([t,e],n)
| 1 | // @observablehq/plot v0.6.16 Copyright 2020-2023 Observable, Inc. |
| 2 | !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("d3@7.9.0/dist/d3.min.js")):"function"==typeof define&&define.amd?define(["exports","d3@7.9.0/dist/d3.min.js"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).Plot=t.Plot||{},t.d3)}(this,(function(t,e){"use strict";function n(t){return null!=t&&!Number.isNaN(t)}function r(t,r){return+n(r)-+n(t)||e.ascending(t,r)}function o(t,r){return+n(r)-+n(t)||e.descending(t,r)}function i(t){return null!=t&&""!=`${t}`}function a(t){return isFinite(t)?t:NaN}function l(t){return t>0&&isFinite(t)?t:NaN}function s(t){return t<0&&isFinite(t)?t:NaN}function c(t,e){if(t instanceof Date||(t=new Date(+t)),isNaN(t))return"function"==typeof e?e(t):e;const n=t.getUTCHours(),r=t.getUTCMinutes(),o=t.getUTCSeconds(),i=t.getUTCMilliseconds();return`${a=t.getUTCFullYear(),a<0?`-${u(-a,6)}`:a>9999?`+${u(a,6)}`:u(a,4)}-${u(t.getUTCMonth()+1,2)}-${u(t.getUTCDate(),2)}${n||r||o||i?`T${u(n,2)}:${u(r,2)}${o||i?`:${u(o,2)}${i?`.${u(i,3)}`:""}`:""}Z`:""}`;var a}function u(t,e){return`${t}`.padStart(e,"0")}const f=/^(?:[-+]\d{2})?\d{4}(?:-\d{2}(?:-\d{2})?)?(?:T\d{2}:\d{2}(?::\d{2}(?:\.\d{3})?)?(?:Z|[-+]\d{2}:?\d{2})?)?$/;function h(t,e){return f.test(t+="")?new Date(t):"function"==typeof e?e(t):e}function d(t){if(null==t)return;const n=t[0],r=t[t.length-1];return e.descending(n,r)}const p=1e3,m=6e4,y=36e5,g=864e5,v=7*g,x=30*g,w=365*g,b=[["millisecond",1],["2 milliseconds",2],["5 milliseconds",5],["10 milliseconds",10],["20 milliseconds",20],["50 milliseconds",50],["100 milliseconds",100],["200 milliseconds",200],["500 milliseconds",500],["second",p],["5 seconds",5e3],["15 seconds",15e3],["30 seconds",3e4],["minute",m],["5 minutes",3e5],["15 minutes",9e5],["30 minutes",18e5],["hour",y],["3 hours",108e5],["6 hours",216e5],["12 hours",432e5],["day",g],["2 days",2*g],["week",v],["2 weeks",2*v],["month",x],["3 months",3*x],["6 months",6*x],["year",w],["2 years",2*w],["5 years",5*w],["10 years",10*w],["20 years",20*w],["50 years",50*w],["100 years",100*w]],k=new Map([["second",p],["minute",m],["hour",y],["day",g],["monday",v],["tuesday",v],["wednesday",v],["thursday",v],["friday",v],["saturday",v],["sunday",v],["week",v],["month",x],["year",w]]),$=new Map([["second",e.timeSecond],["minute",e.timeMinute],["hour",e.timeHour],["day",e.timeDay],["monday",e.timeMonday],["tuesday",e.timeTuesday],["wednesday",e.timeWednesday],["thursday",e.timeThursday],["friday",e.timeFriday],["saturday",e.timeSaturday],["sunday",e.timeSunday],["week",e.timeWeek],["month",e.timeMonth],["year",e.timeYear]]),M=new Map([["second",e.utcSecond],["minute",e.utcMinute],["hour",e.utcHour],["day",e.unixDay],["monday",e.utcMonday],["tuesday",e.utcTuesday],["wednesday",e.utcWednesday],["thursday",e.utcThursday],["friday",e.utcFriday],["saturday",e.utcSaturday],["sunday",e.utcSunday],["week",e.utcWeek],["month",e.utcMonth],["year",e.utcYear]]),A=Symbol("intervalDuration"),L=Symbol("intervalType");for(const[t,e]of $)e[A]=k.get(t),e[L]="time";for(const[t,e]of M)e[A]=k.get(t),e[L]="utc";const S=[["year",e.utcYear,"utc"],["month",e.utcMonth,"utc"],["day",e.unixDay,"utc",6*x],["hour",e.utcHour,"utc",3*g],["minute",e.utcMinute,"utc",216e5],["second",e.utcSecond,"utc",18e5]],z=[["year",e.timeYear,"time"],["month",e.timeMonth,"time"],["day",e.timeDay,"time",6*x],["hour",e.timeHour,"time",3*g],["minute",e.timeMinute,"time",216e5],["second",e.timeSecond,"time",18e5]],O=[S[0],z[0],S[1],z[1],S[2],z[2],...S.slice(3)];function E(t){let e=`${t}`.toLowerCase();e.endsWith("s")&&(e=e.slice(0,-1));let n=1;const r=/^(?:(\d+)\s+)/.exec(e);switch(r&&(e=e.slice(r[0].length),n=+r[1]),e){case"quarter":e="month",n*=3;break;case"half":e="month",n*=6}let o=M.get(e);if(!o)throw new Error(`unknown interval: ${t}`);if(n>1&&!o.every)throw new Error(`non-periodic interval: ${e}`);return[e,n]}function R(t){return N(E(t),"time")}function C(t){return N(E(t),"utc")}function N([t,e],n){let r=("time"===n?$:M).get(t);return e>1&&(r=r.every(e),r[A]=k.get(t)*e,r[L]=n),r}function T(t,n){if(!(n>1))return;const r=t[A];if(!b.some((([,t])=>t===r)))return;if(r%g==0&&g<r&&r<x)return;const[o]=b[e.bisector((([,t])=>Math.log(t))).center(b,Math.log(r*n))];return("time"===t[L]?R:C)(o)}function B(t,n,r){const o="time"===n?e.timeFormat:e.utcFormat;if(null==r)return o("year"===t?"%Y":"month"===t?"%Y-%m":"day"===t?"%Y-%m-%d":"hour"===t||"minute"===t?"%Y-%m-%dT%H:%M":"second"===t?"%Y-%m-%dT%H:%M:%S":"%Y-%m-%dT%H:%M:%S.%L");const i=function(t){return"left"===t||"right"===t?(t,e)=>`\n${t}\n${e}`:"top"===t?(t,e)=>`${e}\n${t}`:(t,e)=>`${t}\n${e}`}(r);switch(t){case"millisecond":return P(o(".%L"),o(":%M:%S"),i);case"second":return P(o(":%S"),o("%-I:%M"),i);case"minute":return P(o("%-I:%M"),o("%p"),i);case"hour":return P(o("%-I %p"),o("%b %-d"),i);case"day":return P(o("%-d"),o("%b"),i);case"month":return P(o("%b"),o("%Y"),i);case"year":return o("%Y")}throw new Error("unable to format time ticks")}function I(t,n,r){const o=e.max(e.pairs(n,((t,e)=>Math.abs(e-t))));if(o<1e3)return B("millisecond","utc",r);for(const[e,i,a,l]of function(t){return"time"===t?z:"utc"===t?S:O}(t)){if(o>l)break;if("hour"===e&&!o)break;if(n.every((t=>i.floor(t)>=t)))return B(e,a,r)}}function P(t,e,n){return(r,o,i)=>{const a=t(r,o),l=e(r,o),s=o-d(i);return o!==s&&void 0!==i[s]&&l===e(i[s],s)?a:n(a,l)}}const W=Object.getPrototypeOf(Uint8Array),j=Object.prototype.toString;function F(t){return t instanceof Array||t instanceof W}function q(t){return t instanceof W&&!function(t){return t instanceof BigInt64Array||t instanceof BigUint64Array}(t)}function D(t){return t?.prototype instanceof W&&!function(t){return t===BigInt64Array||t===BigUint64Array}(t)}const Y=Symbol("reindex");function _(t,e,n){const r=typeof e;return"string"===r?fe(t)?U(t.getChild(e),n):G(t,V(e),n):"function"===r?G(t,e,n):"number"===r||e instanceof Date||"boolean"===r?vt(t,at(e),n):"function"==typeof e?.transform?X(e.transform(t),n):function(t,e){return null!=t&&e?Ct(t,e):t}(X(e,n),t?.[Y])}function G(t,e,n){return vt(t,D(n)?(t,n)=>ct(e(t,n)):e,n)}function X(t,e){return void 0===e?gt(t):he(t)?U(t,e):t instanceof e?t:e.from(t,D(e)&&!q(t)?ct:void 0)}function U(t,e){return null==t?t:void 0!==e&&e!==Array||!function(t){return t&&(8===t.typeId||10===t.typeId)&&1===t.unit}(t.type)?X(t.toArray(),e):ut(t.toArray())}const H=[null],V=t=>e=>{const n=e[t];return void 0===n&&"Feature"===e.type?e.properties?.[t]:n},Z={transform:Rt},Q={transform:t=>t},J=()=>1,K=()=>!0,tt=t=>null==t?t:`${t}`,et=t=>null==t?t:+t,nt=t=>t?t[0]:void 0,rt=t=>t?t[1]:void 0,ot=t=>t?t[2]:void 0,at=t=>()=>t;function lt(t){const n=+`${t}`.slice(1)/100;return(t,r)=>e.quantile(t,n,r)}function st(t){return q(t)?t:vt(t,ct,Float64Array)}function ct(t){return null==t?NaN:Number(t)}function ut(t){return vt(t,ft)}function ft(t){return t instanceof Date&&!isNaN(t)?t:"string"==typeof t?h(t):null==t||isNaN(t=Number(t))?void 0:new Date(t)}function ht(t,e){return void 0===t&&(t=e),null===t?[void 0,"none"]:re(t)?[void 0,t]:[t,void 0]}function dt(t,e){return void 0===t&&(t=e),null===t||"number"==typeof t?[void 0,t]:[t,void 0]}function pt(t,e,n){if(null!=t)return mt(t,e,n)}function mt(t,e,n){const r=`${t}`.toLowerCase();if(!n.includes(r))throw new Error(`invalid ${e}: ${t}`);return r}function yt(t){return fe(t)?t:gt(t)}function gt(t){if(null==t||F(t))return t;if(he(t))return U(t);switch(t.type){case"FeatureCollection":return t.features;case"GeometryCollection":return t.geometries;case"Feature":case"LineString":case"MultiLineString":case"MultiPoint":case"MultiPolygon":case"Point":case"Polygon":case"Sphere":return[t]}return Array.from(t)}function vt(t,e,n=Array){return null==t?t:t instanceof n?t.map(e):n.from(t,e)}function xt(t,e=Array){return t instanceof e?t.slice():e.from(t)}function wt({x:t,x1:e,x2:n}){return void 0!==t||void 0!==e||void 0!==n}function bt({y:t,y1:e,y2:n}){return void 0!==t||void 0!==e||void 0!==n}function kt(t){return wt(t)||bt(t)||void 0!==t.interval}function $t(t){return t?.toString===j}function Mt(t){return $t(t)&&(void 0!==t.type||void 0!==t.domain)}function At(t){return $t(t)&&"function"!=typeof t.transform}function Lt(t){return At(t)&&void 0===t.value&&void 0===t.channel}function St(t,e,n,r=Q){return void 0===e&&void 0===n?(e=0,n=void 0===t?r:t):void 0===e?e=void 0===t?0:t:void 0===n&&(n=void 0===t?0:t),[e,n]}function zt(t,e){return void 0===t&&void 0===e?[nt,rt]:[t,e]}function Ot({z:t,fill:e,stroke:n}={}){return void 0===t&&([t]=ht(e)),void 0===t&&([t]=ht(n)),t}function Et(t){return F(t)?t.length:t?.numRows}function Rt(t){const e=Et(t),n=new Uint32Array(e);for(let t=0;t<e;++t)n[t]=t;return n}function Ct(t,e){return F(t)?vt(e,(e=>t[e]),t.constructor):vt(e,(e=>t.at(e)))}function Nt(t){return 1===t.length?(e,n)=>t(Ct(n,e)):t}function Tt(t,e,n){return t.subarray?t.subarray(e,n):t.slice(e,n)}function Bt(t){return null!==t&&"object"==typeof t?t.valueOf():t}function It(t,e){if(void 0!==e[t])return e[t];switch(t){case"x1":case"x2":t="x";break;case"y1":case"y2":t="y"}return e[t]}function Pt(t){let e;return[{transform:()=>e,label:jt(t)},t=>e=t]}function Wt(t){return null==t?[t]:Pt(t)}function jt(t,e){return"string"==typeof t?t:t&&void 0!==t.label?t.label:e}function Ft(t,e){return{transform(n){const r=t.transform(n),o=e.transform(n);return Qt(r)||Qt(o)?vt(r,((t,e)=>new Date((+r[e]+ +o[e])/2))):vt(r,((t,e)=>(+r[e]+ +o[e])/2),Float64Array)},label:t.label}}function qt(t,e){const n=Dt(e?.interval,e?.type);return n?vt(t,n):t}function Dt(t,e){const r=Yt(t,e);return r&&(t=>n(t)?r.floor(t):t)}function Yt(t,e){if(null!=t){if("number"==typeof t)return _t(t);if("string"==typeof t)return("time"===e?R:C)(t);if("function"!=typeof t.floor)throw new Error("invalid interval; missing floor method");if("function"!=typeof t.offset)throw new Error("invalid interval; missing offset method");return t}}function _t(t){0<(t=+t)&&t<1&&Number.isInteger(1/t)&&(t=-1/t);const n=Math.abs(t);return t<0?{floor:t=>Math.floor(t*n)/n,offset:(t,e=1)=>(t*n+Math.floor(e))/n,range:(t,r)=>e.range(Math.ceil(t*n),r*n).map((t=>t/n))}:{floor:t=>Math.floor(t/n)*n,offset:(t,e=1)=>t+n*Math.floor(e),range:(t,r)=>e.range(Math.ceil(t/n),r/n).map((t=>t*n))}}function Gt(t,e){if((t=Yt(t,e))&&"function"!=typeof t.range)throw new Error("invalid interval: missing range method");return t}function Xt(t){return"function"==typeof t?.range}function Ut(t){return void 0===t||At(t)?t:{value:t}}function Ht(t){return t&&"function"==typeof t[Symbol.iterator]}function Vt(t){for(const e of t)if(null!=e)return"object"!=typeof e||e instanceof Date}function Zt(t){for(const e of t){if(null==e)continue;const t=typeof e;return"string"===t||"boolean"===t}}function Qt(t){for(const e of t)if(null!=e)return e instanceof Date}function Jt(t){for(const e of t)if(null!=e)return"string"==typeof e&&isNaN(e)&&h(e)}function Kt(t){for(const e of t)if(null!=e){if("string"!=typeof e)return!1;if(e.trim())return!isNaN(e)}}function te(t){for(const e of t)if(null!=e)return"number"==typeof e}function ee(t,e){let n;for(const r of t)if(null!=r){if(!e(r))return!1;n=!0}return n}const ne=new Set("none,currentcolor,transparent,aliceblue,antiquewhite,aqua,aquamarine,azure,beige,bisque,black,blanchedalmond,blue,blueviolet,brown,burlywood,cadetblue,chartreuse,chocolate,coral,cornflowerblue,cornsilk,crimson,cyan,darkblue,darkcyan,darkgoldenrod,darkgray,darkgreen,darkgrey,darkkhaki,darkmagenta,darkolivegreen,darkorange,darkorchid,darkred,darksalmon,darkseagreen,darkslateblue,darkslategray,darkslategrey,darkturquoise,darkviolet,deeppink,deepskyblue,dimgray,dimgrey,dodgerblue,firebrick,floralwhite,forestgreen,fuchsia,gainsboro,ghostwhite,gold,goldenrod,gray,green,greenyellow,grey,honeydew,hotpink,indianred,indigo,ivory,khaki,lavender,lavenderblush,lawngreen,lemonchiffon,lightblue,lightcoral,lightcyan,lightgoldenrodyellow,lightgray,lightgreen,lightgrey,lightpink,lightsalmon,lightseagreen,lightskyblue,lightslategray,lightslategrey,lightsteelblue,lightyellow,lime,limegreen,linen,magenta,maroon,mediumaquamarine,mediumblue,mediumorchid,mediumpurple,mediumseagreen,mediumslateblue,mediumspringgreen,mediumturquoise,mediumvioletred,midnightblue,mintcream,mistyrose,moccasin,navajowhite,navy,oldlace,olive,olivedrab,orange,orangered,orchid,palegoldenrod,palegreen,paleturquoise,palevioletred,papayawhip,peachpuff,peru,pink,plum,powderblue,purple,rebeccapurple,red,rosybrown,royalblue,saddlebrown,salmon,sandybrown,seagreen,seashell,sienna,silver,skyblue,slateblue,slategray,slategrey,snow,springgreen,steelblue,tan,teal,thistle,tomato,turquoise,violet,wheat,white,whitesmoke,yellow".split(","));function re(t){return"string"==typeof t&&(t=t.toLowerCase().trim(),/^#[0-9a-f]{3,8}$/.test(t)||/^(?:url|var|rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch|color|color-mix)\(.*\)$/.test(t)||ne.has(t))}function oe(t){return"number"==typeof t&&(0<=t&&t<=1||isNaN(t))}function ie(t){return null==t||ae(t)}function ae(t){return/^\s*none\s*$/i.test(t)}function le(t,e){return pt(t,e,["middle","top-left","top","top-right","right","bottom-right","bottom","bottom-left","left"])}function se(t="middle"){return le(t,"frameAnchor")}function ce(t){return Ht(t)?function(t){console.warn("named iterables are deprecated; please use an object instead");const e=new Set;return Object.fromEntries(Array.from(t,(t=>{const{name:n}=t;if(null==n)throw new Error("missing name");const r=`${n}`;if("__proto__"===r)throw new Error(`illegal name: ${r}`);if(e.has(r))throw new Error(`duplicate name: ${r}`);return e.add(r),[n,t]})))}(t):t}function ue(t){return!0===t?t="frame":!1===t?t=null:null!=t&&(t=mt(t,"clip",["frame","sphere"])),t}function fe(t){return t&&"function"==typeof t.getChild&&"function"==typeof t.toArray&&t.schema&&Array.isArray(t.schema.fields)}function he(t){return t&&"function"==typeof t.toArray&&t.type}const de=Symbol("position"),pe=Symbol("color"),me=Symbol("radius"),ye=Symbol("length"),ge=Symbol("opacity"),ve=Symbol("symbol"),xe=Symbol("projection"),we=new Map([["x",de],["y",de],["fx",de],["fy",de],["r",me],["color",pe],["opacity",ge],["symbol",ve],["length",ye],["projection",xe]]);const be=Math.sqrt(3),ke=2/be,$e={draw(t,e){const n=Math.sqrt(e/Math.PI),r=n*ke,o=r/2;t.moveTo(0,r),t.lineTo(n,o),t.lineTo(n,-o),t.lineTo(0,-r),t.lineTo(-n,-o),t.lineTo(-n,o),t.closePath()}},Me=new Map([["asterisk",e.symbolAsterisk],["circle",e.symbolCircle],["cross",e.symbolCross],["diamond",e.symbolDiamond],["diamond2",e.symbolDiamond2],["hexagon",$e],["plus",e.symbolPlus],["square",e.symbolSquare],["square2",e.symbolSquare2],["star",e.symbolStar],["times",e.symbolTimes],["triangle",e.symbolTriangle],["triangle2",e.symbolTriangle2],["wye",e.symbolWye]]);function Ae(t){return t&&"function"==typeof t.draw}function Le(t){return!!Ae(t)||"string"==typeof t&&Me.has(t.toLowerCase())}function Se(t){if(null==t||Ae(t))return t;const e=Me.get(`${t}`.toLowerCase());if(e)return e;throw new Error(`invalid symbol: ${t}`)}function ze({filter:t,sort:e,reverse:n,transform:r,initializer:o,...i}={},a){if(void 0===r&&(null!=t&&(r=Ne(t)),null==e||Lt(e)||(r=Ee(r,Ie(e))),n&&(r=Ee(r,Te))),null!=a&&null!=o)throw new Error("transforms cannot be applied after initializers");return{...i,...(null===e||Lt(e))&&{sort:e},transform:Ee(r,a)}}function Oe({filter:t,sort:e,reverse:n,initializer:r,...o}={},i){return void 0===r&&(null!=t&&(r=Ne(t)),null==e||Lt(e)||(r=Re(r,Ie(e))),n&&(r=Re(r,Te))),{...o,...(null===e||Lt(e))&&{sort:e},initializer:Re(r,i)}}function Ee(t,e){return null==t?null===e?void 0:e:null==e?null===t?void 0:t:function(n,r,o){return({data:n,facets:r}=t.call(this,n,r,o)),e.call(this,yt(n),r,o)}}function Re(t,e){return null==t?null===e?void 0:e:null==e?null===t?void 0:t:function(n,r,o,...i){let a,l,s,c,u,f;return({data:l=n,facets:s=r,channels:a}=t.call(this,n,r,o,...i)),({data:u=l,facets:f=s,channels:c}=e.call(this,l,s,{...o,...a},...i)),{data:u,facets:f,channels:{...a,...c}}}}function Ce(t,e){return(null!=t.initializer?Oe:ze)(t,e)}function Ne(t){return(e,n)=>{const r=_(e,t);return{data:e,facets:n.map((t=>t.filter((t=>r[t]))))}}}function Te(t,e){return{data:t,facets:e.map((t=>t.slice().reverse()))}}function Be(t,{sort:e,...n}={}){return{...(At(t)&&void 0!==t.channel?Oe:Ce)(n,Ie(t)),sort:Lt(e)?e:null}}function Ie(t){return("function"==typeof t&&1!==t.length?Pe:We)(t)}function Pe(t){return(e,n)=>{const r=F(e)?(n,r)=>t(e[n],e[r]):(n,r)=>t(e.get(n),e.get(r));return{data:e,facets:n.map((t=>t.slice().sort(r)))}}}function We(t){let e,n;({channel:e,value:t,order:n}={...Ut(t)});const i=e?.startsWith("-");if(i&&(e=e.slice(1)),void 0===n&&(n=i?o:r),"function"!=typeof n)switch(`${n}`.toLowerCase()){case"ascending":n=r;break;case"descending":n=o;break;default:throw new Error(`invalid order: ${n}`)}return(r,o,i)=>{let a;if(void 0===e)a=_(r,t);else{if(void 0===i)throw new Error("channel sort requires an initializer");if(a=i[e],!a)return{};a=a.value}const l=(t,e)=>n(a[t],a[e]);return{data:r,facets:o.map((t=>t.slice().sort(l)))}}}function je(t,e){return Ye(null,null,t,e)}function Fe(t={y:"count"},e={}){const{x:n=Q}=e;if(null==n)throw new Error("missing channel: x");return Ye(n,null,t,e)}function qe(t={x:"count"},e={}){const{y:n=Q}=e;if(null==n)throw new Error("missing channel: y");return Ye(null,n,t,e)}function De(t={fill:"count"},e={}){let{x:n,y:r}=e;if([n,r]=zt(n,r),null==n)throw new Error("missing channel: x");if(null==r)throw new Error("missing channel: y");return Ye(n,r,t,e)}function Ye(t,e,{data:n=ln,filter:r,sort:o,reverse:i,...a}={},l={}){a=Qe(a,l),n=tn(n,Q),o=null==o?void 0:Je("sort",o,l),r=null==r?void 0:Ke("filter",r,l);const[s,c]=Wt(t),[u,f]=Wt(e),{z:h,fill:d,stroke:p,x1:m,x2:y,y1:g,y2:v,...x}=l,[w,b]=Wt(h),[k]=ht(d),[$]=ht(p),[M,A]=Wt(k),[L,S]=Wt($);return{..."z"in l&&{z:w||h},..."fill"in l&&{fill:M||d},..."stroke"in l&&{stroke:L||p},...ze(x,((l,s,u)=>{const d=qt(_(l,t),u?.x),p=qt(_(l,e),u?.y),m=_(l,h),y=_(l,k),g=_(l,$),v=nn(a,{z:m,fill:y,stroke:g}),x=[],w=[],M=d&&c([]),L=p&&f([]),z=m&&b([]),O=y&&A([]),E=g&&S([]);let R=0;for(const t of a)t.initialize(l);o&&o.initialize(l),r&&r.initialize(l);for(const t of s){const e=[];for(const e of a)e.scope("facet",t);o&&o.scope("facet",t),r&&r.scope("facet",t);for(const[i,s]of He(t,v))for(const[t,c]of He(s,p))for(const[s,u]of He(c,d)){const c={data:l};if(d&&(c.x=s),p&&(c.y=t),v&&(c.z=i),!r||r.reduce(u,c)){e.push(R++),w.push(n.reduceIndex(u,l,c)),d&&M.push(s),p&&L.push(t),m&&z.push(v===m?i:m[u[0]]),y&&O.push(v===y?i:y[u[0]]),g&&E.push(v===g?i:g[u[0]]);for(const t of a)t.reduce(u,c);o&&o.reduce(u,c)}}x.push(e)}return rn(x,o,i),{data:w,facets:x}})),...!_e(a,"x")&&(s?{x:s}:{x1:m,x2:y}),...!_e(a,"y")&&(u?{y:u}:{y1:g,y2:v}),...Object.fromEntries(a.map((({name:t,output:e})=>[t,e])))}}function _e(t,...e){for(const{name:n}of t)if(e.includes(n))return!0;return!1}function Ge(t,e,n=Xe){const r=Object.entries(t);return null!=e.title&&void 0===t.title&&r.push(["title",cn]),null!=e.href&&void 0===t.href&&r.push(["href",sn]),r.filter((([,t])=>void 0!==t)).map((([t,r])=>null===r?function(t){return{name:t,initialize(){},scope(){},reduce(){}}}(t):n(t,r,e)))}function Xe(t,e,n,r=Ue){let o;$t(e)&&"reduce"in e&&(o=e.scale,e=e.reduce);const i=r(t,e,n),[a,l]=Pt(i.label);let s;return{name:t,output:void 0===o?a:{value:a,scale:o},initialize(t){i.initialize(t),s=l([])},scope(t,e){i.scope(t,e)},reduce(t,e){s.push(i.reduce(t,e))}}}function Ue(t,e,n,r=Ve){const o=It(t,n),i=r(e,o);let a,l;return{label:jt(i===fn?null:o,i.label),initialize(t){a=void 0===o?t:_(t,o),"data"===i.scope&&(l=i.reduceIndex(Rt(t),a))},scope(t,e){i.scope===t&&(l=i.reduceIndex(e,a))},reduce:(t,e)=>null==i.scope?i.reduceIndex(t,a,e):i.reduceIndex(t,a,l,e)}}function He(t,n){return n?e.group(t,(t=>n[t])):[[,t]]}function Ve(t,n,r=Ze){if(null==t)return r(t);if("function"==typeof t.reduceIndex)return t;if("function"==typeof t.reduce&&$t(t))return function(t){return console.warn("deprecated reduce interface; implement reduceIndex instead."),{...t,reduceIndex:t.reduce.bind(t)}}(t);if("function"==typeof t)return o=t,{reduceIndex:(t,e,n)=>o(Ct(e,t),n)};var o;if(/^p\d{2}$/i.test(t))return on(lt(t));switch(`${t}`.toLowerCase()){case"first":return sn;case"last":return un;case"identity":return ln;case"count":return fn;case"distinct":return hn;case"sum":return null==n?fn:dn;case"proportion":return pn(n,"data");case"proportion-facet":return pn(n,"facet");case"deviation":return on(e.deviation);case"min":return on(e.min);case"min-index":return on(e.minIndex);case"max":return on(e.max);case"max-index":return on(e.maxIndex);case"mean":return an(e.mean);case"median":return an(e.median);case"variance":return on(e.variance);case"mode":return on(e.mode)}return r(t)}function Ze(t){throw new Error(`invalid reduce: ${t}`)}function Qe(t,e){return Ge(t,e,Je)}function Je(t,e,n){return Xe(t,e,n,Ke)}function Ke(t,e,n){return Ue(t,e,n,tn)}function tn(t,e){return Ve(t,e,en)}function en(t){switch(`${t}`.toLowerCase()){case"x":return mn;case"y":return yn;case"z":return gn}throw new Error(`invalid group reduce: ${t}`)}function nn(t,e){for(const n in e){const r=e[n];if(void 0!==r&&!t.some((t=>t.name===n)))return r}}function rn(t,e,n){if(e){const n=e.output.transform(),o=(t,e)=>r(n[t],n[e]);t.forEach((t=>t.sort(o)))}n&&t.forEach((t=>t.reverse()))}function on(t){return{reduceIndex:(e,n)=>t(e,(t=>n[t]))}}function an(t){return{reduceIndex(e,n){const r=t(e,(t=>n[t]));return Qt(n)?new Date(r):r}}}const ln={reduceIndex:(t,e)=>Ct(e,t)},sn={reduceIndex:(t,e)=>e[t[0]]},cn={reduceIndex(t,n){const r=e.sort(e.rollup(t,(t=>t.length),(t=>n[t])),rt),o=r.slice(-5).reverse();if(o.length<r.length){const t=r.slice(0,-4);o[4]=[`… ${t.length.toLocaleString("en-US")} more`,e.sum(t,rt)]}return o.map((([t,e])=>`${t} (${e.toLocaleString("en-US")})`)).join("\n")}},un={reduceIndex:(t,e)=>e[t[t.length-1]]},fn={label:"Frequency",reduceIndex:t=>t.length},hn={label:"Distinct",reduceIndex(t,n){const r=new e.InternSet;for(const e of t)r.add(n[e]);return r.size}},dn=on(e.sum);function pn(t,n){return null==t?{scope:n,label:"Frequency",reduceIndex:(t,e,n=1)=>t.length/n}:{scope:n,reduceIndex:(t,n,r=1)=>e.sum(t,(t=>n[t]))/r}}const mn={reduceIndex:(t,e,{x:n})=>n},yn={reduceIndex:(t,e,{y:n})=>n},gn={reduceIndex:(t,e,{z:n})=>n};function vn(t,{scale:e,type:n,value:r,filter:o,hint:i,label:a=jt(r)},l){return void 0===i&&"function"==typeof r?.transform&&(i=r.hint),bn(l,{scale:e,type:n,value:_(t,r),label:a,filter:o,hint:i})}function xn(t,e){return Object.fromEntries(Object.entries(t).map((([t,n])=>[t,vn(e,n,t)])))}function wn(t,e){const n=Object.fromEntries(Object.entries(t).map((([t,{scale:n,value:r}])=>{const o=null==n?null:e[n];return[t,null==o?r:vt(r,o)]})));return n.channels=t,n}function bn(t,e){const{scale:n,value:r}=e;if(!0===n||"auto"===n)switch(t){case"fill":case"stroke":case"color":e.scale=!0!==n&&ee(r,re)?null:"color",e.defaultScale="color";break;case"fillOpacity":case"strokeOpacity":case"opacity":e.scale=!0!==n&&ee(r,oe)?null:"opacity",e.defaultScale="opacity";break;case"symbol":!0!==n&&ee(r,Le)?(e.scale=null,e.value=vt(r,Se)):e.scale="symbol",e.defaultScale="symbol";break;default:e.scale=we.has(t)?t:null}else if(!1===n)e.scale=null;else if(null!=n&&!we.has(n))throw new Error(`unknown scale: ${n}`);return e}function kn(t,e){for(const n in t){const r=t[n];if(r.scale===e)return r}}function $n(t,e){const n=t.original;if(n===t)return e;const r=e.value,o=e.value=[];for(let e=0;e<n.length;++e){const i=r[n[e][0]];for(const n of t[e])o[n]=i}return e}function Mn(t,e,n){const r=An(t,e);return vt(An(t,n),((t,e)=>Math.abs(t-r[e])),Float64Array)}function An(t,e,n){let r=t[e];if(r||void 0===n||(r=t[n]),r)return r.value;throw new Error(`missing channel: ${e}`)}function Ln(t){if(null==t||"function"==typeof t)return t;switch(`${t}`.toLowerCase()){case"ascending":return Sn;case"descending":return zn}throw new Error(`invalid order: ${t}`)}function Sn([t,e],[n,o]){return r(e,o)||r(t,n)}function zn([t,e],[n,i]){return o(e,i)||r(t,n)}function On(t,e){let n=t[e];if(n){for(;n.source;)n=n.source;return null===n.source?null:n}}const En=new Map([["accent",e.schemeAccent],["category10",e.schemeCategory10],["dark2",e.schemeDark2],["observable10",e.schemeObservable10],["paired",e.schemePaired],["pastel1",e.schemePastel1],["pastel2",e.schemePastel2],["set1",e.schemeSet1],["set2",e.schemeSet2],["set3",e.schemeSet3],["tableau10",e.schemeTableau10]]);const Rn=new Map([...En,["brbg",Nn(e.schemeBrBG,e.interpolateBrBG)],["prgn",Nn(e.schemePRGn,e.interpolatePRGn)],["piyg",Nn(e.schemePiYG,e.interpolatePiYG)],["puor",Nn(e.schemePuOr,e.interpolatePuOr)],["rdbu",Nn(e.schemeRdBu,e.interpolateRdBu)],["rdgy",Nn(e.schemeRdGy,e.interpolateRdGy)],["rdylbu",Nn(e.schemeRdYlBu,e.interpolateRdYlBu)],["rdylgn",Nn(e.schemeRdYlGn,e.interpolateRdYlGn)],["spectral",Nn(e.schemeSpectral,e.interpolateSpectral)],["burd",Tn(e.schemeRdBu,e.interpolateRdBu)],["buylrd",Tn(e.schemeRdYlBu,e.interpolateRdYlBu)],["blues",Cn(e.schemeBlues,e.interpolateBlues)],["greens",Cn(e.schemeGreens,e.interpolateGreens)],["greys",Cn(e.schemeGreys,e.interpolateGreys)],["oranges",Cn(e.schemeOranges,e.interpolateOranges)],["purples",Cn(e.schemePurples,e.interpolatePurples)],["reds",Cn(e.schemeReds,e.interpolateReds)],["turbo",Bn(e.interpolateTurbo)],["viridis",Bn(e.interpolateViridis)],["magma",Bn(e.interpolateMagma)],["inferno",Bn(e.interpolateInferno)],["plasma",Bn(e.interpolatePlasma)],["cividis",Bn(e.interpolateCividis)],["cubehelix",Bn(e.interpolateCubehelixDefault)],["warm",Bn(e.interpolateWarm)],["cool",Bn(e.interpolateCool)],["bugn",Cn(e.schemeBuGn,e.interpolateBuGn)],["bupu",Cn(e.schemeBuPu,e.interpolateBuPu)],["gnbu",Cn(e.schemeGnBu,e.interpolateGnBu)],["orrd",Cn(e.schemeOrRd,e.interpolateOrRd)],["pubu",Cn(e.schemePuBu,e.interpolatePuBu)],["pubugn",Cn(e.schemePuBuGn,e.interpolatePuBuGn)],["purd",Cn(e.schemePuRd,e.interpolatePuRd)],["rdpu",Cn(e.schemeRdPu,e.interpolateRdPu)],["ylgn",Cn(e.schemeYlGn,e.interpolateYlGn)],["ylgnbu",Cn(e.schemeYlGnBu,e.interpolateYlGnBu)],["ylorbr",Cn(e.schemeYlOrBr,e.interpolateYlOrBr)],["ylorrd",Cn(e.schemeYlOrRd,e.interpolateYlOrRd)],["rainbow",In(e.interpolateRainbow)],["sinebow",In(e.interpolateSinebow)]]);function Cn(t,n){return({length:r})=>1===r?[t[3][1]]:2===r?[t[3][1],t[3][2]]:(r=Math.max(3,Math.floor(r)))>9?e.quantize(n,r):t[r]}function Nn(t,n){return({length:r})=>2===r?[t[3][0],t[3][2]]:(r=Math.max(3,Math.floor(r)))>11?e.quantize(n,r):t[r]}function Tn(t,n){return({length:r})=>2===r?[t[3][2],t[3][0]]:(r=Math.max(3,Math.floor(r)))>11?e.quantize((t=>n(1-t)),r):t[r].slice().reverse()}function Bn(t){return({length:n})=>e.quantize(t,Math.max(2,Math.floor(n)))}function In(t){return({length:n})=>e.quantize(t,Math.floor(n)+1).slice(0,-1)}function Pn(t){const e=`${t}`.toLowerCase();if(!Rn.has(e))throw new Error(`unknown ordinal scheme: ${e}`);return Rn.get(e)}function Wn(t,e){const n=Pn(t),r="function"==typeof n?n({length:e}):n;return r.length!==e?r.slice(0,e):r}const jn=new Map([["brbg",e.interpolateBrBG],["prgn",e.interpolatePRGn],["piyg",e.interpolatePiYG],["puor",e.interpolatePuOr],["rdbu",e.interpolateRdBu],["rdgy",e.interpolateRdGy],["rdylbu",e.interpolateRdYlBu],["rdylgn",e.interpolateRdYlGn],["spectral",e.interpolateSpectral],["burd",t=>e.interpolateRdBu(1-t)],["buylrd",t=>e.interpolateRdYlBu(1-t)],["blues",e.interpolateBlues],["greens",e.interpolateGreens],["greys",e.interpolateGreys],["purples",e.interpolatePurples],["reds",e.interpolateReds],["oranges",e.interpolateOranges],["turbo",e.interpolateTurbo],["viridis",e.interpolateViridis],["magma",e.interpolateMagma],["inferno",e.interpolateInferno],["plasma",e.interpolatePlasma],["cividis",e.interpolateCividis],["cubehelix",e.interpolateCubehelixDefault],["warm",e.interpolateWarm],["cool",e.interpolateCool],["bugn",e.interpolateBuGn],["bupu",e.interpolateBuPu],["gnbu",e.interpolateGnBu],["orrd",e.interpolateOrRd],["pubugn",e.interpolatePuBuGn],["pubu",e.interpolatePuBu],["purd",e.interpolatePuRd],["rdpu",e.interpolateRdPu],["ylgnbu",e.interpolateYlGnBu],["ylgn",e.interpolateYlGn],["ylorbr",e.interpolateYlOrBr],["ylorrd",e.interpolateYlOrRd],["rainbow",e.interpolateRainbow],["sinebow",e.interpolateSinebow]]);function Fn(t){const e=`${t}`.toLowerCase();if(!jn.has(e))throw new Error(`unknown quantitative scheme: ${e}`);return jn.get(e)}const qn=new Set(["brbg","prgn","piyg","puor","rdbu","rdgy","rdylbu","rdylgn","spectral","burd","buylrd"]);const Dn=t=>e=>t(1-e),Yn=[0,1],_n=new Map([["number",e.interpolateNumber],["rgb",e.interpolateRgb],["hsl",e.interpolateHsl],["hcl",e.interpolateHcl],["lab",e.interpolateLab]]);function Gn(t){const e=`${t}`.toLowerCase();if(!_n.has(e))throw new Error(`unknown interpolator: ${e}`);return _n.get(e)}function Xn(t,n,r,{type:o,nice:i,clamp:a,zero:l,domain:s=Zn(t,r),unknown:c,round:u,scheme:f,interval:h,range:p=(we.get(t)===me?Jn(r,s):we.get(t)===ye?Kn(r,s):we.get(t)===ge?Yn:void 0),interpolate:m=(we.get(t)===pe?null==f&&void 0!==p?e.interpolateRgb:Fn(void 0!==f?f:"cyclical"===o?"rainbow":"turbo"):u?e.interpolateRound:e.interpolateNumber),reverse:y}){if(h=Gt(h,o),"cyclical"!==o&&"sequential"!==o||(o="linear"),"function"!=typeof m&&(m=Gn(m)),y=!!y,void 0!==p){if((s=gt(s)).length!==(p=gt(p)).length){if(1===m.length)throw new Error("invalid piecewise interpolator");m=e.piecewise(m,p),p=void 0}}if(1===m.length?(y&&(m=Dn(m),y=!1),void 0===p&&2===(p=Float64Array.from(s,((t,e)=>e/(s.length-1)))).length&&(p=Yn),n.interpolate((p===Yn?at:nr)(m))):n.interpolate(m),l){const[t,n]=e.extent(s);if(t>0||n<0){(d(s=xt(s))||1)===Math.sign(t)?s[0]=0:s[s.length-1]=0}}return y&&(s=e.reverse(s)),n.domain(s).unknown(c),i&&(n.nice(function(t,e){return!0===t?void 0:"number"==typeof t?t:function(t,e){if((t=Gt(t,e))&&"function"!=typeof t.ceil)throw new Error("invalid interval: missing ceil method");return t}(t,e)}(i,o)),s=n.domain()),void 0!==p&&n.range(p),a&&n.clamp(a),{type:o,domain:s,range:p,scale:n,interpolate:m,interval:h}}function Un(t,n,{exponent:r=1,...o}){return Xn(t,e.scalePow().exponent(r),n,{...o,type:"pow"})}function Hn(t,n,{domain:r=[0],unknown:o,scheme:i="rdylbu",interpolate:a,range:l=(void 0!==a?e.quantize(a,r.length+1):we.get(t)===pe?Wn(i,r.length+1):void 0),reverse:s}){const c=d(r=gt(r));if(!isNaN(c)&&!function(t,n){for(let r=1,o=t.length,i=t[0];r<o;++r){const o=e.descending(i,i=t[r]);if(0!==o&&o!==n)return!1}return!0}(r,c))throw new Error(`the ${t} scale has a non-monotonic domain`);return s&&(l=e.reverse(l)),{type:"threshold",scale:e.scaleThreshold(c<0?e.reverse(r):r,void 0===l?[]:l).unknown(o),domain:r,range:l}}function Vn(t,n=a){return t.length?[e.min(t,(({value:t})=>void 0===t?t:e.min(t,n))),e.max(t,(({value:t})=>void 0===t?t:e.max(t,n)))]:[0,1]}function Zn(t,e){const n=we.get(t);return(n===me||n===ge||n===ye?Qn:Vn)(e)}function Qn(t){return[0,t.length?e.max(t,(({value:t})=>void 0===t?t:e.max(t,a))):1]}function Jn(t,n){const r=t.find((({radius:t})=>void 0!==t));if(void 0!==r)return[0,r.radius];const o=e.quantile(t,.5,(({value:t})=>void 0===t?NaN:e.quantile(t,.25,l))),i=n.map((t=>3*Math.sqrt(t/o))),a=30/e.max(i);return a<1?i.map((t=>t*a)):i}function Kn(t,n){const r=e.median(t,(({value:t})=>void 0===t?NaN:e.median(t,Math.abs))),o=n.map((t=>12*t/r)),i=60/e.max(o);return i<1?o.map((t=>t*i)):o}function tr(t){for(const{value:e}of t)if(void 0!==e)for(let n of e){if(n>0)return Vn(t,l);if(n<0)return Vn(t,s)}return[1,10]}function er(t){const e=[];for(const{value:n}of t)if(void 0!==n)for(const t of n)e.push(t);return e}function nr(t){return(e,n)=>r=>t(e+r*(n-e))}let rr,or=0;function ir(t){t!==rr&&(rr=t,console.warn(t),++or)}function ar(t,n,r,o,{type:i,nice:a,clamp:l,domain:s=Vn(o),unknown:c,pivot:u=0,scheme:f,range:h,symmetric:d=!0,interpolate:p=(we.get(t)===pe?null==f&&void 0!==h?e.interpolateRgb:Fn(void 0!==f?f:"rdbu"):e.interpolateNumber),reverse:m}){u=+u,s=gt(s);let[y,g]=s;if(s.length>2&&ir(`Warning: the diverging ${t} scale domain contains extra elements.`),e.descending(y,g)<0&&([y,g]=[g,y],m=!m),y=Math.min(y,u),g=Math.max(g,u),"function"!=typeof p&&(p=Gn(p)),void 0!==h&&(p=1===p.length?nr(p)(...h):e.piecewise(p,h)),m&&(p=Dn(p)),d){const t=r.apply(u),e=t-r.apply(y),n=r.apply(g)-t;e<n?y=r.invert(t-n):e>n&&(g=r.invert(t+e))}return n.domain([y,u,g]).unknown(c).interpolator(p),l&&n.clamp(l),a&&n.nice(a),{type:i,domain:[y,g],pivot:u,interpolate:p,scale:n}}function lr(t,n,{exponent:r=1,...o}){return ar(t,e.scaleDivergingPow().exponent(r=+r),function(t){return.5===t?fr:{apply:e=>Math.sign(e)*Math.pow(Math.abs(e),t),invert:e=>Math.sign(e)*Math.pow(Math.abs(e),1/t)}}(r),n,{...o,type:"diverging-pow"})}function sr(t,n,{constant:r=1,...o}){return ar(t,e.scaleDivergingSymlog().constant(r=+r),function(t){return{apply:e=>Math.sign(e)*Math.log1p(Math.abs(e/t)),invert:e=>Math.sign(e)*Math.expm1(Math.abs(e))*t}}(r),n,o)}const cr={apply:t=>t,invert:t=>t},ur={apply:Math.log,invert:Math.exp},fr={apply:t=>Math.sign(t)*Math.sqrt(Math.abs(t)),invert:t=>Math.sign(t)*(t*t)};function hr(t,e,n,r){return Xn(t,e,n,r)}const dr=Symbol("ordinal");function pr(t,n,r,{type:o,interval:i,domain:a,range:l,reverse:s,hint:c}){return i=Gt(i,o),void 0===a&&(a=gr(r,i,t)),"categorical"!==o&&o!==dr||(o="ordinal"),s&&(a=e.reverse(a)),a=n.domain(a).domain(),void 0!==l&&("function"==typeof l&&(l=l(a)),n.range(l)),{type:o,domain:a,range:l,scale:n,hint:c,interval:i}}function mr(t,n,{type:r,interval:o,domain:i,range:a,scheme:l,unknown:s,...c}){let u;if(o=Gt(o,r),void 0===i&&(i=gr(n,o,t)),we.get(t)===ve)u=function(t){return{fill:vr(t,"fill"),stroke:vr(t,"stroke")}}(n),a=void 0===a?function(t){return ie(t.fill)?e.symbolsStroke:e.symbolsFill}(u):vt(a,Se);else if(we.get(t)===pe&&(void 0!==a||"ordinal"!==r&&r!==dr||(a=function(t,e="greys"){const n=new Set,[r,o]=Wn(e,2);for(const e of t)if(null!=e)if(!0===e)n.add(o);else{if(!1!==e)return;n.add(r)}return[...n]}(i,l),void 0!==a&&(l=void 0)),void 0===l&&void 0===a&&(l="ordinal"===r?"turbo":"observable10"),void 0!==l))if(void 0!==a){const t=Fn(l),n=a[0],r=a[1]-a[0];a=({length:o})=>e.quantize((e=>t(n+r*e)),o)}else a=Pn(l);if(s===e.scaleImplicit)throw new Error(`implicit unknown on ${t} scale is not supported`);return pr(t,e.scaleOrdinal().unknown(s),n,{...c,type:r,domain:i,range:a,hint:u})}function yr(t,e,n,r){let{round:o}=n;return void 0!==o&&t.round(o=!!o),(t=pr(r,t,e,n)).round=o,t}function gr(t,n,o){const i=new e.InternSet;for(const{value:e,domain:n}of t){if(void 0!==n)return n();if(void 0!==e)for(const t of e)i.add(t)}if(void 0!==n){const[t,r]=e.extent(i).map(n.floor,n);return n.range(t,n.offset(r))}if(i.size>1e4&&we.get(o)===de)throw new Error(`implicit ordinal domain of ${o} scale has more than 10,000 values`);return e.sort(i,r)}function vr(t,e){let n;for(const{hint:r}of t){const t=r?.[e];if(void 0!==t)if(void 0===n)n=t;else if(n!==t)return}return n}function xr(t,{label:e,inset:n=0,insetTop:r=n,insetRight:o=n,insetBottom:i=n,insetLeft:a=n,round:l,nice:s,clamp:c,zero:u,align:f,padding:h,projection:d,facet:{label:p=e}={},...m}={}){const y={};for(const[n,g]of t){const t=m[n],v=Er(n,g,{round:we.get(n)===de?l:void 0,nice:s,clamp:c,zero:u,align:f,padding:h,projection:d,...t});if(v){let{label:l=("fx"===n||"fy"===n?p:e),percent:s,transform:c,inset:u,insetTop:f=(void 0!==u?u:"y"===n?r:0),insetRight:h=(void 0!==u?u:"x"===n?o:0),insetBottom:d=(void 0!==u?u:"y"===n?i:0),insetLeft:m=(void 0!==u?u:"x"===n?a:0)}=t||{};if(null==c)c=void 0;else if("function"!=typeof c)throw new Error("invalid scale transform; not a function");v.percent=!!s,v.label=void 0===l?br(g,v):l,v.transform=c,"x"===n||"fx"===n?(v.insetLeft=+m,v.insetRight=+h):"y"!==n&&"fy"!==n||(v.insetTop=+f,v.insetBottom=+d),y[n]=v}}return y}function wr(t){const e={},n={scales:e};for(const[r,o]of Object.entries(t)){const{scale:t,type:i,interval:a,label:l}=o;e[r]=Fr(o),n[r]=t,t.type=i,null!=a&&(t.interval=a),null!=l&&(t.label=l)}return n}function br(t=[],e){let n;for(const{label:e}of t)if(void 0!==e)if(void 0===n)n=e;else if(n!==e)return;if(void 0!==n)return!Br(e)&&e.percent&&(n=`${n} (%)`),{inferred:!0,toString:()=>n}}function kr(t){return Math.sign(d(t.domain()))*Math.sign(d(t.range()))}function $r(t){const{marginTop:e,marginRight:n,marginBottom:r,marginLeft:o,width:i,height:a,facet:{marginTop:l,marginRight:s,marginBottom:c,marginLeft:u}}=t;return{marginTop:Math.max(e,l),marginRight:Math.max(n,s),marginBottom:Math.max(r,c),marginLeft:Math.max(o,u),width:i,height:a}}function Mr({fx:t,fy:e},n){const{marginTop:r,marginRight:o,marginBottom:i,marginLeft:a,width:l,height:s}=$r(n);return{marginTop:r,marginRight:o,marginBottom:i,marginLeft:a,width:t?t.scale.bandwidth()+a+o:l,height:e?e.scale.bandwidth()+r+i:s,facet:{width:l,height:s}}}function Ar(t,e){if(void 0===t.range){const{insetLeft:n,insetRight:r}=t,{width:o,marginLeft:i=0,marginRight:a=0}=e,l=i+n,s=o-a-r;t.range=[l,Math.max(l,s)],Br(t)||(t.range=zr(t)),t.scale.range(t.range)}Sr(t)}function Lr(t,e){if(void 0===t.range){const{insetTop:n,insetBottom:r}=t,{height:o,marginTop:i=0,marginBottom:a=0}=e,l=i+n,s=o-a-r;t.range=[Math.max(l,s),l],Br(t)?t.range.reverse():t.range=zr(t),t.scale.range(t.range)}Sr(t)}function Sr(t){void 0===t.round&&function({type:t}){return"point"===t||"band"===t}(t)&&function({scale:t}){const e=t.domain().length,[n,r]=t.range(),o=t.paddingInner?t.paddingInner():1,i=t.paddingOuter?t.paddingOuter():t.padding(),a=e-o,l=Math.abs(r-n)/Math.max(1,a+2*i);return(l-Math.floor(l))*a}(t)<=30&&t.scale.round(!0)}function zr(t){const e=t.scale.domain().length+Ir(t);if(!(e>2))return t.range;const[n,r]=t.range;return Array.from({length:e},((t,o)=>n+o/(e-1)*(r-n)))}function Or(t,e,n){return Er(t,void 0===n?void 0:[{hint:n}],{...e})}function Er(t,n=[],r={}){const o=function(t,e,{type:n,domain:r,range:o,scheme:i,pivot:a,projection:l}){if(n=Cr(n),"fx"===t||"fy"===t)return"band";"x"!==t&&"y"!==t||null==l||(n=Nr);for(const t of e){const e=Cr(t.type);if(void 0!==e)if(void 0===n)n=e;else if(n!==e)throw new Error(`scale incompatible with channel: ${n} !== ${e}`)}if(n===Nr)return;if(void 0!==n)return n;if(void 0===r&&!e.some((({value:t})=>void 0!==t)))return;const s=we.get(t);if(s===me)return"sqrt";if(s===ge||s===ye)return"linear";if(s===ve)return"ordinal";if((r||o||[]).length>2)return Tr(s);if(void 0!==r){if(Zt(r))return Tr(s);if(Qt(r))return"utc"}else{const t=e.map((({value:t})=>t)).filter((t=>void 0!==t));if(t.some(Zt))return Tr(s);if(t.some(Qt))return"utc"}if(s===pe){if(null!=a||function(t){return null!=t&&qn.has(`${t}`.toLowerCase())}(i))return"diverging";if(function(t){return null!=t&&En.has(`${t}`.toLowerCase())}(i))return"categorical"}return"linear"}(t,n,r);if(void 0===r.type&&void 0===r.domain&&void 0===r.range&&null==r.interval&&"fx"!==t&&"fy"!==t&&Br({type:o})){const e=n.map((({value:t})=>t)).filter((t=>void 0!==t));e.some(Qt)?ir(`Warning: some data associated with the ${t} scale are dates. Dates are typically associated with a "utc" or "time" scale rather than a "${Rr(o)}" scale. If you are using a bar mark, you probably want a rect mark with the interval option instead; if you are using a group transform, you probably want a bin transform instead. If you want to treat this data as ordinal, you can specify the interval of the ${t} scale (e.g., d3.utcDay), or you can suppress this warning by setting the type of the ${t} scale to "${Rr(o)}".`):e.some(Jt)?ir(`Warning: some data associated with the ${t} scale are strings that appear to be dates (e.g., YYYY-MM-DD). If these strings represent dates, you should parse them to Date objects. Dates are typically associated with a "utc" or "time" scale rather than a "${Rr(o)}" scale. If you are using a bar mark, you probably want a rect mark with the interval option instead; if you are using a group transform, you probably want a bin transform instead. If you want to treat this data as ordinal, you can suppress this warning by setting the type of the ${t} scale to "${Rr(o)}".`):e.some(Kt)&&ir(`Warning: some data associated with the ${t} scale are strings that appear to be numbers. If these strings represent numbers, you should parse or coerce them to numbers. Numbers are typically associated with a "linear" scale rather than a "${Rr(o)}" scale. If you want to treat this data as ordinal, you can specify the interval of the ${t} scale (e.g., 1 for integers), or you can suppress this warning by setting the type of the ${t} scale to "${Rr(o)}".`)}switch(r.type=o,o){case"diverging":case"diverging-sqrt":case"diverging-pow":case"diverging-log":case"diverging-symlog":case"cyclical":case"sequential":case"linear":case"sqrt":case"threshold":case"quantile":case"pow":case"log":case"symlog":r=Wr(n,r,st);break;case"identity":switch(we.get(t)){case de:r=Wr(n,r,st);break;case ve:r=Wr(n,r,jr)}break;case"utc":case"time":r=Wr(n,r,ut)}switch(o){case"diverging":return function(t,n,r){return ar(t,e.scaleDiverging(),cr,n,r)}(t,n,r);case"diverging-sqrt":return function(t,e,n){return lr(t,e,{...n,exponent:.5})}(t,n,r);case"diverging-pow":return lr(t,n,r);case"diverging-log":return function(t,n,{base:r=10,pivot:o=1,domain:i=Vn(n,o<0?s:l),...a}){return ar(t,e.scaleDivergingLog().base(r=+r),ur,n,{domain:i,pivot:o,...a})}(t,n,r);case"diverging-symlog":return sr(t,n,r);case"categorical":case"ordinal":case dr:return mr(t,n,r);case"cyclical":case"sequential":case"linear":return function(t,n,r){return Xn(t,e.scaleLinear(),n,r)}(t,n,r);case"sqrt":return function(t,e,n){return Un(t,e,{...n,exponent:.5})}(t,n,r);case"threshold":return Hn(t,0,r);case"quantile":return function(t,n,{range:r,quantiles:o=(void 0===r?5:(r=[...r]).length),n:i=o,scheme:a="rdylbu",domain:l=er(n),unknown:s,interpolate:c,reverse:u}){return void 0===r&&(r=void 0!==c?e.quantize(c,i):we.get(t)===pe?Wn(a,i):void 0),l.length>0&&(l=e.scaleQuantile(l,void 0===r?{length:i}:r).quantiles()),Hn(t,0,{domain:l,range:r,reverse:u,unknown:s})}(t,n,r);case"quantize":return function(t,n,{range:r,n:o=(void 0===r?5:(r=[...r]).length),scheme:i="rdylbu",domain:a=Zn(t,n),unknown:l,interpolate:s,reverse:c}){const[u,f]=e.extent(a);let h;return void 0===r?(h=e.ticks(u,f,o),h[0]<=u&&h.splice(0,1),h[h.length-1]>=f&&h.pop(),o=h.length+1,r=void 0!==s?e.quantize(s,o):we.get(t)===pe?Wn(i,o):void 0):(h=e.quantize(e.interpolateNumber(u,f),o+1).slice(1,-1),u instanceof Date&&(h=h.map((t=>new Date(t))))),d(gt(a))<0&&h.reverse(),Hn(t,0,{domain:h,range:r,reverse:c,unknown:l})}(t,n,r);case"pow":return Un(t,n,r);case"log":return function(t,n,{base:r=10,domain:o=tr(n),...i}){return Xn(t,e.scaleLog().base(r),n,{...i,domain:o})}(t,n,r);case"symlog":return function(t,n,{constant:r=1,...o}){return Xn(t,e.scaleSymlog().constant(r),n,o)}(t,n,r);case"utc":return function(t,n,r){return hr(t,e.scaleUtc(),n,r)}(t,n,r);case"time":return function(t,n,r){return hr(t,e.scaleTime(),n,r)}(t,n,r);case"point":return function(t,n,{align:r=.5,padding:o=.5,...i}){return yr(e.scalePoint().align(r).padding(o),n,i,t)}(t,n,r);case"band":return function(t,n,{align:r=.5,padding:o=.1,paddingInner:i=o,paddingOuter:a=("fx"===t||"fy"===t?0:o),...l}){return yr(e.scaleBand().align(r).paddingInner(i).paddingOuter(a),n,l,t)}(t,n,r);case"identity":return function(t){return{type:"identity",scale:(n=we.get(t),n===de||n===me||n===ye||n===ge?e.scaleIdentity():t=>t)};var n}(t);case void 0:return;default:throw new Error(`unknown scale type: ${o}`)}}function Rr(t){return"symbol"==typeof t?t.description:t}function Cr(t){return"string"==typeof t?`${t}`.toLowerCase():t}const Nr={toString:()=>"projection"};function Tr(t){switch(t){case de:return"point";case pe:return dr;default:return"ordinal"}}function Br({type:t}){return"ordinal"===t||"point"===t||"band"===t||t===dr}function Ir({type:t}){return"threshold"===t}function Pr(t){if(void 0===t)return!0;const e=t.domain(),n=t(e[0]);for(let r=1,o=e.length;r<o;++r)if(t(e[r])-n)return!1;return!0}function Wr(t,{domain:e,...n},r){for(const n of t)void 0!==n.value&&(void 0===e&&(e=n.value?.domain),n.value=r(n.value));return{domain:void 0===e?e:r(e),...n}}function jr(t){return vt(t,Se)}function Fr({scale:t,type:e,domain:n,range:r,interpolate:o,interval:i,transform:a,percent:l,pivot:s}){if("identity"===e)return{type:"identity",apply:t=>t,invert:t=>t};const c=t.unknown?t.unknown():void 0;return{type:e,domain:xt(n),...void 0!==r&&{range:xt(r)},...void 0!==a&&{transform:a},...l&&{percent:l},...void 0!==c&&{unknown:c},...void 0!==i&&{interval:i},...void 0!==o&&{interpolate:o},...t.clamp&&{clamp:t.clamp()},...void 0!==s&&{pivot:s,symmetric:!1},...t.base&&{base:t.base()},...t.exponent&&{exponent:t.exponent()},...t.constant&&{constant:t.constant()},...t.align&&{align:t.align(),round:t.round()},...t.padding&&(t.paddingInner?{paddingInner:t.paddingInner(),paddingOuter:t.paddingOuter()}:{padding:t.padding()}),...t.bandwidth&&{bandwidth:t.bandwidth(),step:t.step()},apply:e=>t(e),...t.invert&&{invert:e=>t.invert(e)}}}function qr(t,{fx:n,fy:r}){const o=Rt(t),i=n?.value,a=r?.value;return n&&r?e.rollup(o,(t=>(t.fx=i[t[0]],t.fy=a[t[0]],t)),(t=>i[t]),(t=>a[t])):n?e.rollup(o,(t=>(t.fx=i[t[0]],t)),(t=>i[t])):e.rollup(o,(t=>(t.fy=a[t[0]],t)),(t=>a[t]))}function Dr(t){const n=[],r=new Uint32Array(e.sum(t,(t=>t.length)));for(const e of t){let o=0;for(const n of t)e!==n&&(r.set(n,o),o+=n.length);n.push(r.slice(0,o))}return n}const Yr=new Map([["top",Hr],["right",Qr],["bottom",Vr],["left",Zr],["top-left",Jr(Hr,Zr)],["top-right",Jr(Hr,Qr)],["bottom-left",Jr(Vr,Zr)],["bottom-right",Jr(Vr,Qr)],["top-empty",function(t,{y:e},{x:n,y:r,empty:o}){if(o)return!1;if(!e)return;const i=Xr(e,r);if(i>0)return Ur(t,n,e[i-1])}],["right-empty",function(t,{x:e},{x:n,y:r,empty:o}){if(o)return!1;if(!e)return;const i=Xr(e,n);if(i<e.length-1)return Ur(t,e[i+1],r)}],["bottom-empty",function(t,{y:e},{x:n,y:r,empty:o}){if(o)return!1;if(!e)return;const i=Xr(e,r);if(i<e.length-1)return Ur(t,n,e[i+1])}],["left-empty",function(t,{x:e},{x:n,y:r,empty:o}){if(o)return!1;if(!e)return;const i=Xr(e,n);if(i>0)return Ur(t,e[i-1],r)}],["empty",function(t,e,{empty:n}){return n}]]);const _r=new WeakMap;function Gr(t){let n=_r.get(t);return n||_r.set(t,n=new e.InternMap(vt(t,((t,e)=>[t,e])))),n}function Xr(t,e){return Gr(t).get(e)}function Ur(t,e,n){return function(t,e,n){return e=Bt(e),n=Bt(n),t.find((t=>Object.is(Bt(t.x),e)&&Object.is(Bt(t.y),n)))}(t,e,n)?.empty}function Hr(t,{y:e},{y:n}){return!e||0===Xr(e,n)}function Vr(t,{y:e},{y:n}){return!e||Xr(e,n)===e.length-1}function Zr(t,{x:e},{x:n}){return!e||0===Xr(e,n)}function Qr(t,{x:e},{x:n}){return!e||Xr(e,n)===e.length-1}function Jr(t,e){return function(){return t.apply(null,arguments)&&e.apply(null,arguments)}}function Kr(t,{channels:{fx:e,fy:n},groups:r}){return e&&n?t.map((({x:t,y:e})=>r.get(t)?.get(e)??[])):e?t.map((({x:t})=>r.get(t)??[])):t.map((({y:t})=>r.get(t)??[]))}const to=Math.PI,eo=2*to,no=.618;function ro({projection:t,inset:n=0,insetTop:r=n,insetRight:o=n,insetBottom:i=n,insetLeft:a=n}={},l){if(null==t)return;if("function"==typeof t.stream)return t;let s,c,u="frame";if($t(t)){let e;if(({type:t,domain:c,inset:e,insetTop:r=(void 0!==e?e:r),insetRight:o=(void 0!==e?e:o),insetBottom:i=(void 0!==e?e:i),insetLeft:a=(void 0!==e?e:a),clip:u=u,...s}=t),null==t)return}"function"!=typeof t&&({type:t}=oo(t));const{width:f,height:h,marginLeft:d,marginRight:p,marginTop:m,marginBottom:y}=l,g=f-d-p-a-o,v=h-m-y-r-i;if(t=t?.({width:g,height:v,clip:u,...s}),null==t)return;u=function(t,n,r,o,i){if(!1===t||null==t||"number"==typeof t)return t=>t;!0===t&&(t="frame");if("frame"===`${t}`.toLowerCase())return e.geoClipRectangle(n,r,o,i);throw new Error(`unknown projection clip type: ${t}`)}(u,d,m,f-p,h-y);let x,w=d+a,b=m+r;if(null!=c){const[[n,r],[o,i]]=e.geoPath(t).bounds(c),a=Math.min(g/(o-n),v/(i-r));a>0?(w-=(a*(n+o)-g)/2,b-=(a*(r+i)-v)/2,x=e.geoTransform({point(t,e){this.stream.point(t*a+w,e*a+b)}})):ir("Warning: the projection could not be fit to the specified domain; using the default scale.")}return x??=0===w&&0===b?lo():e.geoTransform({point(t,e){this.stream.point(t+w,e+b)}}),{stream:e=>t.stream(x.stream(u(e)))}}function oo(t){switch(`${t}`.toLowerCase()){case"albers-usa":return io(e.geoAlbersUsa,.7463,.4673);case"albers":return ao(e.geoAlbers,.7463,.4673);case"azimuthal-equal-area":return io(e.geoAzimuthalEqualArea,4,4);case"azimuthal-equidistant":return io(e.geoAzimuthalEquidistant,eo,eo);case"conic-conformal":return ao(e.geoConicConformal,eo,eo);case"conic-equal-area":return ao(e.geoConicEqualArea,6.1702,2.9781);case"conic-equidistant":return ao(e.geoConicEquidistant,7.312,3.6282);case"equal-earth":return io(e.geoEqualEarth,5.4133,2.6347);case"equirectangular":return io(e.geoEquirectangular,eo,to);case"gnomonic":return io(e.geoGnomonic,3.4641,3.4641);case"identity":return{type:lo};case"reflect-y":return{type:so};case"mercator":return io(e.geoMercator,eo,eo);case"orthographic":return io(e.geoOrthographic,2,2);case"stereographic":return io(e.geoStereographic,2,2);case"transverse-mercator":return io(e.geoTransverseMercator,eo,eo);default:throw new Error(`unknown projection type: ${t}`)}}function io(t,e,n){return{type:({width:r,height:o,rotate:i,precision:a=.15,clip:l})=>{const s=t();return null!=a&&s.precision?.(a),null!=i&&s.rotate?.(i),"number"==typeof l&&s.clipAngle?.(l),null!=r&&(s.scale(Math.min(r/e,o/n)),s.translate([r/2,o/2])),s},aspectRatio:n/e}}function ao(t,e,n){const{type:r,aspectRatio:o}=io(t,e,n);return{type:t=>{const{parallels:e,domain:n,width:o,height:i}=t,a=r(t);return null!=e&&(a.parallels(e),void 0===n&&null!=o&&a.fitSize([o,i],{type:"Sphere"})),a},aspectRatio:o}}const lo=at({stream:t=>t}),so=at(e.geoTransform({point(t,e){this.stream.point(t,-e)}}));function co(t,e,n,r){const o=n[t],i=n[e],a=o.length,l=n[t]=new Float64Array(a).fill(NaN),s=n[e]=new Float64Array(a).fill(NaN);let c;const u=r.stream({point(t,e){l[c]=t,s[c]=e}});for(c=0;c<a;++c)u.point(o[c],i[c])}function uo({projection:t}={}){return null!=t&&("function"==typeof t.stream||($t(t)&&(t=t.type),null!=t))}function fo(t,e,{projection:n}){const{x:r,y:o}=t;let i={};return r&&(i.x=r),o&&(i.y=o),i=wn(i,e),n&&"x"===r?.scale&&"y"===o?.scale&&co("x","y",i,n),r&&(i.x=st(i.x)),o&&(i.y=st(i.y)),i}function ho(t){const n=[],r=[],o={scale:"x",value:n},i={scale:"y",value:r},a={point(t,e){n.push(t),r.push(e)},lineStart(){},lineEnd(){},polygonStart(){},polygonEnd(){},sphere(){}};for(const n of t.value)e.geoStream(n,a);return[o,i]}function po(t={}){const{document:e=("undefined"!=typeof window?window.document:void 0),clip:n}=t;return{document:e,clip:ue(n)}}function mo(t,{document:n}){return e.select(e.creator(t).call(n.documentElement))}const yo=Symbol("unset");function go(t){return(1===t.length?vo:xo)(t)}function vo(t){let e,n=yo;return r=>(Object.is(n,r)||(n=r,e=t(r)),e)}function xo(t){let e,n;return(...r)=>((n?.length!==r.length||n.some(((t,e)=>!Object.is(t,r[e]))))&&(n=r,e=t(...r)),e)}const wo=go((t=>new Intl.NumberFormat(t))),bo=go(((t,e)=>new Intl.DateTimeFormat(t,{timeZone:"UTC",...e&&{month:e}}))),ko=go(((t,e)=>new Intl.DateTimeFormat(t,{timeZone:"UTC",...e&&{weekday:e}})));function $o(t="en-US"){const e=wo(t);return t=>null==t||isNaN(t)?void 0:e.format(t)}function Mo(t){return c(t,"Invalid Date")}const Ao=function(t="en-US"){const e=$o(t);return t=>(t instanceof Date?Mo:"number"==typeof t?e:tt)(t)}(),Lo=("undefined"!=typeof window?window.devicePixelRatio>1:"undefined"==typeof it)?0:.5;let So=0,zo=0;function Oo(){return"plot-clip-"+ ++So}function Eo(t,{title:e,href:n,ariaLabel:r,ariaDescription:o,ariaHidden:i,target:a,fill:l,fillOpacity:s,stroke:c,strokeWidth:u,strokeOpacity:f,strokeLinejoin:h,strokeLinecap:d,strokeMiterlimit:p,strokeDasharray:m,strokeDashoffset:y,opacity:g,mixBlendMode:v,imageFilter:x,paintOrder:w,pointerEvents:b,shapeRendering:k,channels:$},{ariaLabel:M,fill:A="currentColor",fillOpacity:L,stroke:S="none",strokeOpacity:z,strokeWidth:O,strokeLinecap:E,strokeLinejoin:R,strokeMiterlimit:C,paintOrder:N}){null===A&&(l=null,s=null),null===S&&(c=null,f=null),ie(A)?ie(S)||ie(l)&&!$?.fill||(S="none"):!ie(S)||ie(c)&&!$?.stroke||(A="none");const[T,B]=ht(l,A),[I,P]=dt(s,L),[W,j]=ht(c,S),[F,q]=dt(f,z),[D,Y]=dt(g);ae(j)||(void 0===u&&(u=O),void 0===d&&(d=E),void 0===h&&(h=R),void 0!==p||/^\s*round\s*$/i.test(h)||(p=C),ae(B)||void 0!==w||(w=N));const[_,G]=dt(u);return null!==A&&(t.fill=Go(B,"currentColor"),t.fillOpacity=Xo(P,1)),null!==S&&(t.stroke=Go(j,"none"),t.strokeWidth=Xo(G,1),t.strokeOpacity=Xo(q,1),t.strokeLinejoin=Go(h,"miter"),t.strokeLinecap=Go(d,"butt"),t.strokeMiterlimit=Xo(p,4),t.strokeDasharray=Go(m,"none"),t.strokeDashoffset=Go(y,"0")),t.target=tt(a),t.ariaLabel=tt(M),t.ariaDescription=tt(o),t.ariaHidden=tt(i),t.opacity=Xo(Y,1),t.mixBlendMode=Go(v,"normal"),t.imageFilter=Go(x,"none"),t.paintOrder=Go(w,"normal"),t.pointerEvents=Go(b,"auto"),t.shapeRendering=Go(k,"auto"),{title:{value:e,optional:!0,filter:null},href:{value:n,optional:!0,filter:null},ariaLabel:{value:r,optional:!0,filter:null},fill:{value:T,scale:"auto",optional:!0},fillOpacity:{value:I,scale:"auto",optional:!0},stroke:{value:W,scale:"auto",optional:!0},strokeOpacity:{value:F,scale:"auto",optional:!0},strokeWidth:{value:_,optional:!0},opacity:{value:D,scale:"auto",optional:!0}}}function Ro(t,e){e&&t.text((t=>Ao(e[t])))}function Co(t,e){e&&t.text((([t])=>Ao(e[t])))}function No(t,{target:e,tip:n},{ariaLabel:r,title:o,fill:a,fillOpacity:l,stroke:s,strokeOpacity:c,strokeWidth:u,opacity:f,href:h}){r&&Yo(t,"aria-label",(t=>r[t])),a&&Yo(t,"fill",(t=>a[t])),l&&Yo(t,"fill-opacity",(t=>l[t])),s&&Yo(t,"stroke",(t=>s[t])),c&&Yo(t,"stroke-opacity",(t=>c[t])),u&&Yo(t,"stroke-width",(t=>u[t])),f&&Yo(t,"opacity",(t=>f[t])),h&&Do(t,(t=>h[t]),e),n||function(t,e){e&&t.filter((t=>i(e[t]))).append("title").call(Ro,e)}(t,o)}function To(t,{target:e,tip:n},{ariaLabel:r,title:o,fill:a,fillOpacity:l,stroke:s,strokeOpacity:c,strokeWidth:u,opacity:f,href:h}){r&&Yo(t,"aria-label",(([t])=>r[t])),a&&Yo(t,"fill",(([t])=>a[t])),l&&Yo(t,"fill-opacity",(([t])=>l[t])),s&&Yo(t,"stroke",(([t])=>s[t])),c&&Yo(t,"stroke-opacity",(([t])=>c[t])),u&&Yo(t,"stroke-width",(([t])=>u[t])),f&&Yo(t,"opacity",(([t])=>f[t])),h&&Do(t,(([t])=>h[t]),e),n||function(t,e){e&&t.filter((([t])=>i(e[t]))).append("title").call(Co,e)}(t,o)}function Bo(t,n,r){const o=e.group(t,(t=>n[t]));return void 0===r&&o.size>1+t.length>>1&&ir("Warning: the implicit z channel has high cardinality. This may occur when the fill or stroke channel is associated with quantitative data rather than ordinal or categorical data. You can suppress this warning by setting the z option explicitly; if this data represents a single series, set z to null."),o.values()}function*Io(t,e,r,o){const{z:i}=r,{z:a}=o,l=function({ariaLabel:t,title:e,fill:n,fillOpacity:r,stroke:o,strokeOpacity:i,strokeWidth:a,opacity:l,href:s},{tip:c}){return[t,c?void 0:e,n,r,o,i,a,l,s].filter((t=>void 0!==t))}(o,r),s=[...e,...l];for(const e of a?Bo(t,a,i):[t]){let t,r;t:for(const o of e){for(const t of s)if(!n(t[o])){r&&r.push(-1);continue t}if(void 0!==t){r.push(o);for(let e=0;e<l.length;++e){if(Bt(l[e][o])!==t[e]){yield r,t=l.map((t=>Bt(t[o]))),r=[o];continue t}}}else r&&(yield r),t=l.map((t=>Bt(t[o]))),r=[o]}r&&(yield r)}}function Po(t){const n=new WeakMap;return(r,o)=>{let i=n.get(r);if(!i){const a=Oo();e.select(r.ownerSVGElement).append("clipPath").attr("id",a).call(t,r,o),n.set(r,i=`url(#${a})`)}return i}}const Wo=Po(((t,e,n)=>{const{width:r,height:o,marginLeft:i,marginRight:a,marginTop:l,marginBottom:s}=n;t.append("rect").attr("x",i).attr("y",l).attr("width",r-a-i).attr("height",o-l-s)})),jo=Po(((t,n)=>{const{projection:r}=n;if(!r)throw new Error('the "sphere" clip option requires a projection');t.append("path").attr("d",e.geoPath(r)({type:"Sphere"}))}));function Fo(t,e,n,r){!function(t,e,n,r){let o;const{clip:i=r.clip}=e;switch(i){case"frame":t=mo("svg:g",r).each((function(){this.appendChild(t.node()),t.node=()=>this})),o=Wo(r,n);break;case"sphere":o=jo(r)}Yo(t,"aria-label",e.ariaLabel),Yo(t,"aria-description",e.ariaDescription),Yo(t,"aria-hidden",e.ariaHidden),Yo(t,"clip-path",o)}(t,e,n,r),Yo(t,"class",e.className),Yo(t,"fill",e.fill),Yo(t,"fill-opacity",e.fillOpacity),Yo(t,"stroke",e.stroke),Yo(t,"stroke-width",e.strokeWidth),Yo(t,"stroke-opacity",e.strokeOpacity),Yo(t,"stroke-linejoin",e.strokeLinejoin),Yo(t,"stroke-linecap",e.strokeLinecap),Yo(t,"stroke-miterlimit",e.strokeMiterlimit),Yo(t,"stroke-dasharray",e.strokeDasharray),Yo(t,"stroke-dashoffset",e.strokeDashoffset),Yo(t,"shape-rendering",e.shapeRendering),Yo(t,"filter",e.imageFilter),Yo(t,"paint-order",e.paintOrder);const{pointerEvents:o=(!1===r.pointerSticky?"none":void 0)}=e;Yo(t,"pointer-events",o)}function qo(t,e){!function(t,e,n){null!=n&&t.style(e,n)}(t,"mix-blend-mode",e.mixBlendMode),Yo(t,"opacity",e.opacity)}function Do(t,n,r){t.each((function(t){const o=n(t);if(null!=o){const t=this.ownerDocument.createElementNS(e.namespaces.svg,"a");t.setAttribute("fill","inherit"),t.setAttributeNS(e.namespaces.xlink,"href",o),null!=r&&t.setAttribute("target",r),this.parentNode.insertBefore(t,this).appendChild(this)}}))}function Yo(t,e,n){null!=n&&t.attr(e,n)}function _o(t,e,{x:n,y:r},o=Lo,i=Lo){o+=e.dx,i+=e.dy,n?.bandwidth&&(o+=n.bandwidth()/2),r?.bandwidth&&(i+=r.bandwidth()/2),(o||i)&&t.attr("transform",`translate(${o},${i})`)}function Go(t,e){if((t=tt(t))!==e)return t}function Xo(t,e){if((t=et(t))!==e)return t}const Uo=/^-?([_a-z]|[\240-\377]|\\[0-9a-f]{1,6}(\r\n|[ \t\r\n\f])?|\\[^\r\n\f0-9a-f])([_a-z0-9-]|[\240-\377]|\\[0-9a-f]{1,6}(\r\n|[ \t\r\n\f])?|\\[^\r\n\f0-9a-f])*$/i;function Ho(t){if(void 0===t)return"plot-d6a7b5";if(t=`${t}`,!Uo.test(t))throw new Error(`invalid class name: ${t}`);return t}function Vo(t,e){if("string"==typeof e)t.property("style",e);else if(null!=e)for(const n of t)Object.assign(n.style,e)}function Zo({frameAnchor:t},{width:e,height:n,marginTop:r,marginRight:o,marginBottom:i,marginLeft:a}){return[/left$/.test(t)?a:/right$/.test(t)?e-o:(a+e-o)/2,/^top/.test(t)?r:/^bottom/.test(t)?n-i:(r+n-i)/2]}class Qo{constructor(t,e={},n={},r){const{facet:o="auto",facetAnchor:i,fx:a,fy:l,sort:s,dx:c=0,dy:u=0,margin:f=0,marginTop:h=f,marginRight:d=f,marginBottom:p=f,marginLeft:m=f,className:y,clip:g=r?.clip,channels:v,tip:x,render:w}=n;if(this.data=t,this.sort=Lt(s)?s:null,this.initializer=Oe(n).initializer,this.transform=this.initializer?n.transform:ze(n).transform,null===o||!1===o?this.facet=null:(this.facet=mt(!0===o?"include":o,"facet",["auto","include","exclude","super"]),this.fx=t===H&&"string"==typeof a?[a]:a,this.fy=t===H&&"string"==typeof l?[l]:l),this.facetAnchor=function(t){if(null==t)return null;const e=Yr.get(`${t}`.toLowerCase());if(e)return e;throw new Error(`invalid facet anchor: ${t}`)}(i),e=ce(e),void 0!==v&&(e={...ti(v),...e}),void 0!==r&&(e={...Eo(this,n,r),...e}),this.channels=Object.fromEntries(Object.entries(e).map((([e,n])=>{if(At(n.value)){const{value:t,label:e=n.label,scale:r=n.scale}=n.value;n={...n,label:e,scale:r,value:t}}if(t===H&&"string"==typeof n.value){const{value:t}=n;n={...n,value:[t]}}return[e,n]})).filter((([t,{value:e,optional:n}])=>{if(null!=e)return!0;if(n)return!1;throw new Error(`missing channel value: ${t}`)}))),this.dx=+c,this.dy=+u,this.marginTop=+h,this.marginRight=+d,this.marginBottom=+p,this.marginLeft=+m,this.clip=ue(g),this.tip=function(t){return!0===t?"xy":!1===t||null==t?null:"string"==typeof t?mt(t,"tip",["x","y","xy"]):t}(x),this.className=y?Ho(y):null,"super"===this.facet){if(a||l)throw new Error("super-faceting cannot use fx or fy");for(const t in this.channels){const{scale:n}=e[t];if("x"===n||"y"===n)throw new Error("super-faceting cannot use x or y")}}null!=w&&(this.render=Ko(w,this.render))}initialize(t,n,r){let o=yt(this.data);void 0===t&&null!=o&&(t=[Rt(o)]);const i=t;null!=this.transform&&(({facets:t,data:o}=this.transform(o,t,r)),o=yt(o)),void 0!==t&&(t.original=i);const a=xn(this.channels,o);return null!=this.sort&&function(t,n,r,o,i){const{order:a,reverse:l,reduce:s=!0,limit:c}=i;for(const u in i){if(!we.has(u))continue;let{value:f,order:h=a,reverse:d=l,reduce:p=s,limit:m=c}=Ut(i[u]);const y=f?.startsWith("-");if(y&&(f=f.slice(1)),h=void 0===h?y!==("width"===f||"height"===f)?zn:Sn:Ln(h),null==p||!1===p)continue;const g="fx"===u||"fy"===u?$n(n,o[u]):kn(r,u);if(!g)throw new Error(`missing channel for scale: ${u}`);const v=g.value,[x=0,w=1/0]=Ht(m)?m:m<0?[m]:[0,m];if(null==f)g.domain=()=>{let t=Array.from(new e.InternSet(v));return d&&(t=t.reverse()),0===x&&w===1/0||(t=t.slice(x,w)),t};else{const n="data"===f?t:"height"===f?Mn(r,"y1","y2"):"width"===f?Mn(r,"x1","x2"):An(r,f,"y"===f?"y2":"x"===f?"x2":void 0),o=Ve(!0===p?"max":p,n);g.domain=()=>{let t=e.rollups(Rt(v),(t=>o.reduceIndex(t,n)),(t=>v[t]));return h&&t.sort(h),d&&t.reverse(),0===x&&w===1/0||(t=t.slice(x,w)),t.map(nt)}}}}(o,t,a,n,this.sort),{data:o,facets:t,channels:a}}filter(t,e,r){for(const o in e){const{filter:i=n}=e[o];if(null!==i){const e=r[o];t=t.filter((t=>i(e[t])))}}return t}project(t,e,n){for(const r in t)if("x"===t[r].scale&&/^x|x$/.test(r)){const o=r.replace(/^x|x$/,"y");o in t&&"y"===t[o].scale&&co(r,o,e,n.projection)}}scale(t,e,n){const r=wn(t,e);return n.projection&&this.project(t,r,n),r}}function Jo(...t){return t.plot=Qo.prototype.plot,t}function Ko(t,e){if(null==t)return null===e?void 0:e;if(null==e)return null===t?void 0:t;if("function"!=typeof t)throw new TypeError(`invalid render transform: ${t}`);if("function"!=typeof e)throw new TypeError(`invalid render transform: ${e}`);return function(n,r,o,i,a,l){return t.call(this,n,r,o,i,a,((t,n,r,o,i)=>e.call(this,t,n,r,o,i,l)))}}function ti(t){return Object.fromEntries(Object.entries(ce(t)).map((([t,e])=>(void 0===(e="string"==typeof e?{value:e,label:t}:Ut(e)).filter&&null==e.scale&&(e={...e,filter:null}),[t,e]))))}function ei(t,e){return!0===t?.tip?{...t,tip:e}:$t(t?.tip)&&void 0===t.tip.pointer?{...t,tip:{...t.tip,pointer:e}}:t}function ni({x:t,y:n,fy:r,fx:o},{projection:i,aspectRatio:a},{width:l,marginTopDefault:s,marginRightDefault:c,marginBottomDefault:u,marginLeftDefault:f}){const h=r&&r.scale.domain().length||1,d=function(t){if("function"==typeof t?.stream)return no;if($t(t)){let n,r;if(({domain:n,type:t,...r}=t),null!=n&&null!=t){const o="string"==typeof t?oo(t).type:t,[[i,a],[l,s]]=e.geoPath(o({...r,width:100,height:100})).bounds(n),c=(s-a)/(l-i);return c&&isFinite(c)?c<.2?.2:c>5?5:c:no}}if(null!=t){if("function"!=typeof t){const{aspectRatio:e}=oo(t);if(e)return e}return no}}(i);if(d){const t=(1.1*h-.1)/(1.1*(o?o.scale.domain().length:1)-.1)*d,e=Math.max(.1,Math.min(10,t));return Math.round((l-f-c)*e+s+u)}const p=n?Br(n)?n.scale.domain().length||1:Math.max(7,17/h):1;if(null!=a){if(a=+a,!(isFinite(a)&&a>0))throw new Error(`invalid aspectRatio: ${a}`);const e=ri("y",n)/(ri("x",t)*a),i=o?o.scale.bandwidth():1,h=r?r.scale.bandwidth():1;return(e*(i*(l-f-c)-t.insetLeft-t.insetRight)+n.insetTop+n.insetBottom)/h+s+u}return!(!n&&!r)*Math.max(1,Math.min(60,p*h))*20+30*!!o+60}function ri(t,n){if(!n)throw new Error(`aspectRatio requires ${t} scale`);const{type:r,domain:o}=n;let i;switch(r){case"linear":case"utc":case"time":i=Number;break;case"pow":{const t=n.scale.exponent();i=e=>Math.pow(e,t);break}case"log":i=Math.log;break;case"point":case"band":return o.length;default:throw new Error(`unsupported ${t} scale for aspectRatio: ${r}`)}const[a,l]=e.extent(o);return Math.abs(i(l)-i(a))}const oi=new WeakMap;function ii(t,n,{x:r,y:o,px:i,py:a,maxRadius:l=40,channels:s,render:c,...u}={}){return l=+l,null!=i&&(r??=null,s={...s,px:{value:i,scale:"x"}}),null!=a&&(o??=null,s={...s,py:{value:a,scale:"y"}}),{x:r,y:o,channels:s,...u,render:Ko((function(r,o,i,a,s,c){const u=(s={...s,pointerSticky:!1}).ownerSVGElement,{data:f}=s.getMarkState(this);let h=oi.get(u);h||oi.set(u,h={sticky:!1,roots:[],renders:[]});let d=h.renders.push(N)-1;const{x:p,y:m,fx:y,fy:g}=o;let v=y?y(r.fx)-a.marginLeft:0,x=g?g(r.fy)-a.marginTop:0;p?.bandwidth&&(v+=p.bandwidth()/2),m?.bandwidth&&(x+=m.bandwidth()/2);const w=null!=r.fi;let b;if(w){let t=h.facetStates;t||(h.facetStates=t=new Map),b=t.get(this),b||t.set(this,b=new Map)}const[k,$]=Zo(this,a),{px:M,py:A}=i,L=M?t=>M[t]:ci(i,k),S=A?t=>A[t]:ui(i,$);let z,O,E,R;function C(t,e){if(w){if(R&&(R=cancelAnimationFrame(R)),null!=t)return b.set(r.fi,e),void(R=requestAnimationFrame((()=>{R=null;for(const[n,o]of b)if(o<e||o===e&&n<r.fi){t=null;break}N(t)})));b.delete(r.fi)}N(t)}function N(t){if(z===t&&E===h.sticky)return;z=t,E=s.pointerSticky=h.sticky;const e=null==z?[]:[z];w&&(e.fx=r.fx,e.fy=r.fy,e.fi=r.fi);const n=c(e,o,i,a,s);if(O){if(w){const t=O.parentNode,e=O.getAttribute("transform"),r=n.getAttribute("transform");e?n.setAttribute("transform",e):n.removeAttribute("transform"),r?t.setAttribute("transform",r):t.removeAttribute("transform"),n.removeAttribute("aria-label"),n.removeAttribute("aria-description"),n.removeAttribute("aria-hidden")}O.replaceWith(n)}if(h.roots[d]=O=n,!(null==z&&b?.size>1)){const t=null==z?null:F(f)?f[z]:f.get(z);s.dispatchValue(t)}return n}function T(o){if(h.sticky||"mouse"===o.pointerType&&1===o.buttons)return;let[i,s]=e.pointer(o);i-=v,s-=x;const c=i<a.marginLeft||i>a.width-a.marginRight?1:t,u=s<a.marginTop||s>a.height-a.marginBottom?1:n;let f=null,d=l*l;for(const t of r){const e=c*(L(t)-i),n=u*(S(t)-s),r=e*e+n*n;r<=d&&(f=t,d=r)}if(null!=f&&(1!==t||1!==n)){const t=L(f)-i,e=S(f)-s;d=t*t+e*e}C(f,d)}return u.addEventListener("pointerenter",T),u.addEventListener("pointermove",T),u.addEventListener("pointerdown",(function(t){"mouse"===t.pointerType&&null!=z&&(h.sticky&&h.roots.some((e=>e?.contains(t.target)))||(h.sticky?(h.sticky=!1,h.renders.forEach((t=>t(null)))):(h.sticky=!0,N(z)),t.stopImmediatePropagation()))})),u.addEventListener("pointerleave",(function(t){"mouse"===t.pointerType&&(h.sticky||C(null))})),N(null)}),c)}}function ai(t){return ii(1,1,t)}function li(t){return ii(1,.01,t)}function si(t){return ii(.01,1,t)}function ci({x1:t,x2:e,x:n=t},r){return t&&e?n=>(t[n]+e[n])/2:n?t=>n[t]:()=>r}function ui({y1:t,y2:e,y:n=t},r){return t&&e?n=>(t[n]+e[n])/2:n?t=>n[t]:()=>r}function fi(t){return Br(t)&&void 0===t.interval?void 0:"tabular-nums"}const hi=Math.PI/180;function di(t,{marker:e,markerStart:n=e,markerMid:r=e,markerEnd:o=e}={}){t.markerStart=pi(n),t.markerMid=pi(r),t.markerEnd=pi(o)}function pi(t){if(null==t||!1===t)return null;if(!0===t)return gi;if("function"==typeof t)return t;switch(`${t}`.toLowerCase()){case"none":return null;case"arrow":return mi("auto");case"arrow-reverse":return mi("auto-start-reverse");case"dot":return yi;case"circle":case"circle-fill":return gi;case"circle-stroke":return vi;case"tick":return xi("auto");case"tick-x":return xi(90);case"tick-y":return xi(0)}throw new Error(`invalid marker: ${t}`)}function mi(t){return(e,n)=>mo("svg:marker",n).attr("viewBox","-5 -5 10 10").attr("markerWidth",6.67).attr("markerHeight",6.67).attr("orient",t).attr("fill","none").attr("stroke",e).attr("stroke-width",1.5).attr("stroke-linecap","round").attr("stroke-linejoin","round").call((t=>t.append("path").attr("d","M-1.5,-3l3,3l-3,3"))).node()}function yi(t,e){return mo("svg:marker",e).attr("viewBox","-5 -5 10 10").attr("markerWidth",6.67).attr("markerHeight",6.67).attr("fill",t).attr("stroke","none").call((t=>t.append("circle").attr("r",2.5))).node()}function gi(t,e){return mo("svg:marker",e).attr("viewBox","-5 -5 10 10").attr("markerWidth",6.67).attr("markerHeight",6.67).attr("fill",t).attr("stroke","var(--plot-background)").attr("stroke-width",1.5).call((t=>t.append("circle").attr("r",3))).node()}function vi(t,e){return mo("svg:marker",e).attr("viewBox","-5 -5 10 10").attr("markerWidth",6.67).attr("markerHeight",6.67).attr("fill","var(--plot-background)").attr("stroke",t).attr("stroke-width",1.5).call((t=>t.append("circle").attr("r",3))).node()}function xi(t){return(e,n)=>mo("svg:marker",n).attr("viewBox","-3 -3 6 6").attr("markerWidth",6).attr("markerHeight",6).attr("orient",t).attr("stroke",e).call((t=>t.append("path").attr("d","M0,-3v6"))).node()}let wi=0;function bi(t,e,{stroke:n},r){return Ai(t,e,n&&(t=>n[t]),null,r)}function ki(t,e,{stroke:n,z:r},o){return Ai(t,e,n&&(([t])=>n[t]),r,o)}const $i=1,Mi=2;function Ai(t,{markerStart:e,markerMid:n,markerEnd:r,stroke:o},i=()=>o,a,l){if(!e&&!n&&!r)return;const s=new Map,c=a&&function(t,e){const n=new Uint8Array(e.length),r=t.data().filter((t=>t.length>1)),o=r.length;for(let t=0,i=yo;t<o;++t){const o=r[t];if(o.length>1){const t=o[0];i!==(i=Bt(e[t]))&&(n[t]|=$i)}}for(let t=o-1,i=yo;t>=0;--t){const o=r[t];if(o.length>1){const t=o[0];i!==(i=Bt(e[t]))&&(n[t]|=Mi)}}return([t])=>n[t]}(t,a);function u(t,e,n){return function(r){if(n&&!n(r))return;const o=i(r);let a=s.get(e);a||s.set(e,a=new Map);let c=a.get(o);if(!c){const t=this.parentNode.insertBefore(e(o,l),this),n="plot-marker-"+ ++wi;t.setAttribute("id",n),a.set(o,c=`url(#${n})`)}this.setAttribute(t,c)}}e&&t.each(u("marker-start",e,c&&(t=>c(t)&$i))),n&&c&&t.each(u("marker-start",n,(t=>!(c(t)&$i)))),n&&t.each(u("marker-mid",n)),r&&t.each(u("marker-end",r,c&&(t=>c(t)&Mi)))}function Li({inset:t,insetLeft:e,insetRight:n,...r}={}){return[e,n]=zi(t,e,n),{inset:t,insetLeft:e,insetRight:n,...r}}function Si({inset:t,insetTop:e,insetBottom:n,...r}={}){return[e,n]=zi(t,e,n),{inset:t,insetTop:e,insetBottom:n,...r}}function zi(t,e,n){return void 0===t&&void 0===e&&void 0===n?Lo?[1,0]:[.5,.5]:[e,n]}function Oi(t,{interval:e}){return(t={...Ut(t)}).interval=Yt(void 0===t.interval?e:t.interval),t}function Ei(t,e,n,r){const{[t]:o,[`${t}1`]:i,[`${t}2`]:a}=n,{value:l,interval:s}=Oi(o,n);if(null==l||null==s&&!r)return n;const c=jt(o);if(null==s){let e;const o={transform:t=>e||(e=_(t,l)),label:c};return{...n,[t]:void 0,[`${t}1`]:void 0===i?o:i,[`${t}2`]:void 0!==a||i===a&&r?a:o}}let u,f;function h(t){return void 0!==f&&t===u?f:f=vt(_(u=t,l),(t=>s.floor(t)))}return e({...n,[t]:void 0,[`${t}1`]:void 0===i?{transform:h,label:c}:i,[`${t}2`]:void 0===a?{transform:t=>h(t).map((t=>s.offset(t))),label:c}:a})}function Ri(t,e,n){const{[t]:r}=n,{value:o,interval:i}=Oi(r,n);return null==o||null==i?n:e({...n,[t]:{label:jt(r),transform:t=>{const e=vt(_(t,o),(t=>i.floor(t))),n=e.map((t=>i.offset(t)));return e.map(Qt(e)?(t,e)=>null==t||isNaN(t=+t)||null==(e=n[e])||isNaN(e=+e)?void 0:new Date((t+e)/2):(t,e)=>null==t||null==(e=n[e])?NaN:(+t+ +e)/2)}}})}function Ci(t={}){return Ei("x",Li,t,!0)}function Ni(t={}){return Ei("y",Si,t,!0)}function Ti(t={}){return Ei("x",Li,t)}function Bi(t={}){return Ei("y",Si,t)}function Ii(t={}){return Ri("x",Li,t)}function Pi(t={}){return Ri("y",Si,t)}const Wi={ariaLabel:"rule",fill:null,stroke:"currentColor"};class ji extends Qo{constructor(t,e={}){const{x:n,y1:r,y2:o,inset:i=0,insetTop:a=i,insetBottom:l=i}=e;super(t,{x:{value:n,scale:"x",optional:!0},y1:{value:r,scale:"y",optional:!0},y2:{value:o,scale:"y",optional:!0}},ei(e,"x"),Wi),this.insetTop=et(a),this.insetBottom=et(l),di(this,e)}render(t,e,n,r,o){const{x:i,y:a}=e,{x:l,y1:s,y2:c}=n,{width:u,height:f,marginTop:h,marginRight:d,marginLeft:p,marginBottom:m}=r,{insetTop:y,insetBottom:g}=this;return mo("svg:g",o).call(Fo,this,r,o).call(_o,this,{x:l&&i},Lo,0).call((e=>e.selectAll().data(t).enter().append("line").call(qo,this).attr("x1",l?t=>l[t]:(p+u-d)/2).attr("x2",l?t=>l[t]:(p+u-d)/2).attr("y1",s&&!Pr(a)?t=>s[t]+y:h+y).attr("y2",c&&!Pr(a)?a.bandwidth?t=>c[t]+a.bandwidth()-g:t=>c[t]-g:f-m-g).call(No,this,n).call(bi,this,n,o))).node()}}class Fi extends Qo{constructor(t,e={}){const{x1:n,x2:r,y:o,inset:i=0,insetRight:a=i,insetLeft:l=i}=e;super(t,{y:{value:o,scale:"y",optional:!0},x1:{value:n,scale:"x",optional:!0},x2:{value:r,scale:"x",optional:!0}},ei(e,"y"),Wi),this.insetRight=et(a),this.insetLeft=et(l),di(this,e)}render(t,e,n,r,o){const{x:i,y:a}=e,{y:l,x1:s,x2:c}=n,{width:u,height:f,marginTop:h,marginRight:d,marginLeft:p,marginBottom:m}=r,{insetLeft:y,insetRight:g}=this;return mo("svg:g",o).call(Fo,this,r,o).call(_o,this,{y:l&&a},0,Lo).call((e=>e.selectAll().data(t).enter().append("line").call(qo,this).attr("x1",s&&!Pr(i)?t=>s[t]+y:p+y).attr("x2",c&&!Pr(i)?i.bandwidth?t=>c[t]+i.bandwidth()-g:t=>c[t]-g:u-d-g).attr("y1",l?t=>l[t]:(h+f-m)/2).attr("y2",l?t=>l[t]:(h+f-m)/2).call(No,this,n).call(bi,this,n,o))).node()}}function qi(t,e){let{x:n=Q,y:r,y1:o,y2:i,...a}=Bi(e);return[o,i]=Yi(r,o,i),new ji(t,{...a,x:n,y1:o,y2:i})}function Di(t,e){let{y:n=Q,x:r,x1:o,x2:i,...a}=Ti(e);return[o,i]=Yi(r,o,i),new Fi(t,{...a,y:n,x1:o,x2:i})}function Yi(t,e,n){if(null==t){if(void 0===e){if(void 0!==n)return[0,n]}else if(void 0===n)return[0,e]}else{if(void 0===e)return void 0===n?[0,t]:[t,n];if(void 0===n)return[t,e]}return[e,n]}function _i(t,...e){let n=e.length;for(let r=0,o=!0;r<n;++r)"function"!=typeof e[r]&&(o&&(t=t.slice(),o=!1),t.splice(r,2,t[r]+e[r]+t[r+1]),e.splice(r,1),--r,--n);return r=>{let o=t[0];for(let i=0;i<n;++i)o+=e[i](r)+t[i+1];return o}}const Gi={ariaLabel:"text",strokeLinejoin:"round",strokeWidth:3,paintOrder:"stroke"},Xi="";class Ui extends Qo{constructor(t,e={}){const{x:n,y:r,text:o=(Ht(t)&&Vt(t)?Q:Z),frameAnchor:a,textAnchor:l=(/right$/i.test(a)?"end":/left$/i.test(a)?"start":"middle"),lineAnchor:s=(/^top/i.test(a)?"top":/^bottom/i.test(a)?"bottom":"middle"),lineHeight:c=1,lineWidth:u=1/0,textOverflow:f,monospace:h,fontFamily:d=(h?"ui-monospace, monospace":void 0),fontSize:p,fontStyle:m,fontVariant:y,fontWeight:g,rotate:v}=e,[x,w]=dt(v,0),[b,k]=function(t){return null==t||"number"==typeof t?[void 0,t]:"string"!=typeof t?[t,void 0]:(t=t.trim().toLowerCase(),ta.has(t)||/^[+-]?\d*\.?\d+(e[+-]?\d+)?(\w*|%)$/.test(t)?[void 0,t]:[t,void 0])}(p);var $;if(super(t,{x:{value:n,scale:"x",optional:!0},y:{value:r,scale:"y",optional:!0},fontSize:{value:b,optional:!0},rotate:{value:($=x,null==$?null:{transform:t=>_(t,$,Float64Array),label:jt($)}),optional:!0},text:{value:o,filter:i,optional:!0}},e,Gi),this.rotate=w,this.textAnchor=Go(l,"middle"),this.lineAnchor=mt(s,"lineAnchor",["top","middle","bottom"]),this.lineHeight=+c,this.lineWidth=+u,this.textOverflow=Hi(f),this.monospace=!!h,this.fontFamily=tt(d),this.fontSize=k,this.fontStyle=tt(m),this.fontVariant=tt(y),this.fontWeight=tt(g),this.frameAnchor=se(a),!(this.lineWidth>=0))throw new Error(`invalid lineWidth: ${u}`);this.splitLines=ia(this),this.clipLine=aa(this)}render(t,e,n,r,o){const{x:i,y:a}=e,{x:l,y:s,rotate:c,text:u,title:f,fontSize:h}=n,{rotate:d}=this,[p,m]=Zo(this,r);return mo("svg:g",o).call(Fo,this,r,o).call(Ki,this,u,r).call(_o,this,{x:l&&i,y:s&&a}).call((e=>e.selectAll().data(t).enter().append("text").call(qo,this).call(Vi,this,u,f).attr("transform",_i`translate(${l?t=>l[t]:p},${s?t=>s[t]:m})${c?t=>` rotate(${c[t]})`:d?` rotate(${d})`:""}`).call(Yo,"font-size",h&&(t=>h[t])).call(No,this,n))).node()}}function Hi(t){return null==t?null:mt(t,"textOverflow",["clip","ellipsis","clip-start","clip-end","ellipsis-start","ellipsis-middle","ellipsis-end"]).replace(/^(clip|ellipsis)$/,"$1-end")}function Vi(t,n,r,o){if(!r)return;const{lineAnchor:i,lineHeight:a,textOverflow:l,splitLines:s,clipLine:c}=n;t.each((function(t){const n=s(Ao(r[t])??"").map(c),u=n.length,f="top"===i?.71:"bottom"===i?1-u:(164-100*u)/200;if(u>1){let t=0;for(let r=0;r<u;++r){if(++t,!n[r])continue;const o=this.ownerDocument.createElementNS(e.namespaces.svg,"tspan");o.setAttribute("x",0),r===t-1?o.setAttribute("y",(f+r)*a+"em"):o.setAttribute("dy",t*a+"em"),o.textContent=n[r],this.appendChild(o),t=0}}else f&&this.setAttribute("y",f*a+"em"),this.textContent=n[0];if(l&&!o&&n[0]!==r[t]){const n=this.ownerDocument.createElementNS(e.namespaces.svg,"title");n.textContent=r[t],this.appendChild(n)}}))}function Zi(t,{x:e,y:n,...r}={}){return void 0===r.frameAnchor&&([e,n]=zt(e,n)),new Ui(t,{...r,x:e,y:n})}function Qi(t,{x:e=Q,...n}={}){return new Ui(t,Pi({...n,x:e}))}function Ji(t,{y:e=Q,...n}={}){return new Ui(t,Ii({...n,y:e}))}function Ki(t,e,n){Yo(t,"text-anchor",e.textAnchor),Yo(t,"font-family",e.fontFamily),Yo(t,"font-size",e.fontSize),Yo(t,"font-style",e.fontStyle),Yo(t,"font-variant",void 0===e.fontVariant?function(t){return t&&(te(t)||Qt(t))?"tabular-nums":void 0}(n):e.fontVariant),Yo(t,"font-weight",e.fontWeight)}const ta=new Set(["inherit","initial","revert","unset","xx-small","x-small","small","medium","large","x-large","xx-large","xxx-large","larger","smaller"]);function ea(t,e,n){const r=[];let o,i=0;for(const[a,l,s]of function*(t){let e=0,n=0;const r=t.length;for(;n<r;){let r=1;switch(t[n]){case Xi:case"-":++n,yield[e,n,!1],e=n;break;case" ":for(yield[e,n,!1];" "===t[++n];);e=n;break;case"\r":"\n"===t[n+1]&&++r;case"\n":yield[e,n,!0],n+=r,e=n;break;default:++n}}yield[e,n,!0]}(t))void 0===o&&(o=a),i>o&&n(t,o,l)>e&&(r.push(t.slice(o,i)+(t[i-1]===Xi?"-":"")),o=a),s?(r.push(t.slice(o,l)),o=void 0):i=l;return r}const na={a:56,b:63,c:57,d:63,e:58,f:37,g:62,h:60,i:26,j:26,k:55,l:26,m:88,n:60,o:60,p:62,q:62,r:39,s:54,t:38,u:60,v:55,w:79,x:54,y:55,z:55,A:69,B:67,C:73,D:74,E:61,F:58,G:76,H:75,I:28,J:55,K:67,L:58,M:89,N:75,O:78,P:65,Q:78,R:67,S:65,T:65,U:75,V:69,W:98,X:69,Y:67,Z:67,0:64,1:48,2:62,3:64,4:66,5:63,6:65,7:58,8:65,9:65," ":29,"!":32,'"':49,"'":31,"(":39,")":39,",":31,"-":48,".":31,"/":32,":":31,";":31,"?":52,"‘":31,"’":31,"“":47,"”":47,"…":82};function ra(t,e=0,n=t.length){let r=0;for(let o=e;o<n;o=da(t,o))r+=na[t[o]]??(ma(t,o)?120:na.e);return r}function oa(t,e=0,n=t.length){let r=0;for(let o=e;o<n;o=da(t,o))r+=ma(t,o)?126:63;return r}function ia({monospace:t,lineWidth:e,textOverflow:n}){if(null!=n||e==1/0)return t=>t.split(/\r\n?|\n/g);const r=t?oa:ra,o=100*e;return t=>ea(t,o,r)}function aa({monospace:t,lineWidth:e,textOverflow:n}){if(null==n||e==1/0)return t=>t;const r=t?oa:ra,o=100*e;switch(n){case"clip-start":return t=>ua(t,o,r,"");case"clip-end":return t=>ca(t,o,r,"");case"ellipsis-start":return t=>ua(t,o,r,la);case"ellipsis-middle":return t=>function(t,e,n,r){t=t.trim();const o=n(t);if(o<=e)return t;const i=n(r)/2,[a,l]=sa(t,e/2,n,i),[s]=sa(t,o-e/2-l+i,n,-i);return s<0?r:t.slice(0,a).trimEnd()+r+t.slice(da(t,s)).trimStart()}(t,o,r,la);case"ellipsis-end":return t=>ca(t,o,r,la)}}const la="…";function sa(t,e,n,r){const o=[];let i=0;for(let a=0,l=0,s=t.length;a<s;a=l){l=da(t,a);const s=n(t,a,l);if(i+s>e){for(i+=r;i>e&&a>0;)l=a,a=o.pop(),i-=n(t,a,l);return[a,e-i]}i+=s,o.push(a)}return[-1,0]}function ca(t,e,n,r){t=t.trim();const o=n(r),[i]=sa(t,e,n,o);return i<0?t:t.slice(0,i).trimEnd()+r}function ua(t,e,n,r){const o=n(t=t.trim());if(o<=e)return t;const i=n(r),[a]=sa(t,o-e+i,n,-i);return a<0?r:r+t.slice(da(t,a)).trimStart()}const fa=/[\p{Combining_Mark}\p{Emoji_Modifier}]+/uy,ha=/\p{Extended_Pictographic}/uy;function da(t,e){return e+=function(t,e){const n=t.charCodeAt(e);if(n>=55296&&n<56320){const n=t.charCodeAt(e+1);return n>=56320&&n<57344}return!1}(t,e)?2:1,function(t,e){return!pa(t,e)&&(fa.lastIndex=e,fa.test(t))}(t,e)&&(e=fa.lastIndex),function(t,e){return 8205===t.charCodeAt(e)}(t,e)?da(t,e+1):e}function pa(t,e){return t.charCodeAt(e)<128}function ma(t,e){return!pa(t,e)&&(ha.lastIndex=e,ha.test(t))}const ya={ariaLabel:"vector",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinejoin:"round",strokeLinecap:"round"},ga=3.5,va=5*ga,xa={draw(t,e,n){const r=e*n/va;t.moveTo(0,0),t.lineTo(0,-e),t.moveTo(-r,r-e),t.lineTo(0,-e),t.lineTo(r,r-e)}},wa={draw(t,e,n){t.moveTo(-n,0),t.lineTo(0,-e),t.lineTo(n,0)}},ba=new Map([["arrow",xa],["spike",wa]]);class ka extends Qo{constructor(t,e={}){const{x:n,y:r,r:o=ga,length:i,rotate:a,shape:l=xa,anchor:s="middle",frameAnchor:c}=e,[u,f]=dt(i,12),[h,d]=dt(a,0);super(t,{x:{value:n,scale:"x",optional:!0},y:{value:r,scale:"y",optional:!0},length:{value:u,scale:"length",optional:!0},rotate:{value:h,optional:!0}},e,ya),this.r=+o,this.length=f,this.rotate=d,this.shape=function(t){if(function(t){return t&&"function"==typeof t.draw}(t))return t;const e=ba.get(`${t}`.toLowerCase());if(e)return e;throw new Error(`invalid shape: ${t}`)}(l),this.anchor=mt(s,"anchor",["start","middle","end"]),this.frameAnchor=se(c)}render(t,n,r,o,i){const{x:a,y:l}=n,{x:s,y:c,length:u,rotate:f}=r,{length:h,rotate:d,anchor:p,shape:m,r:y}=this,[g,v]=Zo(this,o);return mo("svg:g",i).call(Fo,this,o,i).call(_o,this,{x:s&&a,y:c&&l}).call((n=>n.selectAll().data(t).enter().append("path").call(qo,this).attr("transform",_i`translate(${s?t=>s[t]:g},${c?t=>c[t]:v})${f?t=>` rotate(${f[t]})`:d?` rotate(${d})`:""}${"start"===p?"":"end"===p?u?t=>` translate(0,${u[t]})`:` translate(0,${h})`:u?t=>` translate(0,${u[t]/2})`:` translate(0,${h/2})`}`).attr("d",u?t=>{const n=e.pathRound();return m.draw(n,u[t],y),n}:(()=>{const t=e.pathRound();return m.draw(t,h,y),t})()).call(No,this,r))).node()}}function $a(t,e={}){let{x:n,y:r,...o}=e;return void 0===e.frameAnchor&&([n,r]=zt(n,r)),new ka(t,{...o,x:n,y:r})}function Ma(t,e={}){const{x:n=Q,...r}=e;return new ka(t,{...r,x:n})}function Aa(t,e={}){const{y:n=Q,...r}=e;return new ka(t,{...r,y:n})}function La(t,e){return arguments.length<2&&!Ht(t)&&(e=t,t=null),void 0===e&&(e={}),[t,e]}function Sa({anchor:t}={},e){return void 0===t?e[0]:mt(t,"anchor",e)}function za(t){return Sa(t,["left","right"])}function Oa(t){return Sa(t,["right","left"])}function Ea(t){return Sa(t,["bottom","top"])}function Ra(t){return Sa(t,["top","bottom"])}function Ca(){const[t,e]=La(...arguments);return Ia("y",za(e),t,e)}function Na(){const[t,e]=La(...arguments);return Ia("fy",Oa(e),t,e)}function Ta(){const[t,e]=La(...arguments);return Pa("x",Ea(e),t,e)}function Ba(){const[t,e]=La(...arguments);return Pa("fx",Ra(e),t,e)}function Ia(t,e,n,{color:r="currentColor",opacity:o=1,stroke:i=r,strokeOpacity:a=o,strokeWidth:l=1,fill:s=r,fillOpacity:c=o,textAnchor:u,textStroke:f,textStrokeOpacity:h,textStrokeWidth:d,tickSize:p=("y"===t?6:0),tickPadding:m,tickRotate:y,x:g,margin:v,marginTop:x=(void 0===v?20:v),marginRight:w=(void 0===v?"right"===e?40:0:v),marginBottom:b=(void 0===v?20:v),marginLeft:k=(void 0===v?"left"===e?40:0:v),label:$,labelAnchor:M,labelArrow:A,labelOffset:L,...S}){return p=et(p),m=et(m),y=et(y),void 0!==M&&(M=mt(M,"labelAnchor",["center","top","bottom"])),A=nl(A),Jo(p&&!ie(i)?function(t,e,n,{strokeWidth:r=1,strokeLinecap:o=null,strokeLinejoin:i=null,facetAnchor:a=e+("y"===t?"-empty":""),frameAnchor:l=e,tickSize:s,inset:c=0,insetLeft:u=c,insetRight:f=c,dx:h=0,y:d=("y"===t?void 0:null),...p}){return Xa(Aa,t,n,{ariaLabel:`${t}-axis tick`,ariaHidden:!0},{strokeWidth:r,strokeLinecap:o,strokeLinejoin:i,facetAnchor:a,frameAnchor:l,y:d,...p,dx:"left"===e?+h-Lo+ +u:+h+Lo-f,anchor:"start",length:s,shape:"left"===e?Ja:Ka})}(t,e,n,{stroke:i,strokeOpacity:a,strokeWidth:l,tickSize:p,tickPadding:m,tickRotate:y,x:g,...S}):null,ie(s)?null:function(t,e,n,{facetAnchor:r=e+("y"===t?"-empty":""),frameAnchor:o=e,tickSize:i,tickRotate:a=0,tickPadding:l=Math.max(3,9-i)+(Math.abs(a)>60?4*Math.cos(a*hi):0),text:s,textAnchor:c=(Math.abs(a)>60?"middle":"left"===e?"end":"start"),lineAnchor:u=(a>60?"top":a<-60?"bottom":"middle"),fontVariant:f,inset:h=0,insetLeft:d=h,insetRight:p=h,dx:m=0,y:y=("y"===t?void 0:null),...g}){return Xa(Ji,t,n,{ariaLabel:`${t}-axis tick label`},{facetAnchor:r,frameAnchor:o,text:s,textAnchor:c,lineAnchor:u,fontVariant:f,rotate:a,y:y,...g,dx:"left"===e?+m-i-l+ +d:+m+ +i+ +l-p},(function(t,n,r,o,i){void 0===f&&(this.fontVariant=tl(t)),void 0===s&&(i.text=Ua(t,n,r,o,e))}))}(t,e,n,{fill:s,fillOpacity:c,stroke:f,strokeOpacity:h,strokeWidth:d,textAnchor:u,tickSize:p,tickPadding:m,tickRotate:y,x:g,marginTop:x,marginRight:w,marginBottom:b,marginLeft:k,...S}),ie(s)||null===$?null:Zi([],Ga({fill:s,fillOpacity:c,...S},(function(n,r,o,i,a){const l=i[t],{marginTop:s,marginRight:c,marginBottom:u,marginLeft:f}="y"===t&&a.inset||a,h=M??(l.bandwidth?"center":"top"),d=L??("right"===e?c:f)-3;return"center"===h?(this.textAnchor=void 0,this.lineAnchor="right"===e?"bottom":"top",this.frameAnchor=e,this.rotate=-90):(this.textAnchor="right"===e?"end":"start",this.lineAnchor=h,this.frameAnchor=`${h}-${e}`,this.rotate=0),this.dy="top"===h?3-s:"bottom"===h?u-3:0,this.dx="right"===e?d:-d,this.ariaLabel=`${t}-axis label`,{facets:[[0]],channels:{text:{value:[el(t,l,{anchor:e,label:$,labelAnchor:h,labelArrow:A})]}}}}))))}function Pa(t,e,n,{color:r="currentColor",opacity:o=1,stroke:i=r,strokeOpacity:a=o,strokeWidth:l=1,fill:s=r,fillOpacity:c=o,textAnchor:u,textStroke:f,textStrokeOpacity:h,textStrokeWidth:d,tickSize:p=("x"===t?6:0),tickPadding:m,tickRotate:y,y:g,margin:v,marginTop:x=(void 0===v?"top"===e?30:0:v),marginRight:w=(void 0===v?20:v),marginBottom:b=(void 0===v?"bottom"===e?30:0:v),marginLeft:k=(void 0===v?20:v),label:$,labelAnchor:M,labelArrow:A,labelOffset:L,...S}){return p=et(p),m=et(m),y=et(y),void 0!==M&&(M=mt(M,"labelAnchor",["center","left","right"])),A=nl(A),Jo(p&&!ie(i)?function(t,e,n,{strokeWidth:r=1,strokeLinecap:o=null,strokeLinejoin:i=null,facetAnchor:a=e+("x"===t?"-empty":""),frameAnchor:l=e,tickSize:s,inset:c=0,insetTop:u=c,insetBottom:f=c,dy:h=0,x:d=("x"===t?void 0:null),...p}){return Xa(Ma,t,n,{ariaLabel:`${t}-axis tick`,ariaHidden:!0},{strokeWidth:r,strokeLinejoin:i,strokeLinecap:o,facetAnchor:a,frameAnchor:l,x:d,...p,dy:"bottom"===e?+h-Lo-f:+h+Lo+ +u,anchor:"start",length:s,shape:"bottom"===e?Za:Qa})}(t,e,n,{stroke:i,strokeOpacity:a,strokeWidth:l,tickSize:p,tickPadding:m,tickRotate:y,y:g,...S}):null,ie(s)?null:function(t,e,n,{facetAnchor:r=e+("x"===t?"-empty":""),frameAnchor:o=e,tickSize:i,tickRotate:a=0,tickPadding:l=Math.max(3,9-i)+(Math.abs(a)>=10?4*Math.cos(a*hi):0),text:s,textAnchor:c=(Math.abs(a)>=10?a<0^"bottom"===e?"start":"end":"middle"),lineAnchor:u=(Math.abs(a)>=10?"middle":"bottom"===e?"top":"bottom"),fontVariant:f,inset:h=0,insetTop:d=h,insetBottom:p=h,dy:m=0,x:y=("x"===t?void 0:null),...g}){return Xa(Qi,t,n,{ariaLabel:`${t}-axis tick label`},{facetAnchor:r,frameAnchor:o,text:void 0===s?null:s,textAnchor:c,lineAnchor:u,fontVariant:f,rotate:a,x:y,...g,dy:"bottom"===e?+m+ +i+ +l-p:+m-i-l+ +d},(function(t,n,r,o,i){void 0===f&&(this.fontVariant=tl(t)),void 0===s&&(i.text=Ua(t,n,r,o,e))}))}(t,e,n,{fill:s,fillOpacity:c,stroke:f,strokeOpacity:h,strokeWidth:d,textAnchor:u,tickSize:p,tickPadding:m,tickRotate:y,y:g,marginTop:x,marginRight:w,marginBottom:b,marginLeft:k,...S}),ie(s)||null===$?null:Zi([],Ga({fill:s,fillOpacity:c,...S},(function(n,r,o,i,a){const l=i[t],{marginTop:s,marginRight:c,marginBottom:u,marginLeft:f}="x"===t&&a.inset||a,h=M??(l.bandwidth?"center":"right"),d=L??("top"===e?s:u)-3;return"center"===h?(this.frameAnchor=e,this.textAnchor=void 0):(this.frameAnchor=`${e}-${h}`,this.textAnchor="right"===h?"end":"start"),this.lineAnchor=e,this.dy="top"===e?-d:d,this.dx="right"===h?c-3:"left"===h?3-f:0,this.ariaLabel=`${t}-axis label`,{facets:[[0]],channels:{text:{value:[el(t,l,{anchor:e,label:$,labelAnchor:h,labelArrow:A})]}}}}))))}function Wa(){const[t,e]=La(...arguments);return Da("y",za(e),t,e)}function ja(){const[t,e]=La(...arguments);return Da("fy",Oa(e),t,e)}function Fa(){const[t,e]=La(...arguments);return Ya("x",Ea(e),t,e)}function qa(){const[t,e]=La(...arguments);return Ya("fx",Ra(e),t,e)}function Da(t,e,n,{y:r=("y"===t?void 0:null),x:o=null,x1:i=("left"===e?o:null),x2:a=("right"===e?o:null),...l}){return Xa(Di,t,n,{ariaLabel:`${t}-grid`,ariaHidden:!0},{y:r,x1:i,x2:a,..._a(l)})}function Ya(t,e,n,{x:r=("x"===t?void 0:null),y:o=null,y1:i=("top"===e?o:null),y2:a=("bottom"===e?o:null),...l}){return Xa(qi,t,n,{ariaLabel:`${t}-grid`,ariaHidden:!0},{x:r,y1:i,y2:a,..._a(l)})}function _a({color:t="currentColor",opacity:e=.1,stroke:n=t,strokeOpacity:r=e,strokeWidth:o=1,...i}){return{stroke:n,strokeOpacity:r,strokeWidth:o,...i}}function Ga({fill:t,fillOpacity:e,fontFamily:n,fontSize:r,fontStyle:o,fontVariant:i,fontWeight:a,monospace:l,pointerEvents:s,shapeRendering:c,clip:u=!1},f){return[,t]=ht(t),[,e]=dt(e),{facet:"super",x:null,y:null,fill:t,fillOpacity:e,fontFamily:n,fontSize:r,fontStyle:o,fontVariant:i,fontWeight:a,monospace:l,pointerEvents:s,shapeRendering:c,clip:u,initializer:f}}function Xa(t,n,r,o,i,a){let l;const s=Oe(i).initializer,c=t(r,Oe({...i,initializer:function(t,r,o,s,c,u){const f=null==t&&("fx"===n||"fy"===n),{[n]:h}=s;if(!h)throw new Error(`missing scale: ${n}`);const d=h.domain();let{interval:p,ticks:m,tickFormat:y,tickSpacing:g=("x"===n?80:35)}=i;if("string"==typeof m&&rl(h)&&(p=m,m=void 0),void 0===m&&(m=Gt(p,h.type)??function(t,n){const[r,o]=e.extent(t.range());return(o-r)/n}(h,g)),null==t){if(Ht(m))t=gt(m);else if(Xt(m))t=Va(m,...e.extent(d));else if(h.interval){let n=h.interval;if(h.ticks){const[r,o]=e.extent(d);n=T(n,(o-r)/n[A]/m)??n,t=Va(n,r,o)}else{n=T(n,(t=d).length/m)??n,n!==h.interval&&(t=Va(n,...e.extent(t)))}if(n===h.interval){const e=Math.round(t.length/m);e>1&&(t=t.filter(((t,n)=>n%e==0)))}}else t=h.ticks?h.ticks(m):d;if(!h.ticks&&t.length&&t!==d){const r=new e.InternSet(d);(t=t.filter((t=>r.has(t)))).length||ir(`Warning: the ${n}-axis ticks appear to not align with the scale domain, resulting in no ticks. Try different ticks?`)}"y"===n||"x"===n?r=[Rt(t)]:l[n]={scale:n,value:Q}}a?.call(this,h,t,m,y,l);const v=Object.fromEntries(Object.entries(l).map((([e,n])=>[e,{...n,value:_(t,n.value)}])));return f&&(r=u.filterFacets(t,v)),{data:t,facets:r,channels:v}}},s));return null==r?(l=c.channels,c.channels={}):l={},void 0!==o&&Object.assign(c,o),void 0===c.clip&&(c.clip=!1),c}function Ua(t,e,n,r,o){return{value:Ha(t,e,n,r,o)}}function Ha(t,n,r,o,i){return"function"!=typeof o||"log"===t.type&&t.tickFormat?void 0===o&&n&&Qt(n)?I(t.type,n,i)??Ao:t.tickFormat?t.tickFormat("number"==typeof r?r:null,o):void 0===o?Ao:"string"==typeof o?(Qt(t.domain())?e.utcFormat:e.format)(o):at(o):o}function Va(t,e,n){return t.range(e,t.offset(t.floor(n)))}const Za={draw(t,e){t.moveTo(0,0),t.lineTo(0,e)}},Qa={draw(t,e){t.moveTo(0,0),t.lineTo(0,-e)}},Ja={draw(t,e){t.moveTo(0,0),t.lineTo(-e,0)}},Ka={draw(t,e){t.moveTo(0,0),t.lineTo(e,0)}};function tl(t){return t.bandwidth&&!t.interval?void 0:"tabular-nums"}function el(t,e,{anchor:n,label:r=e.label,labelAnchor:o,labelArrow:i}={}){if(!(null==r||r.inferred&&rl(e)&&/^(date|time|year)$/i.test(r))){if(r=String(r),"auto"===i&&(i=(!e.bandwidth||e.interval)&&!/[↑↓→←]/.test(r)),!i)return r;if(!0===i){const n=kr(e);n&&(i=/x$/.test(t)||"center"===o?/x$/.test(t)===n<0?"left":"right":n<0?"up":"down")}switch(i){case"left":return`← ${r}`;case"right":return`${r} →`;case"up":return"right"===n?`${r} ↑`:`↑ ${r}`;case"down":return"right"===n?`${r} ↓`:`↓ ${r}`}return r}}function nl(t="auto"){return!ie(t)&&("boolean"==typeof t?t:mt(t,"labelArrow",["auto","up","right","down","left"]))}function rl(t){return Qt(t.domain())}function ol(t,e){if(null==e)return e;const n=t(e);if(!n)throw new Error(`scale not found: ${e}`);return n}function il(t,e={},n){let{columns:r,tickFormat:o,fontVariant:i=fi(t),swatchSize:a=15,swatchWidth:l=a,swatchHeight:s=a,marginLeft:c=0,className:u,style:f,width:h}=e;const d=po(e);u=Ho(u),o=Ha(t.scale,t.domain,void 0,o);const p=mo("div",d).attr("class",`${u}-swatches ${u}-swatches-${null!=r?"columns":"wrap"}`);let m;return null!=r?(m=`:where(.${u}-swatches-columns .${u}-swatch) {\n display: flex;\n align-items: center;\n break-inside: avoid;\n padding-bottom: 1px;\n}\n:where(.${u}-swatches-columns .${u}-swatch::before) {\n flex-shrink: 0;\n}\n:where(.${u}-swatches-columns .${u}-swatch-label) {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}`,p.style("columns",r).selectAll().data(t.domain).enter().append("div").attr("class",`${u}-swatch`).call(n,t,l,s).call((t=>t.append("div").attr("class",`${u}-swatch-label`).attr("title",o).text(o)))):(m=`:where(.${u}-swatches-wrap) {\n display: flex;\n align-items: center;\n min-height: 33px;\n flex-wrap: wrap;\n}\n:where(.${u}-swatches-wrap .${u}-swatch) {\n display: inline-flex;\n align-items: center;\n margin-right: 1em;\n}`,p.selectAll().data(t.domain).enter().append("span").attr("class",`${u}-swatch`).call(n,t,l,s).append((function(){return this.ownerDocument.createTextNode(o.apply(this,arguments))}))),p.call((t=>t.insert("style","*").text(`:where(.${u}-swatches) {\n font-family: system-ui, sans-serif;\n font-size: 10px;\n margin-bottom: 0.5em;\n}\n:where(.${u}-swatch > svg) {\n margin-right: 0.5em;\n overflow: visible;\n}\n${m}`))).style("margin-left",c?+c+"px":null).style("width",void 0===h?null:+h+"px").style("font-variant",Go(i,"normal")).call(Vo,f).node()}const al=new Map([["symbol",function(t,{fill:n=(void 0!==t.hint?.fill?t.hint.fill:"none"),fillOpacity:r=1,stroke:o=(void 0!==t.hint?.stroke?t.hint.stroke:ie(n)?"currentColor":"none"),strokeOpacity:i=1,strokeWidth:a=1.5,r:l=4.5,...s}={},c){const[u,f]=ht(n),[h,d]=ht(o),p=ol(c,u),m=ol(c,h),y=l*l*Math.PI;return r=dt(r)[1],i=dt(i)[1],a=dt(a)[1],il(t,s,((n,o,l,s)=>n.append("svg").attr("viewBox","-8 -8 16 16").attr("width",l).attr("height",s).attr("fill","color"===u?t=>p.scale(t):f).attr("fill-opacity",r).attr("stroke","color"===h?t=>m.scale(t):d).attr("stroke-opacity",i).attr("stroke-width",a).append("path").attr("d",(n=>{const r=e.pathRound();return t.scale(n).draw(r,y),r}))))}],["color",sl],["opacity",function({type:t,interpolate:n,...r},{legend:o=!0,color:i=e.rgb(0,0,0),...a}){if(!n)throw new Error(`${t} opacity scales are not supported`);!0===o&&(o="ramp");if("ramp"!==`${o}`.toLowerCase())throw new Error(`${o} opacity legends are not supported`);return sl({type:t,...r,interpolate:cl(i)},{legend:o,...a})}]]);function ll({className:t,...e},{label:n,ticks:r,tickFormat:o}={},i){return function(t={},...e){let n=t;for(const r of e)for(const e in r)if(void 0===n[e]){const o=r[e];n===t?n={...n,[e]:o}:n[e]=o}return n}(i,{className:t,...e},{label:n,ticks:r,tickFormat:o})}function sl(t,{legend:n=!0,...r}){if(!0===n&&(n="ordinal"===t.type?"swatches":"ramp"),void 0!==t.domain)switch(`${n}`.toLowerCase()){case"swatches":return function(t,{opacity:e,...n}={}){if(!Br(t)&&!Ir(t))throw new Error(`swatches legend requires ordinal or threshold color scale (not ${t.type})`);return il(t,n,((t,n,r,o)=>t.append("svg").attr("width",r).attr("height",o).attr("fill",n.scale).attr("fill-opacity",dt(e)[1]).append("rect").attr("width","100%").attr("height","100%")))}(t,r);case"ramp":return function(t,n){let{label:r=t.label,tickSize:o=6,width:i=240,height:a=44+o,marginTop:l=18,marginRight:s=0,marginBottom:c=16+o,marginLeft:u=0,style:f,ticks:h=(i-u-s)/64,tickFormat:d,fontVariant:p=fi(t),round:m=!0,opacity:y,className:g}=n;const v=po(n);g=Ho(g),y=dt(y)[1],null===d&&(d=()=>null);const x=mo("svg",v).attr("class",`${g}-ramp`).attr("font-family","system-ui, sans-serif").attr("font-size",10).attr("width",i).attr("height",a).attr("viewBox",`0 0 ${i} ${a}`).call((t=>t.append("style").text(`:where(.${g}-ramp) {\n display: block;\n height: auto;\n height: intrinsic;\n max-width: 100%;\n overflow: visible;\n}\n:where(.${g}-ramp text) {\n white-space: pre;\n}`))).call(Vo,f);let w,b=t=>t.selectAll(".tick line").attr("y1",l+c-a);const k=m?(t,e)=>t.rangeRound(e):(t,e)=>t.range(e),{type:$,domain:M,range:A,interpolate:L,scale:S,pivot:z}=t;if(L){const t=void 0===A?L:e.piecewise(1===L.length?nr(L):L,A);w=k(S.copy(),e.quantize(e.interpolateNumber(u,i-s),Math.min(M.length+(void 0!==z),void 0===A?1/0:A.length)));const n=256,r=v.document.createElement("canvas");r.width=n,r.height=1;const o=r.getContext("2d");for(let e=0,r=n-1;e<n;++e)o.fillStyle=t(e/r),o.fillRect(e,0,1,1);x.append("image").attr("opacity",y).attr("x",u).attr("y",l).attr("width",i-u-s).attr("height",a-l-c).attr("preserveAspectRatio","none").attr("xlink:href",r.toDataURL())}else if("threshold"===$){const t=M,n=void 0===d?t=>t:"string"==typeof d?e.format(d):d;w=k(e.scaleLinear().domain([-1,A.length-1]),[u,i-s]),x.append("g").attr("fill-opacity",y).selectAll().data(A).enter().append("rect").attr("x",((t,e)=>w(e-1))).attr("y",l).attr("width",((t,e)=>w(e)-w(e-1))).attr("height",a-l-c).attr("fill",(t=>t)),h=vt(t,((t,e)=>e)),d=e=>n(t[e],e)}else w=k(e.scaleBand().domain(M),[u,i-s]),x.append("g").attr("fill-opacity",y).selectAll().data(M).enter().append("rect").attr("x",w).attr("y",l).attr("width",Math.max(0,w.bandwidth()-1)).attr("height",a-l-c).attr("fill",S),b=()=>{};return x.append("g").attr("transform",`translate(0,${a-c})`).call(e.axisBottom(w).ticks(Array.isArray(h)?null:h,"string"==typeof d?d:void 0).tickFormat("function"==typeof d?d:void 0).tickSize(o).tickValues(Array.isArray(h)?h:null)).attr("font-size",null).attr("font-family",null).attr("font-variant",Go(p,"normal")).call(b).call((t=>t.select(".domain").remove())),void 0!==r&&x.append("text").attr("x",u).attr("y",l-6).attr("fill","currentColor").attr("font-weight","bold").text(r),x.node()}(t,r);default:throw new Error(`unknown legend type: ${n}`)}}function cl(t){const{r:n,g:r,b:o}=e.rgb(t)||e.rgb(0,0,0);return t=>`rgba(${n},${r},${o},${t})`}function ul(t={}){return wt(t)?t:{...t,x:Q}}function fl(t={}){return bt(t)?t:{...t,y:Q}}function hl(t,e){if(1===e.length)return{data:t,facets:e};const n=Et(t),r=new Uint8Array(n);let o=0;for(const t of e)for(const e of t)r[e]&&++o,r[e]=1;if(0===o)return{data:t,facets:e};const i=(t=xt(t))[Y]=new Uint32Array(n+o);e=e.map((t=>xt(t,Uint32Array)));let a=n;r.fill(0);for(const n of e)for(let e=0,o=n.length;e<o;++e){const o=n[e];r[o]?(n[e]=a,t[a]=t[o],i[a]=o,++a):i[o]=o,r[o]=1}return{data:t,facets:e}}function dl(t={},e={}){1===arguments.length&&([t,e]=gl(t));const{y1:n,y:r=n,x:o,...i}=e,[a,l,s,c]=xl(r,o,"y","x",t,i);return{...a,y1:n,y:l,x1:s,x2:c,x:Ft(s,c)}}function pl(t={},e={}){1===arguments.length&&([t,e]=gl(t));const{x1:n,x:r=n,y:o,...i}=e,[a,l,s,c]=xl(r,o,"x","y",t,i);return{...a,x1:n,x:l,y1:s,y2:c,y:Ft(s,c)}}function ml({x:t,x1:e,x2:n,...r}={}){return r=ei(r,"y"),void 0===e&&void 0===n?dl({x:t,...r}):([e,n]=St(t,e,n),{...r,x1:e,x2:n})}function yl({y:t,y1:e,y2:n,...r}={}){return r=ei(r,"x"),void 0===e&&void 0===n?pl({y:t,...r}):([e,n]=St(t,e,n),{...r,y1:e,y2:n})}function gl(t){const{offset:e,order:n,reverse:r,...o}=t;return[{offset:e,order:n,reverse:r},o]}const vl={length:!0};function xl(t,n=J,i,a,{offset:l,order:s,reverse:c},u){if(null===n)throw new Error(`stack requires ${a}`);const f=Ot(u),[h,d]=Wt(t),[p,m]=Pt(n),[y,g]=Pt(n);return p.hint=y.hint=vl,l=function(t){if(null==t)return;if("function"==typeof t)return t;switch(`${t}`.toLowerCase()){case"expand":case"normalize":return bl;case"center":case"silhouette":return kl;case"wiggle":return $l}throw new Error(`unknown offset: ${t}`)}(l),s=function(t,n,i){if(void 0===t&&n===$l)return Ll(r);if(null==t)return;if("string"==typeof t){const n=t.startsWith("-"),a=n?o:r;switch((n?t.slice(1):t).toLowerCase()){case"value":case i:return function(t){return(e,n,r)=>(e,n)=>t(r[e],r[n])}(a);case"z":return function(t){return(e,n,r,o)=>(e,n)=>t(o[e],o[n])}(a);case"sum":return function(t){return Ol(t,((t,n,r,o)=>e.groupSort(Rt(t),(t=>e.sum(t,(t=>r[t]))),(t=>o[t]))))}(a);case"appearance":return function(t){return Ol(t,((t,n,r,o)=>e.groupSort(Rt(t),(t=>n[e.greatest(t,(t=>r[t]))]),(t=>o[t]))))}(a);case"inside-out":return Ll(a)}return Sl(V(t))}if("function"==typeof t)return(1===t.length?Sl:zl)(t);if(F(t))return a=t,Ol(r,(()=>a));var a;throw new Error(`invalid order: ${t}`)}(s,l,a),[ze(u,((r,o,a)=>{({data:r,facets:o}=hl(r,o));const u=null==t?void 0:d(qt(_(r,t),a?.[i])),h=_(r,n,Float64Array),p=_(r,f),y=s&&s(r,u,h,p),v=Et(r),x=m(new Float64Array(v)),w=g(new Float64Array(v)),b=[];for(const t of o){const n=u?Array.from(e.group(t,(t=>u[t])).values()):[t];if(y)for(const t of n)t.sort(y);for(const t of n){let e=0,n=0;c&&t.reverse();for(const r of t){const t=h[r];t<0?e=w[r]=(x[r]=e)+t:t>0?n=w[r]=(x[r]=n)+t:w[r]=x[r]=n}}b.push(n)}return l&&l(b,x,w,p),{data:r,facets:o}})),h,p,y]}function wl(t,e){let n=0,r=0;for(const o of t){const t=e[o];t<n&&(n=t),t>r&&(r=t)}return[n,r]}function bl(t,e,n){for(const r of t)for(const t of r){const[r,o]=wl(t,n);for(const i of t){const t=1/(o-r||1);e[i]=t*(e[i]-r),n[i]=t*(n[i]-r)}}}function kl(t,e,n){for(const r of t){for(const t of r){const[r,o]=wl(t,n);for(const i of t){const t=(o+r)/2;e[i]-=t,n[i]-=t}}Ml(r,e,n)}Al(t,e,n)}function $l(t,n,r,o){for(const i of t){const t=new e.InternMap;let a=0;for(const l of i){let i=-1;const s=l.map((t=>Math.abs(r[t]-n[t]))),c=l.map((e=>{i=o?o[e]:++i;const a=r[e]-n[e],l=t.has(i)?a-t.get(i):0;return t.set(i,a),l})),u=[0,...e.cumsum(c)];for(const t of l)n[t]+=a,r[t]+=a;const f=e.sum(s);f&&(a-=e.sum(s,((t,e)=>(c[e]/2+u[e])*t))/f)}Ml(i,n,r)}Al(t,n,r)}function Ml(t,n,r){const o=e.min(t,(t=>e.min(t,(t=>n[t]))));for(const e of t)for(const t of e)n[t]-=o,r[t]-=o}function Al(t,n,r){const o=t.length;if(1===o)return;const i=t.map((t=>t.flat())),a=i.map((t=>(e.min(t,(t=>n[t]))+e.max(t,(t=>r[t])))/2)),l=e.min(a);for(let t=0;t<o;t++){const e=l-a[t];for(const o of i[t])n[o]+=e,r[o]+=e}}function Ll(t){return Ol(t,((t,n,r,o)=>{const i=Rt(t),a=e.groupSort(i,(t=>n[e.greatest(t,(t=>r[t]))]),(t=>o[t])),l=e.rollup(i,(t=>e.sum(t,(t=>r[t]))),(t=>o[t])),s=[],c=[];let u=0;for(const t of a)u<0?(u+=l.get(t),s.push(t)):(u-=l.get(t),c.push(t));return c.reverse().concat(s)}))}function Sl(t){return e=>{const n=_(e,t);return(t,e)=>r(n[t],n[e])}}function zl(t){return e=>F(e)?(n,r)=>t(e[n],e[r]):(n,r)=>t(e.get(n),e.get(r))}function Ol(t,n){return(r,o,i,a)=>{if(!a)throw new Error("missing channel: z");const l=new e.InternMap(n(r,o,i,a).map(((t,e)=>[t,e])));return(e,n)=>t(l.get(a[e]),l.get(a[n]))}}const El={ariaLabel:"rect"};class Rl extends Qo{constructor(t,e={}){const{x1:n,y1:r,x2:o,y2:i}=e;super(t,{x1:{value:n,scale:"x",type:null!=n&&null==o?"band":void 0,optional:!0},y1:{value:r,scale:"y",type:null!=r&&null==i?"band":void 0,optional:!0},x2:{value:o,scale:"x",optional:!0},y2:{value:i,scale:"y",optional:!0}},e,El),Cl(this,e),Nl(this,e)}render(t,e,n,r,o){const{x:i,y:a}=e;let{x1:l,y1:s,x2:c,y2:u}=n;const{marginTop:f,marginRight:h,marginBottom:d,marginLeft:p,width:m,height:y}=r,{projection:g}=o,{insetTop:v,insetRight:x,insetBottom:w,insetLeft:b}=this,{rx:k,ry:$,rx1y1:M,rx1y2:A,rx2y1:L,rx2y2:S}=this;(l||c)&&!g&&Pr(i)&&(l=c=null),(s||u)&&!g&&Pr(a)&&(s=u=null);const z=i?.bandwidth?i.bandwidth():0,O=a?.bandwidth?a.bandwidth():0;return mo("svg:g",o).call(Fo,this,r,o).call(_o,this,{},0,0).call((e=>e.selectAll().data(t).enter().call(M||A||L||S?t=>t.append("path").call(qo,this).call(Tl,l&&c?t=>l[t]+(c[t]<l[t]?-x:b):l?t=>l[t]+b:p+b,s&&u?t=>s[t]+(u[t]<s[t]?-w:v):s?t=>s[t]+v:f+v,l&&c?t=>c[t]-(c[t]<l[t]?-b:x):l?t=>l[t]+z-x:m-h-x,s&&u?t=>u[t]-(u[t]<s[t]?-v:w):s?t=>s[t]+O-w:y-d-w,this).call(No,this,n):t=>t.append("rect").call(qo,this).attr("x",l?c?t=>Math.min(l[t],c[t])+b:t=>l[t]+b:p+b).attr("y",s?u?t=>Math.min(s[t],u[t])+v:t=>s[t]+v:f+v).attr("width",l?c?t=>Math.max(0,Math.abs(c[t]-l[t])+z-b-x):z-b-x:m-h-p-x-b).attr("height",s?u?t=>Math.max(0,Math.abs(s[t]-u[t])+O-v-w):O-v-w:y-f-d-v-w).call(Yo,"rx",k).call(Yo,"ry",$).call(No,this,n)))).node()}}function Cl(t,{inset:e=0,insetTop:n=e,insetRight:r=e,insetBottom:o=e,insetLeft:i=e}={}){t.insetTop=et(n),t.insetRight=et(r),t.insetBottom=et(o),t.insetLeft=et(i)}function Nl(t,{r:e,rx:n,ry:r,rx1:o=e,ry1:i=e,rx2:a=e,ry2:l=e,rx1y1:s=(void 0!==o?+o:void 0!==i?+i:0),rx1y2:c=(void 0!==o?+o:void 0!==l?+l:0),rx2y1:u=(void 0!==a?+a:void 0!==i?+i:0),rx2y2:f=(void 0!==a?+a:void 0!==l?+l:0)}={}){s||c||u||f?(t.rx1y1=s,t.rx1y2=c,t.rx2y1=u,t.rx2y2=f):(t.rx=Go(n,"auto"),t.ry=Go(r,"auto"))}function Tl(t,e,n,r,o,i){const{rx1y1:a,rx1y2:l,rx2y1:s,rx2y2:c}=i;"function"!=typeof e&&(e=at(e)),"function"!=typeof n&&(n=at(n)),"function"!=typeof r&&(r=at(r)),"function"!=typeof o&&(o=at(o));const u=Math.max(Math.abs(a+s),Math.abs(l+c)),f=Math.max(Math.abs(a+l),Math.abs(s+c));t.attr("d",(t=>{const i=e(t),h=n(t),d=r(t),p=o(t),m=i>d,y=h>p,g=m?d:i,v=m?i:d,x=y?p:h,w=y?h:p,b=Math.min(1,(v-g)/u,(w-x)/f),k=b*(m?y?c:s:y?l:a),$=b*(m?y?l:a:y?c:s),M=b*(m?y?a:l:y?s:c),A=b*(m?y?s:c:y?a:l);return`M${g},${x+Il(k,A)}A${k},${k} 0 0 ${k<0?0:1} ${g+Bl(k,A)},${x}H${v-Bl($,M)}A${$},${$} 0 0 ${$<0?0:1} ${v},${x+Il($,M)}V${w-Il(M,$)}A${M},${M} 0 0 ${M<0?0:1} ${v-Bl(M,$)},${w}H${g+Bl(A,k)}A${A},${A} 0 0 ${A<0?0:1} ${g},${w-Il(A,k)}Z`}))}function Bl(t,e){return e<0?t:Math.abs(t)}function Il(t,e){return e<0?Math.abs(t):t}function Pl(t,e){return new Rl(t,Ci(Ni(e)))}function Wl(t,e={}){return kt(e)||(e={...e,y:Z,x2:Q,interval:1}),new Rl(t,ml(Ni(ul(e))))}function jl(t,e={}){return kt(e)||(e={...e,x:Z,y2:Q,interval:1}),new Rl(t,yl(Ci(fl(e))))}const Fl={ariaLabel:"frame",fill:"none",stroke:"currentColor",clip:!1},ql={ariaLabel:"frame",fill:null,stroke:"currentColor",strokeLinecap:"square",clip:!1};class Dl extends Qo{constructor(t={}){const{anchor:e=null}=t;super(H,void 0,t,null==e?Fl:ql),this.anchor=pt(e,"anchor",["top","right","bottom","left"]),Cl(this,t),e||Nl(this,t)}render(t,e,n,r,o){const{marginTop:i,marginRight:a,marginBottom:l,marginLeft:s,width:c,height:u}=r,{anchor:f,insetTop:h,insetRight:d,insetBottom:p,insetLeft:m}=this,{rx:y,ry:g,rx1y1:v,rx1y2:x,rx2y1:w,rx2y2:b}=this,k=s+m,$=c-a-d,M=i+h,A=u-l-p;return mo(f?"svg:line":v||x||w||b?"svg:path":"svg:rect",o).datum(0).call(Fo,this,r,o).call(qo,this).call(No,this,n).call(_o,this,{}).call("left"===f?t=>t.attr("x1",k).attr("x2",k).attr("y1",M).attr("y2",A):"right"===f?t=>t.attr("x1",$).attr("x2",$).attr("y1",M).attr("y2",A):"top"===f?t=>t.attr("x1",k).attr("x2",$).attr("y1",M).attr("y2",M):"bottom"===f?t=>t.attr("x1",k).attr("x2",$).attr("y1",A).attr("y2",A):v||x||w||b?t=>t.call(Tl,k,M,$,A,this):t=>t.attr("x",k).attr("y",M).attr("width",$-k).attr("height",A-M).attr("rx",y).attr("ry",g)).node()}}function Yl(t){return new Dl(t)}const _l={ariaLabel:"tip",fill:"var(--plot-background)",stroke:"currentColor"},Gl=new Set(["geometry","href","src","ariaLabel","scales"]);class Xl extends Qo{constructor(t,e={}){e.tip&&(e={...e,tip:!1}),void 0===e.title&&Ht(t)&&Vt(t)&&(e={...e,title:Q});const{x:n,y:r,x1:o,x2:i,y1:a,y2:l,anchor:s,preferredAnchor:c="bottom",monospace:u,fontFamily:f=(u?"ui-monospace, monospace":void 0),fontSize:h,fontStyle:d,fontVariant:p,fontWeight:m,lineHeight:y=1,lineWidth:g=20,frameAnchor:v,format:x,textAnchor:w="start",textOverflow:b,textPadding:k=8,title:$,pointerSize:M=12,pathFilter:A="drop-shadow(0 3px 4px rgba(0,0,0,0.2))"}=e;super(t,{x:{value:null!=o&&null!=i?null:n,scale:"x",optional:!0},y:{value:null!=a&&null!=l?null:r,scale:"y",optional:!0},x1:{value:o,scale:"x",optional:null==i},y1:{value:a,scale:"y",optional:null==l},x2:{value:i,scale:"x",optional:null==o},y2:{value:l,scale:"y",optional:null==a},title:{value:$,optional:!0}},e,_l),this.anchor=le(s,"anchor"),this.preferredAnchor=le(c,"preferredAnchor"),this.frameAnchor=se(v),this.textAnchor=Go(w,"middle"),this.textPadding=+k,this.pointerSize=+M,this.pathFilter=tt(A),this.lineHeight=+y,this.lineWidth=+g,this.textOverflow=Hi(b),this.monospace=!!u,this.fontFamily=tt(f),this.fontSize=et(h),this.fontStyle=tt(d),this.fontVariant=tt(p),this.fontWeight=tt(m);for(const t in _l)t in this.channels&&(this[t]=_l[t]);this.splitLines=ia(this),this.clipLine=aa(this),this.format="string"==typeof x||"function"==typeof x?{title:x}:{...x}}render(t,n,r,o,i){const a=this,{x:l,y:s,fx:c,fy:u}=n,{ownerSVGElement:f,document:h}=i,{anchor:d,monospace:p,lineHeight:m,lineWidth:y}=this,{textPadding:g,pointerSize:v,pathFilter:x}=this,{marginTop:w,marginLeft:b}=o,{x1:k,y1:$,x2:M,y2:A,x:L=k??M,y:S=$??A}=r,z=c?c(t.fx)-b:0,O=u?u(t.fy)-w:0,[E,R]=Zo(this,o),C=ci(r,E),N=ui(r,R),T=p?oa:ra,B=T(la);let I,P;"title"in r?(I=Hl.call(this,{title:r.channels.title},n),P=Zl):(I=Hl.call(this,r.channels,n),P=Ql);const W=mo("svg:g",i).call(Fo,this,o,i).call(Ki,this).call(_o,this,{x:L&&l,y:S&&s}).call((o=>o.selectAll().data(t).enter().append("g").attr("transform",(t=>`translate(${Math.round(C(t))},${Math.round(N(t))})`)).call(qo,this).call((t=>t.append("path").attr("filter",x))).call((o=>o.append("text").each((function(o){const i=e.select(this);this.setAttribute("fill","currentColor"),this.setAttribute("fill-opacity",1),this.setAttribute("stroke","none");const l=P.call(a,o,t,I,n,r);if("string"==typeof l)for(const t of a.splitLines(l))j(i,{value:a.clipLine(t)});else{const t=new Set;for(const e of l){const{label:n=""}=e;n&&t.has(n)||(t.add(n),j(i,e))}}}))))));function j(t,{label:e,value:n,color:r,opacity:o}){e??="",n??="";const i=null!=r||null!=o;let a,l=100*y;const[s]=sa(e,l,T,B);if(s>=0)e=e.slice(0,s).trimEnd()+la,a=n.trim(),n="";else{(e||!n&&!i)&&(n=" "+n);const[t]=sa(n,l-T(e),T,B);t>=0&&(a=n.trim(),n=n.slice(0,t).trimEnd()+la)}const c=t.append("tspan").attr("x",0).attr("dy",`${m}em`).text("");e&&c.append("tspan").attr("font-weight","bold").text(e),n&&c.append((()=>h.createTextNode(n))),i&&c.append("tspan").text(" ■").attr("fill",r).attr("fill-opacity",o).style("user-select","none"),a&&c.append("title").text(a)}function F(){const{width:t,height:e}=o.facet??o;W.selectChildren().each((function(n){let{x:r,width:o,height:i}=this.getBBox();o=Math.round(o),i=Math.round(i);let l=d;if(void 0===l){const r=C(n)+z,s=N(n)+O,c=r+o+v+2*g<t,u=r-o-v-2*g>0,f=s+i+v+2*g<e,h=s-i-v-2*g>0;l=c&&u?f&&h?a.preferredAnchor:h?"bottom":"top":f&&h?c?"left":"right":(c||u)&&(f||h)?`${h?"bottom":"top"}-${c?"left":"right"}`:a.preferredAnchor}const s=this.firstChild,c=this.lastChild;if(s.setAttribute("d",function(t,e,n,r,o){const i=r+2*n,a=o+2*n;switch(t){case"middle":return`M${-i/2},${-a/2}h${i}v${a}h${-i}z`;case"top-left":return`M0,0l${e},${e}h${i-e}v${a}h${-i}z`;case"top":return`M0,0l${e/2},${e/2}h${(i-e)/2}v${a}h${-i}v${-a}h${(i-e)/2}z`;case"top-right":return`M0,0l${-e},${e}h${e-i}v${a}h${i}z`;case"right":return`M0,0l${-e/2},${-e/2}v${e/2-a/2}h${-i}v${a}h${i}v${e/2-a/2}z`;case"bottom-left":return`M0,0l${e},${-e}h${i-e}v${-a}h${-i}z`;case"bottom":return`M0,0l${e/2},${-e/2}h${(i-e)/2}v${-a}h${-i}v${a}h${(i-e)/2}z`;case"bottom-right":return`M0,0l${-e},${-e}h${e-i}v${-a}h${i}z`;case"left":return`M0,0l${e/2},${-e/2}v${e/2-a/2}h${i}v${a}h${-i}v${e/2-a/2}z`}}(l,v,g,o,i)),r)for(const t of c.childNodes)t.setAttribute("x",-r);c.setAttribute("y",+function(t,e,n){return/^top(?:-|$)/.test(t)?.94-n:-.29-e*n}(l,c.childNodes.length,m).toFixed(6)+"em"),c.setAttribute("transform",`translate(${function(t,e,n,r,o){switch(t){case"middle":return[-r/2,o/2];case"top-left":return[n,e+n];case"top":return[-r/2,e/2+n];case"top-right":return[-r-n,e+n];case"right":return[-e/2-r-n,o/2];case"bottom-left":return[n,-e-n];case"bottom":return[-r/2,-e/2-n];case"bottom-right":return[-r-n,-e-n];case"left":return[n+e/2,o/2]}}(l,v,g,o,i)})`)})),W.attr("visibility",null)}return t.length&&(W.attr("visibility","hidden"),f.isConnected?Promise.resolve().then(F):"undefined"!=typeof requestAnimationFrame&&requestAnimationFrame(F)),W.node()}}function Ul(t,{x:e,y:n,...r}={}){return void 0===r.frameAnchor&&([e,n]=zt(e,n)),new Xl(t,{...r,x:e,y:n})}function Hl(t,n){const r={};let o=this.format;o=Vl(o,t,"x"),o=Vl(o,t,"y"),this.format=o;for(const e in o){const n=o[e];if(null!==n&&!1!==n)if("fx"===e||"fy"===e)r[e]=!0;else{const n=On(t,e);n&&(r[e]=n)}}for(const e in t){if(e in r||e in o||Gl.has(e))continue;if(("x"===e||"y"===e)&&t.geometry)continue;const n=On(t,e);if(n){if(null==n.scale&&"color"===n.defaultScale)continue;r[e]=n}}this.facet&&(n.fx&&!("fx"in o)&&(r.fx=!0),n.fy&&!("fy"in o)&&(r.fy=!0));for(const t in r){const o=this.format[t];if("string"==typeof o){const i=r[t]?.value??n[t]?.domain()??[];this.format[t]=(Qt(i)?e.utcFormat:e.format)(o)}else if(void 0===o||!0===o){const e=n[t];this.format[t]=e?.bandwidth?Ha(e,e.domain()):Ao}}return r}function Vl(t,e,n){if(!(n in t))return t;const r=`${n}1`,o=`${n}2`;if(!(!(r in t)&&r in e||!(o in t)&&o in e))return t;const i=Object.entries(t),a=t[n];return i.splice(i.findIndex((([t])=>t===n))+1,0,[r,a],[o,a]),Object.fromEntries(i)}function Zl(t,e,{title:n}){return this.format.title(n.value[t],t)}function*Ql(t,e,r,o,i){for(const a in r){if("fx"===a||"fy"===a){yield{label:ts(o,r,a),value:this.format[a](e[a],t)};continue}if("x1"===a&&"x2"in r)continue;if("y1"===a&&"y2"in r)continue;const l=r[a];if("x2"===a&&"x1"in r)yield{label:Kl(o,r,"x"),value:Jl(this.format.x2,r.x1,l,t)};else if("y2"===a&&"y1"in r)yield{label:Kl(o,r,"y"),value:Jl(this.format.y2,r.y1,l,t)};else{const e=l.value[t],s=l.scale;if(!n(e)&&null==s)continue;yield{label:ts(o,r,a),value:this.format[a](e,t),color:"color"===s?i[a][t]:null,opacity:"opacity"===s?i[a][t]:null}}}}function Jl(t,e,n,r){return n.hint?.length?`${t(n.value[r]-e.value[r],r)}`:`${t(e.value[r],r)}–${t(n.value[r],r)}`}function Kl(t,e,n){const r=ts(t,e,`${n}1`,n),o=ts(t,e,`${n}2`,n);return r===o?r:`${r}–${o}`}function ts(t,e,n,r=n){const o=e[n],i=t[o?.scale??n];return String(i?.label??o?.label??r)}function es(t={}){const{facet:n,style:r,title:o,subtitle:i,caption:a,ariaLabel:l,ariaDescription:s}=t,c=Ho(t.className),u=void 0===t.marks?[]:rs(t.marks);u.push(...function(t){const e=[];for(const n of t){let t=n.tip;if(t){!0===t?t={}:"string"==typeof t&&(t={pointer:t});let{pointer:r,preferredAnchor:o}=t;r=/^x$/i.test(r)?li:/^y$/i.test(r)?si:ai,t=r(hs(n,t)),t.title=null,void 0===o&&(t.preferredAnchor=r===si?"left":"bottom");const i=Ul(n.data,t);i.facet=n.facet,i.facetAnchor=n.facetAnchor,e.push(i)}}return e}(u));const f=function(t,e){if(null==t)return;const{x:n,y:r}=t;if(null==n&&null==r)return;const o=yt(t.data);if(null==o)throw new Error("missing facet data");const i={};null!=n&&(i.fx=vn(o,{value:n,scale:"fx"}));null!=r&&(i.fy=vn(o,{value:r,scale:"fy"}));as(i,e);const a=qr(o,i);return{channels:i,groups:a,data:t.data}}(n,t),h=new Map;for(const e of u){const n=fs(e,f,t);n&&h.set(e,n)}const d=new Map;f&&cs(d,[f],t),cs(d,h,t);const p=rs(function(t,e,n){let{projection:r,x:o={},y:i={},fx:a={},fy:l={},axis:s,grid:c,facet:u={},facet:{axis:f=s,grid:h}=u,x:{axis:d=s,grid:p=(null===d?null:c)}=o,y:{axis:m=s,grid:y=(null===m?null:c)}=i,fx:{axis:g=f,grid:v=(null===g?null:h)}=a,fy:{axis:x=f,grid:w=(null===x?null:h)}=l}=n;(r||!Mt(o)&&!gs("x",t))&&(d=p=null);(r||!Mt(i)&&!gs("y",t))&&(m=y=null);e.has("fx")||(g=v=null);e.has("fy")||(x=w=null);void 0===d&&(d=!ys(t,"x"));void 0===m&&(m=!ys(t,"y"));void 0===g&&(g=!ys(t,"fx"));void 0===x&&(x=!ys(t,"fy"));!0===d&&(d="bottom");!0===m&&(m="left");!0===g&&(g="top"===d||null===d?"bottom":"top");!0===x&&(x="right"===m||null===m?"left":"right");const b=[];return ps(b,w,ja,l),ds(b,x,Na,"right","left",u,l),ps(b,v,qa,a),ds(b,g,Ba,"top","bottom",u,a),ps(b,y,Wa,i),ds(b,m,Ca,"left","right",n,i),ps(b,p,Fa,o),ds(b,d,Ta,"bottom","top",n,o),b}(u,d,t));for(const e of p){const n=fs(e,f,t);n&&h.set(e,n)}u.unshift(...p);let m=function(t,n){const{fx:r,fy:o}=xr(t,n),i=r?.scale.domain(),a=o?.scale.domain();return i&&a?e.cross(i,a).map((([t,e],n)=>({x:t,y:e,i:n}))):i?i.map(((t,e)=>({x:t,i:e}))):a?a.map(((t,e)=>({y:t,i:e}))):void 0}(d,t);if(void 0!==m){const t=f?Kr(m,f):void 0;for(const e of u){if(null===e.facet||"super"===e.facet)continue;const n=h.get(e);void 0!==n&&(n.facetsIndex=null!=e.fx||null!=e.fy?Kr(m,n):t)}const e=new Set;for(const{facetsIndex:t}of h.values())t?.forEach(((t,n)=>{t?.length>0&&e.add(n)}));m.forEach(0<e.size&&e.size<m.length?(t,n)=>t.empty=!e.has(n):t=>t.empty=!1);for(const t of u)if("exclude"===t.facet){const e=h.get(t);void 0!==e&&(e.facetsIndex=Dr(e.facetsIndex))}}for(const e of we.keys())Mt(t[e])&&"fx"!==e&&"fy"!==e&&d.set(e,[]);const y=new Map;for(const e of u){if(y.has(e))throw new Error("duplicate mark; each mark must be unique");const{facetsIndex:n,channels:r}=h.get(e)??{},{data:o,facets:i,channels:a}=e.initialize(n,r,t);as(a,t),y.set(e,{data:o,facets:i,channels:a})}const g=xr(cs(d,y,t),t),v=function(t,e,n={}){let r=.5-Lo,o=.5+Lo,i=.5+Lo,a=.5-Lo;for(const{marginTop:t,marginRight:n,marginBottom:l,marginLeft:s}of e)t>r&&(r=t),n>o&&(o=n),l>i&&(i=l),s>a&&(a=s);let{margin:l,marginTop:s=(void 0!==l?l:r),marginRight:c=(void 0!==l?l:o),marginBottom:u=(void 0!==l?l:i),marginLeft:f=(void 0!==l?l:a)}=n;s=+s,c=+c,u=+u,f=+f;let{width:h=640,height:d=ni(t,n,{width:h,marginTopDefault:r,marginRightDefault:o,marginBottomDefault:i,marginLeftDefault:a})+Math.max(0,s-r+u-i)}=n;h=+h,d=+d;const p={width:h,height:d,marginTop:s,marginRight:c,marginBottom:u,marginLeft:f};if(t.fx||t.fy){let{margin:t,marginTop:e=(void 0!==t?t:s),marginRight:r=(void 0!==t?t:c),marginBottom:o=(void 0!==t?t:u),marginLeft:i=(void 0!==t?t:f)}=n.facet??{};e=+e,r=+r,o=+o,i=+i,p.facet={marginTop:e,marginRight:r,marginBottom:o,marginLeft:i}}return p}(g,u,t);!function(t,e){const{x:n,y:r,fx:o,fy:i}=t,a=o||i?$r(e):e;o&&Ar(o,a),i&&Lr(i,a);const l=o||i?Mr(t,e):e;n&&Ar(n,l),r&&Lr(r,l)}(g,v);const x=wr(g),{fx:w,fy:b}=x,k=w||b?Mr(g,v):v,$=w||b?function({fx:t,fy:e},n){const{marginTop:r,marginRight:o,marginBottom:i,marginLeft:a,width:l,height:s}=$r(n),c=t&&vs(t),u=e&&vs(e);return{marginTop:e?u[0]:r,marginRight:t?l-c[1]:o,marginBottom:e?s-u[1]:i,marginLeft:t?c[0]:a,inset:{marginTop:n.marginTop,marginRight:n.marginRight,marginBottom:n.marginBottom,marginLeft:n.marginLeft},width:l,height:s}}(x,v):v,M=po(t),A=M.document,L=e.creator("svg").call(A.documentElement);let S=L;M.ownerSVGElement=L,M.className=c,M.projection=ro(t,k),M.filterFacets=(t,e)=>Kr(m,{channels:e,groups:qr(t,e)}),M.getMarkState=t=>{const e=y.get(t),n=h.get(t);return{...e,channels:{...e.channels,...n?.channels}}},M.dispatchValue=t=>{S.value!==t&&(S.value=t,S.dispatchEvent(new Event("input",{bubbles:!0})))};const z=new Set;for(const[e,n]of y)if(null!=e.initializer){const r="super"===e.facet?$:k,o=e.initializer(n.data,n.facets,n.channels,x,r,M);if(void 0!==o.data&&(n.data=o.data),void 0!==o.facets&&(n.facets=o.facets),void 0!==o.channels){const{fx:r,fy:i,...a}=o.channels;ss(a),Object.assign(n.channels,a);for(const e of Object.values(a)){const{scale:n}=e;null!=n&&((O=we.get(n))!==de&&O!==xe)&&(ls(e,t),z.add(n))}null==r&&null==i||h.set(e,!0)}}var O;if(z.size){const e=new Map;cs(e,y,t,(t=>z.has(t))),cs(d,y,t,(t=>z.has(t)));const n=function(t,e){for(const n in t){const r=t[n],o=e[n];void 0===r.label&&o&&(r.label=o.label)}return t}(xr(e,t),g),{scales:r,...o}=wr(n);Object.assign(g,n),Object.assign(x,o),Object.assign(x.scales,r)}let E,R;void 0!==m&&(E={x:w?.domain(),y:b?.domain()},m=function(t,{x:e,y:n}){return e&&=Gr(e),n&&=Gr(n),t.filter(e&&n?t=>e.has(t.x)&&n.has(t.y):e?t=>e.has(t.x):t=>n.has(t.y)).sort(e&&n?(t,r)=>e.get(t.x)-e.get(r.x)||n.get(t.y)-n.get(r.y):e?(t,n)=>e.get(t.x)-e.get(n.x):(t,e)=>n.get(t.y)-n.get(e.y))}(m,E),R=function(t,e,{marginTop:n,marginLeft:r}){return t&&e?({x:o,y:i})=>`translate(${t(o)-r},${e(i)-n})`:t?({x:e})=>`translate(${t(e)-r},0)`:({y:t})=>`translate(0,${e(t)-n})`}(w,b,v));for(const[t,e]of y)e.values=t.scale(e.channels,x,M);const{width:C,height:N}=v;e.select(L).attr("class",c).attr("fill","currentColor").attr("font-family","system-ui, sans-serif").attr("font-size",10).attr("text-anchor","middle").attr("width",C).attr("height",N).attr("viewBox",`0 0 ${C} ${N}`).attr("aria-label",l).attr("aria-description",s).call((t=>t.append("style").text(`:where(.${c}) {\n --plot-background: white;\n display: block;\n height: auto;\n height: intrinsic;\n max-width: 100%;\n}\n:where(.${c} text),\n:where(.${c} tspan) {\n white-space: pre;\n}`))).call(Vo,r);for(const t of u){const{channels:n,values:r,facets:o}=y.get(t);if(void 0===m||"super"===t.facet){let e=null;if(o&&(e=o[0],e=t.filter(e,n,r),0===e.length))continue;const i=t.render(e,x,r,$,M);if(null==i)continue;L.appendChild(i)}else{let i;for(const a of m){if(!(t.facetAnchor?.(m,E,a)??!a.empty))continue;let l=null;if(o){const e=h.has(t);if(l=o[e?a.i:0],l=t.filter(l,n,r),0===l.length)continue;e||l!==o[0]||(l=Tt(l)),l.fx=a.x,l.fy=a.y,l.fi=a.i}const s=t.render(l,x,r,k,M);if(null!=s){(i??=e.select(L).append("g")).append((()=>s)).datum(a);for(const t of["aria-label","aria-description","aria-hidden","transform"])s.hasAttribute(t)&&(i.attr(t,s.getAttribute(t)),s.removeAttribute(t))}}i?.selectChildren().attr("transform",R)}}const T=function(t,e,n){const r=[];for(const[o,i]of al){const a=n[o];if(a?.legend&&o in t){const n=i(t[o],ll(e,t[o],a),(e=>t[e]));null!=n&&r.push(n)}}return r}(g,M,t),{figure:B=null!=o||null!=i||null!=a||T.length>0}=t;B&&(S=A.createElement("figure"),S.className=`${c}-figure`,S.style.maxWidth="initial",null!=o&&S.append(ns(A,o,"h2")),null!=i&&S.append(ns(A,i,"h3")),S.append(...T,L),null!=a&&S.append(function(t,e){const n=t.createElement("figcaption");return n.append(e),n}(A,a)),"value"in L&&(S.value=L.value,delete L.value)),S.scale=function(t){return e=>{if(!we.has(e=`${e}`))throw new Error(`unknown scale: ${e}`);return t[e]}}(x.scales),S.legend=function(t,e,n={}){return(r,o)=>{if(!al.has(r))throw new Error(`unknown legend type: ${r}`);if(r in t)return al.get(r)(t[r],ll(e,n[r],o),(e=>t[e]))}}(g,M,t);const I=function(){const t=or;return or=0,rr=void 0,t}();return I>0&&e.select(L).append("text").attr("x",C).attr("y",20).attr("dy","-1em").attr("text-anchor","end").attr("font-family","initial").text("⚠️").append("title").text(`${I.toLocaleString("en-US")} warning${1===I?"":"s"}. Please check the console.`),S}function ns(t,e,n){if(e.ownerDocument)return e;const r=t.createElement(n);return r.append(e),r}function rs(t){return t.flat(1/0).filter((t=>null!=t)).map(os)}function os(t){return"function"==typeof t.render?t:new is(t)}class is extends Qo{constructor(t){if("function"!=typeof t)throw new TypeError("invalid mark; missing render function");super(),this.render=t}render(){}}function as(t,e){for(const n in t)ls(t[n],e);return t}function ls(t,e){const{scale:n,transform:r=!0}=t;if(null==n||!r)return;const{type:o,percent:i,interval:a,transform:l=(i?t=>null==t?NaN:100*t:Dt(a,o))}=e[n]??{};null!=l&&(t.value=vt(t.value,l),t.transform=!1)}function ss(t){for(const e in t)bn(e,t[e])}function cs(t,e,n,r=K){for(const{channels:o}of e.values())for(const e in o){const i=o[e],{scale:a}=i;if(null!=a&&r(a))if("projection"===a){if(!uo(n)){const e=void 0===n.x?.domain,r=void 0===n.y?.domain;if(e||r){const[n,o]=ho(i);e&&us(t,"x",n),r&&us(t,"y",o)}}}else us(t,a,i)}return t}function us(t,e,n){const r=t.get(e);void 0!==r?r.push(n):t.set(e,[n])}function fs(t,e,n){if(null===t.facet||"super"===t.facet)return;const{fx:r,fy:o}=t;if(null!=r||null!=o){const e=yt(t.data??r??o);if(void 0===e)throw new Error(`missing facet data in ${t.ariaLabel}`);if(null===e)return;const i={};return null!=r&&(i.fx=vn(e,{value:r,scale:"fx"})),null!=o&&(i.fy=vn(e,{value:o,scale:"fy"})),as(i,n),{channels:i,groups:qr(e,i)}}if(void 0===e)return;const{channels:i,groups:a,data:l}=e;if("auto"!==t.facet||t.data===l)return{channels:i,groups:a};l.length>0&&(a.size>1||1===a.size&&i.fx&&i.fy&&[...a][0][1].size>1)&&Et(yt(t.data))===Et(l)&&ir(`Warning: the ${t.ariaLabel} mark appears to use faceted data, but isn’t faceted. The mark data has the same length as the facet data and the mark facet option is "auto", but the mark data and facet data are distinct. If this mark should be faceted, set the mark facet option to true; otherwise, suppress this warning by setting the mark facet option to false.`)}function hs(t,e={}){return Oe({...e,x:null,y:null},((e,n,r,o,i,a)=>a.getMarkState(t)))}function ds(t,e,n,r,o,i,a){if(!e)return;const l=/^\s*both\s*$/i.test(e);a=function(t,e,{line:n=e.line,ticks:r,tickSize:o,tickSpacing:i,tickPadding:a,tickFormat:l,tickRotate:s,fontVariant:c,ariaLabel:u,ariaDescription:f,label:h=e.label,labelAnchor:d,labelArrow:p=e.labelArrow,labelOffset:m}){return{anchor:t,line:n,ticks:r,tickSize:o,tickSpacing:i,tickPadding:a,tickFormat:l,tickRotate:s,fontVariant:c,ariaLabel:u,ariaDescription:f,label:h,labelAnchor:d,labelArrow:p,labelOffset:m}}(l?r:e,i,a);const{line:s}=a;n!==Ca&&n!==Ta||!s||ae(s)||t.push(Yl(function(t){const{anchor:e,line:n}=t;return{anchor:e,facetAnchor:e+"-empty",stroke:!0===n?void 0:n}}(a))),t.push(n(a)),l&&t.push(n({...a,anchor:o,label:null}))}function ps(t,e,n,r){e&&!ae(e)&&t.push(n(function(t,{stroke:e=(re(t)?t:void 0),ticks:n=(ms(t)?t:void 0),tickSpacing:r,ariaLabel:o,ariaDescription:i}){return{stroke:e,ticks:n,tickSpacing:r,ariaLabel:o,ariaDescription:i}}(e,r)))}function ms(t){switch(typeof t){case"number":return!0;case"string":return!re(t)}return Ht(t)||"function"==typeof t?.range}function ys(t,e){const n=`${e}-axis `;return t.some((t=>t.ariaLabel?.startsWith(n)))}function gs(t,e){for(const n of e)for(const e in n.channels){const{scale:r}=n.channels[e];if(r===t||"projection"===r)return!0}return!1}function vs(t){const e=t.domain();if(0===e.length)return[0,t.bandwidth()];let n=t(e[0]),r=t(e[e.length-1]);return r<n&&([n,r]=[r,n]),[n,r+t.bandwidth()]}const xs=new Map([["basis",e.curveBasis],["basis-closed",e.curveBasisClosed],["basis-open",e.curveBasisOpen],["bundle",e.curveBundle],["bump-x",e.curveBumpX],["bump-y",e.curveBumpY],["cardinal",e.curveCardinal],["cardinal-closed",e.curveCardinalClosed],["cardinal-open",e.curveCardinalOpen],["catmull-rom",e.curveCatmullRom],["catmull-rom-closed",e.curveCatmullRomClosed],["catmull-rom-open",e.curveCatmullRomOpen],["linear",e.curveLinear],["linear-closed",e.curveLinearClosed],["monotone-x",e.curveMonotoneX],["monotone-y",e.curveMonotoneY],["natural",e.curveNatural],["step",e.curveStep],["step-after",e.curveStepAfter],["step-before",e.curveStepBefore]]);function ws(t=e.curveLinear,n){if("function"==typeof t)return t;const r=xs.get(`${t}`.toLowerCase());if(!r)throw new Error(`unknown curve: ${t}`);if(void 0!==n){if("beta"in r)return r.beta(n);if("tension"in r)return r.tension(n);if("alpha"in r)return r.alpha(n)}return r}function bs(t=ks,e){return"function"!=typeof t&&"auto"===`${t}`.toLowerCase()?ks:ws(t,e)}function ks(t){return e.curveLinear(t)}function $s(t={y:"count"},e={}){[t,e]=Es(t,e);const{x:n,y:r}=e;return Os(Rs(n,e,Q),null,null,r,t,Li(e))}function Ms(t={x:"count"},e={}){[t,e]=Es(t,e);const{x:n,y:r}=e;return Os(null,Rs(r,e,Q),n,null,t,Si(e))}function As(t={fill:"count"},e={}){[t,e]=Es(t,e);const{x:n,y:r}=function(t){let{x:e,y:n}=t;return e=Rs(e,t),n=Rs(n,t),[e.value,n.value]=zt(e.value,n.value),{x:e,y:n}}(e);return Os(n,r,null,null,t,Li(Si(e)))}function Ls(t,e,n={}){if(null==n?.interval)return n;const{reduce:r=sn}=n,o={filter:null};return null!=n[e]&&(o[e]=r),null!=n[`${e}1`]&&(o[`${e}1`]=r),null!=n[`${e}2`]&&(o[`${e}2`]=r),t(o,n)}function Ss(t={}){return Ls($s,"y",ei(t,"x"))}function zs(t={}){return Ls(Ms,"x",ei(t,"y"))}function Os(t,e,n,r,{data:o=ln,filter:i=fn,sort:a,reverse:l,...s}={},c={}){t=Cs(t),e=Cs(e),s=function(t,e){return Ge(t,e,Ts)}(s,c),o=Is(o,Q),a=null==a?void 0:Ts("sort",a,c),i=null==i?void 0:Bs("filter",i,c),null!=n&&_e(s,"x","x1","x2")&&(n=null),null!=r&&_e(s,"y","y1","y2")&&(r=null);const[u,f]=Wt(t),[h,d]=Wt(t),[p,m]=Wt(e),[y,g]=Wt(e),[v,x]=null!=n?[n,"x"]:null!=r?[r,"y"]:[],[w,b]=Wt(v),{x:k,y:$,z:M,fill:A,stroke:L,x1:S,x2:z,y1:O,y2:E,domain:R,cumulative:C,thresholds:N,interval:T,...B}=c,[I,P]=Wt(M),[W]=ht(A),[j]=ht(L),[F,q]=Wt(W),[D,Y]=Wt(j);return{..."z"in c&&{z:I||M},..."fill"in c&&{fill:F||A},..."stroke"in c&&{stroke:D||L},...ze(B,((n,r,c)=>{const u=qt(_(n,v),c?.[x]),h=_(n,M),p=_(n,W),y=_(n,j),w=nn(s,{z:h,fill:p,stroke:y}),k=[],$=[],A=u&&b([]),L=h&&P([]),S=p&&q([]),z=y&&Y([]),O=t&&f([]),E=t&&d([]),R=e&&m([]),C=e&&g([]),N=function(t,e,n){const r=t?.(n),o=e?.(n);return r&&o?function*(t){const e=r.bin(t);for(const[t,[i,a]]of r.entries()){const r=o.bin(e[t]);for(const[t,[e,l]]of o.entries())yield[r[t],{data:n,x1:i,y1:e,x2:a,y2:l}]}}:r?function*(t){const e=r.bin(t);for(const[t,[o,i]]of r.entries())yield[e[t],{data:n,x1:o,x2:i}]}:function*(t){const e=o.bin(t);for(const[t,[r,i]]of o.entries())yield[e[t],{data:n,y1:r,y2:i}]}}(t,e,n);let T=0;for(const t of s)t.initialize(n);a&&a.initialize(n),i&&i.initialize(n);for(const t of r){const e=[];for(const e of s)e.scope("facet",t);a&&a.scope("facet",t),i&&i.scope("facet",t);for(const[r,l]of He(t,w))for(const[t,c]of He(l,u))for(const[l,f]of N(c))if(w&&(f.z=r),!i||i.reduce(l,f)){e.push(T++),$.push(o.reduceIndex(l,n,f)),u&&A.push(t),h&&L.push(w===h?r:h[(l.length>0?l:c)[0]]),p&&S.push(w===p?r:p[(l.length>0?l:c)[0]]),y&&z.push(w===y?r:y[(l.length>0?l:c)[0]]),O&&(O.push(f.x1),E.push(f.x2)),R&&(R.push(f.y1),C.push(f.y2));for(const t of s)t.reduce(l,f);a&&a.reduce(l,f)}k.push(e)}return rn(k,a,l),{data:$,facets:k}})),...!_e(s,"x")&&(u?{x1:u,x2:h,x:Ft(u,h)}:{x:k,x1:S,x2:z}),...!_e(s,"y")&&(p?{y1:p,y2:y,y:Ft(p,y)}:{y:$,y1:O,y2:E}),...w&&{[x]:w},...Object.fromEntries(s.map((({name:t,output:e})=>[t,e])))}}function Es({cumulative:t,domain:e,thresholds:n,interval:r,...o},i){return[o,{cumulative:t,domain:e,thresholds:n,interval:r,...i}]}function Rs(t,{cumulative:e,domain:n,thresholds:r,interval:o},i){return void 0===(t={...Ut(t)}).domain&&(t.domain=n),void 0===t.cumulative&&(t.cumulative=e),void 0===t.thresholds&&(t.thresholds=r),void 0===t.interval&&(t.interval=o),void 0===t.value&&(t.value=i),t.thresholds=Ns(t.thresholds,t.interval),t}function Cs(t){if(null==t)return;const{value:n,cumulative:r,domain:o=e.extent,thresholds:i}=t,a=t=>{let a,l=_(t,n);if(Qt(l)||(function(t){return Xt(t)&&"function"==typeof t?.floor&&t.floor()instanceof Date}(s=i)||Ht(s)&&Qt(s))){l=vt(l,ft,Float64Array);let[t,n]="function"==typeof o?o(l):o,r="function"!=typeof i||Xt(i)?i:i(l,t,n);"number"==typeof r&&(r=e.utcTickInterval(t,n,r)),Xt(r)&&(o===e.extent&&(t=r.floor(t),n=r.offset(r.floor(n))),r=r.range(t,r.offset(n))),a=r}else{l=st(l);let[t,n]="function"==typeof o?o(l):o,r="function"!=typeof i||Xt(i)?i:i(l,t,n);if("number"==typeof r)if(o===e.extent){let o=e.tickIncrement(t,n,r);if(isFinite(o))if(o>0){let e=Math.round(t/o),i=Math.round(n/o);e*o<=t||--e,i*o>n||++i;let a=i-e+1;r=new Float64Array(a);for(let t=0;t<a;++t)r[t]=(e+t)*o}else if(o<0){o=-o;let e=Math.round(t*o),i=Math.round(n*o);e/o<=t||--e,i/o>n||++i;let a=i-e+1;r=new Float64Array(a);for(let t=0;t<a;++t)r[t]=(e+t)/o}else r=[t];else r=[t]}else r=e.ticks(t,n,r);else Xt(r)&&(o===e.extent&&(t=r.floor(t),n=r.offset(r.floor(n))),r=r.range(t,r.offset(n)));a=r}var s;const c=[];if(1===a.length)c.push([a[0],a[0]]);else for(let t=1;t<a.length;++t)c.push([a[t-1],a[t]]);return c.bin=(r<0?qs:r>0?Fs:js)(c,a,l),c};return a.label=jt(n),a}function Ns(t,n,r=Ws){if(void 0===t)return void 0===n?r:Gt(n);if("string"==typeof t){switch(t.toLowerCase()){case"freedman-diaconis":return e.thresholdFreedmanDiaconis;case"scott":return e.thresholdScott;case"sturges":return e.thresholdSturges;case"auto":return Ws}return C(t)}return t}function Ts(t,e,n){return Xe(t,e,n,Bs)}function Bs(t,e,n){return Ue(t,e,n,Is)}function Is(t,e){return Ve(t,e,Ps)}function Ps(t){switch(`${t}`.toLowerCase()){case"x":return Ys;case"x1":return Gs;case"x2":return Xs;case"y":return _s;case"y1":return Us;case"y2":return Hs;case"z":return gn}throw new Error(`invalid bin reduce: ${t}`)}function Ws(t,n,r){return Math.min(200,e.thresholdScott(t,n,r))}function js(t,n,r){return n=st(n),o=>{const i=t.map((()=>[]));for(const t of o)i[e.bisect(n,r[t])-1]?.push(t);return i}}function Fs(t,e,n){const r=js(t,e,n);return t=>{const e=r(t);for(let t=1,n=e.length;t<n;++t){const n=e[t-1],r=e[t];for(const t of n)r.push(t)}return e}}function qs(t,e,n){const r=js(t,e,n);return t=>{const e=r(t);for(let t=e.length-2;t>=0;--t){const n=e[t+1],r=e[t];for(const t of n)r.push(t)}return e}}function Ds(t,e){const n=(+t+ +e)/2;return t instanceof Date?new Date(n):n}const Ys={reduceIndex:(t,e,{x1:n,x2:r})=>Ds(n,r)},_s={reduceIndex:(t,e,{y1:n,y2:r})=>Ds(n,r)},Gs={reduceIndex:(t,e,{x1:n})=>n},Xs={reduceIndex:(t,e,{x2:n})=>n},Us={reduceIndex:(t,e,{y1:n})=>n},Hs={reduceIndex:(t,e,{y2:n})=>n},Vs={ariaLabel:"area",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:1};class Zs extends Qo{constructor(t,e={}){const{x1:n,y1:r,x2:o,y2:i,z:a,curve:l,tension:s}=e;super(t,{x1:{value:n,scale:"x"},y1:{value:r,scale:"y"},x2:{value:o,scale:"x",optional:!0},y2:{value:i,scale:"y",optional:!0},z:{value:Ot(e),optional:!0}},e,Vs),this.z=a,this.curve=ws(l,s)}filter(t){return t}render(t,n,r,o,i){const{x1:a,y1:l,x2:s=a,y2:c=l}=r;return mo("svg:g",i).call(Fo,this,o,i).call(_o,this,n,0,0).call((n=>n.selectAll().data(Io(t,[a,l,s,c],this,r)).enter().append("path").call(qo,this).call(To,this,r).attr("d",e.area().curve(this.curve).defined((t=>t>=0)).x0((t=>a[t])).y0((t=>l[t])).x1((t=>s[t])).y1((t=>c[t]))))).node()}}function Qs(t,e){return void 0===e?Ks(t,{x:nt,y:rt}):new Zs(t,e)}function Js(t,e){const{y:n=Z,...r}=zs(e);return new Zs(t,ml(ul({...r,y1:n,y2:void 0})))}function Ks(t,e){const{x:n=Z,...r}=Ss(e);return new Zs(t,yl(fl({...r,x1:n,x2:void 0})))}const tc={ariaLabel:"link",fill:"none",stroke:"currentColor",strokeMiterlimit:1};class ec extends Qo{constructor(t,e={}){const{x1:n,y1:r,x2:o,y2:i,curve:a,tension:l}=e;super(t,{x1:{value:n,scale:"x"},y1:{value:r,scale:"y"},x2:{value:o,scale:"x",optional:!0},y2:{value:i,scale:"y",optional:!0}},e,tc),this.curve=bs(a,l),di(this,e)}project(t,e,n){this.curve!==ks&&super.project(t,e,n)}render(t,n,r,o,i){const{x1:a,y1:l,x2:s=a,y2:c=l}=r,{curve:u}=this;return mo("svg:g",i).call(Fo,this,o,i).call(_o,this,n).call((n=>n.selectAll().data(t).enter().append("path").call(qo,this).attr("d",u===ks&&i.projection?function(t,n,r,o,i){const a=e.geoPath(t);return n=st(n),r=st(r),o=st(o),i=st(i),t=>a({type:"LineString",coordinates:[[n[t],r[t]],[o[t],i[t]]]})}(i.projection,a,l,s,c):t=>{const n=e.pathRound(),r=u(n);return r.lineStart(),r.point(a[t],l[t]),r.point(s[t],c[t]),r.lineEnd(),n}).call(No,this,r).call(bi,this,r,i))).node()}}function nc(t,{x:e,x1:n,x2:r,y:o,y1:i,y2:a,...l}={}){return[n,r]=rc(e,n,r),[i,a]=rc(o,i,a),new ec(t,{...l,x1:n,x2:r,y1:i,y2:a})}function rc(t,e,n){if(void 0===t){if(void 0===e){if(void 0!==n)return[n]}else if(void 0===n)return[e]}else{if(void 0===e)return void 0===n?[t]:[t,n];if(void 0===n)return[t,e]}return[e,n]}const oc={ariaLabel:"arrow",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeMiterlimit:1,strokeWidth:1.5};class ic extends Qo{constructor(t,n={}){const{x1:r,y1:o,x2:i,y2:a,bend:l=0,headAngle:s=60,headLength:c=8,inset:u=0,insetStart:f=u,insetEnd:h=u,sweep:d}=n;super(t,{x1:{value:r,scale:"x"},y1:{value:o,scale:"y"},x2:{value:i,scale:"x",optional:!0},y2:{value:a,scale:"y",optional:!0}},n,oc),this.bend=!0===l?22.5:Math.max(-90,Math.min(90,l)),this.headAngle=+s,this.headLength=+c,this.insetStart=+f,this.insetEnd=+h,this.sweep=function(t=1){if("number"==typeof t)return at(Math.sign(t));if("function"==typeof t)return(e,n,r,o)=>Math.sign(t(e,n,r,o));switch(mt(t,"sweep",["+x","-x","+y","-y"])){case"+x":return(t,n,r)=>e.ascending(t,r);case"-x":return(t,n,r)=>e.descending(t,r);case"+y":return(t,n,r,o)=>e.ascending(n,o);case"-y":return(t,n,r,o)=>e.descending(n,o)}}(d)}render(t,e,n,r,o){const{x1:i,y1:a,x2:l=i,y2:s=a,SW:c}=n,{strokeWidth:u,bend:f,headAngle:h,headLength:d,insetStart:p,insetEnd:m}=this,y=c?t=>c[t]:at(void 0===u?1:u),g=h*hi/2,v=d/1.5;return mo("svg:g",o).call(Fo,this,r,o).call(_o,this,e).call((e=>e.selectAll().data(t).enter().append("path").call(qo,this).attr("d",(t=>{let e=i[t],n=a[t],r=l[t],o=s[t];const c=Math.hypot(r-e,o-n);if(c<=p+m)return null;let u=Math.atan2(o-n,r-e);const h=Math.min(v*y(t),c/3),d=this.sweep(e,n,r,o)*f*hi,x=Math.hypot(c/Math.tan(d),c)/2;if(p||m)if(x<1e5){const t=Math.sign(d),[i,a]=function([t,e],[n,r],o,i){const a=n-t,l=r-e,s=Math.hypot(a,l),c=i*Math.sqrt(o*o-s*s/4)/s;return[(t+n)/2-l*c,(e+r)/2+a*c]}([e,n],[r,o],x,t);if(p&&([e,n]=ac([i,a,x],[e,n,p],-t*Math.sign(p))),m){const[e,n]=ac([i,a,x],[r,o,m],t*Math.sign(m));u+=Math.atan2(n-a,e-i)-Math.atan2(o-a,r-i),r=e,o=n}}else{const t=r-e,i=o-n,a=Math.hypot(t,i);p&&(e+=t/a*p,n+=i/a*p),m&&(r-=t/a*m,o-=i/a*m)}const w=u+d,b=w+g,k=w-g,$=r-h*Math.cos(b),M=o-h*Math.sin(b),A=r-h*Math.cos(k),L=o-h*Math.sin(k);return`M${e},${n}${x<1e5?`A${x},${x} 0,0,${d>0?1:0} `:"L"}${r},${o}${h?`M${$},${M}L${r},${o}L${A},${L}`:""}`})).call(No,this,n))).node()}}function ac([t,e,n],[r,o,i],a){const l=r-t,s=o-e,c=Math.hypot(l,s),u=(l*l+s*s-i*i+n*n)/(2*c),f=a*Math.sqrt(n*n-u*u);return[t+(l*u+s*f)/c,e+(s*u-l*f)/c]}const lc={ariaLabel:"bar"};class sc extends Qo{constructor(t,e,n={},r=lc){super(t,e,n,r),Cl(this,n),Nl(this,n)}render(t,e,n,r,o){const{rx:i,ry:a,rx1y1:l,rx1y2:s,rx2y1:c,rx2y2:u}=this,f=this._x(e,n,r),h=this._y(e,n,r),d=this._width(e,n,r),p=this._height(e,n,r);return mo("svg:g",o).call(Fo,this,r,o).call(this._transform,this,e).call((e=>e.selectAll().data(t).enter().call(l||s||c||u?t=>t.append("path").call(qo,this).call(Tl,f,h,cc(f,d),cc(h,p),this).call(No,this,n):t=>t.append("rect").call(qo,this).attr("x",f).attr("width",d).attr("y",h).attr("height",p).call(Yo,"rx",i).call(Yo,"ry",a).call(No,this,n)))).node()}_x(t,{x:e},{marginLeft:n}){const{insetLeft:r}=this;return e?t=>e[t]+r:n+r}_y(t,{y:e},{marginTop:n}){const{insetTop:r}=this;return e?t=>e[t]+r:n+r}_width({x:t},{x:e},{marginRight:n,marginLeft:r,width:o}){const{insetLeft:i,insetRight:a}=this,l=e&&t?t.bandwidth():o-n-r;return Math.max(0,l-i-a)}_height({y:t},{y:e},{marginTop:n,marginBottom:r,height:o}){const{insetTop:i,insetBottom:a}=this,l=e&&t?t.bandwidth():o-n-r;return Math.max(0,l-i-a)}}function cc(t,e){return"function"==typeof t&&"function"==typeof e?n=>t(n)+e(n):"function"==typeof t?n=>t(n)+e:"function"==typeof e?n=>t+e(n):t+e}class uc extends sc{constructor(t,e={},n){const{x1:r,x2:o,y:i}=e;super(t,{x1:{value:r,scale:"x"},x2:{value:o,scale:"x"},y:{value:i,scale:"y",type:"band",optional:!0}},e,n)}_transform(t,e,{x:n}){t.call(_o,e,{x:n},0,0)}_x({x:t},{x1:e,x2:n},{marginLeft:r}){const{insetLeft:o}=this;return Pr(t)?r+o:t=>Math.min(e[t],n[t])+o}_width({x:t},{x1:e,x2:n},{marginRight:r,marginLeft:o,width:i}){const{insetLeft:a,insetRight:l}=this;return Pr(t)?i-r-o-a-l:t=>Math.max(0,Math.abs(n[t]-e[t])-a-l)}}class fc extends sc{constructor(t,e={},n){const{x:r,y1:o,y2:i}=e;super(t,{y1:{value:o,scale:"y"},y2:{value:i,scale:"y"},x:{value:r,scale:"x",type:"band",optional:!0}},e,n)}_transform(t,e,{y:n}){t.call(_o,e,{y:n},0,0)}_y({y:t},{y1:e,y2:n},{marginTop:r}){const{insetTop:o}=this;return Pr(t)?r+o:t=>Math.min(e[t],n[t])+o}_height({y:t},{y1:e,y2:n},{marginTop:r,marginBottom:o,height:i}){const{insetTop:a,insetBottom:l}=this;return Pr(t)?i-r-o-a-l:t=>Math.max(0,Math.abs(n[t]-e[t])-a-l)}}function hc(t,e={}){return kt(e)||(e={...e,y:Z,x2:Q}),new uc(t,ml(Ti(ul(e))))}function dc(t,e={}){return kt(e)||(e={...e,x:Z,y2:Q}),new fc(t,yl(Bi(fl(e))))}const pc={ariaLabel:"cell"};class mc extends sc{constructor(t,{x:e,y:n,...r}={}){super(t,{x:{value:e,scale:"x",type:"band",optional:!0},y:{value:n,scale:"y",type:"band",optional:!0}},r,pc)}_transform(t,e){t.call(_o,e,{},0,0)}}function yc(t,{x:e,y:n,...r}={}){return[e,n]=zt(e,n),new mc(t,{...r,x:e,y:n})}const gc={ariaLabel:"dot",fill:"none",stroke:"currentColor",strokeWidth:1.5};function vc(t){return void 0===t.sort&&void 0===t.reverse?Be({channel:"-r"},t):t}class xc extends Qo{constructor(t,n={}){const{x:r,y:o,r:i,rotate:a,symbol:s=e.symbolCircle,frameAnchor:c}=n,[u,f]=dt(a,0),[h,d]=function(t){if(null==t||Ae(t))return[void 0,t];if("string"==typeof t){const e=Me.get(`${t}`.toLowerCase());if(e)return[void 0,e]}return[t,void 0]}(s),[p,m]=dt(i,null==h?3:4.5);super(t,{x:{value:r,scale:"x",optional:!0},y:{value:o,scale:"y",optional:!0},r:{value:p,scale:"r",filter:l,optional:!0},rotate:{value:u,optional:!0},symbol:{value:h,scale:"auto",optional:!0}},vc(n),gc),this.r=m,this.rotate=f,this.symbol=d,this.frameAnchor=se(c);const{channels:y}=this,{symbol:g}=y;if(g){const{fill:t,stroke:e}=y;g.hint={fill:t?t.value===g.value?"color":"currentColor":this.fill??"currentColor",stroke:e?e.value===g.value?"color":"currentColor":this.stroke??"none"}}}render(t,n,r,o,i){const{x:a,y:l}=n,{x:c,y:u,r:f,rotate:h,symbol:d}=r,{r:p,rotate:m,symbol:y}=this,[g,v]=Zo(this,o),x=y===e.symbolCircle,w=f?void 0:p*p*Math.PI;return s(p)&&(t=[]),mo("svg:g",i).call(Fo,this,o,i).call(_o,this,{x:c&&a,y:u&&l}).call((n=>n.selectAll().data(t).enter().append(x?"circle":"path").call(qo,this).call(x?t=>{t.attr("cx",c?t=>c[t]:g).attr("cy",u?t=>u[t]:v).attr("r",f?t=>f[t]:p)}:t=>{t.attr("transform",_i`translate(${c?t=>c[t]:g},${u?t=>u[t]:v})${h?t=>` rotate(${h[t]})`:m?` rotate(${m})`:""}`).attr("d",f&&d?t=>{const n=e.pathRound();return d[t].draw(n,f[t]*f[t]*Math.PI),n}:f?t=>{const n=e.pathRound();return y.draw(n,f[t]*f[t]*Math.PI),n}:d?t=>{const n=e.pathRound();return d[t].draw(n,w),n}:(()=>{const t=e.pathRound();return y.draw(t,w),t})())}).call(No,this,r))).node()}}function wc(t,{x:e,y:n,...r}={}){return void 0===r.frameAnchor&&([e,n]=zt(e,n)),new xc(t,{...r,x:e,y:n})}const bc={ariaLabel:"line",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:1};class kc extends Qo{constructor(t,e={}){const{x:n,y:r,z:o,curve:i,tension:a}=e;super(t,{x:{value:n,scale:"x"},y:{value:r,scale:"y"},z:{value:Ot(e),optional:!0}},e,bc),this.z=o,this.curve=bs(i,a),di(this,e)}filter(t){return t}project(t,e,n){this.curve!==ks&&super.project(t,e,n)}render(t,n,r,o,i){const{x:a,y:l}=r,{curve:s}=this;return mo("svg:g",i).call(Fo,this,o,i).call(_o,this,n).call((n=>n.selectAll().data(Io(t,[a,l],this,r)).enter().append("path").call(qo,this).call(To,this,r).call(ki,this,r,i).attr("d",s===ks&&i.projection?function(t,n,r){const o=e.geoPath(t);return n=st(n),r=st(r),t=>{let e=[];const i=[e];for(const o of t)-1===o?(e=[],i.push(e)):e.push([n[o],r[o]]);return o({type:"MultiLineString",coordinates:i})}}(i.projection,a,l):e.line().curve(s).defined((t=>t>=0)).x((t=>a[t])).y((t=>l[t]))))).node()}}function $c(t,{x:e,y:n,...r}={}){return[e,n]=zt(e,n),new kc(t,{...r,x:e,y:n})}function Mc(t,{x:e=Q,y:n=Z,...r}={}){return new kc(t,zs({...r,x:e,y:n}))}function Ac(t,{x:e=Z,y:n=Q,...r}={}){return new kc(t,Ss({...r,x:e,y:n}))}function Lc(t,e){e=function({x:t,y:e,color:n,size:r,fx:o,fy:i,mark:a}={}){At(t)||(t=Oc(t));At(e)||(e=Oc(e));At(n)||(n=re(n)?{color:n}:Oc(n));At(r)||(r=Oc(r));At(o)&&({value:o}=Oc(o));At(i)&&({value:i}=Oc(i));null!=a&&(a=`${a}`.toLowerCase());return{x:t,y:e,color:n,size:r,fx:o,fy:i,mark:a}}(e);const{x:n,y:r,color:o,size:i}=e,a=zc(t,n),l=zc(t,r),s=zc(t,o),c=zc(t,i);let u,f,h,{fx:d,fy:p,x:{value:m,reduce:y,zero:g,...v},y:{value:x,reduce:w,zero:b,...k},color:{value:$,color:M,reduce:A},size:{value:L,reduce:S},mark:z}=e;if(void 0===y&&(y=null==w&&null==m&&null==L&&null!=x?"count":null),void 0===w&&(w=null==y&&null==x&&null==L&&null!=m?"count":null),void 0!==S||null!=L||null!=A||null!=y||null!=w||null!=m&&!Zt(a)||null!=x&&!Zt(l)||(S="count"),void 0===g&&(g=!!Ec(y)||void 0),void 0===b&&(b=!!Ec(w)||void 0),null==m&&null==x)throw new Error("must specify x or y");if(null!=y&&null==x)throw new Error("reducing x requires y");if(null!=w&&null==m)throw new Error("reducing y requires x");switch(void 0===z&&(z=null!=L||null!=S?"dot":Ec(y)||Ec(w)||null!=A?"bar":null!=m&&null!=x?Zt(a)||Zt(l)||null==y&&null==w&&!Sc(a)&&!Sc(l)?"dot":"line":null!=m||null!=x?"rule":null),z){case"dot":h=wc,f="stroke";break;case"line":h=a&&l||null!=y||null!=w?b||null!=w||a&&Sc(a)?Ac:g||null!=y||l&&Sc(l)?Mc:$c:a?Mc:Ac,f="stroke",Cc(s)&&(u=null);break;case"area":h=!b&&null==w&&(g||null!=y||l&&Sc(l))?Js:Ks,f="fill",Cc(s)&&(u=null);break;case"rule":h=a?qi:Di,f="stroke";break;case"bar":h=null!=y?Zt(l)?Rc(y)&&a&&Zt(a)?yc:hc:Wl:null!=w?Zt(a)?Rc(w)&&l&&Zt(l)?yc:dc:jl:null!=A||null!=S?a&&Zt(a)&&l&&Zt(l)?yc:a&&Zt(a)?dc:l&&Zt(l)?hc:Pl:!a||!te(a)||l&&te(l)?!l||!te(l)||a&&te(a)?yc:dc:hc,f="fill";break;default:throw new Error(`invalid mark: ${z}`)}let O,E={fx:d,fy:p,x:a??void 0,y:l??void 0,[f]:s??M,z:u,r:c??void 0,tip:!0},R={[f]:A??void 0,r:S??void 0};if(null!=y&&null!=w)throw new Error("cannot reduce both x and y");return null!=w?(R.y=w,O=Zt(a)?Fe:$s):null!=y?(R.x=y,O=Zt(l)?qe:Ms):null==A&&null==S||(a&&l?O=Zt(a)&&Zt(l)?De:Zt(a)?Ms:Zt(l)?$s:As:a?O=Zt(a)?Fe:$s:l&&(O=Zt(l)?qe:Ms)),O!==As&&O!==$s||(E.x={value:a,...v}),O!==As&&O!==Ms||(E.y={value:l,...k}),void 0===g&&(g=a&&!(O===As||O===$s)&&(h===hc||h===Js||h===Wl||h===Di)),void 0===b&&(b=l&&!(O===As||O===Ms)&&(h===dc||h===Ks||h===jl||h===qi)),{fx:d??null,fy:p??null,x:{value:m??null,reduce:y??null,zero:!!g,...v},y:{value:x??null,reduce:w??null,zero:!!b,...k},color:{value:$??null,reduce:A??null,...void 0!==M&&{color:M}},size:{value:L??null,reduce:S??null},mark:z,markImpl:Tc[h],markOptions:E,transformImpl:Tc[O],transformOptions:R,colorMode:f}}function Sc(t){let n,r;for(const o of t){if(null==o)continue;if(void 0===n){n=o;continue}const t=Math.sign(e.ascending(n,o));if(t){if(void 0!==r&&t!==r)return!1;n=o,r=t}}return!0}function zc(t,e){const n=_(t,e.value);return n&&(n.label=jt(e.value)),n}function Oc(t){return function(t){if(null==t)return!1;if("function"==typeof t.reduceIndex)return!0;if("function"==typeof t.reduce&&$t(t))return!0;if(/^p\d{2}$/i.test(t))return!0;switch(`${t}`.toLowerCase()){case"first":case"last":case"count":case"distinct":case"sum":case"proportion":case"proportion-facet":case"deviation":case"min":case"min-index":case"max":case"max-index":case"mean":case"median":case"variance":case"mode":return!0}return!1}(t)?{reduce:t}:{value:t}}function Ec(t){return/^(?:distinct|count|sum|proportion)$/i.test(t)}function Rc(t){return/^(?:first|last|mode)$/i.test(t)}function Cc(t){return!!t&&new e.InternSet(t).size>t.length>>1}const Nc={dot:wc,line:$c,lineX:Mc,lineY:Ac,areaX:Js,areaY:Ks,ruleX:qi,ruleY:Di,barX:hc,barY:dc,rect:Pl,rectX:Wl,rectY:jl,cell:yc,bin:As,binX:$s,binY:Ms,group:De,groupX:Fe,groupY:qe},Tc=Object.fromEntries(Object.entries(Nc).map((([t,e])=>[e,t])));function Bc(t,e={}){let{x:n,x1:r,x2:o}=e;void 0===n&&void 0===r&&void 0===o&&(e={...e,x:n=Q});const i={};return null!=n&&(i.x=t),null!=r&&(i.x1=t),null!=o&&(i.x2=t),Pc(i,e)}function Ic(t,e={}){let{y:n,y1:r,y2:o}=e;void 0===n&&void 0===r&&void 0===o&&(e={...e,y:n=Q});const i={};return null!=n&&(i.y=t),null!=r&&(i.y1=t),null!=o&&(i.y2=t),Pc(i,e)}function Pc(t={},n={}){const r=Ot(n),o=Object.entries(t).map((([t,e])=>{const r=It(t,n);if(null==r)throw new Error(`missing channel: ${t}`);const[o,i]=Pt(r);return{key:t,input:r,output:o,setOutput:i,map:Wc(e)}}));return{...ze(n,((t,n)=>{const i=_(t,r),a=o.map((({input:e})=>_(t,e))),l=o.map((({setOutput:e})=>e(new Array(t.length))));for(const t of n)for(const n of i?e.group(t,(t=>i[t])).values():[t])o.forEach((({map:t},e)=>t.mapIndex(n,a[e],l[e])));return{data:t,facets:n}})),...Object.fromEntries(o.map((({key:t,output:e})=>[t,e])))}}function Wc(t){if(null==t)throw new Error("missing map");if("function"==typeof t.mapIndex)return t;if("function"==typeof t.map&&$t(t))return function(t){return console.warn("deprecated map interface; implement mapIndex instead."),{mapIndex:t.map.bind(t)}}(t);if("function"==typeof t)return jc(Nt(t));switch(`${t}`.toLowerCase()){case"cumsum":return Fc;case"rank":return jc(((t,n)=>e.rank(t,(t=>n[t]))));case"quantile":return jc(((t,n)=>function(t,n){const r=e.count(t,n)-1;return e.rank(t,n).map((t=>t/r))}(t,(t=>n[t]))))}throw new Error(`invalid map: ${t}`)}function jc(t){return{mapIndex(e,n,r){const o=t(e,n);if(o.length!==e.length)throw new Error("map function returned a mismatched length");for(let t=0,n=e.length;t<n;++t)r[e[t]]=o[t]}}}const Fc={mapIndex(t,e,n){let r=0;for(const o of t)n[o]=r+=e[o]}};function qc(t={}){"number"==typeof t&&(t={k:t});let{k:n,reduce:r,shift:o,anchor:i,strict:a}=t;if(void 0===i&&void 0!==o&&(i=function(t){switch(`${t}`.toLowerCase()){case"centered":return"middle";case"leading":return"start";case"trailing":return"end"}throw new Error(`invalid shift: ${t}`)}(o),ir(`Warning: the shift option is deprecated; please use anchor "${i}" instead.`)),!((n=Math.floor(n))>0))throw new Error(`invalid k: ${n}`);return function(t="mean"){if("string"==typeof t){if(/^p\d{2}$/i.test(t))return Dc(lt(t));switch(t.toLowerCase()){case"deviation":return Dc(e.deviation);case"max":return Yc(((t,n)=>e.max(t,(t=>n[t]))));case"mean":return Gc;case"median":return Dc(e.median);case"min":return Yc(((t,n)=>e.min(t,(t=>n[t]))));case"mode":return Yc(((t,n)=>e.mode(t,(t=>n[t]))));case"sum":return _c;case"variance":return Dc(e.variance);case"difference":return Zc;case"ratio":return Qc;case"first":return Jc;case"last":return Kc}}if("function"!=typeof t)throw new Error(`invalid reduce: ${t}`);return Yc(Nt(t))}(r)(n,function(t="middle",e){switch(`${t}`.toLowerCase()){case"middle":return e-1>>1;case"start":return 0;case"end":return e-1}throw new Error(`invalid anchor: ${t}`)}(i,n),a)}function Dc(t){return(e,n,r)=>r?{mapIndex(r,o,i){const a=t=>null==o[t]?NaN:+o[t];let l=0;for(let t=0;t<e-1;++t)isNaN(a(t))&&++l;for(let o=0,s=r.length-e+1;o<s;++o)isNaN(a(o+e-1))&&++l,i[r[o+n]]=0===l?t(Tt(r,o,o+e),a):NaN,isNaN(a(o))&&--l}}:{mapIndex(r,o,i){const a=t=>null==o[t]?NaN:+o[t];for(let o=-n;o<0;++o)i[r[o+n]]=t(Tt(r,0,o+e),a);for(let o=0,l=r.length-n;o<l;++o)i[r[o+n]]=t(Tt(r,o,o+e),a)}}}function Yc(t){return(e,r,o)=>o?{mapIndex(o,i,a){let l=0;for(let t=0;t<e-1;++t)l+=n(i[o[t]]);for(let s=0,c=o.length-e+1;s<c;++s)l+=n(i[o[s+e-1]]),l===e&&(a[o[s+r]]=t(Tt(o,s,s+e),i)),l-=n(i[o[s]])}}:{mapIndex(n,o,i){for(let a=-r;a<0;++a)i[n[a+r]]=t(Tt(n,0,a+e),o);for(let a=0,l=n.length-r;a<l;++a)i[n[a+r]]=t(Tt(n,a,a+e),o)}}}function _c(t,e,n){return n?{mapIndex(n,r,o){let i=0,a=0;for(let e=0;e<t-1;++e){const t=r[n[e]];null===t||isNaN(t)?++i:a+=+t}for(let l=0,s=n.length-t+1;l<s;++l){const s=r[n[l]],c=r[n[l+t-1]];null===c||isNaN(c)?++i:a+=+c,o[n[l+e]]=0===i?a:NaN,null===s||isNaN(s)?--i:a-=+s}}}:{mapIndex(n,r,o){let i=0;const a=n.length;for(let o=0,l=Math.min(a,t-e-1);o<l;++o)i+=+r[n[o]]||0;for(let l=-e,s=a-e;l<s;++l)i+=+r[n[l+t-1]]||0,o[n[l+e]]=i,i-=+r[n[l]]||0}}}function Gc(t,e,n){if(n){const r=_c(t,e,n);return{mapIndex(n,o,i){r.mapIndex(n,o,i);for(let r=0,o=n.length-t+1;r<o;++r)i[n[r+e]]/=t}}}return{mapIndex(n,r,o){let i=0,a=0;const l=n.length;for(let o=0,s=Math.min(l,t-e-1);o<s;++o){let t=r[n[o]];null===t||isNaN(t=+t)||(i+=t,++a)}for(let s=-e,c=l-e;s<c;++s){let l=r[n[s+t-1]],c=r[n[s]];null===l||isNaN(l=+l)||(i+=l,++a),o[n[s+e]]=i/a,null===c||isNaN(c=+c)||(i-=c,--a)}}}}function Xc(t,e,r,o){for(let i=r+o;r<i;++r){const o=t[e[r]];if(n(o))return o}}function Uc(t,e,r,o){for(let i=r+o-1;i>=r;--i){const r=t[e[i]];if(n(r))return r}}function Hc(t,e,n,r){for(let o=n+r;n<o;++n){let r=t[e[n]];if(null!==r&&!isNaN(r=+r))return r}}function Vc(t,e,n,r){for(let o=n+r-1;o>=n;--o){let n=t[e[o]];if(null!==n&&!isNaN(n=+n))return n}}function Zc(t,e,n){return n?{mapIndex(n,r,o){for(let i=0,a=n.length-t;i<a;++i){const a=r[n[i]],l=r[n[i+t-1]];o[n[i+e]]=null===a||null===l?NaN:l-a}}}:{mapIndex(n,r,o){for(let i=-e,a=n.length-t+e+1;i<a;++i)o[n[i+e]]=Vc(r,n,i,t)-Hc(r,n,i,t)}}}function Qc(t,e,n){return n?{mapIndex(n,r,o){for(let i=0,a=n.length-t;i<a;++i){const a=r[n[i]],l=r[n[i+t-1]];o[n[i+e]]=null===a||null===l?NaN:l/a}}}:{mapIndex(n,r,o){for(let i=-e,a=n.length-t+e+1;i<a;++i)o[n[i+e]]=Vc(r,n,i,t)/Hc(r,n,i,t)}}}function Jc(t,e,n){return n?{mapIndex(n,r,o){for(let i=0,a=n.length-t;i<a;++i)o[n[i+e]]=r[n[i]]}}:{mapIndex(n,r,o){for(let i=-e,a=n.length-t+e+1;i<a;++i)o[n[i+e]]=Xc(r,n,i,t)}}}function Kc(t,e,n){return n?{mapIndex(n,r,o){for(let i=0,a=n.length-t;i<a;++i)o[n[i+e]]=r[n[i+t-1]]}}:{mapIndex(n,r,o){for(let i=-e,a=n.length-t+e+1;i<a;++i)o[n[i+e]]=Uc(r,n,i,t)}}}const tu={n:20,k:2,color:"currentColor",opacity:.2,strict:!0,anchor:"end"};function eu({n:t=tu.n,k:n=0,strict:r=tu.strict,anchor:o=tu.anchor}={}){return qc({k:t,reduce:t=>e.mean(t)+n*(e.deviation(t)||0),strict:r,anchor:o})}const nu={ariaLabel:"tick",fill:null,stroke:"currentColor"};class ru extends Qo{constructor(t,e,n){super(t,e,n,nu),di(this,n)}render(t,e,n,r,o){return mo("svg:g",o).call(Fo,this,r,o).call(this._transform,this,e).call((i=>i.selectAll().data(t).enter().append("line").call(qo,this).attr("x1",this._x1(e,n,r)).attr("x2",this._x2(e,n,r)).attr("y1",this._y1(e,n,r)).attr("y2",this._y2(e,n,r)).call(No,this,n).call(bi,this,n,o))).node()}}class ou extends ru{constructor(t,e={}){const{x:n,y:r,inset:o=0,insetTop:i=o,insetBottom:a=o}=e;super(t,{x:{value:n,scale:"x"},y:{value:r,scale:"y",type:"band",optional:!0}},e),this.insetTop=et(i),this.insetBottom=et(a)}_transform(t,e,{x:n}){t.call(_o,e,{x:n},Lo,0)}_x1(t,{x:e}){return t=>e[t]}_x2(t,{x:e}){return t=>e[t]}_y1({y:t},{y:e},{marginTop:n}){const{insetTop:r}=this;return e&&t?t=>e[t]+r:n+r}_y2({y:t},{y:e},{height:n,marginBottom:r}){const{insetBottom:o}=this;return e&&t?n=>e[n]+t.bandwidth()-o:n-r-o}}class iu extends ru{constructor(t,e={}){const{x:n,y:r,inset:o=0,insetRight:i=o,insetLeft:a=o}=e;super(t,{y:{value:r,scale:"y"},x:{value:n,scale:"x",type:"band",optional:!0}},e),this.insetRight=et(i),this.insetLeft=et(a)}_transform(t,e,{y:n}){t.call(_o,e,{y:n},0,Lo)}_x1({x:t},{x:e},{marginLeft:n}){const{insetLeft:r}=this;return e&&t?t=>e[t]+r:n+r}_x2({x:t},{x:e},{width:n,marginRight:r}){const{insetRight:o}=this;return e&&t?n=>e[n]+t.bandwidth()-o:n-r-o}_y1(t,{y:e}){return t=>e[t]}_y2(t,{y:e}){return t=>e[t]}}function au(t,{x:e=Q,...n}={}){return new ou(t,{...n,x:e})}function lu(t,{y:e=Q,...n}={}){return new iu(t,{...n,y:e})}function su(t){const e=cu(t),n=uu(t);return t.map((t=>t<e||t>n?t:NaN))}function cu(t){const n=2.5*fu(t)-1.5*hu(t);return e.min(t,(t=>t>=n?t:NaN))}function uu(t){const n=2.5*hu(t)-1.5*fu(t);return e.max(t,(t=>t<=n?t:NaN))}function fu(t){return e.quantile(t,.25)}function hu(t){return e.quantile(t,.75)}const du={ariaLabel:"raster",stroke:null,pixelSize:1};function pu(t,e){const n=+t;if(isNaN(n))throw new Error(`invalid ${e}: ${t}`);return n}function mu(t,e){const n=Math.floor(t);if(isNaN(n))throw new Error(`invalid ${e}: ${t}`);return n}class yu extends Qo{constructor(t,e,n={},r){let{width:o,height:i,x:a,y:l,x1:s=(null==a?0:void 0),y1:c=(null==l?0:void 0),x2:u=(null==a?o:void 0),y2:f=(null==l?i:void 0),pixelSize:h=r.pixelSize,blur:d=0,interpolate:p}=n;if(null!=o&&(o=mu(o,"width")),null!=i&&(i=mu(i,"height")),null!=s&&(s=pu(s,"x1")),null!=c&&(c=pu(c,"y1")),null!=u&&(u=pu(u,"x2")),null!=f&&(f=pu(f,"y2")),null==a&&(null==s||null==u))throw new Error("missing x");if(null==l&&(null==c||null==f))throw new Error("missing y");null!=t&&null!=o&&null!=i&&(void 0===a&&null!=s&&null!=u&&(a=function(t,e,n){return{transform(r){const o=r.length,i=new Float64Array(o),a=(e-t)/n,l=t+a/2;for(let t=0;t<o;++t)i[t]=t%n*a+l;return i}}}(s,u,o)),void 0===l&&null!=c&&null!=f&&(l=function(t,e,n,r){return{transform(o){const i=o.length,a=new Float64Array(i),l=(e-t)/r,s=t+l/2;for(let t=0;t<i;++t)a[t]=Math.floor(t/n)%r*l+s;return a}}}(c,f,o,i))),super(t,{x:{value:a,scale:"x",optional:!0},y:{value:l,scale:"y",optional:!0},x1:{value:null==s?null:[s],scale:"x",optional:!0,filter:null},y1:{value:null==c?null:[c],scale:"y",optional:!0,filter:null},x2:{value:null==u?null:[u],scale:"x",optional:!0,filter:null},y2:{value:null==f?null:[f],scale:"y",optional:!0,filter:null},...e},n,r),this.width=o,this.height=i,this.pixelSize=pu(h,"pixelSize"),this.blur=pu(d,"blur"),this.interpolate=null==a||null==l?null:function(t){if("function"==typeof t)return t;if(null==t)return ku;switch(`${t}`.toLowerCase()){case"none":return ku;case"nearest":return Lu;case"barycentric":return $u();case"random-walk":return Su()}throw new Error(`invalid interpolate: ${t}`)}(p)}}class gu extends yu{constructor(t,e={}){const{imageRendering:n}=e;if(null==t){const{fill:t,fillOpacity:n}=e;void 0!==dt(n)[0]&&(e=bu("fillOpacity",e)),void 0!==ht(t)[0]&&(e=bu("fill",e))}super(t,void 0,e,du),this.imageRendering=Go(n,"auto")}scale(t,{color:e,...n},r){return super.scale(t,n,r)}render(t,n,r,o,i){const a=n[r.channels.fill?.scale]??(t=>t),{x:l,y:s}=r,{document:c}=i,[u,f,h,d]=xu(r,o,i),p=h-u,m=d-f,{pixelSize:y,width:g=Math.round(Math.abs(p)/y),height:v=Math.round(Math.abs(m)/y)}=this,x=g*v;let{fill:w,fillOpacity:b}=r,k=0;if(this.interpolate){const e=g/p,n=v/m,r=vt(l,(t=>(t-u)*e),Float64Array),o=vt(s,(t=>(t-f)*n),Float64Array);w&&(w=this.interpolate(t,g,v,r,o,w)),b&&(b=this.interpolate(t,g,v,r,o,b))}else null==this.data&&t&&(k=t.fi*x);const $=c.createElement("canvas");$.width=g,$.height=v;const M=$.getContext("2d"),A=M.createImageData(g,v),L=A.data;let{r:S,g:z,b:O}=e.rgb(this.fill)??{r:0,g:0,b:0},E=255*(this.fillOpacity??1);for(let t=0;t<x;++t){const n=t<<2;if(w){const r=a(w[t+k]);if(null==r){L[n+3]=0;continue}({r:S,g:z,b:O}=e.rgb(r))}b&&(E=255*b[t+k]),L[n+0]=S,L[n+1]=z,L[n+2]=O,L[n+3]=E}return this.blur>0&&e.blurImage(A,this.blur),M.putImageData(A,0,0),mo("svg:g",i).call(Fo,this,o,i).call(_o,this,n).call((t=>t.append("image").attr("transform",`translate(${u},${f}) scale(${Math.sign(h-u)},${Math.sign(d-f)})`).attr("width",Math.abs(p)).attr("height",Math.abs(m)).attr("preserveAspectRatio","none").call(Yo,"image-rendering",this.imageRendering).call(qo,this).attr("xlink:href",$.toDataURL()))).node()}}function vu(t,e,n){arguments.length<3&&(n=e,e=null);let{x:r,y:o,[t]:i,...a}=n;return void 0===r&&void 0===o&&function(t){if(!Ht(t))return!1;for(const e of t)if(null!=e)return"object"==typeof e&&"0"in e&&"1"in e}(e)&&(r=nt,o=rt,void 0===i&&(i=ot)),[e,{...a,x:r,y:o,[t]:i}]}function xu({x1:t,y1:e,x2:n,y2:r},o,{projection:i}){const{width:a,height:l,marginTop:s,marginRight:c,marginBottom:u,marginLeft:f}=o;return[t&&null==i?t[0]:f,e&&null==i?e[0]:s,n&&null==i?n[0]:a-c,r&&null==i?r[0]:l-u]}function wu({x1:t,y1:e,x2:n,y2:r},o,i,a){const l={};return t&&(l.x1=t),e&&(l.y1=e),n&&(l.x2=n),r&&(l.y2=r),xu(wn(l,o),i,a)}function bu(t,e={}){const{[t]:n}=e;if("function"!=typeof n)throw new Error(`invalid ${t}: not a function`);return Oe({...e,[t]:void 0},(function(r,o,i,a,l,s){const{x:c,y:u}=a;if(!c)throw new Error("missing scale: x");if(!u)throw new Error("missing scale: y");const[f,h,d,p]=wu(i,a,l,s),m=d-f,y=p-h,{pixelSize:g}=this,{width:v=Math.round(Math.abs(m)/g),height:x=Math.round(Math.abs(y)/g)}=e,w=new Array(v*x*(o?o.length:1)),b=m/v,k=y/x;let $=0;for(const t of o??[void 0])for(let e=.5;e<x;++e)for(let r=.5;r<v;++r,++$)w[$]=n(c.invert(f+r*b),u.invert(h+e*k),t);return{data:w,facets:o,channels:{[t]:{value:w,scale:"auto"}}}}))}function ku(t,e,n,r,o,i){const a=new Array(e*n);for(const l of t)r[l]<0||r[l]>=e||o[l]<0||o[l]>=n||(a[Math.floor(o[l])*e+Math.floor(r[l])]=i[l]);return a}function $u({random:t=e.randomLcg(42)}={}){return(n,r,o,i,a,l)=>{const{points:s,triangles:c,hull:u}=e.Delaunay.from(n,(t=>i[t]),(t=>a[t])),f=new l.constructor(r*o).fill(NaN),h=new Uint8Array(r*o),d=function(t,e){return te(t)||Qt(t)?zu:function(t){return(e,n,r,o,i,a,l,s)=>{const c=t(l,s);return c<n?e:c<n+o?r:i}}(e)}(l,t);for(let t=0;t<c.length;t+=3){const e=c[t],i=c[t+1],a=c[t+2],u=s[2*e],p=s[2*i],m=s[2*a],y=s[2*e+1],g=s[2*i+1],v=s[2*a+1],x=Math.min(u,p,m),w=Math.max(u,p,m),b=Math.min(y,g,v),k=Math.max(y,g,v),$=(g-v)*(u-m)+(y-v)*(m-p);if(!$)continue;const M=l[n[e]],A=l[n[i]],L=l[n[a]];for(let t=Math.floor(x);t<w;++t)for(let e=Math.floor(b);e<k;++e){if(t<0||t>=r||e<0||e>=o)continue;const n=t+.5,i=e+.5,a=Math.sign($),l=(g-v)*(n-m)+(i-v)*(m-p);if(l*a<0)continue;const s=(v-y)*(n-m)+(i-v)*(u-m);if(s*a<0)continue;const c=$-(l+s);if(c*a<0)continue;const x=t+r*e;f[x]=d(M,l/$,A,s/$,L,c/$,t,e),h[x]=1}}return function(t,e,n,r,o,i,a,l,s,c){n=Float64Array.from(l,(t=>n[s[t]])),r=Float64Array.from(l,(t=>r[s[t]])),o=Array.from(l,(t=>o[s[t]]));const u=n.length,f=Array.from({length:u},((t,e)=>function(t,e,n){const r=e.length,o=e.at(t-2),i=n.at(t-2),a=e.at(t-1),l=n.at(t-1),s=e[t],c=n[t],u=e.at(t+1-r),f=n.at(t+1-r),h=a-s,d=l-c,p=o-a,m=i-l,y=s-u,g=c-f,v=Math.hypot(h,d),x=Math.hypot(p,m),w=Math.hypot(y,g);return(t,e)=>{const n=t-a,r=e-l,o=t-s,i=e-c;return Au(n,r,o,i)>-1e-6&&Au(n,r,h,d)*x-Au(n,r,p,m)*v>-1e-6&&Au(o,i,y,g)*v-Au(o,i,h,d)*w<=0}}(e,n,r)));let h=0;for(let l=0;l<a;++l){const a=l+.5;for(let s=0;s<i;++s){const d=s+i*l;if(!e[d]){const e=s+.5;for(let i=0;i<u;++i){const p=(u+h+(i%2?(i+1)/2:-i/2))%u;if(f[p](e,a)){const i=Mu(n.at(p-1),r.at(p-1),n[p],r[p],e,a);t[d]=c(o.at(p-1),i,o[p],1-i,o[p],0,s,l),h=p;break}}}}}}(f,h,i,a,l,r,o,u,n,d),f}}function Mu(t,e,n,r,o,i){const a=n-t,l=r-e,s=a*(n-o)+l*(r-i),c=a*(o-t)+l*(i-e);return s>0&&c>0?s/(s+c):+(s>c)}function Au(t,e,n,r){return t*r-n*e}function Lu(t,n,r,o,i,a){const l=new a.constructor(n*r),s=e.Delaunay.from(t,(t=>o[t]),(t=>i[t]));let c,u;for(let e=.5,o=0;e<r;++e){u=c;for(let r=.5;r<n;++r,++o)u=s.find(r,e,u),.5===r&&(c=u),l[o]=a[t[u]]}return l}function Su({random:t=e.randomLcg(42),minDistance:n=.5,maxSteps:r=2}={}){return(o,i,a,l,s,c)=>{const u=new c.constructor(i*a),f=e.Delaunay.from(o,(t=>l[t]),(t=>s[t]));let h,d,p;for(let e=.5,m=0;e<a;++e){d=h;for(let a=.5;a<i;++a,++m){let i,y=a,g=e;p=d=f.find(y,g,d),.5===a&&(h=d);let v=0;for(;(i=Math.hypot(l[o[p]]-y,s[o[p]]-g))>n&&v<r;){const n=2*t(a,e,v)*Math.PI;y+=Math.cos(n)*i,g+=Math.sin(n)*i,p=f.find(y,g,p),++v}u[m]=c[o[p]]}}return u}}function zu(t,e,n,r,o,i){return e*t+r*n+i*o}const Ou={ariaLabel:"contour",fill:"none",stroke:"currentColor",strokeMiterlimit:1,pixelSize:2};class Eu extends yu{constructor(t,{smooth:n=!0,value:r,...o}={}){const i=Eo({},o,Ou);if(void 0===r)for(const t in i)if(null!=i[t].value){if(void 0!==r)throw new Error("ambiguous contour value");r=o[t],o[t]="value"}if(null!=r){const t={transform:t=>t.map((t=>t.value)),label:jt(r)};for(const e in i)"value"===o[e]&&(o[e]=t)}if(null==t){if(null==r)throw new Error("missing contour value");o=bu("value",{value:r,...o}),r=null}else{let{interpolate:t}=o;void 0===r&&(r=Q),void 0===t&&(o.interpolate="nearest")}super(t,{value:{value:r,optional:!0}},function({thresholds:t,interval:n,...r}){return t=Ns(t,n,e.thresholdSturges),Oe(r,(function(n,r,o,i,a,l){const[s,c,u,f]=wu(o,i,a,l),h=u-s,d=f-c,{pixelSize:p,width:m=Math.round(Math.abs(h)/p),height:y=Math.round(Math.abs(d)/p)}=this,g=m/h,v=y/d,x=o.value.value,w=[];if(this.interpolate){const{x:t,y:e}=fo(o,i,l),n=vt(t,(t=>(t-s)*g),Float64Array),a=vt(e,(t=>(t-c)*v),Float64Array),u=[o.x,o.y,o.value],f=[n,a,x];for(const t of r){const e=this.filter(t,u,f);w.push(this.interpolate(e,m,y,n,a,x))}}else if(r){const t=m*y,e=r.length;for(let n=0;n<e;++n)w.push(x.slice(n*t,n*t+t))}else w.push(x);if(this.blur>0)for(const t of w)e.blur2({data:t,width:m,height:y},this.blur);const b=function(t,n,r,o){if("function"==typeof t?.range)return t.range(t.floor(r),o);"function"==typeof t&&(t=t(n,r,o));if("number"!=typeof t)return gt(t);const i=e.ticks(...e.nice(r,o,t),t);for(;i[i.length-1]>=o;)i.pop();for(;i[1]<r;)i.shift();return i}(t,x,...function(t){return[e.min(t,(t=>e.min(t,Ru))),e.max(t,(t=>e.max(t,Ru)))]}(w));if(null===b)throw new Error(`unsupported thresholds: ${t}`);const{contour:k}=e.contours().size([m,y]).smooth(this.smooth),$=[],M=[];for(const t of w)M.push(e.range($.length,$.push(...vt(b,(e=>k(t,e))))));for(const{coordinates:t}of $)for(const e of t)for(const t of e)for(const e of t)e[0]=e[0]/g+s,e[1]=e[1]/v+c;return{data:$,facets:M,channels:xn(this.contourChannels,$)}}))}(o),Ou);const a={geometry:{value:Q}};for(const t in this.channels){const e=this.channels[t],{scale:n}=e;"x"!==n&&"y"!==n&&"value"!==t&&(a[t]=e,delete this.channels[t])}this.contourChannels=a,this.smooth=!!n}filter(t,{x:e,y:n,value:r,...o},i){return super.filter(t,o,i)}render(t,n,r,o,i){const{geometry:a}=r,l=e.geoPath();return mo("svg:g",i).call(Fo,this,o,i).call(_o,this,n).call((e=>{e.selectAll().data(t).enter().append("path").call(qo,this).attr("d",(t=>l(a[t]))).call(No,this,r)})).node()}}function Ru(t){return isFinite(t)?t:NaN}function Cu(t,e,n={}){const{x:r,y:o,maxRadius:i}=n,a=t({px:r,py:o,maxRadius:i}),l=[];null!=r&&l.push(qi(e,Bu("x",{...a,inset:-6},n))),null!=o&&l.push(Di(e,Bu("y",{...a,inset:-6},n))),null!=r&&l.push(Zi(e,Iu("x",{...a,dy:9,frameAnchor:"bottom",lineAnchor:"top"},n))),null!=o&&l.push(Zi(e,Iu("y",{...a,dx:-9,frameAnchor:"left",textAnchor:"end"},n)));for(const t of l)t.ariaLabel=`crosshair ${t.ariaLabel}`;return Jo(...l)}function Nu(t,{channels:e,...n},{facet:r,facetAnchor:o,fx:i,fy:a,[t]:l,channels:s,transform:c,initializer:u}){return{...n,facet:r,facetAnchor:o,fx:i,fy:a,[t]:l,channels:{...e,...s},transform:c,initializer:Tu(t,u)}}function Tu(t,e){return null==e?e:function(n,r,{x:o,y:i,px:a,py:l,...s},...c){const{channels:{x:u,y:f,...h}={},...d}=e.call(this,n,r,{...s,x:a,y:l},...c);return{channels:{...h,...u&&{px:u,..."x"===t&&{x:u}},...f&&{py:f,..."y"===t&&{y:f}}},...d}}}function Bu(t,e,n){const{color:r="currentColor",opacity:o=.2,ruleStroke:i=r,ruleStrokeOpacity:a=o,ruleStrokeWidth:l}=n;return{...Nu(t,e,n),stroke:i,strokeOpacity:a,strokeWidth:l}}function Iu(t,e,n){const{color:r="currentColor",textFill:o=r,textFillOpacity:i,textStroke:a="var(--plot-background)",textStrokeOpacity:l,textStrokeWidth:s=5}=n;return{...Nu(t,e,Pu(t,n)),fill:o,fillOpacity:i,stroke:a,strokeOpacity:l,strokeWidth:s}}function Pu(t,e){return Oe(e,((e,n,r)=>({channels:{text:{value:On(r,t)?.value}}})))}const Wu={ariaLabel:"delaunay link",fill:"none",stroke:"currentColor",strokeMiterlimit:1},ju={ariaLabel:"delaunay mesh",fill:null,stroke:"currentColor",strokeOpacity:.2},Fu={ariaLabel:"hull",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeMiterlimit:1},qu={ariaLabel:"voronoi",fill:"none",stroke:"currentColor",strokeMiterlimit:1},Du={ariaLabel:"voronoi mesh",fill:null,stroke:"currentColor",strokeOpacity:.2};class Yu extends Qo{constructor(t,e={}){const{x:n,y:r,z:o,curve:i,tension:a}=e;super(t,{x:{value:n,scale:"x",optional:!0},y:{value:r,scale:"y",optional:!0},z:{value:o,optional:!0}},e,Wu),this.curve=ws(i,a),di(this,e)}render(t,n,r,o,i){const{x:a,y:l}=n,{x:s,y:c,z:u}=r,{curve:f}=this,[h,d]=Zo(this,o),p=s?t=>s[t]:at(h),m=c?t=>c[t]:at(d),y=this;function g(t){let n=-1;const o=[],a={};for(const t in r)a[t]=[];const l=[],s=[],c=[],u=[];function h(e,i){e=t[e],i=t[i],o.push(++n),l[n]=p(e),c[n]=m(e),s[n]=p(i),u[n]=m(i);for(const t in r)a[t].push(r[t][i])}const{halfedges:d,hull:g,triangles:v}=e.Delaunay.from(t,p,m);for(let t=0;t<d.length;++t){const e=d[t];e>t&&h(v[t],v[e])}for(let t=0;t<g.length;++t)h(g[t],g[(t+1)%g.length]);e.select(this).selectAll().data(o).enter().append("path").call(qo,y).attr("d",(t=>{const n=e.pathRound(),r=f(n);return r.lineStart(),r.point(l[t],c[t]),r.point(s[t],u[t]),r.lineEnd(),n})).call(No,y,a).call(bi,y,a,i)}return mo("svg:g",i).call(Fo,this,o,i).call(_o,this,{x:s&&a,y:c&&l}).call(u?n=>n.selectAll().data(e.group(t,(t=>u[t])).values()).enter().append("g").each(g):e=>e.datum(t).each(g)).node()}}class _u extends Qo{constructor(t,e={},n,r=({z:t})=>t){const{x:o,y:i}=e;super(t,{x:{value:o,scale:"x",optional:!0},y:{value:i,scale:"y",optional:!0},z:{value:r(e),optional:!0}},e,n)}render(t,n,r,o,i){const{x:a,y:l}=n,{x:s,y:c,z:u}=r,[f,h]=Zo(this,o),d=s?t=>s[t]:at(f),p=c?t=>c[t]:at(h),m=this;function y(t){const n=e.Delaunay.from(t,d,p);e.select(this).append("path").datum(t[0]).call(qo,m).attr("d",m._render(n,o)).call(No,m,r)}return mo("svg:g",i).call(Fo,this,o,i).call(_o,this,{x:s&&a,y:c&&l}).call(u?n=>n.selectAll().data(e.group(t,(t=>u[t])).values()).enter().append("g").each(y):e=>e.datum(t).each(y)).node()}}class Gu extends _u{constructor(t,e={}){super(t,e,ju),this.fill="none"}_render(t){return t.render()}}class Xu extends _u{constructor(t,e={}){super(t,e,Fu,Ot)}_render(t){return t.renderHull()}}class Uu extends Qo{constructor(t,r={}){const{x:o,y:i,z:a}=r;super(t,{x:{value:o,scale:"x",optional:!0},y:{value:i,scale:"y",optional:!0},z:{value:a,optional:!0}},Oe(r,(function(t,r,o,i,a,l){let{x:s,y:c,z:u}=o;({x:s,y:c}=fo(o,i,l)),u=u?.value;const f=new Array((s??c).length).fill(null),[h,d]=Zo(this,a),p=s?t=>s[t]:at(h),m=c?t=>c[t]:at(d);for(let t of r){s&&(t=t.filter((t=>n(p(t))))),c&&(t=t.filter((t=>n(m(t)))));for(const[,n]of He(t,u)){const t=Vu(e.Delaunay.from(n,p,m),a);for(let e=0,r=n.length;e<r;++e)f[n[e]]=t.renderCell(e)}}return{data:t,facets:r,channels:{cells:{value:f}}}})),qu)}render(t,e,n,r,o){const{x:i,y:a}=e,{x:l,y:s,cells:c}=n;return mo("svg:g",o).call(Fo,this,r,o).call(_o,this,{x:l&&i,y:s&&a}).call((e=>{e.selectAll().data(t).enter().append("path").call(qo,this).attr("d",(t=>c[t])).call(No,this,n)})).node()}}class Hu extends _u{constructor(t,e){super(t,e,Du),this.fill="none"}_render(t,e){return Vu(t,e).render()}}function Vu(t,e){const{width:n,height:r,marginTop:o,marginRight:i,marginBottom:a,marginLeft:l}=e;return t.voronoi([l,o,n-i,r-a])}function Zu(t,e,{x:n,y:r,...o}={}){return[n,r]=zt(n,r),new t(e,{...o,x:n,y:r})}const Qu={ariaLabel:"density",fill:"none",stroke:"currentColor",strokeMiterlimit:1};class Ju extends Qo{constructor(t,{x:n,y:r,z:o,weight:i,fill:a,stroke:l,...s}={}){const c=tf(a)&&(a="currentColor",!0),u=tf(l)&&(l="currentColor",!0);super(t,{x:{value:n,scale:"x",optional:!0},y:{value:r,scale:"y",optional:!0},z:{value:Ot({z:o,fill:a,stroke:l}),optional:!0},weight:{value:i,optional:!0}},function(t,n,r){const o=100;let{bandwidth:i,thresholds:a}=t;return i=void 0===i?20:+i,a=void 0===a?20:"function"==typeof a?.[Symbol.iterator]?st(a):+a,Oe(t,(function(t,l,s,c,u,f){const h=s.weight?st(s.weight.value):null,d=s.z?.value,{z:p}=this,[m,y]=Zo(this,u),{width:g,height:v}=u,{x:x,y:w}=fo(s,c,f),b=Object.fromEntries(Object.entries(s).filter((([t])=>!Ku.has(t))).map((([t,e])=>[t,{...e,value:[]}]))),k=n&&[],$=r&&[],M=e.contourDensity().x(x?t=>x[t]:m).y(w?t=>w[t]:y).weight(h?t=>h[t]:1).size([g,v]).bandwidth(i),A=[];for(const t of l){const e=[];A.push(e);for(const n of d?Bo(t,d,p):[t]){const t=M.contours(n);e.push([n,t])}}let L=a;if(!(L instanceof W)){let t=0;for(const e of A)for(const[,n]of e){const e=n.max;e>t&&(t=e)}L=Float64Array.from({length:a-1},((e,n)=>t*o*(n+1)/a))}const S=[],z=[];for(const t of A){const e=[];S.push(e);for(const[n,r]of t)for(const t of L){e.push(z.length),z.push(r(t/o)),k&&k.push(t),$&&$.push(t);for(const t in b)b[t].value.push(s[t].value[n[0]])}}return k&&k.push(0),$&&$.push(0),{data:t,facets:S,channels:{...b,...k&&{fill:{value:k,scale:"color"}},...$&&{stroke:{value:$,scale:"color"}},contours:{value:z}}}}))}({...s,fill:a,stroke:l},c,u),Qu),c&&(this.fill=void 0),u&&(this.stroke=void 0),this.z=o}filter(t){return t}render(t,n,r,o,i){const{contours:a}=r,l=e.geoPath();return mo("svg:g",i).call(Fo,this,o,i).call(_o,this,{}).call((e=>e.selectAll().data(t).enter().append("path").call(qo,this).call(No,this,r).attr("d",(t=>l(a[t]))))).node()}}const Ku=new Set(["x","y","z","weight"]);function tf(t){return/^density$/i.test(t)}function ef(t,e,{x1:n,x2:r,y1:o,y2:i,x:a=(void 0===n&&void 0===r?"y"===t?Z:Q:void 0),y:l=(void 0===o&&void 0===i?"x"===t?Z:Q:void 0),fill:s,positiveFill:c="#3ca951",negativeFill:u="#4269d0",fillOpacity:f=1,positiveFillOpacity:h=f,negativeFillOpacity:d=f,stroke:p,strokeOpacity:m,z:y=ht(p)[0],clip:g,tip:v,render:x,...w}={}){return[n,r]=nf(a,n,r),[o,i]=nf(l,o,i),n===r&&o===i&&("y"===t?o=rf(0):n=rf(0)),({tip:v}=ei({tip:v},"y"===t?"x":"y")),Jo(ie(c)?null:Object.assign(Qs(e,{x1:n,x2:r,y1:o,y2:i,z:y,fill:c,fillOpacity:h,render:Ko(x,of(t,!0)),clip:g,...w}),{ariaLabel:"positive difference"}),ie(u)?null:Object.assign(Qs(e,{x1:n,x2:r,y1:o,y2:i,z:y,fill:u,fillOpacity:d,render:Ko(x,of(t,!1)),clip:g,...w}),{ariaLabel:"negative difference"}),$c(e,{x:r,y:i,z:y,stroke:p,strokeOpacity:m,tip:v,clip:!0,...w}))}function nf(t,e,n){return void 0===e&&void 0===n?e=n=rf(t):void 0===e?(n=rf(n),e=void 0===t?n:rf(t)):void 0===n?(e=rf(e),n=void 0===t?e:rf(t)):(e=rf(e),n=rf(n)),[e,n]}function rf(t){let e;const{value:n,label:r=jt(n)}=Ut(t);return{transform:t=>e||(e=_(t,n)),label:r}}function of(t,e){const n="x"===t?"y":"x",r=`${n}1`,o=`${n}2`,i=`${t}1`,a=`${t}2`;return(n,l,s,c,u,f)=>{const{[r]:h,[o]:d}=s,p=new Float32Array(h.length),m=new Float32Array(d.length),y=c["y"===t?"height":"width"];(e===kr(l[t])<0?p:m).fill(y);const g=f(n,l,{...s,[o]:h,[a]:m},c,u),v=f(n,l,{...s,[r]:d,[i]:p},c,u),x=g.querySelector("g")??g,w=v.querySelector("g")??v;for(let t=0;x.firstChild;t+=2){const e=Oo(),n=mo("svg:clipPath",u).attr("id",e).node();n.appendChild(x.firstChild),w.childNodes[t].setAttribute("clip-path",`url(#${e})`),w.insertBefore(n,w.childNodes[t])}return v}}function af({geometry:t=Q,...n}={}){const r=go((e=>_(e,t)));return Oe({...n,x:null,y:null,geometry:{transform:r}},((t,n,o,i,a,{projection:l})=>{const s=r(t),c=s.length,u=new Float64Array(c),f=new Float64Array(c),h=e.geoPath(l);for(let t=0;t<c;++t)[u[t],f[t]]=h.centroid(s[t]);return{data:t,facets:n,channels:{x:{value:u,scale:null==l?"x":null,source:null},y:{value:f,scale:null==l?"y":null,source:null}}}}))}const lf={ariaLabel:"geo",fill:"none",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:1};class sf extends Qo{constructor(t,e={}){const[n,r]=dt(e.r,3);super(t,{x:{value:e.tip?e.x:null,scale:"x",optional:!0},y:{value:e.tip?e.y:null,scale:"y",optional:!0},r:{value:n,scale:"r",filter:l,optional:!0},geometry:{value:e.geometry,scale:"projection"}},vc(e),lf),this.r=r}render(t,n,r,o,i){const{geometry:a,r:l}=r,c=e.geoPath(i.projection??function({x:t,y:n}){if(t||n)return t??=t=>t,n??=t=>t,e.geoTransform({point(e,r){this.stream.point(t(e),n(r))}})}(n)),{r:u}=this;return s(u)?t=[]:void 0!==u&&c.pointRadius(u),mo("svg:g",i).call(Fo,this,o,i).call(_o,this,n).call((e=>{e.selectAll().data(t).enter().append("path").call(qo,this).attr("d",l?t=>c.pointRadius(l[t])(a[t]):t=>c(a[t])).call(No,this,r)})).node()}}function cf(t,e={}){return e.tip&&void 0===e.x&&void 0===e.y?e=af(e):void 0===e.geometry&&(e={...e,geometry:Q}),new sf(t,e)}const uf=.5,ff=0;function hf(t,e,n,r,o){const i=o*(1.5/be),a=new Map;for(const l of e){let e=n[l],s=r[l];if(isNaN(e)||isNaN(s))continue;let c=Math.round(s=(s-ff)/i),u=Math.round(e=(e-uf)/o-(1&c)/2),f=s-c;if(3*Math.abs(f)>1){let t=e-u,n=u+(e<u?-1:1)/2,r=c+(s<c?-1:1),o=e-n,i=s-r;t*t+f*f>o*o+i*i&&(u=n+(1&c?1:-1)/2,c=r)}const h=`${u},${c}`;let d=a.get(h);void 0===d&&(d={index:[],extent:{data:t,x:(u+(1&c)/2)*o+uf,y:c*i+ff}},a.set(h,d)),d.index.push(l)}return a.values()}const df={ariaLabel:"hexgrid",fill:"none",stroke:"currentColor",strokeOpacity:.1};class pf extends Qo{constructor({binWidth:t=20,clip:e=!0,...n}={}){super(H,void 0,{clip:e,...n},df),this.binWidth=et(t)}render(t,e,n,r,o){const{binWidth:i}=this,{marginTop:a,marginRight:l,marginBottom:s,marginLeft:c,width:u,height:f}=r,h=c-uf,d=u-l-uf,p=a-ff,m=f-s-ff,y=i/2,g=y*ke,v=g/2,x=2*y,w=1.5*g,b=Math.floor(h/x),k=Math.ceil(d/x),$=Math.floor((p+v)/w),M=Math.ceil((m-v)/w)+1,A=`m0,${mf(-g)}l${mf(y)},${mf(v)}v${mf(g)}l${mf(-y)},${mf(v)}`;let L=A;for(let t=$;t<M;++t)for(let e=b;e<k;++e)L+=`M${mf(e*x+(1&t)*y)},${mf(t*w)}${A}`;return mo("svg:g",o).datum(0).call(Fo,this,r,o).call(_o,this,{},Lo+uf,Lo+ff).call((t=>t.append("path").call(qo,this).call(No,this,n).attr("d",L))).node()}}function mf(t){return Math.round(1e3*t)/1e3}const yf={ariaLabel:"image",fill:null,stroke:null};class gf extends Qo{constructor(t,e={}){let{x:n,y:r,r:o,width:i,height:a,rotate:s,src:c,preserveAspectRatio:u,crossOrigin:f,frameAnchor:h,imageRendering:d}=e;null==o&&(o=void 0),void 0===o&&void 0===i&&void 0===a?i=a=16:void 0===i&&void 0!==a?i=a:void 0===a&&void 0!==i&&(a=i);const[p,m]="string"==typeof(y=c)&&(function(t){return/^\.*\//.test(t)}(y)||function(t){return/^(blob|data|file|http|https):/i.test(t)}(y))?[void 0,y]:[y,void 0];var y;const[g,v]=dt(o),[x,w]=dt(i,void 0!==v?2*v:void 0),[b,k]=dt(a,void 0!==v?2*v:void 0),[$,M]=dt(s,0);super(t,{x:{value:n,scale:"x",optional:!0},y:{value:r,scale:"y",optional:!0},r:{value:g,scale:"r",filter:l,optional:!0},width:{value:x,filter:l,optional:!0},height:{value:b,filter:l,optional:!0},rotate:{value:$,optional:!0},src:{value:p,optional:!0}},vc(e),yf),this.src=m,this.width=w,this.rotate=M,this.height=k,this.r=v,this.preserveAspectRatio=Go(u,"xMidYMid"),this.crossOrigin=tt(f),this.frameAnchor=se(h),this.imageRendering=Go(d,"auto")}render(t,e,n,r,o){const{x:i,y:a}=e,{x:l,y:s,width:c,height:u,r:f,rotate:h,src:d}=n,{r:p,width:m,height:y,rotate:g}=this,[v,x]=Zo(this,r);return mo("svg:g",o).call(Fo,this,r,o).call(_o,this,{x:l&&i,y:s&&a}).call((e=>e.selectAll().data(t).enter().append("image").call(qo,this).attr("x",vf(l,c,f,v,m,p)).attr("y",vf(s,u,f,x,y,p)).attr("width",c?t=>c[t]:void 0!==m?m:f?t=>2*f[t]:2*p).attr("height",u?t=>u[t]:void 0!==y?y:f?t=>2*f[t]:2*p).attr("transform",h?t=>`rotate(${h[t]})`:g?`rotate(${g})`:null).attr("transform-origin",h||g?_i`${l?t=>l[t]:v}px ${s?t=>s[t]:x}px`:null).call(Yo,"href",d?t=>d[t]:this.src).call(Yo,"preserveAspectRatio",this.preserveAspectRatio).call(Yo,"crossorigin",this.crossOrigin).call(Yo,"image-rendering",this.imageRendering).call(Yo,"clip-path",f?t=>`circle(${f[t]}px)`:void 0!==p?`circle(${p}px)`:null).call(No,this,n))).node()}}function vf(t,e,n,r,o,i){return e&&t?n=>t[n]-e[n]/2:e?t=>r-e[t]/2:t&&void 0!==o?e=>t[e]-o/2:void 0!==o?r-o/2:n&&t?e=>t[e]-n[e]:n?t=>r-n[t]:t?e=>t[e]-i:r-i}function xf(t,e,n){var r=0===t||1===t?0:Math.exp(bf(e+n)-bf(e)-bf(n)+e*Math.log(t)+n*Math.log(1-t));return!(t<0||t>1)&&(t<(e+1)/(e+n+2)?r*wf(t,e,n)/e:1-r*wf(1-t,n,e)/n)}function wf(t,e,n){var r,o,i,a,l=1e-30,s=1,c=e+n,u=e+1,f=e-1,h=1,d=1-c*t/u;for(Math.abs(d)<l&&(d=l),a=d=1/d;s<=100&&(d=1+(o=s*(n-s)*t/((f+(r=2*s))*(e+r)))*d,Math.abs(d)<l&&(d=l),h=1+o/h,Math.abs(h)<l&&(h=l),a*=(d=1/d)*h,d=1+(o=-(e+s)*(c+s)*t/((e+r)*(u+r)))*d,Math.abs(d)<l&&(d=l),h=1+o/h,Math.abs(h)<l&&(h=l),a*=i=(d=1/d)*h,!(Math.abs(i-1)<3e-7));s++);return a}function bf(t){var e,n,r,o=0,i=[76.18009172947146,-86.5053203294167,24.01409824083091,-1.231739572450155,.001208650973866179,-5395239384953e-18],a=1.000000000190015;for(r=(n=e=t)+5.5,r-=(e+.5)*Math.log(r);o<6;o++)a+=i[o]/++n;return Math.log(2.506628274631*a/e)-r}function kf(t,e){var n=function(t,e,n){var r,o,i,a,l,s,c,u,f,h,d=e-1,p=n-1,m=0;if(t<=0)return 0;if(t>=1)return 1;for(e>=1&&n>=1?(i=t<.5?t:1-t,s=(2.30753+.27061*(a=Math.sqrt(-2*Math.log(i))))/(1+a*(.99229+.04481*a))-a,t<.5&&(s=-s),c=(s*s-3)/6,u=2/(1/(2*e-1)+1/(2*n-1)),f=s*Math.sqrt(c+u)/u-(1/(2*n-1)-1/(2*e-1))*(c+5/6-2/(3*u)),s=e/(e+n*Math.exp(2*f))):(r=Math.log(e/(e+n)),o=Math.log(n/(e+n)),s=t<(a=Math.exp(e*r)/e)/(f=a+(l=Math.exp(n*o)/n))?Math.pow(e*f*t,1/e):1-Math.pow(n*f*(1-t),1/n)),h=-bf(e)-bf(n)+bf(e+n);m<10;m++){if(0===s||1===s)return s;if((s-=a=(l=(xf(s,e,n)-t)/(a=Math.exp(d*Math.log(s)+p*Math.log(1-s)+h)))/(1-.5*Math.min(1,l*(d/s-p/(1-s)))))<=0&&(s=.5*(s+a)),s>=1&&(s=.5*(s+a+1)),Math.abs(a)<1e-8*s&&m>0)break}return s}(2*Math.min(t,1-t),.5*e,.5);return n=Math.sqrt(e*(1-n)/n),t>.5?n:-n}const $f={ariaLabel:"linear-regression",fill:"currentColor",fillOpacity:.1,stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:1};class Mf extends Qo{constructor(t,e={}){const{x:n,y:r,z:o,ci:i=.95,precision:a=4}=e;if(super(t,{x:{value:n,scale:"x"},y:{value:r,scale:"y"},z:{value:Ot(e),optional:!0}},e,$f),this.z=o,this.ci=+i,this.precision=+a,!(0<=this.ci&&this.ci<1))throw new Error(`invalid ci; not in [0, 1): ${i}`);if(!(this.precision>0))throw new Error(`invalid precision: ${a}`)}render(t,e,n,r,o){const{x:i,y:a,z:l}=n,{ci:s}=this;return mo("svg:g",o).call(Fo,this,r,o).call(_o,this,e).call((e=>e.selectAll().data(l?Bo(t,l,this.z):[t]).enter().call((t=>t.append("path").attr("fill","none").call(qo,this).call(To,this,{...n,fill:null,fillOpacity:null}).attr("d",(t=>this._renderLine(t,i,a))).call(s&&!ae(this.fill)?t=>t.select(Af).attr("stroke","none").call(qo,this).call(To,this,{...n,stroke:null,strokeOpacity:null,strokeWidth:null}).attr("d",(t=>this._renderBand(t,i,a))):()=>{}))))).node()}}function Af(){return this.parentNode.insertBefore(this.ownerDocument.createElementNS(e.namespaces.svg,"path"),this)}class Lf extends Mf{constructor(t,e){super(t,e)}_renderBand(t,n,r){const{ci:o,precision:i}=this,[a,l]=e.extent(t,(t=>r[t])),s=zf(t,r,n),c=Of(t,r,n,(1-o)/2,s);return e.area().y((t=>t)).x0((t=>c(t,-1))).x1((t=>c(t,1)))(e.range(a,l-i/2,i).concat(l))}_renderLine(t,n,r){const[o,i]=e.extent(t,(t=>r[t])),a=zf(t,r,n);return`M${a(o)},${o}L${a(i)},${i}`}}class Sf extends Mf{constructor(t,e){super(t,e)}_renderBand(t,n,r){const{ci:o,precision:i}=this,[a,l]=e.extent(t,(t=>n[t])),s=zf(t,n,r),c=Of(t,n,r,(1-o)/2,s);return e.area().x((t=>t)).y0((t=>c(t,-1))).y1((t=>c(t,1)))(e.range(a,l-i/2,i).concat(l))}_renderLine(t,n,r){const[o,i]=e.extent(t,(t=>n[t])),a=zf(t,n,r);return`M${o},${a(o)}L${i},${a(i)}`}}function zf(t,e,n){let r=0,o=0,i=0,a=0;for(const l of t){const t=e[l],s=n[l];r+=t,o+=s,i+=t*s,a+=t*t}const l=t.length,s=(l*i-r*o)/(l*a-r*r),c=(o-s*r)/l;return t=>s*t+c}function Of(t,n,r,o,i){const a=e.sum(t,(t=>n[t]))/t.length;let l=0,s=0;for(const e of t)l+=(n[e]-a)**2,s+=(r[e]-i(n[e]))**2;const c=Math.sqrt(s/(t.length-2)),u=kf(o,t.length-2);return(e,n)=>{const r=i(e),o=c*Math.sqrt(1/t.length+(e-a)**2/l);return r+n*u*o}}function Ef({path:t=Q,delimiter:n,frameAnchor:r,treeLayout:o=e.tree,treeSort:i,treeSeparation:a,treeAnchor:l,treeFilter:s,...c}={}){l=Cf(l),i=Bf(i),null!=s&&(s=qf(s)),void 0===r&&(r=l.frameAnchor);const u=Pf(n),f=th(c,qf),[h,d]=Pt(),[p,m]=Pt();return{x:h,y:p,frameAnchor:r,...ze(c,((n,r)=>{const c=u(_(n,t)),h=d([]),p=m([]);let y=-1;const g=[],v=[],x=e.stratify().path((t=>c[t])),w=F(n)?t=>t.data=n[t.data]:t=>t.data=n.get(t.data),b=o();b.nodeSize&&b.nodeSize([1,1]),b.separation&&void 0!==a&&b.separation(a??J);for(const t of f)t[Kf]=t[Qf]([]);for(const t of r){const e=[],n=x(t.filter((t=>null!=c[t]))).each(w);null!=i&&n.sort(i),b(n);for(const t of n.descendants())if(null==s||s(t)){e.push(++y),g[y]=t.data,l.position(t,y,h,p);for(const e of f)e[Kf][y]=e[Jf](t)}v.push(e)}return{data:g,facets:v}})),...Object.fromEntries(f)}}function Rf({path:t=Q,delimiter:n,curve:r="bump-x",stroke:o="#555",strokeWidth:i=1.5,strokeOpacity:a=.5,treeLayout:l=e.tree,treeSort:s,treeSeparation:c,treeAnchor:u,treeFilter:f,...h}={}){u=Cf(u),s=Bf(s),null!=f&&(f=Df(f)),h={curve:r,stroke:o,strokeWidth:i,strokeOpacity:a,...h};const d=Pf(n),p=th(h,Df),[m,y]=Pt(),[g,v]=Pt(),[x,w]=Pt(),[b,k]=Pt();return{x1:m,x2:g,y1:x,y2:b,...ze(h,((n,r)=>{const o=d(_(n,t)),i=y([]),a=v([]),h=w([]),m=k([]);let g=-1;const x=[],b=[],$=e.stratify().path((t=>o[t])),M=l();M.nodeSize&&M.nodeSize([1,1]),M.separation&&void 0!==c&&M.separation(c??J);for(const t of p)t[Kf]=t[Qf]([]);for(const t of r){const e=[],r=$(t.filter((t=>null!=o[t]))).each((t=>t.data=n[t.data]));null!=s&&r.sort(s),M(r);for(const{source:t,target:n}of r.links())if(null==f||f(n,t)){e.push(++g),x[g]=n.data,u.position(t,g,i,h),u.position(n,g,a,m);for(const e of p)e[Kf][g]=e[Jf](n,t)}b.push(e)}return{data:x,facets:b}})),...Object.fromEntries(p)}}function Cf(t="left"){switch(`${t}`.trim().toLowerCase()){case"left":return Nf;case"right":return Tf}throw new Error(`invalid tree anchor: ${t}`)}const Nf={frameAnchor:"left",dx:6,position({x:t,y:e},n,r,o){r[n]=e,o[n]=-t}},Tf={frameAnchor:"right",dx:-6,position({x:t,y:e},n,r,o){r[n]=-e,o[n]=-t}};function Bf(t){return null==t||"function"==typeof t?t:`${t}`.trim().toLowerCase().startsWith("node:")?If(qf(t)):If(function(t){return e=>e.data?.[t]}(t))}function If(t){return(e,n)=>r(t(e),t(n))}function Pf(t="/"){if("/"===(t=`${t}`))return t=>t;if(1!==t.length)throw new Error("delimiter must be exactly one character");const e=t.charCodeAt(0);return t=>t.map((t=>function(t,e){if(e===Wf)throw new Error("delimiter cannot be backslash");let n=!1;for(let r=0,o=t.length;r<o;++r){switch(t.charCodeAt(r)){case Wf:if(!n){n=!0;continue}break;case e:n?(t=t.slice(0,r-1)+t.slice(r),--r,--o):t=t.slice(0,r)+"/"+t.slice(r+1);break;case jf:n?(t=t.slice(0,r)+"\\\\"+t.slice(r),r+=2,o+=2):(t=t.slice(0,r)+"\\"+t.slice(r),++r,++o)}n=!1}return t}(t,e)))}const Wf=92,jf=47;function Ff(t){return $t(t)&&"function"==typeof t.node}function qf(t){if(Ff(t))return t.node;if((t=`${t}`.trim().toLowerCase()).startsWith("node:")){switch(t){case"node:name":return _f;case"node:path":return Yf;case"node:internal":return Uf;case"node:external":return Hf;case"node:depth":return Gf;case"node:height":return Xf}throw new Error(`invalid node value: ${t}`)}}function Df(t){if(Ff(t))return t.node;if($t(e=t)&&"function"==typeof e.link)return t.link;var e;if((t=`${t}`.trim().toLowerCase()).startsWith("node:")||t.startsWith("parent:")){switch(t){case"parent:name":return Vf(_f);case"parent:path":return Vf(Yf);case"parent:depth":return Vf(Gf);case"parent:height":return Vf(Xf);case"node:name":return _f;case"node:path":return Yf;case"node:internal":return Uf;case"node:external":return Hf;case"node:depth":return Gf;case"node:height":return Xf}throw new Error(`invalid link value: ${t}`)}}function Yf(t){return t.id}function _f(t){return function(t){let e=t.length;for(;--e>0&&!Zf(t,e););return function(t){let e=!1;for(let n=0,r=t.length;n<r;++n){switch(t.charCodeAt(n)){case Wf:if(!e){e=!0;continue}case jf:e&&(t=t.slice(0,n-1)+t.slice(n),--n,--r)}e=!1}return t}(t.slice(e+1))}(t.id)}function Gf(t){return t.depth}function Xf(t){return t.height}function Uf(t){return!!t.children}function Hf(t){return!t.children}function Vf(t){return(e,n)=>null==n?void 0:t(n)}function Zf(t,e){if("/"===t[e]){let n=0;for(;e>0&&"\\"===t[--e];)++n;if(!(1&n))return!0}return!1}const Qf=2,Jf=3,Kf=4;function th(t,e){const n=[];for(const r in t){const o=t[r],i=e(o);void 0!==i&&n.push([r,...Pt(o),i])}return n}function eh(t,{fill:n,stroke:r,strokeWidth:o,strokeOpacity:i,strokeLinejoin:a,strokeLinecap:l,strokeMiterlimit:s,strokeDasharray:c,strokeDashoffset:u,marker:f,markerStart:h=f,markerEnd:d=f,dot:p=ie(h)&&ie(d),text:m="node:name",textStroke:y="var(--plot-background)",title:g="node:path",dx:v,dy:x,textAnchor:w,treeLayout:b=e.tree,textLayout:k=(b===e.tree||b===e.cluster?"mirrored":"normal"),tip:$,...M}={}){if(void 0===v&&(v=Cf(M.treeAnchor).dx),void 0!==w)throw new Error("textAnchor is not a configurable tree option");function A(e){return Zi(t,Ef({treeLayout:b,text:m,fill:void 0===n?"currentColor":n,stroke:y,dx:v,dy:x,title:g,...e,...M}))}return k=mt(k,"textLayout",["mirrored","normal"]),Jo(nc(t,Rf({treeLayout:b,markerStart:h,markerEnd:d,stroke:void 0!==r?r:void 0===n?"node:internal":n,strokeWidth:o,strokeOpacity:i,strokeLinejoin:a,strokeLinecap:l,strokeMiterlimit:s,strokeDasharray:c,strokeDashoffset:u,...M})),p?wc(t,Ef({treeLayout:b,fill:void 0===n?"node:internal":n,title:g,tip:$,...M})):null,null!=m?"mirrored"===k?[A({textAnchor:"start",treeFilter:"node:external"}),A({textAnchor:"end",treeFilter:"node:internal",dx:-v})]:A():null)}const nh={ariaLabel:"waffle"};class rh extends uc{constructor(t,{unit:e=1,gap:n=1,round:r,render:o,multiple:i,...a}={}){super(t,{...a,render:Ko(o,ih("x"))},nh),this.unit=Math.max(0,e),this.gap=+n,this.round=lh(r),this.multiple=sh(i)}}class oh extends fc{constructor(t,{unit:e=1,gap:n=1,round:r,render:o,multiple:i,...a}={}){super(t,{...a,render:Ko(o,ih("y"))},nh),this.unit=Math.max(0,e),this.gap=+n,this.round=lh(r),this.multiple=sh(i)}}function ih(t){return function(n,r,o,i,a){const{unit:l,gap:s,rx:c,ry:u,round:f}=this,{document:h}=a,d=o.channels[`${t}1`].value,p=o.channels[`${t}2`].value,m=this["y"===t?"_width":"_height"](r,o,i),y=this["y"===t?"_x":"_y"](r,o,i),g=l*function({domain:t,range:e}){return ch(e)/ch(t)}(r.scales[t]),{multiple:v=Math.max(1,Math.floor(Math.sqrt(m/g)))}=this,x=Math.min(m/v,g*v),w=g*v,b="y"===t?([t,e])=>[t*x,-e*w]:([t,e])=>[e*w,t*x],k=(m-v*x)/2,$="function"==typeof y?t=>y(t)+k:y+k,M=r[t](0),A="plot-pattern-"+ ++zo,L=h.createElementNS(e.namespaces.svg,"pattern");L.setAttribute("width","y"===t?x:w),L.setAttribute("height","y"===t?w:x),L.setAttribute("patternUnits","userSpaceOnUse");const S=L.appendChild(h.createElementNS(e.namespaces.svg,"rect"));return S.setAttribute("x",s/2),S.setAttribute("y",s/2),S.setAttribute("width",("y"===t?x:w)-s),S.setAttribute("height",("y"===t?w:x)-s),null!=c&&S.setAttribute("rx",c),null!=u&&S.setAttribute("ry",u),mo("svg:g",a).call(Fo,this,i,a).call(this._transform,this,r).call((t=>t.selectAll().data(n).enter().append((()=>L.cloneNode(!0))).attr("id",(t=>`${A}-${t}`)).select("rect").call(qo,this).call(No,this,o))).call((e=>e.selectAll().data(n).enter().append("path").attr("transform","y"===t?_i`translate(${$},${M})`:_i`translate(${M},${$})`).attr("d",(t=>`M${ah(f(d[t]/l),f(p[t]/l),v).map(b).join("L")}Z`)).attr("fill",(t=>`url(#${A}-${t})`)).attr("stroke",null==this.stroke?null:t=>`url(#${A}-${t})`))).node()}}function ah(t,e,n){if(t<0||e<0){const r=Math.ceil(-Math.min(t,e)/n);return ah(t+r*n,e+r*n,n).map((([t,e])=>[t,e-r]))}return e<t?ah(e,t,n):[[0,Math.ceil(t/n)],[Math.floor(t%n),Math.ceil(t/n)],[Math.floor(t%n),Math.floor(t/n)+t%1],[Math.ceil(t%n),Math.floor(t/n)+t%1],...t%n>n-1?[]:[[Math.ceil(t%n),Math.floor(t/n)],[n,Math.floor(t/n)]],[n,Math.floor(e/n)],[Math.ceil(e%n),Math.floor(e/n)],[Math.ceil(e%n),Math.floor(e/n)+e%1],[Math.floor(e%n),Math.floor(e/n)+e%1],...e%n<1?[]:[[Math.floor(e%n),Math.ceil(e/n)],[0,Math.ceil(e/n)]]]}function lh(t){if(void 0===t||!1===t)return Number;if(!0===t)return Math.round;if("function"!=typeof t)throw new Error(`invalid round: ${t}`);return t}function sh(t){return void 0===t?void 0:Math.max(1,Math.floor(t))}function ch(t){const[n,r]=e.extent(t);return r-n}function uh(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function fh(t,e,n,r,o){for(var i=o+1;r<=o;){var a=r+o>>>1,l=t[a];(void 0!==n?n(l,e):l-e)>=0?(i=a,o=a-1):r=a+1}return i}function hh(t,e,n,r,o){for(var i=o+1;r<=o;){var a=r+o>>>1,l=t[a];(void 0!==n?n(l,e):l-e)>0?(i=a,o=a-1):r=a+1}return i}function dh(t,e,n,r,o){for(var i=r-1;r<=o;){var a=r+o>>>1,l=t[a];(void 0!==n?n(l,e):l-e)<0?(i=a,r=a+1):o=a-1}return i}function ph(t,e,n,r,o){for(var i=r-1;r<=o;){var a=r+o>>>1,l=t[a];(void 0!==n?n(l,e):l-e)<=0?(i=a,r=a+1):o=a-1}return i}function mh(t,e,n,r,o){for(;r<=o;){var i=r+o>>>1,a=t[i],l=void 0!==n?n(a,e):a-e;if(0===l)return i;l<=0?r=i+1:o=i-1}return-1}function yh(t,e,n,r,o,i){return"function"==typeof n?i(t,e,n,void 0===r?0:0|r,void 0===o?t.length-1:0|o):i(t,e,void 0,void 0===n?0:0|n,void 0===r?t.length-1:0|r)}var gh={ge:function(t,e,n,r,o){return yh(t,e,n,r,o,fh)},gt:function(t,e,n,r,o){return yh(t,e,n,r,o,hh)},lt:function(t,e,n,r,o){return yh(t,e,n,r,o,dh)},le:function(t,e,n,r,o){return yh(t,e,n,r,o,ph)},eq:function(t,e,n,r,o){return yh(t,e,n,r,o,mh)}},vh=function(t){if(!t||0===t.length)return new Ch(null);return new Ch(Rh(t))};function xh(t,e,n,r,o){this.mid=t,this.left=e,this.right=n,this.leftPoints=r,this.rightPoints=o,this.count=(e?e.count:0)+(n?n.count:0)+r.length}var wh=xh.prototype;function bh(t,e){t.mid=e.mid,t.left=e.left,t.right=e.right,t.leftPoints=e.leftPoints,t.rightPoints=e.rightPoints,t.count=e.count}function kh(t,e){var n=Rh(e);t.mid=n.mid,t.left=n.left,t.right=n.right,t.leftPoints=n.leftPoints,t.rightPoints=n.rightPoints,t.count=n.count}function $h(t,e){var n=t.intervals([]);n.push(e),kh(t,n)}function Mh(t,e){var n=t.intervals([]),r=n.indexOf(e);return r<0?0:(n.splice(r,1),kh(t,n),1)}function Ah(t,e,n){for(var r=0;r<t.length&&t[r][0]<=e;++r){var o=n(t[r]);if(o)return o}}function Lh(t,e,n){for(var r=t.length-1;r>=0&&t[r][1]>=e;--r){var o=n(t[r]);if(o)return o}}function Sh(t,e){for(var n=0;n<t.length;++n){var r=e(t[n]);if(r)return r}}function zh(t,e){return t-e}function Oh(t,e){var n=t[0]-e[0];return n||t[1]-e[1]}function Eh(t,e){var n=t[1]-e[1];return n||t[0]-e[0]}function Rh(t){if(0===t.length)return null;for(var e=[],n=0;n<t.length;++n)e.push(t[n][0],t[n][1]);e.sort(zh);var r=e[e.length>>1],o=[],i=[],a=[];for(n=0;n<t.length;++n){var l=t[n];l[1]<r?o.push(l):r<l[0]?i.push(l):a.push(l)}var s=a,c=a.slice();return s.sort(Oh),c.sort(Eh),new xh(r,Rh(o),Rh(i),s,c)}function Ch(t){this.root=t}wh.intervals=function(t){return t.push.apply(t,this.leftPoints),this.left&&this.left.intervals(t),this.right&&this.right.intervals(t),t},wh.insert=function(t){var e=this.count-this.leftPoints.length;if(this.count+=1,t[1]<this.mid)this.left?4*(this.left.count+1)>3*(e+1)?$h(this,t):this.left.insert(t):this.left=Rh([t]);else if(t[0]>this.mid)this.right?4*(this.right.count+1)>3*(e+1)?$h(this,t):this.right.insert(t):this.right=Rh([t]);else{var n=gh.ge(this.leftPoints,t,Oh),r=gh.ge(this.rightPoints,t,Eh);this.leftPoints.splice(n,0,t),this.rightPoints.splice(r,0,t)}},wh.remove=function(t){var e=this.count-this.leftPoints;if(t[1]<this.mid)return this.left?4*(this.right?this.right.count:0)>3*(e-1)?Mh(this,t):2===(i=this.left.remove(t))?(this.left=null,this.count-=1,1):(1===i&&(this.count-=1),i):0;if(t[0]>this.mid)return this.right?4*(this.left?this.left.count:0)>3*(e-1)?Mh(this,t):2===(i=this.right.remove(t))?(this.right=null,this.count-=1,1):(1===i&&(this.count-=1),i):0;if(1===this.count)return this.leftPoints[0]===t?2:0;if(1===this.leftPoints.length&&this.leftPoints[0]===t){if(this.left&&this.right){for(var n=this,r=this.left;r.right;)n=r,r=r.right;if(n===this)r.right=this.right;else{var o=this.left,i=this.right;n.count-=r.count,n.right=r.left,r.left=o,r.right=i}bh(this,r),this.count=(this.left?this.left.count:0)+(this.right?this.right.count:0)+this.leftPoints.length}else this.left?bh(this,this.left):bh(this,this.right);return 1}for(o=gh.ge(this.leftPoints,t,Oh);o<this.leftPoints.length&&this.leftPoints[o][0]===t[0];++o)if(this.leftPoints[o]===t){this.count-=1,this.leftPoints.splice(o,1);for(i=gh.ge(this.rightPoints,t,Eh);i<this.rightPoints.length&&this.rightPoints[i][1]===t[1];++i)if(this.rightPoints[i]===t)return this.rightPoints.splice(i,1),1}return 0},wh.queryPoint=function(t,e){if(t<this.mid){if(this.left)if(n=this.left.queryPoint(t,e))return n;return Ah(this.leftPoints,t,e)}if(t>this.mid){var n;if(this.right)if(n=this.right.queryPoint(t,e))return n;return Lh(this.rightPoints,t,e)}return Sh(this.leftPoints,e)},wh.queryInterval=function(t,e,n){var r;if(t<this.mid&&this.left&&(r=this.left.queryInterval(t,e,n)))return r;if(e>this.mid&&this.right&&(r=this.right.queryInterval(t,e,n)))return r;return e<this.mid?Ah(this.leftPoints,e,n):t>this.mid?Lh(this.rightPoints,t,n):Sh(this.leftPoints,n)};var Nh=Ch.prototype;Nh.insert=function(t){this.root?this.root.insert(t):this.root=new xh(t[0],null,null,[t],[t])},Nh.remove=function(t){if(this.root){var e=this.root.remove(t);return 2===e&&(this.root=null),0!==e}return!1},Nh.queryPoint=function(t,e){if(this.root)return this.root.queryPoint(t,e)},Nh.queryInterval=function(t,e,n){if(t<=e&&this.root)return this.root.queryInterval(t,e,n)},Object.defineProperty(Nh,"count",{get:function(){return this.root?this.root.count:0}}),Object.defineProperty(Nh,"intervals",{get:function(){return this.root?this.root.intervals([]):[]}});var Th=uh(vh);const Bh=({marginLeft:t})=>[1,t],Ih=({width:t,marginRight:e})=>[-1,t-e],Ph=({width:t,marginLeft:e,marginRight:n})=>[0,(e+t-n)/2],Wh=({marginTop:t})=>[1,t],jh=({height:t,marginBottom:e})=>[-1,t-e],Fh=({height:t,marginTop:e,marginBottom:n})=>[0,(e+t-n)/2];function qh(t){return"string"==typeof t?{anchor:t}:t}function Dh(t){const{anchor:e,padding:n,...r}=t,{r:o}=r;return[{anchor:e,padding:n,r:o},r]}function Yh(t,e,n,r,o,i){if(null!=o&&"number"!=typeof o){let{channels:t,sort:e,reverse:n}=i;t=ce(t),void 0===t?.r&&(i={...i,channels:{...t,r:{value:o,scale:"r"}}}),void 0===e&&void 0===n&&(i.sort={channel:"-r"})}return Oe(i,(function(i,s,c,u,f,h){let{[e]:d,r:p}=c;if(!c[e])throw new Error(`missing channel: ${e}`);({[e]:d}=fo(c,u,h));const m=p?void 0:void 0!==o?et(o):void 0!==this.r?this.r:3;p&&(p=_(p.value,u[p.scale]||Q,Float64Array));let[y,g]=n(f);const v=y?Gh:_h,x=new Float64Array(d.length),w=p?t=>p[t]:()=>m;for(let t of s){const e=Th();t=t.filter(p?t=>a(d[t])&&l(p[t]):t=>a(d[t]));const n=new Float64Array(2*t.length+2);for(const o of t){const t=w(o),i=y?t+r:0,a=d[o]-t,l=d[o]+t;let s=2;e.queryInterval(a-r,l+r,(([,,t])=>{const e=x[t]-i,a=d[o]-d[t],l=r+(p?p[o]+p[t]:2*m),c=Math.sqrt(l*l-a*a);n[s++]=e-c,n[s++]=e+c}));let c=n.slice(0,s);y&&(c=c.filter((t=>t>=0)));t:for(const t of c.sort(v)){for(let e=0;e<s;e+=2)if(n[e]+1e-6<t&&t<n[e+1]-1e-6)continue t;x[o]=t+i;break}e.insert([a,l,o])}}y||(y=1);for(const t of s)for(const e of t)x[e]=x[e]*y+g;return{data:i,facets:s,channels:{[t]:{value:x,source:null},[e]:{value:d,source:c[e]},...p&&{r:{value:p,source:c.r}}}}}))}function _h(t,e){return Math.abs(t)-Math.abs(e)}function Gh(t,e){return t-e}function Xh(t){if(void 0===t)return Zh;if("function"==typeof t)return Uh(Nt(t));if(/^p\d{2}$/i.test(t))return Hh(lt(t));switch(`${t}`.toLowerCase()){case"deviation":return Jh;case"first":return Zh;case"last":return Qh;case"max":return Kh;case"mean":return td;case"median":return ed;case"min":return nd;case"sum":return rd;case"extent":return Vh}throw new Error(`invalid basis: ${t}`)}function Uh(t){return{mapIndex(e,n,r){const o=+t(e,n);for(const t of e)r[t]=null===n[t]?NaN:n[t]/o}}}function Hh(t){return Uh(((e,n)=>t(e,(t=>n[t]))))}const Vh={mapIndex(t,n,r){const[o,i]=e.extent(t,(t=>n[t])),a=i-o;for(const e of t)r[e]=null===n[e]?NaN:(n[e]-o)/a}},Zh=Uh(((t,e)=>{for(let r=0;r<t.length;++r){const o=e[t[r]];if(n(o))return o}})),Qh=Uh(((t,e)=>{for(let r=t.length-1;r>=0;--r){const o=e[t[r]];if(n(o))return o}})),Jh={mapIndex(t,n,r){const o=e.mean(t,(t=>n[t])),i=e.deviation(t,(t=>n[t]));for(const e of t)r[e]=null===n[e]?NaN:i?(n[e]-o)/i:0}},Kh=Hh(e.max),td=Hh(e.mean),ed=Hh(e.median),nd=Hh(e.min),rd=Hh(e.sum);function od(t,n,r={}){let o,i=1;if("number"==typeof n)i=n,o=(t,e)=>+t+e;else{if("string"==typeof n){const t=n.startsWith("-")?-1:1;[n,i]=E(n.replace(/^[+-]/,"")),i*=t}n=Yt(n),o=(t,e)=>n.offset(t,e)}const a=`${t}1`,l=`${t}2`,s=Pc({[a]:t=>t.map((t=>o(t,i))),[l]:t=>t},r),c=s[l].transform;return s[l].transform=()=>{const t=c(),[n,r]=e.extent(t);return t.domain=i<0?[n,o(r,i)]:[o(n,i),r],t},s}function id(t){if("function"==typeof t)return t;switch(`${t}`.toLowerCase()){case"min":return ud;case"max":return fd}throw new Error(`unknown selector: ${t}`)}function ad(t){return hd(null,sd,t)}function ld(t){return hd(null,cd,t)}function*sd(t){yield t[0]}function*cd(t){yield t[t.length-1]}function*ud(t,n){yield e.least(t,(t=>n[t]))}function*fd(t,n){yield e.greatest(t,(t=>n[t]))}function hd(t,n,r){if(null!=t){if(null==r[t])throw new Error(`missing channel: ${t}`);t=r[t]}const o=Ot(r);return ze(r,((r,i)=>{const a=_(r,o),l=_(r,t),s=[];for(const t of i){const r=[];for(const o of a?e.group(t,(t=>a[t])).values():[t])for(const t of n(o,l))r.push(t);s.push(r)}return{data:r,facets:s}}))}Qo.prototype.plot=function({marks:t=[],...e}={}){return es({...e,marks:[...t,this]})},t.Area=Zs,t.Arrow=ic,t.BarX=uc,t.BarY=fc,t.Cell=mc,t.Contour=Eu,t.Density=Ju,t.Dot=xc,t.Frame=Dl,t.Geo=sf,t.Hexgrid=pf,t.Image=gf,t.Line=kc,t.Link=ec,t.Mark=Qo,t.Raster=gu,t.Rect=Rl,t.RuleX=ji,t.RuleY=Fi,t.Text=Ui,t.TickX=ou,t.TickY=iu,t.Tip=Xl,t.Vector=ka,t.WaffleX=rh,t.WaffleY=oh,t.area=Qs,t.areaX=Js,t.areaY=Ks,t.arrow=function(t,{x:e,x1:n,x2:r,y:o,y1:i,y2:a,...l}={}){return[n,r]=rc(e,n,r),[i,a]=rc(o,i,a),new ic(t,{...l,x1:n,x2:r,y1:i,y2:a})},t.auto=function(t,e){const n=Lc(t,e),{fx:r,fy:o,x:{zero:i},y:{zero:a},markOptions:l,transformOptions:s,colorMode:c}=n,u=Nc[n.markImpl],f=Nc[n.transformImpl],h=null!=r||null!=o?Yl({strokeOpacity:.1}):null,d=[i?qi([0]):null,a?Di([0]):null],p=u(t,f?f(s,l):l);return"stroke"===c?Jo(h,d,p):Jo(h,p,d)},t.autoSpec=Lc,t.axisFx=Ba,t.axisFy=Na,t.axisX=Ta,t.axisY=Ca,t.barX=hc,t.barY=dc,t.bin=As,t.binX=$s,t.binY=Ms,t.bollinger=eu,t.bollingerX=function(t,{x:e=Q,y:n,k:r=tu.k,color:o=tu.color,opacity:i=tu.opacity,fill:a=o,fillOpacity:l=i,stroke:s=o,strokeOpacity:c,strokeWidth:u,...f}={}){return Jo(ie(a)?null:Js(t,Pc({x1:eu({k:-r,...f}),x2:eu({k:r,...f})},{x1:e,x2:e,y:n,fill:a,fillOpacity:l,...f})),ie(s)?null:Mc(t,Pc({x:eu(f)},{x:e,y:n,stroke:s,strokeOpacity:c,strokeWidth:u,...f})))},t.bollingerY=function(t,{x:e,y:n=Q,k:r=tu.k,color:o=tu.color,opacity:i=tu.opacity,fill:a=o,fillOpacity:l=i,stroke:s=o,strokeOpacity:c,strokeWidth:u,...f}={}){return Jo(ie(a)?null:Ks(t,Pc({y1:eu({k:-r,...f}),y2:eu({k:r,...f})},{x:e,y1:n,y2:n,fill:a,fillOpacity:l,...f})),ie(s)?null:Ac(t,Pc({y:eu(f)},{x:e,y:n,stroke:s,strokeOpacity:c,strokeWidth:u,...f})))},t.boxX=function(t,{x:e=Q,y:n=null,r:r,fill:o="#ccc",fillOpacity:i,stroke:a="currentColor",strokeOpacity:l,strokeWidth:s=2,sort:c,...u}={}){const f=null!=n?qe:je;return Jo(Di(t,f({x1:cu,x2:uu},{x:e,y:n,stroke:a,strokeOpacity:l,...u})),hc(t,f({x1:"p25",x2:"p75"},{x:e,y:n,fill:o,fillOpacity:i,...u})),au(t,f({x:"p50"},{x:e,y:n,stroke:a,strokeOpacity:l,strokeWidth:s,sort:c,...u})),wc(t,Pc({x:su},{x:e,y:n,z:n,r:r,stroke:a,strokeOpacity:l,...u})))},t.boxY=function(t,{y:e=Q,x:n=null,r:r,fill:o="#ccc",fillOpacity:i,stroke:a="currentColor",strokeOpacity:l,strokeWidth:s=2,sort:c,...u}={}){const f=null!=n?Fe:je;return Jo(qi(t,f({y1:cu,y2:uu},{x:n,y:e,stroke:a,strokeOpacity:l,...u})),dc(t,f({y1:"p25",y2:"p75"},{x:n,y:e,fill:o,fillOpacity:i,...u})),lu(t,f({y:"p50"},{x:n,y:e,stroke:a,strokeOpacity:l,strokeWidth:s,sort:c,...u})),wc(t,Pc({y:su},{x:n,y:e,z:n,r:r,stroke:a,strokeOpacity:l,...u})))},t.cell=yc,t.cellX=function(t,{x:e=Z,fill:n,stroke:r,...o}={}){return void 0===n&&void 0===ht(r)[0]&&(n=Q),new mc(t,{...o,x:e,fill:n,stroke:r})},t.cellY=function(t,{y:e=Z,fill:n,stroke:r,...o}={}){return void 0===n&&void 0===ht(r)[0]&&(n=Q),new mc(t,{...o,y:e,fill:n,stroke:r})},t.centroid=af,t.circle=function(t,e){return wc(t,{...e,symbol:"circle"})},t.cluster=function(t,n){return eh(t,{...n,treeLayout:e.cluster})},t.column=Pt,t.contour=function(){return new Eu(...vu("value",...arguments))},t.crosshair=function(t,e){return Cu(ai,t,e)},t.crosshairX=function(t,e={}){return Cu(li,t,e)},t.crosshairY=function(t,e={}){return Cu(si,t,e)},t.delaunayLink=function(t,e){return Zu(Yu,t,e)},t.delaunayMesh=function(t,e){return Zu(Gu,t,e)},t.density=function(t,{x:e,y:n,...r}={}){return[e,n]=zt(e,n),new Ju(t,{...r,x:e,y:n})},t.differenceX=function(t,e){return ef("x",t,e)},t.differenceY=function(t,e){return ef("y",t,e)},t.dodgeX=function(t={},e={}){1===arguments.length&&([t,e]=Dh(t));let{anchor:n="left",padding:r=1,r:o=e.r}=qh(t);switch(`${n}`.toLowerCase()){case"left":n=Bh;break;case"right":n=Ih;break;case"middle":n=Ph;break;default:throw new Error(`unknown dodge anchor: ${n}`)}return Yh("x","y",n,et(r),o,e)},t.dodgeY=function(t={},e={}){1===arguments.length&&([t,e]=Dh(t));let{anchor:n="bottom",padding:r=1,r:o=e.r}=qh(t);switch(`${n}`.toLowerCase()){case"top":n=Wh;break;case"bottom":n=jh;break;case"middle":n=Fh;break;default:throw new Error(`unknown dodge anchor: ${n}`)}return Yh("y","x",n,et(r),o,e)},t.dot=wc,t.dotX=function(t,{x:e=Q,...n}={}){return new xc(t,Pi({...n,x:e}))},t.dotY=function(t,{y:e=Q,...n}={}){return new xc(t,Ii({...n,y:e}))},t.filter=function(t,e){return Ce(e,Ne(t))},t.find=function(t){if("function"!=typeof t)throw new Error(`invalid test function: ${t}`);return{reduceIndex:(e,n,{data:r})=>n[e.find(F(r)?e=>t(r[e],e,r):e=>t(r.get(e),e,r))]}},t.formatIsoDate=Mo,t.formatMonth=function(t="en-US",e="short"){const n=bo(t,e);return t=>null==t||isNaN(t=+new Date(Date.UTC(2e3,+t)))?void 0:n.format(t)},t.formatNumber=$o,t.formatWeekday=function(t="en-US",e="short"){const n=ko(t,e);return t=>null==t||isNaN(t=+new Date(Date.UTC(2001,0,+t)))?void 0:n.format(t)},t.frame=Yl,t.geo=cf,t.geoCentroid=function({geometry:t=Q,...n}={}){const r=go((e=>_(e,t))),o=go((t=>_(r(t),e.geoCentroid)));return{...n,x:{transform:t=>Float64Array.from(o(t),(([t])=>t))},y:{transform:t=>Float64Array.from(o(t),(([,t])=>t))},geometry:{transform:r}}},t.graticule=function({strokeOpacity:t=.1,...n}={}){return cf(e.geoGraticule10(),{strokeOpacity:t,...n})},t.gridFx=qa,t.gridFy=ja,t.gridX=Fa,t.gridY=Wa,t.group=De,t.groupX=Fe,t.groupY=qe,t.groupZ=je,t.hexagon=function(t,e){return wc(t,{...e,symbol:"hexagon"})},t.hexbin=function(t={fill:"count"},{binWidth:e,...n}={}){const{z:r}=n;return e=void 0===e?20:et(e),_e(t=Qe(t,n),"fill")&&(n.channels={...n.channels,fill:{value:[]}}),void 0===n.symbol&&(n.symbol="hexagon"),void 0!==n.r||_e(t,"r")||(n.r=e/2),Oe(n,((n,o,i,a,l,s)=>{let{x:c,y:u,z:f,fill:h,stroke:d,symbol:p}=i;if(void 0===c)throw new Error("missing channel: x");if(void 0===u)throw new Error("missing channel: y");({x:c,y:u}=fo(i,a,s)),f=f?f.value:_(n,r),h=h?.value,d=d?.value,p=p?.value;const m=nn(t,{z:f,fill:h,stroke:d,symbol:p}),y=f&&[],g=h&&[],v=d&&[],x=p&&[],w=[],b=[],k=[];let $=-1;for(const e of t)e.initialize(n);for(const r of o){const o=[];for(const e of t)e.scope("facet",r);for(const[i,a]of He(r,m))for(const{index:r,extent:l}of hf(n,a,c,u,e)){o.push(++$),b.push(l.x),k.push(l.y),f&&y.push(m===f?i:f[r[0]]),h&&g.push(m===h?i:h[r[0]]),d&&v.push(m===d?i:d[r[0]]),p&&x.push(m===p?i:p[r[0]]);for(const e of t)e.reduce(r,l)}w.push(o)}const M=i.x.scale,A=i.y.scale;return{data:n,facets:w,channels:{x:{value:b,source:a[M]?{value:vt(b,a[M].invert),scale:M}:null},y:{value:k,source:a[A]?{value:vt(k,a[A].invert),scale:A}:null},...f&&{z:{value:y}},...h&&{fill:{value:g,scale:"auto"}},...d&&{stroke:{value:v,scale:"auto"}},...p&&{symbol:{value:x,scale:"auto"}},...Object.fromEntries(t.map((({name:t,output:n})=>[t,{scale:"auto",label:n.label,radius:"r"===t?e/2:void 0,value:n.transform()}])))}}}))},t.hexgrid=function(t){return new pf(t)},t.hull=function(t,e){return Zu(Xu,t,e)},t.identity=Q,t.image=function(t,{x:e,y:n,...r}={}){return void 0===r.frameAnchor&&([e,n]=zt(e,n)),new gf(t,{...r,x:e,y:n})},t.indexOf=Z,t.initializer=Oe,t.interpolateNearest=Lu,t.interpolateNone=ku,t.interpolatorBarycentric=$u,t.interpolatorRandomWalk=Su,t.legend=function(t={}){for(const[e,n]of al){const r=t[e];if(Mt(r)){const o=po(t);let i;if("symbol"===e){const{fill:e,stroke:n=(void 0===e&&Mt(t.color)?"color":void 0)}=t;i={fill:e,stroke:n}}return n(Or(e,r,i),ll(o,r,t),(e=>Mt(t[e])?Or(e,t[e]):null))}}throw new Error("unknown legend type; no scale found")},t.line=$c,t.lineX=Mc,t.lineY=Ac,t.linearRegressionX=function(t,{y:e=Z,x:n=Q,stroke:r,fill:o=(ie(r)?"currentColor":r),...i}={}){return new Lf(t,zs({...i,x:n,y:e,fill:o,stroke:r}))},t.linearRegressionY=function(t,{x:e=Z,y:n=Q,stroke:r,fill:o=(ie(r)?"currentColor":r),...i}={}){return new Sf(t,Ss({...i,x:e,y:n,fill:o,stroke:r}))},t.link=nc,t.map=Pc,t.mapX=Bc,t.mapY=Ic,t.marks=Jo,t.normalize=Xh,t.normalizeX=function(t,e){return 1===arguments.length&&({basis:t,...e}=t),Bc(Xh(t),e)},t.normalizeY=function(t,e){return 1===arguments.length&&({basis:t,...e}=t),Ic(Xh(t),e)},t.numberInterval=_t,t.plot=es,t.pointer=ai,t.pointerX=li,t.pointerY=si,t.raster=function(){const[t,e]=vu("fill",...arguments);return new gu(t,null==t||void 0!==e.fill||void 0!==e.fillOpacity?e:{...e,fill:Q})},t.rect=Pl,t.rectX=Wl,t.rectY=jl,t.reverse=function({sort:t,...e}={}){return{...Ce(e,Te),sort:Lt(t)?t:null}},t.ruleX=qi,t.ruleY=Di,t.scale=function(t={}){let e;for(const n in t)if(we.has(n)&&Mt(t[n])){if(void 0!==e)throw new Error("ambiguous scale definition; multiple scales found");e=Fr(Or(n,t[n]))}if(void 0===e)throw new Error("invalid scale definition; no scale found");return e},t.select=function(t,e={}){if("string"==typeof t)switch(t.toLowerCase()){case"first":return ad(e);case"last":return ld(e)}if("function"==typeof t)return hd(null,t,e);let n,r;for(n in t){if(void 0!==r)throw new Error("ambiguous selector; multiple inputs");r=id(t[n])}if(void 0===r)throw new Error(`invalid selector: ${t}`);return hd(n,r,e)},t.selectFirst=ad,t.selectLast=ld,t.selectMaxX=function(t){return hd("x",fd,t)},t.selectMaxY=function(t){return hd("y",fd,t)},t.selectMinX=function(t){return hd("x",ud,t)},t.selectMinY=function(t){return hd("y",ud,t)},t.shiftX=function(t,e){return od("x",t,e)},t.shiftY=function(t,e){return od("y",t,e)},t.shuffle=function({seed:t,sort:n,...r}={}){return{...Ce(r,We(null==t?Math.random:e.randomLcg(t))),sort:Lt(n)?n:null}},t.sort=Be,t.sphere=function({strokeWidth:t=1.5,...e}={}){return cf({type:"Sphere"},{strokeWidth:t,...e})},t.spike=function(t,e={}){const{shape:n=wa,stroke:r=ya.stroke,strokeWidth:o=1,fill:i=r,fillOpacity:a=.3,anchor:l="start",...s}=e;return $a(t,{...s,shape:n,stroke:r,strokeWidth:o,fill:i,fillOpacity:a,anchor:l})},t.stackX=dl,t.stackX1=function(t={},e={}){1===arguments.length&&([t,e]=gl(t));const{y1:n,y:r=n,x:o}=e,[i,a,l]=xl(r,o,"y","x",t,e);return{...i,y1:n,y:a,x:l}},t.stackX2=function(t={},e={}){1===arguments.length&&([t,e]=gl(t));const{y1:n,y:r=n,x:o}=e,[i,a,,l]=xl(r,o,"y","x",t,e);return{...i,y1:n,y:a,x:l}},t.stackY=pl,t.stackY1=function(t={},e={}){1===arguments.length&&([t,e]=gl(t));const{x1:n,x:r=n,y:o}=e,[i,a,l]=xl(r,o,"x","y",t,e);return{...i,x1:n,x:a,y:l}},t.stackY2=function(t={},e={}){1===arguments.length&&([t,e]=gl(t));const{x1:n,x:r=n,y:o}=e,[i,a,,l]=xl(r,o,"x","y",t,e);return{...i,x1:n,x:a,y:l}},t.text=Zi,t.textX=Qi,t.textY=Ji,t.tickX=au,t.tickY=lu,t.timeInterval=R,t.tip=Ul,t.transform=ze,t.tree=eh,t.treeLink=Rf,t.treeNode=Ef,t.utcInterval=C,t.valueof=_,t.vector=$a,t.vectorX=Ma,t.vectorY=Aa,t.version="0.6.16",t.voronoi=function(t,{x:e,y:n,initializer:r,...o}={}){return Zu(Uu,t,{...ze({...o,x:e,y:n},hl),initializer:r})},t.voronoiMesh=function(t,e){return Zu(Hu,t,e)},t.waffleX=function(t,e={}){return kt(e)||(e={...e,y:Z,x2:Q}),new rh(t,ml(Ti(ul(e))))},t.waffleY=function(t,e={}){return kt(e)||(e={...e,x:Z,y2:Q}),new oh(t,yl(Bi(fl(e))))},t.window=qc,t.windowX=function(t={},e){return 1===arguments.length&&(e=t),Bc(qc(t),e)},t.windowY=function(t={},e){return 1===arguments.length&&(e=t),Ic(qc(t),e)}})); |
no test coverage detected