@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/auto.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`}},q5t=Object.values(to)});function Mp(t){return Object.prototype.hasOwnProperty.call(nk,t.toLowerCase())}function Pe(t,e){if(!t||t.startsWith("#"))return null;let n=t.toLowerCase();if(!Mp(n))return null;if(e){let r=e.colors[n];if(r)return r}return nk[n]??null}function ok(t){let e=rk[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 kV(t){if(/^(#|rgba?\(|hsla?\()/i.test(t))return!0;let e=t.toLowerCase();return rk[e]!==void 0&&!Mp(e)}function ak(t,e){if(!kV(t))return null;let n=ok(t),r=n?` Nearest: ${n}.`:"";return Rt(e,`Color "${t}" is not a valid DGMO color \u2014 DGMO accepts only these 11 named colors: ${na.join(", ")} (no hex, no CSS color names).${r}`,"warning",qy)}function qn(t,e,n,r){let o=Pe(t,r);if(o!==null)return o;if(/^(#|rgba?\(|hsla?\()/i.test(t)){let s=ok(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: ${na.join(", ")}.${l}`,"error",qy));return}let a=be(t,na),i=a?` ${a}`:"";n.push(Rt(e,`Unknown color "${t}". DGMO accepts only these 11 named colors: ${na.join(", ")} (no hex, no CSS color names).${i}`,"warning",qy))}var Or,nk,na,Ql,qy,rk,F5t,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"},nk={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},na=Object.freeze(["red","orange","yellow","green","blue","purple","teal","cyan","gray","black","white"]),Ql=Object.freeze(["red","green","blue","yellow","teal","purple","orange","cyan"]);qy="E_INVALID_COLOR",rk=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"});F5t=[Or.nord10,Or.nord14,Or.nord13,Or.nord12,Or.nord15,Or.nord11,Or.nord7,Or.nord8]});function ga(t){let e=new Set;for(let n of SV)t(n)&&e.add(n.token);return e}var SV,ik,sk,lk,ck,dk,uk,fk,mk,pk,hk,gk,yk,z5t,Us=dt(()=>{"use strict";SV=[{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"}];ik=ga(()=>!0),sk=ga(t=>!!t.infra?.includes("top-level")),lk=ga(t=>!!t.infra?.includes("behavior")),ck=ga(t=>!!t.infra?.includes("edge")),dk=ga(t=>!!t.gantt?.includes("option")),uk=ga(t=>!!t.gantt?.includes("boolean")),fk=ga(t=>t.map===!0),mk=ga(t=>t.category==="directive"&&!t.colonKey&&!t.noHighlight),pk=ga(t=>t.category==="control"&&!t.colonKey&&!t.noHighlight),hk=ga(t=>t.category==="status"&&!t.colonKey&&!t.noHighlight),gk=ga(t=>t.category==="modifier"&&!t.colonKey&&!t.noHighlight),yk=ga(t=>!!t.colonKey),z5t=ga(t=>!!t.noHighlight)});var bk,xf,vp,wf=dt(()=>{"use strict";bk=[{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=bk,vp=bk.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(MV(r));return{keys:t.keys,tagAliases:n}}function MV(t){return t.trim().toLowerCase().replace(/[^a-z0-9_-]+/g,"-").replace(/^-+|-+$/g,"")}function Ni(t,e){return t.keys.has(e)||t.tagAliases.has(e)}var By,rd,xk,wk,od,Ek,kk,Hy,Fy,Jl,Sk,Lp,Wy,Mk,Ef,vk,kf,Sf,Lk,zy,Yy,Ck,Vy,Uy,Xy,yr=dt(()=>{"use strict";By=vr(["color","description","role","collapsed","position"]),rd=vr(["color","description","collapsed","icon"]),xk=vr(["heat","size","width","label","style","clock"]),wk=vr(["color","description","role","location","email","phone"]),od=vr(["color","description","tech","type","collapsed"]),Ek=vr(["color","description","domain"]),kk=vr(["color"]),Hy=vr(["color","description","wip","assignee","due","collapsed"]),Fy=vr(["color","description","status"]),Jl=vr(["color","description","duration","offset","progress","start","collapsed"]),Sk=vr(["color","description","confidence","collapsed"]),Lp=vr(["color","description","heat"]),Wy=vr([]),Mk=vr(["shape","at","collapsed"]),Ef=vr(["color","description","duration"]),vk=vr(["color","description","collapsed"]),kf=vr(["color","description","quadrant","ring","trend"]),Sf=vr(["color","description","width","span"]),Lk=vr(["color","description","score","emotion","pain","opportunity","thought"]),zy=vr(["color","description"]),Yy=vr(["color","description"]),Ck=vr(["heat"]),Vy=vr(["color","description"]),Uy=vr(["sex","b","d","bp","dp","occupation","military","education","religion","burial"]),Xy=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(!jy.has(a)){if(n&&r!==void 0){let s=ak(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 vV(t){let e=t.trim().toLowerCase();return Mf.has(e)?e:null}function Qn(t,e){let n=vV(t);if(n){if(Ko.has(n))for(let r of Ko)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 Xs.has(o)?{chartType:o,title:void 0}:null}let r=e.substring(0,n).toLowerCase();return Xs.has(r)?{chartType:r,title:e.substring(n+1).trim()||void 0}:null}function Cp(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(!LV.test(o))return null;let a=o.toLowerCase();if(e.has(a)||ik.has(a))return null;if(r===-1)return/\d/.test(o)?null:o;let i=n.substring(r+1).trim();return!i||!CV.test(i)?null:o}function Go(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 ra(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 js(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 xs(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 ad(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=xs(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 E=a[b],k=c(E);if(k!==null){let M=E.slice(E.indexOf(" ")+1).trim();y=k,k==="left"?h=M||h:x=M||x;continue}let C=ye(E,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 Ti(t){let e=Math.max(t.lastIndexOf(" "),t.lastIndexOf(" "));if(e<0)return{label:t};let n=t.substring(e+1);return jy.has(n)?{label:t.substring(0,e).trimEnd(),colorName:n}:{label:t}}function _i(t){let e=t.trimEnd();return e==="collapsed"?{rest:"",collapsed:!0}:/[ \t]collapsed$/.test(e)?{rest:e.slice(0,e.length-9).trimEnd().replace(/,\s*$/,""),collapsed:!0}:{rest:t,collapsed:!1}}function id(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 jy.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 Tk(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 _k(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(Nk.test(i)&&Ni(n,i.toLowerCase()))return o.start}else if(a<0&&Nk.test(o.text)&&Ni(n,o.text.toLowerCase())&&t.substring(o.end).replace(/^[ \t]+/,"").startsWith(":"))return o.start}return-1}function Ky(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,ek(s),"warning",tk.EMPTY_METADATA_VALUE));continue}o[c]=l}return o}function vf(t,e){return _k(t,Tk(t),e)}function Ge(t,e,n=new Map,r,o,a,i={}){let s=Tk(t),l=_k(t,s,e),c,d;l===-1?(c=t.trim(),d=""):(c=t.substring(0,l).trimEnd(),d=t.substring(l));let u=Ti(c),f=u.label,m;if(i.peelAlias!==!1){let g=f.match(NV);g&&(m=g[1],f=f.substring(0,g.index).trimEnd())}let p=d.length>0?Ky(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(Ni(e,a))continue;let i=be(a,o);n(`Unknown metadata key "${a}".${i?" "+i:""}`)}if(r){let a=r.match(TV);if(a){let i=a[1].toLowerCase();if(!Ni(e,i)){let s=be(i,o);s&&n(`Unknown metadata key "${i}". ${s}`)}}}}var jy,Xs,Wn,Mf,Ko,LV,CV,Nk,NV,TV,Re=dt(()=>{"use strict";Kn();en();Us();wf();yr();jy=new Set(na),Xs=new Set(vp);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"]);Ko=new Set(["fill-tint","fill-solid","fill-outline"]);LV=/^[A-Za-z][A-Za-z0-9-]*$/,CV=/^[A-Za-z][A-Za-z\s'&,.\-—–]*$/;Nk=/^[A-Za-z][A-Za-z0-9_-]*$/,NV=/\s+as\s+([A-Za-z][A-Za-z0-9_]{0,11})$/;TV=/\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 _V(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=sd.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)),_V(n,e)}}function AV(t){return/^[A-Za-z][A-Za-z0-9_]{0,11}$/.test(t)}function Ks(t){return Rk.test(t)}function RV(t){if(!Rk.test(t))return null;let e=t.replace(/^tag\s+/i,"");if(!e.trim())return null;let n=js(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&&AV(n[c+1]))r=n.slice(0,c).map(d=>ra(d)).join(" "),o=n[c+1],s=c+2;else{let d=l;if(l<n.length){let u=m=>na.includes(m),f=n[l].replace(/,$/,"");d=u(f)?l-1:l,d<1&&(d=1)}r=n.slice(0,d).map(u=>ra(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);na.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 Er(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"),Ak.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&&!Ak.test(o.alias)&&r(o.lineNumber,`Tag group alias "${o.alias}" contains invalid characters \u2014 use a single identifier (letters, digits, underscore, hyphen)`)}function Np(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 oa(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 RV(t)}var cn,sd,Rk,Ak,Oe=dt(()=>{"use strict";Re();Kn();cn="",sd=Ql;Rk=/^tag\s+/i;Ak=/^[A-Za-z_][A-Za-z0-9_-]*$/});function Lf(t){let e=t.toLowerCase().replace(/\.$/,""),n=IV.indexOf(e);return n>=0?n+1:(n=PV.indexOf(e.slice(0,3)),n>=0?n+1:0)}function Ik(t){let e=[],n=new RegExp(DV.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 Tp(t){let e=t.match(HV);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 Zy(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 qo(t,e={}){let n=e.dateOrder??"mdy",r=t.match(OV);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($V);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=Tp(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(GV);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=Zy(d,l,c),f=Tp(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(qV);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=Zy(d,l,c),f=Tp(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(BV);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=Zy(d,u,f),p=Tp(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 aa(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 FV(t,e,n,r){return t!==r.y?t-r.y:e!==r.m?e-r.m:n-r.d}function _p(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:aa(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&&FV(o,t.month,t.day,e.prev)<0&&(o+=1),e.contextYear=o,e.prev={y:o,m:t.month,d:t.day},{internal:aa(t,o),hint:n,error:r}}function Ap(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 Qy(t,e={}){let n=t.trim(),r=qo(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 aa(r.token,o)}var IV,PV,DV,OV,$V,GV,qV,BV,HV,Zs=dt(()=>{"use strict";IV=["january","february","march","april","may","june","july","august","september","october","november","december"],PV=["jan","feb","mar","apr","may","jun","jul","aug","sep","oct","nov","dec"];DV=/\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;OV=/^(\d{1,4})(?:-(\d{2})(?:-(\d{2}))?)?\s+(BCE|BC|CE|AD)\b/i,$V=/^(\d{4})(?:-(\d{2})(?:-(\d{2}))?)?/,GV=/^([A-Za-z]{3,9})\.?\s+(\d{1,2})(?:,?\s+(\d{4}))?/,qV=/^(\d{1,2})\s+([A-Za-z]{3,9})\.?(?:\s+(\d{4}))?/,BV=/^(\d{1,2})[/-](\d{1,2})(?:[/-](\d{2,4}))?/,HV=/^[T ](\d{1,2}):(\d{2})(?::(\d{2}))?/});function Pk(t,e){let n=qo(t,{dateOrder:e?.order});if(!n)return null;let{token:r,consumed:o}=n;return{date:e?.resolve?e.resolve(r).internal:aa(r,r.year??e?.currentYear??new Date().getFullYear()),rest:t.slice(o),timeValid:!r.invalidTime,invalidTime:r.invalidTime}}function Rp(t,e){let n=Pk(t,e);if(!n)return null;let{date:r}=n,{rest:o}=n,a=o.match(zV);if(a){o=o.slice(a[0].length);let s=Pk(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 Dk(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 YV(t,e,n){let r=Dk(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=Dk(t);return e.sign*e.year+(e.month-1)/12+(e.day-1)/365+e.hour/8760+e.minute/525600+e.second/31536e3}function Ok(t,e,n,r,o,a,i){let s=[],l=Rp(t,i);if(!l){if(/^\d/.test(t)){let E=t.split(/\s/)[0];if(!/^\d{4}(?:-\d{2}(?:-\d{2})?)?$/.test(E))return s.push(Rt(e,`Expected date format YYYY, YYYY-MM, or YYYY-MM-DD. Got '${E}'.`,"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(Ef,new Set([...o.keys(),...o.values()])),d=Ge(l.remainder,c,o);We(d.meta,c,E=>s.push(Rt(e,E,"warning")));let u=d.name,f=l.endDate,m=l.uncertain,p={...d.meta},g=null;if(p.duration){let E=p.duration,k=E.match(/^(.+)\?$/),C=k?k[1]:E;k&&(m=!0);let M=C.match(WV);M?g={amount:parseFloat(M[1]),unit:M[2]}:s.push(Rt(e,`Invalid duration '${E}'. 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=YV(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 WV,zV,Cf=dt(()=>{"use strict";en();Re();yr();Zs();WV=/^(\d+(?:\.\d{1,2})?)(min|[dwmyhs])(\?)?$/,zV=/^\s*(?:->|–>)\s*/});var $k,Gk=dt(()=>{"use strict";$k={rotate:"none",max:0,minSize:14,maxSize:80}});function yo(t,e){return VV(t,e)}function VV(t,e){let n={type:null,title:null,titleLineNumber:null,orientation:"horizontal",periods:[],data:[],words:[],cloudOptions:{...$k},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=qo($,{dateOrder:i});if(A?.token.year!=null){c=A.token.sign*A.token.year;break}}let d=Ap({order:i,directiveYear:l,prescanYear:c,noCurrentYear:s}),u={order:i,resolve:G=>_p(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?aa(G,G.year):m==null&&s?null:aa(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 $=qo(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},E=[],k=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}=Ti(" "+V);if(Y&&U.trim()==="")X=qn(Y,O,n.diagnostics,e)??null;else{let K=Ue(Ef,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}),k=B}continue}if(/^#{2,}\s+/.test(A)&&(n.type==="arc"||n.type==="timeline")){let B=A.replace(/^#{2,}\s+/,"").replace(/\s*\([^)]*\)\s*$/,"").trim();n.diagnostics.push(Rt(O,`'## ${B}' is no longer supported. Use '[${B}]' instead`,"warning"));continue}if(D===0&&(k=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(Go(B[4])??B[4]):1;if(z<0){n.diagnostics.push(oe(ri,O,{value:z,label:`${q} -> ${V}`,channel:"arc link weights"}));continue}if(n.links.push({source:q,target:V,value:z,color:X,lineNumber:O}),k!==null){let U=n.arcNodeGroups.find(Y=>Y.name===k);if(U){let Y=new Set(n.arcNodeGroups.flatMap(K=>K.nodes));Y.has(q)||U.nodes.push(q),Y.has(V)||U.nodes.push(V)}}continue}}if(n.type==="timeline"&&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(Ef,new Set([...T.keys(),...T.values()])),q=Ok(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}=Ti(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=xs(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=xs(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}=Ti(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(Go(z[2])??z[2]),et=parseFloat(Go(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(Zl,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=Go(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}=Ti(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(Zl,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(Go(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(ri,O,{value:V,label:A.substring(0,B).trim(),channel:"wordcloud weights"})):E.push(A)}else E.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&&E.length>0&&(n.words=XV(E.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){Er(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 XV(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||UV.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 UV,ws=dt(()=>{"use strict";Kn();en();Re();yr();Oe();Cf();Zs();Gk();UV=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 KV(t){return t.replace(/(\s[\w:.-]+=")([^"]*)"/g,(e,n,r)=>!r.includes("<")&&!r.includes(">")&&!r.includes("&")?e:`${n}${r.replace(jV,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}"`)}function $r(t){return KV(t.outerHTML)}var jV,oi=dt(()=>{"use strict";jV=/&(?![a-zA-Z][a-zA-Z0-9]*;|#\d+;|#[xX][0-9a-fA-F]+;)/g});var Ip,Jy,tb=dt(()=>{"use strict";Ip="http://www.w3.org/1999/xhtml",Jy={svg:"http://www.w3.org/2000/svg",xhtml:Ip,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"}});function Pp(t){var e=t+="",n=e.indexOf(":");return n>=0&&(e=t.slice(0,n))!=="xmlns"&&(t=t.slice(n+1)),Jy.hasOwnProperty(e)?{space:Jy[e],local:t}:t}var eb=dt(()=>{"use strict";tb()});function ZV(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===Ip&&e.documentElement.namespaceURI===Ip?e.createElement(t):e.createElementNS(n,t)}}function QV(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function Dp(t){var e=Pp(t);return(e.local?QV:ZV)(e)}var nb=dt(()=>{"use strict";eb();tb()});function JV(){}function Op(t){return t==null?JV:function(){return this.querySelector(t)}}var rb=dt(()=>{"use strict"});function qk(t){typeof t!="function"&&(t=Op(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 Bk=dt(()=>{"use strict";Ai();rb()});function ob(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}var Hk=dt(()=>{"use strict"});function tU(){return[]}function Fk(t){return t==null?tU:function(){return this.querySelectorAll(t)}}var Wk=dt(()=>{"use strict"});function eU(t){return function(){return ob(t.apply(this,arguments))}}function zk(t){typeof t=="function"?t=eU(t):t=Fk(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 Yk=dt(()=>{"use strict";Ai();Hk();Wk()});function Vk(t){return function(){return this.matches(t)}}function $p(t){return function(e){return e.matches(t)}}var Gp=dt(()=>{"use strict"});function rU(t){return function(){return nU.call(this.children,t)}}function oU(){return this.firstElementChild}function Uk(t){return this.select(t==null?oU:rU(typeof t=="function"?t:$p(t)))}var nU,Xk=dt(()=>{"use strict";Gp();nU=Array.prototype.find});function iU(){return Array.from(this.children)}function sU(t){return function(){return aU.call(this.children,t)}}function jk(t){return this.selectAll(t==null?iU:sU(typeof t=="function"?t:$p(t)))}var aU,Kk=dt(()=>{"use strict";Gp();aU=Array.prototype.filter});function Zk(t){typeof t!="function"&&(t=Vk(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 Qk=dt(()=>{"use strict";Ai();Gp()});function qp(t){return new Array(t.length)}var ab=dt(()=>{"use strict"});function Jk(){return new zr(this._enter||this._groups.map(qp),this._parents)}function Nf(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}var ib=dt(()=>{"use strict";ab();Ai();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 tS(t){return function(){return t}}var eS=dt(()=>{"use strict"});function lU(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 cU(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 dU(t){return t.__data__}function nS(t,e){if(!arguments.length)return Array.from(this,dU);var n=e?cU:lU,r=this._parents,o=this._groups;typeof t!="function"&&(t=tS(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=uU(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,E,k;y<p;++y)if(E=g[y]){for(y>=b&&(b=y+1);!(k=h[b])&&++b<p;);E._next=k||null}}return i=new zr(i,r),i._enter=s,i._exit=l,i}function uU(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}var rS=dt(()=>{"use strict";Ai();ib();eS()});function oS(){return new zr(this._exit||this._groups.map(qp),this._parents)}var aS=dt(()=>{"use strict";ab();Ai()});function iS(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 sS=dt(()=>{"use strict"});function lS(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 cS=dt(()=>{"use strict";Ai()});function dS(){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 uS=dt(()=>{"use strict"});function fS(t){t||(t=fU);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 fU(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}var mS=dt(()=>{"use strict";Ai()});function pS(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}var hS=dt(()=>{"use strict"});function gS(){return Array.from(this)}var yS=dt(()=>{"use strict"});function bS(){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 xS=dt(()=>{"use strict"});function wS(){let t=0;for(let e of this)++t;return t}var ES=dt(()=>{"use strict"});function kS(){return!this.node()}var SS=dt(()=>{"use strict"});function MS(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 vS=dt(()=>{"use strict"});function mU(t){return function(){this.removeAttribute(t)}}function pU(t){return function(){this.removeAttributeNS(t.space,t.local)}}function hU(t,e){return function(){this.setAttribute(t,e)}}function gU(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function yU(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttribute(t):this.setAttribute(t,n)}}function bU(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 LS(t,e){var n=Pp(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?pU:mU:typeof e=="function"?n.local?bU:yU:n.local?gU:hU)(n,e))}var CS=dt(()=>{"use strict";eb()});function Bp(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}var sb=dt(()=>{"use strict"});function xU(t){return function(){this.style.removeProperty(t)}}function wU(t,e,n){return function(){this.style.setProperty(t,e,n)}}function EU(t,e,n){return function(){var r=e.apply(this,arguments);r==null?this.style.removeProperty(t):this.style.setProperty(t,r,n)}}function NS(t,e,n){return arguments.length>1?this.each((e==null?xU:typeof e=="function"?EU:wU)(t,e,n??"")):kU(this.node(),t)}function kU(t,e){return t.style.getPropertyValue(e)||Bp(t).getComputedStyle(t,null).getPropertyValue(e)}var TS=dt(()=>{"use strict";sb()});function SU(t){return function(){delete this[t]}}function MU(t,e){return function(){this[t]=e}}function vU(t,e){return function(){var n=e.apply(this,arguments);n==null?delete this[t]:this[t]=n}}function _S(t,e){return arguments.length>1?this.each((e==null?SU:typeof e=="function"?vU:MU)(t,e)):this.node()[t]}var AS=dt(()=>{"use strict"});function RS(t){return t.trim().split(/^|\s+/)}function lb(t){return t.classList||new IS(t)}function IS(t){this._node=t,this._names=RS(t.getAttribute("class")||"")}function PS(t,e){for(var n=lb(t),r=-1,o=e.length;++r<o;)n.add(e[r])}function DS(t,e){for(var n=lb(t),r=-1,o=e.length;++r<o;)n.remove(e[r])}function LU(t){return function(){PS(this,t)}}function CU(t){return function(){DS(this,t)}}function NU(t,e){return function(){(e.apply(this,arguments)?PS:DS)(this,t)}}function OS(t,e){var n=RS(t+"");if(arguments.length<2){for(var r=lb(this.node()),o=-1,a=n.length;++o<a;)if(!r.contains(n[o]))return!1;return!0}return this.each((typeof e=="function"?NU:e?LU:CU)(n,e))}var $S=dt(()=>{"use strict";IS.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 TU(){this.textContent=""}function _U(t){return function(){this.textContent=t}}function AU(t){return function(){var e=t.apply(this,arguments);this.textContent=e??""}}function GS(t){return arguments.length?this.each(t==null?TU:(typeof t=="function"?AU:_U)(t)):this.node().textContent}var qS=dt(()=>{"use strict"});function RU(){this.innerHTML=""}function IU(t){return function(){this.innerHTML=t}}function PU(t){return function(){var e=t.apply(this,arguments);this.innerHTML=e??""}}function BS(t){return arguments.length?this.each(t==null?RU:(typeof t=="function"?PU:IU)(t)):this.node().innerHTML}var HS=dt(()=>{"use strict"});function DU(){this.nextSibling&&this.parentNode.appendChild(this)}function FS(){return this.each(DU)}var WS=dt(()=>{"use strict"});function OU(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function zS(){return this.each(OU)}var YS=dt(()=>{"use strict"});function VS(t){var e=typeof t=="function"?t:Dp(t);return this.select(function(){return this.appendChild(e.apply(this,arguments))})}var US=dt(()=>{"use strict";nb()});function $U(){return null}function XS(t,e){var n=typeof t=="function"?t:Dp(t),r=e==null?$U:typeof e=="function"?e:Op(e);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}var jS=dt(()=>{"use strict";nb();rb()});function GU(){var t=this.parentNode;t&&t.removeChild(this)}function KS(){return this.each(GU)}var ZS=dt(()=>{"use strict"});function qU(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function BU(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function QS(t){return this.select(t?BU:qU)}var JS=dt(()=>{"use strict"});function tM(t){return arguments.length?this.property("__data__",t):this.node().__data__}var eM=dt(()=>{"use strict"});function HU(t){return function(e){t.call(this,e,this.__data__)}}function FU(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 WU(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 zU(t,e,n){return function(){var r=this.__on,o,a=HU(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 nM(t,e,n){var r=FU(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?zU:WU,o=0;o<a;++o)this.each(s(r[o],e,n));return this}var rM=dt(()=>{"use strict"});function oM(t,e,n){var r=Bp(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 YU(t,e){return function(){return oM(this,t,e)}}function VU(t,e){return function(){return oM(this,t,e.apply(this,arguments))}}function aM(t,e){return this.each((typeof e=="function"?VU:YU)(t,e))}var iM=dt(()=>{"use strict";sb()});function*sM(){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 lM=dt(()=>{"use strict"});function zr(t,e){this._groups=t,this._parents=e}function UU(){return new zr([[document.documentElement]],cb)}function XU(){return this}var cb,Ai=dt(()=>{"use strict";Bk();Yk();Xk();Kk();Qk();rS();ib();aS();sS();cS();uS();mS();hS();yS();xS();ES();SS();vS();CS();TS();AS();$S();qS();HS();WS();YS();US();jS();ZS();JS();eM();rM();iM();lM();cb=[null];zr.prototype=UU.prototype={constructor:zr,select:qk,selectAll:zk,selectChild:Uk,selectChildren:jk,filter:Zk,data:nS,enter:Jk,exit:oS,join:iS,merge:lS,selection:XU,order:dS,sort:fS,call:pS,nodes:gS,node:bS,size:wS,empty:kS,each:MS,attr:LS,style:NS,property:_S,classed:OS,text:GS,html:BS,raise:FS,lower:zS,append:VS,insert:XS,remove:KS,clone:QS,datum:tM,on:nM,dispatch:aM,[Symbol.iterator]:sM}});function It(t){return typeof t=="string"?new zr([[document.querySelector(t)]],[document.documentElement]):new zr([[t]],cb)}var cM=dt(()=>{"use strict";Ai()});var Cn=dt(()=>{"use strict";cM()});var Mt,Ke=dt(()=>{"use strict";Mt="Inter, system-ui, Avenir, Helvetica, Arial, sans-serif"});function Hp(t){return/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/.test(t)}function dM(t,e,n){for(let r of KU){let o=t[r];if(typeof o!="string"||!Hp(o))throw new Error(`Palette "${n}" ${e}.${r}: invalid hex "${o}"`)}for(let r of jU){let o=t.colors[r];if(typeof o!="string"||!Hp(o))throw new Error(`Palette "${n}" ${e}.colors.${r}: invalid hex "${o}"`)}}function Bo(t){dM(t.light,"light",t.id),dM(t.dark,"dark",t.id),ld.set(t.id,t)}function Fp(t){return ld.get(t)??ld.get(db)}function ub(t,e){let n=ld.get(t);return n||(e?.(`Palette "${t}" is not registered \u2014 falling back to "${db}".`),ld.get(db))}function Wp(){return Array.from(ld.values()).sort((t,e)=>t.name.localeCompare(e.name))}var ld,db,jU,KU,ai=dt(()=>{"use strict";ld=new Map,db="slate";jU=["red","orange","yellow","green","blue","purple","teal","cyan","gray"],KU=["bg","surface","overlay","border","text","textMuted","primary","secondary","accent","destructive"]});function tc(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>=ZU&&zp.clear(),zp.set(t,d),{...d}}function ec(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 fM(t){let{h:e,s:n,l:r}=tc(t);return`${e} ${n}% ${r}%`}function mM(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 pM(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 hM(t,e,n){return[{offset:0,color:t},{offset:1,color:e}]}function Ri(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 Ii(t,e){let n=Ri(t),r=Ri(e),o=Math.max(n,r),a=Math.min(n,r);return(o+.05)/(a+.05)}function ge(t,e,n){if(Ri(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&&Ii(t,n)>Ii(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 Ql.map(n=>e[n])}function cd(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 gM(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?uM.dark:uM.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,ZU,Yp,QU,uM,He=dt(()=>{"use strict";Kn();zp=new Map,ZU=5e3;Yp=new Map,QU=5e3;uM={light:[32,48,64,80],dark:[44,58,72,86]}});var Tf,fb=dt(()=>{"use strict";ai();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"}}};Bo(Tf)});var _f,mb=dt(()=>{"use strict";ai();_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"}}};Bo(_f)});var Af,pb=dt(()=>{"use strict";ai();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"}}};Bo(Af)});var Rf,hb=dt(()=>{"use strict";ai();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"}}};Bo(Rf)});var If,gb=dt(()=>{"use strict";ai();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"}}};Bo(If)});var Pf,yb=dt(()=>{"use strict";ai();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"}}};Bo(Pf)});var Df,bb=dt(()=>{"use strict";ai();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"}}};Bo(Df)});var xb={};de(xb,{atlasPalette:()=>Tf,blueprintPalette:()=>_f,catppuccinPalette:()=>Af,contrastText:()=>ge,getAvailablePalettes:()=>Wp,getPalette:()=>Fp,getSegmentColors:()=>cd,getSeriesColors:()=>On,hexToHSL:()=>tc,hexToHSLString:()=>fM,hslToHex:()=>ec,isValidHex:()=>Hp,nordPalette:()=>Rf,palettes:()=>JU,registerPalette:()=>Bo,resolvePaletteOrFallback:()=>ub,shade:()=>pM,shapeFill:()=>ee,slatePalette:()=>If,themeBaseBg:()=>De,tidewaterPalette:()=>Pf,tint:()=>mM,tokyoNightPalette:()=>Df});var JU,ii=dt(()=>{"use strict";ai();He();fb();mb();pb();hb();gb();yb();bb();fb();mb();pb();hb();gb();yb();bb();JU={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 si(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 ia(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 Qs(t){t.style.display="none"}async function bn(t,e){if(e)return e;let{getPalette:n}=await Promise.resolve().then(()=>(ii(),xb));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 En(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,Pi=dt(()=>{"use strict";oi();Cn();Ke();ii();Xp=1200,jp=800});function nc(t,e){return t==null||e==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}var wb=dt(()=>{"use strict"});function Eb(t,e){return t==null||e==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}var yM=dt(()=>{"use strict"});function Kp(t){let e,n,r;t.length!==2?(e=nc,n=(s,l)=>nc(t(s),l),r=(s,l)=>t(s)-l):(e=t===nc||t===Eb?t:tX,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 tX(){return 0}var bM=dt(()=>{"use strict";wb();yM()});function kb(t){return t===null?NaN:+t}var xM=dt(()=>{"use strict"});var wM,EM,eX,nX,Sb,kM=dt(()=>{"use strict";wb();bM();xM();wM=Kp(nc),EM=wM.right,eX=wM.left,nX=Kp(kb).center,Sb=EM});function dd(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 SM=dt(()=>{"use strict"});var no,MM=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 vM({_intern:t,_key:e},n){let r=e(n);return t.has(r)?t.get(r):n}function rX({_intern:t,_key:e},n){let r=e(n);return t.has(r)?t.get(r):(t.set(r,n),n)}function oX({_intern:t,_key:e},n){let r=e(n);return t.has(r)&&(n=t.get(r),t.delete(r)),n}function aX(t){return t!==null&&typeof t=="object"?t.valueOf():t}var ud,LM=dt(()=>{"use strict";ud=class extends Map{constructor(e,n=aX){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(vM(this,e))}has(e){return super.has(vM(this,e))}set(e,n){return super.set(rX(this,e),n)}delete(e){return super.delete(oX(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>=iX?10:a>=sX?5:a>=lX?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 Mb(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 iX,sX,lX,CM=dt(()=>{"use strict";iX=Math.sqrt(50),sX=Math.sqrt(10),lX=Math.sqrt(2)});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 NM=dt(()=>{"use strict"});function md(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 TM=dt(()=>{"use strict"});function*cX(t){for(let e of t)yield*e}function pd(t){return Array.from(cX(t))}var _M=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 AM=dt(()=>{"use strict"});var Ho=dt(()=>{"use strict";kM();SM();MM();NM();_M();TM();AM();CM();LM()});function Js(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 ud,e=[],n=[],r=IM;function o(a){let i=t.get(a);if(i===void 0){if(r!==IM)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 ud;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)},Js.apply(o,arguments),o}var IM,PM=dt(()=>{"use strict";Ho();$f();IM=Symbol("implicit")});function rc(){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 rc(e(),[r,o]).round(s).paddingInner(l).paddingOuter(c).align(d)},Js.apply(u(),arguments)}function DM(t){var e=t.copy;return t.padding=t.paddingOuter,delete t.paddingInner,delete t.paddingOuter,t.copy=function(){return DM(e())},t}function tl(){return DM(rc.apply(null,arguments).paddingInner(1))}var OM=dt(()=>{"use strict";Ho();$f();PM()});function eh(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function vb(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}var $M=dt(()=>{"use strict"});function Bf(){}function qM(){return this.rgb().formatHex()}function yX(){return this.rgb().formatHex8()}function bX(){return VM(this).formatHsl()}function BM(){return this.rgb().formatRgb()}function el(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=dX.exec(t))?(n=e[1].length,e=parseInt(e[1],16),n===6?HM(e):n===3?new sa(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=uX.exec(t))?new sa(e[1],e[2],e[3],1):(e=fX.exec(t))?new sa(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=mX.exec(t))?nh(e[1],e[2],e[3],e[4]):(e=pX.exec(t))?nh(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=hX.exec(t))?zM(e[1],e[2]/100,e[3]/100,1):(e=gX.exec(t))?zM(e[1],e[2]/100,e[3]/100,e[4]):GM.hasOwnProperty(t)?HM(GM[t]):t==="transparent"?new sa(NaN,NaN,NaN,0):null}function HM(t){return new sa(t>>16&255,t>>8&255,t&255,1)}function nh(t,e,n,r){return r<=0&&(t=e=n=NaN),new sa(t,e,n,r)}function xX(t){return t instanceof Bf||(t=el(t)),t?(t=t.rgb(),new sa(t.r,t.g,t.b,t.opacity)):new sa}function gd(t,e,n,r){return arguments.length===1?xX(t):new sa(t,e,n,r??1)}function sa(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function FM(){return`#${oc(this.r)}${oc(this.g)}${oc(this.b)}`}function wX(){return`#${oc(this.r)}${oc(this.g)}${oc(this.b)}${oc((isNaN(this.opacity)?1:this.opacity)*255)}`}function WM(){let t=ah(this.opacity);return`${t===1?"rgb(":"rgba("}${ac(this.r)}, ${ac(this.g)}, ${ac(this.b)}${t===1?")":`, ${t})`}`}function ah(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function ac(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function oc(t){return t=ac(t),(t<16?"0":"")+t.toString(16)}function zM(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new li(t,e,n,r)}function VM(t){if(t instanceof li)return new li(t.h,t.s,t.l,t.opacity);if(t instanceof Bf||(t=el(t)),!t)return new li;if(t instanceof li)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 li(i,s,l,t.opacity)}function UM(t,e,n,r){return arguments.length===1?VM(t):new li(t,e,n,r??1)}function li(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function YM(t){return t=(t||0)%360,t<0?t+360:t}function rh(t){return Math.max(0,Math.min(1,t||0))}function Lb(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,hd,qf,Di,dX,uX,fX,mX,pX,hX,gX,GM,XM=dt(()=>{"use strict";$M();Gf=.7,oh=1/Gf,hd="\\s*([+-]?\\d+)\\s*",qf="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Di="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",dX=/^#([0-9a-f]{3,8})$/,uX=new RegExp(`^rgb\\(${hd},${hd},${hd}\\)$`),fX=new RegExp(`^rgb\\(${Di},${Di},${Di}\\)$`),mX=new RegExp(`^rgba\\(${hd},${hd},${hd},${qf}\\)$`),pX=new RegExp(`^rgba\\(${Di},${Di},${Di},${qf}\\)$`),hX=new RegExp(`^hsl\\(${qf},${Di},${Di}\\)$`),gX=new RegExp(`^hsla\\(${qf},${Di},${Di},${qf}\\)$`),GM={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,el,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:qM,formatHex:qM,formatHex8:yX,formatHsl:bX,formatRgb:BM,toString:BM});eh(sa,gd,vb(Bf,{brighter(t){return t=t==null?oh:Math.pow(oh,t),new sa(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?Gf:Math.pow(Gf,t),new sa(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new sa(ac(this.r),ac(this.g),ac(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:FM,formatHex:FM,formatHex8:wX,formatRgb:WM,toString:WM}));eh(li,UM,vb(Bf,{brighter(t){return t=t==null?oh:Math.pow(oh,t),new li(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?Gf:Math.pow(Gf,t),new li(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 sa(Lb(t>=240?t-240:t+120,o,r),Lb(t,o,r),Lb(t<120?t+240:t-120,o,r),this.opacity)},clamp(){return new li(YM(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("}${YM(this.h)}, ${rh(this.s)*100}%, ${rh(this.l)*100}%${t===1?")":`, ${t})`}`}}))});var Cb=dt(()=>{"use strict";XM()});function Nb(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 jM(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 Nb((n-r/e)*e,i,o,a,s)}}var Tb=dt(()=>{"use strict"});function KM(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 Nb((n-r/e)*e,o,a,i,s)}}var ZM=dt(()=>{"use strict";Tb()});var Hf,_b=dt(()=>{"use strict";Hf=t=>()=>t});function EX(t,e){return function(n){return t+n*e}}function kX(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 QM(t){return(t=+t)==1?ih:function(e,n){return n-e?kX(e,n,t):Hf(isNaN(e)?n:e)}}function ih(t,e){var n=e-t;return n?EX(t,n):Hf(isNaN(t)?e:t)}var JM=dt(()=>{"use strict";_b()});function tv(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=gd(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 Ab,o9t,a9t,ev=dt(()=>{"use strict";Cb();Tb();ZM();JM();Ab=(function t(e){var n=QM(e);function r(o,a){var i=n((o=gd(o)).r,(a=gd(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);o9t=tv(jM),a9t=tv(KM)});function nv(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 rv(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}var ov=dt(()=>{"use strict"});function av(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]=ic(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 iv=dt(()=>{"use strict";sh()});function sv(t,e){var n=new Date;return t=+t,e=+e,function(r){return n.setTime(t*(1-r)+e*r),n}}var lv=dt(()=>{"use strict"});function nl(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}}var lh=dt(()=>{"use strict"});function cv(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]=ic(t[o],e[o]):r[o]=e[o];return function(a){for(o in n)r[o]=n[o](a);return r}}var dv=dt(()=>{"use strict";sh()});function SX(t){return function(){return t}}function MX(t){return function(e){return t(e)+""}}function uv(t,e){var n=Ib.lastIndex=Rb.lastIndex=0,r,o,a,i=-1,s=[],l=[];for(t=t+"",e=e+"";(r=Ib.exec(t))&&(o=Rb.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:nl(r,o)})),n=Rb.lastIndex;return n<e.length&&(a=e.slice(n),s[i]?s[i]+=a:s[++i]=a),s.length<2?l[0]?MX(l[0].x):SX(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 Ib,Rb,fv=dt(()=>{"use strict";lh();Ib=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Rb=new RegExp(Ib.source,"g")});function ic(t,e){var n=typeof e,r;return e==null||n==="boolean"?Hf(e):(n==="number"?nl:n==="string"?(r=el(e))?(e=r,Ab):uv:e instanceof el?Ab:e instanceof Date?sv:rv(e)?nv:Array.isArray(e)?av:typeof e.valueOf!="function"&&typeof e.toString!="function"||isNaN(e)?cv:nl)(t,e)}var sh=dt(()=>{"use strict";Cb();ev();iv();lv();lh();dv();fv();_b();ov()});function Pb(t,e){return t=+t,e=+e,function(n){return Math.round(t*(1-n)+e*n)}}var mv=dt(()=>{"use strict"});var pv=dt(()=>{"use strict";sh();lh();mv()});function Db(t){return function(){return t}}var hv=dt(()=>{"use strict"});function Ob(t){return+t}var gv=dt(()=>{"use strict"});function ci(t){return t}function $b(t,e){return(e-=t=+t)?function(n){return(n-t)/e}:Db(isNaN(e)?NaN:.5)}function vX(t,e){var n;return t>e&&(n=t,t=e,e=n),function(r){return Math.max(t,Math.min(e,r))}}function LX(t,e,n){var r=t[0],o=t[1],a=e[0],i=e[1];return o<r?(r=$b(o,r),a=n(i,a)):(r=$b(r,o),a=n(a,i)),function(s){return a(r(s))}}function CX(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]=$b(t[i],t[i+1]),a[i]=n(e[i],e[i+1]);return function(s){var l=Sb(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 Gb(){var t=yv,e=yv,n=ic,r,o,a,i=ci,s,l,c;function d(){var f=Math.min(t.length,e.length);return i!==ci&&(i=vX(t[0],t[f-1])),s=f>2?CX:LX,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),nl)))(f)))},u.domain=function(f){return arguments.length?(t=Array.from(f,Ob),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=Pb,d()},u.clamp=function(f){return arguments.length?(i=f?!0:ci,d()):i!==ci},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 qb(){return Gb()(ci,ci)}var yv,Bb=dt(()=>{"use strict";Ho();pv();hv();gv();yv=[0,1]});function bv(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)}function sc(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 Oi(t){return t=sc(Math.abs(t)),t?t[1]:NaN}var Wf=dt(()=>{"use strict";Ff()});function xv(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 wv=dt(()=>{"use strict"});function Ev(t){return function(e){return e.replace(/[0-9]/g,function(n){return t[+n]})}}var kv=dt(()=>{"use strict"});function rl(t){if(!(e=NX.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 NX,Hb=dt(()=>{"use strict";NX=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;rl.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 Sv(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 Mv=dt(()=>{"use strict"});function vv(t,e){var n=sc(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")+sc(t,Math.max(0,e+a-1))[0]}var zf,Fb=dt(()=>{"use strict";Ff()});function Wb(t,e){var n=sc(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 Lv=dt(()=>{"use strict";Ff()});var zb,Cv=dt(()=>{"use strict";Ff();Fb();Lv();zb={"%":(t,e)=>(t*100).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:bv,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)=>Wb(t*100,e),r:Wb,s:vv,X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)}});function Yb(t){return t}var Nv=dt(()=>{"use strict"});function Av(t){var e=t.grouping===void 0||t.thousands===void 0?Yb:xv(Tv.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?Yb:Ev(Tv.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=rl(u);var m=u.fill,p=u.align,g=u.sign,h=u.symbol,x=u.zero,y=u.width,b=u.comma,E=u.precision,k=u.trim,C=u.type;C==="n"?(b=!0,C="g"):zb[C]||(E===void 0&&(E=12),k=!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=zb[C],L=/[defgprs%]/.test(C);E=E===void 0?6:/[gprs]/.test(C)?Math.max(1,Math.min(21,E)):Math.max(0,Math.min(20,E));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),E),k&&(v=Sv(v)),$&&+v==0&&g!=="+"&&($=!1),S=($?g==="("?g:s:g==="-"||g==="("?"":g)+S,T=(C==="s"&&!isNaN(v)&&zf!==void 0?_v[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(Oi(f)/3)))*3,p=Math.pow(10,-m),g=c((u=rl(u),u.type="f",u),{suffix:_v[8+m/3]});return function(h){return g(p*h)}}return{format:c,formatPrefix:d}}var Tv,_v,Rv=dt(()=>{"use strict";Wf();wv();kv();Hb();Mv();Cv();Fb();Nv();Tv=Array.prototype.map,_v=["y","z","a","f","p","n","\xB5","m","","k","M","G","T","P","E","Z","Y"]});function Vb(t){return uh=Av(t),fh=uh.format,mh=uh.formatPrefix,uh}var uh,fh,mh,Iv=dt(()=>{"use strict";Rv();Vb({thousands:",",grouping:[3],currency:["$",""]})});function Ub(t){return Math.max(0,-Oi(Math.abs(t)))}var Pv=dt(()=>{"use strict";Wf()});function Xb(t,e){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Oi(e)/3)))*3-Oi(Math.abs(t)))}var Dv=dt(()=>{"use strict";Wf()});function jb(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,Oi(e)-Oi(t))+1}var Ov=dt(()=>{"use strict";Wf()});var $v=dt(()=>{"use strict";Iv();Hb();Pv();Dv();Ov()});function Kb(t,e,n,r){var o=Mb(t,e,n),a;switch(r=rl(r??",f"),r.type){case"s":{var i=Math.max(Math.abs(t),Math.abs(e));return r.precision==null&&!isNaN(a=Xb(o,i))&&(r.precision=a),mh(r,i)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(a=jb(o,Math.max(Math.abs(t),Math.abs(e))))&&(r.precision=a-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(a=Ub(o))&&(r.precision=a-(r.type==="%")*2);break}}return fh(r)}var Gv=dt(()=>{"use strict";Ho();$v()});function Zb(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 Kb(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=qb();return t.copy=function(){return ch(t,lr())},Js.apply(t,arguments),Zb(t)}var Qb=dt(()=>{"use strict";Ho();Bb();$f();Gv()});function qv(t){return function(e){return e<0?-Math.pow(-e,t):Math.pow(e,t)}}function TX(t){return t<0?-Math.sqrt(-t):Math.sqrt(t)}function _X(t){return t<0?-t*t:t*t}function AX(t){var e=t(ci,ci),n=1;function r(){return n===1?t(ci,ci):n===.5?t(TX,_X):t(qv(n),qv(1/n))}return e.exponent=function(o){return arguments.length?(n=+o,r()):n},Zb(e)}function ph(){var t=AX(Gb());return t.copy=function(){return ch(t,ph()).exponent(t.exponent())},Js.apply(t,arguments),t}function Jb(){return ph.apply(null,arguments).exponent(.5)}var Bv=dt(()=>{"use strict";Qb();Bb();$f()});var di=dt(()=>{"use strict";OM();Qb();Bv()});function Hn(t){return function(){return t}}var Vf=dt(()=>{"use strict"});function Fv(t){return t>1?0:t<-1?yd:Math.acos(t)}function e4(t){return t>=1?Uf:t<=-1?-Uf:Math.asin(t)}var t4,Ro,ol,Hv,hh,ui,lc,bo,yd,Uf,bd,gh=dt(()=>{"use strict";t4=Math.abs,Ro=Math.atan2,ol=Math.cos,Hv=Math.max,hh=Math.min,ui=Math.sin,lc=Math.sqrt,bo=1e-12,yd=Math.PI,Uf=yd/2,bd=2*yd});function Wv(t){this._+=t[0];for(let e=1,n=t.length;e<n;++e)this._+=arguments[e]+t[e]}function IX(t){let e=Math.floor(t);if(!(e>=0))throw new Error(`invalid digits: ${t}`);if(e>15)return Wv;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 zv(){return new dc}var n4,r4,cc,RX,dc,Yv=dt(()=>{"use strict";n4=Math.PI,r4=2*n4,cc=1e-6,RX=r4-cc;dc=class{constructor(e){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=e==null?Wv:IX(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>cc)if(!(Math.abs(u*l-c*d)>cc)||!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((n4-Math.acos((g+f-h)/(2*x*y)))/2),E=b/y,k=b/x;Math.abs(E-1)>cc&&this._append`L${e+E*d},${n+E*u}`,this._append`A${a},${a},0,0,${+(u*m>d*p)},${this._x1=e+k*l},${this._y1=n+k*c}`}}arc(e,n,r,o,a,i){if(e=+e,n=+n,r=+r,i=!!i,r<0)throw new Error(`negative radius: ${r}`);let s=r*Math.cos(o),l=r*Math.sin(o),c=e+s,d=n+l,u=1^i,f=i?o-a:a-o;this._x1===null?this._append`M${c},${d}`:(Math.abs(this._x1-c)>cc||Math.abs(this._y1-d)>cc)&&this._append`L${c},${d}`,r&&(f<0&&(f=f%r4+r4),f>RX?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>cc&&this._append`A${r},${r},0,${+(f>=n4)},${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._}};zv.prototype=dc.prototype});var Vv=dt(()=>{"use strict";Yv()});function xd(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 dc(e)}var yh=dt(()=>{"use strict";Vv()});function PX(t){return t.innerRadius}function DX(t){return t.outerRadius}function OX(t){return t.startAngle}function $X(t){return t.endAngle}function GX(t){return t&&t.padAngle}function qX(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)/lc(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,E=y*y+b*b,k=o-a,C=f*g-p*m,M=(b<0?-1:1)*lc(Hv(0,k*k*E-C*C)),_=(C*b-y*M)/E,I=(-C*y-b*M)/E,L=(C*b+y*M)/E,w=(-C*y+b*M)/E,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/k-1),y11:I*(o/k-1)}}function uc(){var t=PX,e=DX,n=Hn(0),r=null,o=OX,a=$X,i=GX,s=null,l=xd(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=t4(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>bd-bo)s.moveTo(m*ol(p),m*ui(p)),s.arc(0,0,m,p,g,!x),f>bo&&(s.moveTo(f*ol(g),f*ui(g)),s.arc(0,0,f,g,p,x));else{var y=p,b=g,E=p,k=g,C=h,M=h,_=i.apply(this,arguments)/2,I=_>bo&&(r?+r.apply(this,arguments):lc(f*f+m*m)),L=hh(t4(m-f)/2,+n.apply(this,arguments)),w=L,v=L,S,T;if(I>bo){var N=e4(I/f*ui(_)),R=e4(I/m*ui(_));(C-=N*2)>bo?(N*=x?1:-1,E+=N,k-=N):(C=0,E=k=(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*ol(y),$=m*ui(y),A=f*ol(k),D=f*ui(k);if(L>bo){var O=m*ol(b),P=m*ui(b),H=f*ol(E),W=f*ui(E),B;if(h<yd)if(B=qX(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/ui(Fv((q*X+V*z)/(lc(q*q+V*V)*lc(X*X+z*z)))/2),Y=lc(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,Ro(S.y01,S.x01),Ro(T.y01,T.x01),!x):(s.arc(S.cx,S.cy,v,Ro(S.y01,S.x01),Ro(S.y11,S.x11),!x),s.arc(0,0,m,Ro(S.cy+S.y11,S.cx+S.x11),Ro(T.cy+T.y11,T.cx+T.x11),!x),s.arc(T.cx,T.cy,v,Ro(T.y11,T.x11),Ro(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,Ro(S.y01,S.x01),Ro(T.y01,T.x01),!x):(s.arc(S.cx,S.cy,w,Ro(S.y01,S.x01),Ro(S.y11,S.x11),!x),s.arc(0,0,f,Ro(S.cy+S.y11,S.cx+S.x11),Ro(T.cy+T.y11,T.cx+T.x11),x),s.arc(T.cx,T.cy,w,Ro(T.y11,T.x11),Ro(T.y01,T.x01),!x))):s.arc(0,0,f,k,E,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-yd/2;return[ol(u)*d,ui(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 Uv=dt(()=>{"use strict";Vf();gh();yh()});function wd(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}var Kwt,xh=dt(()=>{"use strict";Kwt=Array.prototype.slice});function Xv(t){this._context=t}function fc(t){return new Xv(t)}var wh=dt(()=>{"use strict";Xv.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 Eh(t){return t[0]}function kh(t){return t[1]}var o4=dt(()=>{"use strict"});function nr(t,e){var n=Hn(!0),r=null,o=fc,a=null,i=xd(s);t=typeof t=="function"?t:t===void 0?Eh:Hn(t),e=typeof e=="function"?e:e===void 0?kh:Hn(e);function s(l){var c,d=(l=wd(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 a4=dt(()=>{"use strict";xh();Vf();wh();yh();o4()});function mc(t,e,n){var r=null,o=Hn(!0),a=null,i=fc,s=null,l=xd(c);t=typeof t=="function"?t:t===void 0?Eh:Hn(+t),e=typeof e=="function"?e:e===void 0?Hn(0):Hn(+e),n=typeof n=="function"?n:n===void 0?kh:Hn(+n);function c(u){var f,m,p,g=(u=wd(u)).length,h,x=!1,y,b=new Array(g),E=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],E[p]);s.lineEnd(),s.areaEnd()}x&&(b[f]=+t(h,f,u),E[f]=+e(h,f,u),s.point(r?+r(h,f,u):b[f],n?+n(h,f,u):E[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 jv=dt(()=>{"use strict";xh();Vf();wh();a4();yh();o4()});function Kv(t,e){return e<t?-1:e>t?1:e>=t?0:NaN}var Zv=dt(()=>{"use strict"});function Qv(t){return t}var Jv=dt(()=>{"use strict"});function i4(){var t=Qv,e=Kv,n=null,r=Hn(0),o=Hn(bd),a=Hn(0);function i(s){var l,c=(s=wd(s)).length,d,u,f=0,m=new Array(c),p=new Array(c),g=+r.apply(this,arguments),h=Math.min(bd,Math.max(-bd,o.apply(this,arguments)-g)),x,y=Math.min(Math.abs(h)/c,a.apply(this,arguments)),b=y*(h<0?-1:1),E;for(l=0;l<c;++l)(E=p[m[l]=l]=+t(s[l],l,s))>0&&(f+=E);for(e!=null?m.sort(function(k,C){return e(p[k],p[C])}):n!=null&&m.sort(function(k,C){return n(s[k],s[C])}),l=0,u=f?(h-c*b)/f:0;l<c;++l,g=x)d=m[l],E=p[d],x=g+(E>0?E*u:0)+b,p[d]={data:s[d],index:l,value:E,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 tL=dt(()=>{"use strict";xh();Vf();Zv();Jv();gh()});function s4(t){return new Sh(t,!0)}function l4(t){return new Sh(t,!1)}var Sh,eL=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 nL(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 rL(t){this._context=t}function xo(t){return new rL(t)}var oL=dt(()=>{"use strict";rL.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:nL(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:nL(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}}});function aL(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 SEt,iL=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:aL(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:aL(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}};SEt=(function t(e){function n(r){return new Mh(r,e)}return n.tension=function(r){return t(+r)},n})(0)});function BX(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 sL(t,e){this._context=t,this._alpha=e}var c4,lL=dt(()=>{"use strict";gh();iL();sL.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:BX(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}};c4=(function t(e){function n(r){return e?new sL(r,e):new Mh(r,0)}return n.alpha=function(r){return t(+r)},n})(.5)});function cL(t){return t<0?-1:1}function dL(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(cL(a)+cL(i))*Math.min(Math.abs(a),Math.abs(i),.5*Math.abs(s))||0}function uL(t,e){var n=t._x1-t._x0;return n?(3*(t._y1-t._y0)/n-e)/2:e}function d4(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 HX(t){this._context=new fL(t)}function fL(t){this._context=t}function Ed(t){return new vh(t)}var mL=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:d4(this,this._t0,uL(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,d4(this,uL(this,n=dL(this,t,e)),n);break;default:d4(this,this._t0,n=dL(this,t,e));break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=n}}};(HX.prototype=Object.create(vh.prototype)).point=function(t,e){vh.prototype.point.call(this,e,t)};fL.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 Io=dt(()=>{"use strict";Uv();jv();a4();tL();oL();eL();lL();wh();mL()});function kd(t,e,n){let r=t;for(let o=0;o<e.length;o++)r+=(pL[e.charAt(o)]??u4)*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>=FX&&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=(pL[" "]??u4)*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 pL,u4,Zo,Lh,FX,Ye=dt(()=>{"use strict";pL={" ":.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},u4=.56,Zo=u4,Lh=new Map,FX=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 f4=dt(()=>{"use strict";ws()});function Sd(t,e){return yo(t,e)}var p4=dt(()=>{"use strict";ws()});function h4(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 g4(t){return t.getFullYear()+t.getMonth()/12+(t.getDate()-1)/365+t.getHours()/8760+t.getMinutes()/525600+t.getSeconds()/31536e3}function aj(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:aj(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=pc[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=h4(t);for(h.setSeconds(Math.floor(h.getSeconds()/p)*p,0);;){let x=g4(h);if(x>e)break;if(x>=t){let y=String(h.getHours()).padStart(2,"0"),b=String(h.getMinutes()).padStart(2,"0"),E=String(h.getSeconds()).padStart(2,"0");d.push({pos:n(x),label:`${y}:${b}:${E}`})}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=h4(t);for(h.setMinutes(Math.floor(h.getMinutes()/p)*p,0,0);;){let x=g4(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=h4(t);for(x.setHours(Math.floor(x.getHours()/p)*p,0,0,0);;){let y=g4(x);if(y>e)break;if(y>=t){let b=String(x.getHours()).padStart(2,"0"),E=String(x.getMinutes()).padStart(2,"0");if(h)d.push({pos:n(y),label:`${b}:${E}`});else{let k=pc[x.getMonth()],C=x.getDate();d.push({pos:n(y),label:`${k} ${C} ${b}:${E}`})}}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:`${pc[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 pc,y4=dt(()=>{"use strict";pc=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});var EL={};de(EL,{CONTROLS_ICON_PATH:()=>Ah,EYE_CLOSED_PATH:()=>jf,EYE_OPEN_PATH:()=>Xf,LEGEND_CAPSULE_PAD:()=>Dn,LEGEND_DOT_R:()=>kr,LEGEND_ENTRY_DOT_GAP:()=>Lr,LEGEND_ENTRY_FONT_SIZE:()=>Fn,LEGEND_ENTRY_TRAIL:()=>jr,LEGEND_EYE_GAP:()=>Ra,LEGEND_EYE_SIZE:()=>wo,LEGEND_GEAR_PILL_W:()=>Gi,LEGEND_GROUP_GAP:()=>kn,LEGEND_HEIGHT:()=>Se,LEGEND_ICON_W:()=>Md,LEGEND_MAX_ENTRY_ROWS:()=>_h,LEGEND_PILL_FONT_SIZE:()=>cr,LEGEND_PILL_PAD:()=>uo,LEGEND_TOGGLE_DOT_R:()=>ks,LEGEND_TOGGLE_OFF_OPACITY:()=>b4,legendChromeColors:()=>hc,measureLegendText:()=>Fe,truncateLegendText:()=>Es});function hc(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,kr,Fn,Lr,jr,kn,wo,Ra,Md,_h,Fe,Es,Xf,jf,Ah,ks,b4,Gi,dr=dt(()=>{"use strict";He();Ye();Se=28,uo=16,cr=11,Dn=4,kr=4,Fn=10,Lr=4,jr=8,kn=12,wo=14,Ra=6,Md=20,_h=3;Fe=At,Es=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=kr,b4=.4,Gi=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 x4=dt(()=>{"use strict"});function Dh(t){return Rh(t)}function lj(t,e){let n=Zf(t),r=Fe(Dh(e.min),Fn),o=Fe(Dh(e.max),Fn);return Dn+n+4+r+Ph+w4+Ph+o+Dn}function cj(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+w4+Ph,d=lj(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-kL)/2,rampW:w4,rampH:kL,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 dj(t){let e=0;for(let n of t)e+=kr*2+Lr+Fe(n.value,Fn)+jr;return e}function vL(t){return kr*2+Lr+Fe(t,Fn)+jr}function SL(t){let e=ij;if(t.label&&(e+=Fe(t.label,Ih),t.icon&&(e+=sj)),t.icon&&(e+=14),t.children)for(let n of t.children)e+=Fe(n.label,Ih)+12;return e}function LL(t,e,n,r=0){let o=Zf(t),a=n,i=Dn*2+o+4+r,s=dj(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=vL(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+Gi+4;for(let n of t)e+=ks*2+Lr+Fe(n.label,Fn)+jr;return e}function uj(t,e){return!e&&t.controlsHost==="app"&&!!t.controlsGroup&&t.controlsGroup.toggles.length>0}function fj(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:Gi,height:Se,expanded:!1,pill:{x:0,y:0,width:Gi,height:Se},toggles:[]};let a=Oh(n.toggles),i=[],s=Dn+Gi+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:Gi-Dn*2,height:o},toggles:i}}function al(t,e,n){let{groups:r,controls:o,mode:a}=t,i=a==="export",s=uj(t,i),l=e.activeGroup?.toLowerCase()??null;if(i&&!l)return{height:0,width:0,rows:[],controls:[],pills:[]};let c=i||s?void 0:fj(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=SL(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=SL(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+kn*2:0,p=c?c.width+kn:0,g=n-m-p,h=[],x;for(let C of d){let M=l===C.name.toLowerCase();if(!(i&&!M)){if(M)x=mj(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=pj(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 mj(t,e,n=0){if(t.gradient)return cj(t,t.gradient);let r=Zf(t.name),o=LL(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=vL(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-(kr*2+Lr+jr);M>0&&(x=Es(g.value,Fn,M),h=kr*2+Lr+Fe(x,Fn)+jr)}let b=c+kr,E=l+Se/2,k=c+kr*2+Lr,C=l+Se/2;i.push({value:g.value,color:g.color,x:c,y:l,width:h,dotCx:b,dotCy:E,textX:k,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 pj(t,e,n,r,o,a,i=!1,s){let l=[],c=[];t&&c.push(t),c.push(...e);let d=s?s.width+kn:0,u=[],f=0,m=0;for(let p of c){let g=p.width+kn;if(f+p.width>r&&u.length>0){if(!i){let h=l.length===0?d:0;ML(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||ML(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+kn}else s.x=(o-s.width)/2;s.y=0}return l.length===0&&l.push({y:0,items:[]}),l}function ML(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)*kn,i=e-(n>0?n+kn*2:0)-r,l=Math.max(0,(i-a)/2);for(let c of o)c.x=l,l+=c.width+kn}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=LL(a.name,a.entries,e,r).entryRows*Se;s>o&&(o=s)}return o}function rr(t,e,n){let r=al(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 ij,Ih,sj,Kf,w4,kL,Ph,Ir=dt(()=>{"use strict";dr();x4();ij=16,Ih=11,sj=4,Kf=8,w4=80,kL=8,Ph=6});function il(t){return t.attr("dy",hj)}function CL(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=al(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}=hc(r,o);c.activeCapsule&&gj(d,c.activeCapsule,r,f,m,o,a);for(let p of c.pills)yj(d,p,r,f,a);c.controlsGroup&&xj(d,c.controlsGroup,r,f,m,a,e);for(let p of c.controls)bj(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 gj(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(il).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 hM(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(il).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(il).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",kr).attr("fill",c.color),d.append("text").attr("x",c.textX).attr("y",c.textY).call(il).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 yj(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(il).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 bj(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(il).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(il).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 xj(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(il).attr("font-size",Fn).attr("fill",n.textMuted).attr("opacity",p.active?1:b4).attr("font-family",Mt).text(p.label),a?.onControlsToggle&&g){let x=a.onControlsToggle,y=p.id,b=!p.active;h.on("click",E=>{E.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 hj,NL=dt(()=>{"use strict";Oe();dr();Ir();He();Ke();hj="0.32em"});function nn(t,e){return CL(t,{groups:e.groups,position:e.position??wj,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 wj,br=dt(()=>{"use strict";NL();wj={placement:"top-center",titleRelation:"below-title"}});function Ej(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?Ej(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),E=n(y);if(!Number.isFinite(b)||!Number.isFinite(E))return;let k=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",k).attr("stroke-width",1):v.attr("fill",k).attr("opacity",.08)};if(r){let v=Math.min(b,E),S=Math.abs(E-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",k).attr("font-size","13px").attr("font-weight","600").attr("opacity",.8).text(_)}else{let v=Math.min(b,E),S=Math.abs(E-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);_=Es(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",k).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 E=g[y];if(!Number.isFinite(E))return;let k=x.color||p,C=.5,M=5,_=f==="outline"&&m!==void 0,I=w=>{_?w.attr("fill",m).attr("stroke",k).attr("stroke-width",1.25).attr("opacity",.9):w.attr("fill",k).attr("opacity",.9)},L=t.append("g").attr("class","tl-marker").attr("data-marker-date",String(b)).attr("data-line-number",String(x.lineNumber)).style("cursor","pointer");if(r)L.append("line").attr("x1",0).attr("y1",E).attr("x2",o).attr("y2",E).attr("stroke",k).attr("stroke-width",1.5).attr("stroke-dasharray","6 4").attr("opacity",C),L.append("text").attr("x",-M-8).attr("y",E-M-4).attr("text-anchor","middle").attr("fill",k).attr("font-size","11px").attr("font-weight","600").text(x.label),I(L.append("path").attr("d",`M${-M-8},${E} 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(E,o-E);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-E);O<G&&(G=O)}let $=Math.max(0,G-8);T=Es(x.label,11,$),N=T!==x.label}let R=L.append("text").attr("x",E).attr("y",w).attr("text-anchor","middle").attr("fill",k).attr("font-size","11px").attr("font-weight","600").text(T);I(L.append("path").attr("d",`M${E},${v-M} l${M},${M} l-${M},${M} l-${M},-${M} Z`)),L.append("line").attr("x1",E).attr("y1",S).attr("x2",E).attr("y2",a).attr("stroke",k).attr("stroke-width",1.5).attr("stroke-dasharray","6 4").attr("opacity",C),L.on("mouseenter",function(){i(b),N&&R.text(x.label)}).on("mouseleave",function(){s(),N&&R.text(T)})}})}function Ss(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=pc[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 sl(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 Ss(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 _L(t,e,n,r,o,a){t.selectAll(".tl-scale-tick").attr("opacity",.1);let i=6,s=e(yn(n)),l=Ss(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=Ss(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 AL(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 ll(t){let e=t.endDate?`${Ss(t.date)} \u2192 ${Ss(t.endDate)}`:Ss(t.date);return`<strong>${t.label}</strong><br>${e}`}function RL(t,e,n,r,o,a,i,s,l){let g=hc(o,a).groupBg,h=0;for(let x of e){let y=n.get(x.name)??r,E=22+Fe(x.name,11)+10,k=t.append("g").attr("class","tl-legend-item").attr("data-group",x.name).style("cursor","pointer").on("mouseenter",()=>s(x.name)).on("mouseleave",()=>l());k.append("rect").attr("x",h).attr("y",i-22/2).attr("width",E).attr("height",22).attr("rx",22/2).attr("fill",g),k.append("circle").attr("cx",h+10+4).attr("cy",i).attr("r",4).attr("fill",y),k.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+=E+8}}function kj(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,E=n.border,k=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:E,bgColor:k,bg:C,swimlaneTagGroup:p,groupColorMap:_,tagLanes:I,eventColor:w,minDate:v,maxDate:S,datePadding:R,earliestStartDateStr:T,latestEndDateStr:N,tagLegendReserve:G,ctx:A}}function Sj(){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 Mj(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,E=e.noTitle?null:e.title,{timelineEvents:k}=e,C=Se,M=uo,_=cr,I=Dn,L=kr,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=E?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 k)X.set(String(U.lineNumber),U);V()}}function vj(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:E,minDate:k,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([k-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,k,C,sl(_,I),sl(I,_)),$.length>0&&!e.noLegend){let mt=O?-w.aesthetic(75):-w.aesthetic(55);RL(pt,$,b,h,n,r,mt,xt=>v(pt,xt),()=>N(pt))}Y.forEach((mt,xt)=>{let ht=xt*lt+lt/2,Et=st(yn(mt.date)),ft=E(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?_L(pt,st,mt.date,mt.endDate,rt,ft):ia(p,ll(mt),Tt)}).on("mouseleave",function(){N(pt),O?AL(pt):Qs(p)}).on("mousemove",function(Tt){O||ia(p,ll(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-Et,4),kt=mt.label.length*U+w.aesthetic(16),Ct=yt>=kt,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",Et).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",Et+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=Et+yt>at*.6,zt=Et-Pt-kt>0,Wt=Bt&&zt;St.append("text").attr("x",Wt?Et-Pt:Et+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),kt=Et>at*.6,Ct=Et-yt-Tt>0,gt=kt&&Ct;St.append("circle").attr("cx",Et).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?Et-yt:Et+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 Lj(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:E,groupColorMap:k,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,Et=T.structural(28),ft=Et*F+ht,St=ct.top+ft+ct.bottom,Tt=!s&&g>0&&St>g,yt=Tt?g:St,kt=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,kt,!1,xt,ft,(Pt,Bt)=>R(gt,Pt,Bt),()=>$(gt),W,h,n,ot?mt:void 0,x,E),Gh(gt,H,kt,!1,xt,ft,Pt=>G(gt,Pt),()=>$(gt),W,h,n,at?pt:void 0,x,E),W&&qh(gt,kt,!1,xt,ft,y,_,I,sl(w,v),sl(v,w));let Dt=0;for(let Pt of J){let Bt=k.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-${Nj++}`;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=kt(ue),ce=kt(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+=Et+V;continue}Pt.events.forEach((ne,xe)=>{let ue=Dt+(xe+1)*Et+Et/2,Kt=kt(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?_L(gt,kt,ne.date,ne.endDate,ft,Bt):ia(h,ll(ne),ze)}).on("mouseleave",function(){$(gt),W?AL(gt):Qs(h)}).on("mousemove",function(ze){W||ia(h,ll(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=kt(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"?E:vt(ce,E,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)*Et+V}}function Cj(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:E,tagLanes:k,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(k!=null||H==="group"&&D.length>0){let Q,Z;if(k)Q=k.map(mt=>mt.name),Z=new Map(k.map(mt=>[mt.name,mt.events]));else{let mt=D.map(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(Et=>ht==="(Other)"?Et.group===null||!mt.includes(Et.group):Et.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,_,sl(L,w),sl(w,L)),(B||k)&&Q.forEach((mt,xt)=>{let ht=xt*it,Et=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",Et).attr("opacity",.06)}),Q.forEach((mt,xt)=>{let ht=xt*it,Et=E.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",Et).attr("font-size",`${J}px`).attr("font-weight","600").text(mt),pt.append("line").attr("x1",ft).attr("y1",0).attr("x2",ft).attr("y2",tt).attr("stroke",x).attr("stroke-width",1).attr("stroke-dasharray",F);let Tt=Z.get(mt)??[];for(let yt of Tt){let kt=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),ia(p,ll(yt),Dt)}).on("mouseleave",function(){G(pt),Qs(p)}).on("mousemove",function(Dt){ia(p,ll(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-kt,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(Et,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",kt).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",kt+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",kt).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",kt).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,_,sl(L,w),sl(w,L)),D.length>0&&!e.noLegend&&RL(st,D,E,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),ia(p,ll(ct),ht)}).on("mouseleave",function(){G(st),Qs(p)}).on("mousemove",function(ht){ia(p,ll(ct),ht)}).on("click",()=>{i&&ct.lineNumber&&i(ct.lineNumber)});if($(xt,ct),ct.endDate){let ht=ut(yn(ct.endDate)),Et=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}`,kt=it.select("defs").node()||it.append("defs").node(),Ct=It(kt);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",Et).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+Et/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=kj(t,e,n,r,a,i,s);if(!u)return;s=u.swimlaneTagGroup;let{isVertical:f,tagLanes:m}=u,p=Sj(),g=TL.get(t);g||(g=new Set,TL.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){Cj(t,e,n,r,u,p,o,a,s,i,l,c);return}m!=null||e.timelineSort!=="time"&&e.timelineGroups.length>0?Lj(t,e,n,r,u,p,o,a,s,i,l,c,g,h):vj(t,e,n,r,u,p,o,a,s,i,l,c),Mj(t,e,n,r,u,p,o,a,s,i,l,c,d)}var TL,Nj,E4=dt(()=>{"use strict";Oe();di();Cn();Ke();y4();hr();Pi();Cf();ii();He();Oe();dr();br();TL=new WeakMap,Nj=0});function Hh(t,e){return yo(t,e)}var k4=dt(()=>{"use strict";ws()});function PL(){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 _j(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 Aj(t,e){for(var n=0,r=t.length,o;n<r;++n)if((o=t[n]).name===e)return o.value}function IL(t,e,n){for(var r=0,o=t.length;r<o;++r)if(t[r].name===e){t[r]=Tj,t=t.slice(0,r).concat(t.slice(r+1));break}return n!=null&&t.push({name:e,value:n}),t}var Tj,DL,OL=dt(()=>{"use strict";Tj={value:function(){}};Fh.prototype=PL.prototype={constructor:Fh,on:function(t,e){var n=this._,r=_j(t+"",n),o,a=-1,i=r.length;if(arguments.length<2){for(;++a<i;)if((o=(t=r[a]).type)&&(o=Aj(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]=IL(n[o],t.name,e);else if(e==null)for(o in n)n[o]=IL(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)}};DL=PL});var $L={};de($L,{dispatch:()=>DL});var GL=dt(()=>{"use strict";OL()});var FL=jE((_kt,HL)=>{"use strict";var Rj=(GL(),QE($L)).dispatch,S4=Math.PI/180,Ij={archimedean:BL,rectangular:Fj},Qf=64,Wh=2048;HL.exports=function(){var t=[256,256],e=Pj,n=Dj,r=Oj,o=qL,a=qL,i=$j,s=BL,l=[],c=1/0,d=Rj("word","end"),u=null,f=Math.random,m=()=>(~~(f()*6)-3)*30,p={},g=zj;p.canvas=function(y){return arguments.length?(g=cl(y),p):g},p.start=function(){var y=h(g()),b=Wj((t[0]>>5)*t[1]),E=null,k=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<k&&u;){var w=_[C];w.x=t[0]*(f()+.5)>>1,w.y=t[1]*(f()+.5)>>1,Gj(y,w,_,C),w.hasText&&x(b,w,E)&&(M.push(w),d.call("word",p,w),E?Bj(E,w):E=[{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>=k&&(p.stop(),d.call("end",p,M,E))}},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 E=Math.sqrt(b.getImageData(0,0,1,1).data.length>>2);return y.width=(Qf<<5)/E,y.height=Wh/E,b.fillStyle=b.strokeStyle="red",{context:b,ratio:E}}function x(y,b,E){for(var k=[{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])&&(!E||Hj(b,E))&&!qj(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=cl(y),p):n},p.fontStyle=function(y){return arguments.length?(o=cl(y),p):o},p.fontWeight=function(y){return arguments.length?(a=cl(y),p):a},p.rotate=function(y){return arguments.length?(m=cl(y),p):m},p.text=function(y){return arguments.length?(e=cl(y),p):e},p.spiral=function(y){return arguments.length?(s=Ij[y]||y,p):s},p.fontSize=function(y){return arguments.length?(r=cl(y),p):r},p.padding=function(y){return arguments.length?(i=cl(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 Pj(t){return t.text}function Dj(){return"serif"}function qL(){return"normal"}function Oj(t){return Math.sqrt(t.value)}function $j(){return 1}function Gj(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*S4),u=Math.cos(e.rotate*S4),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*S4),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,E=e.y1-e.y0,k=0;k<E*b;k++)x[k]=0;if(i=e.xoff,i==null)return;s=e.yoff;for(var C=0,M=-1,_=0;_<E;_++){for(var k=0;k<y;k++){var I=b*_+(k>>5),L=h[(s+_)*(Qf<<5)+(i+k)<<2]?1<<31-k%32:0;x[I]|=L,C|=L}C?M=_:(e.y0++,E--,_--,s++)}e.y1=e.y0+M,e.sprite=x.slice(0,(e.y1-e.y0)*b)}}}function qj(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 Bj(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 Hj(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 BL(t){var e=t[0]/t[1];return function(n){return[e*(n*=.1)*Math.cos(n),n*Math.sin(n)]}}function Fj(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 Wj(t){for(var e=[],n=-1;++n<t;)e[n]=0;return e}function zj(){return document.createElement("canvas")}function cl(t){return typeof t=="function"?t:function(){return t}}});function zh(t,e){return yo(t,e)}var M4=dt(()=>{"use strict";ws()});function Yh(t,e){return yo(t,e)}var L4=dt(()=>{"use strict";ws()});function ya(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 dl(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 C4(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 Kj(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 VL(t){let e=[...t?.reserved??[]],n=[],r=t?.obstacles??[],o=t?.markers??[];return{hitsPlaced:a=>e.some(i=>ya(a,i)),hitsObstacle:a=>r.some(i=>ya(a,i)),hitsMarker:a=>o.some(i=>dl(a,i)),leaderCrosses:([a,i,s,l])=>n.some(c=>Kj(a,i,s,l,c[0],c[1],c[2],c[3])),leaderHitsPlaced:([a,i,s,l])=>e.some(c=>C4(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 E=!1;for(let k of l)if(ya(b.rect,k)){E=!0;break}if(!E){for(let k of s)if(dl(b.rect,k)){E=!0;break}}if(!E){for(let k of n)if(ya(b.rect,k)){E=!0;break}}if(!E){let k=y;(!p||k<p.dist)&&(p={rect:b.rect,textX:b.textX,textY:b.textY,anchor:b.anchor,dist:k});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),E=u.r??r,k=u.cx+Math.cos(b)*E,C=u.cy+Math.sin(b)*E,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:k,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 vd=dt(()=>{"use strict";Ye()});function Uh(t,e){return yo(t,e)}var N4=dt(()=>{"use strict";ws()});function t1(t){for(let e of XL)if(e.pattern.test(t))return e.type;return"default"}var XL,eSt,T4=dt(()=>{"use strict";XL=[{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"}];eSt=XL.length});function ae(t){return t.normalize("NFC").replace(Zj," ").trim().toLocaleLowerCase("en-US")}function Sr(t){return t.normalize("NFC").trim()}var Zj,ro=dt(()=>{"use strict";Zj=/\s+/gu});function Ld(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",jL.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",jL.CONTROL_CHAR_IN_LABEL));break}}return n}function Eo(t,e){let n=t.trim();if(n.length===0)return{label:void 0,diagnostics:[]};let r=Ld(n,e);return{label:n,diagnostics:r}}function QL(t){if(tK.test(t)||eK.test(t))return{error:"Bidirectional arrows are no longer supported. Use two separate lines: 'A -msg-> B' and 'B -msg-> A'"};if(KL.test(t)||ZL.test(t)){let n=t.match(KL)??t.match(ZL),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:Jj,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 jL,Qj,Jj,KL,ZL,tK,eK,fi=dt(()=>{"use strict";en();jL={ARROW_SUBSTRING_IN_LABEL:"E_ARROW_SUBSTRING_IN_LABEL",CONTROL_CHAR_IN_LABEL:"E_CONTROL_CHAR_IN_LABEL"};Qj=/^(.+?)\s*-(.+)->\s*(.+)$/,Jj=/^(.+?)\s*~(.+)~>\s*(.+)$/,KL=/^(.+?)\s*<-(.+)-\s*(.+)$/,ZL=/^(.+?)\s*<~(.+)~\s*(.+)$/,tK=/^(.+?)\s*<-(.+)->\s*(.+)$/,eK=/^(.+?)\s*<~(.+)~>\s*(.+)$/});var JL={};de(JL,{isSequenceBlock:()=>Gr,isSequenceNote:()=>oo,isSequenceSection:()=>Qo,looksLikeSequence:()=>A4,parseSequenceDgmo:()=>Xh});function Gr(t){return t.kind==="block"}function Qo(t){return t.kind==="section"}function oo(t){return t.kind==="note"}function fK(t,e,n,r,o){if(!t.toLowerCase().startsWith("note")||t.length>4&&t[4]!==" ")return null;let i=t.match(uK);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(dK);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=mK(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 mK(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,Ao({incomingDisplay:$,incomingLine:T,existingDisplay:D.id,existingLine:D.lineNumber}),"warning",_o.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,E=()=>(b&&(y=[...r.participants].sort((S,T)=>T.label.length-S.label.length),b=!1),y),k=new Map,C=null,M=new Map,_=(S,T)=>{let N=Ue(By,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(sK);if(G){let xt=G[1].trim(),ht=G[2]?.trim(),Et,ft=G[3]?.trim()||"",St=!1,Tt=_i(ft);if(Tt.collapsed&&(St=!0,ft=Tt.rest),ft){let yt=Ue(By,new Set(M.keys())),kt=Ge(ft,yt,M);We(kt.meta,yt,Ct=>l(R,Ct),kt.name),Object.keys(kt.meta).length>0&&(Et=kt.meta),Et?.collapsed?.toLowerCase()==="true"&&(St=!0,delete Et.collapsed,Object.keys(Et).length===0&&(Et=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,...Et?{metadata:Et}:{},...St?{collapsed:!0}:{}},r.groups.push(p);continue}if(N.startsWith("[")){let xt=N.match(lK);if(xt&&xt[1].includes("|")){let ht=xt[1],Et=ht.indexOf("|"),ft=ht.substring(0,Et).trim().replace(/\([^)]*\)$/,"").trim(),St=ht.substring(Et).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:Et,color:ft}=ye(xt,e,r.diagnostics,R);(ht||C.entries.length===0)&&(C.defaultValue=Et),C.entries.push({value:Et,color:ft??cn,lineNumber:R});continue}C&&(C=null);let A=N.match(cK);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(),Et=ht.match(/^(.+?)\((red|orange|yellow|green|blue|purple|teal|cyan|gray|black|white)\)$/);Et&&l(R,`'(${Et[2]})' parens-color syntax removed from sequence diagrams \u2014 use 'tag:' groups for coloring`),u=!0,f=!0;let ft={kind:"section",label:Et?Et[1].trim():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 Et=xt.substring(3);if(_4.has(Et)||rK.has(Et)){if(u){s(R,`Options like '${N}' must appear before the first message or declaration`);continue}r.options[Et]="off";continue}}let ht=N.match(Wn);if(ht){let Et=ht[1].toLowerCase(),ft=ht[2].trim();if(nK.has(Et)||_4.has(Et)){if(u){s(R,`Options like '${N}' must appear before the first message or declaration`);continue}r.options[Et]=ft;continue}}if(_4.has(xt)){if(u){s(R,`Options like '${N}' must appear before the first message or declaration`);continue}if(Ko.has(xt)){for(let Et of Ko)delete r.options[Et];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(aK);if(q){u=!0;let xt=q[1],ht=q[2].toLowerCase(),Et=q[3]?.trim()||"",ft=oK.has(ht)?ht:"default";B!==void 0&&o.set(B,xt);let St=Et.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 kt=k.get(yt);kt?s(R,`Participant '${xt}' is already in group '${kt}' \u2014 participants can only belong to one group`):(p.participantIds.push(yt),k.set(yt,p.name))}continue}let{core:V,meta:X}=_(N,R),z=V.match(iK);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 Et=x(xt,R,{...X!==void 0&&{metadata:X}});if(p&&!p.participantIds.includes(Et)){let ft=k.get(Et);ft?s(R,`Participant '${xt}' is already in group '${ft}' \u2014 participants can only belong to one group`):(p.participantIds.push(Et),k.set(Et,p.name))}continue}{let{core:xt,meta:ht,alias:Et}=_(N,R),ft=p&&pe(T)>0;if(/^\S+$/.test(xt)&&!e1.test(xt)&&(ft||!f||ht)){u=!0;let St=xt;Et!==void 0&&o.set(Et,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 kt=k.get(yt);kt?s(R,`Participant '${St}' is already in group '${kt}' \u2014 participants can only belong to one group`):(p.participantIds.push(yt),k.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=QL(Y);if(nt&&"error"in nt){s(R,nt.error);continue}if(nt){u=!0,f=!0;let{from:xt,to:ht,label:Et,async:ft}=nt,St=x(a(xt),R),Tt=x(a(ht),R);v=St;let yt=Eo(Et,R);yt.diagnostics.forEach(gt=>r.diagnostics.push(gt));let kt=yt.label??Et,Ct={kind:"message",from:St,to:Tt,label:kt,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],Et=j[3].trim();s(R,`Colon syntax is no longer supported. Use '${xt} ${F?"~":"-"}${Et}${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],Et=x(a(xt),R),ft=x(a(ht),R);v=Et;let St={kind:"message",from:Et,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=fK(N,r.participants,g,E(),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 Et={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,Ao({incomingDisplay:$,incomingLine:T,existingDisplay:D.id,existingLine:D.lineNumber}),"warning",_o.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,E=()=>(b&&(y=[...r.participants].sort((S,T)=>T.label.length-S.label.length),b=!1),y),k=new Map,C=null,M=new Map,_=(S,T)=>{let N=Ue(By,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(sK);if(G){let xt=G[1].trim(),ht=G[2]?.trim(),Et,ft=G[3]?.trim()||"",St=!1,Tt=_i(ft);if(Tt.collapsed&&(St=!0,ft=Tt.rest),ft){let yt=Ue(By,new Set(M.keys())),kt=Ge(ft,yt,M);We(kt.meta,yt,Ct=>l(R,Ct),kt.name),Object.keys(kt.meta).length>0&&(Et=kt.meta),Et?.collapsed?.toLowerCase()==="true"&&(St=!0,delete Et.collapsed,Object.keys(Et).length===0&&(Et=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,...Et?{metadata:Et}:{},...St?{collapsed:!0}:{}},r.groups.push(p);continue}if(N.startsWith("[")){let xt=N.match(lK);if(xt&&xt[1].includes("|")){let ht=xt[1],Et=ht.indexOf("|"),ft=ht.substring(0,Et).trim().replace(/\([^)]*\)$/,"").trim(),St=ht.substring(Et).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:Et,color:ft}=ye(xt,e,r.diagnostics,R);(ht||C.entries.length===0)&&(C.defaultValue=Et),C.entries.push({value:Et,color:ft??cn,lineNumber:R});continue}C&&(C=null);let A=N.match(cK);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(),Et=ht.match(/^(.+?)\((red|orange|yellow|green|blue|purple|teal|cyan|gray|black|white)\)$/);Et&&l(R,`'(${Et[2]})' parens-color syntax removed from sequence diagrams \u2014 use 'tag:' groups for coloring`),u=!0,f=!0;let ft={kind:"section",label:Et?Et[1].trim():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 Et=xt.substring(3);if(_4.has(Et)||rK.has(Et)){if(u){s(R,`Options like '${N}' must appear before the first message or declaration`);continue}r.options[Et]="off";continue}}let ht=N.match(Wn);if(ht){let Et=ht[1].toLowerCase(),ft=ht[2].trim();if(nK.has(Et)||_4.has(Et)){if(u){s(R,`Options like '${N}' must appear before the first message or declaration`);continue}r.options[Et]=ft;continue}}if(_4.has(xt)){if(u){s(R,`Options like '${N}' must appear before the first message or declaration`);continue}if(Ko.has(xt)){for(let Et of Ko)delete r.options[Et];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(aK);if(q){u=!0;let xt=q[1],ht=q[2].toLowerCase(),Et=q[3]?.trim()||"",ft=oK.has(ht)?ht:"default";B!==void 0&&o.set(B,xt);let St=Et.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 kt=k.get(yt);kt?s(R,`Participant '${xt}' is already in group '${kt}' \u2014 participants can only belong to one group`):(p.participantIds.push(yt),k.set(yt,p.name))}continue}let{core:V,meta:X}=_(N,R),z=V.match(iK);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 Et=x(xt,R,{...X!==void 0&&{metadata:X}});if(p&&!p.participantIds.includes(Et)){let ft=k.get(Et);ft?s(R,`Participant '${xt}' is already in group '${ft}' \u2014 participants can only belong to one group`):(p.participantIds.push(Et),k.set(Et,p.name))}continue}{let{core:xt,meta:ht,alias:Et}=_(N,R),ft=p&&pe(T)>0;if(/^\S+$/.test(xt)&&!e1.test(xt)&&(ft||!f||ht)){u=!0;let St=xt;Et!==void 0&&o.set(Et,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 kt=k.get(yt);kt?s(R,`Participant '${St}' is already in group '${kt}' \u2014 participants can only belong to one group`):(p.participantIds.push(yt),k.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=QL(Y);if(nt&&"error"in nt){s(R,nt.error);continue}if(nt){u=!0,f=!0;let{from:xt,to:ht,label:Et,async:ft}=nt,St=x(a(xt),R),Tt=x(a(ht),R);v=St;let yt=Eo(Et,R);yt.diagnostics.forEach(gt=>r.diagnostics.push(gt));let kt=yt.label??Et,Ct={kind:"message",from:St,to:Tt,label:kt,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],Et=j[3].trim();s(R,`Colon syntax is no longer supported. Use '${xt} ${F?"~":"-"}${Et}${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],Et=x(a(xt),R),ft=x(a(ht),R);v=Et;let St={kind:"message",from:Et,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=fK(N,r.participants,g,E(),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 Et={kind:"note",text:ht.join(`
25
25
  `),position:xt.position,participantId:xt.participantId,lineNumber:R,endLineNumber:S+1};f=!0,w().push(Et);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});Er(S,r.tagGroups,l,be),In(r.tagGroups,l,s)}return r}function A4(t){return t?t.split(`
26
26
  `).some(n=>{let r=n.trim();return r.startsWith("//")?!1:e1.test(r)}):!1}var nK,_4,rK,oK,aK,iK,sK,lK,cK,e1,dK,uK,Cd=dt(()=>{"use strict";T4();en();ro();fi();Re();yr();Oe();nK=new Set(["active-tag"]),_4=new Set(["fill-tint","fill-solid","fill-outline","no-title","no-legend","legend-inline"]),rK=new Set(["activations"]),oK=new Set(["database","actor","queue","cache"]);aK=/^([^:]+?)\s+is\s+an?\s+(\w+)(?:\s+(.+))?$/i,iK=/^(\S+?)\((red|orange|yellow|green|blue|purple|teal|cyan|gray|black|white)\)\s*$/,sK=/^\[([^\]|]+?)(?:\(([^)]+)\))?\]\s*(.*)$/,lK=/^\[([^\]]+)\]\s*(.*)$/,cK=/^==\s+(.+?)(?:\s*==)?\s*$/,e1=/\S+\s*(?:<-\S+-|<~\S+~|-\S+->|~\S+~>|->|~>|<-|<~)\s*\S+/,dK=/^note\s+(.+)$/i,uK=/^note(?:\s+(right|left)(?:\s+(?:of\s+)?(.+?))?)?\s*$/i});var gc,mSt,R4=dt(()=>{"use strict";gc={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