@diagrammo/dgmo 0.62.1 → 0.63.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/advanced.d.ts +70 -1
- package/dist/advanced.js +83 -6
- package/dist/auto.js +1 -1
- package/dist/block.js +4 -4
- package/dist/chart-meta.js +2 -2
- package/dist/{chunk-3PVUGECM.js → chunk-AA4M6F2P.js} +2 -2
- package/dist/{chunk-OIK6Y2EJ.js → chunk-L57TSE53.js} +2 -2
- package/dist/{chunk-LFAQ4BLZ.js → chunk-MR2XKW35.js} +2 -2
- package/dist/{chunk-QDPMTFB4.js → chunk-QRHA7WIU.js} +6 -6
- package/dist/{chunk-65QX6LYT.js → chunk-SJGZSPSW.js} +9 -3
- package/dist/{chunk-FVYHDZ6Q.js → chunk-ZXLXAOCM.js} +2 -2
- package/dist/{dgmo-router-Z5N6QLIC.js → dgmo-router-QWRF7ZKM.js} +3 -3
- package/dist/element.js +1 -1
- package/dist/index.js +4 -4
- package/dist/{parser-SRUPRH77.js → parser-5WIZGKNE.js} +2 -2
- package/dist/{renderer-JSFWNV37.js → renderer-5SN6N5VN.js} +3 -3
- package/dist/{renderer-A5GFW2XH.js → renderer-CXAL2FYB.js} +5 -5
- package/fonts/coverage.json +1 -0
- package/package.json +3 -2
package/dist/element.js
CHANGED
|
@@ -21,7 +21,7 @@ poi 39.74 -104.98 as Field clock: America/Denver`},CLOCK_TZ_OVERRIDE:{code:"W_MA
|
|
|
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
22
|
Denver heat: 2`}},S5t=Object.values(to)});function vp(t){return Object.prototype.hasOwnProperty.call(Zk,t.toLowerCase())}function Pe(t,e){if(!t||t.startsWith("#"))return null;let n=t.toLowerCase();if(!vp(n))return null;if(e){let r=e.colors[n];if(r)return r}return Zk[n]??null}function Jk(t){let e=Qk[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(h=>h+h).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",g=1/0;for(let[h,x]of m){let y=Math.abs(f-x);y<g&&(g=y,p=h)}return p}function cV(t){if(/^(#|rgba?\(|hsla?\()/i.test(t))return!0;let e=t.toLowerCase();return Qk[e]!==void 0&&!vp(e)}function tE(t,e){if(!cV(t))return null;let n=Jk(t),r=n?` Nearest: ${n}.`:"";return Rt(e,`Color "${t}" is not a valid DGMO color \u2014 DGMO accepts only these 11 named colors: ${ea.join(", ")} (no hex, no CSS color names).${r}`,"warning",Oy)}function qn(t,e,n,r){let o=Pe(t,r);if(o!==null)return o;if(/^(#|rgba?\(|hsla?\()/i.test(t)){let s=Jk(t),l=s?` Nearest: ${s}.`:"";n.push(Rt(e,`Color "${t}" is not supported \u2014 DGMO does not accept hex or CSS color values. Use a named palette color: ${ea.join(", ")}.${l}`,"error",Oy));return}let a=be(t,ea),i=a?` ${a}`:"";n.push(Rt(e,`Unknown color "${t}". DGMO accepts only these 11 named colors: ${ea.join(", ")} (no hex, no CSS color names).${i}`,"warning",Oy))}var Or,Zk,ea,Zl,Oy,Qk,L5t,Kn=dt(()=>{"use strict";en();Or={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"},Zk={red:Or.nord11,orange:Or.nord12,yellow:Or.nord13,green:Or.nord14,blue:Or.nord10,purple:Or.nord15,teal:Or.nord7,cyan:Or.nord8,gray:Or.nord3,black:Or.nord0,white:Or.nord6},ea=Object.freeze(["red","orange","yellow","green","blue","purple","teal","cyan","gray","black","white"]),Zl=Object.freeze(["red","green","blue","yellow","teal","purple","orange","cyan"]);Oy="E_INVALID_COLOR",Qk=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"});L5t=[Or.nord10,Or.nord14,Or.nord13,Or.nord12,Or.nord15,Or.nord11,Or.nord7,Or.nord8]});function ha(t){let e=new Set;for(let n of dV)t(n)&&e.add(n.token);return e}var dV,eE,nE,rE,oE,aE,iE,sE,lE,cE,dE,uE,fE,N5t,Vs=dt(()=>{"use strict";dV=[{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:"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"}];eE=ha(()=>!0),nE=ha(t=>!!t.infra?.includes("top-level")),rE=ha(t=>!!t.infra?.includes("behavior")),oE=ha(t=>!!t.infra?.includes("edge")),aE=ha(t=>!!t.gantt?.includes("option")),iE=ha(t=>!!t.gantt?.includes("boolean")),sE=ha(t=>t.map===!0),lE=ha(t=>t.category==="directive"&&!t.colonKey&&!t.noHighlight),cE=ha(t=>t.category==="control"&&!t.colonKey&&!t.noHighlight),dE=ha(t=>t.category==="status"&&!t.colonKey&&!t.noHighlight),uE=ha(t=>t.category==="modifier"&&!t.colonKey&&!t.noHighlight),fE=ha(t=>!!t.colonKey),N5t=ha(t=>!!t.noHighlight)});var mE,xf,Lp,wf=dt(()=>{"use strict";mE=[{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}],xf=mE,Lp=mE.map(t=>t.id)});function vr(t){return{keys:new Set(t),tagAliases:new Set}}function Ue(t,e){let n=new Set(e);for(let r of e)n.add(uV(r));return{keys:t.keys,tagAliases:n}}function uV(t){return t.trim().toLowerCase().replace(/[^a-z0-9_-]+/g,"-").replace(/^-+|-+$/g,"")}function Li(t,e){return t.keys.has(e)||t.tagAliases.has(e)}var $y,nd,pE,hE,rd,gE,yE,Gy,qy,Ql,bE,Cp,By,xE,kf,wE,Ef,Sf,kE,Hy,Fy,EE,Wy,zy,Yy,yr=dt(()=>{"use strict";$y=vr(["color","description","role","collapsed","position"]),nd=vr(["color","description","collapsed","icon"]),pE=vr(["heat","size","width","label","style","clock"]),hE=vr(["color","description","role","location","email","phone"]),rd=vr(["color","description","tech","type","collapsed"]),gE=vr(["color","description","domain"]),yE=vr(["color"]),Gy=vr(["color","description","wip","assignee","due","collapsed"]),qy=vr(["color","description","status"]),Ql=vr(["color","description","duration","offset","progress","start","collapsed"]),bE=vr(["color","description","confidence","collapsed"]),Cp=vr(["color","description","heat"]),By=vr([]),xE=vr(["shape","at","collapsed"]),kf=vr(["color","description","duration"]),wE=vr(["color","description","collapsed"]),Ef=vr(["color","description","quadrant","ring","trend"]),Sf=vr(["color","description","width","span"]),kE=vr(["color","description","score","emotion","pain","opportunity","thought"]),Hy=vr(["color","description"]),Fy=vr(["color","description"]),EE=vr(["heat"]),Wy=vr(["color","description"]),zy=vr(["sex","b","d","bp","dp","occupation","military","education","religion","burial"]),Yy=vr(["m"])});function pe(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(!Vy.has(a)){if(n&&r!==void 0){let s=tE(a,r);s&&n.push(s)}return{label:t}}let i;return n&&r!==void 0?i=qn(a,r,n,e):i=Pe(a,e)??void 0,{label:t.substring(0,o).trimEnd(),...i!==void 0&&{color:i}}}function Zn(t){return t["no-legend"]==="on"}function go(t){return t["legend-inline"]==="on"}function Rr(t){switch(t.trim().toLowerCase()){case"fill-solid":return"solid";case"fill-outline":return"outline";case"fill-tint":return"tint";default:return null}}function un(t){if(t["fill-solid"]==="on")return"solid";if(t["fill-outline"]==="on")return"outline"}function fV(t){let e=t.trim().toLowerCase();return Mf.has(e)?e:null}function Qn(t,e){let n=fV(t);if(n){if(jo.has(n))for(let r of jo)delete e[r];return e[n]="on",!0}return!1}function Te(t){let e=t.trim();if(!e||e.startsWith("//"))return null;let n=e.indexOf(" ");if(n===-1){let o=e.toLowerCase();return Us.has(o)?{chartType:o,title:void 0}:null}let r=e.substring(0,n).toLowerCase();return Us.has(r)?{chartType:r,title:e.substring(n+1).trim()||void 0}:null}function Np(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(!mV.test(o))return null;let a=o.toLowerCase();if(e.has(a)||eE.has(a))return null;if(r===-1)return/\d/.test(o)?null:o;let i=n.substring(r+1).trim();return!i||!pV.test(i)?null:o}function $o(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 na(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 mn(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 Xs(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 bs(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 od(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=bs(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=[],g=[],h,x,y="left";for(let b=0;b<a.length;b++){let k=a[b],E=c(k);if(E!==null){let M=k.slice(k.indexOf(" ")+1).trim();y=E,E==="left"?h=M||h:x=M||x;continue}let C=ye(k,r,o,l[b]);f.push(C.label),m.push(C.color),p.push(y),g.push(l[b])}return{series:f.join(", "),names:f,nameColors:m,nameLineNumbers:g,newIndex:s,axes:p,...h!==void 0&&{leftLabel:h},...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 Ci(t){let e=Math.max(t.lastIndexOf(" "),t.lastIndexOf(" "));if(e<0)return{label:t};let n=t.substring(e+1);return Vy.has(n)?{label:t.substring(0,e).trimEnd(),colorName:n}:{label:t}}function Ni(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 ad(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 Vy.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 ME(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 vE(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(SE.test(i)&&Li(n,i.toLowerCase()))return o.start}else if(a<0&&SE.test(o.text)&&Li(n,o.text.toLowerCase())&&t.substring(o.end).replace(/^[ \t]+/,"").startsWith(":"))return o.start}return-1}function Uy(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(Rt(r,Kk(s),"warning",jk.EMPTY_METADATA_VALUE));continue}o[c]=l}return o}function vf(t,e){return vE(t,ME(t),e)}function Ge(t,e,n=new Map,r,o,a,i={}){let s=ME(t),l=vE(t,s,e),c,d;l===-1?(c=t.trim(),d=""):(c=t.substring(0,l).trimEnd(),d=t.substring(l));let u=Ci(c),f=u.label,m;if(i.peelAlias!==!1){let g=f.match(hV);g&&(m=g[1],f=f.substring(0,g.index).trimEnd())}let p=d.length>0?Uy(d,n,o,a):{};return{name:f,meta:p,...u.colorName!==void 0&&{color:u.colorName},...m!==void 0&&{alias:m}}}function We(t,e,n,r){let o=Array.from(e.keys);for(let a of Object.keys(t)){if(Li(e,a))continue;let i=be(a,o);n(`Unknown metadata key "${a}".${i?" "+i:""}`)}if(r){let a=r.match(gV);if(a){let i=a[1].toLowerCase();if(!Li(e,i)){let s=be(i,o);s&&n(`Unknown metadata key "${i}". ${s}`)}}}}var Vy,Us,Wn,Mf,jo,mV,pV,SE,hV,gV,Re=dt(()=>{"use strict";Kn();en();Vs();wf();yr();Vy=new Set(ea),Us=new Set(Lp);Wn=/^([a-z][a-z0-9-]*)\s+(.+)$/i,Mf=new Set(["fill-tint","fill-solid","fill-outline","no-title","no-notes","no-legend","legend-inline"]);jo=new Set(["fill-tint","fill-solid","fill-outline"]);mV=/^[A-Za-z][A-Za-z0-9-]*$/,pV=/^[A-Za-z][A-Za-z\s'&,.\-—–]*$/;SE=/^[A-Za-z][A-Za-z0-9_-]*$/,hV=/\s+as\s+([A-Za-z][A-Za-z0-9_]{0,11})$/;gV=/\b([\w-]+)\s*:/});function Ht(t){return t.trim().toLowerCase().replace(/[^a-z0-9_-]+/g,"-").replace(/^-+|-+$/g,"")}function on(t){return/\bdefault\s*$/.test(t)?{text:t.replace(/\s+default\s*$/,"").trim(),isDefault:!0}:{text:t,isDefault:!1}}function yV(t,e){let n=t.entries,r=new Set,o=!1;for(let s of n)s.color===cn?o=!0:r.add(s.color.toLowerCase());if(!o)return;let a=id.map(s=>({name:s,hex:Pe(s,e)??s})),i=new Set;for(let s=0;s<n.length;s++){let l=n[s];if(l.color!==cn)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 gn(t,e){for(let n of t){for(let r=0;r<n.entries.length;r++){let o=n.entries[r],a=mn(o.value);a!==o.value&&(n.entries[r]={...o,value:a})}n.defaultValue!==void 0&&(n.defaultValue=mn(n.defaultValue)),yV(n,e)}}function bV(t){return/^[A-Za-z][A-Za-z0-9_]{0,11}$/.test(t)}function js(t){return CE.test(t)}function xV(t){if(!CE.test(t))return null;let e=t.replace(/^tag\s+/i,"");if(!e.trim())return null;let n=Xs(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&&bV(n[c+1]))r=n.slice(0,c).map(d=>na(d)).join(" "),o=n[c+1],s=c+2;else{let d=l;if(l<n.length){let u=m=>ea.includes(m),f=n[l].replace(/,$/,"");d=u(f)?l-1:l,d<1&&(d=1)}r=n.slice(0,d).map(u=>na(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);ea.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 Rn(t,e,n,r){if(!n)return;let o=e.find(i=>Ht(i.name)===Ht(n));if(!o)return;let a=t[Ht(o.name)]??(r?void 0:o.defaultValue);return a?o.entries.find(i=>i.value.toLowerCase()===a.toLowerCase())?.color??"#999999":"#999999"}function kr(t,e,n,r){if(e.length===0)return;let o=new Map;for(let a of e)o.set(Ht(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(g=>g.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 In(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"),LE.test(Ht(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&&!LE.test(o.alias)&&r(o.lineNumber,`Tag group alias "${o.alias}" contains invalid characters \u2014 use a single identifier (letters, digits, underscore, hyphen)`)}function Tp(t,e){let n=e.map(o=>Ht(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 ra(t,e,n){let r=[];for(let o of e)o.defaultValue&&r.push({key:Ht(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 sr(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 an(t){return xV(t)}var cn,id,CE,LE,Oe=dt(()=>{"use strict";Re();Kn();cn="",id=Zl;CE=/^tag\s+/i;LE=/^[A-Za-z_][A-Za-z0-9_-]*$/});function Lf(t){let e=t.toLowerCase().replace(/\.$/,""),n=wV.indexOf(e);return n>=0?n+1:(n=kV.indexOf(e.slice(0,3)),n>=0?n+1:0)}function NE(t){let e=[],n=new RegExp(EV.source,"g"),r;for(;(r=n.exec(t))!==null;){let o=r[2]??r[3]??"";if(Lf(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(NV);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 Xy(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 Go(t,e={}){let n=e.dateOrder??"mdy",r=t.match(SV);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(MV);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(vV);if(a&&Lf(a[1])>0){let l=Lf(a[1]),c=parseInt(a[2],10),d=a[3]?parseInt(a[3],10):null,u=Xy(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(LV);if(i&&Lf(i[2])>0){let l=Lf(i[2]),c=parseInt(i[1],10),d=i[3]?parseInt(i[3],10):null,u=Xy(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(CV);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=Xy(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 oa(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 TV(t,e,n,r){return t!==r.y?t-r.y:e!==r.m?e-r.m:n-r.d}function Ap(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:oa(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&&TV(o,t.month,t.day,e.prev)<0&&(o+=1),e.contextYear=o,e.prev={y:o,m:t.month,d:t.day},{internal:oa(t,o),hint:n,error:r}}function Rp(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 jy(t,e={}){let n=t.trim(),r=Go(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 oa(r.token,o)}var wV,kV,EV,SV,MV,vV,LV,CV,NV,Ks=dt(()=>{"use strict";wV=["january","february","march","april","may","june","july","august","september","october","november","december"],kV=["jan","feb","mar","apr","may","jun","jul","aug","sep","oct","nov","dec"];EV=/\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;SV=/^(\d{1,4})(?:-(\d{2})(?:-(\d{2}))?)?\s+(BCE|BC|CE|AD)\b/i,MV=/^(\d{4})(?:-(\d{2})(?:-(\d{2}))?)?/,vV=/^([A-Za-z]{3,9})\.?\s+(\d{1,2})(?:,?\s+(\d{4}))?/,LV=/^(\d{1,2})\s+([A-Za-z]{3,9})\.?(?:\s+(\d{4}))?/,CV=/^(\d{1,2})[/-](\d{1,2})(?:[/-](\d{2,4}))?/,NV=/^[T ](\d{1,2}):(\d{2})(?::(\d{2}))?/});function TE(t,e){let n=Go(t,{dateOrder:e?.order});if(!n)return null;let{token:r,consumed:o}=n;return{date:e?.resolve?e.resolve(r).internal:oa(r,r.year??e?.currentYear??new Date().getFullYear()),rest:t.slice(o),timeValid:!r.invalidTime,invalidTime:r.invalidTime}}function Ip(t,e){let n=TE(t,e);if(!n)return null;let{date:r}=n,{rest:o}=n,a=o.match(AV);if(a){o=o.slice(a[0].length);let s=TE(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 _E(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 RV(t,e,n){let r=_E(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 h=Math.floor(e),x=Math.round((e-h)*30);a.setMonth(a.getMonth()+h),x>0&&a.setDate(a.getDate()+x);break}case"y":{let h=Math.floor(e),x=Math.round((e-h)*12);a.setFullYear(a.getFullYear()+h),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,g=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 h=g?`${u}:${f}:${m}`:`${u}:${f}`;return`${s}${l}-${c}-${d} ${h}`}else return`${s}${l}-${c}-${d}`}function yn(t){let e=_E(t);return e.sign*e.year+(e.month-1)/12+(e.day-1)/365+e.hour/8760+e.minute/525600+e.second/31536e3}function AE(t,e,n,r,o,a,i){let s=[],l=Ip(t,i);if(!l){if(/^\d/.test(t)){let k=t.split(/\s/)[0];if(!/^\d{4}(?:-\d{2}(?:-\d{2})?)?$/.test(k))return s.push(Rt(e,`Expected date format YYYY, YYYY-MM, or YYYY-MM-DD. Got '${k}'.`,"warning")),{event:null,diagnostics:s}}return null}if(!l.startTimeValid&&l.invalidStartTime&&s.push(Rt(e,`Invalid time '${l.invalidStartTime}'. Hours must be 0-23, minutes 0-59.`,"warning")),!l.endTimeValid&&l.invalidEndTime&&s.push(Rt(e,`Invalid time '${l.invalidEndTime}'. Hours must be 0-23, minutes 0-59.`,"warning")),!l.remainder)return s.push(Rt(e,"Event needs a name after the date.","warning")),{event:null,diagnostics:s};let c=a??Ue(kf,new Set([...o.keys(),...o.values()])),d=Ge(l.remainder,c,o);We(d.meta,c,k=>s.push(Rt(e,k,"warning")));let u=d.name,f=l.endDate,m=l.uncertain,p={...d.meta},g=null;if(p.duration){let k=p.duration,E=k.match(/^(.+)\?$/),C=E?E[1]:k;E&&(m=!0);let M=C.match(_V);M?g={amount:parseFloat(M[1]),unit:M[2]}:s.push(Rt(e,`Invalid duration '${k}'. Expected format like "30d", "2w", "1.5m", "1y", "2h", "30min", "45s".`,"warning")),delete p.duration}f&&g&&s.push(Rt(e,"Event has both an end date and duration. End date takes precedence.","warning")),!f&&g&&(f=RV(l.startDate,g.amount,g.unit));let h=u;d.color!==void 0&&(h=`${h} ${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:h,group:n,metadata:y,lineNumber:e,...m?{uncertain:!0}:{}},diagnostics:s}}var _V,AV,Cf=dt(()=>{"use strict";en();Re();yr();Ks();_V=/^(\d+(?:\.\d{1,2})?)(min|[dwmyhs])(\?)?$/,AV=/^\s*(?:->|–>)\s*/});var RE,IE=dt(()=>{"use strict";RE={rotate:"none",max:0,minSize:14,maxSize:80}});function yo(t,e){return IV(t,e)}function IV(t,e){let n={type:null,title:null,titleLineNumber:null,orientation:"horizontal",periods:[],data:[],words:[],cloudOptions:{...RE},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=Rt(G,$);return n.diagnostics.push(A),n.error=qe(A),n},o=(G,$)=>{n.diagnostics.push(Rt(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=Go($,{dateOrder:i});if(A?.token.year!=null){c=A.token.sign*A.token.year;break}}let d=Rp({order:i,directiveYear:l,prescanYear:c,noCurrentYear:s}),u={order:i,resolve:G=>Ap(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(),g=G=>G.year!=null?oa(G,G.year):m==null&&s?null:oa(G,m??p),h=/\s+(red|orange|yellow|green|blue|purple|teal|cyan|gray|black|white)\s*$/,x=G=>{let $=G.match(h);return $?{label:G.slice(0,$.index).trim(),color:$[1].toLowerCase()}:{label:G.trim(),color:null}},y=G=>{let $=Go(G,{dateOrder:i});if(!$||$.consumed===0||$.token.invalidTime)return null;let A=g($.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},k=[],E=null,C=null,M={},_=null,I=!1,L=0,w=!1,v=0,S=!1,T=new Map,N=new Set(["slope","wordcloud","arc","timeline","venn","quadrant","sequence"]),R=!1;for(let G=0;G<a.length;G++){let $=a[G],A=$.trim(),D=pe($),O=G+1;if(!A||A.startsWith("//"))continue;if(!R){R=!0;let B=Te(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=an(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}=on(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}=Ci(" "+V);if(Y&&U.trim()==="")X=qn(Y,O,n.diagnostics,e)??null;else{let K=Ue(kf,new Set([...T.keys(),...T.values()])),et=Ge(V,K,T);et.color&&(X=qn(et.color,O,n.diagnostics,e)??null),z={...et.meta},z.color&&(X=qn(z.color,O,n.diagnostics,e)??null,delete z.color)}}n.timelineGroups.push({name:q,color:X,metadata:z,lineNumber:O}),C=q,M=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]?qn(P[2].trim(),O,n.diagnostics,e)??null:null;n.arcNodeGroups.push({name:B,nodes:[],color:q,lineNumber:O}),E=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(Rt(O,`'## ${B}' is no longer supported. Use '[${B}]' instead`,"warning"));continue}if(D===0&&(E=null,C=null,M={}),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(Rt(O,`Trailing colon is not valid in arc edges \u2014 write '${q.replace(/:$/,"")} -> ${V.replace(/:$/,"")}' instead`));continue}let X=B[3]?qn(B[3].trim(),O,n.diagnostics,e)??null:null,z=B[4]?parseFloat($o(B[4])??B[4]):1;if(z<0){n.diagnostics.push(oe(ni,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}),E!==null){let U=n.arcNodeGroups.find(Y=>Y.name===E);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"&&I)if(D<=L)I=!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?qn(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"&&w)if(D<=v)w=!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?qn(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"){I=!0,L=D;continue}if(A.toLowerCase()==="marker"){w=!0,v=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?qn(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?qn(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=Ue(kf,new Set([...T.keys(),...T.values()])),q=AE(A,O,C,M,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}=Ci(A),V=null;q&&(V=qn(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=bs(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=bs(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}=Ci(Y),nt=et?qn(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($o(z[2])??z[2]),et=parseFloat($o(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(oe(Kl,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=Rr(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=$o(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}=Ci(U),et=K?qn(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}R&&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(oe(Kl,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?qn(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($o(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(oe(ni,O,{value:V,label:A.substring(0,B).trim(),channel:"wordcloud weights"})):k.push(A)}else k.push(A);continue}R&&o(O,`Unexpected line: '${A}'.`)}if(!n.type){let G=[...N],$=a.find(O=>O.trim()&&!O.trim().startsWith("//"))?.trim()??"",A=be($.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&&k.length>0&&(n.words=DV(k.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){kr(n.timelineEvents,n.timelineTagGroups,(G,$)=>n.diagnostics.push(Rt(G,$,"warning")),be),In(n.timelineTagGroups,(G,$)=>n.diagnostics.push(Rt(G,$,"warning")),(G,$)=>{let A=Rt(G,$);n.diagnostics.push(A),n.error||(n.error=qe(A))});for(let G of n.timelineTagGroups){if(!G.defaultValue)continue;let $=Ht(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(Rt(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=qe(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 DV(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||PV.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 PV,xs=dt(()=>{"use strict";Kn();en();Re();yr();Oe();Cf();Ks();IE();PV=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 $V(t){return t.replace(/(\s[\w:.-]+=")([^"]*)"/g,(e,n,r)=>!r.includes("<")&&!r.includes(">")&&!r.includes("&")?e:`${n}${r.replace(OV,"&").replace(/</g,"<").replace(/>/g,">")}"`)}function $r(t){return $V(t.outerHTML)}var OV,ri=dt(()=>{"use strict";OV=/&(?![a-zA-Z][a-zA-Z0-9]*;|#\d+;|#[xX][0-9a-fA-F]+;)/g});var Pp,Ky,Zy=dt(()=>{"use strict";Pp="http://www.w3.org/1999/xhtml",Ky={svg:"http://www.w3.org/2000/svg",xhtml:Pp,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"}});function Dp(t){var e=t+="",n=e.indexOf(":");return n>=0&&(e=t.slice(0,n))!=="xmlns"&&(t=t.slice(n+1)),Ky.hasOwnProperty(e)?{space:Ky[e],local:t}:t}var Qy=dt(()=>{"use strict";Zy()});function GV(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===Pp&&e.documentElement.namespaceURI===Pp?e.createElement(t):e.createElementNS(n,t)}}function qV(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function Op(t){var e=Dp(t);return(e.local?qV:GV)(e)}var Jy=dt(()=>{"use strict";Qy();Zy()});function BV(){}function $p(t){return t==null?BV:function(){return this.querySelector(t)}}var tb=dt(()=>{"use strict"});function PE(t){typeof t!="function"&&(t=$p(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 zr(r,this._parents)}var DE=dt(()=>{"use strict";Ti();tb()});function eb(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}var OE=dt(()=>{"use strict"});function HV(){return[]}function $E(t){return t==null?HV:function(){return this.querySelectorAll(t)}}var GE=dt(()=>{"use strict"});function FV(t){return function(){return eb(t.apply(this,arguments))}}function qE(t){typeof t=="function"?t=FV(t):t=$E(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 zr(r,o)}var BE=dt(()=>{"use strict";Ti();OE();GE()});function HE(t){return function(){return this.matches(t)}}function Gp(t){return function(e){return e.matches(t)}}var qp=dt(()=>{"use strict"});function zV(t){return function(){return WV.call(this.children,t)}}function YV(){return this.firstElementChild}function FE(t){return this.select(t==null?YV:zV(typeof t=="function"?t:Gp(t)))}var WV,WE=dt(()=>{"use strict";qp();WV=Array.prototype.find});function UV(){return Array.from(this.children)}function XV(t){return function(){return VV.call(this.children,t)}}function zE(t){return this.selectAll(t==null?UV:XV(typeof t=="function"?t:Gp(t)))}var VV,YE=dt(()=>{"use strict";qp();VV=Array.prototype.filter});function VE(t){typeof t!="function"&&(t=HE(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 zr(r,this._parents)}var UE=dt(()=>{"use strict";Ti();qp()});function Bp(t){return new Array(t.length)}var nb=dt(()=>{"use strict"});function XE(){return new zr(this._enter||this._groups.map(Bp),this._parents)}function Nf(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}var rb=dt(()=>{"use strict";nb();Ti();Nf.prototype={constructor:Nf,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 jE(t){return function(){return t}}var KE=dt(()=>{"use strict"});function jV(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 Nf(t,a[i]);for(;i<l;++i)(s=e[i])&&(o[i]=s)}function KV(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 Nf(t,a[s]);for(s=0;s<d;++s)(l=e[s])&&c.get(f[s])===l&&(o[s]=l)}function ZV(t){return t.__data__}function ZE(t,e){if(!arguments.length)return Array.from(this,ZV);var n=e?KV:jV,r=this._parents,o=this._groups;typeof t!="function"&&(t=jE(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=QV(t.call(d,d&&d.__data__,c,r)),p=m.length,g=s[c]=new Array(p),h=i[c]=new Array(p),x=l[c]=new Array(f);n(d,u,g,h,x,m,e);for(var y=0,b=0,k,E;y<p;++y)if(k=g[y]){for(y>=b&&(b=y+1);!(E=h[b])&&++b<p;);k._next=E||null}}return i=new zr(i,r),i._enter=s,i._exit=l,i}function QV(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}var QE=dt(()=>{"use strict";Ti();rb();KE()});function JE(){return new zr(this._exit||this._groups.map(Bp),this._parents)}var tS=dt(()=>{"use strict";nb();Ti()});function eS(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 nS=dt(()=>{"use strict"});function rS(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 zr(s,this._parents)}var oS=dt(()=>{"use strict";Ti()});function aS(){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 iS=dt(()=>{"use strict"});function sS(t){t||(t=JV);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 zr(o,this._parents).order()}function JV(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}var lS=dt(()=>{"use strict";Ti()});function cS(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}var dS=dt(()=>{"use strict"});function uS(){return Array.from(this)}var fS=dt(()=>{"use strict"});function mS(){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 pS=dt(()=>{"use strict"});function hS(){let t=0;for(let e of this)++t;return t}var gS=dt(()=>{"use strict"});function yS(){return!this.node()}var bS=dt(()=>{"use strict"});function xS(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 wS=dt(()=>{"use strict"});function tU(t){return function(){this.removeAttribute(t)}}function eU(t){return function(){this.removeAttributeNS(t.space,t.local)}}function nU(t,e){return function(){this.setAttribute(t,e)}}function rU(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function oU(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttribute(t):this.setAttribute(t,n)}}function aU(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 kS(t,e){var n=Dp(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?eU:tU:typeof e=="function"?n.local?aU:oU:n.local?rU:nU)(n,e))}var ES=dt(()=>{"use strict";Qy()});function Hp(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}var ob=dt(()=>{"use strict"});function iU(t){return function(){this.style.removeProperty(t)}}function sU(t,e,n){return function(){this.style.setProperty(t,e,n)}}function lU(t,e,n){return function(){var r=e.apply(this,arguments);r==null?this.style.removeProperty(t):this.style.setProperty(t,r,n)}}function SS(t,e,n){return arguments.length>1?this.each((e==null?iU:typeof e=="function"?lU:sU)(t,e,n??"")):cU(this.node(),t)}function cU(t,e){return t.style.getPropertyValue(e)||Hp(t).getComputedStyle(t,null).getPropertyValue(e)}var MS=dt(()=>{"use strict";ob()});function dU(t){return function(){delete this[t]}}function uU(t,e){return function(){this[t]=e}}function fU(t,e){return function(){var n=e.apply(this,arguments);n==null?delete this[t]:this[t]=n}}function vS(t,e){return arguments.length>1?this.each((e==null?dU:typeof e=="function"?fU:uU)(t,e)):this.node()[t]}var LS=dt(()=>{"use strict"});function CS(t){return t.trim().split(/^|\s+/)}function ab(t){return t.classList||new NS(t)}function NS(t){this._node=t,this._names=CS(t.getAttribute("class")||"")}function TS(t,e){for(var n=ab(t),r=-1,o=e.length;++r<o;)n.add(e[r])}function _S(t,e){for(var n=ab(t),r=-1,o=e.length;++r<o;)n.remove(e[r])}function mU(t){return function(){TS(this,t)}}function pU(t){return function(){_S(this,t)}}function hU(t,e){return function(){(e.apply(this,arguments)?TS:_S)(this,t)}}function AS(t,e){var n=CS(t+"");if(arguments.length<2){for(var r=ab(this.node()),o=-1,a=n.length;++o<a;)if(!r.contains(n[o]))return!1;return!0}return this.each((typeof e=="function"?hU:e?mU:pU)(n,e))}var RS=dt(()=>{"use strict";NS.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 gU(){this.textContent=""}function yU(t){return function(){this.textContent=t}}function bU(t){return function(){var e=t.apply(this,arguments);this.textContent=e??""}}function IS(t){return arguments.length?this.each(t==null?gU:(typeof t=="function"?bU:yU)(t)):this.node().textContent}var PS=dt(()=>{"use strict"});function xU(){this.innerHTML=""}function wU(t){return function(){this.innerHTML=t}}function kU(t){return function(){var e=t.apply(this,arguments);this.innerHTML=e??""}}function DS(t){return arguments.length?this.each(t==null?xU:(typeof t=="function"?kU:wU)(t)):this.node().innerHTML}var OS=dt(()=>{"use strict"});function EU(){this.nextSibling&&this.parentNode.appendChild(this)}function $S(){return this.each(EU)}var GS=dt(()=>{"use strict"});function SU(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function qS(){return this.each(SU)}var BS=dt(()=>{"use strict"});function HS(t){var e=typeof t=="function"?t:Op(t);return this.select(function(){return this.appendChild(e.apply(this,arguments))})}var FS=dt(()=>{"use strict";Jy()});function MU(){return null}function WS(t,e){var n=typeof t=="function"?t:Op(t),r=e==null?MU:typeof e=="function"?e:$p(e);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}var zS=dt(()=>{"use strict";Jy();tb()});function vU(){var t=this.parentNode;t&&t.removeChild(this)}function YS(){return this.each(vU)}var VS=dt(()=>{"use strict"});function LU(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function CU(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function US(t){return this.select(t?CU:LU)}var XS=dt(()=>{"use strict"});function jS(t){return arguments.length?this.property("__data__",t):this.node().__data__}var KS=dt(()=>{"use strict"});function NU(t){return function(e){t.call(this,e,this.__data__)}}function TU(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 _U(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 AU(t,e,n){return function(){var r=this.__on,o,a=NU(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 ZS(t,e,n){var r=TU(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?AU:_U,o=0;o<a;++o)this.each(s(r[o],e,n));return this}var QS=dt(()=>{"use strict"});function JS(t,e,n){var r=Hp(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 RU(t,e){return function(){return JS(this,t,e)}}function IU(t,e){return function(){return JS(this,t,e.apply(this,arguments))}}function tM(t,e){return this.each((typeof e=="function"?IU:RU)(t,e))}var eM=dt(()=>{"use strict";ob()});function*nM(){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 rM=dt(()=>{"use strict"});function zr(t,e){this._groups=t,this._parents=e}function PU(){return new zr([[document.documentElement]],ib)}function DU(){return this}var ib,Ti=dt(()=>{"use strict";DE();BE();WE();YE();UE();QE();rb();tS();nS();oS();iS();lS();dS();fS();pS();gS();bS();wS();ES();MS();LS();RS();PS();OS();GS();BS();FS();zS();VS();XS();KS();QS();eM();rM();ib=[null];zr.prototype=PU.prototype={constructor:zr,select:PE,selectAll:qE,selectChild:FE,selectChildren:zE,filter:VE,data:ZE,enter:XE,exit:JE,join:eS,merge:rS,selection:DU,order:aS,sort:sS,call:cS,nodes:uS,node:mS,size:hS,empty:yS,each:xS,attr:kS,style:SS,property:vS,classed:AS,text:IS,html:DS,raise:$S,lower:qS,append:HS,insert:WS,remove:YS,clone:US,datum:jS,on:ZS,dispatch:tM,[Symbol.iterator]:nM}});function It(t){return typeof t=="string"?new zr([[document.querySelector(t)]],[document.documentElement]):new zr([[t]],ib)}var oM=dt(()=>{"use strict";Ti()});var Cn=dt(()=>{"use strict";oM()});var Mt,Ke=dt(()=>{"use strict";Mt="Inter, system-ui, Avenir, Helvetica, Arial, sans-serif"});function Fp(t){return/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/.test(t)}function aM(t,e,n){for(let r of $U){let o=t[r];if(typeof o!="string"||!Fp(o))throw new Error(`Palette "${n}" ${e}.${r}: invalid hex "${o}"`)}for(let r of OU){let o=t.colors[r];if(typeof o!="string"||!Fp(o))throw new Error(`Palette "${n}" ${e}.colors.${r}: invalid hex "${o}"`)}}function qo(t){aM(t.light,"light",t.id),aM(t.dark,"dark",t.id),sd.set(t.id,t)}function Wp(t){return sd.get(t)??sd.get(sb)}function lb(t,e){let n=sd.get(t);return n||(e?.(`Palette "${t}" is not registered \u2014 falling back to "${sb}".`),sd.get(sb))}function iM(){return Array.from(sd.values()).sort((t,e)=>t.name.localeCompare(e.name))}var sd,sb,OU,$U,_i=dt(()=>{"use strict";sd=new Map,sb="slate";OU=["red","orange","yellow","green","blue","purple","teal","cyan","gray"],$U=["bg","surface","overlay","border","text","textMuted","primary","secondary","accent","destructive"]});function Jl(t){let e=zp.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 zp.size>=GU&&zp.clear(),zp.set(t,d),{...d}}function tc(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 g=p;return g<0&&(g+=1),g>1&&(g-=1),g<1/6?f+(m-f)*6*g:g<1/2?m:g<2/3?f+(m-f)*(2/3-g)*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 lM(t){let{h:e,s:n,l:r}=Jl(t);return`${e} ${n}% ${r}%`}function cM(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 dM(t,e,n){let r=m=>{let p=m.replace("#",""),g=p.length===3?[...p].map(h=>h+h).join(""):p;return[parseInt(g.substring(0,2),16),parseInt(g.substring(2,4),16),parseInt(g.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=Yp.get(r);if(o!==void 0)return o;let a=g=>{let h=g.replace("#",""),x=h.length===3?[...h].map(y=>y+y).join(""):h;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=(g,h)=>Math.round(g*f+h*(1-f)).toString(16).padStart(2,"0"),p=`#${m(i,c)}${m(s,d)}${m(l,u)}`;return Yp.size>=qU&&Yp.clear(),Yp.set(r,p),p}function Vp(t,e,n,r){let o=Math.max(0,Math.min(1,n));return vt(e,t,o*100)}function uM(t,e,n){return[{offset:0,color:t},{offset:1,color:e}]}function Ai(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 Ri(t,e){let n=Ai(t),r=Ai(e),o=Math.max(n,r),a=Math.min(n,r);return(o+.05)/(a+.05)}function ge(t,e,n){if(Ai(t)>.55)return n;let o=t.replace("#",""),a=o.length===3?[...o].map(d=>d+d).join(""):o,i=parseInt(a.substring(0,2),16),s=parseInt(a.substring(2,4),16),l=parseInt(a.substring(4,6),16);return Math.min(i,s,l)>=100&&Ri(t,n)>Ri(t,e)?n:e}function De(t,e){return e?t.surface:t.bg}function ee(t,e,n,r){return r?.mode==="solid"?e:r?.mode==="outline"?De(t,n):vt(e,De(t,n),25)}function On(t){let e=t.colors;return Zl.map(n=>e[n])}function ld(t,e){if(e<=0)return[];let n=[...new Set(On(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 fM(t,e,n){if(e<=0)return[];let r=De(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?sM.dark:sM.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 zp,GU,Yp,qU,sM,He=dt(()=>{"use strict";Kn();zp=new Map,GU=5e3;Yp=new Map,qU=5e3;sM={light:[32,48,64,80],dark:[44,58,72,86]}});var Tf,cb=dt(()=>{"use strict";_i();Tf={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"}}};qo(Tf)});var _f,db=dt(()=>{"use strict";_i();_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"}}};qo(_f)});var Af,ub=dt(()=>{"use strict";_i();Af={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"}}};qo(Af)});var Rf,fb=dt(()=>{"use strict";_i();Rf={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"}}};qo(Rf)});var If,mb=dt(()=>{"use strict";_i();If={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"}}};qo(If)});var Pf,pb=dt(()=>{"use strict";_i();Pf={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"}}};qo(Pf)});var Df,hb=dt(()=>{"use strict";_i();Df={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"}}};qo(Df)});var gb={};de(gb,{atlasPalette:()=>Tf,blueprintPalette:()=>_f,catppuccinPalette:()=>Af,contrastText:()=>ge,getAvailablePalettes:()=>iM,getPalette:()=>Wp,getSegmentColors:()=>ld,getSeriesColors:()=>On,hexToHSL:()=>Jl,hexToHSLString:()=>lM,hslToHex:()=>tc,isValidHex:()=>Fp,nordPalette:()=>Rf,palettes:()=>BU,registerPalette:()=>qo,resolvePaletteOrFallback:()=>lb,shade:()=>dM,shapeFill:()=>ee,slatePalette:()=>If,themeBaseBg:()=>De,tidewaterPalette:()=>Pf,tint:()=>cM,tokyoNightPalette:()=>Df});var BU,oi=dt(()=>{"use strict";_i();He();cb();db();ub();fb();mb();pb();hb();cb();db();ub();fb();mb();pb();hb();BU={atlas:Tf,blueprint:_f,slate:If,tidewater:Pf,nord:Rf,catppuccin:Af,tokyoNight:Df}});function eo(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 ai(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=On(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 Up(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 aa(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 Zs(t){t.style.display="none"}async function bn(t,e){if(e)return e;let{getPalette:n}=await Promise.resolve().then(()=>(oi(),gb));return t==="dark"?n("nord").dark:n("nord").light}function Bn(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 kn(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=$r(r);return document.body.removeChild(t),o}var Xp,jp,Ii=dt(()=>{"use strict";ri();Cn();Ke();oi();Xp=1200,jp=800});function ec(t,e){return t==null||e==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}var yb=dt(()=>{"use strict"});function bb(t,e){return t==null||e==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}var mM=dt(()=>{"use strict"});function Kp(t){let e,n,r;t.length!==2?(e=ec,n=(s,l)=>ec(t(s),l),r=(s,l)=>t(s)-l):(e=t===ec||t===bb?t:HU,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 HU(){return 0}var pM=dt(()=>{"use strict";yb();mM()});function xb(t){return t===null?NaN:+t}var hM=dt(()=>{"use strict"});var gM,yM,FU,WU,wb,bM=dt(()=>{"use strict";yb();pM();hM();gM=Kp(ec),yM=gM.right,FU=gM.left,WU=Kp(xb).center,wb=yM});function cd(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 xM=dt(()=>{"use strict"});var no,wM=dt(()=>{"use strict";no=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 kM({_intern:t,_key:e},n){let r=e(n);return t.has(r)?t.get(r):n}function zU({_intern:t,_key:e},n){let r=e(n);return t.has(r)?t.get(r):(t.set(r,n),n)}function YU({_intern:t,_key:e},n){let r=e(n);return t.has(r)&&(n=t.get(r),t.delete(r)),n}function VU(t){return t!==null&&typeof t=="object"?t.valueOf():t}var dd,EM=dt(()=>{"use strict";dd=class extends Map{constructor(e,n=VU){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(kM(this,e))}has(e){return super.has(kM(this,e))}set(e,n){return super.set(zU(this,e),n)}delete(e){return super.delete(YU(this,e))}}});function Zp(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>=UU?10:a>=XU?5:a>=jU?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?Zp(t,e,n*2):[s,l,c]}function Qp(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?Zp(e,t,n):Zp(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 Of(t,e,n){return e=+e,t=+t,n=+n,Zp(t,e,n)[2]}function kb(t,e,n){e=+e,t=+t,n=+n;let r=e<t,o=r?Of(e,t,n):Of(t,e,n);return(r?-1:1)*(o<0?1/-o:o)}var UU,XU,jU,SM=dt(()=>{"use strict";UU=Math.sqrt(50),XU=Math.sqrt(10),jU=Math.sqrt(2)});function ud(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 MM=dt(()=>{"use strict"});function fd(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 vM=dt(()=>{"use strict"});function*KU(t){for(let e of t)yield*e}function md(t){return Array.from(KU(t))}var LM=dt(()=>{"use strict"});function Jp(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 CM=dt(()=>{"use strict"});var Bo=dt(()=>{"use strict";bM();xM();wM();MM();LM();vM();CM();SM();EM()});function Qs(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t);break}return this}var $f=dt(()=>{"use strict"});function th(){var t=new dd,e=[],n=[],r=TM;function o(a){let i=t.get(a);if(i===void 0){if(r!==TM)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 dd;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 th(e,n).unknown(r)},Qs.apply(o,arguments),o}var TM,_M=dt(()=>{"use strict";Bo();$f();TM=Symbol("implicit")});function nc(){var t=th().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,g=m?r:o;a=(g-p)/Math.max(1,f-l+c*2),s&&(a=Math.floor(a)),p+=(g-p-a*(f-l))*d,i=a*(1-l),s&&(p=Math.round(p),i=Math.round(i));var h=Jp(f).map(function(x){return p+a*x});return n(m?h.reverse():h)}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 nc(e(),[r,o]).round(s).paddingInner(l).paddingOuter(c).align(d)},Qs.apply(u(),arguments)}function AM(t){var e=t.copy;return t.padding=t.paddingOuter,delete t.paddingInner,delete t.paddingOuter,t.copy=function(){return AM(e())},t}function Js(){return AM(nc.apply(null,arguments).paddingInner(1))}var RM=dt(()=>{"use strict";Bo();$f();_M()});function eh(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function Eb(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}var IM=dt(()=>{"use strict"});function Bf(){}function DM(){return this.rgb().formatHex()}function oX(){return this.rgb().formatHex8()}function aX(){return FM(this).formatHsl()}function OM(){return this.rgb().formatRgb()}function tl(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=ZU.exec(t))?(n=e[1].length,e=parseInt(e[1],16),n===6?$M(e):n===3?new ia(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):n===8?nh(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):n===4?nh(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=QU.exec(t))?new ia(e[1],e[2],e[3],1):(e=JU.exec(t))?new ia(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=tX.exec(t))?nh(e[1],e[2],e[3],e[4]):(e=eX.exec(t))?nh(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=nX.exec(t))?BM(e[1],e[2]/100,e[3]/100,1):(e=rX.exec(t))?BM(e[1],e[2]/100,e[3]/100,e[4]):PM.hasOwnProperty(t)?$M(PM[t]):t==="transparent"?new ia(NaN,NaN,NaN,0):null}function $M(t){return new ia(t>>16&255,t>>8&255,t&255,1)}function nh(t,e,n,r){return r<=0&&(t=e=n=NaN),new ia(t,e,n,r)}function iX(t){return t instanceof Bf||(t=tl(t)),t?(t=t.rgb(),new ia(t.r,t.g,t.b,t.opacity)):new ia}function hd(t,e,n,r){return arguments.length===1?iX(t):new ia(t,e,n,r??1)}function ia(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function GM(){return`#${rc(this.r)}${rc(this.g)}${rc(this.b)}`}function sX(){return`#${rc(this.r)}${rc(this.g)}${rc(this.b)}${rc((isNaN(this.opacity)?1:this.opacity)*255)}`}function qM(){let t=ah(this.opacity);return`${t===1?"rgb(":"rgba("}${oc(this.r)}, ${oc(this.g)}, ${oc(this.b)}${t===1?")":`, ${t})`}`}function ah(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function oc(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function rc(t){return t=oc(t),(t<16?"0":"")+t.toString(16)}function BM(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new ii(t,e,n,r)}function FM(t){if(t instanceof ii)return new ii(t.h,t.s,t.l,t.opacity);if(t instanceof Bf||(t=tl(t)),!t)return new ii;if(t instanceof ii)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 ii(i,s,l,t.opacity)}function WM(t,e,n,r){return arguments.length===1?FM(t):new ii(t,e,n,r??1)}function ii(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function HM(t){return t=(t||0)%360,t<0?t+360:t}function rh(t){return Math.max(0,Math.min(1,t||0))}function Sb(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 Gf,oh,pd,qf,Pi,ZU,QU,JU,tX,eX,nX,rX,PM,zM=dt(()=>{"use strict";IM();Gf=.7,oh=1/Gf,pd="\\s*([+-]?\\d+)\\s*",qf="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Pi="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",ZU=/^#([0-9a-f]{3,8})$/,QU=new RegExp(`^rgb\\(${pd},${pd},${pd}\\)$`),JU=new RegExp(`^rgb\\(${Pi},${Pi},${Pi}\\)$`),tX=new RegExp(`^rgba\\(${pd},${pd},${pd},${qf}\\)$`),eX=new RegExp(`^rgba\\(${Pi},${Pi},${Pi},${qf}\\)$`),nX=new RegExp(`^hsl\\(${qf},${Pi},${Pi}\\)$`),rX=new RegExp(`^hsla\\(${qf},${Pi},${Pi},${qf}\\)$`),PM={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};eh(Bf,tl,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:DM,formatHex:DM,formatHex8:oX,formatHsl:aX,formatRgb:OM,toString:OM});eh(ia,hd,Eb(Bf,{brighter(t){return t=t==null?oh:Math.pow(oh,t),new ia(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?Gf:Math.pow(Gf,t),new ia(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new ia(oc(this.r),oc(this.g),oc(this.b),ah(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:GM,formatHex:GM,formatHex8:sX,formatRgb:qM,toString:qM}));eh(ii,WM,Eb(Bf,{brighter(t){return t=t==null?oh:Math.pow(oh,t),new ii(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?Gf:Math.pow(Gf,t),new ii(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 ia(Sb(t>=240?t-240:t+120,o,r),Sb(t,o,r),Sb(t<120?t+240:t-120,o,r),this.opacity)},clamp(){return new ii(HM(this.h),rh(this.s),rh(this.l),ah(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=ah(this.opacity);return`${t===1?"hsl(":"hsla("}${HM(this.h)}, ${rh(this.s)*100}%, ${rh(this.l)*100}%${t===1?")":`, ${t})`}`}}))});var Mb=dt(()=>{"use strict";zM()});function vb(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 YM(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 vb((n-r/e)*e,i,o,a,s)}}var Lb=dt(()=>{"use strict"});function VM(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 vb((n-r/e)*e,o,a,i,s)}}var UM=dt(()=>{"use strict";Lb()});var Hf,Cb=dt(()=>{"use strict";Hf=t=>()=>t});function lX(t,e){return function(n){return t+n*e}}function cX(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 XM(t){return(t=+t)==1?ih:function(e,n){return n-e?cX(e,n,t):Hf(isNaN(e)?n:e)}}function ih(t,e){var n=e-t;return n?lX(t,n):Hf(isNaN(t)?e:t)}var jM=dt(()=>{"use strict";Cb()});function KM(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=hd(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 Nb,F8t,W8t,ZM=dt(()=>{"use strict";Mb();Lb();UM();jM();Nb=(function t(e){var n=XM(e);function r(o,a){var i=n((o=hd(o)).r,(a=hd(a)).r),s=n(o.g,a.g),l=n(o.b,a.b),c=ih(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);F8t=KM(YM),W8t=KM(VM)});function QM(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 JM(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}var tv=dt(()=>{"use strict"});function ev(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]=ac(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 nv=dt(()=>{"use strict";sh()});function rv(t,e){var n=new Date;return t=+t,e=+e,function(r){return n.setTime(t*(1-r)+e*r),n}}var ov=dt(()=>{"use strict"});function el(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}}var lh=dt(()=>{"use strict"});function av(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]=ac(t[o],e[o]):r[o]=e[o];return function(a){for(o in n)r[o]=n[o](a);return r}}var iv=dt(()=>{"use strict";sh()});function dX(t){return function(){return t}}function uX(t){return function(e){return t(e)+""}}function sv(t,e){var n=_b.lastIndex=Tb.lastIndex=0,r,o,a,i=-1,s=[],l=[];for(t=t+"",e=e+"";(r=_b.exec(t))&&(o=Tb.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:el(r,o)})),n=Tb.lastIndex;return n<e.length&&(a=e.slice(n),s[i]?s[i]+=a:s[++i]=a),s.length<2?l[0]?uX(l[0].x):dX(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 _b,Tb,lv=dt(()=>{"use strict";lh();_b=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Tb=new RegExp(_b.source,"g")});function ac(t,e){var n=typeof e,r;return e==null||n==="boolean"?Hf(e):(n==="number"?el:n==="string"?(r=tl(e))?(e=r,Nb):sv:e instanceof tl?Nb:e instanceof Date?rv:JM(e)?QM:Array.isArray(e)?ev:typeof e.valueOf!="function"&&typeof e.toString!="function"||isNaN(e)?av:el)(t,e)}var sh=dt(()=>{"use strict";Mb();ZM();nv();ov();lh();iv();lv();Cb();tv()});function Ab(t,e){return t=+t,e=+e,function(n){return Math.round(t*(1-n)+e*n)}}var cv=dt(()=>{"use strict"});var dv=dt(()=>{"use strict";sh();lh();cv()});function Rb(t){return function(){return t}}var uv=dt(()=>{"use strict"});function Ib(t){return+t}var fv=dt(()=>{"use strict"});function si(t){return t}function Pb(t,e){return(e-=t=+t)?function(n){return(n-t)/e}:Rb(isNaN(e)?NaN:.5)}function fX(t,e){var n;return t>e&&(n=t,t=e,e=n),function(r){return Math.max(t,Math.min(e,r))}}function mX(t,e,n){var r=t[0],o=t[1],a=e[0],i=e[1];return o<r?(r=Pb(o,r),a=n(i,a)):(r=Pb(r,o),a=n(a,i)),function(s){return a(r(s))}}function pX(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]=Pb(t[i],t[i+1]),a[i]=n(e[i],e[i+1]);return function(s){var l=wb(t,s,1,r)-1;return a[l](o[l](s))}}function ch(t,e){return e.domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown())}function Db(){var t=mv,e=mv,n=ac,r,o,a,i=si,s,l,c;function d(){var f=Math.min(t.length,e.length);return i!==si&&(i=fX(t[0],t[f-1])),s=f>2?pX:mX,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),el)))(f)))},u.domain=function(f){return arguments.length?(t=Array.from(f,Ib),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=Ab,d()},u.clamp=function(f){return arguments.length?(i=f?!0:si,d()):i!==si},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 Ob(){return Db()(si,si)}var mv,$b=dt(()=>{"use strict";Bo();dv();uv();fv();mv=[0,1]});function pv(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)}function ic(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 Ff=dt(()=>{"use strict"});function Di(t){return t=ic(Math.abs(t)),t?t[1]:NaN}var Wf=dt(()=>{"use strict";Ff()});function hv(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 gv=dt(()=>{"use strict"});function yv(t){return function(e){return e.replace(/[0-9]/g,function(n){return t[+n]})}}var bv=dt(()=>{"use strict"});function nl(t){if(!(e=hX.exec(t)))throw new Error("invalid format: "+t);var e;return new dh({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 dh(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 hX,Gb=dt(()=>{"use strict";hX=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;nl.prototype=dh.prototype;dh.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 xv(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 wv=dt(()=>{"use strict"});function kv(t,e){var n=ic(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")+ic(t,Math.max(0,e+a-1))[0]}var zf,qb=dt(()=>{"use strict";Ff()});function Bb(t,e){var n=ic(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 Ev=dt(()=>{"use strict";Ff()});var Hb,Sv=dt(()=>{"use strict";Ff();qb();Ev();Hb={"%":(t,e)=>(t*100).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:pv,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)=>Bb(t*100,e),r:Bb,s:kv,X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)}});function Fb(t){return t}var Mv=dt(()=>{"use strict"});function Cv(t){var e=t.grouping===void 0||t.thousands===void 0?Fb:hv(vv.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?Fb:yv(vv.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=nl(u);var m=u.fill,p=u.align,g=u.sign,h=u.symbol,x=u.zero,y=u.width,b=u.comma,k=u.precision,E=u.trim,C=u.type;C==="n"?(b=!0,C="g"):Hb[C]||(k===void 0&&(k=12),E=!0,C="g"),(x||m==="0"&&p==="=")&&(x=!0,m="0",p="=");var M=(f&&f.prefix!==void 0?f.prefix:"")+(h==="$"?n:h==="#"&&/[boxX]/.test(C)?"0"+C.toLowerCase():""),_=(h==="$"?r:/[%p]/.test(C)?i:"")+(f&&f.suffix!==void 0?f.suffix:""),I=Hb[C],L=/[defgprs%]/.test(C);k=k===void 0?6:/[gprs]/.test(C)?Math.max(1,Math.min(21,k)):Math.max(0,Math.min(20,k));function w(v){var S=M,T=_,N,R,G;if(C==="c")T=I(v)+T,v="";else{v=+v;var $=v<0||1/v<0;if(v=isNaN(v)?l:I(Math.abs(v),k),E&&(v=xv(v)),$&&+v==0&&g!=="+"&&($=!1),S=($?g==="("?g:s:g==="-"||g==="("?"":g)+S,T=(C==="s"&&!isNaN(v)&&zf!==void 0?Lv[8+zf/3]:"")+T+($&&g==="("?")":""),L){for(N=-1,R=v.length;++N<R;)if(G=v.charCodeAt(N),48>G||G>57){T=(G===46?o+v.slice(N+1):v.slice(N))+T,v=v.slice(0,N);break}}}b&&!x&&(v=e(v,1/0));var A=S.length+v.length+T.length,D=A<y?new Array(y-A+1).join(m):"";switch(b&&x&&(v=e(D+v,D.length?y-T.length:1/0),D=""),p){case"<":v=S+v+T+D;break;case"=":v=S+D+v+T;break;case"^":v=D.slice(0,A=D.length>>1)+S+v+T+D.slice(A);break;default:v=D+S+v+T;break}return a(v)}return w.toString=function(){return u+""},w}function d(u,f){var m=Math.max(-8,Math.min(8,Math.floor(Di(f)/3)))*3,p=Math.pow(10,-m),g=c((u=nl(u),u.type="f",u),{suffix:Lv[8+m/3]});return function(h){return g(p*h)}}return{format:c,formatPrefix:d}}var vv,Lv,Nv=dt(()=>{"use strict";Wf();gv();bv();Gb();wv();Sv();qb();Mv();vv=Array.prototype.map,Lv=["y","z","a","f","p","n","\xB5","m","","k","M","G","T","P","E","Z","Y"]});function Wb(t){return uh=Cv(t),fh=uh.format,mh=uh.formatPrefix,uh}var uh,fh,mh,Tv=dt(()=>{"use strict";Nv();Wb({thousands:",",grouping:[3],currency:["$",""]})});function zb(t){return Math.max(0,-Di(Math.abs(t)))}var _v=dt(()=>{"use strict";Wf()});function Yb(t,e){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Di(e)/3)))*3-Di(Math.abs(t)))}var Av=dt(()=>{"use strict";Wf()});function Vb(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,Di(e)-Di(t))+1}var Rv=dt(()=>{"use strict";Wf()});var Iv=dt(()=>{"use strict";Tv();Gb();_v();Av();Rv()});function Ub(t,e,n,r){var o=kb(t,e,n),a;switch(r=nl(r??",f"),r.type){case"s":{var i=Math.max(Math.abs(t),Math.abs(e));return r.precision==null&&!isNaN(a=Yb(o,i))&&(r.precision=a),mh(r,i)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(a=Vb(o,Math.max(Math.abs(t),Math.abs(e))))&&(r.precision=a-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(a=zb(o))&&(r.precision=a-(r.type==="%")*2);break}}return fh(r)}var Pv=dt(()=>{"use strict";Bo();Iv()});function Xb(t){var e=t.domain;return t.ticks=function(n){var r=e();return Qp(r[0],r[r.length-1],n??10)},t.tickFormat=function(n,r){var o=e();return Ub(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=Of(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 lr(){var t=Ob();return t.copy=function(){return ch(t,lr())},Qs.apply(t,arguments),Xb(t)}var jb=dt(()=>{"use strict";Bo();$b();$f();Pv()});function Dv(t){return function(e){return e<0?-Math.pow(-e,t):Math.pow(e,t)}}function gX(t){return t<0?-Math.sqrt(-t):Math.sqrt(t)}function yX(t){return t<0?-t*t:t*t}function bX(t){var e=t(si,si),n=1;function r(){return n===1?t(si,si):n===.5?t(gX,yX):t(Dv(n),Dv(1/n))}return e.exponent=function(o){return arguments.length?(n=+o,r()):n},Xb(e)}function ph(){var t=bX(Db());return t.copy=function(){return ch(t,ph()).exponent(t.exponent())},Qs.apply(t,arguments),t}function Kb(){return ph.apply(null,arguments).exponent(.5)}var Ov=dt(()=>{"use strict";jb();$b();$f()});var li=dt(()=>{"use strict";RM();jb();Ov()});function Hn(t){return function(){return t}}var Vf=dt(()=>{"use strict"});function Gv(t){return t>1?0:t<-1?gd:Math.acos(t)}function Qb(t){return t>=1?Uf:t<=-1?-Uf:Math.asin(t)}var Zb,Ao,rl,$v,hh,ci,sc,bo,gd,Uf,yd,gh=dt(()=>{"use strict";Zb=Math.abs,Ao=Math.atan2,rl=Math.cos,$v=Math.max,hh=Math.min,ci=Math.sin,sc=Math.sqrt,bo=1e-12,gd=Math.PI,Uf=gd/2,yd=2*gd});function qv(t){this._+=t[0];for(let e=1,n=t.length;e<n;++e)this._+=arguments[e]+t[e]}function wX(t){let e=Math.floor(t);if(!(e>=0))throw new Error(`invalid digits: ${t}`);if(e>15)return qv;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 Bv(){return new cc}var Jb,t4,lc,xX,cc,Hv=dt(()=>{"use strict";Jb=Math.PI,t4=2*Jb,lc=1e-6,xX=t4-lc;cc=class{constructor(e){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=e==null?qv:wX(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>lc)if(!(Math.abs(u*l-c*d)>lc)||!a)this._append`L${this._x1=e},${this._y1=n}`;else{let m=r-i,p=o-s,g=l*l+c*c,h=m*m+p*p,x=Math.sqrt(g),y=Math.sqrt(f),b=a*Math.tan((Jb-Math.acos((g+f-h)/(2*x*y)))/2),k=b/y,E=b/x;Math.abs(k-1)>lc&&this._append`L${e+k*d},${n+k*u}`,this._append`A${a},${a},0,0,${+(u*m>d*p)},${this._x1=e+E*l},${this._y1=n+E*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)>lc||Math.abs(this._y1-d)>lc)&&this._append`L${c},${d}`,r&&(f<0&&(f=f%t4+t4),f>xX?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>lc&&this._append`A${r},${r},0,${+(f>=Jb)},${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._}};Bv.prototype=cc.prototype});var Fv=dt(()=>{"use strict";Hv()});function bd(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 cc(e)}var yh=dt(()=>{"use strict";Fv()});function kX(t){return t.innerRadius}function EX(t){return t.outerRadius}function SX(t){return t.startAngle}function MX(t){return t.endAngle}function vX(t){return t&&t.padAngle}function LX(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<bo))return f=(d*(e-a)-u*(t-o))/f,[t+f*l,e+f*c]}function bh(t,e,n,r,o,a,i){var s=t-n,l=e-r,c=(i?a:-a)/sc(s*s+l*l),d=c*l,u=-c*s,f=t+d,m=e+u,p=n+d,g=r+u,h=(f+p)/2,x=(m+g)/2,y=p-f,b=g-m,k=y*y+b*b,E=o-a,C=f*g-p*m,M=(b<0?-1:1)*sc($v(0,E*E*k-C*C)),_=(C*b-y*M)/k,I=(-C*y-b*M)/k,L=(C*b+y*M)/k,w=(-C*y+b*M)/k,v=_-h,S=I-x,T=L-h,N=w-x;return v*v+S*S>T*T+N*N&&(_=L,I=w),{cx:_,cy:I,x01:-d,y01:-u,x11:_*(o/E-1),y11:I*(o/E-1)}}function dc(){var t=kX,e=EX,n=Hn(0),r=null,o=SX,a=MX,i=vX,s=null,l=bd(c);function c(){var d,u,f=+t.apply(this,arguments),m=+e.apply(this,arguments),p=o.apply(this,arguments)-Uf,g=a.apply(this,arguments)-Uf,h=Zb(g-p),x=g>p;if(s||(s=d=l()),m<f&&(u=m,m=f,f=u),!(m>bo))s.moveTo(0,0);else if(h>yd-bo)s.moveTo(m*rl(p),m*ci(p)),s.arc(0,0,m,p,g,!x),f>bo&&(s.moveTo(f*rl(g),f*ci(g)),s.arc(0,0,f,g,p,x));else{var y=p,b=g,k=p,E=g,C=h,M=h,_=i.apply(this,arguments)/2,I=_>bo&&(r?+r.apply(this,arguments):sc(f*f+m*m)),L=hh(Zb(m-f)/2,+n.apply(this,arguments)),w=L,v=L,S,T;if(I>bo){var N=Qb(I/f*ci(_)),R=Qb(I/m*ci(_));(C-=N*2)>bo?(N*=x?1:-1,k+=N,E-=N):(C=0,k=E=(p+g)/2),(M-=R*2)>bo?(R*=x?1:-1,y+=R,b-=R):(M=0,y=b=(p+g)/2)}var G=m*rl(y),$=m*ci(y),A=f*rl(E),D=f*ci(E);if(L>bo){var O=m*rl(b),P=m*ci(b),H=f*rl(k),W=f*ci(k),B;if(h<gd)if(B=LX(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/ci(Gv((q*X+V*z)/(sc(q*q+V*V)*sc(X*X+z*z)))/2),Y=sc(B[0]*B[0]+B[1]*B[1]);w=hh(L,(f-Y)/(U-1)),v=hh(L,(m-Y)/(U+1))}else w=v=0}M>bo?v>bo?(S=bh(H,W,G,$,m,v,x),T=bh(O,P,A,D,m,v,x),s.moveTo(S.cx+S.x01,S.cy+S.y01),v<L?s.arc(S.cx,S.cy,v,Ao(S.y01,S.x01),Ao(T.y01,T.x01),!x):(s.arc(S.cx,S.cy,v,Ao(S.y01,S.x01),Ao(S.y11,S.x11),!x),s.arc(0,0,m,Ao(S.cy+S.y11,S.cx+S.x11),Ao(T.cy+T.y11,T.cx+T.x11),!x),s.arc(T.cx,T.cy,v,Ao(T.y11,T.x11),Ao(T.y01,T.x01),!x))):(s.moveTo(G,$),s.arc(0,0,m,y,b,!x)):s.moveTo(G,$),!(f>bo)||!(C>bo)?s.lineTo(A,D):w>bo?(S=bh(A,D,O,P,f,-w,x),T=bh(G,$,H,W,f,-w,x),s.lineTo(S.cx+S.x01,S.cy+S.y01),w<L?s.arc(S.cx,S.cy,w,Ao(S.y01,S.x01),Ao(T.y01,T.x01),!x):(s.arc(S.cx,S.cy,w,Ao(S.y01,S.x01),Ao(S.y11,S.x11),!x),s.arc(0,0,f,Ao(S.cy+S.y11,S.cx+S.x11),Ao(T.cy+T.y11,T.cx+T.x11),x),s.arc(T.cx,T.cy,w,Ao(T.y11,T.x11),Ao(T.y01,T.x01),!x))):s.arc(0,0,f,E,k,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-gd/2;return[rl(u)*d,ci(u)*d]},c.innerRadius=function(d){return arguments.length?(t=typeof d=="function"?d:Hn(+d),c):t},c.outerRadius=function(d){return arguments.length?(e=typeof d=="function"?d:Hn(+d),c):e},c.cornerRadius=function(d){return arguments.length?(n=typeof d=="function"?d:Hn(+d),c):n},c.padRadius=function(d){return arguments.length?(r=d==null?null:typeof d=="function"?d:Hn(+d),c):r},c.startAngle=function(d){return arguments.length?(o=typeof d=="function"?d:Hn(+d),c):o},c.endAngle=function(d){return arguments.length?(a=typeof d=="function"?d:Hn(+d),c):a},c.padAngle=function(d){return arguments.length?(i=typeof d=="function"?d:Hn(+d),c):i},c.context=function(d){return arguments.length?(s=d??null,c):s},c}var Wv=dt(()=>{"use strict";Vf();gh();yh()});function xd(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}var Pwt,xh=dt(()=>{"use strict";Pwt=Array.prototype.slice});function zv(t){this._context=t}function uc(t){return new zv(t)}var wh=dt(()=>{"use strict";zv.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 kh(t){return t[0]}function Eh(t){return t[1]}var e4=dt(()=>{"use strict"});function nr(t,e){var n=Hn(!0),r=null,o=uc,a=null,i=bd(s);t=typeof t=="function"?t:t===void 0?kh:Hn(t),e=typeof e=="function"?e:e===void 0?Eh:Hn(e);function s(l){var c,d=(l=xd(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:Hn(+l),s):t},s.y=function(l){return arguments.length?(e=typeof l=="function"?l:Hn(+l),s):e},s.defined=function(l){return arguments.length?(n=typeof l=="function"?l:Hn(!!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 n4=dt(()=>{"use strict";xh();Vf();wh();yh();e4()});function fc(t,e,n){var r=null,o=Hn(!0),a=null,i=uc,s=null,l=bd(c);t=typeof t=="function"?t:t===void 0?kh:Hn(+t),e=typeof e=="function"?e:e===void 0?Hn(0):Hn(+e),n=typeof n=="function"?n:n===void 0?Eh:Hn(+n);function c(u){var f,m,p,g=(u=xd(u)).length,h,x=!1,y,b=new Array(g),k=new Array(g);for(a==null&&(s=i(y=l())),f=0;f<=g;++f){if(!(f<g&&o(h=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],k[p]);s.lineEnd(),s.areaEnd()}x&&(b[f]=+t(h,f,u),k[f]=+e(h,f,u),s.point(r?+r(h,f,u):b[f],n?+n(h,f,u):k[f]))}if(y)return s=null,y+""||null}function d(){return nr().defined(o).curve(i).context(a)}return c.x=function(u){return arguments.length?(t=typeof u=="function"?u:Hn(+u),r=null,c):t},c.x0=function(u){return arguments.length?(t=typeof u=="function"?u:Hn(+u),c):t},c.x1=function(u){return arguments.length?(r=u==null?null:typeof u=="function"?u:Hn(+u),c):r},c.y=function(u){return arguments.length?(e=typeof u=="function"?u:Hn(+u),n=null,c):e},c.y0=function(u){return arguments.length?(e=typeof u=="function"?u:Hn(+u),c):e},c.y1=function(u){return arguments.length?(n=u==null?null:typeof u=="function"?u:Hn(+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:Hn(!!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 Yv=dt(()=>{"use strict";xh();Vf();wh();n4();yh();e4()});function Vv(t,e){return e<t?-1:e>t?1:e>=t?0:NaN}var Uv=dt(()=>{"use strict"});function Xv(t){return t}var jv=dt(()=>{"use strict"});function r4(){var t=Xv,e=Vv,n=null,r=Hn(0),o=Hn(yd),a=Hn(0);function i(s){var l,c=(s=xd(s)).length,d,u,f=0,m=new Array(c),p=new Array(c),g=+r.apply(this,arguments),h=Math.min(yd,Math.max(-yd,o.apply(this,arguments)-g)),x,y=Math.min(Math.abs(h)/c,a.apply(this,arguments)),b=y*(h<0?-1:1),k;for(l=0;l<c;++l)(k=p[m[l]=l]=+t(s[l],l,s))>0&&(f+=k);for(e!=null?m.sort(function(E,C){return e(p[E],p[C])}):n!=null&&m.sort(function(E,C){return n(s[E],s[C])}),l=0,u=f?(h-c*b)/f:0;l<c;++l,g=x)d=m[l],k=p[d],x=g+(k>0?k*u:0)+b,p[d]={data:s[d],index:l,value:k,startAngle:g,endAngle:x,padAngle:y};return p}return i.value=function(s){return arguments.length?(t=typeof s=="function"?s:Hn(+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:Hn(+s),i):r},i.endAngle=function(s){return arguments.length?(o=typeof s=="function"?s:Hn(+s),i):o},i.padAngle=function(s){return arguments.length?(a=typeof s=="function"?s:Hn(+s),i):a},i}var Kv=dt(()=>{"use strict";xh();Vf();Uv();jv();gh()});function o4(t){return new Sh(t,!0)}function a4(t){return new Sh(t,!1)}var Sh,Zv=dt(()=>{"use strict";Sh=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 Qv(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 Jv(t){this._context=t}function xo(t){return new Jv(t)}var tL=dt(()=>{"use strict";Jv.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:Qv(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:Qv(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}}});function eL(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 Mh(t,e){this._context=t,this._k=(1-e)/6}var skt,nL=dt(()=>{"use strict";Mh.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:eL(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:eL(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 Mh(r,e)}return n.tension=function(r){return t(+r)},n})(0)});function CX(t,e,n){var r=t._x1,o=t._y1,a=t._x2,i=t._y2;if(t._l01_a>bo){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>bo){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 rL(t,e){this._context=t,this._alpha=e}var i4,oL=dt(()=>{"use strict";gh();nL();rL.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:CX(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}};i4=(function t(e){function n(r){return e?new rL(r,e):new Mh(r,0)}return n.alpha=function(r){return t(+r)},n})(.5)});function aL(t){return t<0?-1:1}function iL(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(aL(a)+aL(i))*Math.min(Math.abs(a),Math.abs(i),.5*Math.abs(s))||0}function sL(t,e){var n=t._x1-t._x0;return n?(3*(t._y1-t._y0)/n-e)/2:e}function s4(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 vh(t){this._context=t}function NX(t){this._context=new lL(t)}function lL(t){this._context=t}function wd(t){return new vh(t)}var cL=dt(()=>{"use strict";vh.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:s4(this,this._t0,sL(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,s4(this,sL(this,n=iL(this,t,e)),n);break;default:s4(this,this._t0,n=iL(this,t,e));break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=n}}};(NX.prototype=Object.create(vh.prototype)).point=function(t,e){vh.prototype.point.call(this,e,t)};lL.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 Ro=dt(()=>{"use strict";Wv();Yv();n4();Kv();tL();Zv();oL();wh();cL()});function kd(t,e,n){let r=t;for(let o=0;o<e.length;o++)r+=(dL[e.charAt(o)]??l4)*n;return r}function At(t,e){let n=`${e}|${t}`,r=Lh.get(n);if(r!==void 0)return r;let o=kd(0,t,e);return Lh.size>=TX&&Lh.clear(),Lh.set(n,o),o}function Vn(t,e,n){if(At(t,e)<=n)return t;let r="\u2026",o=At(r,e);if(o>n)return"";let a=[0];for(let l=0;l<t.length;l++)a.push(kd(a[l],t.charAt(l),e));let i=0,s=t.length;for(;i<s;){let l=Math.ceil((i+s)/2);a[l]+o<=n?i=l:s=l-1}return i===0?r:t.slice(0,i)+r}function pn(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=(dL[" "]??l4)*e,s=[],l="",c=0,d=u=>{let f=kd(l?c+i:0,u,e);f<=n||!l?(l=l?`${l} ${u}`:u,c=f):(s.push(l),l=u,c=kd(0,u,e))};for(let u of o){if(a&&At(u,e)>n){l&&(s.push(l),l="",c=0);let f="",m=0;for(let p of u){let g=kd(m,p,e);f&&g>n?(s.push(f),f=p,m=kd(0,p,e)):(f+=p,m=g)}l=f,c=m;continue}d(u)}return l&&s.push(l),s.length>0?s:[""]}var dL,l4,Ko,Lh,TX,Ye=dt(()=>{"use strict";dL={" ":.28,"!":.28,'"':.36,"#":.56,$:.56,"%":.89,"&":.67,"'":.19,"(":.33,")":.33,"*":.39,"+":.58,",":.28,"-":.33,".":.28,"/":.28,0:.56,1:.56,2:.56,3:.56,4:.56,5:.56,6:.56,7:.56,8:.56,9:.56,":":.28,";":.28,"<":.58,"=":.58,">":.58,"?":.56,"@":1.02,A:.67,B:.67,C:.72,D:.72,E:.67,F:.61,G:.78,H:.72,I:.28,J:.5,K:.67,L:.56,M:.83,N:.72,O:.78,P:.67,Q:.78,R:.72,S:.67,T:.61,U:.72,V:.67,W:.94,X:.67,Y:.67,Z:.61,a:.56,b:.56,c:.5,d:.56,e:.56,f:.28,g:.56,h:.56,i:.22,j:.22,k:.5,l:.22,m:.83,n:.56,o:.56,p:.56,q:.56,r:.33,s:.5,t:.28,u:.56,v:.5,w:.72,x:.5,y:.5,z:.5},l4=.56,Ko=l4,Lh=new Map,TX=1e4});var ve,hr=dt(()=>{"use strict";ve=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 Nh(t,e){return yo(t,e)}var c4=dt(()=>{"use strict";xs()});function Ed(t,e){return yo(t,e)}var u4=dt(()=>{"use strict";xs()});function f4(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 m4(t){return t.getFullYear()+t.getMonth()/12+(t.getDate()-1)/365+t.getHours()/8760+t.getMinutes()/525600+t.getSeconds()/31536e3}function VX(t){return t<0?`${-t} BCE`:String(t)}function Th(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,g=1;p>800?g=200:p>400?g=100:p>160?g=50:p>80?g=20:p>40?g=10:p>20?g=5:p>10&&(g=2);let h=Math.ceil(u/g)*g;for(let x=h;x<=f;x+=g)d.push({pos:n(x),label:VX(x)})}else if(c>.25){let p=l>s;for(let g=s;g<=l+1;g++)for(let h=1;h<=12;h++){let x=g+(h-1)/12;if(x>e)break;if(x>=t){let y=mc[h-1];d.push({pos:n(x),label:p?`${y} '${String(g).slice(-2)}`:y})}}}else if(c<=114e-7){let p=5,g=c*31536e3;g>180?p=30:g>60?p=15:g>30&&(p=10);let h=f4(t);for(h.setSeconds(Math.floor(h.getSeconds()/p)*p,0);;){let x=m4(h);if(x>e)break;if(x>=t){let y=String(h.getHours()).padStart(2,"0"),b=String(h.getMinutes()).padStart(2,"0"),k=String(h.getSeconds()).padStart(2,"0");d.push({pos:n(x),label:`${y}:${b}:${k}`})}h.setSeconds(h.getSeconds()+p)}}else if(c<=685e-6){let p=5,g=c*8760;g>3?p=30:g>1?p=15:g>.5&&(p=10);let h=f4(t);for(h.setMinutes(Math.floor(h.getMinutes()/p)*p,0,0);;){let x=m4(h);if(x>e)break;if(x>=t){let y=String(h.getHours()).padStart(2,"0"),b=String(h.getMinutes()).padStart(2,"0");d.push({pos:n(x),label:`${y}:${b}`})}h.setMinutes(h.getMinutes()+p)}}else if(c<=.00822){let p=1,g=c*8760;g>48?p=6:g>24?p=3:g>12&&(p=2);let h=g<=24,x=f4(t);for(x.setHours(Math.floor(x.getHours()/p)*p,0,0,0);;){let y=m4(x);if(y>e)break;if(y>=t){let b=String(x.getHours()).padStart(2,"0"),k=String(x.getMinutes()).padStart(2,"0");if(h)d.push({pos:n(y),label:`${b}:${k}`});else{let E=mc[x.getMonth()],C=x.getDate();d.push({pos:n(y),label:`${E} ${C} ${b}:${k}`})}}x.setHours(x.getHours()+p)}}else for(let p=s;p<=l+1;p++)for(let g=1;g<=12;g++)for(let h of[1,8,15,22]){let x=p+(g-1)/12+(h-1)/365;if(x>e)break;x>=t&&d.push({pos:n(x),label:`${mc[g-1]} ${h}`})}let m=40;if(r!==void 0&&a){let p=n(r);d=d.filter(g=>Math.abs(g.pos-p)>=m),d.unshift({pos:p,label:a})}if(o!==void 0&&i){let p=n(o);d=d.filter(g=>Math.abs(g.pos-p)>=m),d.push({pos:p,label:i})}return d}var mc,p4=dt(()=>{"use strict";mc=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});var yL={};de(yL,{CONTROLS_ICON_PATH:()=>Ah,EYE_CLOSED_PATH:()=>jf,EYE_OPEN_PATH:()=>Xf,LEGEND_CAPSULE_PAD:()=>Dn,LEGEND_DOT_R:()=>Er,LEGEND_ENTRY_DOT_GAP:()=>Lr,LEGEND_ENTRY_FONT_SIZE:()=>Fn,LEGEND_ENTRY_TRAIL:()=>jr,LEGEND_EYE_GAP:()=>Aa,LEGEND_EYE_SIZE:()=>wo,LEGEND_GEAR_PILL_W:()=>$i,LEGEND_GROUP_GAP:()=>En,LEGEND_HEIGHT:()=>Se,LEGEND_ICON_W:()=>Sd,LEGEND_MAX_ENTRY_ROWS:()=>_h,LEGEND_PILL_FONT_SIZE:()=>cr,LEGEND_PILL_PAD:()=>uo,LEGEND_TOGGLE_DOT_R:()=>ks,LEGEND_TOGGLE_OFF_OPACITY:()=>h4,legendChromeColors:()=>pc,measureLegendText:()=>Fe,truncateLegendText:()=>ws});function pc(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,uo,cr,Dn,Er,Fn,Lr,jr,En,wo,Aa,Sd,_h,Fe,ws,Xf,jf,Ah,ks,h4,$i,dr=dt(()=>{"use strict";He();Ye();Se=28,uo=16,cr=11,Dn=4,Er=4,Fn=10,Lr=4,jr=8,En=12,wo=14,Aa=6,Sd=20,_h=3;Fe=At,ws=Vn,Xf="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",jf="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",Ah="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",ks=Er,h4=.4,$i=14+uo});function Rh(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 g4=dt(()=>{"use strict"});function Dh(t){return Rh(t)}function jX(t,e){let n=Zf(t),r=Fe(Dh(e.min),Fn),o=Fe(Dh(e.max),Fn);return Dn+n+4+r+Ph+y4+Ph+o+Dn}function KX(t,e){let n=Zf(t.name),r=Dh(e.min),o=Dh(e.max),a=Fe(r,Fn),i=Dn+n+4,s=i,l=i+a+Ph,c=l+y4+Ph,d=jX(t.name,e);return{groupName:t.name,x:0,y:0,width:d,height:Se,pill:{groupName:t.name,x:Dn,y:Dn,width:n,height:Se-Dn*2,isActive:!0},entries:[],gradient:{rampX:l,rampY:(Se-bL)/2,rampW:y4,rampH:bL,min:e.min,max:e.max,minText:r,minX:s,maxText:o,maxX:c,textY:Se/2,low:e.low,high:e.high}}}function Zf(t){return Fe(t,cr)+uo}function ZX(t){let e=0;for(let n of t)e+=Er*2+Lr+Fe(n.value,Fn)+jr;return e}function kL(t){return Er*2+Lr+Fe(t,Fn)+jr}function xL(t){let e=UX;if(t.label&&(e+=Fe(t.label,Ih),t.icon&&(e+=XX)),t.icon&&(e+=14),t.children)for(let n of t.children)e+=Fe(n.label,Ih)+12;return e}function EL(t,e,n,r=0){let o=Zf(t),a=n,i=Dn*2+o+4+r,s=ZX(e),l=i+s;if(l<=a+.5)return{width:l,entryRows:1,moreCount:0,visibleEntries:e.length};let c=a-Dn,d=1,u=Dn+o+4+r,f=0;for(let m=0;m<e.length;m++){let p=kL(e[m].value),g=c-u;if(p>g&&m>0&&(d++,u=Dn+o+4+r,d>_h))return{width:a,entryRows:_h,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 Oh(t){let e=Dn*2+$i+4;for(let n of t)e+=ks*2+Lr+Fe(n.label,Fn)+jr;return e}function QX(t,e){return!e&&t.controlsHost==="app"&&!!t.controlsGroup&&t.controlsGroup.toggles.length>0}function JX(t,e){let n=t.controlsGroup;if(!n||n.toggles.length===0)return;let r=!!e.controlsExpanded,o=Se-Dn*2;if(!r)return{x:0,y:0,width:$i,height:Se,expanded:!1,pill:{x:0,y:0,width:$i,height:Se},toggles:[]};let a=Oh(n.toggles),i=[],s=Dn+$i+4;for(let l of n.toggles){let c=s+ks,d=Se/2,u=s+ks*2+Lr,f=Se/2;i.push({id:l.id,label:l.label,active:l.active,dotCx:c,dotCy:d,textX:u,textY:f}),s+=ks*2+Lr+Fe(l.label,Fn)+jr}return{x:0,y:0,width:a,height:Se,expanded:!0,pill:{x:Dn,y:Dn,width:$i-Dn*2,height:o},toggles:i}}function ol(t,e,n){let{groups:r,controls:o,mode:a}=t,i=a==="export",s=QX(t,i),l=e.activeGroup?.toLowerCase()??null;if(i&&!l)return{height:0,width:0,rows:[],controls:[],pills:[]};let c=i||s?void 0:JX(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 M=xL(C),_=C.children?.map(I=>({id:I.id,label:I.label,x:0,y:0,width:Fe(I.label,Ih)+12,...I.isActive!==void 0&&{isActive:I.isActive}}));u.push({id:C.id,x:0,y:0,width:M,height:Se,icon:C.icon,...C.label!==void 0&&{label:C.label},exportBehavior:C.exportBehavior,..._!==void 0&&{children:_}}),f+=M+Kf}f>0&&(f-=Kf)}else if(o&&i){for(let C of o){if(C.exportBehavior==="strip")continue;let M=xL(C),_=C.children?.map(I=>({id:I.id,label:I.label,x:0,y:0,width:Fe(I.label,Ih)+12,...I.isActive!==void 0&&{isActive:I.isActive}}));u.push({id:C.id,x:0,y:0,width:M,height:Se,icon:C.icon,...C.label!==void 0&&{label:C.label},exportBehavior:C.exportBehavior,..._!==void 0&&{children:_}}),f+=M+Kf}f>0&&(f-=Kf)}let m=f>0?f+En*2:0,p=c?c.width+En:0,g=n-m-p,h=[],x;for(let C of d){let M=l===C.name.toLowerCase();if(!(i&&!M)){if(M)x=tj(C,g,t.capsulePillAddonWidth??0);else if(!l||t.showInactivePills){let _=Zf(C.name);h.push({groupName:C.name,x:0,y:0,width:_,height:Se,isActive:!1})}}}let y=t.position.titleRelation==="inline-with-title",b=ej(x,h,u,g,n,f,y,c);return{height:b.length*Se,width:n,rows:b,...x!==void 0&&{activeCapsule:x},controls:u,pills:h,...c!==void 0&&{controlsGroup:c}}}function tj(t,e,n=0){if(t.gradient)return KX(t,t.gradient);let r=Zf(t.name),o=EL(t.name,t.entries,e,n),a={groupName:t.name,x:Dn,y:Dn,width:r,height:Se-Dn*2,isActive:!0},i=[],s=Dn+r+4+n,l=0,c=s,d=e-Dn,u=0;for(let p=0;p<o.visibleEntries;p++){let g=t.entries[p],h=kL(g.value);o.entryRows>1&&c+h>d&&c>s&&p>0&&(u++,c=s,l=u*Se);let x,y=d-c;if(h>y){let M=y-(Er*2+Lr+jr);M>0&&(x=ws(g.value,Fn,M),h=Er*2+Lr+Fe(x,Fn)+jr)}let b=c+Er,k=l+Se/2,E=c+Er*2+Lr,C=l+Se/2;i.push({value:g.value,color:g.color,x:c,y:l,width:h,dotCx:b,dotCy:k,textX:E,textY:C,...x!==void 0&&{displayValue:x}}),c+=h}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:Dn+r+4}}}function ej(t,e,n,r,o,a,i=!1,s){let l=[],c=[];t&&c.push(t),c.push(...e);let d=s?s.width+En:0,u=[],f=0,m=0;for(let p of c){let g=p.width+En;if(f+p.width>r&&u.length>0){if(!i){let h=l.length===0?d:0;wL(u,o,a,h)}l.push({y:m,items:u}),m+=Se,u=[],f=0}p.x=f,p.y=m,u.push(p),f+=g}if(n.length>0){let p=o;for(let g=n.length-1;g>=0;g--){let h=n[g];p-=h.width,h.x=p,h.y=0,p-=Kf}l.length>0?l[0].items.push(...n):u.length>0?u.push(...n):u.push(...n)}if(u.length>0&&(i||wL(u,o,a,d),l.push({y:m,items:u})),s){let g=(l[0]?.items??[]).filter(h=>"groupName"in h);if(g.length>0){let h=g[g.length-1];s.x=h.x+h.width+En}else s.x=(o-s.width)/2;s.y=0}return l.length===0&&l.push({y:0,items:[]}),l}function wL(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)*En,i=e-(n>0?n+En*2:0)-r,l=Math.max(0,(i-a)/2);for(let c of o)c.x=l,l+=c.width+En}function Jn(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=EL(a.name,a.entries,e,r).entryRows*Se;s>o&&(o=s)}return o}function rr(t,e,n){let r=ol(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 UX,Ih,XX,Kf,y4,bL,Ph,Ir=dt(()=>{"use strict";dr();g4();UX=16,Ih=11,XX=4,Kf=8,y4=80,bL=8,Ph=6});function al(t){return t.attr("dy",nj)}function SL(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=ol(e,l,s),d.selectAll("*").remove(),c.height===0)return;l.activeGroup?d.attr("data-legend-active",Ht(l.activeGroup)):d.attr("data-legend-active",null);let{groupBg:f,pillBorder:m}=pc(r,o);c.activeCapsule&&rj(d,c.activeCapsule,r,f,m,o,a);for(let p of c.pills)oj(d,p,r,f,a);c.controlsGroup&&ij(d,c.controlsGroup,r,f,m,a,e);for(let p of c.controls)aj(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 rj(t,e,n,r,o,a,i){let s=t.append("g").attr("transform",`translate(${e.x},${e.y})`).attr("data-legend-group",Ht(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(al).attr("font-size",cr).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-${Ht(e.groupName).replace(/[^a-z0-9]+/g,"-")}`,u=s.append("defs").append("linearGradient").attr("id",d);for(let f of uM(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(al).attr("font-size",Fn).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(al).attr("font-size",Fn).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",Er).attr("fill",c.color),d.append("text").attr("x",c.textX).attr("y",c.textY).call(al).attr("font-size",Fn).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 oj(t,e,n,r,o){let a=t.append("g").attr("transform",`translate(${e.x},${e.y})`).attr("data-legend-group",Ht(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(al).attr("font-size",cr).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 aj(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+Lr+Fe(e.label,cr)/2),e.label&&s.append("text").attr("x",l).attr("y",e.height/2).attr("text-anchor","middle").call(al).attr("font-size",cr).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(al).attr("font-size",Fn).attr("fill",u.isActive?n.bg:n.textMuted).attr("font-family",Mt).text(u.label);let p=i?.find(g=>g.id===e.id)?.children?.find(g=>g.id===u.id);if(p?.onClick){let g=p.onClick;f.on("click",()=>g())}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 ij(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",Ah).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",g=>{g.stopPropagation(),p()})}let m=i?.controlsGroup?.toggles??[];for(let p of e.toggles){let g=m.find(x=>x.id===p.id),h=s.append("g").attr("data-controls-toggle",p.id).style("cursor","pointer");if(p.active?h.append("circle").attr("cx",p.dotCx).attr("cy",p.dotCy).attr("r",ks).attr("fill",n.primary??n.text):h.append("circle").attr("cx",p.dotCx).attr("cy",p.dotCy).attr("r",ks).attr("fill","none").attr("stroke",n.textMuted).attr("stroke-width",1),h.append("text").attr("x",p.textX).attr("y",p.textY).call(al).attr("font-size",Fn).attr("fill",n.textMuted).attr("opacity",p.active?1:h4).attr("font-family",Mt).text(p.label),a?.onControlsToggle&&g){let x=a.onControlsToggle,y=p.id,b=!p.active;h.on("click",k=>{k.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",Ah).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 nj,ML=dt(()=>{"use strict";Oe();dr();Ir();He();Ke();nj="0.32em"});function nn(t,e){return SL(t,{groups:e.groups,position:e.position??sj,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 sj,br=dt(()=>{"use strict";ML();sj={placement:"top-center",titleRelation:"below-title"}});function lj(t){return[t.colors.blue,t.colors.green,t.colors.yellow,t.colors.orange,t.colors.purple]}function $h(t,e,n,r,o,a,i,s,l=!1,c=null,d,u,f,m){let p=d?lj(d):["#3b6ea5","#5b9357","#c9a227","#cc7a33","#7d5ba6"];e.forEach((g,h)=>{let x=yn(g.startDate),y=yn(g.endDate);if(!Number.isFinite(x)||!Number.isFinite(y))return;let b=n(x),k=n(y);if(!Number.isFinite(b)||!Number.isFinite(k))return;let E=g.color||p[h%p.length],C=t.append("g").attr("class","tl-era").attr("data-line-number",String(g.lineNumber)).attr("data-era-start",String(x)).attr("data-era-end",String(y)).style("cursor","pointer"),M,_=g.label,I=!1,L=f==="outline"&&m!==void 0,w=v=>{L?v.attr("fill",m).attr("stroke",E).attr("stroke-width",1):v.attr("fill",E).attr("opacity",.08)};if(r){let v=Math.min(b,k),S=Math.abs(k-b);w(C.append("rect").attr("x",0).attr("y",v).attr("width",o).attr("height",S)),M=C.append("text").attr("x",6).attr("y",v+18).attr("text-anchor","start").attr("fill",E).attr("font-size","13px").attr("font-weight","600").attr("opacity",.8).text(_)}else{let v=Math.min(b,k),S=Math.abs(k-b),T=u!=null,N=T?0:l?-48:0,R=T?u:l?-32:18;if(w(C.append("rect").attr("x",v).attr("y",N).attr("width",S).attr("height",a-N)),T){let G=Math.max(0,S-8);_=ws(g.label,13,G),I=_!==g.label}M=C.append("text").attr("x",v+S/2).attr("y",R).attr("text-anchor","middle").attr("fill",E).attr("font-size","13px").attr("font-weight","600").attr("opacity",.8).text(_)}C.on("mouseenter",function(){i(x,y),I&&M.text(g.label)}).on("mouseleave",function(){s(),I&&M.text(_)})})}function Gh(t,e,n,r,o,a,i,s,l=!1,c=null,d,u,f,m){let p=d?.accent||"#3a9188",g=e.map(x=>{let y=yn(x.date);return Number.isFinite(y)?n(y):NaN}),h=u!=null&&!r;e.forEach((x,y)=>{let b=yn(x.date);if(!Number.isFinite(b))return;let k=g[y];if(!Number.isFinite(k))return;let E=x.color||p,C=.5,M=5,_=f==="outline"&&m!==void 0,I=w=>{_?w.attr("fill",m).attr("stroke",E).attr("stroke-width",1.25).attr("opacity",.9):w.attr("fill",E).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",k).attr("x2",o).attr("y2",k).attr("stroke",E).attr("stroke-width",1.5).attr("stroke-dasharray","6 4").attr("opacity",C),L.append("text").attr("x",-M-8).attr("y",k-M-4).attr("text-anchor","middle").attr("fill",E).attr("font-size","11px").attr("font-weight","600").text(x.label),I(L.append("path").attr("d",`M${-M-8},${k} l${M},-${M} l${M},${M} l-${M},${M} Z`)),L.on("mouseenter",function(){i(b)}).on("mouseleave",function(){s()});else{let w=h?u:6,v=h?-(M+1):w+14,S=v+M,T=x.label,N=!1;if(h){let G=Math.min(k,o-k);for(let A=0;A<g.length;A++){if(A===y)continue;let D=g[A];if(!Number.isFinite(D))continue;let O=Math.abs(D-k);O<G&&(G=O)}let $=Math.max(0,G-8);T=ws(x.label,11,$),N=T!==x.label}let R=L.append("text").attr("x",k).attr("y",w).attr("text-anchor","middle").attr("fill",E).attr("font-size","11px").attr("font-weight","600").text(T);I(L.append("path").attr("d",`M${k},${v-M} l${M},${M} l-${M},${M} l-${M},-${M} Z`)),L.append("line").attr("x1",k).attr("y1",S).attr("x2",k).attr("y2",a).attr("stroke",E).attr("stroke-width",1.5).attr("stroke-dasharray","6 4").attr("opacity",C),L.on("mouseenter",function(){i(b),N&&R.text(x.label)}).on("mouseleave",function(){s(),N&&R.text(T)})}})}function Es(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=mc[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 il(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 Es(t)}function qh(t,e,n,r,o,a,i,s,l,c){let[d,u]=e.domain(),f=Th(d,u,e,i,s,l,c);if(f.length<2)return;let m=6,p=.4,g=.15;for(let h of f)n?(t.append("line").attr("x1",0).attr("y1",h.pos).attr("x2",r).attr("y2",h.pos).attr("stroke",a).attr("stroke-width",1).attr("stroke-dasharray","4 4").attr("opacity",g),t.append("line").attr("x1",-m).attr("y1",h.pos).attr("x2",0).attr("y2",h.pos).attr("stroke",a).attr("stroke-width",1).attr("opacity",p),t.append("text").attr("x",-m-3).attr("y",h.pos).attr("dy","0.35em").attr("text-anchor","end").attr("fill",a).attr("font-size","10px").attr("opacity",p).text(h.label),t.append("line").attr("x1",r).attr("y1",h.pos).attr("x2",r+m).attr("y2",h.pos).attr("stroke",a).attr("stroke-width",1).attr("opacity",p),t.append("text").attr("x",r+m+3).attr("y",h.pos).attr("dy","0.35em").attr("text-anchor","start").attr("fill",a).attr("font-size","10px").attr("opacity",p).text(h.label)):(t.append("line").attr("class","tl-scale-tick").attr("x1",h.pos).attr("y1",0).attr("x2",h.pos).attr("y2",o).attr("stroke",a).attr("stroke-width",1).attr("stroke-dasharray","4 4").attr("opacity",g),t.append("line").attr("class","tl-scale-tick").attr("x1",h.pos).attr("y1",o).attr("x2",h.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",h.pos).attr("y",o+m+12).attr("text-anchor","middle").attr("fill",a).attr("font-size","10px").attr("opacity",p).text(h.label),t.append("line").attr("class","tl-scale-tick").attr("x1",h.pos).attr("y1",-m).attr("x2",h.pos).attr("y2",0).attr("stroke",a).attr("stroke-width",1).attr("opacity",p),t.append("text").attr("class","tl-scale-tick").attr("x",h.pos).attr("y",-m-4).attr("text-anchor","middle").attr("fill",a).attr("font-size","10px").attr("opacity",p).text(h.label))}function LL(t,e,n,r,o,a){t.selectAll(".tl-scale-tick").attr("opacity",.1);let i=6,s=e(yn(n)),l=Es(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(yn(r)),d=Es(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 CL(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 sl(t){let e=t.endDate?`${Es(t.date)} \u2192 ${Es(t.endDate)}`:Es(t.date);return`<strong>${t.label}</strong><br>${e}`}function NL(t,e,n,r,o,a,i,s,l){let g=pc(o,a).groupBg,h=0;for(let x of e){let y=n.get(x.name)??r,k=22+Fe(x.name,11)+10,E=t.append("g").attr("class","tl-legend-item").attr("data-group",x.name).style("cursor","pointer").on("mouseenter",()=>s(x.name)).on("mouseleave",()=>l());E.append("rect").attr("x",h).attr("y",i-22/2).attr("width",k).attr("height",22).attr("rx",22/2).attr("fill",g),E.append("circle").attr("cx",h+10+4).attr("cy",i).attr("r",4).attr("fill",y),E.append("text").attr("x",h+10+8+4).attr("y",i).attr("dy","0.35em").attr("fill",r).attr("font-size","11px").attr("font-family",Mt).text(x.name),h+=k+8}}function cj(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 g=Up(t,n,r),h=o?.width??t.clientWidth,x=o?.height??t.clientHeight;if(h<=0||x<=0)return null;let y=m==="vertical",b=n.text,k=n.border,E=n.bg,C=De(n,r),M=On(n),_=new Map;c.forEach((D,O)=>{_.set(D.name,D.color??M[O%M.length])});let I=null;if(p){let D=Ht(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)}I=[...P.entries()].sort((B,q)=>{let V=Math.min(...B[1].map(z=>yn(z.date))),X=Math.min(...q[1].map(z=>yn(z.date)));return V-X}).map(([B,q])=>({name:B,events:q})),H.length>0&&I.push({name:"(Other)",events:H});for(let B of O.entries)_.set(B.value,B.color)}}let L=a??p??null;function w(D){if(L){let O=Rn(D.metadata,e.timelineTagGroups,L);if(O)return O}return D.group&&_.has(D.group)?_.get(D.group):b}let v=1/0,S=-1/0,T="",N="";for(let D of l){let O=yn(D.date),P=D.endDate?yn(D.endDate):O;O<v&&(v=O,T=D.date),P>S&&(S=P,N=D.endDate??D.date)}for(let D of d){let O=yn(D.startDate),P=yn(D.endDate);Number.isFinite(O)&&O<v&&(v=O,T=D.startDate),Number.isFinite(P)&&P>S&&(S=P,N=D.endDate)}for(let D of u){let O=yn(D.date);Number.isFinite(O)&&(O<v&&(v=O,T=D.date),O>S&&(S=O,N=D.date))}let R=(S-v)*.05||.5,G=e.timelineTagGroups.length>0&&!e.noLegend?36:0,$=y?500:Math.max(600,l.length*40+200),A=o?ve.identity():ve.from(h,$);return{width:h,height:x,isVertical:y,tooltip:g,fillMode:s,textColor:b,mutedColor:k,bgColor:E,bg:C,swimlaneTagGroup:p,groupColorMap:_,tagLanes:I,eventColor:w,minDate:v,maxDate:S,datePadding:R,earliestStartDateStr:T,latestEndDateStr:N,tagLegendReserve:G,ctx:A}}function dj(){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 uj(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:g,fillMode:h}=o,{FADE_OPACITY:x,fadeReset:y,fadeToTagValue:b}=a,k=e.noTitle?null:e.title,{timelineEvents:E}=e,C=Se,M=uo,_=cr,I=Dn,L=Er,w=Fn,v=Lr,S=jr,T=20,N=It(t).select("svg"),R=N.select("g");if(!N.empty()&&!R.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(){Bh(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",Ht(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=Ht(Z);if(ot){let lt=ot.toLowerCase();b(R,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(R),N.selectAll("[data-legend-entry]").attr("opacity",1)},onGroupRendered:(Z,ot,at)=>{let lt=Ht(Z);if(ot.attr("data-tag-group",lt),at&&!u){let rt=W?.toLowerCase()===lt,ut=Fe(Z,_)+M,it=I+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})`);nn(Q,{...F,palette:n,isDark:r,width:m,activeGroup:J,callbacks:j})},z=function(){let U=H??l??null;R.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=Rn(et.metadata,e.timelineTagGroups,U)??(et.group&&g.has(et.group)?g.get(et.group):p):nt=et.group&&g.has(et.group)?g.get(et.group):p,Y.selectAll("rect").attr("fill",ee(n,nt,r,{mode:h})).attr("stroke",nt),Y.selectAll("circle:not(.tl-event-point-outline)").attr("fill",ee(n,nt,r,{mode:h})).attr("stroke",nt)})};var G=B,$=q,A=V,D=z;let O=k?50:10,P=e.timelineTagGroups.map(U=>{let Y=Fe(U.name,_)+M,K=u?8:T+4,et=I+Y+K;for(let nt of U.entries)et=et+L*2+v+Fe(nt.value,w)+S;return{group:U,minifiedWidth:Y,expandedWidth:et+I}}),H=c??null,W=l??null,X=new Map;for(let U of E)X.set(String(U.lineNumber),U);V()}}function fj(t,e,n,r,o,a,i,s,l,c,d,u){let{width:f,height:m,tooltip:p,fillMode:g,textColor:h,bgColor:x,bg:y,groupColorMap:b,eventColor:k,minDate:E,maxDate:C,datePadding:M,earliestStartDateStr:_,latestEndDateStr:I,tagLegendReserve:L,ctx:w}=o,{fadeToGroup:v,fadeToEra:S,fadeToMarker:T,fadeReset:N,setTagAttrs:R}=a,{timelineEvents:G,timelineGroups:$,timelineEras:A,timelineMarkers:D,timelineScale:O}=e,P=e.noTitle?null:e.title,H=w.structural(22),W=w.structural(5),B=w.structural(2),q=w.structural(4),V=w.structural(2),X=w.text(13),z=w.text(12),U=w.structural(7),Y=G.slice().sort((mt,xt)=>yn(mt.date)-yn(xt.date)),K=O?w.aesthetic(24):0,et=w.structural(22),nt=w.structural(22),J=A.length>0?et:0,F=D.length>0?nt:0,j=O?w.structural(40):0,Q={top:w.aesthetic(104)+j+J+F+L,right:w.aesthetic(40),bottom:w.aesthetic(40)+K,left:w.aesthetic(60)},Z=F?-(j+nt/2):0,ot=J?-(j+F+et/2):0,at=f-Q.left-Q.right,lt=w.structural(28),rt=lt*Y.length,ut=Q.top+rt+Q.bottom,tt=!s&&m>0&&ut>m,it=tt?m:ut,st=lr().domain([E-M,C+M]).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);w.isBelowFloor&&!tt&&ct.attr("width","100%");let pt=ct.append("g").attr("transform",`translate(${Q.left},${Q.top})`);if(eo(ct,P,e.titleLineNumber,f,h,i),$h(pt,A,st,!1,at,rt,(mt,xt)=>S(pt,mt,xt),()=>N(pt),O,p,n,J?ot:void 0,g,y),Gh(pt,D,st,!1,at,rt,mt=>T(pt,mt),()=>N(pt),O,p,n,F?Z:void 0,g,y),O&&qh(pt,st,!1,at,rt,h,E,C,il(_,I),il(I,_)),$.length>0&&!e.noLegend){let mt=O?-w.aesthetic(75):-w.aesthetic(55);NL(pt,$,b,h,n,r,mt,xt=>v(pt,xt),()=>N(pt))}Y.forEach((mt,xt)=>{let ht=xt*lt+lt/2,kt=st(yn(mt.date)),ft=k(mt),St=pt.append("g").attr("class","tl-event").attr("data-group",mt.group||"").attr("data-line-number",String(mt.lineNumber)).attr("data-date",String(yn(mt.date))).attr("data-end-date",mt.endDate?String(yn(mt.endDate)):null).style("cursor","pointer").on("mouseenter",function(Tt){mt.group&&$.length>0&&v(pt,mt.group),O?LL(pt,st,mt.date,mt.endDate,rt,ft):aa(p,sl(mt),Tt)}).on("mouseleave",function(){N(pt),O?CL(pt):Zs(p)}).on("mousemove",function(Tt){O||aa(p,sl(mt),Tt)}).on("click",()=>{i&&mt.lineNumber&&i(mt.lineNumber)});if(R(St,mt),mt.endDate){let Tt=st(yn(mt.endDate)),yt=Math.max(Tt-kt,4),Et=mt.label.length*U+w.aesthetic(16),Ct=yt>=Et,gt=ee(n,ft,r,{mode:g}),Dt=ft;if(mt.uncertain){let Pt=`uncertain-ts-${mt.lineNumber}`,Bt=`uncertain-ts-s-${mt.lineNumber}`,zt=ct.select("defs").node()||ct.append("defs").node(),Wt=It(zt);Wt.append("linearGradient").attr("id",Pt).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",Yt=>Yt.offset).attr("stop-color",g==="outline"?y:vt(ft,y,30)).attr("stop-opacity",Yt=>Yt.opacity),Wt.append("linearGradient").attr("id",Bt).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",Yt=>Yt.offset).attr("stop-color",ft).attr("stop-opacity",Yt=>Yt.opacity),gt=`url(#${Pt})`,Dt=`url(#${Bt})`}if(St.append("rect").attr("x",kt).attr("y",ht-H/2).attr("width",yt).attr("height",H).attr("rx",q).attr("fill",gt).attr("stroke",Dt).attr("stroke-width",V),Ct)St.append("text").attr("x",kt+w.aesthetic(8)).attr("y",ht).attr("dy","0.35em").attr("text-anchor","start").attr("fill",h).attr("font-size",`${X}px`).text(mt.label);else{let Pt=w.aesthetic(6),Bt=kt+yt>at*.6,zt=kt-Pt-Et>0,Wt=Bt&&zt;St.append("text").attr("x",Wt?kt-Pt:kt+yt+Pt).attr("y",ht).attr("dy","0.35em").attr("text-anchor",Wt?"end":"start").attr("fill",h).attr("font-size",`${X}px`).text(mt.label)}}else{let Tt=mt.label.length*U,yt=w.aesthetic(10),Et=kt>at*.6,Ct=kt-yt-Tt>0,gt=Et&&Ct;St.append("circle").attr("cx",kt).attr("cy",ht).attr("r",W).attr("fill",ee(n,ft,r,{mode:g})).attr("stroke",ft).attr("stroke-width",B),St.append("text").attr("x",gt?kt-yt:kt+yt).attr("y",ht).attr("dy","0.35em").attr("text-anchor",gt?"end":"start").attr("fill",h).attr("font-size",`${z}px`).text(mt.label)}})}function mj(t,e,n,r,o,a,i,s,l,c,d,u,f,m){let{width:p,height:g,tooltip:h,fillMode:x,textColor:y,bgColor:b,bg:k,groupColorMap:E,tagLanes:C,eventColor:M,minDate:_,maxDate:I,datePadding:L,earliestStartDateStr:w,latestEndDateStr:v,tagLegendReserve:S,ctx:T}=o,{fadeToGroup:N,fadeToEra:R,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 Pt=O.map(Wt=>Wt.name);J=(D.filter(Wt=>Wt.group===null||!Pt.includes(Wt.group)).length>0?[...Pt,"(Other)"]:Pt).map(Wt=>({name:Wt,events:D.filter(Yt=>Wt==="(Other)"?Yt.group===null||!Pt.includes(Yt.group):Yt.group===Wt)}))}let F=J.reduce((Pt,Bt)=>f.has(Bt.name)?Pt+1:Pt+Bt.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(Pt=>Pt.name.length))+2,ut=Math.max(0,...J.flatMap(Pt=>Pt.events.map(Bt=>Bt.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,xt=p-ct.left-ct.right,ht=(J.length-1)*V,kt=T.structural(28),ft=kt*F+ht,St=ct.top+ft+ct.bottom,Tt=!s&&g>0&&St>g,yt=Tt?g:St,Et=lr().domain([_-L,I+L]).range([0,xt]),Ct=It(t).append("svg").attr("width",p).attr("height",yt).attr("viewBox",`0 0 ${p} ${St}`).attr("preserveAspectRatio","xMidYMin meet").style("background",b);T.isBelowFloor&&!Tt&&Ct.attr("width","100%");let gt=Ct.append("g").attr("transform",`translate(${ct.left},${ct.top})`);eo(Ct,B,e.titleLineNumber,p,y,i),$h(gt,P,Et,!1,xt,ft,(Pt,Bt)=>R(gt,Pt,Bt),()=>$(gt),W,h,n,ot?mt:void 0,x,k),Gh(gt,H,Et,!1,xt,ft,Pt=>G(gt,Pt),()=>$(gt),W,h,n,at?pt:void 0,x,k),W&&qh(gt,Et,!1,xt,ft,y,_,I,il(w,v),il(v,w));let Dt=0;for(let Pt of J){let Bt=E.get(Pt.name)??y,zt=f.has(Pt.name),Wt=zt?"\u25B6":"\u25BC",Yt=-ct.left+5,Vt=ct.left-7,wt=Dt,Gt=q,Qt=T.structural(4),re=T.structural(4),Ot=`tl-band-clip-${hj++}`;if(gt.append("clipPath").attr("id",Ot).append("rect").attr("x",Yt).attr("y",wt).attr("width",Vt).attr("height",Gt).attr("rx",Qt),gt.append("rect").attr("class","tl-group-header-bg").attr("data-group",Pt.name).attr("x",Yt).attr("y",wt).attr("width",Vt).attr("height",Gt).attr("rx",Qt).attr("fill",ee(n,Bt,r,{mode:x})).style("pointer-events","none"),gt.append("rect").attr("class","tl-group-header-accent").attr("data-group",Pt.name).attr("x",Yt).attr("y",wt).attr("width",re).attr("height",Gt).attr("fill",Bt).attr("clip-path",`url(#${Ot})`).style("pointer-events","none"),gt.append("g").attr("class","tl-group-header").attr("data-group",Pt.name).style("cursor","pointer").on("mouseenter",()=>N(gt,Pt.name)).on("mouseleave",()=>$(gt)).on("click",()=>m(Pt.name)).append("text").attr("x",-ct.left+T.aesthetic(10)).attr("y",Dt+q/2).attr("dy","0.35em").attr("text-anchor","start").attr("fill",y).attr("font-size",`${nt}px`).attr("font-weight","600").text(`${Wt} ${Pt.name}`),Pt.events.length>0){let ne=Pt.events.map(Me=>yn(Me.date)),xe=Pt.events.filter(Me=>Me.endDate).map(Me=>yn(Me.endDate)),ue=Math.min(...ne),Kt=Math.max(...ne,...xe),Jt=Et(ue),ce=Et(Kt),Ce=Math.max(ce-Jt,T.structural(20));gt.append("g").attr("class",zt?"tl-group-summary":"tl-group-bar").attr("data-group",Pt.name).style("cursor","pointer").on("mouseenter",()=>N(gt,Pt.name)).on("mouseleave",()=>$(gt)).on("click",()=>m(Pt.name)).append("rect").attr("x",Jt).attr("y",Dt).attr("width",Ce).attr("height",q).attr("rx",U).attr("fill",ee(n,Bt,r,{mode:x})).attr("stroke",Bt).attr("stroke-width",Y)}if(zt){Dt+=kt+V;continue}Pt.events.forEach((ne,xe)=>{let ue=Dt+(xe+1)*kt+kt/2,Kt=Et(yn(ne.date)),Jt=gt.append("g").attr("class","tl-event").attr("data-group",Pt.name).attr("data-line-number",String(ne.lineNumber)).attr("data-date",String(yn(ne.date))).attr("data-end-date",ne.endDate?String(yn(ne.endDate)):null).style("cursor","pointer").on("mouseenter",function(ze){N(gt,Pt.name),W?LL(gt,Et,ne.date,ne.endDate,ft,Bt):aa(h,sl(ne),ze)}).on("mouseleave",function(){$(gt),W?CL(gt):Zs(h)}).on("mousemove",function(ze){W||aa(h,sl(ne),ze)}).on("click",()=>{i&&ne.lineNumber&&i(ne.lineNumber)});A(Jt,ne);let ce=M(ne),Ie=!ne.endDate?"\u25C6":"\u25CF",Me=Jt.append("text").attr("class","tl-event-label").attr("x",-ct.left+T.aesthetic(20)).attr("y",ue).attr("dy","0.35em").attr("text-anchor","start").attr("font-size",`${K}px`).attr("fill",y);if(Me.append("tspan").attr("fill",ce).text(Ie),Me.append("tspan").attr("fill",y).text(" "+ne.label),ne.endDate){let ze=Et(yn(ne.endDate)),Qe=Math.max(ze-Kt,4),jn=ee(n,ce,r,{mode:x}),ln=ce;if(ne.uncertain){let ie=`uncertain-${ne.lineNumber}`,se=`uncertain-s-${ne.lineNumber}`,he=Ct.select("defs").node()||Ct.append("defs").node(),me=It(he);me.append("linearGradient").attr("id",ie).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",je=>je.offset).attr("stop-color",x==="outline"?k:vt(ce,k,30)).attr("stop-opacity",je=>je.opacity),me.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",je=>je.offset).attr("stop-color",ce).attr("stop-opacity",je=>je.opacity),jn=`url(#${ie})`,ln=`url(#${se})`}Jt.append("rect").attr("x",Kt).attr("y",ue-q/2).attr("width",Qe).attr("height",q).attr("rx",U).attr("fill",jn).attr("stroke",ln).attr("stroke-width",Y)}else Jt.append("circle").attr("cx",Kt).attr("cy",ue).attr("r",X).attr("fill",ee(n,ce,r,{mode:x})).attr("stroke",ce).attr("stroke-width",z)}),Dt+=(Pt.events.length+1)*kt+V}}function pj(t,e,n,r,o,a,i,s,l,c,d,u){let{width:f,height:m,tooltip:p,fillMode:g,textColor:h,mutedColor:x,bgColor:y,bg:b,groupColorMap:k,tagLanes:E,eventColor:C,minDate:M,maxDate:_,datePadding:I,earliestStartDateStr:L,latestEndDateStr:w,tagLegendReserve:v,ctx:S}=o,{fadeToGroup:T,fadeToEra:N,fadeToMarker:R,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(E!=null||H==="group"&&D.length>0){let Q,Z;if(E)Q=E.map(mt=>mt.name),Z=new Map(E.map(mt=>[mt.name,mt.events]));else{let mt=D.map(ht=>ht.name);Q=A.filter(ht=>ht.group===null||!mt.includes(ht.group)).length>0?[...mt,"(Other)"]:mt,Z=new Map(Q.map(ht=>[ht,A.filter(kt=>ht==="(Other)"?kt.group===null||!mt.includes(kt.group):kt.group===ht)]))}let ot=Q.length,at=W?S.aesthetic(40):0,lt=P.length>0?S.aesthetic(30):0,rt={top:S.aesthetic(104)+lt+v,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=lr().domain([M-I,_+I]).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})`);eo(ct,q,e.titleLineNumber,f,h,i),$h(pt,O,st,!0,ut,tt,(mt,xt)=>N(pt,mt,xt),()=>G(pt),W,p,n,void 0,g,b),Gh(pt,P,st,!0,ut,tt,mt=>R(pt,mt),()=>G(pt),W,p,n,void 0,g,b),W&&qh(pt,st,!0,ut,tt,h,M,_,il(L,w),il(w,L)),(B||E)&&Q.forEach((mt,xt)=>{let ht=xt*it,kt=xt%2===0?h:"transparent";pt.append("rect").attr("class","tl-swimlane").attr("data-group",mt).attr("x",ht).attr("y",0).attr("width",it).attr("height",tt).attr("fill",kt).attr("opacity",.06)}),Q.forEach((mt,xt)=>{let ht=xt*it,kt=k.get(mt)??h,ft=ht+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",kt).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 Tt=Z.get(mt)??[];for(let yt of Tt){let Et=st(yn(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(yn(yt.date))).attr("data-end-date",yt.endDate?String(yn(yt.endDate)):null).style("cursor","pointer").on("mouseenter",function(Dt){T(pt,mt),aa(p,sl(yt),Dt)}).on("mouseleave",function(){G(pt),Zs(p)}).on("mousemove",function(Dt){aa(p,sl(yt),Dt)}).on("click",()=>{i&&yt.lineNumber&&i(yt.lineNumber)});$(Ct,yt);let gt=C(yt);if(yt.endDate){let Dt=st(yn(yt.endDate)),Pt=Math.max(Dt-Et,4),Bt=ee(n,gt,r,{mode:g}),zt=gt;if(yt.uncertain){let Wt=`uncertain-vg-${yt.lineNumber}`,Yt=`uncertain-vg-s-${yt.lineNumber}`,Vt=ct.select("defs").node()||ct.append("defs").node(),wt=It(Vt);wt.append("linearGradient").attr("id",Wt).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",Gt=>Gt.offset).attr("stop-color",g==="outline"?b:vt(kt,b,30)).attr("stop-opacity",Gt=>Gt.opacity),wt.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",Gt=>Gt.offset).attr("stop-color",gt).attr("stop-opacity",Gt=>Gt.opacity),Bt=`url(#${Wt})`,zt=`url(#${Yt})`}Ct.append("rect").attr("x",ft-Y/2).attr("y",Et).attr("width",Y).attr("height",Pt).attr("rx",z).attr("fill",Bt).attr("stroke",zt).attr("stroke-width",U),Ct.append("text").attr("x",ft+Y+S.aesthetic(2)).attr("y",Et+Pt/2).attr("dy","0.35em").attr("fill",h).attr("font-size",`${K}px`).text(yt.label)}else Ct.append("circle").attr("cx",ft).attr("cy",Et).attr("r",V).attr("fill",ee(n,gt,r,{mode:g})).attr("stroke",gt).attr("stroke-width",X),Ct.append("text").attr("x",ft+S.aesthetic(10)).attr("y",Et).attr("dy","0.35em").attr("fill",h).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+v,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=lr().domain([M-I,_+I]).range([0,lt]),tt=A.slice().sort((ct,pt)=>yn(ct.date)-yn(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})`);eo(it,q,e.titleLineNumber,f,h,i),$h(st,O,ut,!0,at,lt,(ct,pt)=>N(st,ct,pt),()=>G(st),W,p,n,void 0,g,b),Gh(st,P,ut,!0,at,lt,ct=>R(st,ct),()=>G(st),W,p,n,void 0,g,b),W&&qh(st,ut,!0,at,lt,h,M,_,il(L,w),il(w,L)),D.length>0&&!e.noLegend&&NL(st,D,k,h,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(yn(ct.date)),mt=C(ct),xt=st.append("g").attr("class","tl-event").attr("data-group",ct.group||"").attr("data-line-number",String(ct.lineNumber)).attr("data-date",String(yn(ct.date))).attr("data-end-date",ct.endDate?String(yn(ct.endDate)):null).style("cursor","pointer").on("mouseenter",function(ht){ct.group&&D.length>0&&T(st,ct.group),aa(p,sl(ct),ht)}).on("mouseleave",function(){G(st),Zs(p)}).on("mousemove",function(ht){aa(p,sl(ct),ht)}).on("click",()=>{i&&ct.lineNumber&&i(ct.lineNumber)});if($(xt,ct),ct.endDate){let ht=ut(yn(ct.endDate)),kt=Math.max(ht-pt,4),ft=ee(n,mt,r,{mode:g}),St=mt;if(ct.uncertain){let Tt=`uncertain-v-${ct.lineNumber}`,yt=`uncertain-v-s-${ct.lineNumber}`,Et=it.select("defs").node()||it.append("defs").node(),Ct=It(Et);Ct.append("linearGradient").attr("id",Tt).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",gt=>gt.offset).attr("stop-color",g==="outline"?b:vt(mt,b,30)).attr("stop-opacity",gt=>gt.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",gt=>gt.offset).attr("stop-color",mt).attr("stop-opacity",gt=>gt.opacity),ft=`url(#${Tt})`,St=`url(#${yt})`}xt.append("rect").attr("x",rt-Y/2).attr("y",pt).attr("width",Y).attr("height",kt).attr("rx",z).attr("fill",ft).attr("stroke",St).attr("stroke-width",U),xt.append("text").attr("x",rt+Y+S.aesthetic(4)).attr("y",pt+kt/2).attr("dy","0.35em").attr("fill",h).attr("font-size",`${et}px`).text(ct.label)}else xt.append("circle").attr("cx",rt).attr("cy",pt).attr("r",V).attr("fill",ee(n,mt,r,{mode:g})).attr("stroke",mt).attr("stroke-width",X),xt.append("text").attr("x",rt+Y+S.aesthetic(4)).attr("y",pt).attr("dy","0.35em").attr("fill",h).attr("font-size",`${et}px`).text(ct.label);xt.append("text").attr("x",rt-S.aesthetic(14)).attr("y",ct.endDate?ut(yn(ct.date))+Math.max(ut(yn(ct.endDate))-ut(yn(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 Bh(t,e,n,r,o,a,i,s,l,c,d){let u=cj(t,e,n,r,a,i,s);if(!u)return;s=u.swimlaneTagGroup;let{isVertical:f,tagLanes:m}=u,p=dj(),g=vL.get(t);g||(g=new Set,vL.set(t,g));function h(y){g.has(y)?g.delete(y):g.add(y),Bh(t,e,n,r,o,a,i,s,l,c,d)}if(f){pj(t,e,n,r,u,p,o,a,s,i,l,c);return}m!=null||e.timelineSort!=="time"&&e.timelineGroups.length>0?mj(t,e,n,r,u,p,o,a,s,i,l,c,g,h):fj(t,e,n,r,u,p,o,a,s,i,l,c),uj(t,e,n,r,u,p,o,a,s,i,l,c,d)}var vL,hj,b4=dt(()=>{"use strict";Oe();li();Cn();Ke();p4();hr();Ii();Cf();oi();He();Oe();dr();br();vL=new WeakMap,hj=0});function Hh(t,e){return yo(t,e)}var x4=dt(()=>{"use strict";xs()});function _L(){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 Fh(n)}function Fh(t){this._=t}function yj(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 bj(t,e){for(var n=0,r=t.length,o;n<r;++n)if((o=t[n]).name===e)return o.value}function TL(t,e,n){for(var r=0,o=t.length;r<o;++r)if(t[r].name===e){t[r]=gj,t=t.slice(0,r).concat(t.slice(r+1));break}return n!=null&&t.push({name:e,value:n}),t}var gj,AL,RL=dt(()=>{"use strict";gj={value:function(){}};Fh.prototype=_L.prototype={constructor:Fh,on:function(t,e){var n=this._,r=yj(t+"",n),o,a=-1,i=r.length;if(arguments.length<2){for(;++a<i;)if((o=(t=r[a]).type)&&(o=bj(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]=TL(n[o],t.name,e);else if(e==null)for(o in n)n[o]=TL(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 Fh(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)}};AL=_L});var IL={};de(IL,{dispatch:()=>AL});var PL=dt(()=>{"use strict";RL()});var GL=zk((pEt,$L)=>{"use strict";var xj=(PL(),Uk(IL)).dispatch,w4=Math.PI/180,wj={archimedean:OL,rectangular:Tj},Qf=64,Wh=2048;$L.exports=function(){var t=[256,256],e=kj,n=Ej,r=Sj,o=DL,a=DL,i=Mj,s=OL,l=[],c=1/0,d=xj("word","end"),u=null,f=Math.random,m=()=>(~~(f()*6)-3)*30,p={},g=Aj;p.canvas=function(y){return arguments.length?(g=ll(y),p):g},p.start=function(){var y=h(g()),b=_j((t[0]>>5)*t[1]),k=null,E=l.length,C=-1,M=[],_=l.map(function(L,w){return L.text=e.call(this,L,w),L.font=n.call(this,L,w),L.style=o.call(this,L,w),L.weight=a.call(this,L,w),L.rotate=m.call(this,L,w),L.size=~~r.call(this,L,w),L.padding=i.call(this,L,w),L}).sort(function(L,w){return w.size-L.size});return u&&clearInterval(u),u=setInterval(I,0),I(),p;function I(){for(var L=Date.now();Date.now()-L<c&&++C<E&&u;){var w=_[C];w.x=t[0]*(f()+.5)>>1,w.y=t[1]*(f()+.5)>>1,vj(y,w,_,C),w.hasText&&x(b,w,k)&&(M.push(w),d.call("word",p,w),k?Cj(k,w):k=[{x:w.x+w.x0,y:w.y+w.y0},{x:w.x+w.x1,y:w.y+w.y1}],w.x-=t[0]>>1,w.y-=t[1]>>1)}C>=E&&(p.stop(),d.call("end",p,M,k))}},p.stop=function(){u&&(clearInterval(u),u=null);for(let y of l)delete y.sprite;return p};function h(y){let b=y.getContext("2d",{willReadFrequently:!0});y.width=y.height=1;let k=Math.sqrt(b.getImageData(0,0,1,1).data.length>>2);return y.width=(Qf<<5)/k,y.height=Wh/k,b.fillStyle=b.strokeStyle="red",{context:b,ratio:k}}function x(y,b,k){for(var E=[{x:0,y:0},{x:t[0],y:t[1]}],C=b.x,M=b.y,_=Math.sqrt(t[0]*t[0]+t[1]*t[1]),I=s(t),L=f()<.5?1:-1,w=-L,v,S,T;(v=I(w+=L))&&(S=~~v[0],T=~~v[1],!(Math.min(Math.abs(S),Math.abs(T))>=_));)if(b.x=C+S,b.y=M+T,!(b.x+b.x0<0||b.y+b.y0<0||b.x+b.x1>t[0]||b.y+b.y1>t[1])&&(!k||Nj(b,k))&&!Lj(b,y,t[0])){for(var N=b.sprite,R=b.width>>5,G=t[0]>>5,$=b.x-(R<<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<=R;B++)y[P+B]|=H<<D|(B<R?(H=N[W*R+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=ll(y),p):n},p.fontStyle=function(y){return arguments.length?(o=ll(y),p):o},p.fontWeight=function(y){return arguments.length?(a=ll(y),p):a},p.rotate=function(y){return arguments.length?(m=ll(y),p):m},p.text=function(y){return arguments.length?(e=ll(y),p):e},p.spiral=function(y){return arguments.length?(s=wj[y]||y,p):s},p.fontSize=function(y){return arguments.length?(r=ll(y),p):r},p.padding=function(y){return arguments.length?(i=ll(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 kj(t){return t.text}function Ej(){return"serif"}function DL(){return"normal"}function Sj(t){return Math.sqrt(t.value)}function Mj(){return 1}function vj(t,e,n,r){if(!e.sprite){var o=t.context,a=t.ratio;o.clearRect(0,0,(Qf<<5)/a,Wh/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 w=o.measureText(e.text),v=-Math.floor(w.width/2),S=(w.width+1)*a,T=e.size<<1;if(e.rotate){var d=Math.sin(e.rotate*w4),u=Math.cos(e.rotate*w4),f=S*u,m=S*d,p=T*u,g=T*d;S=Math.max(Math.abs(f+g),Math.abs(f-g))+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>=Qf<<5&&(i=0,s+=l,l=0),s+T>=Wh)break;o.translate((i+(S>>1))/a,(s+(T>>1))/a),e.rotate&&o.rotate(e.rotate*w4),o.fillText(e.text,v,0),e.padding&&(o.lineWidth=2*e.padding,o.strokeText(e.text,v,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 h=o.getImageData(0,0,(Qf<<5)/a,Wh/a).data,x=[];--r>=0;)if(e=n[r],!!e.hasText){for(var y=e.width,b=y>>5,k=e.y1-e.y0,E=0;E<k*b;E++)x[E]=0;if(i=e.xoff,i==null)return;s=e.yoff;for(var C=0,M=-1,_=0;_<k;_++){for(var E=0;E<y;E++){var I=b*_+(E>>5),L=h[(s+_)*(Qf<<5)+(i+E)<<2]?1<<31-E%32:0;x[I]|=L,C|=L}C?M=_:(e.y0++,k--,_--,s++)}e.y1=e.y0+M,e.sprite=x.slice(0,(e.y1-e.y0)*b)}}}function Lj(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 Cj(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 Nj(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 OL(t){var e=t[0]/t[1];return function(n){return[e*(n*=.1)*Math.cos(n),n*Math.sin(n)]}}function Tj(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 _j(t){for(var e=[],n=-1;++n<t;)e[n]=0;return e}function Aj(){return document.createElement("canvas")}function ll(t){return typeof t=="function"?t:function(){return t}}});function zh(t,e){return yo(t,e)}var k4=dt(()=>{"use strict";xs()});function Yh(t,e){return yo(t,e)}var S4=dt(()=>{"use strict";xs()});function ga(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 cl(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 M4(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 $j(t,e,n,r,o,a,i,s){let l=(p,g,h,x,y,b)=>Math.sign((h-p)*(b-g)-(x-g)*(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,g,h,x,y,b)=>Math.min(p,h)<=y&&y<=Math.max(p,h)&&Math.min(g,x)<=b&&b<=Math.max(g,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 FL(t){let e=[...t?.reserved??[]],n=[],r=t?.obstacles??[],o=t?.markers??[];return{hitsPlaced:a=>e.some(i=>ga(a,i)),hitsObstacle:a=>r.some(i=>ga(a,i)),hitsMarker:a=>o.some(i=>cl(a,i)),leaderCrosses:([a,i,s,l])=>n.some(c=>$j(a,i,s,l,c[0],c[1],c[2],c[3])),leaderHitsPlaced:([a,i,s,l])=>e.some(c=>M4(a,i,s,l,c)),commit:(a,i)=>{e.push(a),i&&n.push(i)},get placed(){return e}}}function Vh(t,e,n,r,o){let a=o+4,i=a+2,s=t.map(d=>({cx:d.cx,cy:d.cy,r:d.r??r})),l=[],c=[];for(let d=0;d<t.length;d++){let u=t[d],f=(u.r??r)+4,m=At(u.label,o)+8,p=null,g=[{gen:x=>{let y=u.cx-m/2,b=u.cy-x-a;return b<e.top||y<e.left||y+m>e.right?null:{rect:{x:y,y:b,w:m,h:a},textX:u.cx,textY:b+a/2,anchor:"middle"}}},{gen:x=>{let y=u.cx-m/2,b=u.cy+x;return b+a>e.bottom||y<e.left||y+m>e.right?null:{rect:{x:y,y:b,w:m,h:a},textX:u.cx,textY:b+a/2,anchor:"middle"}}},{gen:x=>{let y=u.cx+x,b=u.cy-a/2;return y+m>e.right||b<e.top||b+a>e.bottom?null:{rect:{x:y,y:b,w:m,h:a},textX:y,textY:u.cy,anchor:"start"}}},{gen:x=>{let y=u.cx-x-m,b=u.cy-a/2;return y<e.left||b<e.top||b+a>e.bottom?null:{rect:{x:y,y:b,w:m,h:a},textX:y+m,textY:u.cy,anchor:"end"}}}];for(let{gen:x}of g)for(let y=f;;y+=i){let b=x(y);if(!b)break;let k=!1;for(let E of l)if(ga(b.rect,E)){k=!0;break}if(!k){for(let E of s)if(cl(b.rect,E)){k=!0;break}}if(!k){for(let E of n)if(ga(b.rect,E)){k=!0;break}}if(!k){let E=y;(!p||E<p.dist)&&(p={rect:b.rect,textX:b.textX,textY:b.textY,anchor:b.anchor,dist:E});break}}if(!p){let x=u.cx-m/2,y=u.cy-f-a;p={rect:{x,y,w:m,h:a},textX:u.cx,textY:y+a/2,anchor:"middle",dist:f}}l.push(p.rect);let h;if(p.dist>f+i){let x=p.textX-u.cx,y=p.textY-u.cy,b=Math.atan2(y,x),k=u.r??r,E=u.cx+Math.cos(b)*k,C=u.cy+Math.sin(b)*k,M=Math.max(p.rect.x,Math.min(u.cx,p.rect.x+p.rect.w)),_=Math.max(p.rect.y,Math.min(u.cy,p.rect.y+p.rect.h));h={x1:E,y1:C,x2:M,y2:_}}c.push({label:u.label,x:p.textX,y:p.textY,anchor:p.anchor,...h!==void 0&&{connectorLine:h}})}return c}var Md=dt(()=>{"use strict";Ye()});function Uh(t,e){return yo(t,e)}var v4=dt(()=>{"use strict";xs()});function t1(t){for(let e of zL)if(e.pattern.test(t))return e.type;return"default"}var zL,qEt,L4=dt(()=>{"use strict";zL=[{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"}];qEt=zL.length});function ae(t){return t.normalize("NFC").replace(Gj," ").trim().toLocaleLowerCase("en-US")}function Sr(t){return t.normalize("NFC").trim()}var Gj,ro=dt(()=>{"use strict";Gj=/\s+/gu});function vd(t,e){let n=[];(t.includes("->")||t.includes("~>"))&&n.push(Rt(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",YL.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(Rt(e,`Label contains a control character (U+${s}). Remove it and use plain text.`,"error",YL.CONTROL_CHAR_IN_LABEL));break}}return n}function ko(t,e){let n=t.trim();if(n.length===0)return{label:void 0,diagnostics:[]};let r=vd(n,e);return{label:n,diagnostics:r}}function XL(t){if(Hj.test(t)||Fj.test(t))return{error:"Bidirectional arrows are no longer supported. Use two separate lines: 'A -msg-> B' and 'B -msg-> A'"};if(VL.test(t)||UL.test(t)){let n=t.match(VL)??t.match(UL),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:qj,async:!1},{re:Bj,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 YL,qj,Bj,VL,UL,Hj,Fj,di=dt(()=>{"use strict";en();YL={ARROW_SUBSTRING_IN_LABEL:"E_ARROW_SUBSTRING_IN_LABEL",CONTROL_CHAR_IN_LABEL:"E_CONTROL_CHAR_IN_LABEL"};qj=/^(.+?)\s*-(.+)->\s*(.+)$/,Bj=/^(.+?)\s*~(.+)~>\s*(.+)$/,VL=/^(.+?)\s*<-(.+)-\s*(.+)$/,UL=/^(.+?)\s*<~(.+)~\s*(.+)$/,Hj=/^(.+?)\s*<-(.+)->\s*(.+)$/,Fj=/^(.+?)\s*<~(.+)~>\s*(.+)$/});var jL={};de(jL,{isSequenceBlock:()=>Gr,isSequenceNote:()=>oo,isSequenceSection:()=>Zo,looksLikeSequence:()=>N4,parseSequenceDgmo:()=>Xh});function Gr(t){return t.kind==="block"}function Zo(t){return t.kind==="section"}function oo(t){return t.kind==="note"}function Jj(t,e,n,r,o){if(!t.toLowerCase().startsWith("note")||t.length>4&&t[4]!==" ")return null;let i=t.match(Qj);if(i){let l=i[1]?.toLowerCase()||"right",c=i[2]||null;if(!c){if(!o)return{kind:"skip"};c=o}let d=ae(mn(c));if(n.has(d)){let u=e.find(f=>ae(f.id)===d);return{kind:"multi-head",position:l,participantId:u?.id??c}}}let s=t.match(Zj);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(ae(o))?{kind:"multi-head",position:u,participantId:o}:{kind:"skip"}:{kind:"skip"};let p=tK(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(ae(o))?{kind:"single",position:u,participantId:o,text:f}:{kind:"skip"}:{kind:"skip"}}return o?n.has(ae(o))?{kind:"single",position:"right",participantId:o,text:l}:{kind:"skip"}:{kind:"skip"}}return null}function tK(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=ae(s);if(n.has(l)){let c=t.substring(i+1).trim();return{participantId:e.find(u=>ae(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(ae(s)!==ae(a.id))continue;let l=t.substring(i);if(l===""||l[0]===" "||l[0]===" ")return{participantId:a.id,text:l.trim()}}return null}function Xh(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=Ln(r),s=(S,T)=>{let N=Rt(S,T);r.diagnostics.push(N),r.error||(r.error=qe(N))},l=(S,T)=>{r.diagnostics.push(Rt(S,T,"warning"))};if(!t?.trim())return i(0,"Empty content");let c=t.split(`
|
|
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=Te(T);N?.chartType==="sequence"&&(d=!0,m=S,N.title&&(r.title=N.title,r.titleLineNumber=S+1));break}let p=null,g=new Set,h=new Map,x=(S,T,N)=>{let R=mn(S),G=ae(R),$=R.trim(),A=N?.label??$;if(g.has(G)){let D=r.participants.find(O=>ae(O.id)===G);return D?((Sr(D.label)!==Sr(A)||Sr(D.id)!==Sr($))&&r.diagnostics.push(Rt(T,_o({incomingDisplay:$,incomingLine:T,existingDisplay:D.id,existingLine:D.lineNumber}),"warning",To.NAME_MERGED)),D.id):h.get(G)??$}return g.add(G),h.set(G,$),b=!0,r.participants.push({id:$,label:A,type:N?.type??t1(R),lineNumber:T,...N?.position!==void 0?{position:N.position}:{},...N?.metadata&&Object.keys(N.metadata).length>0?{metadata:N.metadata}:{}}),$},y=[],b=!0,k=()=>(b&&(y=[...r.participants].sort((S,T)=>T.label.length-S.label.length),b=!1),y),E=new Map,C=null,M=new Map,_=(S,T)=>{let N=Ue($y,new Set(M.keys())),R=Ge(S,N,M);return T!=null&&We(R.meta,N,G=>l(T,G),R.name),Object.keys(R.meta).length>0?{core:R.name,meta:R.meta,...R.alias!==void 0&&{alias:R.alias}}:{core:S}},I=(S,T)=>{if(S?.position===void 0)return;let N=S.position;delete S.position;let R=parseInt(N,10);if(!/^-?\d+$/.test(N.trim())||Number.isNaN(R)){s(T,`'position: ${N}' must be an integer slot index`);return}return R},L=[],w=()=>{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},v=null;for(let S=0;S<c.length;S++){let T=c[S],N=T.trim(),R=S+1;if(!N){p=null,C=null;continue}if(S===m)continue;let G=N.match(Xj);if(G){let xt=G[1].trim(),ht=G[2]?.trim(),kt,ft=G[3]?.trim()||"",St=!1,Tt=Ni(ft);if(Tt.collapsed&&(St=!0,ft=Tt.rest),ft){let yt=Ue($y,new Set(M.keys())),Et=Ge(ft,yt,M);We(Et.meta,yt,Ct=>l(R,Ct),Et.name),Object.keys(Et.meta).length>0&&(kt=Et.meta),kt?.collapsed?.toLowerCase()==="true"&&(St=!0,delete kt.collapsed,Object.keys(kt).length===0&&(kt=void 0))}ht&&l(R,`'(${ht})' parens-color syntax removed from sequence diagrams \u2014 use 'tag:' groups for coloring`),u=!0,p={name:xt,participantIds:[],lineNumber:R,...kt?{metadata:kt}:{},...St?{collapsed:!0}:{}},r.groups.push(p);continue}if(N.startsWith("[")){let xt=N.match(jj);if(xt&&xt[1].includes("|")){let ht=xt[1],kt=ht.indexOf("|"),ft=ht.substring(0,kt).trim().replace(/\([^)]*\)$/,"").trim(),St=ht.substring(kt).replace(/^\|\s*/,"").trim();s(R,`Metadata goes after the bracket with no pipe \u2014 use '[${ft}] ${St}' (e.g. '[Backend] t: Product'), not '[${ht.trim()}]'`);continue}}if(p&&pe(T)===0&&(p=null),N.startsWith("//"))continue;if(N.startsWith("#")){s(R,"Use // for comments");continue}let $=an(N);if($){if(u){s(R,"Tag groups must appear before sequence content");continue}let xt={name:$.name,...$.alias!==void 0&&{alias:$.alias},entries:[],lineNumber:R};C=xt,$.alias&&M.set($.alias.toLowerCase(),$.name.toLowerCase()),M.set(ae($.name),$.name.toLowerCase()),r.tagGroups.push(xt);continue}if(C&&!u&&pe(T)>0){let{text:xt,isDefault:ht}=on(N),{label:kt,color:ft}=ye(xt,e,r.diagnostics,R);(ht||C.entries.length===0)&&(C.defaultValue=kt),C.entries.push({value:kt,color:ft??cn,lineNumber:R});continue}C&&(C=null);let A=N.match(Kj);if(A){let xt=pe(T);for(;L.length>0;){let St=L[L.length-1];if(xt>St.indent)break;L.pop()}let ht=A[1].trim(),kt=ht.match(/^(.+?)\((red|orange|yellow|green|blue|purple|teal|cyan|gray|black|white)\)$/);kt&&l(R,`'(${kt[2]})' parens-color syntax removed from sequence diagrams \u2014 use 'tag:' groups for coloring`),u=!0,f=!0;let ft={kind:"section",label:kt?kt[1].trim():ht,lineNumber:R};r.sections.push(ft),w().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 xt=O.toLowerCase();if(!(xt==="note"||xt.startsWith("note "))){let ht=N.substring(D+1).trim();if(u){s(R,`Options like '${xt}: ${ht}' must appear before the first message or declaration`);continue}if(xt==="title"){r.title=ht,r.titleLineNumber=R;continue}r.options[xt]=ht;continue}}{let xt=N.toLowerCase();if(xt.startsWith("no-")){let kt=xt.substring(3);if(C4.has(kt)||zj.has(kt)){if(u){s(R,`Options like '${N}' must appear before the first message or declaration`);continue}r.options[kt]="off";continue}}let ht=N.match(Wn);if(ht){let kt=ht[1].toLowerCase(),ft=ht[2].trim();if(Wj.has(kt)||C4.has(kt)){if(u){s(R,`Options like '${N}' must appear before the first message or declaration`);continue}r.options[kt]=ft;continue}}if(C4.has(xt)){if(u){s(R,`Options like '${N}' must appear before the first message or declaration`);continue}if(jo.has(xt)){for(let kt of jo)delete r.options[kt];if(xt==="fill-tint")continue}r.options[xt]="on";continue}}let{core:H,meta:W,alias:B}=_(N,R),q=/^note(\s|$)/i.test(N)?null:H.match(Vj);if(q){u=!0;let xt=q[1],ht=q[2].toLowerCase(),kt=q[3]?.trim()||"",ft=Yj.has(ht)?ht:"default";B!==void 0&&o.set(B,xt);let St=kt.match(/^(.*?)\s*\bas\s+([A-Za-z][A-Za-z0-9_]{0,11})\s*$/);St&&o.set(St[2],xt);let Tt=I(W,R),yt=x(xt,R,{type:ft,...Tt!==void 0&&{position:Tt},...W!==void 0&&{metadata:W}});if(p&&!p.participantIds.includes(yt)){let Et=E.get(yt);Et?s(R,`Participant '${xt}' is already in group '${Et}' \u2014 participants can only belong to one group`):(p.participantIds.push(yt),E.set(yt,p.name))}continue}let{core:V,meta:X}=_(N,R),z=V.match(Uj);if(z&&!e1.test(V)){let xt=z[1],ht=z[2].trim();s(R,`'${xt}(${ht})' parens-color syntax is no longer supported \u2014 use 'tag:' groups for coloring`),u=!0;let kt=x(xt,R,{...X!==void 0&&{metadata:X}});if(p&&!p.participantIds.includes(kt)){let ft=E.get(kt);ft?s(R,`Participant '${xt}' is already in group '${ft}' \u2014 participants can only belong to one group`):(p.participantIds.push(kt),E.set(kt,p.name))}continue}{let{core:xt,meta:ht,alias:kt}=_(N,R),ft=p&&pe(T)>0;if(/^\S+$/.test(xt)&&!e1.test(xt)&&(ft||!f||ht)){u=!0;let St=xt;kt!==void 0&&o.set(kt,St);let Tt=I(ht,R),yt=x(St,R,{...Tt!==void 0&&{position:Tt},...ht!==void 0&&{metadata:ht}});if(p&&!p.participantIds.includes(yt)){let Et=E.get(yt);Et?s(R,`Participant '${St}' is already in group '${Et}' \u2014 participants can only belong to one group`):(p.participantIds.push(yt),E.set(yt,p.name))}continue}}let U=pe(T);for(;L.length>0;){let xt=L[L.length-1];if(U>xt.indent)break;if(U===xt.indent&&(xt.block.type==="if"||xt.block.type==="parallel")){let ht=N.toLowerCase();if(ht==="else"||ht.startsWith("else if "))break}L.pop()}let{core:Y,meta:K}=_(N,R),et=Y.match(/^async\s+(.+)$/i);if(et&&e1.test(et[1])){s(R,"Use ~> for async messages: A ~> B: message");continue}let nt=XL(Y);if(nt&&"error"in nt){s(R,nt.error);continue}if(nt){u=!0,f=!0;let{from:xt,to:ht,label:kt,async:ft}=nt,St=x(a(xt),R),Tt=x(a(ht),R);v=St;let yt=ko(kt,R);yt.diagnostics.forEach(gt=>r.diagnostics.push(gt));let Et=yt.label??kt,Ct={kind:"message",from:St,to:Tt,label:Et,lineNumber:R,...ft?{async:!0}:{},...K?{metadata:K}:{}};r.messages.push(Ct),w().push(Ct);continue}let J=Y.match(/^(\S+)\s*->\s*([^\s:]+)\s*:\s*(.+)$/),F=Y.match(/^(\S+)\s*~>\s*([^\s:]+)\s*:\s*(.+)$/),j=J||F;if(j){let xt=j[1],ht=j[2],kt=j[3].trim();s(R,`Colon syntax is no longer supported. Use '${xt} ${F?"~":"-"}${kt}${F?"~>":"->"} ${ht}' instead`);continue}if(Y.match(/^(.+?)\s*(?:<->|<~>)\s*(.+)/)){s(R,"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 xt=at[1],ht=at[2];s(R,`Left-pointing arrows are no longer supported. Write '${ht} -> ${xt}' instead`);continue}let lt=Y.match(/^(.+?)\s*->\s*(.+)$/),rt=Y.match(/^(.+?)\s*~>\s*(.+)$/),ut=lt||rt;if(ut){u=!0,f=!0;let xt=ut[1],ht=ut[2],kt=x(a(xt),R),ft=x(a(ht),R);v=kt;let St={kind:"message",from:kt,to:ft,label:"",lineNumber:R,...rt?{async:!0}:{},...K?{metadata:K}:{}};r.messages.push(St),w().push(St);continue}let tt=N.match(/^if\s+(.+)$/i);if(tt){u=!0,f=!0;let xt={kind:"block",type:"if",label:tt[1].trim(),children:[],elseChildren:[],lineNumber:R};w().push(xt),L.push({block:xt,indent:U,inElse:!1});continue}let it=N.match(/^loop\s+(.+)$/i);if(it){u=!0,f=!0;let xt={kind:"block",type:"loop",label:it[1].trim(),children:[],elseChildren:[],lineNumber:R};w().push(xt),L.push({block:xt,indent:U,inElse:!1});continue}let st=N.match(/^parallel(?:\s+(.+))?$/i);if(st){u=!0,f=!0;let xt={kind:"block",type:"parallel",label:st[1]?.trim()||"",children:[],elseChildren:[],lineNumber:R};w().push(xt),L.push({block:xt,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 xt=L[L.length-1];if(xt.block.type==="parallel"){s(R,"parallel blocks don't support else if \u2014 list all concurrent messages directly inside the block");continue}if(xt.block.type==="if"){let ht={label:ct[1].trim(),children:[],lineNumber:R};xt.block.elseIfBranches||(xt.block.elseIfBranches=[]),xt.block.elseIfBranches.push(ht),xt.activeElseIfBranch=ht,xt.inElse=!1}}continue}if(N.toLowerCase()==="else"){if(L.length>0&&L[L.length-1].indent===U){let xt=L[L.length-1];if(xt.block.type==="parallel"){s(R,"parallel blocks don't support else \u2014 list all concurrent messages directly inside the block");continue}xt.block.type==="if"&&(xt.inElse=!0,delete xt.activeElseIfBranch,xt.block.elseLineNumber=R)}continue}let pt=N.match(/^elif\b\s*(.*)$/i);if(pt){let xt=pt[1].trim(),ht=xt?" "+xt:"";s(R,`'elif' is not a keyword. Did you mean 'else if${ht}'?`);continue}let mt=N.match(/^else\s+(.+)$/i);if(mt){let xt=mt[1].trim();s(R,`'else' does not take a label. Did you mean 'else if ${xt}'?`);continue}{let xt=Jj(N,r.participants,g,k(),v);if(xt){if(xt.kind==="single"){let ht={kind:"note",text:xt.text,position:xt.position,participantId:xt.participantId,lineNumber:R,endLineNumber:R};f=!0,w().push(ht);continue}if(xt.kind==="multi-head"){let ht=[];for(;S+1<c.length;){let ft=c[S+1],St=ft.trim();if(!St||pe(ft)<=U)break;ht.push(St),S++}if(ht.length===0)continue;let kt={kind:"note",text:ht.join(`
|
|
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=Te(T);N?.chartType==="sequence"&&(d=!0,m=S,N.title&&(r.title=N.title,r.titleLineNumber=S+1));break}let p=null,g=new Set,h=new Map,x=(S,T,N)=>{let R=mn(S);R===S.trim()&&R.includes(":")&&s(T,`'${R}' 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=ae(R),$=R.trim(),A=N?.label??$;if(g.has(G)){let D=r.participants.find(O=>ae(O.id)===G);return D?((Sr(D.label)!==Sr(A)||Sr(D.id)!==Sr($))&&r.diagnostics.push(Rt(T,_o({incomingDisplay:$,incomingLine:T,existingDisplay:D.id,existingLine:D.lineNumber}),"warning",To.NAME_MERGED)),D.id):h.get(G)??$}return g.add(G),h.set(G,$),b=!0,r.participants.push({id:$,label:A,type:N?.type??t1(R),lineNumber:T,...N?.position!==void 0?{position:N.position}:{},...N?.metadata&&Object.keys(N.metadata).length>0?{metadata:N.metadata}:{}}),$},y=[],b=!0,k=()=>(b&&(y=[...r.participants].sort((S,T)=>T.label.length-S.label.length),b=!1),y),E=new Map,C=null,M=new Map,_=(S,T)=>{let N=Ue($y,new Set(M.keys())),R=Ge(S,N,M);return T!=null&&We(R.meta,N,G=>l(T,G),R.name),Object.keys(R.meta).length>0?{core:R.name,meta:R.meta,...R.alias!==void 0&&{alias:R.alias}}:{core:S}},I=(S,T)=>{if(S?.position===void 0)return;let N=S.position;delete S.position;let R=parseInt(N,10);if(!/^-?\d+$/.test(N.trim())||Number.isNaN(R)){s(T,`'position: ${N}' must be an integer slot index`);return}return R},L=[],w=()=>{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},v=null;for(let S=0;S<c.length;S++){let T=c[S],N=T.trim(),R=S+1;if(!N){p=null,C=null;continue}if(S===m)continue;let G=N.match(Xj);if(G){let xt=G[1].trim(),ht=G[2]?.trim(),kt,ft=G[3]?.trim()||"",St=!1,Tt=Ni(ft);if(Tt.collapsed&&(St=!0,ft=Tt.rest),ft){let yt=Ue($y,new Set(M.keys())),Et=Ge(ft,yt,M);We(Et.meta,yt,Ct=>l(R,Ct),Et.name),Object.keys(Et.meta).length>0&&(kt=Et.meta),kt?.collapsed?.toLowerCase()==="true"&&(St=!0,delete kt.collapsed,Object.keys(kt).length===0&&(kt=void 0))}ht&&l(R,`'(${ht})' parens-color syntax removed from sequence diagrams \u2014 use 'tag:' groups for coloring`),u=!0,p={name:xt,participantIds:[],lineNumber:R,...kt?{metadata:kt}:{},...St?{collapsed:!0}:{}},r.groups.push(p);continue}if(N.startsWith("[")){let xt=N.match(jj);if(xt&&xt[1].includes("|")){let ht=xt[1],kt=ht.indexOf("|"),ft=ht.substring(0,kt).trim().replace(/\([^)]*\)$/,"").trim(),St=ht.substring(kt).replace(/^\|\s*/,"").trim();s(R,`Metadata goes after the bracket with no pipe \u2014 use '[${ft}] ${St}' (e.g. '[Backend] t: Product'), not '[${ht.trim()}]'`);continue}}if(p&&pe(T)===0&&(p=null),N.startsWith("//"))continue;if(N.startsWith("#")){s(R,"Use // for comments");continue}let $=an(N);if($){if(u){s(R,"Tag groups must appear before sequence content");continue}let xt={name:$.name,...$.alias!==void 0&&{alias:$.alias},entries:[],lineNumber:R};C=xt,$.alias&&M.set($.alias.toLowerCase(),$.name.toLowerCase()),M.set(ae($.name),$.name.toLowerCase()),r.tagGroups.push(xt);continue}if(C&&!u&&pe(T)>0){let{text:xt,isDefault:ht}=on(N),{label:kt,color:ft}=ye(xt,e,r.diagnostics,R);(ht||C.entries.length===0)&&(C.defaultValue=kt),C.entries.push({value:kt,color:ft??cn,lineNumber:R});continue}C&&(C=null);let A=N.match(Kj);if(A){let xt=pe(T);for(;L.length>0;){let St=L[L.length-1];if(xt>St.indent)break;L.pop()}let ht=A[1].trim(),kt=ht.match(/^(.+?)\((red|orange|yellow|green|blue|purple|teal|cyan|gray|black|white)\)$/);kt&&l(R,`'(${kt[2]})' parens-color syntax removed from sequence diagrams \u2014 use 'tag:' groups for coloring`),u=!0,f=!0;let ft={kind:"section",label:kt?kt[1].trim():ht,lineNumber:R};r.sections.push(ft),w().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 xt=O.toLowerCase();if(!(xt==="note"||xt.startsWith("note "))){let ht=N.substring(D+1).trim();if(u){s(R,`Options like '${xt}: ${ht}' must appear before the first message or declaration`);continue}if(xt==="title"){r.title=ht,r.titleLineNumber=R;continue}r.options[xt]=ht;continue}}{let xt=N.toLowerCase();if(xt.startsWith("no-")){let kt=xt.substring(3);if(C4.has(kt)||zj.has(kt)){if(u){s(R,`Options like '${N}' must appear before the first message or declaration`);continue}r.options[kt]="off";continue}}let ht=N.match(Wn);if(ht){let kt=ht[1].toLowerCase(),ft=ht[2].trim();if(Wj.has(kt)||C4.has(kt)){if(u){s(R,`Options like '${N}' must appear before the first message or declaration`);continue}r.options[kt]=ft;continue}}if(C4.has(xt)){if(u){s(R,`Options like '${N}' must appear before the first message or declaration`);continue}if(jo.has(xt)){for(let kt of jo)delete r.options[kt];if(xt==="fill-tint")continue}r.options[xt]="on";continue}}let{core:H,meta:W,alias:B}=_(N,R),q=/^note(\s|$)/i.test(N)?null:H.match(Vj);if(q){u=!0;let xt=q[1],ht=q[2].toLowerCase(),kt=q[3]?.trim()||"",ft=Yj.has(ht)?ht:"default";B!==void 0&&o.set(B,xt);let St=kt.match(/^(.*?)\s*\bas\s+([A-Za-z][A-Za-z0-9_]{0,11})\s*$/);St&&o.set(St[2],xt);let Tt=I(W,R),yt=x(xt,R,{type:ft,...Tt!==void 0&&{position:Tt},...W!==void 0&&{metadata:W}});if(p&&!p.participantIds.includes(yt)){let Et=E.get(yt);Et?s(R,`Participant '${xt}' is already in group '${Et}' \u2014 participants can only belong to one group`):(p.participantIds.push(yt),E.set(yt,p.name))}continue}let{core:V,meta:X}=_(N,R),z=V.match(Uj);if(z&&!e1.test(V)){let xt=z[1],ht=z[2].trim();s(R,`'${xt}(${ht})' parens-color syntax is no longer supported \u2014 use 'tag:' groups for coloring`),u=!0;let kt=x(xt,R,{...X!==void 0&&{metadata:X}});if(p&&!p.participantIds.includes(kt)){let ft=E.get(kt);ft?s(R,`Participant '${xt}' is already in group '${ft}' \u2014 participants can only belong to one group`):(p.participantIds.push(kt),E.set(kt,p.name))}continue}{let{core:xt,meta:ht,alias:kt}=_(N,R),ft=p&&pe(T)>0;if(/^\S+$/.test(xt)&&!e1.test(xt)&&(ft||!f||ht)){u=!0;let St=xt;kt!==void 0&&o.set(kt,St);let Tt=I(ht,R),yt=x(St,R,{...Tt!==void 0&&{position:Tt},...ht!==void 0&&{metadata:ht}});if(p&&!p.participantIds.includes(yt)){let Et=E.get(yt);Et?s(R,`Participant '${St}' is already in group '${Et}' \u2014 participants can only belong to one group`):(p.participantIds.push(yt),E.set(yt,p.name))}continue}}let U=pe(T);for(;L.length>0;){let xt=L[L.length-1];if(U>xt.indent)break;if(U===xt.indent&&(xt.block.type==="if"||xt.block.type==="parallel")){let ht=N.toLowerCase();if(ht==="else"||ht.startsWith("else if "))break}L.pop()}let{core:Y,meta:K}=_(N,R),et=Y.match(/^async\s+(.+)$/i);if(et&&e1.test(et[1])){s(R,"Use ~> for async messages: A ~> B: message");continue}let nt=XL(Y);if(nt&&"error"in nt){s(R,nt.error);continue}if(nt){u=!0,f=!0;let{from:xt,to:ht,label:kt,async:ft}=nt,St=x(a(xt),R),Tt=x(a(ht),R);v=St;let yt=ko(kt,R);yt.diagnostics.forEach(gt=>r.diagnostics.push(gt));let Et=yt.label??kt,Ct={kind:"message",from:St,to:Tt,label:Et,lineNumber:R,...ft?{async:!0}:{},...K?{metadata:K}:{}};r.messages.push(Ct),w().push(Ct);continue}let J=Y.match(/^(.+?)\s*->\s*([^:"]+?)\s*:\s*(.+)$/),F=Y.match(/^(.+?)\s*~>\s*([^:"]+?)\s*:\s*(.+)$/),j=J||F;if(j){let xt=j[1],ht=j[2],kt=j[3].trim();s(R,`Colon syntax is no longer supported. Use '${xt} ${F?"~":"-"}${kt}${F?"~>":"->"} ${ht}' instead`);continue}if(Y.match(/^(.+?)\s*(?:<->|<~>)\s*(.+)/)){s(R,"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 xt=at[1],ht=at[2];s(R,`Left-pointing arrows are no longer supported. Write '${ht} -> ${xt}' instead`);continue}let lt=Y.match(/^(.+?)\s*->\s*(.+)$/),rt=Y.match(/^(.+?)\s*~>\s*(.+)$/),ut=lt||rt;if(ut){u=!0,f=!0;let xt=ut[1],ht=ut[2],kt=x(a(xt),R),ft=x(a(ht),R);v=kt;let St={kind:"message",from:kt,to:ft,label:"",lineNumber:R,...rt?{async:!0}:{},...K?{metadata:K}:{}};r.messages.push(St),w().push(St);continue}let tt=N.match(/^if\s+(.+)$/i);if(tt){u=!0,f=!0;let xt={kind:"block",type:"if",label:tt[1].trim(),children:[],elseChildren:[],lineNumber:R};w().push(xt),L.push({block:xt,indent:U,inElse:!1});continue}let it=N.match(/^loop\s+(.+)$/i);if(it){u=!0,f=!0;let xt={kind:"block",type:"loop",label:it[1].trim(),children:[],elseChildren:[],lineNumber:R};w().push(xt),L.push({block:xt,indent:U,inElse:!1});continue}let st=N.match(/^parallel(?:\s+(.+))?$/i);if(st){u=!0,f=!0;let xt={kind:"block",type:"parallel",label:st[1]?.trim()||"",children:[],elseChildren:[],lineNumber:R};w().push(xt),L.push({block:xt,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 xt=L[L.length-1];if(xt.block.type==="parallel"){s(R,"parallel blocks don't support else if \u2014 list all concurrent messages directly inside the block");continue}if(xt.block.type==="if"){let ht={label:ct[1].trim(),children:[],lineNumber:R};xt.block.elseIfBranches||(xt.block.elseIfBranches=[]),xt.block.elseIfBranches.push(ht),xt.activeElseIfBranch=ht,xt.inElse=!1}}continue}if(N.toLowerCase()==="else"){if(L.length>0&&L[L.length-1].indent===U){let xt=L[L.length-1];if(xt.block.type==="parallel"){s(R,"parallel blocks don't support else \u2014 list all concurrent messages directly inside the block");continue}xt.block.type==="if"&&(xt.inElse=!0,delete xt.activeElseIfBranch,xt.block.elseLineNumber=R)}continue}let pt=N.match(/^elif\b\s*(.*)$/i);if(pt){let xt=pt[1].trim(),ht=xt?" "+xt:"";s(R,`'elif' is not a keyword. Did you mean 'else if${ht}'?`);continue}let mt=N.match(/^else\s+(.+)$/i);if(mt){let xt=mt[1].trim();s(R,`'else' does not take a label. Did you mean 'else if ${xt}'?`);continue}{let xt=Jj(N,r.participants,g,k(),v);if(xt){if(xt.kind==="single"){let ht={kind:"note",text:xt.text,position:xt.position,participantId:xt.participantId,lineNumber:R,endLineNumber:R};f=!0,w().push(ht);continue}if(xt.kind==="multi-head"){let ht=[];for(;S+1<c.length;){let ft=c[S+1],St=ft.trim();if(!St||pe(ft)<=U)break;ht.push(St),S++}if(ht.length===0)continue;let kt={kind:"note",text:ht.join(`
|
|
25
25
|
`),position:xt.position,participantId:xt.participantId,lineNumber:R,endLineNumber:S+1};f=!0,w().push(kt);continue}continue}}l(R,`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=>e1.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 R of N)if(oo(R))S.add(R.participantId);else if(Gr(R)&&(T(R.children),T(R.elseChildren),R.elseIfBranches))for(let G of R.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(gn(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});kr(S,r.tagGroups,l,be),In(r.tagGroups,l,s)}return r}function N4(t){return t?t.split(`
|
|
26
26
|
`).some(n=>{let r=n.trim();return r.startsWith("//")?!1:e1.test(r)}):!1}var Wj,C4,zj,Yj,Vj,Uj,Xj,jj,Kj,e1,Zj,Qj,Ld=dt(()=>{"use strict";L4();en();ro();di();Re();yr();Oe();Wj=new Set(["active-tag"]),C4=new Set(["fill-tint","fill-solid","fill-outline","no-title","no-legend","legend-inline"]),zj=new Set(["activations"]),Yj=new Set(["database","actor","queue","cache"]);Vj=/^([^:]+?)\s+is\s+an?\s+(\w+)(?:\s+(.+))?$/i,Uj=/^(\S+?)\((red|orange|yellow|green|blue|purple|teal|cyan|gray|black|white)\)\s*$/,Xj=/^\[([^\]|]+?)(?:\(([^)]+)\))?\]\s*(.*)$/,jj=/^\[([^\]]+)\]\s*(.*)$/,Kj=/^==\s+(.+?)(?:\s*==)?\s*$/,e1=/\S+\s*(?:<-\S+-|<~\S+~|-\S+->|~\S+~>|->|~>|<-|<~)\s*\S+/,Zj=/^note\s+(.+)$/i,Qj=/^note(?:\s+(right|left)(?:\s+(?:of\s+)?(.+?))?)?\s*$/i});var hc,ZEt,T4=dt(()=>{"use strict";hc={INFRA_NO_ENTRY:{code:"W_INFRA_NO_ENTRY",severity:"warning",chartType:"infra",title:"Infra diagram has no entry point",message:"Infra diagram has no 'internet' or 'edge' entry point \u2014 an infra diagram traces request traffic from an entry inward, so without one nothing carries traffic. Add an 'internet' or 'edge' node and route from it.",hint:"Add an 'internet' or 'edge' node and draw an edge from it into the graph.",example:`infra
|
|
27
27
|
gw
|