streamlit-nightly 1.42.3.dev20250226__py2.py3-none-any.whl → 1.42.3.dev20250227__py2.py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- streamlit/commands/navigation.py +16 -4
- streamlit/commands/page_config.py +1 -2
- streamlit/elements/widgets/button.py +5 -7
- streamlit/elements/widgets/chat.py +2 -1
- streamlit/errors.py +11 -9
- streamlit/navigation/page.py +2 -10
- streamlit/proto/ChatInput_pb2.py +6 -6
- streamlit/proto/ChatInput_pb2.pyi +5 -1
- streamlit/proto/ForwardMsg_pb2.py +12 -10
- streamlit/proto/PagesChanged_pb2.pyi +3 -1
- streamlit/runtime/app_session.py +1 -13
- streamlit/runtime/pages_manager.py +61 -232
- streamlit/runtime/scriptrunner/script_runner.py +49 -2
- streamlit/runtime/scriptrunner_utils/script_run_context.py +1 -1
- streamlit/source_util.py +4 -90
- streamlit/static/index.html +1 -1
- streamlit/static/static/js/{FileDownload.esm.CWn5B5ZN.js → FileDownload.esm.rdZtCw5-.js} +1 -1
- streamlit/static/static/js/FileHelper.BztOEKJy.js +5 -0
- streamlit/static/static/js/{FormClearHelper.BlCIuWCo.js → FormClearHelper.Drd1fMJc.js} +1 -1
- streamlit/static/static/js/{Hooks.DURid8_V.js → Hooks.DWd0hyk4.js} +1 -1
- streamlit/static/static/js/{InputInstructions.gFFpIc6i.js → InputInstructions.B7xrWTG0.js} +1 -1
- streamlit/static/static/js/{ProgressBar.CtXtbXhv.js → ProgressBar.CBgJiTH-.js} +1 -1
- streamlit/static/static/js/{RenderInPortalIfExists.DKWNQmbm.js → RenderInPortalIfExists.US28tQOn.js} +1 -1
- streamlit/static/static/js/{Toolbar.CKKwksQV.js → Toolbar.CAOt-xaL.js} +1 -1
- streamlit/static/static/js/{base-input.BUY9TLqO.js → base-input.CauNaJqr.js} +1 -1
- streamlit/static/static/js/{checkbox.C4L_5Z9H.js → checkbox.ChzWCtre.js} +1 -1
- streamlit/static/static/js/{createSuper.DprEKsA6.js → createSuper.D_39RJB6.js} +1 -1
- streamlit/static/static/js/{data-grid-overlay-editor.BArvtwSg.js → data-grid-overlay-editor.rIelkOVS.js} +1 -1
- streamlit/static/static/js/{downloader.C5pxkE2v.js → downloader.Dz5I28nG.js} +1 -1
- streamlit/static/static/js/{es6.DmKjMqyQ.js → es6.DwnEjMMn.js} +2 -2
- streamlit/static/static/js/{iframeResizer.contentWindow.DhqbXIl1.js → iframeResizer.contentWindow.BRiRifwd.js} +1 -1
- streamlit/static/static/js/{index.BEnZZwfW.js → index.BE6MTF-B.js} +1 -1
- streamlit/static/static/js/{index.c_V1HXTs.js → index.BUdhIGhT.js} +1 -1
- streamlit/static/static/js/{index.B-S4HX7x.js → index.BWeYb5ES.js} +1 -1
- streamlit/static/static/js/{index.CTqvpoOz.js → index.Bb4OB39A.js} +1 -1
- streamlit/static/static/js/{index.BoBCblDb.js → index.BrAW6bFJ.js} +1 -1
- streamlit/static/static/js/{index.CXpOPWFV.js → index.CAHGh74D.js} +1 -1
- streamlit/static/static/js/{index.UE_L1IEZ.js → index.CBre8Aui.js} +1 -1
- streamlit/static/static/js/{index.B-vrwvgD.js → index.CM12P2T1.js} +1 -1
- streamlit/static/static/js/{index.Cd03IYkG.js → index.CO3dZWKG.js} +1 -1
- streamlit/static/static/js/{index.CvNhwseQ.js → index.CUz1_nAm.js} +1 -1
- streamlit/static/static/js/{index.BVHfAEko.js → index.C_C365T5.js} +1 -1
- streamlit/static/static/js/{index.NKOzzX__.js → index.CmYiLKNX.js} +1 -1
- streamlit/static/static/js/{index.RFfgDsnM.js → index.CoUzNoRf.js} +1 -1
- streamlit/static/static/js/{index.RrEbViHi.js → index.Ct7MPsA3.js} +1 -1
- streamlit/static/static/js/{index.D2G24Udm.js → index.D1K6NCBQ.js} +1 -1
- streamlit/static/static/js/{index.CoQjULdH.js → index.D2xM-XzG.js} +1 -1
- streamlit/static/static/js/{index.D2-IYCcZ.js → index.D9rv1PQ0.js} +1 -1
- streamlit/static/static/js/{index.ChEJa75P.js → index.DIeegLbv.js} +1 -1
- streamlit/static/static/js/{index.oPGa5nFU.js → index.DJvwxFLn.js} +1 -1
- streamlit/static/static/js/{index.DtIKjlNZ.js → index.DKuQg2D4.js} +1 -1
- streamlit/static/static/js/{index.Bk3A478D.js → index.DWFLx6Tc.js} +6 -6
- streamlit/static/static/js/{index.WAlW9lgW.js → index.DYUhWSq6.js} +1 -1
- streamlit/static/static/js/{index.Bds7Anva.js → index.Db3jGJxa.js} +1 -1
- streamlit/static/static/js/{index.KPwXWqBk.js → index.DfNAkKAr.js} +145 -145
- streamlit/static/static/js/{index.EIkP6R_d.js → index.DgNQKEeQ.js} +1 -1
- streamlit/static/static/js/{index.BmnSGdtS.js → index.Dj91melR.js} +1 -1
- streamlit/static/static/js/{index.C3l2zbST.js → index.DkKZlAsv.js} +1 -1
- streamlit/static/static/js/index.DkgVNhWs.js +1 -0
- streamlit/static/static/js/{index.DNr2W0gq.js → index.Dzp8iBkF.js} +1 -1
- streamlit/static/static/js/index.LL2DLZZA.js +201 -0
- streamlit/static/static/js/index.ORHz8Y8P.js +4537 -0
- streamlit/static/static/js/{index.O5-Wn4Yr.js → index.V3Vj2d9m.js} +1 -1
- streamlit/static/static/js/{index.BUnWa5Cg.js → index.YNWoT4uW.js} +1 -1
- streamlit/static/static/js/index.aL_kqyvR.js +1 -0
- streamlit/static/static/js/{index.BSczaRDm.js → index.fP6rBxlc.js} +1 -1
- streamlit/static/static/js/{index.xTncca7J.js → index.pvQjxG7y.js} +1 -1
- streamlit/static/static/js/{index.doRPQ8od.js → index.wxpL02VY.js} +1 -1
- streamlit/static/static/js/{input.EkJ_AsTP.js → input.D_dn5-2t.js} +1 -1
- streamlit/static/static/js/{memory.BFs17dZE.js → memory.pnMTtWQR.js} +1 -1
- streamlit/static/static/js/{mergeWith.B4u0whL-.js → mergeWith.CRrYodeI.js} +1 -1
- streamlit/static/static/js/{number-overlay-editor.DwazN43x.js → number-overlay-editor.C65GBS2P.js} +1 -1
- streamlit/static/static/js/{possibleConstructorReturn.CZfYLVBb.js → possibleConstructorReturn.BnQk7lq_.js} +1 -1
- streamlit/static/static/js/{sandbox.PjijA1v1.js → sandbox.CrxXt1li.js} +1 -1
- streamlit/static/static/js/{textarea.BGGnQXtw.js → textarea.DiFyO5JY.js} +1 -1
- streamlit/static/static/js/{timepicker.eLEnk1tw.js → timepicker.B1Y7LIk4.js} +1 -1
- streamlit/static/static/js/{toConsumableArray.CgKj9NUY.js → toConsumableArray.BWpBUK-j.js} +1 -1
- streamlit/static/static/js/{uniqueId.CPmOGhdZ.js → uniqueId.7ecIUkUs.js} +1 -1
- streamlit/static/static/js/{useBasicWidgetState.Bw_fxTtX.js → useBasicWidgetState.deG0KPm0.js} +1 -1
- streamlit/static/static/js/{useOnInputChange.D8qi7pm4.js → useOnInputChange.CQ7sD7CO.js} +1 -1
- streamlit/static/static/js/{withFullScreenWrapper.BjVufR9b.js → withFullScreenWrapper.D0wnBu3k.js} +1 -1
- streamlit/testing/v1/app_test.py +8 -10
- {streamlit_nightly-1.42.3.dev20250226.dist-info → streamlit_nightly-1.42.3.dev20250227.dist-info}/METADATA +1 -1
- {streamlit_nightly-1.42.3.dev20250226.dist-info → streamlit_nightly-1.42.3.dev20250227.dist-info}/RECORD +88 -88
- streamlit/static/static/js/FileHelper.Bii_mi1A.js +0 -5
- streamlit/static/static/js/index.BAfr2RC0.js +0 -3865
- streamlit/static/static/js/index.BCErGZwr.js +0 -1
- streamlit/static/static/js/index.DhcYAj3f.js +0 -1
- streamlit/static/static/js/index.u1gL_Cm_.js +0 -201
- {streamlit_nightly-1.42.3.dev20250226.data → streamlit_nightly-1.42.3.dev20250227.data}/scripts/streamlit.cmd +0 -0
- {streamlit_nightly-1.42.3.dev20250226.dist-info → streamlit_nightly-1.42.3.dev20250227.dist-info}/WHEEL +0 -0
- {streamlit_nightly-1.42.3.dev20250226.dist-info → streamlit_nightly-1.42.3.dev20250227.dist-info}/entry_points.txt +0 -0
- {streamlit_nightly-1.42.3.dev20250226.dist-info → streamlit_nightly-1.42.3.dev20250227.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,201 @@
|
|
1
|
+
import{I as _P,n as AP,G as Qe,aF as $P,aG as CE,aH as kP,aI as CP,aJ as pa,aK as Od,M as FP,y as TP,r as wt,L as ab,ad as MP,ao as DP,ak as FE,al as TE,W as OP,aL as RP,N as ME,aA as DE,as as rC,B as NP,j as dm,aM as LP}from"./index.DfNAkKAr.js";import{S as OE,T as PP}from"./Toolbar.CAOt-xaL.js";import{u as oC,E as sC,w as IP}from"./withFullScreenWrapper.D0wnBu3k.js";import{m as zP}from"./mergeWith.CRrYodeI.js";import{a as rc,n as BP,b as UP,c as ag,t as Os,p as jP,d as qP,e as WP,i as jo,f as ug,g as RE,l as $u,h as ub,j as lg,k as NE,m as ho,o as Ga,q as HP,r as qo,s as GP,u as VP,v as YP,w as XP}from"./threshold.DjX0wlsa.js";import{f as KP,a as Z0,b as aC,c as JP,R as cg,r as uC,d as lb,e as cb,C as fb,g as LE,h as PE,i as fg,j as e1,n as Bt,k as Oc,l as QP,m as ZP,o as eI,p as tI,q as nI,s as iI,t as rI,u as oI,v as sI,w as aI,x as uI,y as Rd}from"./value.CgPGBV_l.js";import{P as lI,i as cI,a as fI,b as dI,p as db,T as hI,n as gI,t as pI,d as mI}from"./timer.CAwTRJ_g.js";import{u as yI}from"./FormClearHelper.Drd1fMJc.js";const bI=e=>({"#vg-tooltip-element":{visibility:"hidden",position:"fixed",fontFamily:e.genericFonts.bodyFont,color:e.colors.bodyText,border:`${e.sizes.borderWidth} solid ${e.colors.borderColor}`,backgroundColor:_P(e.colors.bgColor,.05),fontSize:e.fontSizes.twoSm,boxShadow:"rgb(0 0 0 / 16%) 0px 1px 4px",maxWidth:e.sizes.maxChartTooltipWidth,padding:`${e.spacing.xs} ${e.spacing.md}`,borderRadius:e.radii.default,zIndex:e.zIndices.popup,"&.visible":{visibility:"visible"},h2:{marginTop:e.spacing.none,marginBottom:e.spacing.sm,fontSize:e.fontSizes.sm},td:{border:"none"},table:{borderSpacing:0,tr:{border:"none",td:{overflow:"hidden",textOverflow:"ellipsis",paddingTop:e.spacing.threeXS,paddingBottom:e.spacing.threeXS},"td.key":{maxWidth:`calc((${e.sizes.maxChartTooltipWidth} - 2 * ${e.spacing.md}) * 0.4)`,textAlign:"right",color:e.colors.fadedText60,whiteSpace:"nowrap",paddingRight:e.spacing.twoXS},"td.value":{maxWidth:`calc((${e.sizes.maxChartTooltipWidth} - 2 * ${e.spacing.md}) * 0.6)`,textAlign:"left",display:"-webkit-box",WebkitLineClamp:"5",WebkitBoxOrient:"vertical",lineClamp:"5",wordWrap:"break-word"}}}}}),vI=AP("div",{target:"e1xm3y80"})(({theme:e,useContainerWidth:t,isFullScreen:n})=>({width:t||n?"100%":"auto",height:n?"100%":"auto","&.vega-embed":{position:"relative",display:"inline-block",boxSizing:"border-box","details:not([open]) > :not(summary)":{display:"none !important"},"details[open] summary":{opacity:.7},"&:hover summary, .vega-embed:focus summary":{background:"transparent"},"&:hover summary, &:focus-within summary":{opacity:"1 !important",transition:"opacity 0.2s ease"},"&.has-actions":{paddingRight:0},".vega-actions":{position:"absolute",display:"flex",flexDirection:"column",paddingBottom:e.spacing.sm,paddingTop:e.spacing.sm,zIndex:e.zIndices.popup,top:`calc(${e.iconSizes.md} + 2 * ${e.spacing.xs} + ${e.spacing.xs})`,right:0,backgroundColor:e.colors.bgColor,boxShadow:"rgb(0 0 0 / 16%) 0px 4px 16px",border:`${e.sizes.borderWidth} solid ${e.colors.fadedText10}`,animationDuration:"0.15s",animationName:"scale-in",animationTimingFunction:"cubic-bezier(0.2, 0, 0.13, 1.5)",textAlign:"left",borderRadius:e.radii.default,a:{fontFamily:e.genericFonts.bodyFont,fontWeight:e.fontWeights.normal,fontSize:e.fontSizes.md,margin:0,padding:`${e.spacing.twoXS} ${e.spacing.twoXL}`,color:e.colors.bodyText,whiteSpace:"nowrap",textDecoration:"none"},"a:hover, a:focus":{backgroundColor:e.colors.secondaryBg,color:e.colors.bodyText},":before":{content:"none"},":after":{content:"none"}},"@keyframes scale-in":{from:{opacity:0,transform:"scale(0.6)"},to:{opacity:1,transform:"scale(1)"}},".chart-wrapper":{"&.fit-x":{width:"100%"},"&.fit-y":{height:"100%"}},summary:{position:"absolute",top:0,right:0,opacity:0,listStyle:"none",cursor:"pointer",display:"list-item",padding:e.spacing.xs,height:"auto",zIndex:e.zIndices.menuButton,border:"none",boxShadow:"none",borderRadius:e.radii.default,color:e.colors.fadedText10,backgroundColor:"transparent",transition:"opacity 300ms 150ms,transform 300ms 150ms",lineHeight:0,"&::-webkit-details-marker":{display:"none"},"&:active, &:focus-visible, &:hover":{border:"none",boxShadow:"none",color:e.colors.bodyText,opacity:"1 !important",background:e.colors.darkenedBgMix25},svg:{width:e.iconSizes.md,height:e.iconSizes.md}}}}));function IE(e,t){const n={font:t.genericFonts.bodyFont,background:t.colors.bgColor,fieldTitle:"verbal",autosize:{type:"fit",contains:"padding"},title:{align:"left",anchor:"start",color:t.colors.headingColor,titleFontStyle:"normal",fontWeight:t.fontWeights.bold,fontSize:Qe(t.fontSizes.md),orient:"top",offset:26},header:{titleFontWeight:t.fontWeights.normal,titleFontSize:Qe(t.fontSizes.md),titleColor:pa(t),titleFontStyle:"normal",labelFontSize:Qe(t.fontSizes.twoSm),labelFontWeight:t.fontWeights.normal,labelColor:pa(t),labelFontStyle:"normal"},axis:{labelFontSize:Qe(t.fontSizes.twoSm),labelFontWeight:t.fontWeights.normal,labelColor:pa(t),labelFontStyle:"normal",titleFontWeight:t.fontWeights.normal,titleFontSize:Qe(t.fontSizes.sm),titleColor:pa(t),titleFontStyle:"normal",ticks:!1,gridColor:Od(t),domain:!1,domainWidth:1,domainColor:Od(t),labelFlush:!0,labelFlushOffset:1,labelBound:!1,labelLimit:100,titlePadding:Qe(t.spacing.lg),labelPadding:Qe(t.spacing.lg),labelSeparation:Qe(t.spacing.twoXS),labelOverlap:!0},legend:{labelFontSize:Qe(t.fontSizes.sm),labelFontWeight:t.fontWeights.normal,labelColor:pa(t),titleFontSize:Qe(t.fontSizes.sm),titleFontWeight:t.fontWeights.normal,titleFontStyle:"normal",titleColor:pa(t),titlePadding:5,labelPadding:Qe(t.spacing.lg),columnPadding:Qe(t.spacing.sm),rowPadding:Qe(t.spacing.twoXS),padding:7,symbolStrokeWidth:Qe(t.spacing.twoXS)},range:{category:CP(t),diverging:kP(t),ramp:CE(t),heatmap:CE(t)},view:{columns:1,strokeWidth:0,stroke:"transparent",continuousHeight:Qe(t.sizes.defaultChartHeight),continuousWidth:Qe(t.sizes.defaultChartWidth)},concat:{columns:1},facet:{columns:1},mark:{tooltip:{content:"encoding"},color:$P(t)},bar:{binSpacing:Qe(t.spacing.twoXS),discreteBandSize:{band:.85}},axisDiscrete:{grid:!1},axisXPoint:{grid:!1},axisTemporal:{grid:!1},axisXBand:{grid:!1}};return e?zP({},n,e,(i,r)=>Array.isArray(r)?r:void 0):n}function xI(e,t){const{colors:n,fontSizes:i,genericFonts:r}=t,o={labelFont:r.bodyFont,titleFont:r.bodyFont,labelFontSize:Qe(i.twoSm),titleFontSize:Qe(i.twoSm)},s={background:n.bgColor,axis:{labelColor:n.bodyText,titleColor:n.bodyText,gridColor:Od(t),...o},legend:{labelColor:n.bodyText,titleColor:n.bodyText,...o},title:{color:n.bodyText,subtitleColor:n.bodyText,...o},header:{labelColor:n.bodyText,titleColor:n.bodyText,...o},view:{stroke:Od(t),continuousHeight:Qe(t.sizes.defaultChartHeight),continuousWidth:Qe(t.sizes.defaultChartWidth)},mark:{tooltip:!0}};return e?FP({},s,e):s}const wI=20;function EI(e){"params"in e&&"encoding"in e&&e.params.forEach(t=>{"select"in t&&(["interval","point"].includes(t.select)&&(t.select={type:t.select}),"type"in t.select&&t.select.type==="point"&&!("encodings"in t.select)&&ab(t.select.encodings)&&(t.select.encodings=Object.keys(e.encoding)))})}const SI=(e,t,n,i,r,o,s,a)=>{var l,c;const u=JSON.parse(e);if(n==="streamlit"?u.config=IE(u.config,r):((c=(l=u.usermeta)==null?void 0:l.embedOptions)==null?void 0:c.theme)==="streamlit"?(u.config=IE(u.config,r),u.usermeta.embedOptions.theme=void 0):u.config=xI(u.config,r),o?(u.width=s,u.height=a,"vconcat"in u&&u.vconcat.forEach(f=>{f.width=s})):t&&(u.width=s,"vconcat"in u&&u.vconcat.forEach(f=>{f.width=s})),u.padding||(u.padding={}),ab(u.padding.bottom)&&(u.padding.bottom=wI),u.datasets)throw new Error("Datasets should not be passed as part of the spec");return i.length>0&&EI(u),u},_I=e=>{const t=TP(),{expanded:n,width:i,height:r}=oC(sC),{id:o,formId:s,spec:a,data:u,datasets:l,useContainerWidth:c,vegaLiteTheme:f,selectionMode:d}=e,h=wt.useMemo(()=>d,[JSON.stringify(d)]),g=wt.useMemo(()=>SI(a,c,f,h,t,n,i||0,r),[a,c,f,h,t,n,i,r]);return{id:o,formId:s,vegaLiteTheme:f,spec:g,selectionMode:h,data:u,datasets:l,useContainerWidth:c}};function An(e,t,n){return e.fields=t||[],e.fname=n,e}function Je(e){return e==null?null:e.fname}function qt(e){return e==null?null:e.fields}function lC(e){return e.length===1?AI(e[0]):$I(e)}const AI=e=>function(t){return t[e]},$I=e=>{const t=e.length;return function(n){for(let i=0;i<t;++i)n=n[e[i]];return n}};function N(e){throw Error(e)}function ar(e){const t=[],n=e.length;let i=null,r=0,o="",s,a,u;e=e+"";function l(){t.push(o+e.substring(s,a)),o="",s=a+1}for(s=a=0;a<n;++a)if(u=e[a],u==="\\")o+=e.substring(s,a++),s=a;else if(u===i)l(),i=null,r=-1;else{if(i)continue;s===r&&u==='"'||s===r&&u==="'"?(s=a+1,i=u):u==="."&&!r?a>s?l():s=a+1:u==="["?(a>s&&l(),r=s=a+1):u==="]"&&(r||N("Access path missing open bracket: "+e),r>0&&l(),r=0,s=a+1)}return r&&N("Access path missing closing bracket: "+e),i&&N("Access path missing closing quote: "+e),a>s&&(a++,l()),t}function Qn(e,t,n){const i=ar(e);return e=i.length===1?i[0]:e,An((n&&n.get||lC)(i),[e],t||e)}const Rc=Qn("id"),Vt=An(e=>e,[],"identity"),fo=An(()=>0,[],"zero"),ku=An(()=>1,[],"one"),Pn=An(()=>!0,[],"true"),io=An(()=>!1,[],"false");function kI(e,t,n){const i=[t].concat([].slice.call(n));console[e].apply(console,i)}const cC=0,hb=1,gb=2,fC=3,dC=4;function pb(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:kI,i=e||cC;return{level(r){return arguments.length?(i=+r,this):i},error(){return i>=hb&&n(t||"error","ERROR",arguments),this},warn(){return i>=gb&&n(t||"warn","WARN",arguments),this},info(){return i>=fC&&n(t||"log","INFO",arguments),this},debug(){return i>=dC&&n(t||"log","DEBUG",arguments),this}}}var P=Array.isArray;function Y(e){return e===Object(e)}const zE=e=>e!=="__proto__";function Cu(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.reduce((i,r)=>{for(const o in r)if(o==="signals")i.signals=CI(i.signals,r.signals);else{const s=o==="legend"?{layout:1}:o==="style"?!0:null;Fu(i,o,r[o],s)}return i},{})}function Fu(e,t,n,i){if(!zE(t))return;let r,o;if(Y(n)&&!P(n)){o=Y(e[t])?e[t]:e[t]={};for(r in n)i&&(i===!0||i[r])?Fu(o,r,n[r]):zE(r)&&(o[r]=n[r])}else e[t]=n}function CI(e,t){if(e==null)return t;const n={},i=[];function r(o){n[o.name]||(n[o.name]=1,i.push(o))}return t.forEach(r),e.forEach(r),i}function Ee(e){return e[e.length-1]}function Ut(e){return e==null||e===""?null:+e}const hC=e=>t=>e*Math.exp(t),gC=e=>t=>Math.log(e*t),pC=e=>t=>Math.sign(t)*Math.log1p(Math.abs(t/e)),mC=e=>t=>Math.sign(t)*Math.expm1(Math.abs(t))*e,Nd=e=>t=>t<0?-Math.pow(-t,e):Math.pow(t,e);function dg(e,t,n,i){const r=n(e[0]),o=n(Ee(e)),s=(o-r)*t;return[i(r-s),i(o-s)]}function yC(e,t){return dg(e,t,Ut,Vt)}function bC(e,t){var n=Math.sign(e[0]);return dg(e,t,gC(n),hC(n))}function vC(e,t,n){return dg(e,t,Nd(n),Nd(1/n))}function xC(e,t,n){return dg(e,t,pC(n),mC(n))}function hg(e,t,n,i,r){const o=i(e[0]),s=i(Ee(e)),a=t!=null?i(t):(o+s)/2;return[r(a+(o-a)*n),r(a+(s-a)*n)]}function mb(e,t,n){return hg(e,t,n,Ut,Vt)}function yb(e,t,n){const i=Math.sign(e[0]);return hg(e,t,n,gC(i),hC(i))}function Ld(e,t,n,i){return hg(e,t,n,Nd(i),Nd(1/i))}function bb(e,t,n,i){return hg(e,t,n,pC(i),mC(i))}function wC(e){return 1+~~(new Date(e).getMonth()/3)}function EC(e){return 1+~~(new Date(e).getUTCMonth()/3)}function X(e){return e!=null?P(e)?e:[e]:[]}function SC(e,t,n){let i=e[0],r=e[1],o;return r<i&&(o=r,r=i,i=o),o=r-i,o>=n-t?[t,n]:[i=Math.min(Math.max(i,t),n-o),i+o]}function ge(e){return typeof e=="function"}const FI="descending";function vb(e,t,n){n=n||{},t=X(t)||[];const i=[],r=[],o={},s=n.comparator||TI;return X(e).forEach((a,u)=>{a!=null&&(i.push(t[u]===FI?-1:1),r.push(a=ge(a)?a:Qn(a,null,n)),(qt(a)||[]).forEach(l=>o[l]=1))}),r.length===0?null:An(s(r,i),Object.keys(o))}const gg=(e,t)=>(e<t||e==null)&&t!=null?-1:(e>t||t==null)&&e!=null?1:(t=t instanceof Date?+t:t,(e=e instanceof Date?+e:e)!==e&&t===t?-1:t!==t&&e===e?1:0),TI=(e,t)=>e.length===1?MI(e[0],t[0]):DI(e,t,e.length),MI=(e,t)=>function(n,i){return gg(e(n),e(i))*t},DI=(e,t,n)=>(t.push(0),function(i,r){let o,s=0,a=-1;for(;s===0&&++a<n;)o=e[a],s=gg(o(i),o(r));return s*t[a]});function Yt(e){return ge(e)?e:()=>e}function xb(e,t){let n;return i=>{n&&clearTimeout(n),n=setTimeout(()=>(t(i),n=null),e)}}function he(e){for(let t,n,i=1,r=arguments.length;i<r;++i){t=arguments[i];for(n in t)e[n]=t[n]}return e}function Qi(e,t){let n=0,i,r,o,s;if(e&&(i=e.length))if(t==null){for(r=e[n];n<i&&(r==null||r!==r);r=e[++n]);for(o=s=r;n<i;++n)r=e[n],r!=null&&(r<o&&(o=r),r>s&&(s=r))}else{for(r=t(e[n]);n<i&&(r==null||r!==r);r=t(e[++n]));for(o=s=r;n<i;++n)r=t(e[n]),r!=null&&(r<o&&(o=r),r>s&&(s=r))}return[o,s]}function _C(e,t){const n=e.length;let i=-1,r,o,s,a,u;if(t==null){for(;++i<n;)if(o=e[i],o!=null&&o>=o){r=s=o;break}if(i===n)return[-1,-1];for(a=u=i;++i<n;)o=e[i],o!=null&&(r>o&&(r=o,a=i),s<o&&(s=o,u=i))}else{for(;++i<n;)if(o=t(e[i],i,e),o!=null&&o>=o){r=s=o;break}if(i===n)return[-1,-1];for(a=u=i;++i<n;)o=t(e[i],i,e),o!=null&&(r>o&&(r=o,a=i),s<o&&(s=o,u=i))}return[a,u]}const OI=Object.prototype.hasOwnProperty;function J(e,t){return OI.call(e,t)}const Af={};function Tu(e){let t={},n;function i(o){return J(t,o)&&t[o]!==Af}const r={size:0,empty:0,object:t,has:i,get(o){return i(o)?t[o]:void 0},set(o,s){return i(o)||(++r.size,t[o]===Af&&--r.empty),t[o]=s,this},delete(o){return i(o)&&(--r.size,++r.empty,t[o]=Af),this},clear(){r.size=r.empty=0,r.object=t={}},test(o){return arguments.length?(n=o,r):n},clean(){const o={};let s=0;for(const a in t){const u=t[a];u!==Af&&(!n||!n(u))&&(o[a]=u,++s)}r.size=s,r.empty=0,r.object=t=o}};return e&&Object.keys(e).forEach(o=>{r.set(o,e[o])}),r}function AC(e,t,n,i,r,o){if(!n&&n!==0)return o;const s=+n;let a=e[0],u=Ee(e),l;u<a&&(l=a,a=u,u=l),l=Math.abs(t-a);const c=Math.abs(u-t);return l<c&&l<=s?i:c<=s?r:o}function G(e,t,n){const i=e.prototype=Object.create(t.prototype);return Object.defineProperty(i,"constructor",{value:e,writable:!0,enumerable:!0,configurable:!0}),he(i,n)}function Ta(e,t,n,i){let r=t[0],o=t[t.length-1],s;return r>o&&(s=r,r=o,o=s),n=n===void 0||n,i=i===void 0||i,(n?r<=e:r<e)&&(i?e<=o:e<o)}function Wo(e){return typeof e=="boolean"}function So(e){return Object.prototype.toString.call(e)==="[object Date]"}function $C(e){return e&&ge(e[Symbol.iterator])}function Ae(e){return typeof e=="number"}function kC(e){return Object.prototype.toString.call(e)==="[object RegExp]"}function K(e){return typeof e=="string"}function wb(e,t,n){e&&(e=t?X(e).map(a=>a.replace(/\\(.)/g,"$1")):X(e));const i=e&&e.length,r=n&&n.get||lC,o=a=>r(t?[a]:ar(a));let s;if(!i)s=function(){return""};else if(i===1){const a=o(e[0]);s=function(u){return""+a(u)}}else{const a=e.map(o);s=function(u){let l=""+a[0](u),c=0;for(;++c<i;)l+="|"+a[c](u);return l}}return An(s,e,"key")}function CC(e,t){const n=e[0],i=Ee(e),r=+t;return r?r===1?i:n+r*(i-n):n}const RI=1e4;function FC(e){e=+e||RI;let t,n,i;const r=()=>{t={},n={},i=0},o=(s,a)=>(++i>e&&(n=t,t={},i=1),t[s]=a);return r(),{clear:r,has:s=>J(t,s)||J(n,s),get:s=>J(t,s)?t[s]:J(n,s)?o(s,n[s]):void 0,set:(s,a)=>J(t,s)?t[s]=a:o(s,a)}}function TC(e,t,n,i){const r=t.length,o=n.length;if(!o)return t;if(!r)return n;const s=i||new t.constructor(r+o);let a=0,u=0,l=0;for(;a<r&&u<o;++l)s[l]=e(t[a],n[u])>0?n[u++]:t[a++];for(;a<r;++a,++l)s[l]=t[a];for(;u<o;++u,++l)s[l]=n[u];return s}function Sl(e,t){let n="";for(;--t>=0;)n+=e;return n}function MC(e,t,n,i){const r=n||" ",o=e+"",s=t-o.length;return s<=0?o:i==="left"?Sl(r,s)+o:i==="center"?Sl(r,~~(s/2))+o+Sl(r,Math.ceil(s/2)):o+Sl(r,s)}function Nc(e){return e&&Ee(e)-e[0]||0}function H(e){return P(e)?"["+e.map(H)+"]":Y(e)||K(e)?JSON.stringify(e).replace("\u2028","\\u2028").replace("\u2029","\\u2029"):e}function Eb(e){return e==null||e===""?null:!e||e==="false"||e==="0"?!1:!!e}const NI=e=>Ae(e)||So(e)?e:Date.parse(e);function Sb(e,t){return t=t||NI,e==null||e===""?null:t(e)}function _b(e){return e==null||e===""?null:e+""}function xi(e){const t={},n=e.length;for(let i=0;i<n;++i)t[e[i]]=!0;return t}function DC(e,t,n,i){const r=i??"…",o=e+"",s=o.length,a=Math.max(0,t-r.length);return s<=t?o:n==="left"?r+o.slice(s-a):n==="center"?o.slice(0,Math.ceil(a/2))+r+o.slice(s-~~(a/2)):o.slice(0,a)+r}function so(e,t,n){if(e)if(t){const i=e.length;for(let r=0;r<i;++r){const o=t(e[r]);o&&n(o,r,e)}}else e.forEach(n)}var BE={},hm={},gm=34,Qu=10,pm=13;function OC(e){return new Function("d","return {"+e.map(function(t,n){return JSON.stringify(t)+": d["+n+'] || ""'}).join(",")+"}")}function LI(e,t){var n=OC(e);return function(i,r){return t(n(i),r,e)}}function UE(e){var t=Object.create(null),n=[];return e.forEach(function(i){for(var r in i)r in t||n.push(t[r]=r)}),n}function hn(e,t){var n=e+"",i=n.length;return i<t?new Array(t-i+1).join(0)+n:n}function PI(e){return e<0?"-"+hn(-e,6):e>9999?"+"+hn(e,6):hn(e,4)}function II(e){var t=e.getUTCHours(),n=e.getUTCMinutes(),i=e.getUTCSeconds(),r=e.getUTCMilliseconds();return isNaN(e)?"Invalid Date":PI(e.getUTCFullYear())+"-"+hn(e.getUTCMonth()+1,2)+"-"+hn(e.getUTCDate(),2)+(r?"T"+hn(t,2)+":"+hn(n,2)+":"+hn(i,2)+"."+hn(r,3)+"Z":i?"T"+hn(t,2)+":"+hn(n,2)+":"+hn(i,2)+"Z":n||t?"T"+hn(t,2)+":"+hn(n,2)+"Z":"")}function zI(e){var t=new RegExp('["'+e+`
|
2
|
+
\r]`),n=e.charCodeAt(0);function i(f,d){var h,g,p=r(f,function(m,y){if(h)return h(m,y-1);g=m,h=d?LI(m,d):OC(m)});return p.columns=g||[],p}function r(f,d){var h=[],g=f.length,p=0,m=0,y,b=g<=0,v=!1;f.charCodeAt(g-1)===Qu&&--g,f.charCodeAt(g-1)===pm&&--g;function x(){if(b)return hm;if(v)return v=!1,BE;var S,w=p,_;if(f.charCodeAt(w)===gm){for(;p++<g&&f.charCodeAt(p)!==gm||f.charCodeAt(++p)===gm;);return(S=p)>=g?b=!0:(_=f.charCodeAt(p++))===Qu?v=!0:_===pm&&(v=!0,f.charCodeAt(p)===Qu&&++p),f.slice(w+1,S-1).replace(/""/g,'"')}for(;p<g;){if((_=f.charCodeAt(S=p++))===Qu)v=!0;else if(_===pm)v=!0,f.charCodeAt(p)===Qu&&++p;else if(_!==n)continue;return f.slice(w,S)}return b=!0,f.slice(w,g)}for(;(y=x())!==hm;){for(var E=[];y!==BE&&y!==hm;)E.push(y),y=x();d&&(E=d(E,m++))==null||h.push(E)}return h}function o(f,d){return f.map(function(h){return d.map(function(g){return c(h[g])}).join(e)})}function s(f,d){return d==null&&(d=UE(f)),[d.map(c).join(e)].concat(o(f,d)).join(`
|
3
|
+
`)}function a(f,d){return d==null&&(d=UE(f)),o(f,d).join(`
|
4
|
+
`)}function u(f){return f.map(l).join(`
|
5
|
+
`)}function l(f){return f.map(c).join(e)}function c(f){return f==null?"":f instanceof Date?II(f):t.test(f+="")?'"'+f.replace(/"/g,'""')+'"':f}return{parse:i,parseRows:r,format:s,formatBody:a,formatRows:u,formatRow:l,formatValue:c}}function BI(e){return e}function UI(e){if(e==null)return BI;var t,n,i=e.scale[0],r=e.scale[1],o=e.translate[0],s=e.translate[1];return function(a,u){u||(t=n=0);var l=2,c=a.length,f=new Array(c);for(f[0]=(t+=a[0])*i+o,f[1]=(n+=a[1])*r+s;l<c;)f[l]=a[l],++l;return f}}function jI(e,t){for(var n,i=e.length,r=i-t;r<--i;)n=e[r],e[r++]=e[i],e[i]=n}function qI(e,t){return typeof t=="string"&&(t=e.objects[t]),t.type==="GeometryCollection"?{type:"FeatureCollection",features:t.geometries.map(function(n){return jE(e,n)})}:jE(e,t)}function jE(e,t){var n=t.id,i=t.bbox,r=t.properties==null?{}:t.properties,o=RC(e,t);return n==null&&i==null?{type:"Feature",properties:r,geometry:o}:i==null?{type:"Feature",id:n,properties:r,geometry:o}:{type:"Feature",id:n,bbox:i,properties:r,geometry:o}}function RC(e,t){var n=UI(e.transform),i=e.arcs;function r(c,f){f.length&&f.pop();for(var d=i[c<0?~c:c],h=0,g=d.length;h<g;++h)f.push(n(d[h],h));c<0&&jI(f,g)}function o(c){return n(c)}function s(c){for(var f=[],d=0,h=c.length;d<h;++d)r(c[d],f);return f.length<2&&f.push(f[0]),f}function a(c){for(var f=s(c);f.length<4;)f.push(f[0]);return f}function u(c){return c.map(a)}function l(c){var f=c.type,d;switch(f){case"GeometryCollection":return{type:f,geometries:c.geometries.map(l)};case"Point":d=o(c.coordinates);break;case"MultiPoint":d=c.coordinates.map(o);break;case"LineString":d=s(c.arcs);break;case"MultiLineString":d=c.arcs.map(s);break;case"Polygon":d=u(c.arcs);break;case"MultiPolygon":d=c.arcs.map(u);break;default:return null}return{type:f,coordinates:d}}return l(t)}function WI(e,t){var n={},i={},r={},o=[],s=-1;t.forEach(function(l,c){var f=e.arcs[l<0?~l:l],d;f.length<3&&!f[1][0]&&!f[1][1]&&(d=t[++s],t[s]=l,t[c]=d)}),t.forEach(function(l){var c=a(l),f=c[0],d=c[1],h,g;if(h=r[f])if(delete r[h.end],h.push(l),h.end=d,g=i[d]){delete i[g.start];var p=g===h?h:h.concat(g);i[p.start=h.start]=r[p.end=g.end]=p}else i[h.start]=r[h.end]=h;else if(h=i[d])if(delete i[h.start],h.unshift(l),h.start=f,g=r[f]){delete r[g.end];var m=g===h?h:g.concat(h);i[m.start=g.start]=r[m.end=h.end]=m}else i[h.start]=r[h.end]=h;else h=[l],i[h.start=f]=r[h.end=d]=h});function a(l){var c=e.arcs[l<0?~l:l],f=c[0],d;return e.transform?(d=[0,0],c.forEach(function(h){d[0]+=h[0],d[1]+=h[1]})):d=c[c.length-1],l<0?[d,f]:[f,d]}function u(l,c){for(var f in l){var d=l[f];delete c[d.start],delete d.start,delete d.end,d.forEach(function(h){n[h<0?~h:h]=1}),o.push(d)}}return u(r,i),u(i,r),t.forEach(function(l){n[l<0?~l:l]||o.push([l])}),o}function HI(e){return RC(e,GI.apply(this,arguments))}function GI(e,t,n){var i,r,o;if(arguments.length>1)i=VI(e,t,n);else for(r=0,i=new Array(o=e.arcs.length);r<o;++r)i[r]=r;return{type:"MultiLineString",arcs:WI(e,i)}}function VI(e,t,n){var i=[],r=[],o;function s(f){var d=f<0?~f:f;(r[d]||(r[d]=[])).push({i:f,g:o})}function a(f){f.forEach(s)}function u(f){f.forEach(a)}function l(f){f.forEach(u)}function c(f){switch(o=f,f.type){case"GeometryCollection":f.geometries.forEach(c);break;case"LineString":a(f.arcs);break;case"MultiLineString":case"Polygon":u(f.arcs);break;case"MultiPolygon":l(f.arcs);break}}return c(t),r.forEach(n==null?function(f){i.push(f[0].i)}:function(f){n(f[0].g,f[f.length-1].g)&&i.push(f[0].i)}),i}function YI(e,t){let n=0,i,r=0,o=0;if(t===void 0)for(let s of e)s!=null&&(s=+s)>=s&&(i=s-r,r+=i/++n,o+=i*(s-r));else{let s=-1;for(let a of e)(a=t(a,++s,e))!=null&&(a=+a)>=a&&(i=a-r,r+=i/++n,o+=i*(a-r))}if(n>1)return o/(n-1)}function XI(e,t){const n=YI(e,t);return n&&Math.sqrt(n)}class sn{constructor(){this._partials=new Float64Array(32),this._n=0}add(t){const n=this._partials;let i=0;for(let r=0;r<this._n&&r<32;r++){const o=n[r],s=t+o,a=Math.abs(t)<Math.abs(o)?t-(s-o):o-(s-t);a&&(n[i++]=a),t=s}return n[i]=t,this._n=i+1,this}valueOf(){const t=this._partials;let n=this._n,i,r,o,s=0;if(n>0){for(s=t[--n];n>0&&(i=s,r=t[--n],s=i+r,o=r-(s-i),!o););n>0&&(o<0&&t[n-1]<0||o>0&&t[n-1]>0)&&(r=o*2,i=s+r,r==i-s&&(s=i))}return s}}class qE extends Map{constructor(t,n=PC){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),t!=null)for(const[i,r]of t)this.set(i,r)}get(t){return super.get(t1(this,t))}has(t){return super.has(t1(this,t))}set(t,n){return super.set(NC(this,t),n)}delete(t){return super.delete(LC(this,t))}}class Pd extends Set{constructor(t,n=PC){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),t!=null)for(const i of t)this.add(i)}has(t){return super.has(t1(this,t))}add(t){return super.add(NC(this,t))}delete(t){return super.delete(LC(this,t))}}function t1({_intern:e,_key:t},n){const i=t(n);return e.has(i)?e.get(i):n}function NC({_intern:e,_key:t},n){const i=t(n);return e.has(i)?e.get(i):(e.set(i,n),n)}function LC({_intern:e,_key:t},n){const i=t(n);return e.has(i)&&(n=e.get(i),e.delete(i)),n}function PC(e){return e!==null&&typeof e=="object"?e.valueOf():e}function KI(e,t){return Array.from(t,n=>e[n])}function JI(e=rc){if(e===rc)return IC;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,n)=>{const i=e(t,n);return i||i===0?i:(e(n,n)===0)-(e(t,t)===0)}}function IC(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}function _s(e,t){let n;if(t===void 0)for(const i of e)i!=null&&(n<i||n===void 0&&i>=i)&&(n=i);else{let i=-1;for(let r of e)(r=t(r,++i,e))!=null&&(n<r||n===void 0&&r>=r)&&(n=r)}return n}function n1(e,t){let n;if(t===void 0)for(const i of e)i!=null&&(n>i||n===void 0&&i>=i)&&(n=i);else{let i=-1;for(let r of e)(r=t(r,++i,e))!=null&&(n>r||n===void 0&&r>=r)&&(n=r)}return n}function zC(e,t,n=0,i=1/0,r){if(t=Math.floor(t),n=Math.floor(Math.max(0,n)),i=Math.floor(Math.min(e.length-1,i)),!(n<=t&&t<=i))return e;for(r=r===void 0?IC:JI(r);i>n;){if(i-n>600){const u=i-n+1,l=t-n+1,c=Math.log(u),f=.5*Math.exp(2*c/3),d=.5*Math.sqrt(c*f*(u-f)/u)*(l-u/2<0?-1:1),h=Math.max(n,Math.floor(t-l*f/u+d)),g=Math.min(i,Math.floor(t+(u-l)*f/u+d));zC(e,t,h,g,r)}const o=e[t];let s=n,a=i;for(Zu(e,n,t),r(e[i],o)>0&&Zu(e,n,i);s<a;){for(Zu(e,s,a),++s,--a;r(e[s],o)<0;)++s;for(;r(e[a],o)>0;)--a}r(e[n],o)===0?Zu(e,n,a):(++a,Zu(e,a,i)),a<=t&&(n=a+1),t<=a&&(i=a-1)}return e}function Zu(e,t,n){const i=e[t];e[t]=e[n],e[n]=i}function i1(e,t,n){if(e=Float64Array.from(BP(e,n)),!(!(i=e.length)||isNaN(t=+t))){if(t<=0||i<2)return n1(e);if(t>=1)return _s(e);var i,r=(i-1)*t,o=Math.floor(r),s=_s(zC(e,o).subarray(0,o+1)),a=n1(e.subarray(o+1));return s+(a-s)*(r-o)}}function BC(e,t,n=UP){if(!(!(i=e.length)||isNaN(t=+t))){if(t<=0||i<2)return+n(e[0],0,e);if(t>=1)return+n(e[i-1],i-1,e);var i,r=(i-1)*t,o=Math.floor(r),s=+n(e[o],o,e),a=+n(e[o+1],o+1,e);return s+(a-s)*(r-o)}}function QI(e,t){let n=0,i=0;if(t===void 0)for(let r of e)r!=null&&(r=+r)>=r&&(++n,i+=r);else{let r=-1;for(let o of e)(o=t(o,++r,e))!=null&&(o=+o)>=o&&(++n,i+=o)}if(n)return i/n}function UC(e,t){return i1(e,.5,t)}function*ZI(e){for(const t of e)yield*t}function jC(e){return Array.from(ZI(e))}function Mn(e,t,n){e=+e,t=+t,n=(r=arguments.length)<2?(t=e,e=0,1):r<3?1:+n;for(var i=-1,r=Math.max(0,Math.ceil((t-e)/n))|0,o=new Array(r);++i<r;)o[i]=e+i*n;return o}function qC(e,t){let n=0;for(let i of e)(i=+i)&&(n+=i);return n}function ez(e,...t){e=new Pd(e),t=t.map(tz);e:for(const n of e)for(const i of t)if(!i.has(n)){e.delete(n);continue e}return e}function tz(e){return e instanceof Pd?e:new Pd(e)}function nz(...e){const t=new Pd;for(const n of e)for(const i of n)t.add(i);return t}const mm=new Date,ym=new Date;function lt(e,t,n,i){function r(o){return e(o=arguments.length===0?new Date:new Date(+o)),o}return r.floor=o=>(e(o=new Date(+o)),o),r.ceil=o=>(e(o=new Date(o-1)),t(o,1),e(o),o),r.round=o=>{const s=r(o),a=r.ceil(o);return o-s<a-o?s:a},r.offset=(o,s)=>(t(o=new Date(+o),s==null?1:Math.floor(s)),o),r.range=(o,s,a)=>{const u=[];if(o=r.ceil(o),a=a==null?1:Math.floor(a),!(o<s)||!(a>0))return u;let l;do u.push(l=new Date(+o)),t(o,a),e(o);while(l<o&&o<s);return u},r.filter=o=>lt(s=>{if(s>=s)for(;e(s),!o(s);)s.setTime(s-1)},(s,a)=>{if(s>=s)if(a<0)for(;++a<=0;)for(;t(s,-1),!o(s););else for(;--a>=0;)for(;t(s,1),!o(s););}),n&&(r.count=(o,s)=>(mm.setTime(+o),ym.setTime(+s),e(mm),e(ym),Math.floor(n(mm,ym))),r.every=o=>(o=Math.floor(o),!isFinite(o)||!(o>0)?null:o>1?r.filter(i?s=>i(s)%o===0:s=>r.count(0,s)%o===0):r)),r}const Va=lt(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);Va.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?lt(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):Va);Va.range;const Cr=1e3,Gn=Cr*60,Fr=Gn*60,Ur=Fr*24,Ab=Ur*7,WE=Ur*30,bm=Ur*365,Tr=lt(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*Cr)},(e,t)=>(t-e)/Cr,e=>e.getUTCSeconds());Tr.range;const pg=lt(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Cr)},(e,t)=>{e.setTime(+e+t*Gn)},(e,t)=>(t-e)/Gn,e=>e.getMinutes());pg.range;const mg=lt(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*Gn)},(e,t)=>(t-e)/Gn,e=>e.getUTCMinutes());mg.range;const yg=lt(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Cr-e.getMinutes()*Gn)},(e,t)=>{e.setTime(+e+t*Fr)},(e,t)=>(t-e)/Fr,e=>e.getHours());yg.range;const bg=lt(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*Fr)},(e,t)=>(t-e)/Fr,e=>e.getUTCHours());bg.range;const Rr=lt(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Gn)/Ur,e=>e.getDate()-1);Rr.range;const _o=lt(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Ur,e=>e.getUTCDate()-1);_o.range;const WC=lt(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Ur,e=>Math.floor(e/Ur));WC.range;function Qs(e){return lt(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,n)=>{t.setDate(t.getDate()+n*7)},(t,n)=>(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*Gn)/Ab)}const Mu=Qs(0),Id=Qs(1),iz=Qs(2),rz=Qs(3),Ya=Qs(4),oz=Qs(5),sz=Qs(6);Mu.range;Id.range;iz.range;rz.range;Ya.range;oz.range;sz.range;function Zs(e){return lt(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCDate(t.getUTCDate()+n*7)},(t,n)=>(n-t)/Ab)}const Du=Zs(0),zd=Zs(1),az=Zs(2),uz=Zs(3),Xa=Zs(4),lz=Zs(5),cz=Zs(6);Du.range;zd.range;az.range;uz.range;Xa.range;lz.range;cz.range;const oc=lt(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());oc.range;const sc=lt(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());sc.range;const Zi=lt(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());Zi.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:lt(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,n)=>{t.setFullYear(t.getFullYear()+n*e)});Zi.range;const er=lt(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());er.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:lt(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)});er.range;function HC(e,t,n,i,r,o){const s=[[Tr,1,Cr],[Tr,5,5*Cr],[Tr,15,15*Cr],[Tr,30,30*Cr],[o,1,Gn],[o,5,5*Gn],[o,15,15*Gn],[o,30,30*Gn],[r,1,Fr],[r,3,3*Fr],[r,6,6*Fr],[r,12,12*Fr],[i,1,Ur],[i,2,2*Ur],[n,1,Ab],[t,1,WE],[t,3,3*WE],[e,1,bm]];function a(l,c,f){const d=c<l;d&&([l,c]=[c,l]);const h=f&&typeof f.range=="function"?f:u(l,c,f),g=h?h.range(l,+c+1):[];return d?g.reverse():g}function u(l,c,f){const d=Math.abs(c-l)/f,h=ag(([,,m])=>m).right(s,d);if(h===s.length)return e.every(Os(l/bm,c/bm,f));if(h===0)return Va.every(Math.max(Os(l,c,f),1));const[g,p]=s[d/s[h-1][2]<s[h][2]/d?h-1:h];return g.every(p)}return[a,u]}const[fz,dz]=HC(er,sc,Du,WC,bg,mg),[hz,gz]=HC(Zi,oc,Mu,Rr,yg,pg),Ct="year",vn="quarter",Wt="month",st="week",xn="date",zt="day",tr="dayofyear",In="hours",zn="minutes",Zn="seconds",wi="milliseconds",$b=[Ct,vn,Wt,st,xn,zt,tr,In,zn,Zn,wi],vm=$b.reduce((e,t,n)=>(e[t]=1+n,e),{});function kb(e){const t=X(e).slice(),n={};return t.length||N("Missing time unit."),t.forEach(r=>{J(vm,r)?n[r]=1:N(`Invalid time unit: ${r}.`)}),(n[st]||n[zt]?1:0)+(n[vn]||n[Wt]||n[xn]?1:0)+(n[tr]?1:0)>1&&N(`Incompatible time units: ${e}`),t.sort((r,o)=>vm[r]-vm[o]),t}const pz={[Ct]:"%Y ",[vn]:"Q%q ",[Wt]:"%b ",[xn]:"%d ",[st]:"W%U ",[zt]:"%a ",[tr]:"%j ",[In]:"%H:00",[zn]:"00:%M",[Zn]:":%S",[wi]:".%L",[`${Ct}-${Wt}`]:"%Y-%m ",[`${Ct}-${Wt}-${xn}`]:"%Y-%m-%d ",[`${In}-${zn}`]:"%H:%M"};function GC(e,t){const n=he({},pz,t),i=kb(e),r=i.length;let o="",s=0,a,u;for(s=0;s<r;)for(a=i.length;a>s;--a)if(u=i.slice(s,a).join("-"),n[u]!=null){o+=n[u],s=a;break}return o.trim()}const ms=new Date;function Cb(e){return ms.setFullYear(e),ms.setMonth(0),ms.setDate(1),ms.setHours(0,0,0,0),ms}function VC(e){return XC(new Date(e))}function YC(e){return r1(new Date(e))}function XC(e){return Rr.count(Cb(e.getFullYear())-1,e)}function r1(e){return Mu.count(Cb(e.getFullYear())-1,e)}function o1(e){return Cb(e).getDay()}function mz(e,t,n,i,r,o,s){if(0<=e&&e<100){const a=new Date(-1,t,n,i,r,o,s);return a.setFullYear(e),a}return new Date(e,t,n,i,r,o,s)}function KC(e){return QC(new Date(e))}function JC(e){return s1(new Date(e))}function QC(e){const t=Date.UTC(e.getUTCFullYear(),0,1);return _o.count(t-1,e)}function s1(e){const t=Date.UTC(e.getUTCFullYear(),0,1);return Du.count(t-1,e)}function a1(e){return ms.setTime(Date.UTC(e,0,1)),ms.getUTCDay()}function yz(e,t,n,i,r,o,s){if(0<=e&&e<100){const a=new Date(Date.UTC(-1,t,n,i,r,o,s));return a.setUTCFullYear(n.y),a}return new Date(Date.UTC(e,t,n,i,r,o,s))}function ZC(e,t,n,i,r){const o=t||1,s=Ee(e),a=(y,b,v)=>(v=v||y,bz(n[v],i[v],y===s&&o,b)),u=new Date,l=xi(e),c=l[Ct]?a(Ct):Yt(2012),f=l[Wt]?a(Wt):l[vn]?a(vn):fo,d=l[st]&&l[zt]?a(zt,1,st+zt):l[st]?a(st,1):l[zt]?a(zt,1):l[xn]?a(xn,1):l[tr]?a(tr,1):ku,h=l[In]?a(In):fo,g=l[zn]?a(zn):fo,p=l[Zn]?a(Zn):fo,m=l[wi]?a(wi):fo;return function(y){u.setTime(+y);const b=c(u);return r(b,f(u),d(u,b),h(u),g(u),p(u),m(u))}}function bz(e,t,n,i){const r=n<=1?e:i?(o,s)=>i+n*Math.floor((e(o,s)-i)/n):(o,s)=>n*Math.floor(e(o,s)/n);return t?(o,s)=>t(r(o,s),s):r}function Ka(e,t,n){return t+e*7-(n+6)%7}const vz={[Ct]:e=>e.getFullYear(),[vn]:e=>Math.floor(e.getMonth()/3),[Wt]:e=>e.getMonth(),[xn]:e=>e.getDate(),[In]:e=>e.getHours(),[zn]:e=>e.getMinutes(),[Zn]:e=>e.getSeconds(),[wi]:e=>e.getMilliseconds(),[tr]:e=>XC(e),[st]:e=>r1(e),[st+zt]:(e,t)=>Ka(r1(e),e.getDay(),o1(t)),[zt]:(e,t)=>Ka(1,e.getDay(),o1(t))},xz={[vn]:e=>3*e,[st]:(e,t)=>Ka(e,0,o1(t))};function eF(e,t){return ZC(e,t||1,vz,xz,mz)}const wz={[Ct]:e=>e.getUTCFullYear(),[vn]:e=>Math.floor(e.getUTCMonth()/3),[Wt]:e=>e.getUTCMonth(),[xn]:e=>e.getUTCDate(),[In]:e=>e.getUTCHours(),[zn]:e=>e.getUTCMinutes(),[Zn]:e=>e.getUTCSeconds(),[wi]:e=>e.getUTCMilliseconds(),[tr]:e=>QC(e),[st]:e=>s1(e),[zt]:(e,t)=>Ka(1,e.getUTCDay(),a1(t)),[st+zt]:(e,t)=>Ka(s1(e),e.getUTCDay(),a1(t))},Ez={[vn]:e=>3*e,[st]:(e,t)=>Ka(e,0,a1(t))};function tF(e,t){return ZC(e,t||1,wz,Ez,yz)}const Sz={[Ct]:Zi,[vn]:oc.every(3),[Wt]:oc,[st]:Mu,[xn]:Rr,[zt]:Rr,[tr]:Rr,[In]:yg,[zn]:pg,[Zn]:Tr,[wi]:Va},_z={[Ct]:er,[vn]:sc.every(3),[Wt]:sc,[st]:Du,[xn]:_o,[zt]:_o,[tr]:_o,[In]:bg,[zn]:mg,[Zn]:Tr,[wi]:Va};function Ou(e){return Sz[e]}function Ru(e){return _z[e]}function nF(e,t,n){return e?e.offset(t,n):void 0}function iF(e,t,n){return nF(Ou(e),t,n)}function rF(e,t,n){return nF(Ru(e),t,n)}function oF(e,t,n,i){return e?e.range(t,n,i):void 0}function sF(e,t,n,i){return oF(Ou(e),t,n,i)}function aF(e,t,n,i){return oF(Ru(e),t,n,i)}const _l=1e3,Al=_l*60,$l=Al*60,vg=$l*24,Az=vg*7,HE=vg*30,u1=vg*365,uF=[Ct,Wt,xn,In,zn,Zn,wi],kl=uF.slice(0,-1),Cl=kl.slice(0,-1),Fl=Cl.slice(0,-1),$z=Fl.slice(0,-1),kz=[Ct,st],GE=[Ct,Wt],lF=[Ct],el=[[kl,1,_l],[kl,5,5*_l],[kl,15,15*_l],[kl,30,30*_l],[Cl,1,Al],[Cl,5,5*Al],[Cl,15,15*Al],[Cl,30,30*Al],[Fl,1,$l],[Fl,3,3*$l],[Fl,6,6*$l],[Fl,12,12*$l],[$z,1,vg],[kz,1,Az],[GE,1,HE],[GE,3,3*HE],[lF,1,u1]];function cF(e){const t=e.extent,n=e.maxbins||40,i=Math.abs(Nc(t))/n;let r=ag(a=>a[2]).right(el,i),o,s;return r===el.length?(o=lF,s=Os(t[0]/u1,t[1]/u1,n)):r?(r=el[i/el[r-1][2]<el[r][2]/i?r-1:r],o=r[0],s=r[1]):(o=uF,s=Math.max(Os(t[0],t[1],n),1)),{units:o,step:s}}function xm(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function wm(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function tl(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function fF(e){var t=e.dateTime,n=e.date,i=e.time,r=e.periods,o=e.days,s=e.shortDays,a=e.months,u=e.shortMonths,l=nl(r),c=il(r),f=nl(o),d=il(o),h=nl(s),g=il(s),p=nl(a),m=il(a),y=nl(u),b=il(u),v={a:L,A:z,b:I,B:Q,c:null,d:QE,e:QE,f:Kz,g:s6,G:u6,H:Vz,I:Yz,j:Xz,L:dF,m:Jz,M:Qz,p:ue,q:oe,Q:tS,s:nS,S:Zz,u:e6,U:t6,V:n6,w:i6,W:r6,x:null,X:null,y:o6,Y:a6,Z:l6,"%":eS},x={a:fe,A:Pe,b:de,B:Dt,c:null,d:ZE,e:ZE,f:h6,g:S6,G:A6,H:c6,I:f6,j:d6,L:gF,m:g6,M:p6,p:ts,q:to,Q:tS,s:nS,S:m6,u:y6,U:b6,V:v6,w:x6,W:w6,x:null,X:null,y:E6,Y:_6,Z:$6,"%":eS},E={a:k,A:C,b:O,B:M,c:F,d:KE,e:KE,f:qz,g:XE,G:YE,H:JE,I:JE,j:zz,L:jz,m:Iz,M:Bz,p:A,q:Pz,Q:Hz,s:Gz,S:Uz,u:Dz,U:Oz,V:Rz,w:Mz,W:Nz,x:$,X:T,y:XE,Y:YE,Z:Lz,"%":Wz};v.x=S(n,v),v.X=S(i,v),v.c=S(t,v),x.x=S(n,x),x.X=S(i,x),x.c=S(t,x);function S(Z,pe){return function(ye){var W=[],xt=-1,Te=0,Ot=Z.length,ft,Ni,_f;for(ye instanceof Date||(ye=new Date(+ye));++xt<Ot;)Z.charCodeAt(xt)===37&&(W.push(Z.slice(Te,xt)),(Ni=VE[ft=Z.charAt(++xt)])!=null?ft=Z.charAt(++xt):Ni=ft==="e"?" ":"0",(_f=pe[ft])&&(ft=_f(ye,Ni)),W.push(ft),Te=xt+1);return W.push(Z.slice(Te,xt)),W.join("")}}function w(Z,pe){return function(ye){var W=tl(1900,void 0,1),xt=_(W,Z,ye+="",0),Te,Ot;if(xt!=ye.length)return null;if("Q"in W)return new Date(W.Q);if("s"in W)return new Date(W.s*1e3+("L"in W?W.L:0));if(pe&&!("Z"in W)&&(W.Z=0),"p"in W&&(W.H=W.H%12+W.p*12),W.m===void 0&&(W.m="q"in W?W.q:0),"V"in W){if(W.V<1||W.V>53)return null;"w"in W||(W.w=1),"Z"in W?(Te=wm(tl(W.y,0,1)),Ot=Te.getUTCDay(),Te=Ot>4||Ot===0?zd.ceil(Te):zd(Te),Te=_o.offset(Te,(W.V-1)*7),W.y=Te.getUTCFullYear(),W.m=Te.getUTCMonth(),W.d=Te.getUTCDate()+(W.w+6)%7):(Te=xm(tl(W.y,0,1)),Ot=Te.getDay(),Te=Ot>4||Ot===0?Id.ceil(Te):Id(Te),Te=Rr.offset(Te,(W.V-1)*7),W.y=Te.getFullYear(),W.m=Te.getMonth(),W.d=Te.getDate()+(W.w+6)%7)}else("W"in W||"U"in W)&&("w"in W||(W.w="u"in W?W.u%7:"W"in W?1:0),Ot="Z"in W?wm(tl(W.y,0,1)).getUTCDay():xm(tl(W.y,0,1)).getDay(),W.m=0,W.d="W"in W?(W.w+6)%7+W.W*7-(Ot+5)%7:W.w+W.U*7-(Ot+6)%7);return"Z"in W?(W.H+=W.Z/100|0,W.M+=W.Z%100,wm(W)):xm(W)}}function _(Z,pe,ye,W){for(var xt=0,Te=pe.length,Ot=ye.length,ft,Ni;xt<Te;){if(W>=Ot)return-1;if(ft=pe.charCodeAt(xt++),ft===37){if(ft=pe.charAt(xt++),Ni=E[ft in VE?pe.charAt(xt++):ft],!Ni||(W=Ni(Z,ye,W))<0)return-1}else if(ft!=ye.charCodeAt(W++))return-1}return W}function A(Z,pe,ye){var W=l.exec(pe.slice(ye));return W?(Z.p=c.get(W[0].toLowerCase()),ye+W[0].length):-1}function k(Z,pe,ye){var W=h.exec(pe.slice(ye));return W?(Z.w=g.get(W[0].toLowerCase()),ye+W[0].length):-1}function C(Z,pe,ye){var W=f.exec(pe.slice(ye));return W?(Z.w=d.get(W[0].toLowerCase()),ye+W[0].length):-1}function O(Z,pe,ye){var W=y.exec(pe.slice(ye));return W?(Z.m=b.get(W[0].toLowerCase()),ye+W[0].length):-1}function M(Z,pe,ye){var W=p.exec(pe.slice(ye));return W?(Z.m=m.get(W[0].toLowerCase()),ye+W[0].length):-1}function F(Z,pe,ye){return _(Z,t,pe,ye)}function $(Z,pe,ye){return _(Z,n,pe,ye)}function T(Z,pe,ye){return _(Z,i,pe,ye)}function L(Z){return s[Z.getDay()]}function z(Z){return o[Z.getDay()]}function I(Z){return u[Z.getMonth()]}function Q(Z){return a[Z.getMonth()]}function ue(Z){return r[+(Z.getHours()>=12)]}function oe(Z){return 1+~~(Z.getMonth()/3)}function fe(Z){return s[Z.getUTCDay()]}function Pe(Z){return o[Z.getUTCDay()]}function de(Z){return u[Z.getUTCMonth()]}function Dt(Z){return a[Z.getUTCMonth()]}function ts(Z){return r[+(Z.getUTCHours()>=12)]}function to(Z){return 1+~~(Z.getUTCMonth()/3)}return{format:function(Z){var pe=S(Z+="",v);return pe.toString=function(){return Z},pe},parse:function(Z){var pe=w(Z+="",!1);return pe.toString=function(){return Z},pe},utcFormat:function(Z){var pe=S(Z+="",x);return pe.toString=function(){return Z},pe},utcParse:function(Z){var pe=w(Z+="",!0);return pe.toString=function(){return Z},pe}}}var VE={"-":"",_:" ",0:"0"},bt=/^\s*\d+/,Cz=/^%/,Fz=/[\\^$*+?|[\]().{}]/g;function $e(e,t,n){var i=e<0?"-":"",r=(i?-e:e)+"",o=r.length;return i+(o<n?new Array(n-o+1).join(t)+r:r)}function Tz(e){return e.replace(Fz,"\\$&")}function nl(e){return new RegExp("^(?:"+e.map(Tz).join("|")+")","i")}function il(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function Mz(e,t,n){var i=bt.exec(t.slice(n,n+1));return i?(e.w=+i[0],n+i[0].length):-1}function Dz(e,t,n){var i=bt.exec(t.slice(n,n+1));return i?(e.u=+i[0],n+i[0].length):-1}function Oz(e,t,n){var i=bt.exec(t.slice(n,n+2));return i?(e.U=+i[0],n+i[0].length):-1}function Rz(e,t,n){var i=bt.exec(t.slice(n,n+2));return i?(e.V=+i[0],n+i[0].length):-1}function Nz(e,t,n){var i=bt.exec(t.slice(n,n+2));return i?(e.W=+i[0],n+i[0].length):-1}function YE(e,t,n){var i=bt.exec(t.slice(n,n+4));return i?(e.y=+i[0],n+i[0].length):-1}function XE(e,t,n){var i=bt.exec(t.slice(n,n+2));return i?(e.y=+i[0]+(+i[0]>68?1900:2e3),n+i[0].length):-1}function Lz(e,t,n){var i=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return i?(e.Z=i[1]?0:-(i[2]+(i[3]||"00")),n+i[0].length):-1}function Pz(e,t,n){var i=bt.exec(t.slice(n,n+1));return i?(e.q=i[0]*3-3,n+i[0].length):-1}function Iz(e,t,n){var i=bt.exec(t.slice(n,n+2));return i?(e.m=i[0]-1,n+i[0].length):-1}function KE(e,t,n){var i=bt.exec(t.slice(n,n+2));return i?(e.d=+i[0],n+i[0].length):-1}function zz(e,t,n){var i=bt.exec(t.slice(n,n+3));return i?(e.m=0,e.d=+i[0],n+i[0].length):-1}function JE(e,t,n){var i=bt.exec(t.slice(n,n+2));return i?(e.H=+i[0],n+i[0].length):-1}function Bz(e,t,n){var i=bt.exec(t.slice(n,n+2));return i?(e.M=+i[0],n+i[0].length):-1}function Uz(e,t,n){var i=bt.exec(t.slice(n,n+2));return i?(e.S=+i[0],n+i[0].length):-1}function jz(e,t,n){var i=bt.exec(t.slice(n,n+3));return i?(e.L=+i[0],n+i[0].length):-1}function qz(e,t,n){var i=bt.exec(t.slice(n,n+6));return i?(e.L=Math.floor(i[0]/1e3),n+i[0].length):-1}function Wz(e,t,n){var i=Cz.exec(t.slice(n,n+1));return i?n+i[0].length:-1}function Hz(e,t,n){var i=bt.exec(t.slice(n));return i?(e.Q=+i[0],n+i[0].length):-1}function Gz(e,t,n){var i=bt.exec(t.slice(n));return i?(e.s=+i[0],n+i[0].length):-1}function QE(e,t){return $e(e.getDate(),t,2)}function Vz(e,t){return $e(e.getHours(),t,2)}function Yz(e,t){return $e(e.getHours()%12||12,t,2)}function Xz(e,t){return $e(1+Rr.count(Zi(e),e),t,3)}function dF(e,t){return $e(e.getMilliseconds(),t,3)}function Kz(e,t){return dF(e,t)+"000"}function Jz(e,t){return $e(e.getMonth()+1,t,2)}function Qz(e,t){return $e(e.getMinutes(),t,2)}function Zz(e,t){return $e(e.getSeconds(),t,2)}function e6(e){var t=e.getDay();return t===0?7:t}function t6(e,t){return $e(Mu.count(Zi(e)-1,e),t,2)}function hF(e){var t=e.getDay();return t>=4||t===0?Ya(e):Ya.ceil(e)}function n6(e,t){return e=hF(e),$e(Ya.count(Zi(e),e)+(Zi(e).getDay()===4),t,2)}function i6(e){return e.getDay()}function r6(e,t){return $e(Id.count(Zi(e)-1,e),t,2)}function o6(e,t){return $e(e.getFullYear()%100,t,2)}function s6(e,t){return e=hF(e),$e(e.getFullYear()%100,t,2)}function a6(e,t){return $e(e.getFullYear()%1e4,t,4)}function u6(e,t){var n=e.getDay();return e=n>=4||n===0?Ya(e):Ya.ceil(e),$e(e.getFullYear()%1e4,t,4)}function l6(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+$e(t/60|0,"0",2)+$e(t%60,"0",2)}function ZE(e,t){return $e(e.getUTCDate(),t,2)}function c6(e,t){return $e(e.getUTCHours(),t,2)}function f6(e,t){return $e(e.getUTCHours()%12||12,t,2)}function d6(e,t){return $e(1+_o.count(er(e),e),t,3)}function gF(e,t){return $e(e.getUTCMilliseconds(),t,3)}function h6(e,t){return gF(e,t)+"000"}function g6(e,t){return $e(e.getUTCMonth()+1,t,2)}function p6(e,t){return $e(e.getUTCMinutes(),t,2)}function m6(e,t){return $e(e.getUTCSeconds(),t,2)}function y6(e){var t=e.getUTCDay();return t===0?7:t}function b6(e,t){return $e(Du.count(er(e)-1,e),t,2)}function pF(e){var t=e.getUTCDay();return t>=4||t===0?Xa(e):Xa.ceil(e)}function v6(e,t){return e=pF(e),$e(Xa.count(er(e),e)+(er(e).getUTCDay()===4),t,2)}function x6(e){return e.getUTCDay()}function w6(e,t){return $e(zd.count(er(e)-1,e),t,2)}function E6(e,t){return $e(e.getUTCFullYear()%100,t,2)}function S6(e,t){return e=pF(e),$e(e.getUTCFullYear()%100,t,2)}function _6(e,t){return $e(e.getUTCFullYear()%1e4,t,4)}function A6(e,t){var n=e.getUTCDay();return e=n>=4||n===0?Xa(e):Xa.ceil(e),$e(e.getUTCFullYear()%1e4,t,4)}function $6(){return"+0000"}function eS(){return"%"}function tS(e){return+e}function nS(e){return Math.floor(+e/1e3)}var ma,Fb,mF,Tb,yF;k6({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function k6(e){return ma=fF(e),Fb=ma.format,mF=ma.parse,Tb=ma.utcFormat,yF=ma.utcParse,ma}function Tl(e){const t={};return n=>t[n]||(t[n]=e(n))}function C6(e,t){return n=>{const i=e(n),r=i.indexOf(t);if(r<0)return i;let o=F6(i,r);const s=o<i.length?i.slice(o):"";for(;--o>r;)if(i[o]!=="0"){++o;break}return i.slice(0,o)+s}}function F6(e,t){let n=e.lastIndexOf("e"),i;if(n>0)return n;for(n=e.length;--n>t;)if(i=e.charCodeAt(n),i>=48&&i<=57)return n+1}function bF(e){const t=Tl(e.format),n=e.formatPrefix;return{format:t,formatPrefix:n,formatFloat(i){const r=Z0(i||",");if(r.precision==null){switch(r.precision=12,r.type){case"%":r.precision-=2;break;case"e":r.precision-=1;break}return C6(t(r),t(".1f")(1)[1])}else return t(r)},formatSpan(i,r,o,s){s=Z0(s??",f");const a=Os(i,r,o),u=Math.max(Math.abs(i),Math.abs(r));let l;if(s.precision==null)switch(s.type){case"s":return isNaN(l=WP(a,u))||(s.precision=l),n(s,u);case"":case"e":case"g":case"p":case"r":{isNaN(l=qP(a,u))||(s.precision=l-(s.type==="e"));break}case"f":case"%":{isNaN(l=jP(a))||(s.precision=l-(s.type==="%")*2);break}}return t(s)}}}let l1;vF();function vF(){return l1=bF({format:aC,formatPrefix:JP})}function xF(e){return bF(KP(e))}function Bd(e){return arguments.length?l1=xF(e):l1}function iS(e,t,n){n=n||{},Y(n)||N(`Invalid time multi-format specifier: ${n}`);const i=t(Zn),r=t(zn),o=t(In),s=t(xn),a=t(st),u=t(Wt),l=t(vn),c=t(Ct),f=e(n[wi]||".%L"),d=e(n[Zn]||":%S"),h=e(n[zn]||"%I:%M"),g=e(n[In]||"%I %p"),p=e(n[xn]||n[zt]||"%a %d"),m=e(n[st]||"%b %d"),y=e(n[Wt]||"%B"),b=e(n[vn]||"%B"),v=e(n[Ct]||"%Y");return x=>(i(x)<x?f:r(x)<x?d:o(x)<x?h:s(x)<x?g:u(x)<x?a(x)<x?p:m:c(x)<x?l(x)<x?y:b:v)(x)}function wF(e){const t=Tl(e.format),n=Tl(e.utcFormat);return{timeFormat:i=>K(i)?t(i):iS(t,Ou,i),utcFormat:i=>K(i)?n(i):iS(n,Ru,i),timeParse:Tl(e.parse),utcParse:Tl(e.utcParse)}}let c1;EF();function EF(){return c1=wF({format:Fb,parse:mF,utcFormat:Tb,utcParse:yF})}function SF(e){return wF(fF(e))}function ac(e){return arguments.length?c1=SF(e):c1}const f1=(e,t)=>he({},e,t);function _F(e,t){const n=e?xF(e):Bd(),i=t?SF(t):ac();return f1(n,i)}function Mb(e,t){const n=arguments.length;return n&&n!==2&&N("defaultLocale expects either zero or two arguments."),n?f1(Bd(e),ac(t)):f1(Bd(),ac())}function T6(){return vF(),EF(),Mb()}const M6=/^(data:|([A-Za-z]+:)?\/\/)/,D6=/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp|file|data):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i,O6=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205f\u3000]/g,rS="file://";function R6(e,t){return n=>({options:n||{},sanitize:L6,load:N6,fileAccess:!1,file:P6(t),http:z6(e)})}async function N6(e,t){const n=await this.sanitize(e,t),i=n.href;return n.localFile?this.file(i):this.http(i,t)}async function L6(e,t){t=he({},this.options,t);const n=this.fileAccess,i={href:null};let r,o,s;const a=D6.test(e.replace(O6,""));(e==null||typeof e!="string"||!a)&&N("Sanitize failure, invalid URI: "+H(e));const u=M6.test(e);return(s=t.baseURL)&&!u&&(!e.startsWith("/")&&!s.endsWith("/")&&(e="/"+e),e=s+e),o=(r=e.startsWith(rS))||t.mode==="file"||t.mode!=="http"&&!u&&n,r?e=e.slice(rS.length):e.startsWith("//")&&(t.defaultProtocol==="file"?(e=e.slice(2),o=!0):e=(t.defaultProtocol||"http")+":"+e),Object.defineProperty(i,"localFile",{value:!!o}),i.href=e,t.target&&(i.target=t.target+""),t.rel&&(i.rel=t.rel+""),t.context==="image"&&t.crossOrigin&&(i.crossOrigin=t.crossOrigin+""),i}function P6(e){return e?t=>new Promise((n,i)=>{e.readFile(t,(r,o)=>{r?i(r):n(o)})}):I6}async function I6(){N("No file system access.")}function z6(e){return e?async function(t,n){const i=he({},this.options.http,n),r=n&&n.response,o=await e(t,i);return o.ok?ge(o[r])?o[r]():o.text():N(o.status+""+o.statusText)}:B6}async function B6(){N("No HTTP fetch method available.")}const U6=e=>e!=null&&e===e,j6=e=>e==="true"||e==="false"||e===!0||e===!1,q6=e=>!Number.isNaN(Date.parse(e)),AF=e=>!Number.isNaN(+e)&&!(e instanceof Date),W6=e=>AF(e)&&Number.isInteger(+e),d1={boolean:Eb,integer:Ut,number:Ut,date:Sb,string:_b,unknown:Vt},$f=[j6,W6,AF,q6],H6=["boolean","integer","number","date"];function $F(e,t){if(!e||!e.length)return"unknown";const n=e.length,i=$f.length,r=$f.map((o,s)=>s+1);for(let o=0,s=0,a,u;o<n;++o)for(u=t?e[o][t]:e[o],a=0;a<i;++a)if(r[a]&&U6(u)&&!$f[a](u)&&(r[a]=0,++s,s===$f.length))return"string";return H6[r.reduce((o,s)=>o===0?s:o,0)-1]}function kF(e,t){return t.reduce((n,i)=>(n[i]=$F(e,i),n),{})}function oS(e){const t=function(n,i){const r={delimiter:e};return Db(n,i?he(i,r):r)};return t.responseType="text",t}function Db(e,t){return t.header&&(e=t.header.map(H).join(t.delimiter)+`
|
6
|
+
`+e),zI(t.delimiter).parse(e+"")}Db.responseType="text";function G6(e){return typeof Buffer=="function"&&ge(Buffer.isBuffer)?Buffer.isBuffer(e):!1}function Ob(e,t){const n=t&&t.property?Qn(t.property):Vt;return Y(e)&&!G6(e)?V6(n(e),t):n(JSON.parse(e))}Ob.responseType="json";function V6(e,t){return!P(e)&&$C(e)&&(e=[...e]),t&&t.copy?JSON.parse(JSON.stringify(e)):e}const Y6={interior:(e,t)=>e!==t,exterior:(e,t)=>e===t};function CF(e,t){let n,i,r,o;return e=Ob(e,t),t&&t.feature?(n=qI,r=t.feature):t&&t.mesh?(n=HI,r=t.mesh,o=Y6[t.filter]):N("Missing TopoJSON feature or mesh parameter."),i=(i=e.objects[r])?n(e,i,o):N("Invalid TopoJSON object: "+r),i&&i.features||[i]}CF.responseType="json";const ld={dsv:Db,csv:oS(","),tsv:oS(" "),json:Ob,topojson:CF};function Rb(e,t){return arguments.length>1?(ld[e]=t,this):J(ld,e)?ld[e]:null}function FF(e){const t=Rb(e);return t&&t.responseType||"text"}function TF(e,t,n,i){t=t||{};const r=Rb(t.type||"json");return r||N("Unknown data format type: "+t.type),e=r(e,t),t.parse&&X6(e,t.parse,n,i),J(e,"columns")&&delete e.columns,e}function X6(e,t,n,i){if(!e.length)return;const r=ac();n=n||r.timeParse,i=i||r.utcParse;let o=e.columns||Object.keys(e[0]),s,a,u,l,c,f;t==="auto"&&(t=kF(e,o)),o=Object.keys(t);const d=o.map(h=>{const g=t[h];let p,m;if(g&&(g.startsWith("date:")||g.startsWith("utc:")))return p=g.split(/:(.+)?/,2),m=p[1],(m[0]==="'"&&m[m.length-1]==="'"||m[0]==='"'&&m[m.length-1]==='"')&&(m=m.slice(1,-1)),(p[0]==="utc"?i:n)(m);if(!d1[g])throw Error("Illegal format pattern: "+h+":"+g);return d1[g]});for(u=0,c=e.length,f=o.length;u<c;++u)for(s=e[u],l=0;l<f;++l)a=o[l],s[a]=d[l](s[a])}const xg=R6(typeof fetch<"u"&&fetch,null);function wg(e){const t=e||Vt,n=[],i={};return n.add=r=>{const o=t(r);return i[o]||(i[o]=1,n.push(r)),n},n.remove=r=>{const o=t(r);if(i[o]){i[o]=0;const s=n.indexOf(r);s>=0&&n.splice(s,1)}return n},n}async function cd(e,t){try{await t(e)}catch(n){e.error(n)}}const MF=Symbol("vega_id");let K6=1;function Eg(e){return!!(e&&ie(e))}function ie(e){return e[MF]}function DF(e,t){return e[MF]=t,e}function Ce(e){const t=e===Object(e)?e:{data:e};return ie(t)?t:DF(t,K6++)}function Nb(e){return Sg(e,Ce({}))}function Sg(e,t){for(const n in e)t[n]=e[n];return t}function OF(e,t){return DF(t,ie(e))}function ea(e,t){return e?t?(n,i)=>e(n,i)||ie(t(n))-ie(t(i)):(n,i)=>e(n,i)||ie(n)-ie(i):null}function RF(e){return e&&e.constructor===ta}function ta(){const e=[],t=[],n=[],i=[],r=[];let o=null,s=!1;return{constructor:ta,insert(a){const u=X(a),l=u.length;for(let c=0;c<l;++c)e.push(u[c]);return this},remove(a){const u=ge(a)?i:t,l=X(a),c=l.length;for(let f=0;f<c;++f)u.push(l[f]);return this},modify(a,u,l){const c={field:u,value:Yt(l)};return ge(a)?(c.filter=a,r.push(c)):(c.tuple=a,n.push(c)),this},encode(a,u){return ge(a)?r.push({filter:a,field:u}):n.push({tuple:a,field:u}),this},clean(a){return o=a,this},reflow(){return s=!0,this},pulse(a,u){const l={},c={};let f,d,h,g,p,m;for(f=0,d=u.length;f<d;++f)l[ie(u[f])]=1;for(f=0,d=t.length;f<d;++f)p=t[f],l[ie(p)]=-1;for(f=0,d=i.length;f<d;++f)g=i[f],u.forEach(b=>{g(b)&&(l[ie(b)]=-1)});for(f=0,d=e.length;f<d;++f)p=e[f],m=ie(p),l[m]?l[m]=1:a.add.push(Ce(e[f]));for(f=0,d=u.length;f<d;++f)p=u[f],l[ie(p)]<0&&a.rem.push(p);function y(b,v,x){x?b[v]=x(b):a.encode=v,s||(c[ie(b)]=b)}for(f=0,d=n.length;f<d;++f)h=n[f],p=h.tuple,g=h.field,m=l[ie(p)],m>0&&(y(p,g,h.value),a.modifies(g));for(f=0,d=r.length;f<d;++f)h=r[f],g=h.filter,u.forEach(b=>{g(b)&&l[ie(b)]>0&&y(b,h.field,h.value)}),a.modifies(h.field);if(s)a.mod=t.length||i.length?u.filter(b=>l[ie(b)]>0):u.slice();else for(m in c)a.mod.push(c[m]);return(o||o==null&&(t.length||i.length))&&a.clean(!0),a}}}const fd="_:mod:_";function _g(){Object.defineProperty(this,fd,{writable:!0,value:{}})}_g.prototype={set(e,t,n,i){const r=this,o=r[e],s=r[fd];return t!=null&&t>=0?(o[t]!==n||i)&&(o[t]=n,s[t+":"+e]=-1,s[e]=-1):(o!==n||i)&&(r[e]=n,s[e]=P(n)?1+n.length:-1),r},modified(e,t){const n=this[fd];if(arguments.length){if(P(e)){for(let i=0;i<e.length;++i)if(n[e[i]])return!0;return!1}}else{for(const i in n)if(n[i])return!0;return!1}return t!=null&&t>=0?t+1<n[e]||!!n[t+":"+e]:!!n[e]},clear(){return this[fd]={},this}};let J6=0;const Q6="pulse",Z6=new _g,e4=1,t4=2;function Ie(e,t,n,i){this.id=++J6,this.value=e,this.stamp=-1,this.rank=-1,this.qrank=-1,this.flags=0,t&&(this._update=t),n&&this.parameters(n,i)}function sS(e){return function(t){const n=this.flags;return arguments.length===0?!!(n&e):(this.flags=t?n|e:n&~e,this)}}Ie.prototype={targets(){return this._targets||(this._targets=wg(Rc))},set(e){return this.value!==e?(this.value=e,1):0},skip:sS(e4),modified:sS(t4),parameters(e,t,n){t=t!==!1;const i=this._argval=this._argval||new _g,r=this._argops=this._argops||[],o=[];let s,a,u,l;const c=(f,d,h)=>{h instanceof Ie?(h!==this&&(t&&h.targets().add(this),o.push(h)),r.push({op:h,name:f,index:d})):i.set(f,d,h)};for(s in e)if(a=e[s],s===Q6)X(a).forEach(f=>{f instanceof Ie?f!==this&&(f.targets().add(this),o.push(f)):N("Pulse parameters must be operator instances.")}),this.source=a;else if(P(a))for(i.set(s,-1,Array(u=a.length)),l=0;l<u;++l)c(s,l,a[l]);else c(s,-1,a);return this.marshall().clear(),n&&(r.initonly=!0),o},marshall(e){const t=this._argval||Z6,n=this._argops;let i,r,o,s;if(n){const a=n.length;for(r=0;r<a;++r)i=n[r],o=i.op,s=o.modified()&&o.stamp===e,t.set(i.name,i.index,o.value,s);if(n.initonly){for(r=0;r<a;++r)i=n[r],i.op.targets().remove(this);this._argops=null,this._update=null}}return t},detach(){const e=this._argops;let t,n,i,r;if(e)for(t=0,n=e.length;t<n;++t)i=e[t],r=i.op,r._targets&&r._targets.remove(this);this.pulse=null,this.source=null},evaluate(e){const t=this._update;if(t){const n=this.marshall(e.stamp),i=t.call(this,n,e);if(n.clear(),i!==this.value)this.value=i;else if(!this.modified())return e.StopPropagation}},run(e){if(e.stamp<this.stamp)return e.StopPropagation;let t;return this.skip()?(this.skip(!1),t=0):t=this.evaluate(e),this.pulse=t||e}};function n4(e,t,n,i){let r=1,o;return e instanceof Ie?o=e:e&&e.prototype instanceof Ie?o=new e:ge(e)?o=new Ie(null,e):(r=0,o=new Ie(e,t)),this.rank(o),r&&(i=n,n=t),n&&this.connect(o,o.parameters(n,i)),this.touch(o),o}function i4(e,t){const n=e.rank,i=t.length;for(let r=0;r<i;++r)if(n<t[r].rank){this.rerank(e);return}}let r4=0;function Ag(e,t,n){this.id=++r4,this.value=null,n&&(this.receive=n),e&&(this._filter=e),t&&(this._apply=t)}function ro(e,t,n){return new Ag(e,t,n)}Ag.prototype={_filter:Pn,_apply:Vt,targets(){return this._targets||(this._targets=wg(Rc))},consume(e){return arguments.length?(this._consume=!!e,this):!!this._consume},receive(e){if(this._filter(e)){const t=this.value=this._apply(e),n=this._targets,i=n?n.length:0;for(let r=0;r<i;++r)n[r].receive(t);this._consume&&(e.preventDefault(),e.stopPropagation())}},filter(e){const t=ro(e);return this.targets().add(t),t},apply(e){const t=ro(null,e);return this.targets().add(t),t},merge(){const e=ro();this.targets().add(e);for(let t=0,n=arguments.length;t<n;++t)arguments[t].targets().add(e);return e},throttle(e){let t=-1;return this.filter(()=>{const n=Date.now();return n-t>e?(t=n,1):0})},debounce(e){const t=ro();return this.targets().add(ro(null,null,xb(e,n=>{const i=n.dataflow;t.receive(n),i&&i.run&&i.run()}))),t},between(e,t){let n=!1;return e.targets().add(ro(null,null,()=>n=!0)),t.targets().add(ro(null,null,()=>n=!1)),this.filter(()=>n)},detach(){this._filter=Pn,this._targets=null}};function o4(e,t,n,i){const r=this,o=ro(n,i),s=function(l){l.dataflow=r;try{o.receive(l)}catch(c){r.error(c)}finally{r.run()}};let a;typeof e=="string"&&typeof document<"u"?a=document.querySelectorAll(e):a=X(e);const u=a.length;for(let l=0;l<u;++l)a[l].addEventListener(t,s);return o}function s4(e,t){const n=this.locale();return TF(e,t,n.timeParse,n.utcParse)}function a4(e,t,n){return t=this.parse(t,n),this.pulse(e,this.changeset().insert(t))}async function u4(e,t){const n=this;let i=0,r;try{r=await n.loader().load(e,{context:"dataflow",response:FF(t&&t.type)});try{r=n.parse(r,t)}catch(o){i=-2,n.warn("Data ingestion failed",e,o)}}catch(o){i=-1,n.warn("Loading failed",e,o)}return{data:r,status:i}}async function l4(e,t,n){const i=this,r=i._pending||c4(i);r.requests+=1;const o=await i.request(t,n);return i.pulse(e,i.changeset().remove(Pn).insert(o.data||[])),r.done(),o}function c4(e){let t;const n=new Promise(i=>t=i);return n.requests=0,n.done=()=>{--n.requests===0&&(e._pending=null,t(e))},e._pending=n}const f4={skip:!0};function d4(e,t,n,i,r){return(e instanceof Ie?g4:h4)(this,e,t,n,i,r),this}function h4(e,t,n,i,r,o){const s=he({},o,f4);let a,u;ge(n)||(n=Yt(n)),i===void 0?a=l=>e.touch(n(l)):ge(i)?(u=new Ie(null,i,r,!1),a=l=>{u.evaluate(l);const c=n(l),f=u.value;RF(f)?e.pulse(c,f,o):e.update(c,f,s)}):a=l=>e.update(n(l),i,s),t.apply(a)}function g4(e,t,n,i,r,o){if(i===void 0)t.targets().add(n);else{const s=o||{},a=new Ie(null,p4(n,i),r,!1);a.modified(s.force),a.rank=t.rank,t.targets().add(a),n&&(a.skip(!0),a.value=n.value,a.targets().add(n),e.connect(n,[a]))}}function p4(e,t){return t=ge(t)?t:Yt(t),e?function(n,i){const r=t(n,i);return e.skip()||(e.skip(r!==this.value).value=r),r}:t}function m4(e){e.rank=++this._rank}function y4(e){const t=[e];let n,i,r;for(;t.length;)if(this.rank(n=t.pop()),i=n._targets)for(r=i.length;--r>=0;)t.push(n=i[r]),n===e&&N("Cycle detected in dataflow graph.")}const Ud={},Bi=1,ao=2,Sr=4,b4=Bi|ao,aS=Bi|Sr,ya=Bi|ao|Sr,uS=8,rl=16,lS=32,cS=64;function Ao(e,t,n){this.dataflow=e,this.stamp=t??-1,this.add=[],this.rem=[],this.mod=[],this.fields=null,this.encode=n||null}function Em(e,t){const n=[];return so(e,t,i=>n.push(i)),n}function fS(e,t){const n={};return e.visit(t,i=>{n[ie(i)]=1}),i=>n[ie(i)]?null:i}function kf(e,t){return e?(n,i)=>e(n,i)&&t(n,i):t}Ao.prototype={StopPropagation:Ud,ADD:Bi,REM:ao,MOD:Sr,ADD_REM:b4,ADD_MOD:aS,ALL:ya,REFLOW:uS,SOURCE:rl,NO_SOURCE:lS,NO_FIELDS:cS,fork(e){return new Ao(this.dataflow).init(this,e)},clone(){const e=this.fork(ya);return e.add=e.add.slice(),e.rem=e.rem.slice(),e.mod=e.mod.slice(),e.source&&(e.source=e.source.slice()),e.materialize(ya|rl)},addAll(){let e=this;return!e.source||e.add===e.rem||!e.rem.length&&e.source.length===e.add.length||(e=new Ao(this.dataflow).init(this),e.add=e.source,e.rem=[]),e},init(e,t){const n=this;return n.stamp=e.stamp,n.encode=e.encode,e.fields&&!(t&cS)&&(n.fields=e.fields),t&Bi?(n.addF=e.addF,n.add=e.add):(n.addF=null,n.add=[]),t&ao?(n.remF=e.remF,n.rem=e.rem):(n.remF=null,n.rem=[]),t&Sr?(n.modF=e.modF,n.mod=e.mod):(n.modF=null,n.mod=[]),t&lS?(n.srcF=null,n.source=null):(n.srcF=e.srcF,n.source=e.source,e.cleans&&(n.cleans=e.cleans)),n},runAfter(e){this.dataflow.runAfter(e)},changed(e){const t=e||ya;return t&Bi&&this.add.length||t&ao&&this.rem.length||t&Sr&&this.mod.length},reflow(e){if(e)return this.fork(ya).reflow();const t=this.add.length,n=this.source&&this.source.length;return n&&n!==t&&(this.mod=this.source,t&&this.filter(Sr,fS(this,Bi))),this},clean(e){return arguments.length?(this.cleans=!!e,this):this.cleans},modifies(e){const t=this.fields||(this.fields={});return P(e)?e.forEach(n=>t[n]=!0):t[e]=!0,this},modified(e,t){const n=this.fields;return(t||this.mod.length)&&n?arguments.length?P(e)?e.some(i=>n[i]):n[e]:!!n:!1},filter(e,t){const n=this;return e&Bi&&(n.addF=kf(n.addF,t)),e&ao&&(n.remF=kf(n.remF,t)),e&Sr&&(n.modF=kf(n.modF,t)),e&rl&&(n.srcF=kf(n.srcF,t)),n},materialize(e){e=e||ya;const t=this;return e&Bi&&t.addF&&(t.add=Em(t.add,t.addF),t.addF=null),e&ao&&t.remF&&(t.rem=Em(t.rem,t.remF),t.remF=null),e&Sr&&t.modF&&(t.mod=Em(t.mod,t.modF),t.modF=null),e&rl&&t.srcF&&(t.source=t.source.filter(t.srcF),t.srcF=null),t},visit(e,t){const n=this,i=t;if(e&rl)return so(n.source,n.srcF,i),n;e&Bi&&so(n.add,n.addF,i),e&ao&&so(n.rem,n.remF,i),e&Sr&&so(n.mod,n.modF,i);const r=n.source;if(e&uS&&r){const o=n.add.length+n.mod.length;o===r.length||(o?so(r,fS(n,aS),i):so(r,n.srcF,i))}return n}};function Lb(e,t,n,i){const r=this;let o=0;this.dataflow=e,this.stamp=t,this.fields=null,this.encode=i||null,this.pulses=n;for(const s of n)if(s.stamp===t){if(s.fields){const a=r.fields||(r.fields={});for(const u in s.fields)a[u]=1}s.changed(r.ADD)&&(o|=r.ADD),s.changed(r.REM)&&(o|=r.REM),s.changed(r.MOD)&&(o|=r.MOD)}this.changes=o}G(Lb,Ao,{fork(e){const t=new Ao(this.dataflow).init(this,e&this.NO_FIELDS);return e!==void 0&&(e&t.ADD&&this.visit(t.ADD,n=>t.add.push(n)),e&t.REM&&this.visit(t.REM,n=>t.rem.push(n)),e&t.MOD&&this.visit(t.MOD,n=>t.mod.push(n))),t},changed(e){return this.changes&e},modified(e){const t=this,n=t.fields;return n&&t.changes&t.MOD?P(e)?e.some(i=>n[i]):n[e]:0},filter(){N("MultiPulse does not support filtering.")},materialize(){N("MultiPulse does not support materialization.")},visit(e,t){const n=this,i=n.pulses,r=i.length;let o=0;if(e&n.SOURCE)for(;o<r;++o)i[o].visit(e,t);else for(;o<r;++o)i[o].stamp===n.stamp&&i[o].visit(e,t);return n}});async function v4(e,t,n){const i=this,r=[];if(i._pulse)return NF(i);if(i._pending&&await i._pending,t&&await cd(i,t),!i._touched.length)return i.debug("Dataflow invoked, but nothing to do."),i;const o=++i._clock;i._pulse=new Ao(i,o,e),i._touched.forEach(c=>i._enqueue(c,!0)),i._touched=wg(Rc);let s=0,a,u,l;try{for(;i._heap.size()>0;){if(a=i._heap.pop(),a.rank!==a.qrank){i._enqueue(a,!0);continue}u=a.run(i._getPulse(a,e)),u.then?u=await u:u.async&&(r.push(u.async),u=Ud),u!==Ud&&a._targets&&a._targets.forEach(c=>i._enqueue(c)),++s}}catch(c){i._heap.clear(),l=c}if(i._input={},i._pulse=null,i.debug(`Pulse ${o}: ${s} operators`),l&&(i._postrun=[],i.error(l)),i._postrun.length){const c=i._postrun.sort((f,d)=>d.priority-f.priority);i._postrun=[];for(let f=0;f<c.length;++f)await cd(i,c[f].callback)}return n&&await cd(i,n),r.length&&Promise.all(r).then(c=>i.runAsync(null,()=>{c.forEach(f=>{try{f(i)}catch(d){i.error(d)}})})),i}async function x4(e,t,n){for(;this._running;)await this._running;const i=()=>this._running=null;return(this._running=this.evaluate(e,t,n)).then(i,i),this._running}function w4(e,t,n){return this._pulse?NF(this):(this.evaluate(e,t,n),this)}function E4(e,t,n){if(this._pulse||t)this._postrun.push({priority:n||0,callback:e});else try{e(this)}catch(i){this.error(i)}}function NF(e){return e.error("Dataflow already running. Use runAsync() to chain invocations."),e}function S4(e,t){const n=e.stamp<this._clock;n&&(e.stamp=this._clock),(n||t)&&(e.qrank=e.rank,this._heap.push(e))}function _4(e,t){const n=e.source,i=this._clock;return n&&P(n)?new Lb(this,i,n.map(r=>r.pulse),t):this._input[e.id]||A4(this._pulse,n&&n.pulse)}function A4(e,t){return t&&t.stamp===e.stamp?t:(e=e.fork(),t&&t!==Ud&&(e.source=t.source),e)}const Pb={skip:!1,force:!1};function $4(e,t){const n=t||Pb;return this._pulse?this._enqueue(e):this._touched.add(e),n.skip&&e.skip(!0),this}function k4(e,t,n){const i=n||Pb;return(e.set(t)||i.force)&&this.touch(e,i),this}function C4(e,t,n){this.touch(e,n||Pb);const i=new Ao(this,this._clock+(this._pulse?0:1)),r=e.pulse&&e.pulse.source||[];return i.target=e,this._input[e.id]=t.pulse(i,r),this}function F4(e){let t=[];return{clear:()=>t=[],size:()=>t.length,peek:()=>t[0],push:n=>(t.push(n),LF(t,0,t.length-1,e)),pop:()=>{const n=t.pop();let i;return t.length?(i=t[0],t[0]=n,T4(t,0,e)):i=n,i}}}function LF(e,t,n,i){let r,o;const s=e[n];for(;n>t;){if(o=n-1>>1,r=e[o],i(s,r)<0){e[n]=r,n=o;continue}break}return e[n]=s}function T4(e,t,n){const i=t,r=e.length,o=e[t];let s=(t<<1)+1,a;for(;s<r;)a=s+1,a<r&&n(e[s],e[a])>=0&&(s=a),e[t]=e[s],t=s,s=(t<<1)+1;return e[t]=o,LF(e,i,t,n)}function Pa(){this.logger(pb()),this.logLevel(hb),this._clock=0,this._rank=0,this._locale=Mb();try{this._loader=xg()}catch{}this._touched=wg(Rc),this._input={},this._pulse=null,this._heap=F4((e,t)=>e.qrank-t.qrank),this._postrun=[]}function ol(e){return function(){return this._log[e].apply(this,arguments)}}Pa.prototype={stamp(){return this._clock},loader(e){return arguments.length?(this._loader=e,this):this._loader},locale(e){return arguments.length?(this._locale=e,this):this._locale},logger(e){return arguments.length?(this._log=e,this):this._log},error:ol("error"),warn:ol("warn"),info:ol("info"),debug:ol("debug"),logLevel:ol("level"),cleanThreshold:1e4,add:n4,connect:i4,rank:m4,rerank:y4,pulse:C4,touch:$4,update:k4,changeset:ta,ingest:a4,parse:s4,preload:l4,request:u4,events:o4,on:d4,evaluate:v4,run:w4,runAsync:x4,runAfter:E4,_enqueue:S4,_getPulse:_4};function D(e,t){Ie.call(this,e,null,t)}G(D,Ie,{run(e){if(e.stamp<this.stamp)return e.StopPropagation;let t;return this.skip()?this.skip(!1):t=this.evaluate(e),t=t||e,t.then?t=t.then(n=>this.pulse=n):t!==e.StopPropagation&&(this.pulse=t),t},evaluate(e){const t=this.marshall(e.stamp),n=this.transform(t,e);return t.clear(),n},transform(){}});const Ja={};function PF(e){const t=IF(e);return t&&t.Definition||null}function IF(e){return e=e&&e.toLowerCase(),J(Ja,e)?Ja[e]:null}function*zF(e,t){if(t==null)for(let n of e)n!=null&&n!==""&&(n=+n)>=n&&(yield n);else{let n=-1;for(let i of e)i=t(i,++n,e),i!=null&&i!==""&&(i=+i)>=i&&(yield i)}}function Ib(e,t,n){const i=Float64Array.from(zF(e,n));return i.sort(rc),t.map(r=>BC(i,r))}function zb(e,t){return Ib(e,[.25,.5,.75],t)}function Bb(e,t){const n=e.length,i=XI(e,t),r=zb(e,t),o=(r[2]-r[0])/1.34;return 1.06*(Math.min(i,o)||i||Math.abs(r[0])||1)*Math.pow(n,-.2)}function BF(e){const t=e.maxbins||20,n=e.base||10,i=Math.log(n),r=e.divide||[5,2];let o=e.extent[0],s=e.extent[1],a,u,l,c,f,d;const h=e.span||s-o||Math.abs(o)||1;if(e.step)a=e.step;else if(e.steps){for(c=h/t,f=0,d=e.steps.length;f<d&&e.steps[f]<c;++f);a=e.steps[Math.max(0,f-1)]}else{for(u=Math.ceil(Math.log(t)/i),l=e.minstep||0,a=Math.max(l,Math.pow(n,Math.round(Math.log(h)/i)-u));Math.ceil(h/a)>t;)a*=n;for(f=0,d=r.length;f<d;++f)c=a/r[f],c>=l&&h/c<=t&&(a=c)}c=Math.log(a);const g=c>=0?0:~~(-c/i)+1,p=Math.pow(n,-g-1);return(e.nice||e.nice===void 0)&&(c=Math.floor(o/a+p)*a,o=o<c?c-a:c,s=Math.ceil(s/a)*a),{start:o,stop:s===o?o+a:s,step:a}}var ei=Math.random;function M4(e){ei=e}function UF(e,t,n,i){if(!e.length)return[void 0,void 0];const r=Float64Array.from(zF(e,i)),o=r.length,s=t;let a,u,l,c;for(l=0,c=Array(s);l<s;++l){for(a=0,u=0;u<o;++u)a+=r[~~(ei()*o)];c[l]=a/o}return c.sort(rc),[i1(c,n/2),i1(c,1-n/2)]}function jF(e,t,n,i){i=i||(d=>d);const r=e.length,o=new Float64Array(r);let s=0,a=1,u=i(e[0]),l=u,c=u+t,f;for(;a<r;++a){if(f=i(e[a]),f>=c){for(l=(u+l)/2;s<a;++s)o[s]=l;c=f+t,u=f}l=f}for(l=(u+l)/2;s<a;++s)o[s]=l;return n?D4(o,t+t/4):o}function D4(e,t){const n=e.length;let i=0,r=1,o,s;for(;e[i]===e[r];)++r;for(;r<n;){for(o=r+1;e[r]===e[o];)++o;if(e[r]-e[r-1]<t){for(s=r+(i+o-r-r>>1);s<r;)e[s++]=e[r];for(;s>r;)e[s--]=e[i]}i=r,r=o}return e}function O4(e){return function(){return e=(1103515245*e+12345)%2147483647,e/2147483647}}function R4(e,t){t==null&&(t=e,e=0);let n,i,r;const o={min(s){return arguments.length?(n=s||0,r=i-n,o):n},max(s){return arguments.length?(i=s||0,r=i-n,o):i},sample(){return n+Math.floor(r*ei())},pdf(s){return s===Math.floor(s)&&s>=n&&s<i?1/r:0},cdf(s){const a=Math.floor(s);return a<n?0:a>=i?1:(a-n+1)/r},icdf(s){return s>=0&&s<=1?n-1+Math.floor(s*r):NaN}};return o.min(e).max(t)}const qF=Math.sqrt(2*Math.PI),N4=Math.SQRT2;let sl=NaN;function $g(e,t){e=e||0,t=t??1;let n=0,i=0,r,o;if(sl===sl)n=sl,sl=NaN;else{do n=ei()*2-1,i=ei()*2-1,r=n*n+i*i;while(r===0||r>1);o=Math.sqrt(-2*Math.log(r)/r),n*=o,sl=i*o}return e+n*t}function Ub(e,t,n){n=n??1;const i=(e-(t||0))/n;return Math.exp(-.5*i*i)/(n*qF)}function kg(e,t,n){t=t||0,n=n??1;const i=(e-t)/n,r=Math.abs(i);let o;if(r>37)o=0;else{const s=Math.exp(-r*r/2);let a;r<7.07106781186547?(a=.0352624965998911*r+.700383064443688,a=a*r+6.37396220353165,a=a*r+33.912866078383,a=a*r+112.079291497871,a=a*r+221.213596169931,a=a*r+220.206867912376,o=s*a,a=.0883883476483184*r+1.75566716318264,a=a*r+16.064177579207,a=a*r+86.7807322029461,a=a*r+296.564248779674,a=a*r+637.333633378831,a=a*r+793.826512519948,a=a*r+440.413735824752,o=o/a):(a=r+.65,a=r+4/a,a=r+3/a,a=r+2/a,a=r+1/a,o=s/a/2.506628274631)}return i>0?1-o:o}function Cg(e,t,n){return e<0||e>1?NaN:(t||0)+(n??1)*N4*L4(2*e-1)}function L4(e){let t=-Math.log((1-e)*(1+e)),n;return t<6.25?(t-=3.125,n=-364441206401782e-35,n=-16850591381820166e-35+n*t,n=128584807152564e-32+n*t,n=11157877678025181e-33+n*t,n=-1333171662854621e-31+n*t,n=20972767875968562e-33+n*t,n=6637638134358324e-30+n*t,n=-4054566272975207e-29+n*t,n=-8151934197605472e-29+n*t,n=26335093153082323e-28+n*t,n=-12975133253453532e-27+n*t,n=-5415412054294628e-26+n*t,n=10512122733215323e-25+n*t,n=-4112633980346984e-24+n*t,n=-29070369957882005e-24+n*t,n=42347877827932404e-23+n*t,n=-13654692000834679e-22+n*t,n=-13882523362786469e-21+n*t,n=.00018673420803405714+n*t,n=-.000740702534166267+n*t,n=-.006033670871430149+n*t,n=.24015818242558962+n*t,n=1.6536545626831027+n*t):t<16?(t=Math.sqrt(t)-3.25,n=22137376921775787e-25,n=9075656193888539e-23+n*t,n=-27517406297064545e-23+n*t,n=18239629214389228e-24+n*t,n=15027403968909828e-22+n*t,n=-4013867526981546e-21+n*t,n=29234449089955446e-22+n*t,n=12475304481671779e-21+n*t,n=-47318229009055734e-21+n*t,n=6828485145957318e-20+n*t,n=24031110387097894e-21+n*t,n=-.0003550375203628475+n*t,n=.0009532893797373805+n*t,n=-.0016882755560235047+n*t,n=.002491442096107851+n*t,n=-.003751208507569241+n*t,n=.005370914553590064+n*t,n=1.0052589676941592+n*t,n=3.0838856104922208+n*t):Number.isFinite(t)?(t=Math.sqrt(t)-5,n=-27109920616438573e-27,n=-2555641816996525e-25+n*t,n=15076572693500548e-25+n*t,n=-3789465440126737e-24+n*t,n=761570120807834e-23+n*t,n=-1496002662714924e-23+n*t,n=2914795345090108e-23+n*t,n=-6771199775845234e-23+n*t,n=22900482228026655e-23+n*t,n=-99298272942317e-20+n*t,n=4526062597223154e-21+n*t,n=-1968177810553167e-20+n*t,n=7599527703001776e-20+n*t,n=-.00021503011930044477+n*t,n=-.00013871931833623122+n*t,n=1.0103004648645344+n*t,n=4.849906401408584+n*t):n=1/0,n*e}function jb(e,t){let n,i;const r={mean(o){return arguments.length?(n=o||0,r):n},stdev(o){return arguments.length?(i=o??1,r):i},sample:()=>$g(n,i),pdf:o=>Ub(o,n,i),cdf:o=>kg(o,n,i),icdf:o=>Cg(o,n,i)};return r.mean(e).stdev(t)}function qb(e,t){const n=jb();let i=0;const r={data(o){return arguments.length?(e=o,i=o?o.length:0,r.bandwidth(t)):e},bandwidth(o){return arguments.length?(t=o,!t&&e&&(t=Bb(e)),r):t},sample(){return e[~~(ei()*i)]+t*n.sample()},pdf(o){let s=0,a=0;for(;a<i;++a)s+=n.pdf((o-e[a])/t);return s/t/i},cdf(o){let s=0,a=0;for(;a<i;++a)s+=n.cdf((o-e[a])/t);return s/i},icdf(){throw Error("KDE icdf not supported.")}};return r.data(e)}function Wb(e,t){return e=e||0,t=t??1,Math.exp(e+$g()*t)}function Hb(e,t,n){if(e<=0)return 0;t=t||0,n=n??1;const i=(Math.log(e)-t)/n;return Math.exp(-.5*i*i)/(n*qF*e)}function Gb(e,t,n){return kg(Math.log(e),t,n)}function Vb(e,t,n){return Math.exp(Cg(e,t,n))}function WF(e,t){let n,i;const r={mean(o){return arguments.length?(n=o||0,r):n},stdev(o){return arguments.length?(i=o??1,r):i},sample:()=>Wb(n,i),pdf:o=>Hb(o,n,i),cdf:o=>Gb(o,n,i),icdf:o=>Vb(o,n,i)};return r.mean(e).stdev(t)}function HF(e,t){let n=0,i;function r(s){const a=[];let u=0,l;for(l=0;l<n;++l)u+=a[l]=s[l]==null?1:+s[l];for(l=0;l<n;++l)a[l]/=u;return a}const o={weights(s){return arguments.length?(i=r(t=s||[]),o):t},distributions(s){return arguments.length?(s?(n=s.length,e=s):(n=0,e=[]),o.weights(t)):e},sample(){const s=ei();let a=e[n-1],u=i[0],l=0;for(;l<n-1;u+=i[++l])if(s<u){a=e[l];break}return a.sample()},pdf(s){let a=0,u=0;for(;u<n;++u)a+=i[u]*e[u].pdf(s);return a},cdf(s){let a=0,u=0;for(;u<n;++u)a+=i[u]*e[u].cdf(s);return a},icdf(){throw Error("Mixture icdf not supported.")}};return o.distributions(e).weights(t)}function Yb(e,t){return t==null&&(t=e??1,e=0),e+(t-e)*ei()}function Xb(e,t,n){return n==null&&(n=t??1,t=0),e>=t&&e<=n?1/(n-t):0}function Kb(e,t,n){return n==null&&(n=t??1,t=0),e<t?0:e>n?1:(e-t)/(n-t)}function Jb(e,t,n){return n==null&&(n=t??1,t=0),e>=0&&e<=1?t+e*(n-t):NaN}function GF(e,t){let n,i;const r={min(o){return arguments.length?(n=o||0,r):n},max(o){return arguments.length?(i=o??1,r):i},sample:()=>Yb(n,i),pdf:o=>Xb(o,n,i),cdf:o=>Kb(o,n,i),icdf:o=>Jb(o,n,i)};return t==null&&(t=e??1,e=0),r.min(e).max(t)}function Qb(e,t,n){let i=0,r=0;for(const o of e){const s=n(o);t(o)==null||s==null||isNaN(s)||(i+=(s-i)/++r)}return{coef:[i],predict:()=>i,rSquared:0}}function Lc(e,t,n,i){const r=i-e*e,o=Math.abs(r)<1e-24?0:(n-e*t)/r;return[t-o*e,o]}function Fg(e,t,n,i){e=e.filter(h=>{let g=t(h),p=n(h);return g!=null&&(g=+g)>=g&&p!=null&&(p=+p)>=p}),i&&e.sort((h,g)=>t(h)-t(g));const r=e.length,o=new Float64Array(r),s=new Float64Array(r);let a=0,u=0,l=0,c,f,d;for(d of e)o[a]=c=+t(d),s[a]=f=+n(d),++a,u+=(c-u)/a,l+=(f-l)/a;for(a=0;a<r;++a)o[a]-=u,s[a]-=l;return[o,s,u,l]}function Pc(e,t,n,i){let r=-1,o,s;for(const a of e)o=t(a),s=n(a),o!=null&&(o=+o)>=o&&s!=null&&(s=+s)>=s&&i(o,s,++r)}function Nu(e,t,n,i,r){let o=0,s=0;return Pc(e,t,n,(a,u)=>{const l=u-r(a),c=u-i;o+=l*l,s+=c*c}),1-o/s}function Zb(e,t,n){let i=0,r=0,o=0,s=0,a=0;Pc(e,t,n,(c,f)=>{++a,i+=(c-i)/a,r+=(f-r)/a,o+=(c*f-o)/a,s+=(c*c-s)/a});const u=Lc(i,r,o,s),l=c=>u[0]+u[1]*c;return{coef:u,predict:l,rSquared:Nu(e,t,n,r,l)}}function VF(e,t,n){let i=0,r=0,o=0,s=0,a=0;Pc(e,t,n,(c,f)=>{++a,c=Math.log(c),i+=(c-i)/a,r+=(f-r)/a,o+=(c*f-o)/a,s+=(c*c-s)/a});const u=Lc(i,r,o,s),l=c=>u[0]+u[1]*Math.log(c);return{coef:u,predict:l,rSquared:Nu(e,t,n,r,l)}}function YF(e,t,n){const[i,r,o,s]=Fg(e,t,n);let a=0,u=0,l=0,c=0,f=0,d,h,g;Pc(e,t,n,(b,v)=>{d=i[f++],h=Math.log(v),g=d*v,a+=(v*h-a)/f,u+=(g-u)/f,l+=(g*h-l)/f,c+=(d*g-c)/f});const[p,m]=Lc(u/s,a/s,l/s,c/s),y=b=>Math.exp(p+m*(b-o));return{coef:[Math.exp(p-m*o),m],predict:y,rSquared:Nu(e,t,n,s,y)}}function XF(e,t,n){let i=0,r=0,o=0,s=0,a=0,u=0;Pc(e,t,n,(f,d)=>{const h=Math.log(f),g=Math.log(d);++u,i+=(h-i)/u,r+=(g-r)/u,o+=(h*g-o)/u,s+=(h*h-s)/u,a+=(d-a)/u});const l=Lc(i,r,o,s),c=f=>l[0]*Math.pow(f,l[1]);return l[0]=Math.exp(l[0]),{coef:l,predict:c,rSquared:Nu(e,t,n,a,c)}}function ev(e,t,n){const[i,r,o,s]=Fg(e,t,n),a=i.length;let u=0,l=0,c=0,f=0,d=0,h,g,p,m;for(h=0;h<a;)g=i[h],p=r[h++],m=g*g,u+=(m-u)/h,l+=(m*g-l)/h,c+=(m*m-c)/h,f+=(g*p-f)/h,d+=(m*p-d)/h;const y=c-u*u,b=u*y-l*l,v=(d*u-f*l)/b,x=(f*y-d*l)/b,E=-v*u,S=w=>(w=w-o,v*w*w+x*w+E+s);return{coef:[E-x*o+v*o*o+s,x-2*v*o,v],predict:S,rSquared:Nu(e,t,n,s,S)}}function KF(e,t,n,i){if(i===0)return Qb(e,t,n);if(i===1)return Zb(e,t,n);if(i===2)return ev(e,t,n);const[r,o,s,a]=Fg(e,t,n),u=r.length,l=[],c=[],f=i+1;let d,h,g,p,m;for(d=0;d<f;++d){for(g=0,p=0;g<u;++g)p+=Math.pow(r[g],d)*o[g];for(l.push(p),m=new Float64Array(f),h=0;h<f;++h){for(g=0,p=0;g<u;++g)p+=Math.pow(r[g],d+h);m[h]=p}c.push(m)}c.push(l);const y=I4(c),b=v=>{v-=s;let x=a+y[0]+y[1]*v+y[2]*v*v;for(d=3;d<f;++d)x+=y[d]*Math.pow(v,d);return x};return{coef:P4(f,y,-s,a),predict:b,rSquared:Nu(e,t,n,a,b)}}function P4(e,t,n,i){const r=Array(e);let o,s,a,u;for(o=0;o<e;++o)r[o]=0;for(o=e-1;o>=0;--o)for(a=t[o],u=1,r[o]+=a,s=1;s<=o;++s)u*=(o+1-s)/s,r[o-s]+=a*Math.pow(n,s)*u;return r[0]+=i,r}function I4(e){const t=e.length-1,n=[];let i,r,o,s,a;for(i=0;i<t;++i){for(s=i,r=i+1;r<t;++r)Math.abs(e[i][r])>Math.abs(e[i][s])&&(s=r);for(o=i;o<t+1;++o)a=e[o][i],e[o][i]=e[o][s],e[o][s]=a;for(r=i+1;r<t;++r)for(o=t;o>=i;o--)e[o][r]-=e[o][i]*e[i][r]/e[i][i]}for(r=t-1;r>=0;--r){for(a=0,o=r+1;o<t;++o)a+=e[o][r]*n[o];n[r]=(e[t][r]-a)/e[r][r]}return n}const dS=2,hS=1e-12;function JF(e,t,n,i){const[r,o,s,a]=Fg(e,t,n,!0),u=r.length,l=Math.max(2,~~(i*u)),c=new Float64Array(u),f=new Float64Array(u),d=new Float64Array(u).fill(1);for(let h=-1;++h<=dS;){const g=[0,l-1];for(let m=0;m<u;++m){const y=r[m],b=g[0],v=g[1],x=y-r[b]>r[v]-y?b:v;let E=0,S=0,w=0,_=0,A=0;const k=1/Math.abs(r[x]-y||1);for(let M=b;M<=v;++M){const F=r[M],$=o[M],T=z4(Math.abs(y-F)*k)*d[M],L=F*T;E+=T,S+=L,w+=$*T,_+=$*L,A+=F*L}const[C,O]=Lc(S/E,w/E,_/E,A/E);c[m]=C+O*y,f[m]=Math.abs(o[m]-c[m]),B4(r,m+1,g)}if(h===dS)break;const p=UC(f);if(Math.abs(p)<hS)break;for(let m=0,y,b;m<u;++m)y=f[m]/(6*p),d[m]=y>=1?hS:(b=1-y*y)*b}return U4(r,c,s,a)}function z4(e){return(e=1-e*e*e)*e*e}function B4(e,t,n){const i=e[t];let r=n[0],o=n[1]+1;if(!(o>=e.length))for(;t>r&&e[o]-i<=i-e[r];)n[0]=++r,n[1]=o,++o}function U4(e,t,n,i){const r=e.length,o=[];let s=0,a=0,u=[],l;for(;s<r;++s)l=e[s]+n,u[0]===l?u[1]+=(t[s]-u[1])/++a:(a=0,u[1]+=i,u=[l,t[s]],o.push(u));return u[1]+=i,o}const j4=.5*Math.PI/180;function Tg(e,t,n,i){n=n||25,i=Math.max(n,i||200);const r=p=>[p,e(p)],o=t[0],s=t[1],a=s-o,u=a/i,l=[r(o)],c=[];if(n===i){for(let p=1;p<i;++p)l.push(r(o+p/n*a));return l.push(r(s)),l}else{c.push(r(s));for(let p=n;--p>0;)c.push(r(o+p/n*a))}let f=l[0],d=c[c.length-1];const h=1/a,g=q4(f[1],c);for(;d;){const p=r((f[0]+d[0])/2);p[0]-f[0]>=u&&W4(f,p,d,h,g)>j4?c.push(p):(f=d,l.push(d),c.pop()),d=c[c.length-1]}return l}function q4(e,t){let n=e,i=e;const r=t.length;for(let o=0;o<r;++o){const s=t[o][1];s<n&&(n=s),s>i&&(i=s)}return 1/(i-n)}function W4(e,t,n,i,r){const o=Math.atan2(r*(n[1]-e[1]),i*(n[0]-e[0])),s=Math.atan2(r*(t[1]-e[1]),i*(t[0]-e[0]));return Math.abs(o-s)}function H4(e){return t=>{const n=e.length;let i=1,r=String(e[0](t));for(;i<n;++i)r+="|"+e[i](t);return r}}function h1(e){return!e||!e.length?function(){return""}:e.length===1?e[0]:H4(e)}function QF(e,t,n){return n||e+(t?"_"+t:"")}const Sm=()=>{},G4={init:Sm,add:Sm,rem:Sm,idx:0},uc={values:{init:e=>e.cell.store=!0,value:e=>e.cell.data.values(),idx:-1},count:{value:e=>e.cell.num},__count__:{value:e=>e.missing+e.valid},missing:{value:e=>e.missing},valid:{value:e=>e.valid},sum:{init:e=>e.sum=0,value:e=>e.valid?e.sum:void 0,add:(e,t)=>e.sum+=+t,rem:(e,t)=>e.sum-=t},product:{init:e=>e.product=1,value:e=>e.valid?e.product:void 0,add:(e,t)=>e.product*=t,rem:(e,t)=>e.product/=t},mean:{init:e=>e.mean=0,value:e=>e.valid?e.mean:void 0,add:(e,t)=>(e.mean_d=t-e.mean,e.mean+=e.mean_d/e.valid),rem:(e,t)=>(e.mean_d=t-e.mean,e.mean-=e.valid?e.mean_d/e.valid:e.mean)},average:{value:e=>e.valid?e.mean:void 0,req:["mean"],idx:1},variance:{init:e=>e.dev=0,value:e=>e.valid>1?e.dev/(e.valid-1):void 0,add:(e,t)=>e.dev+=e.mean_d*(t-e.mean),rem:(e,t)=>e.dev-=e.mean_d*(t-e.mean),req:["mean"],idx:1},variancep:{value:e=>e.valid>1?e.dev/e.valid:void 0,req:["variance"],idx:2},stdev:{value:e=>e.valid>1?Math.sqrt(e.dev/(e.valid-1)):void 0,req:["variance"],idx:2},stdevp:{value:e=>e.valid>1?Math.sqrt(e.dev/e.valid):void 0,req:["variance"],idx:2},stderr:{value:e=>e.valid>1?Math.sqrt(e.dev/(e.valid*(e.valid-1))):void 0,req:["variance"],idx:2},distinct:{value:e=>e.cell.data.distinct(e.get),req:["values"],idx:3},ci0:{value:e=>e.cell.data.ci0(e.get),req:["values"],idx:3},ci1:{value:e=>e.cell.data.ci1(e.get),req:["values"],idx:3},median:{value:e=>e.cell.data.q2(e.get),req:["values"],idx:3},q1:{value:e=>e.cell.data.q1(e.get),req:["values"],idx:3},q3:{value:e=>e.cell.data.q3(e.get),req:["values"],idx:3},min:{init:e=>e.min=void 0,value:e=>e.min=Number.isNaN(e.min)?e.cell.data.min(e.get):e.min,add:(e,t)=>{(t<e.min||e.min===void 0)&&(e.min=t)},rem:(e,t)=>{t<=e.min&&(e.min=NaN)},req:["values"],idx:4},max:{init:e=>e.max=void 0,value:e=>e.max=Number.isNaN(e.max)?e.cell.data.max(e.get):e.max,add:(e,t)=>{(t>e.max||e.max===void 0)&&(e.max=t)},rem:(e,t)=>{t>=e.max&&(e.max=NaN)},req:["values"],idx:4},argmin:{init:e=>e.argmin=void 0,value:e=>e.argmin||e.cell.data.argmin(e.get),add:(e,t,n)=>{t<e.min&&(e.argmin=n)},rem:(e,t)=>{t<=e.min&&(e.argmin=void 0)},req:["min","values"],idx:3},argmax:{init:e=>e.argmax=void 0,value:e=>e.argmax||e.cell.data.argmax(e.get),add:(e,t,n)=>{t>e.max&&(e.argmax=n)},rem:(e,t)=>{t>=e.max&&(e.argmax=void 0)},req:["max","values"],idx:3},exponential:{init:(e,t)=>{e.exp=0,e.exp_r=t},value:e=>e.valid?e.exp*(1-e.exp_r)/(1-e.exp_r**e.valid):void 0,add:(e,t)=>e.exp=e.exp_r*e.exp+t,rem:(e,t)=>e.exp=(e.exp-t/e.exp_r**(e.valid-1))/e.exp_r},exponentialb:{value:e=>e.valid?e.exp*(1-e.exp_r):void 0,req:["exponential"],idx:1}},Ic=Object.keys(uc).filter(e=>e!=="__count__");function V4(e,t){return(n,i)=>he({name:e,aggregate_param:i,out:n||e},G4,t)}[...Ic,"__count__"].forEach(e=>{uc[e]=V4(e,uc[e])});function ZF(e,t,n){return uc[e](n,t)}function eT(e,t){return e.idx-t.idx}function Y4(e){const t={};e.forEach(i=>t[i.name]=i);const n=i=>{i.req&&i.req.forEach(r=>{t[r]||n(t[r]=uc[r]())})};return e.forEach(n),Object.values(t).sort(eT)}function X4(){this.valid=0,this.missing=0,this._ops.forEach(e=>e.aggregate_param==null?e.init(this):e.init(this,e.aggregate_param))}function K4(e,t){if(e==null||e===""){++this.missing;return}e===e&&(++this.valid,this._ops.forEach(n=>n.add(this,e,t)))}function J4(e,t){if(e==null||e===""){--this.missing;return}e===e&&(--this.valid,this._ops.forEach(n=>n.rem(this,e,t)))}function Q4(e){return this._out.forEach(t=>e[t.out]=t.value(this)),e}function tT(e,t){const n=t||Vt,i=Y4(e),r=e.slice().sort(eT);function o(s){this._ops=i,this._out=r,this.cell=s,this.init()}return o.prototype.init=X4,o.prototype.add=K4,o.prototype.rem=J4,o.prototype.set=Q4,o.prototype.get=n,o.fields=e.map(s=>s.out),o}function tv(e){this._key=e?Qn(e):ie,this.reset()}const Mt=tv.prototype;Mt.reset=function(){this._add=[],this._rem=[],this._ext=null,this._get=null,this._q=null};Mt.add=function(e){this._add.push(e)};Mt.rem=function(e){this._rem.push(e)};Mt.values=function(){if(this._get=null,this._rem.length===0)return this._add;const e=this._add,t=this._rem,n=this._key,i=e.length,r=t.length,o=Array(i-r),s={};let a,u,l;for(a=0;a<r;++a)s[n(t[a])]=1;for(a=0,u=0;a<i;++a)s[n(l=e[a])]?s[n(l)]=0:o[u++]=l;return this._rem=[],this._add=o};Mt.distinct=function(e){const t=this.values(),n={};let i=t.length,r=0,o;for(;--i>=0;)o=e(t[i])+"",J(n,o)||(n[o]=1,++r);return r};Mt.extent=function(e){if(this._get!==e||!this._ext){const t=this.values(),n=_C(t,e);this._ext=[t[n[0]],t[n[1]]],this._get=e}return this._ext};Mt.argmin=function(e){return this.extent(e)[0]||{}};Mt.argmax=function(e){return this.extent(e)[1]||{}};Mt.min=function(e){const t=this.extent(e)[0];return t!=null?e(t):void 0};Mt.max=function(e){const t=this.extent(e)[1];return t!=null?e(t):void 0};Mt.quartile=function(e){return(this._get!==e||!this._q)&&(this._q=zb(this.values(),e),this._get=e),this._q};Mt.q1=function(e){return this.quartile(e)[0]};Mt.q2=function(e){return this.quartile(e)[1]};Mt.q3=function(e){return this.quartile(e)[2]};Mt.ci=function(e){return(this._get!==e||!this._ci)&&(this._ci=UF(this.values(),1e3,.05,e),this._get=e),this._ci};Mt.ci0=function(e){return this.ci(e)[0]};Mt.ci1=function(e){return this.ci(e)[1]};function Fo(e){D.call(this,null,e),this._adds=[],this._mods=[],this._alen=0,this._mlen=0,this._drop=!0,this._cross=!1,this._dims=[],this._dnames=[],this._measures=[],this._countOnly=!1,this._counts=null,this._prev=null,this._inputs=null,this._outputs=null}Fo.Definition={type:"Aggregate",metadata:{generates:!0,changes:!0},params:[{name:"groupby",type:"field",array:!0},{name:"ops",type:"enum",array:!0,values:Ic},{name:"aggregate_params",type:"number",null:!0,array:!0},{name:"fields",type:"field",null:!0,array:!0},{name:"as",type:"string",null:!0,array:!0},{name:"drop",type:"boolean",default:!0},{name:"cross",type:"boolean",default:!1},{name:"key",type:"field"}]};G(Fo,D,{transform(e,t){const n=this,i=t.fork(t.NO_SOURCE|t.NO_FIELDS),r=e.modified();return n.stamp=i.stamp,n.value&&(r||t.modified(n._inputs,!0))?(n._prev=n.value,n.value=r?n.init(e):Object.create(null),t.visit(t.SOURCE,o=>n.add(o))):(n.value=n.value||n.init(e),t.visit(t.REM,o=>n.rem(o)),t.visit(t.ADD,o=>n.add(o))),i.modifies(n._outputs),n._drop=e.drop!==!1,e.cross&&n._dims.length>1&&(n._drop=!1,n.cross()),t.clean()&&n._drop&&i.clean(!0).runAfter(()=>this.clean()),n.changes(i)},cross(){const e=this,t=e.value,n=e._dnames,i=n.map(()=>({})),r=n.length;function o(a){let u,l,c,f;for(u in a)for(c=a[u].tuple,l=0;l<r;++l)i[l][f=c[n[l]]]=f}o(e._prev),o(t);function s(a,u,l){const c=n[l],f=i[l++];for(const d in f){const h=a?a+"|"+d:d;u[c]=f[d],l<r?s(h,u,l):t[h]||e.cell(h,u)}}s("",{},0)},init(e){const t=this._inputs=[],n=this._outputs=[],i={};function r(b){const v=X(qt(b)),x=v.length;let E=0,S;for(;E<x;++E)i[S=v[E]]||(i[S]=1,t.push(S))}this._dims=X(e.groupby),this._dnames=this._dims.map(b=>{const v=Je(b);return r(b),n.push(v),v}),this.cellkey=e.key?e.key:h1(this._dims),this._countOnly=!0,this._counts=[],this._measures=[];const o=e.fields||[null],s=e.ops||["count"],a=e.aggregate_params||[null],u=e.as||[],l=o.length,c={};let f,d,h,g,p,m,y;for(l!==s.length&&N("Unmatched number of fields and aggregate ops."),y=0;y<l;++y){if(f=o[y],d=s[y],h=a[y]||null,f==null&&d!=="count"&&N("Null aggregate field specified."),p=Je(f),m=QF(d,p,u[y]),n.push(m),d==="count"){this._counts.push(m);continue}g=c[p],g||(r(f),g=c[p]=[],g.field=f,this._measures.push(g)),d!=="count"&&(this._countOnly=!1),g.push(ZF(d,h,m))}return this._measures=this._measures.map(b=>tT(b,b.field)),Object.create(null)},cellkey:h1(),cell(e,t){let n=this.value[e];return n?n.num===0&&this._drop&&n.stamp<this.stamp?(n.stamp=this.stamp,this._adds[this._alen++]=n):n.stamp<this.stamp&&(n.stamp=this.stamp,this._mods[this._mlen++]=n):(n=this.value[e]=this.newcell(e,t),this._adds[this._alen++]=n),n},newcell(e,t){const n={key:e,num:0,agg:null,tuple:this.newtuple(t,this._prev&&this._prev[e]),stamp:this.stamp,store:!1};if(!this._countOnly){const i=this._measures,r=i.length;n.agg=Array(r);for(let o=0;o<r;++o)n.agg[o]=new i[o](n)}return n.store&&(n.data=new tv),n},newtuple(e,t){const n=this._dnames,i=this._dims,r=i.length,o={};for(let s=0;s<r;++s)o[n[s]]=i[s](e);return t?OF(t.tuple,o):Ce(o)},clean(){const e=this.value;for(const t in e)e[t].num===0&&delete e[t]},add(e){const t=this.cellkey(e),n=this.cell(t,e);if(n.num+=1,this._countOnly)return;n.store&&n.data.add(e);const i=n.agg;for(let r=0,o=i.length;r<o;++r)i[r].add(i[r].get(e),e)},rem(e){const t=this.cellkey(e),n=this.cell(t,e);if(n.num-=1,this._countOnly)return;n.store&&n.data.rem(e);const i=n.agg;for(let r=0,o=i.length;r<o;++r)i[r].rem(i[r].get(e),e)},celltuple(e){const t=e.tuple,n=this._counts;e.store&&e.data.values();for(let i=0,r=n.length;i<r;++i)t[n[i]]=e.num;if(!this._countOnly){const i=e.agg;for(let r=0,o=i.length;r<o;++r)i[r].set(t)}return t},changes(e){const t=this._adds,n=this._mods,i=this._prev,r=this._drop,o=e.add,s=e.rem,a=e.mod;let u,l,c,f;if(i)for(l in i)u=i[l],(!r||u.num)&&s.push(u.tuple);for(c=0,f=this._alen;c<f;++c)o.push(this.celltuple(t[c])),t[c]=null;for(c=0,f=this._mlen;c<f;++c)u=n[c],(u.num===0&&r?s:a).push(this.celltuple(u)),n[c]=null;return this._alen=this._mlen=0,this._prev=null,e}});const Z4=1e-14;function nv(e){D.call(this,null,e)}nv.Definition={type:"Bin",metadata:{modifies:!0},params:[{name:"field",type:"field",required:!0},{name:"interval",type:"boolean",default:!0},{name:"anchor",type:"number"},{name:"maxbins",type:"number",default:20},{name:"base",type:"number",default:10},{name:"divide",type:"number",array:!0,default:[5,2]},{name:"extent",type:"number",array:!0,length:2,required:!0},{name:"span",type:"number"},{name:"step",type:"number"},{name:"steps",type:"number",array:!0},{name:"minstep",type:"number",default:0},{name:"nice",type:"boolean",default:!0},{name:"name",type:"string"},{name:"as",type:"string",array:!0,length:2,default:["bin0","bin1"]}]};G(nv,D,{transform(e,t){const n=e.interval!==!1,i=this._bins(e),r=i.start,o=i.step,s=e.as||["bin0","bin1"],a=s[0],u=s[1];let l;return e.modified()?(t=t.reflow(!0),l=t.SOURCE):l=t.modified(qt(e.field))?t.ADD_MOD:t.ADD,t.visit(l,n?c=>{const f=i(c);c[a]=f,c[u]=f==null?null:r+o*(1+(f-r)/o)}:c=>c[a]=i(c)),t.modifies(n?s:a)},_bins(e){if(this.value&&!e.modified())return this.value;const t=e.field,n=BF(e),i=n.step;let r=n.start,o=r+Math.ceil((n.stop-r)/i)*i,s,a;(s=e.anchor)!=null&&(a=s-(r+i*Math.floor((s-r)/i)),r+=a,o+=a);const u=function(l){let c=Ut(t(l));return c==null?null:c<r?-1/0:c>o?1/0:(c=Math.max(r,Math.min(c,o-i)),r+i*Math.floor(Z4+(c-r)/i))};return u.start=r,u.stop=n.stop,u.step=i,this.value=An(u,qt(t),e.name||"bin_"+Je(t))}});function nT(e,t,n){const i=e;let r=t||[],o=n||[],s={},a=0;return{add:u=>o.push(u),remove:u=>s[i(u)]=++a,size:()=>r.length,data:(u,l)=>(a&&(r=r.filter(c=>!s[i(c)]),s={},a=0),l&&u&&r.sort(u),o.length&&(r=u?TC(u,r,o.sort(u)):r.concat(o),o=[]),r)}}function iv(e){D.call(this,[],e)}iv.Definition={type:"Collect",metadata:{source:!0},params:[{name:"sort",type:"compare"}]};G(iv,D,{transform(e,t){const n=t.fork(t.ALL),i=nT(ie,this.value,n.materialize(n.ADD).add),r=e.sort,o=t.changed()||r&&(e.modified("sort")||t.modified(r.fields));return n.visit(n.REM,i.remove),this.modified(o),this.value=n.source=i.data(ea(r),o),t.source&&t.source.root&&(this.value.root=t.source.root),n}});function iT(e){Ie.call(this,null,e9,e)}G(iT,Ie);function e9(e){return this.value&&!e.modified()?this.value:vb(e.fields,e.orders)}function rv(e){D.call(this,null,e)}rv.Definition={type:"CountPattern",metadata:{generates:!0,changes:!0},params:[{name:"field",type:"field",required:!0},{name:"case",type:"enum",values:["upper","lower","mixed"],default:"mixed"},{name:"pattern",type:"string",default:'[\\w"]+'},{name:"stopwords",type:"string",default:""},{name:"as",type:"string",array:!0,length:2,default:["text","count"]}]};function t9(e,t,n){switch(t){case"upper":e=e.toUpperCase();break;case"lower":e=e.toLowerCase();break}return e.match(n)}G(rv,D,{transform(e,t){const n=f=>d=>{for(var h=t9(a(d),e.case,o)||[],g,p=0,m=h.length;p<m;++p)s.test(g=h[p])||f(g)},i=this._parameterCheck(e,t),r=this._counts,o=this._match,s=this._stop,a=e.field,u=e.as||["text","count"],l=n(f=>r[f]=1+(r[f]||0)),c=n(f=>r[f]-=1);return i?t.visit(t.SOURCE,l):(t.visit(t.ADD,l),t.visit(t.REM,c)),this._finish(t,u)},_parameterCheck(e,t){let n=!1;return(e.modified("stopwords")||!this._stop)&&(this._stop=new RegExp("^"+(e.stopwords||"")+"$","i"),n=!0),(e.modified("pattern")||!this._match)&&(this._match=new RegExp(e.pattern||"[\\w']+","g"),n=!0),(e.modified("field")||t.modified(e.field.fields))&&(n=!0),n&&(this._counts={}),n},_finish(e,t){const n=this._counts,i=this._tuples||(this._tuples={}),r=t[0],o=t[1],s=e.fork(e.NO_SOURCE|e.NO_FIELDS);let a,u,l;for(a in n)u=i[a],l=n[a]||0,!u&&l?(i[a]=u=Ce({}),u[r]=a,u[o]=l,s.add.push(u)):l===0?(u&&s.rem.push(u),n[a]=null,i[a]=null):u[o]!==l&&(u[o]=l,s.mod.push(u));return s.modifies(t)}});function ov(e){D.call(this,null,e)}ov.Definition={type:"Cross",metadata:{generates:!0},params:[{name:"filter",type:"expr"},{name:"as",type:"string",array:!0,length:2,default:["a","b"]}]};G(ov,D,{transform(e,t){const n=t.fork(t.NO_SOURCE),i=e.as||["a","b"],r=i[0],o=i[1],s=!this.value||t.changed(t.ADD_REM)||e.modified("as")||e.modified("filter");let a=this.value;return s?(a&&(n.rem=a),a=t.materialize(t.SOURCE).source,n.add=this.value=n9(a,r,o,e.filter||Pn)):n.mod=a,n.source=this.value,n.modifies(i)}});function n9(e,t,n,i){for(var r=[],o={},s=e.length,a=0,u,l;a<s;++a)for(o[t]=l=e[a],u=0;u<s;++u)o[n]=e[u],i(o)&&(r.push(Ce(o)),o={},o[t]=l);return r}const gS={kde:qb,mixture:HF,normal:jb,lognormal:WF,uniform:GF},i9="distributions",pS="function",r9="field";function rT(e,t){const n=e[pS];J(gS,n)||N("Unknown distribution function: "+n);const i=gS[n]();for(const r in e)r===r9?i.data((e.from||t()).map(e[r])):r===i9?i[r](e[r].map(o=>rT(o,t))):typeof i[r]===pS&&i[r](e[r]);return i}function sv(e){D.call(this,null,e)}const oT=[{key:{function:"normal"},params:[{name:"mean",type:"number",default:0},{name:"stdev",type:"number",default:1}]},{key:{function:"lognormal"},params:[{name:"mean",type:"number",default:0},{name:"stdev",type:"number",default:1}]},{key:{function:"uniform"},params:[{name:"min",type:"number",default:0},{name:"max",type:"number",default:1}]},{key:{function:"kde"},params:[{name:"field",type:"field",required:!0},{name:"from",type:"data"},{name:"bandwidth",type:"number",default:0}]}],o9={key:{function:"mixture"},params:[{name:"distributions",type:"param",array:!0,params:oT},{name:"weights",type:"number",array:!0}]};sv.Definition={type:"Density",metadata:{generates:!0},params:[{name:"extent",type:"number",array:!0,length:2},{name:"steps",type:"number"},{name:"minsteps",type:"number",default:25},{name:"maxsteps",type:"number",default:200},{name:"method",type:"string",default:"pdf",values:["pdf","cdf"]},{name:"distribution",type:"param",params:oT.concat(o9)},{name:"as",type:"string",array:!0,default:["value","density"]}]};G(sv,D,{transform(e,t){const n=t.fork(t.NO_SOURCE|t.NO_FIELDS);if(!this.value||t.changed()||e.modified()){const i=rT(e.distribution,s9(t)),r=e.steps||e.minsteps||25,o=e.steps||e.maxsteps||200;let s=e.method||"pdf";s!=="pdf"&&s!=="cdf"&&N("Invalid density method: "+s),!e.extent&&!i.data&&N("Missing density extent parameter."),s=i[s];const a=e.as||["value","density"],u=e.extent||Qi(i.data()),l=Tg(s,u,r,o).map(c=>{const f={};return f[a[0]]=c[0],f[a[1]]=c[1],Ce(f)});this.value&&(n.rem=this.value),this.value=n.add=n.source=l}return n}});function s9(e){return()=>e.materialize(e.SOURCE).source}function sT(e,t){return e?e.map((n,i)=>t[i]||Je(n)):null}function av(e,t,n){const i=[],r=f=>f(u);let o,s,a,u,l,c;if(t==null)i.push(e.map(n));else for(o={},s=0,a=e.length;s<a;++s)u=e[s],l=t.map(r),c=o[l],c||(o[l]=c=[],c.dims=l,i.push(c)),c.push(n(u));return i}const aT="bin";function uv(e){D.call(this,null,e)}uv.Definition={type:"DotBin",metadata:{modifies:!0},params:[{name:"field",type:"field",required:!0},{name:"groupby",type:"field",array:!0},{name:"step",type:"number"},{name:"smooth",type:"boolean",default:!1},{name:"as",type:"string",default:aT}]};const a9=(e,t)=>Nc(Qi(e,t))/30;G(uv,D,{transform(e,t){if(this.value&&!(e.modified()||t.changed()))return t;const n=t.materialize(t.SOURCE).source,i=av(t.source,e.groupby,Vt),r=e.smooth||!1,o=e.field,s=e.step||a9(n,o),a=ea((g,p)=>o(g)-o(p)),u=e.as||aT,l=i.length;let c=1/0,f=-1/0,d=0,h;for(;d<l;++d){const g=i[d].sort(a);h=-1;for(const p of jF(g,s,r,o))p<c&&(c=p),p>f&&(f=p),g[++h][u]=p}return this.value={start:c,stop:f,step:s},t.reflow(!0).modifies(u)}});function uT(e){Ie.call(this,null,u9,e),this.modified(!0)}G(uT,Ie);function u9(e){const t=e.expr;return this.value&&!e.modified("expr")?this.value:An(n=>t(n,e),qt(t),Je(t))}function lv(e){D.call(this,[void 0,void 0],e)}lv.Definition={type:"Extent",metadata:{},params:[{name:"field",type:"field",required:!0}]};G(lv,D,{transform(e,t){const n=this.value,i=e.field,r=t.changed()||t.modified(i.fields)||e.modified("field");let o=n[0],s=n[1];if((r||o==null)&&(o=1/0,s=-1/0),t.visit(r?t.SOURCE:t.ADD,a=>{const u=Ut(i(a));u!=null&&(u<o&&(o=u),u>s&&(s=u))}),!Number.isFinite(o)||!Number.isFinite(s)){let a=Je(i);a&&(a=` for field "${a}"`),t.dataflow.warn(`Infinite extent${a}: [${o}, ${s}]`),o=s=void 0}this.value=[o,s]}});function cv(e,t){Ie.call(this,e),this.parent=t,this.count=0}G(cv,Ie,{connect(e){return this.detachSubflow=e.detachSubflow,this.targets().add(e),e.source=this},add(e){this.count+=1,this.value.add.push(e)},rem(e){this.count-=1,this.value.rem.push(e)},mod(e){this.value.mod.push(e)},init(e){this.value.init(e,e.NO_SOURCE)},evaluate(){return this.value}});function Mg(e){D.call(this,{},e),this._keys=Tu();const t=this._targets=[];t.active=0,t.forEach=n=>{for(let i=0,r=t.active;i<r;++i)n(t[i],i,t)}}G(Mg,D,{activate(e){this._targets[this._targets.active++]=e},subflow(e,t,n,i){const r=this.value;let o=J(r,e)&&r[e],s,a;return o?o.value.stamp<n.stamp&&(o.init(n),this.activate(o)):(a=i||(a=this._group[e])&&a.tuple,s=n.dataflow,o=new cv(n.fork(n.NO_SOURCE),this),s.add(o).connect(t(s,e,a)),r[e]=o,this.activate(o)),o},clean(){const e=this.value;let t=0;for(const n in e)if(e[n].count===0){const i=e[n].detachSubflow;i&&i(),delete e[n],++t}if(t){const n=this._targets.filter(i=>i&&i.count>0);this.initTargets(n)}},initTargets(e){const t=this._targets,n=t.length,i=e?e.length:0;let r=0;for(;r<i;++r)t[r]=e[r];for(;r<n&&t[r]!=null;++r)t[r]=null;t.active=i},transform(e,t){const n=t.dataflow,i=e.key,r=e.subflow,o=this._keys,s=e.modified("key"),a=u=>this.subflow(u,r,t);return this._group=e.group||{},this.initTargets(),t.visit(t.REM,u=>{const l=ie(u),c=o.get(l);c!==void 0&&(o.delete(l),a(c).rem(u))}),t.visit(t.ADD,u=>{const l=i(u);o.set(ie(u),l),a(l).add(u)}),s||t.modified(i.fields)?t.visit(t.MOD,u=>{const l=ie(u),c=o.get(l),f=i(u);c===f?a(f).mod(u):(o.set(l,f),a(c).rem(u),a(f).add(u))}):t.changed(t.MOD)&&t.visit(t.MOD,u=>{a(o.get(ie(u))).mod(u)}),s&&t.visit(t.REFLOW,u=>{const l=ie(u),c=o.get(l),f=i(u);c!==f&&(o.set(l,f),a(c).rem(u),a(f).add(u))}),t.clean()?n.runAfter(()=>{this.clean(),o.clean()}):o.empty>n.cleanThreshold&&n.runAfter(o.clean),t}});function lT(e){Ie.call(this,null,l9,e)}G(lT,Ie);function l9(e){return this.value&&!e.modified()?this.value:P(e.name)?X(e.name).map(t=>Qn(t)):Qn(e.name,e.as)}function fv(e){D.call(this,Tu(),e)}fv.Definition={type:"Filter",metadata:{changes:!0},params:[{name:"expr",type:"expr",required:!0}]};G(fv,D,{transform(e,t){const n=t.dataflow,i=this.value,r=t.fork(),o=r.add,s=r.rem,a=r.mod,u=e.expr;let l=!0;t.visit(t.REM,f=>{const d=ie(f);i.has(d)?i.delete(d):s.push(f)}),t.visit(t.ADD,f=>{u(f,e)?o.push(f):i.set(ie(f),1)});function c(f){const d=ie(f),h=u(f,e),g=i.get(d);h&&g?(i.delete(d),o.push(f)):!h&&!g?(i.set(d,1),s.push(f)):l&&h&&!g&&a.push(f)}return t.visit(t.MOD,c),e.modified()&&(l=!1,t.visit(t.REFLOW,c)),i.empty>n.cleanThreshold&&n.runAfter(i.clean),r}});function dv(e){D.call(this,[],e)}dv.Definition={type:"Flatten",metadata:{generates:!0},params:[{name:"fields",type:"field",array:!0,required:!0},{name:"index",type:"string"},{name:"as",type:"string",array:!0}]};G(dv,D,{transform(e,t){const n=t.fork(t.NO_SOURCE),i=e.fields,r=sT(i,e.as||[]),o=e.index||null,s=r.length;return n.rem=this.value,t.visit(t.SOURCE,a=>{const u=i.map(g=>g(a)),l=u.reduce((g,p)=>Math.max(g,p.length),0);let c=0,f,d,h;for(;c<l;++c){for(d=Nb(a),f=0;f<s;++f)d[r[f]]=(h=u[f][c])==null?null:h;o&&(d[o]=c),n.add.push(d)}}),this.value=n.source=n.add,o&&n.modifies(o),n.modifies(r)}});function hv(e){D.call(this,[],e)}hv.Definition={type:"Fold",metadata:{generates:!0},params:[{name:"fields",type:"field",array:!0,required:!0},{name:"as",type:"string",array:!0,length:2,default:["key","value"]}]};G(hv,D,{transform(e,t){const n=t.fork(t.NO_SOURCE),i=e.fields,r=i.map(Je),o=e.as||["key","value"],s=o[0],a=o[1],u=i.length;return n.rem=this.value,t.visit(t.SOURCE,l=>{for(let c=0,f;c<u;++c)f=Nb(l),f[s]=r[c],f[a]=i[c](l),n.add.push(f)}),this.value=n.source=n.add,n.modifies(o)}});function gv(e){D.call(this,null,e)}gv.Definition={type:"Formula",metadata:{modifies:!0},params:[{name:"expr",type:"expr",required:!0},{name:"as",type:"string",required:!0},{name:"initonly",type:"boolean"}]};G(gv,D,{transform(e,t){const n=e.expr,i=e.as,r=e.modified(),o=e.initonly?t.ADD:r?t.SOURCE:t.modified(n.fields)||t.modified(i)?t.ADD_MOD:t.ADD;return r&&(t=t.materialize().reflow(!0)),e.initonly||t.modifies(i),t.visit(o,s=>s[i]=n(s,e))}});function cT(e){D.call(this,[],e)}G(cT,D,{transform(e,t){const n=t.fork(t.ALL),i=e.generator;let r=this.value,o=e.size-r.length,s,a,u;if(o>0){for(s=[];--o>=0;)s.push(u=Ce(i(e))),r.push(u);n.add=n.add.length?n.materialize(n.ADD).add.concat(s):s}else a=r.slice(0,-o),n.rem=n.rem.length?n.materialize(n.REM).rem.concat(a):a,r=r.slice(-o);return n.source=this.value=r,n}});const Cf={value:"value",median:UC,mean:QI,min:n1,max:_s},c9=[];function pv(e){D.call(this,[],e)}pv.Definition={type:"Impute",metadata:{changes:!0},params:[{name:"field",type:"field",required:!0},{name:"key",type:"field",required:!0},{name:"keyvals",array:!0},{name:"groupby",type:"field",array:!0},{name:"method",type:"enum",default:"value",values:["value","mean","median","max","min"]},{name:"value",default:0}]};function f9(e){var t=e.method||Cf.value,n;if(Cf[t]==null)N("Unrecognized imputation method: "+t);else return t===Cf.value?(n=e.value!==void 0?e.value:0,()=>n):Cf[t]}function d9(e){const t=e.field;return n=>n?t(n):NaN}G(pv,D,{transform(e,t){var n=t.fork(t.ALL),i=f9(e),r=d9(e),o=Je(e.field),s=Je(e.key),a=(e.groupby||[]).map(Je),u=h9(t.source,e.groupby,e.key,e.keyvals),l=[],c=this.value,f=u.domain.length,d,h,g,p,m,y,b,v,x,E;for(m=0,v=u.length;m<v;++m)for(d=u[m],g=d.values,h=NaN,b=0;b<f;++b)if(d[b]==null){for(p=u.domain[b],E={_impute:!0},y=0,x=g.length;y<x;++y)E[a[y]]=g[y];E[s]=p,E[o]=Number.isNaN(h)?h=i(d,r):h,l.push(Ce(E))}return l.length&&(n.add=n.materialize(n.ADD).add.concat(l)),c.length&&(n.rem=n.materialize(n.REM).rem.concat(c)),this.value=l,n}});function h9(e,t,n,i){var r=y=>y(m),o=[],s=i?i.slice():[],a={},u={},l,c,f,d,h,g,p,m;for(s.forEach((y,b)=>a[y]=b+1),d=0,p=e.length;d<p;++d)m=e[d],g=n(m),h=a[g]||(a[g]=s.push(g)),c=(l=t?t.map(r):c9)+"",(f=u[c])||(f=u[c]=[],o.push(f),f.values=l),f[h-1]=m;return o.domain=s,o}function mv(e){Fo.call(this,e)}mv.Definition={type:"JoinAggregate",metadata:{modifies:!0},params:[{name:"groupby",type:"field",array:!0},{name:"fields",type:"field",null:!0,array:!0},{name:"ops",type:"enum",array:!0,values:Ic},{name:"as",type:"string",null:!0,array:!0},{name:"key",type:"field"}]};G(mv,Fo,{transform(e,t){const n=this,i=e.modified();let r;return n.value&&(i||t.modified(n._inputs,!0))?(r=n.value=i?n.init(e):{},t.visit(t.SOURCE,o=>n.add(o))):(r=n.value=n.value||this.init(e),t.visit(t.REM,o=>n.rem(o)),t.visit(t.ADD,o=>n.add(o))),n.changes(),t.visit(t.SOURCE,o=>{he(o,r[n.cellkey(o)].tuple)}),t.reflow(i).modifies(this._outputs)},changes(){const e=this._adds,t=this._mods;let n,i;for(n=0,i=this._alen;n<i;++n)this.celltuple(e[n]),e[n]=null;for(n=0,i=this._mlen;n<i;++n)this.celltuple(t[n]),t[n]=null;this._alen=this._mlen=0}});function yv(e){D.call(this,null,e)}yv.Definition={type:"KDE",metadata:{generates:!0},params:[{name:"groupby",type:"field",array:!0},{name:"field",type:"field",required:!0},{name:"cumulative",type:"boolean",default:!1},{name:"counts",type:"boolean",default:!1},{name:"bandwidth",type:"number",default:0},{name:"extent",type:"number",array:!0,length:2},{name:"resolve",type:"enum",values:["shared","independent"],default:"independent"},{name:"steps",type:"number"},{name:"minsteps",type:"number",default:25},{name:"maxsteps",type:"number",default:200},{name:"as",type:"string",array:!0,default:["value","density"]}]};G(yv,D,{transform(e,t){const n=t.fork(t.NO_SOURCE|t.NO_FIELDS);if(!this.value||t.changed()||e.modified()){const i=t.materialize(t.SOURCE).source,r=av(i,e.groupby,e.field),o=(e.groupby||[]).map(Je),s=e.bandwidth,a=e.cumulative?"cdf":"pdf",u=e.as||["value","density"],l=[];let c=e.extent,f=e.steps||e.minsteps||25,d=e.steps||e.maxsteps||200;a!=="pdf"&&a!=="cdf"&&N("Invalid density method: "+a),e.resolve==="shared"&&(c||(c=Qi(i,e.field)),f=d=e.steps||d),r.forEach(h=>{const g=qb(h,s)[a],p=e.counts?h.length:1,m=c||Qi(h);Tg(g,m,f,d).forEach(y=>{const b={};for(let v=0;v<o.length;++v)b[o[v]]=h.dims[v];b[u[0]]=y[0],b[u[1]]=y[1]*p,l.push(Ce(b))})}),this.value&&(n.rem=this.value),this.value=n.add=n.source=l}return n}});function fT(e){Ie.call(this,null,g9,e)}G(fT,Ie);function g9(e){return this.value&&!e.modified()?this.value:wb(e.fields,e.flat)}function dT(e){D.call(this,[],e),this._pending=null}G(dT,D,{transform(e,t){const n=t.dataflow;return this._pending?_m(this,t,this._pending):p9(e)?t.StopPropagation:e.values?_m(this,t,n.parse(e.values,e.format)):e.async?{async:n.request(e.url,e.format).then(r=>(this._pending=X(r.data),o=>o.touch(this)))}:n.request(e.url,e.format).then(i=>_m(this,t,X(i.data)))}});function p9(e){return e.modified("async")&&!(e.modified("values")||e.modified("url")||e.modified("format"))}function _m(e,t,n){n.forEach(Ce);const i=t.fork(t.NO_FIELDS&t.NO_SOURCE);return i.rem=e.value,e.value=i.source=i.add=n,e._pending=null,i.rem.length&&i.clean(!0),i}function bv(e){D.call(this,{},e)}bv.Definition={type:"Lookup",metadata:{modifies:!0},params:[{name:"index",type:"index",params:[{name:"from",type:"data",required:!0},{name:"key",type:"field",required:!0}]},{name:"values",type:"field",array:!0},{name:"fields",type:"field",array:!0,required:!0},{name:"as",type:"string",array:!0},{name:"default",default:null}]};G(bv,D,{transform(e,t){const n=e.fields,i=e.index,r=e.values,o=e.default==null?null:e.default,s=e.modified(),a=n.length;let u=s?t.SOURCE:t.ADD,l=t,c=e.as,f,d,h;return r?(d=r.length,a>1&&!c&&N('Multi-field lookup requires explicit "as" parameter.'),c&&c.length!==a*d&&N('The "as" parameter has too few output field names.'),c=c||r.map(Je),f=function(g){for(var p=0,m=0,y,b;p<a;++p)if(b=i.get(n[p](g)),b==null)for(y=0;y<d;++y,++m)g[c[m]]=o;else for(y=0;y<d;++y,++m)g[c[m]]=r[y](b)}):(c||N("Missing output field names."),f=function(g){for(var p=0,m;p<a;++p)m=i.get(n[p](g)),g[c[p]]=m??o}),s?l=t.reflow(!0):(h=n.some(g=>t.modified(g.fields)),u|=h?t.MOD:0),t.visit(u,f),l.modifies(c)}});function hT(e){Ie.call(this,null,m9,e)}G(hT,Ie);function m9(e){if(this.value&&!e.modified())return this.value;const t=e.extents,n=t.length;let i=1/0,r=-1/0,o,s;for(o=0;o<n;++o)s=t[o],s[0]<i&&(i=s[0]),s[1]>r&&(r=s[1]);return[i,r]}function gT(e){Ie.call(this,null,y9,e)}G(gT,Ie);function y9(e){return this.value&&!e.modified()?this.value:e.values.reduce((t,n)=>t.concat(n),[])}function pT(e){D.call(this,null,e)}G(pT,D,{transform(e,t){return this.modified(e.modified()),this.value=e,t.fork(t.NO_SOURCE|t.NO_FIELDS)}});function vv(e){Fo.call(this,e)}vv.Definition={type:"Pivot",metadata:{generates:!0,changes:!0},params:[{name:"groupby",type:"field",array:!0},{name:"field",type:"field",required:!0},{name:"value",type:"field",required:!0},{name:"op",type:"enum",values:Ic,default:"sum"},{name:"limit",type:"number",default:0},{name:"key",type:"field"}]};G(vv,Fo,{_transform:Fo.prototype.transform,transform(e,t){return this._transform(b9(e,t),t)}});function b9(e,t){const n=e.field,i=e.value,r=(e.op==="count"?"__count__":e.op)||"sum",o=qt(n).concat(qt(i)),s=x9(n,e.limit||0,t);return t.changed()&&e.set("__pivot__",null,null,!0),{key:e.key,groupby:e.groupby,ops:s.map(()=>r),fields:s.map(a=>v9(a,n,i,o)),as:s.map(a=>a+""),modified:e.modified.bind(e)}}function v9(e,t,n,i){return An(r=>t(r)===e?n(r):NaN,i,e+"")}function x9(e,t,n){const i={},r=[];return n.visit(n.SOURCE,o=>{const s=e(o);i[s]||(i[s]=1,r.push(s))}),r.sort(gg),t?r.slice(0,t):r}function mT(e){Mg.call(this,e)}G(mT,Mg,{transform(e,t){const n=e.subflow,i=e.field,r=o=>this.subflow(ie(o),n,t,o);return(e.modified("field")||i&&t.modified(qt(i)))&&N("PreFacet does not support field modification."),this.initTargets(),i?(t.visit(t.MOD,o=>{const s=r(o);i(o).forEach(a=>s.mod(a))}),t.visit(t.ADD,o=>{const s=r(o);i(o).forEach(a=>s.add(Ce(a)))}),t.visit(t.REM,o=>{const s=r(o);i(o).forEach(a=>s.rem(a))})):(t.visit(t.MOD,o=>r(o).mod(o)),t.visit(t.ADD,o=>r(o).add(o)),t.visit(t.REM,o=>r(o).rem(o))),t.clean()&&t.runAfter(()=>this.clean()),t}});function xv(e){D.call(this,null,e)}xv.Definition={type:"Project",metadata:{generates:!0,changes:!0},params:[{name:"fields",type:"field",array:!0},{name:"as",type:"string",null:!0,array:!0}]};G(xv,D,{transform(e,t){const n=t.fork(t.NO_SOURCE),i=e.fields,r=sT(e.fields,e.as||[]),o=i?(a,u)=>w9(a,u,i,r):Sg;let s;return this.value?s=this.value:(t=t.addAll(),s=this.value={}),t.visit(t.REM,a=>{const u=ie(a);n.rem.push(s[u]),s[u]=null}),t.visit(t.ADD,a=>{const u=o(a,Ce({}));s[ie(a)]=u,n.add.push(u)}),t.visit(t.MOD,a=>{n.mod.push(o(a,s[ie(a)]))}),n}});function w9(e,t,n,i){for(let r=0,o=n.length;r<o;++r)t[i[r]]=n[r](e);return t}function yT(e){D.call(this,null,e)}G(yT,D,{transform(e,t){return this.value=e.value,e.modified("value")?t.fork(t.NO_SOURCE|t.NO_FIELDS):t.StopPropagation}});function wv(e){D.call(this,null,e)}wv.Definition={type:"Quantile",metadata:{generates:!0,changes:!0},params:[{name:"groupby",type:"field",array:!0},{name:"field",type:"field",required:!0},{name:"probs",type:"number",array:!0},{name:"step",type:"number",default:.01},{name:"as",type:"string",array:!0,default:["prob","value"]}]};const E9=1e-14;G(wv,D,{transform(e,t){const n=t.fork(t.NO_SOURCE|t.NO_FIELDS),i=e.as||["prob","value"];if(this.value&&!e.modified()&&!t.changed())return n.source=this.value,n;const r=t.materialize(t.SOURCE).source,o=av(r,e.groupby,e.field),s=(e.groupby||[]).map(Je),a=[],u=e.step||.01,l=e.probs||Mn(u/2,1-E9,u),c=l.length;return o.forEach(f=>{const d=Ib(f,l);for(let h=0;h<c;++h){const g={};for(let p=0;p<s.length;++p)g[s[p]]=f.dims[p];g[i[0]]=l[h],g[i[1]]=d[h],a.push(Ce(g))}}),this.value&&(n.rem=this.value),this.value=n.add=n.source=a,n}});function bT(e){D.call(this,null,e)}G(bT,D,{transform(e,t){let n,i;return this.value?i=this.value:(n=t=t.addAll(),i=this.value={}),e.derive&&(n=t.fork(t.NO_SOURCE),t.visit(t.REM,r=>{const o=ie(r);n.rem.push(i[o]),i[o]=null}),t.visit(t.ADD,r=>{const o=Nb(r);i[ie(r)]=o,n.add.push(o)}),t.visit(t.MOD,r=>{const o=i[ie(r)];for(const s in r)o[s]=r[s],n.modifies(s);n.mod.push(o)})),n}});function Ev(e){D.call(this,[],e),this.count=0}Ev.Definition={type:"Sample",metadata:{},params:[{name:"size",type:"number",default:1e3}]};G(Ev,D,{transform(e,t){const n=t.fork(t.NO_SOURCE),i=e.modified("size"),r=e.size,o=this.value.reduce((c,f)=>(c[ie(f)]=1,c),{});let s=this.value,a=this.count,u=0;function l(c){let f,d;s.length<r?s.push(c):(d=~~((a+1)*ei()),d<s.length&&d>=u&&(f=s[d],o[ie(f)]&&n.rem.push(f),s[d]=c)),++a}if(t.rem.length&&(t.visit(t.REM,c=>{const f=ie(c);o[f]&&(o[f]=-1,n.rem.push(c)),--a}),s=s.filter(c=>o[ie(c)]!==-1)),(t.rem.length||i)&&s.length<r&&t.source&&(u=a=s.length,t.visit(t.SOURCE,c=>{o[ie(c)]||l(c)}),u=-1),i&&s.length>r){const c=s.length-r;for(let f=0;f<c;++f)o[ie(s[f])]=-1,n.rem.push(s[f]);s=s.slice(c)}return t.mod.length&&t.visit(t.MOD,c=>{o[ie(c)]&&n.mod.push(c)}),t.add.length&&t.visit(t.ADD,l),(t.add.length||u<0)&&(n.add=s.filter(c=>!o[ie(c)])),this.count=a,this.value=n.source=s,n}});function Sv(e){D.call(this,null,e)}Sv.Definition={type:"Sequence",metadata:{generates:!0,changes:!0},params:[{name:"start",type:"number",required:!0},{name:"stop",type:"number",required:!0},{name:"step",type:"number",default:1},{name:"as",type:"string",default:"data"}]};G(Sv,D,{transform(e,t){if(this.value&&!e.modified())return;const n=t.materialize().fork(t.MOD),i=e.as||"data";return n.rem=this.value?t.rem.concat(this.value):t.rem,this.value=Mn(e.start,e.stop,e.step||1).map(r=>{const o={};return o[i]=r,Ce(o)}),n.add=t.add.concat(this.value),n}});function vT(e){D.call(this,null,e),this.modified(!0)}G(vT,D,{transform(e,t){return this.value=t.source,t.changed()?t.fork(t.NO_SOURCE|t.NO_FIELDS):t.StopPropagation}});function _v(e){D.call(this,null,e)}const xT=["unit0","unit1"];_v.Definition={type:"TimeUnit",metadata:{modifies:!0},params:[{name:"field",type:"field",required:!0},{name:"interval",type:"boolean",default:!0},{name:"units",type:"enum",values:$b,array:!0},{name:"step",type:"number",default:1},{name:"maxbins",type:"number",default:40},{name:"extent",type:"date",array:!0},{name:"timezone",type:"enum",default:"local",values:["local","utc"]},{name:"as",type:"string",array:!0,length:2,default:xT}]};G(_v,D,{transform(e,t){const n=e.field,i=e.interval!==!1,r=e.timezone==="utc",o=this._floor(e,t),s=(r?Ru:Ou)(o.unit).offset,a=e.as||xT,u=a[0],l=a[1],c=o.step;let f=o.start||1/0,d=o.stop||-1/0,h=t.ADD;return(e.modified()||t.changed(t.REM)||t.modified(qt(n)))&&(t=t.reflow(!0),h=t.SOURCE,f=1/0,d=-1/0),t.visit(h,g=>{const p=n(g);let m,y;p==null?(g[u]=null,i&&(g[l]=null)):(g[u]=m=y=o(p),i&&(g[l]=y=s(m,c)),m<f&&(f=m),y>d&&(d=y))}),o.start=f,o.stop=d,t.modifies(i?a:u)},_floor(e,t){const n=e.timezone==="utc",{units:i,step:r}=e.units?{units:e.units,step:e.step||1}:cF({extent:e.extent||Qi(t.materialize(t.SOURCE).source,e.field),maxbins:e.maxbins}),o=kb(i),s=this.value||{},a=(n?tF:eF)(o,r);return a.unit=Ee(o),a.units=o,a.step=r,a.start=s.start,a.stop=s.stop,this.value=a}});function wT(e){D.call(this,Tu(),e)}G(wT,D,{transform(e,t){const n=t.dataflow,i=e.field,r=this.value,o=a=>r.set(i(a),a);let s=!0;return e.modified("field")||t.modified(i.fields)?(r.clear(),t.visit(t.SOURCE,o)):t.changed()?(t.visit(t.REM,a=>r.delete(i(a))),t.visit(t.ADD,o)):s=!1,this.modified(s),r.empty>n.cleanThreshold&&n.runAfter(r.clean),t.fork()}});function ET(e){D.call(this,null,e)}G(ET,D,{transform(e,t){(!this.value||e.modified("field")||e.modified("sort")||t.changed()||e.sort&&t.modified(e.sort.fields))&&(this.value=(e.sort?t.source.slice().sort(ea(e.sort)):t.source).map(e.field))}});function S9(e,t,n,i){const r=lc[e](t,n);return{init:r.init||fo,update:function(o,s){s[i]=r.next(o)}}}const lc={row_number:function(){return{next:e=>e.index+1}},rank:function(){let e;return{init:()=>e=1,next:t=>{const n=t.index,i=t.data;return n&&t.compare(i[n-1],i[n])?e=n+1:e}}},dense_rank:function(){let e;return{init:()=>e=1,next:t=>{const n=t.index,i=t.data;return n&&t.compare(i[n-1],i[n])?++e:e}}},percent_rank:function(){const e=lc.rank(),t=e.next;return{init:e.init,next:n=>(t(n)-1)/(n.data.length-1)}},cume_dist:function(){let e;return{init:()=>e=0,next:t=>{const n=t.data,i=t.compare;let r=t.index;if(e<r){for(;r+1<n.length&&!i(n[r],n[r+1]);)++r;e=r}return(1+e)/n.length}}},ntile:function(e,t){t=+t,t>0||N("ntile num must be greater than zero.");const n=lc.cume_dist(),i=n.next;return{init:n.init,next:r=>Math.ceil(t*i(r))}},lag:function(e,t){return t=+t||1,{next:n=>{const i=n.index-t;return i>=0?e(n.data[i]):null}}},lead:function(e,t){return t=+t||1,{next:n=>{const i=n.index+t,r=n.data;return i<r.length?e(r[i]):null}}},first_value:function(e){return{next:t=>e(t.data[t.i0])}},last_value:function(e){return{next:t=>e(t.data[t.i1-1])}},nth_value:function(e,t){return t=+t,t>0||N("nth_value nth must be greater than zero."),{next:n=>{const i=n.i0+(t-1);return i<n.i1?e(n.data[i]):null}}},prev_value:function(e){let t;return{init:()=>t=null,next:n=>{const i=e(n.data[n.index]);return i!=null?t=i:t}}},next_value:function(e){let t,n;return{init:()=>(t=null,n=-1),next:i=>{const r=i.data;return i.index<=n?t:(n=_9(e,r,i.index))<0?(n=r.length,t=null):t=e(r[n])}}}};function _9(e,t,n){for(let i=t.length;n<i;++n)if(e(t[n])!=null)return n;return-1}const A9=Object.keys(lc);function ST(e){const t=X(e.ops),n=X(e.fields),i=X(e.params),r=X(e.aggregate_params),o=X(e.as),s=this.outputs=[],a=this.windows=[],u={},l={},c=[],f=[];let d=!0;function h(g){X(qt(g)).forEach(p=>u[p]=1)}h(e.sort),t.forEach((g,p)=>{const m=n[p],y=i[p],b=r[p]||null,v=Je(m),x=QF(g,v,o[p]);if(h(m),s.push(x),J(lc,g))a.push(S9(g,m,y,x));else{if(m==null&&g!=="count"&&N("Null aggregate field specified."),g==="count"){c.push(x);return}d=!1;let E=l[v];E||(E=l[v]=[],E.field=m,f.push(E)),E.push(ZF(g,b,x))}}),(c.length||f.length)&&(this.cell=$9(f,c,d)),this.inputs=Object.keys(u)}const _T=ST.prototype;_T.init=function(){this.windows.forEach(e=>e.init()),this.cell&&this.cell.init()};_T.update=function(e,t){const n=this.cell,i=this.windows,r=e.data,o=i&&i.length;let s;if(n){for(s=e.p0;s<e.i0;++s)n.rem(r[s]);for(s=e.p1;s<e.i1;++s)n.add(r[s]);n.set(t)}for(s=0;s<o;++s)i[s].update(e,t)};function $9(e,t,n){e=e.map(u=>tT(u,u.field));const i={num:0,agg:null,store:!1,count:t};if(!n)for(var r=e.length,o=i.agg=Array(r),s=0;s<r;++s)o[s]=new e[s](i);if(i.store)var a=i.data=new tv;return i.add=function(u){if(i.num+=1,!n){a&&a.add(u);for(let l=0;l<r;++l)o[l].add(o[l].get(u),u)}},i.rem=function(u){if(i.num-=1,!n){a&&a.rem(u);for(let l=0;l<r;++l)o[l].rem(o[l].get(u),u)}},i.set=function(u){let l,c;for(a&&a.values(),l=0,c=t.length;l<c;++l)u[t[l]]=i.num;if(!n)for(l=0,c=o.length;l<c;++l)o[l].set(u)},i.init=function(){i.num=0,a&&a.reset();for(let u=0;u<r;++u)o[u].init()},i}function Av(e){D.call(this,{},e),this._mlen=0,this._mods=[]}Av.Definition={type:"Window",metadata:{modifies:!0},params:[{name:"sort",type:"compare"},{name:"groupby",type:"field",array:!0},{name:"ops",type:"enum",array:!0,values:A9.concat(Ic)},{name:"params",type:"number",null:!0,array:!0},{name:"aggregate_params",type:"number",null:!0,array:!0},{name:"fields",type:"field",null:!0,array:!0},{name:"as",type:"string",null:!0,array:!0},{name:"frame",type:"number",null:!0,array:!0,length:2,default:[null,0]},{name:"ignorePeers",type:"boolean",default:!1}]};G(Av,D,{transform(e,t){this.stamp=t.stamp;const n=e.modified(),i=ea(e.sort),r=h1(e.groupby),o=a=>this.group(r(a));let s=this.state;(!s||n)&&(s=this.state=new ST(e)),n||t.modified(s.inputs)?(this.value={},t.visit(t.SOURCE,a=>o(a).add(a))):(t.visit(t.REM,a=>o(a).remove(a)),t.visit(t.ADD,a=>o(a).add(a)));for(let a=0,u=this._mlen;a<u;++a)k9(this._mods[a],s,i,e);return this._mlen=0,this._mods=[],t.reflow(n).modifies(s.outputs)},group(e){let t=this.value[e];return t||(t=this.value[e]=nT(ie),t.stamp=-1),t.stamp<this.stamp&&(t.stamp=this.stamp,this._mods[this._mlen++]=t),t}});function k9(e,t,n,i){const r=i.sort,o=r&&!i.ignorePeers,s=i.frame||[null,0],a=e.data(n),u=a.length,l=o?ag(r):null,c={i0:0,i1:0,p0:0,p1:0,index:0,data:a,compare:r||Yt(-1)};t.init();for(let f=0;f<u;++f)C9(c,s,f,u),o&&F9(c,l),t.update(c,a[f])}function C9(e,t,n,i){e.p0=e.i0,e.p1=e.i1,e.i0=t[0]==null?0:Math.max(0,n-Math.abs(t[0])),e.i1=t[1]==null?i:Math.min(i,n+Math.abs(t[1])+1),e.index=n}function F9(e,t){const n=e.i0,i=e.i1-1,r=e.compare,o=e.data,s=o.length-1;n>0&&!r(o[n],o[n-1])&&(e.i0=t.left(o,o[n])),i<s&&!r(o[i],o[i+1])&&(e.i1=t.right(o,o[i]))}const T9=Object.freeze(Object.defineProperty({__proto__:null,aggregate:Fo,bin:nv,collect:iv,compare:iT,countpattern:rv,cross:ov,density:sv,dotbin:uv,expression:uT,extent:lv,facet:Mg,field:lT,filter:fv,flatten:dv,fold:hv,formula:gv,generate:cT,impute:pv,joinaggregate:mv,kde:yv,key:fT,load:dT,lookup:bv,multiextent:hT,multivalues:gT,params:pT,pivot:vv,prefacet:mT,project:xv,proxy:yT,quantile:wv,relay:bT,sample:Ev,sequence:Sv,sieve:vT,subflow:cv,timeunit:_v,tupleindex:wT,values:ET,window:Av},Symbol.toStringTag,{value:"Module"}));function Fe(e){return function(){return e}}const mS=Math.abs,Rt=Math.atan2,ns=Math.cos,M9=Math.max,Am=Math.min,Li=Math.sin,ws=Math.sqrt,Lt=1e-12,Qa=Math.PI,jd=Qa/2,AT=2*Qa;function D9(e){return e>1?0:e<-1?Qa:Math.acos(e)}function yS(e){return e>=1?jd:e<=-1?-jd:Math.asin(e)}function Dg(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{const i=Math.floor(n);if(!(i>=0))throw new RangeError(`invalid digits: ${n}`);t=i}return e},()=>new lI(t)}function O9(e){return e.innerRadius}function R9(e){return e.outerRadius}function N9(e){return e.startAngle}function L9(e){return e.endAngle}function P9(e){return e&&e.padAngle}function I9(e,t,n,i,r,o,s,a){var u=n-e,l=i-t,c=s-r,f=a-o,d=f*u-c*l;if(!(d*d<Lt))return d=(c*(t-o)-f*(e-r))/d,[e+d*u,t+d*l]}function Ff(e,t,n,i,r,o,s){var a=e-n,u=t-i,l=(s?o:-o)/ws(a*a+u*u),c=l*u,f=-l*a,d=e+c,h=t+f,g=n+c,p=i+f,m=(d+g)/2,y=(h+p)/2,b=g-d,v=p-h,x=b*b+v*v,E=r-o,S=d*p-g*h,w=(v<0?-1:1)*ws(M9(0,E*E*x-S*S)),_=(S*v-b*w)/x,A=(-S*b-v*w)/x,k=(S*v+b*w)/x,C=(-S*b+v*w)/x,O=_-m,M=A-y,F=k-m,$=C-y;return O*O+M*M>F*F+$*$&&(_=k,A=C),{cx:_,cy:A,x01:-c,y01:-f,x11:_*(r/E-1),y11:A*(r/E-1)}}function z9(){var e=O9,t=R9,n=Fe(0),i=null,r=N9,o=L9,s=P9,a=null,u=Dg(l);function l(){var c,f,d=+e.apply(this,arguments),h=+t.apply(this,arguments),g=r.apply(this,arguments)-jd,p=o.apply(this,arguments)-jd,m=mS(p-g),y=p>g;if(a||(a=c=u()),h<d&&(f=h,h=d,d=f),!(h>Lt))a.moveTo(0,0);else if(m>AT-Lt)a.moveTo(h*ns(g),h*Li(g)),a.arc(0,0,h,g,p,!y),d>Lt&&(a.moveTo(d*ns(p),d*Li(p)),a.arc(0,0,d,p,g,y));else{var b=g,v=p,x=g,E=p,S=m,w=m,_=s.apply(this,arguments)/2,A=_>Lt&&(i?+i.apply(this,arguments):ws(d*d+h*h)),k=Am(mS(h-d)/2,+n.apply(this,arguments)),C=k,O=k,M,F;if(A>Lt){var $=yS(A/d*Li(_)),T=yS(A/h*Li(_));(S-=$*2)>Lt?($*=y?1:-1,x+=$,E-=$):(S=0,x=E=(g+p)/2),(w-=T*2)>Lt?(T*=y?1:-1,b+=T,v-=T):(w=0,b=v=(g+p)/2)}var L=h*ns(b),z=h*Li(b),I=d*ns(E),Q=d*Li(E);if(k>Lt){var ue=h*ns(v),oe=h*Li(v),fe=d*ns(x),Pe=d*Li(x),de;if(m<Qa)if(de=I9(L,z,fe,Pe,ue,oe,I,Q)){var Dt=L-de[0],ts=z-de[1],to=ue-de[0],Z=oe-de[1],pe=1/Li(D9((Dt*to+ts*Z)/(ws(Dt*Dt+ts*ts)*ws(to*to+Z*Z)))/2),ye=ws(de[0]*de[0]+de[1]*de[1]);C=Am(k,(d-ye)/(pe-1)),O=Am(k,(h-ye)/(pe+1))}else C=O=0}w>Lt?O>Lt?(M=Ff(fe,Pe,L,z,h,O,y),F=Ff(ue,oe,I,Q,h,O,y),a.moveTo(M.cx+M.x01,M.cy+M.y01),O<k?a.arc(M.cx,M.cy,O,Rt(M.y01,M.x01),Rt(F.y01,F.x01),!y):(a.arc(M.cx,M.cy,O,Rt(M.y01,M.x01),Rt(M.y11,M.x11),!y),a.arc(0,0,h,Rt(M.cy+M.y11,M.cx+M.x11),Rt(F.cy+F.y11,F.cx+F.x11),!y),a.arc(F.cx,F.cy,O,Rt(F.y11,F.x11),Rt(F.y01,F.x01),!y))):(a.moveTo(L,z),a.arc(0,0,h,b,v,!y)):a.moveTo(L,z),!(d>Lt)||!(S>Lt)?a.lineTo(I,Q):C>Lt?(M=Ff(I,Q,ue,oe,d,-C,y),F=Ff(L,z,fe,Pe,d,-C,y),a.lineTo(M.cx+M.x01,M.cy+M.y01),C<k?a.arc(M.cx,M.cy,C,Rt(M.y01,M.x01),Rt(F.y01,F.x01),!y):(a.arc(M.cx,M.cy,C,Rt(M.y01,M.x01),Rt(M.y11,M.x11),!y),a.arc(0,0,d,Rt(M.cy+M.y11,M.cx+M.x11),Rt(F.cy+F.y11,F.cx+F.x11),y),a.arc(F.cx,F.cy,C,Rt(F.y11,F.x11),Rt(F.y01,F.x01),!y))):a.arc(0,0,d,E,x,y)}if(a.closePath(),c)return a=null,c+""||null}return l.centroid=function(){var c=(+e.apply(this,arguments)+ +t.apply(this,arguments))/2,f=(+r.apply(this,arguments)+ +o.apply(this,arguments))/2-Qa/2;return[ns(f)*c,Li(f)*c]},l.innerRadius=function(c){return arguments.length?(e=typeof c=="function"?c:Fe(+c),l):e},l.outerRadius=function(c){return arguments.length?(t=typeof c=="function"?c:Fe(+c),l):t},l.cornerRadius=function(c){return arguments.length?(n=typeof c=="function"?c:Fe(+c),l):n},l.padRadius=function(c){return arguments.length?(i=c==null?null:typeof c=="function"?c:Fe(+c),l):i},l.startAngle=function(c){return arguments.length?(r=typeof c=="function"?c:Fe(+c),l):r},l.endAngle=function(c){return arguments.length?(o=typeof c=="function"?c:Fe(+c),l):o},l.padAngle=function(c){return arguments.length?(s=typeof c=="function"?c:Fe(+c),l):s},l.context=function(c){return arguments.length?(a=c??null,l):a},l}function $T(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function kT(e){this._context=e}kT.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function $v(e){return new kT(e)}function CT(e){return e[0]}function FT(e){return e[1]}function TT(e,t){var n=Fe(!0),i=null,r=$v,o=null,s=Dg(a);e=typeof e=="function"?e:e===void 0?CT:Fe(e),t=typeof t=="function"?t:t===void 0?FT:Fe(t);function a(u){var l,c=(u=$T(u)).length,f,d=!1,h;for(i==null&&(o=r(h=s())),l=0;l<=c;++l)!(l<c&&n(f=u[l],l,u))===d&&((d=!d)?o.lineStart():o.lineEnd()),d&&o.point(+e(f,l,u),+t(f,l,u));if(h)return o=null,h+""||null}return a.x=function(u){return arguments.length?(e=typeof u=="function"?u:Fe(+u),a):e},a.y=function(u){return arguments.length?(t=typeof u=="function"?u:Fe(+u),a):t},a.defined=function(u){return arguments.length?(n=typeof u=="function"?u:Fe(!!u),a):n},a.curve=function(u){return arguments.length?(r=u,i!=null&&(o=r(i)),a):r},a.context=function(u){return arguments.length?(u==null?i=o=null:o=r(i=u),a):i},a}function MT(e,t,n){var i=null,r=Fe(!0),o=null,s=$v,a=null,u=Dg(l);e=typeof e=="function"?e:e===void 0?CT:Fe(+e),t=typeof t=="function"?t:Fe(t===void 0?0:+t),n=typeof n=="function"?n:n===void 0?FT:Fe(+n);function l(f){var d,h,g,p=(f=$T(f)).length,m,y=!1,b,v=new Array(p),x=new Array(p);for(o==null&&(a=s(b=u())),d=0;d<=p;++d){if(!(d<p&&r(m=f[d],d,f))===y)if(y=!y)h=d,a.areaStart(),a.lineStart();else{for(a.lineEnd(),a.lineStart(),g=d-1;g>=h;--g)a.point(v[g],x[g]);a.lineEnd(),a.areaEnd()}y&&(v[d]=+e(m,d,f),x[d]=+t(m,d,f),a.point(i?+i(m,d,f):v[d],n?+n(m,d,f):x[d]))}if(b)return a=null,b+""||null}function c(){return TT().defined(r).curve(s).context(o)}return l.x=function(f){return arguments.length?(e=typeof f=="function"?f:Fe(+f),i=null,l):e},l.x0=function(f){return arguments.length?(e=typeof f=="function"?f:Fe(+f),l):e},l.x1=function(f){return arguments.length?(i=f==null?null:typeof f=="function"?f:Fe(+f),l):i},l.y=function(f){return arguments.length?(t=typeof f=="function"?f:Fe(+f),n=null,l):t},l.y0=function(f){return arguments.length?(t=typeof f=="function"?f:Fe(+f),l):t},l.y1=function(f){return arguments.length?(n=f==null?null:typeof f=="function"?f:Fe(+f),l):n},l.lineX0=l.lineY0=function(){return c().x(e).y(t)},l.lineY1=function(){return c().x(e).y(n)},l.lineX1=function(){return c().x(i).y(t)},l.defined=function(f){return arguments.length?(r=typeof f=="function"?f:Fe(!!f),l):r},l.curve=function(f){return arguments.length?(s=f,o!=null&&(a=s(o)),l):s},l.context=function(f){return arguments.length?(f==null?o=a=null:a=s(o=f),l):o},l}const B9={draw(e,t){const n=ws(t/Qa);e.moveTo(n,0),e.arc(0,0,n,0,AT)}};function U9(e,t){let n=null,i=Dg(r);e=typeof e=="function"?e:Fe(e||B9),t=typeof t=="function"?t:Fe(t===void 0?64:+t);function r(){let o;if(n||(n=o=i()),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),o)return n=null,o+""||null}return r.type=function(o){return arguments.length?(e=typeof o=="function"?o:Fe(o),r):e},r.size=function(o){return arguments.length?(t=typeof o=="function"?o:Fe(+o),r):t},r.context=function(o){return arguments.length?(n=o??null,r):n},r}function To(){}function qd(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function Og(e){this._context=e}Og.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:qd(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:qd(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function j9(e){return new Og(e)}function DT(e){this._context=e}DT.prototype={areaStart:To,areaEnd:To,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:qd(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function q9(e){return new DT(e)}function OT(e){this._context=e}OT.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+e)/6,i=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,i):this._context.moveTo(n,i);break;case 3:this._point=4;default:qd(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function W9(e){return new OT(e)}function RT(e,t){this._basis=new Og(e),this._beta=t}RT.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var e=this._x,t=this._y,n=e.length-1;if(n>0)for(var i=e[0],r=t[0],o=e[n]-i,s=t[n]-r,a=-1,u;++a<=n;)u=a/n,this._basis.point(this._beta*e[a]+(1-this._beta)*(i+u*o),this._beta*t[a]+(1-this._beta)*(r+u*s));this._x=this._y=null,this._basis.lineEnd()},point:function(e,t){this._x.push(+e),this._y.push(+t)}};const H9=function e(t){function n(i){return t===1?new Og(i):new RT(i,t)}return n.beta=function(i){return e(+i)},n}(.85);function Wd(e,t,n){e._context.bezierCurveTo(e._x1+e._k*(e._x2-e._x0),e._y1+e._k*(e._y2-e._y0),e._x2+e._k*(e._x1-t),e._y2+e._k*(e._y1-n),e._x2,e._y2)}function kv(e,t){this._context=e,this._k=(1-t)/6}kv.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:Wd(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2,this._x1=e,this._y1=t;break;case 2:this._point=3;default:Wd(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const G9=function e(t){function n(i){return new kv(i,t)}return n.tension=function(i){return e(+i)},n}(0);function Cv(e,t){this._context=e,this._k=(1-t)/6}Cv.prototype={areaStart:To,areaEnd:To,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:Wd(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const V9=function e(t){function n(i){return new Cv(i,t)}return n.tension=function(i){return e(+i)},n}(0);function Fv(e,t){this._context=e,this._k=(1-t)/6}Fv.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:Wd(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const Y9=function e(t){function n(i){return new Fv(i,t)}return n.tension=function(i){return e(+i)},n}(0);function Tv(e,t,n){var i=e._x1,r=e._y1,o=e._x2,s=e._y2;if(e._l01_a>Lt){var a=2*e._l01_2a+3*e._l01_a*e._l12_a+e._l12_2a,u=3*e._l01_a*(e._l01_a+e._l12_a);i=(i*a-e._x0*e._l12_2a+e._x2*e._l01_2a)/u,r=(r*a-e._y0*e._l12_2a+e._y2*e._l01_2a)/u}if(e._l23_a>Lt){var l=2*e._l23_2a+3*e._l23_a*e._l12_a+e._l12_2a,c=3*e._l23_a*(e._l23_a+e._l12_a);o=(o*l+e._x1*e._l23_2a-t*e._l12_2a)/c,s=(s*l+e._y1*e._l23_2a-n*e._l12_2a)/c}e._context.bezierCurveTo(i,r,o,s,e._x2,e._y2)}function NT(e,t){this._context=e,this._alpha=t}NT.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,i=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+i*i,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3;default:Tv(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const X9=function e(t){function n(i){return t?new NT(i,t):new kv(i,0)}return n.alpha=function(i){return e(+i)},n}(.5);function LT(e,t){this._context=e,this._alpha=t}LT.prototype={areaStart:To,areaEnd:To,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,i=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+i*i,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:Tv(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const K9=function e(t){function n(i){return t?new LT(i,t):new Cv(i,0)}return n.alpha=function(i){return e(+i)},n}(.5);function PT(e,t){this._context=e,this._alpha=t}PT.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,i=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+i*i,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:Tv(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const J9=function e(t){function n(i){return t?new PT(i,t):new Fv(i,0)}return n.alpha=function(i){return e(+i)},n}(.5);function IT(e){this._context=e}IT.prototype={areaStart:To,areaEnd:To,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function Q9(e){return new IT(e)}function bS(e){return e<0?-1:1}function vS(e,t,n){var i=e._x1-e._x0,r=t-e._x1,o=(e._y1-e._y0)/(i||r<0&&-0),s=(n-e._y1)/(r||i<0&&-0),a=(o*r+s*i)/(i+r);return(bS(o)+bS(s))*Math.min(Math.abs(o),Math.abs(s),.5*Math.abs(a))||0}function xS(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function $m(e,t,n){var i=e._x0,r=e._y0,o=e._x1,s=e._y1,a=(o-i)/3;e._context.bezierCurveTo(i+a,r+a*t,o-a,s-a*n,o,s)}function Hd(e){this._context=e}Hd.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:$m(this,this._t0,xS(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,$m(this,xS(this,n=vS(this,e,t)),n);break;default:$m(this,this._t0,n=vS(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function zT(e){this._context=new BT(e)}(zT.prototype=Object.create(Hd.prototype)).point=function(e,t){Hd.prototype.point.call(this,t,e)};function BT(e){this._context=e}BT.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,i,r,o){this._context.bezierCurveTo(t,e,i,n,o,r)}};function Z9(e){return new Hd(e)}function e8(e){return new zT(e)}function UT(e){this._context=e}UT.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),n===2)this._context.lineTo(e[1],t[1]);else for(var i=wS(e),r=wS(t),o=0,s=1;s<n;++o,++s)this._context.bezierCurveTo(i[0][o],r[0][o],i[1][o],r[1][o],e[s],t[s]);(this._line||this._line!==0&&n===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}};function wS(e){var t,n=e.length-1,i,r=new Array(n),o=new Array(n),s=new Array(n);for(r[0]=0,o[0]=2,s[0]=e[0]+2*e[1],t=1;t<n-1;++t)r[t]=1,o[t]=4,s[t]=4*e[t]+2*e[t+1];for(r[n-1]=2,o[n-1]=7,s[n-1]=8*e[n-1]+e[n],t=1;t<n;++t)i=r[t]/o[t-1],o[t]-=i,s[t]-=i*s[t-1];for(r[n-1]=s[n-1]/o[n-1],t=n-2;t>=0;--t)r[t]=(s[t]-r[t+1])/o[t];for(o[n-1]=(e[n]+r[n-1])/2,t=0;t<n-1;++t)o[t]=2*e[t+1]-r[t+1];return[r,o]}function t8(e){return new UT(e)}function Rg(e,t){this._context=e,this._t=t}Rg.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}break}}this._x=e,this._y=t}};function n8(e){return new Rg(e,.5)}function i8(e){return new Rg(e,0)}function r8(e){return new Rg(e,1)}function $o(e,t){if(typeof document<"u"&&document.createElement){const n=document.createElement("canvas");if(n&&n.getContext)return n.width=e,n.height=t,n}return null}const o8=()=>typeof Image<"u"?Image:null,g1=Symbol("implicit");function Mv(){var e=new qE,t=[],n=[],i=g1;function r(o){let s=e.get(o);if(s===void 0){if(i!==g1)return i;e.set(o,s=t.push(o)-1)}return n[s%n.length]}return r.domain=function(o){if(!arguments.length)return t.slice();t=[],e=new qE;for(const s of o)e.has(s)||e.set(s,t.push(s)-1);return r},r.range=function(o){return arguments.length?(n=Array.from(o),r):n.slice()},r.unknown=function(o){return arguments.length?(i=o,r):i},r.copy=function(){return Mv(t,n).unknown(i)},jo.apply(r,arguments),r}const jT=Math.PI/180,qT=180/Math.PI,Gd=18,WT=.96422,HT=1,GT=.82521,VT=4/29,Ia=6/29,YT=3*Ia*Ia,s8=Ia*Ia*Ia;function XT(e){if(e instanceof Yi)return new Yi(e.l,e.a,e.b,e.opacity);if(e instanceof Mr)return KT(e);e instanceof cg||(e=uC(e));var t=Tm(e.r),n=Tm(e.g),i=Tm(e.b),r=km((.2225045*t+.7168786*n+.0606169*i)/HT),o,s;return t===n&&n===i?o=s=r:(o=km((.4360747*t+.3850649*n+.1430804*i)/WT),s=km((.0139322*t+.0971045*n+.7141733*i)/GT)),new Yi(116*r-16,500*(o-r),200*(r-s),e.opacity)}function Vd(e,t,n,i){return arguments.length===1?XT(e):new Yi(e,t,n,i??1)}function Yi(e,t,n,i){this.l=+e,this.a=+t,this.b=+n,this.opacity=+i}lb(Yi,Vd,cb(fb,{brighter(e){return new Yi(this.l+Gd*(e??1),this.a,this.b,this.opacity)},darker(e){return new Yi(this.l-Gd*(e??1),this.a,this.b,this.opacity)},rgb(){var e=(this.l+16)/116,t=isNaN(this.a)?e:e+this.a/500,n=isNaN(this.b)?e:e-this.b/200;return t=WT*Cm(t),e=HT*Cm(e),n=GT*Cm(n),new cg(Fm(3.1338561*t-1.6168667*e-.4906146*n),Fm(-.9787684*t+1.9161415*e+.033454*n),Fm(.0719453*t-.2289914*e+1.4052427*n),this.opacity)}}));function km(e){return e>s8?Math.pow(e,1/3):e/YT+VT}function Cm(e){return e>Ia?e*e*e:YT*(e-VT)}function Fm(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function Tm(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function a8(e){if(e instanceof Mr)return new Mr(e.h,e.c,e.l,e.opacity);if(e instanceof Yi||(e=XT(e)),e.a===0&&e.b===0)return new Mr(NaN,0<e.l&&e.l<100?0:NaN,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*qT;return new Mr(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}function Yd(e,t,n,i){return arguments.length===1?a8(e):new Mr(e,t,n,i??1)}function Mr(e,t,n,i){this.h=+e,this.c=+t,this.l=+n,this.opacity=+i}function KT(e){if(isNaN(e.h))return new Yi(e.l,0,0,e.opacity);var t=e.h*jT;return new Yi(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}lb(Mr,Yd,cb(fb,{brighter(e){return new Mr(this.h,this.c,this.l+Gd*(e??1),this.opacity)},darker(e){return new Mr(this.h,this.c,this.l-Gd*(e??1),this.opacity)},rgb(){return KT(this).rgb()}}));var JT=-.14861,Dv=1.78277,Ov=-.29227,Ng=-.90649,cc=1.97294,ES=cc*Ng,SS=cc*Dv,_S=Dv*Ov-Ng*JT;function u8(e){if(e instanceof As)return new As(e.h,e.s,e.l,e.opacity);e instanceof cg||(e=uC(e));var t=e.r/255,n=e.g/255,i=e.b/255,r=(_S*i+ES*t-SS*n)/(_S+ES-SS),o=i-r,s=(cc*(n-r)-Ov*o)/Ng,a=Math.sqrt(s*s+o*o)/(cc*r*(1-r)),u=a?Math.atan2(s,o)*qT-120:NaN;return new As(u<0?u+360:u,a,r,e.opacity)}function p1(e,t,n,i){return arguments.length===1?u8(e):new As(e,t,n,i??1)}function As(e,t,n,i){this.h=+e,this.s=+t,this.l=+n,this.opacity=+i}lb(As,p1,cb(fb,{brighter(e){return e=e==null?PE:Math.pow(PE,e),new As(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?LE:Math.pow(LE,e),new As(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=isNaN(this.h)?0:(this.h+120)*jT,t=+this.l,n=isNaN(this.s)?0:this.s*t*(1-t),i=Math.cos(e),r=Math.sin(e);return new cg(255*(t+n*(JT*i+Dv*r)),255*(t+n*(Ov*i+Ng*r)),255*(t+n*(cc*i)),this.opacity)}}));function l8(e){var t=e.length;return function(n){return e[Math.max(0,Math.min(t-1,Math.floor(n*t)))]}}function c8(e,t){var n=fg(+e,+t);return function(i){var r=n(i);return r-360*Math.floor(r/360)}}function QT(e){return function(t,n){var i=e((t=e1(t)).h,(n=e1(n)).h),r=Bt(t.s,n.s),o=Bt(t.l,n.l),s=Bt(t.opacity,n.opacity);return function(a){return t.h=i(a),t.s=r(a),t.l=o(a),t.opacity=s(a),t+""}}}const f8=QT(fg);var d8=QT(Bt);function h8(e,t){var n=Bt((e=Vd(e)).l,(t=Vd(t)).l),i=Bt(e.a,t.a),r=Bt(e.b,t.b),o=Bt(e.opacity,t.opacity);return function(s){return e.l=n(s),e.a=i(s),e.b=r(s),e.opacity=o(s),e+""}}function ZT(e){return function(t,n){var i=e((t=Yd(t)).h,(n=Yd(n)).h),r=Bt(t.c,n.c),o=Bt(t.l,n.l),s=Bt(t.opacity,n.opacity);return function(a){return t.h=i(a),t.c=r(a),t.l=o(a),t.opacity=s(a),t+""}}}const g8=ZT(fg);var p8=ZT(Bt);function eM(e){return function t(n){n=+n;function i(r,o){var s=e((r=p1(r)).h,(o=p1(o)).h),a=Bt(r.s,o.s),u=Bt(r.l,o.l),l=Bt(r.opacity,o.opacity);return function(c){return r.h=s(c),r.s=a(c),r.l=u(Math.pow(c,n)),r.opacity=l(c),r+""}}return i.gamma=t,i}(1)}const m8=eM(fg);var y8=eM(Bt);function Rv(e,t){t===void 0&&(t=e,e=Oc);for(var n=0,i=t.length-1,r=t[0],o=new Array(i<0?0:i);n<i;)o[n]=e(r,r=t[++n]);return function(s){var a=Math.max(0,Math.min(i-1,Math.floor(s*=i)));return o[a](s-a)}}function b8(e,t){for(var n=new Array(t),i=0;i<t;++i)n[i]=e(i/(t-1));return n}const v8=Object.freeze(Object.defineProperty({__proto__:null,interpolate:Oc,interpolateArray:QP,interpolateBasis:ZP,interpolateBasisClosed:eI,interpolateCubehelix:m8,interpolateCubehelixLong:y8,interpolateDate:tI,interpolateDiscrete:l8,interpolateHcl:g8,interpolateHclLong:p8,interpolateHsl:f8,interpolateHslLong:d8,interpolateHue:c8,interpolateLab:h8,interpolateNumber:nI,interpolateNumberArray:iI,interpolateObject:rI,interpolateRgb:oI,interpolateRgbBasis:sI,interpolateRgbBasisClosed:aI,interpolateRound:ug,interpolateString:uI,interpolateTransformCss:cI,interpolateTransformSvg:fI,interpolateZoom:dI,piecewise:Rv,quantize:b8},Symbol.toStringTag,{value:"Module"}));function tM(e){var t;function n(i){return i==null||isNaN(i=+i)?t:i}return n.invert=n,n.domain=n.range=function(i){return arguments.length?(e=Array.from(i,RE),n):e.slice()},n.unknown=function(i){return arguments.length?(t=i,n):t},n.copy=function(){return tM(e).unknown(t)},e=arguments.length?Array.from(e,RE):[0,1],$u(n)}function nM(e,t){e=e.slice();var n=0,i=e.length-1,r=e[n],o=e[i],s;return o<r&&(s=n,n=i,i=s,s=r,r=o,o=s),e[n]=t.floor(r),e[i]=t.ceil(o),e}function AS(e){return Math.log(e)}function $S(e){return Math.exp(e)}function x8(e){return-Math.log(-e)}function w8(e){return-Math.exp(-e)}function E8(e){return isFinite(e)?+("1e"+e):e<0?0:e}function S8(e){return e===10?E8:e===Math.E?Math.exp:t=>Math.pow(e,t)}function _8(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function kS(e){return(t,n)=>-e(-t,n)}function Nv(e){const t=e(AS,$S),n=t.domain;let i=10,r,o;function s(){return r=_8(i),o=S8(i),n()[0]<0?(r=kS(r),o=kS(o),e(x8,w8)):e(AS,$S),t}return t.base=function(a){return arguments.length?(i=+a,s()):i},t.domain=function(a){return arguments.length?(n(a),s()):n()},t.ticks=a=>{const u=n();let l=u[0],c=u[u.length-1];const f=c<l;f&&([l,c]=[c,l]);let d=r(l),h=r(c),g,p;const m=a==null?10:+a;let y=[];if(!(i%1)&&h-d<m){if(d=Math.floor(d),h=Math.ceil(h),l>0){for(;d<=h;++d)for(g=1;g<i;++g)if(p=d<0?g/o(-d):g*o(d),!(p<l)){if(p>c)break;y.push(p)}}else for(;d<=h;++d)for(g=i-1;g>=1;--g)if(p=d>0?g/o(-d):g*o(d),!(p<l)){if(p>c)break;y.push(p)}y.length*2<m&&(y=NE(l,c,m))}else y=NE(d,h,Math.min(h-d,m)).map(o);return f?y.reverse():y},t.tickFormat=(a,u)=>{if(a==null&&(a=10),u==null&&(u=i===10?"s":","),typeof u!="function"&&(!(i%1)&&(u=Z0(u)).precision==null&&(u.trim=!0),u=aC(u)),a===1/0)return u;const l=Math.max(1,i*a/t.ticks().length);return c=>{let f=c/o(Math.round(r(c)));return f*i<i-.5&&(f*=i),f<=l?u(c):""}},t.nice=()=>n(nM(n(),{floor:a=>o(Math.floor(r(a))),ceil:a=>o(Math.ceil(r(a)))})),t}function iM(){const e=Nv(ub()).domain([1,10]);return e.copy=()=>lg(e,iM()).base(e.base()),jo.apply(e,arguments),e}function CS(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function FS(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function Lv(e){var t=1,n=e(CS(t),FS(t));return n.constant=function(i){return arguments.length?e(CS(t=+i),FS(t)):t},$u(n)}function rM(){var e=Lv(ub());return e.copy=function(){return lg(e,rM()).constant(e.constant())},jo.apply(e,arguments)}function TS(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function A8(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function $8(e){return e<0?-e*e:e*e}function Pv(e){var t=e(ho,ho),n=1;function i(){return n===1?e(ho,ho):n===.5?e(A8,$8):e(TS(n),TS(1/n))}return t.exponent=function(r){return arguments.length?(n=+r,i()):n},$u(t)}function Iv(){var e=Pv(ub());return e.copy=function(){return lg(e,Iv()).exponent(e.exponent())},jo.apply(e,arguments),e}function k8(){return Iv.apply(null,arguments).exponent(.5)}function oM(){var e=[],t=[],n=[],i;function r(){var s=0,a=Math.max(1,t.length);for(n=new Array(a-1);++s<a;)n[s-1]=BC(e,s/a);return o}function o(s){return s==null||isNaN(s=+s)?i:t[Ga(n,s)]}return o.invertExtent=function(s){var a=t.indexOf(s);return a<0?[NaN,NaN]:[a>0?n[a-1]:e[0],a<n.length?n[a]:e[e.length-1]]},o.domain=function(s){if(!arguments.length)return e.slice();e=[];for(let a of s)a!=null&&!isNaN(a=+a)&&e.push(a);return e.sort(rc),r()},o.range=function(s){return arguments.length?(t=Array.from(s),r()):t.slice()},o.unknown=function(s){return arguments.length?(i=s,o):i},o.quantiles=function(){return n.slice()},o.copy=function(){return oM().domain(e).range(t).unknown(i)},jo.apply(o,arguments)}function sM(){var e=0,t=1,n=1,i=[.5],r=[0,1],o;function s(u){return u!=null&&u<=u?r[Ga(i,u,0,n)]:o}function a(){var u=-1;for(i=new Array(n);++u<n;)i[u]=((u+1)*t-(u-n)*e)/(n+1);return s}return s.domain=function(u){return arguments.length?([e,t]=u,e=+e,t=+t,a()):[e,t]},s.range=function(u){return arguments.length?(n=(r=Array.from(u)).length-1,a()):r.slice()},s.invertExtent=function(u){var l=r.indexOf(u);return l<0?[NaN,NaN]:l<1?[e,i[0]]:l>=n?[i[n-1],t]:[i[l-1],i[l]]},s.unknown=function(u){return arguments.length&&(o=u),s},s.thresholds=function(){return i.slice()},s.copy=function(){return sM().domain([e,t]).range(r).unknown(o)},jo.apply($u(s),arguments)}function C8(e){return new Date(e)}function F8(e){return e instanceof Date?+e:+new Date(+e)}function zv(e,t,n,i,r,o,s,a,u,l){var c=HP(),f=c.invert,d=c.domain,h=l(".%L"),g=l(":%S"),p=l("%I:%M"),m=l("%I %p"),y=l("%a %d"),b=l("%b %d"),v=l("%B"),x=l("%Y");function E(S){return(u(S)<S?h:a(S)<S?g:s(S)<S?p:o(S)<S?m:i(S)<S?r(S)<S?y:b:n(S)<S?v:x)(S)}return c.invert=function(S){return new Date(f(S))},c.domain=function(S){return arguments.length?d(Array.from(S,F8)):d().map(C8)},c.ticks=function(S){var w=d();return e(w[0],w[w.length-1],S??10)},c.tickFormat=function(S,w){return w==null?E:l(w)},c.nice=function(S){var w=d();return(!S||typeof S.range!="function")&&(S=t(w[0],w[w.length-1],S??10)),S?d(nM(w,S)):c},c.copy=function(){return lg(c,zv(e,t,n,i,r,o,s,a,u,l))},c}function T8(){return jo.apply(zv(hz,gz,Zi,oc,Mu,Rr,yg,pg,Tr,Fb).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function M8(){return jo.apply(zv(fz,dz,er,sc,Du,_o,bg,mg,Tr,Tb).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function Lg(){var e=0,t=1,n,i,r,o,s=ho,a=!1,u;function l(f){return f==null||isNaN(f=+f)?u:s(r===0?.5:(f=(o(f)-n)*r,a?Math.max(0,Math.min(1,f)):f))}l.domain=function(f){return arguments.length?([e,t]=f,n=o(e=+e),i=o(t=+t),r=n===i?0:1/(i-n),l):[e,t]},l.clamp=function(f){return arguments.length?(a=!!f,l):a},l.interpolator=function(f){return arguments.length?(s=f,l):s};function c(f){return function(d){var h,g;return arguments.length?([h,g]=d,s=f(h,g),l):[s(0),s(1)]}}return l.range=c(Oc),l.rangeRound=c(ug),l.unknown=function(f){return arguments.length?(u=f,l):u},function(f){return o=f,n=f(e),i=f(t),r=n===i?0:1/(i-n),l}}function Ho(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function Bv(){var e=$u(Lg()(ho));return e.copy=function(){return Ho(e,Bv())},qo.apply(e,arguments)}function aM(){var e=Nv(Lg()).domain([1,10]);return e.copy=function(){return Ho(e,aM()).base(e.base())},qo.apply(e,arguments)}function uM(){var e=Lv(Lg());return e.copy=function(){return Ho(e,uM()).constant(e.constant())},qo.apply(e,arguments)}function Uv(){var e=Pv(Lg());return e.copy=function(){return Ho(e,Uv()).exponent(e.exponent())},qo.apply(e,arguments)}function D8(){return Uv.apply(null,arguments).exponent(.5)}function Pg(){var e=0,t=.5,n=1,i=1,r,o,s,a,u,l=ho,c,f=!1,d;function h(p){return isNaN(p=+p)?d:(p=.5+((p=+c(p))-o)*(i*p<i*o?a:u),l(f?Math.max(0,Math.min(1,p)):p))}h.domain=function(p){return arguments.length?([e,t,n]=p,r=c(e=+e),o=c(t=+t),s=c(n=+n),a=r===o?0:.5/(o-r),u=o===s?0:.5/(s-o),i=o<r?-1:1,h):[e,t,n]},h.clamp=function(p){return arguments.length?(f=!!p,h):f},h.interpolator=function(p){return arguments.length?(l=p,h):l};function g(p){return function(m){var y,b,v;return arguments.length?([y,b,v]=m,l=Rv(p,[y,b,v]),h):[l(0),l(.5),l(1)]}}return h.range=g(Oc),h.rangeRound=g(ug),h.unknown=function(p){return arguments.length?(d=p,h):d},function(p){return c=p,r=p(e),o=p(t),s=p(n),a=r===o?0:.5/(o-r),u=o===s?0:.5/(s-o),i=o<r?-1:1,h}}function lM(){var e=$u(Pg()(ho));return e.copy=function(){return Ho(e,lM())},qo.apply(e,arguments)}function cM(){var e=Nv(Pg()).domain([.1,1,10]);return e.copy=function(){return Ho(e,cM()).base(e.base())},qo.apply(e,arguments)}function fM(){var e=Lv(Pg());return e.copy=function(){return Ho(e,fM()).constant(e.constant())},qo.apply(e,arguments)}function jv(){var e=Pv(Pg());return e.copy=function(){return Ho(e,jv()).exponent(e.exponent())},qo.apply(e,arguments)}function O8(){return jv.apply(null,arguments).exponent(.5)}function ur(e){for(var t=e.length/6|0,n=new Array(t),i=0;i<t;)n[i]="#"+e.slice(i*6,++i*6);return n}const R8=ur("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf"),N8=ur("7fc97fbeaed4fdc086ffff99386cb0f0027fbf5b17666666"),L8=ur("1b9e77d95f027570b3e7298a66a61ee6ab02a6761d666666"),P8=ur("4269d0efb118ff725c6cc5b03ca951ff8ab7a463f297bbf59c6b4e9498a0"),I8=ur("a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928"),z8=ur("fbb4aeb3cde3ccebc5decbe4fed9a6ffffcce5d8bdfddaecf2f2f2"),B8=ur("b3e2cdfdcdaccbd5e8f4cae4e6f5c9fff2aef1e2cccccccc"),U8=ur("e41a1c377eb84daf4a984ea3ff7f00ffff33a65628f781bf999999"),j8=ur("66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3"),q8=ur("8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f");function qv(e,t,n){const i=e-t+n*2;return e?i>0?i:1:0}const W8="identity",Za="linear",jr="log",zc="pow",Bc="sqrt",Ig="symlog",Rs="time",Ns="utc",Xi="sequential",Lu="diverging",eu="quantile",zg="quantize",Bg="threshold",Wv="ordinal",m1="point",dM="band",Hv="bin-ordinal",ct="continuous",Uc="discrete",jc="discretizing",ri="interpolating",Gv="temporal";function H8(e){return function(t){let n=t[0],i=t[1],r;return i<n&&(r=n,n=i,i=r),[e.invert(n),e.invert(i)]}}function G8(e){return function(t){const n=e.range();let i=t[0],r=t[1],o=-1,s,a,u,l;for(r<i&&(a=i,i=r,r=a),u=0,l=n.length;u<l;++u)n[u]>=i&&n[u]<=r&&(o<0&&(o=u),s=u);if(!(o<0))return i=e.invertExtent(n[o]),r=e.invertExtent(n[s]),[i[0]===void 0?i[1]:i[0],r[1]===void 0?r[0]:r[1]]}}function Vv(){const e=Mv().unknown(void 0),t=e.domain,n=e.range;let i=[0,1],r,o,s=!1,a=0,u=0,l=.5;delete e.unknown;function c(){const f=t().length,d=i[1]<i[0],h=i[1-d],g=qv(f,a,u);let p=i[d-0];r=(h-p)/(g||1),s&&(r=Math.floor(r)),p+=(h-p-r*(f-a))*l,o=r*(1-a),s&&(p=Math.round(p),o=Math.round(o));const m=Mn(f).map(y=>p+r*y);return n(d?m.reverse():m)}return e.domain=function(f){return arguments.length?(t(f),c()):t()},e.range=function(f){return arguments.length?(i=[+f[0],+f[1]],c()):i.slice()},e.rangeRound=function(f){return i=[+f[0],+f[1]],s=!0,c()},e.bandwidth=function(){return o},e.step=function(){return r},e.round=function(f){return arguments.length?(s=!!f,c()):s},e.padding=function(f){return arguments.length?(u=Math.max(0,Math.min(1,f)),a=u,c()):a},e.paddingInner=function(f){return arguments.length?(a=Math.max(0,Math.min(1,f)),c()):a},e.paddingOuter=function(f){return arguments.length?(u=Math.max(0,Math.min(1,f)),c()):u},e.align=function(f){return arguments.length?(l=Math.max(0,Math.min(1,f)),c()):l},e.invertRange=function(f){if(f[0]==null||f[1]==null)return;const d=i[1]<i[0],h=d?n().reverse():n(),g=h.length-1;let p=+f[0],m=+f[1],y,b,v;if(!(p!==p||m!==m)&&(m<p&&(v=p,p=m,m=v),!(m<h[0]||p>i[1-d])))return y=Math.max(0,Ga(h,p)-1),b=p===m?y:Ga(h,m)-1,p-h[y]>o+1e-10&&++y,d&&(v=y,y=g-b,b=g-v),y>b?void 0:t().slice(y,b+1)},e.invert=function(f){const d=e.invertRange([f,f]);return d&&d[0]},e.copy=function(){return Vv().domain(t()).range(i).round(s).paddingInner(a).paddingOuter(u).align(l)},c()}function hM(e){const t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,e.copy=function(){return hM(t())},e}function V8(){return hM(Vv().paddingInner(1))}var Y8=Array.prototype.map;function X8(e){return Y8.call(e,Ut)}const K8=Array.prototype.slice;function gM(){let e=[],t=[];function n(i){return i==null||i!==i?void 0:t[(Ga(e,i)-1)%t.length]}return n.domain=function(i){return arguments.length?(e=X8(i),n):e.slice()},n.range=function(i){return arguments.length?(t=K8.call(i),n):t.slice()},n.tickFormat=function(i,r){return YP(e[0],Ee(e),i??10,r)},n.copy=function(){return gM().domain(n.domain()).range(n.range())},n}const Xd=new Map,pM=Symbol("vega_scale");function mM(e){return e[pM]=!0,e}function J8(e){return e&&e[pM]===!0}function Q8(e,t,n){const i=function(){const o=t();return o.invertRange||(o.invertRange=o.invert?H8(o):o.invertExtent?G8(o):void 0),o.type=e,mM(o)};return i.metadata=xi(X(n)),i}function ke(e,t,n){return arguments.length>1?(Xd.set(e,Q8(e,t,n)),this):yM(e)?Xd.get(e):void 0}ke(W8,tM);ke(Za,GP,ct);ke(jr,iM,[ct,jr]);ke(zc,Iv,ct);ke(Bc,k8,ct);ke(Ig,rM,ct);ke(Rs,T8,[ct,Gv]);ke(Ns,M8,[ct,Gv]);ke(Xi,Bv,[ct,ri]);ke(`${Xi}-${Za}`,Bv,[ct,ri]);ke(`${Xi}-${jr}`,aM,[ct,ri,jr]);ke(`${Xi}-${zc}`,Uv,[ct,ri]);ke(`${Xi}-${Bc}`,D8,[ct,ri]);ke(`${Xi}-${Ig}`,uM,[ct,ri]);ke(`${Lu}-${Za}`,lM,[ct,ri]);ke(`${Lu}-${jr}`,cM,[ct,ri,jr]);ke(`${Lu}-${zc}`,jv,[ct,ri]);ke(`${Lu}-${Bc}`,O8,[ct,ri]);ke(`${Lu}-${Ig}`,fM,[ct,ri]);ke(eu,oM,[jc,eu]);ke(zg,sM,jc);ke(Bg,VP,jc);ke(Hv,gM,[Uc,jc]);ke(Wv,Mv,Uc);ke(dM,Vv,Uc);ke(m1,V8,Uc);function yM(e){return Xd.has(e)}function na(e,t){const n=Xd.get(e);return n&&n.metadata[t]}function Yv(e){return na(e,ct)}function tu(e){return na(e,Uc)}function y1(e){return na(e,jc)}function bM(e){return na(e,jr)}function Z8(e){return na(e,Gv)}function vM(e){return na(e,ri)}function xM(e){return na(e,eu)}const e7=["clamp","base","constant","exponent"];function wM(e,t){const n=t[0],i=Ee(t)-n;return function(r){return e(n+r*i)}}function Ug(e,t,n){return Rv(Xv(t||"rgb",n),e)}function EM(e,t){const n=new Array(t),i=t+1;for(let r=0;r<t;)n[r]=e(++r/i);return n}function SM(e,t,n){const i=n-t;let r,o,s;return!i||!Number.isFinite(i)?Yt(.5):(r=(o=e.type).indexOf("-"),o=r<0?o:o.slice(r+1),s=ke(o)().domain([t,n]).range([0,1]),e7.forEach(a=>e[a]?s[a](e[a]()):0),s)}function Xv(e,t){const n=v8[t7(e)];return t!=null&&n&&n.gamma?n.gamma(t):n}function t7(e){return"interpolate"+e.toLowerCase().split("-").map(t=>t[0].toUpperCase()+t.slice(1)).join("")}const n7={blues:"cfe1f2bed8eca8cee58fc1de74b2d75ba3cf4592c63181bd206fb2125ca40a4a90",greens:"d3eecdc0e6baabdda594d3917bc77d60ba6c46ab5e329a512089430e7735036429",greys:"e2e2e2d4d4d4c4c4c4b1b1b19d9d9d8888887575756262624d4d4d3535351e1e1e",oranges:"fdd8b3fdc998fdb87bfda55efc9244f87f2cf06b18e4580bd14904b93d029f3303",purples:"e2e1efd4d4e8c4c5e0b4b3d6a3a0cc928ec3827cb97566ae684ea25c3696501f8c",reds:"fdc9b4fcb49afc9e80fc8767fa7051f6573fec3f2fdc2a25c81b1db21218970b13",blueGreen:"d5efedc1e8e0a7ddd18bd2be70c6a958ba9144ad77319c5d2089460e7736036429",bluePurple:"ccddecbad0e4a8c2dd9ab0d4919cc98d85be8b6db28a55a6873c99822287730f71",greenBlue:"d3eecec5e8c3b1e1bb9bd8bb82cec269c2ca51b2cd3c9fc7288abd1675b10b60a1",orangeRed:"fddcaffdcf9bfdc18afdad77fb9562f67d53ee6545e24932d32d1ebf130da70403",purpleBlue:"dbdaebc8cee4b1c3de97b7d87bacd15b9fc93a90c01e7fb70b70ab056199045281",purpleBlueGreen:"dbd8eac8cee4b0c3de93b7d872acd1549fc83892bb1c88a3097f8702736b016353",purpleRed:"dcc9e2d3b3d7ce9eccd186c0da6bb2e14da0e23189d91e6fc61159ab07498f023a",redPurple:"fccfccfcbec0faa9b8f98faff571a5ec539ddb3695c41b8aa908808d0179700174",yellowGreen:"e4f4acd1eca0b9e2949ed68880c97c62bb6e47aa5e3297502083440e723b036034",yellowOrangeBrown:"feeaa1fedd84fecc63feb746fca031f68921eb7215db5e0bc54c05ab3d038f3204",yellowOrangeRed:"fee087fed16ffebd59fea849fd903efc7335f9522bee3423de1b20ca0b22af0225",blueOrange:"134b852f78b35da2cb9dcae1d2e5eff2f0ebfce0bafbbf74e8932fc5690d994a07",brownBlueGreen:"704108a0651ac79548e3c78af3e6c6eef1eac9e9e48ed1c74da79e187a72025147",purpleGreen:"5b1667834792a67fb6c9aed3e6d6e8eff0efd9efd5aedda971bb75368e490e5e29",purpleOrange:"4114696647968f83b7b9b4d6dadbebf3eeeafce0bafbbf74e8932fc5690d994a07",redBlue:"8c0d25bf363adf745ef4ae91fbdbc9f2efeed2e5ef9dcae15da2cb2f78b3134b85",redGrey:"8c0d25bf363adf745ef4ae91fcdccbfaf4f1e2e2e2c0c0c0969696646464343434",yellowGreenBlue:"eff9bddbf1b4bde5b594d5b969c5be45b4c22c9ec02182b82163aa23479c1c3185",redYellowBlue:"a50026d4322cf16e43fcac64fedd90faf8c1dcf1ecabd6e875abd04a74b4313695",redYellowGreen:"a50026d4322cf16e43fcac63fedd8df9f7aed7ee8ea4d86e64bc6122964f006837",pinkYellowGreen:"8e0152c0267edd72adf0b3d6faddedf5f3efe1f2cab6de8780bb474f9125276419",spectral:"9e0142d13c4bf0704afcac63fedd8dfbf8b0e0f3a1a9dda269bda94288b55e4fa2",viridis:"440154470e61481a6c482575472f7d443a834144873d4e8a39568c35608d31688e2d708e2a788e27818e23888e21918d1f988b1fa08822a8842ab07f35b77943bf7154c56866cc5d7ad1518fd744a5db36bcdf27d2e21be9e51afde725",magma:"0000040404130b0924150e3720114b2c11603b0f704a107957157e651a80721f817f24828c29819a2e80a8327db6377ac43c75d1426fde4968e95462f1605df76f5cfa7f5efc8f65fe9f6dfeaf78febf84fece91fddea0fcedaffcfdbf",inferno:"0000040403130c0826170c3b240c4f330a5f420a68500d6c5d126e6b176e781c6d86216b932667a12b62ae305cbb3755c73e4cd24644dd513ae65c30ed6925f3771af8850ffb9506fca50afcb519fac62df6d645f2e661f3f484fcffa4",plasma:"0d088723069033059742039d5002a25d01a66a00a87801a88405a7900da49c179ea72198b12a90ba3488c33d80cb4779d35171da5a69e16462e76e5bed7953f2834cf68f44fa9a3dfca636fdb32ffec029fcce25f9dc24f5ea27f0f921",cividis:"00205100235800265d002961012b65042e670831690d346b11366c16396d1c3c6e213f6e26426e2c456e31476e374a6e3c4d6e42506e47536d4c566d51586e555b6e5a5e6e5e616e62646f66676f6a6a706e6d717270717573727976737c79747f7c75827f758682768985778c8877908b78938e789691789a94789e9778a19b78a59e77a9a177aea575b2a874b6ab73bbaf71c0b26fc5b66dc9b96acebd68d3c065d8c462ddc85fe2cb5ce7cf58ebd355f0d652f3da4ff7de4cfae249fce647",rainbow:"6e40aa883eb1a43db3bf3cafd83fa4ee4395fe4b83ff576eff6659ff7847ff8c38f3a130e2b72fcfcc36bee044aff05b8ff4576ff65b52f6673af27828ea8d1ddfa319d0b81cbecb23abd82f96e03d82e14c6edb5a5dd0664dbf6e40aa",sinebow:"ff4040fc582af47218e78d0bd5a703bfbf00a7d5038de70b72f41858fc2a40ff402afc5818f4720be78d03d5a700bfbf03a7d50b8de71872f42a58fc4040ff582afc7218f48d0be7a703d5bf00bfd503a7e70b8df41872fc2a58ff4040",turbo:"23171b32204a3e2a71453493493eae4b49c54a53d7485ee44569ee4074f53c7ff8378af93295f72e9ff42ba9ef28b3e926bce125c5d925cdcf27d5c629dcbc2de3b232e9a738ee9d3ff39347f68950f9805afc7765fd6e70fe667cfd5e88fc5795fb51a1f84badf545b9f140c5ec3cd0e637dae034e4d931ecd12ef4c92bfac029ffb626ffad24ffa223ff9821ff8d1fff821dff771cfd6c1af76118f05616e84b14df4111d5380fcb2f0dc0260ab61f07ac1805a313029b0f00950c00910b00",browns:"eedbbdecca96e9b97ae4a865dc9856d18954c7784cc0673fb85536ad44339f3632",tealBlues:"bce4d89dd3d181c3cb65b3c245a2b9368fae347da0306a932c5985",teals:"bbdfdfa2d4d58ac9c975bcbb61b0af4da5a43799982b8b8c1e7f7f127273006667",warmGreys:"dcd4d0cec5c1c0b8b4b3aaa7a59c9998908c8b827f7e7673726866665c5a59504e",goldGreen:"f4d166d5ca60b6c35c98bb597cb25760a6564b9c533f8f4f33834a257740146c36",goldOrange:"f4d166f8be5cf8aa4cf5983bf3852aef701be2621fd65322c54923b142239e3a26",goldRed:"f4d166f6be59f9aa51fc964ef6834bee734ae56249db5247cf4244c43141b71d3e",lightGreyRed:"efe9e6e1dad7d5cbc8c8bdb9bbaea9cd967ddc7b43e15f19df4011dc000b",lightGreyTeal:"e4eaead6dcddc8ced2b7c2c7a6b4bc64b0bf22a6c32295c11f85be1876bc",lightMulti:"e0f1f2c4e9d0b0de9fd0e181f6e072f6c053f3993ef77440ef4a3c",lightOrange:"f2e7daf7d5baf9c499fab184fa9c73f68967ef7860e8645bde515bd43d5b",lightTealBlue:"e3e9e0c0dccf9aceca7abfc859afc0389fb9328dad2f7ca0276b95255988",darkBlue:"3232322d46681a5c930074af008cbf05a7ce25c0dd38daed50f3faffffff",darkGold:"3c3c3c584b37725e348c7631ae8b2bcfa424ecc31ef9de30fff184ffffff",darkGreen:"3a3a3a215748006f4d048942489e4276b340a6c63dd2d836ffeb2cffffaa",darkMulti:"3737371f5287197d8c29a86995ce3fffe800ffffff",darkRed:"3434347036339e3c38cc4037e75d1eec8620eeab29f0ce32ffeb2c"},i7={accent:N8,category10:R8,category20:"1f77b4aec7e8ff7f0effbb782ca02c98df8ad62728ff98969467bdc5b0d58c564bc49c94e377c2f7b6d27f7f7fc7c7c7bcbd22dbdb8d17becf9edae5",category20b:"393b795254a36b6ecf9c9ede6379398ca252b5cf6bcedb9c8c6d31bd9e39e7ba52e7cb94843c39ad494ad6616be7969c7b4173a55194ce6dbdde9ed6",category20c:"3182bd6baed69ecae1c6dbefe6550dfd8d3cfdae6bfdd0a231a35474c476a1d99bc7e9c0756bb19e9ac8bcbddcdadaeb636363969696bdbdbdd9d9d9",dark2:L8,observable10:P8,paired:I8,pastel1:z8,pastel2:B8,set1:U8,set2:j8,set3:q8,tableau10:"4c78a8f58518e4575672b7b254a24beeca3bb279a2ff9da69d755dbab0ac",tableau20:"4c78a89ecae9f58518ffbf7954a24b88d27ab79a20f2cf5b43989483bcb6e45756ff9d9879706ebab0acd67195fcbfd2b279a2d6a5c99e765fd8b5a5"};function _M(e){if(P(e))return e;const t=e.length/6|0,n=new Array(t);for(let i=0;i<t;)n[i]="#"+e.slice(i*6,++i*6);return n}function AM(e,t){for(const n in e)Kv(n,t(e[n]))}const MS={};AM(i7,_M);AM(n7,e=>Ug(_M(e)));function Kv(e,t){return e=e&&e.toLowerCase(),arguments.length>1?(MS[e]=t,this):MS[e]}const dd="symbol",r7="discrete",o7="gradient",s7=e=>P(e)?e.map(t=>String(t)):String(e),a7=(e,t)=>e[1]-t[1],u7=(e,t)=>t[1]-e[1];function Jv(e,t,n){let i;return Ae(t)&&(e.bins&&(t=Math.max(t,e.bins.length)),n!=null&&(t=Math.min(t,Math.floor(Nc(e.domain())/n||1)+1))),Y(t)&&(i=t.step,t=t.interval),K(t)&&(t=e.type===Rs?Ou(t):e.type==Ns?Ru(t):N("Only time and utc scales accept interval strings."),i&&(t=t.every(i))),t}function $M(e,t,n){let i=e.range(),r=i[0],o=Ee(i),s=a7;if(r>o&&(i=o,o=r,r=i,s=u7),r=Math.floor(r),o=Math.ceil(o),t=t.map(a=>[a,e(a)]).filter(a=>r<=a[1]&&a[1]<=o).sort(s).map(a=>a[0]),n>0&&t.length>1){const a=[t[0],Ee(t)];for(;t.length>n&&t.length>=3;)t=t.filter((u,l)=>!(l%2));t.length<3&&(t=a)}return t}function Qv(e,t){return e.bins?$M(e,e.bins,t):e.ticks?e.ticks(t):e.domain()}function kM(e,t,n,i,r,o){const s=t.type;let a=s7;if(s===Rs||r===Rs)a=e.timeFormat(i);else if(s===Ns||r===Ns)a=e.utcFormat(i);else if(bM(s)){const u=e.formatFloat(i);if(o||t.bins)a=u;else{const l=CM(t,n,!1);a=c=>l(c)?u(c):""}}else if(t.tickFormat){const u=t.domain();a=e.formatSpan(u[0],u[u.length-1],n,i)}else i&&(a=e.format(i));return a}function CM(e,t,n){const i=Qv(e,t),r=e.base(),o=Math.log(r),s=Math.max(1,r*t/i.length),a=u=>{let l=u/Math.pow(r,Math.round(Math.log(u)/o));return l*r<r-.5&&(l*=r),l<=s};return n?i.filter(a):a}const b1={[eu]:"quantiles",[zg]:"thresholds",[Bg]:"domain"},FM={[eu]:"quantiles",[zg]:"domain"};function TM(e,t){return e.bins?f7(e.bins):e.type===jr?CM(e,t,!0):b1[e.type]?c7(e[b1[e.type]]()):Qv(e,t)}function l7(e,t,n){const i=t[FM[t.type]](),r=i.length;let o=r>1?i[1]-i[0]:i[0],s;for(s=1;s<r;++s)o=Math.min(o,i[s]-i[s-1]);return e.formatSpan(0,o,3*10,n)}function c7(e){const t=[-1/0].concat(e);return t.max=1/0,t}function f7(e){const t=e.slice(0,-1);return t.max=Ee(e),t}const d7=e=>b1[e.type]||e.bins;function MM(e,t,n,i,r,o,s){const a=FM[t.type]&&o!==Rs&&o!==Ns?l7(e,t,r):kM(e,t,n,r,o,s);return i===dd&&d7(t)?h7(a):i===r7?g7(a):p7(a)}const h7=e=>(t,n,i)=>{const r=DS(i[n+1],DS(i.max,1/0)),o=OS(t,e),s=OS(r,e);return o&&s?o+" – "+s:s?"< "+s:"≥ "+o},DS=(e,t)=>e??t,g7=e=>(t,n)=>n?e(t):null,p7=e=>t=>e(t),OS=(e,t)=>Number.isFinite(e)?t(e):null;function m7(e){const t=e.domain(),n=t.length-1;let i=+t[0],r=+Ee(t),o=r-i;if(e.type===Bg){const s=n?o/n:.1;i-=s,r+=s,o=r-i}return s=>(s-i)/o}function y7(e,t,n,i){const r=i||t.type;return K(n)&&Z8(r)&&(n=n.replace(/%a/g,"%A").replace(/%b/g,"%B")),!n&&r===Rs?e.timeFormat("%A, %d %B %Y, %X"):!n&&r===Ns?e.utcFormat("%A, %d %B %Y, %X UTC"):MM(e,t,5,null,n,i,!0)}function DM(e,t,n){n=n||{};const i=Math.max(3,n.maxlen||7),r=y7(e,t,n.format,n.formatType);if(y1(t.type)){const o=TM(t).slice(1).map(r),s=o.length;return`${s} boundar${s===1?"y":"ies"}: ${o.join(", ")}`}else if(tu(t.type)){const o=t.domain(),s=o.length,a=s>i?o.slice(0,i-2).map(r).join(", ")+", ending with "+o.slice(-1).map(r):o.map(r).join(", ");return`${s} value${s===1?"":"s"}: ${a}`}else{const o=t.domain();return`values from ${r(o[0])} to ${r(Ee(o))}`}}let OM=0;function b7(){OM=0}const Kd="p_";function Zv(e){return e&&e.gradient}function RM(e,t,n){const i=e.gradient;let r=e.id,o=i==="radial"?Kd:"";return r||(r=e.id="gradient_"+OM++,i==="radial"?(e.x1=Pi(e.x1,.5),e.y1=Pi(e.y1,.5),e.r1=Pi(e.r1,0),e.x2=Pi(e.x2,.5),e.y2=Pi(e.y2,.5),e.r2=Pi(e.r2,.5),o=Kd):(e.x1=Pi(e.x1,0),e.y1=Pi(e.y1,0),e.x2=Pi(e.x2,1),e.y2=Pi(e.y2,0))),t[r]=e,"url("+(n||"")+"#"+o+r+")"}function Pi(e,t){return e??t}function NM(e,t){var n=[],i;return i={gradient:"linear",x1:e?e[0]:0,y1:e?e[1]:0,x2:t?t[0]:1,y2:t?t[1]:0,stops:n,stop:function(r,o){return n.push({offset:r,color:o}),i}}}const RS={basis:{curve:j9},"basis-closed":{curve:q9},"basis-open":{curve:W9},bundle:{curve:H9,tension:"beta",value:.85},cardinal:{curve:G9,tension:"tension",value:0},"cardinal-open":{curve:Y9,tension:"tension",value:0},"cardinal-closed":{curve:V9,tension:"tension",value:0},"catmull-rom":{curve:X9,tension:"alpha",value:.5},"catmull-rom-closed":{curve:K9,tension:"alpha",value:.5},"catmull-rom-open":{curve:J9,tension:"alpha",value:.5},linear:{curve:$v},"linear-closed":{curve:Q9},monotone:{horizontal:e8,vertical:Z9},natural:{curve:t8},step:{curve:n8},"step-after":{curve:r8},"step-before":{curve:i8}};function ex(e,t,n){var i=J(RS,e)&&RS[e],r=null;return i&&(r=i.curve||i[t||"vertical"],i.tension&&n!=null&&(r=r[i.tension](n))),r}const v7={m:2,l:2,h:1,v:1,z:0,c:6,s:4,q:4,t:2,a:7},x7=/[mlhvzcsqta]([^mlhvzcsqta]+|$)/gi,w7=/^[+-]?(([0-9]*\.[0-9]+)|([0-9]+\.)|([0-9]+))([eE][+-]?[0-9]+)?/,E7=/^((\s+,?\s*)|(,\s*))/,S7=/^[01]/;function nu(e){const t=[];return(e.match(x7)||[]).forEach(i=>{let r=i[0];const o=r.toLowerCase(),s=v7[o],a=_7(o,s,i.slice(1).trim()),u=a.length;if(u<s||u&&u%s!==0)throw Error("Invalid SVG path, incorrect parameter count");if(t.push([r,...a.slice(0,s)]),u!==s){o==="m"&&(r=r==="M"?"L":"l");for(let l=s;l<u;l+=s)t.push([r,...a.slice(l,l+s)])}}),t}function _7(e,t,n){const i=[];for(let r=0;t&&r<n.length;)for(let o=0;o<t;++o){const s=e==="a"&&(o===3||o===4)?S7:w7,a=n.slice(r).match(s);if(a===null)throw Error("Invalid SVG path, incorrect parameter type");r+=a[0].length,i.push(+a[0]);const u=n.slice(r).match(E7);u!==null&&(r+=u[0].length)}return i}const Mo=Math.PI/180,A7=1e-14,ys=Math.PI/2,qi=Math.PI*2,ba=Math.sqrt(3)/2;var Mm={},Dm={},LM=[].join;function $7(e,t,n,i,r,o,s,a,u){const l=LM.call(arguments);if(Mm[l])return Mm[l];const c=s*Mo,f=Math.sin(c),d=Math.cos(c);n=Math.abs(n),i=Math.abs(i);const h=d*(a-e)*.5+f*(u-t)*.5,g=d*(u-t)*.5-f*(a-e)*.5;let p=h*h/(n*n)+g*g/(i*i);p>1&&(p=Math.sqrt(p),n*=p,i*=p);const m=d/n,y=f/n,b=-f/i,v=d/i,x=m*a+y*u,E=b*a+v*u,S=m*e+y*t,w=b*e+v*t;let A=1/((S-x)*(S-x)+(w-E)*(w-E))-.25;A<0&&(A=0);let k=Math.sqrt(A);o==r&&(k=-k);const C=.5*(x+S)-k*(w-E),O=.5*(E+w)+k*(S-x),M=Math.atan2(E-O,x-C);let $=Math.atan2(w-O,S-C)-M;$<0&&o===1?$+=qi:$>0&&o===0&&($-=qi);const T=Math.ceil(Math.abs($/(ys+.001))),L=[];for(let z=0;z<T;++z){const I=M+z*$/T,Q=M+(z+1)*$/T;L[z]=[C,O,I,Q,n,i,f,d]}return Mm[l]=L}function k7(e){const t=LM.call(e);if(Dm[t])return Dm[t];var n=e[0],i=e[1],r=e[2],o=e[3],s=e[4],a=e[5],u=e[6],l=e[7];const c=l*s,f=-u*a,d=u*s,h=l*a,g=Math.cos(r),p=Math.sin(r),m=Math.cos(o),y=Math.sin(o),b=.5*(o-r),v=Math.sin(b*.5),x=8/3*v*v/Math.sin(b),E=n+g-x*p,S=i+p+x*g,w=n+m,_=i+y,A=w+x*y,k=_-x*m;return Dm[t]=[c*E+f*S,d*E+h*S,c*A+f*k,d*A+h*k,c*w+f*_,d*w+h*_]}const jn=["l",0,0,0,0,0,0,0];function C7(e,t,n){const i=jn[0]=e[0];if(i==="a"||i==="A")jn[1]=t*e[1],jn[2]=n*e[2],jn[3]=e[3],jn[4]=e[4],jn[5]=e[5],jn[6]=t*e[6],jn[7]=n*e[7];else if(i==="h"||i==="H")jn[1]=t*e[1];else if(i==="v"||i==="V")jn[1]=n*e[1];else for(var r=1,o=e.length;r<o;++r)jn[r]=(r%2==1?t:n)*e[r];return jn}function fc(e,t,n,i,r,o){var s,a=null,u=0,l=0,c=0,f=0,d,h,g,p,m=0,y=0;n==null&&(n=0),i==null&&(i=0),r==null&&(r=1),o==null&&(o=r),e.beginPath&&e.beginPath();for(var b=0,v=t.length;b<v;++b){switch(s=t[b],(r!==1||o!==1)&&(s=C7(s,r,o)),s[0]){case"l":u+=s[1],l+=s[2],e.lineTo(u+n,l+i);break;case"L":u=s[1],l=s[2],e.lineTo(u+n,l+i);break;case"h":u+=s[1],e.lineTo(u+n,l+i);break;case"H":u=s[1],e.lineTo(u+n,l+i);break;case"v":l+=s[1],e.lineTo(u+n,l+i);break;case"V":l=s[1],e.lineTo(u+n,l+i);break;case"m":u+=s[1],l+=s[2],m=u,y=l,e.moveTo(u+n,l+i);break;case"M":u=s[1],l=s[2],m=u,y=l,e.moveTo(u+n,l+i);break;case"c":d=u+s[5],h=l+s[6],c=u+s[3],f=l+s[4],e.bezierCurveTo(u+s[1]+n,l+s[2]+i,c+n,f+i,d+n,h+i),u=d,l=h;break;case"C":u=s[5],l=s[6],c=s[3],f=s[4],e.bezierCurveTo(s[1]+n,s[2]+i,c+n,f+i,u+n,l+i);break;case"s":d=u+s[3],h=l+s[4],c=2*u-c,f=2*l-f,e.bezierCurveTo(c+n,f+i,u+s[1]+n,l+s[2]+i,d+n,h+i),c=u+s[1],f=l+s[2],u=d,l=h;break;case"S":d=s[3],h=s[4],c=2*u-c,f=2*l-f,e.bezierCurveTo(c+n,f+i,s[1]+n,s[2]+i,d+n,h+i),u=d,l=h,c=s[1],f=s[2];break;case"q":d=u+s[3],h=l+s[4],c=u+s[1],f=l+s[2],e.quadraticCurveTo(c+n,f+i,d+n,h+i),u=d,l=h;break;case"Q":d=s[3],h=s[4],e.quadraticCurveTo(s[1]+n,s[2]+i,d+n,h+i),u=d,l=h,c=s[1],f=s[2];break;case"t":d=u+s[1],h=l+s[2],a[0].match(/[QqTt]/)===null?(c=u,f=l):a[0]==="t"?(c=2*u-g,f=2*l-p):a[0]==="q"&&(c=2*u-c,f=2*l-f),g=c,p=f,e.quadraticCurveTo(c+n,f+i,d+n,h+i),u=d,l=h,c=u+s[1],f=l+s[2];break;case"T":d=s[1],h=s[2],c=2*u-c,f=2*l-f,e.quadraticCurveTo(c+n,f+i,d+n,h+i),u=d,l=h;break;case"a":NS(e,u+n,l+i,[s[1],s[2],s[3],s[4],s[5],s[6]+u+n,s[7]+l+i]),u+=s[6],l+=s[7];break;case"A":NS(e,u+n,l+i,[s[1],s[2],s[3],s[4],s[5],s[6]+n,s[7]+i]),u=s[6],l=s[7];break;case"z":case"Z":u=m,l=y,e.closePath();break}a=s}}function NS(e,t,n,i){const r=$7(i[5],i[6],i[0],i[1],i[3],i[4],i[2],t,n);for(let o=0;o<r.length;++o){const s=k7(r[o]);e.bezierCurveTo(s[0],s[1],s[2],s[3],s[4],s[5])}}const LS=.5773502691896257,PS={circle:{draw:function(e,t){const n=Math.sqrt(t)/2;e.moveTo(n,0),e.arc(0,0,n,0,qi)}},cross:{draw:function(e,t){var n=Math.sqrt(t)/2,i=n/2.5;e.moveTo(-n,-i),e.lineTo(-n,i),e.lineTo(-i,i),e.lineTo(-i,n),e.lineTo(i,n),e.lineTo(i,i),e.lineTo(n,i),e.lineTo(n,-i),e.lineTo(i,-i),e.lineTo(i,-n),e.lineTo(-i,-n),e.lineTo(-i,-i),e.closePath()}},diamond:{draw:function(e,t){const n=Math.sqrt(t)/2;e.moveTo(-n,0),e.lineTo(0,-n),e.lineTo(n,0),e.lineTo(0,n),e.closePath()}},square:{draw:function(e,t){var n=Math.sqrt(t),i=-n/2;e.rect(i,i,n,n)}},arrow:{draw:function(e,t){var n=Math.sqrt(t)/2,i=n/7,r=n/2.5,o=n/8;e.moveTo(-i,n),e.lineTo(i,n),e.lineTo(i,-o),e.lineTo(r,-o),e.lineTo(0,-n),e.lineTo(-r,-o),e.lineTo(-i,-o),e.closePath()}},wedge:{draw:function(e,t){var n=Math.sqrt(t)/2,i=ba*n,r=i-n*LS,o=n/4;e.moveTo(0,-i-r),e.lineTo(-o,i-r),e.lineTo(o,i-r),e.closePath()}},triangle:{draw:function(e,t){var n=Math.sqrt(t)/2,i=ba*n,r=i-n*LS;e.moveTo(0,-i-r),e.lineTo(-n,i-r),e.lineTo(n,i-r),e.closePath()}},"triangle-up":{draw:function(e,t){var n=Math.sqrt(t)/2,i=ba*n;e.moveTo(0,-i),e.lineTo(-n,i),e.lineTo(n,i),e.closePath()}},"triangle-down":{draw:function(e,t){var n=Math.sqrt(t)/2,i=ba*n;e.moveTo(0,i),e.lineTo(-n,-i),e.lineTo(n,-i),e.closePath()}},"triangle-right":{draw:function(e,t){var n=Math.sqrt(t)/2,i=ba*n;e.moveTo(i,0),e.lineTo(-i,-n),e.lineTo(-i,n),e.closePath()}},"triangle-left":{draw:function(e,t){var n=Math.sqrt(t)/2,i=ba*n;e.moveTo(-i,0),e.lineTo(i,-n),e.lineTo(i,n),e.closePath()}},stroke:{draw:function(e,t){const n=Math.sqrt(t)/2;e.moveTo(-n,0),e.lineTo(n,0)}}};function PM(e){return J(PS,e)?PS[e]:F7(e)}var Om={};function F7(e){if(!J(Om,e)){const t=nu(e);Om[e]={draw:function(n,i){fc(n,t,0,0,Math.sqrt(i)/2)}}}return Om[e]}const no=.448084975506;function T7(e){return e.x}function M7(e){return e.y}function D7(e){return e.width}function O7(e){return e.height}function vr(e){return typeof e=="function"?e:()=>+e}function Tf(e,t,n){return Math.max(t,Math.min(e,n))}function IM(){var e=T7,t=M7,n=D7,i=O7,r=vr(0),o=r,s=r,a=r,u=null;function l(c,f,d){var h,g=f??+e.call(this,c),p=d??+t.call(this,c),m=+n.call(this,c),y=+i.call(this,c),b=Math.min(m,y)/2,v=Tf(+r.call(this,c),0,b),x=Tf(+o.call(this,c),0,b),E=Tf(+s.call(this,c),0,b),S=Tf(+a.call(this,c),0,b);if(u||(u=h=db()),v<=0&&x<=0&&E<=0&&S<=0)u.rect(g,p,m,y);else{var w=g+m,_=p+y;u.moveTo(g+v,p),u.lineTo(w-x,p),u.bezierCurveTo(w-no*x,p,w,p+no*x,w,p+x),u.lineTo(w,_-S),u.bezierCurveTo(w,_-no*S,w-no*S,_,w-S,_),u.lineTo(g+E,_),u.bezierCurveTo(g+no*E,_,g,_-no*E,g,_-E),u.lineTo(g,p+v),u.bezierCurveTo(g,p+no*v,g+no*v,p,g+v,p),u.closePath()}if(h)return u=null,h+""||null}return l.x=function(c){return arguments.length?(e=vr(c),l):e},l.y=function(c){return arguments.length?(t=vr(c),l):t},l.width=function(c){return arguments.length?(n=vr(c),l):n},l.height=function(c){return arguments.length?(i=vr(c),l):i},l.cornerRadius=function(c,f,d,h){return arguments.length?(r=vr(c),o=f!=null?vr(f):r,a=d!=null?vr(d):r,s=h!=null?vr(h):o,l):r},l.context=function(c){return arguments.length?(u=c??null,l):u},l}function zM(){var e,t,n,i,r=null,o,s,a,u;function l(f,d,h){const g=h/2;if(o){var p=a-d,m=f-s;if(p||m){var y=Math.hypot(p,m),b=(p/=y)*u,v=(m/=y)*u,x=Math.atan2(m,p);r.moveTo(s-b,a-v),r.lineTo(f-p*g,d-m*g),r.arc(f,d,g,x-Math.PI,x),r.lineTo(s+b,a+v),r.arc(s,a,u,x,x+Math.PI)}else r.arc(f,d,g,0,qi);r.closePath()}else o=1;s=f,a=d,u=g}function c(f){var d,h=f.length,g,p=!1,m;for(r==null&&(r=m=db()),d=0;d<=h;++d)!(d<h&&i(g=f[d],d,f))===p&&(p=!p)&&(o=0),p&&l(+e(g,d,f),+t(g,d,f),+n(g,d,f));if(m)return r=null,m+""||null}return c.x=function(f){return arguments.length?(e=f,c):e},c.y=function(f){return arguments.length?(t=f,c):t},c.size=function(f){return arguments.length?(n=f,c):n},c.defined=function(f){return arguments.length?(i=f,c):i},c.context=function(f){return arguments.length?(f==null?r=null:r=f,c):r},c}function qc(e,t){return e??t}const Wc=e=>e.x||0,Hc=e=>e.y||0,R7=e=>e.width||0,N7=e=>e.height||0,L7=e=>(e.x||0)+(e.width||0),P7=e=>(e.y||0)+(e.height||0),I7=e=>e.startAngle||0,z7=e=>e.endAngle||0,B7=e=>e.padAngle||0,U7=e=>e.innerRadius||0,j7=e=>e.outerRadius||0,q7=e=>e.cornerRadius||0,W7=e=>qc(e.cornerRadiusTopLeft,e.cornerRadius)||0,H7=e=>qc(e.cornerRadiusTopRight,e.cornerRadius)||0,G7=e=>qc(e.cornerRadiusBottomRight,e.cornerRadius)||0,V7=e=>qc(e.cornerRadiusBottomLeft,e.cornerRadius)||0,Y7=e=>qc(e.size,64),X7=e=>e.size||1,jg=e=>e.defined!==!1,K7=e=>PM(e.shape||"circle"),J7=z9().startAngle(I7).endAngle(z7).padAngle(B7).innerRadius(U7).outerRadius(j7).cornerRadius(q7),Q7=MT().x(Wc).y1(Hc).y0(P7).defined(jg),Z7=MT().y(Hc).x1(Wc).x0(L7).defined(jg),eB=TT().x(Wc).y(Hc).defined(jg),tB=IM().x(Wc).y(Hc).width(R7).height(N7).cornerRadius(W7,H7,G7,V7),nB=U9().type(K7).size(Y7),iB=zM().x(Wc).y(Hc).defined(jg).size(X7);function tx(e){return e.cornerRadius||e.cornerRadiusTopLeft||e.cornerRadiusTopRight||e.cornerRadiusBottomRight||e.cornerRadiusBottomLeft}function rB(e,t){return J7.context(e)(t)}function oB(e,t){const n=t[0],i=n.interpolate||"linear";return(n.orient==="horizontal"?Z7:Q7).curve(ex(i,n.orient,n.tension)).context(e)(t)}function sB(e,t){const n=t[0],i=n.interpolate||"linear";return eB.curve(ex(i,n.orient,n.tension)).context(e)(t)}function Pu(e,t,n,i){return tB.context(e)(t,n,i)}function aB(e,t){return(t.mark.shape||t.shape).context(e)(t)}function uB(e,t){return nB.context(e)(t)}function lB(e,t){return iB.context(e)(t)}var BM=1;function UM(){BM=1}function nx(e,t,n){var i=t.clip,r=e._defs,o=t.clip_id||(t.clip_id="clip"+BM++),s=r.clipping[o]||(r.clipping[o]={id:o});return ge(i)?s.path=i(null):tx(n)?s.path=Pu(null,n,0,0):(s.width=n.width||0,s.height=n.height||0),"url(#"+o+")"}function it(e){this.clear(),e&&this.union(e)}it.prototype={clone(){return new it(this)},clear(){return this.x1=+Number.MAX_VALUE,this.y1=+Number.MAX_VALUE,this.x2=-Number.MAX_VALUE,this.y2=-Number.MAX_VALUE,this},empty(){return this.x1===+Number.MAX_VALUE&&this.y1===+Number.MAX_VALUE&&this.x2===-Number.MAX_VALUE&&this.y2===-Number.MAX_VALUE},equals(e){return this.x1===e.x1&&this.y1===e.y1&&this.x2===e.x2&&this.y2===e.y2},set(e,t,n,i){return n<e?(this.x2=e,this.x1=n):(this.x1=e,this.x2=n),i<t?(this.y2=t,this.y1=i):(this.y1=t,this.y2=i),this},add(e,t){return e<this.x1&&(this.x1=e),t<this.y1&&(this.y1=t),e>this.x2&&(this.x2=e),t>this.y2&&(this.y2=t),this},expand(e){return this.x1-=e,this.y1-=e,this.x2+=e,this.y2+=e,this},round(){return this.x1=Math.floor(this.x1),this.y1=Math.floor(this.y1),this.x2=Math.ceil(this.x2),this.y2=Math.ceil(this.y2),this},scale(e){return this.x1*=e,this.y1*=e,this.x2*=e,this.y2*=e,this},translate(e,t){return this.x1+=e,this.x2+=e,this.y1+=t,this.y2+=t,this},rotate(e,t,n){const i=this.rotatedPoints(e,t,n);return this.clear().add(i[0],i[1]).add(i[2],i[3]).add(i[4],i[5]).add(i[6],i[7])},rotatedPoints(e,t,n){var{x1:i,y1:r,x2:o,y2:s}=this,a=Math.cos(e),u=Math.sin(e),l=t-t*a+n*u,c=n-t*u-n*a;return[a*i-u*r+l,u*i+a*r+c,a*i-u*s+l,u*i+a*s+c,a*o-u*r+l,u*o+a*r+c,a*o-u*s+l,u*o+a*s+c]},union(e){return e.x1<this.x1&&(this.x1=e.x1),e.y1<this.y1&&(this.y1=e.y1),e.x2>this.x2&&(this.x2=e.x2),e.y2>this.y2&&(this.y2=e.y2),this},intersect(e){return e.x1>this.x1&&(this.x1=e.x1),e.y1>this.y1&&(this.y1=e.y1),e.x2<this.x2&&(this.x2=e.x2),e.y2<this.y2&&(this.y2=e.y2),this},encloses(e){return e&&this.x1<=e.x1&&this.x2>=e.x2&&this.y1<=e.y1&&this.y2>=e.y2},alignsWith(e){return e&&(this.x1==e.x1||this.x2==e.x2||this.y1==e.y1||this.y2==e.y2)},intersects(e){return e&&!(this.x2<e.x1||this.x1>e.x2||this.y2<e.y1||this.y1>e.y2)},contains(e,t){return!(e<this.x1||e>this.x2||t<this.y1||t>this.y2)},width(){return this.x2-this.x1},height(){return this.y2-this.y1}};function qg(e){this.mark=e,this.bounds=this.bounds||new it}function Wg(e){qg.call(this,e),this.items=this.items||[]}G(Wg,qg);class jM{constructor(t){this._pending=0,this._loader=t||xg()}pending(){return this._pending}sanitizeURL(t){const n=this;return IS(n),n._loader.sanitize(t,{context:"href"}).then(i=>(al(n),i)).catch(()=>(al(n),null))}loadImage(t){const n=this,i=o8();return IS(n),n._loader.sanitize(t,{context:"image"}).then(r=>{const o=r.href;if(!o||!i)throw{url:o};const s=new i,a=J(r,"crossOrigin")?r.crossOrigin:"anonymous";return a!=null&&(s.crossOrigin=a),s.onload=()=>al(n),s.onerror=()=>al(n),s.src=o,s}).catch(r=>(al(n),{complete:!1,width:0,height:0,src:r&&r.url||""}))}ready(){const t=this;return new Promise(n=>{function i(r){t.pending()?setTimeout(()=>{i(!0)},10):n(r)}i(!1)})}}function IS(e){e._pending+=1}function al(e){e._pending-=1}function Gr(e,t,n){if(t.stroke&&t.opacity!==0&&t.strokeOpacity!==0){const i=t.strokeWidth!=null?+t.strokeWidth:1;e.expand(i+(n?cB(t,i):0))}return e}function cB(e,t){return e.strokeJoin&&e.strokeJoin!=="miter"?0:t}const fB=qi-1e-8;let Hg,hd,gd,Es,v1,pd,x1,w1;const go=(e,t)=>Hg.add(e,t),md=(e,t)=>go(hd=e,gd=t),zS=e=>go(e,Hg.y1),BS=e=>go(Hg.x1,e),bs=(e,t)=>v1*e+x1*t,vs=(e,t)=>pd*e+w1*t,Rm=(e,t)=>go(bs(e,t),vs(e,t)),Nm=(e,t)=>md(bs(e,t),vs(e,t));function Gc(e,t){return Hg=e,t?(Es=t*Mo,v1=w1=Math.cos(Es),pd=Math.sin(Es),x1=-pd):(v1=w1=1,Es=pd=x1=0),dB}const dB={beginPath(){},closePath(){},moveTo:Nm,lineTo:Nm,rect(e,t,n,i){Es?(Rm(e+n,t),Rm(e+n,t+i),Rm(e,t+i),Nm(e,t)):(go(e+n,t+i),md(e,t))},quadraticCurveTo(e,t,n,i){const r=bs(e,t),o=vs(e,t),s=bs(n,i),a=vs(n,i);US(hd,r,s,zS),US(gd,o,a,BS),md(s,a)},bezierCurveTo(e,t,n,i,r,o){const s=bs(e,t),a=vs(e,t),u=bs(n,i),l=vs(n,i),c=bs(r,o),f=vs(r,o);jS(hd,s,u,c,zS),jS(gd,a,l,f,BS),md(c,f)},arc(e,t,n,i,r,o){if(i+=Es,r+=Es,hd=n*Math.cos(r)+e,gd=n*Math.sin(r)+t,Math.abs(r-i)>fB)go(e-n,t-n),go(e+n,t+n);else{const s=l=>go(n*Math.cos(l)+e,n*Math.sin(l)+t);let a,u;if(s(i),s(r),r!==i)if(i=i%qi,i<0&&(i+=qi),r=r%qi,r<0&&(r+=qi),r<i&&(o=!o,a=i,i=r,r=a),o)for(r-=qi,a=i-i%ys,u=0;u<4&&a>r;++u,a-=ys)s(a);else for(a=i-i%ys+ys,u=0;u<4&&a<r;++u,a=a+ys)s(a)}}};function US(e,t,n,i){const r=(e-t)/(e+n-2*t);0<r&&r<1&&i(e+(t-e)*r)}function jS(e,t,n,i,r){const o=i-e+3*t-3*n,s=e+n-2*t,a=e-t;let u=0,l=0,c;Math.abs(o)>A7?(c=s*s+a*o,c>=0&&(c=Math.sqrt(c),u=(-s+c)/o,l=(-s-c)/o)):u=.5*a/s,0<u&&u<1&&r(qS(u,e,t,n,i)),0<l&&l<1&&r(qS(l,e,t,n,i))}function qS(e,t,n,i,r){const o=1-e,s=o*o,a=e*e;return s*o*t+3*s*e*n+3*o*a*i+a*e*r}var ko=(ko=$o(1,1))?ko.getContext("2d"):null;const E1=new it;function ix(e){return function(t,n){if(!ko)return!0;e(ko,t),E1.clear().union(t.bounds).intersect(n).round();const{x1:i,y1:r,x2:o,y2:s}=E1;for(let a=r;a<=s;++a)for(let u=i;u<=o;++u)if(ko.isPointInPath(u,a))return!0;return!1}}function rx(e,t){return t.contains(e.x||0,e.y||0)}function qM(e,t){const n=e.x||0,i=e.y||0,r=e.width||0,o=e.height||0;return t.intersects(E1.set(n,i,n+r,i+o))}function WM(e,t){const n=e.x||0,i=e.y||0,r=e.x2!=null?e.x2:n,o=e.y2!=null?e.y2:i;return Ma(t,n,i,r,o)}function Ma(e,t,n,i,r){const{x1:o,y1:s,x2:a,y2:u}=e,l=i-t,c=r-n;let f=0,d=1,h,g,p,m;for(m=0;m<4;++m){if(m===0&&(h=-l,g=-(o-t)),m===1&&(h=l,g=a-t),m===2&&(h=-c,g=-(s-n)),m===3&&(h=c,g=u-n),Math.abs(h)<1e-10&&g<0)return!1;if(p=g/h,h<0){if(p>d)return!1;p>f&&(f=p)}else if(h>0){if(p<f)return!1;p<d&&(d=p)}}return!0}function iu(e,t){e.globalCompositeOperation=t.blend||"source-over"}function ui(e,t){return e??t}function WS(e,t){const n=t.length;for(let i=0;i<n;++i)e.addColorStop(t[i].offset,t[i].color);return e}function hB(e,t,n){const i=n.width(),r=n.height();let o;if(t.gradient==="radial")o=e.createRadialGradient(n.x1+ui(t.x1,.5)*i,n.y1+ui(t.y1,.5)*r,Math.max(i,r)*ui(t.r1,0),n.x1+ui(t.x2,.5)*i,n.y1+ui(t.y2,.5)*r,Math.max(i,r)*ui(t.r2,.5));else{const s=ui(t.x1,0),a=ui(t.y1,0),u=ui(t.x2,1),l=ui(t.y2,0);if(s===u||a===l||i===r)o=e.createLinearGradient(n.x1+s*i,n.y1+a*r,n.x1+u*i,n.y1+l*r);else{const c=$o(Math.ceil(i),Math.ceil(r)),f=c.getContext("2d");return f.scale(i,r),f.fillStyle=WS(f.createLinearGradient(s,a,u,l),t.stops),f.fillRect(0,0,i,r),e.createPattern(c,"no-repeat")}}return WS(o,t.stops)}function HM(e,t,n){return Zv(n)?hB(e,n,t.bounds):n}function Jd(e,t,n){return n*=t.fillOpacity==null?1:t.fillOpacity,n>0?(e.globalAlpha=n,e.fillStyle=HM(e,t,t.fill),!0):!1}var gB=[];function ru(e,t,n){var i=(i=t.strokeWidth)!=null?i:1;return i<=0?!1:(n*=t.strokeOpacity==null?1:t.strokeOpacity,n>0?(e.globalAlpha=n,e.strokeStyle=HM(e,t,t.stroke),e.lineWidth=i,e.lineCap=t.strokeCap||"butt",e.lineJoin=t.strokeJoin||"miter",e.miterLimit=t.strokeMiterLimit||10,e.setLineDash&&(e.setLineDash(t.strokeDash||gB),e.lineDashOffset=t.strokeDashOffset||0),!0):!1)}function pB(e,t){return e.zindex-t.zindex||e.index-t.index}function ox(e){if(!e.zdirty)return e.zitems;var t=e.items,n=[],i,r,o;for(r=0,o=t.length;r<o;++r)i=t[r],i.index=r,i.zindex&&n.push(i);return e.zdirty=!1,e.zitems=n.sort(pB)}function Ei(e,t){var n=e.items,i,r;if(!n||!n.length)return;const o=ox(e);if(o&&o.length){for(i=0,r=n.length;i<r;++i)n[i].zindex||t(n[i]);n=o}for(i=0,r=n.length;i<r;++i)t(n[i])}function Qd(e,t){var n=e.items,i,r;if(!n||!n.length)return null;const o=ox(e);for(o&&o.length&&(n=o),r=n.length;--r>=0;)if(i=t(n[r]))return i;if(n===o){for(n=e.items,r=n.length;--r>=0;)if(!n[r].zindex&&(i=t(n[r])))return i}return null}function sx(e){return function(t,n,i){Ei(n,r=>{(!i||i.intersects(r.bounds))&&GM(e,t,r,r)})}}function mB(e){return function(t,n,i){n.items.length&&(!i||i.intersects(n.bounds))&&GM(e,t,n.items[0],n.items)}}function GM(e,t,n,i){var r=n.opacity==null?1:n.opacity;r!==0&&(e(t,i)||(iu(t,n),n.fill&&Jd(t,n,r)&&t.fill(),n.stroke&&ru(t,n,r)&&t.stroke()))}function Gg(e){return e=e||Pn,function(t,n,i,r,o,s){return i*=t.pixelRatio,r*=t.pixelRatio,Qd(n,a=>{const u=a.bounds;if(!(u&&!u.contains(o,s)||!u)&&e(t,a,i,r,o,s))return a})}}function Vc(e,t){return function(n,i,r,o){var s=Array.isArray(i)?i[0]:i,a=t??s.fill,u=s.stroke&&n.isPointInStroke,l,c;return u&&(l=s.strokeWidth,c=s.strokeCap,n.lineWidth=l??1,n.lineCap=c??"butt"),e(n,i)?!1:a&&n.isPointInPath(r,o)||u&&n.isPointInStroke(r,o)}}function ax(e){return Gg(Vc(e))}function $s(e,t){return"translate("+e+","+t+")"}function ux(e){return"rotate("+e+")"}function yB(e,t){return"scale("+e+","+t+")"}function VM(e){return $s(e.x||0,e.y||0)}function bB(e){return $s(e.x||0,e.y||0)+(e.angle?" "+ux(e.angle):"")}function vB(e){return $s(e.x||0,e.y||0)+(e.angle?" "+ux(e.angle):"")+(e.scaleX||e.scaleY?" "+yB(e.scaleX||1,e.scaleY||1):"")}function lx(e,t,n){function i(s,a){s("transform",bB(a)),s("d",t(null,a))}function r(s,a){return t(Gc(s,a.angle),a),Gr(s,a).translate(a.x||0,a.y||0)}function o(s,a){var u=a.x||0,l=a.y||0,c=a.angle||0;s.translate(u,l),c&&s.rotate(c*=Mo),s.beginPath(),t(s,a),c&&s.rotate(-c),s.translate(-u,-l)}return{type:e,tag:"path",nested:!1,attr:i,bound:r,draw:sx(o),pick:ax(o),isect:n||ix(o)}}var xB=lx("arc",rB);function wB(e,t){for(var n=e[0].orient==="horizontal"?t[1]:t[0],i=e[0].orient==="horizontal"?"y":"x",r=e.length,o=1/0,s,a;--r>=0;)e[r].defined!==!1&&(a=Math.abs(e[r][i]-n),a<o&&(o=a,s=e[r]));return s}function EB(e,t){for(var n=Math.pow(e[0].strokeWidth||1,2),i=e.length,r,o,s;--i>=0;)if(e[i].defined!==!1&&(r=e[i].x-t[0],o=e[i].y-t[1],s=r*r+o*o,s<n))return e[i];return null}function SB(e,t){for(var n=e.length,i,r,o;--n>=0;)if(e[n].defined!==!1&&(i=e[n].x-t[0],r=e[n].y-t[1],o=i*i+r*r,i=e[n].size||1,o<i*i))return e[n];return null}function cx(e,t,n){function i(u,l){var c=l.mark.items;c.length&&u("d",t(null,c))}function r(u,l){var c=l.items;return c.length===0?u:(t(Gc(u),c),Gr(u,c[0]))}function o(u,l){u.beginPath(),t(u,l)}const s=Vc(o);function a(u,l,c,f,d,h){var g=l.items,p=l.bounds;return!g||!g.length||p&&!p.contains(d,h)?null:(c*=u.pixelRatio,f*=u.pixelRatio,s(u,g,c,f)?g[0]:null)}return{type:e,tag:"path",nested:!0,attr:i,bound:r,draw:mB(o),pick:a,isect:rx,tip:n}}var _B=cx("area",oB,wB);function AB(e,t){var n=t.clip;e.save(),ge(n)?(e.beginPath(),n(e),e.clip()):YM(e,t.group)}function YM(e,t){e.beginPath(),tx(t)?Pu(e,t,0,0):e.rect(0,0,t.width||0,t.height||0),e.clip()}function XM(e){const t=ui(e.strokeWidth,1);return e.strokeOffset!=null?e.strokeOffset:e.stroke&&t>.5&&t<1.5?.5-Math.abs(t-1):0}function $B(e,t){e("transform",VM(t))}function KM(e,t){const n=XM(t);e("d",Pu(null,t,n,n))}function kB(e,t){e("class","background"),e("aria-hidden",!0),KM(e,t)}function CB(e,t){e("class","foreground"),e("aria-hidden",!0),t.strokeForeground?KM(e,t):e("d","")}function FB(e,t,n){const i=t.clip?nx(n,t,t):null;e("clip-path",i)}function TB(e,t){if(!t.clip&&t.items){const n=t.items,i=n.length;for(let r=0;r<i;++r)e.union(n[r].bounds)}return(t.clip||t.width||t.height)&&!t.noBound&&e.add(0,0).add(t.width||0,t.height||0),Gr(e,t),e.translate(t.x||0,t.y||0)}function dc(e,t,n,i){const r=XM(t);e.beginPath(),Pu(e,t,(n||0)+r,(i||0)+r)}const MB=Vc(dc),DB=Vc(dc,!1),OB=Vc(dc,!0);function RB(e,t,n,i){Ei(t,r=>{const o=r.x||0,s=r.y||0,a=r.strokeForeground,u=r.opacity==null?1:r.opacity;(r.stroke||r.fill)&&u&&(dc(e,r,o,s),iu(e,r),r.fill&&Jd(e,r,u)&&e.fill(),r.stroke&&!a&&ru(e,r,u)&&e.stroke()),e.save(),e.translate(o,s),r.clip&&YM(e,r),n&&n.translate(-o,-s),Ei(r,l=>{(l.marktype==="group"||i==null||i.includes(l.marktype))&&this.draw(e,l,n,i)}),n&&n.translate(o,s),e.restore(),a&&r.stroke&&u&&(dc(e,r,o,s),iu(e,r),ru(e,r,u)&&e.stroke())})}function NB(e,t,n,i,r,o){if(t.bounds&&!t.bounds.contains(r,o)||!t.items)return null;const s=n*e.pixelRatio,a=i*e.pixelRatio;return Qd(t,u=>{let l,c,f;const d=u.bounds;if(d&&!d.contains(r,o))return;c=u.x||0,f=u.y||0;const h=c+(u.width||0),g=f+(u.height||0),p=u.clip;if(p&&(r<c||r>h||o<f||o>g))return;if(e.save(),e.translate(c,f),c=r-c,f=o-f,p&&tx(u)&&!OB(e,u,s,a))return e.restore(),null;const m=u.strokeForeground,y=t.interactive!==!1;return y&&m&&u.stroke&&DB(e,u,s,a)?(e.restore(),u):(l=Qd(u,b=>LB(b,c,f)?this.pick(b,n,i,c,f):null),!l&&y&&(u.fill||!m&&u.stroke)&&MB(e,u,s,a)&&(l=u),e.restore(),l||null)})}function LB(e,t,n){return(e.interactive!==!1||e.marktype==="group")&&e.bounds&&e.bounds.contains(t,n)}var PB={type:"group",tag:"g",nested:!1,attr:$B,bound:TB,draw:RB,pick:NB,isect:qM,content:FB,background:kB,foreground:CB},hc={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",version:"1.1"};function fx(e,t){var n=e.image;return(!n||e.url&&e.url!==n.url)&&(n={complete:!1,width:0,height:0},t.loadImage(e.url).then(i=>{e.image=i,e.image.url=e.url})),n}function dx(e,t){return e.width!=null?e.width:!t||!t.width?0:e.aspect!==!1&&e.height?e.height*t.width/t.height:t.width}function hx(e,t){return e.height!=null?e.height:!t||!t.height?0:e.aspect!==!1&&e.width?e.width*t.height/t.width:t.height}function Vg(e,t){return e==="center"?t/2:e==="right"?t:0}function Yg(e,t){return e==="middle"?t/2:e==="bottom"?t:0}function IB(e,t,n){const i=fx(t,n),r=dx(t,i),o=hx(t,i),s=(t.x||0)-Vg(t.align,r),a=(t.y||0)-Yg(t.baseline,o),u=!i.src&&i.toDataURL?i.toDataURL():i.src||"";e("href",u,hc["xmlns:xlink"],"xlink:href"),e("transform",$s(s,a)),e("width",r),e("height",o),e("preserveAspectRatio",t.aspect===!1?"none":"xMidYMid")}function zB(e,t){const n=t.image,i=dx(t,n),r=hx(t,n),o=(t.x||0)-Vg(t.align,i),s=(t.y||0)-Yg(t.baseline,r);return e.set(o,s,o+i,s+r)}function BB(e,t,n){Ei(t,i=>{if(n&&!n.intersects(i.bounds))return;const r=fx(i,this);let o=dx(i,r),s=hx(i,r);if(o===0||s===0)return;let a=(i.x||0)-Vg(i.align,o),u=(i.y||0)-Yg(i.baseline,s),l,c,f,d;i.aspect!==!1&&(c=r.width/r.height,f=i.width/i.height,c===c&&f===f&&c!==f&&(f<c?(d=o/c,u+=(s-d)/2,s=d):(d=s*c,a+=(o-d)/2,o=d))),(r.complete||r.toDataURL)&&(iu(e,i),e.globalAlpha=(l=i.opacity)!=null?l:1,e.imageSmoothingEnabled=i.smooth!==!1,e.drawImage(r,a,u,o,s))})}var UB={type:"image",tag:"image",nested:!1,attr:IB,bound:zB,draw:BB,pick:Gg(),isect:Pn,get:fx,xOffset:Vg,yOffset:Yg},jB=cx("line",sB,EB);function qB(e,t){var n=t.scaleX||1,i=t.scaleY||1;(n!==1||i!==1)&&e("vector-effect","non-scaling-stroke"),e("transform",vB(t)),e("d",t.path)}function yd(e,t){var n=t.path;if(n==null)return!0;var i=t.x||0,r=t.y||0,o=t.scaleX||1,s=t.scaleY||1,a=(t.angle||0)*Mo,u=t.pathCache;(!u||u.path!==n)&&((t.pathCache=u=nu(n)).path=n),a&&e.rotate&&e.translate?(e.translate(i,r),e.rotate(a),fc(e,u,0,0,o,s),e.rotate(-a),e.translate(-i,-r)):fc(e,u,i,r,o,s)}function WB(e,t){return yd(Gc(e,t.angle),t)?e.set(0,0,0,0):Gr(e,t,!0)}var HB={type:"path",tag:"path",nested:!1,attr:qB,bound:WB,draw:sx(yd),pick:ax(yd),isect:ix(yd)};function GB(e,t){e("d",Pu(null,t))}function VB(e,t){var n,i;return Gr(e.set(n=t.x||0,i=t.y||0,n+t.width||0,i+t.height||0),t)}function HS(e,t){e.beginPath(),Pu(e,t)}var YB={type:"rect",tag:"path",nested:!1,attr:GB,bound:VB,draw:sx(HS),pick:ax(HS),isect:qM};function XB(e,t){e("transform",VM(t)),e("x2",t.x2!=null?t.x2-(t.x||0):0),e("y2",t.y2!=null?t.y2-(t.y||0):0)}function KB(e,t){var n,i;return Gr(e.set(n=t.x||0,i=t.y||0,t.x2!=null?t.x2:n,t.y2!=null?t.y2:i),t)}function JM(e,t,n){var i,r,o,s;return t.stroke&&ru(e,t,n)?(i=t.x||0,r=t.y||0,o=t.x2!=null?t.x2:i,s=t.y2!=null?t.y2:r,e.beginPath(),e.moveTo(i,r),e.lineTo(o,s),!0):!1}function JB(e,t,n){Ei(t,i=>{if(!(n&&!n.intersects(i.bounds))){var r=i.opacity==null?1:i.opacity;r&&JM(e,i,r)&&(iu(e,i),e.stroke())}})}function QB(e,t,n,i){return e.isPointInStroke?JM(e,t,1)&&e.isPointInStroke(n,i):!1}var ZB={type:"rule",tag:"line",nested:!1,attr:XB,bound:KB,draw:JB,pick:Gg(QB),isect:WM},eU=lx("shape",aB),tU=lx("symbol",uB,rx);const GS=FC();var Rn={height:lr,measureWidth:gx,estimateWidth:Zd,width:Zd,canvas:QM};QM(!0);function QM(e){Rn.width=e&&ko?gx:Zd}function Zd(e,t){return ZM(Oo(e,t),lr(e))}function ZM(e,t){return~~(.8*e.length*t)}function gx(e,t){return lr(e)<=0||!(t=Oo(e,t))?0:eD(t,Xg(e))}function eD(e,t){const n=`(${t}) ${e}`;let i=GS.get(n);return i===void 0&&(ko.font=t,i=ko.measureText(e).width,GS.set(n,i)),i}function lr(e){return e.fontSize!=null?+e.fontSize||0:11}function Do(e){return e.lineHeight!=null?e.lineHeight:lr(e)+2}function nU(e){return P(e)?e.length>1?e:e[0]:e}function Yc(e){return nU(e.lineBreak&&e.text&&!P(e.text)?e.text.split(e.lineBreak):e.text)}function px(e){const t=Yc(e);return(P(t)?t.length-1:0)*Do(e)}function Oo(e,t){const n=t==null?"":(t+"").trim();return e.limit>0&&n.length?rU(e,n):n}function iU(e){if(Rn.width===gx){const t=Xg(e);return n=>eD(n,t)}else if(Rn.width===Zd){const t=lr(e);return n=>ZM(n,t)}else return t=>Rn.width(e,t)}function rU(e,t){var n=+e.limit,i=iU(e);if(i(t)<n)return t;var r=e.ellipsis||"…",o=e.dir==="rtl",s=0,a=t.length,u;if(n-=i(r),o){for(;s<a;)u=s+a>>>1,i(t.slice(u))>n?s=u+1:a=u;return r+t.slice(s)}else{for(;s<a;)u=1+(s+a>>>1),i(t.slice(0,u))<n?s=u:a=u-1;return t.slice(0,s)+r}}function Xc(e,t){var n=e.font;return(t&&n?String(n).replace(/"/g,"'"):n)||"sans-serif"}function Xg(e,t){return(e.fontStyle?e.fontStyle+" ":"")+(e.fontVariant?e.fontVariant+" ":"")+(e.fontWeight?e.fontWeight+" ":"")+lr(e)+"px "+Xc(e,t)}function mx(e){var t=e.baseline,n=lr(e);return Math.round(t==="top"?.79*n:t==="middle"?.3*n:t==="bottom"?-.21*n:t==="line-top"?.29*n+.5*Do(e):t==="line-bottom"?.29*n-.5*Do(e):0)}const oU={left:"start",center:"middle",right:"end"},Wl=new it;function Kg(e){var t=e.x||0,n=e.y||0,i=e.radius||0,r;return i&&(r=(e.theta||0)-ys,t+=i*Math.cos(r),n+=i*Math.sin(r)),Wl.x1=t,Wl.y1=n,Wl}function sU(e,t){var n=t.dx||0,i=(t.dy||0)+mx(t),r=Kg(t),o=r.x1,s=r.y1,a=t.angle||0,u;e("text-anchor",oU[t.align]||"start"),a?(u=$s(o,s)+" "+ux(a),(n||i)&&(u+=" "+$s(n,i))):u=$s(o+n,s+i),e("transform",u)}function yx(e,t,n){var i=Rn.height(t),r=t.align,o=Kg(t),s=o.x1,a=o.y1,u=t.dx||0,l=(t.dy||0)+mx(t)-Math.round(.8*i),c=Yc(t),f;if(P(c)?(i+=Do(t)*(c.length-1),f=c.reduce((d,h)=>Math.max(d,Rn.width(t,h)),0)):f=Rn.width(t,c),r==="center"?u-=f/2:r==="right"&&(u-=f),e.set(u+=s,l+=a,u+f,l+i),t.angle&&!n)e.rotate(t.angle*Mo,s,a);else if(n===2)return e.rotatedPoints(t.angle*Mo,s,a);return e}function aU(e,t,n){Ei(t,i=>{var r=i.opacity==null?1:i.opacity,o,s,a,u,l,c,f;if(!(n&&!n.intersects(i.bounds)||r===0||i.fontSize<=0||i.text==null||i.text.length===0)){if(e.font=Xg(i),e.textAlign=i.align||"left",o=Kg(i),s=o.x1,a=o.y1,i.angle&&(e.save(),e.translate(s,a),e.rotate(i.angle*Mo),s=a=0),s+=i.dx||0,a+=(i.dy||0)+mx(i),c=Yc(i),iu(e,i),P(c))for(l=Do(i),u=0;u<c.length;++u)f=Oo(i,c[u]),i.fill&&Jd(e,i,r)&&e.fillText(f,s,a),i.stroke&&ru(e,i,r)&&e.strokeText(f,s,a),a+=l;else f=Oo(i,c),i.fill&&Jd(e,i,r)&&e.fillText(f,s,a),i.stroke&&ru(e,i,r)&&e.strokeText(f,s,a);i.angle&&e.restore()}})}function uU(e,t,n,i,r,o){if(t.fontSize<=0)return!1;if(!t.angle)return!0;var s=Kg(t),a=s.x1,u=s.y1,l=yx(Wl,t,1),c=-t.angle*Mo,f=Math.cos(c),d=Math.sin(c),h=f*r-d*o+(a-f*a+d*u),g=d*r+f*o+(u-d*a-f*u);return l.contains(h,g)}function lU(e,t){const n=yx(Wl,e,2);return Ma(t,n[0],n[1],n[2],n[3])||Ma(t,n[0],n[1],n[4],n[5])||Ma(t,n[4],n[5],n[6],n[7])||Ma(t,n[2],n[3],n[6],n[7])}var cU={type:"text",tag:"text",nested:!1,attr:sU,bound:yx,draw:aU,pick:Gg(uU),isect:lU},fU=cx("trail",lB,SB),Bn={arc:xB,area:_B,group:PB,image:UB,line:jB,path:HB,rect:YB,rule:ZB,shape:eU,symbol:tU,text:cU,trail:fU};function S1(e,t,n){var i=Bn[e.mark.marktype],r=t||i.bound;return i.nested&&(e=e.mark),r(e.bounds||(e.bounds=new it),e,n)}var VS={mark:null};function tD(e,t,n){var i=Bn[e.marktype],r=i.bound,o=e.items,s=o&&o.length,a,u,l,c;if(i.nested)return s?l=o[0]:(VS.mark=e,l=VS),c=S1(l,r,n),t=t&&t.union(c)||c,t;if(t=t||e.bounds&&e.bounds.clear()||new it,s)for(a=0,u=o.length;a<u;++a)t.union(S1(o[a],r,n));return e.bounds=t}const dU=["marktype","name","role","interactive","clip","items","zindex","x","y","width","height","align","baseline","fill","fillOpacity","opacity","blend","stroke","strokeOpacity","strokeWidth","strokeCap","strokeDash","strokeDashOffset","strokeForeground","strokeOffset","startAngle","endAngle","innerRadius","outerRadius","cornerRadius","padAngle","cornerRadiusTopLeft","cornerRadiusTopRight","cornerRadiusBottomLeft","cornerRadiusBottomRight","interpolate","tension","orient","defined","url","aspect","smooth","path","scaleX","scaleY","x2","y2","size","shape","text","angle","theta","radius","dir","dx","dy","ellipsis","limit","lineBreak","lineHeight","font","fontSize","fontWeight","fontStyle","fontVariant","description","aria","ariaRole","ariaRoleDescription"];function nD(e,t){return JSON.stringify(e,dU,t)}function iD(e){const t=typeof e=="string"?JSON.parse(e):e;return rD(t)}function rD(e){var t=e.marktype,n=e.items,i,r,o;if(n)for(r=0,o=n.length;r<o;++r)i=t?"mark":"group",n[r][i]=e,n[r].zindex&&(n[r][i].zdirty=!0),(t||i)==="group"&&rD(n[r]);return t&&tD(e),e}class oD{constructor(t){arguments.length?this.root=iD(t):(this.root=YS({marktype:"group",name:"root",role:"frame"}),this.root.items=[new Wg(this.root)])}toJSON(t){return nD(this.root,t||0)}mark(t,n,i){n=n||this.root.items[0];const r=YS(t,n);return n.items[i]=r,r.zindex&&(r.group.zdirty=!0),r}}function YS(e,t){const n={bounds:new it,clip:!!e.clip,group:t,interactive:e.interactive!==!1,items:[],marktype:e.marktype,name:e.name||void 0,role:e.role||void 0,zindex:e.zindex||0};return e.aria!=null&&(n.aria=e.aria),e.description&&(n.description=e.description),n}function po(e,t,n){return!e&&typeof document<"u"&&document.createElement&&(e=document),e?n?e.createElementNS(n,t):e.createElement(t):null}function bx(e,t){t=t.toLowerCase();for(var n=e.childNodes,i=0,r=n.length;i<r;++i)if(n[i].tagName.toLowerCase()===t)return n[i]}function ot(e,t,n,i){var r=e.childNodes[t],o;return(!r||r.tagName.toLowerCase()!==n.toLowerCase())&&(o=r||null,r=po(e.ownerDocument,n,i),e.insertBefore(r,o)),r}function Wn(e,t){for(var n=e.childNodes,i=n.length;i>t;)e.removeChild(n[--i]);return e}function sD(e){return"mark-"+e.marktype+(e.role?" role-"+e.role:"")+(e.name?" "+e.name:"")}function Jg(e,t){const n=t.getBoundingClientRect();return[e.clientX-n.left-(t.clientLeft||0),e.clientY-n.top-(t.clientTop||0)]}function hU(e,t,n,i){var r=e&&e.mark,o,s;if(r&&(o=Bn[r.marktype]).tip){for(s=Jg(t,n),s[0]-=i[0],s[1]-=i[1];e=e.mark.group;)s[0]-=e.x||0,s[1]-=e.y||0;e=o.tip(r.items,s)}return e}let vx=class{constructor(t,n){this._active=null,this._handlers={},this._loader=t||xg(),this._tooltip=n||gU}initialize(t,n,i){return this._el=t,this._obj=i||null,this.origin(n)}element(){return this._el}canvas(){return this._el&&this._el.firstChild}origin(t){return arguments.length?(this._origin=t||[0,0],this):this._origin.slice()}scene(t){return arguments.length?(this._scene=t,this):this._scene}on(){}off(){}_handlerIndex(t,n,i){for(let r=t?t.length:0;--r>=0;)if(t[r].type===n&&(!i||t[r].handler===i))return r;return-1}handlers(t){const n=this._handlers,i=[];if(t)i.push(...n[this.eventName(t)]);else for(const r in n)i.push(...n[r]);return i}eventName(t){const n=t.indexOf(".");return n<0?t:t.slice(0,n)}handleHref(t,n,i){this._loader.sanitize(i,{context:"href"}).then(r=>{const o=new MouseEvent(t.type,t),s=po(null,"a");for(const a in r)s.setAttribute(a,r[a]);s.dispatchEvent(o)}).catch(()=>{})}handleTooltip(t,n,i){if(n&&n.tooltip!=null){n=hU(n,t,this.canvas(),this._origin);const r=i&&n&&n.tooltip||null;this._tooltip.call(this._obj,this,t,n,r)}}getItemBoundingClientRect(t){const n=this.canvas();if(!n)return;const i=n.getBoundingClientRect(),r=this._origin,o=t.bounds,s=o.width(),a=o.height();let u=o.x1+r[0]+i.left,l=o.y1+r[1]+i.top;for(;t.mark&&(t=t.mark.group);)u+=t.x||0,l+=t.y||0;return{x:u,y:l,width:s,height:a,left:u,top:l,right:u+s,bottom:l+a}}};function gU(e,t,n,i){e.element().setAttribute("title",i||"")}class Kc{constructor(t){this._el=null,this._bgcolor=null,this._loader=new jM(t)}initialize(t,n,i,r,o){return this._el=t,this.resize(n,i,r,o)}element(){return this._el}canvas(){return this._el&&this._el.firstChild}background(t){return arguments.length===0?this._bgcolor:(this._bgcolor=t,this)}resize(t,n,i,r){return this._width=t,this._height=n,this._origin=i||[0,0],this._scale=r||1,this}dirty(){}render(t,n){const i=this;return i._call=function(){i._render(t,n)},i._call(),i._call=null,i}_render(){}renderAsync(t,n){const i=this.render(t,n);return this._ready?this._ready.then(()=>i):Promise.resolve(i)}_load(t,n){var i=this,r=i._loader[t](n);if(!i._ready){const o=i._call;i._ready=i._loader.ready().then(s=>{s&&o(),i._ready=null})}return r}sanitizeURL(t){return this._load("sanitizeURL",t)}loadImage(t){return this._load("loadImage",t)}}const pU="keydown",mU="keypress",yU="keyup",aD="dragenter",bd="dragleave",uD="dragover",_1="pointerdown",bU="pointerup",eh="pointermove",vd="pointerout",lD="pointerover",A1="mousedown",vU="mouseup",cD="mousemove",th="mouseout",fD="mouseover",nh="click",xU="dblclick",wU="wheel",dD="mousewheel",ih="touchstart",rh="touchmove",oh="touchend",EU=[pU,mU,yU,aD,bd,uD,_1,bU,eh,vd,lD,A1,vU,cD,th,fD,nh,xU,wU,dD,ih,rh,oh],$1=eh,Hl=th,k1=nh;class Jc extends vx{constructor(t,n){super(t,n),this._down=null,this._touch=null,this._first=!0,this._events={},this.events=EU,this.pointermove=KS([eh,cD],[lD,fD],[vd,th]),this.dragover=KS([uD],[aD],[bd]),this.pointerout=JS([vd,th]),this.dragleave=JS([bd])}initialize(t,n,i){return this._canvas=t&&bx(t,"canvas"),[nh,A1,_1,eh,vd,bd].forEach(r=>XS(this,r)),super.initialize(t,n,i)}canvas(){return this._canvas}context(){return this._canvas.getContext("2d")}DOMMouseScroll(t){this.fire(dD,t)}pointerdown(t){this._down=this._active,this.fire(_1,t)}mousedown(t){this._down=this._active,this.fire(A1,t)}click(t){this._down===this._active&&(this.fire(nh,t),this._down=null)}touchstart(t){this._touch=this.pickEvent(t.changedTouches[0]),this._first&&(this._active=this._touch,this._first=!1),this.fire(ih,t,!0)}touchmove(t){this.fire(rh,t,!0)}touchend(t){this.fire(oh,t,!0),this._touch=null}fire(t,n,i){const r=i?this._touch:this._active,o=this._handlers[t];if(n.vegaType=t,t===k1&&r&&r.href?this.handleHref(n,r,r.href):(t===$1||t===Hl)&&this.handleTooltip(n,r,t!==Hl),o)for(let s=0,a=o.length;s<a;++s)o[s].handler.call(this._obj,n,r)}on(t,n){const i=this.eventName(t),r=this._handlers;return this._handlerIndex(r[i],t,n)<0&&(XS(this,t),(r[i]||(r[i]=[])).push({type:t,handler:n})),this}off(t,n){const i=this.eventName(t),r=this._handlers[i],o=this._handlerIndex(r,t,n);return o>=0&&r.splice(o,1),this}pickEvent(t){const n=Jg(t,this._canvas),i=this._origin;return this.pick(this._scene,n[0],n[1],n[0]-i[0],n[1]-i[1])}pick(t,n,i,r,o){const s=this.context();return Bn[t.marktype].pick.call(this,s,t,n,i,r,o)}}const SU=e=>e===ih||e===rh||e===oh?[ih,rh,oh]:[e];function XS(e,t){SU(t).forEach(n=>_U(e,n))}function _U(e,t){const n=e.canvas();n&&!e._events[t]&&(e._events[t]=1,n.addEventListener(t,e[t]?i=>e[t](i):i=>e.fire(t,i)))}function Ml(e,t,n){t.forEach(i=>e.fire(i,n))}function KS(e,t,n){return function(i){const r=this._active,o=this.pickEvent(i);o===r?Ml(this,e,i):((!r||!r.exit)&&Ml(this,n,i),this._active=o,Ml(this,t,i),Ml(this,e,i))}}function JS(e){return function(t){Ml(this,e,t),this._active=null}}function AU(){return typeof window<"u"&&window.devicePixelRatio||1}function $U(e,t,n,i,r,o){const s=typeof HTMLElement<"u"&&e instanceof HTMLElement&&e.parentNode!=null,a=e.getContext("2d"),u=s?AU():r;e.width=t*u,e.height=n*u;for(const l in o)a[l]=o[l];return s&&u!==1&&(e.style.width=t+"px",e.style.height=n+"px"),a.pixelRatio=u,a.setTransform(u,0,0,u,u*i[0],u*i[1]),e}class sh extends Kc{constructor(t){super(t),this._options={},this._redraw=!1,this._dirty=new it,this._tempb=new it}initialize(t,n,i,r,o,s){return this._options=s||{},this._canvas=this._options.externalContext?null:$o(1,1,this._options.type),t&&this._canvas&&(Wn(t,0).appendChild(this._canvas),this._canvas.setAttribute("class","marks")),super.initialize(t,n,i,r,o)}resize(t,n,i,r){if(super.resize(t,n,i,r),this._canvas)$U(this._canvas,this._width,this._height,this._origin,this._scale,this._options.context);else{const o=this._options.externalContext;o||N("CanvasRenderer is missing a valid canvas or context"),o.scale(this._scale,this._scale),o.translate(this._origin[0],this._origin[1])}return this._redraw=!0,this}canvas(){return this._canvas}context(){return this._options.externalContext||(this._canvas?this._canvas.getContext("2d"):null)}dirty(t){const n=this._tempb.clear().union(t.bounds);let i=t.mark.group;for(;i;)n.translate(i.x||0,i.y||0),i=i.mark.group;this._dirty.union(n)}_render(t,n){const i=this.context(),r=this._origin,o=this._width,s=this._height,a=this._dirty,u=kU(r,o,s);i.save();const l=this._redraw||a.empty()?(this._redraw=!1,u.expand(1)):CU(i,u.intersect(a),r);return this.clear(-r[0],-r[1],o,s),this.draw(i,t,l,n),i.restore(),a.clear(),this}draw(t,n,i,r){if(n.marktype!=="group"&&r!=null&&!r.includes(n.marktype))return;const o=Bn[n.marktype];n.clip&&AB(t,n),o.draw.call(this,t,n,i,r),n.clip&&t.restore()}clear(t,n,i,r){const o=this._options,s=this.context();o.type!=="pdf"&&!o.externalContext&&s.clearRect(t,n,i,r),this._bgcolor!=null&&(s.fillStyle=this._bgcolor,s.fillRect(t,n,i,r))}}const kU=(e,t,n)=>new it().set(0,0,t,n).translate(-e[0],-e[1]);function CU(e,t,n){return t.expand(1).round(),e.pixelRatio%1&&t.scale(e.pixelRatio).round().scale(1/e.pixelRatio),t.translate(-(n[0]%1),-(n[1]%1)),e.beginPath(),e.rect(t.x1,t.y1,t.width(),t.height()),e.clip(),t}class hD extends vx{constructor(t,n){super(t,n);const i=this;i._hrefHandler=Lm(i,(r,o)=>{o&&o.href&&i.handleHref(r,o,o.href)}),i._tooltipHandler=Lm(i,(r,o)=>{i.handleTooltip(r,o,r.type!==Hl)})}initialize(t,n,i){let r=this._svg;return r&&(r.removeEventListener(k1,this._hrefHandler),r.removeEventListener($1,this._tooltipHandler),r.removeEventListener(Hl,this._tooltipHandler)),this._svg=r=t&&bx(t,"svg"),r&&(r.addEventListener(k1,this._hrefHandler),r.addEventListener($1,this._tooltipHandler),r.addEventListener(Hl,this._tooltipHandler)),super.initialize(t,n,i)}canvas(){return this._svg}on(t,n){const i=this.eventName(t),r=this._handlers;if(this._handlerIndex(r[i],t,n)<0){const s={type:t,handler:n,listener:Lm(this,n)};(r[i]||(r[i]=[])).push(s),this._svg&&this._svg.addEventListener(i,s.listener)}return this}off(t,n){const i=this.eventName(t),r=this._handlers[i],o=this._handlerIndex(r,t,n);return o>=0&&(this._svg&&this._svg.removeEventListener(i,r[o].listener),r.splice(o,1)),this}}const Lm=(e,t)=>n=>{let i=n.target.__data__;i=Array.isArray(i)?i[0]:i,n.vegaType=n.type,t.call(e._obj,n,i)},gD="aria-hidden",xx="aria-label",wx="role",Ex="aria-roledescription",pD="graphics-object",Sx="graphics-symbol",mD=(e,t,n)=>({[wx]:e,[Ex]:t,[xx]:n||void 0}),FU=xi(["axis-domain","axis-grid","axis-label","axis-tick","axis-title","legend-band","legend-entry","legend-gradient","legend-label","legend-title","legend-symbol","title"]),QS={axis:{desc:"axis",caption:DU},legend:{desc:"legend",caption:OU},"title-text":{desc:"title",caption:e=>`Title text '${e_(e)}'`},"title-subtitle":{desc:"subtitle",caption:e=>`Subtitle text '${e_(e)}'`}},ZS={ariaRole:wx,ariaRoleDescription:Ex,description:xx};function yD(e,t){const n=t.aria===!1;if(e(gD,n||void 0),n||t.description==null)for(const i in ZS)e(ZS[i],void 0);else{const i=t.mark.marktype;e(xx,t.description),e(wx,t.ariaRole||(i==="group"?pD:Sx)),e(Ex,t.ariaRoleDescription||`${i} mark`)}}function bD(e){return e.aria===!1?{[gD]:!0}:FU[e.role]?null:QS[e.role]?MU(e,QS[e.role]):TU(e)}function TU(e){const t=e.marktype,n=t==="group"||t==="text"||e.items.some(i=>i.description!=null&&i.aria!==!1);return mD(n?pD:Sx,`${t} mark container`,e.description)}function MU(e,t){try{const n=e.items[0],i=t.caption||(()=>"");return mD(t.role||Sx,t.desc,n.description||i(n))}catch{return null}}function e_(e){return X(e.text).join(" ")}function DU(e){const t=e.datum,n=e.orient,i=t.title?vD(e):null,r=e.context,o=r.scales[t.scale].value,s=r.dataflow.locale(),a=o.type;return`${n==="left"||n==="right"?"Y":"X"}-axis`+(i?` titled '${i}'`:"")+` for a ${tu(a)?"discrete":a} scale with ${DM(s,o,e)}`}function OU(e){const t=e.datum,n=t.title?vD(e):null,i=`${t.type||""} legend`.trim(),r=t.scales,o=Object.keys(r),s=e.context,a=s.scales[r[o[0]]].value,u=s.dataflow.locale();return NU(i)+(n?` titled '${n}'`:"")+` for ${RU(o)} with ${DM(u,a,e)}`}function vD(e){try{return X(Ee(e.items).items[0].text).join(" ")}catch{return null}}function RU(e){return e=e.map(t=>t+(t==="fill"||t==="stroke"?" color":"")),e.length<2?e[0]:e.slice(0,-1).join(", ")+" and "+Ee(e)}function NU(e){return e.length?e[0].toUpperCase()+e.slice(1):e}const xD=e=>(e+"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">"),LU=e=>xD(e).replace(/"/g,""").replace(/\t/g,"	").replace(/\n/g,"
").replace(/\r/g,"
");function _x(){let e="",t="",n="";const i=[],r=()=>t=n="",o=u=>{t&&(e+=`${t}>${n}`,r()),i.push(u)},s=(u,l)=>(l!=null&&(t+=` ${u}="${LU(l)}"`),a),a={open(u){o(u),t="<"+u;for(var l=arguments.length,c=new Array(l>1?l-1:0),f=1;f<l;f++)c[f-1]=arguments[f];for(const d of c)for(const h in d)s(h,d[h]);return a},close(){const u=i.pop();return t?e+=t+(n?`>${n}</${u}>`:"/>"):e+=`</${u}>`,r(),a},attr:s,text:u=>(n+=xD(u),a),toString:()=>e};return a}const wD=e=>ED(_x(),e)+"";function ED(e,t){if(e.open(t.tagName),t.hasAttributes()){const n=t.attributes,i=n.length;for(let r=0;r<i;++r)e.attr(n[r].name,n[r].value)}if(t.hasChildNodes()){const n=t.childNodes;for(const i of n)i.nodeType===3?e.text(i.nodeValue):ED(e,i)}return e.close()}const ah={fill:"fill",fillOpacity:"fill-opacity",stroke:"stroke",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",strokeCap:"stroke-linecap",strokeJoin:"stroke-linejoin",strokeDash:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeMiterLimit:"stroke-miterlimit",opacity:"opacity"},uh={blend:"mix-blend-mode"},SD={fill:"none","stroke-miterlimit":10},ul=0,t_="http://www.w3.org/2000/xmlns/",rt=hc.xmlns;class Ax extends Kc{constructor(t){super(t),this._dirtyID=0,this._dirty=[],this._svg=null,this._root=null,this._defs=null}initialize(t,n,i,r,o){return this._defs={},this._clearDefs(),t&&(this._svg=ot(t,0,"svg",rt),this._svg.setAttributeNS(t_,"xmlns",rt),this._svg.setAttributeNS(t_,"xmlns:xlink",hc["xmlns:xlink"]),this._svg.setAttribute("version",hc.version),this._svg.setAttribute("class","marks"),Wn(t,1),this._root=ot(this._svg,ul,"g",rt),mo(this._root,SD),Wn(this._svg,ul+1)),this.background(this._bgcolor),super.initialize(t,n,i,r,o)}background(t){return arguments.length&&this._svg&&this._svg.style.setProperty("background-color",t),super.background(...arguments)}resize(t,n,i,r){return super.resize(t,n,i,r),this._svg&&(mo(this._svg,{width:this._width*this._scale,height:this._height*this._scale,viewBox:`0 0 ${this._width} ${this._height}`}),this._root.setAttribute("transform",`translate(${this._origin})`)),this._dirty=[],this}canvas(){return this._svg}svg(){const t=this._svg,n=this._bgcolor;if(!t)return null;let i;n&&(t.removeAttribute("style"),i=ot(t,ul,"rect",rt),mo(i,{width:this._width,height:this._height,fill:n}));const r=wD(t);return n&&(t.removeChild(i),this._svg.style.setProperty("background-color",n)),r}_render(t,n){return this._dirtyCheck()&&(this._dirtyAll&&this._clearDefs(),this.mark(this._root,t,void 0,n),Wn(this._root,1)),this.defs(),this._dirty=[],++this._dirtyID,this}dirty(t){t.dirty!==this._dirtyID&&(t.dirty=this._dirtyID,this._dirty.push(t))}isDirty(t){return this._dirtyAll||!t._svg||!t._svg.ownerSVGElement||t.dirty===this._dirtyID}_dirtyCheck(){this._dirtyAll=!0;const t=this._dirty;if(!t.length||!this._dirtyID)return!0;const n=++this._dirtyID;let i,r,o,s,a,u,l;for(a=0,u=t.length;a<u;++a)if(i=t[a],r=i.mark,r.marktype!==o&&(o=r.marktype,s=Bn[o]),r.zdirty&&r.dirty!==n&&(this._dirtyAll=!1,n_(i,n),r.items.forEach(c=>{c.dirty=n})),!r.zdirty){if(i.exit){s.nested&&r.items.length?(l=r.items[0],l._svg&&this._update(s,l._svg,l)):i._svg&&(l=i._svg.parentNode,l&&l.removeChild(i._svg)),i._svg=null;continue}i=s.nested?r.items[0]:i,i._update!==n&&(!i._svg||!i._svg.ownerSVGElement?(this._dirtyAll=!1,n_(i,n)):this._update(s,i._svg,i),i._update=n)}return!this._dirtyAll}mark(t,n,i,r){if(!this.isDirty(n))return n._svg;const o=this._svg,s=n.marktype,a=Bn[s],u=n.interactive===!1?"none":null,l=a.tag==="g",c=i_(n,t,i,"g",o);if(s!=="group"&&r!=null&&!r.includes(s))return Wn(c,0),n._svg;c.setAttribute("class",sD(n));const f=bD(n);for(const p in f)Jt(c,p,f[p]);l||Jt(c,"pointer-events",u),Jt(c,"clip-path",n.clip?nx(this,n,n.group):null);let d=null,h=0;const g=p=>{const m=this.isDirty(p),y=i_(p,c,d,a.tag,o);m&&(this._update(a,y,p),l&&zU(this,y,p,r)),d=y,++h};return a.nested?n.items.length&&g(n.items[0]):Ei(n,g),Wn(c,h),c}_update(t,n,i){Dr=n,It=n.__values__,yD(Gl,i),t.attr(Gl,i,this);const r=UU[t.type];r&&r.call(this,t,n,i),Dr&&this.style(Dr,i)}style(t,n){if(n!=null){for(const i in ah){let r=i==="font"?Xc(n):n[i];if(r===It[i])continue;const o=ah[i];r==null?t.removeAttribute(o):(Zv(r)&&(r=RM(r,this._defs.gradient,_D())),t.setAttribute(o,r+"")),It[i]=r}for(const i in uh)xd(t,uh[i],n[i])}}defs(){const t=this._svg,n=this._defs;let i=n.el,r=0;for(const o in n.gradient)i||(n.el=i=ot(t,ul+1,"defs",rt)),r=PU(i,n.gradient[o],r);for(const o in n.clipping)i||(n.el=i=ot(t,ul+1,"defs",rt)),r=IU(i,n.clipping[o],r);i&&(r===0?(t.removeChild(i),n.el=null):Wn(i,r))}_clearDefs(){const t=this._defs;t.gradient={},t.clipping={}}}function n_(e,t){for(;e&&e.dirty!==t;e=e.mark.group)if(e.dirty=t,e.mark&&e.mark.dirty!==t)e.mark.dirty=t;else return}function PU(e,t,n){let i,r,o;if(t.gradient==="radial"){let s=ot(e,n++,"pattern",rt);mo(s,{id:Kd+t.id,viewBox:"0,0,1,1",width:"100%",height:"100%",preserveAspectRatio:"xMidYMid slice"}),s=ot(s,0,"rect",rt),mo(s,{width:1,height:1,fill:`url(${_D()}#${t.id})`}),e=ot(e,n++,"radialGradient",rt),mo(e,{id:t.id,fx:t.x1,fy:t.y1,fr:t.r1,cx:t.x2,cy:t.y2,r:t.r2})}else e=ot(e,n++,"linearGradient",rt),mo(e,{id:t.id,x1:t.x1,x2:t.x2,y1:t.y1,y2:t.y2});for(i=0,r=t.stops.length;i<r;++i)o=ot(e,i,"stop",rt),o.setAttribute("offset",t.stops[i].offset),o.setAttribute("stop-color",t.stops[i].color);return Wn(e,i),n}function IU(e,t,n){let i;return e=ot(e,n,"clipPath",rt),e.setAttribute("id",t.id),t.path?(i=ot(e,0,"path",rt),i.setAttribute("d",t.path)):(i=ot(e,0,"rect",rt),mo(i,{x:0,y:0,width:t.width,height:t.height})),Wn(e,1),n+1}function zU(e,t,n,i){t=t.lastChild.previousSibling;let r,o=0;Ei(n,s=>{r=e.mark(t,s,r,i),++o}),Wn(t,1+o)}function i_(e,t,n,i,r){let o=e._svg,s;if(!o&&(s=t.ownerDocument,o=po(s,i,rt),e._svg=o,e.mark&&(o.__data__=e,o.__values__={fill:"default"},i==="g"))){const a=po(s,"path",rt);o.appendChild(a),a.__data__=e;const u=po(s,"g",rt);o.appendChild(u),u.__data__=e;const l=po(s,"path",rt);o.appendChild(l),l.__data__=e,l.__values__={fill:"default"}}return(o.ownerSVGElement!==r||BU(o,n))&&t.insertBefore(o,n?n.nextSibling:t.firstChild),o}function BU(e,t){return e.parentNode&&e.parentNode.childNodes.length>1&&e.previousSibling!=t}let Dr=null,It=null;const UU={group(e,t,n){const i=Dr=t.childNodes[2];It=i.__values__,e.foreground(Gl,n,this),It=t.__values__,Dr=t.childNodes[1],e.content(Gl,n,this);const r=Dr=t.childNodes[0];e.background(Gl,n,this);const o=n.mark.interactive===!1?"none":null;if(o!==It.events&&(Jt(i,"pointer-events",o),Jt(r,"pointer-events",o),It.events=o),n.strokeForeground&&n.stroke){const s=n.fill;Jt(i,"display",null),this.style(r,n),Jt(r,"stroke",null),s&&(n.fill=null),It=i.__values__,this.style(i,n),s&&(n.fill=s),Dr=null}else Jt(i,"display","none")},image(e,t,n){n.smooth===!1?(xd(t,"image-rendering","optimizeSpeed"),xd(t,"image-rendering","pixelated")):xd(t,"image-rendering",null)},text(e,t,n){const i=Yc(n);let r,o,s,a;P(i)?(o=i.map(u=>Oo(n,u)),r=o.join(`
|
7
|
+
`),r!==It.text&&(Wn(t,0),s=t.ownerDocument,a=Do(n),o.forEach((u,l)=>{const c=po(s,"tspan",rt);c.__data__=n,c.textContent=u,l&&(c.setAttribute("x",0),c.setAttribute("dy",a)),t.appendChild(c)}),It.text=r)):(o=Oo(n,i),o!==It.text&&(t.textContent=o,It.text=o)),Jt(t,"font-family",Xc(n)),Jt(t,"font-size",lr(n)+"px"),Jt(t,"font-style",n.fontStyle),Jt(t,"font-variant",n.fontVariant),Jt(t,"font-weight",n.fontWeight)}};function Gl(e,t,n){t!==It[e]&&(n?jU(Dr,e,t,n):Jt(Dr,e,t),It[e]=t)}function xd(e,t,n){n!==It[t]&&(n==null?e.style.removeProperty(t):e.style.setProperty(t,n+""),It[t]=n)}function mo(e,t){for(const n in t)Jt(e,n,t[n])}function Jt(e,t,n){n!=null?e.setAttribute(t,n):e.removeAttribute(t)}function jU(e,t,n,i){n!=null?e.setAttributeNS(i,t,n):e.removeAttributeNS(i,t)}function _D(){let e;return typeof window>"u"?"":(e=window.location).hash?e.href.slice(0,-e.hash.length):e.href}class AD extends Kc{constructor(t){super(t),this._text=null,this._defs={gradient:{},clipping:{}}}svg(){return this._text}_render(t){const n=_x();n.open("svg",he({},hc,{class:"marks",width:this._width*this._scale,height:this._height*this._scale,viewBox:`0 0 ${this._width} ${this._height}`}));const i=this._bgcolor;return i&&i!=="transparent"&&i!=="none"&&n.open("rect",{width:this._width,height:this._height,fill:i}).close(),n.open("g",SD,{transform:"translate("+this._origin+")"}),this.mark(n,t),n.close(),this.defs(n),this._text=n.close()+"",this}mark(t,n){const i=Bn[n.marktype],r=i.tag,o=[yD,i.attr];t.open("g",{class:sD(n),"clip-path":n.clip?nx(this,n,n.group):null},bD(n),{"pointer-events":r!=="g"&&n.interactive===!1?"none":null});const s=a=>{const u=this.href(a);if(u&&t.open("a",u),t.open(r,this.attr(n,a,o,r!=="g"?r:null)),r==="text"){const l=Yc(a);if(P(l)){const c={x:0,dy:Do(a)};for(let f=0;f<l.length;++f)t.open("tspan",f?c:null).text(Oo(a,l[f])).close()}else t.text(Oo(a,l))}else if(r==="g"){const l=a.strokeForeground,c=a.fill,f=a.stroke;l&&f&&(a.stroke=null),t.open("path",this.attr(n,a,i.background,"bgrect")).close(),t.open("g",this.attr(n,a,i.content)),Ei(a,d=>this.mark(t,d)),t.close(),l&&f?(c&&(a.fill=null),a.stroke=f,t.open("path",this.attr(n,a,i.foreground,"bgrect")).close(),c&&(a.fill=c)):t.open("path",this.attr(n,a,i.foreground,"bgfore")).close()}t.close(),u&&t.close()};return i.nested?n.items&&n.items.length&&s(n.items[0]):Ei(n,s),t.close()}href(t){const n=t.href;let i;if(n){if(i=this._hrefs&&this._hrefs[n])return i;this.sanitizeURL(n).then(r=>{r["xlink:href"]=r.href,r.href=null,(this._hrefs||(this._hrefs={}))[n]=r})}return null}attr(t,n,i,r){const o={},s=(a,u,l,c)=>{o[c||a]=u};return Array.isArray(i)?i.forEach(a=>a(s,n,this)):i(s,n,this),r&&qU(o,n,t,r,this._defs),o}defs(t){const n=this._defs.gradient,i=this._defs.clipping;if(Object.keys(n).length+Object.keys(i).length!==0){t.open("defs");for(const o in n){const s=n[o],a=s.stops;s.gradient==="radial"?(t.open("pattern",{id:Kd+o,viewBox:"0,0,1,1",width:"100%",height:"100%",preserveAspectRatio:"xMidYMid slice"}),t.open("rect",{width:"1",height:"1",fill:"url(#"+o+")"}).close(),t.close(),t.open("radialGradient",{id:o,fx:s.x1,fy:s.y1,fr:s.r1,cx:s.x2,cy:s.y2,r:s.r2})):t.open("linearGradient",{id:o,x1:s.x1,x2:s.x2,y1:s.y1,y2:s.y2});for(let u=0;u<a.length;++u)t.open("stop",{offset:a[u].offset,"stop-color":a[u].color}).close();t.close()}for(const o in i){const s=i[o];t.open("clipPath",{id:o}),s.path?t.open("path",{d:s.path}).close():t.open("rect",{x:0,y:0,width:s.width,height:s.height}).close(),t.close()}t.close()}}}function qU(e,t,n,i,r){let o;if(t==null||(i==="bgrect"&&n.interactive===!1&&(e["pointer-events"]="none"),i==="bgfore"&&(n.interactive===!1&&(e["pointer-events"]="none"),e.display="none",t.fill!==null)))return e;i==="image"&&t.smooth===!1&&(o=["image-rendering: optimizeSpeed;","image-rendering: pixelated;"]),i==="text"&&(e["font-family"]=Xc(t),e["font-size"]=lr(t)+"px",e["font-style"]=t.fontStyle,e["font-variant"]=t.fontVariant,e["font-weight"]=t.fontWeight);for(const s in ah){let a=t[s];const u=ah[s];a==="transparent"&&(u==="fill"||u==="stroke")||a!=null&&(Zv(a)&&(a=RM(a,r.gradient,"")),e[u]=a)}for(const s in uh){const a=t[s];a!=null&&(o=o||[],o.push(`${uh[s]}: ${a};`))}return o&&(e.style=o.join(" ")),e}const ci={svgMarkTypes:["text"],svgOnTop:!0,debug:!1};function WU(e){ci.svgMarkTypes=e.svgMarkTypes??["text"],ci.svgOnTop=e.svgOnTop??!0,ci.debug=e.debug??!1}class C1 extends Kc{constructor(t){super(t),this._svgRenderer=new Ax(t),this._canvasRenderer=new sh(t)}initialize(t,n,i,r,o){this._root_el=ot(t,0,"div");const s=ot(this._root_el,0,"div"),a=ot(this._root_el,1,"div");return this._root_el.style.position="relative",ci.debug||(s.style.height="100%",a.style.position="absolute",a.style.top="0",a.style.left="0",a.style.height="100%",a.style.width="100%"),this._svgEl=ci.svgOnTop?a:s,this._canvasEl=ci.svgOnTop?s:a,this._svgEl.style.pointerEvents="none",this._canvasRenderer.initialize(this._canvasEl,n,i,r,o),this._svgRenderer.initialize(this._svgEl,n,i,r,o),super.initialize(t,n,i,r,o)}dirty(t){return ci.svgMarkTypes.includes(t.mark.marktype)?this._svgRenderer.dirty(t):this._canvasRenderer.dirty(t),this}_render(t,n){const r=(n??["arc","area","image","line","path","rect","rule","shape","symbol","text","trail"]).filter(o=>!ci.svgMarkTypes.includes(o));this._svgRenderer.render(t,ci.svgMarkTypes),this._canvasRenderer.render(t,r)}resize(t,n,i,r){return super.resize(t,n,i,r),this._svgRenderer.resize(t,n,i,r),this._canvasRenderer.resize(t,n,i,r),this}background(t){return ci.svgOnTop?this._canvasRenderer.background(t):this._svgRenderer.background(t),this}}class $D extends Jc{constructor(t,n){super(t,n)}initialize(t,n,i){const r=ot(ot(t,0,"div"),ci.svgOnTop?0:1,"div");return super.initialize(r,n,i)}}const kD="canvas",CD="hybrid",FD="png",TD="svg",MD="none",yo={Canvas:kD,PNG:FD,SVG:TD,Hybrid:CD,None:MD},Ls={};Ls[kD]=Ls[FD]={renderer:sh,headless:sh,handler:Jc};Ls[TD]={renderer:Ax,headless:AD,handler:hD};Ls[CD]={renderer:C1,headless:C1,handler:$D};Ls[MD]={};function Qg(e,t){return e=String(e||"").toLowerCase(),arguments.length>1?(Ls[e]=t,this):Ls[e]}function DD(e,t,n){const i=[],r=new it().union(t),o=e.marktype;return o?OD(e,r,n,i):o==="group"?RD(e,r,n,i):N("Intersect scene must be mark node or group item.")}function OD(e,t,n,i){if(HU(e,t,n)){const r=e.items,o=e.marktype,s=r.length;let a=0;if(o==="group")for(;a<s;++a)RD(r[a],t,n,i);else for(const u=Bn[o].isect;a<s;++a){const l=r[a];ND(l,t,u)&&i.push(l)}}return i}function HU(e,t,n){return e.bounds&&t.intersects(e.bounds)&&(e.marktype==="group"||e.interactive!==!1&&(!n||n(e)))}function RD(e,t,n,i){n&&n(e.mark)&&ND(e,t,Bn.group.isect)&&i.push(e);const r=e.items,o=r&&r.length;if(o){const s=e.x||0,a=e.y||0;t.translate(-s,-a);for(let u=0;u<o;++u)OD(r[u],t,n,i);t.translate(s,a)}return i}function ND(e,t,n){const i=e.bounds;return t.encloses(i)||t.intersects(i)&&n(e,t)}const Pm=new it;function LD(e){const t=e.clip;if(ge(t))t(Gc(Pm.clear()));else if(t)Pm.set(0,0,e.group.width,e.group.height);else return;e.bounds.intersect(Pm)}const GU=1e-9;function $x(e,t,n){return e===t?!0:n==="path"?PD(e,t):e instanceof Date&&t instanceof Date?+e==+t:Ae(e)&&Ae(t)?Math.abs(e-t)<=GU:!e||!t||!Y(e)&&!Y(t)?e==t:VU(e,t)}function PD(e,t){return $x(nu(e),nu(t))}function VU(e,t){var n=Object.keys(e),i=Object.keys(t),r,o;if(n.length!==i.length)return!1;for(n.sort(),i.sort(),o=n.length-1;o>=0;o--)if(n[o]!=i[o])return!1;for(o=n.length-1;o>=0;o--)if(r=n[o],!$x(e[r],t[r],r))return!1;return typeof e==typeof t}function YU(){UM(),b7()}const ou="top",hi="left",gi="right",Ro="bottom",XU="top-left",KU="top-right",JU="bottom-left",QU="bottom-right",kx="start",F1="middle",Qt="end",ZU="x",ej="y",Zg="group",Cx="axis",Fx="title",tj="frame",nj="scope",Tx="legend",ID="row-header",zD="row-footer",BD="row-title",UD="column-header",jD="column-footer",qD="column-title",ij="padding",rj="symbol",WD="fit",HD="fit-x",GD="fit-y",oj="pad",Mx="none",Mf="all",T1="each",Dx="flush",bo="column",vo="row";function VD(e){D.call(this,null,e)}G(VD,D,{transform(e,t){const n=t.dataflow,i=e.mark,r=i.marktype,o=Bn[r],s=o.bound;let a=i.bounds,u;if(o.nested)i.items.length&&n.dirty(i.items[0]),a=Df(i,s),i.items.forEach(l=>{l.bounds.clear().union(a)});else if(r===Zg||e.modified())switch(t.visit(t.MOD,l=>n.dirty(l)),a.clear(),i.items.forEach(l=>a.union(Df(l,s))),i.role){case Cx:case Tx:case Fx:t.reflow()}else u=t.changed(t.REM),t.visit(t.ADD,l=>{a.union(Df(l,s))}),t.visit(t.MOD,l=>{u=u||a.alignsWith(l.bounds),n.dirty(l),a.union(Df(l,s))}),u&&(a.clear(),i.items.forEach(l=>a.union(l.bounds)));return LD(i),t.modifies("bounds")}});function Df(e,t,n){return t(e.bounds.clear(),e,n)}const r_=":vega_identifier:";function Ox(e){D.call(this,0,e)}Ox.Definition={type:"Identifier",metadata:{modifies:!0},params:[{name:"as",type:"string",required:!0}]};G(Ox,D,{transform(e,t){const n=sj(t.dataflow),i=e.as;let r=n.value;return t.visit(t.ADD,o=>o[i]=o[i]||++r),n.set(this.value=r),t}});function sj(e){return e._signals[r_]||(e._signals[r_]=e.add(0))}function YD(e){D.call(this,null,e)}G(YD,D,{transform(e,t){let n=this.value;n||(n=t.dataflow.scenegraph().mark(e.markdef,aj(e),e.index),n.group.context=e.context,e.context.group||(e.context.group=n.group),n.source=this.source,n.clip=e.clip,n.interactive=e.interactive,this.value=n);const i=n.marktype===Zg?Wg:qg;return t.visit(t.ADD,r=>i.call(r,n)),(e.modified("clip")||e.modified("interactive"))&&(n.clip=e.clip,n.interactive=!!e.interactive,n.zdirty=!0,t.reflow()),n.items=t.source,t}});function aj(e){const t=e.groups,n=e.parent;return t&&t.size===1?t.get(Object.keys(t.object)[0]):t&&n?t.lookup(n):null}function XD(e){D.call(this,null,e)}const o_={parity:e=>e.filter((t,n)=>n%2?t.opacity=0:1),greedy:(e,t)=>{let n;return e.filter((i,r)=>!r||!KD(n.bounds,i.bounds,t)?(n=i,1):i.opacity=0)}},KD=(e,t,n)=>n>Math.max(t.x1-e.x2,e.x1-t.x2,t.y1-e.y2,e.y1-t.y2),s_=(e,t)=>{for(var n=1,i=e.length,r=e[0].bounds,o;n<i;r=o,++n)if(KD(r,o=e[n].bounds,t))return!0},uj=e=>{const t=e.bounds;return t.width()>1&&t.height()>1},lj=(e,t,n)=>{var i=e.range(),r=new it;return t===ou||t===Ro?r.set(i[0],-1/0,i[1],1/0):r.set(-1/0,i[0],1/0,i[1]),r.expand(n||1),o=>r.encloses(o.bounds)},a_=e=>(e.forEach(t=>t.opacity=1),e),u_=(e,t)=>e.reflow(t.modified()).modifies("opacity");G(XD,D,{transform(e,t){const n=o_[e.method]||o_.parity,i=e.separation||0;let r=t.materialize(t.SOURCE).source,o,s;if(!r||!r.length)return;if(!e.method)return e.modified("method")&&(a_(r),t=u_(t,e)),t;if(r=r.filter(uj),!r.length)return;if(e.sort&&(r=r.slice().sort(e.sort)),o=a_(r),t=u_(t,e),o.length>=3&&s_(o,i)){do o=n(o,i);while(o.length>=3&&s_(o,i));o.length<3&&!Ee(r).opacity&&(o.length>1&&(Ee(o).opacity=0),Ee(r).opacity=1)}e.boundScale&&e.boundTolerance>=0&&(s=lj(e.boundScale,e.boundOrient,+e.boundTolerance),r.forEach(u=>{s(u)||(u.opacity=0)}));const a=o[0].mark.bounds.clear();return r.forEach(u=>{u.opacity&&a.union(u.bounds)}),t}});function JD(e){D.call(this,null,e)}G(JD,D,{transform(e,t){const n=t.dataflow;if(t.visit(t.ALL,i=>n.dirty(i)),t.fields&&t.fields.zindex){const i=t.source&&t.source[0];i&&(i.mark.zdirty=!0)}}});const Pt=new it;function Da(e,t,n){return e[t]===n?0:(e[t]=n,1)}function cj(e){var t=e.items[0].orient;return t===hi||t===gi}function fj(e){let t=+e.grid;return[e.ticks?t++:-1,e.labels?t++:-1,t+ +e.domain]}function dj(e,t,n,i){var r=t.items[0],o=r.datum,s=r.translate!=null?r.translate:.5,a=r.orient,u=fj(o),l=r.range,c=r.offset,f=r.position,d=r.minExtent,h=r.maxExtent,g=o.title&&r.items[u[2]].items[0],p=r.titlePadding,m=r.bounds,y=g&&px(g),b=0,v=0,x,E;switch(Pt.clear().union(m),m.clear(),(x=u[0])>-1&&m.union(r.items[x].bounds),(x=u[1])>-1&&m.union(r.items[x].bounds),a){case ou:b=f||0,v=-c,E=Math.max(d,Math.min(h,-m.y1)),m.add(0,-E).add(l,0),g&&Of(e,g,E,p,y,0,-1,m);break;case hi:b=-c,v=f||0,E=Math.max(d,Math.min(h,-m.x1)),m.add(-E,0).add(0,l),g&&Of(e,g,E,p,y,1,-1,m);break;case gi:b=n+c,v=f||0,E=Math.max(d,Math.min(h,m.x2)),m.add(0,0).add(E,l),g&&Of(e,g,E,p,y,1,1,m);break;case Ro:b=f||0,v=i+c,E=Math.max(d,Math.min(h,m.y2)),m.add(0,0).add(l,E),g&&Of(e,g,E,p,0,0,1,m);break;default:b=r.x,v=r.y}return Gr(m.translate(b,v),r),Da(r,"x",b+s)|Da(r,"y",v+s)&&(r.bounds=Pt,e.dirty(r),r.bounds=m,e.dirty(r)),r.mark.bounds.clear().union(m)}function Of(e,t,n,i,r,o,s,a){const u=t.bounds;if(t.auto){const l=s*(n+r+i);let c=0,f=0;e.dirty(t),o?c=(t.x||0)-(t.x=l):f=(t.y||0)-(t.y=l),t.mark.bounds.clear().union(u.translate(-c,-f)),e.dirty(t)}a.union(u)}const l_=(e,t)=>Math.floor(Math.min(e,t)),c_=(e,t)=>Math.ceil(Math.max(e,t));function hj(e){var t=e.items,n=t.length,i=0,r,o;const s={marks:[],rowheaders:[],rowfooters:[],colheaders:[],colfooters:[],rowtitle:null,coltitle:null};for(;i<n;++i)if(r=t[i],o=r.items,r.marktype===Zg)switch(r.role){case Cx:case Tx:case Fx:break;case ID:s.rowheaders.push(...o);break;case zD:s.rowfooters.push(...o);break;case UD:s.colheaders.push(...o);break;case jD:s.colfooters.push(...o);break;case BD:s.rowtitle=o[0];break;case qD:s.coltitle=o[0];break;default:s.marks.push(...o)}return s}function gj(e){return new it().set(0,0,e.width||0,e.height||0)}function pj(e){const t=e.bounds.clone();return t.empty()?t.set(0,0,0,0):t.translate(-(e.x||0),-(e.y||0))}function je(e,t,n){const i=Y(e)?e[t]:e;return i??(n!==void 0?n:0)}function f_(e){return e<0?Math.ceil(-e):0}function QD(e,t,n){var i=!n.nodirty,r=n.bounds===Dx?gj:pj,o=Pt.set(0,0,0,0),s=je(n.align,bo),a=je(n.align,vo),u=je(n.padding,bo),l=je(n.padding,vo),c=n.columns||t.length,f=c<=0?1:Math.ceil(t.length/c),d=t.length,h=Array(d),g=Array(c),p=0,m=Array(d),y=Array(f),b=0,v=Array(d),x=Array(d),E=Array(d),S,w,_,A,k,C,O,M,F,$,T;for(w=0;w<c;++w)g[w]=0;for(w=0;w<f;++w)y[w]=0;for(w=0;w<d;++w)C=t[w],k=E[w]=r(C),C.x=C.x||0,v[w]=0,C.y=C.y||0,x[w]=0,_=w%c,A=~~(w/c),p=Math.max(p,O=Math.ceil(k.x2)),b=Math.max(b,M=Math.ceil(k.y2)),g[_]=Math.max(g[_],O),y[A]=Math.max(y[A],M),h[w]=u+f_(k.x1),m[w]=l+f_(k.y1),i&&e.dirty(t[w]);for(w=0;w<d;++w)w%c===0&&(h[w]=0),w<c&&(m[w]=0);if(s===T1)for(_=1;_<c;++_){for(T=0,w=_;w<d;w+=c)T<h[w]&&(T=h[w]);for(w=_;w<d;w+=c)h[w]=T+g[_-1]}else if(s===Mf){for(T=0,w=0;w<d;++w)w%c&&T<h[w]&&(T=h[w]);for(w=0;w<d;++w)w%c&&(h[w]=T+p)}else for(s=!1,_=1;_<c;++_)for(w=_;w<d;w+=c)h[w]+=g[_-1];if(a===T1)for(A=1;A<f;++A){for(T=0,w=A*c,S=w+c;w<S;++w)T<m[w]&&(T=m[w]);for(w=A*c;w<S;++w)m[w]=T+y[A-1]}else if(a===Mf){for(T=0,w=c;w<d;++w)T<m[w]&&(T=m[w]);for(w=c;w<d;++w)m[w]=T+b}else for(a=!1,A=1;A<f;++A)for(w=A*c,S=w+c;w<S;++w)m[w]+=y[A-1];for(F=0,w=0;w<d;++w)F=h[w]+(w%c?F:0),v[w]+=F-t[w].x;for(_=0;_<c;++_)for($=0,w=_;w<d;w+=c)$+=m[w],x[w]+=$-t[w].y;if(s&&je(n.center,bo)&&f>1)for(w=0;w<d;++w)k=s===Mf?p:g[w%c],F=k-E[w].x2-t[w].x-v[w],F>0&&(v[w]+=F/2);if(a&&je(n.center,vo)&&c!==1)for(w=0;w<d;++w)k=a===Mf?b:y[~~(w/c)],$=k-E[w].y2-t[w].y-x[w],$>0&&(x[w]+=$/2);for(w=0;w<d;++w)o.union(E[w].translate(v[w],x[w]));switch(F=je(n.anchor,ZU),$=je(n.anchor,ej),je(n.anchor,bo)){case Qt:F-=o.width();break;case F1:F-=o.width()/2}switch(je(n.anchor,vo)){case Qt:$-=o.height();break;case F1:$-=o.height()/2}for(F=Math.round(F),$=Math.round($),o.clear(),w=0;w<d;++w)t[w].mark.bounds.clear();for(w=0;w<d;++w)C=t[w],C.x+=v[w]+=F,C.y+=x[w]+=$,o.union(C.mark.bounds.union(C.bounds.translate(v[w],x[w]))),i&&e.dirty(C);return o}function mj(e,t,n){var i=hj(t),r=i.marks,o=n.bounds===Dx?yj:bj,s=n.offset,a=n.columns||r.length,u=a<=0?1:Math.ceil(r.length/a),l=u*a,c,f,d,h,g,p,m;const y=QD(e,r,n);y.empty()&&y.set(0,0,0,0),i.rowheaders&&(p=je(n.headerBand,vo,null),c=Rf(e,i.rowheaders,r,a,u,-je(s,"rowHeader"),l_,0,o,"x1",0,a,1,p)),i.colheaders&&(p=je(n.headerBand,bo,null),f=Rf(e,i.colheaders,r,a,a,-je(s,"columnHeader"),l_,1,o,"y1",0,1,a,p)),i.rowfooters&&(p=je(n.footerBand,vo,null),d=Rf(e,i.rowfooters,r,a,u,je(s,"rowFooter"),c_,0,o,"x2",a-1,a,1,p)),i.colfooters&&(p=je(n.footerBand,bo,null),h=Rf(e,i.colfooters,r,a,a,je(s,"columnFooter"),c_,1,o,"y2",l-a,1,a,p)),i.rowtitle&&(g=je(n.titleAnchor,vo),m=je(s,"rowTitle"),m=g===Qt?d+m:c-m,p=je(n.titleBand,vo,.5),d_(e,i.rowtitle,m,0,y,p)),i.coltitle&&(g=je(n.titleAnchor,bo),m=je(s,"columnTitle"),m=g===Qt?h+m:f-m,p=je(n.titleBand,bo,.5),d_(e,i.coltitle,m,1,y,p))}function yj(e,t){return t==="x1"?e.x||0:t==="y1"?e.y||0:t==="x2"?(e.x||0)+(e.width||0):t==="y2"?(e.y||0)+(e.height||0):void 0}function bj(e,t){return e.bounds[t]}function Rf(e,t,n,i,r,o,s,a,u,l,c,f,d,h){var g=n.length,p=0,m=0,y,b,v,x,E,S,w,_,A;if(!g)return p;for(y=c;y<g;y+=f)n[y]&&(p=s(p,u(n[y],l)));if(!t.length)return p;for(t.length>r&&(e.warn("Grid headers exceed limit: "+r),t=t.slice(0,r)),p+=o,b=0,x=t.length;b<x;++b)e.dirty(t[b]),t[b].mark.bounds.clear();for(y=c,b=0,x=t.length;b<x;++b,y+=f){for(S=t[b],E=S.mark.bounds,v=y;v>=0&&(w=n[v])==null;v-=d);a?(_=h==null?w.x:Math.round(w.bounds.x1+h*w.bounds.width()),A=p):(_=p,A=h==null?w.y:Math.round(w.bounds.y1+h*w.bounds.height())),E.union(S.bounds.translate(_-(S.x||0),A-(S.y||0))),S.x=_,S.y=A,e.dirty(S),m=s(m,E[l])}return m}function d_(e,t,n,i,r,o){if(t){e.dirty(t);var s=n,a=n;i?s=Math.round(r.x1+o*r.width()):a=Math.round(r.y1+o*r.height()),t.bounds.translate(s-(t.x||0),a-(t.y||0)),t.mark.bounds.clear().union(t.bounds),t.x=s,t.y=a,e.dirty(t)}}function vj(e,t){const n=e[t]||{};return(i,r)=>n[i]!=null?n[i]:e[i]!=null?e[i]:r}function xj(e,t){let n=-1/0;return e.forEach(i=>{i.offset!=null&&(n=Math.max(n,i.offset))}),n>-1/0?n:t}function wj(e,t,n,i,r,o,s){const a=vj(n,t),u=xj(e,a("offset",0)),l=a("anchor",kx),c=l===Qt?1:l===F1?.5:0,f={align:T1,bounds:a("bounds",Dx),columns:a("direction")==="vertical"?1:e.length,padding:a("margin",8),center:a("center"),nodirty:!0};switch(t){case hi:f.anchor={x:Math.floor(i.x1)-u,column:Qt,y:c*(s||i.height()+2*i.y1),row:l};break;case gi:f.anchor={x:Math.ceil(i.x2)+u,y:c*(s||i.height()+2*i.y1),row:l};break;case ou:f.anchor={y:Math.floor(r.y1)-u,row:Qt,x:c*(o||r.width()+2*r.x1),column:l};break;case Ro:f.anchor={y:Math.ceil(r.y2)+u,x:c*(o||r.width()+2*r.x1),column:l};break;case XU:f.anchor={x:u,y:u};break;case KU:f.anchor={x:o-u,y:u,column:Qt};break;case JU:f.anchor={x:u,y:s-u,row:Qt};break;case QU:f.anchor={x:o-u,y:s-u,column:Qt,row:Qt};break}return f}function Ej(e,t){var n=t.items[0],i=n.datum,r=n.orient,o=n.bounds,s=n.x,a=n.y,u,l;return n._bounds?n._bounds.clear().union(o):n._bounds=o.clone(),o.clear(),_j(e,n,n.items[0].items[0]),o=Sj(n,o),u=2*n.padding,l=2*n.padding,o.empty()||(u=Math.ceil(o.width()+u),l=Math.ceil(o.height()+l)),i.type===rj&&Aj(n.items[0].items[0].items[0].items),r!==Mx&&(n.x=s=0,n.y=a=0),n.width=u,n.height=l,Gr(o.set(s,a,s+u,a+l),n),n.mark.bounds.clear().union(o),n}function Sj(e,t){return e.items.forEach(n=>t.union(n.bounds)),t.x1=e.padding,t.y1=e.padding,t}function _j(e,t,n){var i=t.padding,r=i-n.x,o=i-n.y;if(!t.datum.title)(r||o)&&ll(e,n,r,o);else{var s=t.items[1].items[0],a=s.anchor,u=t.titlePadding||0,l=i-s.x,c=i-s.y;switch(s.orient){case hi:r+=Math.ceil(s.bounds.width())+u;break;case gi:case Ro:break;default:o+=s.bounds.height()+u}switch((r||o)&&ll(e,n,r,o),s.orient){case hi:c+=va(t,n,s,a,1,1);break;case gi:l+=va(t,n,s,Qt,0,0)+u,c+=va(t,n,s,a,1,1);break;case Ro:l+=va(t,n,s,a,0,0),c+=va(t,n,s,Qt,-1,0,1)+u;break;default:l+=va(t,n,s,a,0,0)}(l||c)&&ll(e,s,l,c),(l=Math.round(s.bounds.x1-i))<0&&(ll(e,n,-l,0),ll(e,s,-l,0))}}function va(e,t,n,i,r,o,s){const a=e.datum.type!=="symbol",u=n.datum.vgrad,l=a&&(o||!u)&&!s?t.items[0]:t,c=l.bounds[r?"y2":"x2"]-e.padding,f=u&&o?c:0,d=u&&o?0:c,h=r<=0?0:px(n);return Math.round(i===kx?f:i===Qt?d-h:.5*(c-h))}function ll(e,t,n,i){t.x+=n,t.y+=i,t.bounds.translate(n,i),t.mark.bounds.translate(n,i),e.dirty(t)}function Aj(e){const t=e.reduce((n,i)=>(n[i.column]=Math.max(i.bounds.x2-i.x,n[i.column]||0),n),{});e.forEach(n=>{n.width=t[n.column],n.height=n.bounds.y2-n.y})}function $j(e,t,n,i,r){var o=t.items[0],s=o.frame,a=o.orient,u=o.anchor,l=o.offset,c=o.padding,f=o.items[0].items[0],d=o.items[1]&&o.items[1].items[0],h=a===hi||a===gi?i:n,g=0,p=0,m=0,y=0,b=0,v;if(s!==Zg?a===hi?(g=r.y2,h=r.y1):a===gi?(g=r.y1,h=r.y2):(g=r.x1,h=r.x2):a===hi&&(g=i,h=0),v=u===kx?g:u===Qt?h:(g+h)/2,d&&d.text){switch(a){case ou:case Ro:b=f.bounds.height()+c;break;case hi:y=f.bounds.width()+c;break;case gi:y=-f.bounds.width()-c;break}Pt.clear().union(d.bounds),Pt.translate(y-(d.x||0),b-(d.y||0)),Da(d,"x",y)|Da(d,"y",b)&&(e.dirty(d),d.bounds.clear().union(Pt),d.mark.bounds.clear().union(Pt),e.dirty(d)),Pt.clear().union(d.bounds)}else Pt.clear();switch(Pt.union(f.bounds),a){case ou:p=v,m=r.y1-Pt.height()-l;break;case hi:p=r.x1-Pt.width()-l,m=v;break;case gi:p=r.x2+Pt.width()+l,m=v;break;case Ro:p=v,m=r.y2+l;break;default:p=o.x,m=o.y}return Da(o,"x",p)|Da(o,"y",m)&&(Pt.translate(p,m),e.dirty(o),o.bounds.clear().union(Pt),t.bounds.clear().union(Pt),e.dirty(o)),o.bounds}function ZD(e){D.call(this,null,e)}G(ZD,D,{transform(e,t){const n=t.dataflow;return e.mark.items.forEach(i=>{e.layout&&mj(n,i,e.layout),Cj(n,i,e)}),kj(e.mark.group)?t.reflow():t}});function kj(e){return e&&e.mark.role!=="legend-entry"}function Cj(e,t,n){var i=t.items,r=Math.max(0,t.width||0),o=Math.max(0,t.height||0),s=new it().set(0,0,r,o),a=s.clone(),u=s.clone(),l=[],c,f,d,h,g,p;for(g=0,p=i.length;g<p;++g)switch(f=i[g],f.role){case Cx:h=cj(f)?a:u,h.union(dj(e,f,r,o));break;case Fx:c=f;break;case Tx:l.push(Ej(e,f));break;case tj:case nj:case ID:case zD:case BD:case UD:case jD:case qD:a.union(f.bounds),u.union(f.bounds);break;default:s.union(f.bounds)}if(l.length){const m={};l.forEach(y=>{d=y.orient||gi,d!==Mx&&(m[d]||(m[d]=[])).push(y)});for(const y in m){const b=m[y];QD(e,b,wj(b,y,n.legends,a,u,r,o))}l.forEach(y=>{const b=y.bounds;if(b.equals(y._bounds)||(y.bounds=y._bounds,e.dirty(y),y.bounds=b,e.dirty(y)),n.autosize&&(n.autosize.type===WD||n.autosize.type===HD||n.autosize.type===GD))switch(y.orient){case hi:case gi:s.add(b.x1,0).add(b.x2,0);break;case ou:case Ro:s.add(0,b.y1).add(0,b.y2)}else s.union(b)})}s.union(a).union(u),c&&s.union($j(e,c,r,o,s)),t.clip&&s.set(0,0,t.width||0,t.height||0),Fj(e,t,s,n)}function Fj(e,t,n,i){const r=i.autosize||{},o=r.type;if(e._autosize<1||!o)return;let s=e._width,a=e._height,u=Math.max(0,t.width||0),l=Math.max(0,Math.ceil(-n.x1)),c=Math.max(0,t.height||0),f=Math.max(0,Math.ceil(-n.y1));const d=Math.max(0,Math.ceil(n.x2-u)),h=Math.max(0,Math.ceil(n.y2-c));if(r.contains===ij){const g=e.padding();s-=g.left+g.right,a-=g.top+g.bottom}o===Mx?(l=0,f=0,u=s,c=a):o===WD?(u=Math.max(0,s-l-d),c=Math.max(0,a-f-h)):o===HD?(u=Math.max(0,s-l-d),a=c+f+h):o===GD?(s=u+l+d,c=Math.max(0,a-f-h)):o===oj&&(s=u+l+d,a=c+f+h),e._resizeView(s,a,u,c,[l,f],r.resize)}const Tj=Object.freeze(Object.defineProperty({__proto__:null,bound:VD,identifier:Ox,mark:YD,overlap:XD,render:JD,viewlayout:ZD},Symbol.toStringTag,{value:"Module"}));function eO(e){D.call(this,null,e)}G(eO,D,{transform(e,t){if(this.value&&!e.modified())return t.StopPropagation;var n=t.dataflow.locale(),i=t.fork(t.NO_SOURCE|t.NO_FIELDS),r=this.value,o=e.scale,s=e.count==null?e.values?e.values.length:10:e.count,a=Jv(o,s,e.minstep),u=e.format||kM(n,o,a,e.formatSpecifier,e.formatType,!!e.values),l=e.values?$M(o,e.values,a):Qv(o,a);return r&&(i.rem=r),r=l.map((c,f)=>Ce({index:f/(l.length-1||1),value:c,label:u(c)})),e.extra&&r.length&&r.push(Ce({index:-1,extra:{value:r[0].value},label:""})),i.source=r,i.add=r,this.value=r,i}});function tO(e){D.call(this,null,e)}function Mj(){return Ce({})}function Dj(e){const t=Tu().test(n=>n.exit);return t.lookup=n=>t.get(e(n)),t}G(tO,D,{transform(e,t){var n=t.dataflow,i=t.fork(t.NO_SOURCE|t.NO_FIELDS),r=e.item||Mj,o=e.key||ie,s=this.value;return P(i.encode)&&(i.encode=null),s&&(e.modified("key")||t.modified(o))&&N("DataJoin does not support modified key function or fields."),s||(t=t.addAll(),this.value=s=Dj(o)),t.visit(t.ADD,a=>{const u=o(a);let l=s.get(u);l?l.exit?(s.empty--,i.add.push(l)):i.mod.push(l):(l=r(a),s.set(u,l),i.add.push(l)),l.datum=a,l.exit=!1}),t.visit(t.MOD,a=>{const u=o(a),l=s.get(u);l&&(l.datum=a,i.mod.push(l))}),t.visit(t.REM,a=>{const u=o(a),l=s.get(u);a===l.datum&&!l.exit&&(i.rem.push(l),l.exit=!0,++s.empty)}),t.changed(t.ADD_MOD)&&i.modifies("datum"),(t.clean()||e.clean&&s.empty>n.cleanThreshold)&&n.runAfter(s.clean),i}});function nO(e){D.call(this,null,e)}G(nO,D,{transform(e,t){var n=t.fork(t.ADD_REM),i=e.mod||!1,r=e.encoders,o=t.encode;if(P(o))if(n.changed()||o.every(f=>r[f]))o=o[0],n.encode=null;else return t.StopPropagation;var s=o==="enter",a=r.update||io,u=r.enter||io,l=r.exit||io,c=(o&&!s?r[o]:a)||io;if(t.changed(t.ADD)&&(t.visit(t.ADD,f=>{u(f,e),a(f,e)}),n.modifies(u.output),n.modifies(a.output),c!==io&&c!==a&&(t.visit(t.ADD,f=>{c(f,e)}),n.modifies(c.output))),t.changed(t.REM)&&l!==io&&(t.visit(t.REM,f=>{l(f,e)}),n.modifies(l.output)),s||c!==io){const f=t.MOD|(e.modified()?t.REFLOW:0);s?(t.visit(f,d=>{const h=u(d,e)||i;(c(d,e)||h)&&n.mod.push(d)}),n.mod.length&&n.modifies(u.output)):t.visit(f,d=>{(c(d,e)||i)&&n.mod.push(d)}),n.mod.length&&n.modifies(c.output)}return n.changed()?n:t.StopPropagation}});function iO(e){D.call(this,[],e)}G(iO,D,{transform(e,t){if(this.value!=null&&!e.modified())return t.StopPropagation;var n=t.dataflow.locale(),i=t.fork(t.NO_SOURCE|t.NO_FIELDS),r=this.value,o=e.type||dd,s=e.scale,a=+e.limit,u=Jv(s,e.count==null?5:e.count,e.minstep),l=!!e.values||o===dd,c=e.format||MM(n,s,u,o,e.formatSpecifier,e.formatType,l),f=e.values||TM(s,u),d,h,g,p,m;return r&&(i.rem=r),o===dd?(a&&f.length>a?(t.dataflow.warn("Symbol legend count exceeds limit, filtering items."),r=f.slice(0,a-1),m=!0):r=f,ge(g=e.size)?(!e.values&&s(r[0])===0&&(r=r.slice(1)),p=r.reduce((y,b)=>Math.max(y,g(b,e)),0)):g=Yt(p=g||8),r=r.map((y,b)=>Ce({index:b,label:c(y,b,r),value:y,offset:p,size:g(y,e)})),m&&(m=f[r.length],r.push(Ce({index:r.length,label:`…${f.length-r.length} entries`,value:m,offset:p,size:g(m,e)})))):o===o7?(d=s.domain(),h=SM(s,d[0],Ee(d)),f.length<3&&!e.values&&d[0]!==Ee(d)&&(f=[d[0],Ee(d)]),r=f.map((y,b)=>Ce({index:b,label:c(y,b,f),value:y,perc:h(y)}))):(g=f.length-1,h=m7(s),r=f.map((y,b)=>Ce({index:b,label:c(y,b,f),value:y,perc:b?h(y):0,perc2:b===g?1:h(f[b+1])}))),i.source=r,i.add=r,this.value=r,i}});const Oj=e=>e.source.x,Rj=e=>e.source.y,Nj=e=>e.target.x,Lj=e=>e.target.y;function Rx(e){D.call(this,{},e)}Rx.Definition={type:"LinkPath",metadata:{modifies:!0},params:[{name:"sourceX",type:"field",default:"source.x"},{name:"sourceY",type:"field",default:"source.y"},{name:"targetX",type:"field",default:"target.x"},{name:"targetY",type:"field",default:"target.y"},{name:"orient",type:"enum",default:"vertical",values:["horizontal","vertical","radial"]},{name:"shape",type:"enum",default:"line",values:["line","arc","curve","diagonal","orthogonal"]},{name:"require",type:"signal"},{name:"as",type:"string",default:"path"}]};G(Rx,D,{transform(e,t){var n=e.sourceX||Oj,i=e.sourceY||Rj,r=e.targetX||Nj,o=e.targetY||Lj,s=e.as||"path",a=e.orient||"vertical",u=e.shape||"line",l=h_.get(u+"-"+a)||h_.get(u);return l||N("LinkPath unsupported type: "+e.shape+(e.orient?"-"+e.orient:"")),t.visit(t.SOURCE,c=>{c[s]=l(n(c),i(c),r(c),o(c))}),t.reflow(e.modified()).modifies(s)}});const rO=(e,t,n,i)=>"M"+e+","+t+"L"+n+","+i,Pj=(e,t,n,i)=>rO(t*Math.cos(e),t*Math.sin(e),i*Math.cos(n),i*Math.sin(n)),oO=(e,t,n,i)=>{var r=n-e,o=i-t,s=Math.hypot(r,o)/2,a=180*Math.atan2(o,r)/Math.PI;return"M"+e+","+t+"A"+s+","+s+" "+a+" 0 1 "+n+","+i},Ij=(e,t,n,i)=>oO(t*Math.cos(e),t*Math.sin(e),i*Math.cos(n),i*Math.sin(n)),sO=(e,t,n,i)=>{const r=n-e,o=i-t,s=.2*(r+o),a=.2*(o-r);return"M"+e+","+t+"C"+(e+s)+","+(t+a)+" "+(n+a)+","+(i-s)+" "+n+","+i},zj=(e,t,n,i)=>sO(t*Math.cos(e),t*Math.sin(e),i*Math.cos(n),i*Math.sin(n)),Bj=(e,t,n,i)=>"M"+e+","+t+"V"+i+"H"+n,Uj=(e,t,n,i)=>"M"+e+","+t+"H"+n+"V"+i,jj=(e,t,n,i)=>{const r=Math.cos(e),o=Math.sin(e),s=Math.cos(n),a=Math.sin(n),u=Math.abs(n-e)>Math.PI?n<=e:n>e;return"M"+t*r+","+t*o+"A"+t+","+t+" 0 0,"+(u?1:0)+" "+t*s+","+t*a+"L"+i*s+","+i*a},qj=(e,t,n,i)=>{const r=(e+n)/2;return"M"+e+","+t+"C"+r+","+t+" "+r+","+i+" "+n+","+i},Wj=(e,t,n,i)=>{const r=(t+i)/2;return"M"+e+","+t+"C"+e+","+r+" "+n+","+r+" "+n+","+i},Hj=(e,t,n,i)=>{const r=Math.cos(e),o=Math.sin(e),s=Math.cos(n),a=Math.sin(n),u=(t+i)/2;return"M"+t*r+","+t*o+"C"+u*r+","+u*o+" "+u*s+","+u*a+" "+i*s+","+i*a},h_=Tu({line:rO,"line-radial":Pj,arc:oO,"arc-radial":Ij,curve:sO,"curve-radial":zj,"orthogonal-horizontal":Bj,"orthogonal-vertical":Uj,"orthogonal-radial":jj,"diagonal-horizontal":qj,"diagonal-vertical":Wj,"diagonal-radial":Hj});function Nx(e){D.call(this,null,e)}Nx.Definition={type:"Pie",metadata:{modifies:!0},params:[{name:"field",type:"field"},{name:"startAngle",type:"number",default:0},{name:"endAngle",type:"number",default:6.283185307179586},{name:"sort",type:"boolean",default:!1},{name:"as",type:"string",array:!0,length:2,default:["startAngle","endAngle"]}]};G(Nx,D,{transform(e,t){var n=e.as||["startAngle","endAngle"],i=n[0],r=n[1],o=e.field||ku,s=e.startAngle||0,a=e.endAngle!=null?e.endAngle:2*Math.PI,u=t.source,l=u.map(o),c=l.length,f=s,d=(a-s)/qC(l),h=Mn(c),g,p,m;for(e.sort&&h.sort((y,b)=>l[y]-l[b]),g=0;g<c;++g)m=l[h[g]],p=u[h[g]],p[i]=f,p[r]=f+=m*d;return this.value=l,t.reflow(e.modified()).modifies(n)}});const Gj=5;function Vj(e){const t=e.type;return!e.bins&&(t===Za||t===zc||t===Bc)}function aO(e){return Yv(e)&&e!==Xi}const Yj=xi(["set","modified","clear","type","scheme","schemeExtent","schemeCount","domain","domainMin","domainMid","domainMax","domainRaw","domainImplicit","nice","zero","bins","range","rangeStep","round","reverse","interpolate","interpolateGamma"]);function uO(e){D.call(this,null,e),this.modified(!0)}G(uO,D,{transform(e,t){var n=t.dataflow,i=this.value,r=Xj(e);(!i||r!==i.type)&&(this.value=i=ke(r)());for(r in e)if(!Yj[r]){if(r==="padding"&&aO(i.type))continue;ge(i[r])?i[r](e[r]):n.warn("Unsupported scale property: "+r)}return tq(i,e,eq(i,e,Jj(i,e,n))),t.fork(t.NO_SOURCE|t.NO_FIELDS)}});function Xj(e){var t=e.type,n="",i;return t===Xi?Xi+"-"+Za:(Kj(e)&&(i=e.rawDomain?e.rawDomain.length:e.domain?e.domain.length+ +(e.domainMid!=null):0,n=i===2?Xi+"-":i===3?Lu+"-":""),(n+t||Za).toLowerCase())}function Kj(e){const t=e.type;return Yv(t)&&t!==Rs&&t!==Ns&&(e.scheme||e.range&&e.range.length&&e.range.every(K))}function Jj(e,t,n){const i=Qj(e,t.domainRaw,n);if(i>-1)return i;var r=t.domain,o=e.type,s=t.zero||t.zero===void 0&&Vj(e),a,u;if(!r)return 0;if((s||t.domainMin!=null||t.domainMax!=null||t.domainMid!=null)&&(a=(r=r.slice()).length-1||1,s&&(r[0]>0&&(r[0]=0),r[a]<0&&(r[a]=0)),t.domainMin!=null&&(r[0]=t.domainMin),t.domainMax!=null&&(r[a]=t.domainMax),t.domainMid!=null)){u=t.domainMid;const l=u>r[a]?a+1:u<r[0]?0:a;l!==a&&n.warn("Scale domainMid exceeds domain min or max.",u),r.splice(l,0,u)}return aO(o)&&t.padding&&r[0]!==Ee(r)&&(r=Zj(o,r,t.range,t.padding,t.exponent,t.constant)),e.domain(lO(o,r,n)),o===Wv&&e.unknown(t.domainImplicit?g1:void 0),t.nice&&e.nice&&e.nice(t.nice!==!0&&Jv(e,t.nice)||null),r.length}function Qj(e,t,n){return t?(e.domain(lO(e.type,t,n)),t.length):-1}function Zj(e,t,n,i,r,o){var s=Math.abs(Ee(n)-n[0]),a=s/(s-2*i),u=e===jr?yb(t,null,a):e===Bc?Ld(t,null,a,.5):e===zc?Ld(t,null,a,r||1):e===Ig?bb(t,null,a,o||1):mb(t,null,a);return t=t.slice(),t[0]=u[0],t[t.length-1]=u[1],t}function lO(e,t,n){if(bM(e)){var i=Math.abs(t.reduce((r,o)=>r+(o<0?-1:o>0?1:0),0));i!==t.length&&n.warn("Log scale domain includes zero: "+H(t))}return t}function eq(e,t,n){let i=t.bins;if(i&&!P(i)){const r=e.domain(),o=r[0],s=Ee(r),a=i.step;let u=i.start==null?o:i.start,l=i.stop==null?s:i.stop;a||N("Scale bins parameter missing step property."),u<o&&(u=a*Math.ceil(o/a)),l>s&&(l=a*Math.floor(s/a)),i=Mn(u,l+a/2,a)}return i?e.bins=i:e.bins&&delete e.bins,e.type===Hv&&(i?!t.domain&&!t.domainRaw&&(e.domain(i),n=i.length):e.bins=e.domain()),n}function tq(e,t,n){var i=e.type,r=t.round||!1,o=t.range;if(t.rangeStep!=null)o=nq(i,t,n);else if(t.scheme&&(o=iq(i,t,n),ge(o))){if(e.interpolator)return e.interpolator(o);N(`Scale type ${i} does not support interpolating color schemes.`)}if(o&&vM(i))return e.interpolator(Ug(M1(o,t.reverse),t.interpolate,t.interpolateGamma));o&&t.interpolate&&e.interpolate?e.interpolate(Xv(t.interpolate,t.interpolateGamma)):ge(e.round)?e.round(r):ge(e.rangeRound)&&e.interpolate(r?ug:Oc),o&&e.range(M1(o,t.reverse))}function nq(e,t,n){e!==dM&&e!==m1&&N("Only band and point scales support rangeStep.");var i=(t.paddingOuter!=null?t.paddingOuter:t.padding)||0,r=e===m1?1:(t.paddingInner!=null?t.paddingInner:t.padding)||0;return[0,t.rangeStep*qv(n,r,i)]}function iq(e,t,n){var i=t.schemeExtent,r,o;return P(t.scheme)?o=Ug(t.scheme,t.interpolate,t.interpolateGamma):(r=t.scheme.toLowerCase(),o=Kv(r),o||N(`Unrecognized scheme name: ${t.scheme}`)),n=e===Bg?n+1:e===Hv?n-1:e===eu||e===zg?+t.schemeCount||Gj:n,vM(e)?g_(o,i,t.reverse):ge(o)?EM(g_(o,i),n):e===Wv?o:o.slice(0,n)}function g_(e,t,n){return ge(e)&&(t||n)?wM(e,M1(t||[0,1],n)):e}function M1(e,t){return t?e.slice().reverse():e}function cO(e){D.call(this,null,e)}G(cO,D,{transform(e,t){const n=e.modified("sort")||t.changed(t.ADD)||t.modified(e.sort.fields)||t.modified("datum");return n&&t.source.sort(ea(e.sort)),this.modified(n),t}});const p_="zero",fO="center",dO="normalize",hO=["y0","y1"];function Lx(e){D.call(this,null,e)}Lx.Definition={type:"Stack",metadata:{modifies:!0},params:[{name:"field",type:"field"},{name:"groupby",type:"field",array:!0},{name:"sort",type:"compare"},{name:"offset",type:"enum",default:p_,values:[p_,fO,dO]},{name:"as",type:"string",array:!0,length:2,default:hO}]};G(Lx,D,{transform(e,t){var n=e.as||hO,i=n[0],r=n[1],o=ea(e.sort),s=e.field||ku,a=e.offset===fO?rq:e.offset===dO?oq:sq,u,l,c,f;for(u=aq(t.source,e.groupby,o,s),l=0,c=u.length,f=u.max;l<c;++l)a(u[l],f,s,i,r);return t.reflow(e.modified()).modifies(n)}});function rq(e,t,n,i,r){for(var o=(t-e.sum)/2,s=e.length,a=0,u;a<s;++a)u=e[a],u[i]=o,u[r]=o+=Math.abs(n(u))}function oq(e,t,n,i,r){for(var o=1/e.sum,s=0,a=e.length,u=0,l=0,c;u<a;++u)c=e[u],c[i]=s,c[r]=s=o*(l+=Math.abs(n(c)))}function sq(e,t,n,i,r){for(var o=0,s=0,a=e.length,u=0,l,c;u<a;++u)c=e[u],l=+n(c),l<0?(c[i]=s,c[r]=s+=l):(c[i]=o,c[r]=o+=l)}function aq(e,t,n,i){var r=[],o=p=>p(c),s,a,u,l,c,f,d,h,g;if(t==null)r.push(e.slice());else for(s={},a=0,u=e.length;a<u;++a)c=e[a],f=t.map(o),d=s[f],d||(s[f]=d=[],r.push(d)),d.push(c);for(f=0,g=0,l=r.length;f<l;++f){for(d=r[f],a=0,h=0,u=d.length;a<u;++a)h+=Math.abs(i(d[a]));d.sum=h,h>g&&(g=h),n&&d.sort(n)}return r.max=g,r}const uq=Object.freeze(Object.defineProperty({__proto__:null,axisticks:eO,datajoin:tO,encode:nO,legendentries:iO,linkpath:Rx,pie:Nx,scale:uO,sortitems:cO,stack:Lx},Symbol.toStringTag,{value:"Module"}));var ae=1e-6,D1=1e-12,be=Math.PI,Xe=be/2,lh=be/4,un=be*2,Ze=180/be,me=be/180,we=Math.abs,Iu=Math.atan,ti=Math.atan2,se=Math.cos,Nf=Math.ceil,gO=Math.exp,O1=Math.hypot,ch=Math.log,Im=Math.pow,re=Math.sin,Vn=Math.sign||function(e){return e>0?1:e<0?-1:0},ln=Math.sqrt,Px=Math.tan;function pO(e){return e>1?0:e<-1?be:Math.acos(e)}function wn(e){return e>1?Xe:e<-1?-Xe:Math.asin(e)}function $t(){}function fh(e,t){e&&y_.hasOwnProperty(e.type)&&y_[e.type](e,t)}var m_={Feature:function(e,t){fh(e.geometry,t)},FeatureCollection:function(e,t){for(var n=e.features,i=-1,r=n.length;++i<r;)fh(n[i].geometry,t)}},y_={Sphere:function(e,t){t.sphere()},Point:function(e,t){e=e.coordinates,t.point(e[0],e[1],e[2])},MultiPoint:function(e,t){for(var n=e.coordinates,i=-1,r=n.length;++i<r;)e=n[i],t.point(e[0],e[1],e[2])},LineString:function(e,t){R1(e.coordinates,t,0)},MultiLineString:function(e,t){for(var n=e.coordinates,i=-1,r=n.length;++i<r;)R1(n[i],t,0)},Polygon:function(e,t){b_(e.coordinates,t)},MultiPolygon:function(e,t){for(var n=e.coordinates,i=-1,r=n.length;++i<r;)b_(n[i],t)},GeometryCollection:function(e,t){for(var n=e.geometries,i=-1,r=n.length;++i<r;)fh(n[i],t)}};function R1(e,t,n){var i=-1,r=e.length-n,o;for(t.lineStart();++i<r;)o=e[i],t.point(o[0],o[1],o[2]);t.lineEnd()}function b_(e,t){var n=-1,i=e.length;for(t.polygonStart();++n<i;)R1(e[n],t,1);t.polygonEnd()}function $r(e,t){e&&m_.hasOwnProperty(e.type)?m_[e.type](e,t):fh(e,t)}var dh=new sn,hh=new sn,mO,yO,N1,L1,P1,nr={point:$t,lineStart:$t,lineEnd:$t,polygonStart:function(){dh=new sn,nr.lineStart=lq,nr.lineEnd=cq},polygonEnd:function(){var e=+dh;hh.add(e<0?un+e:e),this.lineStart=this.lineEnd=this.point=$t},sphere:function(){hh.add(un)}};function lq(){nr.point=fq}function cq(){bO(mO,yO)}function fq(e,t){nr.point=bO,mO=e,yO=t,e*=me,t*=me,N1=e,L1=se(t=t/2+lh),P1=re(t)}function bO(e,t){e*=me,t*=me,t=t/2+lh;var n=e-N1,i=n>=0?1:-1,r=i*n,o=se(t),s=re(t),a=P1*s,u=L1*o+a*se(r),l=a*i*re(r);dh.add(ti(l,u)),N1=e,L1=o,P1=s}function dq(e){return hh=new sn,$r(e,nr),hh*2}function gh(e){return[ti(e[1],e[0]),wn(e[2])]}function Ps(e){var t=e[0],n=e[1],i=se(n);return[i*se(t),i*re(t),re(n)]}function Lf(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function su(e,t){return[e[1]*t[2]-e[2]*t[1],e[2]*t[0]-e[0]*t[2],e[0]*t[1]-e[1]*t[0]]}function zm(e,t){e[0]+=t[0],e[1]+=t[1],e[2]+=t[2]}function Pf(e,t){return[e[0]*t,e[1]*t,e[2]*t]}function ph(e){var t=ln(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]/=t,e[1]/=t,e[2]/=t}var He,pn,Ve,Fn,gs,vO,xO,za,Vl,uo,qr,_r={point:I1,lineStart:v_,lineEnd:x_,polygonStart:function(){_r.point=EO,_r.lineStart=hq,_r.lineEnd=gq,Vl=new sn,nr.polygonStart()},polygonEnd:function(){nr.polygonEnd(),_r.point=I1,_r.lineStart=v_,_r.lineEnd=x_,dh<0?(He=-(Ve=180),pn=-(Fn=90)):Vl>ae?Fn=90:Vl<-1e-6&&(pn=-90),qr[0]=He,qr[1]=Ve},sphere:function(){He=-(Ve=180),pn=-(Fn=90)}};function I1(e,t){uo.push(qr=[He=e,Ve=e]),t<pn&&(pn=t),t>Fn&&(Fn=t)}function wO(e,t){var n=Ps([e*me,t*me]);if(za){var i=su(za,n),r=[i[1],-i[0],0],o=su(r,i);ph(o),o=gh(o);var s=e-gs,a=s>0?1:-1,u=o[0]*Ze*a,l,c=we(s)>180;c^(a*gs<u&&u<a*e)?(l=o[1]*Ze,l>Fn&&(Fn=l)):(u=(u+360)%360-180,c^(a*gs<u&&u<a*e)?(l=-o[1]*Ze,l<pn&&(pn=l)):(t<pn&&(pn=t),t>Fn&&(Fn=t))),c?e<gs?Cn(He,e)>Cn(He,Ve)&&(Ve=e):Cn(e,Ve)>Cn(He,Ve)&&(He=e):Ve>=He?(e<He&&(He=e),e>Ve&&(Ve=e)):e>gs?Cn(He,e)>Cn(He,Ve)&&(Ve=e):Cn(e,Ve)>Cn(He,Ve)&&(He=e)}else uo.push(qr=[He=e,Ve=e]);t<pn&&(pn=t),t>Fn&&(Fn=t),za=n,gs=e}function v_(){_r.point=wO}function x_(){qr[0]=He,qr[1]=Ve,_r.point=I1,za=null}function EO(e,t){if(za){var n=e-gs;Vl.add(we(n)>180?n+(n>0?360:-360):n)}else vO=e,xO=t;nr.point(e,t),wO(e,t)}function hq(){nr.lineStart()}function gq(){EO(vO,xO),nr.lineEnd(),we(Vl)>ae&&(He=-(Ve=180)),qr[0]=He,qr[1]=Ve,za=null}function Cn(e,t){return(t-=e)<0?t+360:t}function pq(e,t){return e[0]-t[0]}function w_(e,t){return e[0]<=e[1]?e[0]<=t&&t<=e[1]:t<e[0]||e[1]<t}function mq(e){var t,n,i,r,o,s,a;if(Fn=Ve=-(He=pn=1/0),uo=[],$r(e,_r),n=uo.length){for(uo.sort(pq),t=1,i=uo[0],o=[i];t<n;++t)r=uo[t],w_(i,r[0])||w_(i,r[1])?(Cn(i[0],r[1])>Cn(i[0],i[1])&&(i[1]=r[1]),Cn(r[0],i[1])>Cn(i[0],i[1])&&(i[0]=r[0])):o.push(i=r);for(s=-1/0,n=o.length-1,t=0,i=o[n];t<=n;i=r,++t)r=o[t],(a=Cn(i[1],r[0]))>s&&(s=a,He=r[0],Ve=i[1])}return uo=qr=null,He===1/0||pn===1/0?[[NaN,NaN],[NaN,NaN]]:[[He,pn],[Ve,Fn]]}var Dl,mh,yh,bh,vh,xh,wh,Eh,z1,B1,U1,SO,_O,Zt,en,tn,pi={sphere:$t,point:Ix,lineStart:E_,lineEnd:S_,polygonStart:function(){pi.lineStart=vq,pi.lineEnd=xq},polygonEnd:function(){pi.lineStart=E_,pi.lineEnd=S_}};function Ix(e,t){e*=me,t*=me;var n=se(t);Qc(n*se(e),n*re(e),re(t))}function Qc(e,t,n){++Dl,yh+=(e-yh)/Dl,bh+=(t-bh)/Dl,vh+=(n-vh)/Dl}function E_(){pi.point=yq}function yq(e,t){e*=me,t*=me;var n=se(t);Zt=n*se(e),en=n*re(e),tn=re(t),pi.point=bq,Qc(Zt,en,tn)}function bq(e,t){e*=me,t*=me;var n=se(t),i=n*se(e),r=n*re(e),o=re(t),s=ti(ln((s=en*o-tn*r)*s+(s=tn*i-Zt*o)*s+(s=Zt*r-en*i)*s),Zt*i+en*r+tn*o);mh+=s,xh+=s*(Zt+(Zt=i)),wh+=s*(en+(en=r)),Eh+=s*(tn+(tn=o)),Qc(Zt,en,tn)}function S_(){pi.point=Ix}function vq(){pi.point=wq}function xq(){AO(SO,_O),pi.point=Ix}function wq(e,t){SO=e,_O=t,e*=me,t*=me,pi.point=AO;var n=se(t);Zt=n*se(e),en=n*re(e),tn=re(t),Qc(Zt,en,tn)}function AO(e,t){e*=me,t*=me;var n=se(t),i=n*se(e),r=n*re(e),o=re(t),s=en*o-tn*r,a=tn*i-Zt*o,u=Zt*r-en*i,l=O1(s,a,u),c=wn(l),f=l&&-c/l;z1.add(f*s),B1.add(f*a),U1.add(f*u),mh+=c,xh+=c*(Zt+(Zt=i)),wh+=c*(en+(en=r)),Eh+=c*(tn+(tn=o)),Qc(Zt,en,tn)}function Eq(e){Dl=mh=yh=bh=vh=xh=wh=Eh=0,z1=new sn,B1=new sn,U1=new sn,$r(e,pi);var t=+z1,n=+B1,i=+U1,r=O1(t,n,i);return r<D1&&(t=xh,n=wh,i=Eh,mh<ae&&(t=yh,n=bh,i=vh),r=O1(t,n,i),r<D1)?[NaN,NaN]:[ti(n,t)*Ze,wn(i/r)*Ze]}function j1(e,t){function n(i,r){return i=e(i,r),t(i[0],i[1])}return e.invert&&t.invert&&(n.invert=function(i,r){return i=t.invert(i,r),i&&e.invert(i[0],i[1])}),n}function q1(e,t){return we(e)>be&&(e-=Math.round(e/un)*un),[e,t]}q1.invert=q1;function $O(e,t,n){return(e%=un)?t||n?j1(A_(e),$_(t,n)):A_(e):t||n?$_(t,n):q1}function __(e){return function(t,n){return t+=e,we(t)>be&&(t-=Math.round(t/un)*un),[t,n]}}function A_(e){var t=__(e);return t.invert=__(-e),t}function $_(e,t){var n=se(e),i=re(e),r=se(t),o=re(t);function s(a,u){var l=se(u),c=se(a)*l,f=re(a)*l,d=re(u),h=d*n+c*i;return[ti(f*r-h*o,c*n-d*i),wn(h*r+f*o)]}return s.invert=function(a,u){var l=se(u),c=se(a)*l,f=re(a)*l,d=re(u),h=d*r-f*o;return[ti(f*r+d*o,c*n+h*i),wn(h*n-c*i)]},s}function Sq(e){e=$O(e[0]*me,e[1]*me,e.length>2?e[2]*me:0);function t(n){return n=e(n[0]*me,n[1]*me),n[0]*=Ze,n[1]*=Ze,n}return t.invert=function(n){return n=e.invert(n[0]*me,n[1]*me),n[0]*=Ze,n[1]*=Ze,n},t}function _q(e,t,n,i,r,o){if(n){var s=se(t),a=re(t),u=i*n;r==null?(r=t+i*un,o=t-u/2):(r=k_(s,r),o=k_(s,o),(i>0?r<o:r>o)&&(r+=i*un));for(var l,c=r;i>0?c>o:c<o;c-=u)l=gh([s,-a*se(c),-a*re(c)]),e.point(l[0],l[1])}}function k_(e,t){t=Ps(t),t[0]-=e,ph(t);var n=pO(-t[1]);return((-t[2]<0?-n:n)+un-ae)%un}function kO(){var e=[],t;return{point:function(n,i,r){t.push([n,i,r])},lineStart:function(){e.push(t=[])},lineEnd:$t,rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}}function wd(e,t){return we(e[0]-t[0])<ae&&we(e[1]-t[1])<ae}function If(e,t,n,i){this.x=e,this.z=t,this.o=n,this.e=i,this.v=!1,this.n=this.p=null}function CO(e,t,n,i,r){var o=[],s=[],a,u;if(e.forEach(function(g){if(!((p=g.length-1)<=0)){var p,m=g[0],y=g[p],b;if(wd(m,y)){if(!m[2]&&!y[2]){for(r.lineStart(),a=0;a<p;++a)r.point((m=g[a])[0],m[1]);r.lineEnd();return}y[0]+=2*ae}o.push(b=new If(m,g,null,!0)),s.push(b.o=new If(m,null,b,!1)),o.push(b=new If(y,g,null,!1)),s.push(b.o=new If(y,null,b,!0))}}),!!o.length){for(s.sort(t),C_(o),C_(s),a=0,u=s.length;a<u;++a)s[a].e=n=!n;for(var l=o[0],c,f;;){for(var d=l,h=!0;d.v;)if((d=d.n)===l)return;c=d.z,r.lineStart();do{if(d.v=d.o.v=!0,d.e){if(h)for(a=0,u=c.length;a<u;++a)r.point((f=c[a])[0],f[1]);else i(d.x,d.n.x,1,r);d=d.n}else{if(h)for(c=d.p.z,a=c.length-1;a>=0;--a)r.point((f=c[a])[0],f[1]);else i(d.x,d.p.x,-1,r);d=d.p}d=d.o,c=d.z,h=!h}while(!d.v);r.lineEnd()}}}function C_(e){if(t=e.length){for(var t,n=0,i=e[0],r;++n<t;)i.n=r=e[n],r.p=i,i=r;i.n=r=e[0],r.p=i}}function Bm(e){return we(e[0])<=be?e[0]:Vn(e[0])*((we(e[0])+be)%un-be)}function Aq(e,t){var n=Bm(t),i=t[1],r=re(i),o=[re(n),-se(n),0],s=0,a=0,u=new sn;r===1?i=Xe+ae:r===-1&&(i=-Xe-ae);for(var l=0,c=e.length;l<c;++l)if(d=(f=e[l]).length)for(var f,d,h=f[d-1],g=Bm(h),p=h[1]/2+lh,m=re(p),y=se(p),b=0;b<d;++b,g=x,m=S,y=w,h=v){var v=f[b],x=Bm(v),E=v[1]/2+lh,S=re(E),w=se(E),_=x-g,A=_>=0?1:-1,k=A*_,C=k>be,O=m*S;if(u.add(ti(O*A*re(k),y*w+O*se(k))),s+=C?_+A*un:_,C^g>=n^x>=n){var M=su(Ps(h),Ps(v));ph(M);var F=su(o,M);ph(F);var $=(C^_>=0?-1:1)*wn(F[2]);(i>$||i===$&&(M[0]||M[1]))&&(a+=C^_>=0?1:-1)}}return(s<-1e-6||s<ae&&u<-1e-12)^a&1}function FO(e,t,n,i){return function(r){var o=t(r),s=kO(),a=t(s),u=!1,l,c,f,d={point:h,lineStart:p,lineEnd:m,polygonStart:function(){d.point=y,d.lineStart=b,d.lineEnd=v,c=[],l=[]},polygonEnd:function(){d.point=h,d.lineStart=p,d.lineEnd=m,c=jC(c);var x=Aq(l,i);c.length?(u||(r.polygonStart(),u=!0),CO(c,kq,x,n,r)):x&&(u||(r.polygonStart(),u=!0),r.lineStart(),n(null,null,1,r),r.lineEnd()),u&&(r.polygonEnd(),u=!1),c=l=null},sphere:function(){r.polygonStart(),r.lineStart(),n(null,null,1,r),r.lineEnd(),r.polygonEnd()}};function h(x,E){e(x,E)&&r.point(x,E)}function g(x,E){o.point(x,E)}function p(){d.point=g,o.lineStart()}function m(){d.point=h,o.lineEnd()}function y(x,E){f.push([x,E]),a.point(x,E)}function b(){a.lineStart(),f=[]}function v(){y(f[0][0],f[0][1]),a.lineEnd();var x=a.clean(),E=s.result(),S,w=E.length,_,A,k;if(f.pop(),l.push(f),f=null,!!w){if(x&1){if(A=E[0],(_=A.length-1)>0){for(u||(r.polygonStart(),u=!0),r.lineStart(),S=0;S<_;++S)r.point((k=A[S])[0],k[1]);r.lineEnd()}return}w>1&&x&2&&E.push(E.pop().concat(E.shift())),c.push(E.filter($q))}}return d}}function $q(e){return e.length>1}function kq(e,t){return((e=e.x)[0]<0?e[1]-Xe-ae:Xe-e[1])-((t=t.x)[0]<0?t[1]-Xe-ae:Xe-t[1])}const F_=FO(function(){return!0},Cq,Tq,[-be,-Xe]);function Cq(e){var t=NaN,n=NaN,i=NaN,r;return{lineStart:function(){e.lineStart(),r=1},point:function(o,s){var a=o>0?be:-be,u=we(o-t);we(u-be)<ae?(e.point(t,n=(n+s)/2>0?Xe:-Xe),e.point(i,n),e.lineEnd(),e.lineStart(),e.point(a,n),e.point(o,n),r=0):i!==a&&u>=be&&(we(t-i)<ae&&(t-=i*ae),we(o-a)<ae&&(o-=a*ae),n=Fq(t,n,o,s),e.point(i,n),e.lineEnd(),e.lineStart(),e.point(a,n),r=0),e.point(t=o,n=s),i=a},lineEnd:function(){e.lineEnd(),t=n=NaN},clean:function(){return 2-r}}}function Fq(e,t,n,i){var r,o,s=re(e-n);return we(s)>ae?Iu((re(t)*(o=se(i))*re(n)-re(i)*(r=se(t))*re(e))/(r*o*s)):(t+i)/2}function Tq(e,t,n,i){var r;if(e==null)r=n*Xe,i.point(-be,r),i.point(0,r),i.point(be,r),i.point(be,0),i.point(be,-r),i.point(0,-r),i.point(-be,-r),i.point(-be,0),i.point(-be,r);else if(we(e[0]-t[0])>ae){var o=e[0]<t[0]?be:-be;r=n*o/2,i.point(-o,r),i.point(0,r),i.point(o,r)}else i.point(t[0],t[1])}function Mq(e){var t=se(e),n=2*me,i=t>0,r=we(t)>ae;function o(c,f,d,h){_q(h,e,n,d,c,f)}function s(c,f){return se(c)*se(f)>t}function a(c){var f,d,h,g,p;return{lineStart:function(){g=h=!1,p=1},point:function(m,y){var b=[m,y],v,x=s(m,y),E=i?x?0:l(m,y):x?l(m+(m<0?be:-be),y):0;if(!f&&(g=h=x)&&c.lineStart(),x!==h&&(v=u(f,b),(!v||wd(f,v)||wd(b,v))&&(b[2]=1)),x!==h)p=0,x?(c.lineStart(),v=u(b,f),c.point(v[0],v[1])):(v=u(f,b),c.point(v[0],v[1],2),c.lineEnd()),f=v;else if(r&&f&&i^x){var S;!(E&d)&&(S=u(b,f,!0))&&(p=0,i?(c.lineStart(),c.point(S[0][0],S[0][1]),c.point(S[1][0],S[1][1]),c.lineEnd()):(c.point(S[1][0],S[1][1]),c.lineEnd(),c.lineStart(),c.point(S[0][0],S[0][1],3)))}x&&(!f||!wd(f,b))&&c.point(b[0],b[1]),f=b,h=x,d=E},lineEnd:function(){h&&c.lineEnd(),f=null},clean:function(){return p|(g&&h)<<1}}}function u(c,f,d){var h=Ps(c),g=Ps(f),p=[1,0,0],m=su(h,g),y=Lf(m,m),b=m[0],v=y-b*b;if(!v)return!d&&c;var x=t*y/v,E=-t*b/v,S=su(p,m),w=Pf(p,x),_=Pf(m,E);zm(w,_);var A=S,k=Lf(w,A),C=Lf(A,A),O=k*k-C*(Lf(w,w)-1);if(!(O<0)){var M=ln(O),F=Pf(A,(-k-M)/C);if(zm(F,w),F=gh(F),!d)return F;var $=c[0],T=f[0],L=c[1],z=f[1],I;T<$&&(I=$,$=T,T=I);var Q=T-$,ue=we(Q-be)<ae,oe=ue||Q<ae;if(!ue&&z<L&&(I=L,L=z,z=I),oe?ue?L+z>0^F[1]<(we(F[0]-$)<ae?L:z):L<=F[1]&&F[1]<=z:Q>be^($<=F[0]&&F[0]<=T)){var fe=Pf(A,(-k+M)/C);return zm(fe,w),[F,gh(fe)]}}}function l(c,f){var d=i?e:be-e,h=0;return c<-d?h|=1:c>d&&(h|=2),f<-d?h|=4:f>d&&(h|=8),h}return FO(s,a,o,i?[0,-e]:[-be,e-be])}function Dq(e,t,n,i,r,o){var s=e[0],a=e[1],u=t[0],l=t[1],c=0,f=1,d=u-s,h=l-a,g;if(g=n-s,!(!d&&g>0)){if(g/=d,d<0){if(g<c)return;g<f&&(f=g)}else if(d>0){if(g>f)return;g>c&&(c=g)}if(g=r-s,!(!d&&g<0)){if(g/=d,d<0){if(g>f)return;g>c&&(c=g)}else if(d>0){if(g<c)return;g<f&&(f=g)}if(g=i-a,!(!h&&g>0)){if(g/=h,h<0){if(g<c)return;g<f&&(f=g)}else if(h>0){if(g>f)return;g>c&&(c=g)}if(g=o-a,!(!h&&g<0)){if(g/=h,h<0){if(g>f)return;g>c&&(c=g)}else if(h>0){if(g<c)return;g<f&&(f=g)}return c>0&&(e[0]=s+c*d,e[1]=a+c*h),f<1&&(t[0]=s+f*d,t[1]=a+f*h),!0}}}}}var zf=1e9,Bf=-1e9;function TO(e,t,n,i){function r(l,c){return e<=l&&l<=n&&t<=c&&c<=i}function o(l,c,f,d){var h=0,g=0;if(l==null||(h=s(l,f))!==(g=s(c,f))||u(l,c)<0^f>0)do d.point(h===0||h===3?e:n,h>1?i:t);while((h=(h+f+4)%4)!==g);else d.point(c[0],c[1])}function s(l,c){return we(l[0]-e)<ae?c>0?0:3:we(l[0]-n)<ae?c>0?2:1:we(l[1]-t)<ae?c>0?1:0:c>0?3:2}function a(l,c){return u(l.x,c.x)}function u(l,c){var f=s(l,1),d=s(c,1);return f!==d?f-d:f===0?c[1]-l[1]:f===1?l[0]-c[0]:f===2?l[1]-c[1]:c[0]-l[0]}return function(l){var c=l,f=kO(),d,h,g,p,m,y,b,v,x,E,S,w={point:_,lineStart:O,lineEnd:M,polygonStart:k,polygonEnd:C};function _($,T){r($,T)&&c.point($,T)}function A(){for(var $=0,T=0,L=h.length;T<L;++T)for(var z=h[T],I=1,Q=z.length,ue=z[0],oe,fe,Pe=ue[0],de=ue[1];I<Q;++I)oe=Pe,fe=de,ue=z[I],Pe=ue[0],de=ue[1],fe<=i?de>i&&(Pe-oe)*(i-fe)>(de-fe)*(e-oe)&&++$:de<=i&&(Pe-oe)*(i-fe)<(de-fe)*(e-oe)&&--$;return $}function k(){c=f,d=[],h=[],S=!0}function C(){var $=A(),T=S&&$,L=(d=jC(d)).length;(T||L)&&(l.polygonStart(),T&&(l.lineStart(),o(null,null,1,l),l.lineEnd()),L&&CO(d,a,$,o,l),l.polygonEnd()),c=l,d=h=g=null}function O(){w.point=F,h&&h.push(g=[]),E=!0,x=!1,b=v=NaN}function M(){d&&(F(p,m),y&&x&&f.rejoin(),d.push(f.result())),w.point=_,x&&c.lineEnd()}function F($,T){var L=r($,T);if(h&&g.push([$,T]),E)p=$,m=T,y=L,E=!1,L&&(c.lineStart(),c.point($,T));else if(L&&x)c.point($,T);else{var z=[b=Math.max(Bf,Math.min(zf,b)),v=Math.max(Bf,Math.min(zf,v))],I=[$=Math.max(Bf,Math.min(zf,$)),T=Math.max(Bf,Math.min(zf,T))];Dq(z,I,e,t,n,i)?(x||(c.lineStart(),c.point(z[0],z[1])),c.point(I[0],I[1]),L||c.lineEnd(),S=!1):L&&(c.lineStart(),c.point($,T),S=!1)}b=$,v=T,x=L}return w}}function T_(e,t,n){var i=Mn(e,t-ae,n).concat(t);return function(r){return i.map(function(o){return[r,o]})}}function M_(e,t,n){var i=Mn(e,t-ae,n).concat(t);return function(r){return i.map(function(o){return[o,r]})}}function Oq(){var e,t,n,i,r,o,s,a,u=10,l=u,c=90,f=360,d,h,g,p,m=2.5;function y(){return{type:"MultiLineString",coordinates:b()}}function b(){return Mn(Nf(i/c)*c,n,c).map(g).concat(Mn(Nf(a/f)*f,s,f).map(p)).concat(Mn(Nf(t/u)*u,e,u).filter(function(v){return we(v%c)>ae}).map(d)).concat(Mn(Nf(o/l)*l,r,l).filter(function(v){return we(v%f)>ae}).map(h))}return y.lines=function(){return b().map(function(v){return{type:"LineString",coordinates:v}})},y.outline=function(){return{type:"Polygon",coordinates:[g(i).concat(p(s).slice(1),g(n).reverse().slice(1),p(a).reverse().slice(1))]}},y.extent=function(v){return arguments.length?y.extentMajor(v).extentMinor(v):y.extentMinor()},y.extentMajor=function(v){return arguments.length?(i=+v[0][0],n=+v[1][0],a=+v[0][1],s=+v[1][1],i>n&&(v=i,i=n,n=v),a>s&&(v=a,a=s,s=v),y.precision(m)):[[i,a],[n,s]]},y.extentMinor=function(v){return arguments.length?(t=+v[0][0],e=+v[1][0],o=+v[0][1],r=+v[1][1],t>e&&(v=t,t=e,e=v),o>r&&(v=o,o=r,r=v),y.precision(m)):[[t,o],[e,r]]},y.step=function(v){return arguments.length?y.stepMajor(v).stepMinor(v):y.stepMinor()},y.stepMajor=function(v){return arguments.length?(c=+v[0],f=+v[1],y):[c,f]},y.stepMinor=function(v){return arguments.length?(u=+v[0],l=+v[1],y):[u,l]},y.precision=function(v){return arguments.length?(m=+v,d=T_(o,r,90),h=M_(t,e,m),g=T_(a,s,90),p=M_(i,n,m),y):m},y.extentMajor([[-180,-90+ae],[180,90-ae]]).extentMinor([[-180,-80-ae],[180,80+ae]])}const gc=e=>e;var Um=new sn,W1=new sn,MO,DO,H1,G1,kr={point:$t,lineStart:$t,lineEnd:$t,polygonStart:function(){kr.lineStart=Rq,kr.lineEnd=Lq},polygonEnd:function(){kr.lineStart=kr.lineEnd=kr.point=$t,Um.add(we(W1)),W1=new sn},result:function(){var e=Um/2;return Um=new sn,e}};function Rq(){kr.point=Nq}function Nq(e,t){kr.point=OO,MO=H1=e,DO=G1=t}function OO(e,t){W1.add(G1*e-H1*t),H1=e,G1=t}function Lq(){OO(MO,DO)}var au=1/0,Sh=au,pc=-au,_h=pc,Ah={point:Pq,lineStart:$t,lineEnd:$t,polygonStart:$t,polygonEnd:$t,result:function(){var e=[[au,Sh],[pc,_h]];return pc=_h=-(Sh=au=1/0),e}};function Pq(e,t){e<au&&(au=e),e>pc&&(pc=e),t<Sh&&(Sh=t),t>_h&&(_h=t)}var V1=0,Y1=0,Ol=0,$h=0,kh=0,Oa=0,X1=0,K1=0,Rl=0,RO,NO,Wi,Hi,Hn={point:Is,lineStart:D_,lineEnd:O_,polygonStart:function(){Hn.lineStart=Bq,Hn.lineEnd=Uq},polygonEnd:function(){Hn.point=Is,Hn.lineStart=D_,Hn.lineEnd=O_},result:function(){var e=Rl?[X1/Rl,K1/Rl]:Oa?[$h/Oa,kh/Oa]:Ol?[V1/Ol,Y1/Ol]:[NaN,NaN];return V1=Y1=Ol=$h=kh=Oa=X1=K1=Rl=0,e}};function Is(e,t){V1+=e,Y1+=t,++Ol}function D_(){Hn.point=Iq}function Iq(e,t){Hn.point=zq,Is(Wi=e,Hi=t)}function zq(e,t){var n=e-Wi,i=t-Hi,r=ln(n*n+i*i);$h+=r*(Wi+e)/2,kh+=r*(Hi+t)/2,Oa+=r,Is(Wi=e,Hi=t)}function O_(){Hn.point=Is}function Bq(){Hn.point=jq}function Uq(){LO(RO,NO)}function jq(e,t){Hn.point=LO,Is(RO=Wi=e,NO=Hi=t)}function LO(e,t){var n=e-Wi,i=t-Hi,r=ln(n*n+i*i);$h+=r*(Wi+e)/2,kh+=r*(Hi+t)/2,Oa+=r,r=Hi*e-Wi*t,X1+=r*(Wi+e),K1+=r*(Hi+t),Rl+=r*3,Is(Wi=e,Hi=t)}function PO(e){this._context=e}PO.prototype={_radius:4.5,pointRadius:function(e){return this._radius=e,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){this._line===0&&this._context.closePath(),this._point=NaN},point:function(e,t){switch(this._point){case 0:{this._context.moveTo(e,t),this._point=1;break}case 1:{this._context.lineTo(e,t);break}default:{this._context.moveTo(e+this._radius,t),this._context.arc(e,t,this._radius,0,un);break}}},result:$t};var J1=new sn,jm,IO,zO,Nl,Ll,mc={point:$t,lineStart:function(){mc.point=qq},lineEnd:function(){jm&&BO(IO,zO),mc.point=$t},polygonStart:function(){jm=!0},polygonEnd:function(){jm=null},result:function(){var e=+J1;return J1=new sn,e}};function qq(e,t){mc.point=BO,IO=Nl=e,zO=Ll=t}function BO(e,t){Nl-=e,Ll-=t,J1.add(ln(Nl*Nl+Ll*Ll)),Nl=e,Ll=t}let R_,Ch,N_,L_;class P_{constructor(t){this._append=t==null?UO:Wq(t),this._radius=4.5,this._=""}pointRadius(t){return this._radius=+t,this}polygonStart(){this._line=0}polygonEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){this._line===0&&(this._+="Z"),this._point=NaN}point(t,n){switch(this._point){case 0:{this._append`M${t},${n}`,this._point=1;break}case 1:{this._append`L${t},${n}`;break}default:{if(this._append`M${t},${n}`,this._radius!==N_||this._append!==Ch){const i=this._radius,r=this._;this._="",this._append`m0,${i}a${i},${i} 0 1,1 0,${-2*i}a${i},${i} 0 1,1 0,${2*i}z`,N_=i,Ch=this._append,L_=this._,this._=r}this._+=L_;break}}}result(){const t=this._;return this._="",t.length?t:null}}function UO(e){let t=1;this._+=e[0];for(const n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function Wq(e){const t=Math.floor(e);if(!(t>=0))throw new RangeError(`invalid digits: ${e}`);if(t>15)return UO;if(t!==R_){const n=10**t;R_=t,Ch=function(r){let o=1;this._+=r[0];for(const s=r.length;o<s;++o)this._+=Math.round(arguments[o]*n)/n+r[o]}}return Ch}function jO(e,t){let n=3,i=4.5,r,o;function s(a){return a&&(typeof i=="function"&&o.pointRadius(+i.apply(this,arguments)),$r(a,r(o))),o.result()}return s.area=function(a){return $r(a,r(kr)),kr.result()},s.measure=function(a){return $r(a,r(mc)),mc.result()},s.bounds=function(a){return $r(a,r(Ah)),Ah.result()},s.centroid=function(a){return $r(a,r(Hn)),Hn.result()},s.projection=function(a){return arguments.length?(r=a==null?(e=null,gc):(e=a).stream,s):e},s.context=function(a){return arguments.length?(o=a==null?(t=null,new P_(n)):new PO(t=a),typeof i!="function"&&o.pointRadius(i),s):t},s.pointRadius=function(a){return arguments.length?(i=typeof a=="function"?a:(o.pointRadius(+a),+a),s):i},s.digits=function(a){if(!arguments.length)return n;if(a==null)n=null;else{const u=Math.floor(a);if(!(u>=0))throw new RangeError(`invalid digits: ${a}`);n=u}return t===null&&(o=new P_(n)),s},s.projection(e).digits(n).context(t)}function ep(e){return function(t){var n=new Q1;for(var i in e)n[i]=e[i];return n.stream=t,n}}function Q1(){}Q1.prototype={constructor:Q1,point:function(e,t){this.stream.point(e,t)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};function zx(e,t,n){var i=e.clipExtent&&e.clipExtent();return e.scale(150).translate([0,0]),i!=null&&e.clipExtent(null),$r(n,e.stream(Ah)),t(Ah.result()),i!=null&&e.clipExtent(i),e}function tp(e,t,n){return zx(e,function(i){var r=t[1][0]-t[0][0],o=t[1][1]-t[0][1],s=Math.min(r/(i[1][0]-i[0][0]),o/(i[1][1]-i[0][1])),a=+t[0][0]+(r-s*(i[1][0]+i[0][0]))/2,u=+t[0][1]+(o-s*(i[1][1]+i[0][1]))/2;e.scale(150*s).translate([a,u])},n)}function Bx(e,t,n){return tp(e,[[0,0],t],n)}function Ux(e,t,n){return zx(e,function(i){var r=+t,o=r/(i[1][0]-i[0][0]),s=(r-o*(i[1][0]+i[0][0]))/2,a=-o*i[0][1];e.scale(150*o).translate([s,a])},n)}function jx(e,t,n){return zx(e,function(i){var r=+t,o=r/(i[1][1]-i[0][1]),s=-o*i[0][0],a=(r-o*(i[1][1]+i[0][1]))/2;e.scale(150*o).translate([s,a])},n)}var I_=16,Hq=se(30*me);function z_(e,t){return+t?Vq(e,t):Gq(e)}function Gq(e){return ep({point:function(t,n){t=e(t,n),this.stream.point(t[0],t[1])}})}function Vq(e,t){function n(i,r,o,s,a,u,l,c,f,d,h,g,p,m){var y=l-i,b=c-r,v=y*y+b*b;if(v>4*t&&p--){var x=s+d,E=a+h,S=u+g,w=ln(x*x+E*E+S*S),_=wn(S/=w),A=we(we(S)-1)<ae||we(o-f)<ae?(o+f)/2:ti(E,x),k=e(A,_),C=k[0],O=k[1],M=C-i,F=O-r,$=b*M-y*F;($*$/v>t||we((y*M+b*F)/v-.5)>.3||s*d+a*h+u*g<Hq)&&(n(i,r,o,s,a,u,C,O,A,x/=w,E/=w,S,p,m),m.point(C,O),n(C,O,A,x,E,S,l,c,f,d,h,g,p,m))}}return function(i){var r,o,s,a,u,l,c,f,d,h,g,p,m={point:y,lineStart:b,lineEnd:x,polygonStart:function(){i.polygonStart(),m.lineStart=E},polygonEnd:function(){i.polygonEnd(),m.lineStart=b}};function y(_,A){_=e(_,A),i.point(_[0],_[1])}function b(){f=NaN,m.point=v,i.lineStart()}function v(_,A){var k=Ps([_,A]),C=e(_,A);n(f,d,c,h,g,p,f=C[0],d=C[1],c=_,h=k[0],g=k[1],p=k[2],I_,i),i.point(f,d)}function x(){m.point=y,i.lineEnd()}function E(){b(),m.point=S,m.lineEnd=w}function S(_,A){v(r=_,A),o=f,s=d,a=h,u=g,l=p,m.point=v}function w(){n(f,d,c,h,g,p,o,s,r,a,u,l,I_,i),m.lineEnd=x,x()}return m}}var Yq=ep({point:function(e,t){this.stream.point(e*me,t*me)}});function Xq(e){return ep({point:function(t,n){var i=e(t,n);return this.stream.point(i[0],i[1])}})}function Kq(e,t,n,i,r){function o(s,a){return s*=i,a*=r,[t+e*s,n-e*a]}return o.invert=function(s,a){return[(s-t)/e*i,(n-a)/e*r]},o}function B_(e,t,n,i,r,o){if(!o)return Kq(e,t,n,i,r);var s=se(o),a=re(o),u=s*e,l=a*e,c=s/e,f=a/e,d=(a*n-s*t)/e,h=(a*t+s*n)/e;function g(p,m){return p*=i,m*=r,[u*p-l*m+t,n-l*p-u*m]}return g.invert=function(p,m){return[i*(c*p-f*m+d),r*(h-f*p-c*m)]},g}function cr(e){return qO(function(){return e})()}function qO(e){var t,n=150,i=480,r=250,o=0,s=0,a=0,u=0,l=0,c,f=0,d=1,h=1,g=null,p=F_,m=null,y,b,v,x=gc,E=.5,S,w,_,A,k;function C($){return _($[0]*me,$[1]*me)}function O($){return $=_.invert($[0],$[1]),$&&[$[0]*Ze,$[1]*Ze]}C.stream=function($){return A&&k===$?A:A=Yq(Xq(c)(p(S(x(k=$)))))},C.preclip=function($){return arguments.length?(p=$,g=void 0,F()):p},C.postclip=function($){return arguments.length?(x=$,m=y=b=v=null,F()):x},C.clipAngle=function($){return arguments.length?(p=+$?Mq(g=$*me):(g=null,F_),F()):g*Ze},C.clipExtent=function($){return arguments.length?(x=$==null?(m=y=b=v=null,gc):TO(m=+$[0][0],y=+$[0][1],b=+$[1][0],v=+$[1][1]),F()):m==null?null:[[m,y],[b,v]]},C.scale=function($){return arguments.length?(n=+$,M()):n},C.translate=function($){return arguments.length?(i=+$[0],r=+$[1],M()):[i,r]},C.center=function($){return arguments.length?(o=$[0]%360*me,s=$[1]%360*me,M()):[o*Ze,s*Ze]},C.rotate=function($){return arguments.length?(a=$[0]%360*me,u=$[1]%360*me,l=$.length>2?$[2]%360*me:0,M()):[a*Ze,u*Ze,l*Ze]},C.angle=function($){return arguments.length?(f=$%360*me,M()):f*Ze},C.reflectX=function($){return arguments.length?(d=$?-1:1,M()):d<0},C.reflectY=function($){return arguments.length?(h=$?-1:1,M()):h<0},C.precision=function($){return arguments.length?(S=z_(w,E=$*$),F()):ln(E)},C.fitExtent=function($,T){return tp(C,$,T)},C.fitSize=function($,T){return Bx(C,$,T)},C.fitWidth=function($,T){return Ux(C,$,T)},C.fitHeight=function($,T){return jx(C,$,T)};function M(){var $=B_(n,0,0,d,h,f).apply(null,t(o,s)),T=B_(n,i-$[0],r-$[1],d,h,f);return c=$O(a,u,l),w=j1(t,T),_=j1(c,w),S=z_(w,E),F()}function F(){return A=k=null,C}return function(){return t=e.apply(this,arguments),C.invert=t.invert&&O,M()}}function qx(e){var t=0,n=be/3,i=qO(e),r=i(t,n);return r.parallels=function(o){return arguments.length?i(t=o[0]*me,n=o[1]*me):[t*Ze,n*Ze]},r}function Jq(e){var t=se(e);function n(i,r){return[i*t,re(r)/t]}return n.invert=function(i,r){return[i/t,wn(r*t)]},n}function Qq(e,t){var n=re(e),i=(n+re(t))/2;if(we(i)<ae)return Jq(e);var r=1+n*(2*i-n),o=ln(r)/i;function s(a,u){var l=ln(r-2*i*re(u))/i;return[l*re(a*=i),o-l*se(a)]}return s.invert=function(a,u){var l=o-u,c=ti(a,we(l))*Vn(l);return l*i<0&&(c-=be*Vn(a)*Vn(l)),[c/i,wn((r-(a*a+l*l)*i*i)/(2*i))]},s}function Fh(){return qx(Qq).scale(155.424).center([0,33.6442])}function WO(){return Fh().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])}function Zq(e){var t=e.length;return{point:function(n,i){for(var r=-1;++r<t;)e[r].point(n,i)},sphere:function(){for(var n=-1;++n<t;)e[n].sphere()},lineStart:function(){for(var n=-1;++n<t;)e[n].lineStart()},lineEnd:function(){for(var n=-1;++n<t;)e[n].lineEnd()},polygonStart:function(){for(var n=-1;++n<t;)e[n].polygonStart()},polygonEnd:function(){for(var n=-1;++n<t;)e[n].polygonEnd()}}}function eW(){var e,t,n=WO(),i,r=Fh().rotate([154,0]).center([-2,58.5]).parallels([55,65]),o,s=Fh().rotate([157,0]).center([-3,19.9]).parallels([8,18]),a,u,l={point:function(d,h){u=[d,h]}};function c(d){var h=d[0],g=d[1];return u=null,i.point(h,g),u||(o.point(h,g),u)||(a.point(h,g),u)}c.invert=function(d){var h=n.scale(),g=n.translate(),p=(d[0]-g[0])/h,m=(d[1]-g[1])/h;return(m>=.12&&m<.234&&p>=-.425&&p<-.214?r:m>=.166&&m<.234&&p>=-.214&&p<-.115?s:n).invert(d)},c.stream=function(d){return e&&t===d?e:e=Zq([n.stream(t=d),r.stream(d),s.stream(d)])},c.precision=function(d){return arguments.length?(n.precision(d),r.precision(d),s.precision(d),f()):n.precision()},c.scale=function(d){return arguments.length?(n.scale(d),r.scale(d*.35),s.scale(d),c.translate(n.translate())):n.scale()},c.translate=function(d){if(!arguments.length)return n.translate();var h=n.scale(),g=+d[0],p=+d[1];return i=n.translate(d).clipExtent([[g-.455*h,p-.238*h],[g+.455*h,p+.238*h]]).stream(l),o=r.translate([g-.307*h,p+.201*h]).clipExtent([[g-.425*h+ae,p+.12*h+ae],[g-.214*h-ae,p+.234*h-ae]]).stream(l),a=s.translate([g-.205*h,p+.212*h]).clipExtent([[g-.214*h+ae,p+.166*h+ae],[g-.115*h-ae,p+.234*h-ae]]).stream(l),f()},c.fitExtent=function(d,h){return tp(c,d,h)},c.fitSize=function(d,h){return Bx(c,d,h)},c.fitWidth=function(d,h){return Ux(c,d,h)},c.fitHeight=function(d,h){return jx(c,d,h)};function f(){return e=t=null,c}return c.scale(1070)}function HO(e){return function(t,n){var i=se(t),r=se(n),o=e(i*r);return o===1/0?[2,0]:[o*r*re(t),o*re(n)]}}function Zc(e){return function(t,n){var i=ln(t*t+n*n),r=e(i),o=re(r),s=se(r);return[ti(t*o,i*s),wn(i&&n*o/i)]}}var GO=HO(function(e){return ln(2/(1+e))});GO.invert=Zc(function(e){return 2*wn(e/2)});function tW(){return cr(GO).scale(124.75).clipAngle(180-.001)}var VO=HO(function(e){return(e=pO(e))&&e/re(e)});VO.invert=Zc(function(e){return e});function nW(){return cr(VO).scale(79.4188).clipAngle(180-.001)}function np(e,t){return[e,ch(Px((Xe+t)/2))]}np.invert=function(e,t){return[e,2*Iu(gO(t))-Xe]};function iW(){return YO(np).scale(961/un)}function YO(e){var t=cr(e),n=t.center,i=t.scale,r=t.translate,o=t.clipExtent,s=null,a,u,l;t.scale=function(f){return arguments.length?(i(f),c()):i()},t.translate=function(f){return arguments.length?(r(f),c()):r()},t.center=function(f){return arguments.length?(n(f),c()):n()},t.clipExtent=function(f){return arguments.length?(f==null?s=a=u=l=null:(s=+f[0][0],a=+f[0][1],u=+f[1][0],l=+f[1][1]),c()):s==null?null:[[s,a],[u,l]]};function c(){var f=be*i(),d=t(Sq(t.rotate()).invert([0,0]));return o(s==null?[[d[0]-f,d[1]-f],[d[0]+f,d[1]+f]]:e===np?[[Math.max(d[0]-f,s),a],[Math.min(d[0]+f,u),l]]:[[s,Math.max(d[1]-f,a)],[u,Math.min(d[1]+f,l)]])}return c()}function Uf(e){return Px((Xe+e)/2)}function rW(e,t){var n=se(e),i=e===t?re(e):ch(n/se(t))/ch(Uf(t)/Uf(e)),r=n*Im(Uf(e),i)/i;if(!i)return np;function o(s,a){r>0?a<-Xe+ae&&(a=-Xe+ae):a>Xe-ae&&(a=Xe-ae);var u=r/Im(Uf(a),i);return[u*re(i*s),r-u*se(i*s)]}return o.invert=function(s,a){var u=r-a,l=Vn(i)*ln(s*s+u*u),c=ti(s,we(u))*Vn(u);return u*i<0&&(c-=be*Vn(s)*Vn(u)),[c/i,2*Iu(Im(r/l,1/i))-Xe]},o}function oW(){return qx(rW).scale(109.5).parallels([30,30])}function Th(e,t){return[e,t]}Th.invert=Th;function sW(){return cr(Th).scale(152.63)}function aW(e,t){var n=se(e),i=e===t?re(e):(n-se(t))/(t-e),r=n/i+e;if(we(i)<ae)return Th;function o(s,a){var u=r-a,l=i*s;return[u*re(l),r-u*se(l)]}return o.invert=function(s,a){var u=r-a,l=ti(s,we(u))*Vn(u);return u*i<0&&(l-=be*Vn(s)*Vn(u)),[l/i,r-Vn(i)*ln(s*s+u*u)]},o}function uW(){return qx(aW).scale(131.154).center([0,13.9389])}var Yl=1.340264,Xl=-.081106,Kl=893e-6,Jl=.003796,Mh=ln(3)/2,lW=12;function XO(e,t){var n=wn(Mh*re(t)),i=n*n,r=i*i*i;return[e*se(n)/(Mh*(Yl+3*Xl*i+r*(7*Kl+9*Jl*i))),n*(Yl+Xl*i+r*(Kl+Jl*i))]}XO.invert=function(e,t){for(var n=t,i=n*n,r=i*i*i,o=0,s,a,u;o<lW&&(a=n*(Yl+Xl*i+r*(Kl+Jl*i))-t,u=Yl+3*Xl*i+r*(7*Kl+9*Jl*i),n-=s=a/u,i=n*n,r=i*i*i,!(we(s)<D1));++o);return[Mh*e*(Yl+3*Xl*i+r*(7*Kl+9*Jl*i))/se(n),wn(re(n)/Mh)]};function cW(){return cr(XO).scale(177.158)}function KO(e,t){var n=se(t),i=se(e)*n;return[n*re(e)/i,re(t)/i]}KO.invert=Zc(Iu);function fW(){return cr(KO).scale(144.049).clipAngle(60)}function dW(){var e=1,t=0,n=0,i=1,r=1,o=0,s,a,u=null,l,c,f,d=1,h=1,g=ep({point:function(x,E){var S=v([x,E]);this.stream.point(S[0],S[1])}}),p=gc,m,y;function b(){return d=e*i,h=e*r,m=y=null,v}function v(x){var E=x[0]*d,S=x[1]*h;if(o){var w=S*s-E*a;E=E*s+S*a,S=w}return[E+t,S+n]}return v.invert=function(x){var E=x[0]-t,S=x[1]-n;if(o){var w=S*s+E*a;E=E*s-S*a,S=w}return[E/d,S/h]},v.stream=function(x){return m&&y===x?m:m=g(p(y=x))},v.postclip=function(x){return arguments.length?(p=x,u=l=c=f=null,b()):p},v.clipExtent=function(x){return arguments.length?(p=x==null?(u=l=c=f=null,gc):TO(u=+x[0][0],l=+x[0][1],c=+x[1][0],f=+x[1][1]),b()):u==null?null:[[u,l],[c,f]]},v.scale=function(x){return arguments.length?(e=+x,b()):e},v.translate=function(x){return arguments.length?(t=+x[0],n=+x[1],b()):[t,n]},v.angle=function(x){return arguments.length?(o=x%360*me,a=re(o),s=se(o),b()):o*Ze},v.reflectX=function(x){return arguments.length?(i=x?-1:1,b()):i<0},v.reflectY=function(x){return arguments.length?(r=x?-1:1,b()):r<0},v.fitExtent=function(x,E){return tp(v,x,E)},v.fitSize=function(x,E){return Bx(v,x,E)},v.fitWidth=function(x,E){return Ux(v,x,E)},v.fitHeight=function(x,E){return jx(v,x,E)},v}function JO(e,t){var n=t*t,i=n*n;return[e*(.8707-.131979*n+i*(-.013791+i*(.003971*n-.001529*i))),t*(1.007226+n*(.015085+i*(-.044475+.028874*n-.005916*i)))]}JO.invert=function(e,t){var n=t,i=25,r;do{var o=n*n,s=o*o;n-=r=(n*(1.007226+o*(.015085+s*(-.044475+.028874*o-.005916*s)))-t)/(1.007226+o*(.015085*3+s*(-.044475*7+.028874*9*o-.005916*11*s)))}while(we(r)>ae&&--i>0);return[e/(.8707+(o=n*n)*(-.131979+o*(-.013791+o*o*o*(.003971-.001529*o)))),n]};function hW(){return cr(JO).scale(175.295)}function QO(e,t){return[se(t)*re(e),re(t)]}QO.invert=Zc(wn);function gW(){return cr(QO).scale(249.5).clipAngle(90+ae)}function ZO(e,t){var n=se(t),i=1+se(e)*n;return[n*re(e)/i,re(t)/i]}ZO.invert=Zc(function(e){return 2*Iu(e)});function pW(){return cr(ZO).scale(250).clipAngle(142)}function eR(e,t){return[ch(Px((Xe+t)/2)),-e]}eR.invert=function(e,t){return[-t,2*Iu(gO(e))-Xe]};function mW(){var e=YO(eR),t=e.center,n=e.rotate;return e.center=function(i){return arguments.length?t([-i[1],i[0]]):(i=t(),[i[1],-i[0]])},e.rotate=function(i){return arguments.length?n([i[0],i[1],i.length>2?i[2]+90:90]):(i=n(),[i[0],i[1],i[2]-90])},n([0,0,90]).scale(159.155)}var yW=Math.abs,Z1=Math.cos,Dh=Math.sin,bW=1e-6,tR=Math.PI,ey=tR/2,U_=vW(2);function j_(e){return e>1?ey:e<-1?-ey:Math.asin(e)}function vW(e){return e>0?Math.sqrt(e):0}function xW(e,t){var n=e*Dh(t),i=30,r;do t-=r=(t+Dh(t)-n)/(1+Z1(t));while(yW(r)>bW&&--i>0);return t/2}function wW(e,t,n){function i(r,o){return[e*r*Z1(o=xW(n,o)),t*Dh(o)]}return i.invert=function(r,o){return o=j_(o/t),[r/(e*Z1(o)),j_((2*o+Dh(2*o))/n)]},i}var EW=wW(U_/ey,U_,tR);function SW(){return cr(EW).scale(169.529)}const _W=jO(),ty=["clipAngle","clipExtent","scale","translate","center","rotate","parallels","precision","reflectX","reflectY","coefficient","distance","fraction","lobes","parallel","radius","ratio","spacing","tilt"];function AW(e,t){return function n(){const i=t();return i.type=e,i.path=jO().projection(i),i.copy=i.copy||function(){const r=n();return ty.forEach(o=>{i[o]&&r[o](i[o]())}),r.path.pointRadius(i.path.pointRadius()),r},mM(i)}}function Wx(e,t){if(!e||typeof e!="string")throw new Error("Projection type must be a name string.");return e=e.toLowerCase(),arguments.length>1?(Oh[e]=AW(e,t),this):Oh[e]||null}function nR(e){return e&&e.path||_W}const Oh={albers:WO,albersusa:eW,azimuthalequalarea:tW,azimuthalequidistant:nW,conicconformal:oW,conicequalarea:Fh,conicequidistant:uW,equalEarth:cW,equirectangular:sW,gnomonic:fW,identity:dW,mercator:iW,mollweide:SW,naturalEarth1:hW,orthographic:gW,stereographic:pW,transversemercator:mW};for(const e in Oh)Wx(e,Oh[e]);function $W(){}const xr=[[],[[[1,1.5],[.5,1]]],[[[1.5,1],[1,1.5]]],[[[1.5,1],[.5,1]]],[[[1,.5],[1.5,1]]],[[[1,1.5],[.5,1]],[[1,.5],[1.5,1]]],[[[1,.5],[1,1.5]]],[[[1,.5],[.5,1]]],[[[.5,1],[1,.5]]],[[[1,1.5],[1,.5]]],[[[.5,1],[1,.5]],[[1.5,1],[1,1.5]]],[[[1.5,1],[1,.5]]],[[[.5,1],[1.5,1]]],[[[1,1.5],[1.5,1]]],[[[.5,1],[1,1.5]]],[]];function iR(){var e=1,t=1,n=a;function i(u,l){return l.map(c=>r(u,c))}function r(u,l){var c=[],f=[];return o(u,l,d=>{n(d,u,l),kW(d)>0?c.push([d]):f.push(d)}),f.forEach(d=>{for(var h=0,g=c.length,p;h<g;++h)if(CW((p=c[h])[0],d)!==-1){p.push(d);return}}),{type:"MultiPolygon",value:l,coordinates:c}}function o(u,l,c){var f=[],d=[],h,g,p,m,y,b;for(h=g=-1,m=u[0]>=l,xr[m<<1].forEach(v);++h<e-1;)p=m,m=u[h+1]>=l,xr[p|m<<1].forEach(v);for(xr[m<<0].forEach(v);++g<t-1;){for(h=-1,m=u[g*e+e]>=l,y=u[g*e]>=l,xr[m<<1|y<<2].forEach(v);++h<e-1;)p=m,m=u[g*e+e+h+1]>=l,b=y,y=u[g*e+h+1]>=l,xr[p|m<<1|y<<2|b<<3].forEach(v);xr[m|y<<3].forEach(v)}for(h=-1,y=u[g*e]>=l,xr[y<<2].forEach(v);++h<e-1;)b=y,y=u[g*e+h+1]>=l,xr[y<<2|b<<3].forEach(v);xr[y<<3].forEach(v);function v(x){var E=[x[0][0]+h,x[0][1]+g],S=[x[1][0]+h,x[1][1]+g],w=s(E),_=s(S),A,k;(A=d[w])?(k=f[_])?(delete d[A.end],delete f[k.start],A===k?(A.ring.push(S),c(A.ring)):f[A.start]=d[k.end]={start:A.start,end:k.end,ring:A.ring.concat(k.ring)}):(delete d[A.end],A.ring.push(S),d[A.end=_]=A):(A=f[_])?(k=d[w])?(delete f[A.start],delete d[k.end],A===k?(A.ring.push(S),c(A.ring)):f[k.start]=d[A.end]={start:k.start,end:A.end,ring:k.ring.concat(A.ring)}):(delete f[A.start],A.ring.unshift(E),f[A.start=w]=A):f[w]=d[_]={start:w,end:_,ring:[E,S]}}}function s(u){return u[0]*2+u[1]*(e+1)*4}function a(u,l,c){u.forEach(f=>{var d=f[0],h=f[1],g=d|0,p=h|0,m,y=l[p*e+g];d>0&&d<e&&g===d&&(m=l[p*e+g-1],f[0]=d+(c-m)/(y-m)-.5),h>0&&h<t&&p===h&&(m=l[(p-1)*e+g],f[1]=h+(c-m)/(y-m)-.5)})}return i.contour=r,i.size=function(u){if(!arguments.length)return[e,t];var l=Math.floor(u[0]),c=Math.floor(u[1]);return l>=0&&c>=0||N("invalid size"),e=l,t=c,i},i.smooth=function(u){return arguments.length?(n=u?a:$W,i):n===a},i}function kW(e){for(var t=0,n=e.length,i=e[n-1][1]*e[0][0]-e[n-1][0]*e[0][1];++t<n;)i+=e[t-1][1]*e[t][0]-e[t-1][0]*e[t][1];return i}function CW(e,t){for(var n=-1,i=t.length,r;++n<i;)if(r=FW(e,t[n]))return r;return 0}function FW(e,t){for(var n=t[0],i=t[1],r=-1,o=0,s=e.length,a=s-1;o<s;a=o++){var u=e[o],l=u[0],c=u[1],f=e[a],d=f[0],h=f[1];if(TW(u,f,t))return 0;c>i!=h>i&&n<(d-l)*(i-c)/(h-c)+l&&(r=-r)}return r}function TW(e,t,n){var i;return MW(e,t,n)&&DW(e[i=+(e[0]===t[0])],n[i],t[i])}function MW(e,t,n){return(t[0]-e[0])*(n[1]-e[1])===(n[0]-e[0])*(t[1]-e[1])}function DW(e,t,n){return e<=t&&t<=n||n<=t&&t<=e}function rR(e,t,n){return function(i){var r=Qi(i),o=n?Math.min(r[0],0):r[0],s=r[1],a=s-o,u=t?Os(o,s,e):a/(e+1);return Mn(o+u,s,u)}}function Hx(e){D.call(this,null,e)}Hx.Definition={type:"Isocontour",metadata:{generates:!0},params:[{name:"field",type:"field"},{name:"thresholds",type:"number",array:!0},{name:"levels",type:"number"},{name:"nice",type:"boolean",default:!1},{name:"resolve",type:"enum",values:["shared","independent"],default:"independent"},{name:"zero",type:"boolean",default:!0},{name:"smooth",type:"boolean",default:!0},{name:"scale",type:"number",expr:!0},{name:"translate",type:"number",array:!0,expr:!0},{name:"as",type:"string",null:!0,default:"contour"}]};G(Hx,D,{transform(e,t){if(this.value&&!t.changed()&&!e.modified())return t.StopPropagation;var n=t.fork(t.NO_SOURCE|t.NO_FIELDS),i=t.materialize(t.SOURCE).source,r=e.field||Vt,o=iR().smooth(e.smooth!==!1),s=e.thresholds||OW(i,r,e),a=e.as===null?null:e.as||"contour",u=[];return i.forEach(l=>{const c=r(l),f=o.size([c.width,c.height])(c.values,P(s)?s:s(c.values));RW(f,c,l,e),f.forEach(d=>{u.push(Sg(l,Ce(a!=null?{[a]:d}:d)))})}),this.value&&(n.rem=this.value),this.value=n.source=n.add=u,n}});function OW(e,t,n){const i=rR(n.levels||10,n.nice,n.zero!==!1);return n.resolve!=="shared"?i:i(e.map(r=>_s(t(r).values)))}function RW(e,t,n,i){let r=i.scale||t.scale,o=i.translate||t.translate;if(ge(r)&&(r=r(n,i)),ge(o)&&(o=o(n,i)),(r===1||r==null)&&!o)return;const s=(Ae(r)?r:r[0])||1,a=(Ae(r)?r:r[1])||1,u=o&&o[0]||0,l=o&&o[1]||0;e.forEach(oR(t,s,a,u,l))}function oR(e,t,n,i,r){const o=e.x1||0,s=e.y1||0,a=t*n<0;function u(f){f.forEach(l)}function l(f){a&&f.reverse(),f.forEach(c)}function c(f){f[0]=(f[0]-o)*t+i,f[1]=(f[1]-s)*n+r}return function(f){return f.coordinates.forEach(u),f}}function q_(e,t,n){const i=e>=0?e:Bb(t,n);return Math.round((Math.sqrt(4*i*i+1)-1)/2)}function qm(e){return ge(e)?e:Yt(+e)}function sR(){var e=u=>u[0],t=u=>u[1],n=ku,i=[-1,-1],r=960,o=500,s=2;function a(u,l){const c=q_(i[0],u,e)>>s,f=q_(i[1],u,t)>>s,d=c?c+2:0,h=f?f+2:0,g=2*d+(r>>s),p=2*h+(o>>s),m=new Float32Array(g*p),y=new Float32Array(g*p);let b=m;u.forEach(x=>{const E=d+(+e(x)>>s),S=h+(+t(x)>>s);E>=0&&E<g&&S>=0&&S<p&&(m[E+S*g]+=+n(x))}),c>0&&f>0?(xa(g,p,m,y,c),wa(g,p,y,m,f),xa(g,p,m,y,c),wa(g,p,y,m,f),xa(g,p,m,y,c),wa(g,p,y,m,f)):c>0?(xa(g,p,m,y,c),xa(g,p,y,m,c),xa(g,p,m,y,c),b=y):f>0&&(wa(g,p,m,y,f),wa(g,p,y,m,f),wa(g,p,m,y,f),b=y);const v=l?Math.pow(2,-2*s):1/qC(b);for(let x=0,E=g*p;x<E;++x)b[x]*=v;return{values:b,scale:1<<s,width:g,height:p,x1:d,y1:h,x2:d+(r>>s),y2:h+(o>>s)}}return a.x=function(u){return arguments.length?(e=qm(u),a):e},a.y=function(u){return arguments.length?(t=qm(u),a):t},a.weight=function(u){return arguments.length?(n=qm(u),a):n},a.size=function(u){if(!arguments.length)return[r,o];var l=+u[0],c=+u[1];return l>=0&&c>=0||N("invalid size"),r=l,o=c,a},a.cellSize=function(u){return arguments.length?((u=+u)>=1||N("invalid cell size"),s=Math.floor(Math.log(u)/Math.LN2),a):1<<s},a.bandwidth=function(u){return arguments.length?(u=X(u),u.length===1&&(u=[+u[0],+u[0]]),u.length!==2&&N("invalid bandwidth"),i=u,a):i},a}function xa(e,t,n,i,r){const o=(r<<1)+1;for(let s=0;s<t;++s)for(let a=0,u=0;a<e+r;++a)a<e&&(u+=n[a+s*e]),a>=r&&(a>=o&&(u-=n[a-o+s*e]),i[a-r+s*e]=u/Math.min(a+1,e-1+o-a,o))}function wa(e,t,n,i,r){const o=(r<<1)+1;for(let s=0;s<e;++s)for(let a=0,u=0;a<t+r;++a)a<t&&(u+=n[s+a*e]),a>=r&&(a>=o&&(u-=n[s+(a-o)*e]),i[s+(a-r)*e]=u/Math.min(a+1,t-1+o-a,o))}function Gx(e){D.call(this,null,e)}Gx.Definition={type:"KDE2D",metadata:{generates:!0},params:[{name:"size",type:"number",array:!0,length:2,required:!0},{name:"x",type:"field",required:!0},{name:"y",type:"field",required:!0},{name:"weight",type:"field"},{name:"groupby",type:"field",array:!0},{name:"cellSize",type:"number"},{name:"bandwidth",type:"number",array:!0,length:2},{name:"counts",type:"boolean",default:!1},{name:"as",type:"string",default:"grid"}]};const NW=["x","y","weight","size","cellSize","bandwidth"];function aR(e,t){return NW.forEach(n=>t[n]!=null?e[n](t[n]):0),e}G(Gx,D,{transform(e,t){if(this.value&&!t.changed()&&!e.modified())return t.StopPropagation;var n=t.fork(t.NO_SOURCE|t.NO_FIELDS),i=t.materialize(t.SOURCE).source,r=LW(i,e.groupby),o=(e.groupby||[]).map(Je),s=aR(sR(),e),a=e.as||"grid",u=[];function l(c,f){for(let d=0;d<o.length;++d)c[o[d]]=f[d];return c}return u=r.map(c=>Ce(l({[a]:s(c,e.counts)},c.dims))),this.value&&(n.rem=this.value),this.value=n.source=n.add=u,n}});function LW(e,t){var n=[],i=c=>c(a),r,o,s,a,u,l;if(t==null)n.push(e);else for(r={},o=0,s=e.length;o<s;++o)a=e[o],u=t.map(i),l=r[u],l||(r[u]=l=[],l.dims=u,n.push(l)),l.push(a);return n}function Vx(e){D.call(this,null,e)}Vx.Definition={type:"Contour",metadata:{generates:!0},params:[{name:"size",type:"number",array:!0,length:2,required:!0},{name:"values",type:"number",array:!0},{name:"x",type:"field"},{name:"y",type:"field"},{name:"weight",type:"field"},{name:"cellSize",type:"number"},{name:"bandwidth",type:"number"},{name:"count",type:"number"},{name:"nice",type:"boolean",default:!1},{name:"thresholds",type:"number",array:!0},{name:"smooth",type:"boolean",default:!0}]};G(Vx,D,{transform(e,t){if(this.value&&!t.changed()&&!e.modified())return t.StopPropagation;var n=t.fork(t.NO_SOURCE|t.NO_FIELDS),i=iR().smooth(e.smooth!==!1),r=e.values,o=e.thresholds||rR(e.count||10,e.nice,!!r),s=e.size,a,u;return r||(r=t.materialize(t.SOURCE).source,a=aR(sR(),e)(r,!0),u=oR(a,a.scale||1,a.scale||1,0,0),s=[a.width,a.height],r=a.values),o=P(o)?o:o(r),r=i.size(s)(r,o),u&&r.forEach(u),this.value&&(n.rem=this.value),this.value=n.source=n.add=(r||[]).map(Ce),n}});const ny="Feature",Yx="FeatureCollection",PW="MultiPoint";function Xx(e){D.call(this,null,e)}Xx.Definition={type:"GeoJSON",metadata:{},params:[{name:"fields",type:"field",array:!0,length:2},{name:"geojson",type:"field"}]};G(Xx,D,{transform(e,t){var n=this._features,i=this._points,r=e.fields,o=r&&r[0],s=r&&r[1],a=e.geojson||!r&&Vt,u=t.ADD,l;l=e.modified()||t.changed(t.REM)||t.modified(qt(a))||o&&t.modified(qt(o))||s&&t.modified(qt(s)),(!this.value||l)&&(u=t.SOURCE,this._features=n=[],this._points=i=[]),a&&t.visit(u,c=>n.push(a(c))),o&&s&&(t.visit(u,c=>{var f=o(c),d=s(c);f!=null&&d!=null&&(f=+f)===f&&(d=+d)===d&&i.push([f,d])}),n=n.concat({type:ny,geometry:{type:PW,coordinates:i}})),this.value={type:Yx,features:n}}});function Kx(e){D.call(this,null,e)}Kx.Definition={type:"GeoPath",metadata:{modifies:!0},params:[{name:"projection",type:"projection"},{name:"field",type:"field"},{name:"pointRadius",type:"number",expr:!0},{name:"as",type:"string",default:"path"}]};G(Kx,D,{transform(e,t){var n=t.fork(t.ALL),i=this.value,r=e.field||Vt,o=e.as||"path",s=n.SOURCE;!i||e.modified()?(this.value=i=nR(e.projection),n.materialize().reflow()):s=r===Vt||t.modified(r.fields)?n.ADD_MOD:n.ADD;const a=IW(i,e.pointRadius);return n.visit(s,u=>u[o]=i(r(u))),i.pointRadius(a),n.modifies(o)}});function IW(e,t){const n=e.pointRadius();return e.context(null),t!=null&&e.pointRadius(t),n}function Jx(e){D.call(this,null,e)}Jx.Definition={type:"GeoPoint",metadata:{modifies:!0},params:[{name:"projection",type:"projection",required:!0},{name:"fields",type:"field",array:!0,required:!0,length:2},{name:"as",type:"string",array:!0,length:2,default:["x","y"]}]};G(Jx,D,{transform(e,t){var n=e.projection,i=e.fields[0],r=e.fields[1],o=e.as||["x","y"],s=o[0],a=o[1],u;function l(c){const f=n([i(c),r(c)]);f?(c[s]=f[0],c[a]=f[1]):(c[s]=void 0,c[a]=void 0)}return e.modified()?t=t.materialize().reflow(!0).visit(t.SOURCE,l):(u=t.modified(i.fields)||t.modified(r.fields),t.visit(u?t.ADD_MOD:t.ADD,l)),t.modifies(o)}});function Qx(e){D.call(this,null,e)}Qx.Definition={type:"GeoShape",metadata:{modifies:!0,nomod:!0},params:[{name:"projection",type:"projection"},{name:"field",type:"field",default:"datum"},{name:"pointRadius",type:"number",expr:!0},{name:"as",type:"string",default:"shape"}]};G(Qx,D,{transform(e,t){var n=t.fork(t.ALL),i=this.value,r=e.as||"shape",o=n.ADD;return(!i||e.modified())&&(this.value=i=zW(nR(e.projection),e.field||Qn("datum"),e.pointRadius),n.materialize().reflow(),o=n.SOURCE),n.visit(o,s=>s[r]=i),n.modifies(r)}});function zW(e,t,n){const i=n==null?r=>e(t(r)):r=>{var o=e.pointRadius(),s=e.pointRadius(n)(t(r));return e.pointRadius(o),s};return i.context=r=>(e.context(r),i),i}function Zx(e){D.call(this,[],e),this.generator=Oq()}Zx.Definition={type:"Graticule",metadata:{changes:!0,generates:!0},params:[{name:"extent",type:"array",array:!0,length:2,content:{type:"number",array:!0,length:2}},{name:"extentMajor",type:"array",array:!0,length:2,content:{type:"number",array:!0,length:2}},{name:"extentMinor",type:"array",array:!0,length:2,content:{type:"number",array:!0,length:2}},{name:"step",type:"number",array:!0,length:2},{name:"stepMajor",type:"number",array:!0,length:2,default:[90,360]},{name:"stepMinor",type:"number",array:!0,length:2,default:[10,10]},{name:"precision",type:"number",default:2.5}]};G(Zx,D,{transform(e,t){var n=this.value,i=this.generator,r;if(!n.length||e.modified())for(const o in e)ge(i[o])&&i[o](e[o]);return r=i(),n.length?t.mod.push(OF(n[0],r)):t.add.push(Ce(r)),n[0]=r,t}});function e2(e){D.call(this,null,e)}e2.Definition={type:"heatmap",metadata:{modifies:!0},params:[{name:"field",type:"field"},{name:"color",type:"string",expr:!0},{name:"opacity",type:"number",expr:!0},{name:"resolve",type:"enum",values:["shared","independent"],default:"independent"},{name:"as",type:"string",default:"image"}]};G(e2,D,{transform(e,t){if(!t.changed()&&!e.modified())return t.StopPropagation;var n=t.materialize(t.SOURCE).source,i=e.resolve==="shared",r=e.field||Vt,o=UW(e.opacity,e),s=BW(e.color,e),a=e.as||"image",u={$x:0,$y:0,$value:0,$max:i?_s(n.map(l=>_s(r(l).values))):0};return n.forEach(l=>{const c=r(l),f=he({},l,u);i||(f.$max=_s(c.values||[])),l[a]=jW(c,f,s.dep?s:Yt(s(f)),o.dep?o:Yt(o(f)))}),t.reflow(!0).modifies(a)}});function BW(e,t){let n;return ge(e)?(n=i=>Rd(e(i,t)),n.dep=uR(e)):n=Yt(Rd(e||"#888")),n}function UW(e,t){let n;return ge(e)?(n=i=>e(i,t),n.dep=uR(e)):e?n=Yt(e):(n=i=>i.$value/i.$max||0,n.dep=!0),n}function uR(e){if(!ge(e))return!1;const t=xi(qt(e));return t.$x||t.$y||t.$value||t.$max}function jW(e,t,n,i){const r=e.width,o=e.height,s=e.x1||0,a=e.y1||0,u=e.x2||r,l=e.y2||o,c=e.values,f=c?m=>c[m]:fo,d=$o(u-s,l-a),h=d.getContext("2d"),g=h.getImageData(0,0,u-s,l-a),p=g.data;for(let m=a,y=0;m<l;++m){t.$y=m-a;for(let b=s,v=m*r;b<u;++b,y+=4){t.$x=b-s,t.$value=f(b+v);const x=n(t);p[y+0]=x.r,p[y+1]=x.g,p[y+2]=x.b,p[y+3]=~~(255*i(t))}}return h.putImageData(g,0,0),d}function lR(e){D.call(this,null,e),this.modified(!0)}G(lR,D,{transform(e,t){let n=this.value;return!n||e.modified("type")?(this.value=n=WW(e.type),ty.forEach(i=>{e[i]!=null&&W_(n,i,e[i])})):ty.forEach(i=>{e.modified(i)&&W_(n,i,e[i])}),e.pointRadius!=null&&n.path.pointRadius(e.pointRadius),e.fit&&qW(n,e),t.fork(t.NO_SOURCE|t.NO_FIELDS)}});function qW(e,t){const n=HW(t.fit);t.extent?e.fitExtent(t.extent,n):t.size&&e.fitSize(t.size,n)}function WW(e){const t=Wx((e||"mercator").toLowerCase());return t||N("Unrecognized projection type: "+e),t()}function W_(e,t,n){ge(e[t])&&e[t](n)}function HW(e){return e=X(e),e.length===1?e[0]:{type:Yx,features:e.reduce((t,n)=>t.concat(GW(n)),[])}}function GW(e){return e.type===Yx?e.features:X(e).filter(t=>t!=null).map(t=>t.type===ny?t:{type:ny,geometry:t})}const VW=Object.freeze(Object.defineProperty({__proto__:null,contour:Vx,geojson:Xx,geopath:Kx,geopoint:Jx,geoshape:Qx,graticule:Zx,heatmap:e2,isocontour:Hx,kde2d:Gx,projection:lR},Symbol.toStringTag,{value:"Module"}));function YW(e,t){var n,i=1;e==null&&(e=0),t==null&&(t=0);function r(){var o,s=n.length,a,u=0,l=0;for(o=0;o<s;++o)a=n[o],u+=a.x,l+=a.y;for(u=(u/s-e)*i,l=(l/s-t)*i,o=0;o<s;++o)a=n[o],a.x-=u,a.y-=l}return r.initialize=function(o){n=o},r.x=function(o){return arguments.length?(e=+o,r):e},r.y=function(o){return arguments.length?(t=+o,r):t},r.strength=function(o){return arguments.length?(i=+o,r):i},r}function XW(e){const t=+this._x.call(null,e),n=+this._y.call(null,e);return cR(this.cover(t,n),t,n,e)}function cR(e,t,n,i){if(isNaN(t)||isNaN(n))return e;var r,o=e._root,s={data:i},a=e._x0,u=e._y0,l=e._x1,c=e._y1,f,d,h,g,p,m,y,b;if(!o)return e._root=s,e;for(;o.length;)if((p=t>=(f=(a+l)/2))?a=f:l=f,(m=n>=(d=(u+c)/2))?u=d:c=d,r=o,!(o=o[y=m<<1|p]))return r[y]=s,e;if(h=+e._x.call(null,o.data),g=+e._y.call(null,o.data),t===h&&n===g)return s.next=o,r?r[y]=s:e._root=s,e;do r=r?r[y]=new Array(4):e._root=new Array(4),(p=t>=(f=(a+l)/2))?a=f:l=f,(m=n>=(d=(u+c)/2))?u=d:c=d;while((y=m<<1|p)===(b=(g>=d)<<1|h>=f));return r[b]=o,r[y]=s,e}function KW(e){var t,n,i=e.length,r,o,s=new Array(i),a=new Array(i),u=1/0,l=1/0,c=-1/0,f=-1/0;for(n=0;n<i;++n)isNaN(r=+this._x.call(null,t=e[n]))||isNaN(o=+this._y.call(null,t))||(s[n]=r,a[n]=o,r<u&&(u=r),r>c&&(c=r),o<l&&(l=o),o>f&&(f=o));if(u>c||l>f)return this;for(this.cover(u,l).cover(c,f),n=0;n<i;++n)cR(this,s[n],a[n],e[n]);return this}function JW(e,t){if(isNaN(e=+e)||isNaN(t=+t))return this;var n=this._x0,i=this._y0,r=this._x1,o=this._y1;if(isNaN(n))r=(n=Math.floor(e))+1,o=(i=Math.floor(t))+1;else{for(var s=r-n||1,a=this._root,u,l;n>e||e>=r||i>t||t>=o;)switch(l=(t<i)<<1|e<n,u=new Array(4),u[l]=a,a=u,s*=2,l){case 0:r=n+s,o=i+s;break;case 1:n=r-s,o=i+s;break;case 2:r=n+s,i=o-s;break;case 3:n=r-s,i=o-s;break}this._root&&this._root.length&&(this._root=a)}return this._x0=n,this._y0=i,this._x1=r,this._y1=o,this}function QW(){var e=[];return this.visit(function(t){if(!t.length)do e.push(t.data);while(t=t.next)}),e}function ZW(e){return arguments.length?this.cover(+e[0][0],+e[0][1]).cover(+e[1][0],+e[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]}function nn(e,t,n,i,r){this.node=e,this.x0=t,this.y0=n,this.x1=i,this.y1=r}function eH(e,t,n){var i,r=this._x0,o=this._y0,s,a,u,l,c=this._x1,f=this._y1,d=[],h=this._root,g,p;for(h&&d.push(new nn(h,r,o,c,f)),n==null?n=1/0:(r=e-n,o=t-n,c=e+n,f=t+n,n*=n);g=d.pop();)if(!(!(h=g.node)||(s=g.x0)>c||(a=g.y0)>f||(u=g.x1)<r||(l=g.y1)<o))if(h.length){var m=(s+u)/2,y=(a+l)/2;d.push(new nn(h[3],m,y,u,l),new nn(h[2],s,y,m,l),new nn(h[1],m,a,u,y),new nn(h[0],s,a,m,y)),(p=(t>=y)<<1|e>=m)&&(g=d[d.length-1],d[d.length-1]=d[d.length-1-p],d[d.length-1-p]=g)}else{var b=e-+this._x.call(null,h.data),v=t-+this._y.call(null,h.data),x=b*b+v*v;if(x<n){var E=Math.sqrt(n=x);r=e-E,o=t-E,c=e+E,f=t+E,i=h.data}}return i}function tH(e){if(isNaN(c=+this._x.call(null,e))||isNaN(f=+this._y.call(null,e)))return this;var t,n=this._root,i,r,o,s=this._x0,a=this._y0,u=this._x1,l=this._y1,c,f,d,h,g,p,m,y;if(!n)return this;if(n.length)for(;;){if((g=c>=(d=(s+u)/2))?s=d:u=d,(p=f>=(h=(a+l)/2))?a=h:l=h,t=n,!(n=n[m=p<<1|g]))return this;if(!n.length)break;(t[m+1&3]||t[m+2&3]||t[m+3&3])&&(i=t,y=m)}for(;n.data!==e;)if(r=n,!(n=n.next))return this;return(o=n.next)&&delete n.next,r?(o?r.next=o:delete r.next,this):t?(o?t[m]=o:delete t[m],(n=t[0]||t[1]||t[2]||t[3])&&n===(t[3]||t[2]||t[1]||t[0])&&!n.length&&(i?i[y]=n:this._root=n),this):(this._root=o,this)}function nH(e){for(var t=0,n=e.length;t<n;++t)this.remove(e[t]);return this}function iH(){return this._root}function rH(){var e=0;return this.visit(function(t){if(!t.length)do++e;while(t=t.next)}),e}function oH(e){var t=[],n,i=this._root,r,o,s,a,u;for(i&&t.push(new nn(i,this._x0,this._y0,this._x1,this._y1));n=t.pop();)if(!e(i=n.node,o=n.x0,s=n.y0,a=n.x1,u=n.y1)&&i.length){var l=(o+a)/2,c=(s+u)/2;(r=i[3])&&t.push(new nn(r,l,c,a,u)),(r=i[2])&&t.push(new nn(r,o,c,l,u)),(r=i[1])&&t.push(new nn(r,l,s,a,c)),(r=i[0])&&t.push(new nn(r,o,s,l,c))}return this}function sH(e){var t=[],n=[],i;for(this._root&&t.push(new nn(this._root,this._x0,this._y0,this._x1,this._y1));i=t.pop();){var r=i.node;if(r.length){var o,s=i.x0,a=i.y0,u=i.x1,l=i.y1,c=(s+u)/2,f=(a+l)/2;(o=r[0])&&t.push(new nn(o,s,a,c,f)),(o=r[1])&&t.push(new nn(o,c,a,u,f)),(o=r[2])&&t.push(new nn(o,s,f,c,l)),(o=r[3])&&t.push(new nn(o,c,f,u,l))}n.push(i)}for(;i=n.pop();)e(i.node,i.x0,i.y0,i.x1,i.y1);return this}function aH(e){return e[0]}function uH(e){return arguments.length?(this._x=e,this):this._x}function lH(e){return e[1]}function cH(e){return arguments.length?(this._y=e,this):this._y}function t2(e,t,n){var i=new n2(t??aH,n??lH,NaN,NaN,NaN,NaN);return e==null?i:i.addAll(e)}function n2(e,t,n,i,r,o){this._x=e,this._y=t,this._x0=n,this._y0=i,this._x1=r,this._y1=o,this._root=void 0}function H_(e){for(var t={data:e.data},n=t;e=e.next;)n=n.next={data:e.data};return t}var fn=t2.prototype=n2.prototype;fn.copy=function(){var e=new n2(this._x,this._y,this._x0,this._y0,this._x1,this._y1),t=this._root,n,i;if(!t)return e;if(!t.length)return e._root=H_(t),e;for(n=[{source:t,target:e._root=new Array(4)}];t=n.pop();)for(var r=0;r<4;++r)(i=t.source[r])&&(i.length?n.push({source:i,target:t.target[r]=new Array(4)}):t.target[r]=H_(i));return e};fn.add=XW;fn.addAll=KW;fn.cover=JW;fn.data=QW;fn.extent=ZW;fn.find=eH;fn.remove=tH;fn.removeAll=nH;fn.root=iH;fn.size=rH;fn.visit=oH;fn.visitAfter=sH;fn.x=uH;fn.y=cH;function rn(e){return function(){return e}}function xo(e){return(e()-.5)*1e-6}function fH(e){return e.x+e.vx}function dH(e){return e.y+e.vy}function hH(e){var t,n,i,r=1,o=1;typeof e!="function"&&(e=rn(e==null?1:+e));function s(){for(var l,c=t.length,f,d,h,g,p,m,y=0;y<o;++y)for(f=t2(t,fH,dH).visitAfter(a),l=0;l<c;++l)d=t[l],p=n[d.index],m=p*p,h=d.x+d.vx,g=d.y+d.vy,f.visit(b);function b(v,x,E,S,w){var _=v.data,A=v.r,k=p+A;if(_){if(_.index>d.index){var C=h-_.x-_.vx,O=g-_.y-_.vy,M=C*C+O*O;M<k*k&&(C===0&&(C=xo(i),M+=C*C),O===0&&(O=xo(i),M+=O*O),M=(k-(M=Math.sqrt(M)))/M*r,d.vx+=(C*=M)*(k=(A*=A)/(m+A)),d.vy+=(O*=M)*k,_.vx-=C*(k=1-k),_.vy-=O*k)}return}return x>h+k||S<h-k||E>g+k||w<g-k}}function a(l){if(l.data)return l.r=n[l.data.index];for(var c=l.r=0;c<4;++c)l[c]&&l[c].r>l.r&&(l.r=l[c].r)}function u(){if(t){var l,c=t.length,f;for(n=new Array(c),l=0;l<c;++l)f=t[l],n[f.index]=+e(f,l,t)}}return s.initialize=function(l,c){t=l,i=c,u()},s.iterations=function(l){return arguments.length?(o=+l,s):o},s.strength=function(l){return arguments.length?(r=+l,s):r},s.radius=function(l){return arguments.length?(e=typeof l=="function"?l:rn(+l),u(),s):e},s}function gH(e){return e.index}function G_(e,t){var n=e.get(t);if(!n)throw new Error("node not found: "+t);return n}function pH(e){var t=gH,n=f,i,r=rn(30),o,s,a,u,l,c=1;e==null&&(e=[]);function f(m){return 1/Math.min(a[m.source.index],a[m.target.index])}function d(m){for(var y=0,b=e.length;y<c;++y)for(var v=0,x,E,S,w,_,A,k;v<b;++v)x=e[v],E=x.source,S=x.target,w=S.x+S.vx-E.x-E.vx||xo(l),_=S.y+S.vy-E.y-E.vy||xo(l),A=Math.sqrt(w*w+_*_),A=(A-o[v])/A*m*i[v],w*=A,_*=A,S.vx-=w*(k=u[v]),S.vy-=_*k,E.vx+=w*(k=1-k),E.vy+=_*k}function h(){if(s){var m,y=s.length,b=e.length,v=new Map(s.map((E,S)=>[t(E,S,s),E])),x;for(m=0,a=new Array(y);m<b;++m)x=e[m],x.index=m,typeof x.source!="object"&&(x.source=G_(v,x.source)),typeof x.target!="object"&&(x.target=G_(v,x.target)),a[x.source.index]=(a[x.source.index]||0)+1,a[x.target.index]=(a[x.target.index]||0)+1;for(m=0,u=new Array(b);m<b;++m)x=e[m],u[m]=a[x.source.index]/(a[x.source.index]+a[x.target.index]);i=new Array(b),g(),o=new Array(b),p()}}function g(){if(s)for(var m=0,y=e.length;m<y;++m)i[m]=+n(e[m],m,e)}function p(){if(s)for(var m=0,y=e.length;m<y;++m)o[m]=+r(e[m],m,e)}return d.initialize=function(m,y){s=m,l=y,h()},d.links=function(m){return arguments.length?(e=m,h(),d):e},d.id=function(m){return arguments.length?(t=m,d):t},d.iterations=function(m){return arguments.length?(c=+m,d):c},d.strength=function(m){return arguments.length?(n=typeof m=="function"?m:rn(+m),g(),d):n},d.distance=function(m){return arguments.length?(r=typeof m=="function"?m:rn(+m),p(),d):r},d}function mH(e,t,n){var i=new hI,r=t;return t==null?(i.restart(e,t,n),i):(i._restart=i.restart,i.restart=function(o,s,a){s=+s,a=a==null?gI():+a,i._restart(function u(l){l+=r,i._restart(u,r+=s,a),o(l)},s,a)},i.restart(e,t,n),i)}const yH=1664525,bH=1013904223,V_=4294967296;function vH(){let e=1;return()=>(e=(yH*e+bH)%V_)/V_}function xH(e){return e.x}function wH(e){return e.y}var EH=10,SH=Math.PI*(3-Math.sqrt(5));function _H(e){var t,n=1,i=.001,r=1-Math.pow(i,1/300),o=0,s=.6,a=new Map,u=pI(f),l=mI("tick","end"),c=vH();e==null&&(e=[]);function f(){d(),l.call("tick",t),n<i&&(u.stop(),l.call("end",t))}function d(p){var m,y=e.length,b;p===void 0&&(p=1);for(var v=0;v<p;++v)for(n+=(o-n)*r,a.forEach(function(x){x(n)}),m=0;m<y;++m)b=e[m],b.fx==null?b.x+=b.vx*=s:(b.x=b.fx,b.vx=0),b.fy==null?b.y+=b.vy*=s:(b.y=b.fy,b.vy=0);return t}function h(){for(var p=0,m=e.length,y;p<m;++p){if(y=e[p],y.index=p,y.fx!=null&&(y.x=y.fx),y.fy!=null&&(y.y=y.fy),isNaN(y.x)||isNaN(y.y)){var b=EH*Math.sqrt(.5+p),v=p*SH;y.x=b*Math.cos(v),y.y=b*Math.sin(v)}(isNaN(y.vx)||isNaN(y.vy))&&(y.vx=y.vy=0)}}function g(p){return p.initialize&&p.initialize(e,c),p}return h(),t={tick:d,restart:function(){return u.restart(f),t},stop:function(){return u.stop(),t},nodes:function(p){return arguments.length?(e=p,h(),a.forEach(g),t):e},alpha:function(p){return arguments.length?(n=+p,t):n},alphaMin:function(p){return arguments.length?(i=+p,t):i},alphaDecay:function(p){return arguments.length?(r=+p,t):+r},alphaTarget:function(p){return arguments.length?(o=+p,t):o},velocityDecay:function(p){return arguments.length?(s=1-p,t):1-s},randomSource:function(p){return arguments.length?(c=p,a.forEach(g),t):c},force:function(p,m){return arguments.length>1?(m==null?a.delete(p):a.set(p,g(m)),t):a.get(p)},find:function(p,m,y){var b=0,v=e.length,x,E,S,w,_;for(y==null?y=1/0:y*=y,b=0;b<v;++b)w=e[b],x=p-w.x,E=m-w.y,S=x*x+E*E,S<y&&(_=w,y=S);return _},on:function(p,m){return arguments.length>1?(l.on(p,m),t):l.on(p)}}}function AH(){var e,t,n,i,r=rn(-30),o,s=1,a=1/0,u=.81;function l(h){var g,p=e.length,m=t2(e,xH,wH).visitAfter(f);for(i=h,g=0;g<p;++g)t=e[g],m.visit(d)}function c(){if(e){var h,g=e.length,p;for(o=new Array(g),h=0;h<g;++h)p=e[h],o[p.index]=+r(p,h,e)}}function f(h){var g=0,p,m,y=0,b,v,x;if(h.length){for(b=v=x=0;x<4;++x)(p=h[x])&&(m=Math.abs(p.value))&&(g+=p.value,y+=m,b+=m*p.x,v+=m*p.y);h.x=b/y,h.y=v/y}else{p=h,p.x=p.data.x,p.y=p.data.y;do g+=o[p.data.index];while(p=p.next)}h.value=g}function d(h,g,p,m){if(!h.value)return!0;var y=h.x-t.x,b=h.y-t.y,v=m-g,x=y*y+b*b;if(v*v/u<x)return x<a&&(y===0&&(y=xo(n),x+=y*y),b===0&&(b=xo(n),x+=b*b),x<s&&(x=Math.sqrt(s*x)),t.vx+=y*h.value*i/x,t.vy+=b*h.value*i/x),!0;if(h.length||x>=a)return;(h.data!==t||h.next)&&(y===0&&(y=xo(n),x+=y*y),b===0&&(b=xo(n),x+=b*b),x<s&&(x=Math.sqrt(s*x)));do h.data!==t&&(v=o[h.data.index]*i/x,t.vx+=y*v,t.vy+=b*v);while(h=h.next)}return l.initialize=function(h,g){e=h,n=g,c()},l.strength=function(h){return arguments.length?(r=typeof h=="function"?h:rn(+h),c(),l):r},l.distanceMin=function(h){return arguments.length?(s=h*h,l):Math.sqrt(s)},l.distanceMax=function(h){return arguments.length?(a=h*h,l):Math.sqrt(a)},l.theta=function(h){return arguments.length?(u=h*h,l):Math.sqrt(u)},l}function $H(e){var t=rn(.1),n,i,r;typeof e!="function"&&(e=rn(e==null?0:+e));function o(a){for(var u=0,l=n.length,c;u<l;++u)c=n[u],c.vx+=(r[u]-c.x)*i[u]*a}function s(){if(n){var a,u=n.length;for(i=new Array(u),r=new Array(u),a=0;a<u;++a)i[a]=isNaN(r[a]=+e(n[a],a,n))?0:+t(n[a],a,n)}}return o.initialize=function(a){n=a,s()},o.strength=function(a){return arguments.length?(t=typeof a=="function"?a:rn(+a),s(),o):t},o.x=function(a){return arguments.length?(e=typeof a=="function"?a:rn(+a),s(),o):e},o}function kH(e){var t=rn(.1),n,i,r;typeof e!="function"&&(e=rn(e==null?0:+e));function o(a){for(var u=0,l=n.length,c;u<l;++u)c=n[u],c.vy+=(r[u]-c.y)*i[u]*a}function s(){if(n){var a,u=n.length;for(i=new Array(u),r=new Array(u),a=0;a<u;++a)i[a]=isNaN(r[a]=+e(n[a],a,n))?0:+t(n[a],a,n)}}return o.initialize=function(a){n=a,s()},o.strength=function(a){return arguments.length?(t=typeof a=="function"?a:rn(+a),s(),o):t},o.y=function(a){return arguments.length?(e=typeof a=="function"?a:rn(+a),s(),o):e},o}const Y_={center:YW,collide:hH,nbody:AH,link:pH,x:$H,y:kH},Pl="forces",iy=["alpha","alphaMin","alphaTarget","velocityDecay","forces"],CH=["static","iterations"],fR=["x","y","vx","vy"];function i2(e){D.call(this,null,e)}i2.Definition={type:"Force",metadata:{modifies:!0},params:[{name:"static",type:"boolean",default:!1},{name:"restart",type:"boolean",default:!1},{name:"iterations",type:"number",default:300},{name:"alpha",type:"number",default:1},{name:"alphaMin",type:"number",default:.001},{name:"alphaTarget",type:"number",default:0},{name:"velocityDecay",type:"number",default:.4},{name:"forces",type:"param",array:!0,params:[{key:{force:"center"},params:[{name:"x",type:"number",default:0},{name:"y",type:"number",default:0}]},{key:{force:"collide"},params:[{name:"radius",type:"number",expr:!0},{name:"strength",type:"number",default:.7},{name:"iterations",type:"number",default:1}]},{key:{force:"nbody"},params:[{name:"strength",type:"number",default:-30,expr:!0},{name:"theta",type:"number",default:.9},{name:"distanceMin",type:"number",default:1},{name:"distanceMax",type:"number"}]},{key:{force:"link"},params:[{name:"links",type:"data"},{name:"id",type:"field"},{name:"distance",type:"number",default:30,expr:!0},{name:"strength",type:"number",expr:!0},{name:"iterations",type:"number",default:1}]},{key:{force:"x"},params:[{name:"strength",type:"number",default:.1},{name:"x",type:"field"}]},{key:{force:"y"},params:[{name:"strength",type:"number",default:.1},{name:"y",type:"field"}]}]},{name:"as",type:"string",array:!0,modify:!1,default:fR}]};G(i2,D,{transform(e,t){var n=this.value,i=t.changed(t.ADD_REM),r=e.modified(iy),o=e.iterations||300;if(n?(i&&(t.modifies("index"),n.nodes(t.source)),(r||t.changed(t.MOD))&&dR(n,e,0,t)):(this.value=n=TH(t.source,e),n.on("tick",FH(t.dataflow,this)),e.static||(i=!0,n.tick()),t.modifies("index")),r||i||e.modified(CH)||t.changed()&&e.restart){if(n.alpha(Math.max(n.alpha(),e.alpha||1)).alphaDecay(1-Math.pow(n.alphaMin(),1/o)),e.static)for(n.stop();--o>=0;)n.tick();else if(n.stopped()&&n.restart(),!i)return t.StopPropagation}return this.finish(e,t)},finish(e,t){const n=t.dataflow;for(let a=this._argops,u=0,l=a.length,c;u<l;++u)if(c=a[u],!(c.name!==Pl||c.op._argval.force!=="link")){for(var i=c.op._argops,r=0,o=i.length,s;r<o;++r)if(i[r].name==="links"&&(s=i[r].op.source)){n.pulse(s,n.changeset().reflow());break}}return t.reflow(e.modified()).modifies(fR)}});function FH(e,t){return()=>e.touch(t).run()}function TH(e,t){const n=_H(e),i=n.stop,r=n.restart;let o=!1;return n.stopped=()=>o,n.restart=()=>(o=!1,r()),n.stop=()=>(o=!0,i()),dR(n,t,!0).on("end",()=>o=!0)}function dR(e,t,n,i){var r=X(t.forces),o,s,a,u;for(o=0,s=iy.length;o<s;++o)a=iy[o],a!==Pl&&t.modified(a)&&e[a](t[a]);for(o=0,s=r.length;o<s;++o)u=Pl+o,a=n||t.modified(Pl,o)?DH(r[o]):i&&MH(r[o],i)?e.force(u):null,a&&e.force(u,a);for(s=e.numForces||0;o<s;++o)e.force(Pl+o,null);return e.numForces=r.length,e}function MH(e,t){var n,i;for(n in e)if(ge(i=e[n])&&t.modified(qt(i)))return 1;return 0}function DH(e){var t,n;J(Y_,e.force)||N("Unrecognized force: "+e.force),t=Y_[e.force]();for(n in e)ge(t[n])&&OH(t[n],e[n],e);return t}function OH(e,t,n){e(ge(t)?i=>t(i,n):t)}const RH=Object.freeze(Object.defineProperty({__proto__:null,force:i2},Symbol.toStringTag,{value:"Module"}));function NH(e,t){return e.parent===t.parent?1:2}function LH(e){return e.reduce(PH,0)/e.length}function PH(e,t){return e+t.x}function IH(e){return 1+e.reduce(zH,0)}function zH(e,t){return Math.max(e,t.y)}function BH(e){for(var t;t=e.children;)e=t[0];return e}function UH(e){for(var t;t=e.children;)e=t[t.length-1];return e}function jH(){var e=NH,t=1,n=1,i=!1;function r(o){var s,a=0;o.eachAfter(function(d){var h=d.children;h?(d.x=LH(h),d.y=IH(h)):(d.x=s?a+=e(d,s):0,d.y=0,s=d)});var u=BH(o),l=UH(o),c=u.x-e(u,l)/2,f=l.x+e(l,u)/2;return o.eachAfter(i?function(d){d.x=(d.x-o.x)*t,d.y=(o.y-d.y)*n}:function(d){d.x=(d.x-c)/(f-c)*t,d.y=(1-(o.y?d.y/o.y:1))*n})}return r.separation=function(o){return arguments.length?(e=o,r):e},r.size=function(o){return arguments.length?(i=!1,t=+o[0],n=+o[1],r):i?null:[t,n]},r.nodeSize=function(o){return arguments.length?(i=!0,t=+o[0],n=+o[1],r):i?[t,n]:null},r}function qH(e){var t=0,n=e.children,i=n&&n.length;if(!i)t=1;else for(;--i>=0;)t+=n[i].value;e.value=t}function WH(){return this.eachAfter(qH)}function HH(e,t){let n=-1;for(const i of this)e.call(t,i,++n,this);return this}function GH(e,t){for(var n=this,i=[n],r,o,s=-1;n=i.pop();)if(e.call(t,n,++s,this),r=n.children)for(o=r.length-1;o>=0;--o)i.push(r[o]);return this}function VH(e,t){for(var n=this,i=[n],r=[],o,s,a,u=-1;n=i.pop();)if(r.push(n),o=n.children)for(s=0,a=o.length;s<a;++s)i.push(o[s]);for(;n=r.pop();)e.call(t,n,++u,this);return this}function YH(e,t){let n=-1;for(const i of this)if(e.call(t,i,++n,this))return i}function XH(e){return this.eachAfter(function(t){for(var n=+e(t.data)||0,i=t.children,r=i&&i.length;--r>=0;)n+=i[r].value;t.value=n})}function KH(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})}function JH(e){for(var t=this,n=QH(t,e),i=[t];t!==n;)t=t.parent,i.push(t);for(var r=i.length;e!==n;)i.splice(r,0,e),e=e.parent;return i}function QH(e,t){if(e===t)return e;var n=e.ancestors(),i=t.ancestors(),r=null;for(e=n.pop(),t=i.pop();e===t;)r=e,e=n.pop(),t=i.pop();return r}function ZH(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t}function eG(){return Array.from(this)}function tG(){var e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e}function nG(){var e=this,t=[];return e.each(function(n){n!==e&&t.push({source:n.parent,target:n})}),t}function*iG(){var e=this,t,n=[e],i,r,o;do for(t=n.reverse(),n=[];e=t.pop();)if(yield e,i=e.children)for(r=0,o=i.length;r<o;++r)n.push(i[r]);while(n.length)}function r2(e,t){e instanceof Map?(e=[void 0,e],t===void 0&&(t=sG)):t===void 0&&(t=oG);for(var n=new uu(e),i,r=[n],o,s,a,u;i=r.pop();)if((s=t(i.data))&&(u=(s=Array.from(s)).length))for(i.children=s,a=u-1;a>=0;--a)r.push(o=s[a]=new uu(s[a])),o.parent=i,o.depth=i.depth+1;return n.eachBefore(hR)}function rG(){return r2(this).eachBefore(aG)}function oG(e){return e.children}function sG(e){return Array.isArray(e)?e[1]:null}function aG(e){e.data.value!==void 0&&(e.value=e.data.value),e.data=e.data.data}function hR(e){var t=0;do e.height=t;while((e=e.parent)&&e.height<++t)}function uu(e){this.data=e,this.depth=this.height=0,this.parent=null}uu.prototype=r2.prototype={constructor:uu,count:WH,each:HH,eachAfter:VH,eachBefore:GH,find:YH,sum:XH,sort:KH,path:JH,ancestors:ZH,descendants:eG,leaves:tG,links:nG,copy:rG,[Symbol.iterator]:iG};function Ed(e){return e==null?null:gR(e)}function gR(e){if(typeof e!="function")throw new Error;return e}function xs(){return 0}function Ca(e){return function(){return e}}const uG=1664525,lG=1013904223,X_=4294967296;function cG(){let e=1;return()=>(e=(uG*e+lG)%X_)/X_}function fG(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function dG(e,t){let n=e.length,i,r;for(;n;)r=t()*n--|0,i=e[n],e[n]=e[r],e[r]=i;return e}function hG(e,t){for(var n=0,i=(e=dG(Array.from(e),t)).length,r=[],o,s;n<i;)o=e[n],s&&pR(s,o)?++n:(s=pG(r=gG(r,o)),n=0);return s}function gG(e,t){var n,i;if(Wm(t,e))return[t];for(n=0;n<e.length;++n)if(jf(t,e[n])&&Wm(Il(e[n],t),e))return[e[n],t];for(n=0;n<e.length-1;++n)for(i=n+1;i<e.length;++i)if(jf(Il(e[n],e[i]),t)&&jf(Il(e[n],t),e[i])&&jf(Il(e[i],t),e[n])&&Wm(mR(e[n],e[i],t),e))return[e[n],e[i],t];throw new Error}function jf(e,t){var n=e.r-t.r,i=t.x-e.x,r=t.y-e.y;return n<0||n*n<i*i+r*r}function pR(e,t){var n=e.r-t.r+Math.max(e.r,t.r,1)*1e-9,i=t.x-e.x,r=t.y-e.y;return n>0&&n*n>i*i+r*r}function Wm(e,t){for(var n=0;n<t.length;++n)if(!pR(e,t[n]))return!1;return!0}function pG(e){switch(e.length){case 1:return mG(e[0]);case 2:return Il(e[0],e[1]);case 3:return mR(e[0],e[1],e[2])}}function mG(e){return{x:e.x,y:e.y,r:e.r}}function Il(e,t){var n=e.x,i=e.y,r=e.r,o=t.x,s=t.y,a=t.r,u=o-n,l=s-i,c=a-r,f=Math.sqrt(u*u+l*l);return{x:(n+o+u/f*c)/2,y:(i+s+l/f*c)/2,r:(f+r+a)/2}}function mR(e,t,n){var i=e.x,r=e.y,o=e.r,s=t.x,a=t.y,u=t.r,l=n.x,c=n.y,f=n.r,d=i-s,h=i-l,g=r-a,p=r-c,m=u-o,y=f-o,b=i*i+r*r-o*o,v=b-s*s-a*a+u*u,x=b-l*l-c*c+f*f,E=h*g-d*p,S=(g*x-p*v)/(E*2)-i,w=(p*m-g*y)/E,_=(h*v-d*x)/(E*2)-r,A=(d*y-h*m)/E,k=w*w+A*A-1,C=2*(o+S*w+_*A),O=S*S+_*_-o*o,M=-(Math.abs(k)>1e-6?(C+Math.sqrt(C*C-4*k*O))/(2*k):O/C);return{x:i+S+w*M,y:r+_+A*M,r:M}}function K_(e,t,n){var i=e.x-t.x,r,o,s=e.y-t.y,a,u,l=i*i+s*s;l?(o=t.r+n.r,o*=o,u=e.r+n.r,u*=u,o>u?(r=(l+u-o)/(2*l),a=Math.sqrt(Math.max(0,u/l-r*r)),n.x=e.x-r*i-a*s,n.y=e.y-r*s+a*i):(r=(l+o-u)/(2*l),a=Math.sqrt(Math.max(0,o/l-r*r)),n.x=t.x+r*i-a*s,n.y=t.y+r*s+a*i)):(n.x=t.x+n.r,n.y=t.y)}function J_(e,t){var n=e.r+t.r-1e-6,i=t.x-e.x,r=t.y-e.y;return n>0&&n*n>i*i+r*r}function Q_(e){var t=e._,n=e.next._,i=t.r+n.r,r=(t.x*n.r+n.x*t.r)/i,o=(t.y*n.r+n.y*t.r)/i;return r*r+o*o}function qf(e){this._=e,this.next=null,this.previous=null}function yG(e,t){if(!(o=(e=fG(e)).length))return 0;var n,i,r,o,s,a,u,l,c,f,d;if(n=e[0],n.x=0,n.y=0,!(o>1))return n.r;if(i=e[1],n.x=-i.r,i.x=n.r,i.y=0,!(o>2))return n.r+i.r;K_(i,n,r=e[2]),n=new qf(n),i=new qf(i),r=new qf(r),n.next=r.previous=i,i.next=n.previous=r,r.next=i.previous=n;e:for(u=3;u<o;++u){K_(n._,i._,r=e[u]),r=new qf(r),l=i.next,c=n.previous,f=i._.r,d=n._.r;do if(f<=d){if(J_(l._,r._)){i=l,n.next=i,i.previous=n,--u;continue e}f+=l._.r,l=l.next}else{if(J_(c._,r._)){n=c,n.next=i,i.previous=n,--u;continue e}d+=c._.r,c=c.previous}while(l!==c.next);for(r.previous=n,r.next=i,n.next=i.previous=i=r,s=Q_(n);(r=r.next)!==i;)(a=Q_(r))<s&&(n=r,s=a);i=n.next}for(n=[i._],r=i;(r=r.next)!==i;)n.push(r._);for(r=hG(n,t),u=0;u<o;++u)n=e[u],n.x-=r.x,n.y-=r.y;return r.r}function bG(e){return Math.sqrt(e.value)}function vG(){var e=null,t=1,n=1,i=xs;function r(o){const s=cG();return o.x=t/2,o.y=n/2,e?o.eachBefore(Z_(e)).eachAfter(Hm(i,.5,s)).eachBefore(eA(1)):o.eachBefore(Z_(bG)).eachAfter(Hm(xs,1,s)).eachAfter(Hm(i,o.r/Math.min(t,n),s)).eachBefore(eA(Math.min(t,n)/(2*o.r))),o}return r.radius=function(o){return arguments.length?(e=Ed(o),r):e},r.size=function(o){return arguments.length?(t=+o[0],n=+o[1],r):[t,n]},r.padding=function(o){return arguments.length?(i=typeof o=="function"?o:Ca(+o),r):i},r}function Z_(e){return function(t){t.children||(t.r=Math.max(0,+e(t)||0))}}function Hm(e,t,n){return function(i){if(r=i.children){var r,o,s=r.length,a=e(i)*t||0,u;if(a)for(o=0;o<s;++o)r[o].r+=a;if(u=yG(r,n),a)for(o=0;o<s;++o)r[o].r-=a;i.r=u+a}}}function eA(e){return function(t){var n=t.parent;t.r*=e,n&&(t.x=n.x+e*t.x,t.y=n.y+e*t.y)}}function yR(e){e.x0=Math.round(e.x0),e.y0=Math.round(e.y0),e.x1=Math.round(e.x1),e.y1=Math.round(e.y1)}function ef(e,t,n,i,r){for(var o=e.children,s,a=-1,u=o.length,l=e.value&&(i-t)/e.value;++a<u;)s=o[a],s.y0=n,s.y1=r,s.x0=t,s.x1=t+=s.value*l}function xG(){var e=1,t=1,n=0,i=!1;function r(s){var a=s.height+1;return s.x0=s.y0=n,s.x1=e,s.y1=t/a,s.eachBefore(o(t,a)),i&&s.eachBefore(yR),s}function o(s,a){return function(u){u.children&&ef(u,u.x0,s*(u.depth+1)/a,u.x1,s*(u.depth+2)/a);var l=u.x0,c=u.y0,f=u.x1-n,d=u.y1-n;f<l&&(l=f=(l+f)/2),d<c&&(c=d=(c+d)/2),u.x0=l,u.y0=c,u.x1=f,u.y1=d}}return r.round=function(s){return arguments.length?(i=!!s,r):i},r.size=function(s){return arguments.length?(e=+s[0],t=+s[1],r):[e,t]},r.padding=function(s){return arguments.length?(n=+s,r):n},r}var wG={depth:-1},tA={},Gm={};function EG(e){return e.id}function SG(e){return e.parentId}function nA(){var e=EG,t=SG,n;function i(r){var o=Array.from(r),s=e,a=t,u,l,c,f,d,h,g,p,m=new Map;if(n!=null){const y=o.map((x,E)=>_G(n(x,E,r))),b=y.map(iA),v=new Set(y).add("");for(const x of b)v.has(x)||(v.add(x),y.push(x),b.push(iA(x)),o.push(Gm));s=(x,E)=>y[E],a=(x,E)=>b[E]}for(c=0,u=o.length;c<u;++c)l=o[c],h=o[c]=new uu(l),(g=s(l,c,r))!=null&&(g+="")&&(p=h.id=g,m.set(p,m.has(p)?tA:h)),(g=a(l,c,r))!=null&&(g+="")&&(h.parent=g);for(c=0;c<u;++c)if(h=o[c],g=h.parent){if(d=m.get(g),!d)throw new Error("missing: "+g);if(d===tA)throw new Error("ambiguous: "+g);d.children?d.children.push(h):d.children=[h],h.parent=d}else{if(f)throw new Error("multiple roots");f=h}if(!f)throw new Error("no root");if(n!=null){for(;f.data===Gm&&f.children.length===1;)f=f.children[0],--u;for(let y=o.length-1;y>=0&&(h=o[y],h.data===Gm);--y)h.data=null}if(f.parent=wG,f.eachBefore(function(y){y.depth=y.parent.depth+1,--u}).eachBefore(hR),f.parent=null,u>0)throw new Error("cycle");return f}return i.id=function(r){return arguments.length?(e=Ed(r),i):e},i.parentId=function(r){return arguments.length?(t=Ed(r),i):t},i.path=function(r){return arguments.length?(n=Ed(r),i):n},i}function _G(e){e=`${e}`;let t=e.length;return ry(e,t-1)&&!ry(e,t-2)&&(e=e.slice(0,-1)),e[0]==="/"?e:`/${e}`}function iA(e){let t=e.length;if(t<2)return"";for(;--t>1&&!ry(e,t););return e.slice(0,t)}function ry(e,t){if(e[t]==="/"){let n=0;for(;t>0&&e[--t]==="\\";)++n;if(!(n&1))return!0}return!1}function AG(e,t){return e.parent===t.parent?1:2}function Vm(e){var t=e.children;return t?t[0]:e.t}function Ym(e){var t=e.children;return t?t[t.length-1]:e.t}function $G(e,t,n){var i=n/(t.i-e.i);t.c-=i,t.s+=n,e.c+=i,t.z+=n,t.m+=n}function kG(e){for(var t=0,n=0,i=e.children,r=i.length,o;--r>=0;)o=i[r],o.z+=t,o.m+=t,t+=o.s+(n+=o.c)}function CG(e,t,n){return e.a.parent===t.parent?e.a:n}function Sd(e,t){this._=e,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=t}Sd.prototype=Object.create(uu.prototype);function FG(e){for(var t=new Sd(e,0),n,i=[t],r,o,s,a;n=i.pop();)if(o=n._.children)for(n.children=new Array(a=o.length),s=a-1;s>=0;--s)i.push(r=n.children[s]=new Sd(o[s],s)),r.parent=n;return(t.parent=new Sd(null,0)).children=[t],t}function TG(){var e=AG,t=1,n=1,i=null;function r(l){var c=FG(l);if(c.eachAfter(o),c.parent.m=-c.z,c.eachBefore(s),i)l.eachBefore(u);else{var f=l,d=l,h=l;l.eachBefore(function(b){b.x<f.x&&(f=b),b.x>d.x&&(d=b),b.depth>h.depth&&(h=b)});var g=f===d?1:e(f,d)/2,p=g-f.x,m=t/(d.x+g+p),y=n/(h.depth||1);l.eachBefore(function(b){b.x=(b.x+p)*m,b.y=b.depth*y})}return l}function o(l){var c=l.children,f=l.parent.children,d=l.i?f[l.i-1]:null;if(c){kG(l);var h=(c[0].z+c[c.length-1].z)/2;d?(l.z=d.z+e(l._,d._),l.m=l.z-h):l.z=h}else d&&(l.z=d.z+e(l._,d._));l.parent.A=a(l,d,l.parent.A||f[0])}function s(l){l._.x=l.z+l.parent.m,l.m+=l.parent.m}function a(l,c,f){if(c){for(var d=l,h=l,g=c,p=d.parent.children[0],m=d.m,y=h.m,b=g.m,v=p.m,x;g=Ym(g),d=Vm(d),g&&d;)p=Vm(p),h=Ym(h),h.a=l,x=g.z+b-d.z-m+e(g._,d._),x>0&&($G(CG(g,l,f),l,x),m+=x,y+=x),b+=g.m,m+=d.m,v+=p.m,y+=h.m;g&&!Ym(h)&&(h.t=g,h.m+=b-y),d&&!Vm(p)&&(p.t=d,p.m+=m-v,f=l)}return f}function u(l){l.x*=t,l.y=l.depth*n}return r.separation=function(l){return arguments.length?(e=l,r):e},r.size=function(l){return arguments.length?(i=!1,t=+l[0],n=+l[1],r):i?null:[t,n]},r.nodeSize=function(l){return arguments.length?(i=!0,t=+l[0],n=+l[1],r):i?[t,n]:null},r}function ip(e,t,n,i,r){for(var o=e.children,s,a=-1,u=o.length,l=e.value&&(r-n)/e.value;++a<u;)s=o[a],s.x0=t,s.x1=i,s.y0=n,s.y1=n+=s.value*l}var bR=(1+Math.sqrt(5))/2;function vR(e,t,n,i,r,o){for(var s=[],a=t.children,u,l,c=0,f=0,d=a.length,h,g,p=t.value,m,y,b,v,x,E,S;c<d;){h=r-n,g=o-i;do m=a[f++].value;while(!m&&f<d);for(y=b=m,E=Math.max(g/h,h/g)/(p*e),S=m*m*E,x=Math.max(b/S,S/y);f<d;++f){if(m+=l=a[f].value,l<y&&(y=l),l>b&&(b=l),S=m*m*E,v=Math.max(b/S,S/y),v>x){m-=l;break}x=v}s.push(u={value:m,dice:h<g,children:a.slice(c,f)}),u.dice?ef(u,n,i,r,p?i+=g*m/p:o):ip(u,n,i,p?n+=h*m/p:r,o),p-=m,c=f}return s}const xR=function e(t){function n(i,r,o,s,a){vR(t,i,r,o,s,a)}return n.ratio=function(i){return e((i=+i)>1?i:1)},n}(bR);function MG(){var e=xR,t=!1,n=1,i=1,r=[0],o=xs,s=xs,a=xs,u=xs,l=xs;function c(d){return d.x0=d.y0=0,d.x1=n,d.y1=i,d.eachBefore(f),r=[0],t&&d.eachBefore(yR),d}function f(d){var h=r[d.depth],g=d.x0+h,p=d.y0+h,m=d.x1-h,y=d.y1-h;m<g&&(g=m=(g+m)/2),y<p&&(p=y=(p+y)/2),d.x0=g,d.y0=p,d.x1=m,d.y1=y,d.children&&(h=r[d.depth+1]=o(d)/2,g+=l(d)-h,p+=s(d)-h,m-=a(d)-h,y-=u(d)-h,m<g&&(g=m=(g+m)/2),y<p&&(p=y=(p+y)/2),e(d,g,p,m,y))}return c.round=function(d){return arguments.length?(t=!!d,c):t},c.size=function(d){return arguments.length?(n=+d[0],i=+d[1],c):[n,i]},c.tile=function(d){return arguments.length?(e=gR(d),c):e},c.padding=function(d){return arguments.length?c.paddingInner(d).paddingOuter(d):c.paddingInner()},c.paddingInner=function(d){return arguments.length?(o=typeof d=="function"?d:Ca(+d),c):o},c.paddingOuter=function(d){return arguments.length?c.paddingTop(d).paddingRight(d).paddingBottom(d).paddingLeft(d):c.paddingTop()},c.paddingTop=function(d){return arguments.length?(s=typeof d=="function"?d:Ca(+d),c):s},c.paddingRight=function(d){return arguments.length?(a=typeof d=="function"?d:Ca(+d),c):a},c.paddingBottom=function(d){return arguments.length?(u=typeof d=="function"?d:Ca(+d),c):u},c.paddingLeft=function(d){return arguments.length?(l=typeof d=="function"?d:Ca(+d),c):l},c}function DG(e,t,n,i,r){var o=e.children,s,a=o.length,u,l=new Array(a+1);for(l[0]=u=s=0;s<a;++s)l[s+1]=u+=o[s].value;c(0,a,e.value,t,n,i,r);function c(f,d,h,g,p,m,y){if(f>=d-1){var b=o[f];b.x0=g,b.y0=p,b.x1=m,b.y1=y;return}for(var v=l[f],x=h/2+v,E=f+1,S=d-1;E<S;){var w=E+S>>>1;l[w]<x?E=w+1:S=w}x-l[E-1]<l[E]-x&&f+1<E&&--E;var _=l[E]-v,A=h-_;if(m-g>y-p){var k=h?(g*A+m*_)/h:m;c(f,E,_,g,p,k,y),c(E,d,A,k,p,m,y)}else{var C=h?(p*A+y*_)/h:y;c(f,E,_,g,p,m,C),c(E,d,A,g,C,m,y)}}}function OG(e,t,n,i,r){(e.depth&1?ip:ef)(e,t,n,i,r)}const RG=function e(t){function n(i,r,o,s,a){if((u=i._squarify)&&u.ratio===t)for(var u,l,c,f,d=-1,h,g=u.length,p=i.value;++d<g;){for(l=u[d],c=l.children,f=l.value=0,h=c.length;f<h;++f)l.value+=c[f].value;l.dice?ef(l,r,o,s,p?o+=(a-o)*l.value/p:a):ip(l,r,o,p?r+=(s-r)*l.value/p:s,a),p-=l.value}else i._squarify=u=vR(t,i,r,o,s,a),u.ratio=t}return n.ratio=function(i){return e((i=+i)>1?i:1)},n}(bR);function oy(e,t,n){const i={};return e.each(r=>{const o=r.data;n(o)&&(i[t(o)]=r)}),e.lookup=i,e}function o2(e){D.call(this,null,e)}o2.Definition={type:"Nest",metadata:{treesource:!0,changes:!0},params:[{name:"keys",type:"field",array:!0},{name:"generate",type:"boolean"}]};const NG=e=>e.values;G(o2,D,{transform(e,t){t.source||N("Nest transform requires an upstream data source.");var n=e.generate,i=e.modified(),r=t.clone(),o=this.value;return(!o||i||t.changed())&&(o&&o.each(s=>{s.children&&Eg(s.data)&&r.rem.push(s.data)}),this.value=o=r2({values:X(e.keys).reduce((s,a)=>(s.key(a),s),LG()).entries(r.source)},NG),n&&o.each(s=>{s.children&&(s=Ce(s.data),r.add.push(s),r.source.push(s))}),oy(o,ie,ie)),r.source.root=o,r}});function LG(){const e=[],t={entries:r=>i(n(r,0),0),key:r=>(e.push(r),t)};function n(r,o){if(o>=e.length)return r;const s=r.length,a=e[o++],u={},l={};let c=-1,f,d,h;for(;++c<s;)f=a(d=r[c])+"",(h=u[f])?h.push(d):u[f]=[d];for(f in u)l[f]=n(u[f],o);return l}function i(r,o){if(++o>e.length)return r;const s=[];for(const a in r)s.push({key:a,values:i(r[a],o)});return s}return t}function Vr(e){D.call(this,null,e)}const PG=(e,t)=>e.parent===t.parent?1:2;G(Vr,D,{transform(e,t){(!t.source||!t.source.root)&&N(this.constructor.name+" transform requires a backing tree data source.");const n=this.layout(e.method),i=this.fields,r=t.source.root,o=e.as||i;e.field?r.sum(e.field):r.count(),e.sort&&r.sort(ea(e.sort,s=>s.data)),IG(n,this.params,e),n.separation&&n.separation(e.separation!==!1?PG:ku);try{this.value=n(r)}catch(s){N(s)}return r.each(s=>zG(s,i,o)),t.reflow(e.modified()).modifies(o).modifies("leaf")}});function IG(e,t,n){for(let i,r=0,o=t.length;r<o;++r)i=t[r],i in n&&e[i](n[i])}function zG(e,t,n){const i=e.data,r=t.length-1;for(let o=0;o<r;++o)i[n[o]]=e[t[o]];i[n[r]]=e.children?e.children.length:0}const sy=["x","y","r","depth","children"];function s2(e){Vr.call(this,e)}s2.Definition={type:"Pack",metadata:{tree:!0,modifies:!0},params:[{name:"field",type:"field"},{name:"sort",type:"compare"},{name:"padding",type:"number",default:0},{name:"radius",type:"field",default:null},{name:"size",type:"number",array:!0,length:2},{name:"as",type:"string",array:!0,length:sy.length,default:sy}]};G(s2,Vr,{layout:vG,params:["radius","size","padding"],fields:sy});const ay=["x0","y0","x1","y1","depth","children"];function a2(e){Vr.call(this,e)}a2.Definition={type:"Partition",metadata:{tree:!0,modifies:!0},params:[{name:"field",type:"field"},{name:"sort",type:"compare"},{name:"padding",type:"number",default:0},{name:"round",type:"boolean",default:!1},{name:"size",type:"number",array:!0,length:2},{name:"as",type:"string",array:!0,length:ay.length,default:ay}]};G(a2,Vr,{layout:xG,params:["size","round","padding"],fields:ay});function u2(e){D.call(this,null,e)}u2.Definition={type:"Stratify",metadata:{treesource:!0},params:[{name:"key",type:"field",required:!0},{name:"parentKey",type:"field",required:!0}]};G(u2,D,{transform(e,t){t.source||N("Stratify transform requires an upstream data source.");let n=this.value;const i=e.modified(),r=t.fork(t.ALL).materialize(t.SOURCE),o=!n||i||t.changed(t.ADD_REM)||t.modified(e.key.fields)||t.modified(e.parentKey.fields);return r.source=r.source.slice(),o&&(n=r.source.length?oy(nA().id(e.key).parentId(e.parentKey)(r.source),e.key,Pn):oy(nA()([{}]),e.key,e.key)),r.source.root=this.value=n,r}});const rA={tidy:TG,cluster:jH},uy=["x","y","depth","children"];function l2(e){Vr.call(this,e)}l2.Definition={type:"Tree",metadata:{tree:!0,modifies:!0},params:[{name:"field",type:"field"},{name:"sort",type:"compare"},{name:"method",type:"enum",default:"tidy",values:["tidy","cluster"]},{name:"size",type:"number",array:!0,length:2},{name:"nodeSize",type:"number",array:!0,length:2},{name:"separation",type:"boolean",default:!0},{name:"as",type:"string",array:!0,length:uy.length,default:uy}]};G(l2,Vr,{layout(e){const t=e||"tidy";if(J(rA,t))return rA[t]();N("Unrecognized Tree layout method: "+t)},params:["size","nodeSize"],fields:uy});function c2(e){D.call(this,[],e)}c2.Definition={type:"TreeLinks",metadata:{tree:!0,generates:!0,changes:!0},params:[]};G(c2,D,{transform(e,t){const n=this.value,i=t.source&&t.source.root,r=t.fork(t.NO_SOURCE),o={};return i||N("TreeLinks transform requires a tree data source."),t.changed(t.ADD_REM)?(r.rem=n,t.visit(t.SOURCE,s=>o[ie(s)]=1),i.each(s=>{const a=s.data,u=s.parent&&s.parent.data;u&&o[ie(a)]&&o[ie(u)]&&r.add.push(Ce({source:u,target:a}))}),this.value=r.add):t.changed(t.MOD)&&(t.visit(t.MOD,s=>o[ie(s)]=1),n.forEach(s=>{(o[ie(s.source)]||o[ie(s.target)])&&r.mod.push(s)})),r}});const oA={binary:DG,dice:ef,slice:ip,slicedice:OG,squarify:xR,resquarify:RG},ly=["x0","y0","x1","y1","depth","children"];function f2(e){Vr.call(this,e)}f2.Definition={type:"Treemap",metadata:{tree:!0,modifies:!0},params:[{name:"field",type:"field"},{name:"sort",type:"compare"},{name:"method",type:"enum",default:"squarify",values:["squarify","resquarify","binary","dice","slice","slicedice"]},{name:"padding",type:"number",default:0},{name:"paddingInner",type:"number",default:0},{name:"paddingOuter",type:"number",default:0},{name:"paddingTop",type:"number",default:0},{name:"paddingRight",type:"number",default:0},{name:"paddingBottom",type:"number",default:0},{name:"paddingLeft",type:"number",default:0},{name:"ratio",type:"number",default:1.618033988749895},{name:"round",type:"boolean",default:!1},{name:"size",type:"number",array:!0,length:2},{name:"as",type:"string",array:!0,length:ly.length,default:ly}]};G(f2,Vr,{layout(){const e=MG();return e.ratio=t=>{const n=e.tile();n.ratio&&e.tile(n.ratio(t))},e.method=t=>{J(oA,t)?e.tile(oA[t]):N("Unrecognized Treemap layout method: "+t)},e},params:["method","ratio","size","round","padding","paddingInner","paddingOuter","paddingTop","paddingRight","paddingBottom","paddingLeft"],fields:ly});const BG=Object.freeze(Object.defineProperty({__proto__:null,nest:o2,pack:s2,partition:a2,stratify:u2,tree:l2,treelinks:c2,treemap:f2},Symbol.toStringTag,{value:"Module"})),Xm=4278190080;function UG(e,t){const n=e.bitmap();return(t||[]).forEach(i=>n.set(e(i.boundary[0]),e(i.boundary[3]))),[n,void 0]}function jG(e,t,n,i,r){const o=e.width,s=e.height,a=i||r,u=$o(o,s).getContext("2d"),l=$o(o,s).getContext("2d"),c=a&&$o(o,s).getContext("2d");n.forEach(_=>_d(u,_,!1)),_d(l,t,!1),a&&_d(c,t,!0);const f=Km(u,o,s),d=Km(l,o,s),h=a&&Km(c,o,s),g=e.bitmap(),p=a&&e.bitmap();let m,y,b,v,x,E,S,w;for(y=0;y<s;++y)for(m=0;m<o;++m)x=y*o+m,E=f[x]&Xm,w=d[x]&Xm,S=a&&h[x]&Xm,(E||S||w)&&(b=e(m),v=e(y),!r&&(E||w)&&g.set(b,v),a&&(E||S)&&p.set(b,v));return[g,p]}function Km(e,t,n){return new Uint32Array(e.getImageData(0,0,t,n).data.buffer)}function _d(e,t,n){if(!t.length)return;const i=t[0].mark.marktype;i==="group"?t.forEach(r=>{r.items.forEach(o=>_d(e,o.items,n))}):Bn[i].draw(e,{items:n?t.map(qG):t})}function qG(e){const t=Sg(e,{});return t.stroke&&t.strokeOpacity!==0||t.fill&&t.fillOpacity!==0?{...t,strokeOpacity:1,stroke:"#000",fillOpacity:0}:t}const wr=5,Xt=31,yc=32,lo=new Uint32Array(yc+1),di=new Uint32Array(yc+1);di[0]=0;lo[0]=~di[0];for(let e=1;e<=yc;++e)di[e]=di[e-1]<<1|1,lo[e]=~di[e];function WG(e,t){const n=new Uint32Array(~~((e*t+yc)/yc));function i(o,s){n[o]|=s}function r(o,s){n[o]&=s}return{array:n,get:(o,s)=>{const a=s*e+o;return n[a>>>wr]&1<<(a&Xt)},set:(o,s)=>{const a=s*e+o;i(a>>>wr,1<<(a&Xt))},clear:(o,s)=>{const a=s*e+o;r(a>>>wr,~(1<<(a&Xt)))},getRange:(o,s,a,u)=>{let l=u,c,f,d,h;for(;l>=s;--l)if(c=l*e+o,f=l*e+a,d=c>>>wr,h=f>>>wr,d===h){if(n[d]&lo[c&Xt]&di[(f&Xt)+1])return!0}else{if(n[d]&lo[c&Xt]||n[h]&di[(f&Xt)+1])return!0;for(let g=d+1;g<h;++g)if(n[g])return!0}return!1},setRange:(o,s,a,u)=>{let l,c,f,d,h;for(;s<=u;++s)if(l=s*e+o,c=s*e+a,f=l>>>wr,d=c>>>wr,f===d)i(f,lo[l&Xt]&di[(c&Xt)+1]);else for(i(f,lo[l&Xt]),i(d,di[(c&Xt)+1]),h=f+1;h<d;++h)i(h,4294967295)},clearRange:(o,s,a,u)=>{let l,c,f,d,h;for(;s<=u;++s)if(l=s*e+o,c=s*e+a,f=l>>>wr,d=c>>>wr,f===d)r(f,di[l&Xt]|lo[(c&Xt)+1]);else for(r(f,di[l&Xt]),r(d,lo[(c&Xt)+1]),h=f+1;h<d;++h)r(h,0)},outOfBounds:(o,s,a,u)=>o<0||s<0||u>=t||a>=e}}function HG(e,t,n){const i=Math.max(1,Math.sqrt(e*t/1e6)),r=~~((e+2*n+i)/i),o=~~((t+2*n+i)/i),s=a=>~~((a+n)/i);return s.invert=a=>a*i-n,s.bitmap=()=>WG(r,o),s.ratio=i,s.padding=n,s.width=e,s.height=t,s}function GG(e,t,n,i){const r=e.width,o=e.height;return function(s){const a=s.datum.datum.items[i].items,u=a.length,l=s.datum.fontSize,c=Rn.width(s.datum,s.datum.text);let f=0,d,h,g,p,m,y,b;for(let v=0;v<u;++v)d=a[v].x,g=a[v].y,h=a[v].x2===void 0?d:a[v].x2,p=a[v].y2===void 0?g:a[v].y2,m=(d+h)/2,y=(g+p)/2,b=Math.abs(h-d+p-g),b>=f&&(f=b,s.x=m,s.y=y);return m=c/2,y=l/2,d=s.x-m,h=s.x+m,g=s.y-y,p=s.y+y,s.align="center",d<0&&h<=r?s.align="left":0<=d&&r<h&&(s.align="right"),s.baseline="middle",g<0&&p<=o?s.baseline="top":0<=g&&o<p&&(s.baseline="bottom"),!0}}function Rh(e,t,n,i,r,o){let s=n/2;return e-s<0||e+s>r||t-(s=i/2)<0||t+s>o}function wo(e,t,n,i,r,o,s,a){const u=r*o/(i*2),l=e(t-u),c=e(t+u),f=e(n-(o=o/2)),d=e(n+o);return s.outOfBounds(l,f,c,d)||s.getRange(l,f,c,d)||a&&a.getRange(l,f,c,d)}function VG(e,t,n,i){const r=e.width,o=e.height,s=t[0],a=t[1];function u(l,c,f,d,h){const g=e.invert(l),p=e.invert(c);let m=f,y=o,b;if(!Rh(g,p,d,h,r,o)&&!wo(e,g,p,h,d,m,s,a)&&!wo(e,g,p,h,d,h,s,null)){for(;y-m>=1;)b=(m+y)/2,wo(e,g,p,h,d,b,s,a)?y=b:m=b;if(m>f)return[g,p,m,!0]}}return function(l){const c=l.datum.datum.items[i].items,f=c.length,d=l.datum.fontSize,h=Rn.width(l.datum,l.datum.text);let g=n?d:0,p=!1,m=!1,y=0,b,v,x,E,S,w,_,A,k,C,O,M,F,$,T,L,z;for(let I=0;I<f;++I){for(b=c[I].x,x=c[I].y,v=c[I].x2===void 0?b:c[I].x2,E=c[I].y2===void 0?x:c[I].y2,b>v&&(z=b,b=v,v=z),x>E&&(z=x,x=E,E=z),k=e(b),O=e(v),C=~~((k+O)/2),M=e(x),$=e(E),F=~~((M+$)/2),_=C;_>=k;--_)for(A=F;A>=M;--A)L=u(_,A,g,h,d),L&&([l.x,l.y,g,p]=L);for(_=C;_<=O;++_)for(A=F;A<=$;++A)L=u(_,A,g,h,d),L&&([l.x,l.y,g,p]=L);!p&&!n&&(T=Math.abs(v-b+E-x),S=(b+v)/2,w=(x+E)/2,T>=y&&!Rh(S,w,h,d,r,o)&&!wo(e,S,w,d,h,d,s,null)&&(y=T,l.x=S,l.y=w,m=!0))}return p||m?(S=h/2,w=d/2,s.setRange(e(l.x-S),e(l.y-w),e(l.x+S),e(l.y+w)),l.align="center",l.baseline="middle",!0):!1}}const YG=[-1,-1,1,1],XG=[-1,1,-1,1];function KG(e,t,n,i){const r=e.width,o=e.height,s=t[0],a=t[1],u=e.bitmap();return function(l){const c=l.datum.datum.items[i].items,f=c.length,d=l.datum.fontSize,h=Rn.width(l.datum,l.datum.text),g=[];let p=n?d:0,m=!1,y=!1,b=0,v,x,E,S,w,_,A,k,C,O,M,F;for(let $=0;$<f;++$){for(v=c[$].x,E=c[$].y,x=c[$].x2===void 0?v:c[$].x2,S=c[$].y2===void 0?E:c[$].y2,g.push([e((v+x)/2),e((E+S)/2)]);g.length;)if([A,k]=g.pop(),!(s.get(A,k)||a.get(A,k)||u.get(A,k))){u.set(A,k);for(let T=0;T<4;++T)w=A+YG[T],_=k+XG[T],u.outOfBounds(w,_,w,_)||g.push([w,_]);if(w=e.invert(A),_=e.invert(k),C=p,O=o,!Rh(w,_,h,d,r,o)&&!wo(e,w,_,d,h,C,s,a)&&!wo(e,w,_,d,h,d,s,null)){for(;O-C>=1;)M=(C+O)/2,wo(e,w,_,d,h,M,s,a)?O=M:C=M;C>p&&(l.x=w,l.y=_,p=C,m=!0)}}!m&&!n&&(F=Math.abs(x-v+S-E),w=(v+x)/2,_=(E+S)/2,F>=b&&!Rh(w,_,h,d,r,o)&&!wo(e,w,_,d,h,d,s,null)&&(b=F,l.x=w,l.y=_,y=!0))}return m||y?(w=h/2,_=d/2,s.setRange(e(l.x-w),e(l.y-_),e(l.x+w),e(l.y+_)),l.align="center",l.baseline="middle",!0):!1}}const JG=["right","center","left"],QG=["bottom","middle","top"];function ZG(e,t,n,i){const r=e.width,o=e.height,s=t[0],a=t[1],u=i.length;return function(l){const c=l.boundary,f=l.datum.fontSize;if(c[2]<0||c[5]<0||c[0]>r||c[3]>o)return!1;let d=l.textWidth??0,h,g,p,m,y,b,v,x,E,S,w,_,A,k,C;for(let O=0;O<u;++O){if(h=(n[O]&3)-1,g=(n[O]>>>2&3)-1,p=h===0&&g===0||i[O]<0,m=h&&g?Math.SQRT1_2:1,y=i[O]<0?-1:1,b=c[1+h]+i[O]*h*m,w=c[4+g]+y*f*g/2+i[O]*g*m,x=w-f/2,E=w+f/2,_=e(b),k=e(x),C=e(E),!d)if(sA(_,_,k,C,s,a,b,b,x,E,c,p))d=Rn.width(l.datum,l.datum.text);else continue;if(S=b+y*d*h/2,b=S-d/2,v=S+d/2,_=e(b),A=e(v),sA(_,A,k,C,s,a,b,v,x,E,c,p))return l.x=h?h*y<0?v:b:S,l.y=g?g*y<0?E:x:w,l.align=JG[h*y+1],l.baseline=QG[g*y+1],s.setRange(_,k,A,C),!0}return!1}}function sA(e,t,n,i,r,o,s,a,u,l,c,f){return!(r.outOfBounds(e,n,t,i)||(f&&o||r).getRange(e,n,t,i))}const Jm=0,Qm=4,Zm=8,e0=0,t0=1,n0=2,eV={"top-left":Jm+e0,top:Jm+t0,"top-right":Jm+n0,left:Qm+e0,middle:Qm+t0,right:Qm+n0,"bottom-left":Zm+e0,bottom:Zm+t0,"bottom-right":Zm+n0},tV={naive:GG,"reduced-search":VG,floodfill:KG};function nV(e,t,n,i,r,o,s,a,u,l,c){if(!e.length)return e;const f=Math.max(i.length,r.length),d=iV(i,f),h=rV(r,f),g=oV(e[0].datum),p=g==="group"&&e[0].datum.items[u].marktype,m=p==="area",y=sV(g,p,a,u),b=l===null||l===1/0,v=m&&c==="naive";let x=-1,E=-1;const S=e.map(k=>{const C=b?Rn.width(k,k.text):void 0;return x=Math.max(x,C),E=Math.max(E,k.fontSize),{datum:k,opacity:0,x:void 0,y:void 0,align:void 0,baseline:void 0,boundary:y(k),textWidth:C}});l=l===null||l===1/0?Math.max(x,E)+Math.max(...i):l;const w=HG(t[0],t[1],l);let _;if(!v){n&&S.sort((O,M)=>n(O.datum,M.datum));let k=!1;for(let O=0;O<h.length&&!k;++O)k=h[O]===5||d[O]<0;const C=(g&&s||m)&&e.map(O=>O.datum);_=o.length||C?jG(w,C||[],o,k,m):UG(w,s&&S)}const A=m?tV[c](w,_,s,u):ZG(w,_,h,d);return S.forEach(k=>k.opacity=+A(k)),S}function iV(e,t){const n=new Float64Array(t),i=e.length;for(let r=0;r<i;++r)n[r]=e[r]||0;for(let r=i;r<t;++r)n[r]=n[i-1];return n}function rV(e,t){const n=new Int8Array(t),i=e.length;for(let r=0;r<i;++r)n[r]|=eV[e[r]];for(let r=i;r<t;++r)n[r]=n[i-1];return n}function oV(e){return e&&e.mark&&e.mark.marktype}function sV(e,t,n,i){const r=o=>[o.x,o.x,o.x,o.y,o.y,o.y];return e?e==="line"||e==="area"?o=>r(o.datum):t==="line"?o=>{const s=o.datum.items[i].items;return r(s.length?s[n==="start"?0:s.length-1]:{x:NaN,y:NaN})}:o=>{const s=o.datum.bounds;return[s.x1,(s.x1+s.x2)/2,s.x2,s.y1,(s.y1+s.y2)/2,s.y2]}:r}const cy=["x","y","opacity","align","baseline"],wR=["top-left","left","bottom-left","top","bottom","top-right","right","bottom-right"];function d2(e){D.call(this,null,e)}d2.Definition={type:"Label",metadata:{modifies:!0},params:[{name:"size",type:"number",array:!0,length:2,required:!0},{name:"sort",type:"compare"},{name:"anchor",type:"string",array:!0,default:wR},{name:"offset",type:"number",array:!0,default:[1]},{name:"padding",type:"number",default:0,null:!0},{name:"lineAnchor",type:"string",values:["start","end"],default:"end"},{name:"markIndex",type:"number",default:0},{name:"avoidBaseMark",type:"boolean",default:!0},{name:"avoidMarks",type:"data",array:!0},{name:"method",type:"string",default:"naive"},{name:"as",type:"string",array:!0,length:cy.length,default:cy}]};G(d2,D,{transform(e,t){function n(o){const s=e[o];return ge(s)&&t.modified(s.fields)}const i=e.modified();if(!(i||t.changed(t.ADD_REM)||n("sort")))return;(!e.size||e.size.length!==2)&&N("Size parameter should be specified as a [width, height] array.");const r=e.as||cy;return nV(t.materialize(t.SOURCE).source||[],e.size,e.sort,X(e.offset==null?1:e.offset),X(e.anchor||wR),e.avoidMarks||[],e.avoidBaseMark!==!1,e.lineAnchor||"end",e.markIndex||0,e.padding===void 0?0:e.padding,e.method||"naive").forEach(o=>{const s=o.datum;s[r[0]]=o.x,s[r[1]]=o.y,s[r[2]]=o.opacity,s[r[3]]=o.align,s[r[4]]=o.baseline}),t.reflow(i).modifies(r)}});const aV=Object.freeze(Object.defineProperty({__proto__:null,label:d2},Symbol.toStringTag,{value:"Module"}));function ER(e,t){var n=[],i=function(c){return c(a)},r,o,s,a,u,l;if(t==null)n.push(e);else for(r={},o=0,s=e.length;o<s;++o)a=e[o],u=t.map(i),l=r[u],l||(r[u]=l=[],l.dims=u,n.push(l)),l.push(a);return n}function h2(e){D.call(this,null,e)}h2.Definition={type:"Loess",metadata:{generates:!0},params:[{name:"x",type:"field",required:!0},{name:"y",type:"field",required:!0},{name:"groupby",type:"field",array:!0},{name:"bandwidth",type:"number",default:.3},{name:"as",type:"string",array:!0}]};G(h2,D,{transform(e,t){const n=t.fork(t.NO_SOURCE|t.NO_FIELDS);if(!this.value||t.changed()||e.modified()){const i=t.materialize(t.SOURCE).source,r=ER(i,e.groupby),o=(e.groupby||[]).map(Je),s=o.length,a=e.as||[Je(e.x),Je(e.y)],u=[];r.forEach(l=>{JF(l,e.x,e.y,e.bandwidth||.3).forEach(c=>{const f={};for(let d=0;d<s;++d)f[o[d]]=l.dims[d];f[a[0]]=c[0],f[a[1]]=c[1],u.push(Ce(f))})}),this.value&&(n.rem=this.value),this.value=n.add=n.source=u}return n}});const fy={constant:Qb,linear:Zb,log:VF,exp:YF,pow:XF,quad:ev,poly:KF},uV=(e,t)=>e==="poly"?t:e==="quad"?2:1;function g2(e){D.call(this,null,e)}g2.Definition={type:"Regression",metadata:{generates:!0},params:[{name:"x",type:"field",required:!0},{name:"y",type:"field",required:!0},{name:"groupby",type:"field",array:!0},{name:"method",type:"string",default:"linear",values:Object.keys(fy)},{name:"order",type:"number",default:3},{name:"extent",type:"number",array:!0,length:2},{name:"params",type:"boolean",default:!1},{name:"as",type:"string",array:!0}]};G(g2,D,{transform(e,t){const n=t.fork(t.NO_SOURCE|t.NO_FIELDS);if(!this.value||t.changed()||e.modified()){const i=t.materialize(t.SOURCE).source,r=ER(i,e.groupby),o=(e.groupby||[]).map(Je),s=e.method||"linear",a=e.order==null?3:e.order,u=uV(s,a),l=e.as||[Je(e.x),Je(e.y)],c=fy[s],f=[];let d=e.extent;J(fy,s)||N("Invalid regression method: "+s),d!=null&&s==="log"&&d[0]<=0&&(t.dataflow.warn("Ignoring extent with values <= 0 for log regression."),d=null),r.forEach(h=>{if(h.length<=u){t.dataflow.warn("Skipping regression with more parameters than data points.");return}const p=c(h,e.x,e.y,a);if(e.params){f.push(Ce({keys:h.dims,coef:p.coef,rSquared:p.rSquared}));return}const m=d||Qi(h,e.x),y=b=>{const v={};for(let x=0;x<o.length;++x)v[o[x]]=h.dims[x];v[l[0]]=b[0],v[l[1]]=b[1],f.push(Ce(v))};s==="linear"||s==="constant"?m.forEach(b=>y([b,p.predict(b)])):Tg(p.predict,m,25,200).forEach(y)}),this.value&&(n.rem=this.value),this.value=n.add=n.source=f}return n}});const lV=Object.freeze(Object.defineProperty({__proto__:null,loess:h2,regression:g2},Symbol.toStringTag,{value:"Module"})),Nr=11102230246251565e-32,Nt=134217729,cV=(3+8*Nr)*Nr;function i0(e,t,n,i,r){let o,s,a,u,l=t[0],c=i[0],f=0,d=0;c>l==c>-l?(o=l,l=t[++f]):(o=c,c=i[++d]);let h=0;if(f<e&&d<n)for(c>l==c>-l?(s=l+o,a=o-(s-l),l=t[++f]):(s=c+o,a=o-(s-c),c=i[++d]),o=s,a!==0&&(r[h++]=a);f<e&&d<n;)c>l==c>-l?(s=o+l,u=s-o,a=o-(s-u)+(l-u),l=t[++f]):(s=o+c,u=s-o,a=o-(s-u)+(c-u),c=i[++d]),o=s,a!==0&&(r[h++]=a);for(;f<e;)s=o+l,u=s-o,a=o-(s-u)+(l-u),l=t[++f],o=s,a!==0&&(r[h++]=a);for(;d<n;)s=o+c,u=s-o,a=o-(s-u)+(c-u),c=i[++d],o=s,a!==0&&(r[h++]=a);return(o!==0||h===0)&&(r[h++]=o),h}function fV(e,t){let n=t[0];for(let i=1;i<e;i++)n+=t[i];return n}function tf(e){return new Float64Array(e)}const dV=(3+16*Nr)*Nr,hV=(2+12*Nr)*Nr,gV=(9+64*Nr)*Nr*Nr,Ea=tf(4),aA=tf(8),uA=tf(12),lA=tf(16),Kt=tf(4);function pV(e,t,n,i,r,o,s){let a,u,l,c,f,d,h,g,p,m,y,b,v,x,E,S,w,_;const A=e-r,k=n-r,C=t-o,O=i-o;x=A*O,d=Nt*A,h=d-(d-A),g=A-h,d=Nt*O,p=d-(d-O),m=O-p,E=g*m-(x-h*p-g*p-h*m),S=C*k,d=Nt*C,h=d-(d-C),g=C-h,d=Nt*k,p=d-(d-k),m=k-p,w=g*m-(S-h*p-g*p-h*m),y=E-w,f=E-y,Ea[0]=E-(y+f)+(f-w),b=x+y,f=b-x,v=x-(b-f)+(y-f),y=v-S,f=v-y,Ea[1]=v-(y+f)+(f-S),_=b+y,f=_-b,Ea[2]=b-(_-f)+(y-f),Ea[3]=_;let M=fV(4,Ea),F=hV*s;if(M>=F||-M>=F||(f=e-A,a=e-(A+f)+(f-r),f=n-k,l=n-(k+f)+(f-r),f=t-C,u=t-(C+f)+(f-o),f=i-O,c=i-(O+f)+(f-o),a===0&&u===0&&l===0&&c===0)||(F=gV*s+cV*Math.abs(M),M+=A*c+O*a-(C*l+k*u),M>=F||-M>=F))return M;x=a*O,d=Nt*a,h=d-(d-a),g=a-h,d=Nt*O,p=d-(d-O),m=O-p,E=g*m-(x-h*p-g*p-h*m),S=u*k,d=Nt*u,h=d-(d-u),g=u-h,d=Nt*k,p=d-(d-k),m=k-p,w=g*m-(S-h*p-g*p-h*m),y=E-w,f=E-y,Kt[0]=E-(y+f)+(f-w),b=x+y,f=b-x,v=x-(b-f)+(y-f),y=v-S,f=v-y,Kt[1]=v-(y+f)+(f-S),_=b+y,f=_-b,Kt[2]=b-(_-f)+(y-f),Kt[3]=_;const $=i0(4,Ea,4,Kt,aA);x=A*c,d=Nt*A,h=d-(d-A),g=A-h,d=Nt*c,p=d-(d-c),m=c-p,E=g*m-(x-h*p-g*p-h*m),S=C*l,d=Nt*C,h=d-(d-C),g=C-h,d=Nt*l,p=d-(d-l),m=l-p,w=g*m-(S-h*p-g*p-h*m),y=E-w,f=E-y,Kt[0]=E-(y+f)+(f-w),b=x+y,f=b-x,v=x-(b-f)+(y-f),y=v-S,f=v-y,Kt[1]=v-(y+f)+(f-S),_=b+y,f=_-b,Kt[2]=b-(_-f)+(y-f),Kt[3]=_;const T=i0($,aA,4,Kt,uA);x=a*c,d=Nt*a,h=d-(d-a),g=a-h,d=Nt*c,p=d-(d-c),m=c-p,E=g*m-(x-h*p-g*p-h*m),S=u*l,d=Nt*u,h=d-(d-u),g=u-h,d=Nt*l,p=d-(d-l),m=l-p,w=g*m-(S-h*p-g*p-h*m),y=E-w,f=E-y,Kt[0]=E-(y+f)+(f-w),b=x+y,f=b-x,v=x-(b-f)+(y-f),y=v-S,f=v-y,Kt[1]=v-(y+f)+(f-S),_=b+y,f=_-b,Kt[2]=b-(_-f)+(y-f),Kt[3]=_;const L=i0(T,uA,4,Kt,lA);return lA[L-1]}function Wf(e,t,n,i,r,o){const s=(t-o)*(n-r),a=(e-r)*(i-o),u=s-a,l=Math.abs(s+a);return Math.abs(u)>=dV*l?u:-pV(e,t,n,i,r,o,l)}const cA=Math.pow(2,-52),Hf=new Uint32Array(512);class Nh{static from(t,n=xV,i=wV){const r=t.length,o=new Float64Array(r*2);for(let s=0;s<r;s++){const a=t[s];o[2*s]=n(a),o[2*s+1]=i(a)}return new Nh(o)}constructor(t){const n=t.length>>1;if(n>0&&typeof t[0]!="number")throw new Error("Expected coords to contain numbers.");this.coords=t;const i=Math.max(2*n-5,0);this._triangles=new Uint32Array(i*3),this._halfedges=new Int32Array(i*3),this._hashSize=Math.ceil(Math.sqrt(n)),this._hullPrev=new Uint32Array(n),this._hullNext=new Uint32Array(n),this._hullTri=new Uint32Array(n),this._hullHash=new Int32Array(this._hashSize),this._ids=new Uint32Array(n),this._dists=new Float64Array(n),this.update()}update(){const{coords:t,_hullPrev:n,_hullNext:i,_hullTri:r,_hullHash:o}=this,s=t.length>>1;let a=1/0,u=1/0,l=-1/0,c=-1/0;for(let A=0;A<s;A++){const k=t[2*A],C=t[2*A+1];k<a&&(a=k),C<u&&(u=C),k>l&&(l=k),C>c&&(c=C),this._ids[A]=A}const f=(a+l)/2,d=(u+c)/2;let h,g,p;for(let A=0,k=1/0;A<s;A++){const C=r0(f,d,t[2*A],t[2*A+1]);C<k&&(h=A,k=C)}const m=t[2*h],y=t[2*h+1];for(let A=0,k=1/0;A<s;A++){if(A===h)continue;const C=r0(m,y,t[2*A],t[2*A+1]);C<k&&C>0&&(g=A,k=C)}let b=t[2*g],v=t[2*g+1],x=1/0;for(let A=0;A<s;A++){if(A===h||A===g)continue;const k=bV(m,y,b,v,t[2*A],t[2*A+1]);k<x&&(p=A,x=k)}let E=t[2*p],S=t[2*p+1];if(x===1/0){for(let C=0;C<s;C++)this._dists[C]=t[2*C]-t[0]||t[2*C+1]-t[1];Ra(this._ids,this._dists,0,s-1);const A=new Uint32Array(s);let k=0;for(let C=0,O=-1/0;C<s;C++){const M=this._ids[C],F=this._dists[M];F>O&&(A[k++]=M,O=F)}this.hull=A.subarray(0,k),this.triangles=new Uint32Array(0),this.halfedges=new Uint32Array(0);return}if(Wf(m,y,b,v,E,S)<0){const A=g,k=b,C=v;g=p,b=E,v=S,p=A,E=k,S=C}const w=vV(m,y,b,v,E,S);this._cx=w.x,this._cy=w.y;for(let A=0;A<s;A++)this._dists[A]=r0(t[2*A],t[2*A+1],w.x,w.y);Ra(this._ids,this._dists,0,s-1),this._hullStart=h;let _=3;i[h]=n[p]=g,i[g]=n[h]=p,i[p]=n[g]=h,r[h]=0,r[g]=1,r[p]=2,o.fill(-1),o[this._hashKey(m,y)]=h,o[this._hashKey(b,v)]=g,o[this._hashKey(E,S)]=p,this.trianglesLen=0,this._addTriangle(h,g,p,-1,-1,-1);for(let A=0,k,C;A<this._ids.length;A++){const O=this._ids[A],M=t[2*O],F=t[2*O+1];if(A>0&&Math.abs(M-k)<=cA&&Math.abs(F-C)<=cA||(k=M,C=F,O===h||O===g||O===p))continue;let $=0;for(let Q=0,ue=this._hashKey(M,F);Q<this._hashSize&&($=o[(ue+Q)%this._hashSize],!($!==-1&&$!==i[$]));Q++);$=n[$];let T=$,L;for(;L=i[T],Wf(M,F,t[2*T],t[2*T+1],t[2*L],t[2*L+1])>=0;)if(T=L,T===$){T=-1;break}if(T===-1)continue;let z=this._addTriangle(T,O,i[T],-1,-1,r[T]);r[O]=this._legalize(z+2),r[T]=z,_++;let I=i[T];for(;L=i[I],Wf(M,F,t[2*I],t[2*I+1],t[2*L],t[2*L+1])<0;)z=this._addTriangle(I,O,L,r[O],-1,r[I]),r[O]=this._legalize(z+2),i[I]=I,_--,I=L;if(T===$)for(;L=n[T],Wf(M,F,t[2*L],t[2*L+1],t[2*T],t[2*T+1])<0;)z=this._addTriangle(L,O,T,-1,r[T],r[L]),this._legalize(z+2),r[L]=z,i[T]=T,_--,T=L;this._hullStart=n[O]=T,i[T]=n[I]=O,i[O]=I,o[this._hashKey(M,F)]=O,o[this._hashKey(t[2*T],t[2*T+1])]=T}this.hull=new Uint32Array(_);for(let A=0,k=this._hullStart;A<_;A++)this.hull[A]=k,k=i[k];this.triangles=this._triangles.subarray(0,this.trianglesLen),this.halfedges=this._halfedges.subarray(0,this.trianglesLen)}_hashKey(t,n){return Math.floor(mV(t-this._cx,n-this._cy)*this._hashSize)%this._hashSize}_legalize(t){const{_triangles:n,_halfedges:i,coords:r}=this;let o=0,s=0;for(;;){const a=i[t],u=t-t%3;if(s=u+(t+2)%3,a===-1){if(o===0)break;t=Hf[--o];continue}const l=a-a%3,c=u+(t+1)%3,f=l+(a+2)%3,d=n[s],h=n[t],g=n[c],p=n[f];if(yV(r[2*d],r[2*d+1],r[2*h],r[2*h+1],r[2*g],r[2*g+1],r[2*p],r[2*p+1])){n[t]=p,n[a]=d;const y=i[f];if(y===-1){let v=this._hullStart;do{if(this._hullTri[v]===f){this._hullTri[v]=t;break}v=this._hullPrev[v]}while(v!==this._hullStart)}this._link(t,y),this._link(a,i[s]),this._link(s,f);const b=l+(a+1)%3;o<Hf.length&&(Hf[o++]=b)}else{if(o===0)break;t=Hf[--o]}}return s}_link(t,n){this._halfedges[t]=n,n!==-1&&(this._halfedges[n]=t)}_addTriangle(t,n,i,r,o,s){const a=this.trianglesLen;return this._triangles[a]=t,this._triangles[a+1]=n,this._triangles[a+2]=i,this._link(a,r),this._link(a+1,o),this._link(a+2,s),this.trianglesLen+=3,a}}function mV(e,t){const n=e/(Math.abs(e)+Math.abs(t));return(t>0?3-n:1+n)/4}function r0(e,t,n,i){const r=e-n,o=t-i;return r*r+o*o}function yV(e,t,n,i,r,o,s,a){const u=e-s,l=t-a,c=n-s,f=i-a,d=r-s,h=o-a,g=u*u+l*l,p=c*c+f*f,m=d*d+h*h;return u*(f*m-p*h)-l*(c*m-p*d)+g*(c*h-f*d)<0}function bV(e,t,n,i,r,o){const s=n-e,a=i-t,u=r-e,l=o-t,c=s*s+a*a,f=u*u+l*l,d=.5/(s*l-a*u),h=(l*c-a*f)*d,g=(s*f-u*c)*d;return h*h+g*g}function vV(e,t,n,i,r,o){const s=n-e,a=i-t,u=r-e,l=o-t,c=s*s+a*a,f=u*u+l*l,d=.5/(s*l-a*u),h=e+(l*c-a*f)*d,g=t+(s*f-u*c)*d;return{x:h,y:g}}function Ra(e,t,n,i){if(i-n<=20)for(let r=n+1;r<=i;r++){const o=e[r],s=t[o];let a=r-1;for(;a>=n&&t[e[a]]>s;)e[a+1]=e[a--];e[a+1]=o}else{const r=n+i>>1;let o=n+1,s=i;cl(e,r,o),t[e[n]]>t[e[i]]&&cl(e,n,i),t[e[o]]>t[e[i]]&&cl(e,o,i),t[e[n]]>t[e[o]]&&cl(e,n,o);const a=e[o],u=t[a];for(;;){do o++;while(t[e[o]]<u);do s--;while(t[e[s]]>u);if(s<o)break;cl(e,o,s)}e[n+1]=e[s],e[s]=a,i-o+1>=s-n?(Ra(e,t,o,i),Ra(e,t,n,s-1)):(Ra(e,t,n,s-1),Ra(e,t,o,i))}}function cl(e,t,n){const i=e[t];e[t]=e[n],e[n]=i}function xV(e){return e[0]}function wV(e){return e[1]}const fA=1e-6;class Ss{constructor(){this._x0=this._y0=this._x1=this._y1=null,this._=""}moveTo(t,n){this._+=`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")}lineTo(t,n){this._+=`L${this._x1=+t},${this._y1=+n}`}arc(t,n,i){t=+t,n=+n,i=+i;const r=t+i,o=n;if(i<0)throw new Error("negative radius");this._x1===null?this._+=`M${r},${o}`:(Math.abs(this._x1-r)>fA||Math.abs(this._y1-o)>fA)&&(this._+="L"+r+","+o),i&&(this._+=`A${i},${i},0,1,1,${t-i},${n}A${i},${i},0,1,1,${this._x1=r},${this._y1=o}`)}rect(t,n,i,r){this._+=`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${+i}v${+r}h${-i}Z`}value(){return this._||null}}class dy{constructor(){this._=[]}moveTo(t,n){this._.push([t,n])}closePath(){this._.push(this._[0].slice())}lineTo(t,n){this._.push([t,n])}value(){return this._.length?this._:null}}let EV=class{constructor(t,[n,i,r,o]=[0,0,960,500]){if(!((r=+r)>=(n=+n))||!((o=+o)>=(i=+i)))throw new Error("invalid bounds");this.delaunay=t,this._circumcenters=new Float64Array(t.points.length*2),this.vectors=new Float64Array(t.points.length*2),this.xmax=r,this.xmin=n,this.ymax=o,this.ymin=i,this._init()}update(){return this.delaunay.update(),this._init(),this}_init(){const{delaunay:{points:t,hull:n,triangles:i},vectors:r}=this;let o,s;const a=this.circumcenters=this._circumcenters.subarray(0,i.length/3*2);for(let p=0,m=0,y=i.length,b,v;p<y;p+=3,m+=2){const x=i[p]*2,E=i[p+1]*2,S=i[p+2]*2,w=t[x],_=t[x+1],A=t[E],k=t[E+1],C=t[S],O=t[S+1],M=A-w,F=k-_,$=C-w,T=O-_,L=(M*T-F*$)*2;if(Math.abs(L)<1e-9){if(o===void 0){o=s=0;for(const I of n)o+=t[I*2],s+=t[I*2+1];o/=n.length,s/=n.length}const z=1e9*Math.sign((o-w)*T-(s-_)*$);b=(w+C)/2-z*T,v=(_+O)/2+z*$}else{const z=1/L,I=M*M+F*F,Q=$*$+T*T;b=w+(T*I-F*Q)*z,v=_+(M*Q-$*I)*z}a[m]=b,a[m+1]=v}let u=n[n.length-1],l,c=u*4,f,d=t[2*u],h,g=t[2*u+1];r.fill(0);for(let p=0;p<n.length;++p)u=n[p],l=c,f=d,h=g,c=u*4,d=t[2*u],g=t[2*u+1],r[l+2]=r[c]=h-g,r[l+3]=r[c+1]=d-f}render(t){const n=t==null?t=new Ss:void 0,{delaunay:{halfedges:i,inedges:r,hull:o},circumcenters:s,vectors:a}=this;if(o.length<=1)return null;for(let c=0,f=i.length;c<f;++c){const d=i[c];if(d<c)continue;const h=Math.floor(c/3)*2,g=Math.floor(d/3)*2,p=s[h],m=s[h+1],y=s[g],b=s[g+1];this._renderSegment(p,m,y,b,t)}let u,l=o[o.length-1];for(let c=0;c<o.length;++c){u=l,l=o[c];const f=Math.floor(r[l]/3)*2,d=s[f],h=s[f+1],g=u*4,p=this._project(d,h,a[g+2],a[g+3]);p&&this._renderSegment(d,h,p[0],p[1],t)}return n&&n.value()}renderBounds(t){const n=t==null?t=new Ss:void 0;return t.rect(this.xmin,this.ymin,this.xmax-this.xmin,this.ymax-this.ymin),n&&n.value()}renderCell(t,n){const i=n==null?n=new Ss:void 0,r=this._clip(t);if(r===null||!r.length)return;n.moveTo(r[0],r[1]);let o=r.length;for(;r[0]===r[o-2]&&r[1]===r[o-1]&&o>1;)o-=2;for(let s=2;s<o;s+=2)(r[s]!==r[s-2]||r[s+1]!==r[s-1])&&n.lineTo(r[s],r[s+1]);return n.closePath(),i&&i.value()}*cellPolygons(){const{delaunay:{points:t}}=this;for(let n=0,i=t.length/2;n<i;++n){const r=this.cellPolygon(n);r&&(r.index=n,yield r)}}cellPolygon(t){const n=new dy;return this.renderCell(t,n),n.value()}_renderSegment(t,n,i,r,o){let s;const a=this._regioncode(t,n),u=this._regioncode(i,r);a===0&&u===0?(o.moveTo(t,n),o.lineTo(i,r)):(s=this._clipSegment(t,n,i,r,a,u))&&(o.moveTo(s[0],s[1]),o.lineTo(s[2],s[3]))}contains(t,n,i){return n=+n,n!==n||(i=+i,i!==i)?!1:this.delaunay._step(t,n,i)===t}*neighbors(t){const n=this._clip(t);if(n)for(const i of this.delaunay.neighbors(t)){const r=this._clip(i);if(r){e:for(let o=0,s=n.length;o<s;o+=2)for(let a=0,u=r.length;a<u;a+=2)if(n[o]===r[a]&&n[o+1]===r[a+1]&&n[(o+2)%s]===r[(a+u-2)%u]&&n[(o+3)%s]===r[(a+u-1)%u]){yield i;break e}}}}_cell(t){const{circumcenters:n,delaunay:{inedges:i,halfedges:r,triangles:o}}=this,s=i[t];if(s===-1)return null;const a=[];let u=s;do{const l=Math.floor(u/3);if(a.push(n[l*2],n[l*2+1]),u=u%3===2?u-2:u+1,o[u]!==t)break;u=r[u]}while(u!==s&&u!==-1);return a}_clip(t){if(t===0&&this.delaunay.hull.length===1)return[this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax,this.xmin,this.ymin];const n=this._cell(t);if(n===null)return null;const{vectors:i}=this,r=t*4;return this._simplify(i[r]||i[r+1]?this._clipInfinite(t,n,i[r],i[r+1],i[r+2],i[r+3]):this._clipFinite(t,n))}_clipFinite(t,n){const i=n.length;let r=null,o,s,a=n[i-2],u=n[i-1],l,c=this._regioncode(a,u),f,d=0;for(let h=0;h<i;h+=2)if(o=a,s=u,a=n[h],u=n[h+1],l=c,c=this._regioncode(a,u),l===0&&c===0)f=d,d=0,r?r.push(a,u):r=[a,u];else{let g,p,m,y,b;if(l===0){if((g=this._clipSegment(o,s,a,u,l,c))===null)continue;[p,m,y,b]=g}else{if((g=this._clipSegment(a,u,o,s,c,l))===null)continue;[y,b,p,m]=g,f=d,d=this._edgecode(p,m),f&&d&&this._edge(t,f,d,r,r.length),r?r.push(p,m):r=[p,m]}f=d,d=this._edgecode(y,b),f&&d&&this._edge(t,f,d,r,r.length),r?r.push(y,b):r=[y,b]}if(r)f=d,d=this._edgecode(r[0],r[1]),f&&d&&this._edge(t,f,d,r,r.length);else if(this.contains(t,(this.xmin+this.xmax)/2,(this.ymin+this.ymax)/2))return[this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax,this.xmin,this.ymin];return r}_clipSegment(t,n,i,r,o,s){const a=o<s;for(a&&([t,n,i,r,o,s]=[i,r,t,n,s,o]);;){if(o===0&&s===0)return a?[i,r,t,n]:[t,n,i,r];if(o&s)return null;let u,l,c=o||s;c&8?(u=t+(i-t)*(this.ymax-n)/(r-n),l=this.ymax):c&4?(u=t+(i-t)*(this.ymin-n)/(r-n),l=this.ymin):c&2?(l=n+(r-n)*(this.xmax-t)/(i-t),u=this.xmax):(l=n+(r-n)*(this.xmin-t)/(i-t),u=this.xmin),o?(t=u,n=l,o=this._regioncode(t,n)):(i=u,r=l,s=this._regioncode(i,r))}}_clipInfinite(t,n,i,r,o,s){let a=Array.from(n),u;if((u=this._project(a[0],a[1],i,r))&&a.unshift(u[0],u[1]),(u=this._project(a[a.length-2],a[a.length-1],o,s))&&a.push(u[0],u[1]),a=this._clipFinite(t,a))for(let l=0,c=a.length,f,d=this._edgecode(a[c-2],a[c-1]);l<c;l+=2)f=d,d=this._edgecode(a[l],a[l+1]),f&&d&&(l=this._edge(t,f,d,a,l),c=a.length);else this.contains(t,(this.xmin+this.xmax)/2,(this.ymin+this.ymax)/2)&&(a=[this.xmin,this.ymin,this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax]);return a}_edge(t,n,i,r,o){for(;n!==i;){let s,a;switch(n){case 5:n=4;continue;case 4:n=6,s=this.xmax,a=this.ymin;break;case 6:n=2;continue;case 2:n=10,s=this.xmax,a=this.ymax;break;case 10:n=8;continue;case 8:n=9,s=this.xmin,a=this.ymax;break;case 9:n=1;continue;case 1:n=5,s=this.xmin,a=this.ymin;break}(r[o]!==s||r[o+1]!==a)&&this.contains(t,s,a)&&(r.splice(o,0,s,a),o+=2)}return o}_project(t,n,i,r){let o=1/0,s,a,u;if(r<0){if(n<=this.ymin)return null;(s=(this.ymin-n)/r)<o&&(u=this.ymin,a=t+(o=s)*i)}else if(r>0){if(n>=this.ymax)return null;(s=(this.ymax-n)/r)<o&&(u=this.ymax,a=t+(o=s)*i)}if(i>0){if(t>=this.xmax)return null;(s=(this.xmax-t)/i)<o&&(a=this.xmax,u=n+(o=s)*r)}else if(i<0){if(t<=this.xmin)return null;(s=(this.xmin-t)/i)<o&&(a=this.xmin,u=n+(o=s)*r)}return[a,u]}_edgecode(t,n){return(t===this.xmin?1:t===this.xmax?2:0)|(n===this.ymin?4:n===this.ymax?8:0)}_regioncode(t,n){return(t<this.xmin?1:t>this.xmax?2:0)|(n<this.ymin?4:n>this.ymax?8:0)}_simplify(t){if(t&&t.length>4){for(let n=0;n<t.length;n+=2){const i=(n+2)%t.length,r=(n+4)%t.length;(t[n]===t[i]&&t[i]===t[r]||t[n+1]===t[i+1]&&t[i+1]===t[r+1])&&(t.splice(i,2),n-=2)}t.length||(t=null)}return t}};const SV=2*Math.PI,Sa=Math.pow;function _V(e){return e[0]}function AV(e){return e[1]}function $V(e){const{triangles:t,coords:n}=e;for(let i=0;i<t.length;i+=3){const r=2*t[i],o=2*t[i+1],s=2*t[i+2];if((n[s]-n[r])*(n[o+1]-n[r+1])-(n[o]-n[r])*(n[s+1]-n[r+1])>1e-10)return!1}return!0}function kV(e,t,n){return[e+Math.sin(e+t)*n,t+Math.cos(e-t)*n]}class p2{static from(t,n=_V,i=AV,r){return new p2("length"in t?CV(t,n,i,r):Float64Array.from(FV(t,n,i,r)))}constructor(t){this._delaunator=new Nh(t),this.inedges=new Int32Array(t.length/2),this._hullIndex=new Int32Array(t.length/2),this.points=this._delaunator.coords,this._init()}update(){return this._delaunator.update(),this._init(),this}_init(){const t=this._delaunator,n=this.points;if(t.hull&&t.hull.length>2&&$V(t)){this.collinear=Int32Array.from({length:n.length/2},(d,h)=>h).sort((d,h)=>n[2*d]-n[2*h]||n[2*d+1]-n[2*h+1]);const u=this.collinear[0],l=this.collinear[this.collinear.length-1],c=[n[2*u],n[2*u+1],n[2*l],n[2*l+1]],f=1e-8*Math.hypot(c[3]-c[1],c[2]-c[0]);for(let d=0,h=n.length/2;d<h;++d){const g=kV(n[2*d],n[2*d+1],f);n[2*d]=g[0],n[2*d+1]=g[1]}this._delaunator=new Nh(n)}else delete this.collinear;const i=this.halfedges=this._delaunator.halfedges,r=this.hull=this._delaunator.hull,o=this.triangles=this._delaunator.triangles,s=this.inedges.fill(-1),a=this._hullIndex.fill(-1);for(let u=0,l=i.length;u<l;++u){const c=o[u%3===2?u-2:u+1];(i[u]===-1||s[c]===-1)&&(s[c]=u)}for(let u=0,l=r.length;u<l;++u)a[r[u]]=u;r.length<=2&&r.length>0&&(this.triangles=new Int32Array(3).fill(-1),this.halfedges=new Int32Array(3).fill(-1),this.triangles[0]=r[0],s[r[0]]=1,r.length===2&&(s[r[1]]=0,this.triangles[1]=r[1],this.triangles[2]=r[1]))}voronoi(t){return new EV(this,t)}*neighbors(t){const{inedges:n,hull:i,_hullIndex:r,halfedges:o,triangles:s,collinear:a}=this;if(a){const f=a.indexOf(t);f>0&&(yield a[f-1]),f<a.length-1&&(yield a[f+1]);return}const u=n[t];if(u===-1)return;let l=u,c=-1;do{if(yield c=s[l],l=l%3===2?l-2:l+1,s[l]!==t)return;if(l=o[l],l===-1){const f=i[(r[t]+1)%i.length];f!==c&&(yield f);return}}while(l!==u)}find(t,n,i=0){if(t=+t,t!==t||(n=+n,n!==n))return-1;const r=i;let o;for(;(o=this._step(i,t,n))>=0&&o!==i&&o!==r;)i=o;return o}_step(t,n,i){const{inedges:r,hull:o,_hullIndex:s,halfedges:a,triangles:u,points:l}=this;if(r[t]===-1||!l.length)return(t+1)%(l.length>>1);let c=t,f=Sa(n-l[t*2],2)+Sa(i-l[t*2+1],2);const d=r[t];let h=d;do{let g=u[h];const p=Sa(n-l[g*2],2)+Sa(i-l[g*2+1],2);if(p<f&&(f=p,c=g),h=h%3===2?h-2:h+1,u[h]!==t)break;if(h=a[h],h===-1){if(h=o[(s[t]+1)%o.length],h!==g&&Sa(n-l[h*2],2)+Sa(i-l[h*2+1],2)<f)return h;break}}while(h!==d);return c}render(t){const n=t==null?t=new Ss:void 0,{points:i,halfedges:r,triangles:o}=this;for(let s=0,a=r.length;s<a;++s){const u=r[s];if(u<s)continue;const l=o[s]*2,c=o[u]*2;t.moveTo(i[l],i[l+1]),t.lineTo(i[c],i[c+1])}return this.renderHull(t),n&&n.value()}renderPoints(t,n){n===void 0&&(!t||typeof t.moveTo!="function")&&(n=t,t=null),n=n==null?2:+n;const i=t==null?t=new Ss:void 0,{points:r}=this;for(let o=0,s=r.length;o<s;o+=2){const a=r[o],u=r[o+1];t.moveTo(a+n,u),t.arc(a,u,n,0,SV)}return i&&i.value()}renderHull(t){const n=t==null?t=new Ss:void 0,{hull:i,points:r}=this,o=i[0]*2,s=i.length;t.moveTo(r[o],r[o+1]);for(let a=1;a<s;++a){const u=2*i[a];t.lineTo(r[u],r[u+1])}return t.closePath(),n&&n.value()}hullPolygon(){const t=new dy;return this.renderHull(t),t.value()}renderTriangle(t,n){const i=n==null?n=new Ss:void 0,{points:r,triangles:o}=this,s=o[t*=3]*2,a=o[t+1]*2,u=o[t+2]*2;return n.moveTo(r[s],r[s+1]),n.lineTo(r[a],r[a+1]),n.lineTo(r[u],r[u+1]),n.closePath(),i&&i.value()}*trianglePolygons(){const{triangles:t}=this;for(let n=0,i=t.length/3;n<i;++n)yield this.trianglePolygon(n)}trianglePolygon(t){const n=new dy;return this.renderTriangle(t,n),n.value()}}function CV(e,t,n,i){const r=e.length,o=new Float64Array(r*2);for(let s=0;s<r;++s){const a=e[s];o[s*2]=t.call(i,a,s,e),o[s*2+1]=n.call(i,a,s,e)}return o}function*FV(e,t,n,i){let r=0;for(const o of e)yield t.call(i,o,r,e),yield n.call(i,o,r,e),++r}function m2(e){D.call(this,null,e)}m2.Definition={type:"Voronoi",metadata:{modifies:!0},params:[{name:"x",type:"field",required:!0},{name:"y",type:"field",required:!0},{name:"size",type:"number",array:!0,length:2},{name:"extent",type:"array",array:!0,length:2,default:[[-1e5,-1e5],[1e5,1e5]],content:{type:"number",array:!0,length:2}},{name:"as",type:"string",default:"path"}]};const TV=[-1e5,-1e5,1e5,1e5];G(m2,D,{transform(e,t){const n=e.as||"path",i=t.source;if(!i||!i.length)return t;let r=e.size;r=r?[0,0,r[0],r[1]]:(r=e.extent)?[r[0][0],r[0][1],r[1][0],r[1][1]]:TV;const o=this.value=p2.from(i,e.x,e.y).voronoi(r);for(let s=0,a=i.length;s<a;++s){const u=o.cellPolygon(s);i[s][n]=u&&!DV(u)?MV(u):null}return t.reflow(e.modified()).modifies(n)}});function MV(e){const t=e[0][0],n=e[0][1];let i=e.length-1;for(;e[i][0]===t&&e[i][1]===n;--i);return"M"+e.slice(0,i+1).join("L")+"Z"}function DV(e){return e.length===2&&e[0][0]===e[1][0]&&e[0][1]===e[1][1]}const OV=Object.freeze(Object.defineProperty({__proto__:null,voronoi:m2},Symbol.toStringTag,{value:"Module"}));var o0=Math.PI/180,zl=64,Ad=2048;function RV(){var e=[256,256],t,n,i,r,o,s,a,u=SR,l=[],c=Math.random,f={};f.layout=function(){for(var g=d($o()),p=BV((e[0]>>5)*e[1]),m=null,y=l.length,b=-1,v=[],x=l.map(S=>({text:t(S),font:n(S),style:r(S),weight:o(S),rotate:s(S),size:~~(i(S)+1e-14),padding:a(S),xoff:0,yoff:0,x1:0,y1:0,x0:0,y0:0,hasText:!1,sprite:null,datum:S})).sort((S,w)=>w.size-S.size);++b<y;){var E=x[b];E.x=e[0]*(c()+.5)>>1,E.y=e[1]*(c()+.5)>>1,NV(g,E,x,b),E.hasText&&h(p,E,m)&&(v.push(E),m?PV(m,E):m=[{x:E.x+E.x0,y:E.y+E.y0},{x:E.x+E.x1,y:E.y+E.y1}],E.x-=e[0]>>1,E.y-=e[1]>>1)}return v};function d(g){g.width=g.height=1;var p=Math.sqrt(g.getContext("2d").getImageData(0,0,1,1).data.length>>2);g.width=(zl<<5)/p,g.height=Ad/p;var m=g.getContext("2d");return m.fillStyle=m.strokeStyle="red",m.textAlign="center",{context:m,ratio:p}}function h(g,p,m){for(var y=p.x,b=p.y,v=Math.hypot(e[0],e[1]),x=u(e),E=c()<.5?1:-1,S=-E,w,_,A;(w=x(S+=E))&&(_=~~w[0],A=~~w[1],!(Math.min(Math.abs(_),Math.abs(A))>=v));)if(p.x=y+_,p.y=b+A,!(p.x+p.x0<0||p.y+p.y0<0||p.x+p.x1>e[0]||p.y+p.y1>e[1])&&(!m||!LV(p,g,e[0]))&&(!m||IV(p,m))){for(var k=p.sprite,C=p.width>>5,O=e[0]>>5,M=p.x-(C<<4),F=M&127,$=32-F,T=p.y1-p.y0,L=(p.y+p.y0)*O+(M>>5),z,I=0;I<T;I++){z=0;for(var Q=0;Q<=C;Q++)g[L+Q]|=z<<$|(Q<C?(z=k[I*C+Q])>>>F:0);L+=O}return p.sprite=null,!0}return!1}return f.words=function(g){return arguments.length?(l=g,f):l},f.size=function(g){return arguments.length?(e=[+g[0],+g[1]],f):e},f.font=function(g){return arguments.length?(n=is(g),f):n},f.fontStyle=function(g){return arguments.length?(r=is(g),f):r},f.fontWeight=function(g){return arguments.length?(o=is(g),f):o},f.rotate=function(g){return arguments.length?(s=is(g),f):s},f.text=function(g){return arguments.length?(t=is(g),f):t},f.spiral=function(g){return arguments.length?(u=UV[g]||g,f):u},f.fontSize=function(g){return arguments.length?(i=is(g),f):i},f.padding=function(g){return arguments.length?(a=is(g),f):a},f.random=function(g){return arguments.length?(c=g,f):c},f}function NV(e,t,n,i){if(!t.sprite){var r=e.context,o=e.ratio;r.clearRect(0,0,(zl<<5)/o,Ad/o);var s=0,a=0,u=0,l=n.length,c,f,d,h,g;for(--i;++i<l;){if(t=n[i],r.save(),r.font=t.style+" "+t.weight+" "+~~((t.size+1)/o)+"px "+t.font,c=r.measureText(t.text+"m").width*o,d=t.size<<1,t.rotate){var p=Math.sin(t.rotate*o0),m=Math.cos(t.rotate*o0),y=c*m,b=c*p,v=d*m,x=d*p;c=Math.max(Math.abs(y+x),Math.abs(y-x))+31>>5<<5,d=~~Math.max(Math.abs(b+v),Math.abs(b-v))}else c=c+31>>5<<5;if(d>u&&(u=d),s+c>=zl<<5&&(s=0,a+=u,u=0),a+d>=Ad)break;r.translate((s+(c>>1))/o,(a+(d>>1))/o),t.rotate&&r.rotate(t.rotate*o0),r.fillText(t.text,0,0),t.padding&&(r.lineWidth=2*t.padding,r.strokeText(t.text,0,0)),r.restore(),t.width=c,t.height=d,t.xoff=s,t.yoff=a,t.x1=c>>1,t.y1=d>>1,t.x0=-t.x1,t.y0=-t.y1,t.hasText=!0,s+=c}for(var E=r.getImageData(0,0,(zl<<5)/o,Ad/o).data,S=[];--i>=0;)if(t=n[i],!!t.hasText){for(c=t.width,f=c>>5,d=t.y1-t.y0,h=0;h<d*f;h++)S[h]=0;if(s=t.xoff,s==null)return;a=t.yoff;var w=0,_=-1;for(g=0;g<d;g++){for(h=0;h<c;h++){var A=f*g+(h>>5),k=E[(a+g)*(zl<<5)+(s+h)<<2]?1<<31-h%32:0;S[A]|=k,w|=k}w?_=g:(t.y0++,d--,g--,a++)}t.y1=t.y0+_,t.sprite=S.slice(0,(t.y1-t.y0)*f)}}}function LV(e,t,n){n>>=5;for(var i=e.sprite,r=e.width>>5,o=e.x-(r<<4),s=o&127,a=32-s,u=e.y1-e.y0,l=(e.y+e.y0)*n+(o>>5),c,f=0;f<u;f++){c=0;for(var d=0;d<=r;d++)if((c<<a|(d<r?(c=i[f*r+d])>>>s:0))&t[l+d])return!0;l+=n}return!1}function PV(e,t){var n=e[0],i=e[1];t.x+t.x0<n.x&&(n.x=t.x+t.x0),t.y+t.y0<n.y&&(n.y=t.y+t.y0),t.x+t.x1>i.x&&(i.x=t.x+t.x1),t.y+t.y1>i.y&&(i.y=t.y+t.y1)}function IV(e,t){return e.x+e.x1>t[0].x&&e.x+e.x0<t[1].x&&e.y+e.y1>t[0].y&&e.y+e.y0<t[1].y}function SR(e){var t=e[0]/e[1];return function(n){return[t*(n*=.1)*Math.cos(n),n*Math.sin(n)]}}function zV(e){var t=4,n=t*e[0]/e[1],i=0,r=0;return function(o){var s=o<0?-1:1;switch(Math.sqrt(1+4*s*o)-s&3){case 0:i+=n;break;case 1:r+=t;break;case 2:i-=n;break;default:r-=t;break}return[i,r]}}function BV(e){for(var t=[],n=-1;++n<e;)t[n]=0;return t}function is(e){return typeof e=="function"?e:function(){return e}}var UV={archimedean:SR,rectangular:zV};const _R=["x","y","font","fontSize","fontStyle","fontWeight","angle"],jV=["text","font","rotate","fontSize","fontStyle","fontWeight"];function y2(e){D.call(this,RV(),e)}y2.Definition={type:"Wordcloud",metadata:{modifies:!0},params:[{name:"size",type:"number",array:!0,length:2},{name:"font",type:"string",expr:!0,default:"sans-serif"},{name:"fontStyle",type:"string",expr:!0,default:"normal"},{name:"fontWeight",type:"string",expr:!0,default:"normal"},{name:"fontSize",type:"number",expr:!0,default:14},{name:"fontSizeRange",type:"number",array:"nullable",default:[10,50]},{name:"rotate",type:"number",expr:!0,default:0},{name:"text",type:"field"},{name:"spiral",type:"string",values:["archimedean","rectangular"]},{name:"padding",type:"number",expr:!0},{name:"as",type:"string",array:!0,length:7,default:_R}]};G(y2,D,{transform(e,t){e.size&&!(e.size[0]&&e.size[1])&&N("Wordcloud size dimensions must be non-zero.");function n(g){const p=e[g];return ge(p)&&t.modified(p.fields)}const i=e.modified();if(!(i||t.changed(t.ADD_REM)||jV.some(n)))return;const r=t.materialize(t.SOURCE).source,o=this.value,s=e.as||_R;let a=e.fontSize||14,u;if(ge(a)?u=e.fontSizeRange:a=Yt(a),u){const g=a,p=ke("sqrt")().domain(Qi(r,g)).range(u);a=m=>p(g(m))}r.forEach(g=>{g[s[0]]=NaN,g[s[1]]=NaN,g[s[3]]=0});const l=o.words(r).text(e.text).size(e.size||[500,500]).padding(e.padding||1).spiral(e.spiral||"archimedean").rotate(e.rotate||0).font(e.font||"sans-serif").fontStyle(e.fontStyle||"normal").fontWeight(e.fontWeight||"normal").fontSize(a).random(ei).layout(),c=o.size(),f=c[0]>>1,d=c[1]>>1,h=l.length;for(let g=0,p,m;g<h;++g)p=l[g],m=p.datum,m[s[0]]=p.x+f,m[s[1]]=p.y+d,m[s[2]]=p.font,m[s[3]]=p.size,m[s[4]]=p.style,m[s[5]]=p.weight,m[s[6]]=p.rotate;return t.reflow(i).modifies(s)}});const qV=Object.freeze(Object.defineProperty({__proto__:null,wordcloud:y2},Symbol.toStringTag,{value:"Module"})),WV=e=>new Uint8Array(e),HV=e=>new Uint16Array(e),Ql=e=>new Uint32Array(e);function GV(){let e=8,t=[],n=Ql(0),i=Gf(0,e),r=Gf(0,e);return{data:()=>t,seen:()=>n=VV(n,t.length),add(o){for(let s=0,a=t.length,u=o.length,l;s<u;++s)l=o[s],l._index=a++,t.push(l)},remove(o,s){const a=t.length,u=Array(a-o),l=t;let c,f,d;for(f=0;!s[f]&&f<a;++f)u[f]=t[f],l[f]=f;for(d=f;f<a;++f)c=t[f],s[f]?l[f]=-1:(l[f]=d,i[d]=i[f],r[d]=r[f],u[d]=c,c._index=d++),i[f]=0;return t=u,l},size:()=>t.length,curr:()=>i,prev:()=>r,reset:o=>r[o]=i[o],all:()=>e<257?255:e<65537?65535:4294967295,set(o,s){i[o]|=s},clear(o,s){i[o]&=~s},resize(o,s){const a=i.length;(o>a||s>e)&&(e=Math.max(s,e),i=Gf(o,e,i),r=Gf(o,e))}}}function VV(e,t,n){return e.length>=t?e:(n=n||new e.constructor(t),n.set(e),n)}function Gf(e,t,n){const i=(t<257?WV:t<65537?HV:Ql)(e);return n&&i.set(n),i}function dA(e,t,n){const i=1<<t;return{one:i,zero:~i,range:n.slice(),bisect:e.bisect,index:e.index,size:e.size,onAdd(r,o){const s=this,a=s.bisect(s.range,r.value),u=r.index,l=a[0],c=a[1],f=u.length;let d;for(d=0;d<l;++d)o[u[d]]|=i;for(d=c;d<f;++d)o[u[d]]|=i;return s}}}function hA(){let e=Ql(0),t=[],n=0;function i(a,u,l){if(!u.length)return[];const c=n,f=u.length,d=Ql(f);let h=Array(f),g,p,m;for(m=0;m<f;++m)h[m]=a(u[m]),d[m]=m;if(h=YV(h,d),c)g=t,p=e,t=Array(c+f),e=Ql(c+f),XV(l,g,p,c,h,d,f,t,e);else{if(l>0)for(m=0;m<f;++m)d[m]+=l;t=h,e=d}return n=c+f,{index:d,value:h}}function r(a,u){const l=n;let c,f,d;for(f=0;!u[e[f]]&&f<l;++f);for(d=f;f<l;++f)u[c=e[f]]||(e[d]=c,t[d]=t[f],++d);n=l-a}function o(a){for(let u=0,l=n;u<l;++u)e[u]=a[e[u]]}function s(a,u){let l;return u?l=u.length:(u=t,l=n),[XP(u,a[0],0,l),Ga(u,a[1],0,l)]}return{insert:i,remove:r,bisect:s,reindex:o,index:()=>e,size:()=>n}}function YV(e,t){return e.sort.call(t,(n,i)=>{const r=e[n],o=e[i];return r<o?-1:r>o?1:0}),KI(e,t)}function XV(e,t,n,i,r,o,s,a,u){let l=0,c=0,f;for(f=0;l<i&&c<s;++f)t[l]<r[c]?(a[f]=t[l],u[f]=n[l++]):(a[f]=r[c],u[f]=o[c++]+e);for(;l<i;++l,++f)a[f]=t[l],u[f]=n[l];for(;c<s;++c,++f)a[f]=r[c],u[f]=o[c]+e}function b2(e){D.call(this,GV(),e),this._indices=null,this._dims=null}b2.Definition={type:"CrossFilter",metadata:{},params:[{name:"fields",type:"field",array:!0,required:!0},{name:"query",type:"array",array:!0,required:!0,content:{type:"number",array:!0,length:2}}]};G(b2,D,{transform(e,t){if(this._dims){var n=e.modified("fields")||e.fields.some(i=>t.modified(i.fields));return n?this.reinit(e,t):this.eval(e,t)}else return this.init(e,t)},init(e,t){const n=e.fields,i=e.query,r=this._indices={},o=this._dims=[],s=i.length;let a=0,u,l;for(;a<s;++a)u=n[a].fname,l=r[u]||(r[u]=hA()),o.push(dA(l,a,i[a]));return this.eval(e,t)},reinit(e,t){const n=t.materialize().fork(),i=e.fields,r=e.query,o=this._indices,s=this._dims,a=this.value,u=a.curr(),l=a.prev(),c=a.all(),f=n.rem=n.add,d=n.mod,h=r.length,g={};let p,m,y,b,v,x,E,S,w;if(l.set(u),t.rem.length&&(v=this.remove(e,t,n)),t.add.length&&a.add(t.add),t.mod.length)for(x={},b=t.mod,E=0,S=b.length;E<S;++E)x[b[E]._index]=1;for(E=0;E<h;++E)w=i[E],(!s[E]||e.modified("fields",E)||t.modified(w.fields))&&(y=w.fname,(p=g[y])||(o[y]=m=hA(),g[y]=p=m.insert(w,t.source,0)),s[E]=dA(m,E,r[E]).onAdd(p,u));for(E=0,S=a.data().length;E<S;++E)v[E]||(l[E]!==u[E]?f.push(E):x[E]&&u[E]!==c&&d.push(E));return a.mask=(1<<h)-1,n},eval(e,t){const n=t.materialize().fork(),i=this._dims.length;let r=0;return t.rem.length&&(this.remove(e,t,n),r|=(1<<i)-1),e.modified("query")&&!e.modified("fields")&&(r|=this.update(e,t,n)),t.add.length&&(this.insert(e,t,n),r|=(1<<i)-1),t.mod.length&&(this.modify(t,n),r|=(1<<i)-1),this.value.mask=r,n},insert(e,t,n){const i=t.add,r=this.value,o=this._dims,s=this._indices,a=e.fields,u={},l=n.add,c=r.size()+i.length,f=o.length;let d=r.size(),h,g,p;r.resize(c,f),r.add(i);const m=r.curr(),y=r.prev(),b=r.all();for(h=0;h<f;++h)g=a[h].fname,p=u[g]||(u[g]=s[g].insert(a[h],i,d)),o[h].onAdd(p,m);for(;d<c;++d)y[d]=b,m[d]!==b&&l.push(d)},modify(e,t){const n=t.mod,i=this.value,r=i.curr(),o=i.all(),s=e.mod;let a,u,l;for(a=0,u=s.length;a<u;++a)l=s[a]._index,r[l]!==o&&n.push(l)},remove(e,t,n){const i=this._indices,r=this.value,o=r.curr(),s=r.prev(),a=r.all(),u={},l=n.rem,c=t.rem;let f,d,h,g;for(f=0,d=c.length;f<d;++f)h=c[f]._index,u[h]=1,s[h]=g=o[h],o[h]=a,g!==a&&l.push(h);for(h in i)i[h].remove(d,u);return this.reindex(t,d,u),u},reindex(e,t,n){const i=this._indices,r=this.value;e.runAfter(()=>{const o=r.remove(t,n);for(const s in i)i[s].reindex(o)})},update(e,t,n){const i=this._dims,r=e.query,o=t.stamp,s=i.length;let a=0,u,l;for(n.filters=0,l=0;l<s;++l)e.modified("query",l)&&(u=l,++a);if(a===1)a=i[u].one,this.incrementOne(i[u],r[u],n.add,n.rem);else for(l=0,a=0;l<s;++l)e.modified("query",l)&&(a|=i[l].one,this.incrementAll(i[l],r[l],o,n.add),n.rem=n.add);return a},incrementAll(e,t,n,i){const r=this.value,o=r.seen(),s=r.curr(),a=r.prev(),u=e.index(),l=e.bisect(e.range),c=e.bisect(t),f=c[0],d=c[1],h=l[0],g=l[1],p=e.one;let m,y,b;if(f<h)for(m=f,y=Math.min(h,d);m<y;++m)b=u[m],o[b]!==n&&(a[b]=s[b],o[b]=n,i.push(b)),s[b]^=p;else if(f>h)for(m=h,y=Math.min(f,g);m<y;++m)b=u[m],o[b]!==n&&(a[b]=s[b],o[b]=n,i.push(b)),s[b]^=p;if(d>g)for(m=Math.max(f,g),y=d;m<y;++m)b=u[m],o[b]!==n&&(a[b]=s[b],o[b]=n,i.push(b)),s[b]^=p;else if(d<g)for(m=Math.max(h,d),y=g;m<y;++m)b=u[m],o[b]!==n&&(a[b]=s[b],o[b]=n,i.push(b)),s[b]^=p;e.range=t.slice()},incrementOne(e,t,n,i){const r=this.value,o=r.curr(),s=e.index(),a=e.bisect(e.range),u=e.bisect(t),l=u[0],c=u[1],f=a[0],d=a[1],h=e.one;let g,p,m;if(l<f)for(g=l,p=Math.min(f,c);g<p;++g)m=s[g],o[m]^=h,n.push(m);else if(l>f)for(g=f,p=Math.min(l,d);g<p;++g)m=s[g],o[m]^=h,i.push(m);if(c>d)for(g=Math.max(l,d),p=c;g<p;++g)m=s[g],o[m]^=h,n.push(m);else if(c<d)for(g=Math.max(f,c),p=d;g<p;++g)m=s[g],o[m]^=h,i.push(m);e.range=t.slice()}});function v2(e){D.call(this,null,e)}v2.Definition={type:"ResolveFilter",metadata:{},params:[{name:"ignore",type:"number",required:!0,description:"A bit mask indicating which filters to ignore."},{name:"filter",type:"object",required:!0,description:"Per-tuple filter bitmaps from a CrossFilter transform."}]};G(v2,D,{transform(e,t){const n=~(e.ignore||0),i=e.filter,r=i.mask;if(!(r&n))return t.StopPropagation;const o=t.fork(t.ALL),s=i.data(),a=i.curr(),u=i.prev(),l=c=>a[c]&n?null:s[c];return o.filter(o.MOD,l),r&r-1?(o.filter(o.ADD,c=>{const f=a[c]&n;return!f&&f^u[c]&n?s[c]:null}),o.filter(o.REM,c=>{const f=a[c]&n;return f&&!(f^(f^u[c]&n))?s[c]:null})):(o.filter(o.ADD,l),o.filter(o.REM,c=>(a[c]&n)===r?s[c]:null)),o.filter(o.SOURCE,c=>l(c._index))}});const KV=Object.freeze(Object.defineProperty({__proto__:null,crossfilter:b2,resolvefilter:v2},Symbol.toStringTag,{value:"Module"})),JV="RawCode",zs="Literal",QV="Property",ZV="Identifier",eY="ArrayExpression",tY="BinaryExpression",AR="CallExpression",nY="ConditionalExpression",iY="LogicalExpression",rY="MemberExpression",oY="ObjectExpression",sY="UnaryExpression";function ki(e){this.type=e}ki.prototype.visit=function(e){let t,n,i;if(e(this))return 1;for(t=aY(this),n=0,i=t.length;n<i;++n)if(t[n].visit(e))return 1};function aY(e){switch(e.type){case eY:return e.elements;case tY:case iY:return[e.left,e.right];case AR:return[e.callee].concat(e.arguments);case nY:return[e.test,e.consequent,e.alternate];case rY:return[e.object,e.property];case oY:return e.properties;case QV:return[e.key,e.value];case sY:return[e.argument];case ZV:case zs:case JV:default:return[]}}var fr,ee,R,Ht,Me,rp=1,nf=2,Bs=3,Go=4,op=5,ia=6,gn=7,rf=8,uY=9;fr={};fr[rp]="Boolean";fr[nf]="<end>";fr[Bs]="Identifier";fr[Go]="Keyword";fr[op]="Null";fr[ia]="Numeric";fr[gn]="Punctuator";fr[rf]="String";fr[uY]="RegularExpression";var lY="ArrayExpression",cY="BinaryExpression",fY="CallExpression",dY="ConditionalExpression",$R="Identifier",hY="Literal",gY="LogicalExpression",pY="MemberExpression",mY="ObjectExpression",yY="Property",bY="UnaryExpression",ht="Unexpected token %0",vY="Unexpected number",xY="Unexpected string",wY="Unexpected identifier",EY="Unexpected reserved word",SY="Unexpected end of input",hy="Invalid regular expression",s0="Invalid regular expression: missing /",kR="Octal literals are not allowed in strict mode.",_Y="Duplicate data property in object literal not allowed in strict mode",kt="ILLEGAL",bc="Disabled.",AY=new RegExp("[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0620-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u08A0-\\u08B2\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0\\u0AE1\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C\\u0B5D\\u0B5F-\\u0B61\\u0B71\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D\\u0C58\\u0C59\\u0C60\\u0C61\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDE\\u0CE0\\u0CE1\\u0CF1\\u0CF2\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D\\u0D4E\\u0D60\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0E01-\\u0E30\\u0E32\\u0E33\\u0E40-\\u0E46\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC-\\u0EDF\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1877\\u1880-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19C1-\\u19C7\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4B\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1CE9-\\u1CEC\\u1CEE-\\u1CF1\\u1CF5\\u1CF6\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA66E\\uA67F-\\uA69D\\uA6A0-\\uA6EF\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA7AD\\uA7B0\\uA7B1\\uA7F7-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uA9E0-\\uA9E4\\uA9E6-\\uA9EF\\uA9FA-\\uA9FE\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAA60-\\uAA76\\uAA7A\\uAA7E-\\uAAAF\\uAAB1\\uAAB5\\uAAB6\\uAAB9-\\uAABD\\uAAC0\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEA\\uAAF2-\\uAAF4\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB5F\\uAB64\\uAB65\\uABC0-\\uABE2\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]"),$Y=new RegExp("[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0300-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u0483-\\u0487\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u0591-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u05C5\\u05C7\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0610-\\u061A\\u0620-\\u0669\\u066E-\\u06D3\\u06D5-\\u06DC\\u06DF-\\u06E8\\u06EA-\\u06FC\\u06FF\\u0710-\\u074A\\u074D-\\u07B1\\u07C0-\\u07F5\\u07FA\\u0800-\\u082D\\u0840-\\u085B\\u08A0-\\u08B2\\u08E4-\\u0963\\u0966-\\u096F\\u0971-\\u0983\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BC-\\u09C4\\u09C7\\u09C8\\u09CB-\\u09CE\\u09D7\\u09DC\\u09DD\\u09DF-\\u09E3\\u09E6-\\u09F1\\u0A01-\\u0A03\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A3C\\u0A3E-\\u0A42\\u0A47\\u0A48\\u0A4B-\\u0A4D\\u0A51\\u0A59-\\u0A5C\\u0A5E\\u0A66-\\u0A75\\u0A81-\\u0A83\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABC-\\u0AC5\\u0AC7-\\u0AC9\\u0ACB-\\u0ACD\\u0AD0\\u0AE0-\\u0AE3\\u0AE6-\\u0AEF\\u0B01-\\u0B03\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3C-\\u0B44\\u0B47\\u0B48\\u0B4B-\\u0B4D\\u0B56\\u0B57\\u0B5C\\u0B5D\\u0B5F-\\u0B63\\u0B66-\\u0B6F\\u0B71\\u0B82\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BBE-\\u0BC2\\u0BC6-\\u0BC8\\u0BCA-\\u0BCD\\u0BD0\\u0BD7\\u0BE6-\\u0BEF\\u0C00-\\u0C03\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D-\\u0C44\\u0C46-\\u0C48\\u0C4A-\\u0C4D\\u0C55\\u0C56\\u0C58\\u0C59\\u0C60-\\u0C63\\u0C66-\\u0C6F\\u0C81-\\u0C83\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBC-\\u0CC4\\u0CC6-\\u0CC8\\u0CCA-\\u0CCD\\u0CD5\\u0CD6\\u0CDE\\u0CE0-\\u0CE3\\u0CE6-\\u0CEF\\u0CF1\\u0CF2\\u0D01-\\u0D03\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D-\\u0D44\\u0D46-\\u0D48\\u0D4A-\\u0D4E\\u0D57\\u0D60-\\u0D63\\u0D66-\\u0D6F\\u0D7A-\\u0D7F\\u0D82\\u0D83\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0DCA\\u0DCF-\\u0DD4\\u0DD6\\u0DD8-\\u0DDF\\u0DE6-\\u0DEF\\u0DF2\\u0DF3\\u0E01-\\u0E3A\\u0E40-\\u0E4E\\u0E50-\\u0E59\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB9\\u0EBB-\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EC8-\\u0ECD\\u0ED0-\\u0ED9\\u0EDC-\\u0EDF\\u0F00\\u0F18\\u0F19\\u0F20-\\u0F29\\u0F35\\u0F37\\u0F39\\u0F3E-\\u0F47\\u0F49-\\u0F6C\\u0F71-\\u0F84\\u0F86-\\u0F97\\u0F99-\\u0FBC\\u0FC6\\u1000-\\u1049\\u1050-\\u109D\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u135D-\\u135F\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1714\\u1720-\\u1734\\u1740-\\u1753\\u1760-\\u176C\\u176E-\\u1770\\u1772\\u1773\\u1780-\\u17D3\\u17D7\\u17DC\\u17DD\\u17E0-\\u17E9\\u180B-\\u180D\\u1810-\\u1819\\u1820-\\u1877\\u1880-\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1920-\\u192B\\u1930-\\u193B\\u1946-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u19D0-\\u19D9\\u1A00-\\u1A1B\\u1A20-\\u1A5E\\u1A60-\\u1A7C\\u1A7F-\\u1A89\\u1A90-\\u1A99\\u1AA7\\u1AB0-\\u1ABD\\u1B00-\\u1B4B\\u1B50-\\u1B59\\u1B6B-\\u1B73\\u1B80-\\u1BF3\\u1C00-\\u1C37\\u1C40-\\u1C49\\u1C4D-\\u1C7D\\u1CD0-\\u1CD2\\u1CD4-\\u1CF6\\u1CF8\\u1CF9\\u1D00-\\u1DF5\\u1DFC-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u200C\\u200D\\u203F\\u2040\\u2054\\u2071\\u207F\\u2090-\\u209C\\u20D0-\\u20DC\\u20E1\\u20E5-\\u20F0\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D7F-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2DE0-\\u2DFF\\u2E2F\\u3005-\\u3007\\u3021-\\u302F\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u3099\\u309A\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA62B\\uA640-\\uA66F\\uA674-\\uA67D\\uA67F-\\uA69D\\uA69F-\\uA6F1\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA7AD\\uA7B0\\uA7B1\\uA7F7-\\uA827\\uA840-\\uA873\\uA880-\\uA8C4\\uA8D0-\\uA8D9\\uA8E0-\\uA8F7\\uA8FB\\uA900-\\uA92D\\uA930-\\uA953\\uA960-\\uA97C\\uA980-\\uA9C0\\uA9CF-\\uA9D9\\uA9E0-\\uA9FE\\uAA00-\\uAA36\\uAA40-\\uAA4D\\uAA50-\\uAA59\\uAA60-\\uAA76\\uAA7A-\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEF\\uAAF2-\\uAAF6\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB5F\\uAB64\\uAB65\\uABC0-\\uABEA\\uABEC\\uABED\\uABF0-\\uABF9\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE00-\\uFE0F\\uFE20-\\uFE2D\\uFE33\\uFE34\\uFE4D-\\uFE4F\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF10-\\uFF19\\uFF21-\\uFF3A\\uFF3F\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]");function sp(e,t){if(!e)throw new Error("ASSERT: "+t)}function Ar(e){return e>=48&&e<=57}function x2(e){return"0123456789abcdefABCDEF".includes(e)}function Zl(e){return"01234567".includes(e)}function kY(e){return e===32||e===9||e===11||e===12||e===160||e>=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].includes(e)}function vc(e){return e===10||e===13||e===8232||e===8233}function of(e){return e===36||e===95||e>=65&&e<=90||e>=97&&e<=122||e===92||e>=128&&AY.test(String.fromCharCode(e))}function Lh(e){return e===36||e===95||e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||e===92||e>=128&&$Y.test(String.fromCharCode(e))}const CY={if:1,in:1,do:1,var:1,for:1,new:1,try:1,let:1,this:1,else:1,case:1,void:1,with:1,enum:1,while:1,break:1,catch:1,throw:1,const:1,yield:1,class:1,super:1,return:1,typeof:1,delete:1,switch:1,export:1,import:1,public:1,static:1,default:1,finally:1,extends:1,package:1,private:1,function:1,continue:1,debugger:1,interface:1,protected:1,instanceof:1,implements:1};function CR(){for(;R<Ht;){const e=ee.charCodeAt(R);if(kY(e)||vc(e))++R;else break}}function gy(e){var t,n,i,r=0;for(n=e==="u"?4:2,t=0;t<n;++t)R<Ht&&x2(ee[R])?(i=ee[R++],r=r*16+"0123456789abcdef".indexOf(i.toLowerCase())):_e({},ht,kt);return String.fromCharCode(r)}function FY(){var e,t,n,i;for(e=ee[R],t=0,e==="}"&&_e({},ht,kt);R<Ht&&(e=ee[R++],!!x2(e));)t=t*16+"0123456789abcdef".indexOf(e.toLowerCase());return(t>1114111||e!=="}")&&_e({},ht,kt),t<=65535?String.fromCharCode(t):(n=(t-65536>>10)+55296,i=(t-65536&1023)+56320,String.fromCharCode(n,i))}function FR(){var e,t;for(e=ee.charCodeAt(R++),t=String.fromCharCode(e),e===92&&(ee.charCodeAt(R)!==117&&_e({},ht,kt),++R,e=gy("u"),(!e||e==="\\"||!of(e.charCodeAt(0)))&&_e({},ht,kt),t=e);R<Ht&&(e=ee.charCodeAt(R),!!Lh(e));)++R,t+=String.fromCharCode(e),e===92&&(t=t.substr(0,t.length-1),ee.charCodeAt(R)!==117&&_e({},ht,kt),++R,e=gy("u"),(!e||e==="\\"||!Lh(e.charCodeAt(0)))&&_e({},ht,kt),t+=e);return t}function TY(){var e,t;for(e=R++;R<Ht;){if(t=ee.charCodeAt(R),t===92)return R=e,FR();if(Lh(t))++R;else break}return ee.slice(e,R)}function MY(){var e,t,n;return e=R,t=ee.charCodeAt(R)===92?FR():TY(),t.length===1?n=Bs:CY.hasOwnProperty(t)?n=Go:t==="null"?n=op:t==="true"||t==="false"?n=rp:n=Bs,{type:n,value:t,start:e,end:R}}function a0(){var e=R,t=ee.charCodeAt(R),n,i=ee[R],r,o,s;switch(t){case 46:case 40:case 41:case 59:case 44:case 123:case 125:case 91:case 93:case 58:case 63:case 126:return++R,{type:gn,value:String.fromCharCode(t),start:e,end:R};default:if(n=ee.charCodeAt(R+1),n===61)switch(t){case 43:case 45:case 47:case 60:case 62:case 94:case 124:case 37:case 38:case 42:return R+=2,{type:gn,value:String.fromCharCode(t)+String.fromCharCode(n),start:e,end:R};case 33:case 61:return R+=2,ee.charCodeAt(R)===61&&++R,{type:gn,value:ee.slice(e,R),start:e,end:R}}}if(s=ee.substr(R,4),s===">>>=")return R+=4,{type:gn,value:s,start:e,end:R};if(o=s.substr(0,3),o===">>>"||o==="<<="||o===">>=")return R+=3,{type:gn,value:o,start:e,end:R};if(r=o.substr(0,2),i===r[1]&&"+-<>&|".includes(i)||r==="=>")return R+=2,{type:gn,value:r,start:e,end:R};if(r==="//"&&_e({},ht,kt),"<>=!+-*%&|^/".includes(i))return++R,{type:gn,value:i,start:e,end:R};_e({},ht,kt)}function DY(e){let t="";for(;R<Ht&&x2(ee[R]);)t+=ee[R++];return t.length===0&&_e({},ht,kt),of(ee.charCodeAt(R))&&_e({},ht,kt),{type:ia,value:parseInt("0x"+t,16),start:e,end:R}}function OY(e){let t="0"+ee[R++];for(;R<Ht&&Zl(ee[R]);)t+=ee[R++];return(of(ee.charCodeAt(R))||Ar(ee.charCodeAt(R)))&&_e({},ht,kt),{type:ia,value:parseInt(t,8),octal:!0,start:e,end:R}}function gA(){var e,t,n;if(n=ee[R],sp(Ar(n.charCodeAt(0))||n===".","Numeric literal must start with a decimal digit or a decimal point"),t=R,e="",n!=="."){if(e=ee[R++],n=ee[R],e==="0"){if(n==="x"||n==="X")return++R,DY(t);if(Zl(n))return OY(t);n&&Ar(n.charCodeAt(0))&&_e({},ht,kt)}for(;Ar(ee.charCodeAt(R));)e+=ee[R++];n=ee[R]}if(n==="."){for(e+=ee[R++];Ar(ee.charCodeAt(R));)e+=ee[R++];n=ee[R]}if(n==="e"||n==="E")if(e+=ee[R++],n=ee[R],(n==="+"||n==="-")&&(e+=ee[R++]),Ar(ee.charCodeAt(R)))for(;Ar(ee.charCodeAt(R));)e+=ee[R++];else _e({},ht,kt);return of(ee.charCodeAt(R))&&_e({},ht,kt),{type:ia,value:parseFloat(e),start:t,end:R}}function RY(){var e="",t,n,i,r,o=!1;for(t=ee[R],sp(t==="'"||t==='"',"String literal must starts with a quote"),n=R,++R;R<Ht;)if(i=ee[R++],i===t){t="";break}else if(i==="\\")if(i=ee[R++],!i||!vc(i.charCodeAt(0)))switch(i){case"u":case"x":ee[R]==="{"?(++R,e+=FY()):e+=gy(i);break;case"n":e+=`
|
8
|
+
`;break;case"r":e+="\r";break;case"t":e+=" ";break;case"b":e+="\b";break;case"f":e+="\f";break;case"v":e+="\v";break;default:Zl(i)?(r="01234567".indexOf(i),r!==0&&(o=!0),R<Ht&&Zl(ee[R])&&(o=!0,r=r*8+"01234567".indexOf(ee[R++]),"0123".includes(i)&&R<Ht&&Zl(ee[R])&&(r=r*8+"01234567".indexOf(ee[R++]))),e+=String.fromCharCode(r)):e+=i;break}else i==="\r"&&ee[R]===`
|
9
|
+
`&&++R;else{if(vc(i.charCodeAt(0)))break;e+=i}return t!==""&&_e({},ht,kt),{type:rf,value:e,octal:o,start:n,end:R}}function NY(e,t){let n=e;t.includes("u")&&(n=n.replace(/\\u\{([0-9a-fA-F]+)\}/g,(i,r)=>{if(parseInt(r,16)<=1114111)return"x";_e({},hy)}).replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"x"));try{new RegExp(n)}catch{_e({},hy)}try{return new RegExp(e,t)}catch{return null}}function LY(){var e,t,n,i,r;for(e=ee[R],sp(e==="/","Regular expression literal must start with a slash"),t=ee[R++],n=!1,i=!1;R<Ht;)if(e=ee[R++],t+=e,e==="\\")e=ee[R++],vc(e.charCodeAt(0))&&_e({},s0),t+=e;else if(vc(e.charCodeAt(0)))_e({},s0);else if(n)e==="]"&&(n=!1);else if(e==="/"){i=!0;break}else e==="["&&(n=!0);return i||_e({},s0),r=t.substr(1,t.length-2),{value:r,literal:t}}function PY(){var e,t,n;for(t="",n="";R<Ht&&(e=ee[R],!!Lh(e.charCodeAt(0)));)++R,e==="\\"&&R<Ht?_e({},ht,kt):(n+=e,t+=e);return n.search(/[^gimuy]/g)>=0&&_e({},hy,n),{value:n,literal:t}}function IY(){var e,t,n,i;return Me=null,CR(),e=R,t=LY(),n=PY(),i=NY(t.value,n.value),{literal:t.literal+n.literal,value:i,regex:{pattern:t.value,flags:n.value},start:e,end:R}}function zY(e){return e.type===Bs||e.type===Go||e.type===rp||e.type===op}function TR(){if(CR(),R>=Ht)return{type:nf,start:R,end:R};const e=ee.charCodeAt(R);return of(e)?MY():e===40||e===41||e===59?a0():e===39||e===34?RY():e===46?Ar(ee.charCodeAt(R+1))?gA():a0():Ar(e)?gA():a0()}function mn(){const e=Me;return R=e.end,Me=TR(),R=e.end,e}function MR(){const e=R;Me=TR(),R=e}function BY(e){const t=new ki(lY);return t.elements=e,t}function pA(e,t,n){const i=new ki(e==="||"||e==="&&"?gY:cY);return i.operator=e,i.left=t,i.right=n,i}function UY(e,t){const n=new ki(fY);return n.callee=e,n.arguments=t,n}function jY(e,t,n){const i=new ki(dY);return i.test=e,i.consequent=t,i.alternate=n,i}function w2(e){const t=new ki($R);return t.name=e,t}function Bl(e){const t=new ki(hY);return t.value=e.value,t.raw=ee.slice(e.start,e.end),e.regex&&(t.raw==="//"&&(t.raw="/(?:)/"),t.regex=e.regex),t}function mA(e,t,n){const i=new ki(pY);return i.computed=e==="[",i.object=t,i.property=n,i.computed||(n.member=!0),i}function qY(e){const t=new ki(mY);return t.properties=e,t}function yA(e,t,n){const i=new ki(yY);return i.key=t,i.value=n,i.kind=e,i}function WY(e,t){const n=new ki(bY);return n.operator=e,n.argument=t,n.prefix=!0,n}function _e(e,t){var n,i=Array.prototype.slice.call(arguments,2),r=t.replace(/%(\d)/g,(o,s)=>(sp(s<i.length,"Message reference must be in range"),i[s]));throw n=new Error(r),n.index=R,n.description=r,n}function ap(e){e.type===nf&&_e(e,SY),e.type===ia&&_e(e,vY),e.type===rf&&_e(e,xY),e.type===Bs&&_e(e,wY),e.type===Go&&_e(e,EY),_e(e,ht,e.value)}function Gt(e){const t=mn();(t.type!==gn||t.value!==e)&&ap(t)}function Be(e){return Me.type===gn&&Me.value===e}function u0(e){return Me.type===Go&&Me.value===e}function HY(){const e=[];for(R=Me.start,Gt("[");!Be("]");)Be(",")?(mn(),e.push(null)):(e.push(Us()),Be("]")||Gt(","));return mn(),BY(e)}function bA(){R=Me.start;const e=mn();return e.type===rf||e.type===ia?(e.octal&&_e(e,kR),Bl(e)):w2(e.value)}function GY(){var e,t,n,i;if(R=Me.start,e=Me,e.type===Bs)return n=bA(),Gt(":"),i=Us(),yA("init",n,i);if(e.type===nf||e.type===gn)ap(e);else return t=bA(),Gt(":"),i=Us(),yA("init",t,i)}function VY(){var e=[],t,n,i,r={},o=String;for(R=Me.start,Gt("{");!Be("}");)t=GY(),t.key.type===$R?n=t.key.name:n=o(t.key.value),i="$"+n,Object.prototype.hasOwnProperty.call(r,i)?_e({},_Y):r[i]=!0,e.push(t),Be("}")||Gt(",");return Gt("}"),qY(e)}function YY(){Gt("(");const e=E2();return Gt(")"),e}const XY={if:1};function KY(){var e,t,n;if(Be("("))return YY();if(Be("["))return HY();if(Be("{"))return VY();if(e=Me.type,R=Me.start,e===Bs||XY[Me.value])n=w2(mn().value);else if(e===rf||e===ia)Me.octal&&_e(Me,kR),n=Bl(mn());else{if(e===Go)throw new Error(bc);e===rp?(t=mn(),t.value=t.value==="true",n=Bl(t)):e===op?(t=mn(),t.value=null,n=Bl(t)):Be("/")||Be("/=")?(n=Bl(IY()),MR()):ap(mn())}return n}function JY(){const e=[];if(Gt("("),!Be(")"))for(;R<Ht&&(e.push(Us()),!Be(")"));)Gt(",");return Gt(")"),e}function QY(){R=Me.start;const e=mn();return zY(e)||ap(e),w2(e.value)}function ZY(){return Gt("."),QY()}function eX(){Gt("[");const e=E2();return Gt("]"),e}function tX(){var e,t,n;for(e=KY();;)if(Be("."))n=ZY(),e=mA(".",e,n);else if(Be("("))t=JY(),e=UY(e,t);else if(Be("["))n=eX(),e=mA("[",e,n);else break;return e}function vA(){const e=tX();if(Me.type===gn&&(Be("++")||Be("--")))throw new Error(bc);return e}function $d(){var e,t;if(Me.type!==gn&&Me.type!==Go)t=vA();else{if(Be("++")||Be("--"))throw new Error(bc);if(Be("+")||Be("-")||Be("~")||Be("!"))e=mn(),t=$d(),t=WY(e.value,t);else{if(u0("delete")||u0("void")||u0("typeof"))throw new Error(bc);t=vA()}}return t}function xA(e){let t=0;if(e.type!==gn&&e.type!==Go)return 0;switch(e.value){case"||":t=1;break;case"&&":t=2;break;case"|":t=3;break;case"^":t=4;break;case"&":t=5;break;case"==":case"!=":case"===":case"!==":t=6;break;case"<":case">":case"<=":case">=":case"instanceof":case"in":t=7;break;case"<<":case">>":case">>>":t=8;break;case"+":case"-":t=9;break;case"*":case"/":case"%":t=11;break}return t}function nX(){var e,t,n,i,r,o,s,a,u,l;if(e=Me,u=$d(),i=Me,r=xA(i),r===0)return u;for(i.prec=r,mn(),t=[e,Me],s=$d(),o=[u,i,s];(r=xA(Me))>0;){for(;o.length>2&&r<=o[o.length-2].prec;)s=o.pop(),a=o.pop().value,u=o.pop(),t.pop(),n=pA(a,u,s),o.push(n);i=mn(),i.prec=r,o.push(i),t.push(Me),n=$d(),o.push(n)}for(l=o.length-1,n=o[l],t.pop();l>1;)t.pop(),n=pA(o[l-1].value,o[l-2],n),l-=2;return n}function Us(){var e,t,n;return e=nX(),Be("?")&&(mn(),t=Us(),Gt(":"),n=Us(),e=jY(e,t,n)),e}function E2(){const e=Us();if(Be(","))throw new Error(bc);return e}function S2(e){ee=e,R=0,Ht=ee.length,Me=null,MR();const t=E2();if(Me.type!==nf)throw new Error("Unexpect token after expression.");return t}var DR={NaN:"NaN",E:"Math.E",LN2:"Math.LN2",LN10:"Math.LN10",LOG2E:"Math.LOG2E",LOG10E:"Math.LOG10E",PI:"Math.PI",SQRT1_2:"Math.SQRT1_2",SQRT2:"Math.SQRT2",MIN_VALUE:"Number.MIN_VALUE",MAX_VALUE:"Number.MAX_VALUE"};function OR(e){function t(s,a,u,l){let c=e(a[0]);return u&&(c=u+"("+c+")",u.lastIndexOf("new ",0)===0&&(c="("+c+")")),c+"."+s+(l<0?"":l===0?"()":"("+a.slice(1).map(e).join(",")+")")}function n(s,a,u){return l=>t(s,l,a,u)}const i="new Date",r="String",o="RegExp";return{isNaN:"Number.isNaN",isFinite:"Number.isFinite",abs:"Math.abs",acos:"Math.acos",asin:"Math.asin",atan:"Math.atan",atan2:"Math.atan2",ceil:"Math.ceil",cos:"Math.cos",exp:"Math.exp",floor:"Math.floor",hypot:"Math.hypot",log:"Math.log",max:"Math.max",min:"Math.min",pow:"Math.pow",random:"Math.random",round:"Math.round",sin:"Math.sin",sqrt:"Math.sqrt",tan:"Math.tan",clamp:function(s){s.length<3&&N("Missing arguments to clamp function."),s.length>3&&N("Too many arguments to clamp function.");const a=s.map(e);return"Math.max("+a[1]+", Math.min("+a[2]+","+a[0]+"))"},now:"Date.now",utc:"Date.UTC",datetime:i,date:n("getDate",i,0),day:n("getDay",i,0),year:n("getFullYear",i,0),month:n("getMonth",i,0),hours:n("getHours",i,0),minutes:n("getMinutes",i,0),seconds:n("getSeconds",i,0),milliseconds:n("getMilliseconds",i,0),time:n("getTime",i,0),timezoneoffset:n("getTimezoneOffset",i,0),utcdate:n("getUTCDate",i,0),utcday:n("getUTCDay",i,0),utcyear:n("getUTCFullYear",i,0),utcmonth:n("getUTCMonth",i,0),utchours:n("getUTCHours",i,0),utcminutes:n("getUTCMinutes",i,0),utcseconds:n("getUTCSeconds",i,0),utcmilliseconds:n("getUTCMilliseconds",i,0),length:n("length",null,-1),parseFloat:"parseFloat",parseInt:"parseInt",upper:n("toUpperCase",r,0),lower:n("toLowerCase",r,0),substring:n("substring",r),split:n("split",r),trim:n("trim",r,0),regexp:o,test:n("test",o),if:function(s){s.length<3&&N("Missing arguments to if function."),s.length>3&&N("Too many arguments to if function.");const a=s.map(e);return"("+a[0]+"?"+a[1]+":"+a[2]+")"}}}function iX(e){const t=e&&e.length-1;return t&&(e[0]==='"'&&e[t]==='"'||e[0]==="'"&&e[t]==="'")?e.slice(1,-1):e}function RR(e){e=e||{};const t=e.allowed?xi(e.allowed):{},n=e.forbidden?xi(e.forbidden):{},i=e.constants||DR,r=(e.functions||OR)(f),o=e.globalvar,s=e.fieldvar,a=ge(o)?o:g=>`${o}["${g}"]`;let u={},l={},c=0;function f(g){if(K(g))return g;const p=d[g.type];return p==null&&N("Unsupported type: "+g.type),p(g)}const d={Literal:g=>g.raw,Identifier:g=>{const p=g.name;return c>0?p:J(n,p)?N("Illegal identifier: "+p):J(i,p)?i[p]:J(t,p)?p:(u[p]=1,a(p))},MemberExpression:g=>{const p=!g.computed,m=f(g.object);p&&(c+=1);const y=f(g.property);return m===s&&(l[iX(y)]=1),p&&(c-=1),m+(p?"."+y:"["+y+"]")},CallExpression:g=>{g.callee.type!=="Identifier"&&N("Illegal callee type: "+g.callee.type);const p=g.callee.name,m=g.arguments,y=J(r,p)&&r[p];return y||N("Unrecognized function: "+p),ge(y)?y(m):y+"("+m.map(f).join(",")+")"},ArrayExpression:g=>"["+g.elements.map(f).join(",")+"]",BinaryExpression:g=>"("+f(g.left)+" "+g.operator+" "+f(g.right)+")",UnaryExpression:g=>"("+g.operator+f(g.argument)+")",ConditionalExpression:g=>"("+f(g.test)+"?"+f(g.consequent)+":"+f(g.alternate)+")",LogicalExpression:g=>"("+f(g.left)+g.operator+f(g.right)+")",ObjectExpression:g=>"{"+g.properties.map(f).join(",")+"}",Property:g=>{c+=1;const p=f(g.key);return c-=1,p+":"+f(g.value)}};function h(g){const p={code:f(g),globals:Object.keys(u),fields:Object.keys(l)};return u={},l={},p}return h.functions=r,h.constants=i,h}const wA=Symbol("vega_selection_getter");function NR(e){return(!e.getter||!e.getter[wA])&&(e.getter=Qn(e.field),e.getter[wA]=!0),e.getter}const _2="intersect",EA="union",rX="vlMulti",oX="vlPoint",SA="or",sX="and",ji="_vgsid_",xc=Qn(ji),aX="E",uX="R",lX="R-E",cX="R-LE",fX="R-RE",Ph="index:unit";function _A(e,t){for(var n=t.fields,i=t.values,r=n.length,o=0,s,a;o<r;++o)if(a=n[o],s=NR(a)(e),So(s)&&(s=Ut(s)),So(i[o])&&(i[o]=Ut(i[o])),P(i[o])&&So(i[o][0])&&(i[o]=i[o].map(Ut)),a.type===aX){if(P(i[o])?i[o].indexOf(s)<0:s!==i[o])return!1}else if(a.type===uX){if(!Ta(s,i[o]))return!1}else if(a.type===fX){if(!Ta(s,i[o],!0,!1))return!1}else if(a.type===lX){if(!Ta(s,i[o],!1,!1))return!1}else if(a.type===cX&&!Ta(s,i[o],!1,!0))return!1;return!0}function dX(e,t,n){for(var i=this.context.data[e],r=i?i.values.value:[],o=i?i[Ph]&&i[Ph].value:void 0,s=n===_2,a=r.length,u=0,l,c,f,d,h;u<a;++u)if(l=r[u],o&&s){if(c=c||{},f=c[d=l.unit]||0,f===-1)continue;if(h=_A(t,l),c[d]=h?-1:++f,h&&o.size===1)return!0;if(!h&&f===o.get(d).count)return!1}else if(h=_A(t,l),s^h)return h;return a&&s}const LR=ag(xc),hX=LR.left,gX=LR.right;function pX(e,t,n){const i=this.context.data[e],r=i?i.values.value:[],o=i?i[Ph]&&i[Ph].value:void 0,s=n===_2,a=xc(t),u=hX(r,a);if(u===r.length||xc(r[u])!==a)return!1;if(o&&s){if(o.size===1)return!0;if(gX(r,a)-u<o.size)return!1}return!0}function mX(e,t){return e.map(n=>he(t.fields?{values:t.fields.map(i=>NR(i)(n.datum))}:{[ji]:xc(n.datum)},t))}function yX(e,t,n,i){for(var r=this.context.data[e],o=r?r.values.value:[],s={},a={},u={},l,c,f,d,h,g,p,m,y,b,v=o.length,x=0,E,S;x<v;++x)if(l=o[x],d=l.unit,c=l.fields,f=l.values,c&&f){for(E=0,S=c.length;E<S;++E)h=c[E],p=s[h.field]||(s[h.field]={}),m=p[d]||(p[d]=[]),u[h.field]=y=h.type.charAt(0),b=l0[`${y}_union`],p[d]=b(m,X(f[E]));n&&(m=a[d]||(a[d]=[]),m.push(X(f).reduce((w,_,A)=>(w[c[A].field]=_,w),{})))}else h=ji,g=xc(l),p=s[h]||(s[h]={}),m=p[d]||(p[d]=[]),m.push(g),n&&(m=a[d]||(a[d]=[]),m.push({[ji]:g}));if(t=t||EA,s[ji]?s[ji]=l0[`${ji}_${t}`](...Object.values(s[ji])):Object.keys(s).forEach(w=>{s[w]=Object.keys(s[w]).map(_=>s[w][_]).reduce((_,A)=>_===void 0?A:l0[`${u[w]}_${t}`](_,A))}),o=Object.keys(a),n&&o.length){const w=i?oX:rX;s[w]=t===EA?{[SA]:o.reduce((_,A)=>(_.push(...a[A]),_),[])}:{[sX]:o.map(_=>({[SA]:a[_]}))}}return s}var l0={[`${ji}_union`]:nz,[`${ji}_intersect`]:ez,E_union:function(e,t){if(!e.length)return t;for(var n=0,i=t.length;n<i;++n)e.indexOf(t[n])<0&&e.push(t[n]);return e},E_intersect:function(e,t){return e.length?e.filter(n=>t.indexOf(n)>=0):t},R_union:function(e,t){var n=Ut(t[0]),i=Ut(t[1]);return n>i&&(n=t[1],i=t[0]),e.length?(e[0]>n&&(e[0]=n),e[1]<i&&(e[1]=i),e):[n,i]},R_intersect:function(e,t){var n=Ut(t[0]),i=Ut(t[1]);return n>i&&(n=t[1],i=t[0]),e.length?i<e[0]||e[1]<n?[]:(e[0]<n&&(e[0]=n),e[1]>i&&(e[1]=i),e):[n,i]}};const bX=":",vX="@";function A2(e,t,n,i){t[0].type!==zs&&N("First argument to selection functions must be a string literal.");const r=t[0].value,o=t.length>=2&&Ee(t).value,s="unit",a=vX+s,u=bX+r;o===_2&&!J(i,a)&&(i[a]=n.getData(r).indataRef(n,s)),J(i,u)||(i[u]=n.getData(r).tuplesRef())}function PR(e){const t=this.context.data[e];return t?t.values.value:[]}function xX(e,t,n){const i=this.context.data[e]["index:"+t],r=i?i.value.get(n):void 0;return r&&r.count}function wX(e,t){const n=this.context.dataflow,i=this.context.data[e],r=i.input;return n.pulse(r,n.changeset().remove(Pn).insert(t)),1}function EX(e,t,n){if(e){const i=this.context.dataflow,r=e.mark.source;i.pulse(r,i.changeset().encode(e,t))}return n!==void 0?n:e}const sf=e=>function(t,n){const i=this.context.dataflow.locale();return t===null?"null":i[e](n)(t)},SX=sf("format"),IR=sf("timeFormat"),_X=sf("utcFormat"),AX=sf("timeParse"),$X=sf("utcParse"),Vf=new Date(2e3,0,1);function up(e,t,n){return!Number.isInteger(e)||!Number.isInteger(t)?"":(Vf.setYear(2e3),Vf.setMonth(e),Vf.setDate(t),IR.call(this,Vf,n))}function kX(e){return up.call(this,e,1,"%B")}function CX(e){return up.call(this,e,1,"%b")}function FX(e){return up.call(this,0,2+e,"%A")}function TX(e){return up.call(this,0,2+e,"%a")}const MX=":",DX="@",py="%",zR="$";function $2(e,t,n,i){t[0].type!==zs&&N("First argument to data functions must be a string literal.");const r=t[0].value,o=MX+r;if(!J(o,i))try{i[o]=n.getData(r).tuplesRef()}catch{}}function OX(e,t,n,i){t[0].type!==zs&&N("First argument to indata must be a string literal."),t[1].type!==zs&&N("Second argument to indata must be a string literal.");const r=t[0].value,o=t[1].value,s=DX+o;J(s,i)||(i[s]=n.getData(r).indataRef(n,o))}function an(e,t,n,i){if(t[0].type===zs)AA(n,i,t[0].value);else for(e in n.scales)AA(n,i,e)}function AA(e,t,n){const i=py+n;if(!J(t,i))try{t[i]=e.scaleRef(n)}catch{}}function dr(e,t){if(ge(e))return e;if(K(e)){const n=t.scales[e];return n&&J8(n.value)?n.value:void 0}}function RX(e,t,n){t.__bandwidth=r=>r&&r.bandwidth?r.bandwidth():0,n._bandwidth=an,n._range=an,n._scale=an;const i=r=>"_["+(r.type===zs?H(py+r.value):H(py)+"+"+e(r))+"]";return{_bandwidth:r=>`this.__bandwidth(${i(r[0])})`,_range:r=>`${i(r[0])}.range()`,_scale:r=>`${i(r[0])}(${e(r[1])})`}}function k2(e,t){return function(n,i,r){if(n){const o=dr(n,(r||this).context);return o&&o.path[e](i)}else return t(i)}}const NX=k2("area",dq),LX=k2("bounds",mq),PX=k2("centroid",Eq);function IX(e,t){const n=dr(e,(t||this).context);return n&&n.scale()}function zX(e){const t=this.context.group;let n=!1;if(t)for(;e;){if(e===t){n=!0;break}e=e.mark.group}return n}function C2(e,t,n){try{e[t].apply(e,["EXPRESSION"].concat([].slice.call(n)))}catch(i){e.warn(i)}return n[n.length-1]}function BX(){return C2(this.context.dataflow,"warn",arguments)}function UX(){return C2(this.context.dataflow,"info",arguments)}function jX(){return C2(this.context.dataflow,"debug",arguments)}function c0(e){const t=e/255;return t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4)}function my(e){const t=Rd(e),n=c0(t.r),i=c0(t.g),r=c0(t.b);return .2126*n+.7152*i+.0722*r}function qX(e,t){const n=my(e),i=my(t),r=Math.max(n,i),o=Math.min(n,i);return(r+.05)/(o+.05)}function WX(){const e=[].slice.call(arguments);return e.unshift({}),he(...e)}function BR(e,t){return e===t||e!==e&&t!==t?!0:P(e)?P(t)&&e.length===t.length?HX(e,t):!1:Y(e)&&Y(t)?UR(e,t):!1}function HX(e,t){for(let n=0,i=e.length;n<i;++n)if(!BR(e[n],t[n]))return!1;return!0}function UR(e,t){for(const n in e)if(!BR(e[n],t[n]))return!1;return!0}function $A(e){return t=>UR(e,t)}function GX(e,t,n,i,r,o){const s=this.context.dataflow,a=this.context.data[e],u=a.input,l=s.stamp();let c=a.changes,f,d;if(s._trigger===!1||!(u.value.length||t||i))return 0;if((!c||c.stamp<l)&&(a.changes=c=s.changeset(),c.stamp=l,s.runAfter(()=>{a.modified=!0,s.pulse(u,c).run()},!0,1)),n&&(f=n===!0?Pn:P(n)||Eg(n)?n:$A(n),c.remove(f)),t&&c.insert(t),i&&(f=$A(i),u.value.some(f)?c.remove(f):c.insert(i)),r)for(d in o)c.modify(r,d,o[d]);return 1}function VX(e){const t=e.touches,n=t[0].clientX-t[1].clientX,i=t[0].clientY-t[1].clientY;return Math.hypot(n,i)}function YX(e){const t=e.touches;return Math.atan2(t[0].clientY-t[1].clientY,t[0].clientX-t[1].clientX)}const kA={};function XX(e,t){const n=kA[t]||(kA[t]=Qn(t));return P(e)?e.map(n):n(e)}function F2(e){return P(e)||ArrayBuffer.isView(e)?e:null}function T2(e){return F2(e)||(K(e)?e:null)}function KX(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return F2(e).join(...n)}function JX(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return T2(e).indexOf(...n)}function QX(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return T2(e).lastIndexOf(...n)}function ZX(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return T2(e).slice(...n)}function eK(e,t,n){return ge(n)&&N("Function argument passed to replace."),String(e).replace(t,n)}function tK(e){return F2(e).slice().reverse()}function nK(e,t,n){return qv(e||0,t||0,n||0)}function iK(e,t){const n=dr(e,(t||this).context);return n&&n.bandwidth?n.bandwidth():0}function rK(e,t){const n=dr(e,(t||this).context);return n?n.copy():void 0}function oK(e,t){const n=dr(e,(t||this).context);return n?n.domain():[]}function sK(e,t,n){const i=dr(e,(n||this).context);return i?P(t)?(i.invertRange||i.invert)(t):(i.invert||i.invertExtent)(t):void 0}function aK(e,t){const n=dr(e,(t||this).context);return n&&n.range?n.range():[]}function uK(e,t,n){const i=dr(e,(n||this).context);return i?i(t):void 0}function lK(e,t,n,i,r){e=dr(e,(r||this).context);const o=NM(t,n);let s=e.domain(),a=s[0],u=Ee(s),l=Vt;return u-a?l=SM(e,a,u):e=(e.interpolator?ke("sequential")().interpolator(e.interpolator()):ke("linear")().interpolate(e.interpolate()).range(e.range())).domain([a=0,u=1]),e.ticks&&(s=e.ticks(+i||15),a!==s[0]&&s.unshift(a),u!==Ee(s)&&s.push(u)),s.forEach(c=>o.stop(l(c),e(c))),o}function cK(e,t,n){const i=dr(e,(n||this).context);return function(r){return i?i.path.context(r)(t):""}}function fK(e){let t=null;return function(n){return n?fc(n,t=t||nu(e)):e}}const jR=e=>e.data;function qR(e,t){const n=PR.call(t,e);return n.root&&n.root.lookup||{}}function dK(e,t,n){const i=qR(e,this),r=i[t],o=i[n];return r&&o?r.path(o).map(jR):void 0}function hK(e,t){const n=qR(e,this)[t];return n?n.ancestors().map(jR):void 0}const WR=()=>typeof window<"u"&&window||null;function gK(){const e=WR();return e?e.screen:{}}function pK(){const e=WR();return e?[e.innerWidth,e.innerHeight]:[void 0,void 0]}function mK(){const e=this.context.dataflow,t=e.container&&e.container();return t?[t.clientWidth,t.clientHeight]:[void 0,void 0]}function HR(e,t,n){if(!e)return[];const[i,r]=e,o=new it().set(i[0],i[1],r[0],r[1]),s=n||this.context.dataflow.scenegraph().root;return DD(s,o,yK(t))}function yK(e){let t=null;if(e){const n=X(e.marktype),i=X(e.markname);t=r=>(!n.length||n.some(o=>r.marktype===o))&&(!i.length||i.some(o=>r.name===o))}return t}function bK(e,t,n){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:5;e=X(e);const r=e[e.length-1];return r===void 0||Math.hypot(r[0]-t,r[1]-n)>i?[...e,[t,n]]:e}function vK(e){return X(e).reduce((t,n,i)=>{let[r,o]=n;return t+=i==0?`M ${r},${o} `:i===e.length-1?" Z":`L ${r},${o} `},"")}function xK(e,t,n){const{x:i,y:r,mark:o}=n,s=new it().set(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,Number.MIN_SAFE_INTEGER,Number.MIN_SAFE_INTEGER);for(const[u,l]of t)u<s.x1&&(s.x1=u),u>s.x2&&(s.x2=u),l<s.y1&&(s.y1=l),l>s.y2&&(s.y2=l);return s.translate(i,r),HR([[s.x1,s.y1],[s.x2,s.y2]],e,o).filter(u=>wK(u.x,u.y,t))}function wK(e,t,n){let i=0;for(let r=0,o=n.length-1;r<n.length;o=r++){const[s,a]=n[o],[u,l]=n[r];l>t!=a>t&&e<(s-u)*(t-l)/(a-l)+u&&i++}return i&1}const wc={random(){return ei()},cumulativeNormal:kg,cumulativeLogNormal:Gb,cumulativeUniform:Kb,densityNormal:Ub,densityLogNormal:Hb,densityUniform:Xb,quantileNormal:Cg,quantileLogNormal:Vb,quantileUniform:Jb,sampleNormal:$g,sampleLogNormal:Wb,sampleUniform:Yb,isArray:P,isBoolean:Wo,isDate:So,isDefined(e){return e!==void 0},isNumber:Ae,isObject:Y,isRegExp:kC,isString:K,isTuple:Eg,isValid(e){return e!=null&&e===e},toBoolean:Eb,toDate(e){return Sb(e)},toNumber:Ut,toString:_b,indexof:JX,join:KX,lastindexof:QX,replace:eK,reverse:tK,slice:ZX,flush:AC,lerp:CC,merge:WX,pad:MC,peek:Ee,pluck:XX,span:Nc,inrange:Ta,truncate:DC,rgb:Rd,lab:Vd,hcl:Yd,hsl:e1,luminance:my,contrast:qX,sequence:Mn,format:SX,utcFormat:_X,utcParse:$X,utcOffset:rF,utcSequence:aF,timeFormat:IR,timeParse:AX,timeOffset:iF,timeSequence:sF,timeUnitSpecifier:GC,monthFormat:kX,monthAbbrevFormat:CX,dayFormat:FX,dayAbbrevFormat:TX,quarter:wC,utcquarter:EC,week:YC,utcweek:JC,dayofyear:VC,utcdayofyear:KC,warn:BX,info:UX,debug:jX,extent(e){return Qi(e)},inScope:zX,intersect:HR,clampRange:SC,pinchDistance:VX,pinchAngle:YX,screen:gK,containerSize:mK,windowSize:pK,bandspace:nK,setdata:wX,pathShape:fK,panLinear:yC,panLog:bC,panPow:vC,panSymlog:xC,zoomLinear:mb,zoomLog:yb,zoomPow:Ld,zoomSymlog:bb,encode:EX,modify:GX,lassoAppend:bK,lassoPath:vK,intersectLasso:xK},EK=["view","item","group","xy","x","y"],SK="event.vega.",GR="this.",M2={},VR={forbidden:["_"],allowed:["datum","event","item"],fieldvar:"datum",globalvar:e=>`_[${H(zR+e)}]`,functions:_K,constants:DR,visitors:M2},yy=RR(VR);function _K(e){const t=OR(e);EK.forEach(n=>t[n]=SK+n);for(const n in wc)t[n]=GR+n;return he(t,RX(e,wc,M2)),t}function nt(e,t,n){return arguments.length===1?wc[e]:(wc[e]=t,n&&(M2[e]=n),yy&&(yy.functions[e]=GR+e),this)}nt("bandwidth",iK,an);nt("copy",rK,an);nt("domain",oK,an);nt("range",aK,an);nt("invert",sK,an);nt("scale",uK,an);nt("gradient",lK,an);nt("geoArea",NX,an);nt("geoBounds",LX,an);nt("geoCentroid",PX,an);nt("geoShape",cK,an);nt("geoScale",IX,an);nt("indata",xX,OX);nt("data",PR,$2);nt("treePath",dK,$2);nt("treeAncestors",hK,$2);nt("vlSelectionTest",dX,A2);nt("vlSelectionIdTest",pX,A2);nt("vlSelectionResolve",yX,A2);nt("vlSelectionTuples",mX);function ir(e,t){const n={};let i;try{e=K(e)?e:H(e)+"",i=S2(e)}catch{N("Expression parse error: "+e)}i.visit(o=>{if(o.type!==AR)return;const s=o.callee.name,a=VR.visitors[s];a&&a(s,o.arguments,t,n)});const r=yy(i);return r.globals.forEach(o=>{const s=zR+o;!J(n,s)&&t.getSignal(o)&&(n[s]=t.signalRef(o))}),{$expr:he({code:r.code},t.options.ast?{ast:i}:null),$fields:r.fields,$params:n}}function AK(e){const t=this,n=e.operators||[];return e.background&&(t.background=e.background),e.eventConfig&&(t.eventConfig=e.eventConfig),e.locale&&(t.locale=e.locale),n.forEach(i=>t.parseOperator(i)),n.forEach(i=>t.parseOperatorParameters(i)),(e.streams||[]).forEach(i=>t.parseStream(i)),(e.updates||[]).forEach(i=>t.parseUpdate(i)),t.resolve()}const $K=xi(["rule"]),CA=xi(["group","image","rect"]);function kK(e,t){let n="";return $K[t]||(e.x2&&(e.x?(CA[t]&&(n+="if(o.x>o.x2)$=o.x,o.x=o.x2,o.x2=$;"),n+="o.width=o.x2-o.x;"):n+="o.x=o.x2-(o.width||0);"),e.xc&&(n+="o.x=o.xc-(o.width||0)/2;"),e.y2&&(e.y?(CA[t]&&(n+="if(o.y>o.y2)$=o.y,o.y=o.y2,o.y2=$;"),n+="o.height=o.y2-o.y;"):n+="o.y=o.y2-(o.height||0);"),e.yc&&(n+="o.y=o.yc-(o.height||0)/2;")),n}function D2(e){return(e+"").toLowerCase()}function CK(e){return D2(e)==="operator"}function FK(e){return D2(e)==="collect"}function fl(e,t,n){n.endsWith(";")||(n="return("+n+");");const i=Function(...t.concat(n));return e&&e.functions?i.bind(e.functions):i}function TK(e,t,n,i){return`((u = ${e}) < (v = ${t}) || u == null) && v != null ? ${n}
|
10
|
+
: (u > v || v == null) && u != null ? ${i}
|
11
|
+
: ((v = v instanceof Date ? +v : v), (u = u instanceof Date ? +u : u)) !== u && v === v ? ${n}
|
12
|
+
: v !== v && u === u ? ${i} : `}var MK={operator:(e,t)=>fl(e,["_"],t.code),parameter:(e,t)=>fl(e,["datum","_"],t.code),event:(e,t)=>fl(e,["event"],t.code),handler:(e,t)=>{const n=`var datum=event.item&&event.item.datum;return ${t.code};`;return fl(e,["_","event"],n)},encode:(e,t)=>{const{marktype:n,channels:i}=t;let r="var o=item,datum=o.datum,m=0,$;";for(const o in i){const s="o["+H(o)+"]";r+=`$=${i[o].code};if(${s}!==$)${s}=$,m=1;`}return r+=kK(i,n),r+="return m;",fl(e,["item","_"],r)},codegen:{get(e){const t=`[${e.map(H).join("][")}]`,n=Function("_",`return _${t};`);return n.path=t,n},comparator(e,t){let n;const i=(o,s)=>{const a=t[s];let u,l;return o.path?(u=`a${o.path}`,l=`b${o.path}`):((n=n||{})["f"+s]=o,u=`this.f${s}(a)`,l=`this.f${s}(b)`),TK(u,l,-a,a)},r=Function("a","b","var u, v; return "+e.map(i).join("")+"0;");return n?r.bind(n):r}}};function DK(e){const t=this;CK(e.type)||!e.type?t.operator(e,e.update?t.operatorExpression(e.update):null):t.transform(e,e.type)}function OK(e){const t=this;if(e.params){const n=t.get(e.id);n||N("Invalid operator id: "+e.id),t.dataflow.connect(n,n.parameters(t.parseParameters(e.params),e.react,e.initonly))}}function RK(e,t){t=t||{};const n=this;for(const i in e){const r=e[i];t[i]=P(r)?r.map(o=>FA(o,n,t)):FA(r,n,t)}return t}function FA(e,t,n){if(!e||!Y(e))return e;for(let i=0,r=TA.length,o;i<r;++i)if(o=TA[i],J(e,o.key))return o.parse(e,t,n);return e}var TA=[{key:"$ref",parse:NK},{key:"$key",parse:PK},{key:"$expr",parse:LK},{key:"$field",parse:IK},{key:"$encode",parse:BK},{key:"$compare",parse:zK},{key:"$context",parse:UK},{key:"$subflow",parse:jK},{key:"$tupleid",parse:qK}];function NK(e,t){return t.get(e.$ref)||N("Operator not defined: "+e.$ref)}function LK(e,t,n){e.$params&&t.parseParameters(e.$params,n);const i="e:"+e.$expr.code;return t.fn[i]||(t.fn[i]=An(t.parameterExpression(e.$expr),e.$fields))}function PK(e,t){const n="k:"+e.$key+"_"+!!e.$flat;return t.fn[n]||(t.fn[n]=wb(e.$key,e.$flat,t.expr.codegen))}function IK(e,t){if(!e.$field)return null;const n="f:"+e.$field+"_"+e.$name;return t.fn[n]||(t.fn[n]=Qn(e.$field,e.$name,t.expr.codegen))}function zK(e,t){const n="c:"+e.$compare+"_"+e.$order,i=X(e.$compare).map(r=>r&&r.$tupleid?ie:r);return t.fn[n]||(t.fn[n]=vb(i,e.$order,t.expr.codegen))}function BK(e,t){const n=e.$encode,i={};for(const r in n){const o=n[r];i[r]=An(t.encodeExpression(o.$expr),o.$fields),i[r].output=o.$output}return i}function UK(e,t){return t}function jK(e,t){const n=e.$subflow;return function(i,r,o){const s=t.fork().parse(n),a=s.get(n.operators[0].id),u=s.signals.parent;return u&&u.set(o),a.detachSubflow=()=>t.detach(s),a}}function qK(){return ie}function WK(e){var t=this,n=e.filter!=null?t.eventExpression(e.filter):void 0,i=e.stream!=null?t.get(e.stream):void 0,r;e.source?i=t.events(e.source,e.type,n):e.merge&&(r=e.merge.map(o=>t.get(o)),i=r[0].merge.apply(r[0],r.slice(1))),e.between&&(r=e.between.map(o=>t.get(o)),i=i.between(r[0],r[1])),e.filter&&(i=i.filter(n)),e.throttle!=null&&(i=i.throttle(+e.throttle)),e.debounce!=null&&(i=i.debounce(+e.debounce)),i==null&&N("Invalid stream definition: "+JSON.stringify(e)),e.consume&&i.consume(!0),t.stream(e,i)}function HK(e){var t=this,n=Y(n=e.source)?n.$ref:n,i=t.get(n),r=null,o=e.update,s=void 0;i||N("Source not defined: "+e.source),r=e.target&&e.target.$expr?t.eventExpression(e.target.$expr):t.get(e.target),o&&o.$expr&&(o.$params&&(s=t.parseParameters(o.$params)),o=t.handlerExpression(o.$expr)),t.update(e,i,r,o,s)}const GK={skip:!0};function VK(e){var t=this,n={};if(e.signals){var i=n.signals={};Object.keys(t.signals).forEach(o=>{const s=t.signals[o];e.signals(o,s)&&(i[o]=s.value)})}if(e.data){var r=n.data={};Object.keys(t.data).forEach(o=>{const s=t.data[o];e.data(o,s)&&(r[o]=s.input.value)})}return t.subcontext&&e.recurse!==!1&&(n.subcontext=t.subcontext.map(o=>o.getState(e))),n}function YK(e){var t=this,n=t.dataflow,i=e.data,r=e.signals;Object.keys(r||{}).forEach(o=>{n.update(t.signals[o],r[o],GK)}),Object.keys(i||{}).forEach(o=>{n.pulse(t.data[o].input,n.changeset().remove(Pn).insert(i[o]))}),(e.subcontext||[]).forEach((o,s)=>{const a=t.subcontext[s];a&&a.setState(o)})}function YR(e,t,n,i){return new XR(e,t,n,i)}function XR(e,t,n,i){this.dataflow=e,this.transforms=t,this.events=e.events.bind(e),this.expr=i||MK,this.signals={},this.scales={},this.nodes={},this.data={},this.fn={},n&&(this.functions=Object.create(n),this.functions.context=this)}function MA(e){this.dataflow=e.dataflow,this.transforms=e.transforms,this.events=e.events,this.expr=e.expr,this.signals=Object.create(e.signals),this.scales=Object.create(e.scales),this.nodes=Object.create(e.nodes),this.data=Object.create(e.data),this.fn=Object.create(e.fn),e.functions&&(this.functions=Object.create(e.functions),this.functions.context=this)}XR.prototype=MA.prototype={fork(){const e=new MA(this);return(this.subcontext||(this.subcontext=[])).push(e),e},detach(e){this.subcontext=this.subcontext.filter(n=>n!==e);const t=Object.keys(e.nodes);for(const n of t)e.nodes[n]._targets=null;for(const n of t)e.nodes[n].detach();e.nodes=null},get(e){return this.nodes[e]},set(e,t){return this.nodes[e]=t},add(e,t){const n=this,i=n.dataflow,r=e.value;if(n.set(e.id,t),FK(e.type)&&r&&(r.$ingest?i.ingest(t,r.$ingest,r.$format):r.$request?i.preload(t,r.$request,r.$format):i.pulse(t,i.changeset().insert(r))),e.root&&(n.root=t),e.parent){let o=n.get(e.parent.$ref);o?(i.connect(o,[t]),t.targets().add(o)):(n.unresolved=n.unresolved||[]).push(()=>{o=n.get(e.parent.$ref),i.connect(o,[t]),t.targets().add(o)})}if(e.signal&&(n.signals[e.signal]=t),e.scale&&(n.scales[e.scale]=t),e.data)for(const o in e.data){const s=n.data[o]||(n.data[o]={});e.data[o].forEach(a=>s[a]=t)}},resolve(){return(this.unresolved||[]).forEach(e=>e()),delete this.unresolved,this},operator(e,t){this.add(e,this.dataflow.add(e.value,t))},transform(e,t){this.add(e,this.dataflow.add(this.transforms[D2(t)]))},stream(e,t){this.set(e.id,t)},update(e,t,n,i,r){this.dataflow.on(t,n,i,r,e.options)},operatorExpression(e){return this.expr.operator(this,e)},parameterExpression(e){return this.expr.parameter(this,e)},eventExpression(e){return this.expr.event(this,e)},handlerExpression(e){return this.expr.handler(this,e)},encodeExpression(e){return this.expr.encode(this,e)},parse:AK,parseOperator:DK,parseOperatorParameters:OK,parseParameters:RK,parseStream:WK,parseUpdate:HK,getState:VK,setState:YK};function XK(e){const t=e.container();t&&(t.setAttribute("role","graphics-document"),t.setAttribute("aria-roleDescription","visualization"),KR(t,e.description()))}function KR(e,t){e&&(t==null?e.removeAttribute("aria-label"):e.setAttribute("aria-label",t))}function KK(e){e.add(null,t=>(e._background=t.bg,e._resize=1,t.bg),{bg:e._signals.background})}const f0="default";function JK(e){const t=e._signals.cursor||(e._signals.cursor=e.add({user:f0,item:null}));e.on(e.events("view","pointermove"),t,(n,i)=>{const r=t.value,o=r?K(r)?r:r.user:f0,s=i.item&&i.item.cursor||null;return r&&o===r.user&&s==r.item?r:{user:o,item:s}}),e.add(null,function(n){let i=n.cursor,r=this.value;return K(i)||(r=i.item,i=i.user),by(e,i&&i!==f0?i:r||i),r},{cursor:t})}function by(e,t){const n=e.globalCursor()?typeof document<"u"&&document.body:e.container();if(n)return t==null?n.style.removeProperty("cursor"):n.style.cursor=t}function Ih(e,t){var n=e._runtime.data;return J(n,t)||N("Unrecognized data set: "+t),n[t]}function QK(e,t){return arguments.length<2?Ih(this,e).values.value:lp.call(this,e,ta().remove(Pn).insert(t))}function lp(e,t){RF(t)||N("Second argument to changes must be a changeset.");const n=Ih(this,e);return n.modified=!0,this.pulse(n.input,t)}function ZK(e,t){return lp.call(this,e,ta().insert(t))}function eJ(e,t){return lp.call(this,e,ta().remove(t))}function JR(e){var t=e.padding();return Math.max(0,e._viewWidth+t.left+t.right)}function QR(e){var t=e.padding();return Math.max(0,e._viewHeight+t.top+t.bottom)}function cp(e){var t=e.padding(),n=e._origin;return[t.left+n[0],t.top+n[1]]}function tJ(e){var t=cp(e),n=JR(e),i=QR(e);e._renderer.background(e.background()),e._renderer.resize(n,i,t),e._handler.origin(t),e._resizeListeners.forEach(r=>{try{r(n,i)}catch(o){e.error(o)}})}function nJ(e,t,n){var i=e._renderer,r=i&&i.canvas(),o,s,a;return r&&(a=cp(e),s=t.changedTouches?t.changedTouches[0]:t,o=Jg(s,r),o[0]-=a[0],o[1]-=a[1]),t.dataflow=e,t.item=n,t.vega=iJ(e,n,o),t}function iJ(e,t,n){const i=t?t.mark.marktype==="group"?t:t.mark.group:null;function r(s){var a=i,u;if(s){for(u=t;u;u=u.mark.group)if(u.mark.name===s){a=u;break}}return a&&a.mark&&a.mark.interactive?a:{}}function o(s){if(!s)return n;K(s)&&(s=r(s));const a=n.slice();for(;s;)a[0]-=s.x||0,a[1]-=s.y||0,s=s.mark&&s.mark.group;return a}return{view:Yt(e),item:Yt(t||{}),group:r,xy:o,x:s=>o(s)[0],y:s=>o(s)[1]}}const DA="view",rJ="timer",oJ="window",sJ={trap:!1};function aJ(e){const t=he({defaults:{}},e),n=(i,r)=>{r.forEach(o=>{P(i[o])&&(i[o]=xi(i[o]))})};return n(t.defaults,["prevent","allow"]),n(t,["view","window","selector"]),t}function ZR(e,t,n,i){e._eventListeners.push({type:n,sources:X(t),handler:i})}function uJ(e,t){var n=e._eventConfig.defaults,i=n.prevent,r=n.allow;return i===!1||r===!0?!1:i===!0||r===!1?!0:i?i[t]:r?!r[t]:e.preventDefault()}function Yf(e,t,n){const i=e._eventConfig&&e._eventConfig[t];return i===!1||Y(i)&&!i[n]?(e.warn(`Blocked ${t} ${n} event listener.`),!1):!0}function lJ(e,t,n){var i=this,r=new Ag(n),o=function(l,c){i.runAsync(null,()=>{e===DA&&uJ(i,t)&&l.preventDefault(),r.receive(nJ(i,l,c))})},s;if(e===rJ)Yf(i,"timer",t)&&i.timer(o,t);else if(e===DA)Yf(i,"view",t)&&i.addEventListener(t,o,sJ);else if(e===oJ?Yf(i,"window",t)&&typeof window<"u"&&(s=[window]):typeof document<"u"&&Yf(i,"selector",t)&&(s=Array.from(document.querySelectorAll(e))),!s)i.warn("Can not resolve event source: "+e);else{for(var a=0,u=s.length;a<u;++a)s[a].addEventListener(t,o);ZR(i,s,t,o)}return r}function OA(e){return e.item}function RA(e){return e.item.mark.source}function NA(e){return function(t,n){return n.vega.view().changeset().encode(n.item,e)}}function cJ(e,t){return e=[e||"hover"],t=[t||"update",e[0]],this.on(this.events("view","pointerover",OA),RA,NA(e)),this.on(this.events("view","pointerout",OA),RA,NA(t)),this}function fJ(){var e=this._tooltip,t=this._timers,n=this._handler.handlers(),i=this._eventListeners,r,o,s,a,u;for(r=t.length;--r>=0;)t[r].stop();for(r=i.length;--r>=0;)for(s=i[r],o=s.sources.length;--o>=0;)s.sources[o].removeEventListener(s.type,s.handler);for(e&&e.call(this,this._handler,null,null,null),r=n.length;--r>=0;)u=n[r].type,a=n[r].handler,this._handler.off(u,a);return this}function Nn(e,t,n){const i=document.createElement(e);for(const r in t)i.setAttribute(r,t[r]);return n!=null&&(i.textContent=n),i}const dJ="vega-bind",hJ="vega-bind-name",gJ="vega-bind-radio";function pJ(e,t,n){if(!t)return;const i=n.param;let r=n.state;return r||(r=n.state={elements:null,active:!1,set:null,update:s=>{s!=e.signal(i.signal)&&e.runAsync(null,()=>{r.source=!0,e.signal(i.signal,s)})}},i.debounce&&(r.update=xb(i.debounce,r.update))),(i.input==null&&i.element?mJ:bJ)(r,t,i,e),r.active||(e.on(e._signals[i.signal],null,()=>{r.source?r.source=!1:r.set(e.signal(i.signal))}),r.active=!0),r}function mJ(e,t,n,i){const r=n.event||"input",o=()=>e.update(t.value);i.signal(n.signal,t.value),t.addEventListener(r,o),ZR(i,t,r,o),e.set=s=>{t.value=s,t.dispatchEvent(yJ(r))}}function yJ(e){return typeof Event<"u"?new Event(e):{type:e}}function bJ(e,t,n,i){const r=i.signal(n.signal),o=Nn("div",{class:dJ}),s=n.input==="radio"?o:o.appendChild(Nn("label"));s.appendChild(Nn("span",{class:hJ},n.name||n.signal)),t.appendChild(o);let a=vJ;switch(n.input){case"checkbox":a=xJ;break;case"select":a=wJ;break;case"radio":a=EJ;break;case"range":a=SJ;break}a(e,s,n,r)}function vJ(e,t,n,i){const r=Nn("input");for(const o in n)o!=="signal"&&o!=="element"&&r.setAttribute(o==="input"?"type":o,n[o]);r.setAttribute("name",n.signal),r.value=i,t.appendChild(r),r.addEventListener("input",()=>e.update(r.value)),e.elements=[r],e.set=o=>r.value=o}function xJ(e,t,n,i){const r={type:"checkbox",name:n.signal};i&&(r.checked=!0);const o=Nn("input",r);t.appendChild(o),o.addEventListener("change",()=>e.update(o.checked)),e.elements=[o],e.set=s=>o.checked=!!s||null}function wJ(e,t,n,i){const r=Nn("select",{name:n.signal}),o=n.labels||[];n.options.forEach((s,a)=>{const u={value:s};zh(s,i)&&(u.selected=!0),r.appendChild(Nn("option",u,(o[a]||s)+""))}),t.appendChild(r),r.addEventListener("change",()=>{e.update(n.options[r.selectedIndex])}),e.elements=[r],e.set=s=>{for(let a=0,u=n.options.length;a<u;++a)if(zh(n.options[a],s)){r.selectedIndex=a;return}}}function EJ(e,t,n,i){const r=Nn("span",{class:gJ}),o=n.labels||[];t.appendChild(r),e.elements=n.options.map((s,a)=>{const u={type:"radio",name:n.signal,value:s};zh(s,i)&&(u.checked=!0);const l=Nn("input",u);l.addEventListener("change",()=>e.update(s));const c=Nn("label",{},(o[a]||s)+"");return c.prepend(l),r.appendChild(c),l}),e.set=s=>{const a=e.elements,u=a.length;for(let l=0;l<u;++l)zh(a[l].value,s)&&(a[l].checked=!0)}}function SJ(e,t,n,i){i=i!==void 0?i:(+n.max+ +n.min)/2;const r=n.max!=null?n.max:Math.max(100,+i)||100,o=n.min||Math.min(0,r,+i)||0,s=n.step||Os(o,r,100),a=Nn("input",{type:"range",name:n.signal,min:o,max:r,step:s});a.value=i;const u=Nn("span",{},+i);t.appendChild(a),t.appendChild(u);const l=()=>{u.textContent=a.value,e.update(+a.value)};a.addEventListener("input",l),a.addEventListener("change",l),e.elements=[a],e.set=c=>{a.value=c,u.textContent=c}}function zh(e,t){return e===t||e+""==t+""}function eN(e,t,n,i,r,o){return t=t||new i(e.loader()),t.initialize(n,JR(e),QR(e),cp(e),r,o).background(e.background())}function O2(e,t){return t?function(){try{t.apply(this,arguments)}catch(n){e.error(n)}}:null}function _J(e,t,n,i){const r=new i(e.loader(),O2(e,e.tooltip())).scene(e.scenegraph().root).initialize(n,cp(e),e);return t&&t.handlers().forEach(o=>{r.on(o.type,o.handler)}),r}function AJ(e,t){const n=this,i=n._renderType,r=n._eventConfig.bind,o=Qg(i);e=n._el=e?d0(n,e,!0):null,XK(n),o||n.error("Unrecognized renderer type: "+i);const s=o.handler||Jc,a=e?o.renderer:o.headless;return n._renderer=a?eN(n,n._renderer,e,a):null,n._handler=_J(n,n._handler,e,s),n._redraw=!0,e&&r!=="none"&&(t=t?n._elBind=d0(n,t,!0):e.appendChild(Nn("form",{class:"vega-bindings"})),n._bind.forEach(u=>{u.param.element&&r!=="container"&&(u.element=d0(n,u.param.element,!!u.param.input))}),n._bind.forEach(u=>{pJ(n,u.element||t,u)})),n}function d0(e,t,n){if(typeof t=="string")if(typeof document<"u"){if(t=document.querySelector(t),!t)return e.error("Signal bind element not found: "+t),null}else return e.error("DOM document instance not found."),null;if(t&&n)try{t.textContent=""}catch(i){t=null,e.error(i)}return t}const dl=e=>+e||0,$J=e=>({top:e,bottom:e,left:e,right:e});function LA(e){return Y(e)?{top:dl(e.top),bottom:dl(e.bottom),left:dl(e.left),right:dl(e.right)}:$J(dl(e))}async function R2(e,t,n,i){const r=Qg(t),o=r&&r.headless;return o||N("Unrecognized renderer type: "+t),await e.runAsync(),eN(e,null,null,o,n,i).renderAsync(e._scenegraph.root)}async function kJ(e,t){e!==yo.Canvas&&e!==yo.SVG&&e!==yo.PNG&&N("Unrecognized image type: "+e);const n=await R2(this,e,t);return e===yo.SVG?CJ(n.svg(),"image/svg+xml"):n.canvas().toDataURL("image/png")}function CJ(e,t){const n=new Blob([e],{type:t});return window.URL.createObjectURL(n)}async function FJ(e,t){return(await R2(this,yo.Canvas,e,t)).canvas()}async function TJ(e){return(await R2(this,yo.SVG,e)).svg()}function MJ(e,t,n){return YR(e,Ja,wc,n).parse(t)}function DJ(e){var t=this._runtime.scales;return J(t,e)||N("Unrecognized scale or projection: "+e),t[e].value}var tN="width",nN="height",N2="padding",PA={skip:!0};function iN(e,t){var n=e.autosize(),i=e.padding();return t-(n&&n.contains===N2?i.left+i.right:0)}function rN(e,t){var n=e.autosize(),i=e.padding();return t-(n&&n.contains===N2?i.top+i.bottom:0)}function OJ(e){var t=e._signals,n=t[tN],i=t[nN],r=t[N2];function o(){e._autosize=e._resize=1}e._resizeWidth=e.add(null,a=>{e._width=a.size,e._viewWidth=iN(e,a.size),o()},{size:n}),e._resizeHeight=e.add(null,a=>{e._height=a.size,e._viewHeight=rN(e,a.size),o()},{size:i});const s=e.add(null,o,{pad:r});e._resizeWidth.rank=n.rank+1,e._resizeHeight.rank=i.rank+1,s.rank=r.rank+1}function RJ(e,t,n,i,r,o){this.runAfter(s=>{let a=0;s._autosize=0,s.width()!==n&&(a=1,s.signal(tN,n,PA),s._resizeWidth.skip(!0)),s.height()!==i&&(a=1,s.signal(nN,i,PA),s._resizeHeight.skip(!0)),s._viewWidth!==e&&(s._resize=1,s._viewWidth=e),s._viewHeight!==t&&(s._resize=1,s._viewHeight=t),(s._origin[0]!==r[0]||s._origin[1]!==r[1])&&(s._resize=1,s._origin=r),a&&s.run("enter"),o&&s.runAfter(u=>u.resize())},!1,1)}function NJ(e){return this._runtime.getState(e||{data:LJ,signals:PJ,recurse:!0})}function LJ(e,t){return t.modified&&P(t.input.value)&&!e.startsWith("_:vega:_")}function PJ(e,t){return!(e==="parent"||t instanceof Ja.proxy)}function IJ(e){return this.runAsync(null,t=>{t._trigger=!1,t._runtime.setState(e)},t=>{t._trigger=!0}),this}function zJ(e,t){function n(i){e({timestamp:Date.now(),elapsed:i})}this._timers.push(mH(n,t))}function BJ(e,t,n,i){const r=e.element();r&&r.setAttribute("title",UJ(i))}function UJ(e){return e==null?"":P(e)?oN(e):Y(e)&&!So(e)?jJ(e):e+""}function jJ(e){return Object.keys(e).map(t=>{const n=e[t];return t+": "+(P(n)?oN(n):sN(n))}).join(`
|
13
|
+
`)}function oN(e){return"["+e.map(sN).join(", ")+"]"}function sN(e){return P(e)?"[…]":Y(e)&&!So(e)?"{…}":e}function qJ(){if(this.renderer()==="canvas"&&this._renderer._canvas){let e=null;const t=()=>{e!=null&&e();const n=matchMedia(`(resolution: ${window.devicePixelRatio}dppx)`);n.addEventListener("change",t),e=()=>{n.removeEventListener("change",t)},this._renderer._canvas.getContext("2d").pixelRatio=window.devicePixelRatio||1,this._redraw=!0,this._resize=1,this.resize().runAsync()};t()}}function aN(e,t){const n=this;if(t=t||{},Pa.call(n),t.loader&&n.loader(t.loader),t.logger&&n.logger(t.logger),t.logLevel!=null&&n.logLevel(t.logLevel),t.locale||e.locale){const o=he({},e.locale,t.locale);n.locale(_F(o.number,o.time))}n._el=null,n._elBind=null,n._renderType=t.renderer||yo.Canvas,n._scenegraph=new oD;const i=n._scenegraph.root;n._renderer=null,n._tooltip=t.tooltip||BJ,n._redraw=!0,n._handler=new Jc().scene(i),n._globalCursor=!1,n._preventDefault=!1,n._timers=[],n._eventListeners=[],n._resizeListeners=[],n._eventConfig=aJ(e.eventConfig),n.globalCursor(n._eventConfig.globalCursor);const r=MJ(n,e,t.expr);n._runtime=r,n._signals=r.signals,n._bind=(e.bindings||[]).map(o=>({state:null,param:he({},o)})),r.root&&r.root.set(i),i.source=r.data.root.input,n.pulse(r.data.root.input,n.changeset().insert(i.items)),n._width=n.width(),n._height=n.height(),n._viewWidth=iN(n,n._width),n._viewHeight=rN(n,n._height),n._origin=[0,0],n._resize=0,n._autosize=1,OJ(n),KK(n),JK(n),n.description(e.description),t.hover&&n.hover(),t.container&&n.initialize(t.container,t.bind),t.watchPixelRatio&&n._watchPixelRatio()}function Xf(e,t){return J(e._signals,t)?e._signals[t]:N("Unrecognized signal name: "+H(t))}function uN(e,t){const n=(e._targets||[]).filter(i=>i._update&&i._update.handler===t);return n.length?n[0]:null}function IA(e,t,n,i){let r=uN(n,i);return r||(r=O2(e,()=>i(t,n.value)),r.handler=i,e.on(n,null,r)),e}function zA(e,t,n){const i=uN(t,n);return i&&t._targets.remove(i),e}G(aN,Pa,{async evaluate(e,t,n){if(await Pa.prototype.evaluate.call(this,e,t),this._redraw||this._resize)try{this._renderer&&(this._resize&&(this._resize=0,tJ(this)),await this._renderer.renderAsync(this._scenegraph.root)),this._redraw=!1}catch(i){this.error(i)}return n&&cd(this,n),this},dirty(e){this._redraw=!0,this._renderer&&this._renderer.dirty(e)},description(e){if(arguments.length){const t=e!=null?e+"":null;return t!==this._desc&&KR(this._el,this._desc=t),this}return this._desc},container(){return this._el},scenegraph(){return this._scenegraph},origin(){return this._origin.slice()},signal(e,t,n){const i=Xf(this,e);return arguments.length===1?i.value:this.update(i,t,n)},width(e){return arguments.length?this.signal("width",e):this.signal("width")},height(e){return arguments.length?this.signal("height",e):this.signal("height")},padding(e){return arguments.length?this.signal("padding",LA(e)):LA(this.signal("padding"))},autosize(e){return arguments.length?this.signal("autosize",e):this.signal("autosize")},background(e){return arguments.length?this.signal("background",e):this.signal("background")},renderer(e){return arguments.length?(Qg(e)||N("Unrecognized renderer type: "+e),e!==this._renderType&&(this._renderType=e,this._resetRenderer()),this):this._renderType},tooltip(e){return arguments.length?(e!==this._tooltip&&(this._tooltip=e,this._resetRenderer()),this):this._tooltip},loader(e){return arguments.length?(e!==this._loader&&(Pa.prototype.loader.call(this,e),this._resetRenderer()),this):this._loader},resize(){return this._autosize=1,this.touch(Xf(this,"autosize"))},_resetRenderer(){this._renderer&&(this._renderer=null,this.initialize(this._el,this._elBind))},_resizeView:RJ,addEventListener(e,t,n){let i=t;return n&&n.trap===!1||(i=O2(this,t),i.raw=t),this._handler.on(e,i),this},removeEventListener(e,t){for(var n=this._handler.handlers(e),i=n.length,r,o;--i>=0;)if(o=n[i].type,r=n[i].handler,e===o&&(t===r||t===r.raw)){this._handler.off(o,r);break}return this},addResizeListener(e){const t=this._resizeListeners;return t.includes(e)||t.push(e),this},removeResizeListener(e){var t=this._resizeListeners,n=t.indexOf(e);return n>=0&&t.splice(n,1),this},addSignalListener(e,t){return IA(this,e,Xf(this,e),t)},removeSignalListener(e,t){return zA(this,Xf(this,e),t)},addDataListener(e,t){return IA(this,e,Ih(this,e).values,t)},removeDataListener(e,t){return zA(this,Ih(this,e).values,t)},globalCursor(e){if(arguments.length){if(this._globalCursor!==!!e){const t=by(this,null);this._globalCursor=!!e,t&&by(this,t)}return this}else return this._globalCursor},preventDefault(e){return arguments.length?(this._preventDefault=e,this):this._preventDefault},timer:zJ,events:lJ,finalize:fJ,hover:cJ,data:QK,change:lp,insert:ZK,remove:eJ,scale:DJ,initialize:AJ,toImageURL:kJ,toCanvas:FJ,toSVG:TJ,getState:NJ,setState:IJ,_watchPixelRatio:qJ});const WJ="view",Bh="[",Uh="]",lN="{",cN="}",HJ=":",fN=",",GJ="@",VJ=">",YJ=/[[\]{}]/,XJ={"*":1,arc:1,area:1,group:1,image:1,line:1,path:1,rect:1,rule:1,shape:1,symbol:1,text:1,trail:1};let dN,hN;function Vo(e,t,n){return dN=t||WJ,hN=n||XJ,gN(e.trim()).map(vy)}function KJ(e){return hN[e]}function ec(e,t,n,i,r){const o=e.length;let s=0,a;for(;t<o;++t){if(a=e[t],!s&&a===n)return t;r&&r.indexOf(a)>=0?--s:i&&i.indexOf(a)>=0&&++s}return t}function gN(e){const t=[],n=e.length;let i=0,r=0;for(;r<n;)r=ec(e,r,fN,Bh+lN,Uh+cN),t.push(e.substring(i,r).trim()),i=++r;if(t.length===0)throw"Empty event selector: "+e;return t}function vy(e){return e[0]==="["?JJ(e):QJ(e)}function JJ(e){const t=e.length;let n=1,i;if(n=ec(e,n,Uh,Bh,Uh),n===t)throw"Empty between selector: "+e;if(i=gN(e.substring(1,n)),i.length!==2)throw"Between selector must have two elements: "+e;if(e=e.slice(n+1).trim(),e[0]!==VJ)throw"Expected '>' after between selector: "+e;i=i.map(vy);const r=vy(e.slice(1).trim());return r.between?{between:i,stream:r}:(r.between=i,r)}function QJ(e){const t={source:dN},n=[];let i=[0,0],r=0,o=0,s=e.length,a=0,u,l;if(e[s-1]===cN){if(a=e.lastIndexOf(lN),a>=0){try{i=ZJ(e.substring(a+1,s-1))}catch{throw"Invalid throttle specification: "+e}e=e.slice(0,a).trim(),s=e.length}else throw"Unmatched right brace: "+e;a=0}if(!s)throw e;if(e[0]===GJ&&(r=++a),u=ec(e,a,HJ),u<s&&(n.push(e.substring(o,u).trim()),o=a=++u),a=ec(e,a,Bh),a===s)n.push(e.substring(o,s).trim());else if(n.push(e.substring(o,a).trim()),l=[],o=++a,o===s)throw"Unmatched left bracket: "+e;for(;a<s;){if(a=ec(e,a,Uh),a===s)throw"Unmatched left bracket: "+e;if(l.push(e.substring(o,a).trim()),a<s-1&&e[++a]!==Bh)throw"Expected left bracket: "+e;o=++a}if(!(s=n.length)||YJ.test(n[s-1]))throw"Invalid event selector: "+e;return s>1?(t.type=n[1],r?t.markname=n[0].slice(1):KJ(n[0])?t.marktype=n[0]:t.source=n[0]):t.type=n[0],t.type.slice(-1)==="!"&&(t.consume=!0,t.type=t.type.slice(0,-1)),l!=null&&(t.filter=l),i[0]&&(t.throttle=i[0]),i[1]&&(t.debounce=i[1]),t}function ZJ(e){const t=e.split(fN);if(!e.length||t.length>2)throw e;return t.map(n=>{const i=+n;if(i!==i)throw e;return i})}function eQ(e){return Y(e)?e:{type:e||"pad"}}const hl=e=>+e||0,tQ=e=>({top:e,bottom:e,left:e,right:e});function nQ(e){return Y(e)?e.signal?e:{top:hl(e.top),bottom:hl(e.bottom),left:hl(e.left),right:hl(e.right)}:tQ(hl(e))}const gt=e=>Y(e)&&!P(e)?he({},e):{value:e};function BA(e,t,n,i){return n!=null?(Y(n)&&!P(n)||P(n)&&n.length&&Y(n[0])?e.update[t]=n:e[i||"enter"][t]={value:n},1):0}function Tt(e,t,n){for(const i in t)BA(e,i,t[i]);for(const i in n)BA(e,i,n[i],"update")}function zu(e,t,n){for(const i in t)n&&J(n,i)||(e[i]=he(e[i]||{},t[i]));return e}function Fa(e,t){return t&&(t.enter&&t.enter[e]||t.update&&t.update[e])}const L2="mark",P2="frame",I2="scope",iQ="axis",rQ="axis-domain",oQ="axis-grid",sQ="axis-label",aQ="axis-tick",uQ="axis-title",lQ="legend",cQ="legend-band",fQ="legend-entry",dQ="legend-gradient",pN="legend-label",hQ="legend-symbol",gQ="legend-title",pQ="title",mQ="title-text",yQ="title-subtitle";function bQ(e,t,n,i,r){const o={},s={};let a,u,l,c;u="lineBreak",t==="text"&&r[u]!=null&&!Fa(u,e)&&h0(o,u,r[u]),(n=="legend"||String(n).startsWith("axis"))&&(n=null),c=n===P2?r.group:n===L2?he({},r.mark,r[t]):null;for(u in c)l=Fa(u,e)||(u==="fill"||u==="stroke")&&(Fa("fill",e)||Fa("stroke",e)),l||h0(o,u,c[u]);X(i).forEach(f=>{const d=r.style&&r.style[f];for(const h in d)Fa(h,e)||h0(o,h,d[h])}),e=he({},e);for(u in o)c=o[u],c.signal?(a=a||{})[u]=c:s[u]=c;return e.enter=he(s,e.enter),a&&(e.update=he(a,e.update)),e}function h0(e,t,n){e[t]=n&&n.signal?{signal:n.signal}:{value:n}}const mN=e=>K(e)?H(e):e.signal?`(${e.signal})`:yN(e);function fp(e){if(e.gradient!=null)return xQ(e);let t=e.signal?`(${e.signal})`:e.color?vQ(e.color):e.field!=null?yN(e.field):e.value!==void 0?H(e.value):void 0;return e.scale!=null&&(t=wQ(e,t)),t===void 0&&(t=null),e.exponent!=null&&(t=`pow(${t},${kd(e.exponent)})`),e.mult!=null&&(t+=`*${kd(e.mult)}`),e.offset!=null&&(t+=`+${kd(e.offset)}`),e.round&&(t=`round(${t})`),t}const Kf=(e,t,n,i)=>`(${e}(${[t,n,i].map(fp).join(",")})+'')`;function vQ(e){return e.c?Kf("hcl",e.h,e.c,e.l):e.h||e.s?Kf("hsl",e.h,e.s,e.l):e.l||e.a?Kf("lab",e.l,e.a,e.b):e.r||e.g||e.b?Kf("rgb",e.r,e.g,e.b):null}function xQ(e){const t=[e.start,e.stop,e.count].map(n=>n==null?null:H(n));for(;t.length&&Ee(t)==null;)t.pop();return t.unshift(mN(e.gradient)),`gradient(${t.join(",")})`}function kd(e){return Y(e)?"("+fp(e)+")":e}function yN(e){return bN(Y(e)?e:{datum:e})}function bN(e){let t,n,i;if(e.signal)t="datum",i=e.signal;else if(e.group||e.parent){for(n=Math.max(1,e.level||1),t="item";n-- >0;)t+=".mark.group";e.parent?(i=e.parent,t+=".datum"):i=e.group}else e.datum?(t="datum",i=e.datum):N("Invalid field reference: "+H(e));return e.signal||(i=K(i)?ar(i).map(H).join("]["):bN(i)),t+"["+i+"]"}function wQ(e,t){const n=mN(e.scale);return e.range!=null?t=`lerp(_range(${n}), ${+e.range})`:(t!==void 0&&(t=`_scale(${n}, ${t})`),e.band&&(t=(t?t+"+":"")+`_bandwidth(${n})`+(+e.band==1?"":"*"+kd(e.band)),e.extra&&(t=`(datum.extra ? _scale(${n}, datum.extra.value) : ${t})`)),t==null&&(t="0")),t}function EQ(e){let t="";return e.forEach(n=>{const i=fp(n);t+=n.test?`(${n.test})?${i}:`:i}),Ee(t)===":"&&(t+="null"),t}function vN(e,t,n,i,r,o){const s={};o=o||{},o.encoders={$encode:s},e=bQ(e,t,n,i,r.config);for(const a in e)s[a]=SQ(e[a],t,o,r);return o}function SQ(e,t,n,i){const r={},o={};for(const s in e)e[s]!=null&&(r[s]=AQ(_Q(e[s]),i,n,o));return{$expr:{marktype:t,channels:r},$fields:Object.keys(o),$output:Object.keys(e)}}function _Q(e){return P(e)?EQ(e):fp(e)}function AQ(e,t,n,i){const r=ir(e,t);return r.$fields.forEach(o=>i[o]=1),he(n,r.$params),r.$expr}const $Q="outer",kQ=["value","update","init","react","bind"];function UA(e,t){N(e+' for "outer" push: '+H(t))}function xN(e,t){const n=e.name;if(e.push===$Q)t.signals[n]||UA("No prior signal definition",n),kQ.forEach(i=>{e[i]!==void 0&&UA("Invalid property ",i)});else{const i=t.addSignal(n,e.value);e.react===!1&&(i.react=!1),e.bind&&t.addBinding(n,e.bind)}}function xy(e,t,n,i){this.id=-1,this.type=e,this.value=t,this.params=n,i&&(this.parent=i)}function dp(e,t,n,i){return new xy(e,t,n,i)}function jh(e,t){return dp("operator",e,t)}function ne(e){const t={$ref:e.id};return e.id<0&&(e.refs=e.refs||[]).push(t),t}function Ec(e,t){return t?{$field:e,$name:t}:{$field:e}}const wy=Ec("key");function jA(e,t){return{$compare:e,$order:t}}function CQ(e,t){const n={$key:e};return t&&(n.$flat=!0),n}const FQ="ascending",TQ="descending";function MQ(e){return Y(e)?(e.order===TQ?"-":"+")+hp(e.op,e.field):""}function hp(e,t){return(e&&e.signal?"$"+e.signal:e||"")+(e&&t?"_":"")+(t&&t.signal?"$"+t.signal:t||"")}const z2="scope",Ey="view";function ut(e){return e&&e.signal}function DQ(e){return e&&e.expr}function Cd(e){if(ut(e))return!0;if(Y(e)){for(const t in e)if(Cd(e[t]))return!0}return!1}function fi(e,t){return e??t}function ks(e){return e&&e.signal||e}const qA="timer";function Sc(e,t){return(e.merge?RQ:e.stream?NQ:e.type?LQ:N("Invalid stream specification: "+H(e)))(e,t)}function OQ(e){return e===z2?Ey:e||Ey}function RQ(e,t){const n=e.merge.map(r=>Sc(r,t)),i=B2({merge:n},e,t);return t.addStream(i).id}function NQ(e,t){const n=Sc(e.stream,t),i=B2({stream:n},e,t);return t.addStream(i).id}function LQ(e,t){let n;e.type===qA?(n=t.event(qA,e.throttle),e={between:e.between,filter:e.filter}):n=t.event(OQ(e.source),e.type);const i=B2({stream:n},e,t);return Object.keys(i).length===1?n:t.addStream(i).id}function B2(e,t,n){let i=t.between;return i&&(i.length!==2&&N('Stream "between" parameter must have 2 entries: '+H(t)),e.between=[Sc(i[0],n),Sc(i[1],n)]),i=t.filter?[].concat(t.filter):[],(t.marktype||t.markname||t.markrole)&&i.push(PQ(t.marktype,t.markname,t.markrole)),t.source===z2&&i.push("inScope(event.item)"),i.length&&(e.filter=ir("("+i.join(")&&(")+")",n).$expr),(i=t.throttle)!=null&&(e.throttle=+i),(i=t.debounce)!=null&&(e.debounce=+i),t.consume&&(e.consume=!0),e}function PQ(e,t,n){const i="event.item";return i+(e&&e!=="*"?"&&"+i+".mark.marktype==='"+e+"'":"")+(n?"&&"+i+".mark.role==='"+n+"'":"")+(t?"&&"+i+".mark.name==='"+t+"'":"")}const IQ={code:"_.$value",ast:{type:"Identifier",value:"value"}};function zQ(e,t,n){const i=e.encode,r={target:n};let o=e.events,s=e.update,a=[];o||N("Signal update missing events specification."),K(o)&&(o=Vo(o,t.isSubscope()?z2:Ey)),o=X(o).filter(u=>u.signal||u.scale?(a.push(u),0):1),a.length>1&&(a=[UQ(a)]),o.length&&a.push(o.length>1?{merge:o}:o[0]),i!=null&&(s&&N("Signal encode and update are mutually exclusive."),s="encode(item(),"+H(i)+")"),r.update=K(s)?ir(s,t):s.expr!=null?ir(s.expr,t):s.value!=null?s.value:s.signal!=null?{$expr:IQ,$params:{$value:t.signalRef(s.signal)}}:N("Invalid signal update specification."),e.force&&(r.options={force:!0}),a.forEach(u=>t.addUpdate(he(BQ(u,t),r)))}function BQ(e,t){return{source:e.signal?t.signalRef(e.signal):e.scale?t.scaleRef(e.scale):Sc(e,t)}}function UQ(e){return{signal:"["+e.map(t=>t.scale?'scale("'+t.scale+'")':t.signal)+"]"}}function jQ(e,t){const n=t.getSignal(e.name);let i=e.update;e.init&&(i?N("Signals can not include both init and update expressions."):(i=e.init,n.initonly=!0)),i&&(i=ir(i,t),n.update=i.$expr,n.params=i.$params),e.on&&e.on.forEach(r=>zQ(r,t,n.id))}const Le=e=>(t,n,i)=>dp(e,n,t||void 0,i),wN=Le("aggregate"),qQ=Le("axisticks"),EN=Le("bound"),Ci=Le("collect"),WA=Le("compare"),WQ=Le("datajoin"),SN=Le("encode"),HQ=Le("expression"),GQ=Le("facet"),VQ=Le("field"),YQ=Le("key"),XQ=Le("legendentries"),KQ=Le("load"),JQ=Le("mark"),QQ=Le("multiextent"),ZQ=Le("multivalues"),eZ=Le("overlap"),tZ=Le("params"),_N=Le("prefacet"),nZ=Le("projection"),iZ=Le("proxy"),rZ=Le("relay"),AN=Le("render"),oZ=Le("scale"),ra=Le("sieve"),sZ=Le("sortitems"),$N=Le("viewlayout"),aZ=Le("values");let uZ=0;const kN={min:"min",max:"max",count:"sum"};function lZ(e,t){const n=e.type||"linear";yM(n)||N("Unrecognized scale type: "+H(n)),t.addScale(e.name,{type:n,domain:void 0})}function cZ(e,t){const n=t.getScale(e.name).params;let i;n.domain=CN(e.domain,e,t),e.range!=null&&(n.range=TN(e,t,n)),e.interpolate!=null&&xZ(e.interpolate,n),e.nice!=null&&(n.nice=vZ(e.nice,t)),e.bins!=null&&(n.bins=bZ(e.bins,t));for(i in e)J(n,i)||i==="name"||(n[i]=Yn(e[i],t))}function Yn(e,t){return Y(e)?e.signal?t.signalRef(e.signal):N("Unsupported object: "+H(e)):e}function Fd(e,t){return e.signal?t.signalRef(e.signal):e.map(n=>Yn(n,t))}function gp(e){N("Can not find data set: "+H(e))}function CN(e,t,n){if(!e){(t.domainMin!=null||t.domainMax!=null)&&N("No scale domain defined for domainMin/domainMax to override.");return}return e.signal?n.signalRef(e.signal):(P(e)?fZ:e.fields?hZ:dZ)(e,t,n)}function fZ(e,t,n){return e.map(i=>Yn(i,n))}function dZ(e,t,n){const i=n.getData(e.data);return i||gp(e.data),tu(t.type)?i.valuesRef(n,e.field,FN(e.sort,!1)):xM(t.type)?i.domainRef(n,e.field):i.extentRef(n,e.field)}function hZ(e,t,n){const i=e.data,r=e.fields.reduce((o,s)=>(s=K(s)?{data:i,field:s}:P(s)||s.signal?gZ(s,n):s,o.push(s),o),[]);return(tu(t.type)?pZ:xM(t.type)?mZ:yZ)(e,n,r)}function gZ(e,t){const n="_:vega:_"+uZ++,i=Ci({});if(P(e))i.value={$ingest:e};else if(e.signal){const r="setdata("+H(n)+","+e.signal+")";i.params.input=t.signalRef(r)}return t.addDataPipeline(n,[i,ra({})]),{data:n,field:"data"}}function pZ(e,t,n){const i=FN(e.sort,!0);let r,o;const s=n.map(l=>{const c=t.getData(l.data);return c||gp(l.data),c.countsRef(t,l.field,i)}),a={groupby:wy,pulse:s};i&&(r=i.op||"count",o=i.field?hp(r,i.field):"count",a.ops=[kN[r]],a.fields=[t.fieldRef(o)],a.as=[o]),r=t.add(wN(a));const u=t.add(Ci({pulse:ne(r)}));return o=t.add(aZ({field:wy,sort:t.sortRef(i),pulse:ne(u)})),ne(o)}function FN(e,t){return e&&(!e.field&&!e.op?Y(e)?e.field="key":e={field:"key"}:!e.field&&e.op!=="count"?N("No field provided for sort aggregate op: "+e.op):t&&e.field&&e.op&&!kN[e.op]&&N("Multiple domain scales can not be sorted using "+e.op)),e}function mZ(e,t,n){const i=n.map(r=>{const o=t.getData(r.data);return o||gp(r.data),o.domainRef(t,r.field)});return ne(t.add(ZQ({values:i})))}function yZ(e,t,n){const i=n.map(r=>{const o=t.getData(r.data);return o||gp(r.data),o.extentRef(t,r.field)});return ne(t.add(QQ({extents:i})))}function bZ(e,t){return e.signal||P(e)?Fd(e,t):t.objectProperty(e)}function vZ(e,t){return e.signal?t.signalRef(e.signal):Y(e)?{interval:Yn(e.interval),step:Yn(e.step)}:Yn(e)}function xZ(e,t){t.interpolate=Yn(e.type||e),e.gamma!=null&&(t.interpolateGamma=Yn(e.gamma))}function TN(e,t,n){const i=t.config.range;let r=e.range;if(r.signal)return t.signalRef(r.signal);if(K(r)){if(i&&J(i,r))return e=he({},e,{range:i[r]}),TN(e,t,n);r==="width"?r=[0,{signal:"width"}]:r==="height"?r=tu(e.type)?[0,{signal:"height"}]:[{signal:"height"},0]:N("Unrecognized scale range value: "+H(r))}else if(r.scheme){n.scheme=P(r.scheme)?Fd(r.scheme,t):Yn(r.scheme,t),r.extent&&(n.schemeExtent=Fd(r.extent,t)),r.count&&(n.schemeCount=Yn(r.count,t));return}else if(r.step){n.rangeStep=Yn(r.step,t);return}else{if(tu(e.type)&&!P(r))return CN(r,e,t);P(r)||N("Unsupported range type: "+H(r))}return r.map(o=>(P(o)?Fd:Yn)(o,t))}function wZ(e,t){const n=t.config.projection||{},i={};for(const r in e)r!=="name"&&(i[r]=Sy(e[r],r,t));for(const r in n)i[r]==null&&(i[r]=Sy(n[r],r,t));t.addProjection(e.name,i)}function Sy(e,t,n){return P(e)?e.map(i=>Sy(i,t,n)):Y(e)?e.signal?n.signalRef(e.signal):t==="fit"?e:N("Unsupported parameter object: "+H(e)):e}const Fi="top",Bu="left",Uu="right",No="bottom",MN="center",EZ="vertical",SZ="start",_Z="middle",AZ="end",_y="index",U2="label",$Z="offset",lu="perc",kZ="perc2",Kn="value",af="guide-label",j2="guide-title",CZ="group-title",FZ="group-subtitle",HA="symbol",Td="gradient",Ay="discrete",$y="size",TZ="shape",MZ="fill",DZ="stroke",OZ="strokeWidth",RZ="strokeDash",NZ="opacity",q2=[$y,TZ,MZ,DZ,OZ,RZ,NZ],uf={name:1,style:1,interactive:1},Se={value:0},Jn={value:1},pp="group",DN="rect",W2="rule",LZ="symbol",oa="text";function _c(e){return e.type=pp,e.interactive=e.interactive||!1,e}function $n(e,t){const n=(i,r)=>fi(e[i],fi(t[i],r));return n.isVertical=i=>EZ===fi(e.direction,t.direction||(i?t.symbolDirection:t.gradientDirection)),n.gradientLength=()=>fi(e.gradientLength,t.gradientLength||t.gradientWidth),n.gradientThickness=()=>fi(e.gradientThickness,t.gradientThickness||t.gradientHeight),n.entryColumns=()=>fi(e.columns,fi(t.columns,+n.isVertical(!0))),n}function ON(e,t){const n=t&&(t.update&&t.update[e]||t.enter&&t.enter[e]);return n&&n.signal?n:n?n.value:null}function PZ(e,t,n){const i=t.config.style[n];return i&&i[e]}function mp(e,t,n){return`item.anchor === '${SZ}' ? ${e} : item.anchor === '${AZ}' ? ${t} : ${n}`}const H2=mp(H(Bu),H(Uu),H(MN));function IZ(e){const t=e("tickBand");let n=e("tickOffset"),i,r;return t?t.signal?(i={signal:`(${t.signal}) === 'extent' ? 1 : 0.5`},r={signal:`(${t.signal}) === 'extent'`},Y(n)||(n={signal:`(${t.signal}) === 'extent' ? 0 : ${n}`})):t==="extent"?(i=1,r=!0,n=0):(i=.5,r=!1):(i=e("bandPosition"),r=e("tickExtra")),{extra:r,band:i,offset:n}}function RN(e,t){return t?e?Y(e)?Object.assign({},e,{offset:RN(e.offset,t)}):{value:e,offset:t}:t:e}function Un(e,t){return t?(e.name=t.name,e.style=t.style||e.style,e.interactive=!!t.interactive,e.encode=zu(e.encode,t,uf)):e.interactive=!1,e}function zZ(e,t,n,i){const r=$n(e,n),o=r.isVertical(),s=r.gradientThickness(),a=r.gradientLength();let u,l,c,f,d;o?(l=[0,1],c=[0,0],f=s,d=a):(l=[0,0],c=[1,0],f=a,d=s);const h={enter:u={opacity:Se,x:Se,y:Se,width:gt(f),height:gt(d)},update:he({},u,{opacity:Jn,fill:{gradient:t,start:l,stop:c}}),exit:{opacity:Se}};return Tt(h,{stroke:r("gradientStrokeColor"),strokeWidth:r("gradientStrokeWidth")},{opacity:r("gradientOpacity")}),Un({type:DN,role:dQ,encode:h},i)}function BZ(e,t,n,i,r){const o=$n(e,n),s=o.isVertical(),a=o.gradientThickness(),u=o.gradientLength();let l,c,f,d,h="";s?(l="y",f="y2",c="x",d="width",h="1-"):(l="x",f="x2",c="y",d="height");const g={opacity:Se,fill:{scale:t,field:Kn}};g[l]={signal:h+"datum."+lu,mult:u},g[c]=Se,g[f]={signal:h+"datum."+kZ,mult:u},g[d]=gt(a);const p={enter:g,update:he({},g,{opacity:Jn}),exit:{opacity:Se}};return Tt(p,{stroke:o("gradientStrokeColor"),strokeWidth:o("gradientStrokeWidth")},{opacity:o("gradientOpacity")}),Un({type:DN,role:cQ,key:Kn,from:r,encode:p},i)}const UZ=`datum.${lu}<=0?"${Bu}":datum.${lu}>=1?"${Uu}":"${MN}"`,jZ=`datum.${lu}<=0?"${No}":datum.${lu}>=1?"${Fi}":"${_Z}"`;function GA(e,t,n,i){const r=$n(e,t),o=r.isVertical(),s=gt(r.gradientThickness()),a=r.gradientLength();let u=r("labelOverlap"),l,c,f,d,h="";const g={enter:l={opacity:Se},update:c={opacity:Jn,text:{field:U2}},exit:{opacity:Se}};return Tt(g,{fill:r("labelColor"),fillOpacity:r("labelOpacity"),font:r("labelFont"),fontSize:r("labelFontSize"),fontStyle:r("labelFontStyle"),fontWeight:r("labelFontWeight"),limit:fi(e.labelLimit,t.gradientLabelLimit)}),o?(l.align={value:"left"},l.baseline=c.baseline={signal:jZ},f="y",d="x",h="1-"):(l.align=c.align={signal:UZ},l.baseline={value:"top"},f="x",d="y"),l[f]=c[f]={signal:h+"datum."+lu,mult:a},l[d]=c[d]=s,s.offset=fi(e.labelOffset,t.gradientLabelOffset)||0,u=u?{separation:r("labelSeparation"),method:u,order:"datum."+_y}:void 0,Un({type:oa,role:pN,style:af,key:Kn,from:i,encode:g,overlap:u},n)}function qZ(e,t,n,i,r){const o=$n(e,t),s=n.entries,a=!!(s&&s.interactive),u=s?s.name:void 0,l=o("clipHeight"),c=o("symbolOffset"),f={data:"value"},d=`(${r}) ? datum.${$Z} : datum.${$y}`,h=l?gt(l):{field:$y},g=`datum.${_y}`,p=`max(1, ${r})`;let m,y,b,v,x;h.mult=.5,m={enter:y={opacity:Se,x:{signal:d,mult:.5,offset:c},y:h},update:b={opacity:Jn,x:y.x,y:y.y},exit:{opacity:Se}};let E=null,S=null;e.fill||(E=t.symbolBaseFillColor,S=t.symbolBaseStrokeColor),Tt(m,{fill:o("symbolFillColor",E),shape:o("symbolType"),size:o("symbolSize"),stroke:o("symbolStrokeColor",S),strokeDash:o("symbolDash"),strokeDashOffset:o("symbolDashOffset"),strokeWidth:o("symbolStrokeWidth")},{opacity:o("symbolOpacity")}),q2.forEach(k=>{e[k]&&(b[k]=y[k]={scale:e[k],field:Kn})});const w=Un({type:LZ,role:hQ,key:Kn,from:f,clip:l?!0:void 0,encode:m},n.symbols),_=gt(c);_.offset=o("labelOffset"),m={enter:y={opacity:Se,x:{signal:d,offset:_},y:h},update:b={opacity:Jn,text:{field:U2},x:y.x,y:y.y},exit:{opacity:Se}},Tt(m,{align:o("labelAlign"),baseline:o("labelBaseline"),fill:o("labelColor"),fillOpacity:o("labelOpacity"),font:o("labelFont"),fontSize:o("labelFontSize"),fontStyle:o("labelFontStyle"),fontWeight:o("labelFontWeight"),limit:o("labelLimit")});const A=Un({type:oa,role:pN,style:af,key:Kn,from:f,encode:m},n.labels);return m={enter:{noBound:{value:!l},width:Se,height:l?gt(l):Se,opacity:Se},exit:{opacity:Se},update:b={opacity:Jn,row:{signal:null},column:{signal:null}}},o.isVertical(!0)?(v=`ceil(item.mark.items.length / ${p})`,b.row.signal=`${g}%${v}`,b.column.signal=`floor(${g} / ${v})`,x={field:["row",g]}):(b.row.signal=`floor(${g} / ${p})`,b.column.signal=`${g} % ${p}`,x={field:g}),b.column.signal=`(${r})?${b.column.signal}:${g}`,i={facet:{data:i,name:"value",groupby:_y}},_c({role:I2,from:i,encode:zu(m,s,uf),marks:[w,A],name:u,interactive:a,sort:x})}function WZ(e,t){const n=$n(e,t);return{align:n("gridAlign"),columns:n.entryColumns(),center:{row:!0,column:!1},padding:{row:n("rowPadding"),column:n("columnPadding")}}}const G2='item.orient === "left"',V2='item.orient === "right"',yp=`(${G2} || ${V2})`,HZ=`datum.vgrad && ${yp}`,GZ=mp('"top"','"bottom"','"middle"'),VZ=mp('"right"','"left"','"center"'),YZ=`datum.vgrad && ${V2} ? (${VZ}) : (${yp} && !(datum.vgrad && ${G2})) ? "left" : ${H2}`,XZ=`item._anchor || (${yp} ? "middle" : "start")`,KZ=`${HZ} ? (${G2} ? -90 : 90) : 0`,JZ=`${yp} ? (datum.vgrad ? (${V2} ? "bottom" : "top") : ${GZ}) : "top"`;function QZ(e,t,n,i){const r=$n(e,t),o={enter:{opacity:Se},update:{opacity:Jn,x:{field:{group:"padding"}},y:{field:{group:"padding"}}},exit:{opacity:Se}};return Tt(o,{orient:r("titleOrient"),_anchor:r("titleAnchor"),anchor:{signal:XZ},angle:{signal:KZ},align:{signal:YZ},baseline:{signal:JZ},text:e.title,fill:r("titleColor"),fillOpacity:r("titleOpacity"),font:r("titleFont"),fontSize:r("titleFontSize"),fontStyle:r("titleFontStyle"),fontWeight:r("titleFontWeight"),limit:r("titleLimit"),lineHeight:r("titleLineHeight")},{align:r("titleAlign"),baseline:r("titleBaseline")}),Un({type:oa,role:gQ,style:j2,from:i,encode:o},n)}function ZZ(e,t){let n;return Y(e)&&(e.signal?n=e.signal:e.path?n="pathShape("+VA(e.path)+")":e.sphere&&(n="geoShape("+VA(e.sphere)+', {type: "Sphere"})')),n?t.signalRef(n):!!e}function VA(e){return Y(e)&&e.signal?e.signal:H(e)}function NN(e){const t=e.role||"";return t.startsWith("axis")||t.startsWith("legend")||t.startsWith("title")?t:e.type===pp?I2:t||L2}function eee(e){return{marktype:e.type,name:e.name||void 0,role:e.role||NN(e),zindex:+e.zindex||void 0,aria:e.aria,description:e.description}}function tee(e,t){return e&&e.signal?t.signalRef(e.signal):e!==!1}function Y2(e,t){const n=PF(e.type);n||N("Unrecognized transform type: "+H(e.type));const i=dp(n.type.toLowerCase(),null,LN(n,e,t));return e.signal&&t.addSignal(e.signal,t.proxy(i)),i.metadata=n.metadata||{},i}function LN(e,t,n){const i={},r=e.params.length;for(let o=0;o<r;++o){const s=e.params[o];i[s.name]=nee(s,t,n)}return i}function nee(e,t,n){const i=e.type,r=t[e.name];if(i==="index")return iee(e,t,n);if(r===void 0){e.required&&N("Missing required "+H(t.type)+" parameter: "+H(e.name));return}else{if(i==="param")return ree(e,t,n);if(i==="projection")return n.projectionRef(t[e.name])}return e.array&&!ut(r)?r.map(o=>YA(e,o,n)):YA(e,r,n)}function YA(e,t,n){const i=e.type;if(ut(t))return KA(i)?N("Expression references can not be signals."):g0(i)?n.fieldRef(t):JA(i)?n.compareRef(t):n.signalRef(t.signal);{const r=e.expr||g0(i);return r&&oee(t)?n.exprRef(t.expr,t.as):r&&see(t)?Ec(t.field,t.as):KA(i)?ir(t,n):aee(i)?ne(n.getData(t).values):g0(i)?Ec(t):JA(i)?n.compareRef(t):t}}function iee(e,t,n){return K(t.from)||N('Lookup "from" parameter must be a string literal.'),n.getData(t.from).lookupRef(n,t.key)}function ree(e,t,n){const i=t[e.name];return e.array?(P(i)||N("Expected an array of sub-parameters. Instead: "+H(i)),i.map(r=>XA(e,r,n))):XA(e,i,n)}function XA(e,t,n){const i=e.params.length;let r;for(let s=0;s<i;++s){r=e.params[s];for(const a in r.key)if(r.key[a]!==t[a]){r=null;break}if(r)break}r||N("Unsupported parameter: "+H(t));const o=he(LN(r,t,n),r.key);return ne(n.add(tZ(o)))}const oee=e=>e&&e.expr,see=e=>e&&e.field,aee=e=>e==="data",KA=e=>e==="expr",g0=e=>e==="field",JA=e=>e==="compare";function uee(e,t,n){let i,r,o,s,a;return e?(i=e.facet)&&(t||N("Only group marks can be faceted."),i.field!=null?s=a=Md(i,n):(e.data?a=ne(n.getData(e.data).aggregate):(o=Y2(he({type:"aggregate",groupby:X(i.groupby)},i.aggregate),n),o.params.key=n.keyRef(i.groupby),o.params.pulse=Md(i,n),s=a=ne(n.add(o))),r=n.keyRef(i.groupby,!0))):s=ne(n.add(Ci(null,[{}]))),s||(s=Md(e,n)),{key:r,pulse:s,parent:a}}function Md(e,t){return e.$ref?e:e.data&&e.data.$ref?e.data:ne(t.getData(e.data).output)}function js(e,t,n,i,r){this.scope=e,this.input=t,this.output=n,this.values=i,this.aggregate=r,this.index={}}js.fromEntries=function(e,t){const n=t.length,i=t[n-1],r=t[n-2];let o=t[0],s=null,a=1;for(o&&o.type==="load"&&(o=t[1]),e.add(t[0]);a<n;++a)t[a].params.pulse=ne(t[a-1]),e.add(t[a]),t[a].type==="aggregate"&&(s=t[a]);return new js(e,o,r,i,s)};function PN(e){return K(e)?e:null}function QA(e,t,n){const i=hp(n.op,n.field);let r;if(t.ops){for(let o=0,s=t.as.length;o<s;++o)if(t.as[o]===i)return}else t.ops=["count"],t.fields=[null],t.as=["count"];n.op&&(t.ops.push((r=n.op.signal)?e.signalRef(r):n.op),t.fields.push(e.fieldRef(n.field)),t.as.push(i))}function gl(e,t,n,i,r,o,s){const a=t[n]||(t[n]={}),u=MQ(o);let l=PN(r),c,f;if(l!=null&&(e=t.scope,l=l+(u?"|"+u:""),c=a[l]),!c){const d=o?{field:wy,pulse:t.countsRef(e,r,o)}:{field:e.fieldRef(r),pulse:ne(t.output)};u&&(d.sort=e.sortRef(o)),f=e.add(dp(i,void 0,d)),s&&(t.index[r]=f),c=ne(f),l!=null&&(a[l]=c)}return c}js.prototype={countsRef(e,t,n){const i=this,r=i.counts||(i.counts={}),o=PN(t);let s,a,u;return o!=null&&(e=i.scope,s=r[o]),s?n&&n.field&&QA(e,s.agg.params,n):(u={groupby:e.fieldRef(t,"key"),pulse:ne(i.output)},n&&n.field&&QA(e,u,n),a=e.add(wN(u)),s=e.add(Ci({pulse:ne(a)})),s={agg:a,ref:ne(s)},o!=null&&(r[o]=s)),s.ref},tuplesRef(){return ne(this.values)},extentRef(e,t){return gl(e,this,"extent","extent",t,!1)},domainRef(e,t){return gl(e,this,"domain","values",t,!1)},valuesRef(e,t,n){return gl(e,this,"vals","values",t,n||!0)},lookupRef(e,t){return gl(e,this,"lookup","tupleindex",t,!1)},indataRef(e,t){return gl(e,this,"indata","tupleindex",t,!0,!0)}};function lee(e,t,n){const i=e.from.facet,r=i.name,o=Md(i,t);let s;i.name||N("Facet must have a name: "+H(i)),i.data||N("Facet must reference a data set: "+H(i)),i.field?s=t.add(_N({field:t.fieldRef(i.field),pulse:o})):i.groupby?s=t.add(GQ({key:t.keyRef(i.groupby),group:ne(t.proxy(n.parent)),pulse:o})):N("Facet must specify groupby or field: "+H(i));const a=t.fork(),u=a.add(Ci()),l=a.add(ra({pulse:ne(u)}));a.addData(r,new js(a,u,u,l)),a.addSignal("parent",null),s.params.subflow={$subflow:a.parse(e).toRuntime()}}function cee(e,t,n){const i=t.add(_N({pulse:n.pulse})),r=t.fork();r.add(ra()),r.addSignal("parent",null),i.params.subflow={$subflow:r.parse(e).toRuntime()}}function IN(e,t,n){const i=e.remove,r=e.insert,o=e.toggle,s=e.modify,a=e.values,u=t.add(jh()),l="if("+e.trigger+',modify("'+n+'",'+[r,i,o,s,a].map(f=>f??"null").join(",")+"),0)",c=ir(l,t);u.update=c.$expr,u.params=c.$params}function bp(e,t){const n=NN(e),i=e.type===pp,r=e.from&&e.from.facet,o=e.overlap;let s=e.layout||n===I2||n===P2,a,u,l,c,f,d,h;const g=n===L2||s||r,p=uee(e.from,i,t);u=t.add(WQ({key:p.key||(e.key?Ec(e.key):void 0),pulse:p.pulse,clean:!i}));const m=ne(u);u=l=t.add(Ci({pulse:m})),u=t.add(JQ({markdef:eee(e),interactive:tee(e.interactive,t),clip:ZZ(e.clip,t),context:{$context:!0},groups:t.lookup(),parent:t.signals.parent?t.signalRef("parent"):null,index:t.markpath(),pulse:ne(u)}));const y=ne(u);u=c=t.add(SN(vN(e.encode,e.type,n,e.style,t,{mod:!1,pulse:y}))),u.params.parent=t.encode(),e.transform&&e.transform.forEach(S=>{const w=Y2(S,t),_=w.metadata;(_.generates||_.changes)&&N("Mark transforms should not generate new data."),_.nomod||(c.params.mod=!0),w.params.pulse=ne(u),t.add(u=w)}),e.sort&&(u=t.add(sZ({sort:t.compareRef(e.sort),pulse:ne(u)})));const b=ne(u);(r||s)&&(s=t.add($N({layout:t.objectProperty(e.layout),legends:t.legends,mark:y,pulse:b})),d=ne(s));const v=t.add(EN({mark:y,pulse:d||b}));h=ne(v),i&&(g&&(a=t.operators,a.pop(),s&&a.pop()),t.pushState(b,d||h,m),r?lee(e,t,p):g?cee(e,t,p):t.parse(e),t.popState(),g&&(s&&a.push(s),a.push(v))),o&&(h=fee(o,h,t));const x=t.add(AN({pulse:h})),E=t.add(ra({pulse:ne(x)},void 0,t.parent()));e.name!=null&&(f=e.name,t.addData(f,new js(t,l,x,E)),e.on&&e.on.forEach(S=>{(S.insert||S.remove||S.toggle)&&N("Marks only support modify triggers."),IN(S,t,f)}))}function fee(e,t,n){const i=e.method,r=e.bound,o=e.separation,s={separation:ut(o)?n.signalRef(o.signal):o,method:ut(i)?n.signalRef(i.signal):i,pulse:t};if(e.order&&(s.sort=n.compareRef({field:e.order})),r){const a=r.tolerance;s.boundTolerance=ut(a)?n.signalRef(a.signal):+a,s.boundScale=n.scaleRef(r.scale),s.boundOrient=r.orient}return ne(n.add(eZ(s)))}function dee(e,t){const n=t.config.legend,i=e.encode||{},r=$n(e,n),o=i.legend||{},s=o.name||void 0,a=o.interactive,u=o.style,l={};let c=0,f,d,h;q2.forEach(v=>e[v]?(l[v]=e[v],c=c||e[v]):0),c||N("Missing valid scale for legend.");const g=hee(e,t.scaleType(c)),p={title:e.title!=null,scales:l,type:g,vgrad:g!=="symbol"&&r.isVertical()},m=ne(t.add(Ci(null,[p]))),y={enter:{x:{value:0},y:{value:0}}},b=ne(t.add(XQ(d={type:g,scale:t.scaleRef(c),count:t.objectProperty(r("tickCount")),limit:t.property(r("symbolLimit")),values:t.objectProperty(e.values),minstep:t.property(e.tickMinStep),formatType:t.property(e.formatType),formatSpecifier:t.property(e.format)})));return g===Td?(h=[zZ(e,c,n,i.gradient),GA(e,n,i.labels,b)],d.count=d.count||t.signalRef(`max(2,2*floor((${ks(r.gradientLength())})/100))`)):g===Ay?h=[BZ(e,c,n,i.gradient,b),GA(e,n,i.labels,b)]:(f=WZ(e,n),h=[qZ(e,n,i,b,ks(f.columns))],d.size=mee(e,t,h[0].marks)),h=[_c({role:fQ,from:m,encode:y,marks:h,layout:f,interactive:a})],p.title&&h.push(QZ(e,n,i.title,m)),bp(_c({role:lQ,from:m,encode:zu(pee(r,e,n),o,uf),marks:h,aria:r("aria"),description:r("description"),zindex:r("zindex"),name:s,interactive:a,style:u}),t)}function hee(e,t){let n=e.type||HA;return!e.type&&gee(e)===1&&(e.fill||e.stroke)&&(n=Yv(t)?Td:y1(t)?Ay:HA),n!==Td?n:y1(t)?Ay:Td}function gee(e){return q2.reduce((t,n)=>t+(e[n]?1:0),0)}function pee(e,t,n){const i={enter:{},update:{}};return Tt(i,{orient:e("orient"),offset:e("offset"),padding:e("padding"),titlePadding:e("titlePadding"),cornerRadius:e("cornerRadius"),fill:e("fillColor"),stroke:e("strokeColor"),strokeWidth:n.strokeWidth,strokeDash:n.strokeDash,x:e("legendX"),y:e("legendY"),format:t.format,formatType:t.formatType}),i}function mee(e,t,n){const i=ks(ZA("size",e,n)),r=ks(ZA("strokeWidth",e,n)),o=ks(yee(n[1].encode,t,af));return ir(`max(ceil(sqrt(${i})+${r}),${o})`,t)}function ZA(e,t,n){return t[e]?`scale("${t[e]}",datum)`:ON(e,n[0].encode)}function yee(e,t,n){return ON("fontSize",e)||PZ("fontSize",t,n)}const bee=`item.orient==="${Bu}"?-90:item.orient==="${Uu}"?90:0`;function vee(e,t){e=K(e)?{text:e}:e;const n=$n(e,t.config.title),i=e.encode||{},r=i.group||{},o=r.name||void 0,s=r.interactive,a=r.style,u=[],l={},c=ne(t.add(Ci(null,[l])));return u.push(Eee(e,n,xee(e),c)),e.subtitle&&u.push(See(e,n,i.subtitle,c)),bp(_c({role:pQ,from:c,encode:wee(n,r),marks:u,aria:n("aria"),description:n("description"),zindex:n("zindex"),name:o,interactive:s,style:a}),t)}function xee(e){const t=e.encode;return t&&t.title||he({name:e.name,interactive:e.interactive,style:e.style},t)}function wee(e,t){const n={enter:{},update:{}};return Tt(n,{orient:e("orient"),anchor:e("anchor"),align:{signal:H2},angle:{signal:bee},limit:e("limit"),frame:e("frame"),offset:e("offset")||0,padding:e("subtitlePadding")}),zu(n,t,uf)}function Eee(e,t,n,i){const r={value:0},o=e.text,s={enter:{opacity:r},update:{opacity:{value:1}},exit:{opacity:r}};return Tt(s,{text:o,align:{signal:"item.mark.group.align"},angle:{signal:"item.mark.group.angle"},limit:{signal:"item.mark.group.limit"},baseline:"top",dx:t("dx"),dy:t("dy"),fill:t("color"),font:t("font"),fontSize:t("fontSize"),fontStyle:t("fontStyle"),fontWeight:t("fontWeight"),lineHeight:t("lineHeight")},{align:t("align"),angle:t("angle"),baseline:t("baseline")}),Un({type:oa,role:mQ,style:CZ,from:i,encode:s},n)}function See(e,t,n,i){const r={value:0},o=e.subtitle,s={enter:{opacity:r},update:{opacity:{value:1}},exit:{opacity:r}};return Tt(s,{text:o,align:{signal:"item.mark.group.align"},angle:{signal:"item.mark.group.angle"},limit:{signal:"item.mark.group.limit"},baseline:"top",dx:t("dx"),dy:t("dy"),fill:t("subtitleColor"),font:t("subtitleFont"),fontSize:t("subtitleFontSize"),fontStyle:t("subtitleFontStyle"),fontWeight:t("subtitleFontWeight"),lineHeight:t("subtitleLineHeight")},{align:t("align"),angle:t("angle"),baseline:t("baseline")}),Un({type:oa,role:yQ,style:FZ,from:i,encode:s},n)}function _ee(e,t){const n=[];e.transform&&e.transform.forEach(i=>{n.push(Y2(i,t))}),e.on&&e.on.forEach(i=>{IN(i,t,e.name)}),t.addDataPipeline(e.name,Aee(e,t,n))}function Aee(e,t,n){const i=[];let r=null,o=!1,s=!1,a,u,l,c,f;for(e.values?ut(e.values)||Cd(e.format)?(i.push(e$(t,e)),i.push(r=rs())):i.push(r=rs({$ingest:e.values,$format:e.format})):e.url?Cd(e.url)||Cd(e.format)?(i.push(e$(t,e)),i.push(r=rs())):i.push(r=rs({$request:e.url,$format:e.format})):e.source&&(r=a=X(e.source).map(d=>ne(t.getData(d).output)),i.push(null)),u=0,l=n.length;u<l;++u)c=n[u],f=c.metadata,!r&&!f.source&&i.push(r=rs()),i.push(c),f.generates&&(s=!0),f.modifies&&!s&&(o=!0),f.source?r=c:f.changes&&(r=null);return a&&(l=a.length-1,i[0]=rZ({derive:o,pulse:l?a:a[0]}),(o||l)&&i.splice(1,0,rs())),r||i.push(rs()),i.push(ra({})),i}function rs(e){const t=Ci({},e);return t.metadata={source:!0},t}function e$(e,t){return KQ({url:t.url?e.property(t.url):void 0,async:t.async?e.property(t.async):void 0,values:t.values?e.property(t.values):void 0,format:e.objectProperty(t.format)})}const zN=e=>e===No||e===Fi,vp=(e,t,n)=>ut(e)?Fee(e.signal,t,n):e===Bu||e===Fi?t:n,pt=(e,t,n)=>ut(e)?kee(e.signal,t,n):zN(e)?t:n,bi=(e,t,n)=>ut(e)?Cee(e.signal,t,n):zN(e)?n:t,BN=(e,t,n)=>ut(e)?Tee(e.signal,t,n):e===Fi?{value:t}:{value:n},$ee=(e,t,n)=>ut(e)?Mee(e.signal,t,n):e===Uu?{value:t}:{value:n},kee=(e,t,n)=>UN(`${e} === '${Fi}' || ${e} === '${No}'`,t,n),Cee=(e,t,n)=>UN(`${e} !== '${Fi}' && ${e} !== '${No}'`,t,n),Fee=(e,t,n)=>X2(`${e} === '${Bu}' || ${e} === '${Fi}'`,t,n),Tee=(e,t,n)=>X2(`${e} === '${Fi}'`,t,n),Mee=(e,t,n)=>X2(`${e} === '${Uu}'`,t,n),UN=(e,t,n)=>(t=t!=null?gt(t):t,n=n!=null?gt(n):n,t$(t)&&t$(n)?(t=t?t.signal||H(t.value):null,n=n?n.signal||H(n.value):null,{signal:`${e} ? (${t}) : (${n})`}):[he({test:e},t)].concat(n||[])),t$=e=>e==null||Object.keys(e).length===1,X2=(e,t,n)=>({signal:`${e} ? (${Na(t)}) : (${Na(n)})`}),Dee=(e,t,n,i,r)=>({signal:(i!=null?`${e} === '${Bu}' ? (${Na(i)}) : `:"")+(n!=null?`${e} === '${No}' ? (${Na(n)}) : `:"")+(r!=null?`${e} === '${Uu}' ? (${Na(r)}) : `:"")+(t!=null?`${e} === '${Fi}' ? (${Na(t)}) : `:"")+"(null)"}),Na=e=>ut(e)?e.signal:e==null?null:H(e),Oee=(e,t)=>t===0?0:ut(e)?{signal:`(${e.signal}) * ${t}`}:{value:e*t},Ba=(e,t)=>{const n=e.signal;return n&&n.endsWith("(null)")?{signal:n.slice(0,-6)+t.signal}:e};function _a(e,t,n,i){let r;if(t&&J(t,e))return t[e];if(J(n,e))return n[e];if(e.startsWith("title")){switch(e){case"titleColor":r="fill";break;case"titleFont":case"titleFontSize":case"titleFontWeight":r=e[5].toLowerCase()+e.slice(6)}return i[j2][r]}else if(e.startsWith("label")){switch(e){case"labelColor":r="fill";break;case"labelFont":case"labelFontSize":r=e[5].toLowerCase()+e.slice(6)}return i[af][r]}return null}function n$(e){const t={};for(const n of e)if(n)for(const i in n)t[i]=1;return Object.keys(t)}function Ree(e,t){var n=t.config,i=n.style,r=n.axis,o=t.scaleType(e.scale)==="band"&&n.axisBand,s=e.orient,a,u,l;if(ut(s)){const f=n$([n.axisX,n.axisY]),d=n$([n.axisTop,n.axisBottom,n.axisLeft,n.axisRight]);a={};for(l of f)a[l]=pt(s,_a(l,n.axisX,r,i),_a(l,n.axisY,r,i));u={};for(l of d)u[l]=Dee(s.signal,_a(l,n.axisTop,r,i),_a(l,n.axisBottom,r,i),_a(l,n.axisLeft,r,i),_a(l,n.axisRight,r,i))}else a=s===Fi||s===No?n.axisX:n.axisY,u=n["axis"+s[0].toUpperCase()+s.slice(1)];return a||u||o?he({},r,a,u,o):r}function Nee(e,t,n,i){const r=$n(e,t),o=e.orient;let s,a;const u={enter:s={opacity:Se},update:a={opacity:Jn},exit:{opacity:Se}};Tt(u,{stroke:r("domainColor"),strokeCap:r("domainCap"),strokeDash:r("domainDash"),strokeDashOffset:r("domainDashOffset"),strokeWidth:r("domainWidth"),strokeOpacity:r("domainOpacity")});const l=i$(e,0),c=i$(e,1);return s.x=a.x=pt(o,l,Se),s.x2=a.x2=pt(o,c),s.y=a.y=bi(o,l,Se),s.y2=a.y2=bi(o,c),Un({type:W2,role:rQ,from:i,encode:u},n)}function i$(e,t){return{scale:e.scale,range:t}}function Lee(e,t,n,i,r){const o=$n(e,t),s=e.orient,a=e.gridScale,u=vp(s,1,-1),l=Pee(e.offset,u);let c,f,d;const h={enter:c={opacity:Se},update:d={opacity:Jn},exit:f={opacity:Se}};Tt(h,{stroke:o("gridColor"),strokeCap:o("gridCap"),strokeDash:o("gridDash"),strokeDashOffset:o("gridDashOffset"),strokeOpacity:o("gridOpacity"),strokeWidth:o("gridWidth")});const g={scale:e.scale,field:Kn,band:r.band,extra:r.extra,offset:r.offset,round:o("tickRound")},p=pt(s,{signal:"height"},{signal:"width"}),m=a?{scale:a,range:0,mult:u,offset:l}:{value:0,offset:l},y=a?{scale:a,range:1,mult:u,offset:l}:he(p,{mult:u,offset:l});return c.x=d.x=pt(s,g,m),c.y=d.y=bi(s,g,m),c.x2=d.x2=bi(s,y),c.y2=d.y2=pt(s,y),f.x=pt(s,g),f.y=bi(s,g),Un({type:W2,role:oQ,key:Kn,from:i,encode:h},n)}function Pee(e,t){if(t!==1)if(!Y(e))e=ut(t)?{signal:`(${t.signal}) * (${e||0})`}:t*(e||0);else{let n=e=he({},e);for(;n.mult!=null;)if(Y(n.mult))n=n.mult=he({},n.mult);else return n.mult=ut(t)?{signal:`(${n.mult}) * (${t.signal})`}:n.mult*t,e;n.mult=t}return e}function Iee(e,t,n,i,r,o){const s=$n(e,t),a=e.orient,u=vp(a,-1,1);let l,c,f;const d={enter:l={opacity:Se},update:f={opacity:Jn},exit:c={opacity:Se}};Tt(d,{stroke:s("tickColor"),strokeCap:s("tickCap"),strokeDash:s("tickDash"),strokeDashOffset:s("tickDashOffset"),strokeOpacity:s("tickOpacity"),strokeWidth:s("tickWidth")});const h=gt(r);h.mult=u;const g={scale:e.scale,field:Kn,band:o.band,extra:o.extra,offset:o.offset,round:s("tickRound")};return f.y=l.y=pt(a,Se,g),f.y2=l.y2=pt(a,h),c.x=pt(a,g),f.x=l.x=bi(a,Se,g),f.x2=l.x2=bi(a,h),c.y=bi(a,g),Un({type:W2,role:aQ,key:Kn,from:i,encode:d},n)}function p0(e,t,n,i,r){return{signal:'flush(range("'+e+'"), scale("'+e+'", datum.value), '+t+","+n+","+i+","+r+")"}}function zee(e,t,n,i,r,o){const s=$n(e,t),a=e.orient,u=e.scale,l=vp(a,-1,1),c=ks(s("labelFlush")),f=ks(s("labelFlushOffset")),d=s("labelAlign"),h=s("labelBaseline");let g=c===0||!!c,p;const m=gt(r);m.mult=l,m.offset=gt(s("labelPadding")||0),m.offset.mult=l;const y={scale:u,field:Kn,band:.5,offset:RN(o.offset,s("labelOffset"))},b=pt(a,g?p0(u,c,'"left"','"right"','"center"'):{value:"center"},$ee(a,"left","right")),v=pt(a,BN(a,"bottom","top"),g?p0(u,c,'"top"','"bottom"','"middle"'):{value:"middle"}),x=p0(u,c,`-(${f})`,f,0);g=g&&f;const E={opacity:Se,x:pt(a,y,m),y:bi(a,y,m)},S={enter:E,update:p={opacity:Jn,text:{field:U2},x:E.x,y:E.y,align:b,baseline:v},exit:{opacity:Se,x:E.x,y:E.y}};Tt(S,{dx:!d&&g?pt(a,x):null,dy:!h&&g?bi(a,x):null}),Tt(S,{angle:s("labelAngle"),fill:s("labelColor"),fillOpacity:s("labelOpacity"),font:s("labelFont"),fontSize:s("labelFontSize"),fontWeight:s("labelFontWeight"),fontStyle:s("labelFontStyle"),limit:s("labelLimit"),lineHeight:s("labelLineHeight")},{align:d,baseline:h});const w=s("labelBound");let _=s("labelOverlap");return _=_||w?{separation:s("labelSeparation"),method:_,order:"datum.index",bound:w?{scale:u,orient:a,tolerance:w}:null}:void 0,p.align!==b&&(p.align=Ba(p.align,b)),p.baseline!==v&&(p.baseline=Ba(p.baseline,v)),Un({type:oa,role:sQ,style:af,key:Kn,from:i,encode:S,overlap:_},n)}function Bee(e,t,n,i){const r=$n(e,t),o=e.orient,s=vp(o,-1,1);let a,u;const l={enter:a={opacity:Se,anchor:gt(r("titleAnchor",null)),align:{signal:H2}},update:u=he({},a,{opacity:Jn,text:gt(e.title)}),exit:{opacity:Se}},c={signal:`lerp(range("${e.scale}"), ${mp(0,1,.5)})`};return u.x=pt(o,c),u.y=bi(o,c),a.angle=pt(o,Se,Oee(s,90)),a.baseline=pt(o,BN(o,No,Fi),{value:No}),u.angle=a.angle,u.baseline=a.baseline,Tt(l,{fill:r("titleColor"),fillOpacity:r("titleOpacity"),font:r("titleFont"),fontSize:r("titleFontSize"),fontStyle:r("titleFontStyle"),fontWeight:r("titleFontWeight"),limit:r("titleLimit"),lineHeight:r("titleLineHeight")},{align:r("titleAlign"),angle:r("titleAngle"),baseline:r("titleBaseline")}),Uee(r,o,l,n),l.update.align=Ba(l.update.align,a.align),l.update.angle=Ba(l.update.angle,a.angle),l.update.baseline=Ba(l.update.baseline,a.baseline),Un({type:oa,role:uQ,style:j2,from:i,encode:l},n)}function Uee(e,t,n,i){const r=(a,u)=>a!=null?(n.update[u]=Ba(gt(a),n.update[u]),!1):!Fa(u,i),o=r(e("titleX"),"x"),s=r(e("titleY"),"y");n.enter.auto=s===o?gt(s):pt(t,gt(s),gt(o))}function jee(e,t){const n=Ree(e,t),i=e.encode||{},r=i.axis||{},o=r.name||void 0,s=r.interactive,a=r.style,u=$n(e,n),l=IZ(u),c={scale:e.scale,ticks:!!u("ticks"),labels:!!u("labels"),grid:!!u("grid"),domain:!!u("domain"),title:e.title!=null},f=ne(t.add(Ci({},[c]))),d=ne(t.add(qQ({scale:t.scaleRef(e.scale),extra:t.property(l.extra),count:t.objectProperty(e.tickCount),values:t.objectProperty(e.values),minstep:t.property(e.tickMinStep),formatType:t.property(e.formatType),formatSpecifier:t.property(e.format)}))),h=[];let g;return c.grid&&h.push(Lee(e,n,i.grid,d,l)),c.ticks&&(g=u("tickSize"),h.push(Iee(e,n,i.ticks,d,g,l))),c.labels&&(g=c.ticks?g:0,h.push(zee(e,n,i.labels,d,g,l))),c.domain&&h.push(Nee(e,n,i.domain,f)),c.title&&h.push(Bee(e,n,i.title,f)),bp(_c({role:iQ,from:f,encode:zu(qee(u,e),r,uf),marks:h,aria:u("aria"),description:u("description"),zindex:u("zindex"),name:o,interactive:s,style:a}),t)}function qee(e,t){const n={enter:{},update:{}};return Tt(n,{orient:e("orient"),offset:e("offset")||0,position:fi(t.position,0),titlePadding:e("titlePadding"),minExtent:e("minExtent"),maxExtent:e("maxExtent"),range:{signal:`abs(span(range("${t.scale}")))`},translate:e("translate"),format:t.format,formatType:t.formatType}),n}function jN(e,t,n){const i=X(e.signals),r=X(e.scales);return n||i.forEach(o=>xN(o,t)),X(e.projections).forEach(o=>wZ(o,t)),r.forEach(o=>lZ(o,t)),X(e.data).forEach(o=>_ee(o,t)),r.forEach(o=>cZ(o,t)),(n||i).forEach(o=>jQ(o,t)),X(e.axes).forEach(o=>jee(o,t)),X(e.marks).forEach(o=>bp(o,t)),X(e.legends).forEach(o=>dee(o,t)),e.title&&vee(e.title,t),t.parseLambdas(),t}const Wee=e=>zu({enter:{x:{value:0},y:{value:0}},update:{width:{signal:"width"},height:{signal:"height"}}},e);function Hee(e,t){const n=t.config,i=ne(t.root=t.add(jh())),r=Gee(e,n);r.forEach(l=>xN(l,t)),t.description=e.description||n.description,t.eventConfig=n.events,t.legends=t.objectProperty(n.legend&&n.legend.layout),t.locale=n.locale;const o=t.add(Ci()),s=t.add(SN(vN(Wee(e.encode),pp,P2,e.style,t,{pulse:ne(o)}))),a=t.add($N({layout:t.objectProperty(e.layout),legends:t.legends,autosize:t.signalRef("autosize"),mark:i,pulse:ne(s)}));t.operators.pop(),t.pushState(ne(s),ne(a),null),jN(e,t,r),t.operators.push(a);let u=t.add(EN({mark:i,pulse:ne(a)}));return u=t.add(AN({pulse:ne(u)})),u=t.add(ra({pulse:ne(u)})),t.addData("root",new js(t,o,o,u)),t}function pl(e,t){return t&&t.signal?{name:e,update:t.signal}:{name:e,value:t}}function Gee(e,t){const n=s=>fi(e[s],t[s]),i=[pl("background",n("background")),pl("autosize",eQ(n("autosize"))),pl("padding",nQ(n("padding"))),pl("width",n("width")||0),pl("height",n("height")||0)],r=i.reduce((s,a)=>(s[a.name]=a,s),{}),o={};return X(e.signals).forEach(s=>{J(r,s.name)?s=he(r[s.name],s):i.push(s),o[s.name]=s}),X(t.signals).forEach(s=>{!J(o,s.name)&&!J(r,s.name)&&i.push(s)}),i}function qN(e,t){this.config=e||{},this.options=t||{},this.bindings=[],this.field={},this.signals={},this.lambdas={},this.scales={},this.events={},this.data={},this.streams=[],this.updates=[],this.operators=[],this.eventConfig=null,this.locale=null,this._id=0,this._subid=0,this._nextsub=[0],this._parent=[],this._encode=[],this._lookup=[],this._markpath=[]}function r$(e){this.config=e.config,this.options=e.options,this.legends=e.legends,this.field=Object.create(e.field),this.signals=Object.create(e.signals),this.lambdas=Object.create(e.lambdas),this.scales=Object.create(e.scales),this.events=Object.create(e.events),this.data=Object.create(e.data),this.streams=[],this.updates=[],this.operators=[],this._id=0,this._subid=++e._nextsub[0],this._nextsub=e._nextsub,this._parent=e._parent.slice(),this._encode=e._encode.slice(),this._lookup=e._lookup.slice(),this._markpath=e._markpath}qN.prototype=r$.prototype={parse(e){return jN(e,this)},fork(){return new r$(this)},isSubscope(){return this._subid>0},toRuntime(){return this.finish(),{description:this.description,operators:this.operators,streams:this.streams,updates:this.updates,bindings:this.bindings,eventConfig:this.eventConfig,locale:this.locale}},id(){return(this._subid?this._subid+":":0)+this._id++},add(e){return this.operators.push(e),e.id=this.id(),e.refs&&(e.refs.forEach(t=>{t.$ref=e.id}),e.refs=null),e},proxy(e){const t=e instanceof xy?ne(e):e;return this.add(iZ({value:t}))},addStream(e){return this.streams.push(e),e.id=this.id(),e},addUpdate(e){return this.updates.push(e),e},finish(){let e,t;this.root&&(this.root.root=!0);for(e in this.signals)this.signals[e].signal=e;for(e in this.scales)this.scales[e].scale=e;function n(i,r,o){let s,a;i&&(s=i.data||(i.data={}),a=s[r]||(s[r]=[]),a.push(o))}for(e in this.data){t=this.data[e],n(t.input,e,"input"),n(t.output,e,"output"),n(t.values,e,"values");for(const i in t.index)n(t.index[i],e,"index:"+i)}return this},pushState(e,t,n){this._encode.push(ne(this.add(ra({pulse:e})))),this._parent.push(t),this._lookup.push(n?ne(this.proxy(n)):null),this._markpath.push(-1)},popState(){this._encode.pop(),this._parent.pop(),this._lookup.pop(),this._markpath.pop()},parent(){return Ee(this._parent)},encode(){return Ee(this._encode)},lookup(){return Ee(this._lookup)},markpath(){const e=this._markpath;return++e[e.length-1]},fieldRef(e,t){if(K(e))return Ec(e,t);e.signal||N("Unsupported field reference: "+H(e));const n=e.signal;let i=this.field[n];if(!i){const r={name:this.signalRef(n)};t&&(r.as=t),this.field[n]=i=ne(this.add(VQ(r)))}return i},compareRef(e){let t=!1;const n=o=>ut(o)?(t=!0,this.signalRef(o.signal)):DQ(o)?(t=!0,this.exprRef(o.expr)):o,i=X(e.field).map(n),r=X(e.order).map(n);return t?ne(this.add(WA({fields:i,orders:r}))):jA(i,r)},keyRef(e,t){let n=!1;const i=o=>ut(o)?(n=!0,ne(r[o.signal])):o,r=this.signals;return e=X(e).map(i),n?ne(this.add(YQ({fields:e,flat:t}))):CQ(e,t)},sortRef(e){if(!e)return e;const t=hp(e.op,e.field),n=e.order||FQ;return n.signal?ne(this.add(WA({fields:t,orders:this.signalRef(n.signal)}))):jA(t,n)},event(e,t){const n=e+":"+t;if(!this.events[n]){const i=this.id();this.streams.push({id:i,source:e,type:t}),this.events[n]=i}return this.events[n]},hasOwnSignal(e){return J(this.signals,e)},addSignal(e,t){this.hasOwnSignal(e)&&N("Duplicate signal name: "+H(e));const n=t instanceof xy?t:this.add(jh(t));return this.signals[e]=n},getSignal(e){return this.signals[e]||N("Unrecognized signal name: "+H(e)),this.signals[e]},signalRef(e){return this.signals[e]?ne(this.signals[e]):(J(this.lambdas,e)||(this.lambdas[e]=this.add(jh(null))),ne(this.lambdas[e]))},parseLambdas(){const e=Object.keys(this.lambdas);for(let t=0,n=e.length;t<n;++t){const i=e[t],r=ir(i,this),o=this.lambdas[i];o.params=r.$params,o.update=r.$expr}},property(e){return e&&e.signal?this.signalRef(e.signal):e},objectProperty(e){return!e||!Y(e)?e:this.signalRef(e.signal||K2(e))},exprRef(e,t){const n={expr:ir(e,this)};return t&&(n.expr.$name=t),ne(this.add(HQ(n)))},addBinding(e,t){this.bindings||N("Nested signals do not support binding: "+H(e)),this.bindings.push(he({signal:e},t))},addScaleProj(e,t){J(this.scales,e)&&N("Duplicate scale or projection name: "+H(e)),this.scales[e]=this.add(t)},addScale(e,t){this.addScaleProj(e,oZ(t))},addProjection(e,t){this.addScaleProj(e,nZ(t))},getScale(e){return this.scales[e]||N("Unrecognized scale name: "+H(e)),this.scales[e]},scaleRef(e){return ne(this.getScale(e))},scaleType(e){return this.getScale(e).params.type},projectionRef(e){return this.scaleRef(e)},projectionType(e){return this.scaleType(e)},addData(e,t){return J(this.data,e)&&N("Duplicate data set name: "+H(e)),this.data[e]=t},getData(e){return this.data[e]||N("Undefined data set name: "+H(e)),this.data[e]},addDataPipeline(e,t){return J(this.data,e)&&N("Duplicate data set name: "+H(e)),this.addData(e,js.fromEntries(this,t))}};function K2(e){return(P(e)?Vee:Yee)(e)}function Vee(e){const t=e.length;let n="[";for(let i=0;i<t;++i){const r=e[i];n+=(i>0?",":"")+(Y(r)?r.signal||K2(r):H(r))}return n+"]"}function Yee(e){let t="{",n=0,i,r;for(i in e)r=e[i],t+=(++n>1?",":"")+H(i)+":"+(Y(r)?r.signal||K2(r):H(r));return t+"}"}function Xee(){const e="sans-serif",i="#4c78a8",r="#000",o="#888",s="#ddd";return{description:"Vega visualization",padding:0,autosize:"pad",background:null,events:{defaults:{allow:["wheel"]}},group:null,mark:null,arc:{fill:i},area:{fill:i},image:null,line:{stroke:i,strokeWidth:2},path:{stroke:i},rect:{fill:i},rule:{stroke:r},shape:{stroke:i},symbol:{fill:i,size:64},text:{fill:r,font:e,fontSize:11},trail:{fill:i,size:2},style:{"guide-label":{fill:r,font:e,fontSize:10},"guide-title":{fill:r,font:e,fontSize:11,fontWeight:"bold"},"group-title":{fill:r,font:e,fontSize:13,fontWeight:"bold"},"group-subtitle":{fill:r,font:e,fontSize:12},point:{size:30,strokeWidth:2,shape:"circle"},circle:{size:30,strokeWidth:2},square:{size:30,strokeWidth:2,shape:"square"},cell:{fill:"transparent",stroke:s},view:{fill:"transparent"}},title:{orient:"top",anchor:"middle",offset:4,subtitlePadding:3},axis:{minExtent:0,maxExtent:200,bandPosition:.5,domain:!0,domainWidth:1,domainColor:o,grid:!1,gridWidth:1,gridColor:s,labels:!0,labelAngle:0,labelLimit:180,labelOffset:0,labelPadding:2,ticks:!0,tickColor:o,tickOffset:0,tickRound:!0,tickSize:5,tickWidth:1,titlePadding:4},axisBand:{tickOffset:-.5},projection:{type:"mercator"},legend:{orient:"right",padding:0,gridAlign:"each",columnPadding:10,rowPadding:2,symbolDirection:"vertical",gradientDirection:"vertical",gradientLength:200,gradientThickness:16,gradientStrokeColor:s,gradientStrokeWidth:0,gradientLabelOffset:2,labelAlign:"left",labelBaseline:"middle",labelLimit:160,labelOffset:4,labelOverlap:!0,symbolLimit:30,symbolType:"circle",symbolSize:100,symbolOffset:0,symbolStrokeWidth:1.5,symbolBaseFillColor:"transparent",symbolBaseStrokeColor:o,titleLimit:180,titleOrient:"top",titlePadding:5,layout:{offset:18,direction:"horizontal",left:{direction:"vertical"},right:{direction:"vertical"}}},range:{category:{scheme:"tableau10"},ordinal:{scheme:"blues"},heatmap:{scheme:"yellowgreenblue"},ramp:{scheme:"blues"},diverging:{scheme:"blueorange",extent:[1,0]},symbol:["circle","square","triangle-up","cross","diamond","triangle-right","triangle-down","triangle-left"]}}}function Kee(e,t,n){return Y(e)||N("Input Vega specification must be an object."),t=Cu(Xee(),t,e.config),Hee(e,new qN(t,n)).toRuntime()}var Jee="5.30.0";he(Ja,T9,Tj,uq,VW,RH,aV,BG,lV,OV,qV,KV);const Qee=Object.freeze(Object.defineProperty({__proto__:null,Bounds:it,CanvasHandler:Jc,CanvasRenderer:sh,DATE:xn,DAY:zt,DAYOFYEAR:tr,Dataflow:Pa,Debug:dC,Error:hb,EventStream:Ag,Gradient:NM,GroupItem:Wg,HOURS:In,Handler:vx,HybridHandler:$D,HybridRenderer:C1,Info:fC,Item:qg,MILLISECONDS:wi,MINUTES:zn,MONTH:Wt,Marks:Bn,MultiPulse:Lb,None:cC,Operator:Ie,Parameters:_g,Pulse:Ao,QUARTER:vn,RenderType:yo,Renderer:Kc,ResourceLoader:jM,SECONDS:Zn,SVGHandler:hD,SVGRenderer:Ax,SVGStringRenderer:AD,Scenegraph:oD,TIME_UNITS:$b,Transform:D,View:aN,WEEK:st,Warn:gb,YEAR:Ct,accessor:An,accessorFields:qt,accessorName:Je,array:X,ascending:gg,bandwidthNRD:Bb,bin:BF,bootstrapCI:UF,boundClip:LD,boundContext:Gc,boundItem:S1,boundMark:tD,boundStroke:Gr,changeset:ta,clampRange:SC,codegenExpression:RR,compare:vb,constant:Yt,cumulativeLogNormal:Gb,cumulativeNormal:kg,cumulativeUniform:Kb,dayofyear:VC,debounce:xb,defaultLocale:Mb,definition:PF,densityLogNormal:Hb,densityNormal:Ub,densityUniform:Xb,domChild:ot,domClear:Wn,domCreate:po,domFind:bx,dotbin:jF,error:N,expressionFunction:nt,extend:he,extent:Qi,extentIndex:_C,falsy:io,fastmap:Tu,field:Qn,flush:AC,font:Xg,fontFamily:Xc,fontSize:lr,format:ld,formatLocale:Bd,formats:Rb,hasOwnProperty:J,id:Rc,identity:Vt,inferType:$F,inferTypes:kF,ingest:Ce,inherits:G,inrange:Ta,interpolate:Xv,interpolateColors:Ug,interpolateRange:wM,intersect:DD,intersectBoxLine:Ma,intersectPath:ix,intersectPoint:rx,intersectRule:WM,isArray:P,isBoolean:Wo,isDate:So,isFunction:ge,isIterable:$C,isNumber:Ae,isObject:Y,isRegExp:kC,isString:K,isTuple:Eg,key:wb,lerp:CC,lineHeight:Do,loader:xg,locale:_F,logger:pb,lruCache:FC,markup:_x,merge:TC,mergeConfig:Cu,multiLineOffset:px,one:ku,pad:MC,panLinear:yC,panLog:bC,panPow:vC,panSymlog:xC,parse:Kee,parseExpression:S2,parseSelector:Vo,path:db,pathCurves:ex,pathEqual:PD,pathParse:nu,pathRectangle:IM,pathRender:fc,pathSymbols:PM,pathTrail:zM,peek:Ee,point:Jg,projection:Wx,quantileLogNormal:Vb,quantileNormal:Cg,quantileUniform:Jb,quantiles:Ib,quantizeInterpolator:EM,quarter:wC,quartiles:zb,get random(){return ei},randomInteger:R4,randomKDE:qb,randomLCG:O4,randomLogNormal:WF,randomMixture:HF,randomNormal:jb,randomUniform:GF,read:TF,regressionConstant:Qb,regressionExp:YF,regressionLinear:Zb,regressionLoess:JF,regressionLog:VF,regressionPoly:KF,regressionPow:XF,regressionQuad:ev,renderModule:Qg,repeat:Sl,resetDefaultLocale:T6,resetSVGClipId:UM,resetSVGDefIds:YU,responseType:FF,runtimeContext:YR,sampleCurve:Tg,sampleLogNormal:Wb,sampleNormal:$g,sampleUniform:Yb,scale:ke,sceneEqual:$x,sceneFromJSON:iD,scenePickVisit:Qd,sceneToJSON:nD,sceneVisit:Ei,sceneZOrder:ox,scheme:Kv,serializeXML:wD,setHybridRendererOptions:WU,setRandom:M4,span:Nc,splitAccessPath:ar,stringValue:H,textMetrics:Rn,timeBin:cF,timeFloor:eF,timeFormatLocale:ac,timeInterval:Ou,timeOffset:iF,timeSequence:sF,timeUnitSpecifier:GC,timeUnits:kb,toBoolean:Eb,toDate:Sb,toNumber:Ut,toSet:xi,toString:_b,transform:IF,transforms:Ja,truncate:DC,truthy:Pn,tupleid:ie,typeParsers:d1,utcFloor:tF,utcInterval:Ru,utcOffset:rF,utcSequence:aF,utcdayofyear:KC,utcquarter:EC,utcweek:JC,version:Jee,visitArray:so,week:YC,writeConfig:Fu,zero:fo,zoomLinear:mb,zoomLog:yb,zoomPow:Ld,zoomSymlog:bb},Symbol.toStringTag,{value:"Module"})),Zee=/("(?:[^\\"]|\\.)*")|[:,]/g;function m0(e,t={}){const n=JSON.stringify([1],void 0,t.indent===void 0?2:t.indent).slice(2,-3),i=n===""?1/0:t.maxLength===void 0?80:t.maxLength;let{replacer:r}=t;return function o(s,a,u){s&&typeof s.toJSON=="function"&&(s=s.toJSON());const l=JSON.stringify(s,r);if(l===void 0)return l;const c=i-a.length-u;if(l.length<=c){const f=l.replace(Zee,(d,h)=>h||`${d} `);if(f.length<=c)return f}if(r!=null&&(s=JSON.parse(l),r=void 0),typeof s=="object"&&s!==null){const f=a+n,d=[];let h=0,g,p;if(Array.isArray(s)){g="[",p="]";const{length:m}=s;for(;h<m;h++)d.push(o(s[h],f,h===m-1?0:1)||"null")}else{g="{",p="}";const m=Object.keys(s),{length:y}=m;for(;h<y;h++){const b=m[h],v=`${JSON.stringify(b)}: `,x=o(s[b],f,v.length+(h===y-1?0:1));x!==void 0&&d.push(v+x)}}if(d.length>0)return[g,n+d.join(`,
|
14
|
+
${f}`),p].join(`
|
15
|
+
${a}`)}return l}(e,"",0)}function ete(e,t,n){let i;t.x2&&(t.x?(n&&e.x>e.x2&&(i=e.x,e.x=e.x2,e.x2=i),e.width=e.x2-e.x):e.x=e.x2-(e.width||0)),t.xc&&(e.x=e.xc-(e.width||0)/2),t.y2&&(t.y?(n&&e.y>e.y2&&(i=e.y,e.y=e.y2,e.y2=i),e.height=e.y2-e.y):e.y=e.y2-(e.height||0)),t.yc&&(e.y=e.yc-(e.height||0)/2)}var tte={NaN:NaN,E:Math.E,LN2:Math.LN2,LN10:Math.LN10,LOG2E:Math.LOG2E,LOG10E:Math.LOG10E,PI:Math.PI,SQRT1_2:Math.SQRT1_2,SQRT2:Math.SQRT2,MIN_VALUE:Number.MIN_VALUE,MAX_VALUE:Number.MAX_VALUE},nte={"*":(e,t)=>e*t,"+":(e,t)=>e+t,"-":(e,t)=>e-t,"/":(e,t)=>e/t,"%":(e,t)=>e%t,">":(e,t)=>e>t,"<":(e,t)=>e<t,"<=":(e,t)=>e<=t,">=":(e,t)=>e>=t,"==":(e,t)=>e==t,"!=":(e,t)=>e!=t,"===":(e,t)=>e===t,"!==":(e,t)=>e!==t,"&":(e,t)=>e&t,"|":(e,t)=>e|t,"^":(e,t)=>e^t,"<<":(e,t)=>e<<t,">>":(e,t)=>e>>t,">>>":(e,t)=>e>>>t},ite={"+":e=>+e,"-":e=>-e,"~":e=>~e,"!":e=>!e};const rte=Array.prototype.slice,os=(e,t,n)=>{const i=n?n(t[0]):t[0];return i[e].apply(i,rte.call(t,1))},ote=(e,t,n,i,r,o,s)=>new Date(e,t||0,n??1,i||0,r||0,o||0,s||0);var ste={isNaN:Number.isNaN,isFinite:Number.isFinite,abs:Math.abs,acos:Math.acos,asin:Math.asin,atan:Math.atan,atan2:Math.atan2,ceil:Math.ceil,cos:Math.cos,exp:Math.exp,floor:Math.floor,log:Math.log,max:Math.max,min:Math.min,pow:Math.pow,random:Math.random,round:Math.round,sin:Math.sin,sqrt:Math.sqrt,tan:Math.tan,clamp:(e,t,n)=>Math.max(t,Math.min(n,e)),now:Date.now,utc:Date.UTC,datetime:ote,date:e=>new Date(e).getDate(),day:e=>new Date(e).getDay(),year:e=>new Date(e).getFullYear(),month:e=>new Date(e).getMonth(),hours:e=>new Date(e).getHours(),minutes:e=>new Date(e).getMinutes(),seconds:e=>new Date(e).getSeconds(),milliseconds:e=>new Date(e).getMilliseconds(),time:e=>new Date(e).getTime(),timezoneoffset:e=>new Date(e).getTimezoneOffset(),utcdate:e=>new Date(e).getUTCDate(),utcday:e=>new Date(e).getUTCDay(),utcyear:e=>new Date(e).getUTCFullYear(),utcmonth:e=>new Date(e).getUTCMonth(),utchours:e=>new Date(e).getUTCHours(),utcminutes:e=>new Date(e).getUTCMinutes(),utcseconds:e=>new Date(e).getUTCSeconds(),utcmilliseconds:e=>new Date(e).getUTCMilliseconds(),length:e=>e.length,join:function(){return os("join",arguments)},indexof:function(){return os("indexOf",arguments)},lastindexof:function(){return os("lastIndexOf",arguments)},slice:function(){return os("slice",arguments)},reverse:e=>e.slice().reverse(),parseFloat,parseInt,upper:e=>String(e).toUpperCase(),lower:e=>String(e).toLowerCase(),substring:function(){return os("substring",arguments,String)},split:function(){return os("split",arguments,String)},replace:function(){return os("replace",arguments,String)},trim:e=>String(e).trim(),regexp:RegExp,test:(e,t)=>RegExp(e).test(t)};const ate=["view","item","group","xy","x","y"],ky=new Set([Function,eval,setTimeout,setInterval]);typeof setImmediate=="function"&&ky.add(setImmediate);const ute={Literal:(e,t)=>t.value,Identifier:(e,t)=>{const n=t.name;return e.memberDepth>0?n:n==="datum"?e.datum:n==="event"?e.event:n==="item"?e.item:tte[n]||e.params["$"+n]},MemberExpression:(e,t)=>{const n=!t.computed,i=e(t.object);n&&(e.memberDepth+=1);const r=e(t.property);if(n&&(e.memberDepth-=1),ky.has(i[r])){console.error(`Prevented interpretation of member "${r}" which could lead to insecure code execution`);return}return i[r]},CallExpression:(e,t)=>{const n=t.arguments;let i=t.callee.name;return i.startsWith("_")&&(i=i.slice(1)),i==="if"?e(n[0])?e(n[1]):e(n[2]):(e.fn[i]||ste[i]).apply(e.fn,n.map(e))},ArrayExpression:(e,t)=>t.elements.map(e),BinaryExpression:(e,t)=>nte[t.operator](e(t.left),e(t.right)),UnaryExpression:(e,t)=>ite[t.operator](e(t.argument)),ConditionalExpression:(e,t)=>e(t.test)?e(t.consequent):e(t.alternate),LogicalExpression:(e,t)=>t.operator==="&&"?e(t.left)&&e(t.right):e(t.left)||e(t.right),ObjectExpression:(e,t)=>t.properties.reduce((n,i)=>{e.memberDepth+=1;const r=e(i.key);return e.memberDepth-=1,ky.has(e(i.value))?console.error(`Prevented interpretation of property "${r}" which could lead to insecure code execution`):n[r]=e(i.value),n},{})};function ml(e,t,n,i,r,o){const s=a=>ute[a.type](s,a);return s.memberDepth=0,s.fn=Object.create(t),s.params=n,s.datum=i,s.event=r,s.item=o,ate.forEach(a=>s.fn[a]=function(){return r.vega[a](...arguments)}),s(e)}var lte={operator(e,t){const n=t.ast,i=e.functions;return r=>ml(n,i,r)},parameter(e,t){const n=t.ast,i=e.functions;return(r,o)=>ml(n,i,o,r)},event(e,t){const n=t.ast,i=e.functions;return r=>ml(n,i,void 0,void 0,r)},handler(e,t){const n=t.ast,i=e.functions;return(r,o)=>{const s=o.item&&o.item.datum;return ml(n,i,r,s,o)}},encode(e,t){const{marktype:n,channels:i}=t,r=e.functions,o=n==="group"||n==="image"||n==="rect";return(s,a)=>{const u=s.datum;let l=0,c;for(const f in i)c=ml(i[f].ast,r,a,u,void 0,s),s[f]!==c&&(s[f]=c,l=1);return n!=="rule"&&ete(s,i,o),l}}};const cte="5.21.0",fte={version:cte};function J2(e){return U(e,"or")}function Q2(e){return U(e,"and")}function Z2(e){return U(e,"not")}function Dd(e,t){if(Z2(e))Dd(e.not,t);else if(Q2(e))for(const n of e.and)Dd(n,t);else if(J2(e))for(const n of e.or)Dd(n,t);else t(e)}function Ua(e,t){return Z2(e)?{not:Ua(e.not,t)}:Q2(e)?{and:e.and.map(n=>Ua(n,t))}:J2(e)?{or:e.or.map(n=>Ua(n,t))}:t(e)}const le=structuredClone;function WN(e){throw new Error(e)}function cu(e,t){const n={};for(const i of t)J(e,i)&&(n[i]=e[i]);return n}function yn(e,t){const n={...e};for(const i of t)delete n[i];return n}Set.prototype.toJSON=function(){return`Set(${[...this].map(e=>Ne(e)).join(",")})`};function xe(e){if(Ae(e))return e;const t=K(e)?e:Ne(e);if(t.length<250)return t;let n=0;for(let i=0;i<t.length;i++){const r=t.charCodeAt(i);n=(n<<5)-n+r,n=n&n}return n}function Cy(e){return e===!1||e===null}function ve(e,t){return e.includes(t)}function fu(e,t){let n=0;for(const[i,r]of e.entries())if(t(r,i,n++))return!0;return!1}function ew(e,t){let n=0;for(const[i,r]of e.entries())if(!t(r,i,n++))return!1;return!0}function HN(e,...t){for(const n of t)dte(e,n??{});return e}function dte(e,t){for(const n of B(t))Fu(e,n,t[n],!0)}function Gi(e,t){const n=[],i={};let r;for(const o of e)r=t(o),!(r in i)&&(i[r]=1,n.push(o));return n}function hte(e,t){const n=B(e),i=B(t);if(n.length!==i.length)return!1;for(const r of n)if(e[r]!==t[r])return!1;return!0}function GN(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function tw(e,t){for(const n of e)if(t.has(n))return!0;return!1}function Fy(e){const t=new Set;for(const n of e){const r=ar(n).map((s,a)=>a===0?s:`[${s}]`),o=r.map((s,a)=>r.slice(0,a+1).join(""));for(const s of o)t.add(s)}return t}function nw(e,t){return e===void 0||t===void 0?!0:tw(Fy(e),Fy(t))}function Re(e){return B(e).length===0}const B=Object.keys,Ft=Object.values,Lo=Object.entries;function Ac(e){return e===!0||e===!1}function qe(e){const t=e.replace(/\W/g,"_");return(e.match(/^\d+/)?"_":"")+t}function tc(e,t){return Z2(e)?`!(${tc(e.not,t)})`:Q2(e)?`(${e.and.map(n=>tc(n,t)).join(") && (")})`:J2(e)?`(${e.or.map(n=>tc(n,t)).join(") || (")})`:t(e)}function qh(e,t){if(t.length===0)return!0;const n=t.shift();return n in e&&qh(e[n],t)&&delete e[n],Re(e)}function lf(e){return e.charAt(0).toUpperCase()+e.substr(1)}function iw(e,t="datum"){const n=ar(e),i=[];for(let r=1;r<=n.length;r++){const o=`[${n.slice(0,r).map(H).join("][")}]`;i.push(`${t}${o}`)}return i.join(" && ")}function VN(e,t="datum"){return`${t}[${H(ar(e).join("."))}]`}function gte(e){return e.replace(/(\[|\]|\.|'|")/g,"\\$1")}function ni(e){return`${ar(e).map(gte).join("\\.")}`}function qs(e,t,n){return e.replace(new RegExp(t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),"g"),n)}function ju(e){return`${ar(e).join(".")}`}function du(e){return e?ar(e).length:0}function et(...e){return e.find(t=>t!==void 0)}let YN=42;function XN(e){const t=++YN;return e?String(e)+t:t}function pte(){YN=42}function KN(e){return JN(e)?e:`__${e}`}function JN(e){return e.startsWith("__")}function $c(e){if(e!==void 0)return(e%360+360)%360}function xp(e){return Ae(e)?!0:!isNaN(e)&&!isNaN(parseFloat(e))}const o$=Object.getPrototypeOf(structuredClone({}));function Dn(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor.name!==t.constructor.name)return!1;let n,i;if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(i=n;i--!==0;)if(!Dn(e[i],t[i]))return!1;return!0}if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const o of e.entries())if(!t.has(o[0]))return!1;for(const o of e.entries())if(!Dn(o[1],t.get(o[0])))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const o of e.entries())if(!t.has(o[0]))return!1;return!0}if(ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if(n=e.length,n!=t.length)return!1;for(i=n;i--!==0;)if(e[i]!==t[i])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf&&e.valueOf!==o$.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString&&e.toString!==o$.toString)return e.toString()===t.toString();const r=Object.keys(e);if(n=r.length,n!==Object.keys(t).length)return!1;for(i=n;i--!==0;)if(!Object.prototype.hasOwnProperty.call(t,r[i]))return!1;for(i=n;i--!==0;){const o=r[i];if(!Dn(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function Ne(e){const t=[];return function n(i){if(i&&i.toJSON&&typeof i.toJSON=="function"&&(i=i.toJSON()),i===void 0)return;if(typeof i=="number")return isFinite(i)?""+i:"null";if(typeof i!="object")return JSON.stringify(i);let r,o;if(Array.isArray(i)){for(o="[",r=0;r<i.length;r++)r&&(o+=","),o+=n(i[r])||"null";return o+"]"}if(i===null)return"null";if(t.includes(i))throw new TypeError("Converting circular structure to JSON");const s=t.push(i)-1,a=Object.keys(i).sort();for(o="",r=0;r<a.length;r++){const u=a[r],l=n(i[u]);l&&(o&&(o+=","),o+=JSON.stringify(u)+":"+l)}return t.splice(s,1),`{${o}}`}(e)}function U(e,t){return Y(e)&&J(e,t)&&e[t]!==void 0}const Lr="row",Pr="column",wp="facet",We="x",vt="y",Ti="x2",hr="y2",Yo="xOffset",qu="yOffset",Mi="radius",Yr="radius2",oi="theta",Xr="theta2",Di="latitude",Oi="longitude",Ri="latitude2",ii="longitude2",En="color",gr="fill",pr="stroke",Sn="shape",Kr="size",sa="angle",Jr="opacity",Xo="fillOpacity",Ko="strokeOpacity",Jo="strokeWidth",Qo="strokeDash",cf="text",hu="order",ff="detail",Ep="key",Ws="tooltip",Sp="href",_p="url",Ap="description",mte={x:1,y:1,x2:1,y2:1},QN={theta:1,theta2:1,radius:1,radius2:1};function ZN(e){return J(QN,e)}const rw={longitude:1,longitude2:1,latitude:1,latitude2:1};function e3(e){switch(e){case Di:return"y";case Ri:return"y2";case Oi:return"x";case ii:return"x2"}}function t3(e){return J(rw,e)}const yte=B(rw),ow={...mte,...QN,...rw,xOffset:1,yOffset:1,color:1,fill:1,stroke:1,opacity:1,fillOpacity:1,strokeOpacity:1,strokeWidth:1,strokeDash:1,size:1,angle:1,shape:1,order:1,text:1,detail:1,key:1,tooltip:1,href:1,url:1,description:1};function ja(e){return e===En||e===gr||e===pr}const n3={row:1,column:1,facet:1},Xn=B(n3),sw={...ow,...n3},bte=B(sw),{order:nde,detail:ide,tooltip:rde,...vte}=sw,{row:ode,column:sde,facet:ade,...xte}=vte;function wte(e){return J(xte,e)}function i3(e){return J(sw,e)}const Ete=[Ti,hr,Ri,ii,Xr,Yr];function r3(e){return aa(e)!==e}function aa(e){switch(e){case Ti:return We;case hr:return vt;case Ri:return Di;case ii:return Oi;case Xr:return oi;case Yr:return Mi}return e}function Po(e){if(ZN(e))switch(e){case oi:return"startAngle";case Xr:return"endAngle";case Mi:return"outerRadius";case Yr:return"innerRadius"}return e}function mr(e){switch(e){case We:return Ti;case vt:return hr;case Di:return Ri;case Oi:return ii;case oi:return Xr;case Mi:return Yr}}function _n(e){switch(e){case We:case Ti:return"width";case vt:case hr:return"height"}}function o3(e){switch(e){case We:return"xOffset";case vt:return"yOffset";case Ti:return"x2Offset";case hr:return"y2Offset";case oi:return"thetaOffset";case Mi:return"radiusOffset";case Xr:return"theta2Offset";case Yr:return"radius2Offset"}}function aw(e){switch(e){case We:return"xOffset";case vt:return"yOffset"}}function Ste(e){switch(e){case"xOffset":return"x";case"yOffset":return"y"}}const _te=B(ow),{x:ude,y:lde,x2:cde,y2:fde,xOffset:dde,yOffset:hde,latitude:gde,longitude:pde,latitude2:mde,longitude2:yde,theta:bde,theta2:vde,radius:xde,radius2:wde,...uw}=ow,Ate=B(uw),lw={x:1,y:1},Qr=B(lw);function tt(e){return J(lw,e)}const cw={theta:1,radius:1},$te=B(cw);function $p(e){return e==="width"?We:vt}const s3={xOffset:1,yOffset:1};function df(e){return J(s3,e)}const{text:Ede,tooltip:Sde,href:_de,url:Ade,description:$de,detail:kde,key:Cde,order:Fde,...a3}=uw,kte=B(a3);function Cte(e){return J(uw,e)}function Fte(e){switch(e){case En:case gr:case pr:case Kr:case Sn:case Jr:case Jo:case Qo:return!0;case Xo:case Ko:case sa:return!1}}const u3={...lw,...cw,...s3,...a3},fw=B(u3);function yr(e){return J(u3,e)}function Tte(e,t){return Dte(e)[t]}const l3={arc:"always",area:"always",bar:"always",circle:"always",geoshape:"always",image:"always",line:"always",rule:"always",point:"always",rect:"always",square:"always",trail:"always",text:"always",tick:"always"},{geoshape:Tde,...Mte}=l3;function Dte(e){switch(e){case En:case gr:case pr:case Ap:case ff:case Ep:case Ws:case Sp:case hu:case Jr:case Xo:case Ko:case Jo:case wp:case Lr:case Pr:return l3;case We:case vt:case Yo:case qu:case Di:case Oi:return Mte;case Ti:case hr:case Ri:case ii:return{area:"always",bar:"always",image:"always",rect:"always",rule:"always",circle:"binned",point:"binned",square:"binned",tick:"binned",line:"binned",trail:"binned"};case Kr:return{point:"always",tick:"always",rule:"always",circle:"always",square:"always",bar:"always",text:"always",line:"always",trail:"always"};case Qo:return{line:"always",point:"always",tick:"always",rule:"always",circle:"always",square:"always",bar:"always",geoshape:"always"};case Sn:return{point:"always",geoshape:"always"};case cf:return{text:"always"};case sa:return{point:"always",square:"always",text:"always"};case _p:return{image:"always"};case oi:return{text:"always",arc:"always"};case Mi:return{text:"always",arc:"always"};case Xr:case Yr:return{arc:"always"}}}function y0(e){switch(e){case We:case vt:case oi:case Mi:case Yo:case qu:case Kr:case sa:case Jo:case Jr:case Xo:case Ko:case Ti:case hr:case Xr:case Yr:return;case wp:case Lr:case Pr:case Sn:case Qo:case cf:case Ws:case Sp:case _p:case Ap:return"discrete";case En:case gr:case pr:return"flexible";case Di:case Oi:case Ri:case ii:case ff:case Ep:case hu:return}}const Ote={argmax:1,argmin:1,average:1,count:1,distinct:1,exponential:1,exponentialb:1,product:1,max:1,mean:1,median:1,min:1,missing:1,q1:1,q3:1,ci0:1,ci1:1,stderr:1,stdev:1,stdevp:1,sum:1,valid:1,values:1,variance:1,variancep:1},Rte={count:1,min:1,max:1};function Wr(e){return U(e,"argmin")}function Zo(e){return U(e,"argmax")}function dw(e){return K(e)&&J(Ote,e)}const Nte=new Set(["count","valid","missing","distinct"]);function kp(e){return K(e)&&Nte.has(e)}function Lte(e){return K(e)&&ve(["min","max"],e)}const Pte=new Set(["count","sum","distinct","valid","missing"]),Ite=new Set(["mean","average","median","q1","q3","min","max"]);function c3(e){return Wo(e)&&(e=zp(e,void 0)),"bin"+B(e).map(t=>Cp(e[t])?qe(`_${t}_${Lo(e[t])}`):qe(`_${t}_${e[t]}`)).join("")}function ze(e){return e===!0||ua(e)&&!e.binned}function Et(e){return e==="binned"||ua(e)&&e.binned===!0}function ua(e){return Y(e)}function Cp(e){return U(e,"param")}function s$(e){switch(e){case Lr:case Pr:case Kr:case En:case gr:case pr:case Jo:case Jr:case Xo:case Ko:case Sn:return 6;case Qo:return 4;default:return 10}}function hf(e){return U(e,"expr")}function St(e,{level:t}={level:0}){const n=B(e||{}),i={};for(const r of n)i[r]=t===0?Tn(e[r]):St(e[r],{level:t-1});return i}function f3(e){const{anchor:t,frame:n,offset:i,orient:r,angle:o,limit:s,color:a,subtitleColor:u,subtitleFont:l,subtitleFontSize:c,subtitleFontStyle:f,subtitleFontWeight:d,subtitleLineHeight:h,subtitlePadding:g,...p}=e,m={...p,...a?{fill:a}:{}},y={...t?{anchor:t}:{},...n?{frame:n}:{},...i?{offset:i}:{},...r?{orient:r}:{},...o!==void 0?{angle:o}:{},...s!==void 0?{limit:s}:{}},b={...u?{subtitleColor:u}:{},...l?{subtitleFont:l}:{},...c?{subtitleFontSize:c}:{},...f?{subtitleFontStyle:f}:{},...d?{subtitleFontWeight:d}:{},...h?{subtitleLineHeight:h}:{},...g?{subtitlePadding:g}:{}},v=cu(e,["align","baseline","dx","dy","limit"]);return{titleMarkConfig:m,subtitleMarkConfig:v,nonMarkTitleProperties:y,subtitle:b}}function co(e){return K(e)||P(e)&&K(e[0])}function te(e){return U(e,"signal")}function la(e){return U(e,"step")}function zte(e){return P(e)?!1:U(e,"fields")&&!U(e,"data")}function Bte(e){return P(e)?!1:U(e,"fields")&&U(e,"data")}function Or(e){return P(e)?!1:U(e,"field")&&U(e,"data")}const Ute={aria:1,description:1,ariaRole:1,ariaRoleDescription:1,blend:1,opacity:1,fill:1,fillOpacity:1,stroke:1,strokeCap:1,strokeWidth:1,strokeOpacity:1,strokeDash:1,strokeDashOffset:1,strokeJoin:1,strokeOffset:1,strokeMiterLimit:1,startAngle:1,endAngle:1,padAngle:1,innerRadius:1,outerRadius:1,size:1,shape:1,interpolate:1,tension:1,orient:1,align:1,baseline:1,text:1,dir:1,dx:1,dy:1,ellipsis:1,limit:1,radius:1,theta:1,angle:1,font:1,fontSize:1,fontWeight:1,fontStyle:1,lineBreak:1,lineHeight:1,cursor:1,href:1,tooltip:1,cornerRadius:1,cornerRadiusTopLeft:1,cornerRadiusTopRight:1,cornerRadiusBottomLeft:1,cornerRadiusBottomRight:1,aspect:1,width:1,height:1,url:1,smooth:1},jte=B(Ute),qte={arc:1,area:1,group:1,image:1,line:1,path:1,rect:1,rule:1,shape:1,symbol:1,text:1,trail:1},Ty=["cornerRadius","cornerRadiusTopLeft","cornerRadiusTopRight","cornerRadiusBottomLeft","cornerRadiusBottomRight"];function d3(e){const t=P(e.condition)?e.condition.map(a$):a$(e.condition);return{...Tn(e),condition:t}}function Tn(e){if(hf(e)){const{expr:t,...n}=e;return{signal:t,...n}}return e}function a$(e){if(hf(e)){const{expr:t,...n}=e;return{signal:t,...n}}return e}function Ue(e){if(hf(e)){const{expr:t,...n}=e;return{signal:t,...n}}return te(e)?e:e!==void 0?{value:e}:void 0}function Wte(e){return te(e)?e.signal:H(e)}function u$(e){return te(e)?e.signal:H(e.value)}function mi(e){return te(e)?e.signal:e==null?null:H(e)}function Hte(e,t,n){for(const i of n){const r=rr(i,t.markDef,t.config);r!==void 0&&(e[i]=Ue(r))}return e}function h3(e){return[].concat(e.type,e.style??[])}function Oe(e,t,n,i={}){const{vgChannel:r,ignoreVgConfig:o}=i;return r&&U(t,r)?t[r]:t[e]!==void 0?t[e]:o&&(!r||r===e)?void 0:rr(e,t,n,i)}function rr(e,t,n,{vgChannel:i}={}){const r=My(e,t,n.style);return et(i?r:void 0,r,i?n[t.type][i]:void 0,n[t.type][e],i?n.mark[i]:n.mark[e])}function My(e,t,n){return g3(e,h3(t),n)}function g3(e,t,n){t=X(t);let i;for(const r of t){const o=n[r];U(o,e)&&(i=o[e])}return i}function p3(e,t){return X(e).reduce((n,i)=>(n.field.push(V(i,t)),n.order.push(i.sort??"ascending"),n),{field:[],order:[]})}function m3(e,t){const n=[...e];return t.forEach(i=>{for(const r of n)if(Dn(r,i))return;n.push(i)}),n}function y3(e,t){return Dn(e,t)||!t?e:e?[...X(e),...X(t)].join(", "):t}function b3(e,t){const n=e.value,i=t.value;if(n==null||i===null)return{explicit:e.explicit,value:null};if((co(n)||te(n))&&(co(i)||te(i)))return{explicit:e.explicit,value:y3(n,i)};if(co(n)||te(n))return{explicit:e.explicit,value:n};if(co(i)||te(i))return{explicit:e.explicit,value:i};if(!co(n)&&!te(n)&&!co(i)&&!te(i))return{explicit:e.explicit,value:m3(n,i)};throw new Error("It should never reach here")}function hw(e){return`Invalid specification ${Ne(e)}. Make sure the specification includes at least one of the following properties: "mark", "layer", "facet", "hconcat", "vconcat", "concat", or "repeat".`}const Gte='Autosize "fit" only works for single views and layered views.';function l$(e){return`${e=="width"?"Width":"Height"} "container" only works for single views and layered views.`}function c$(e){const t=e=="width"?"Width":"Height",n=e=="width"?"x":"y";return`${t} "container" only works well with autosize "fit" or "fit-${n}".`}function f$(e){return e?`Dropping "fit-${e}" because spec has discrete ${_n(e)}.`:'Dropping "fit" because spec has discrete size.'}function gw(e){return`Unknown field for ${e}. Cannot calculate view size.`}function d$(e){return`Cannot project a selection on encoding channel "${e}", which has no field.`}function Vte(e,t){return`Cannot project a selection on encoding channel "${e}" as it uses an aggregate function ("${t}").`}function Yte(e){return`The "nearest" transform is not supported for ${e} marks.`}function v3(e){return`Selection not supported for ${e} yet.`}function Xte(e){return`Cannot find a selection named "${e}".`}const Kte="Scale bindings are currently only supported for scales with unbinned, continuous domains.",Jte="Sequntial scales are deprecated. The available quantitative scale type values are linear, log, pow, sqrt, symlog, time and utc",Qte="Legend bindings are only supported for selections over an individual field or encoding channel.";function Zte(e){return`Lookups can only be performed on selection parameters. "${e}" is a variable parameter.`}function ene(e){return`Cannot define and lookup the "${e}" selection in the same view. Try moving the lookup into a second, layered view?`}const tne="The same selection must be used to override scale domains in a layered view.",nne='Interval selections should be initialized using "x", "y", "longitude", or "latitude" keys.';function ine(e){return`Unknown repeated value "${e}".`}function h$(e){return`The "columns" property cannot be used when "${e}" has nested row/column.`}const rne="Axes cannot be shared in concatenated or repeated views yet (https://github.com/vega/vega-lite/issues/2415).";function one(e){return`Unrecognized parse "${e}".`}function g$(e,t,n){return`An ancestor parsed field "${e}" as ${n} but a child wants to parse the field as ${t}.`}const sne="Attempt to add the same child twice.";function ane(e){return`Ignoring an invalid transform: ${Ne(e)}.`}const une='If "from.fields" is not specified, "as" has to be a string that specifies the key to be used for the data from the secondary source.';function p$(e){return`Config.customFormatTypes is not true, thus custom format type and format for channel ${e} are dropped.`}function lne(e){const{parentProjection:t,projection:n}=e;return`Layer's shared projection ${Ne(t)} is overridden by a child projection ${Ne(n)}.`}const cne="Arc marks uses theta channel rather than angle, replacing angle with theta.";function fne(e){return`${e}Offset dropped because ${e} is continuous`}function dne(e,t,n){return`Channel ${e} is a ${t}. Converted to {value: ${Ne(n)}}.`}function x3(e){return`Invalid field type "${e}".`}function hne(e,t){return`Invalid field type "${e}" for aggregate: "${t}", using "quantitative" instead.`}function gne(e){return`Invalid aggregation operator "${e}".`}function w3(e,t){const{fill:n,stroke:i}=t;return`Dropping color ${e} as the plot also has ${n&&i?"fill and stroke":n?"fill":"stroke"}.`}function pne(e){return`Position range does not support relative band size for ${e}.`}function Dy(e,t){return`Dropping ${Ne(e)} from channel "${t}" since it does not contain any data field, datum, value, or signal.`}const mne="Line marks cannot encode size with a non-groupby field. You may want to use trail marks instead.";function Fp(e,t,n){return`${e} dropped as it is incompatible with "${t}".`}function yne(e){return`${e}-encoding is dropped as ${e} is not a valid encoding channel.`}function bne(e){return`${e} encoding should be discrete (ordinal / nominal / binned).`}function vne(e){return`${e} encoding should be discrete (ordinal / nominal / binned) or use a discretizing scale (e.g. threshold).`}function xne(e){return`Facet encoding dropped as ${e.join(" and ")} ${e.length>1?"are":"is"} also specified.`}function b0(e,t){return`Using discrete channel "${e}" to encode "${t}" field can be misleading as it does not encode ${t==="ordinal"?"order":"magnitude"}.`}function wne(e){return`The ${e} for range marks cannot be an expression`}function Ene(e,t){return`Line mark is for continuous lines and thus cannot be used with ${e&&t?"x2 and y2":e?"x2":"y2"}. We will use the rule mark (line segments) instead.`}function Sne(e,t){return`Specified orient "${e}" overridden with "${t}".`}function _ne(e){return`Cannot use the scale property "${e}" with non-color channel.`}function Ane(e){return`Cannot use the relative band size with ${e} scale.`}function $ne(e){return`Using unaggregated domain with raw field has no effect (${Ne(e)}).`}function kne(e){return`Unaggregated domain not applicable for "${e}" since it produces values outside the origin domain of the source data.`}function Cne(e){return`Unaggregated domain is currently unsupported for log scale (${Ne(e)}).`}function Fne(e){return`Cannot apply size to non-oriented mark "${e}".`}function Tne(e,t,n){return`Channel "${e}" does not work with "${t}" scale. We are using "${n}" scale instead.`}function Mne(e,t){return`FieldDef does not work with "${e}" scale. We are using "${t}" scale instead.`}function E3(e,t,n){return`${n}-scale's "${t}" is dropped as it does not work with ${e} scale.`}function S3(e){return`The step for "${e}" is dropped because the ${e==="width"?"x":"y"} is continuous.`}function Dne(e,t,n,i){return`Conflicting ${t.toString()} property "${e.toString()}" (${Ne(n)} and ${Ne(i)}). Using ${Ne(n)}.`}function One(e,t,n,i){return`Conflicting ${t.toString()} property "${e.toString()}" (${Ne(n)} and ${Ne(i)}). Using the union of the two domains.`}function Rne(e){return`Setting the scale to be independent for "${e}" means we also have to set the guide (axis or legend) to be independent.`}function Nne(e){return`Dropping sort property ${Ne(e)} as unioned domains only support boolean or op "count", "min", and "max".`}const m$="Domains that should be unioned has conflicting sort properties. Sort will be set to true.",Lne="Detected faceted independent scales that union domain of multiple fields from different data sources. We will use the first field. The result view size may be incorrect.",Pne="Detected faceted independent scales that union domain of the same fields from different source. We will assume that this is the same field from a different fork of the same data source. However, if this is not the case, the result view size may be incorrect.",Ine="Detected faceted independent scales that union domain of multiple fields from the same data source. We will use the first field. The result view size may be incorrect.";function zne(e){return`Cannot stack "${e}" if there is already "${e}2".`}function Bne(e){return`Stack is applied to a non-linear scale (${e}).`}function Une(e){return`Stacking is applied even though the aggregate function is non-summative ("${e}").`}function Wh(e,t){return`Invalid ${e}: ${Ne(t)}.`}function jne(e){return`Dropping day from datetime ${Ne(e)} as day cannot be combined with other units.`}function qne(e,t){return`${t?"extent ":""}${t&&e?"and ":""}${e?"center ":""}${t&&e?"are ":"is "}not needed when data are aggregated.`}function Wne(e,t,n){return`${e} is not usually used with ${t} for ${n}.`}function Hne(e,t){return`Continuous axis should not have customized aggregation function ${e}; ${t} already agregates the axis.`}function y$(e){return`1D error band does not support ${e}.`}function _3(e){return`Channel ${e} is required for "binned" bin.`}function Gne(e){return`Channel ${e} should not be used with "binned" bin.`}function Vne(e){return`Domain for ${e} is required for threshold scale.`}const A3=pb(gb);let gu=A3;function Yne(e){return gu=e,gu}function Xne(){return gu=A3,gu}function j(...e){gu.warn(...e)}function Kne(...e){gu.debug(...e)}function ca(e){if(e&&Y(e)){for(const t of mw)if(U(e,t))return!0}return!1}const $3=["january","february","march","april","may","june","july","august","september","october","november","december"],Jne=$3.map(e=>e.substr(0,3)),k3=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"],Qne=k3.map(e=>e.substr(0,3));function Zne(e){if(xp(e)&&(e=+e),Ae(e))return e>4&&j(Wh("quarter",e)),e-1;throw new Error(Wh("quarter",e))}function eie(e){if(xp(e)&&(e=+e),Ae(e))return e-1;{const t=e.toLowerCase(),n=$3.indexOf(t);if(n!==-1)return n;const i=t.substr(0,3),r=Jne.indexOf(i);if(r!==-1)return r;throw new Error(Wh("month",e))}}function tie(e){if(xp(e)&&(e=+e),Ae(e))return e%7;{const t=e.toLowerCase(),n=k3.indexOf(t);if(n!==-1)return n;const i=t.substr(0,3),r=Qne.indexOf(i);if(r!==-1)return r;throw new Error(Wh("day",e))}}function pw(e,t){const n=[];if(t&&e.day!==void 0&&B(e).length>1&&(j(jne(e)),e=le(e),delete e.day),e.year!==void 0?n.push(e.year):n.push(2012),e.month!==void 0){const i=t?eie(e.month):e.month;n.push(i)}else if(e.quarter!==void 0){const i=t?Zne(e.quarter):e.quarter;n.push(Ae(i)?i*3:`${i}*3`)}else n.push(0);if(e.date!==void 0)n.push(e.date);else if(e.day!==void 0){const i=t?tie(e.day):e.day;n.push(Ae(i)?i+1:`${i}+1`)}else n.push(1);for(const i of["hours","minutes","seconds","milliseconds"]){const r=e[i];n.push(typeof r>"u"?0:r)}return n}function Hs(e){const n=pw(e,!0).join(", ");return e.utc?`utc(${n})`:`datetime(${n})`}function nie(e){const n=pw(e,!1).join(", ");return e.utc?`utc(${n})`:`datetime(${n})`}function iie(e){const t=pw(e,!0);return e.utc?+new Date(Date.UTC(...t)):+new Date(...t)}const C3={year:1,quarter:1,month:1,week:1,day:1,dayofyear:1,date:1,hours:1,minutes:1,seconds:1,milliseconds:1},mw=B(C3);function rie(e){return J(C3,e)}function fa(e){return Y(e)?e.binned:F3(e)}function F3(e){return e&&e.startsWith("binned")}function yw(e){return e.startsWith("utc")}function oie(e){return e.substring(3)}const sie={"year-month":"%b %Y ","year-month-date":"%b %d, %Y "};function Tp(e){return mw.filter(t=>M3(e,t))}function T3(e){const t=Tp(e);return t[t.length-1]}function M3(e,t){const n=e.indexOf(t);return!(n<0||n>0&&t==="seconds"&&e.charAt(n-1)==="i"||e.length>n+3&&t==="day"&&e.charAt(n+3)==="o"||n>0&&t==="year"&&e.charAt(n-1)==="f")}function aie(e,t,{end:n}={end:!1}){const i=iw(t),r=yw(e)?"utc":"";function o(u){return u==="quarter"?`(${r}quarter(${i})-1)`:`${r}${u}(${i})`}let s;const a={};for(const u of mw)M3(e,u)&&(a[u]=o(u),s=u);return n&&(a[s]+="+1"),nie(a)}function D3(e){if(!e)return;const t=Tp(e);return`timeUnitSpecifier(${Ne(t)}, ${Ne(sie)})`}function uie(e,t,n){if(!e)return;const i=D3(e);return`${n||yw(e)?"utc":"time"}Format(${t}, ${i})`}function mt(e){if(!e)return;let t;return K(e)?F3(e)?t={unit:e.substring(6),binned:!0}:t={unit:e}:Y(e)&&(t={...e,...e.unit?{unit:e.unit}:{}}),yw(t.unit)&&(t.utc=!0,t.unit=oie(t.unit)),t}function lie(e){const{utc:t,...n}=mt(e);return n.unit?(t?"utc":"")+B(n).map(i=>qe(`${i==="unit"?"":`_${i}_`}${n[i]}`)).join(""):(t?"utc":"")+"timeunit"+B(n).map(i=>qe(`_${i}_${n[i]}`)).join("")}function O3(e,t=n=>n){const n=mt(e),i=T3(n.unit);if(i&&i!=="day"){const r={year:2001,month:1,date:1,hours:0,minutes:0,seconds:0,milliseconds:0},{step:o,part:s}=R3(i,n.step),a={...r,[s]:+r[s]+o};return`${t(Hs(a))} - ${t(Hs(r))}`}}const cie={year:1,month:1,date:1,hours:1,minutes:1,seconds:1,milliseconds:1};function fie(e){return J(cie,e)}function R3(e,t=1){if(fie(e))return{part:e,step:t};switch(e){case"day":case"dayofyear":return{part:"date",step:t};case"quarter":return{part:"month",step:t*3};case"week":return{part:"date",step:t*7}}}function die(e){return U(e,"param")}function bw(e){return!!(e!=null&&e.field)&&e.equal!==void 0}function vw(e){return!!(e!=null&&e.field)&&e.lt!==void 0}function xw(e){return!!(e!=null&&e.field)&&e.lte!==void 0}function ww(e){return!!(e!=null&&e.field)&&e.gt!==void 0}function Ew(e){return!!(e!=null&&e.field)&&e.gte!==void 0}function Sw(e){if(e!=null&&e.field){if(P(e.range)&&e.range.length===2)return!0;if(te(e.range))return!0}return!1}function _w(e){return!!(e!=null&&e.field)&&(P(e.oneOf)||P(e.in))}function hie(e){return!!(e!=null&&e.field)&&e.valid!==void 0}function N3(e){return _w(e)||bw(e)||Sw(e)||vw(e)||ww(e)||xw(e)||Ew(e)}function Ii(e,t){return Bp(e,{timeUnit:t,wrapTime:!0})}function gie(e,t){return e.map(n=>Ii(n,t))}function L3(e,t=!0){const{field:n}=e,i=mt(e.timeUnit),{unit:r,binned:o}=i||{},s=V(e,{expr:"datum"}),a=r?`time(${o?s:aie(r,n)})`:s;if(bw(e))return`${a}===${Ii(e.equal,r)}`;if(vw(e)){const u=e.lt;return`${a}<${Ii(u,r)}`}else if(ww(e)){const u=e.gt;return`${a}>${Ii(u,r)}`}else if(xw(e)){const u=e.lte;return`${a}<=${Ii(u,r)}`}else if(Ew(e)){const u=e.gte;return`${a}>=${Ii(u,r)}`}else{if(_w(e))return`indexof([${gie(e.oneOf,r).join(",")}], ${a}) !== -1`;if(hie(e))return Mp(a,e.valid);if(Sw(e)){const{range:u}=St(e),l=te(u)?{signal:`${u.signal}[0]`}:u[0],c=te(u)?{signal:`${u.signal}[1]`}:u[1];if(l!==null&&c!==null&&t)return"inrange("+a+", ["+Ii(l,r)+", "+Ii(c,r)+"])";const f=[];return l!==null&&f.push(`${a} >= ${Ii(l,r)}`),c!==null&&f.push(`${a} <= ${Ii(c,r)}`),f.length>0?f.join(" && "):"true"}}throw new Error(`Invalid field predicate: ${Ne(e)}`)}function Mp(e,t=!0){return t?`isValid(${e}) && isFinite(+${e})`:`!isValid(${e}) || !isFinite(+${e})`}function pie(e){return N3(e)&&e.timeUnit?{...e,timeUnit:mt(e.timeUnit)}:e}const gf={quantitative:"quantitative",ordinal:"ordinal",temporal:"temporal",nominal:"nominal",geojson:"geojson"};function mie(e){return e==="quantitative"||e==="temporal"}function P3(e){return e==="ordinal"||e==="nominal"}const Gs=gf.quantitative,Aw=gf.ordinal,pu=gf.temporal,$w=gf.nominal,Wu=gf.geojson;function yie(e){if(e)switch(e=e.toLowerCase(),e){case"q":case Gs:return"quantitative";case"t":case pu:return"temporal";case"o":case Aw:return"ordinal";case"n":case $w:return"nominal";case Wu:return"geojson"}}const _t={LINEAR:"linear",LOG:"log",POW:"pow",SQRT:"sqrt",TIME:"time",UTC:"utc",POINT:"point",BAND:"band"},Oy={linear:"numeric",log:"numeric",pow:"numeric",sqrt:"numeric",symlog:"numeric",identity:"numeric",sequential:"numeric",time:"time",utc:"time",ordinal:"ordinal","bin-ordinal":"bin-ordinal",point:"ordinal-position",band:"ordinal-position",quantile:"discretizing",quantize:"discretizing",threshold:"discretizing"};function bie(e,t){const n=Oy[e],i=Oy[t];return n===i||n==="ordinal-position"&&i==="time"||i==="ordinal-position"&&n==="time"}const vie={linear:0,log:1,pow:1,sqrt:1,symlog:1,identity:1,sequential:1,time:0,utc:0,point:10,band:11,ordinal:0,"bin-ordinal":0,quantile:0,quantize:0,threshold:0};function b$(e){return vie[e]}const I3=new Set(["linear","log","pow","sqrt","symlog"]),z3=new Set([...I3,"time","utc"]);function B3(e){return I3.has(e)}const U3=new Set(["quantile","quantize","threshold"]),xie=new Set([...z3,...U3,"sequential","identity"]),wie=new Set(["ordinal","bin-ordinal","point","band"]);function yt(e){return wie.has(e)}function Si(e){return xie.has(e)}function Vi(e){return z3.has(e)}function mu(e){return U3.has(e)}const Eie={pointPadding:.5,barBandPaddingInner:.1,rectBandPaddingInner:0,tickBandPaddingInner:.25,bandWithNestedOffsetPaddingInner:.2,bandWithNestedOffsetPaddingOuter:.2,minBandSize:2,minFontSize:8,maxFontSize:40,minOpacity:.3,maxOpacity:.8,minSize:4,minStrokeWidth:1,maxStrokeWidth:4,quantileCount:4,quantizeCount:4,zero:!0};function Sie(e){return!K(e)&&U(e,"name")}function j3(e){return U(e,"param")}function _ie(e){return U(e,"unionWith")}function Aie(e){return Y(e)&&"field"in e}const $ie={type:1,domain:1,domainMax:1,domainMin:1,domainMid:1,domainRaw:1,align:1,range:1,rangeMax:1,rangeMin:1,scheme:1,bins:1,reverse:1,round:1,clamp:1,nice:1,base:1,exponent:1,constant:1,interpolate:1,zero:1,padding:1,paddingInner:1,paddingOuter:1},{type:Mde,domain:Dde,range:Ode,rangeMax:Rde,rangeMin:Nde,scheme:Lde,...kie}=$ie,Cie=B(kie);function Ry(e,t){switch(t){case"type":case"domain":case"reverse":case"range":return!0;case"scheme":case"interpolate":return!["point","band","identity"].includes(e);case"bins":return!["point","band","identity","ordinal"].includes(e);case"round":return Vi(e)||e==="band"||e==="point";case"padding":case"rangeMin":case"rangeMax":return Vi(e)||["point","band"].includes(e);case"paddingOuter":case"align":return["point","band"].includes(e);case"paddingInner":return e==="band";case"domainMax":case"domainMid":case"domainMin":case"domainRaw":case"clamp":return Vi(e);case"nice":return Vi(e)||e==="quantize"||e==="threshold";case"exponent":return e==="pow";case"base":return e==="log";case"constant":return e==="symlog";case"zero":return Si(e)&&!ve(["log","time","utc","threshold","quantile"],e)}}function q3(e,t){switch(t){case"interpolate":case"scheme":case"domainMid":return ja(e)?void 0:_ne(t);case"align":case"type":case"bins":case"domain":case"domainMax":case"domainMin":case"domainRaw":case"range":case"base":case"exponent":case"constant":case"nice":case"padding":case"paddingInner":case"paddingOuter":case"rangeMax":case"rangeMin":case"reverse":case"round":case"clamp":case"zero":return}}function Fie(e,t){return ve([Aw,$w],t)?e===void 0||yt(e):t===pu?ve([_t.TIME,_t.UTC,void 0],e):t===Gs?B3(e)||mu(e)||e===void 0:!0}function Tie(e,t,n=!1){if(!yr(e))return!1;switch(e){case We:case vt:case Yo:case qu:case oi:case Mi:return Vi(t)||t==="band"?!0:t==="point"?!n:!1;case Kr:case Jo:case Jr:case Xo:case Ko:case sa:return Vi(t)||mu(t)||ve(["band","point","ordinal"],t);case En:case gr:case pr:return t!=="band";case Qo:case Sn:return t==="ordinal"||mu(t)}}function Mie(e){return Y(e)&&"value"in e}const dn={arc:"arc",area:"area",bar:"bar",image:"image",line:"line",point:"point",rect:"rect",rule:"rule",text:"text",tick:"tick",trail:"trail",circle:"circle",square:"square",geoshape:"geoshape"},W3=dn.arc,Dp=dn.area,Op=dn.bar,Die=dn.image,Rp=dn.line,Np=dn.point,Oie=dn.rect,Hh=dn.rule,H3=dn.text,kw=dn.tick,Rie=dn.trail,Cw=dn.circle,Fw=dn.square,G3=dn.geoshape;function es(e){return["line","area","trail"].includes(e)}function kc(e){return["rect","bar","image","arc","tick"].includes(e)}const Nie=new Set(B(dn));function or(e){return U(e,"type")}const Lie=["stroke","strokeWidth","strokeDash","strokeDashOffset","strokeOpacity","strokeJoin","strokeMiterLimit"],Pie=["fill","fillOpacity"],Iie=[...Lie,...Pie],zie={color:1,filled:1,invalid:1,order:1,radius2:1,theta2:1,timeUnitBandSize:1,timeUnitBandPosition:1},v$=B(zie),v0=["binSpacing","continuousBandSize","discreteBandSize","minBandSize"],Bie={area:["line","point"],bar:v0,rect:v0,line:["point"],tick:["bandSize","thickness",...v0]},Uie={color:"#4c78a8",invalid:"break-paths-show-path-domains",timeUnitBandSize:1},jie={mark:1,arc:1,area:1,bar:1,circle:1,image:1,line:1,point:1,rect:1,rule:1,square:1,text:1,tick:1,trail:1,geoshape:1},V3=B(jie);function Vs(e){return U(e,"band")}const qie={horizontal:["cornerRadiusTopRight","cornerRadiusBottomRight"],vertical:["cornerRadiusTopLeft","cornerRadiusTopRight"]},Wie=5,Tw={binSpacing:0,continuousBandSize:Wie,minBandSize:.25,timeUnitBandPosition:.5},Hie={...Tw,binSpacing:1},Gie={...Tw,thickness:1};function Vie(e){return or(e)?e.type:e}function Y3(e,{isPath:t}){return e===void 0||e==="break-paths-show-path-domains"?t?"break-paths-show-domains":"filter":e===null?"show":e}function Mw({markDef:e,config:t,scaleChannel:n,scaleType:i,isCountAggregate:r}){var a,u;if(!i||!Si(i)||r)return"always-valid";const o=Y3(Oe("invalid",e,t),{isPath:es(e.type)});return((u=(a=t.scale)==null?void 0:a.invalid)==null?void 0:u[n])!==void 0?"show":o}function Yie(e){return e==="break-paths-filter-domains"||e==="break-paths-show-domains"}function X3({scaleName:e,scale:t,mode:n}){const i=`domain('${e}')`;if(!t||!e)return;const r=`${i}[0]`,o=`peek(${i})`,s=t.domainHasZero();return s==="definitely"?{scale:e,value:0}:s==="maybe"?{signal:`scale('${e}', inrange(0, ${i}) ? 0 : ${n==="zeroOrMin"?r:o})`}:{signal:`scale('${e}', ${n==="zeroOrMin"?r:o})`}}function K3({scaleChannel:e,channelDef:t,scale:n,scaleName:i,markDef:r,config:o}){var c;const s=n==null?void 0:n.get("type"),a=Ai(t),u=kp(a==null?void 0:a.aggregate),l=Mw({scaleChannel:e,markDef:r,config:o,scaleType:s,isCountAggregate:u});if(a&&l==="show"){const f=((c=o.scale.invalid)==null?void 0:c[e])??"zero-or-min";return{test:Mp(V(a,{expr:"datum"}),!1),...Xie(f,n,i)}}}function Xie(e,t,n){if(Mie(e)){const{value:i}=e;return te(i)?{signal:i.signal}:{value:i}}return X3({scale:t,scaleName:n,mode:"zeroOrMin"})}function Dw(e){const{channel:t,channelDef:n,markDef:i,scale:r,scaleName:o,config:s}=e,a=aa(t),u=Ow(e),l=K3({scaleChannel:a,channelDef:n,scale:r,scaleName:o,markDef:i,config:s});return l!==void 0?[l,u]:u}function Kie(e){const{datum:t}=e;return ca(t)?Hs(t):`${Ne(t)}`}function Cs(e,t,n,i){const r={};if(t&&(r.scale=t),br(e)){const{datum:o}=e;ca(o)?r.signal=Hs(o):te(o)?r.signal=o.signal:hf(o)?r.signal=o.expr:r.value=o}else r.field=V(e,n);if(i){const{offset:o,band:s}=i;o&&(r.offset=o),s&&(r.band=s)}return r}function Gh({scaleName:e,fieldOrDatumDef:t,fieldOrDatumDef2:n,offset:i,startSuffix:r,endSuffix:o="end",bandPosition:s=.5}){const a=!te(s)&&0<s&&s<1?"datum":void 0,u=V(t,{expr:a,suffix:r}),l=n!==void 0?V(n,{expr:a}):V(t,{suffix:o,expr:a}),c={};if(s===0||s===1){c.scale=e;const f=s===0?u:l;c.field=f}else{const f=te(s)?`(1-${s.signal}) * ${u} + ${s.signal} * ${l}`:`${1-s} * ${u} + ${s} * ${l}`;c.signal=`scale("${e}", ${f})`}return i&&(c.offset=i),c}function Jie({scaleName:e,fieldDef:t}){const n=V(t,{expr:"datum"}),i=V(t,{expr:"datum",suffix:"end"});return`abs(scale("${e}", ${i}) - scale("${e}", ${n}))`}function Ow({channel:e,channelDef:t,channel2Def:n,markDef:i,config:r,scaleName:o,scale:s,stack:a,offset:u,defaultRef:l,bandPosition:c}){if(t){if(ce(t)){const f=s==null?void 0:s.get("type");if(cn(t)){c??(c=Io({fieldDef:t,fieldDef2:n,markDef:i,config:r}));const{bin:d,timeUnit:h,type:g}=t;if(ze(d)||c&&h&&g===pu)return a!=null&&a.impute?Cs(t,o,{binSuffix:"mid"},{offset:u}):c&&!yt(f)?Gh({scaleName:o,fieldOrDatumDef:t,bandPosition:c,offset:u}):Cs(t,o,vf(t,e)?{binSuffix:"range"}:{},{offset:u});if(Et(d)){if(q(n))return Gh({scaleName:o,fieldOrDatumDef:t,fieldOrDatumDef2:n,bandPosition:c,offset:u});j(_3(e===We?Ti:hr))}}return Cs(t,o,yt(f)?{binSuffix:"range"}:{},{offset:u,band:f==="band"?c??t.bandPosition??.5:void 0})}else if(_i(t)){const f=t.value,d=u?{offset:u}:{};return{...nc(e,f),...d}}}return ge(l)&&(l=l()),l&&{...l,...u?{offset:u}:{}}}function nc(e,t){return ve(["x","x2"],e)&&t==="width"?{field:{group:"width"}}:ve(["y","y2"],e)&&t==="height"?{field:{group:"height"}}:Ue(t)}function Ys(e){return e&&e!=="number"&&e!=="time"}function J3(e,t,n){return`${e}(${t}${n?`, ${Ne(n)}`:""})`}const Qie=" – ";function Rw({fieldOrDatumDef:e,format:t,formatType:n,expr:i,normalizeStack:r,config:o}){var u,l;if(Ys(n))return yi({fieldOrDatumDef:e,format:t,formatType:n,expr:i,config:o});const s=Q3(e,i,r),a=yu(e);if(t===void 0&&n===void 0&&o.customFormatTypes){if(a==="quantitative"){if(r&&o.normalizedNumberFormatType)return yi({fieldOrDatumDef:e,format:o.normalizedNumberFormat,formatType:o.normalizedNumberFormatType,expr:i,config:o});if(o.numberFormatType)return yi({fieldOrDatumDef:e,format:o.numberFormat,formatType:o.numberFormatType,expr:i,config:o})}if(a==="temporal"&&o.timeFormatType&&q(e)&&e.timeUnit===void 0)return yi({fieldOrDatumDef:e,format:o.timeFormat,formatType:o.timeFormatType,expr:i,config:o})}if(vu(e)){const c=ere({field:s,timeUnit:q(e)?(u=mt(e.timeUnit))==null?void 0:u.unit:void 0,format:t,formatType:o.timeFormatType,rawTimeFormat:o.timeFormat,isUTCScale:da(e)&&((l=e.scale)==null?void 0:l.type)===_t.UTC});return c?{signal:c}:void 0}if(t=Ny({type:a,specifiedFormat:t,config:o,normalizeStack:r}),q(e)&&ze(e.bin)){const c=V(e,{expr:i,binSuffix:"end"});return{signal:pf(s,c,t,n,o)}}else return t||yu(e)==="quantitative"?{signal:`${t5(s,t)}`}:{signal:`isValid(${s}) ? ${s} : ""+${s}`}}function Q3(e,t,n){return q(e)?n?`${V(e,{expr:t,suffix:"end"})}-${V(e,{expr:t,suffix:"start"})}`:V(e,{expr:t}):Kie(e)}function yi({fieldOrDatumDef:e,format:t,formatType:n,expr:i,normalizeStack:r,config:o,field:s}){if(s??(s=Q3(e,i,r)),s!=="datum.value"&&q(e)&&ze(e.bin)){const a=V(e,{expr:i,binSuffix:"end"});return{signal:pf(s,a,t,n,o)}}return{signal:J3(n,s,t)}}function Z3(e,t,n,i,r,o){var s;if(!(K(i)&&Ys(i))&&!(n===void 0&&i===void 0&&r.customFormatTypes&&yu(e)==="quantitative"&&(r.normalizedNumberFormatType&&bu(e)&&e.stack==="normalize"||r.numberFormatType))){if(bu(e)&&e.stack==="normalize"&&r.normalizedNumberFormat)return Ny({type:"quantitative",config:r,normalizeStack:!0});if(vu(e)){const a=q(e)?(s=mt(e.timeUnit))==null?void 0:s.unit:void 0;return a===void 0&&r.customFormatTypes&&r.timeFormatType?void 0:Zie({specifiedFormat:n,timeUnit:a,config:r,omitTimeFormatConfig:o})}return Ny({type:t,specifiedFormat:n,config:r})}}function e5(e,t,n){var i;if(e&&(te(e)||e==="number"||e==="time"))return e;if(vu(t)&&n!=="time"&&n!=="utc")return q(t)&&((i=mt(t==null?void 0:t.timeUnit))!=null&&i.utc)?"utc":"time"}function Ny({type:e,specifiedFormat:t,config:n,normalizeStack:i}){if(K(t))return t;if(e===Gs)return i?n.normalizedNumberFormat:n.numberFormat}function Zie({specifiedFormat:e,timeUnit:t,config:n,omitTimeFormatConfig:i}){return e||(t?{signal:D3(t)}:i?void 0:n.timeFormat)}function t5(e,t){return`format(${e}, "${t||""}")`}function x$(e,t,n,i){return Ys(n)?J3(n,e,t):t5(e,(K(t)?t:void 0)??i.numberFormat)}function pf(e,t,n,i,r){if(n===void 0&&i===void 0&&r.customFormatTypes&&r.numberFormatType)return pf(e,t,r.numberFormat,r.numberFormatType,r);const o=x$(e,n,i,r),s=x$(t,n,i,r);return`${Mp(e,!1)} ? "null" : ${o} + "${Qie}" + ${s}`}function ere({field:e,timeUnit:t,format:n,formatType:i,rawTimeFormat:r,isUTCScale:o}){return!t||n?!t&&i?`${i}(${e}, '${n}')`:(n=K(n)?n:r,`${o?"utc":"time"}Format(${e}, '${n}')`):uie(t,e,o)}const Lp="min",tre={x:1,y:1,color:1,fill:1,stroke:1,strokeWidth:1,size:1,shape:1,fillOpacity:1,strokeOpacity:1,opacity:1,text:1};function w$(e){return J(tre,e)}function nre(e){return U(e,"encoding")}function Ir(e){return e&&(e.op==="count"||U(e,"field"))}function n5(e){return e&&P(e)}function mf(e){return U(e,"row")||U(e,"column")}function Nw(e){return U(e,"header")}function Pp(e){return U(e,"facet")}function ire(e){return U(e,"param")}function rre(e){return!K(e)&&U(e,"repeat")}function E$(e){const{field:t,timeUnit:n,bin:i,aggregate:r}=e;return{...n?{timeUnit:n}:{},...i?{bin:i}:{},...r?{aggregate:r}:{},field:t}}function Lw(e){return U(e,"sort")}function Io({fieldDef:e,fieldDef2:t,markDef:n,config:i}){if(ce(e)&&e.bandPosition!==void 0)return e.bandPosition;if(q(e)){const{timeUnit:r,bin:o}=e;if(r&&!t)return rr("timeUnitBandPosition",n,i);if(ze(o))return .5}}function i5({channel:e,fieldDef:t,fieldDef2:n,markDef:i,config:r,scaleType:o,useVlSizeChannel:s}){var l,c,f;const a=_n(e),u=Oe(s?"size":a,i,r,{vgChannel:a});if(u!==void 0)return u;if(q(t)){const{timeUnit:d,bin:h}=t;if(d&&!n)return{band:rr("timeUnitBandSize",i,r)};if(ze(h)&&!yt(o))return{band:1}}if(kc(i.type))return o?yt(o)?((l=r[i.type])==null?void 0:l.discreteBandSize)||{band:1}:(c=r[i.type])==null?void 0:c.continuousBandSize:(f=r[i.type])==null?void 0:f.discreteBandSize}function r5(e,t,n,i){return ze(e.bin)||e.timeUnit&&cn(e)&&e.type==="temporal"?Io({fieldDef:e,fieldDef2:t,markDef:n,config:i})!==void 0:!1}function o5(e){return U(e,"sort")&&!U(e,"field")}function yf(e){return U(e,"condition")}function Ip(e){const t=e==null?void 0:e.condition;return!!t&&!P(t)&&q(t)}function bf(e){const t=e==null?void 0:e.condition;return!!t&&!P(t)&&ce(t)}function ore(e){const t=e==null?void 0:e.condition;return!!t&&(P(t)||_i(t))}function q(e){return U(e,"field")||(e==null?void 0:e.aggregate)==="count"}function yu(e){return e==null?void 0:e.type}function br(e){return U(e,"datum")}function Eo(e){return cn(e)&&!Yh(e)||Vh(e)}function S$(e){return cn(e)&&e.type==="quantitative"&&!e.bin||Vh(e)}function Vh(e){return br(e)&&Ae(e.datum)}function ce(e){return q(e)||br(e)}function cn(e){return e&&(U(e,"field")||e.aggregate==="count")&&U(e,"type")}function _i(e){return U(e,"value")}function da(e){return U(e,"scale")||U(e,"sort")}function bu(e){return U(e,"axis")||U(e,"stack")||U(e,"impute")}function s5(e){return U(e,"legend")}function a5(e){return U(e,"format")||U(e,"formatType")}function sre(e){return yn(e,["legend","axis","header","scale"])}function are(e){return U(e,"op")}function V(e,t={}){let n=e.field;const i=t.prefix;let r=t.suffix,o="";if(lre(e))n=KN("count");else{let s;if(!t.nofn)if(are(e))s=e.op;else{const{bin:a,aggregate:u,timeUnit:l}=e;ze(a)?(s=c3(a),r=(t.binSuffix??"")+(t.suffix??"")):u?Zo(u)?(o=`["${n}"]`,n=`argmax_${u.argmax}`):Wr(u)?(o=`["${n}"]`,n=`argmin_${u.argmin}`):s=String(u):l&&!fa(l)&&(s=lie(l),r=(!["range","mid"].includes(t.binSuffix)&&t.binSuffix||"")+(t.suffix??""))}s&&(n=n?`${s}_${n}`:s)}return r&&(n=`${n}_${r}`),i&&(n=`${i}_${n}`),t.forAs?ju(n):t.expr?VN(n,t.expr)+o:ni(n)+o}function Yh(e){switch(e.type){case"nominal":case"ordinal":case"geojson":return!0;case"quantitative":return q(e)&&!!e.bin;case"temporal":return!1}throw new Error(x3(e.type))}function ure(e){var t;return da(e)&&mu((t=e.scale)==null?void 0:t.type)}function lre(e){return e.aggregate==="count"}function cre(e,t){var s;const{field:n,bin:i,timeUnit:r,aggregate:o}=e;if(o==="count")return t.countTitle;if(ze(i))return`${n} (binned)`;if(r&&!fa(r)){const a=(s=mt(r))==null?void 0:s.unit;if(a)return`${n} (${Tp(a).join("-")})`}else if(o)return Zo(o)?`${n} for max ${o.argmax}`:Wr(o)?`${n} for min ${o.argmin}`:`${lf(o)} of ${n}`;return n}function fre(e){const{aggregate:t,bin:n,timeUnit:i,field:r}=e;if(Zo(t))return`${r} for argmax(${t.argmax})`;if(Wr(t))return`${r} for argmin(${t.argmin})`;const o=i&&!fa(i)?mt(i):void 0,s=t||(o==null?void 0:o.unit)||(o==null?void 0:o.maxbins)&&"timeunit"||ze(n)&&"bin";return s?`${s.toUpperCase()}(${r})`:r}const u5=(e,t)=>{switch(t.fieldTitle){case"plain":return e.field;case"functional":return fre(e);default:return cre(e,t)}};let l5=u5;function c5(e){l5=e}function dre(){c5(u5)}function qa(e,t,{allowDisabling:n,includeDefault:i=!0}){var a;const r=(a=Pw(e))==null?void 0:a.title;if(!q(e))return r??e.title;const o=e,s=i?Iw(o,t):void 0;return n?et(r,o.title,s):r??o.title??s}function Pw(e){if(bu(e)&&e.axis)return e.axis;if(s5(e)&&e.legend)return e.legend;if(Nw(e)&&e.header)return e.header}function Iw(e,t){return l5(e,t)}function Xh(e){if(a5(e)){const{format:t,formatType:n}=e;return{format:t,formatType:n}}else{const t=Pw(e)??{},{format:n,formatType:i}=t;return{format:n,formatType:i}}}function hre(e,t){var o;switch(t){case"latitude":case"longitude":return"quantitative";case"row":case"column":case"facet":case"shape":case"strokeDash":return"nominal";case"order":return"ordinal"}if(Lw(e)&&P(e.sort))return"ordinal";const{aggregate:n,bin:i,timeUnit:r}=e;if(r)return"temporal";if(i||n&&!Zo(n)&&!Wr(n))return"quantitative";if(da(e)&&((o=e.scale)!=null&&o.type))switch(Oy[e.scale.type]){case"numeric":case"discretizing":return"quantitative";case"time":return"temporal"}return"nominal"}function Ai(e){if(q(e))return e;if(Ip(e))return e.condition}function at(e){if(ce(e))return e;if(bf(e))return e.condition}function f5(e,t,n,i={}){if(K(e)||Ae(e)||Wo(e)){const r=K(e)?"string":Ae(e)?"number":"boolean";return j(dne(t,r,e)),{value:e}}return ce(e)?Kh(e,t,n,i):bf(e)?{...e,condition:Kh(e.condition,t,n,i)}:e}function Kh(e,t,n,i){if(a5(e)){const{format:r,formatType:o,...s}=e;if(Ys(o)&&!n.customFormatTypes)return j(p$(t)),Kh(s,t,n,i)}else{const r=bu(e)?"axis":s5(e)?"legend":Nw(e)?"header":null;if(r&&e[r]){const{format:o,formatType:s,...a}=e[r];if(Ys(s)&&!n.customFormatTypes)return j(p$(t)),Kh({...e,[r]:a},t,n,i)}}return q(e)?zw(e,t,i):gre(e)}function gre(e){let t=e.type;if(t)return e;const{datum:n}=e;return t=Ae(n)?"quantitative":K(n)?"nominal":ca(n)?"temporal":void 0,{...e,type:t}}function zw(e,t,{compositeMark:n=!1}={}){const{aggregate:i,timeUnit:r,bin:o,field:s}=e,a={...e};if(!n&&i&&!dw(i)&&!Zo(i)&&!Wr(i)&&(j(gne(i)),delete a.aggregate),r&&(a.timeUnit=mt(r)),s&&(a.field=`${s}`),ze(o)&&(a.bin=zp(o,t)),Et(o)&&!tt(t)&&j(Gne(t)),cn(a)){const{type:u}=a,l=yie(u);u!==l&&(a.type=l),u!=="quantitative"&&kp(i)&&(j(hne(u,i)),a.type="quantitative")}else if(!r3(t)){const u=hre(a,t);a.type=u}if(cn(a)){const{compatible:u,warning:l}=pre(a,t)||{};u===!1&&j(l)}if(Lw(a)&&K(a.sort)){const{sort:u}=a;if(w$(u))return{...a,sort:{encoding:u}};const l=u.substring(1);if(u.charAt(0)==="-"&&w$(l))return{...a,sort:{encoding:l,order:"descending"}}}if(Nw(a)){const{header:u}=a;if(u){const{orient:l,...c}=u;if(l)return{...a,header:{...c,labelOrient:u.labelOrient||l,titleOrient:u.titleOrient||l}}}}return a}function zp(e,t){return Wo(e)?{maxbins:s$(t)}:e==="binned"?{binned:!0}:!e.maxbins&&!e.step?{...e,maxbins:s$(t)}:e}const Aa={compatible:!0};function pre(e,t){const n=e.type;if(n==="geojson"&&t!=="shape")return{compatible:!1,warning:`Channel ${t} should not be used with a geojson data.`};switch(t){case Lr:case Pr:case wp:return Yh(e)?Aa:{compatible:!1,warning:bne(t)};case We:case vt:case Yo:case qu:case En:case gr:case pr:case cf:case ff:case Ep:case Ws:case Sp:case _p:case sa:case oi:case Mi:case Ap:return Aa;case Oi:case ii:case Di:case Ri:return n!==Gs?{compatible:!1,warning:`Channel ${t} should be used with a quantitative field only, not ${e.type} field.`}:Aa;case Jr:case Xo:case Ko:case Jo:case Kr:case Xr:case Yr:case Ti:case hr:return n==="nominal"&&!e.sort?{compatible:!1,warning:`Channel ${t} should not be used with an unsorted discrete field.`}:Aa;case Sn:case Qo:return!Yh(e)&&!ure(e)?{compatible:!1,warning:vne(t)}:Aa;case hu:return e.type==="nominal"&&!("sort"in e)?{compatible:!1,warning:"Channel order is inappropriate for nominal field, which has no inherent order."}:Aa}}function vu(e){const{formatType:t}=Xh(e);return t==="time"||!t&&mre(e)}function mre(e){return e&&(e.type==="temporal"||q(e)&&!!e.timeUnit)}function Bp(e,{timeUnit:t,type:n,wrapTime:i,undefinedIfExprNotRequired:r}){var u;const o=t&&((u=mt(t))==null?void 0:u.unit);let s=o||n==="temporal",a;return hf(e)?a=e.expr:te(e)?a=e.signal:ca(e)?(s=!0,a=Hs(e)):(K(e)||Ae(e))&&s&&(a=`datetime(${Ne(e)})`,rie(o)&&(Ae(e)&&e<1e4||K(e)&&isNaN(Date.parse(e)))&&(a=Hs({[o]:e}))),a?i&&s?`time(${a})`:a:r?void 0:Ne(e)}function d5(e,t){const{type:n}=e;return t.map(i=>{const r=q(e)&&!fa(e.timeUnit)?e.timeUnit:void 0,o=Bp(i,{timeUnit:r,type:n,undefinedIfExprNotRequired:!0});return o!==void 0?{signal:o}:i})}function vf(e,t){return ze(e.bin)?yr(t)&&["ordinal","nominal"].includes(e.type):(console.warn("Only call this method for binned field defs."),!1)}const _$={labelAlign:{part:"labels",vgProp:"align"},labelBaseline:{part:"labels",vgProp:"baseline"},labelColor:{part:"labels",vgProp:"fill"},labelFont:{part:"labels",vgProp:"font"},labelFontSize:{part:"labels",vgProp:"fontSize"},labelFontStyle:{part:"labels",vgProp:"fontStyle"},labelFontWeight:{part:"labels",vgProp:"fontWeight"},labelOpacity:{part:"labels",vgProp:"opacity"},labelOffset:null,labelPadding:null,gridColor:{part:"grid",vgProp:"stroke"},gridDash:{part:"grid",vgProp:"strokeDash"},gridDashOffset:{part:"grid",vgProp:"strokeDashOffset"},gridOpacity:{part:"grid",vgProp:"opacity"},gridWidth:{part:"grid",vgProp:"strokeWidth"},tickColor:{part:"ticks",vgProp:"stroke"},tickDash:{part:"ticks",vgProp:"strokeDash"},tickDashOffset:{part:"ticks",vgProp:"strokeDashOffset"},tickOpacity:{part:"ticks",vgProp:"opacity"},tickSize:null,tickWidth:{part:"ticks",vgProp:"strokeWidth"}};function xf(e){return e==null?void 0:e.condition}const h5=["domain","grid","labels","ticks","title"],yre={grid:"grid",gridCap:"grid",gridColor:"grid",gridDash:"grid",gridDashOffset:"grid",gridOpacity:"grid",gridScale:"grid",gridWidth:"grid",orient:"main",bandPosition:"both",aria:"main",description:"main",domain:"main",domainCap:"main",domainColor:"main",domainDash:"main",domainDashOffset:"main",domainOpacity:"main",domainWidth:"main",format:"main",formatType:"main",labelAlign:"main",labelAngle:"main",labelBaseline:"main",labelBound:"main",labelColor:"main",labelFlush:"main",labelFlushOffset:"main",labelFont:"main",labelFontSize:"main",labelFontStyle:"main",labelFontWeight:"main",labelLimit:"main",labelLineHeight:"main",labelOffset:"main",labelOpacity:"main",labelOverlap:"main",labelPadding:"main",labels:"main",labelSeparation:"main",maxExtent:"main",minExtent:"main",offset:"both",position:"main",tickCap:"main",tickColor:"main",tickDash:"main",tickDashOffset:"main",tickMinStep:"both",tickOffset:"both",tickOpacity:"main",tickRound:"both",ticks:"main",tickSize:"main",tickWidth:"both",title:"main",titleAlign:"main",titleAnchor:"main",titleAngle:"main",titleBaseline:"main",titleColor:"main",titleFont:"main",titleFontSize:"main",titleFontStyle:"main",titleFontWeight:"main",titleLimit:"main",titleLineHeight:"main",titleOpacity:"main",titlePadding:"main",titleX:"main",titleY:"main",encode:"both",scale:"both",tickBand:"both",tickCount:"both",tickExtra:"both",translate:"both",values:"both",zindex:"both"},g5={orient:1,aria:1,bandPosition:1,description:1,domain:1,domainCap:1,domainColor:1,domainDash:1,domainDashOffset:1,domainOpacity:1,domainWidth:1,format:1,formatType:1,grid:1,gridCap:1,gridColor:1,gridDash:1,gridDashOffset:1,gridOpacity:1,gridWidth:1,labelAlign:1,labelAngle:1,labelBaseline:1,labelBound:1,labelColor:1,labelFlush:1,labelFlushOffset:1,labelFont:1,labelFontSize:1,labelFontStyle:1,labelFontWeight:1,labelLimit:1,labelLineHeight:1,labelOffset:1,labelOpacity:1,labelOverlap:1,labelPadding:1,labels:1,labelSeparation:1,maxExtent:1,minExtent:1,offset:1,position:1,tickBand:1,tickCap:1,tickColor:1,tickCount:1,tickDash:1,tickDashOffset:1,tickExtra:1,tickMinStep:1,tickOffset:1,tickOpacity:1,tickRound:1,ticks:1,tickSize:1,tickWidth:1,title:1,titleAlign:1,titleAnchor:1,titleAngle:1,titleBaseline:1,titleColor:1,titleFont:1,titleFontSize:1,titleFontStyle:1,titleFontWeight:1,titleLimit:1,titleLineHeight:1,titleOpacity:1,titlePadding:1,titleX:1,titleY:1,translate:1,values:1,zindex:1},bre={...g5,style:1,labelExpr:1,encoding:1};function A$(e){return J(bre,e)}const vre={axis:1,axisBand:1,axisBottom:1,axisDiscrete:1,axisLeft:1,axisPoint:1,axisQuantitative:1,axisRight:1,axisTemporal:1,axisTop:1,axisX:1,axisXBand:1,axisXDiscrete:1,axisXPoint:1,axisXQuantitative:1,axisXTemporal:1,axisY:1,axisYBand:1,axisYDiscrete:1,axisYPoint:1,axisYQuantitative:1,axisYTemporal:1},p5=B(vre);function Zr(e){return U(e,"mark")}class Up{constructor(t,n){this.name=t,this.run=n}hasMatchingType(t){return Zr(t)?Vie(t.mark)===this.name:!1}}function Fs(e,t){const n=e&&e[t];return n?P(n)?fu(n,i=>!!i.field):q(n)||Ip(n):!1}function m5(e,t){const n=e&&e[t];return n?P(n)?fu(n,i=>!!i.field):q(n)||br(n)||bf(n):!1}function y5(e,t){if(tt(t)){const n=e[t];if((q(n)||br(n))&&(P3(n.type)||q(n)&&n.timeUnit)){const i=aw(t);return m5(e,i)}}return!1}function b5(e){return fu(bte,t=>{if(Fs(e,t)){const n=e[t];if(P(n))return fu(n,i=>!!i.aggregate);{const i=Ai(n);return i&&!!i.aggregate}}return!1})}function v5(e,t){const n=[],i=[],r=[],o=[],s={};return Bw(e,(a,u)=>{if(q(a)){const{field:l,aggregate:c,bin:f,timeUnit:d,...h}=a;if(c||d||f){const g=Pw(a),p=g==null?void 0:g.title;let m=V(a,{forAs:!0});const y={...p?[]:{title:qa(a,t,{allowDisabling:!0})},...h,field:m};if(c){let b;if(Zo(c)?(b="argmax",m=V({op:"argmax",field:c.argmax},{forAs:!0}),y.field=`${m}.${l}`):Wr(c)?(b="argmin",m=V({op:"argmin",field:c.argmin},{forAs:!0}),y.field=`${m}.${l}`):c!=="boxplot"&&c!=="errorbar"&&c!=="errorband"&&(b=c),b){const v={op:b,as:m};l&&(v.field=l),o.push(v)}}else if(n.push(m),cn(a)&&ze(f)){if(i.push({bin:f,field:l,as:m}),n.push(V(a,{binSuffix:"end"})),vf(a,u)&&n.push(V(a,{binSuffix:"range"})),tt(u)){const b={field:`${m}_end`};s[`${u}2`]=b}y.bin="binned",r3(u)||(y.type=Gs)}else if(d&&!fa(d)){r.push({timeUnit:d,field:l,as:m});const b=cn(a)&&a.type!==pu&&"time";b&&(u===cf||u===Ws?y.formatType=b:Cte(u)?y.legend={formatType:b,...y.legend}:tt(u)&&(y.axis={formatType:b,...y.axis}))}s[u]=y}else n.push(l),s[u]=e[u]}else s[u]=e[u]}),{bins:i,timeUnits:r,aggregate:o,groupby:n,encoding:s}}function xre(e,t,n){const i=Tte(t,n);if(i){if(i==="binned"){const r=e[t===Ti?We:vt];return!!(q(r)&&q(e[t])&&Et(r.bin))}}else return!1;return!0}function wre(e,t,n,i){const r={};for(const o of B(e))i3(o)||j(yne(o));for(let o of _te){if(!e[o])continue;const s=e[o];if(df(o)){const a=Ste(o),u=r[a];if(q(u)&&mie(u.type)&&q(s)&&!u.timeUnit){j(fne(a));continue}}if(o==="angle"&&t==="arc"&&!e.theta&&(j(cne),o=oi),!xre(e,o,t)){j(Fp(o,t));continue}if(o===Kr&&t==="line"){const a=Ai(e[o]);if(a!=null&&a.aggregate){j(mne);continue}}if(o===En&&(n?"fill"in e:"stroke"in e)){j(w3("encoding",{fill:"fill"in e,stroke:"stroke"in e}));continue}if(o===ff||o===hu&&!P(s)&&!_i(s)||o===Ws&&P(s)){if(s){if(o===hu){const a=e[o];if(o5(a)){r[o]=a;continue}}r[o]=X(s).reduce((a,u)=>(q(u)?a.push(zw(u,o)):j(Dy(u,o)),a),[])}}else{if(o===Ws&&s===null)r[o]=null;else if(!q(s)&&!br(s)&&!_i(s)&&!yf(s)&&!te(s)){j(Dy(s,o));continue}r[o]=f5(s,o,i)}}return r}function jp(e,t){const n={};for(const i of B(e)){const r=f5(e[i],i,t,{compositeMark:!0});n[i]=r}return n}function Ere(e){const t=[];for(const n of B(e))if(Fs(e,n)){const i=e[n],r=X(i);for(const o of r)q(o)?t.push(o):Ip(o)&&t.push(o.condition)}return t}function Bw(e,t,n){if(e)for(const i of B(e)){const r=e[i];if(P(r))for(const o of r)t.call(n,o,i);else t.call(n,r,i)}}function Sre(e,t,n,i){return e?B(e).reduce((r,o)=>{const s=e[o];return P(s)?s.reduce((a,u)=>t.call(i,a,u,o),r):t.call(i,r,s,o)},n):n}function x5(e,t){return B(t).reduce((n,i)=>{switch(i){case We:case vt:case Sp:case Ap:case _p:case Ti:case hr:case Yo:case qu:case oi:case Xr:case Mi:case Yr:case Di:case Oi:case Ri:case ii:case cf:case Sn:case sa:case Ws:return n;case hu:if(e==="line"||e==="trail")return n;case ff:case Ep:{const r=t[i];if(P(r)||q(r))for(const o of X(r))o.aggregate||n.push(V(o,{}));return n}case Kr:if(e==="trail")return n;case En:case gr:case pr:case Jr:case Xo:case Ko:case Qo:case Jo:{const r=Ai(t[i]);return r&&!r.aggregate&&n.push(V(r,{})),n}}},[])}function _re(e){const{tooltip:t,...n}=e;if(!t)return{filteredEncoding:n};let i,r;if(P(t)){for(const o of t)o.aggregate?(i||(i=[]),i.push(o)):(r||(r=[]),r.push(o));i&&(n.tooltip=i)}else t.aggregate?n.tooltip=t:r=t;return P(r)&&r.length===1&&(r=r[0]),{customTooltipWithoutAggregatedField:r,filteredEncoding:n}}function Ly(e,t,n,i=!0){if("tooltip"in n)return{tooltip:n.tooltip};const r=e.map(({fieldPrefix:s,titlePrefix:a})=>{const u=i?` of ${Uw(t)}`:"";return{field:s+t.field,type:t.type,title:te(a)?{signal:`${a}"${escape(u)}"`}:a+u}}),o=Ere(n).map(sre);return{tooltip:[...r,...Gi(o,xe)]}}function Uw(e){const{title:t,field:n}=e;return et(t,n)}function jw(e,t,n,i,r){const{scale:o,axis:s}=n;return({partName:a,mark:u,positionPrefix:l,endPositionPrefix:c=void 0,extraEncoding:f={}})=>{const d=Uw(n);return w5(e,a,r,{mark:u,encoding:{[t]:{field:`${l}_${n.field}`,type:n.type,...d!==void 0?{title:d}:{},...o!==void 0?{scale:o}:{},...s!==void 0?{axis:s}:{}},...K(c)?{[`${t}2`]:{field:`${c}_${n.field}`}}:{},...i,...f}})}}function w5(e,t,n,i){const{clip:r,color:o,opacity:s}=e,a=e.type;return e[t]||e[t]===void 0&&n[t]?[{...i,mark:{...n[t],...r?{clip:r}:{},...o?{color:o}:{},...s?{opacity:s}:{},...or(i.mark)?i.mark:{type:i.mark},style:`${a}-${String(t)}`,...Wo(e[t])?{}:e[t]}}]:[]}function E5(e,t,n){const{encoding:i}=e,r=t==="vertical"?"y":"x",o=i[r],s=i[`${r}2`],a=i[`${r}Error`],u=i[`${r}Error2`];return{continuousAxisChannelDef:Jf(o,n),continuousAxisChannelDef2:Jf(s,n),continuousAxisChannelDefError:Jf(a,n),continuousAxisChannelDefError2:Jf(u,n),continuousAxis:r}}function Jf(e,t){if(e!=null&&e.aggregate){const{aggregate:n,...i}=e;return n!==t&&j(Hne(n,t)),i}else return e}function S5(e,t){const{mark:n,encoding:i}=e,{x:r,y:o}=i;if(or(n)&&n.orient)return n.orient;if(Eo(r)){if(Eo(o)){const s=q(r)&&r.aggregate,a=q(o)&&o.aggregate;if(!s&&a===t)return"vertical";if(!a&&s===t)return"horizontal";if(s===t&&a===t)throw new Error("Both x and y cannot have aggregate");return vu(o)&&!vu(r)?"horizontal":"vertical"}return"horizontal"}else{if(Eo(o))return"vertical";throw new Error(`Need a valid continuous axis for ${t}s`)}}const Jh="boxplot",Are=["box","median","outliers","rule","ticks"],$re=new Up(Jh,A5);function _5(e){return Ae(e)?"tukey":e}function A5(e,{config:t}){e={...e,encoding:jp(e.encoding,t)};const{mark:n,encoding:i,params:r,projection:o,...s}=e,a=or(n)?n:{type:n};r&&j(v3("boxplot"));const u=a.extent??t.boxplot.extent,l=Oe("size",a,t),c=a.invalid,f=_5(u),{bins:d,timeUnits:h,transform:g,continuousAxisChannelDef:p,continuousAxis:m,groupby:y,aggregate:b,encodingWithoutContinuousAxis:v,ticksOrient:x,boxOrient:E,customTooltipWithoutAggregatedField:S}=kre(e,u,t),w=ju(p.field),{color:_,size:A,...k}=v,C=_f=>jw(a,m,p,_f,t.boxplot),O=C(k),M=C(v),F=(Y(t.boxplot.box)?t.boxplot.box.color:t.mark.color)||"#4c78a8",$=C({...k,...A?{size:A}:{},color:{condition:{test:`datum['lower_box_${p.field}'] >= datum['upper_box_${p.field}']`,..._||{value:F}}}}),T=Ly([{fieldPrefix:f==="min-max"?"upper_whisker_":"max_",titlePrefix:"Max"},{fieldPrefix:"upper_box_",titlePrefix:"Q3"},{fieldPrefix:"mid_box_",titlePrefix:"Median"},{fieldPrefix:"lower_box_",titlePrefix:"Q1"},{fieldPrefix:f==="min-max"?"lower_whisker_":"min_",titlePrefix:"Min"}],p,v),L={type:"tick",color:"black",opacity:1,orient:x,invalid:c,aria:!1},z=f==="min-max"?T:Ly([{fieldPrefix:"upper_whisker_",titlePrefix:"Upper Whisker"},{fieldPrefix:"lower_whisker_",titlePrefix:"Lower Whisker"}],p,v),I=[...O({partName:"rule",mark:{type:"rule",invalid:c,aria:!1},positionPrefix:"lower_whisker",endPositionPrefix:"lower_box",extraEncoding:z}),...O({partName:"rule",mark:{type:"rule",invalid:c,aria:!1},positionPrefix:"upper_box",endPositionPrefix:"upper_whisker",extraEncoding:z}),...O({partName:"ticks",mark:L,positionPrefix:"lower_whisker",extraEncoding:z}),...O({partName:"ticks",mark:L,positionPrefix:"upper_whisker",extraEncoding:z})],Q=[...f!=="tukey"?I:[],...M({partName:"box",mark:{type:"bar",...l?{size:l}:{},orient:E,invalid:c,ariaRoleDescription:"box"},positionPrefix:"lower_box",endPositionPrefix:"upper_box",extraEncoding:T}),...$({partName:"median",mark:{type:"tick",invalid:c,...Y(t.boxplot.median)&&t.boxplot.median.color?{color:t.boxplot.median.color}:{},...l?{size:l}:{},orient:x,aria:!1},positionPrefix:"mid_box",extraEncoding:T})];if(f==="min-max")return{...s,transform:(s.transform??[]).concat(g),layer:Q};const ue=`datum["lower_box_${p.field}"]`,oe=`datum["upper_box_${p.field}"]`,fe=`(${oe} - ${ue})`,Pe=`${ue} - ${u} * ${fe}`,de=`${oe} + ${u} * ${fe}`,Dt=`datum["${p.field}"]`,ts={joinaggregate:$5(p.field),groupby:y},to={transform:[{filter:`(${Pe} <= ${Dt}) && (${Dt} <= ${de})`},{aggregate:[{op:"min",field:p.field,as:`lower_whisker_${w}`},{op:"max",field:p.field,as:`upper_whisker_${w}`},{op:"min",field:`lower_box_${p.field}`,as:`lower_box_${w}`},{op:"max",field:`upper_box_${p.field}`,as:`upper_box_${w}`},...b],groupby:y}],layer:I},{tooltip:Z,...pe}=k,{scale:ye,axis:W}=p,xt=Uw(p),Te=yn(W,["title"]),Ot=w5(a,"outliers",t.boxplot,{transform:[{filter:`(${Dt} < ${Pe}) || (${Dt} > ${de})`}],mark:"point",encoding:{[m]:{field:p.field,type:p.type,...xt!==void 0?{title:xt}:{},...ye!==void 0?{scale:ye}:{},...Re(Te)?{}:{axis:Te}},...pe,..._?{color:_}:{},...S?{tooltip:S}:{}}})[0];let ft;const Ni=[...d,...h,ts];return Ot?ft={transform:Ni,layer:[Ot,to]}:(ft=to,ft.transform.unshift(...Ni)),{...s,layer:[ft,{transform:g,layer:Q}]}}function $5(e){const t=ju(e);return[{op:"q1",field:e,as:`lower_box_${t}`},{op:"q3",field:e,as:`upper_box_${t}`}]}function kre(e,t,n){const i=S5(e,Jh),{continuousAxisChannelDef:r,continuousAxis:o}=E5(e,i,Jh),s=r.field,a=ju(s),u=_5(t),l=[...$5(s),{op:"median",field:s,as:`mid_box_${a}`},{op:"min",field:s,as:(u==="min-max"?"lower_whisker_":"min_")+a},{op:"max",field:s,as:(u==="min-max"?"upper_whisker_":"max_")+a}],c=u==="min-max"||u==="tukey"?[]:[{calculate:`datum["upper_box_${a}"] - datum["lower_box_${a}"]`,as:`iqr_${a}`},{calculate:`min(datum["upper_box_${a}"] + datum["iqr_${a}"] * ${t}, datum["max_${a}"])`,as:`upper_whisker_${a}`},{calculate:`max(datum["lower_box_${a}"] - datum["iqr_${a}"] * ${t}, datum["min_${a}"])`,as:`lower_whisker_${a}`}],{[o]:f,...d}=e.encoding,{customTooltipWithoutAggregatedField:h,filteredEncoding:g}=_re(d),{bins:p,timeUnits:m,aggregate:y,groupby:b,encoding:v}=v5(g,n),x=i==="vertical"?"horizontal":"vertical",E=i,S=[...p,...m,{aggregate:[...y,...l],groupby:b},...c];return{bins:p,timeUnits:m,transform:S,groupby:b,aggregate:y,continuousAxisChannelDef:r,continuousAxis:o,encodingWithoutContinuousAxis:v,ticksOrient:x,boxOrient:E,customTooltipWithoutAggregatedField:h}}const qw="errorbar",Cre=["ticks","rule"],Fre=new Up(qw,k5);function k5(e,{config:t}){e={...e,encoding:jp(e.encoding,t)};const{transform:n,continuousAxisChannelDef:i,continuousAxis:r,encodingWithoutContinuousAxis:o,ticksOrient:s,markDef:a,outerSpec:u,tooltipEncoding:l}=C5(e,qw,t);delete o.size;const c=jw(a,r,i,o,t.errorbar),f=a.thickness,d=a.size,h={type:"tick",orient:s,aria:!1,...f!==void 0?{thickness:f}:{},...d!==void 0?{size:d}:{}},g=[...c({partName:"ticks",mark:h,positionPrefix:"lower",extraEncoding:l}),...c({partName:"ticks",mark:h,positionPrefix:"upper",extraEncoding:l}),...c({partName:"rule",mark:{type:"rule",ariaRoleDescription:"errorbar",...f!==void 0?{size:f}:{}},positionPrefix:"lower",endPositionPrefix:"upper",extraEncoding:l})];return{...u,transform:n,...g.length>1?{layer:g}:{...g[0]}}}function Tre(e,t){const{encoding:n}=e;if(Mre(n))return{orient:S5(e,t),inputType:"raw"};const i=Dre(n),r=Ore(n),o=n.x,s=n.y;if(i){if(r)throw new Error(`${t} cannot be both type aggregated-upper-lower and aggregated-error`);const a=n.x2,u=n.y2;if(ce(a)&&ce(u))throw new Error(`${t} cannot have both x2 and y2`);if(ce(a)){if(Eo(o))return{orient:"horizontal",inputType:"aggregated-upper-lower"};throw new Error(`Both x and x2 have to be quantitative in ${t}`)}else if(ce(u)){if(Eo(s))return{orient:"vertical",inputType:"aggregated-upper-lower"};throw new Error(`Both y and y2 have to be quantitative in ${t}`)}throw new Error("No ranged axis")}else{const a=n.xError,u=n.xError2,l=n.yError,c=n.yError2;if(ce(u)&&!ce(a))throw new Error(`${t} cannot have xError2 without xError`);if(ce(c)&&!ce(l))throw new Error(`${t} cannot have yError2 without yError`);if(ce(a)&&ce(l))throw new Error(`${t} cannot have both xError and yError with both are quantiative`);if(ce(a)){if(Eo(o))return{orient:"horizontal",inputType:"aggregated-error"};throw new Error("All x, xError, and xError2 (if exist) have to be quantitative")}else if(ce(l)){if(Eo(s))return{orient:"vertical",inputType:"aggregated-error"};throw new Error("All y, yError, and yError2 (if exist) have to be quantitative")}throw new Error("No ranged axis")}}function Mre(e){return(ce(e.x)||ce(e.y))&&!ce(e.x2)&&!ce(e.y2)&&!ce(e.xError)&&!ce(e.xError2)&&!ce(e.yError)&&!ce(e.yError2)}function Dre(e){return ce(e.x2)||ce(e.y2)}function Ore(e){return ce(e.xError)||ce(e.xError2)||ce(e.yError)||ce(e.yError2)}function C5(e,t,n){const{mark:i,encoding:r,params:o,projection:s,...a}=e,u=or(i)?i:{type:i};o&&j(v3(t));const{orient:l,inputType:c}=Tre(e,t),{continuousAxisChannelDef:f,continuousAxisChannelDef2:d,continuousAxisChannelDefError:h,continuousAxisChannelDefError2:g,continuousAxis:p}=E5(e,l,t),{errorBarSpecificAggregate:m,postAggregateCalculates:y,tooltipSummary:b,tooltipTitleWithFieldName:v}=Rre(u,f,d,h,g,c,t,n),{[p]:x,[p==="x"?"x2":"y2"]:E,[p==="x"?"xError":"yError"]:S,[p==="x"?"xError2":"yError2"]:w,..._}=r,{bins:A,timeUnits:k,aggregate:C,groupby:O,encoding:M}=v5(_,n),F=[...C,...m],$=c!=="raw"?[]:O,T=Ly(b,f,M,v);return{transform:[...a.transform??[],...A,...k,...F.length===0?[]:[{aggregate:F,groupby:$}],...y],groupby:$,continuousAxisChannelDef:f,continuousAxis:p,encodingWithoutContinuousAxis:M,ticksOrient:l==="vertical"?"horizontal":"vertical",markDef:u,outerSpec:a,tooltipEncoding:T}}function Rre(e,t,n,i,r,o,s,a){let u=[],l=[];const c=t.field;let f,d=!1;if(o==="raw"){const h=e.center?e.center:e.extent?e.extent==="iqr"?"median":"mean":a.errorbar.center,g=e.extent?e.extent:h==="mean"?"stderr":"iqr";if(h==="median"!=(g==="iqr")&&j(Wne(h,g,s)),g==="stderr"||g==="stdev")u=[{op:g,field:c,as:`extent_${c}`},{op:h,field:c,as:`center_${c}`}],l=[{calculate:`datum["center_${c}"] + datum["extent_${c}"]`,as:`upper_${c}`},{calculate:`datum["center_${c}"] - datum["extent_${c}"]`,as:`lower_${c}`}],f=[{fieldPrefix:"center_",titlePrefix:lf(h)},{fieldPrefix:"upper_",titlePrefix:$$(h,g,"+")},{fieldPrefix:"lower_",titlePrefix:$$(h,g,"-")}],d=!0;else{let p,m,y;g==="ci"?(p="mean",m="ci0",y="ci1"):(p="median",m="q1",y="q3"),u=[{op:m,field:c,as:`lower_${c}`},{op:y,field:c,as:`upper_${c}`},{op:p,field:c,as:`center_${c}`}],f=[{fieldPrefix:"upper_",titlePrefix:qa({field:c,aggregate:y,type:"quantitative"},a,{allowDisabling:!1})},{fieldPrefix:"lower_",titlePrefix:qa({field:c,aggregate:m,type:"quantitative"},a,{allowDisabling:!1})},{fieldPrefix:"center_",titlePrefix:qa({field:c,aggregate:p,type:"quantitative"},a,{allowDisabling:!1})}]}}else{(e.center||e.extent)&&j(qne(e.center,e.extent)),o==="aggregated-upper-lower"?(f=[],l=[{calculate:`datum["${n.field}"]`,as:`upper_${c}`},{calculate:`datum["${c}"]`,as:`lower_${c}`}]):o==="aggregated-error"&&(f=[{fieldPrefix:"",titlePrefix:c}],l=[{calculate:`datum["${c}"] + datum["${i.field}"]`,as:`upper_${c}`}],r?l.push({calculate:`datum["${c}"] + datum["${r.field}"]`,as:`lower_${c}`}):l.push({calculate:`datum["${c}"] - datum["${i.field}"]`,as:`lower_${c}`}));for(const h of l)f.push({fieldPrefix:h.as.substring(0,6),titlePrefix:qs(qs(h.calculate,'datum["',""),'"]',"")})}return{postAggregateCalculates:l,errorBarSpecificAggregate:u,tooltipSummary:f,tooltipTitleWithFieldName:d}}function $$(e,t,n){return`${lf(e)} ${n} ${t}`}const Ww="errorband",Nre=["band","borders"],Lre=new Up(Ww,F5);function F5(e,{config:t}){e={...e,encoding:jp(e.encoding,t)};const{transform:n,continuousAxisChannelDef:i,continuousAxis:r,encodingWithoutContinuousAxis:o,markDef:s,outerSpec:a,tooltipEncoding:u}=C5(e,Ww,t),l=s,c=jw(l,r,i,o,t.errorband),f=e.encoding.x!==void 0&&e.encoding.y!==void 0;let d={type:f?"area":"rect"},h={type:f?"line":"rule"};const g={...l.interpolate?{interpolate:l.interpolate}:{},...l.tension&&l.interpolate?{tension:l.tension}:{}};return f?(d={...d,...g,ariaRoleDescription:"errorband"},h={...h,...g,aria:!1}):l.interpolate?j(y$("interpolate")):l.tension&&j(y$("tension")),{...a,transform:n,layer:[...c({partName:"band",mark:d,positionPrefix:"lower",endPositionPrefix:"upper",extraEncoding:u}),...c({partName:"borders",mark:h,positionPrefix:"lower",extraEncoding:u}),...c({partName:"borders",mark:h,positionPrefix:"upper",extraEncoding:u})]}}const T5={};function Hw(e,t,n){const i=new Up(e,t);T5[e]={normalizer:i,parts:n}}function Pre(){return B(T5)}Hw(Jh,A5,Are);Hw(qw,k5,Cre);Hw(Ww,F5,Nre);const Ire=["gradientHorizontalMaxLength","gradientHorizontalMinLength","gradientVerticalMaxLength","gradientVerticalMinLength","unselectedOpacity"],M5={titleAlign:"align",titleAnchor:"anchor",titleAngle:"angle",titleBaseline:"baseline",titleColor:"color",titleFont:"font",titleFontSize:"fontSize",titleFontStyle:"fontStyle",titleFontWeight:"fontWeight",titleLimit:"limit",titleLineHeight:"lineHeight",titleOrient:"orient",titlePadding:"offset"},D5={labelAlign:"align",labelAnchor:"anchor",labelAngle:"angle",labelBaseline:"baseline",labelColor:"color",labelFont:"font",labelFontSize:"fontSize",labelFontStyle:"fontStyle",labelFontWeight:"fontWeight",labelLimit:"limit",labelLineHeight:"lineHeight",labelOrient:"orient",labelPadding:"offset"},zre=B(M5),Bre=B(D5),Ure={header:1,headerRow:1,headerColumn:1,headerFacet:1},O5=B(Ure),R5=["size","shape","fill","stroke","strokeDash","strokeWidth","opacity"],jre={gradientHorizontalMaxLength:200,gradientHorizontalMinLength:100,gradientVerticalMaxLength:200,gradientVerticalMinLength:64,unselectedOpacity:.35},qre={aria:1,clipHeight:1,columnPadding:1,columns:1,cornerRadius:1,description:1,direction:1,fillColor:1,format:1,formatType:1,gradientLength:1,gradientOpacity:1,gradientStrokeColor:1,gradientStrokeWidth:1,gradientThickness:1,gridAlign:1,labelAlign:1,labelBaseline:1,labelColor:1,labelFont:1,labelFontSize:1,labelFontStyle:1,labelFontWeight:1,labelLimit:1,labelOffset:1,labelOpacity:1,labelOverlap:1,labelPadding:1,labelSeparation:1,legendX:1,legendY:1,offset:1,orient:1,padding:1,rowPadding:1,strokeColor:1,symbolDash:1,symbolDashOffset:1,symbolFillColor:1,symbolLimit:1,symbolOffset:1,symbolOpacity:1,symbolSize:1,symbolStrokeColor:1,symbolStrokeWidth:1,symbolType:1,tickCount:1,tickMinStep:1,title:1,titleAlign:1,titleAnchor:1,titleBaseline:1,titleColor:1,titleFont:1,titleFontSize:1,titleFontStyle:1,titleFontWeight:1,titleLimit:1,titleLineHeight:1,titleOpacity:1,titleOrient:1,titlePadding:1,type:1,values:1,zindex:1},$i="_vgsid_",Wre={point:{on:"click",fields:[$i],toggle:"event.shiftKey",resolve:"global",clear:"dblclick"},interval:{on:"[pointerdown, window:pointerup] > window:pointermove!",encodings:["x","y"],translate:"[pointerdown, window:pointerup] > window:pointermove!",zoom:"wheel!",mark:{fill:"#333",fillOpacity:.125,stroke:"white"},resolve:"global",clear:"dblclick"}};function Gw(e){return e==="legend"||!!(e!=null&&e.legend)}function x0(e){return Gw(e)&&Y(e)}function Vw(e){return!!(e!=null&&e.select)}function N5(e){const t=[];for(const n of e||[]){if(Vw(n))continue;const{expr:i,bind:r,...o}=n;if(r&&i){const s={...o,bind:r,init:i};t.push(s)}else{const s={...o,...i?{update:i}:{},...r?{bind:r}:{}};t.push(s)}}return t}function Hre(e){return qp(e)||Xw(e)||Yw(e)}function Yw(e){return U(e,"concat")}function qp(e){return U(e,"vconcat")}function Xw(e){return U(e,"hconcat")}function L5({step:e,offsetIsDiscrete:t}){return t?e.for??"offset":"position"}function sr(e){return U(e,"step")}function k$(e){return U(e,"view")||U(e,"width")||U(e,"height")}const C$=20,Gre={align:1,bounds:1,center:1,columns:1,spacing:1},Vre=B(Gre);function Yre(e,t,n){const i=n[t],r={},{spacing:o,columns:s}=i;o!==void 0&&(r.spacing=o),s!==void 0&&(Pp(e)&&!mf(e.facet)||Yw(e))&&(r.columns=s),qp(e)&&(r.columns=1);for(const a of Vre)if(e[a]!==void 0)if(a==="spacing"){const u=e[a];r[a]=Ae(u)?u:{row:u.row??o,column:u.column??o}}else r[a]=e[a];return r}function Py(e,t){return e[t]??e[t==="width"?"continuousWidth":"continuousHeight"]}function Iy(e,t){const n=Qh(e,t);return sr(n)?n.step:P5}function Qh(e,t){const n=e[t]??e[t==="width"?"discreteWidth":"discreteHeight"];return et(n,{step:e.step})}const P5=20,Xre={continuousWidth:200,continuousHeight:200,step:P5},Kre={background:"white",padding:5,timeFormat:"%b %d, %Y",countTitle:"Count of Records",view:Xre,mark:Uie,arc:{},area:{},bar:Hie,circle:{},geoshape:{},image:{},line:{},point:{},rect:Tw,rule:{color:"black"},square:{},text:{color:"black"},tick:Gie,trail:{},boxplot:{size:14,extent:1.5,box:{},median:{color:"white"},outliers:{},rule:{},ticks:null},errorbar:{center:"mean",rule:!0,ticks:!1},errorband:{band:{opacity:.3},borders:!1},scale:Eie,projection:{},legend:jre,header:{titlePadding:10,labelPadding:10},headerColumn:{},headerRow:{},headerFacet:{},selection:Wre,style:{},title:{},facet:{spacing:C$},concat:{spacing:C$},normalizedNumberFormat:".0%"},Er=["#4c78a8","#f58518","#e45756","#72b7b2","#54a24b","#eeca3b","#b279a2","#ff9da6","#9d755d","#bab0ac"],F$={text:11,guideLabel:10,guideTitle:11,groupTitle:13,groupSubtitle:12},T$={blue:Er[0],orange:Er[1],red:Er[2],teal:Er[3],green:Er[4],yellow:Er[5],purple:Er[6],pink:Er[7],brown:Er[8],gray0:"#000",gray1:"#111",gray2:"#222",gray3:"#333",gray4:"#444",gray5:"#555",gray6:"#666",gray7:"#777",gray8:"#888",gray9:"#999",gray10:"#aaa",gray11:"#bbb",gray12:"#ccc",gray13:"#ddd",gray14:"#eee",gray15:"#fff"};function Jre(e={}){return{signals:[{name:"color",value:Y(e)?{...T$,...e}:T$}],mark:{color:{signal:"color.blue"}},rule:{color:{signal:"color.gray0"}},text:{color:{signal:"color.gray0"}},style:{"guide-label":{fill:{signal:"color.gray0"}},"guide-title":{fill:{signal:"color.gray0"}},"group-title":{fill:{signal:"color.gray0"}},"group-subtitle":{fill:{signal:"color.gray0"}},cell:{stroke:{signal:"color.gray8"}}},axis:{domainColor:{signal:"color.gray13"},gridColor:{signal:"color.gray8"},tickColor:{signal:"color.gray13"}},range:{category:[{signal:"color.blue"},{signal:"color.orange"},{signal:"color.red"},{signal:"color.teal"},{signal:"color.green"},{signal:"color.yellow"},{signal:"color.purple"},{signal:"color.pink"},{signal:"color.brown"},{signal:"color.grey8"}]}}}function Qre(e){return{signals:[{name:"fontSize",value:Y(e)?{...F$,...e}:F$}],text:{fontSize:{signal:"fontSize.text"}},style:{"guide-label":{fontSize:{signal:"fontSize.guideLabel"}},"guide-title":{fontSize:{signal:"fontSize.guideTitle"}},"group-title":{fontSize:{signal:"fontSize.groupTitle"}},"group-subtitle":{fontSize:{signal:"fontSize.groupSubtitle"}}}}}function Zre(e){return{text:{font:e},style:{"guide-label":{font:e},"guide-title":{font:e},"group-title":{font:e},"group-subtitle":{font:e}}}}function I5(e){const t=B(e||{}),n={};for(const i of t){const r=e[i];n[i]=xf(r)?d3(r):Tn(r)}return n}function eoe(e){const t=B(e),n={};for(const i of t)n[i]=I5(e[i]);return n}const toe=[...V3,...p5,...O5,"background","padding","legend","lineBreak","scale","style","title","view"];function z5(e={}){const{color:t,font:n,fontSize:i,selection:r,...o}=e,s=Cu({},le(Kre),n?Zre(n):{},t?Jre(t):{},i?Qre(i):{},o||{});r&&Fu(s,"selection",r,!0);const a=yn(s,toe);for(const u of["background","lineBreak","padding"])s[u]&&(a[u]=Tn(s[u]));for(const u of V3)s[u]&&(a[u]=St(s[u]));for(const u of p5)s[u]&&(a[u]=I5(s[u]));for(const u of O5)s[u]&&(a[u]=St(s[u]));if(s.legend&&(a.legend=St(s.legend)),s.scale){const{invalid:u,...l}=s.scale,c=St(u,{level:1});a.scale={...St(l),...B(c).length>0?{invalid:c}:{}}}return s.style&&(a.style=eoe(s.style)),s.title&&(a.title=St(s.title)),s.view&&(a.view=St(s.view)),a}const noe=new Set(["view",...Nie]),ioe=["color","fontSize","background","padding","facet","concat","numberFormat","numberFormatType","normalizedNumberFormat","normalizedNumberFormatType","timeFormat","countTitle","header","axisQuantitative","axisTemporal","axisDiscrete","axisPoint","axisXBand","axisXPoint","axisXDiscrete","axisXQuantitative","axisXTemporal","axisYBand","axisYPoint","axisYDiscrete","axisYQuantitative","axisYTemporal","scale","selection","overlay"],roe={view:["continuousWidth","continuousHeight","discreteWidth","discreteHeight","step"],...Bie};function ooe(e){e=le(e);for(const t of ioe)delete e[t];if(e.axis)for(const t in e.axis)xf(e.axis[t])&&delete e.axis[t];if(e.legend)for(const t of Ire)delete e.legend[t];if(e.mark){for(const t of v$)delete e.mark[t];e.mark.tooltip&&Y(e.mark.tooltip)&&delete e.mark.tooltip}e.params&&(e.signals=(e.signals||[]).concat(N5(e.params)),delete e.params);for(const t of noe){for(const i of v$)delete e[t][i];const n=roe[t];if(n)for(const i of n)delete e[t][i];aoe(e,t)}for(const t of Pre())delete e[t];soe(e);for(const t in e)Y(e[t])&&Re(e[t])&&delete e[t];return Re(e)?void 0:e}function soe(e){const{titleMarkConfig:t,subtitleMarkConfig:n,subtitle:i}=f3(e.title);Re(t)||(e.style["group-title"]={...e.style["group-title"],...t}),Re(n)||(e.style["group-subtitle"]={...e.style["group-subtitle"],...n}),Re(i)?delete e.title:e.title=i}function aoe(e,t,n,i){const r=e[t];t==="view"&&(n="cell");const o={...r,...e.style[n??t]};Re(o)||(e.style[n??t]=o),delete e[t]}function Wp(e){return U(e,"layer")}function uoe(e){return U(e,"repeat")}function loe(e){return!P(e.repeat)&&U(e.repeat,"layer")}class Kw{map(t,n){return Pp(t)?this.mapFacet(t,n):uoe(t)?this.mapRepeat(t,n):Xw(t)?this.mapHConcat(t,n):qp(t)?this.mapVConcat(t,n):Yw(t)?this.mapConcat(t,n):this.mapLayerOrUnit(t,n)}mapLayerOrUnit(t,n){if(Wp(t))return this.mapLayer(t,n);if(Zr(t))return this.mapUnit(t,n);throw new Error(hw(t))}mapLayer(t,n){return{...t,layer:t.layer.map(i=>this.mapLayerOrUnit(i,n))}}mapHConcat(t,n){return{...t,hconcat:t.hconcat.map(i=>this.map(i,n))}}mapVConcat(t,n){return{...t,vconcat:t.vconcat.map(i=>this.map(i,n))}}mapConcat(t,n){const{concat:i,...r}=t;return{...r,concat:i.map(o=>this.map(o,n))}}mapFacet(t,n){return{...t,spec:this.map(t.spec,n)}}mapRepeat(t,n){return{...t,spec:this.map(t.spec,n)}}}const coe={zero:1,center:1,normalize:1};function foe(e){return J(coe,e)}const doe=new Set([W3,Op,Dp,Hh,Np,Cw,Fw,Rp,H3,kw]),hoe=new Set([Op,Dp,W3]);function $a(e){return q(e)&&yu(e)==="quantitative"&&!e.bin}function M$(e,t,{orient:n,type:i}){const r=t==="x"?"y":"radius",o=t==="x"&&["bar","area"].includes(i),s=e[t],a=e[r];if(q(s)&&q(a))if($a(s)&&$a(a)){if(s.stack)return t;if(a.stack)return r;const u=q(s)&&!!s.aggregate,l=q(a)&&!!a.aggregate;if(u!==l)return u?t:r;if(o){if(n==="vertical")return r;if(n==="horizontal")return t}}else{if($a(s))return t;if($a(a))return r}else{if($a(s))return o&&n==="vertical"?void 0:t;if($a(a))return o&&n==="horizontal"?void 0:r}}function goe(e){switch(e){case"x":return"y";case"y":return"x";case"theta":return"radius";case"radius":return"theta"}}function B5(e,t){var p,m;const n=or(e)?e:{type:e},i=n.type;if(!doe.has(i))return null;const r=M$(t,"x",n)||M$(t,"theta",n);if(!r)return null;const o=t[r],s=q(o)?V(o,{}):void 0,a=goe(r),u=[],l=new Set;if(t[a]){const y=t[a],b=q(y)?V(y,{}):void 0;b&&b!==s&&(u.push(a),l.add(b))}const c=a==="x"?"xOffset":"yOffset",f=t[c],d=q(f)?V(f,{}):void 0;d&&d!==s&&(u.push(c),l.add(d));const h=Ate.reduce((y,b)=>{if(b!=="tooltip"&&Fs(t,b)){const v=t[b];for(const x of X(v)){const E=Ai(x);if(E.aggregate)continue;const S=V(E,{});(!S||!l.has(S))&&y.push({channel:b,fieldDef:E})}}return y},[]);let g;return o.stack!==void 0?Wo(o.stack)?g=o.stack?"zero":null:g=o.stack:hoe.has(i)&&(g="zero"),!g||!foe(g)||b5(t)&&h.length===0?null:((p=o==null?void 0:o.scale)!=null&&p.type&&((m=o==null?void 0:o.scale)==null?void 0:m.type)!==_t.LINEAR&&o!=null&&o.stack&&j(Bne(o.scale.type)),ce(t[mr(r)])?(o.stack!==void 0&&j(zne(r)),null):(q(o)&&o.aggregate&&!Pte.has(o.aggregate)&&j(Une(o.aggregate)),{groupbyChannels:u,groupbyFields:l,fieldChannel:r,impute:o.impute===null?!1:es(i),stackBy:h,offset:g}))}function U5(e,t,n){const i=St(e),r=Oe("orient",i,n);if(i.orient=boe(i.type,t,r),r!==void 0&&r!==i.orient&&j(Sne(i.orient,r)),i.type==="bar"&&i.orient){const u=Oe("cornerRadiusEnd",i,n);if(u!==void 0){const l=i.orient==="horizontal"&&t.x2||i.orient==="vertical"&&t.y2?["cornerRadius"]:qie[i.orient];for(const c of l)i[c]=u;i.cornerRadiusEnd!==void 0&&delete i.cornerRadiusEnd}}const o=Oe("opacity",i,n),s=Oe("fillOpacity",i,n);return o===void 0&&s===void 0&&(i.opacity=moe(i.type,t)),Oe("cursor",i,n)===void 0&&(i.cursor=poe(i,t,n)),i}function poe(e,t,n){return t.href||e.href||Oe("href",e,n)?"pointer":e.cursor}function moe(e,t){if(ve([Np,kw,Cw,Fw],e)&&!b5(t))return .7}function yoe(e,t,{graticule:n}){if(n)return!1;const i=rr("filled",e,t),r=e.type;return et(i,r!==Np&&r!==Rp&&r!==Hh)}function boe(e,t,n){switch(e){case Np:case Cw:case Fw:case H3:case Oie:case Die:return}const{x:i,y:r,x2:o,y2:s}=t;switch(e){case Op:if(q(i)&&(Et(i.bin)||q(r)&&r.aggregate&&!i.aggregate))return"vertical";if(q(r)&&(Et(r.bin)||q(i)&&i.aggregate&&!r.aggregate))return"horizontal";if(s||o){if(n)return n;if(!o)return(q(i)&&i.type===Gs&&!ze(i.bin)||Vh(i))&&q(r)&&Et(r.bin)?"horizontal":"vertical";if(!s)return(q(r)&&r.type===Gs&&!ze(r.bin)||Vh(r))&&q(i)&&Et(i.bin)?"vertical":"horizontal"}case Hh:if(o&&!(q(i)&&Et(i.bin))&&s&&!(q(r)&&Et(r.bin)))return;case Dp:if(s)return q(r)&&Et(r.bin)?"horizontal":"vertical";if(o)return q(i)&&Et(i.bin)?"vertical":"horizontal";if(e===Hh){if(i&&!r)return"vertical";if(r&&!i)return"horizontal"}case Rp:case kw:{const a=S$(i),u=S$(r);if(n)return n;if(a&&!u)return e!=="tick"?"horizontal":"vertical";if(!a&&u)return e!=="tick"?"vertical":"horizontal";if(a&&u)return"vertical";{const l=cn(i)&&i.type===pu,c=cn(r)&&r.type===pu;if(l&&!c)return"vertical";if(!l&&c)return"horizontal"}return}}return"vertical"}function voe(e){const{point:t,line:n,...i}=e;return B(i).length>1?i:i.type}function xoe(e){for(const t of["line","area","rule","trail"])e[t]&&(e={...e,[t]:yn(e[t],["point","line"])});return e}function w0(e,t={},n){return e.point==="transparent"?{opacity:0}:e.point?Y(e.point)?e.point:{}:e.point!==void 0?null:t.point||n.shape?Y(t.point)?t.point:{}:void 0}function D$(e,t={}){return e.line?e.line===!0?{}:e.line:e.line!==void 0?null:t.line?t.line===!0?{}:t.line:void 0}class woe{constructor(){this.name="path-overlay"}hasMatchingType(t,n){if(Zr(t)){const{mark:i,encoding:r}=t,o=or(i)?i:{type:i};switch(o.type){case"line":case"rule":case"trail":return!!w0(o,n[o.type],r);case"area":return!!w0(o,n[o.type],r)||!!D$(o,n[o.type])}}return!1}run(t,n,i){const{config:r}=n,{params:o,projection:s,mark:a,name:u,encoding:l,...c}=t,f=jp(l,r),d=or(a)?a:{type:a},h=w0(d,r[d.type],f),g=d.type==="area"&&D$(d,r[d.type]),p=[{name:u,...o?{params:o}:{},mark:voe({...d.type==="area"&&d.opacity===void 0&&d.fillOpacity===void 0?{opacity:.7}:{},...d}),encoding:yn(f,["shape"])}],m=B5(U5(d,f,r),f);let y=f;if(m){const{fieldChannel:b,offset:v}=m;y={...f,[b]:{...f[b],...v?{stack:v}:{}}}}return y=yn(y,["y2","x2"]),g&&p.push({...s?{projection:s}:{},mark:{type:"line",...cu(d,["clip","interpolate","tension","tooltip"]),...g},encoding:y}),h&&p.push({...s?{projection:s}:{},mark:{type:"point",opacity:1,filled:!0,...cu(d,["clip","tooltip"]),...h},encoding:y}),i({...c,layer:p},{...n,config:xoe(r)})}}function Eoe(e,t){return t?mf(e)?q5(e,t):j5(e,t):e}function E0(e,t){return t?q5(e,t):e}function zy(e,t,n){const i=t[e];if(rre(i)){if(i.repeat in n)return{...t,[e]:n[i.repeat]};j(ine(i.repeat));return}return t}function j5(e,t){if(e=zy("field",e,t),e!==void 0){if(e===null)return null;if(Lw(e)&&Ir(e.sort)){const n=zy("field",e.sort,t);e={...e,...n?{sort:n}:{}}}return e}}function O$(e,t){if(q(e))return j5(e,t);{const n=zy("datum",e,t);return n!==e&&!n.type&&(n.type="nominal"),n}}function R$(e,t){if(ce(e)){const n=O$(e,t);if(n)return n;if(yf(e))return{condition:e.condition}}else{if(bf(e)){const n=O$(e.condition,t);if(n)return{...e,condition:n};{const{condition:i,...r}=e;return r}}return e}}function q5(e,t){const n={};for(const i in e)if(U(e,i)){const r=e[i];if(P(r))n[i]=r.map(o=>R$(o,t)).filter(o=>o);else{const o=R$(r,t);o!==void 0&&(n[i]=o)}}return n}class Soe{constructor(){this.name="RuleForRangedLine"}hasMatchingType(t){if(Zr(t)){const{encoding:n,mark:i}=t;if(i==="line"||or(i)&&i.type==="line")for(const r of Ete){const o=aa(r),s=n[o];if(n[r]&&(q(s)&&!Et(s.bin)||br(s)))return!0}}return!1}run(t,n,i){const{encoding:r,mark:o}=t;return j(Ene(!!r.x2,!!r.y2)),i({...t,mark:Y(o)?{...o,type:"rule"}:"rule"},n)}}class _oe extends Kw{constructor(){super(...arguments),this.nonFacetUnitNormalizers=[$re,Fre,Lre,new woe,new Soe]}map(t,n){if(Zr(t)){const i=Fs(t.encoding,Lr),r=Fs(t.encoding,Pr),o=Fs(t.encoding,wp);if(i||r||o)return this.mapFacetedUnit(t,n)}return super.map(t,n)}mapUnit(t,n){const{parentEncoding:i,parentProjection:r}=n,o=E0(t.encoding,n.repeater),s={...t,...t.name?{name:[n.repeaterPrefix,t.name].filter(u=>u).join("_")}:{},...o?{encoding:o}:{}};if(i||r)return this.mapUnitWithParentEncodingOrProjection(s,n);const a=this.mapLayerOrUnit.bind(this);for(const u of this.nonFacetUnitNormalizers)if(u.hasMatchingType(s,n.config))return u.run(s,n,a);return s}mapRepeat(t,n){return loe(t)?this.mapLayerRepeat(t,n):this.mapNonLayerRepeat(t,n)}mapLayerRepeat(t,n){const{repeat:i,spec:r,...o}=t,{row:s,column:a,layer:u}=i,{repeater:l={},repeaterPrefix:c=""}=n;return s||a?this.mapRepeat({...t,repeat:{...s?{row:s}:{},...a?{column:a}:{}},spec:{repeat:{layer:u},spec:r}},n):{...o,layer:u.map(f=>{const d={...l,layer:f},h=`${(r.name?`${r.name}_`:"")+c}child__layer_${qe(f)}`,g=this.mapLayerOrUnit(r,{...n,repeater:d,repeaterPrefix:h});return g.name=h,g})}}mapNonLayerRepeat(t,n){const{repeat:i,spec:r,data:o,...s}=t;!P(i)&&t.columns&&(t=yn(t,["columns"]),j(h$("repeat")));const a=[],{repeater:u={},repeaterPrefix:l=""}=n,c=!P(i)&&i.row||[u?u.row:null],f=!P(i)&&i.column||[u?u.column:null],d=P(i)&&i||[u?u.repeat:null];for(const g of d)for(const p of c)for(const m of f){const y={repeat:g,row:p,column:m,layer:u.layer},b=(r.name?`${r.name}_`:"")+l+"child__"+(P(i)?`${qe(g)}`:(i.row?`row_${qe(p)}`:"")+(i.column?`column_${qe(m)}`:"")),v=this.map(r,{...n,repeater:y,repeaterPrefix:b});v.name=b,a.push(yn(v,["data"]))}const h=P(i)?t.columns:i.column?i.column.length:1;return{data:r.data??o,align:"all",...s,columns:h,concat:a}}mapFacet(t,n){const{facet:i}=t;return mf(i)&&t.columns&&(t=yn(t,["columns"]),j(h$("facet"))),super.mapFacet(t,n)}mapUnitWithParentEncodingOrProjection(t,n){const{encoding:i,projection:r}=t,{parentEncoding:o,parentProjection:s,config:a}=n,u=L$({parentProjection:s,projection:r}),l=N$({parentEncoding:o,encoding:E0(i,n.repeater)});return this.mapUnit({...t,...u?{projection:u}:{},...l?{encoding:l}:{}},{config:a})}mapFacetedUnit(t,n){const{row:i,column:r,facet:o,...s}=t.encoding,{mark:a,width:u,projection:l,height:c,view:f,params:d,encoding:h,...g}=t,{facetMapping:p,layout:m}=this.getFacetMappingAndLayout({row:i,column:r,facet:o},n),y=E0(s,n.repeater);return this.mapFacet({...g,...m,facet:p,spec:{...u?{width:u}:{},...c?{height:c}:{},...f?{view:f}:{},...l?{projection:l}:{},mark:a,encoding:y,...d?{params:d}:{}}},n)}getFacetMappingAndLayout(t,n){const{row:i,column:r,facet:o}=t;if(i||r){o&&j(xne([...i?[Lr]:[],...r?[Pr]:[]]));const s={},a={};for(const u of[Lr,Pr]){const l=t[u];if(l){const{align:c,center:f,spacing:d,columns:h,...g}=l;s[u]=g;for(const p of["align","center","spacing"])l[p]!==void 0&&(a[p]??(a[p]={}),a[p][u]=l[p])}}return{facetMapping:s,layout:a}}else{const{align:s,center:a,spacing:u,columns:l,...c}=o;return{facetMapping:Eoe(c,n.repeater),layout:{...s?{align:s}:{},...a?{center:a}:{},...u?{spacing:u}:{},...l?{columns:l}:{}}}}}mapLayer(t,{parentEncoding:n,parentProjection:i,...r}){const{encoding:o,projection:s,...a}=t,u={...r,parentEncoding:N$({parentEncoding:n,encoding:o,layer:!0}),parentProjection:L$({parentProjection:i,projection:s})};return super.mapLayer({...a,...t.name?{name:[u.repeaterPrefix,t.name].filter(l=>l).join("_")}:{}},u)}}function N$({parentEncoding:e,encoding:t={},layer:n}){let i={};if(e){const r=new Set([...B(e),...B(t)]);for(const o of r){const s=t[o],a=e[o];if(ce(s)){const u={...a,...s};i[o]=u}else bf(s)?i[o]={...s,condition:{...a,...s.condition}}:s||s===null?i[o]=s:(n||_i(a)||te(a)||ce(a)||P(a))&&(i[o]=a)}}else i=t;return!i||Re(i)?void 0:i}function L$(e){const{parentProjection:t,projection:n}=e;return t&&n&&j(lne({parentProjection:t,projection:n})),n??t}function Jw(e){return U(e,"filter")}function Aoe(e){return U(e,"stop")}function W5(e){return U(e,"lookup")}function $oe(e){return U(e,"data")}function koe(e){return U(e,"param")}function Coe(e){return U(e,"pivot")}function Foe(e){return U(e,"density")}function Toe(e){return U(e,"quantile")}function Moe(e){return U(e,"regression")}function Doe(e){return U(e,"loess")}function Ooe(e){return U(e,"sample")}function Roe(e){return U(e,"window")}function Noe(e){return U(e,"joinaggregate")}function Loe(e){return U(e,"flatten")}function Poe(e){return U(e,"calculate")}function H5(e){return U(e,"bin")}function Ioe(e){return U(e,"impute")}function zoe(e){return U(e,"timeUnit")}function Boe(e){return U(e,"aggregate")}function Uoe(e){return U(e,"stack")}function joe(e){return U(e,"fold")}function qoe(e){return U(e,"extent")&&!U(e,"density")&&!U(e,"regression")}function Woe(e){return e.map(t=>Jw(t)?{filter:Ua(t.filter,pie)}:t)}class Hoe extends Kw{map(t,n){return n.emptySelections??(n.emptySelections={}),n.selectionPredicates??(n.selectionPredicates={}),t=P$(t,n),super.map(t,n)}mapLayerOrUnit(t,n){if(t=P$(t,n),t.encoding){const i={};for(const[r,o]of Lo(t.encoding))i[r]=G5(o,n);t={...t,encoding:i}}return super.mapLayerOrUnit(t,n)}mapUnit(t,n){const{selection:i,...r}=t;return i?{...r,params:Lo(i).map(([o,s])=>{const{init:a,bind:u,empty:l,...c}=s;c.type==="single"?(c.type="point",c.toggle=!1):c.type==="multi"&&(c.type="point"),n.emptySelections[o]=l!=="none";for(const f of Ft(n.selectionPredicates[o]??{}))f.empty=l!=="none";return{name:o,value:a,select:c,bind:u}})}:t}}function P$(e,t){const{transform:n,...i}=e;if(n){const r=n.map(o=>{if(Jw(o))return{filter:By(o,t)};if(H5(o)&&ua(o.bin))return{...o,bin:V5(o.bin)};if(W5(o)){const{selection:s,...a}=o.from;return s?{...o,from:{param:s,...a}}:o}return o});return{...i,transform:r}}return e}function G5(e,t){var i,r;const n=le(e);if(q(n)&&ua(n.bin)&&(n.bin=V5(n.bin)),da(n)&&((r=(i=n.scale)==null?void 0:i.domain)!=null&&r.selection)){const{selection:o,...s}=n.scale.domain;n.scale.domain={...s,...o?{param:o}:{}}}if(yf(n))if(P(n.condition))n.condition=n.condition.map(o=>{const{selection:s,param:a,test:u,...l}=o;return a?o:{...l,test:By(o,t)}});else{const{selection:o,param:s,test:a,...u}=G5(n.condition,t);n.condition=s?n.condition:{...u,test:By(n.condition,t)}}return n}function V5(e){const t=e.extent;if(t!=null&&t.selection){const{selection:n,...i}=t;return{...e,extent:{...i,param:n}}}return e}function By(e,t){const n=i=>Ua(i,r=>{var o;const s=t.emptySelections[r]??!0,a={param:r,empty:s};return(o=t.selectionPredicates)[r]??(o[r]=[]),t.selectionPredicates[r].push(a),a});return e.selection?n(e.selection):Ua(e.test||e.filter,i=>i.selection?n(i.selection):i)}class Uy extends Kw{map(t,n){const i=n.selections??[];if(t.params&&!Zr(t)){const r=[];for(const o of t.params)Vw(o)?i.push(o):r.push(o);t.params=r}return n.selections=i,super.map(t,n)}mapUnit(t,n){const i=n.selections;if(!i||!i.length)return t;const r=(n.path??[]).concat(t.name),o=[];for(const s of i)if(!s.views||!s.views.length)o.push(s);else for(const a of s.views)(K(a)&&(a===t.name||r.includes(a))||P(a)&&a.map(u=>r.indexOf(u)).every((u,l,c)=>u!==-1&&(l===0||u>c[l-1])))&&o.push(s);return o.length&&(t.params=o),t}}for(const e of["mapFacet","mapRepeat","mapHConcat","mapVConcat","mapLayer"]){const t=Uy.prototype[e];Uy.prototype[e]=function(n,i){return t.call(this,n,Goe(n,i))}}function Goe(e,t){return e.name?{...t,path:(t.path??[]).concat(e.name)}:t}function Y5(e,t){t===void 0&&(t=z5(e.config));const n=Koe(e,t),{width:i,height:r}=e,o=Joe(n,{width:i,height:r,autosize:e.autosize},t);return{...n,...o?{autosize:o}:{}}}const Voe=new _oe,Yoe=new Hoe,Xoe=new Uy;function Koe(e,t={}){const n={config:t};return Xoe.map(Voe.map(Yoe.map(e,n),n),n)}function I$(e){return K(e)?{type:e}:e??{}}function Joe(e,t,n){let{width:i,height:r}=t;const o=Zr(e)||Wp(e),s={};o?i=="container"&&r=="container"?(s.type="fit",s.contains="padding"):i=="container"?(s.type="fit-x",s.contains="padding"):r=="container"&&(s.type="fit-y",s.contains="padding"):(i=="container"&&(j(l$("width")),i=void 0),r=="container"&&(j(l$("height")),r=void 0));const a={type:"pad",...s,...n?I$(n.autosize):{},...I$(e.autosize)};if(a.type==="fit"&&!o&&(j(Gte),a.type="pad"),i=="container"&&!(a.type=="fit"||a.type=="fit-x")&&j(c$("width")),r=="container"&&!(a.type=="fit"||a.type=="fit-y")&&j(c$("height")),!Dn(a,{type:"pad"}))return a}function Qoe(e){return["fit","fit-x","fit-y"].includes(e)}function Zoe(e){return e?`fit-${$p(e)}`:"fit"}const ese=["background","padding"];function z$(e,t){const n={};for(const i of ese)e&&e[i]!==void 0&&(n[i]=Tn(e[i]));return t&&(n.params=e.params),n}class eo{constructor(t={},n={}){this.explicit=t,this.implicit=n}clone(){return new eo(le(this.explicit),le(this.implicit))}combine(){return{...this.explicit,...this.implicit}}get(t){return et(this.explicit[t],this.implicit[t])}getWithExplicit(t){return this.explicit[t]!==void 0?{explicit:!0,value:this.explicit[t]}:this.implicit[t]!==void 0?{explicit:!1,value:this.implicit[t]}:{explicit:!1,value:void 0}}setWithExplicit(t,{value:n,explicit:i}){n!==void 0&&this.set(t,n,i)}set(t,n,i){return delete this[i?"implicit":"explicit"][t],this[i?"explicit":"implicit"][t]=n,this}copyKeyFromSplit(t,{explicit:n,implicit:i}){n[t]!==void 0?this.set(t,n[t],!0):i[t]!==void 0&&this.set(t,i[t],!1)}copyKeyFromObject(t,n){n[t]!==void 0&&this.set(t,n[t],!0)}copyAll(t){for(const n of B(t.combine())){const i=t.getWithExplicit(n);this.setWithExplicit(n,i)}}}function Ui(e){return{explicit:!0,value:e}}function kn(e){return{explicit:!1,value:e}}function X5(e){return(t,n,i,r)=>{const o=e(t.value,n.value);return o>0?t:o<0?n:Hp(t,n,i,r)}}function Hp(e,t,n,i){return e.explicit&&t.explicit&&j(Dne(n,i,e.value,t.value)),e}function zo(e,t,n,i,r=Hp){return e===void 0||e.value===void 0?t:e.explicit&&!t.explicit?e:t.explicit&&!e.explicit?t:Dn(e.value,t.value)?e:r(e,t,n,i)}class tse extends eo{constructor(t={},n={},i=!1){super(t,n),this.explicit=t,this.implicit=n,this.parseNothing=i}clone(){const t=super.clone();return t.parseNothing=this.parseNothing,t}}function xu(e){return U(e,"url")}function Cc(e){return U(e,"values")}function K5(e){return U(e,"name")&&!xu(e)&&!Cc(e)&&!Co(e)}function Co(e){return e&&(J5(e)||Q5(e)||Qw(e))}function J5(e){return U(e,"sequence")}function Q5(e){return U(e,"sphere")}function Qw(e){return U(e,"graticule")}var Ke;(function(e){e[e.Raw=0]="Raw",e[e.Main=1]="Main",e[e.Row=2]="Row",e[e.Column=3]="Column",e[e.Lookup=4]="Lookup",e[e.PreFilterInvalid=5]="PreFilterInvalid",e[e.PostFilterInvalid=6]="PostFilterInvalid"})(Ke||(Ke={}));function Z5({invalid:e,isPath:t}){switch(Y3(e,{isPath:t})){case"filter":return{marks:"exclude-invalid-values",scales:"exclude-invalid-values"};case"break-paths-show-domains":return{marks:t?"include-invalid-values":"exclude-invalid-values",scales:"include-invalid-values"};case"break-paths-filter-domains":return{marks:t?"include-invalid-values":"exclude-invalid-values",scales:"exclude-invalid-values"};case"show":return{marks:"include-invalid-values",scales:"include-invalid-values"}}}function nse(e){const{marks:t,scales:n}=Z5(e);return t===n?Ke.Main:n==="include-invalid-values"?Ke.PreFilterInvalid:Ke.PostFilterInvalid}function eL(e){const{signals:t,hasLegend:n,index:i,...r}=e;return r.field=ni(r.field),r}function Xs(e,t=!0,n=Vt){if(P(e)){const i=e.map(r=>Xs(r,t,n));return t?`[${i.join(", ")}]`:i}else if(ca(e))return n(t?Hs(e):iie(e));return t?n(Ne(e)):e}function ise(e,t){for(const n of Ft(e.component.selection??{})){const i=n.name;let r=`${i}${Bo}, ${n.resolve==="global"?"true":`{unit: ${Ts(e)}}`}`;for(const o of Xp)o.defined(n)&&(o.signals&&(t=o.signals(e,n,t)),o.modifyExpr&&(r=o.modifyExpr(e,n,r)));t.push({name:i+Ose,on:[{events:{signal:n.name+Bo},update:`modify(${H(n.name+Ks)}, ${r})`}]})}return Zw(t)}function rse(e,t){if(e.component.selection&&B(e.component.selection).length){const n=H(e.getName("cell"));t.unshift({name:"facet",value:{},on:[{events:Vo("pointermove","scope"),update:`isTuple(facet) ? facet : group(${n}).datum`}]})}return Zw(t)}function ose(e,t){let n=!1;for(const i of Ft(e.component.selection??{})){const r=i.name,o=H(r+Ks);if(t.filter(a=>a.name===r).length===0){const a=i.resolve==="global"?"union":i.resolve,u=i.type==="point"?", true, true)":")";t.push({name:i.name,update:`${bL}(${o}, ${H(a)}${u}`})}n=!0;for(const a of Xp)a.defined(i)&&a.topLevelSignals&&(t=a.topLevelSignals(e,i,t))}return n&&t.filter(r=>r.name==="unit").length===0&&t.unshift({name:"unit",value:{},on:[{events:"pointermove",update:"isTuple(group()) ? group() : unit"}]}),Zw(t)}function sse(e,t){const n=[...t],i=Ts(e,{escape:!1});for(const r of Ft(e.component.selection??{})){const o={name:r.name+Ks};if(r.project.hasSelectionId&&(o.transform=[{type:"collect",sort:{field:$i}}]),r.init){const a=r.project.items.map(eL);o.values=r.project.hasSelectionId?r.init.map(u=>({unit:i,[$i]:Xs(u,!1)[0]})):r.init.map(u=>({unit:i,fields:a,values:Xs(u,!1)}))}n.filter(a=>a.name===r.name+Ks).length||n.push(o)}return n}function tL(e,t){for(const n of Ft(e.component.selection??{}))for(const i of Xp)i.defined(n)&&i.marks&&(t=i.marks(e,n,t));return t}function ase(e,t){for(const n of e.children)Ge(n)&&(t=tL(n,t));return t}function use(e,t,n,i){const r=SL(e,t.param,t);return{signal:Si(n.get("type"))&&P(i)&&i[0]>i[1]?`isValid(${r}) && reverse(${r})`:r}}function Zw(e){return e.map(t=>(t.on&&!t.on.length&&delete t.on,t))}class De{constructor(t,n){this.debugName=n,this._children=[],this._parent=null,t&&(this.parent=t)}clone(){throw new Error("Cannot clone node")}get parent(){return this._parent}set parent(t){this._parent=t,t&&t.addChild(this)}get children(){return this._children}numChildren(){return this._children.length}addChild(t,n){if(this._children.includes(t)){j(sne);return}n!==void 0?this._children.splice(n,0,t):this._children.push(t)}removeChild(t){const n=this._children.indexOf(t);return this._children.splice(n,1),n}remove(){let t=this._parent.removeChild(this);for(const n of this._children)n._parent=this._parent,this._parent.addChild(n,t++)}insertAsParentOf(t){const n=t.parent;n.removeChild(this),this.parent=n,t.parent=this}swapWithParent(){const t=this._parent,n=t.parent;for(const r of this._children)r.parent=t;this._children=[],t.removeChild(this);const i=t.parent.removeChild(t);this._parent=n,n.addChild(this,i),t.parent=this}}class bn extends De{clone(){const t=new this.constructor;return t.debugName=`clone_${this.debugName}`,t._source=this._source,t._name=`clone_${this._name}`,t.type=this.type,t.refCounts=this.refCounts,t.refCounts[t._name]=0,t}constructor(t,n,i,r){super(t,n),this.type=i,this.refCounts=r,this._source=this._name=n,this.refCounts&&!(this._name in this.refCounts)&&(this.refCounts[this._name]=0)}dependentFields(){return new Set}producedFields(){return new Set}hash(){return this._hash===void 0&&(this._hash=`Output ${XN()}`),this._hash}getSource(){return this.refCounts[this._name]++,this._source}isRequired(){return!!this.refCounts[this._name]}setSource(t){this._source=t}}function S0(e){return e.as!==void 0}function B$(e){return`${e}_end`}class Ki extends De{clone(){return new Ki(null,le(this.timeUnits))}constructor(t,n){super(t),this.timeUnits=n}static makeFromEncoding(t,n){const i=n.reduceFieldDef((r,o,s)=>{const{field:a,timeUnit:u}=o;if(u){let l;if(fa(u)){if(Ge(n)){const{mark:c,markDef:f,config:d}=n,h=Io({fieldDef:o,markDef:f,config:d});(kc(c)||h)&&(l={timeUnit:mt(u),field:a})}}else l={as:V(o,{forAs:!0}),field:a,timeUnit:u};if(Ge(n)){const{mark:c,markDef:f,config:d}=n,h=Io({fieldDef:o,markDef:f,config:d});kc(c)&&tt(s)&&h!==.5&&(l.rectBandPosition=h)}l&&(r[xe(l)]=l)}return r},{});return Re(i)?null:new Ki(t,i)}static makeFromTransform(t,n){const{timeUnit:i,...r}={...n},o=mt(i),s={...r,timeUnit:o};return new Ki(t,{[xe(s)]:s})}merge(t){this.timeUnits={...this.timeUnits};for(const n in t.timeUnits)this.timeUnits[n]||(this.timeUnits[n]=t.timeUnits[n]);for(const n of t.children)t.removeChild(n),n.parent=this;t.remove()}removeFormulas(t){const n={};for(const[i,r]of Lo(this.timeUnits)){const o=S0(r)?r.as:`${r.field}_end`;t.has(o)||(n[i]=r)}this.timeUnits=n}producedFields(){return new Set(Ft(this.timeUnits).map(t=>S0(t)?t.as:B$(t.field)))}dependentFields(){return new Set(Ft(this.timeUnits).map(t=>t.field))}hash(){return`TimeUnit ${xe(this.timeUnits)}`}assemble(){const t=[];for(const n of Ft(this.timeUnits)){const{rectBandPosition:i}=n,r=mt(n.timeUnit);if(S0(n)){const{field:o,as:s}=n,{unit:a,utc:u,...l}=r,c=[s,`${s}_end`];t.push({field:ni(o),type:"timeunit",...a?{units:Tp(a)}:{},...u?{timezone:"utc"}:{},...l,as:c}),t.push(...U$(c,i,r))}else if(n){const{field:o}=n,s=o.replaceAll("\\.","."),a=nL({timeUnit:r,field:s}),u=B$(s);t.push({type:"formula",expr:a,as:u}),t.push(...U$([s,u],i,r))}}return t}}const Gp="offsetted_rect_start",Vp="offsetted_rect_end";function nL({timeUnit:e,field:t,reverse:n}){const{unit:i,utc:r}=e,o=T3(i),{part:s,step:a}=R3(o,e.step);return`${r?"utcOffset":"timeOffset"}('${s}', datum['${t}'], ${n?-a:a})`}function U$([e,t],n,i){if(n!==void 0&&n!==.5){const r=`datum['${e}']`,o=`datum['${t}']`;return[{type:"formula",expr:j$([nL({timeUnit:i,field:e,reverse:!0}),r],n+.5),as:`${e}_${Gp}`},{type:"formula",expr:j$([r,o],n+.5),as:`${e}_${Vp}`}]}return[]}function j$([e,t],n){return`${1-n} * ${e} + ${n} * ${t}`}const wf="_tuple_fields";class lse{constructor(...t){this.items=t,this.hasChannel={},this.hasField={},this.hasSelectionId=!1}}const cse={defined:()=>!0,parse:(e,t,n)=>{const i=t.name,r=t.project??(t.project=new lse),o={},s={},a=new Set,u=(g,p)=>{const m=p==="visual"?g.channel:g.field;let y=qe(`${i}_${m}`);for(let b=1;a.has(y);b++)y=qe(`${i}_${m}_${b}`);return a.add(y),{[p]:y}},l=t.type,c=e.config.selection[l],f=n.value!==void 0?X(n.value):null;let{fields:d,encodings:h}=Y(n.select)?n.select:{};if(!d&&!h&&f){for(const g of f)if(Y(g))for(const p of B(g))wte(p)?(h||(h=[])).push(p):l==="interval"?(j(nne),h=c.encodings):(d??(d=[])).push(p)}!d&&!h&&(h=c.encodings,"fields"in c&&(d=c.fields));for(const g of h??[]){const p=e.fieldDef(g);if(p){let m=p.field;if(p.aggregate){j(Vte(g,p.aggregate));continue}else if(!m){j(d$(g));continue}if(p.timeUnit&&!fa(p.timeUnit)){m=e.vgField(g);const y={timeUnit:p.timeUnit,as:m,field:p.field};s[xe(y)]=y}if(!o[m]){const y=l==="interval"&&yr(g)&&Si(e.getScaleComponent(g).get("type"))?"R":p.bin?"R-RE":"E",b={field:m,channel:g,type:y,index:r.items.length};b.signals={...u(b,"data"),...u(b,"visual")},r.items.push(o[m]=b),r.hasField[m]=o[m],r.hasSelectionId=r.hasSelectionId||m===$i,t3(g)?(b.geoChannel=g,b.channel=e3(g),r.hasChannel[b.channel]=o[m]):r.hasChannel[g]=o[m]}}else j(d$(g))}for(const g of d??[]){if(r.hasField[g])continue;const p={type:"E",field:g,index:r.items.length};p.signals={...u(p,"data")},r.items.push(p),r.hasField[g]=p,r.hasSelectionId=r.hasSelectionId||g===$i}f&&(t.init=f.map(g=>r.items.map(p=>Y(g)?g[p.geoChannel||p.channel]!==void 0?g[p.geoChannel||p.channel]:g[p.field]:g))),Re(s)||(r.timeUnit=new Ki(null,s))},signals:(e,t,n)=>{const i=t.name+wf;return n.filter(o=>o.name===i).length>0||t.project.hasSelectionId?n:n.concat({name:i,value:t.project.items.map(eL)})}},zr={defined:e=>e.type==="interval"&&e.resolve==="global"&&e.bind&&e.bind==="scales",parse:(e,t)=>{const n=t.scales=[];for(const i of t.project.items){const r=i.channel;if(!yr(r))continue;const o=e.getScaleComponent(r),s=o?o.get("type"):void 0;if(s=="sequential"&&j(Jte),!o||!Si(s)){j(Kte);continue}o.set("selectionExtent",{param:t.name,field:i.field},!0),n.push(i)}},topLevelSignals:(e,t,n)=>{const i=t.scales.filter(s=>n.filter(a=>a.name===s.signals.data).length===0);if(!e.parent||q$(e)||i.length===0)return n;const r=n.find(s=>s.name===t.name);let o=r.update;if(o.includes(bL))r.update=`{${i.map(s=>`${H(ni(s.field))}: ${s.signals.data}`).join(", ")}}`;else{for(const s of i){const a=`${H(ni(s.field))}: ${s.signals.data}`;o.includes(a)||(o=`${o.substring(0,o.length-1)}, ${a}}`)}r.update=o}return n.concat(i.map(s=>({name:s.signals.data})))},signals:(e,t,n)=>{if(e.parent&&!q$(e))for(const i of t.scales){const r=n.find(o=>o.name===i.signals.data);r.push="outer",delete r.value,delete r.update}return n}};function jy(e,t){return`domain(${H(e.scaleName(t))})`}function q$(e){return e.parent&&Xu(e.parent)&&!e.parent.parent}const Wa="_brush",iL="_scale_trigger",yl="geo_interval_init_tick",rL="_init",fse="_center",dse={defined:e=>e.type==="interval",parse:(e,t,n)=>{var i;if(e.hasProjection){const r={...Y(n.select)?n.select:{}};r.fields=[$i],r.encodings||(r.encodings=n.value?B(n.value):[Oi,Di]),n.select={type:"interval",...r}}if(t.translate&&!zr.defined(t)){const r=`!event.item || event.item.mark.name !== ${H(t.name+Wa)}`;for(const o of t.events){if(!o.between){j(`${o} is not an ordered event stream for interval selections.`);continue}const s=X((i=o.between[0]).filter??(i.filter=[]));s.includes(r)||s.push(r)}}},signals:(e,t,n)=>{const i=t.name,r=i+Bo,o=Ft(t.project.hasChannel).filter(a=>a.channel===We||a.channel===vt),s=t.init?t.init[0]:null;if(n.push(...o.reduce((a,u)=>a.concat(hse(e,t,u,s&&s[u.index])),[])),e.hasProjection){const a=H(e.projectionName()),u=e.projectionName()+fse,{x:l,y:c}=t.project.hasChannel,f=l&&l.signals.visual,d=c&&c.signals.visual,h=l?s&&s[l.index]:`${u}[0]`,g=c?s&&s[c.index]:`${u}[1]`,p=E=>e.getSizeSignalRef(E).signal,m=`[[${f?f+"[0]":"0"}, ${d?d+"[0]":"0"}],[${f?f+"[1]":p("width")}, ${d?d+"[1]":p("height")}]]`;s&&(n.unshift({name:i+rL,init:`[scale(${a}, [${l?h[0]:h}, ${c?g[0]:g}]), scale(${a}, [${l?h[1]:h}, ${c?g[1]:g}])]`}),(!l||!c)&&(n.find(S=>S.name===u)||n.unshift({name:u,update:`invert(${a}, [${p("width")}/2, ${p("height")}/2])`})));const y=`intersect(${m}, {markname: ${H(e.getName("marks"))}}, unit.mark)`,b=`{unit: ${Ts(e)}}`,v=`vlSelectionTuples(${y}, ${b})`,x=o.map(E=>E.signals.visual);return n.concat({name:r,on:[{events:[...x.length?[{signal:x.join(" || ")}]:[],...s?[{signal:yl}]:[]],update:v}]})}else{if(!zr.defined(t)){const l=i+iL,c=o.map(f=>{const d=f.channel,{data:h,visual:g}=f.signals,p=H(e.scaleName(d)),m=e.getScaleComponent(d).get("type"),y=Si(m)?"+":"";return`(!isArray(${h}) || (${y}invert(${p}, ${g})[0] === ${y}${h}[0] && ${y}invert(${p}, ${g})[1] === ${y}${h}[1]))`});c.length&&n.push({name:l,value:{},on:[{events:o.map(f=>({scale:e.scaleName(f.channel)})),update:c.join(" && ")+` ? ${l} : {}`}]})}const a=o.map(l=>l.signals.data),u=`unit: ${Ts(e)}, fields: ${i+wf}, values`;return n.concat({name:r,...s?{init:`{${u}: ${Xs(s)}}`}:{},...a.length?{on:[{events:[{signal:a.join(" || ")}],update:`${a.join(" && ")} ? {${u}: [${a}]} : null`}]}:{}})}},topLevelSignals:(e,t,n)=>(Ge(e)&&e.hasProjection&&t.init&&(n.filter(r=>r.name===yl).length||n.unshift({name:yl,value:null,on:[{events:"timer{1}",update:`${yl} === null ? {} : ${yl}`}]})),n),marks:(e,t,n)=>{const i=t.name,{x:r,y:o}=t.project.hasChannel,s=r==null?void 0:r.signals.visual,a=o==null?void 0:o.signals.visual,u=`data(${H(t.name+Ks)})`;if(zr.defined(t)||!r&&!o)return n;const l={x:r!==void 0?{signal:`${s}[0]`}:{value:0},y:o!==void 0?{signal:`${a}[0]`}:{value:0},x2:r!==void 0?{signal:`${s}[1]`}:{field:{group:"width"}},y2:o!==void 0?{signal:`${a}[1]`}:{field:{group:"height"}}};if(t.resolve==="global")for(const m of B(l))l[m]=[{test:`${u}.length && ${u}[0].unit === ${Ts(e)}`,...l[m]},{value:0}];const{fill:c,fillOpacity:f,cursor:d,...h}=t.mark,g=B(h).reduce((m,y)=>(m[y]=[{test:[r!==void 0&&`${s}[0] !== ${s}[1]`,o!==void 0&&`${a}[0] !== ${a}[1]`].filter(b=>b).join(" && "),value:h[y]},{value:null}],m),{}),p=d??(t.translate?"move":null);return[{name:`${i+Wa}_bg`,type:"rect",clip:!0,encode:{enter:{fill:{value:c},fillOpacity:{value:f}},update:l}},...n,{name:i+Wa,type:"rect",clip:!0,encode:{enter:{...p?{cursor:{value:p}}:{},fill:{value:"transparent"}},update:{...l,...g}}}]}};function hse(e,t,n,i){const r=!e.hasProjection,o=n.channel,s=n.signals.visual,a=H(r?e.scaleName(o):e.projectionName()),u=d=>`scale(${a}, ${d})`,l=e.getSizeSignalRef(o===We?"width":"height").signal,c=`${o}(unit)`,f=t.events.reduce((d,h)=>[...d,{events:h.between[0],update:`[${c}, ${c}]`},{events:h,update:`[${s}[0], clamp(${c}, 0, ${l})]`}],[]);if(r){const d=n.signals.data,h=zr.defined(t),g=e.getScaleComponent(o),p=g?g.get("type"):void 0,m=i?{init:Xs(i,!0,u)}:{value:[]};return f.push({events:{signal:t.name+iL},update:Si(p)?`[${u(`${d}[0]`)}, ${u(`${d}[1]`)}]`:"[0, 0]"}),h?[{name:d,on:[]}]:[{name:s,...m,on:f},{name:d,...i?{init:Xs(i)}:{},on:[{events:{signal:s},update:`${s}[0] === ${s}[1] ? null : invert(${a}, ${s})`}]}]}else{const d=o===We?0:1,h=t.name+rL,g=i?{init:`[${h}[0][${d}], ${h}[1][${d}]]`}:{value:[]};return[{name:s,...g,on:f}]}}const gse={defined:e=>e.type==="point",signals:(e,t,n)=>{const i=t.name,r=i+wf,o=t.project,s="(item().isVoronoi ? datum.datum : datum)",a=Ft(e.component.selection??{}).reduce((f,d)=>d.type==="interval"?f.concat(d.name+Wa):f,[]).map(f=>`indexof(item().mark.name, '${f}') < 0`).join(" && "),u=`datum && item().mark.marktype !== 'group' && indexof(item().mark.role, 'legend') < 0${a?` && ${a}`:""}`;let l=`unit: ${Ts(e)}, `;if(t.project.hasSelectionId)l+=`${$i}: ${s}[${H($i)}]`;else{const f=o.items.map(d=>{const h=e.fieldDef(d.channel);return h!=null&&h.bin?`[${s}[${H(e.vgField(d.channel,{}))}], ${s}[${H(e.vgField(d.channel,{binSuffix:"end"}))}]]`:`${s}[${H(d.field)}]`}).join(", ");l+=`fields: ${r}, values: [${f}]`}const c=t.events;return n.concat([{name:i+Bo,on:c?[{events:c,update:`${u} ? {${l}} : null`,force:!0}]:[]}])}};function Hu({model:e,channelDef:t,vgChannel:n,invalidValueRef:i,mainRefFn:r}){const o=yf(t)&&t.condition;let s=[];o&&(s=X(o).map(l=>{const c=r(l);if(ire(l)){const{param:f,empty:d}=l;return{test:EL(e,{param:f,empty:d}),...c}}else return{test:tg(e,l.test),...c}})),i!==void 0&&s.push(i);const a=r(t);return a!==void 0&&s.push(a),s.length>1||s.length===1&&s[0].test?{[n]:s}:s.length===1?{[n]:s[0]}:{}}function eE(e,t="text"){const n=e.encoding[t];return Hu({model:e,channelDef:n,vgChannel:t,mainRefFn:i=>Yp(i,e.config),invalidValueRef:void 0})}function Yp(e,t,n="datum"){if(e){if(_i(e))return Ue(e.value);if(ce(e)){const{format:i,formatType:r}=Xh(e);return Rw({fieldOrDatumDef:e,format:i,formatType:r,expr:n,config:t})}}}function oL(e,t={}){const{encoding:n,markDef:i,config:r,stack:o}=e,s=n.tooltip;if(P(s))return{tooltip:W$({tooltip:s},o,r,t)};{const a=t.reactiveGeom?"datum.datum":"datum";return Hu({model:e,channelDef:s,vgChannel:"tooltip",mainRefFn:l=>{const c=Yp(l,r,a);if(c)return c;if(l===null)return;let f=Oe("tooltip",i,r);if(f===!0&&(f={content:"encoding"}),K(f))return{value:f};if(Y(f))return te(f)?f:f.content==="encoding"?W$(n,o,r,t):{signal:a}},invalidValueRef:void 0})}}function sL(e,t,n,{reactiveGeom:i}={}){const r={...n,...n.tooltipFormat},o=new Set,s=i?"datum.datum":"datum",a=[];function u(c,f){const d=aa(f),h=cn(c)?c:{...c,type:e[d].type},g=h.title||Iw(h,r),p=X(g).join(", ").replaceAll(/"/g,'\\"');let m;if(tt(f)){const y=f==="x"?"x2":"y2",b=Ai(e[y]);if(Et(h.bin)&&b){const v=V(h,{expr:s}),x=V(b,{expr:s}),{format:E,formatType:S}=Xh(h);m=pf(v,x,E,S,r),o.add(y)}}if((tt(f)||f===oi||f===Mi)&&t&&t.fieldChannel===f&&t.offset==="normalize"){const{format:y,formatType:b}=Xh(h);m=Rw({fieldOrDatumDef:h,format:y,formatType:b,expr:s,config:r,normalizeStack:!0}).signal}m??(m=Yp(h,r,s).signal),a.push({channel:f,key:p,value:m})}Bw(e,(c,f)=>{q(c)?u(c,f):Ip(c)&&u(c.condition,f)});const l={};for(const{channel:c,key:f,value:d}of a)!o.has(c)&&!l[f]&&(l[f]=d);return l}function W$(e,t,n,{reactiveGeom:i}={}){const r=sL(e,t,n,{reactiveGeom:i}),o=Lo(r).map(([s,a])=>`"${s}": ${a}`);return o.length>0?{signal:`{${o.join(", ")}}`}:void 0}function pse(e){const{markDef:t,config:n}=e,i=Oe("aria",t,n);return i===!1?{}:{...i?{aria:i}:{},...mse(e),...yse(e)}}function mse(e){const{mark:t,markDef:n,config:i}=e;if(i.aria===!1)return{};const r=Oe("ariaRoleDescription",n,i);return r!=null?{ariaRoleDescription:{value:r}}:J(qte,t)?{}:{ariaRoleDescription:{value:t}}}function yse(e){const{encoding:t,markDef:n,config:i,stack:r}=e,o=t.description;if(o)return Hu({model:e,channelDef:o,vgChannel:"description",mainRefFn:u=>Yp(u,e.config),invalidValueRef:void 0});const s=Oe("description",n,i);if(s!=null)return{description:Ue(s)};if(i.aria===!1)return{};const a=sL(t,r,i);if(!Re(a))return{description:{signal:Lo(a).map(([u,l],c)=>`"${c>0?"; ":""}${u}: " + (${l})`).join(" + ")}}}function At(e,t,n={}){const{markDef:i,encoding:r,config:o}=t,{vgChannel:s}=n;let{defaultRef:a,defaultValue:u}=n;const l=r[e];a===void 0&&(u??(u=Oe(e,i,o,{vgChannel:s,ignoreVgConfig:!yf(l)})),u!==void 0&&(a=Ue(u)));const c={markDef:i,config:o,scaleName:t.scaleName(e),scale:t.getScaleComponent(e)},f=K3({...c,scaleChannel:e,channelDef:l});return Hu({model:t,channelDef:l,vgChannel:s??e,invalidValueRef:f,mainRefFn:h=>Ow({...c,channel:e,channelDef:h,stack:null,defaultRef:a})})}function aL(e,t={filled:void 0}){const{markDef:n,encoding:i,config:r}=e,{type:o}=n,s=t.filled??Oe("filled",n,r),a=ve(["bar","point","circle","square","geoshape"],o)?"transparent":void 0,u=Oe(s===!0?"color":void 0,n,r,{vgChannel:"fill"})??r.mark[s===!0&&"color"]??a,l=Oe(s===!1?"color":void 0,n,r,{vgChannel:"stroke"})??r.mark[s===!1&&"color"],c=s?"fill":"stroke",f={...u?{fill:Ue(u)}:{},...l?{stroke:Ue(l)}:{}};return n.color&&(s?n.fill:n.stroke)&&j(w3("property",{fill:"fill"in n,stroke:"stroke"in n})),{...f,...At("color",e,{vgChannel:c,defaultValue:s?u:l}),...At("fill",e,{defaultValue:i.fill?u:void 0}),...At("stroke",e,{defaultValue:i.stroke?l:void 0})}}function bse(e){const{encoding:t,mark:n}=e,i=t.order;return!es(n)&&_i(i)?Hu({model:e,channelDef:i,vgChannel:"zindex",mainRefFn:r=>Ue(r.value),invalidValueRef:void 0}):{}}function wu({channel:e,markDef:t,encoding:n={},model:i,bandPosition:r}){const o=`${e}Offset`,s=t[o],a=n[o];if((o==="xOffset"||o==="yOffset")&&a)return{offsetType:"encoding",offset:Ow({channel:o,channelDef:a,markDef:t,config:i==null?void 0:i.config,scaleName:i.scaleName(o),scale:i.getScaleComponent(o),stack:null,defaultRef:Ue(s),bandPosition:r})};const u=t[o];return u?{offsetType:"visual",offset:u}:{}}function on(e,t,{defaultPos:n,vgChannel:i}){const{encoding:r,markDef:o,config:s,stack:a}=t,u=r[e],l=r[mr(e)],c=t.scaleName(e),f=t.getScaleComponent(e),{offset:d,offsetType:h}=wu({channel:e,markDef:o,encoding:r,model:t,bandPosition:.5}),g=tE({model:t,defaultPos:n,channel:e,scaleName:c,scale:f}),p=!u&&tt(e)&&(r.latitude||r.longitude)?{field:t.getName(e)}:vse({channel:e,channelDef:u,channel2Def:l,markDef:o,config:s,scaleName:c,scale:f,stack:a,offset:d,defaultRef:g,bandPosition:h==="encoding"?0:void 0});return p?{[i||e]:p}:void 0}function vse(e){const{channel:t,channelDef:n,scaleName:i,stack:r,offset:o,markDef:s}=e;if(ce(n)&&r&&t===r.fieldChannel){if(q(n)){let a=n.bandPosition;if(a===void 0&&s.type==="text"&&(t==="radius"||t==="theta")&&(a=.5),a!==void 0)return Gh({scaleName:i,fieldOrDatumDef:n,startSuffix:"start",bandPosition:a,offset:o})}return Cs(n,i,{suffix:"end"},{offset:o})}return Dw(e)}function tE({model:e,defaultPos:t,channel:n,scaleName:i,scale:r}){const{markDef:o,config:s}=e;return()=>{const a=aa(n),u=Po(n),l=Oe(n,o,s,{vgChannel:u});if(l!==void 0)return nc(n,l);switch(t){case"zeroOrMin":return H$({scaleName:i,scale:r,mode:"zeroOrMin",mainChannel:a,config:s});case"zeroOrMax":return H$({scaleName:i,scale:r,mode:{zeroOrMax:{widthSignal:e.width.signal,heightSignal:e.height.signal}},mainChannel:a,config:s});case"mid":return{...e[_n(n)],mult:.5}}}}function H$({mainChannel:e,config:t,...n}){const i=X3(n),{mode:r}=n;if(i)return i;switch(e){case"radius":{if(r==="zeroOrMin")return{value:0};const{widthSignal:o,heightSignal:s}=r.zeroOrMax;return{signal:`min(${o},${s})/2`}}case"theta":return r==="zeroOrMin"?{value:0}:{signal:"2*PI"};case"x":return r==="zeroOrMin"?{value:0}:{field:{group:"width"}};case"y":return r==="zeroOrMin"?{field:{group:"height"}}:{value:0}}}const xse={left:"x",center:"xc",right:"x2"},wse={top:"y",middle:"yc",bottom:"y2"};function uL(e,t,n,i="middle"){if(e==="radius"||e==="theta")return Po(e);const r=e==="x"?"align":"baseline",o=Oe(r,t,n);let s;return te(o)?(j(wne(r)),s=void 0):s=o,e==="x"?xse[s||(i==="top"?"left":"center")]:wse[s||i]}function Zh(e,t,{defaultPos:n,defaultPos2:i,range:r}){return r?lL(e,t,{defaultPos:n,defaultPos2:i}):on(e,t,{defaultPos:n})}function lL(e,t,{defaultPos:n,defaultPos2:i}){const{markDef:r,config:o}=t,s=mr(e),a=_n(e),u=Ese(t,i,s),l=u[a]?uL(e,r,o):Po(e);return{...on(e,t,{defaultPos:n,vgChannel:l}),...u}}function Ese(e,t,n){const{encoding:i,mark:r,markDef:o,stack:s,config:a}=e,u=aa(n),l=_n(n),c=Po(n),f=i[u],d=e.scaleName(u),h=e.getScaleComponent(u),{offset:g}=n in i||n in o?wu({channel:n,markDef:o,encoding:i,model:e}):wu({channel:u,markDef:o,encoding:i,model:e});if(!f&&(n==="x2"||n==="y2")&&(i.latitude||i.longitude)){const m=_n(n),y=e.markDef[m];return y!=null?{[m]:{value:y}}:{[c]:{field:e.getName(n)}}}const p=Sse({channel:n,channelDef:f,channel2Def:i[n],markDef:o,config:a,scaleName:d,scale:h,stack:s,offset:g,defaultRef:void 0});return p!==void 0?{[c]:p}:Qf(n,o)||Qf(n,{[n]:My(n,o,a.style),[l]:My(l,o,a.style)})||Qf(n,a[r])||Qf(n,a.mark)||{[c]:tE({model:e,defaultPos:t,channel:n,scaleName:d,scale:h})()}}function Sse({channel:e,channelDef:t,channel2Def:n,markDef:i,config:r,scaleName:o,scale:s,stack:a,offset:u,defaultRef:l}){return ce(t)&&a&&e.charAt(0)===a.fieldChannel.charAt(0)?Cs(t,o,{suffix:"start"},{offset:u}):Dw({channel:e,channelDef:n,scaleName:o,scale:s,stack:a,markDef:i,config:r,offset:u,defaultRef:l})}function Qf(e,t){const n=_n(e),i=Po(e);if(t[i]!==void 0)return{[i]:nc(e,t[i])};if(t[e]!==void 0)return{[i]:nc(e,t[e])};if(t[n]){const r=t[n];if(Vs(r))j(pne(n));else return{[n]:nc(e,r)}}}function Hr(e,t){const{config:n,encoding:i,markDef:r}=e,o=r.type,s=mr(t),a=_n(t),u=i[t],l=i[s],c=e.getScaleComponent(t),f=c?c.get("type"):void 0,d=r.orient,h=i[a]??i.size??Oe("size",r,n,{vgChannel:a}),g=o3(t),p=o==="bar"&&(t==="x"?d==="vertical":d==="horizontal")||o==="tick"&&(t==="y"?d==="vertical":d==="horizontal");return q(u)&&(ze(u.bin)||Et(u.bin)||u.timeUnit&&!l)&&!(h&&!Vs(h))&&!i[g]&&!yt(f)?$se({fieldDef:u,fieldDef2:l,channel:t,model:e}):(ce(u)&&yt(f)||p)&&!l?Ase(u,t,e):lL(t,e,{defaultPos:"zeroOrMax",defaultPos2:"zeroOrMin"})}function _se(e,t,n,i,r,o,s){if(Vs(r))if(n){const u=n.get("type");if(u==="band"){let l=`bandwidth('${t}')`;r.band!==1&&(l=`${r.band} * ${l}`);const c=rr("minBandSize",{type:s},i);return{signal:c?`max(${mi(c)}, ${l})`:l}}else r.band!==1&&(j(Ane(u)),r=void 0)}else return{mult:r.band,field:{group:e}};else{if(te(r))return r;if(r)return{value:r}}if(n){const u=n.get("range");if(la(u)&&Ae(u.step))return{value:u.step-2}}if(!o){const{bandPaddingInner:u,barBandPaddingInner:l,rectBandPaddingInner:c,tickBandPaddingInner:f}=i.scale,d=et(u,s==="tick"?f:s==="bar"?l:c);if(te(d))return{signal:`(1 - (${d.signal})) * ${e}`};if(Ae(d))return{signal:`${1-d} * ${e}`}}return{value:Iy(i.view,e)-2}}function Ase(e,t,n){var A,k;const{markDef:i,encoding:r,config:o,stack:s}=n,a=i.orient,u=n.scaleName(t),l=n.getScaleComponent(t),c=_n(t),f=mr(t),d=o3(t),h=n.scaleName(d),g=n.getScaleComponent(aw(t)),p=i.type==="tick"||a==="horizontal"&&t==="y"||a==="vertical"&&t==="x";let m;(r.size||i.size)&&(p?m=At("size",n,{vgChannel:c,defaultRef:Ue(i.size)}):j(Fne(i.type)));const y=!!m,b=i5({channel:t,fieldDef:e,markDef:i,config:o,scaleType:(A=l||g)==null?void 0:A.get("type"),useVlSizeChannel:p});m=m||{[c]:_se(c,h||u,g||l,o,b,!!e,i.type)};const v=((k=l||g)==null?void 0:k.get("type"))==="band"&&Vs(b)&&!y?"top":"middle",x=uL(t,i,o,v),E=x==="xc"||x==="yc",{offset:S,offsetType:w}=wu({channel:t,markDef:i,encoding:r,model:n,bandPosition:E?.5:0}),_=Dw({channel:t,channelDef:e,markDef:i,config:o,scaleName:u,scale:l,stack:s,offset:S,defaultRef:tE({model:n,defaultPos:"mid",channel:t,scaleName:u,scale:l}),bandPosition:E?w==="encoding"?0:.5:te(b)?{signal:`(1-${b})/2`}:Vs(b)?(1-b.band)/2:0});if(c)return{[x]:_,...m};{const C=Po(f),O=m[c],M=S?{...O,offset:S}:O;return{[x]:_,[C]:P(_)?[_[0],{..._[1],offset:M}]:{..._,offset:M}}}}function G$(e,t,n,i,r,o,s){if(ZN(e))return 0;const a=e==="x"||e==="y2",u=a?-t/2:t/2;if(te(n)||te(r)||te(i)||o){const l=mi(n),c=mi(r),f=mi(i),d=mi(o),g=o?`(${s} < ${d} ? ${a?"":"-"}0.5 * (${d} - (${s})) : ${u})`:u,p=f?`${f} + `:"",m=l?`(${l} ? -1 : 1) * `:"",y=c?`(${c} + ${g})`:g;return{signal:p+m+y}}else return r=r||0,i+(n?-r-u:+r+u)}function $se({fieldDef:e,fieldDef2:t,channel:n,model:i}){var k;const{config:r,markDef:o,encoding:s}=i,a=i.getScaleComponent(n),u=i.scaleName(n),l=a?a.get("type"):void 0,c=a.get("reverse"),f=i5({channel:n,fieldDef:e,markDef:o,config:r,scaleType:l}),d=(k=i.component.axes[n])==null?void 0:k[0],h=(d==null?void 0:d.get("translate"))??.5,g=tt(n)?Oe("binSpacing",o,r)??0:0,p=mr(n),m=Po(n),y=Po(p),b=rr("minBandSize",o,r),{offset:v}=wu({channel:n,markDef:o,encoding:s,model:i,bandPosition:0}),{offset:x}=wu({channel:p,markDef:o,encoding:s,model:i,bandPosition:0}),E=Jie({fieldDef:e,scaleName:u}),S=G$(n,g,c,h,v,b,E),w=G$(p,g,c,h,x??v,b,E),_=te(f)?{signal:`(1-${f.signal})/2`}:Vs(f)?(1-f.band)/2:.5,A=Io({fieldDef:e,fieldDef2:t,markDef:o,config:r});if(ze(e.bin)||e.timeUnit){const C=e.timeUnit&&A!==.5;return{[y]:V$({fieldDef:e,scaleName:u,bandPosition:_,offset:w,useRectOffsetField:C}),[m]:V$({fieldDef:e,scaleName:u,bandPosition:te(_)?{signal:`1-${_.signal}`}:1-_,offset:S,useRectOffsetField:C})}}else if(Et(e.bin)){const C=Cs(e,u,{},{offset:w});if(q(t))return{[y]:C,[m]:Cs(t,u,{},{offset:S})};if(ua(e.bin)&&e.bin.step)return{[y]:C,[m]:{signal:`scale("${u}", ${V(e,{expr:"datum"})} + ${e.bin.step})`,offset:S}}}j(_3(p))}function V$({fieldDef:e,scaleName:t,bandPosition:n,offset:i,useRectOffsetField:r}){return Gh({scaleName:t,fieldOrDatumDef:e,bandPosition:n,offset:i,...r?{startSuffix:Gp,endSuffix:Vp}:{}})}const kse=new Set(["aria","width","height"]);function si(e,t){const{fill:n=void 0,stroke:i=void 0}=t.color==="include"?aL(e):{};return{...Cse(e.markDef,t),...Y$("fill",n),...Y$("stroke",i),...At("opacity",e),...At("fillOpacity",e),...At("strokeOpacity",e),...At("strokeWidth",e),...At("strokeDash",e),...bse(e),...oL(e),...eE(e,"href"),...pse(e)}}function Y$(e,t){return t?{[e]:t}:{}}function Cse(e,t){return jte.reduce((n,i)=>(!kse.has(i)&&U(e,i)&&t[i]!=="ignore"&&(n[i]=Ue(e[i])),n),{})}function nE(e){const{config:t,markDef:n}=e,i=new Set;if(e.forEachFieldDef((r,o)=>{var l;let s;if(!yr(o)||!(s=e.getScaleType(o)))return;const a=kp(r.aggregate),u=Mw({scaleChannel:o,markDef:n,config:t,scaleType:s,isCountAggregate:a});if(Yie(u)){const c=e.vgField(o,{expr:"datum",binSuffix:(l=e.stack)!=null&&l.impute?"mid":void 0});c&&i.add(c)}}),i.size>0)return{defined:{signal:[...i].map(o=>Mp(o,!0)).join(" && ")}}}function X$(e,t){if(t!==void 0)return{[e]:Ue(t)}}const _0="voronoi",cL={defined:e=>e.type==="point"&&e.nearest,parse:(e,t)=>{if(t.events)for(const n of t.events)n.markname=e.getName(_0)},marks:(e,t,n)=>{const{x:i,y:r}=t.project.hasChannel,o=e.mark;if(es(o))return j(Yte(o)),n;const s={name:e.getName(_0),type:"path",interactive:!0,from:{data:e.getName("marks")},encode:{update:{fill:{value:"transparent"},strokeWidth:{value:.35},stroke:{value:"transparent"},isVoronoi:{value:!0},...oL(e,{reactiveGeom:!0})}},transform:[{type:"voronoi",x:{expr:i||!r?"datum.datum.x || 0":"0"},y:{expr:r||!i?"datum.datum.y || 0":"0"},size:[e.getSizeSignalRef("width"),e.getSizeSignalRef("height")]}]};let a=0,u=!1;return n.forEach((l,c)=>{const f=l.name??"";f===e.component.mark[0].name?a=c:f.includes(_0)&&(u=!0)}),u||n.splice(a+1,0,s),n}},fL={defined:e=>e.type==="point"&&e.resolve==="global"&&e.bind&&e.bind!=="scales"&&!Gw(e.bind),parse:(e,t,n)=>vL(t,n),topLevelSignals:(e,t,n)=>{const i=t.name,r=t.project,o=t.bind,s=t.init&&t.init[0],a=cL.defined(t)?"(item().isVoronoi ? datum.datum : datum)":"datum";return r.items.forEach((u,l)=>{const c=qe(`${i}_${u.field}`);n.filter(d=>d.name===c).length||n.unshift({name:c,...s?{init:Xs(s[l])}:{value:null},on:t.events?[{events:t.events,update:`datum && item().mark.marktype !== 'group' ? ${a}[${H(u.field)}] : null`}]:[],bind:o[u.field]??o[u.channel]??o})}),n},signals:(e,t,n)=>{const i=t.name,r=t.project,o=n.find(l=>l.name===i+Bo),s=i+wf,a=r.items.map(l=>qe(`${i}_${l.field}`)),u=a.map(l=>`${l} !== null`).join(" && ");return a.length&&(o.update=`${u} ? {fields: ${s}, values: [${a.join(", ")}]} : null`),delete o.value,delete o.on,n}},eg="_toggle",dL={defined:e=>e.type==="point"&&!!e.toggle,signals:(e,t,n)=>n.concat({name:t.name+eg,value:!1,on:[{events:t.events,update:t.toggle}]}),modifyExpr:(e,t)=>{const n=t.name+Bo,i=t.name+eg;return`${i} ? null : ${n}, `+(t.resolve==="global"?`${i} ? null : true, `:`${i} ? null : {unit: ${Ts(e)}}, `)+`${i} ? ${n} : null`}},Fse={defined:e=>e.clear!==void 0&&e.clear!==!1,parse:(e,t)=>{t.clear&&(t.clear=K(t.clear)?Vo(t.clear,"view"):t.clear)},topLevelSignals:(e,t,n)=>{if(fL.defined(t))for(const i of t.project.items){const r=n.findIndex(o=>o.name===qe(`${t.name}_${i.field}`));r!==-1&&n[r].on.push({events:t.clear,update:"null"})}return n},signals:(e,t,n)=>{function i(r,o){r!==-1&&n[r].on&&n[r].on.push({events:t.clear,update:o})}if(t.type==="interval")for(const r of t.project.items){const o=n.findIndex(s=>s.name===r.signals.visual);if(i(o,"[0, 0]"),o===-1){const s=n.findIndex(a=>a.name===r.signals.data);i(s,"null")}}else{let r=n.findIndex(o=>o.name===t.name+Bo);i(r,"null"),dL.defined(t)&&(r=n.findIndex(o=>o.name===t.name+eg),i(r,"false"))}return n}},hL={defined:e=>{const t=e.resolve==="global"&&e.bind&&Gw(e.bind),n=e.project.items.length===1&&e.project.items[0].field!==$i;return t&&!n&&j(Qte),t&&n},parse:(e,t,n)=>{const i=le(n);if(i.select=K(i.select)?{type:i.select,toggle:t.toggle}:{...i.select,toggle:t.toggle},vL(t,i),Y(n.select)&&(n.select.on||n.select.clear)){const s='event.item && indexof(event.item.mark.role, "legend") < 0';for(const a of t.events)a.filter=X(a.filter??[]),a.filter.includes(s)||a.filter.push(s)}const r=x0(t.bind)?t.bind.legend:"click",o=K(r)?Vo(r,"view"):X(r);t.bind={legend:{merge:o}}},topLevelSignals:(e,t,n)=>{const i=t.name,r=x0(t.bind)&&t.bind.legend,o=s=>a=>{const u=le(a);return u.markname=s,u};for(const s of t.project.items){if(!s.hasLegend)continue;const a=`${qe(s.field)}_legend`,u=`${i}_${a}`;if(n.filter(c=>c.name===u).length===0){const c=r.merge.map(o(`${a}_symbols`)).concat(r.merge.map(o(`${a}_labels`))).concat(r.merge.map(o(`${a}_entries`)));n.unshift({name:u,...t.init?{}:{value:null},on:[{events:c,update:"isDefined(datum.value) ? datum.value : item().items[0].items[0].datum.value",force:!0},{events:r.merge,update:`!event.item || !datum ? null : ${u}`,force:!0}]})}}return n},signals:(e,t,n)=>{const i=t.name,r=t.project,o=n.find(d=>d.name===i+Bo),s=i+wf,a=r.items.filter(d=>d.hasLegend).map(d=>qe(`${i}_${qe(d.field)}_legend`)),l=`${a.map(d=>`${d} !== null`).join(" && ")} ? {fields: ${s}, values: [${a.join(", ")}]} : null`;t.events&&a.length>0?o.on.push({events:a.map(d=>({signal:d})),update:l}):a.length>0&&(o.update=l,delete o.value,delete o.on);const c=n.find(d=>d.name===i+eg),f=x0(t.bind)&&t.bind.legend;return c&&(t.events?c.on.push({...c.on[0],events:f}):c.on[0].events=f),n}};function Tse(e,t,n){var r;const i=(r=e.fieldDef(t))==null?void 0:r.field;for(const o of Ft(e.component.selection??{})){const s=o.project.hasField[i]??o.project.hasChannel[t];if(s&&hL.defined(o)){const a=n.get("selections")??[];a.push(o.name),n.set("selections",a,!1),s.hasLegend=!0}}}const gL="_translate_anchor",pL="_translate_delta",Mse={defined:e=>e.type==="interval"&&e.translate,signals:(e,t,n)=>{const i=t.name,r=zr.defined(t),o=i+gL,{x:s,y:a}=t.project.hasChannel;let u=Vo(t.translate,"scope");return r||(u=u.map(l=>(l.between[0].markname=i+Wa,l))),n.push({name:o,value:{},on:[{events:u.map(l=>l.between[0]),update:"{x: x(unit), y: y(unit)"+(s!==void 0?`, extent_x: ${r?jy(e,We):`slice(${s.signals.visual})`}`:"")+(a!==void 0?`, extent_y: ${r?jy(e,vt):`slice(${a.signals.visual})`}`:"")+"}"}]},{name:i+pL,value:{},on:[{events:u,update:`{x: ${o}.x - x(unit), y: ${o}.y - y(unit)}`}]}),s!==void 0&&K$(e,t,s,"width",n),a!==void 0&&K$(e,t,a,"height",n),n}};function K$(e,t,n,i,r){const o=t.name,s=o+gL,a=o+pL,u=n.channel,l=zr.defined(t),c=r.find(E=>E.name===n.signals[l?"data":"visual"]),f=e.getSizeSignalRef(i).signal,d=e.getScaleComponent(u),h=d&&d.get("type"),g=d&&d.get("reverse"),p=l?u===We?g?"":"-":g?"-":"":"",m=`${s}.extent_${u}`,y=`${p}${a}.${u} / ${l?`${f}`:`span(${m})`}`,b=!l||!d?"panLinear":h==="log"?"panLog":h==="symlog"?"panSymlog":h==="pow"?"panPow":"panLinear",v=l?h==="pow"?`, ${d.get("exponent")??1}`:h==="symlog"?`, ${d.get("constant")??1}`:"":"",x=`${b}(${m}, ${y}${v})`;c.on.push({events:{signal:a},update:l?x:`clampRange(${x}, 0, ${f})`})}const mL="_zoom_anchor",yL="_zoom_delta",Dse={defined:e=>e.type==="interval"&&e.zoom,signals:(e,t,n)=>{const i=t.name,r=zr.defined(t),o=i+yL,{x:s,y:a}=t.project.hasChannel,u=H(e.scaleName(We)),l=H(e.scaleName(vt));let c=Vo(t.zoom,"scope");return r||(c=c.map(f=>(f.markname=i+Wa,f))),n.push({name:i+mL,on:[{events:c,update:r?"{"+[u?`x: invert(${u}, x(unit))`:"",l?`y: invert(${l}, y(unit))`:""].filter(f=>f).join(", ")+"}":"{x: x(unit), y: y(unit)}"}]},{name:o,on:[{events:c,force:!0,update:"pow(1.001, event.deltaY * pow(16, event.deltaMode))"}]}),s!==void 0&&J$(e,t,s,"width",n),a!==void 0&&J$(e,t,a,"height",n),n}};function J$(e,t,n,i,r){const o=t.name,s=n.channel,a=zr.defined(t),u=r.find(b=>b.name===n.signals[a?"data":"visual"]),l=e.getSizeSignalRef(i).signal,c=e.getScaleComponent(s),f=c&&c.get("type"),d=a?jy(e,s):u.name,h=o+yL,g=`${o}${mL}.${s}`,p=!a||!c?"zoomLinear":f==="log"?"zoomLog":f==="symlog"?"zoomSymlog":f==="pow"?"zoomPow":"zoomLinear",m=a?f==="pow"?`, ${c.get("exponent")??1}`:f==="symlog"?`, ${c.get("constant")??1}`:"":"",y=`${p}(${d}, ${g}, ${h}${m})`;u.on.push({events:{signal:h},update:a?y:`clampRange(${y}, 0, ${l})`})}const Ks="_store",Bo="_tuple",Ose="_modify",bL="vlSelectionResolve",Xp=[gse,dse,cse,dL,fL,zr,hL,Fse,Mse,Dse,cL];function Rse(e){let t=e.parent;for(;t&&!Ln(t);)t=t.parent;return t}function Ts(e,{escape:t}={escape:!0}){let n=t?H(e.name):e.name;const i=Rse(e);if(i){const{facet:r}=i;for(const o of Xn)r[o]&&(n+=` + '__facet_${o}_' + (facet[${H(i.vgField(o))}])`)}return n}function iE(e){return Ft(e.component.selection??{}).reduce((t,n)=>t||n.project.hasSelectionId,!1)}function vL(e,t){(K(t.select)||!t.select.on)&&delete e.events,(K(t.select)||!t.select.clear)&&delete e.clear,(K(t.select)||!t.select.toggle)&&delete e.toggle}function qy(e){const t=[];return e.type==="Identifier"?[e.name]:e.type==="Literal"?[e.value]:(e.type==="MemberExpression"&&(t.push(...qy(e.object)),t.push(...qy(e.property))),t)}function xL(e){return e.object.type==="MemberExpression"?xL(e.object):e.object.name==="datum"}function wL(e){const t=S2(e),n=new Set;return t.visit(i=>{i.type==="MemberExpression"&&xL(i)&&n.add(qy(i).slice(1).join("."))}),n}class Gu extends De{clone(){return new Gu(null,this.model,le(this.filter))}constructor(t,n,i){super(t),this.model=n,this.filter=i,this.expr=tg(this.model,this.filter,this),this._dependentFields=wL(this.expr)}dependentFields(){return this._dependentFields}producedFields(){return new Set}assemble(){return{type:"filter",expr:this.expr}}hash(){return`Filter ${this.expr}`}}function Nse(e,t){const n={},i=e.config.selection;if(!t||!t.length)return n;for(const r of t){const o=qe(r.name),s=r.select,a=K(s)?s:s.type,u=Y(s)?le(s):{type:a},l=i[a];for(const d in l)d==="fields"||d==="encodings"||(d==="mark"&&(u.mark={...l.mark,...u.mark}),(u[d]===void 0||u[d]===!0)&&(u[d]=le(l[d]??u[d])));const c=n[o]={...u,name:o,type:a,init:r.value,bind:r.bind,events:K(u.on)?Vo(u.on,"scope"):X(le(u.on))},f=le(r);for(const d of Xp)d.defined(c)&&d.parse&&d.parse(e,c,f)}return n}function EL(e,t,n,i="datum"){const r=K(t)?t:t.param,o=qe(r),s=H(o+Ks);let a;try{a=e.getSelectionComponent(o,r)}catch{return`!!${o}`}if(a.project.timeUnit){const d=n??e.component.data.raw,h=a.project.timeUnit.clone();d.parent?h.insertAsParentOf(d):d.parent=h}const u=a.project.hasSelectionId?"vlSelectionIdTest(":"vlSelectionTest(",l=a.resolve==="global"?")":`, ${H(a.resolve)})`,c=`${u}${s}, ${i}${l}`,f=`length(data(${s}))`;return t.empty===!1?`${f} && ${c}`:`!${f} || ${c}`}function SL(e,t,n){const i=qe(t),r=n.encoding;let o=n.field,s;try{s=e.getSelectionComponent(i,t)}catch{return i}if(!r&&!o)o=s.project.items[0].field,s.project.items.length>1&&j(`A "field" or "encoding" must be specified when using a selection as a scale domain. Using "field": ${H(o)}.`);else if(r&&!o){const a=s.project.items.filter(u=>u.channel===r);!a.length||a.length>1?(o=s.project.items[0].field,j((a.length?"Multiple ":"No ")+`matching ${H(r)} encoding found for selection ${H(n.param)}. Using "field": ${H(o)}.`)):o=a[0].field}return`${s.name}[${H(ni(o))}]`}function Lse(e,t){for(const[n,i]of Lo(e.component.selection??{})){const r=e.getName(`lookup_${n}`);e.component.data.outputNodes[r]=i.materialized=new bn(new Gu(t,e,{param:n}),r,Ke.Lookup,e.component.data.outputNodeRefCounts)}}function tg(e,t,n){return tc(t,i=>K(i)?i:die(i)?EL(e,i,n):L3(i))}function Pse(e,t){if(e)return P(e)&&!co(e)?e.map(n=>Iw(n,t)).join(", "):e}function A0(e,t,n,i){var r,o;e.encode??(e.encode={}),(r=e.encode)[t]??(r[t]={}),(o=e.encode[t]).update??(o.update={}),e.encode[t].update[n]=i}function Ul(e,t,n,i={header:!1}){var f,d;const{disable:r,orient:o,scale:s,labelExpr:a,title:u,zindex:l,...c}=e.combine();if(!r){for(const h in c){const g=h,p=yre[g],m=c[g];if(p&&p!==t&&p!=="both")delete c[g];else if(xf(m)){const{condition:y,...b}=m,v=X(y),x=_$[g];if(x){const{vgProp:E,part:S}=x,w=[...v.map(_=>{const{test:A,...k}=_;return{test:tg(null,A),...k}}),b];A0(c,S,E,w),delete c[g]}else if(x===null){const E={signal:v.map(S=>{const{test:w,..._}=S;return`${tg(null,w)} ? ${u$(_)} : `}).join("")+u$(b)};c[g]=E}}else if(te(m)){const y=_$[g];if(y){const{vgProp:b,part:v}=y;A0(c,v,b,m),delete c[g]}}ve(["labelAlign","labelBaseline"],g)&&c[g]===null&&delete c[g]}if(t==="grid"){if(!c.grid)return;if(c.encode){const{grid:h}=c.encode;c.encode={...h?{grid:h}:{}},Re(c.encode)&&delete c.encode}return{scale:s,orient:o,...c,domain:!1,labels:!1,aria:!1,maxExtent:0,minExtent:0,ticks:!1,zindex:et(l,0)}}else{if(!i.header&&e.mainExtracted)return;if(a!==void 0){let g=a;(d=(f=c.encode)==null?void 0:f.labels)!=null&&d.update&&te(c.encode.labels.update.text)&&(g=qs(a,"datum.label",c.encode.labels.update.text.signal)),A0(c,"labels","text",{signal:g})}if(c.labelAlign===null&&delete c.labelAlign,c.encode){for(const g of h5)e.hasAxisPart(g)||delete c.encode[g];Re(c.encode)&&delete c.encode}const h=Pse(u,n);return{scale:s,orient:o,grid:!1,...h?{title:h}:{},...c,...n.aria===!1?{aria:!1}:{},zindex:et(l,0)}}}}function _L(e){const{axes:t}=e.component,n=[];for(const i of Qr)if(t[i]){for(const r of t[i])if(!r.get("disable")&&!r.get("gridScale")){const o=i==="x"?"height":"width",s=e.getSizeSignalRef(o).signal;o!==s&&n.push({name:o,update:s})}}return n}function Ise(e,t){const{x:n=[],y:i=[]}=e;return[...n.map(r=>Ul(r,"grid",t)),...i.map(r=>Ul(r,"grid",t)),...n.map(r=>Ul(r,"main",t)),...i.map(r=>Ul(r,"main",t))].filter(r=>r)}function Q$(e,t,n,i){return Object.assign.apply(null,[{},...e.map(r=>{if(r==="axisOrient"){const o=n==="x"?"bottom":"left",s=t[n==="x"?"axisBottom":"axisLeft"]||{},a=t[n==="x"?"axisTop":"axisRight"]||{},u=new Set([...B(s),...B(a)]),l={};for(const c of u.values())l[c]={signal:`${i.signal} === "${o}" ? ${mi(s[c])} : ${mi(a[c])}`};return l}return t[r]})])}function zse(e,t,n,i){const r=t==="band"?["axisDiscrete","axisBand"]:t==="point"?["axisDiscrete","axisPoint"]:B3(t)?["axisQuantitative"]:t==="time"||t==="utc"?["axisTemporal"]:[],o=e==="x"?"axisX":"axisY",s=te(n)?"axisOrient":`axis${lf(n)}`,a=[...r,...r.map(l=>o+l.substr(4))],u=["axis",s,o];return{vlOnlyAxisConfig:Q$(a,i,e,n),vgAxisConfig:Q$(u,i,e,n),axisConfigStyle:Bse([...u,...a],i)}}function Bse(e,t){var i;const n=[{}];for(const r of e){let o=(i=t[r])==null?void 0:i.style;if(o){o=X(o);for(const s of o)n.push(t.style[s])}}return Object.assign.apply(null,n)}function Wy(e,t,n,i={}){var o;const r=g3(e,n,t);if(r!==void 0)return{configFrom:"style",configValue:r};for(const s of["vlOnlyAxisConfig","vgAxisConfig","axisConfigStyle"])if(((o=i[s])==null?void 0:o[e])!==void 0)return{configFrom:s,configValue:i[s][e]};return{}}const Z$={scale:({model:e,channel:t})=>e.scaleName(t),format:({format:e})=>e,formatType:({formatType:e})=>e,grid:({fieldOrDatumDef:e,axis:t,scaleType:n})=>t.grid??Use(n,e),gridScale:({model:e,channel:t})=>jse(e,t),labelAlign:({axis:e,labelAngle:t,orient:n,channel:i})=>e.labelAlign||$L(t,n,i),labelAngle:({labelAngle:e})=>e,labelBaseline:({axis:e,labelAngle:t,orient:n,channel:i})=>e.labelBaseline||AL(t,n,i),labelFlush:({axis:e,fieldOrDatumDef:t,channel:n})=>e.labelFlush??Wse(t.type,n),labelOverlap:({axis:e,fieldOrDatumDef:t,scaleType:n})=>e.labelOverlap??Hse(t.type,n,q(t)&&!!t.timeUnit,q(t)?t.sort:void 0),orient:({orient:e})=>e,tickCount:({channel:e,model:t,axis:n,fieldOrDatumDef:i,scaleType:r})=>{const o=e==="x"?"width":e==="y"?"height":void 0,s=o?t.getSizeSignalRef(o):void 0;return n.tickCount??Vse({fieldOrDatumDef:i,scaleType:r,size:s,values:n.values})},tickMinStep:Yse,title:({axis:e,model:t,channel:n})=>{if(e.title!==void 0)return e.title;const i=kL(t,n);if(i!==void 0)return i;const r=t.typedFieldDef(n),o=n==="x"?"x2":"y2",s=t.fieldDef(o);return m3(r?[E$(r)]:[],q(s)?[E$(s)]:[])},values:({axis:e,fieldOrDatumDef:t})=>Xse(e,t),zindex:({axis:e,fieldOrDatumDef:t,mark:n})=>e.zindex??Kse(n,t)};function Use(e,t){return!yt(e)&&q(t)&&!ze(t==null?void 0:t.bin)&&!Et(t==null?void 0:t.bin)}function jse(e,t){const n=t==="x"?"y":"x";if(e.getScaleComponent(n))return e.scaleName(n)}function qse(e,t,n,i,r){const o=t==null?void 0:t.labelAngle;if(o!==void 0)return te(o)?o:$c(o);{const{configValue:s}=Wy("labelAngle",i,t==null?void 0:t.style,r);return s!==void 0?$c(s):n===We&&ve([$w,Aw],e.type)&&!(q(e)&&e.timeUnit)?270:void 0}}function Hy(e){return`(((${e.signal} % 360) + 360) % 360)`}function AL(e,t,n,i){if(e!==void 0)if(n==="x"){if(te(e)){const r=Hy(e),o=te(t)?`(${t.signal} === "top")`:t==="top";return{signal:`(45 < ${r} && ${r} < 135) || (225 < ${r} && ${r} < 315) ? "middle" :(${r} <= 45 || 315 <= ${r}) === ${o} ? "bottom" : "top"`}}if(45<e&&e<135||225<e&&e<315)return"middle";if(te(t)){const r=e<=45||315<=e?"===":"!==";return{signal:`${t.signal} ${r} "top" ? "bottom" : "top"`}}return(e<=45||315<=e)==(t==="top")?"bottom":"top"}else{if(te(e)){const r=Hy(e),o=te(t)?`(${t.signal} === "left")`:t==="left";return{signal:`${r} <= 45 || 315 <= ${r} || (135 <= ${r} && ${r} <= 225) ? ${i?'"middle"':"null"} : (45 <= ${r} && ${r} <= 135) === ${o} ? "top" : "bottom"`}}if(e<=45||315<=e||135<=e&&e<=225)return i?"middle":null;if(te(t)){const r=45<=e&&e<=135?"===":"!==";return{signal:`${t.signal} ${r} "left" ? "top" : "bottom"`}}return(45<=e&&e<=135)==(t==="left")?"top":"bottom"}}function $L(e,t,n){if(e===void 0)return;const i=n==="x",r=i?0:90,o=i?"bottom":"left";if(te(e)){const s=Hy(e),a=te(t)?`(${t.signal} === "${o}")`:t===o;return{signal:`(${r?`(${s} + 90)`:s} % 180 === 0) ? ${i?null:'"center"'} :(${r} < ${s} && ${s} < ${180+r}) === ${a} ? "left" : "right"`}}if((e+r)%180===0)return i?null:"center";if(te(t)){const s=r<e&&e<180+r?"===":"!==";return{signal:`${`${t.signal} ${s} "${o}"`} ? "left" : "right"`}}return(r<e&&e<180+r)==(t===o)?"left":"right"}function Wse(e,t){if(t==="x"&&ve(["quantitative","temporal"],e))return!0}function Hse(e,t,n,i){if(n&&!Y(i)||e!=="nominal"&&e!=="ordinal")return t==="log"||t==="symlog"?"greedy":!0}function Gse(e){return e==="x"?"bottom":"left"}function Vse({fieldOrDatumDef:e,scaleType:t,size:n,values:i}){var r;if(!i&&!yt(t)&&t!=="log"){if(q(e)){if(ze(e.bin))return{signal:`ceil(${n.signal}/10)`};if(e.timeUnit&&ve(["month","hours","day","quarter"],(r=mt(e.timeUnit))==null?void 0:r.unit))return}return{signal:`ceil(${n.signal}/40)`}}}function Yse({format:e,fieldOrDatumDef:t}){if(e==="d")return 1;if(q(t)){const{timeUnit:n}=t;if(n){const i=O3(n);if(i)return{signal:i}}}}function kL(e,t){const n=t==="x"?"x2":"y2",i=e.fieldDef(t),r=e.fieldDef(n),o=i?i.title:void 0,s=r?r.title:void 0;if(o&&s)return y3(o,s);if(o)return o;if(s)return s;if(o!==void 0)return o;if(s!==void 0)return s}function Xse(e,t){const n=e.values;if(P(n))return d5(t,n);if(te(n))return n}function Kse(e,t){return e==="rect"&&Yh(t)?1:0}class Eu extends De{clone(){return new Eu(null,le(this.transform))}constructor(t,n){super(t),this.transform=n,this._dependentFields=wL(this.transform.calculate)}static parseAllForSortIndex(t,n){return n.forEachFieldDef((i,r)=>{if(da(i)&&n5(i.sort)){const{field:o,timeUnit:s}=i,a=i.sort,u=a.map((l,c)=>`${L3({field:o,timeUnit:s,equal:l})} ? ${c} : `).join("")+a.length;t=new Eu(t,{calculate:u,as:Su(i,r,{forAs:!0})})}}),t}producedFields(){return new Set([this.transform.as])}dependentFields(){return this._dependentFields}assemble(){return{type:"formula",expr:this.transform.calculate,as:this.transform.as}}hash(){return`Calculate ${xe(this.transform)}`}}function Su(e,t,n){return V(e,{prefix:t,suffix:"sort_index",...n})}function Kp(e,t){return ve(["top","bottom"],t)?"column":ve(["left","right"],t)||e==="row"?"row":"column"}function _u(e,t,n,i){const r=i==="row"?n.headerRow:i==="column"?n.headerColumn:n.headerFacet;return et((t||{})[e],r[e],n.header[e])}function Jp(e,t,n,i){const r={};for(const o of e){const s=_u(o,t||{},n,i);s!==void 0&&(r[o]=s)}return r}const rE=["row","column"],oE=["header","footer"];function Jse(e,t){const n=e.component.layoutHeaders[t].title,i=e.config?e.config:void 0,r=e.component.layoutHeaders[t].facetFieldDef?e.component.layoutHeaders[t].facetFieldDef:void 0,{titleAnchor:o,titleAngle:s,titleOrient:a}=Jp(["titleAnchor","titleAngle","titleOrient"],r.header,i,t),u=Kp(t,a),l=$c(s);return{name:`${t}-title`,type:"group",role:`${u}-title`,title:{text:n,...t==="row"?{orient:"left"}:{},style:"guide-title",...FL(l,u),...CL(u,l,o),...TL(i,r,t,zre,M5)}}}function CL(e,t,n="middle"){switch(n){case"start":return{align:"left"};case"end":return{align:"right"}}const i=$L(t,e==="row"?"left":"top",e==="row"?"y":"x");return i?{align:i}:{}}function FL(e,t){const n=AL(e,t==="row"?"left":"top",t==="row"?"y":"x",!0);return n?{baseline:n}:{}}function Qse(e,t){const n=e.component.layoutHeaders[t],i=[];for(const r of oE)if(n[r])for(const o of n[r]){const s=eae(e,t,r,n,o);s!=null&&i.push(s)}return i}function Zse(e,t){const{sort:n}=e;return Ir(n)?{field:V(n,{expr:"datum"}),order:n.order??"ascending"}:P(n)?{field:Su(e,t,{expr:"datum"}),order:"ascending"}:{field:V(e,{expr:"datum"}),order:n??"ascending"}}function Gy(e,t,n){const{format:i,formatType:r,labelAngle:o,labelAnchor:s,labelOrient:a,labelExpr:u}=Jp(["format","formatType","labelAngle","labelAnchor","labelOrient","labelExpr"],e.header,n,t),l=Rw({fieldOrDatumDef:e,format:i,formatType:r,expr:"parent",config:n}).signal,c=Kp(t,a);return{text:{signal:u?qs(qs(u,"datum.label",l),"datum.value",V(e,{expr:"parent"})):l},...t==="row"?{orient:"left"}:{},style:"guide-label",frame:"group",...FL(o,c),...CL(c,o,s),...TL(n,e,t,Bre,D5)}}function eae(e,t,n,i,r){if(r){let o=null;const{facetFieldDef:s}=i,a=e.config?e.config:void 0;if(s&&r.labels){const{labelOrient:f}=Jp(["labelOrient"],s.header,a,t);(t==="row"&&!ve(["top","bottom"],f)||t==="column"&&!ve(["left","right"],f))&&(o=Gy(s,t,a))}const u=Ln(e)&&!mf(e.facet),l=r.axes,c=(l==null?void 0:l.length)>0;if(o||c){const f=t==="row"?"height":"width";return{name:e.getName(`${t}_${n}`),type:"group",role:`${t}-${n}`,...i.facetFieldDef?{from:{data:e.getName(`${t}_domain`)},sort:Zse(s,t)}:{},...c&&u?{from:{data:e.getName(`facet_domain_${t}`)}}:{},...o?{title:o}:{},...r.sizeSignal?{encode:{update:{[f]:r.sizeSignal}}}:{},...c?{axes:l}:{}}}}return null}const tae={column:{start:0,end:1},row:{start:1,end:0}};function nae(e,t){return tae[t][e]}function iae(e,t){const n={};for(const i of Xn){const r=e[i];if(r!=null&&r.facetFieldDef){const{titleAnchor:o,titleOrient:s}=Jp(["titleAnchor","titleOrient"],r.facetFieldDef.header,t,i),a=Kp(i,s),u=nae(o,a);u!==void 0&&(n[a]=u)}}return Re(n)?void 0:n}function TL(e,t,n,i,r){const o={};for(const s of i){if(!r[s])continue;const a=_u(s,t==null?void 0:t.header,e,n);a!==void 0&&(o[r[s]]=a)}return o}function sE(e){return[...Zf(e,"width"),...Zf(e,"height"),...Zf(e,"childWidth"),...Zf(e,"childHeight")]}function Zf(e,t){const n=t==="width"?"x":"y",i=e.component.layoutSize.get(t);if(!i||i==="merged")return[];const r=e.getSizeSignalRef(t).signal;if(i==="step"){const o=e.getScaleComponent(n);if(o){const s=o.get("type"),a=o.get("range");if(yt(s)&&la(a)){const u=e.scaleName(n);return Ln(e.parent)&&e.parent.component.resolve.scale[n]==="independent"?[ek(u,a)]:[ek(u,a),{name:r,update:ML(u,o,`domain('${u}').length`)}]}}throw new Error("layout size is step although width/height is not step.")}else if(i=="container"){const o=r.endsWith("width"),s=o?"containerSize()[0]":"containerSize()[1]",a=Py(e.config.view,o?"width":"height"),u=`isFinite(${s}) ? ${s} : ${a}`;return[{name:r,init:u,on:[{update:u,events:"window:resize"}]}]}else return[{name:r,value:i}]}function ek(e,t){const n=`${e}_step`;return te(t.step)?{name:n,update:t.step.signal}:{name:n,value:t.step}}function ML(e,t,n){const i=t.get("type"),r=t.get("padding"),o=et(t.get("paddingOuter"),r);let s=t.get("paddingInner");return s=i==="band"?s!==void 0?s:r:1,`bandspace(${n}, ${mi(s)}, ${mi(o)}) * ${e}_step`}function DL(e){return e==="childWidth"?"width":e==="childHeight"?"height":e}function OL(e,t){return B(e).reduce((n,i)=>({...n,...Hu({model:t,channelDef:e[i],vgChannel:i,mainRefFn:r=>Ue(r.value),invalidValueRef:void 0})}),{})}function RL(e,t){if(Ln(t))return e==="theta"?"independent":"shared";if(Xu(t))return"shared";if(hE(t))return tt(e)||e==="theta"||e==="radius"?"independent":"shared";throw new Error("invalid model type for resolve")}function aE(e,t){const n=e.scale[t],i=tt(t)?"axis":"legend";return n==="independent"?(e[i][t]==="shared"&&j(Rne(t)),"independent"):e[i][t]||"shared"}const rae={...qre,disable:1,labelExpr:1,selections:1,opacity:1,shape:1,stroke:1,fill:1,size:1,strokeWidth:1,strokeDash:1,encode:1},NL=B(rae);class oae extends eo{}const tk={symbols:sae,gradient:aae,labels:uae,entries:lae};function sae(e,{fieldOrDatumDef:t,model:n,channel:i,legendCmpt:r,legendType:o}){if(o!=="symbol")return;const{markDef:s,encoding:a,config:u,mark:l}=n,c=s.filled&&l!=="trail";let f={...Hte({},n,Iie),...aL(n,{filled:c})};const d=r.get("symbolOpacity")??u.legend.symbolOpacity,h=r.get("symbolFillColor")??u.legend.symbolFillColor,g=r.get("symbolStrokeColor")??u.legend.symbolStrokeColor,p=d===void 0?LL(a.opacity)??s.opacity:void 0;if(f.fill){if(i==="fill"||c&&i===En)delete f.fill;else if(U(f.fill,"field"))h?delete f.fill:(f.fill=Ue(u.legend.symbolBaseFillColor??"black"),f.fillOpacity=Ue(p??1));else if(P(f.fill)){const m=Vy(a.fill??a.color)??s.fill??(c&&s.color);m&&(f.fill=Ue(m))}}if(f.stroke){if(i==="stroke"||!c&&i===En)delete f.stroke;else if(U(f.stroke,"field")||g)delete f.stroke;else if(P(f.stroke)){const m=et(Vy(a.stroke||a.color),s.stroke,c?s.color:void 0);m&&(f.stroke={value:m})}}if(i!==Jr){const m=q(t)&&IL(n,r,t);m?f.opacity=[{test:m,...Ue(p??1)},Ue(u.legend.unselectedOpacity)]:p&&(f.opacity=Ue(p))}return f={...f,...e},Re(f)?void 0:f}function aae(e,{model:t,legendType:n,legendCmpt:i}){if(n!=="gradient")return;const{config:r,markDef:o,encoding:s}=t;let a={};const l=(i.get("gradientOpacity")??r.legend.gradientOpacity)===void 0?LL(s.opacity)||o.opacity:void 0;return l&&(a.opacity=Ue(l)),a={...a,...e},Re(a)?void 0:a}function uae(e,{fieldOrDatumDef:t,model:n,channel:i,legendCmpt:r}){const o=n.legend(i)||{},s=n.config,a=q(t)?IL(n,r,t):void 0,u=a?[{test:a,value:1},{value:s.legend.unselectedOpacity}]:void 0,{format:l,formatType:c}=o;let f;Ys(c)?f=yi({fieldOrDatumDef:t,field:"datum.value",format:l,formatType:c,config:s}):l===void 0&&c===void 0&&s.customFormatTypes&&(t.type==="quantitative"&&s.numberFormatType?f=yi({fieldOrDatumDef:t,field:"datum.value",format:s.numberFormat,formatType:s.numberFormatType,config:s}):t.type==="temporal"&&s.timeFormatType&&q(t)&&t.timeUnit===void 0&&(f=yi({fieldOrDatumDef:t,field:"datum.value",format:s.timeFormat,formatType:s.timeFormatType,config:s})));const d={...u?{opacity:u}:{},...f?{text:f}:{},...e};return Re(d)?void 0:d}function lae(e,{legendCmpt:t}){const n=t.get("selections");return n!=null&&n.length?{...e,fill:{value:"transparent"}}:e}function LL(e){return PL(e,(t,n)=>Math.max(t,n.value))}function Vy(e){return PL(e,(t,n)=>et(t,n.value))}function PL(e,t){if(ore(e))return X(e.condition).reduce(t,e.value);if(_i(e))return e.value}function IL(e,t,n){const i=t.get("selections");if(!(i!=null&&i.length))return;const r=H(n.field);return i.map(o=>`(!length(data(${H(qe(o)+Ks)})) || (${o}[${r}] && indexof(${o}[${r}], datum.value) >= 0))`).join(" || ")}const nk={direction:({direction:e})=>e,format:({fieldOrDatumDef:e,legend:t,config:n})=>{const{format:i,formatType:r}=t;return Z3(e,e.type,i,r,n,!1)},formatType:({legend:e,fieldOrDatumDef:t,scaleType:n})=>{const{formatType:i}=e;return e5(i,t,n)},gradientLength:e=>{const{legend:t,legendConfig:n}=e;return t.gradientLength??n.gradientLength??mae(e)},labelOverlap:({legend:e,legendConfig:t,scaleType:n})=>e.labelOverlap??t.labelOverlap??yae(n),symbolType:({legend:e,markDef:t,channel:n,encoding:i})=>e.symbolType??fae(t.type,n,i.shape,t.shape),title:({fieldOrDatumDef:e,config:t})=>qa(e,t,{allowDisabling:!0}),type:({legendType:e,scaleType:t,channel:n})=>{if(ja(n)&&Vi(t)){if(e==="gradient")return}else if(e==="symbol")return;return e},values:({fieldOrDatumDef:e,legend:t})=>cae(t,e)};function cae(e,t){const n=e.values;if(P(n))return d5(t,n);if(te(n))return n}function fae(e,t,n,i){if(t!=="shape"){const r=Vy(n)??i;if(r)return r}switch(e){case"bar":case"rect":case"image":case"square":return"square";case"line":case"trail":case"rule":return"stroke";case"arc":case"point":case"circle":case"tick":case"geoshape":case"area":case"text":return"circle"}}function dae(e){const{legend:t}=e;return et(t.type,hae(e))}function hae({channel:e,timeUnit:t,scaleType:n}){if(ja(e)){if(ve(["quarter","month","day"],t))return"symbol";if(Vi(n))return"gradient"}return"symbol"}function gae({legendConfig:e,legendType:t,orient:n,legend:i}){return i.direction??e[t?"gradientDirection":"symbolDirection"]??pae(n,t)}function pae(e,t){switch(e){case"top":case"bottom":return"horizontal";case"left":case"right":case"none":case void 0:return;default:return t==="gradient"?"horizontal":void 0}}function mae({legendConfig:e,model:t,direction:n,orient:i,scaleType:r}){const{gradientHorizontalMaxLength:o,gradientHorizontalMinLength:s,gradientVerticalMaxLength:a,gradientVerticalMinLength:u}=e;if(Vi(r))return n==="horizontal"?i==="top"||i==="bottom"?ik(t,"width",s,o):s:ik(t,"height",u,a)}function ik(e,t,n,i){return{signal:`clamp(${e.getSizeSignalRef(t).signal}, ${n}, ${i})`}}function yae(e){if(ve(["quantile","threshold","log","symlog"],e))return"greedy"}function zL(e){const t=Ge(e)?bae(e):Eae(e);return e.component.legends=t,t}function bae(e){const{encoding:t}=e,n={};for(const i of[En,...R5]){const r=at(t[i]);!r||!e.getScaleComponent(i)||i===Sn&&q(r)&&r.type===Wu||(n[i]=wae(e,i))}return n}function vae(e,t){const n=e.scaleName(t);if(e.mark==="trail"){if(t==="color")return{stroke:n};if(t==="size")return{strokeWidth:n}}return t==="color"?e.markDef.filled?{fill:n}:{stroke:n}:{[t]:n}}function xae(e,t,n,i){switch(t){case"disable":return n!==void 0;case"values":return!!(n!=null&&n.values);case"title":if(t==="title"&&e===(i==null?void 0:i.title))return!0}return e===(n||{})[t]}function wae(e,t){var x;let n=e.legend(t);const{markDef:i,encoding:r,config:o}=e,s=o.legend,a=new oae({},vae(e,t));Tse(e,t,a);const u=n!==void 0?!n:s.disable;if(a.set("disable",u,n!==void 0),u)return a;n=n||{};const l=e.getScaleComponent(t).get("type"),c=at(r[t]),f=q(c)?(x=mt(c.timeUnit))==null?void 0:x.unit:void 0,d=n.orient||o.legend.orient||"right",h=dae({legend:n,channel:t,timeUnit:f,scaleType:l}),g=gae({legend:n,legendType:h,orient:d,legendConfig:s}),p={legend:n,channel:t,model:e,markDef:i,encoding:r,fieldOrDatumDef:c,legendConfig:s,config:o,scaleType:l,orient:d,legendType:h,direction:g};for(const E of NL){if(h==="gradient"&&E.startsWith("symbol")||h==="symbol"&&E.startsWith("gradient"))continue;const S=E in nk?nk[E](p):n[E];if(S!==void 0){const w=xae(S,E,n,e.fieldDef(t));(w||o.legend[E]===void 0)&&a.set(E,S,w)}}const m=(n==null?void 0:n.encoding)??{},y=a.get("selections"),b={},v={fieldOrDatumDef:c,model:e,channel:t,legendCmpt:a,legendType:h};for(const E of["labels","legend","title","symbols","gradient","entries"]){const S=OL(m[E]??{},e),w=E in tk?tk[E](S,v):S;w!==void 0&&!Re(w)&&(b[E]={...y!=null&&y.length&&q(c)?{name:`${qe(c.field)}_legend_${E}`}:{},...y!=null&&y.length?{interactive:!!y}:{},update:w})}return Re(b)||a.set("encode",b,!!(n!=null&&n.encoding)),a}function Eae(e){const{legends:t,resolve:n}=e.component;for(const i of e.children){zL(i);for(const r of B(i.component.legends))n.legend[r]=aE(e.component.resolve,r),n.legend[r]==="shared"&&(t[r]=BL(t[r],i.component.legends[r]),t[r]||(n.legend[r]="independent",delete t[r]))}for(const i of B(t))for(const r of e.children)r.component.legends[i]&&n.legend[i]==="shared"&&delete r.component.legends[i];return t}function BL(e,t){var o,s,a,u;if(!e)return t.clone();const n=e.getWithExplicit("orient"),i=t.getWithExplicit("orient");if(n.explicit&&i.explicit&&n.value!==i.value)return;let r=!1;for(const l of NL){const c=zo(e.getWithExplicit(l),t.getWithExplicit(l),l,"legend",(f,d)=>{switch(l){case"symbolType":return Sae(f,d);case"title":return b3(f,d);case"type":return r=!0,kn("symbol")}return Hp(f,d,l,"legend")});e.setWithExplicit(l,c)}return r&&((s=(o=e.implicit)==null?void 0:o.encode)!=null&&s.gradient&&qh(e.implicit,["encode","gradient"]),(u=(a=e.explicit)==null?void 0:a.encode)!=null&&u.gradient&&qh(e.explicit,["encode","gradient"])),e}function Sae(e,t){return t.value==="circle"?t:e}function _ae(e,t,n,i){var r,o;e.encode??(e.encode={}),(r=e.encode)[t]??(r[t]={}),(o=e.encode[t]).update??(o.update={}),e.encode[t].update[n]=i}function UL(e){const t=e.component.legends,n={};for(const r of B(t)){const o=e.getScaleComponent(r),s=Ne(o.get("domains"));if(n[s])for(const a of n[s])BL(a,t[r])||n[s].push(t[r]);else n[s]=[t[r].clone()]}return Ft(n).flat().map(r=>Aae(r,e.config)).filter(r=>r!==void 0)}function Aae(e,t){var s,a,u;const{disable:n,labelExpr:i,selections:r,...o}=e.combine();if(!n){if(t.aria===!1&&o.aria==null&&(o.aria=!1),(s=o.encode)!=null&&s.symbols){const l=o.encode.symbols.update;l.fill&&l.fill.value!=="transparent"&&!l.stroke&&!o.stroke&&(l.stroke={value:"transparent"});for(const c of R5)o[c]&&delete l[c]}if(o.title||delete o.title,i!==void 0){let l=i;(u=(a=o.encode)==null?void 0:a.labels)!=null&&u.update&&te(o.encode.labels.update.text)&&(l=qs(i,"datum.label",o.encode.labels.update.text.signal)),_ae(o,"labels","text",{signal:l})}return o}}function $ae(e){return Xu(e)||hE(e)?kae(e):jL(e)}function kae(e){return e.children.reduce((t,n)=>t.concat(n.assembleProjections()),jL(e))}function jL(e){const t=e.component.projection;if(!t||t.merged)return[];const n=t.combine(),{name:i}=n;if(t.data){const r={signal:`[${t.size.map(s=>s.signal).join(", ")}]`},o=t.data.reduce((s,a)=>{const u=te(a)?a.signal:`data('${e.lookupDataSource(a)}')`;return ve(s,u)||s.push(u),s},[]);if(o.length<=0)throw new Error("Projection's fit didn't find any data sources");return[{name:i,size:r,fit:{signal:o.length>1?`[${o.join(", ")}]`:o[0]},...n}]}else return[{name:i,translate:{signal:"[width / 2, height / 2]"},...n}]}const Cae=["type","clipAngle","clipExtent","center","rotate","precision","reflectX","reflectY","coefficient","distance","fraction","lobes","parallel","radius","ratio","spacing","tilt"];class qL extends eo{constructor(t,n,i,r){super({...n},{name:t}),this.specifiedProjection=n,this.size=i,this.data=r,this.merged=!1}get isFit(){return!!this.data}}function WL(e){e.component.projection=Ge(e)?Fae(e):Dae(e)}function Fae(e){if(e.hasProjection){const t=St(e.specifiedProjection),n=!(t&&(t.scale!=null||t.translate!=null)),i=n?[e.getSizeSignalRef("width"),e.getSizeSignalRef("height")]:void 0,r=n?Tae(e):void 0,o=new qL(e.projectionName(!0),{...St(e.config.projection),...t},i,r);return o.get("type")||o.set("type","equalEarth",!1),o}}function Tae(e){const t=[],{encoding:n}=e;for(const i of[[Oi,Di],[ii,Ri]])(at(n[i[0]])||at(n[i[1]]))&&t.push({signal:e.getName(`geojson_${t.length}`)});return e.channelHasField(Sn)&&e.typedFieldDef(Sn).type===Wu&&t.push({signal:e.getName(`geojson_${t.length}`)}),t.length===0&&t.push(e.requestDataName(Ke.Main)),t}function Mae(e,t){const n=ew(Cae,r=>!!(!J(e.explicit,r)&&!J(t.explicit,r)||J(e.explicit,r)&&J(t.explicit,r)&&Dn(e.get(r),t.get(r))));if(Dn(e.size,t.size)){if(n)return e;if(Dn(e.explicit,{}))return t;if(Dn(t.explicit,{}))return e}return null}function Dae(e){if(e.children.length===0)return;let t;for(const i of e.children)WL(i);const n=ew(e.children,i=>{const r=i.component.projection;if(r)if(t){const o=Mae(t,r);return o&&(t=o),!!o}else return t=r,!0;else return!0});if(t&&n){const i=e.projectionName(!0),r=new qL(i,t.specifiedProjection,t.size,le(t.data));for(const o of e.children){const s=o.component.projection;s&&(s.isFit&&r.data.push(...o.component.projection.data),o.renameProjection(s.get("name"),i),s.merged=!0)}return r}}function Oae(e,t,n,i){if(vf(t,n)){const r=Ge(e)?e.axis(n)??e.legend(n)??{}:{},o=V(t,{expr:"datum"}),s=V(t,{expr:"datum",binSuffix:"end"});return{formulaAs:V(t,{binSuffix:"range",forAs:!0}),formula:pf(o,s,r.format,r.formatType,i)}}return{}}function HL(e,t){return`${c3(e)}_${t}`}function Rae(e,t){return{signal:e.getName(`${t}_bins`),extentSignal:e.getName(`${t}_extent`)}}function uE(e,t,n){const i=zp(n,void 0)??{},r=HL(i,t);return e.getName(`${r}_bins`)}function Nae(e){return"as"in e}function rk(e,t,n){let i,r;Nae(e)?i=K(e.as)?[e.as,`${e.as}_end`]:[e.as[0],e.as[1]]:i=[V(e,{forAs:!0}),V(e,{binSuffix:"end",forAs:!0})];const o={...zp(t,void 0)},s=HL(o,e.field),{signal:a,extentSignal:u}=Rae(n,s);if(Cp(o.extent)){const c=o.extent;r=SL(n,c.param,c),delete o.extent}const l={bin:o,field:e.field,as:[i],...a?{signal:a}:{},...u?{extentSignal:u}:{},...r?{span:r}:{}};return{key:s,binComponent:l}}class Ji extends De{clone(){return new Ji(null,le(this.bins))}constructor(t,n){super(t),this.bins=n}static makeFromEncoding(t,n){const i=n.reduceFieldDef((r,o,s)=>{if(cn(o)&&ze(o.bin)){const{key:a,binComponent:u}=rk(o,o.bin,n);r[a]={...u,...r[a],...Oae(n,o,s,n.config)}}return r},{});return Re(i)?null:new Ji(t,i)}static makeFromTransform(t,n,i){const{key:r,binComponent:o}=rk(n,n.bin,i);return new Ji(t,{[r]:o})}merge(t,n){for(const i of B(t.bins))i in this.bins?(n(t.bins[i].signal,this.bins[i].signal),this.bins[i].as=Gi([...this.bins[i].as,...t.bins[i].as],xe)):this.bins[i]=t.bins[i];for(const i of t.children)t.removeChild(i),i.parent=this;t.remove()}producedFields(){return new Set(Ft(this.bins).map(t=>t.as).flat(2))}dependentFields(){return new Set(Ft(this.bins).map(t=>t.field))}hash(){return`Bin ${xe(this.bins)}`}assemble(){return Ft(this.bins).flatMap(t=>{const n=[],[i,...r]=t.as,{extent:o,...s}=t.bin,a={type:"bin",field:ni(t.field),as:i,signal:t.signal,...Cp(o)?{extent:null}:{extent:o},...t.span?{span:{signal:`span(${t.span})`}}:{},...s};!o&&t.extentSignal&&(n.push({type:"extent",field:ni(t.field),signal:t.extentSignal}),a.extent={signal:t.extentSignal}),n.push(a);for(const u of r)for(let l=0;l<2;l++)n.push({type:"formula",expr:V({field:i[l]},{expr:"datum"}),as:u[l]});return t.formula&&n.push({type:"formula",expr:t.formula,as:t.formulaAs}),n})}}function Lae(e,t,n,i){var o;const r=Ge(i)?i.encoding[mr(t)]:void 0;if(cn(n)&&Ge(i)&&r5(n,r,i.markDef,i.config)){e.add(V(n,{})),e.add(V(n,{suffix:"end"}));const{mark:s,markDef:a,config:u}=i,l=Io({fieldDef:n,markDef:a,config:u});kc(s)&&l!==.5&&tt(t)&&(e.add(V(n,{suffix:Gp})),e.add(V(n,{suffix:Vp}))),n.bin&&vf(n,t)&&e.add(V(n,{binSuffix:"range"}))}else if(t3(t)){const s=e3(t);e.add(i.getName(s))}else e.add(V(n));return da(n)&&Aie((o=n.scale)==null?void 0:o.range)&&e.add(n.scale.range.field),e}function Pae(e,t){for(const n of B(t)){const i=t[n];for(const r of B(i))n in e?e[n][r]=new Set([...e[n][r]??[],...i[r]]):e[n]={[r]:i[r]}}}class vi extends De{clone(){return new vi(null,new Set(this.dimensions),le(this.measures))}constructor(t,n,i){super(t),this.dimensions=n,this.measures=i}get groupBy(){return this.dimensions}static makeFromEncoding(t,n){let i=!1;n.forEachFieldDef(s=>{s.aggregate&&(i=!0)});const r={},o=new Set;return!i||(n.forEachFieldDef((s,a)=>{const{aggregate:u,field:l}=s;if(u)if(u==="count")r["*"]??(r["*"]={}),r["*"].count=new Set([V(s,{forAs:!0})]);else{if(Wr(u)||Zo(u)){const c=Wr(u)?"argmin":"argmax",f=u[c];r[f]??(r[f]={}),r[f][c]=new Set([V({op:c,field:f},{forAs:!0})])}else r[l]??(r[l]={}),r[l][u]=new Set([V(s,{forAs:!0})]);yr(a)&&n.scaleDomain(a)==="unaggregated"&&(r[l]??(r[l]={}),r[l].min=new Set([V({field:l,aggregate:"min"},{forAs:!0})]),r[l].max=new Set([V({field:l,aggregate:"max"},{forAs:!0})]))}else Lae(o,a,s,n)}),o.size+B(r).length===0)?null:new vi(t,o,r)}static makeFromTransform(t,n){var i;const r=new Set,o={};for(const s of n.aggregate){const{op:a,field:u,as:l}=s;a&&(a==="count"?(o["*"]??(o["*"]={}),o["*"].count=new Set([l||V(s,{forAs:!0})])):(o[u]??(o[u]={}),(i=o[u])[a]??(i[a]=new Set),o[u][a].add(l||V(s,{forAs:!0}))))}for(const s of n.groupby??[])r.add(s);return r.size+B(o).length===0?null:new vi(t,r,o)}merge(t){return GN(this.dimensions,t.dimensions)?(Pae(this.measures,t.measures),!0):(Kne("different dimensions, cannot merge"),!1)}addDimensions(t){t.forEach(this.dimensions.add,this.dimensions)}dependentFields(){return new Set([...this.dimensions,...B(this.measures)])}producedFields(){const t=new Set;for(const n of B(this.measures))for(const i of B(this.measures[n])){const r=this.measures[n][i];r.size===0?t.add(`${i}_${n}`):r.forEach(t.add,t)}return t}hash(){return`Aggregate ${xe({dimensions:this.dimensions,measures:this.measures})}`}assemble(){const t=[],n=[],i=[];for(const o of B(this.measures))for(const s of B(this.measures[o]))for(const a of this.measures[o][s])i.push(a),t.push(s),n.push(o==="*"?null:ni(o));return{type:"aggregate",groupby:[...this.dimensions].map(ni),ops:t,fields:n,as:i}}}class Vu extends De{constructor(t,n,i,r){super(t),this.model=n,this.name=i,this.data=r;for(const o of Xn){const s=n.facet[o];if(s){const{bin:a,sort:u}=s;this[o]={name:n.getName(`${o}_domain`),fields:[V(s),...ze(a)?[V(s,{binSuffix:"end"})]:[]],...Ir(u)?{sortField:u}:P(u)?{sortIndexField:Su(s,o)}:{}}}}this.childModel=n.child}hash(){let t="Facet";for(const n of Xn)this[n]&&(t+=` ${n.charAt(0)}:${xe(this[n])}`);return t}get fields(){var n;const t=[];for(const i of Xn)(n=this[i])!=null&&n.fields&&t.push(...this[i].fields);return t}dependentFields(){const t=new Set(this.fields);for(const n of Xn)this[n]&&(this[n].sortField&&t.add(this[n].sortField.field),this[n].sortIndexField&&t.add(this[n].sortIndexField));return t}producedFields(){return new Set}getSource(){return this.name}getChildIndependentFieldsWithStep(){const t={};for(const n of Qr){const i=this.childModel.component.scales[n];if(i&&!i.merged){const r=i.get("type"),o=i.get("range");if(yt(r)&&la(o)){const s=Qp(this.childModel,n),a=dE(s);a?t[n]=a:j(gw(n))}}}return t}assembleRowColumnHeaderData(t,n,i){const r={row:"y",column:"x",facet:void 0}[t],o=[],s=[],a=[];r&&i&&i[r]&&(n?(o.push(`distinct_${i[r]}`),s.push("max")):(o.push(i[r]),s.push("distinct")),a.push(`distinct_${i[r]}`));const{sortField:u,sortIndexField:l}=this[t];if(u){const{op:c=Lp,field:f}=u;o.push(f),s.push(c),a.push(V(u,{forAs:!0}))}else l&&(o.push(l),s.push("max"),a.push(l));return{name:this[t].name,source:n??this.data,transform:[{type:"aggregate",groupby:this[t].fields,...o.length?{fields:o,ops:s,as:a}:{}}]}}assembleFacetHeaderData(t){var u;const{columns:n}=this.model.layout,{layoutHeaders:i}=this.model.component,r=[],o={};for(const l of rE){for(const c of oE){const f=(i[l]&&i[l][c])??[];for(const d of f)if(((u=d.axes)==null?void 0:u.length)>0){o[l]=!0;break}}if(o[l]){const c=`length(data("${this.facet.name}"))`,f=l==="row"?n?{signal:`ceil(${c} / ${n})`}:1:n?{signal:`min(${c}, ${n})`}:{signal:c};r.push({name:`${this.facet.name}_${l}`,transform:[{type:"sequence",start:0,stop:f}]})}}const{row:s,column:a}=o;return(s||a)&&r.unshift(this.assembleRowColumnHeaderData("facet",null,t)),r}assemble(){const t=[];let n=null;const i=this.getChildIndependentFieldsWithStep(),{column:r,row:o,facet:s}=this;if(r&&o&&(i.x||i.y)){n=`cross_${this.column.name}_${this.row.name}`;const a=[].concat(i.x??[],i.y??[]),u=a.map(()=>"distinct");t.push({name:n,source:this.data,transform:[{type:"aggregate",groupby:this.fields,fields:a,ops:u}]})}for(const a of[Pr,Lr])this[a]&&t.push(this.assembleRowColumnHeaderData(a,n,i));if(s){const a=this.assembleFacetHeaderData(i);a&&t.push(...a)}return t}}function ok(e){return e.startsWith("'")&&e.endsWith("'")||e.startsWith('"')&&e.endsWith('"')?e.slice(1,-1):e}function Iae(e,t){const n=iw(e);if(t==="number")return`toNumber(${n})`;if(t==="boolean")return`toBoolean(${n})`;if(t==="string")return`toString(${n})`;if(t==="date")return`toDate(${n})`;if(t==="flatten")return n;if(t.startsWith("date:")){const i=ok(t.slice(5,t.length));return`timeParse(${n},'${i}')`}else if(t.startsWith("utc:")){const i=ok(t.slice(4,t.length));return`utcParse(${n},'${i}')`}else return j(one(t)),null}function zae(e){const t={};return Dd(e.filter,n=>{if(N3(n)){let i=null;bw(n)?i=Tn(n.equal):xw(n)?i=Tn(n.lte):vw(n)?i=Tn(n.lt):ww(n)?i=Tn(n.gt):Ew(n)?i=Tn(n.gte):Sw(n)?i=n.range[0]:_w(n)&&(i=(n.oneOf??n.in)[0]),i&&(ca(i)?t[n.field]="date":Ae(i)?t[n.field]="number":K(i)&&(t[n.field]="string")),n.timeUnit&&(t[n.field]="date")}}),t}function Bae(e){const t={};function n(i){vu(i)?t[i.field]="date":i.type==="quantitative"&&Lte(i.aggregate)?t[i.field]="number":du(i.field)>1?i.field in t||(t[i.field]="flatten"):da(i)&&Ir(i.sort)&&du(i.sort.field)>1&&(i.sort.field in t||(t[i.sort.field]="flatten"))}if((Ge(e)||Ln(e))&&e.forEachFieldDef((i,r)=>{if(cn(i))n(i);else{const o=aa(r),s=e.fieldDef(o);n({...i,type:s.type})}}),Ge(e)){const{mark:i,markDef:r,encoding:o}=e;if(es(i)&&!e.encoding.order){const s=r.orient==="horizontal"?"y":"x",a=o[s];q(a)&&a.type==="quantitative"&&!(a.field in t)&&(t[a.field]="number")}}return t}function Uae(e){const t={};if(Ge(e)&&e.component.selection)for(const n of B(e.component.selection)){const i=e.component.selection[n];for(const r of i.project.items)!r.channel&&du(r.field)>1&&(t[r.field]="flatten")}return t}class jt extends De{clone(){return new jt(null,le(this._parse))}constructor(t,n){super(t),this._parse=n}hash(){return`Parse ${xe(this._parse)}`}static makeExplicit(t,n,i){var s;let r={};const o=n.data;return!Co(o)&&((s=o==null?void 0:o.format)!=null&&s.parse)&&(r=o.format.parse),this.makeWithAncestors(t,r,{},i)}static makeWithAncestors(t,n,i,r){for(const a of B(i)){const u=r.getWithExplicit(a);u.value!==void 0&&(u.explicit||u.value===i[a]||u.value==="derived"||i[a]==="flatten"?delete i[a]:j(g$(a,i[a],u.value)))}for(const a of B(n)){const u=r.get(a);u!==void 0&&(u===n[a]?delete n[a]:j(g$(a,n[a],u)))}const o=new eo(n,i);r.copyAll(o);const s={};for(const a of B(o.combine())){const u=o.get(a);u!==null&&(s[a]=u)}return B(s).length===0||r.parseNothing?null:new jt(t,s)}get parse(){return this._parse}merge(t){this._parse={...this._parse,...t.parse},t.remove()}assembleFormatParse(){const t={};for(const n of B(this._parse)){const i=this._parse[n];du(n)===1&&(t[n]=i)}return t}producedFields(){return new Set(B(this._parse))}dependentFields(){return new Set(B(this._parse))}assembleTransforms(t=!1){return B(this._parse).filter(n=>t?du(n)>1:!0).map(n=>{const i=Iae(n,this._parse[n]);return i?{type:"formula",expr:i,as:ju(n)}:null}).filter(n=>n!==null)}}class Uo extends De{clone(){return new Uo(null)}constructor(t){super(t)}dependentFields(){return new Set}producedFields(){return new Set([$i])}hash(){return"Identifier"}assemble(){return{type:"identifier",as:$i}}}class Ef extends De{clone(){return new Ef(null,this.params)}constructor(t,n){super(t),this.params=n}dependentFields(){return new Set}producedFields(){}hash(){return`Graticule ${xe(this.params)}`}assemble(){return{type:"graticule",...this.params===!0?{}:this.params}}}class Sf extends De{clone(){return new Sf(null,this.params)}constructor(t,n){super(t),this.params=n}dependentFields(){return new Set}producedFields(){return new Set([this.params.as??"data"])}hash(){return`Hash ${xe(this.params)}`}assemble(){return{type:"sequence",...this.params}}}class Js extends De{constructor(t){super(null),t??(t={name:"source"});let n;if(Co(t)||(n=t.format?{...yn(t.format,["parse"])}:{}),Cc(t))this._data={values:t.values};else if(xu(t)){if(this._data={url:t.url},!n.type){let i=/(?:\.([^.]+))?$/.exec(t.url)[1];ve(["json","csv","tsv","dsv","topojson"],i)||(i="json"),n.type=i}}else Q5(t)?this._data={values:[{type:"Sphere"}]}:(K5(t)||Co(t))&&(this._data={});this._generator=Co(t),t.name&&(this._name=t.name),n&&!Re(n)&&(this._data.format=n)}dependentFields(){return new Set}producedFields(){}get data(){return this._data}hasName(){return!!this._name}get isGenerator(){return this._generator}get dataName(){return this._name}set dataName(t){this._name=t}set parent(t){throw new Error("Source nodes have to be roots.")}remove(){throw new Error("Source nodes are roots and cannot be removed.")}hash(){throw new Error("Cannot hash sources")}assemble(){return{name:this._name,...this._data,transform:[]}}}var sk=function(e,t,n,i,r){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!r)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?r.call(e,n):r?r.value=n:t.set(e,n),n},jae=function(e,t,n,i){if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?i:n==="a"?i.call(e):i?i.value:t.get(e)},jl;function lE(e){return e instanceof Js||e instanceof Ef||e instanceof Sf}class cE{constructor(){jl.set(this,void 0),sk(this,jl,!1,"f")}setModified(){sk(this,jl,!0,"f")}get modifiedFlag(){return jae(this,jl,"f")}}jl=new WeakMap;class ha extends cE{getNodeDepths(t,n,i){i.set(t,n);for(const r of t.children)this.getNodeDepths(r,n+1,i);return i}optimize(t){const i=[...this.getNodeDepths(t,0,new Map).entries()].sort((r,o)=>o[1]-r[1]);for(const r of i)this.run(r[0]);return this.modifiedFlag}}class fE extends cE{optimize(t){this.run(t);for(const n of t.children)this.optimize(n);return this.modifiedFlag}}class qae extends fE{mergeNodes(t,n){const i=n.shift();for(const r of n)t.removeChild(r),r.parent=i,r.remove()}run(t){const n=t.children.map(r=>r.hash()),i={};for(let r=0;r<n.length;r++)i[n[r]]===void 0?i[n[r]]=[t.children[r]]:i[n[r]].push(t.children[r]);for(const r of B(i))i[r].length>1&&(this.setModified(),this.mergeNodes(t,i[r]))}}class Wae extends fE{constructor(t){super(),this.requiresSelectionId=t&&iE(t)}run(t){t instanceof Uo&&(this.requiresSelectionId&&(lE(t.parent)||t.parent instanceof vi||t.parent instanceof jt)||(this.setModified(),t.remove()))}}class Hae extends cE{optimize(t){return this.run(t,new Set),this.modifiedFlag}run(t,n){let i=new Set;t instanceof Ki&&(i=t.producedFields(),tw(i,n)&&(this.setModified(),t.removeFormulas(n),t.producedFields.length===0&&t.remove()));for(const r of t.children)this.run(r,new Set([...n,...i]))}}class Gae extends fE{constructor(){super()}run(t){t instanceof bn&&!t.isRequired()&&(this.setModified(),t.remove())}}class Vae extends ha{run(t){if(!lE(t)&&!(t.numChildren()>1)){for(const n of t.children)if(n instanceof jt)if(t instanceof jt)this.setModified(),t.merge(n);else{if(nw(t.producedFields(),n.dependentFields()))continue;this.setModified(),n.swapWithParent()}}}}class Yae extends ha{run(t){const n=[...t.children],i=t.children.filter(r=>r instanceof jt);if(t.numChildren()>1&&i.length>=1){const r={},o=new Set;for(const s of i){const a=s.parse;for(const u of B(a))u in r?r[u]!==a[u]&&o.add(u):r[u]=a[u]}for(const s of o)delete r[s];if(!Re(r)){this.setModified();const s=new jt(t,r);for(const a of n){if(a instanceof jt)for(const u of B(r))delete a.parse[u];t.removeChild(a),a.parent=s,a instanceof jt&&B(a.parse).length===0&&a.remove()}}}}}class Xae extends ha{run(t){t instanceof bn||t.numChildren()>0||t instanceof Vu||t instanceof Js||(this.setModified(),t.remove())}}class Kae extends ha{run(t){const n=t.children.filter(r=>r instanceof Ki),i=n.pop();for(const r of n)this.setModified(),i.merge(r)}}class Jae extends ha{run(t){const n=t.children.filter(r=>r instanceof vi),i={};for(const r of n){const o=xe(r.groupBy);o in i||(i[o]=[]),i[o].push(r)}for(const r of B(i)){const o=i[r];if(o.length>1){const s=o.pop();for(const a of o)s.merge(a)&&(t.removeChild(a),a.parent=s,a.remove(),this.setModified())}}}}class Qae extends ha{constructor(t){super(),this.model=t}run(t){const n=!(lE(t)||t instanceof Gu||t instanceof jt||t instanceof Uo),i=[],r=[];for(const o of t.children)o instanceof Ji&&(n&&!nw(t.producedFields(),o.dependentFields())?i.push(o):r.push(o));if(i.length>0){const o=i.pop();for(const s of i)o.merge(s,this.model.renameSignal.bind(this.model));this.setModified(),t instanceof Ji?t.merge(o,this.model.renameSignal.bind(this.model)):o.swapWithParent()}if(r.length>1){const o=r.pop();for(const s of r)o.merge(s,this.model.renameSignal.bind(this.model));this.setModified()}}}class Zae extends ha{run(t){const n=[...t.children];if(!fu(n,s=>s instanceof bn)||t.numChildren()<=1)return;const r=[];let o;for(const s of n)if(s instanceof bn){let a=s;for(;a.numChildren()===1;){const[u]=a.children;if(u instanceof bn)a=u;else break}r.push(...a.children),o?(t.removeChild(s),s.parent=o.parent,o.parent.removeChild(o),o.parent=a,this.setModified()):o=a}else r.push(s);if(r.length){this.setModified();for(const s of r)s.parent.removeChild(s),s.parent=o}}}class ga extends De{clone(){return new ga(null,le(this.transform))}constructor(t,n){super(t),this.transform=n}addDimensions(t){this.transform.groupby=Gi(this.transform.groupby.concat(t),n=>n)}dependentFields(){const t=new Set;return this.transform.groupby&&this.transform.groupby.forEach(t.add,t),this.transform.joinaggregate.map(n=>n.field).filter(n=>n!==void 0).forEach(t.add,t),t}producedFields(){return new Set(this.transform.joinaggregate.map(this.getDefaultName))}getDefaultName(t){return t.as??V(t)}hash(){return`JoinAggregateTransform ${xe(this.transform)}`}assemble(){const t=[],n=[],i=[];for(const o of this.transform.joinaggregate)n.push(o.op),i.push(this.getDefaultName(o)),t.push(o.field===void 0?null:o.field);const r=this.transform.groupby;return{type:"joinaggregate",as:i,ops:n,fields:t,...r!==void 0?{groupby:r}:{}}}}class Au extends De{clone(){return new Au(null,{...this.filter})}constructor(t,n){super(t),this.filter=n}static make(t,n,i){const{config:r,markDef:o}=n,{marks:s,scales:a}=i;if(s==="include-invalid-values"&&a==="include-invalid-values")return null;const u=n.reduceFieldDef((l,c,f)=>{const d=yr(f)&&n.getScaleComponent(f);if(d){const h=d.get("type"),{aggregate:g}=c,p=Mw({scaleChannel:f,markDef:o,config:r,scaleType:h,isCountAggregate:kp(g)});p!=="show"&&p!=="always-valid"&&(l[c.field]=c)}return l},{});return B(u).length?new Au(t,u):null}dependentFields(){return new Set(B(this.filter))}producedFields(){return new Set}hash(){return`FilterInvalid ${xe(this.filter)}`}assemble(){const t=B(this.filter).reduce((n,i)=>{const r=this.filter[i],o=V(r,{expr:"datum"});return r!==null&&(r.type==="temporal"?n.push(`(isDate(${o}) || (${Yy(o)}))`):r.type==="quantitative"&&n.push(Yy(o))),n},[]);return t.length>0?{type:"filter",expr:t.join(" && ")}:null}}function Yy(e){return`isValid(${e}) && isFinite(+${e})`}function eue(e){return e.stack.stackBy.reduce((t,n)=>{const i=n.fieldDef,r=V(i);return r&&t.push(r),t},[])}function tue(e){return P(e)&&e.every(t=>K(t))&&e.length>1}class Br extends De{clone(){return new Br(null,le(this._stack))}constructor(t,n){super(t),this._stack=n}static makeFromTransform(t,n){const{stack:i,groupby:r,as:o,offset:s="zero"}=n,a=[],u=[];if(n.sort!==void 0)for(const f of n.sort)a.push(f.field),u.push(et(f.order,"ascending"));const l={field:a,order:u};let c;return tue(o)?c=o:K(o)?c=[o,`${o}_end`]:c=[`${n.stack}_start`,`${n.stack}_end`],new Br(t,{dimensionFieldDefs:[],stackField:i,groupby:r,offset:s,sort:l,facetby:[],as:c})}static makeFromEncoding(t,n){const i=n.stack,{encoding:r}=n;if(!i)return null;const{groupbyChannels:o,fieldChannel:s,offset:a,impute:u}=i,l=o.map(h=>{const g=r[h];return Ai(g)}).filter(h=>!!h),c=eue(n),f=n.encoding.order;let d;if(P(f)||q(f))d=p3(f);else{const h=o5(f)?f.sort:s==="y"?"descending":"ascending";d=c.reduce((g,p)=>(g.field.includes(p)||(g.field.push(p),g.order.push(h)),g),{field:[],order:[]})}return new Br(t,{dimensionFieldDefs:l,stackField:n.vgField(s),facetby:[],stackby:c,sort:d,offset:a,impute:u,as:[n.vgField(s,{suffix:"start",forAs:!0}),n.vgField(s,{suffix:"end",forAs:!0})]})}get stack(){return this._stack}addDimensions(t){this._stack.facetby.push(...t)}dependentFields(){const t=new Set;return t.add(this._stack.stackField),this.getGroupbyFields().forEach(t.add,t),this._stack.facetby.forEach(t.add,t),this._stack.sort.field.forEach(t.add,t),t}producedFields(){return new Set(this._stack.as)}hash(){return`Stack ${xe(this._stack)}`}getGroupbyFields(){const{dimensionFieldDefs:t,impute:n,groupby:i}=this._stack;return t.length>0?t.map(r=>r.bin?n?[V(r,{binSuffix:"mid"})]:[V(r,{}),V(r,{binSuffix:"end"})]:[V(r)]).flat():i??[]}assemble(){const t=[],{facetby:n,dimensionFieldDefs:i,stackField:r,stackby:o,sort:s,offset:a,impute:u,as:l}=this._stack;if(u)for(const c of i){const{bandPosition:f=.5,bin:d}=c;if(d){const h=V(c,{expr:"datum"}),g=V(c,{expr:"datum",binSuffix:"end"});t.push({type:"formula",expr:`${Yy(h)} ? ${f}*${h}+${1-f}*${g} : ${h}`,as:V(c,{binSuffix:"mid",forAs:!0})})}t.push({type:"impute",field:r,groupby:[...o,...n],key:V(c,{binSuffix:"mid"}),method:"value",value:0})}return t.push({type:"stack",groupby:[...this.getGroupbyFields(),...n],field:r,sort:s,as:l,offset:a}),t}}class Yu extends De{clone(){return new Yu(null,le(this.transform))}constructor(t,n){super(t),this.transform=n}addDimensions(t){this.transform.groupby=Gi(this.transform.groupby.concat(t),n=>n)}dependentFields(){const t=new Set;return(this.transform.groupby??[]).forEach(t.add,t),(this.transform.sort??[]).forEach(n=>t.add(n.field)),this.transform.window.map(n=>n.field).filter(n=>n!==void 0).forEach(t.add,t),t}producedFields(){return new Set(this.transform.window.map(this.getDefaultName))}getDefaultName(t){return t.as??V(t)}hash(){return`WindowTransform ${xe(this.transform)}`}assemble(){const t=[],n=[],i=[],r=[];for(const f of this.transform.window)n.push(f.op),i.push(this.getDefaultName(f)),r.push(f.param===void 0?null:f.param),t.push(f.field===void 0?null:f.field);const o=this.transform.frame,s=this.transform.groupby;if(o&&o[0]===null&&o[1]===null&&n.every(f=>dw(f)))return{type:"joinaggregate",as:i,ops:n,fields:t,...s!==void 0?{groupby:s}:{}};const a=[],u=[];if(this.transform.sort!==void 0)for(const f of this.transform.sort)a.push(f.field),u.push(f.order??"ascending");const l={field:a,order:u},c=this.transform.ignorePeers;return{type:"window",params:r,as:i,ops:n,fields:t,sort:l,...c!==void 0?{ignorePeers:c}:{},...s!==void 0?{groupby:s}:{},...o!==void 0?{frame:o}:{}}}}function nue(e){function t(n){if(!(n instanceof Vu)){const i=n.clone();if(i instanceof bn){const r=Ky+i.getSource();i.setSource(r),e.model.component.data.outputNodes[r]=i}else(i instanceof vi||i instanceof Br||i instanceof Yu||i instanceof ga)&&i.addDimensions(e.fields);for(const r of n.children.flatMap(t))r.parent=i;return[i]}return n.children.flatMap(t)}return t}function Xy(e){if(e instanceof Vu)if(e.numChildren()===1&&!(e.children[0]instanceof bn)){const t=e.children[0];(t instanceof vi||t instanceof Br||t instanceof Yu||t instanceof ga)&&t.addDimensions(e.fields),t.swapWithParent(),Xy(e)}else{const t=e.model.component.data.main;GL(t);const n=nue(e),i=e.children.map(n).flat();for(const r of i)r.parent=t}else e.children.map(Xy)}function GL(e){if(e instanceof bn&&e.type===Ke.Main&&e.numChildren()===1){const t=e.children[0];t instanceof Vu||(t.swapWithParent(),GL(e))}}const Ky="scale_",ed=5;function Jy(e){for(const t of e){for(const n of t.children)if(n.parent!==t)return!1;if(!Jy(t.children))return!1}return!0}function ai(e,t){let n=!1;for(const i of t)n=e.optimize(i)||n;return n}function ak(e,t,n){let i=e.sources,r=!1;return r=ai(new Gae,i)||r,r=ai(new Wae(t),i)||r,i=i.filter(o=>o.numChildren()>0),r=ai(new Xae,i)||r,i=i.filter(o=>o.numChildren()>0),n||(r=ai(new Vae,i)||r,r=ai(new Qae(t),i)||r,r=ai(new Hae,i)||r,r=ai(new Yae,i)||r,r=ai(new Jae,i)||r,r=ai(new Kae,i)||r,r=ai(new qae,i)||r,r=ai(new Zae,i)||r),e.sources=i,r}function iue(e,t){Jy(e.sources);let n=0,i=0;for(let r=0;r<ed&&ak(e,t,!0);r++)n++;e.sources.map(Xy);for(let r=0;r<ed&&ak(e,t,!1);r++)i++;Jy(e.sources),Math.max(n,i)===ed&&j(`Maximum optimization runs(${ed}) reached.`)}class dt{constructor(t){Object.defineProperty(this,"signal",{enumerable:!0,get:t})}static fromName(t,n){return new dt(()=>t(n))}}function VL(e){Ge(e)?rue(e):oue(e)}function rue(e){const t=e.component.scales;for(const n of B(t)){const i=aue(e,n);if(t[n].setWithExplicit("domains",i),lue(e,n),e.component.data.isFaceted){let o=e;for(;!Ln(o)&&o.parent;)o=o.parent;if(o.component.resolve.scale[n]==="shared")for(const a of i.value)Or(a)&&(a.data=Ky+a.data.replace(Ky,""))}}}function oue(e){for(const n of e.children)VL(n);const t=e.component.scales;for(const n of B(t)){let i,r=null;for(const o of e.children){const s=o.component.scales[n];if(s){i===void 0?i=s.getWithExplicit("domains"):i=zo(i,s.getWithExplicit("domains"),"domains","scale",Qy);const a=s.get("selectionExtent");r&&a&&r.param!==a.param&&j(tne),r=a}}t[n].setWithExplicit("domains",i),r&&t[n].set("selectionExtent",r,!0)}}function sue(e,t,n,i){if(e==="unaggregated"){const{valid:r,reason:o}=uk(t,n);if(!r){j(o);return}}else if(e===void 0&&i.useUnaggregatedDomain){const{valid:r}=uk(t,n);if(r)return"unaggregated"}return e}function aue(e,t){const n=e.getScaleComponent(t).get("type"),{encoding:i}=e,r=sue(e.scaleDomain(t),e.typedFieldDef(t),n,e.config.scale);return r!==e.scaleDomain(t)&&(e.specifiedScales[t]={...e.specifiedScales[t],domain:r}),t==="x"&&at(i.x2)?at(i.x)?zo(oo(n,r,e,"x"),oo(n,r,e,"x2"),"domain","scale",Qy):oo(n,r,e,"x2"):t==="y"&&at(i.y2)?at(i.y)?zo(oo(n,r,e,"y"),oo(n,r,e,"y2"),"domain","scale",Qy):oo(n,r,e,"y2"):oo(n,r,e,t)}function uue(e,t,n){return e.map(i=>({signal:`{data: ${Bp(i,{timeUnit:n,type:t})}}`}))}function $0(e,t,n){var r;const i=(r=mt(n))==null?void 0:r.unit;return t==="temporal"||i?uue(e,t,i):[e]}function oo(e,t,n,i){const{encoding:r,markDef:o,mark:s,config:a,stack:u}=n,l=at(r[i]),{type:c}=l,f=l.timeUnit,d=nse({invalid:rr("invalid",o,a),isPath:es(s)});if(_ie(t)){const p=oo(e,void 0,n,i),m=$0(t.unionWith,c,f);return Ui([...m,...p.value])}else{if(te(t))return Ui([t]);if(t&&t!=="unaggregated"&&!j3(t))return Ui($0(t,c,f))}if(u&&i===u.fieldChannel){if(u.offset==="normalize")return kn([[0,1]]);const p=n.requestDataName(d);return kn([{data:p,field:n.vgField(i,{suffix:"start"})},{data:p,field:n.vgField(i,{suffix:"end"})}])}const h=yr(i)&&q(l)?cue(n,i,e):void 0;if(br(l)){const p=$0([l.datum],c,f);return kn(p)}const g=l;if(t==="unaggregated"){const{field:p}=l;return kn([{data:n.requestDataName(d),field:V({field:p,aggregate:"min"})},{data:n.requestDataName(d),field:V({field:p,aggregate:"max"})}])}else if(ze(g.bin)){if(yt(e))return kn(e==="bin-ordinal"?[]:[{data:Ac(h)?n.requestDataName(d):n.requestDataName(Ke.Raw),field:n.vgField(i,vf(g,i)?{binSuffix:"range"}:{}),sort:h===!0||!Y(h)?{field:n.vgField(i,{}),op:"min"}:h}]);{const{bin:p}=g;if(ze(p)){const m=uE(n,g.field,p);return kn([new dt(()=>{const y=n.getSignalName(m);return`[${y}.start, ${y}.stop]`})])}else return kn([{data:n.requestDataName(d),field:n.vgField(i,{})}])}}else if(g.timeUnit&&ve(["time","utc"],e)){const p=r[mr(i)];if(r5(g,p,o,a)){const m=n.requestDataName(d),y=Io({fieldDef:g,fieldDef2:p,markDef:o,config:a}),b=kc(s)&&y!==.5&&tt(i);return kn([{data:m,field:n.vgField(i,b?{suffix:Gp}:{})},{data:m,field:n.vgField(i,{suffix:b?Vp:"end"})}])}}return kn(h?[{data:Ac(h)?n.requestDataName(d):n.requestDataName(Ke.Raw),field:n.vgField(i),sort:h}]:[{data:n.requestDataName(d),field:n.vgField(i)}])}function k0(e,t){const{op:n,field:i,order:r}=e;return{op:n??(t?"sum":Lp),...i?{field:ni(i)}:{},...r?{order:r}:{}}}function lue(e,t){var a;const n=e.component.scales[t],i=e.specifiedScales[t].domain,r=(a=e.fieldDef(t))==null?void 0:a.bin,o=j3(i)?i:void 0,s=ua(r)&&Cp(r.extent)?r.extent:void 0;(o||s)&&n.set("selectionExtent",o??s,!0)}function cue(e,t,n){if(!yt(n))return;const i=e.fieldDef(t),r=i.sort;if(n5(r))return{op:"min",field:Su(i,t),order:"ascending"};const{stack:o}=e,s=o?new Set([...o.groupbyFields,...o.stackBy.map(a=>a.fieldDef.field)]):void 0;if(Ir(r)){const a=o&&!s.has(r.field);return k0(r,a)}else if(nre(r)){const{encoding:a,order:u}=r,l=e.fieldDef(a),{aggregate:c,field:f}=l,d=o&&!s.has(f);if(Wr(c)||Zo(c))return k0({field:V(l),order:u},d);if(dw(c)||!c)return k0({op:c,field:f,order:u},d)}else{if(r==="descending")return{op:"min",field:e.vgField(t),order:"descending"};if(ve(["ascending",void 0],r))return!0}}function uk(e,t){const{aggregate:n,type:i}=e;return n?K(n)&&!Ite.has(n)?{valid:!1,reason:kne(n)}:i==="quantitative"&&t==="log"?{valid:!1,reason:Cne(e)}:{valid:!0}:{valid:!1,reason:$ne(e)}}function Qy(e,t,n,i){return e.explicit&&t.explicit&&j(One(n,i,e.value,t.value)),{explicit:e.explicit,value:[...e.value,...t.value]}}function fue(e){const t=Gi(e.map(s=>{if(Or(s)){const{sort:a,...u}=s;return u}return s}),xe),n=Gi(e.map(s=>{if(Or(s)){const a=s.sort;return a!==void 0&&!Ac(a)&&("op"in a&&a.op==="count"&&delete a.field,a.order==="ascending"&&delete a.order),a}}).filter(s=>s!==void 0),xe);if(t.length===0)return;if(t.length===1){const s=e[0];if(Or(s)&&n.length>0){let a=n[0];if(n.length>1){j(m$);const u=n.filter(l=>Y(l)&&"op"in l&&l.op!=="min");n.every(l=>Y(l)&&"op"in l)&&u.length===1?a=u[0]:a=!0}else if(Y(a)&&"field"in a){const u=a.field;s.field===u&&(a=a.order?{order:a.order}:!0)}return{...s,sort:a}}return s}const i=Gi(n.map(s=>Ac(s)||!("op"in s)||K(s.op)&&J(Rte,s.op)?s:(j(Nne(s)),!0)),xe);let r;i.length===1?r=i[0]:i.length>1&&(j(m$),r=!0);const o=Gi(e.map(s=>Or(s)?s.data:null),s=>s);return o.length===1&&o[0]!==null?{data:o[0],fields:t.map(a=>a.field),...r?{sort:r}:{}}:{fields:t,...r?{sort:r}:{}}}function dE(e){if(Or(e)&&K(e.field))return e.field;if(zte(e)){let t;for(const n of e.fields)if(Or(n)&&K(n.field)){if(!t)t=n.field;else if(t!==n.field)return j(Lne),t}return j(Pne),t}else if(Bte(e)){j(Ine);const t=e.fields[0];return K(t)?t:void 0}}function Qp(e,t){const i=e.component.scales[t].get("domains").map(r=>(Or(r)&&(r.data=e.lookupDataSource(r.data)),r));return fue(i)}function YL(e){return Xu(e)||hE(e)?e.children.reduce((t,n)=>t.concat(YL(n)),lk(e)):lk(e)}function lk(e){return B(e.component.scales).reduce((t,n)=>{const i=e.component.scales[n];if(i.merged)return t;const r=i.combine(),{name:o,type:s,selectionExtent:a,domains:u,range:l,reverse:c,...f}=r,d=due(r.range,o,n,e),h=Qp(e,n),g=a?use(e,a,i,h):null;return t.push({name:o,type:s,...h?{domain:h}:{},...g?{domainRaw:g}:{},range:d,...c!==void 0?{reverse:c}:{},...f}),t},[])}function due(e,t,n,i){if(tt(n)){if(la(e))return{step:{signal:`${t}_step`}}}else if(Y(e)&&Or(e))return{...e,data:i.lookupDataSource(e.data)};return e}class XL extends eo{constructor(t,n){super({},{name:t}),this.merged=!1,this.setWithExplicit("type",n)}domainHasZero(){const t=this.get("type");if(ve([_t.LOG,_t.TIME,_t.UTC],t))return"definitely-not";const n=this.get("zero");if(n===!0||n===void 0&&ve([_t.LINEAR,_t.SQRT,_t.POW],t))return"definitely";const i=this.get("domains");if(i.length>0){let r=!1,o=!1,s=!1;for(const a of i){if(P(a)){const u=a[0],l=a[a.length-1];if(Ae(u)&&Ae(l))if(u<=0&&l>=0){r=!0;continue}else{o=!0;continue}}s=!0}if(r)return"definitely";if(o&&!s)return"definitely-not"}return"maybe"}}const hue=["range","scheme"];function gue(e){const t=e.component.scales;for(const n of fw){const i=t[n];if(!i)continue;const r=pue(n,e);i.setWithExplicit("range",r)}}function ck(e,t){const n=e.fieldDef(t);if(n!=null&&n.bin){const{bin:i,field:r}=n,o=_n(t),s=e.getName(o);if(Y(i)&&i.binned&&i.step!==void 0)return new dt(()=>{const a=e.scaleName(t),u=`(domain("${a}")[1] - domain("${a}")[0]) / ${i.step}`;return`${e.getSignalName(s)} / (${u})`});if(ze(i)){const a=uE(e,r,i);return new dt(()=>{const u=e.getSignalName(a),l=`(${u}.stop - ${u}.start) / ${u}.step`;return`${e.getSignalName(s)} / (${l})`})}}}function pue(e,t){const n=t.specifiedScales[e],{size:i}=t,o=t.getScaleComponent(e).get("type");for(const f of hue)if(n[f]!==void 0){const d=Ry(o,f),h=q3(e,f);if(!d)j(E3(o,f,e));else if(h)j(h);else switch(f){case"range":{const g=n.range;if(P(g)){if(tt(e))return Ui(g.map(p=>{if(p==="width"||p==="height"){const m=t.getName(p),y=t.getSignalName.bind(t);return dt.fromName(y,m)}return p}))}else if(Y(g))return Ui({data:t.requestDataName(Ke.Main),field:g.field,sort:{op:"min",field:t.vgField(e)}});return Ui(g)}case"scheme":return Ui(mue(n[f]))}}const s=e===We||e==="xOffset"?"width":"height",a=i[s];if(sr(a)){if(tt(e))if(yt(o)){const f=JL(a,t,e);if(f)return Ui({step:f})}else j(S3(s));else if(df(e)){const f=e===Yo?"x":"y";if(t.getScaleComponent(f).get("type")==="band"){const g=QL(a,o);if(g)return Ui(g)}}}const{rangeMin:u,rangeMax:l}=n,c=yue(e,t);return(u!==void 0||l!==void 0)&&Ry(o,"rangeMin")&&P(c)&&c.length===2?Ui([u??c[0],l??c[1]]):kn(c)}function mue(e){return Sie(e)?{scheme:e.name,...yn(e,["name"])}:{scheme:e}}function KL(e,t,n,{center:i}={}){const r=_n(e),o=t.getName(r),s=t.getSignalName.bind(t);return e===vt&&Si(n)?i?[dt.fromName(a=>`${s(a)}/2`,o),dt.fromName(a=>`-${s(a)}/2`,o)]:[dt.fromName(s,o),0]:i?[dt.fromName(a=>`-${s(a)}/2`,o),dt.fromName(a=>`${s(a)}/2`,o)]:[0,dt.fromName(s,o)]}function yue(e,t){const{size:n,config:i,mark:r,encoding:o}=t,{type:s}=at(o[e]),u=t.getScaleComponent(e).get("type"),{domain:l,domainMid:c}=t.specifiedScales[e];switch(e){case We:case vt:{if(ve(["point","band"],u)){const f=ZL(e,n,i.view);if(sr(f))return{step:JL(f,t,e)}}return KL(e,t,u)}case Yo:case qu:return bue(e,t,u);case Kr:{const f=wue(r,i),d=Eue(r,n,t,i);return mu(u)?xue(f,d,vue(u,i,l,e)):[f,d]}case oi:return[0,Math.PI*2];case sa:return[0,360];case Mi:return[0,new dt(()=>{const f=t.getSignalName(Ln(t.parent)?"child_width":"width"),d=t.getSignalName(Ln(t.parent)?"child_height":"height");return`min(${f},${d})/2`})];case Jo:return[i.scale.minStrokeWidth,i.scale.maxStrokeWidth];case Qo:return[[1,0],[4,2],[2,1],[1,1],[1,2,4,2]];case Sn:return"symbol";case En:case gr:case pr:return u==="ordinal"?s==="nominal"?"category":"ordinal":c!==void 0?"diverging":r==="rect"||r==="geoshape"?"heatmap":"ramp";case Jr:case Xo:case Ko:return[i.scale.minOpacity,i.scale.maxOpacity]}}function JL(e,t,n){const{encoding:i}=t,r=t.getScaleComponent(n),o=aw(n),s=i[o];if(L5({step:e,offsetIsDiscrete:ce(s)&&P3(s.type)})==="offset"&&m5(i,o)){const u=t.getScaleComponent(o);let c=`domain('${t.scaleName(o)}').length`;if(u.get("type")==="band"){const d=u.get("paddingInner")??u.get("padding")??0,h=u.get("paddingOuter")??u.get("padding")??0;c=`bandspace(${c}, ${d}, ${h})`}const f=r.get("paddingInner")??r.get("padding");return{signal:`${e.step} * ${c} / (1-${Wte(f)})`}}else return e.step}function QL(e,t){if(L5({step:e,offsetIsDiscrete:yt(t)})==="offset")return{step:e.step}}function bue(e,t,n){const i=e===Yo?"x":"y",r=t.getScaleComponent(i);if(!r)return KL(i,t,n,{center:!0});const o=r.get("type"),s=t.scaleName(i),{markDef:a,config:u}=t;if(o==="band"){const l=ZL(i,t.size,t.config.view);if(sr(l)){const c=QL(l,n);if(c)return c}return[0,{signal:`bandwidth('${s}')`}]}else{const l=t.encoding[i];if(q(l)&&l.timeUnit){const c=O3(l.timeUnit,g=>`scale('${s}', ${g})`),f=t.config.scale.bandWithNestedOffsetPaddingInner,d=Io({fieldDef:l,markDef:a,config:u})-.5,h=d!==0?` + ${d}`:"";if(f){const g=te(f)?`${f.signal}/2`+h:`${f/2+d}`,p=te(f)?`(1 - ${f.signal}/2)`+h:`${1-f/2+d}`;return[{signal:`${g} * (${c})`},{signal:`${p} * (${c})`}]}return[0,{signal:c}]}return WN(`Cannot use ${e} scale if ${i} scale is not discrete.`)}}function ZL(e,t,n){const i=e===We?"width":"height",r=t[i];return r||Qh(n,i)}function vue(e,t,n,i){switch(e){case"quantile":return t.scale.quantileCount;case"quantize":return t.scale.quantizeCount;case"threshold":return n!==void 0&&P(n)?n.length+1:(j(Vne(i)),3)}}function xue(e,t,n){const i=()=>{const r=mi(t),o=mi(e),s=`(${r} - ${o}) / (${n} - 1)`;return`sequence(${o}, ${r} + ${s}, ${s})`};return te(t)?new dt(i):{signal:i()}}function wue(e,t){switch(e){case"bar":case"tick":return t.scale.minBandSize;case"line":case"trail":case"rule":return t.scale.minStrokeWidth;case"text":return t.scale.minFontSize;case"point":case"square":case"circle":return t.scale.minSize}throw new Error(Fp("size",e))}const fk=.95;function Eue(e,t,n,i){const r={x:ck(n,"x"),y:ck(n,"y")};switch(e){case"bar":case"tick":{if(i.scale.maxBandSize!==void 0)return i.scale.maxBandSize;const o=dk(t,r,i.view);return Ae(o)?o-1:new dt(()=>`${o.signal} - 1`)}case"line":case"trail":case"rule":return i.scale.maxStrokeWidth;case"text":return i.scale.maxFontSize;case"point":case"square":case"circle":{if(i.scale.maxSize)return i.scale.maxSize;const o=dk(t,r,i.view);return Ae(o)?Math.pow(fk*o,2):new dt(()=>`pow(${fk} * ${o.signal}, 2)`)}}throw new Error(Fp("size",e))}function dk(e,t,n){const i=sr(e.width)?e.width.step:Iy(n,"width"),r=sr(e.height)?e.height.step:Iy(n,"height");return t.x||t.y?new dt(()=>`min(${[t.x?t.x.signal:i,t.y?t.y.signal:r].join(", ")})`):Math.min(i,r)}function eP(e,t){Ge(e)?Sue(e,t):nP(e,t)}function Sue(e,t){const n=e.component.scales,{config:i,encoding:r,markDef:o,specifiedScales:s}=e;for(const a of B(n)){const u=s[a],l=n[a],c=e.getScaleComponent(a),f=at(r[a]),d=u[t],h=c.get("type"),g=c.get("padding"),p=c.get("paddingInner"),m=Ry(h,t),y=q3(a,t);if(d!==void 0&&(m?y&&j(y):j(E3(h,t,a))),m&&y===void 0)if(d!==void 0){const b=f.timeUnit,v=f.type;switch(t){case"domainMax":case"domainMin":ca(u[t])||v==="temporal"||b?l.set(t,{signal:Bp(u[t],{type:v,timeUnit:b})},!0):l.set(t,u[t],!0);break;default:l.copyKeyFromObject(t,u)}}else{const b=U(hk,t)?hk[t]({model:e,channel:a,fieldOrDatumDef:f,scaleType:h,scalePadding:g,scalePaddingInner:p,domain:u.domain,domainMin:u.domainMin,domainMax:u.domainMax,markDef:o,config:i,hasNestedOffsetScale:y5(r,a),hasSecondaryRangeChannel:!!r[mr(a)]}):i.scale[t];b!==void 0&&l.set(t,b,!1)}}}const hk={bins:({model:e,fieldOrDatumDef:t})=>q(t)?_ue(e,t):void 0,interpolate:({channel:e,fieldOrDatumDef:t})=>Aue(e,t.type),nice:({scaleType:e,channel:t,domain:n,domainMin:i,domainMax:r,fieldOrDatumDef:o})=>$ue(e,t,n,i,r,o),padding:({channel:e,scaleType:t,fieldOrDatumDef:n,markDef:i,config:r})=>kue(e,t,r.scale,n,i,r.bar),paddingInner:({scalePadding:e,channel:t,markDef:n,scaleType:i,config:r,hasNestedOffsetScale:o})=>Cue(e,t,n.type,i,r.scale,o),paddingOuter:({scalePadding:e,channel:t,scaleType:n,scalePaddingInner:i,config:r,hasNestedOffsetScale:o})=>Fue(e,t,n,i,r.scale,o),reverse:({fieldOrDatumDef:e,scaleType:t,channel:n,config:i})=>{const r=q(e)?e.sort:void 0;return Tue(t,r,n,i.scale)},zero:({channel:e,fieldOrDatumDef:t,domain:n,markDef:i,scaleType:r,config:o,hasSecondaryRangeChannel:s})=>Mue(e,t,n,i,r,o.scale,s)};function tP(e){Ge(e)?gue(e):nP(e,"range")}function nP(e,t){const n=e.component.scales;for(const i of e.children)t==="range"?tP(i):eP(i,t);for(const i of B(n)){let r;for(const o of e.children){const s=o.component.scales[i];if(s){const a=s.getWithExplicit(t);r=zo(r,a,t,"scale",X5((u,l)=>{switch(t){case"range":return u.step&&l.step?u.step-l.step:0}return 0}))}}n[i].setWithExplicit(t,r)}}function _ue(e,t){const n=t.bin;if(ze(n)){const i=uE(e,t.field,n);return new dt(()=>e.getSignalName(i))}else if(Et(n)&&ua(n)&&n.step!==void 0)return{step:n.step}}function Aue(e,t){if(ve([En,gr,pr],e)&&t!=="nominal")return"hcl"}function $ue(e,t,n,i,r,o){var s;if(!((s=Ai(o))!=null&&s.bin||P(n)||r!=null||i!=null||ve([_t.TIME,_t.UTC],e)))return tt(t)?!0:void 0}function kue(e,t,n,i,r,o){if(tt(e)){if(Vi(t)){if(n.continuousPadding!==void 0)return n.continuousPadding;const{type:s,orient:a}=r;if(s==="bar"&&!(q(i)&&(i.bin||i.timeUnit))&&(a==="vertical"&&e==="x"||a==="horizontal"&&e==="y"))return o.continuousBandSize}if(t===_t.POINT)return n.pointPadding}}function Cue(e,t,n,i,r,o=!1){if(e===void 0){if(tt(t)){const{bandPaddingInner:s,barBandPaddingInner:a,rectBandPaddingInner:u,tickBandPaddingInner:l,bandWithNestedOffsetPaddingInner:c}=r;return o?c:et(s,n==="bar"?a:n==="tick"?l:u)}else if(df(t)&&i===_t.BAND)return r.offsetBandPaddingInner}}function Fue(e,t,n,i,r,o=!1){if(e===void 0){if(tt(t)){const{bandPaddingOuter:s,bandWithNestedOffsetPaddingOuter:a}=r;if(o)return a;if(n===_t.BAND)return et(s,te(i)?{signal:`${i.signal}/2`}:i/2)}else if(df(t)){if(n===_t.POINT)return .5;if(n===_t.BAND)return r.offsetBandPaddingOuter}}}function Tue(e,t,n,i){if(n==="x"&&i.xReverse!==void 0)return Si(e)&&t==="descending"?te(i.xReverse)?{signal:`!${i.xReverse.signal}`}:!i.xReverse:i.xReverse;if(Si(e)&&t==="descending")return!0}function Mue(e,t,n,i,r,o,s){if(!!n&&n!=="unaggregated"&&Si(r)){if(P(n)){const u=n[0],l=n[n.length-1];if(Ae(u)&&u<=0&&Ae(l)&&l>=0)return!0}return!1}if(e==="size"&&t.type==="quantitative"&&!mu(r))return!0;if(!(q(t)&&t.bin)&&ve([...Qr,...$te],e)){const{orient:u,type:l}=i;return ve(["bar","area","line","trail"],l)&&(u==="horizontal"&&e==="y"||u==="vertical"&&e==="x")?!1:ve(["bar","area"],l)&&!s?!0:o==null?void 0:o.zero}return!1}function Due(e,t,n,i,r=!1){const o=Oue(t,n,i,r),{type:s}=e;return yr(t)?s!==void 0?Tie(t,s)?q(n)&&!Fie(s,n.type)?(j(Mne(s,o)),o):s:(j(Tne(t,s,o)),o):o:null}function Oue(e,t,n,i){var r;switch(t.type){case"nominal":case"ordinal":{if(ja(e)||y0(e)==="discrete")return e==="shape"&&t.type==="ordinal"&&j(b0(e,"ordinal")),"ordinal";if(tt(e)||df(e)){if(ve(["rect","bar","image","rule","tick"],n.type)||i)return"band"}else if(n.type==="arc"&&e in cw)return"band";const o=n[_n(e)];return Vs(o)||bu(t)&&((r=t.axis)!=null&&r.tickBand)?"band":"point"}case"temporal":return ja(e)?"time":y0(e)==="discrete"?(j(b0(e,"temporal")),"ordinal"):q(t)&&t.timeUnit&&mt(t.timeUnit).utc?"utc":"time";case"quantitative":return ja(e)?q(t)&&ze(t.bin)?"bin-ordinal":"linear":y0(e)==="discrete"?(j(b0(e,"quantitative")),"ordinal"):"linear";case"geojson":return}throw new Error(x3(t.type))}function Rue(e,{ignoreRange:t}={}){iP(e),VL(e);for(const n of Cie)eP(e,n);t||tP(e)}function iP(e){Ge(e)?e.component.scales=Nue(e):e.component.scales=Pue(e)}function Nue(e){const{encoding:t,mark:n,markDef:i}=e,r={};for(const o of fw){const s=at(t[o]);if(s&&n===G3&&o===Sn&&s.type===Wu)continue;let a=s&&s.scale;if(s&&a!==null&&a!==!1){a??(a={});const u=y5(t,o),l=Due(a,o,s,i,u);r[o]=new XL(e.scaleName(`${o}`,!0),{value:l,explicit:a.type===l})}}return r}const Lue=X5((e,t)=>b$(e)-b$(t));function Pue(e){var t;const n=e.component.scales={},i={},r=e.component.resolve;for(const o of e.children){iP(o);for(const s of B(o.component.scales))if((t=r.scale)[s]??(t[s]=RL(s,e)),r.scale[s]==="shared"){const a=i[s],u=o.component.scales[s].getWithExplicit("type");a?bie(a.value,u.value)?i[s]=zo(a,u,"type","scale",Lue):(r.scale[s]="independent",delete i[s]):i[s]=u}}for(const o of B(i)){const s=e.scaleName(o,!0),a=i[o];n[o]=new XL(s,a);for(const u of e.children){const l=u.component.scales[o];l&&(u.renameScale(l.get("name"),s),l.merged=!0)}}return n}class C0{constructor(){this.nameMap={}}rename(t,n){this.nameMap[t]=n}has(t){return this.nameMap[t]!==void 0}get(t){for(;this.nameMap[t]&&t!==this.nameMap[t];)t=this.nameMap[t];return t}}function Ge(e){return(e==null?void 0:e.type)==="unit"}function Ln(e){return(e==null?void 0:e.type)==="facet"}function hE(e){return(e==null?void 0:e.type)==="concat"}function Xu(e){return(e==null?void 0:e.type)==="layer"}class gE{constructor(t,n,i,r,o,s,a){this.type=n,this.parent=i,this.config=o,this.correctDataNames=u=>{var l,c,f;return(l=u.from)!=null&&l.data&&(u.from.data=this.lookupDataSource(u.from.data)),(f=(c=u.from)==null?void 0:c.facet)!=null&&f.data&&(u.from.facet.data=this.lookupDataSource(u.from.facet.data)),u},this.parent=i,this.config=o,this.view=St(a),this.name=t.name??r,this.title=co(t.title)?{text:t.title}:t.title?St(t.title):void 0,this.scaleNameMap=i?i.scaleNameMap:new C0,this.projectionNameMap=i?i.projectionNameMap:new C0,this.signalNameMap=i?i.signalNameMap:new C0,this.data=t.data,this.description=t.description,this.transforms=Woe(t.transform??[]),this.layout=n==="layer"||n==="unit"?{}:Yre(t,n,o),this.component={data:{sources:i?i.component.data.sources:[],outputNodes:i?i.component.data.outputNodes:{},outputNodeRefCounts:i?i.component.data.outputNodeRefCounts:{},isFaceted:Pp(t)||(i==null?void 0:i.component.data.isFaceted)&&t.data===void 0},layoutSize:new eo,layoutHeaders:{row:{},column:{},facet:{}},mark:null,resolve:{scale:{},axis:{},legend:{},...s?le(s):{}},selection:null,scales:null,projection:null,axes:{},legends:{}}}get width(){return this.getSizeSignalRef("width")}get height(){return this.getSizeSignalRef("height")}parse(){this.parseScale(),this.parseLayoutSize(),this.renameTopLevelLayoutSizeSignal(),this.parseSelections(),this.parseProjection(),this.parseData(),this.parseAxesAndHeaders(),this.parseLegends(),this.parseMarkGroup()}parseScale(){Rue(this)}parseProjection(){WL(this)}renameTopLevelLayoutSizeSignal(){this.getName("width")!=="width"&&this.renameSignal(this.getName("width"),"width"),this.getName("height")!=="height"&&this.renameSignal(this.getName("height"),"height")}parseLegends(){zL(this)}assembleEncodeFromView(t){const{style:n,...i}=t,r={};for(const o of B(i)){const s=i[o];s!==void 0&&(r[o]=Ue(s))}return r}assembleGroupEncodeEntry(t){let n={};return this.view&&(n=this.assembleEncodeFromView(this.view)),!t&&(this.description&&(n.description=Ue(this.description)),this.type==="unit"||this.type==="layer")?{width:this.getSizeSignalRef("width"),height:this.getSizeSignalRef("height"),...n}:Re(n)?void 0:n}assembleLayout(){if(!this.layout)return;const{spacing:t,...n}=this.layout,{component:i,config:r}=this,o=iae(i.layoutHeaders,r);return{padding:t,...this.assembleDefaultLayout(),...n,...o?{titleBand:o}:{}}}assembleDefaultLayout(){return{}}assembleHeaderMarks(){const{layoutHeaders:t}=this.component;let n=[];for(const i of Xn)t[i].title&&n.push(Jse(this,i));for(const i of rE)n=n.concat(Qse(this,i));return n}assembleAxes(){return Ise(this.component.axes,this.config)}assembleLegends(){return UL(this)}assembleProjections(){return $ae(this)}assembleTitle(){const{encoding:t,...n}=this.title??{},i={...f3(this.config.title).nonMarkTitleProperties,...n,...t?{encode:{update:t}}:{}};if(i.text)return ve(["unit","layer"],this.type)?ve(["middle",void 0],i.anchor)&&(i.frame??(i.frame="group")):i.anchor??(i.anchor="start"),Re(i)?void 0:i}assembleGroup(t=[]){const n={};t=t.concat(this.assembleSignals()),t.length>0&&(n.signals=t);const i=this.assembleLayout();i&&(n.layout=i),n.marks=[].concat(this.assembleHeaderMarks(),this.assembleMarks());const r=!this.parent||Ln(this.parent)?YL(this):[];r.length>0&&(n.scales=r);const o=this.assembleAxes();o.length>0&&(n.axes=o);const s=this.assembleLegends();return s.length>0&&(n.legends=s),n}getName(t){return qe((this.name?`${this.name}_`:"")+t)}getDataName(t){return this.getName(Ke[t].toLowerCase())}requestDataName(t){const n=this.getDataName(t),i=this.component.data.outputNodeRefCounts;return i[n]=(i[n]||0)+1,n}getSizeSignalRef(t){if(Ln(this.parent)){const n=DL(t),i=$p(n),r=this.component.scales[i];if(r&&!r.merged){const o=r.get("type"),s=r.get("range");if(yt(o)&&la(s)){const a=r.get("name"),u=Qp(this,i),l=dE(u);if(l){const c=V({aggregate:"distinct",field:l},{expr:"datum"});return{signal:ML(a,r,c)}}else return j(gw(i)),null}}}return{signal:this.signalNameMap.get(this.getName(t))}}lookupDataSource(t){const n=this.component.data.outputNodes[t];return n?n.getSource():t}getSignalName(t){return this.signalNameMap.get(t)}renameSignal(t,n){this.signalNameMap.rename(t,n)}renameScale(t,n){this.scaleNameMap.rename(t,n)}renameProjection(t,n){this.projectionNameMap.rename(t,n)}scaleName(t,n){if(n)return this.getName(t);if(i3(t)&&yr(t)&&this.component.scales[t]||this.scaleNameMap.has(this.getName(t)))return this.scaleNameMap.get(this.getName(t))}projectionName(t){if(t)return this.getName("projection");if(this.component.projection&&!this.component.projection.merged||this.projectionNameMap.has(this.getName("projection")))return this.projectionNameMap.get(this.getName("projection"))}getScaleComponent(t){if(!this.component.scales)throw new Error("getScaleComponent cannot be called before parseScale(). Make sure you have called parseScale or use parseUnitModelWithScale().");const n=this.component.scales[t];return n&&!n.merged?n:this.parent?this.parent.getScaleComponent(t):void 0}getScaleType(t){const n=this.getScaleComponent(t);return n?n.get("type"):void 0}getSelectionComponent(t,n){let i=this.component.selection[t];if(!i&&this.parent&&(i=this.parent.getSelectionComponent(t,n)),!i)throw new Error(Xte(n));return i}hasAxisOrientSignalRef(){var t,n;return((t=this.component.axes.x)==null?void 0:t.some(i=>i.hasOrientSignalRef()))||((n=this.component.axes.y)==null?void 0:n.some(i=>i.hasOrientSignalRef()))}}class rP extends gE{vgField(t,n={}){const i=this.fieldDef(t);if(i)return V(i,n)}reduceFieldDef(t,n){return Sre(this.getMapping(),(i,r,o)=>{const s=Ai(r);return s?t(i,s,o):i},n)}forEachFieldDef(t,n){Bw(this.getMapping(),(i,r)=>{const o=Ai(i);o&&t(o,r)},n)}}class Zp extends De{clone(){return new Zp(null,le(this.transform))}constructor(t,n){super(t),this.transform=n,this.transform=le(n);const i=this.transform.as??[void 0,void 0];this.transform.as=[i[0]??"value",i[1]??"density"];const r=this.transform.resolve??"shared";this.transform.resolve=r}dependentFields(){return new Set([this.transform.density,...this.transform.groupby??[]])}producedFields(){return new Set(this.transform.as)}hash(){return`DensityTransform ${xe(this.transform)}`}assemble(){const{density:t,...n}=this.transform,i={type:"kde",field:t,...n};return i.resolve=this.transform.resolve,i}}class em extends De{clone(){return new em(null,le(this.transform))}constructor(t,n){super(t),this.transform=n,this.transform=le(n)}dependentFields(){return new Set([this.transform.extent])}producedFields(){return new Set([])}hash(){return`ExtentTransform ${xe(this.transform)}`}assemble(){const{extent:t,param:n}=this.transform;return{type:"extent",field:t,signal:n}}}class tm extends De{clone(){return new tm(this.parent,le(this.transform))}constructor(t,n){super(t),this.transform=n,this.transform=le(n);const{flatten:i,as:r=[]}=this.transform;this.transform.as=i.map((o,s)=>r[s]??o)}dependentFields(){return new Set(this.transform.flatten)}producedFields(){return new Set(this.transform.as)}hash(){return`FlattenTransform ${xe(this.transform)}`}assemble(){const{flatten:t,as:n}=this.transform;return{type:"flatten",fields:t,as:n}}}class nm extends De{clone(){return new nm(null,le(this.transform))}constructor(t,n){super(t),this.transform=n,this.transform=le(n);const i=this.transform.as??[void 0,void 0];this.transform.as=[i[0]??"key",i[1]??"value"]}dependentFields(){return new Set(this.transform.fold)}producedFields(){return new Set(this.transform.as)}hash(){return`FoldTransform ${xe(this.transform)}`}assemble(){const{fold:t,as:n}=this.transform;return{type:"fold",fields:t,as:n}}}class Ha extends De{clone(){return new Ha(null,le(this.fields),this.geojson,this.signal)}static parseAll(t,n){if(n.component.projection&&!n.component.projection.isFit)return t;let i=0;for(const r of[[Oi,Di],[ii,Ri]]){const o=r.map(s=>{const a=at(n.encoding[s]);return q(a)?a.field:br(a)?{expr:`${a.datum}`}:_i(a)?{expr:`${a.value}`}:void 0});(o[0]||o[1])&&(t=new Ha(t,o,null,n.getName(`geojson_${i++}`)))}if(n.channelHasField(Sn)){const r=n.typedFieldDef(Sn);r.type===Wu&&(t=new Ha(t,null,r.field,n.getName(`geojson_${i++}`)))}return t}constructor(t,n,i,r){super(t),this.fields=n,this.geojson=i,this.signal=r}dependentFields(){const t=(this.fields??[]).filter(K);return new Set([...this.geojson?[this.geojson]:[],...t])}producedFields(){return new Set}hash(){return`GeoJSON ${this.geojson} ${this.signal} ${xe(this.fields)}`}assemble(){return[...this.geojson?[{type:"filter",expr:`isValid(datum["${this.geojson}"])`}]:[],{type:"geojson",...this.fields?{fields:this.fields}:{},...this.geojson?{geojson:this.geojson}:{},signal:this.signal}]}}class Fc extends De{clone(){return new Fc(null,this.projection,le(this.fields),le(this.as))}constructor(t,n,i,r){super(t),this.projection=n,this.fields=i,this.as=r}static parseAll(t,n){if(!n.projectionName())return t;for(const i of[[Oi,Di],[ii,Ri]]){const r=i.map(s=>{const a=at(n.encoding[s]);return q(a)?a.field:br(a)?{expr:`${a.datum}`}:_i(a)?{expr:`${a.value}`}:void 0}),o=i[0]===ii?"2":"";(r[0]||r[1])&&(t=new Fc(t,n.projectionName(),r,[n.getName(`x${o}`),n.getName(`y${o}`)]))}return t}dependentFields(){return new Set(this.fields.filter(K))}producedFields(){return new Set(this.as)}hash(){return`Geopoint ${this.projection} ${xe(this.fields)} ${xe(this.as)}`}assemble(){return{type:"geopoint",projection:this.projection,fields:this.fields,as:this.as}}}class Ms extends De{clone(){return new Ms(null,le(this.transform))}constructor(t,n){super(t),this.transform=n}dependentFields(){return new Set([this.transform.impute,this.transform.key,...this.transform.groupby??[]])}producedFields(){return new Set([this.transform.impute])}processSequence(t){const{start:n=0,stop:i,step:r}=t;return{signal:`sequence(${[n,i,...r?[r]:[]].join(",")})`}}static makeFromTransform(t,n){return new Ms(t,n)}static makeFromEncoding(t,n){const i=n.encoding,r=i.x,o=i.y;if(q(r)&&q(o)){const s=r.impute?r:o.impute?o:void 0;if(s===void 0)return;const a=r.impute?o:o.impute?r:void 0,{method:u,value:l,frame:c,keyvals:f}=s.impute,d=x5(n.mark,i);return new Ms(t,{impute:s.field,key:a.field,...u?{method:u}:{},...l!==void 0?{value:l}:{},...c?{frame:c}:{},...f!==void 0?{keyvals:f}:{},...d.length?{groupby:d}:{}})}return null}hash(){return`Impute ${xe(this.transform)}`}assemble(){const{impute:t,key:n,keyvals:i,method:r,groupby:o,value:s,frame:a=[null,null]}=this.transform,u={type:"impute",field:t,key:n,...i?{keyvals:Aoe(i)?this.processSequence(i):i}:{},method:"value",...o?{groupby:o}:{},value:!r||r==="value"?s:null};if(r&&r!=="value"){const l={type:"window",as:[`imputed_${t}_value`],ops:[r],fields:[t],frame:a,ignorePeers:!1,...o?{groupby:o}:{}},c={type:"formula",expr:`datum.${t} === null ? datum.imputed_${t}_value : datum.${t}`,as:t};return[u,l,c]}else return[u]}}class im extends De{clone(){return new im(null,le(this.transform))}constructor(t,n){super(t),this.transform=n,this.transform=le(n);const i=this.transform.as??[void 0,void 0];this.transform.as=[i[0]??n.on,i[1]??n.loess]}dependentFields(){return new Set([this.transform.loess,this.transform.on,...this.transform.groupby??[]])}producedFields(){return new Set(this.transform.as)}hash(){return`LoessTransform ${xe(this.transform)}`}assemble(){const{loess:t,on:n,...i}=this.transform;return{type:"loess",x:n,y:t,...i}}}class Tc extends De{clone(){return new Tc(null,le(this.transform),this.secondary)}constructor(t,n,i){super(t),this.transform=n,this.secondary=i}static make(t,n,i,r){const o=n.component.data.sources,{from:s}=i;let a=null;if($oe(s)){let u=aP(s.data,o);u||(u=new Js(s.data),o.push(u));const l=n.getName(`lookup_${r}`);a=new bn(u,l,Ke.Lookup,n.component.data.outputNodeRefCounts),n.component.data.outputNodes[l]=a}else if(koe(s)){const u=s.param;i={as:u,...i};let l;try{l=n.getSelectionComponent(qe(u),u)}catch{throw new Error(Zte(u))}if(a=l.materialized,!a)throw new Error(ene(u))}return new Tc(t,i,a.getSource())}dependentFields(){return new Set([this.transform.lookup])}producedFields(){return new Set(this.transform.as?X(this.transform.as):this.transform.from.fields)}hash(){return`Lookup ${xe({transform:this.transform,secondary:this.secondary})}`}assemble(){let t;if(this.transform.from.fields)t={values:this.transform.from.fields,...this.transform.as?{as:X(this.transform.as)}:{}};else{let n=this.transform.as;K(n)||(j(une),n="_lookup"),t={as:[n]}}return{type:"lookup",from:this.secondary,key:this.transform.from.key,fields:[this.transform.lookup],...t,...this.transform.default?{default:this.transform.default}:{}}}}class rm extends De{clone(){return new rm(null,le(this.transform))}constructor(t,n){super(t),this.transform=n,this.transform=le(n);const i=this.transform.as??[void 0,void 0];this.transform.as=[i[0]??"prob",i[1]??"value"]}dependentFields(){return new Set([this.transform.quantile,...this.transform.groupby??[]])}producedFields(){return new Set(this.transform.as)}hash(){return`QuantileTransform ${xe(this.transform)}`}assemble(){const{quantile:t,...n}=this.transform;return{type:"quantile",field:t,...n}}}class om extends De{clone(){return new om(null,le(this.transform))}constructor(t,n){super(t),this.transform=n,this.transform=le(n);const i=this.transform.as??[void 0,void 0];this.transform.as=[i[0]??n.on,i[1]??n.regression]}dependentFields(){return new Set([this.transform.regression,this.transform.on,...this.transform.groupby??[]])}producedFields(){return new Set(this.transform.as)}hash(){return`RegressionTransform ${xe(this.transform)}`}assemble(){const{regression:t,on:n,...i}=this.transform;return{type:"regression",x:n,y:t,...i}}}class sm extends De{clone(){return new sm(null,le(this.transform))}constructor(t,n){super(t),this.transform=n}addDimensions(t){this.transform.groupby=Gi((this.transform.groupby??[]).concat(t),n=>n)}producedFields(){}dependentFields(){return new Set([this.transform.pivot,this.transform.value,...this.transform.groupby??[]])}hash(){return`PivotTransform ${xe(this.transform)}`}assemble(){const{pivot:t,value:n,groupby:i,limit:r,op:o}=this.transform;return{type:"pivot",field:t,value:n,...r!==void 0?{limit:r}:{},...o!==void 0?{op:o}:{},...i!==void 0?{groupby:i}:{}}}}class am extends De{clone(){return new am(null,le(this.transform))}constructor(t,n){super(t),this.transform=n}dependentFields(){return new Set}producedFields(){return new Set}hash(){return`SampleTransform ${xe(this.transform)}`}assemble(){return{type:"sample",size:this.transform.sample}}}function oP(e){let t=0;function n(i,r){if(i instanceof Js&&!i.isGenerator&&!xu(i.data)&&(e.push(r),r={name:null,source:r.name,transform:[]}),i instanceof jt&&(i.parent instanceof Js&&!r.source?(r.format={...r.format,parse:i.assembleFormatParse()},r.transform.push(...i.assembleTransforms(!0))):r.transform.push(...i.assembleTransforms())),i instanceof Vu){r.name||(r.name=`data_${t++}`),!r.source||r.transform.length>0?(e.push(r),i.data=r.name):i.data=r.source,e.push(...i.assemble());return}switch((i instanceof Ef||i instanceof Sf||i instanceof Au||i instanceof Gu||i instanceof Eu||i instanceof Fc||i instanceof vi||i instanceof Tc||i instanceof Yu||i instanceof ga||i instanceof nm||i instanceof tm||i instanceof Zp||i instanceof im||i instanceof rm||i instanceof om||i instanceof Uo||i instanceof am||i instanceof sm||i instanceof em)&&r.transform.push(i.assemble()),(i instanceof Ji||i instanceof Ki||i instanceof Ms||i instanceof Br||i instanceof Ha)&&r.transform.push(...i.assemble()),i instanceof bn&&(r.source&&r.transform.length===0?i.setSource(r.source):i.parent instanceof bn?i.setSource(r.name):(r.name||(r.name=`data_${t++}`),i.setSource(r.name),i.numChildren()===1&&(e.push(r),r={name:null,source:r.name,transform:[]}))),i.numChildren()){case 0:i instanceof bn&&(!r.source||r.transform.length>0)&&e.push(r);break;case 1:n(i.children[0],r);break;default:{r.name||(r.name=`data_${t++}`);let o=r.name;!r.source||r.transform.length>0?e.push(r):o=r.source;for(const s of i.children)n(s,{name:null,source:o,transform:[]});break}}}return n}function Iue(e){const t=[],n=oP(t);for(const i of e.children)n(i,{source:e.name,name:null,transform:[]});return t}function zue(e,t){const n=[],i=oP(n);let r=0;for(const s of e.sources){s.hasName()||(s.dataName=`source_${r++}`);const a=s.assemble();i(s,a)}for(const s of n)s.transform.length===0&&delete s.transform;let o=0;for(const[s,a]of n.entries())(a.transform??[]).length===0&&!a.source&&n.splice(o++,0,n.splice(s,1)[0]);for(const s of n)for(const a of s.transform??[])a.type==="lookup"&&(a.from=e.outputNodes[a.from].getSource());for(const s of n)s.name in t&&(s.values=t[s.name]);return n}function Bue(e){return e==="top"||e==="left"||te(e)?"header":"footer"}function Uue(e){for(const t of Xn)jue(e,t);gk(e,"x"),gk(e,"y")}function jue(e,t){var s;const{facet:n,config:i,child:r,component:o}=e;if(e.channelHasField(t)){const a=n[t],u=_u("title",null,i,t);let l=qa(a,i,{allowDisabling:!0,includeDefault:u===void 0||!!u});r.component.layoutHeaders[t].title&&(l=P(l)?l.join(", "):l,l+=` / ${r.component.layoutHeaders[t].title}`,r.component.layoutHeaders[t].title=null);const c=_u("labelOrient",a.header,i,t),f=a.header!==null?et((s=a.header)==null?void 0:s.labels,i.header.labels,!0):!1,d=ve(["bottom","right"],c)?"footer":"header";o.layoutHeaders[t]={title:a.header!==null?l:null,facetFieldDef:a,[d]:t==="facet"?[]:[sP(e,t,f)]}}}function sP(e,t,n){const i=t==="row"?"height":"width";return{labels:n,sizeSignal:e.child.component.layoutSize.get(i)?e.child.getSizeSignalRef(i):void 0,axes:[]}}function gk(e,t){const{child:n}=e;if(n.component.axes[t]){const{layoutHeaders:i,resolve:r}=e.component;if(r.axis[t]=aE(r,t),r.axis[t]==="shared"){const o=t==="x"?"column":"row",s=i[o];for(const a of n.component.axes[t]){const u=Bue(a.get("orient"));s[u]??(s[u]=[sP(e,o,!1)]);const l=Ul(a,"main",e.config,{header:!0});l&&s[u][0].axes.push(l),a.mainExtracted=!0}}}}function que(e){pE(e),ng(e,"width"),ng(e,"height")}function Wue(e){pE(e);const t=e.layout.columns===1?"width":"childWidth",n=e.layout.columns===void 0?"height":"childHeight";ng(e,t),ng(e,n)}function pE(e){for(const t of e.children)t.parseLayoutSize()}function ng(e,t){const n=DL(t),i=$p(n),r=e.component.resolve,o=e.component.layoutSize;let s;for(const a of e.children){const u=a.component.layoutSize.getWithExplicit(n),l=r.scale[i]??RL(i,e);if(l==="independent"&&u.value==="step"){s=void 0;break}if(s){if(l==="independent"&&s.value!==u.value){s=void 0;break}s=zo(s,u,n,"")}else s=u}if(s){for(const a of e.children)e.renameSignal(a.getName(n),e.getName(t)),a.component.layoutSize.set(n,"merged",!1);o.setWithExplicit(t,s)}else o.setWithExplicit(t,{explicit:!1,value:void 0})}function Hue(e){const{size:t,component:n}=e;for(const i of Qr){const r=_n(i);if(t[r]){const o=t[r];n.layoutSize.set(r,sr(o)?"step":o,!0)}else{const o=Gue(e,r);n.layoutSize.set(r,o,!1)}}}function Gue(e,t){const n=t==="width"?"x":"y",i=e.config,r=e.getScaleComponent(n);if(r){const o=r.get("type"),s=r.get("range");if(yt(o)){const a=Qh(i.view,t);return la(s)||sr(a)?"step":a}else return Py(i.view,t)}else{if(e.hasProjection||e.mark==="arc")return Py(i.view,t);{const o=Qh(i.view,t);return sr(o)?o.step:o}}}function Zy(e,t,n){return V(t,{suffix:`by_${V(e)}`,...n})}class ic extends rP{constructor(t,n,i,r){super(t,"facet",n,i,r,t.resolve),this.child=xE(t.spec,this,this.getName("child"),void 0,r),this.children=[this.child],this.facet=this.initFacet(t.facet)}initFacet(t){if(!mf(t))return{facet:this.initFacetFieldDef(t,"facet")};const n=B(t),i={};for(const r of n){if(![Lr,Pr].includes(r)){j(Fp(r,"facet"));break}const o=t[r];if(o.field===void 0){j(Dy(o,r));break}i[r]=this.initFacetFieldDef(o,r)}return i}initFacetFieldDef(t,n){const i=zw(t,n);return i.header?i.header=St(i.header):i.header===null&&(i.header=null),i}channelHasField(t){return U(this.facet,t)}fieldDef(t){return this.facet[t]}parseData(){this.component.data=um(this),this.child.parseData()}parseLayoutSize(){pE(this)}parseSelections(){this.child.parseSelections(),this.component.selection=this.child.component.selection}parseMarkGroup(){this.child.parseMarkGroup()}parseAxesAndHeaders(){this.child.parseAxesAndHeaders(),Uue(this)}assembleSelectionTopLevelSignals(t){return this.child.assembleSelectionTopLevelSignals(t)}assembleSignals(){return this.child.assembleSignals(),[]}assembleSelectionData(t){return this.child.assembleSelectionData(t)}getHeaderLayoutMixins(){const t={};for(const n of Xn)for(const i of oE){const r=this.component.layoutHeaders[n],o=r[i],{facetFieldDef:s}=r;if(s){const a=_u("titleOrient",s.header,this.config,n);if(["right","bottom"].includes(a)){const u=Kp(n,a);t.titleAnchor??(t.titleAnchor={}),t.titleAnchor[u]="end"}}if(o!=null&&o[0]){const a=n==="row"?"height":"width",u=i==="header"?"headerBand":"footerBand";n!=="facet"&&!this.child.component.layoutSize.get(a)&&(t[u]??(t[u]={}),t[u][n]=.5),r.title&&(t.offset??(t.offset={}),t.offset[n==="row"?"rowTitle":"columnTitle"]=10)}}return t}assembleDefaultLayout(){const{column:t,row:n}=this.facet,i=t?this.columnDistinctSignal():n?1:void 0;let r="all";return(!n&&this.component.resolve.scale.x==="independent"||!t&&this.component.resolve.scale.y==="independent")&&(r="none"),{...this.getHeaderLayoutMixins(),...i?{columns:i}:{},bounds:"full",align:r}}assembleLayoutSignals(){return this.child.assembleLayoutSignals()}columnDistinctSignal(){if(!(this.parent&&this.parent instanceof ic))return{signal:`length(data('${this.getName("column_domain")}'))`}}assembleGroupStyle(){}assembleGroup(t){return this.parent&&this.parent instanceof ic?{...this.channelHasField("column")?{encode:{update:{columns:{field:V(this.facet.column,{prefix:"distinct"})}}}}:{},...super.assembleGroup(t)}:super.assembleGroup(t)}getCardinalityAggregateForChild(){const t=[],n=[],i=[];if(this.child instanceof ic){if(this.child.channelHasField("column")){const r=V(this.child.facet.column);t.push(r),n.push("distinct"),i.push(`distinct_${r}`)}}else for(const r of Qr){const o=this.child.component.scales[r];if(o&&!o.merged){const s=o.get("type"),a=o.get("range");if(yt(s)&&la(a)){const u=Qp(this.child,r),l=dE(u);l?(t.push(l),n.push("distinct"),i.push(`distinct_${l}`)):j(gw(r))}}}return{fields:t,ops:n,as:i}}assembleFacet(){const{name:t,data:n}=this.component.data.facetRoot,{row:i,column:r}=this.facet,{fields:o,ops:s,as:a}=this.getCardinalityAggregateForChild(),u=[];for(const c of Xn){const f=this.facet[c];if(f){u.push(V(f));const{bin:d,sort:h}=f;if(ze(d)&&u.push(V(f,{binSuffix:"end"})),Ir(h)){const{field:g,op:p=Lp}=h,m=Zy(f,h);i&&r?(o.push(m),s.push("max"),a.push(m)):(o.push(g),s.push(p),a.push(m))}else if(P(h)){const g=Su(f,c);o.push(g),s.push("max"),a.push(g)}}}const l=!!i&&!!r;return{name:t,data:n,groupby:u,...l||o.length>0?{aggregate:{...l?{cross:l}:{},...o.length?{fields:o,ops:s,as:a}:{}}}:{}}}facetSortFields(t){const{facet:n}=this,i=n[t];return i?Ir(i.sort)?[Zy(i,i.sort,{expr:"datum"})]:P(i.sort)?[Su(i,t,{expr:"datum"})]:[V(i,{expr:"datum"})]:[]}facetSortOrder(t){const{facet:n}=this,i=n[t];if(i){const{sort:r}=i;return[(Ir(r)?r.order:!P(r)&&r)||"ascending"]}return[]}assembleLabelTitle(){var r;const{facet:t,config:n}=this;if(t.facet)return Gy(t.facet,"facet",n);const i={row:["top","bottom"],column:["left","right"]};for(const o of rE)if(t[o]){const s=_u("labelOrient",(r=t[o])==null?void 0:r.header,n,o);if(i[o].includes(s))return Gy(t[o],o,n)}}assembleMarks(){const{child:t}=this,n=this.component.data.facetRoot,i=Iue(n),r=t.assembleGroupEncodeEntry(!1),o=this.assembleLabelTitle()||t.assembleTitle(),s=t.assembleGroupStyle();return[{name:this.getName("cell"),type:"group",...o?{title:o}:{},...s?{style:s}:{},from:{facet:this.assembleFacet()},sort:{field:Xn.map(u=>this.facetSortFields(u)).flat(),order:Xn.map(u=>this.facetSortOrder(u)).flat()},...i.length>0?{data:i}:{},...r?{encode:{update:r}}:{},...t.assembleGroup(rse(this,[]))}]}getMapping(){return this.facet}}function Vue(e,t){const{row:n,column:i}=t;if(n&&i){let r=null;for(const o of[n,i])if(Ir(o.sort)){const{field:s,op:a=Lp}=o.sort;e=r=new ga(e,{joinaggregate:[{op:a,field:s,as:Zy(o,o.sort,{forAs:!0})}],groupby:[V(o)]})}return r}return null}function aP(e,t){var n,i,r,o;for(const s of t){const a=s.data;if(e.name&&s.hasName()&&e.name!==s.dataName)continue;const u=(n=e.format)==null?void 0:n.mesh,l=(i=a.format)==null?void 0:i.feature;if(u&&l)continue;const c=(r=e.format)==null?void 0:r.feature;if((c||l)&&c!==l)continue;const f=(o=a.format)==null?void 0:o.mesh;if(!((u||f)&&u!==f)){if(Cc(e)&&Cc(a)){if(Dn(e.values,a.values))return s}else if(xu(e)&&xu(a)){if(e.url===a.url)return s}else if(K5(e)&&e.name===s.dataName)return s}}return null}function Yue(e,t){if(e.data||!e.parent){if(e.data===null){const i=new Js({values:[]});return t.push(i),i}const n=aP(e.data,t);if(n)return Co(e.data)||(n.data.format=HN({},e.data.format,n.data.format)),!n.hasName()&&e.data.name&&(n.dataName=e.data.name),n;{const i=new Js(e.data);return t.push(i),i}}else return e.parent.component.data.facetRoot?e.parent.component.data.facetRoot:e.parent.component.data.main}function Xue(e,t,n){let i=0;for(const r of t.transforms){let o,s;if(Poe(r))s=e=new Eu(e,r),o="derived";else if(Jw(r)){const a=zae(r);s=e=jt.makeWithAncestors(e,{},a,n)??e,e=new Gu(e,t,r.filter)}else if(H5(r))s=e=Ji.makeFromTransform(e,r,t),o="number";else if(zoe(r))o="date",n.getWithExplicit(r.field).value===void 0&&(e=new jt(e,{[r.field]:o}),n.set(r.field,o,!1)),s=e=Ki.makeFromTransform(e,r);else if(Boe(r))s=e=vi.makeFromTransform(e,r),o="number",iE(t)&&(e=new Uo(e));else if(W5(r))s=e=Tc.make(e,t,r,i++),o="derived";else if(Roe(r))s=e=new Yu(e,r),o="number";else if(Noe(r))s=e=new ga(e,r),o="number";else if(Uoe(r))s=e=Br.makeFromTransform(e,r),o="derived";else if(joe(r))s=e=new nm(e,r),o="derived";else if(qoe(r))s=e=new em(e,r),o="derived";else if(Loe(r))s=e=new tm(e,r),o="derived";else if(Coe(r))s=e=new sm(e,r),o="derived";else if(Ooe(r))e=new am(e,r);else if(Ioe(r))s=e=Ms.makeFromTransform(e,r),o="derived";else if(Foe(r))s=e=new Zp(e,r),o="derived";else if(Toe(r))s=e=new rm(e,r),o="derived";else if(Moe(r))s=e=new om(e,r),o="derived";else if(Doe(r))s=e=new im(e,r),o="derived";else{j(ane(r));continue}if(s&&o!==void 0)for(const a of s.producedFields()??[])n.set(a,o,!1)}return e}function um(e){var m;let t=Yue(e,e.component.data.sources);const{outputNodes:n,outputNodeRefCounts:i}=e.component.data,r=e.data,s=!(r&&(Co(r)||xu(r)||Cc(r)))&&e.parent?e.parent.component.data.ancestorParse.clone():new tse;Co(r)?(J5(r)?t=new Sf(t,r.sequence):Qw(r)&&(t=new Ef(t,r.graticule)),s.parseNothing=!0):((m=r==null?void 0:r.format)==null?void 0:m.parse)===null&&(s.parseNothing=!0),t=jt.makeExplicit(t,e,s)??t,t=new Uo(t);const a=e.parent&&Xu(e.parent);(Ge(e)||Ln(e))&&a&&(t=Ji.makeFromEncoding(t,e)??t),e.transforms.length>0&&(t=Xue(t,e,s));const u=Uae(e),l=Bae(e);t=jt.makeWithAncestors(t,{},{...u,...l},s)??t,Ge(e)&&(t=Ha.parseAll(t,e),t=Fc.parseAll(t,e)),(Ge(e)||Ln(e))&&(a||(t=Ji.makeFromEncoding(t,e)??t),t=Ki.makeFromEncoding(t,e)??t,t=Eu.parseAllForSortIndex(t,e));const c=t=td(Ke.Raw,e,t);if(Ge(e)){const y=vi.makeFromEncoding(t,e);y&&(t=y,iE(e)&&(t=new Uo(t))),t=Ms.makeFromEncoding(t,e)??t,t=Br.makeFromEncoding(t,e)??t}let f,d;if(Ge(e)){const{markDef:y,mark:b,config:v}=e,x=Oe("invalid",y,v),{marks:E,scales:S}=d=Z5({invalid:x,isPath:es(b)});E!==S&&S==="include-invalid-values"&&(f=t=td(Ke.PreFilterInvalid,e,t)),E==="exclude-invalid-values"&&(t=Au.make(t,e,d)??t)}const h=t=td(Ke.Main,e,t);let g;if(Ge(e)&&d){const{marks:y,scales:b}=d;y==="include-invalid-values"&&b==="exclude-invalid-values"&&(t=Au.make(t,e,d)??t,g=t=td(Ke.PostFilterInvalid,e,t))}Ge(e)&&Lse(e,h);let p=null;if(Ln(e)){const y=e.getName("facet");t=Vue(t,e.facet)??t,p=new Vu(t,e,y,h.getSource()),n[y]=p}return{...e.component.data,outputNodes:n,outputNodeRefCounts:i,raw:c,main:h,facetRoot:p,ancestorParse:s,preFilterInvalid:f,postFilterInvalid:g}}function td(e,t,n){const{outputNodes:i,outputNodeRefCounts:r}=t.component.data,o=t.getDataName(e),s=new bn(n,o,e,r);return i[o]=s,s}class Kue extends gE{constructor(t,n,i,r){var o,s,a,u;super(t,"concat",n,i,r,t.resolve),(((s=(o=t.resolve)==null?void 0:o.axis)==null?void 0:s.x)==="shared"||((u=(a=t.resolve)==null?void 0:a.axis)==null?void 0:u.y)==="shared")&&j(rne),this.children=this.getChildren(t).map((l,c)=>xE(l,this,this.getName(`concat_${c}`),void 0,r))}parseData(){this.component.data=um(this);for(const t of this.children)t.parseData()}parseSelections(){this.component.selection={};for(const t of this.children){t.parseSelections();for(const n of B(t.component.selection))this.component.selection[n]=t.component.selection[n]}}parseMarkGroup(){for(const t of this.children)t.parseMarkGroup()}parseAxesAndHeaders(){for(const t of this.children)t.parseAxesAndHeaders()}getChildren(t){return qp(t)?t.vconcat:Xw(t)?t.hconcat:t.concat}parseLayoutSize(){Wue(this)}parseAxisGroup(){return null}assembleSelectionTopLevelSignals(t){return this.children.reduce((n,i)=>i.assembleSelectionTopLevelSignals(n),t)}assembleSignals(){return this.children.forEach(t=>t.assembleSignals()),[]}assembleLayoutSignals(){const t=sE(this);for(const n of this.children)t.push(...n.assembleLayoutSignals());return t}assembleSelectionData(t){return this.children.reduce((n,i)=>i.assembleSelectionData(n),t)}assembleMarks(){return this.children.map(t=>{const n=t.assembleTitle(),i=t.assembleGroupStyle(),r=t.assembleGroupEncodeEntry(!1);return{type:"group",name:t.getName("group"),...n?{title:n}:{},...i?{style:i}:{},...r?{encode:{update:r}}:{},...t.assembleGroup()}})}assembleGroupStyle(){}assembleDefaultLayout(){const t=this.layout.columns;return{...t!=null?{columns:t}:{},bounds:"full",align:"each"}}}function Jue(e){return e===!1||e===null}const Que={disable:1,gridScale:1,scale:1,...g5,labelExpr:1,encode:1},uP=B(Que);class mE extends eo{constructor(t={},n={},i=!1){super(),this.explicit=t,this.implicit=n,this.mainExtracted=i}clone(){return new mE(le(this.explicit),le(this.implicit),this.mainExtracted)}hasAxisPart(t){return t==="axis"?!0:t==="grid"||t==="title"?!!this.get(t):!Jue(this.get(t))}hasOrientSignalRef(){return te(this.explicit.orient)}}function Zue(e,t,n){const{encoding:i,config:r}=e,o=at(i[t])??at(i[mr(t)]),s=e.axis(t)||{},{format:a,formatType:u}=s;if(Ys(u))return{text:yi({fieldOrDatumDef:o,field:"datum.value",format:a,formatType:u,config:r}),...n};if(a===void 0&&u===void 0&&r.customFormatTypes){if(yu(o)==="quantitative"){if(bu(o)&&o.stack==="normalize"&&r.normalizedNumberFormatType)return{text:yi({fieldOrDatumDef:o,field:"datum.value",format:r.normalizedNumberFormat,formatType:r.normalizedNumberFormatType,config:r}),...n};if(r.numberFormatType)return{text:yi({fieldOrDatumDef:o,field:"datum.value",format:r.numberFormat,formatType:r.numberFormatType,config:r}),...n}}if(yu(o)==="temporal"&&r.timeFormatType&&q(o)&&!o.timeUnit)return{text:yi({fieldOrDatumDef:o,field:"datum.value",format:r.timeFormat,formatType:r.timeFormatType,config:r}),...n}}return n}function ele(e){return Qr.reduce((t,n)=>(e.component.scales[n]&&(t[n]=[ale(n,e)]),t),{})}const tle={bottom:"top",top:"bottom",left:"right",right:"left"};function nle(e){const{axes:t,resolve:n}=e.component,i={top:0,bottom:0,right:0,left:0};for(const r of e.children){r.parseAxesAndHeaders();for(const o of B(r.component.axes))n.axis[o]=aE(e.component.resolve,o),n.axis[o]==="shared"&&(t[o]=ile(t[o],r.component.axes[o]),t[o]||(n.axis[o]="independent",delete t[o]))}for(const r of Qr){for(const o of e.children)if(o.component.axes[r]){if(n.axis[r]==="independent"){t[r]=(t[r]??[]).concat(o.component.axes[r]);for(const s of o.component.axes[r]){const{value:a,explicit:u}=s.getWithExplicit("orient");if(!te(a)){if(i[a]>0&&!u){const l=tle[a];i[a]>i[l]&&s.set("orient",l,!1)}i[a]++}}}delete o.component.axes[r]}if(n.axis[r]==="independent"&&t[r]&&t[r].length>1)for(const[o,s]of(t[r]||[]).entries())o>0&&s.get("grid")&&!s.explicit.grid&&(s.implicit.grid=!1)}}function ile(e,t){if(e){if(e.length!==t.length)return;const n=e.length;for(let i=0;i<n;i++){const r=e[i],o=t[i];if(!!r!=!!o)return;if(r&&o){const s=r.getWithExplicit("orient"),a=o.getWithExplicit("orient");if(s.explicit&&a.explicit&&s.value!==a.value)return;e[i]=rle(r,o)}}}else return t.map(n=>n.clone());return e}function rle(e,t){for(const n of uP){const i=zo(e.getWithExplicit(n),t.getWithExplicit(n),n,"axis",(r,o)=>{switch(n){case"title":return b3(r,o);case"gridScale":return{explicit:r.explicit,value:et(r.value,o.value)}}return Hp(r,o,n,"axis")});e.setWithExplicit(n,i)}return e}function ole(e,t,n,i,r){if(t==="disable")return n!==void 0;switch(n=n||{},t){case"titleAngle":case"labelAngle":return e===(te(n.labelAngle)?n.labelAngle:$c(n.labelAngle));case"values":return!!n.values;case"encode":return!!n.encoding||!!n.labelAngle;case"title":if(e===kL(i,r))return!0}return e===n[t]}const sle=new Set(["grid","translate","format","formatType","orient","labelExpr","tickCount","position","tickMinStep"]);function ale(e,t){var y,b;let n=t.axis(e);const i=new mE,r=at(t.encoding[e]),{mark:o,config:s}=t,a=(n==null?void 0:n.orient)||((y=s[e==="x"?"axisX":"axisY"])==null?void 0:y.orient)||((b=s.axis)==null?void 0:b.orient)||Gse(e),u=t.getScaleComponent(e).get("type"),l=zse(e,u,a,t.config),c=n!==void 0?!n:Wy("disable",s.style,n==null?void 0:n.style,l).configValue;if(i.set("disable",c,n!==void 0),c)return i;n=n||{};const f=qse(r,n,e,s.style,l),d=e5(n.formatType,r,u),h=Z3(r,r.type,n.format,n.formatType,s,!0),g={fieldOrDatumDef:r,axis:n,channel:e,model:t,scaleType:u,orient:a,labelAngle:f,format:h,formatType:d,mark:o,config:s};for(const v of uP){const x=v in Z$?Z$[v](g):A$(v)?n[v]:void 0,E=x!==void 0,S=ole(x,v,n,t,e);if(E&&S)i.set(v,x,S);else{const{configValue:w=void 0,configFrom:_=void 0}=A$(v)&&v!=="values"?Wy(v,s.style,n.style,l):{},A=w!==void 0;E&&!A?i.set(v,x,S):(_!=="vgAxisConfig"||sle.has(v)&&A||xf(w)||te(w))&&i.set(v,w,!1)}}const p=n.encoding??{},m=h5.reduce((v,x)=>{if(!i.hasAxisPart(x))return v;const E=OL(p[x]??{},t),S=x==="labels"?Zue(t,e,E):E;return S!==void 0&&!Re(S)&&(v[x]={update:S}),v},{});return Re(m)||i.set("encode",m,!!n.encoding||n.labelAngle!==void 0),i}function ule({encoding:e,size:t}){for(const n of Qr){const i=_n(n);sr(t[i])&&Eo(e[n])&&(delete t[i],j(S3(i)))}return t}const lle={vgMark:"arc",encodeEntry:e=>({...si(e,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore",theta:"ignore"}),...on("x",e,{defaultPos:"mid"}),...on("y",e,{defaultPos:"mid"}),...Hr(e,"radius"),...Hr(e,"theta")})},cle={vgMark:"area",encodeEntry:e=>({...si(e,{align:"ignore",baseline:"ignore",color:"include",orient:"include",size:"ignore",theta:"ignore"}),...Zh("x",e,{defaultPos:"zeroOrMin",defaultPos2:"zeroOrMin",range:e.markDef.orient==="horizontal"}),...Zh("y",e,{defaultPos:"zeroOrMin",defaultPos2:"zeroOrMin",range:e.markDef.orient==="vertical"}),...nE(e)})},fle={vgMark:"rect",encodeEntry:e=>({...si(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...Hr(e,"x"),...Hr(e,"y")})},dle={vgMark:"shape",encodeEntry:e=>({...si(e,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore",theta:"ignore"})}),postEncodingTransform:e=>{const{encoding:t}=e,n=t.shape;return[{type:"geoshape",projection:e.projectionName(),...n&&q(n)&&n.type===Wu?{field:V(n,{expr:"datum"})}:{}}]}},hle={vgMark:"image",encodeEntry:e=>({...si(e,{align:"ignore",baseline:"ignore",color:"ignore",orient:"ignore",size:"ignore",theta:"ignore"}),...Hr(e,"x"),...Hr(e,"y"),...eE(e,"url")})},gle={vgMark:"line",encodeEntry:e=>({...si(e,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore",theta:"ignore"}),...on("x",e,{defaultPos:"mid"}),...on("y",e,{defaultPos:"mid"}),...At("size",e,{vgChannel:"strokeWidth"}),...nE(e)})},ple={vgMark:"trail",encodeEntry:e=>({...si(e,{align:"ignore",baseline:"ignore",color:"include",size:"include",orient:"ignore",theta:"ignore"}),...on("x",e,{defaultPos:"mid"}),...on("y",e,{defaultPos:"mid"}),...At("size",e),...nE(e)})};function yE(e,t){const{config:n}=e;return{...si(e,{align:"ignore",baseline:"ignore",color:"include",size:"include",orient:"ignore",theta:"ignore"}),...on("x",e,{defaultPos:"mid"}),...on("y",e,{defaultPos:"mid"}),...At("size",e),...At("angle",e),...mle(e,n,t)}}function mle(e,t,n){return n?{shape:{value:n}}:At("shape",e)}const yle={vgMark:"symbol",encodeEntry:e=>yE(e)},ble={vgMark:"symbol",encodeEntry:e=>yE(e,"circle")},vle={vgMark:"symbol",encodeEntry:e=>yE(e,"square")},xle={vgMark:"rect",encodeEntry:e=>({...si(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...Hr(e,"x"),...Hr(e,"y")})},wle={vgMark:"rule",encodeEntry:e=>{const{markDef:t}=e,n=t.orient;return!e.encoding.x&&!e.encoding.y&&!e.encoding.latitude&&!e.encoding.longitude?{}:{...si(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...Zh("x",e,{defaultPos:n==="horizontal"?"zeroOrMax":"mid",defaultPos2:"zeroOrMin",range:n!=="vertical"}),...Zh("y",e,{defaultPos:n==="vertical"?"zeroOrMax":"mid",defaultPos2:"zeroOrMin",range:n!=="horizontal"}),...At("size",e,{vgChannel:"strokeWidth"})}}},Ele={vgMark:"text",encodeEntry:e=>{const{config:t,encoding:n}=e;return{...si(e,{align:"include",baseline:"include",color:"include",size:"ignore",orient:"ignore",theta:"include"}),...on("x",e,{defaultPos:"mid"}),...on("y",e,{defaultPos:"mid"}),...eE(e),...At("size",e,{vgChannel:"fontSize"}),...At("angle",e),...X$("align",Sle(e.markDef,n,t)),...X$("baseline",_le(e.markDef,n,t)),...on("radius",e,{defaultPos:null}),...on("theta",e,{defaultPos:null})}}};function Sle(e,t,n){if(Oe("align",e,n)===void 0)return"center"}function _le(e,t,n){if(Oe("baseline",e,n)===void 0)return"middle"}const Ale={vgMark:"rect",encodeEntry:e=>{const{config:t,markDef:n}=e,i=n.orient,r=i==="horizontal"?"x":"y",o=i==="horizontal"?"y":"x",s=i==="horizontal"?"height":"width";return{...si(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...Hr(e,r),...on(o,e,{defaultPos:"mid",vgChannel:o==="y"?"yc":"xc"}),[s]:Ue(Oe("thickness",n,t))}}},nd={arc:lle,area:cle,bar:fle,circle:ble,geoshape:dle,image:hle,line:gle,point:yle,rect:xle,rule:wle,square:vle,text:Ele,tick:Ale,trail:ple};function $le(e){if(ve([Rp,Dp,Rie],e.mark)){const t=x5(e.mark,e.encoding);if(t.length>0)return kle(e,t)}else if(e.mark===Op){const t=Ty.some(n=>Oe(n,e.markDef,e.config));if(e.stack&&!e.fieldDef("size")&&t)return Cle(e)}return bE(e)}const pk="faceted_path_";function kle(e,t){return[{name:e.getName("pathgroup"),type:"group",from:{facet:{name:pk+e.requestDataName(Ke.Main),data:e.requestDataName(Ke.Main),groupby:t}},encode:{update:{width:{field:{group:"width"}},height:{field:{group:"height"}}}},marks:bE(e,{fromPrefix:pk})}]}const mk="stack_group_";function Cle(e){var l;const[t]=bE(e,{fromPrefix:mk}),n=e.scaleName(e.stack.fieldChannel),i=(c={})=>e.vgField(e.stack.fieldChannel,c),r=(c,f)=>{const d=[i({prefix:"min",suffix:"start",expr:f}),i({prefix:"max",suffix:"start",expr:f}),i({prefix:"min",suffix:"end",expr:f}),i({prefix:"max",suffix:"end",expr:f})];return`${c}(${d.map(h=>`scale('${n}',${h})`).join(",")})`};let o,s;e.stack.fieldChannel==="x"?(o={...cu(t.encode.update,["y","yc","y2","height",...Ty]),x:{signal:r("min","datum")},x2:{signal:r("max","datum")},clip:{value:!0}},s={x:{field:{group:"x"},mult:-1},height:{field:{group:"height"}}},t.encode.update={...yn(t.encode.update,["y","yc","y2"]),height:{field:{group:"height"}}}):(o={...cu(t.encode.update,["x","xc","x2","width"]),y:{signal:r("min","datum")},y2:{signal:r("max","datum")},clip:{value:!0}},s={y:{field:{group:"y"},mult:-1},width:{field:{group:"width"}}},t.encode.update={...yn(t.encode.update,["x","xc","x2"]),width:{field:{group:"width"}}});for(const c of Ty){const f=rr(c,e.markDef,e.config);t.encode.update[c]?(o[c]=t.encode.update[c],delete t.encode.update[c]):f&&(o[c]=Ue(f)),f&&(t.encode.update[c]={value:0})}const a=[];if(((l=e.stack.groupbyChannels)==null?void 0:l.length)>0)for(const c of e.stack.groupbyChannels){const f=e.fieldDef(c),d=V(f);d&&a.push(d),(f!=null&&f.bin||f!=null&&f.timeUnit)&&a.push(V(f,{binSuffix:"end"}))}return o=["stroke","strokeWidth","strokeJoin","strokeCap","strokeDash","strokeDashOffset","strokeMiterLimit","strokeOpacity"].reduce((c,f)=>{if(t.encode.update[f])return{...c,[f]:t.encode.update[f]};{const d=rr(f,e.markDef,e.config);return d!==void 0?{...c,[f]:Ue(d)}:c}},o),o.stroke&&(o.strokeForeground={value:!0},o.strokeOffset={value:0}),[{type:"group",from:{facet:{data:e.requestDataName(Ke.Main),name:mk+e.requestDataName(Ke.Main),groupby:a,aggregate:{fields:[i({suffix:"start"}),i({suffix:"start"}),i({suffix:"end"}),i({suffix:"end"})],ops:["min","max","min","max"]}}},encode:{update:o},marks:[{type:"group",encode:{update:s},marks:[t]}]}]}function Fle(e){const{encoding:t,stack:n,mark:i,markDef:r,config:o}=e,s=t.order;if(!(!P(s)&&_i(s)&&Cy(s.value)||!s&&Cy(Oe("order",r,o)))){if((P(s)||q(s))&&!n)return p3(s,{expr:"datum"});if(es(i)){const a=r.orient==="horizontal"?"y":"x",u=t[a];if(q(u))return{field:a}}}}function bE(e,t={fromPrefix:""}){const{mark:n,markDef:i,encoding:r,config:o}=e,s=et(i.clip,Tle(e),Mle(e)),a=h3(i),u=r.key,l=Fle(e),c=Dle(e),f=Oe("aria",i,o),d=nd[n].postEncodingTransform?nd[n].postEncodingTransform(e):null;return[{name:e.getName("marks"),type:nd[n].vgMark,...s?{clip:s}:{},...a?{style:a}:{},...u?{key:u.field}:{},...l?{sort:l}:{},...c||{},...f===!1?{aria:f}:{},from:{data:t.fromPrefix+e.requestDataName(Ke.Main)},encode:{update:nd[n].encodeEntry(e)},...d?{transform:d}:{}}]}function Tle(e){const t=e.getScaleComponent("x"),n=e.getScaleComponent("y");return t!=null&&t.get("selectionExtent")||n!=null&&n.get("selectionExtent")?!0:void 0}function Mle(e){const t=e.component.projection;return t&&!t.isFit?!0:void 0}function Dle(e){if(!e.component.selection)return null;const t=B(e.component.selection).length;let n=t,i=e.parent;for(;i&&n===0;)n=B(i.component.selection).length,i=i.parent;return n?{interactive:t>0||e.mark==="geoshape"||!!e.encoding.tooltip||!!e.markDef.tooltip}:null}class lP extends rP{constructor(t,n,i,r={},o){super(t,"unit",n,i,o,void 0,k$(t)?t.view:void 0),this.specifiedScales={},this.specifiedAxes={},this.specifiedLegends={},this.specifiedProjection={},this.selection=[],this.children=[];const s=or(t.mark)?{...t.mark}:{type:t.mark},a=s.type;s.filled===void 0&&(s.filled=yoe(s,o,{graticule:t.data&&Qw(t.data)}));const u=this.encoding=wre(t.encoding||{},a,s.filled,o);this.markDef=U5(s,u,o),this.size=ule({encoding:u,size:k$(t)?{...r,...t.width?{width:t.width}:{},...t.height?{height:t.height}:{}}:r}),this.stack=B5(this.markDef,u),this.specifiedScales=this.initScales(a,u),this.specifiedAxes=this.initAxes(u),this.specifiedLegends=this.initLegends(u),this.specifiedProjection=t.projection,this.selection=(t.params??[]).filter(l=>Vw(l))}get hasProjection(){const{encoding:t}=this,n=this.mark===G3,i=t&&yte.some(r=>ce(t[r]));return n||i}scaleDomain(t){const n=this.specifiedScales[t];return n?n.domain:void 0}axis(t){return this.specifiedAxes[t]}legend(t){return this.specifiedLegends[t]}initScales(t,n){return fw.reduce((i,r)=>{const o=at(n[r]);return o&&(i[r]=this.initScale(o.scale??{})),i},{})}initScale(t){const{domain:n,range:i}=t,r=St(t);return P(n)&&(r.domain=n.map(Tn)),P(i)&&(r.range=i.map(Tn)),r}initAxes(t){return Qr.reduce((n,i)=>{const r=t[i];if(ce(r)||i===We&&ce(t.x2)||i===vt&&ce(t.y2)){const o=ce(r)?r.axis:void 0;n[i]=o&&this.initAxis({...o})}return n},{})}initAxis(t){const n=B(t),i={};for(const r of n){const o=t[r];i[r]=xf(o)?d3(o):Tn(o)}return i}initLegends(t){return kte.reduce((n,i)=>{const r=at(t[i]);if(r&&Fte(i)){const o=r.legend;n[i]=o&&St(o)}return n},{})}parseData(){this.component.data=um(this)}parseLayoutSize(){Hue(this)}parseSelections(){this.component.selection=Nse(this,this.selection)}parseMarkGroup(){this.component.mark=$le(this)}parseAxesAndHeaders(){this.component.axes=ele(this)}assembleSelectionTopLevelSignals(t){return ose(this,t)}assembleSignals(){return[..._L(this),...ise(this,[])]}assembleSelectionData(t){return sse(this,t)}assembleLayout(){return null}assembleLayoutSignals(){return sE(this)}assembleMarks(){let t=this.component.mark??[];return(!this.parent||!Xu(this.parent))&&(t=tL(this,t)),t.map(this.correctDataNames)}assembleGroupStyle(){const{style:t}=this.view||{};return t!==void 0?t:this.encoding.x||this.encoding.y?"cell":"view"}getMapping(){return this.encoding}get mark(){return this.markDef.type}channelHasField(t){return Fs(this.encoding,t)}fieldDef(t){const n=this.encoding[t];return Ai(n)}typedFieldDef(t){const n=this.fieldDef(t);return cn(n)?n:null}}class vE extends gE{constructor(t,n,i,r,o){super(t,"layer",n,i,o,t.resolve,t.view);const s={...r,...t.width?{width:t.width}:{},...t.height?{height:t.height}:{}};this.children=t.layer.map((a,u)=>{if(Wp(a))return new vE(a,this,this.getName(`layer_${u}`),s,o);if(Zr(a))return new lP(a,this,this.getName(`layer_${u}`),s,o);throw new Error(hw(a))})}parseData(){this.component.data=um(this);for(const t of this.children)t.parseData()}parseLayoutSize(){que(this)}parseSelections(){this.component.selection={};for(const t of this.children){t.parseSelections();for(const n of B(t.component.selection))this.component.selection[n]=t.component.selection[n]}}parseMarkGroup(){for(const t of this.children)t.parseMarkGroup()}parseAxesAndHeaders(){nle(this)}assembleSelectionTopLevelSignals(t){return this.children.reduce((n,i)=>i.assembleSelectionTopLevelSignals(n),t)}assembleSignals(){return this.children.reduce((t,n)=>t.concat(n.assembleSignals()),_L(this))}assembleLayoutSignals(){return this.children.reduce((t,n)=>t.concat(n.assembleLayoutSignals()),sE(this))}assembleSelectionData(t){return this.children.reduce((n,i)=>i.assembleSelectionData(n),t)}assembleGroupStyle(){const t=new Set;for(const i of this.children)for(const r of X(i.assembleGroupStyle()))t.add(r);const n=Array.from(t);return n.length>1?n:n.length===1?n[0]:void 0}assembleTitle(){let t=super.assembleTitle();if(t)return t;for(const n of this.children)if(t=n.assembleTitle(),t)return t}assembleLayout(){return null}assembleMarks(){return ase(this,this.children.flatMap(t=>t.assembleMarks()))}assembleLegends(){return this.children.reduce((t,n)=>t.concat(n.assembleLegends()),UL(this))}}function xE(e,t,n,i,r){if(Pp(e))return new ic(e,t,n,r);if(Wp(e))return new vE(e,t,n,i,r);if(Zr(e))return new lP(e,t,n,i,r);if(Hre(e))return new Kue(e,t,n,r);throw new Error(hw(e))}function Ole(e,t={}){t.logger&&Yne(t.logger),t.fieldTitle&&c5(t.fieldTitle);try{const n=z5(Cu(t.config,e.config)),i=Y5(e,n),r=xE(i,null,"",void 0,n);return r.parse(),iue(r.component.data,r),{spec:Nle(r,Rle(e,i.autosize,n,r),e.datasets,e.usermeta),normalized:i}}finally{t.logger&&Xne(),t.fieldTitle&&dre()}}function Rle(e,t,n,i){const r=i.component.layoutSize.get("width"),o=i.component.layoutSize.get("height");if(t===void 0?(t={type:"pad"},i.hasAxisOrientSignalRef()&&(t.resize=!0)):K(t)&&(t={type:t}),r&&o&&Qoe(t.type)){if(r==="step"&&o==="step")j(f$()),t.type="pad";else if(r==="step"||o==="step"){const s=r==="step"?"width":"height";j(f$($p(s)));const a=s==="width"?"height":"width";t.type=Zoe(a)}}return{...B(t).length===1&&t.type?t.type==="pad"?{}:{autosize:t.type}:{autosize:t},...z$(n,!1),...z$(e,!0)}}function Nle(e,t,n={},i){const r=e.config?ooe(e.config):void 0,o=[].concat(e.assembleSelectionData([]),zue(e.component.data,n)),s=e.assembleProjections(),a=e.assembleTitle(),u=e.assembleGroupStyle(),l=e.assembleGroupEncodeEntry(!0);let c=e.assembleLayoutSignals();c=c.filter(h=>(h.name==="width"||h.name==="height")&&h.value!==void 0?(t[h.name]=+h.value,!1):!0);const{params:f,...d}=t;return{$schema:"https://vega.github.io/schema/vega/v5.json",...e.description?{description:e.description}:{},...d,...a?{title:a}:{},...u?{style:u}:{},...l?{encode:{update:l}}:{},data:o,...s.length>0?{projections:s}:{},...e.assembleGroup([...c,...e.assembleSelectionTopLevelSignals([]),...N5(f)]),...r?{config:r}:{},...i?{usermeta:i}:{}}}const Lle=fte.version,Ple=Object.freeze(Object.defineProperty({__proto__:null,accessPathDepth:du,accessPathWithDatum:iw,compile:Ole,contains:ve,deepEqual:Dn,deleteNestedProperty:qh,duplicate:le,entries:Lo,every:ew,fieldIntersection:nw,flatAccessWithDatum:VN,getFirstDefined:et,hasIntersection:tw,hasProperty:U,hash:xe,internalField:KN,isBoolean:Ac,isEmpty:Re,isEqual:hte,isInternalField:JN,isNullOrFalse:Cy,isNumeric:xp,keys:B,logicalExpr:tc,mergeDeep:HN,never:WN,normalize:Y5,normalizeAngle:$c,omit:yn,pick:cu,prefixGenerator:Fy,removePathFromField:ju,replaceAll:qs,replacePathInField:ni,resetIdCounter:pte,setEqual:GN,some:fu,stringify:Ne,titleCase:lf,unique:Gi,uniqueId:XN,vals:Ft,varName:qe,version:Lle},Symbol.toStringTag,{value:"Module"}));function cP(e){const[t,n]=/schema\/([\w-]+)\/([\w\.\-]+)\.json$/g.exec(e).slice(1,3);return{library:t,version:n}}var Ile="2.15.0",zle={version:Ile};const ka="#fff",yk="#888",Ble={background:"#333",view:{stroke:yk},title:{color:ka,subtitleColor:ka},style:{"guide-label":{fill:ka},"guide-title":{fill:ka}},axis:{domainColor:ka,gridColor:yk,tickColor:ka}},ss="#4572a7",Ule={background:"#fff",arc:{fill:ss},area:{fill:ss},line:{stroke:ss,strokeWidth:2},path:{stroke:ss},rect:{fill:ss},shape:{stroke:ss},symbol:{fill:ss,strokeWidth:1.5,size:50},axis:{bandPosition:.5,grid:!0,gridColor:"#000000",gridOpacity:1,gridWidth:.5,labelPadding:10,tickSize:5,tickWidth:.5},axisBand:{grid:!1,tickExtra:!0},legend:{labelBaseline:"middle",labelFontSize:11,symbolSize:50,symbolType:"square"},range:{category:["#4572a7","#aa4643","#8aa453","#71598e","#4598ae","#d98445","#94aace","#d09393","#b9cc98","#a99cbc"]}},as="#30a2da",F0="#cbcbcb",jle="#999",qle="#333",bk="#f0f0f0",vk="#333",Wle={arc:{fill:as},area:{fill:as},axis:{domainColor:F0,grid:!0,gridColor:F0,gridWidth:1,labelColor:jle,labelFontSize:10,titleColor:qle,tickColor:F0,tickSize:10,titleFontSize:14,titlePadding:10,labelPadding:4},axisBand:{grid:!1},background:bk,group:{fill:bk},legend:{labelColor:vk,labelFontSize:11,padding:1,symbolSize:30,symbolType:"square",titleColor:vk,titleFontSize:14,titlePadding:10},line:{stroke:as,strokeWidth:2},path:{stroke:as,strokeWidth:.5},rect:{fill:as},range:{category:["#30a2da","#fc4f30","#e5ae38","#6d904f","#8b8b8b","#b96db8","#ff9e27","#56cc60","#52d2ca","#52689e","#545454","#9fe4f8"],diverging:["#cc0020","#e77866","#f6e7e1","#d6e8ed","#91bfd9","#1d78b5"],heatmap:["#d6e8ed","#cee0e5","#91bfd9","#549cc6","#1d78b5"]},point:{filled:!0,shape:"circle"},shape:{stroke:as},bar:{binSpacing:2,fill:as,stroke:null},title:{anchor:"start",fontSize:24,fontWeight:600,offset:20}},us="#000",Hle={group:{fill:"#e5e5e5"},arc:{fill:us},area:{fill:us},line:{stroke:us},path:{stroke:us},rect:{fill:us},shape:{stroke:us},symbol:{fill:us,size:40},axis:{domain:!1,grid:!0,gridColor:"#FFFFFF",gridOpacity:1,labelColor:"#7F7F7F",labelPadding:4,tickColor:"#7F7F7F",tickSize:5.67,titleFontSize:16,titleFontWeight:"normal"},legend:{labelBaseline:"middle",labelFontSize:11,symbolSize:40},range:{category:["#000000","#7F7F7F","#1A1A1A","#999999","#333333","#B0B0B0","#4D4D4D","#C9C9C9","#666666","#DCDCDC"]}},Gle=22,Vle="normal",xk="Benton Gothic, sans-serif",wk=11.5,Yle="normal",ls="#82c6df",T0="Benton Gothic Bold, sans-serif",Ek="normal",Sk=13,bl={"category-6":["#ec8431","#829eb1","#c89d29","#3580b1","#adc839","#ab7fb4"],"fire-7":["#fbf2c7","#f9e39c","#f8d36e","#f4bb6a","#e68a4f","#d15a40","#ab4232"],"fireandice-6":["#e68a4f","#f4bb6a","#f9e39c","#dadfe2","#a6b7c6","#849eae"]},Xle={background:"#ffffff",title:{anchor:"start",color:"#000000",font:T0,fontSize:Gle,fontWeight:Vle},arc:{fill:ls},area:{fill:ls},line:{stroke:ls,strokeWidth:2},path:{stroke:ls},rect:{fill:ls},shape:{stroke:ls},symbol:{fill:ls,size:30},axis:{labelFont:xk,labelFontSize:wk,labelFontWeight:Yle,titleFont:T0,titleFontSize:Sk,titleFontWeight:Ek},axisX:{labelAngle:0,labelPadding:4,tickSize:3},axisY:{labelBaseline:"middle",maxExtent:45,minExtent:45,tickSize:2,titleAlign:"left",titleAngle:0,titleX:-45,titleY:-11},legend:{labelFont:xk,labelFontSize:wk,symbolType:"square",titleFont:T0,titleFontSize:Sk,titleFontWeight:Ek},range:{category:bl["category-6"],diverging:bl["fireandice-6"],heatmap:bl["fire-7"],ordinal:bl["fire-7"],ramp:bl["fire-7"]}},cs="#ab5787",id="#979797",Kle={background:"#f9f9f9",arc:{fill:cs},area:{fill:cs},line:{stroke:cs},path:{stroke:cs},rect:{fill:cs},shape:{stroke:cs},symbol:{fill:cs,size:30},axis:{domainColor:id,domainWidth:.5,gridWidth:.2,labelColor:id,tickColor:id,tickWidth:.2,titleColor:id},axisBand:{grid:!1},axisX:{grid:!0,tickSize:10},axisY:{domain:!1,grid:!0,tickSize:0},legend:{labelFontSize:11,padding:1,symbolSize:30,symbolType:"square"},range:{category:["#ab5787","#51b2e5","#703c5c","#168dd9","#d190b6","#00609f","#d365ba","#154866","#666666","#c4c4c4"]}},fs="#3e5c69",Jle={background:"#fff",arc:{fill:fs},area:{fill:fs},line:{stroke:fs},path:{stroke:fs},rect:{fill:fs},shape:{stroke:fs},symbol:{fill:fs},axis:{domainWidth:.5,grid:!0,labelPadding:2,tickSize:5,tickWidth:.5,titleFontWeight:"normal"},axisBand:{grid:!1},axisX:{gridWidth:.2},axisY:{gridDash:[3],gridWidth:.4},legend:{labelFontSize:11,padding:1,symbolType:"square"},range:{category:["#3e5c69","#6793a6","#182429","#0570b0","#3690c0","#74a9cf","#a6bddb","#e2ddf2"]}},qn="#1696d2",_k="#000000",Qle="#FFFFFF",rd="Lato",M0="Lato",Zle="Lato",ece="#DEDDDD",tce=18,vl={"shades-blue":["#CFE8F3","#A2D4EC","#73BFE2","#46ABDB","#1696D2","#12719E","#0A4C6A","#062635"],"six-groups-cat-1":["#1696d2","#ec008b","#fdbf11","#000000","#d2d2d2","#55b748"],"six-groups-seq":["#cfe8f3","#a2d4ec","#73bfe2","#46abdb","#1696d2","#12719e"],"diverging-colors":["#ca5800","#fdbf11","#fdd870","#fff2cf","#cfe8f3","#73bfe2","#1696d2","#0a4c6a"]},nce={background:Qle,title:{anchor:"start",fontSize:tce,font:rd},axisX:{domain:!0,domainColor:_k,domainWidth:1,grid:!1,labelFontSize:12,labelFont:M0,labelAngle:0,tickColor:_k,tickSize:5,titleFontSize:12,titlePadding:10,titleFont:rd},axisY:{domain:!1,domainWidth:1,grid:!0,gridColor:ece,gridWidth:1,labelFontSize:12,labelFont:M0,labelPadding:8,ticks:!1,titleFontSize:12,titlePadding:10,titleFont:rd,titleAngle:0,titleY:-10,titleX:18},legend:{labelFontSize:12,labelFont:M0,symbolSize:100,titleFontSize:12,titlePadding:10,titleFont:rd,orient:"right",offset:10},view:{stroke:"transparent"},range:{category:vl["six-groups-cat-1"],diverging:vl["diverging-colors"],heatmap:vl["diverging-colors"],ordinal:vl["six-groups-seq"],ramp:vl["shades-blue"]},area:{fill:qn},rect:{fill:qn},line:{color:qn,stroke:qn,strokeWidth:5},trail:{color:qn,stroke:qn,strokeWidth:0,size:1},path:{stroke:qn,strokeWidth:.5},point:{filled:!0},text:{font:Zle,color:qn,fontSize:11,align:"center",fontWeight:400,size:11},style:{bar:{fill:qn,stroke:null}},arc:{fill:qn},shape:{stroke:qn},symbol:{fill:qn,size:30}},ds="#3366CC",Ak="#ccc",od="Arial, sans-serif",ice={arc:{fill:ds},area:{fill:ds},path:{stroke:ds},rect:{fill:ds},shape:{stroke:ds},symbol:{stroke:ds},circle:{fill:ds},background:"#fff",padding:{top:10,right:10,bottom:10,left:10},style:{"guide-label":{font:od,fontSize:12},"guide-title":{font:od,fontSize:12},"group-title":{font:od,fontSize:12}},title:{font:od,fontSize:14,fontWeight:"bold",dy:-3,anchor:"start"},axis:{gridColor:Ak,tickColor:Ak,domain:!1,grid:!0},range:{category:["#4285F4","#DB4437","#F4B400","#0F9D58","#AB47BC","#00ACC1","#FF7043","#9E9D24","#5C6BC0","#F06292","#00796B","#C2185B"],heatmap:["#c6dafc","#5e97f6","#2a56c6"]}},wE=e=>e*(1/3+1),$k=wE(9),kk=wE(10),Ck=wE(12),xl="Segoe UI",Fk="wf_standard-font, helvetica, arial, sans-serif",Tk="#252423",wl="#605E5C",Mk="transparent",rce="#C8C6C4",li="#118DFF",oce="#12239E",sce="#E66C37",ace="#6B007B",uce="#E044A7",lce="#744EC2",cce="#D9B300",fce="#D64550",fP=li,dP="#DEEFFF",Dk=[dP,fP],dce=[dP,"#c7e4ff","#b0d9ff","#9aceff","#83c3ff","#6cb9ff","#55aeff","#3fa3ff","#2898ff",fP],hce={view:{stroke:Mk},background:Mk,font:xl,header:{titleFont:Fk,titleFontSize:Ck,titleColor:Tk,labelFont:xl,labelFontSize:kk,labelColor:wl},axis:{ticks:!1,grid:!1,domain:!1,labelColor:wl,labelFontSize:$k,titleFont:Fk,titleColor:Tk,titleFontSize:Ck,titleFontWeight:"normal"},axisQuantitative:{tickCount:3,grid:!0,gridColor:rce,gridDash:[1,5],labelFlush:!1},axisBand:{tickExtra:!0},axisX:{labelPadding:5},axisY:{labelPadding:10},bar:{fill:li},line:{stroke:li,strokeWidth:3,strokeCap:"round",strokeJoin:"round"},text:{font:xl,fontSize:$k,fill:wl},arc:{fill:li},area:{fill:li,line:!0,opacity:.6},path:{stroke:li},rect:{fill:li},point:{fill:li,filled:!0,size:75},shape:{stroke:li},symbol:{fill:li,strokeWidth:1.5,size:50},legend:{titleFont:xl,titleFontWeight:"bold",titleColor:wl,labelFont:xl,labelFontSize:kk,labelColor:wl,symbolType:"circle",symbolSize:75},range:{category:[li,oce,sce,ace,uce,lce,cce,fce],diverging:Dk,heatmap:Dk,ordinal:dce}},D0='IBM Plex Sans,system-ui,-apple-system,BlinkMacSystemFont,".sfnstext-regular",sans-serif',gce='IBM Plex Sans Condensed, system-ui, -apple-system, BlinkMacSystemFont, ".SFNSText-Regular", sans-serif',O0=400,sd={textPrimary:{g90:"#f4f4f4",g100:"#f4f4f4",white:"#161616",g10:"#161616"},textSecondary:{g90:"#c6c6c6",g100:"#c6c6c6",white:"#525252",g10:"#525252"},layerAccent01:{white:"#e0e0e0",g10:"#e0e0e0",g90:"#525252",g100:"#393939"},gridBg:{white:"#ffffff",g10:"#ffffff",g90:"#161616",g100:"#161616"}},pce=["#8a3ffc","#33b1ff","#007d79","#ff7eb6","#fa4d56","#fff1f1","#6fdc8c","#4589ff","#d12771","#d2a106","#08bdba","#bae6ff","#ba4e00","#d4bbff"],mce=["#6929c4","#1192e8","#005d5d","#9f1853","#fa4d56","#570408","#198038","#002d9c","#ee538b","#b28600","#009d9a","#012749","#8a3800","#a56eff"];function lm({theme:e,background:t}){const n=["white","g10"].includes(e)?"light":"dark",i=sd.gridBg[e],r=sd.textPrimary[e],o=sd.textSecondary[e],s=n==="dark"?pce:mce,a=n==="dark"?"#d4bbff":"#6929c4";return{background:t,arc:{fill:a},area:{fill:a},path:{stroke:a},rect:{fill:a},shape:{stroke:a},symbol:{stroke:a},circle:{fill:a},view:{fill:i,stroke:i},group:{fill:i},title:{color:r,anchor:"start",dy:-15,fontSize:16,font:D0,fontWeight:600},axis:{labelColor:o,labelFontSize:12,labelFont:gce,labelFontWeight:O0,titleColor:r,titleFontWeight:600,titleFontSize:12,grid:!0,gridColor:sd.layerAccent01[e],labelAngle:0},axisX:{titlePadding:10},axisY:{titlePadding:2.5},style:{"guide-label":{font:D0,fill:o,fontWeight:O0},"guide-title":{font:D0,fill:o,fontWeight:O0}},range:{category:s,diverging:["#750e13","#a2191f","#da1e28","#fa4d56","#ff8389","#ffb3b8","#ffd7d9","#fff1f1","#e5f6ff","#bae6ff","#82cfff","#33b1ff","#1192e8","#0072c3","#00539a","#003a6d"],heatmap:["#f6f2ff","#e8daff","#d4bbff","#be95ff","#a56eff","#8a3ffc","#6929c4","#491d8b","#31135e","#1c0f30"]}}}const yce=lm({theme:"white",background:"#ffffff"}),bce=lm({theme:"g10",background:"#f4f4f4"}),vce=lm({theme:"g90",background:"#262626"}),xce=lm({theme:"g100",background:"#161616"}),wce=zle.version,Ece=Object.freeze(Object.defineProperty({__proto__:null,carbong10:bce,carbong100:xce,carbong90:vce,carbonwhite:yce,dark:Ble,excel:Ule,fivethirtyeight:Wle,ggplot2:Hle,googlecharts:ice,latimes:Xle,powerbi:hce,quartz:Kle,urbaninstitute:nce,version:wce,vox:Jle},Symbol.toStringTag,{value:"Module"}));function Sce(e,t,n,i){if(P(e))return`[${e.map(r=>t(K(r)?r:Ok(r,n))).join(", ")}]`;if(Y(e)){let r="";const{title:o,image:s,...a}=e;o&&(r+=`<h2>${t(o)}</h2>`),s&&(r+=`<img src="${new URL(t(s),i||location.href).href}">`);const u=Object.keys(a);if(u.length>0){r+="<table>";for(const l of u){let c=a[l];c!==void 0&&(Y(c)&&(c=Ok(c,n)),r+=`<tr><td class="key">${t(l)}</td><td class="value">${t(c)}</td></tr>`)}r+="</table>"}return r||"{}"}return t(e)}function _ce(e){const t=[];return function(n,i){if(typeof i!="object"||i===null)return i;const r=t.indexOf(this)+1;return t.length=r,t.length>e?"[Object]":t.indexOf(i)>=0?"[Circular]":(t.push(i),i)}}function Ok(e,t){return JSON.stringify(e,_ce(t))}var Ace=`#vg-tooltip-element {
|
16
|
+
visibility: hidden;
|
17
|
+
padding: 8px;
|
18
|
+
position: fixed;
|
19
|
+
z-index: 1000;
|
20
|
+
font-family: sans-serif;
|
21
|
+
font-size: 11px;
|
22
|
+
border-radius: 3px;
|
23
|
+
box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
|
24
|
+
/* The default theme is the light theme. */
|
25
|
+
background-color: rgba(255, 255, 255, 0.95);
|
26
|
+
border: 1px solid #d9d9d9;
|
27
|
+
color: black;
|
28
|
+
}
|
29
|
+
#vg-tooltip-element.visible {
|
30
|
+
visibility: visible;
|
31
|
+
}
|
32
|
+
#vg-tooltip-element h2 {
|
33
|
+
margin-top: 0;
|
34
|
+
margin-bottom: 10px;
|
35
|
+
font-size: 13px;
|
36
|
+
}
|
37
|
+
#vg-tooltip-element table {
|
38
|
+
border-spacing: 0;
|
39
|
+
}
|
40
|
+
#vg-tooltip-element table tr {
|
41
|
+
border: none;
|
42
|
+
}
|
43
|
+
#vg-tooltip-element table tr td {
|
44
|
+
overflow: hidden;
|
45
|
+
text-overflow: ellipsis;
|
46
|
+
padding-top: 2px;
|
47
|
+
padding-bottom: 2px;
|
48
|
+
}
|
49
|
+
#vg-tooltip-element table tr td.key {
|
50
|
+
color: #808080;
|
51
|
+
max-width: 150px;
|
52
|
+
text-align: right;
|
53
|
+
padding-right: 4px;
|
54
|
+
}
|
55
|
+
#vg-tooltip-element table tr td.value {
|
56
|
+
display: block;
|
57
|
+
max-width: 300px;
|
58
|
+
max-height: 7em;
|
59
|
+
text-align: left;
|
60
|
+
}
|
61
|
+
#vg-tooltip-element.dark-theme {
|
62
|
+
background-color: rgba(32, 32, 32, 0.9);
|
63
|
+
border: 1px solid #f5f5f5;
|
64
|
+
color: white;
|
65
|
+
}
|
66
|
+
#vg-tooltip-element.dark-theme td.key {
|
67
|
+
color: #bfbfbf;
|
68
|
+
}
|
69
|
+
`;const hP="vg-tooltip-element",$ce={offsetX:10,offsetY:10,id:hP,styleId:"vega-tooltip-style",theme:"light",disableDefaultStyle:!1,sanitize:kce,maxDepth:2,formatTooltip:Sce,baseURL:"",anchor:"cursor",position:["top","bottom","left","right","top-left","top-right","bottom-left","bottom-right"]};function kce(e){return String(e).replace(/&/g,"&").replace(/</g,"<")}function Cce(e){if(!/^[A-Za-z]+[-:.\w]*$/.test(e))throw new Error("Invalid HTML ID");return Ace.toString().replace(hP,e)}function gP(e,t,{offsetX:n,offsetY:i}){const r=pP({x1:e.clientX,x2:e.clientX,y1:e.clientY,y2:e.clientY},t,n,i),o=["bottom-right","bottom-left","top-right","top-left"];for(const s of o)if(mP(r[s],t))return r[s];return r["top-left"]}function Fce(e,t,n,i,r){const{position:o,offsetX:s,offsetY:a}=r,u=e._el.getBoundingClientRect(),l=e._origin,c=Tce(u,l,n),f=pP(c,i,s,a),d=Array.isArray(o)?o:[o];for(const h of d)if(mP(f[h],i)&&!Mce(t,f[h],i))return f[h];return gP(t,i,r)}function Tce(e,t,n){const i=n.isVoronoi?n.datum.bounds:n.bounds;let r=e.left+t[0]+i.x1,o=e.top+t[1]+i.y1,s=n;for(;s.mark.group;)s=s.mark.group,r+=s.x??0,o+=s.y??0;const a=i.x2-i.x1,u=i.y2-i.y1;return{x1:r,x2:r+a,y1:o,y2:o+u}}function pP(e,t,n,i){const r=(e.x1+e.x2)/2,o=(e.y1+e.y2)/2,s=e.x1-t.width-n,a=r-t.width/2,u=e.x2+n,l=e.y1-t.height-i,c=o-t.height/2,f=e.y2+i;return{top:{x:a,y:l},bottom:{x:a,y:f},left:{x:s,y:c},right:{x:u,y:c},"top-left":{x:s,y:l},"top-right":{x:u,y:l},"bottom-left":{x:s,y:f},"bottom-right":{x:u,y:f}}}function mP(e,t){return e.x>=0&&e.y>=0&&e.x+t.width<=window.innerWidth&&e.y+t.height<=window.innerHeight}function Mce(e,t,n){return e.clientX>=t.x&&e.clientX<=t.x+n.width&&e.clientY>=t.y&&e.clientY<=t.y+n.height}class Dce{constructor(t){this.options={...$ce,...t};const n=this.options.id;if(this.el=null,this.call=this.tooltipHandler.bind(this),!this.options.disableDefaultStyle&&!document.getElementById(this.options.styleId)){const i=document.createElement("style");i.setAttribute("id",this.options.styleId),i.innerHTML=Cce(n);const r=document.head;r.childNodes.length>0?r.insertBefore(i,r.childNodes[0]):r.appendChild(i)}}tooltipHandler(t,n,i,r){if(this.el=document.getElementById(this.options.id),this.el||(this.el=document.createElement("div"),this.el.setAttribute("id",this.options.id),this.el.classList.add("vg-tooltip"),(document.fullscreenElement??document.body).appendChild(this.el)),r==null||r===""){this.el.classList.remove("visible",`${this.options.theme}-theme`);return}this.el.innerHTML=this.options.formatTooltip(r,this.options.sanitize,this.options.maxDepth,this.options.baseURL),this.el.classList.add("visible",`${this.options.theme}-theme`);const{x:o,y:s}=this.options.anchor==="mark"?Fce(t,n,i,this.el.getBoundingClientRect(),this.options):gP(n,this.el.getBoundingClientRect(),this.options);this.el.style.top=`${s}px`,this.el.style.left=`${o}px`}}var R0={};/*!
|
70
|
+
* https://github.com/Starcounter-Jack/JSON-Patch
|
71
|
+
* (c) 2017-2022 Joachim Wester
|
72
|
+
* MIT licensed
|
73
|
+
*/var Oce=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var o in r)r.hasOwnProperty(o)&&(i[o]=r[o])},e(t,n)};return function(t,n){e(t,n);function i(){this.constructor=t}t.prototype=n===null?Object.create(n):(i.prototype=n.prototype,new i)}}(),Rce=Object.prototype.hasOwnProperty;function eb(e,t){return Rce.call(e,t)}function tb(e){if(Array.isArray(e)){for(var t=new Array(e.length),n=0;n<t.length;n++)t[n]=""+n;return t}if(Object.keys)return Object.keys(e);var i=[];for(var r in e)eb(e,r)&&i.push(r);return i}function On(e){switch(typeof e){case"object":return JSON.parse(JSON.stringify(e));case"undefined":return null;default:return e}}function nb(e){for(var t=0,n=e.length,i;t<n;){if(i=e.charCodeAt(t),i>=48&&i<=57){t++;continue}return!1}return!0}function ps(e){return e.indexOf("/")===-1&&e.indexOf("~")===-1?e:e.replace(/~/g,"~0").replace(/\//g,"~1")}function yP(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function ib(e){if(e===void 0)return!0;if(e){if(Array.isArray(e)){for(var t=0,n=e.length;t<n;t++)if(ib(e[t]))return!0}else if(typeof e=="object"){for(var i=tb(e),r=i.length,o=0;o<r;o++)if(ib(e[i[o]]))return!0}}return!1}function Rk(e,t){var n=[e];for(var i in t){var r=typeof t[i]=="object"?JSON.stringify(t[i],null,2):t[i];typeof r<"u"&&n.push(i+": "+r)}return n.join(`
|
74
|
+
`)}var bP=function(e){Oce(t,e);function t(n,i,r,o,s){var a=this.constructor,u=e.call(this,Rk(n,{name:i,index:r,operation:o,tree:s}))||this;return u.name=i,u.index=r,u.operation=o,u.tree=s,Object.setPrototypeOf(u,a.prototype),u.message=Rk(n,{name:i,index:r,operation:o,tree:s}),u}return t}(Error),Ye=bP,Nce=On,La={add:function(e,t,n){return e[t]=this.value,{newDocument:n}},remove:function(e,t,n){var i=e[t];return delete e[t],{newDocument:n,removed:i}},replace:function(e,t,n){var i=e[t];return e[t]=this.value,{newDocument:n,removed:i}},move:function(e,t,n){var i=ig(n,this.path);i&&(i=On(i));var r=Ds(n,{op:"remove",path:this.from}).removed;return Ds(n,{op:"add",path:this.path,value:r}),{newDocument:n,removed:i}},copy:function(e,t,n){var i=ig(n,this.from);return Ds(n,{op:"add",path:this.path,value:On(i)}),{newDocument:n}},test:function(e,t,n){return{newDocument:n,test:Mc(e[t],this.value)}},_get:function(e,t,n){return this.value=e[t],{newDocument:n}}},Lce={add:function(e,t,n){return nb(t)?e.splice(t,0,this.value):e[t]=this.value,{newDocument:n,index:t}},remove:function(e,t,n){var i=e.splice(t,1);return{newDocument:n,removed:i[0]}},replace:function(e,t,n){var i=e[t];return e[t]=this.value,{newDocument:n,removed:i}},move:La.move,copy:La.copy,test:La.test,_get:La._get};function ig(e,t){if(t=="")return e;var n={op:"_get",path:t};return Ds(e,n),n.value}function Ds(e,t,n,i,r,o){if(n===void 0&&(n=!1),i===void 0&&(i=!0),r===void 0&&(r=!0),o===void 0&&(o=0),n&&(typeof n=="function"?n(t,0,e,t.path):rg(t,0)),t.path===""){var s={newDocument:e};if(t.op==="add")return s.newDocument=t.value,s;if(t.op==="replace")return s.newDocument=t.value,s.removed=e,s;if(t.op==="move"||t.op==="copy")return s.newDocument=ig(e,t.from),t.op==="move"&&(s.removed=e),s;if(t.op==="test"){if(s.test=Mc(e,t.value),s.test===!1)throw new Ye("Test operation failed","TEST_OPERATION_FAILED",o,t,e);return s.newDocument=e,s}else{if(t.op==="remove")return s.removed=e,s.newDocument=null,s;if(t.op==="_get")return t.value=e,s;if(n)throw new Ye("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",o,t,e);return s}}else{i||(e=On(e));var a=t.path||"",u=a.split("/"),l=e,c=1,f=u.length,d=void 0,h=void 0,g=void 0;for(typeof n=="function"?g=n:g=rg;;){if(h=u[c],h&&h.indexOf("~")!=-1&&(h=yP(h)),r&&(h=="__proto__"||h=="prototype"&&c>0&&u[c-1]=="constructor"))throw new TypeError("JSON-Patch: modifying `__proto__` or `constructor/prototype` prop is banned for security reasons, if this was on purpose, please set `banPrototypeModifications` flag false and pass it to this function. More info in fast-json-patch README");if(n&&d===void 0&&(l[h]===void 0?d=u.slice(0,c).join("/"):c==f-1&&(d=t.path),d!==void 0&&g(t,0,e,d)),c++,Array.isArray(l)){if(h==="-")h=l.length;else{if(n&&!nb(h))throw new Ye("Expected an unsigned base-10 integer value, making the new referenced value the array element with the zero-based index","OPERATION_PATH_ILLEGAL_ARRAY_INDEX",o,t,e);nb(h)&&(h=~~h)}if(c>=f){if(n&&t.op==="add"&&h>l.length)throw new Ye("The specified index MUST NOT be greater than the number of elements in the array","OPERATION_VALUE_OUT_OF_BOUNDS",o,t,e);var s=Lce[t.op].call(t,l,h,e);if(s.test===!1)throw new Ye("Test operation failed","TEST_OPERATION_FAILED",o,t,e);return s}}else if(c>=f){var s=La[t.op].call(t,l,h,e);if(s.test===!1)throw new Ye("Test operation failed","TEST_OPERATION_FAILED",o,t,e);return s}if(l=l[h],n&&c<f&&(!l||typeof l!="object"))throw new Ye("Cannot perform operation at the desired path","OPERATION_PATH_UNRESOLVABLE",o,t,e)}}}function cm(e,t,n,i,r){if(i===void 0&&(i=!0),r===void 0&&(r=!0),n&&!Array.isArray(t))throw new Ye("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");i||(e=On(e));for(var o=new Array(t.length),s=0,a=t.length;s<a;s++)o[s]=Ds(e,t[s],n,!0,r,s),e=o[s].newDocument;return o.newDocument=e,o}function Pce(e,t,n){var i=Ds(e,t);if(i.test===!1)throw new Ye("Test operation failed","TEST_OPERATION_FAILED",n,t,e);return i.newDocument}function rg(e,t,n,i){if(typeof e!="object"||e===null||Array.isArray(e))throw new Ye("Operation is not an object","OPERATION_NOT_AN_OBJECT",t,e,n);if(La[e.op]){if(typeof e.path!="string")throw new Ye("Operation `path` property is not a string","OPERATION_PATH_INVALID",t,e,n);if(e.path.indexOf("/")!==0&&e.path.length>0)throw new Ye('Operation `path` property must start with "/"',"OPERATION_PATH_INVALID",t,e,n);if((e.op==="move"||e.op==="copy")&&typeof e.from!="string")throw new Ye("Operation `from` property is not present (applicable in `move` and `copy` operations)","OPERATION_FROM_REQUIRED",t,e,n);if((e.op==="add"||e.op==="replace"||e.op==="test")&&e.value===void 0)throw new Ye("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_REQUIRED",t,e,n);if((e.op==="add"||e.op==="replace"||e.op==="test")&&ib(e.value))throw new Ye("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_CANNOT_CONTAIN_UNDEFINED",t,e,n);if(n){if(e.op=="add"){var r=e.path.split("/").length,o=i.split("/").length;if(r!==o+1&&r!==o)throw new Ye("Cannot perform an `add` operation at the desired path","OPERATION_PATH_CANNOT_ADD",t,e,n)}else if(e.op==="replace"||e.op==="remove"||e.op==="_get"){if(e.path!==i)throw new Ye("Cannot perform the operation at a path that does not exist","OPERATION_PATH_UNRESOLVABLE",t,e,n)}else if(e.op==="move"||e.op==="copy"){var s={op:"_get",path:e.from,value:void 0},a=vP([s],n);if(a&&a.name==="OPERATION_PATH_UNRESOLVABLE")throw new Ye("Cannot perform the operation from a path that does not exist","OPERATION_FROM_UNRESOLVABLE",t,e,n)}}}else throw new Ye("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",t,e,n)}function vP(e,t,n){try{if(!Array.isArray(e))throw new Ye("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");if(t)cm(On(t),On(e),n||!0);else{n=n||rg;for(var i=0;i<e.length;i++)n(e[i],i,t,void 0)}}catch(r){if(r instanceof Ye)return r;throw r}}function Mc(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){var n=Array.isArray(e),i=Array.isArray(t),r,o,s;if(n&&i){if(o=e.length,o!=t.length)return!1;for(r=o;r--!==0;)if(!Mc(e[r],t[r]))return!1;return!0}if(n!=i)return!1;var a=Object.keys(e);if(o=a.length,o!==Object.keys(t).length)return!1;for(r=o;r--!==0;)if(!t.hasOwnProperty(a[r]))return!1;for(r=o;r--!==0;)if(s=a[r],!Mc(e[s],t[s]))return!1;return!0}return e!==e&&t!==t}var Ice=Object.freeze({__proto__:null,JsonPatchError:Ye,_areEquals:Mc,applyOperation:Ds,applyPatch:cm,applyReducer:Pce,deepClone:Nce,getValueByPointer:ig,validate:vP,validator:rg});/*!
|
75
|
+
* https://github.com/Starcounter-Jack/JSON-Patch
|
76
|
+
* (c) 2017-2021 Joachim Wester
|
77
|
+
* MIT license
|
78
|
+
*/var EE=new WeakMap,zce=function(){function e(t){this.observers=new Map,this.obj=t}return e}(),Bce=function(){function e(t,n){this.callback=t,this.observer=n}return e}();function Uce(e){return EE.get(e)}function jce(e,t){return e.observers.get(t)}function qce(e,t){e.observers.delete(t.callback)}function Wce(e,t){t.unobserve()}function Hce(e,t){var n=[],i,r=Uce(e);if(!r)r=new zce(e),EE.set(e,r);else{var o=jce(r,t);i=o&&o.observer}if(i)return i;if(i={},r.value=On(e),t){i.callback=t,i.next=null;var s=function(){rb(i)},a=function(){clearTimeout(i.next),i.next=setTimeout(s)};typeof window<"u"&&(window.addEventListener("mouseup",a),window.addEventListener("keyup",a),window.addEventListener("mousedown",a),window.addEventListener("keydown",a),window.addEventListener("change",a))}return i.patches=n,i.object=e,i.unobserve=function(){rb(i),clearTimeout(i.next),qce(r,i),typeof window<"u"&&(window.removeEventListener("mouseup",a),window.removeEventListener("keyup",a),window.removeEventListener("mousedown",a),window.removeEventListener("keydown",a),window.removeEventListener("change",a))},r.observers.set(t,new Bce(t,i)),i}function rb(e,t){t===void 0&&(t=!1);var n=EE.get(e.object);SE(n.value,e.object,e.patches,"",t),e.patches.length&&cm(n.value,e.patches);var i=e.patches;return i.length>0&&(e.patches=[],e.callback&&e.callback(i)),i}function SE(e,t,n,i,r){if(t!==e){typeof t.toJSON=="function"&&(t=t.toJSON());for(var o=tb(t),s=tb(e),a=!1,u=s.length-1;u>=0;u--){var l=s[u],c=e[l];if(eb(t,l)&&!(t[l]===void 0&&c!==void 0&&Array.isArray(t)===!1)){var f=t[l];typeof c=="object"&&c!=null&&typeof f=="object"&&f!=null&&Array.isArray(c)===Array.isArray(f)?SE(c,f,n,i+"/"+ps(l),r):c!==f&&(r&&n.push({op:"test",path:i+"/"+ps(l),value:On(c)}),n.push({op:"replace",path:i+"/"+ps(l),value:On(f)}))}else Array.isArray(e)===Array.isArray(t)?(r&&n.push({op:"test",path:i+"/"+ps(l),value:On(c)}),n.push({op:"remove",path:i+"/"+ps(l)}),a=!0):(r&&n.push({op:"test",path:i,value:e}),n.push({op:"replace",path:i,value:t}))}if(!(!a&&o.length==s.length))for(var u=0;u<o.length;u++){var l=o[u];!eb(e,l)&&t[l]!==void 0&&n.push({op:"add",path:i+"/"+ps(l),value:On(t[l])})}}}function Gce(e,t,n){n===void 0&&(n=!1);var i=[];return SE(e,t,i,"",n),i}var Vce=Object.freeze({__proto__:null,compare:Gce,generate:rb,observe:Hce,unobserve:Wce});Object.assign({},Ice,Vce,{JsonPatchError:bP,deepClone:On,escapePathComponent:ps,unescapePathComponent:yP});function Yce(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var N0,Nk;function Xce(){if(Nk)return N0;Nk=1;class e{constructor(){this.max=1e3,this.map=new Map}get(n){const i=this.map.get(n);if(i!==void 0)return this.map.delete(n),this.map.set(n,i),i}delete(n){return this.map.delete(n)}set(n,i){if(!this.delete(n)&&i!==void 0){if(this.map.size>=this.max){const o=this.map.keys().next().value;this.delete(o)}this.map.set(n,i)}return this}}return N0=e,N0}var L0,Lk;function _E(){if(Lk)return L0;Lk=1;const e=Object.freeze({loose:!0}),t=Object.freeze({});return L0=i=>i?typeof i!="object"?e:i:t,L0}var ad={exports:{}},P0,Pk;function AE(){if(Pk)return P0;Pk=1;const e="2.0.0",t=256,n=Number.MAX_SAFE_INTEGER||9007199254740991,i=16,r=t-6;return P0={MAX_LENGTH:t,MAX_SAFE_COMPONENT_LENGTH:i,MAX_SAFE_BUILD_LENGTH:r,MAX_SAFE_INTEGER:n,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:e,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2},P0}var I0,Ik;function fm(){return Ik||(Ik=1,I0=typeof process=="object"&&R0&&R0.NODE_DEBUG&&/\bsemver\b/i.test(R0.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{}),I0}var zk;function $E(){return zk||(zk=1,function(e,t){const{MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:i,MAX_LENGTH:r}=AE(),o=fm();t=e.exports={};const s=t.re=[],a=t.safeRe=[],u=t.src=[],l=t.t={};let c=0;const f="[a-zA-Z0-9-]",d=[["\\s",1],["\\d",r],[f,i]],h=p=>{for(const[m,y]of d)p=p.split(`${m}*`).join(`${m}{0,${y}}`).split(`${m}+`).join(`${m}{1,${y}}`);return p},g=(p,m,y)=>{const b=h(m),v=c++;o(p,v,m),l[p]=v,u[v]=m,s[v]=new RegExp(m,y?"g":void 0),a[v]=new RegExp(b,y?"g":void 0)};g("NUMERICIDENTIFIER","0|[1-9]\\d*"),g("NUMERICIDENTIFIERLOOSE","\\d+"),g("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${f}*`),g("MAINVERSION",`(${u[l.NUMERICIDENTIFIER]})\\.(${u[l.NUMERICIDENTIFIER]})\\.(${u[l.NUMERICIDENTIFIER]})`),g("MAINVERSIONLOOSE",`(${u[l.NUMERICIDENTIFIERLOOSE]})\\.(${u[l.NUMERICIDENTIFIERLOOSE]})\\.(${u[l.NUMERICIDENTIFIERLOOSE]})`),g("PRERELEASEIDENTIFIER",`(?:${u[l.NUMERICIDENTIFIER]}|${u[l.NONNUMERICIDENTIFIER]})`),g("PRERELEASEIDENTIFIERLOOSE",`(?:${u[l.NUMERICIDENTIFIERLOOSE]}|${u[l.NONNUMERICIDENTIFIER]})`),g("PRERELEASE",`(?:-(${u[l.PRERELEASEIDENTIFIER]}(?:\\.${u[l.PRERELEASEIDENTIFIER]})*))`),g("PRERELEASELOOSE",`(?:-?(${u[l.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${u[l.PRERELEASEIDENTIFIERLOOSE]})*))`),g("BUILDIDENTIFIER",`${f}+`),g("BUILD",`(?:\\+(${u[l.BUILDIDENTIFIER]}(?:\\.${u[l.BUILDIDENTIFIER]})*))`),g("FULLPLAIN",`v?${u[l.MAINVERSION]}${u[l.PRERELEASE]}?${u[l.BUILD]}?`),g("FULL",`^${u[l.FULLPLAIN]}$`),g("LOOSEPLAIN",`[v=\\s]*${u[l.MAINVERSIONLOOSE]}${u[l.PRERELEASELOOSE]}?${u[l.BUILD]}?`),g("LOOSE",`^${u[l.LOOSEPLAIN]}$`),g("GTLT","((?:<|>)?=?)"),g("XRANGEIDENTIFIERLOOSE",`${u[l.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),g("XRANGEIDENTIFIER",`${u[l.NUMERICIDENTIFIER]}|x|X|\\*`),g("XRANGEPLAIN",`[v=\\s]*(${u[l.XRANGEIDENTIFIER]})(?:\\.(${u[l.XRANGEIDENTIFIER]})(?:\\.(${u[l.XRANGEIDENTIFIER]})(?:${u[l.PRERELEASE]})?${u[l.BUILD]}?)?)?`),g("XRANGEPLAINLOOSE",`[v=\\s]*(${u[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[l.XRANGEIDENTIFIERLOOSE]})(?:${u[l.PRERELEASELOOSE]})?${u[l.BUILD]}?)?)?`),g("XRANGE",`^${u[l.GTLT]}\\s*${u[l.XRANGEPLAIN]}$`),g("XRANGELOOSE",`^${u[l.GTLT]}\\s*${u[l.XRANGEPLAINLOOSE]}$`),g("COERCEPLAIN",`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?`),g("COERCE",`${u[l.COERCEPLAIN]}(?:$|[^\\d])`),g("COERCEFULL",u[l.COERCEPLAIN]+`(?:${u[l.PRERELEASE]})?(?:${u[l.BUILD]})?(?:$|[^\\d])`),g("COERCERTL",u[l.COERCE],!0),g("COERCERTLFULL",u[l.COERCEFULL],!0),g("LONETILDE","(?:~>?)"),g("TILDETRIM",`(\\s*)${u[l.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",g("TILDE",`^${u[l.LONETILDE]}${u[l.XRANGEPLAIN]}$`),g("TILDELOOSE",`^${u[l.LONETILDE]}${u[l.XRANGEPLAINLOOSE]}$`),g("LONECARET","(?:\\^)"),g("CARETTRIM",`(\\s*)${u[l.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",g("CARET",`^${u[l.LONECARET]}${u[l.XRANGEPLAIN]}$`),g("CARETLOOSE",`^${u[l.LONECARET]}${u[l.XRANGEPLAINLOOSE]}$`),g("COMPARATORLOOSE",`^${u[l.GTLT]}\\s*(${u[l.LOOSEPLAIN]})$|^$`),g("COMPARATOR",`^${u[l.GTLT]}\\s*(${u[l.FULLPLAIN]})$|^$`),g("COMPARATORTRIM",`(\\s*)${u[l.GTLT]}\\s*(${u[l.LOOSEPLAIN]}|${u[l.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",g("HYPHENRANGE",`^\\s*(${u[l.XRANGEPLAIN]})\\s+-\\s+(${u[l.XRANGEPLAIN]})\\s*$`),g("HYPHENRANGELOOSE",`^\\s*(${u[l.XRANGEPLAINLOOSE]})\\s+-\\s+(${u[l.XRANGEPLAINLOOSE]})\\s*$`),g("STAR","(<|>)?=?\\s*\\*"),g("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),g("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")}(ad,ad.exports)),ad.exports}var z0,Bk;function Kce(){if(Bk)return z0;Bk=1;const e=/^[0-9]+$/,t=(i,r)=>{const o=e.test(i),s=e.test(r);return o&&s&&(i=+i,r=+r),i===r?0:o&&!s?-1:s&&!o?1:i<r?-1:1};return z0={compareIdentifiers:t,rcompareIdentifiers:(i,r)=>t(r,i)},z0}var B0,Uk;function kE(){if(Uk)return B0;Uk=1;const e=fm(),{MAX_LENGTH:t,MAX_SAFE_INTEGER:n}=AE(),{safeRe:i,t:r}=$E(),o=_E(),{compareIdentifiers:s}=Kce();class a{constructor(l,c){if(c=o(c),l instanceof a){if(l.loose===!!c.loose&&l.includePrerelease===!!c.includePrerelease)return l;l=l.version}else if(typeof l!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof l}".`);if(l.length>t)throw new TypeError(`version is longer than ${t} characters`);e("SemVer",l,c),this.options=c,this.loose=!!c.loose,this.includePrerelease=!!c.includePrerelease;const f=l.trim().match(c.loose?i[r.LOOSE]:i[r.FULL]);if(!f)throw new TypeError(`Invalid Version: ${l}`);if(this.raw=l,this.major=+f[1],this.minor=+f[2],this.patch=+f[3],this.major>n||this.major<0)throw new TypeError("Invalid major version");if(this.minor>n||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>n||this.patch<0)throw new TypeError("Invalid patch version");f[4]?this.prerelease=f[4].split(".").map(d=>{if(/^[0-9]+$/.test(d)){const h=+d;if(h>=0&&h<n)return h}return d}):this.prerelease=[],this.build=f[5]?f[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(l){if(e("SemVer.compare",this.version,this.options,l),!(l instanceof a)){if(typeof l=="string"&&l===this.version)return 0;l=new a(l,this.options)}return l.version===this.version?0:this.compareMain(l)||this.comparePre(l)}compareMain(l){return l instanceof a||(l=new a(l,this.options)),s(this.major,l.major)||s(this.minor,l.minor)||s(this.patch,l.patch)}comparePre(l){if(l instanceof a||(l=new a(l,this.options)),this.prerelease.length&&!l.prerelease.length)return-1;if(!this.prerelease.length&&l.prerelease.length)return 1;if(!this.prerelease.length&&!l.prerelease.length)return 0;let c=0;do{const f=this.prerelease[c],d=l.prerelease[c];if(e("prerelease compare",c,f,d),f===void 0&&d===void 0)return 0;if(d===void 0)return 1;if(f===void 0)return-1;if(f===d)continue;return s(f,d)}while(++c)}compareBuild(l){l instanceof a||(l=new a(l,this.options));let c=0;do{const f=this.build[c],d=l.build[c];if(e("build compare",c,f,d),f===void 0&&d===void 0)return 0;if(d===void 0)return 1;if(f===void 0)return-1;if(f===d)continue;return s(f,d)}while(++c)}inc(l,c,f){switch(l){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",c,f);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",c,f);break;case"prepatch":this.prerelease.length=0,this.inc("patch",c,f),this.inc("pre",c,f);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",c,f),this.inc("pre",c,f);break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{const d=Number(f)?1:0;if(!c&&f===!1)throw new Error("invalid increment argument: identifier is empty");if(this.prerelease.length===0)this.prerelease=[d];else{let h=this.prerelease.length;for(;--h>=0;)typeof this.prerelease[h]=="number"&&(this.prerelease[h]++,h=-2);if(h===-1){if(c===this.prerelease.join(".")&&f===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(d)}}if(c){let h=[c,d];f===!1&&(h=[c]),s(this.prerelease[0],c)===0?isNaN(this.prerelease[1])&&(this.prerelease=h):this.prerelease=h}break}default:throw new Error(`invalid increment argument: ${l}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}return B0=a,B0}var U0,jk;function Ku(){if(jk)return U0;jk=1;const e=kE();return U0=(n,i,r)=>new e(n,r).compare(new e(i,r)),U0}var j0,qk;function Jce(){if(qk)return j0;qk=1;const e=Ku();return j0=(n,i,r)=>e(n,i,r)===0,j0}var q0,Wk;function Qce(){if(Wk)return q0;Wk=1;const e=Ku();return q0=(n,i,r)=>e(n,i,r)!==0,q0}var W0,Hk;function Zce(){if(Hk)return W0;Hk=1;const e=Ku();return W0=(n,i,r)=>e(n,i,r)>0,W0}var H0,Gk;function efe(){if(Gk)return H0;Gk=1;const e=Ku();return H0=(n,i,r)=>e(n,i,r)>=0,H0}var G0,Vk;function tfe(){if(Vk)return G0;Vk=1;const e=Ku();return G0=(n,i,r)=>e(n,i,r)<0,G0}var V0,Yk;function nfe(){if(Yk)return V0;Yk=1;const e=Ku();return V0=(n,i,r)=>e(n,i,r)<=0,V0}var Y0,Xk;function ife(){if(Xk)return Y0;Xk=1;const e=Jce(),t=Qce(),n=Zce(),i=efe(),r=tfe(),o=nfe();return Y0=(a,u,l,c)=>{switch(u){case"===":return typeof a=="object"&&(a=a.version),typeof l=="object"&&(l=l.version),a===l;case"!==":return typeof a=="object"&&(a=a.version),typeof l=="object"&&(l=l.version),a!==l;case"":case"=":case"==":return e(a,l,c);case"!=":return t(a,l,c);case">":return n(a,l,c);case">=":return i(a,l,c);case"<":return r(a,l,c);case"<=":return o(a,l,c);default:throw new TypeError(`Invalid operator: ${u}`)}},Y0}var X0,Kk;function rfe(){if(Kk)return X0;Kk=1;const e=Symbol("SemVer ANY");class t{static get ANY(){return e}constructor(c,f){if(f=n(f),c instanceof t){if(c.loose===!!f.loose)return c;c=c.value}c=c.trim().split(/\s+/).join(" "),s("comparator",c,f),this.options=f,this.loose=!!f.loose,this.parse(c),this.semver===e?this.value="":this.value=this.operator+this.semver.version,s("comp",this)}parse(c){const f=this.options.loose?i[r.COMPARATORLOOSE]:i[r.COMPARATOR],d=c.match(f);if(!d)throw new TypeError(`Invalid comparator: ${c}`);this.operator=d[1]!==void 0?d[1]:"",this.operator==="="&&(this.operator=""),d[2]?this.semver=new a(d[2],this.options.loose):this.semver=e}toString(){return this.value}test(c){if(s("Comparator.test",c,this.options.loose),this.semver===e||c===e)return!0;if(typeof c=="string")try{c=new a(c,this.options)}catch{return!1}return o(c,this.operator,this.semver,this.options)}intersects(c,f){if(!(c instanceof t))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new u(c.value,f).test(this.value):c.operator===""?c.value===""?!0:new u(this.value,f).test(c.semver):(f=n(f),f.includePrerelease&&(this.value==="<0.0.0-0"||c.value==="<0.0.0-0")||!f.includePrerelease&&(this.value.startsWith("<0.0.0")||c.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&c.operator.startsWith(">")||this.operator.startsWith("<")&&c.operator.startsWith("<")||this.semver.version===c.semver.version&&this.operator.includes("=")&&c.operator.includes("=")||o(this.semver,"<",c.semver,f)&&this.operator.startsWith(">")&&c.operator.startsWith("<")||o(this.semver,">",c.semver,f)&&this.operator.startsWith("<")&&c.operator.startsWith(">")))}}X0=t;const n=_E(),{safeRe:i,t:r}=$E(),o=ife(),s=fm(),a=kE(),u=xP();return X0}var K0,Jk;function xP(){if(Jk)return K0;Jk=1;const e=/\s+/g;class t{constructor($,T){if(T=r(T),$ instanceof t)return $.loose===!!T.loose&&$.includePrerelease===!!T.includePrerelease?$:new t($.raw,T);if($ instanceof o)return this.raw=$.value,this.set=[[$]],this.formatted=void 0,this;if(this.options=T,this.loose=!!T.loose,this.includePrerelease=!!T.includePrerelease,this.raw=$.trim().replace(e," "),this.set=this.raw.split("||").map(L=>this.parseRange(L.trim())).filter(L=>L.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const L=this.set[0];if(this.set=this.set.filter(z=>!p(z[0])),this.set.length===0)this.set=[L];else if(this.set.length>1){for(const z of this.set)if(z.length===1&&m(z[0])){this.set=[z];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let $=0;$<this.set.length;$++){$>0&&(this.formatted+="||");const T=this.set[$];for(let L=0;L<T.length;L++)L>0&&(this.formatted+=" "),this.formatted+=T[L].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange($){const L=((this.options.includePrerelease&&h)|(this.options.loose&&g))+":"+$,z=i.get(L);if(z)return z;const I=this.options.loose,Q=I?u[l.HYPHENRANGELOOSE]:u[l.HYPHENRANGE];$=$.replace(Q,O(this.options.includePrerelease)),s("hyphen replace",$),$=$.replace(u[l.COMPARATORTRIM],c),s("comparator trim",$),$=$.replace(u[l.TILDETRIM],f),s("tilde trim",$),$=$.replace(u[l.CARETTRIM],d),s("caret trim",$);let ue=$.split(" ").map(de=>b(de,this.options)).join(" ").split(/\s+/).map(de=>C(de,this.options));I&&(ue=ue.filter(de=>(s("loose invalid filter",de,this.options),!!de.match(u[l.COMPARATORLOOSE])))),s("range list",ue);const oe=new Map,fe=ue.map(de=>new o(de,this.options));for(const de of fe){if(p(de))return[de];oe.set(de.value,de)}oe.size>1&&oe.has("")&&oe.delete("");const Pe=[...oe.values()];return i.set(L,Pe),Pe}intersects($,T){if(!($ instanceof t))throw new TypeError("a Range is required");return this.set.some(L=>y(L,T)&&$.set.some(z=>y(z,T)&&L.every(I=>z.every(Q=>I.intersects(Q,T)))))}test($){if(!$)return!1;if(typeof $=="string")try{$=new a($,this.options)}catch{return!1}for(let T=0;T<this.set.length;T++)if(M(this.set[T],$,this.options))return!0;return!1}}K0=t;const n=Xce(),i=new n,r=_E(),o=rfe(),s=fm(),a=kE(),{safeRe:u,t:l,comparatorTrimReplace:c,tildeTrimReplace:f,caretTrimReplace:d}=$E(),{FLAG_INCLUDE_PRERELEASE:h,FLAG_LOOSE:g}=AE(),p=F=>F.value==="<0.0.0-0",m=F=>F.value==="",y=(F,$)=>{let T=!0;const L=F.slice();let z=L.pop();for(;T&&L.length;)T=L.every(I=>z.intersects(I,$)),z=L.pop();return T},b=(F,$)=>(s("comp",F,$),F=S(F,$),s("caret",F),F=x(F,$),s("tildes",F),F=_(F,$),s("xrange",F),F=k(F,$),s("stars",F),F),v=F=>!F||F.toLowerCase()==="x"||F==="*",x=(F,$)=>F.trim().split(/\s+/).map(T=>E(T,$)).join(" "),E=(F,$)=>{const T=$.loose?u[l.TILDELOOSE]:u[l.TILDE];return F.replace(T,(L,z,I,Q,ue)=>{s("tilde",F,L,z,I,Q,ue);let oe;return v(z)?oe="":v(I)?oe=`>=${z}.0.0 <${+z+1}.0.0-0`:v(Q)?oe=`>=${z}.${I}.0 <${z}.${+I+1}.0-0`:ue?(s("replaceTilde pr",ue),oe=`>=${z}.${I}.${Q}-${ue} <${z}.${+I+1}.0-0`):oe=`>=${z}.${I}.${Q} <${z}.${+I+1}.0-0`,s("tilde return",oe),oe})},S=(F,$)=>F.trim().split(/\s+/).map(T=>w(T,$)).join(" "),w=(F,$)=>{s("caret",F,$);const T=$.loose?u[l.CARETLOOSE]:u[l.CARET],L=$.includePrerelease?"-0":"";return F.replace(T,(z,I,Q,ue,oe)=>{s("caret",F,z,I,Q,ue,oe);let fe;return v(I)?fe="":v(Q)?fe=`>=${I}.0.0${L} <${+I+1}.0.0-0`:v(ue)?I==="0"?fe=`>=${I}.${Q}.0${L} <${I}.${+Q+1}.0-0`:fe=`>=${I}.${Q}.0${L} <${+I+1}.0.0-0`:oe?(s("replaceCaret pr",oe),I==="0"?Q==="0"?fe=`>=${I}.${Q}.${ue}-${oe} <${I}.${Q}.${+ue+1}-0`:fe=`>=${I}.${Q}.${ue}-${oe} <${I}.${+Q+1}.0-0`:fe=`>=${I}.${Q}.${ue}-${oe} <${+I+1}.0.0-0`):(s("no pr"),I==="0"?Q==="0"?fe=`>=${I}.${Q}.${ue}${L} <${I}.${Q}.${+ue+1}-0`:fe=`>=${I}.${Q}.${ue}${L} <${I}.${+Q+1}.0-0`:fe=`>=${I}.${Q}.${ue} <${+I+1}.0.0-0`),s("caret return",fe),fe})},_=(F,$)=>(s("replaceXRanges",F,$),F.split(/\s+/).map(T=>A(T,$)).join(" ")),A=(F,$)=>{F=F.trim();const T=$.loose?u[l.XRANGELOOSE]:u[l.XRANGE];return F.replace(T,(L,z,I,Q,ue,oe)=>{s("xRange",F,L,z,I,Q,ue,oe);const fe=v(I),Pe=fe||v(Q),de=Pe||v(ue),Dt=de;return z==="="&&Dt&&(z=""),oe=$.includePrerelease?"-0":"",fe?z===">"||z==="<"?L="<0.0.0-0":L="*":z&&Dt?(Pe&&(Q=0),ue=0,z===">"?(z=">=",Pe?(I=+I+1,Q=0,ue=0):(Q=+Q+1,ue=0)):z==="<="&&(z="<",Pe?I=+I+1:Q=+Q+1),z==="<"&&(oe="-0"),L=`${z+I}.${Q}.${ue}${oe}`):Pe?L=`>=${I}.0.0${oe} <${+I+1}.0.0-0`:de&&(L=`>=${I}.${Q}.0${oe} <${I}.${+Q+1}.0-0`),s("xRange return",L),L})},k=(F,$)=>(s("replaceStars",F,$),F.trim().replace(u[l.STAR],"")),C=(F,$)=>(s("replaceGTE0",F,$),F.trim().replace(u[$.includePrerelease?l.GTE0PRE:l.GTE0],"")),O=F=>($,T,L,z,I,Q,ue,oe,fe,Pe,de,Dt)=>(v(L)?T="":v(z)?T=`>=${L}.0.0${F?"-0":""}`:v(I)?T=`>=${L}.${z}.0${F?"-0":""}`:Q?T=`>=${T}`:T=`>=${T}${F?"-0":""}`,v(fe)?oe="":v(Pe)?oe=`<${+fe+1}.0.0-0`:v(de)?oe=`<${fe}.${+Pe+1}.0-0`:Dt?oe=`<=${fe}.${Pe}.${de}-${Dt}`:F?oe=`<${fe}.${Pe}.${+de+1}-0`:oe=`<=${oe}`,`${T} ${oe}`.trim()),M=(F,$,T)=>{for(let L=0;L<F.length;L++)if(!F[L].test($))return!1;if($.prerelease.length&&!T.includePrerelease){for(let L=0;L<F.length;L++)if(s(F[L].semver),F[L].semver!==o.ANY&&F[L].semver.prerelease.length>0){const z=F[L].semver;if(z.major===$.major&&z.minor===$.minor&&z.patch===$.patch)return!0}return!1}return!0};return K0}var J0,Qk;function ofe(){if(Qk)return J0;Qk=1;const e=xP();return J0=(n,i,r)=>{try{i=new e(i,r)}catch{return!1}return i.test(n)},J0}var sfe=ofe(),wP=Yce(sfe);function afe(e,t,n){const i=e.open(t),r=250,{origin:o}=new URL(t);let s=40;function a(l){l.source===i&&(s=0,e.removeEventListener("message",a,!1))}e.addEventListener("message",a,!1);function u(){s<=0||(i.postMessage(n,o),setTimeout(u,r),s-=1)}setTimeout(u,r)}var ufe=`.vega-embed {
|
79
|
+
position: relative;
|
80
|
+
display: inline-block;
|
81
|
+
box-sizing: border-box;
|
82
|
+
}
|
83
|
+
.vega-embed.has-actions {
|
84
|
+
padding-right: 38px;
|
85
|
+
}
|
86
|
+
.vega-embed details:not([open]) > :not(summary) {
|
87
|
+
display: none !important;
|
88
|
+
}
|
89
|
+
.vega-embed summary {
|
90
|
+
list-style: none;
|
91
|
+
position: absolute;
|
92
|
+
top: 0;
|
93
|
+
right: 0;
|
94
|
+
padding: 6px;
|
95
|
+
z-index: 1000;
|
96
|
+
background: white;
|
97
|
+
box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.1);
|
98
|
+
color: #1b1e23;
|
99
|
+
border: 1px solid #aaa;
|
100
|
+
border-radius: 999px;
|
101
|
+
opacity: 0.2;
|
102
|
+
transition: opacity 0.4s ease-in;
|
103
|
+
cursor: pointer;
|
104
|
+
line-height: 0px;
|
105
|
+
}
|
106
|
+
.vega-embed summary::-webkit-details-marker {
|
107
|
+
display: none;
|
108
|
+
}
|
109
|
+
.vega-embed summary:active {
|
110
|
+
box-shadow: #aaa 0px 0px 0px 1px inset;
|
111
|
+
}
|
112
|
+
.vega-embed summary svg {
|
113
|
+
width: 14px;
|
114
|
+
height: 14px;
|
115
|
+
}
|
116
|
+
.vega-embed details[open] summary {
|
117
|
+
opacity: 0.7;
|
118
|
+
}
|
119
|
+
.vega-embed:hover summary, .vega-embed:focus-within summary {
|
120
|
+
opacity: 1 !important;
|
121
|
+
transition: opacity 0.2s ease;
|
122
|
+
}
|
123
|
+
.vega-embed .vega-actions {
|
124
|
+
position: absolute;
|
125
|
+
z-index: 1001;
|
126
|
+
top: 35px;
|
127
|
+
right: -9px;
|
128
|
+
display: flex;
|
129
|
+
flex-direction: column;
|
130
|
+
padding-bottom: 8px;
|
131
|
+
padding-top: 8px;
|
132
|
+
border-radius: 4px;
|
133
|
+
box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.2);
|
134
|
+
border: 1px solid #d9d9d9;
|
135
|
+
background: white;
|
136
|
+
animation-duration: 0.15s;
|
137
|
+
animation-name: scale-in;
|
138
|
+
animation-timing-function: cubic-bezier(0.2, 0, 0.13, 1.5);
|
139
|
+
text-align: left;
|
140
|
+
}
|
141
|
+
.vega-embed .vega-actions a {
|
142
|
+
padding: 8px 16px;
|
143
|
+
font-family: sans-serif;
|
144
|
+
font-size: 14px;
|
145
|
+
font-weight: 600;
|
146
|
+
white-space: nowrap;
|
147
|
+
color: #434a56;
|
148
|
+
text-decoration: none;
|
149
|
+
}
|
150
|
+
.vega-embed .vega-actions a:hover, .vega-embed .vega-actions a:focus {
|
151
|
+
background-color: #f7f7f9;
|
152
|
+
color: black;
|
153
|
+
}
|
154
|
+
.vega-embed .vega-actions::before, .vega-embed .vega-actions::after {
|
155
|
+
content: "";
|
156
|
+
display: inline-block;
|
157
|
+
position: absolute;
|
158
|
+
}
|
159
|
+
.vega-embed .vega-actions::before {
|
160
|
+
left: auto;
|
161
|
+
right: 14px;
|
162
|
+
top: -16px;
|
163
|
+
border: 8px solid rgba(0, 0, 0, 0);
|
164
|
+
border-bottom-color: #d9d9d9;
|
165
|
+
}
|
166
|
+
.vega-embed .vega-actions::after {
|
167
|
+
left: auto;
|
168
|
+
right: 15px;
|
169
|
+
top: -14px;
|
170
|
+
border: 7px solid rgba(0, 0, 0, 0);
|
171
|
+
border-bottom-color: #fff;
|
172
|
+
}
|
173
|
+
.vega-embed .chart-wrapper.fit-x {
|
174
|
+
width: 100%;
|
175
|
+
}
|
176
|
+
.vega-embed .chart-wrapper.fit-y {
|
177
|
+
height: 100%;
|
178
|
+
}
|
179
|
+
|
180
|
+
.vega-embed-wrapper {
|
181
|
+
max-width: 100%;
|
182
|
+
overflow: auto;
|
183
|
+
padding-right: 14px;
|
184
|
+
}
|
185
|
+
|
186
|
+
@keyframes scale-in {
|
187
|
+
from {
|
188
|
+
opacity: 0;
|
189
|
+
transform: scale(0.6);
|
190
|
+
}
|
191
|
+
to {
|
192
|
+
opacity: 1;
|
193
|
+
transform: scale(1);
|
194
|
+
}
|
195
|
+
}
|
196
|
+
`;function EP(e,...t){for(const n of t)lfe(e,n);return e}function lfe(e,t){for(const n of Object.keys(t))Fu(e,n,t[n],!0)}const zi=Qee;let Dc=Ple;const ud=typeof window<"u"?window:void 0;var iC;Dc===void 0&&((iC=ud==null?void 0:ud.vl)!=null&&iC.compile)&&(Dc=ud.vl);const cfe={export:{svg:!0,png:!0},source:!0,compiled:!0,editor:!0},ffe={CLICK_TO_VIEW_ACTIONS:"Click to view actions",COMPILED_ACTION:"View Compiled Vega",EDITOR_ACTION:"Open in Vega Editor",PNG_ACTION:"Save as PNG",SOURCE_ACTION:"View Source",SVG_ACTION:"Save as SVG"},ql={vega:"Vega","vega-lite":"Vega-Lite"},og={vega:zi.version,"vega-lite":Dc?Dc.version:"not available"},dfe={vega:e=>e,"vega-lite":(e,t)=>Dc.compile(e,{config:t}).spec},hfe=`
|
197
|
+
<svg viewBox="0 0 16 16" fill="currentColor" stroke="none" stroke-width="1" stroke-linecap="round" stroke-linejoin="round">
|
198
|
+
<circle r="2" cy="8" cx="2"></circle>
|
199
|
+
<circle r="2" cy="8" cx="8"></circle>
|
200
|
+
<circle r="2" cy="8" cx="14"></circle>
|
201
|
+
</svg>`,gfe="chart-wrapper";function pfe(e){return typeof e=="function"}function Zk(e,t,n,i){const r=`<html><head>${t}</head><body><pre><code class="json">`,o=`</code></pre>${n}</body></html>`,s=window.open("");s.document.write(r+e+o),s.document.title=`${ql[i]} JSON Source`}function mfe(e,t){if(e.$schema){const n=cP(e.$schema);t&&t!==n.library&&console.warn(`The given visualization spec is written in ${ql[n.library]}, but mode argument sets ${ql[t]??t}.`);const i=n.library;return wP(og[i],`^${n.version.slice(1)}`)||console.warn(`The input spec uses ${ql[i]} ${n.version}, but the current version of ${ql[i]} is v${og[i]}.`),i}return"mark"in e||"encoding"in e||"layer"in e||"hconcat"in e||"vconcat"in e||"facet"in e||"repeat"in e?"vega-lite":"marks"in e||"signals"in e||"scales"in e||"axes"in e?"vega":t??"vega"}function SP(e){return!!(e&&"load"in e)}function eC(e){return SP(e)?e:zi.loader(e)}function yfe(e){var n;const t=((n=e.usermeta)==null?void 0:n.embedOptions)??{};return K(t.defaultStyle)&&(t.defaultStyle=!1),t}async function bfe(e,t,n={}){let i,r;K(t)?(r=eC(n.loader),i=JSON.parse(await r.load(t))):i=t;const o=yfe(i),s=o.loader;(!r||s)&&(r=eC(n.loader??s));const a=await tC(o,r),u=await tC(n,r),l={...EP(u,a),config:Cu(u.config??{},a.config??{})};return await xfe(e,i,l,r)}async function tC(e,t){const n=K(e.config)?JSON.parse(await t.load(e.config)):e.config??{},i=K(e.patch)?JSON.parse(await t.load(e.patch)):e.patch;return{...e,...i?{patch:i}:{},...n?{config:n}:{}}}function vfe(e){const t=e.getRootNode?e.getRootNode():document;return t instanceof ShadowRoot?{root:t,rootContainer:t}:{root:document,rootContainer:document.head??document.body}}async function xfe(e,t,n={},i){const r=n.theme?Cu(Ece[n.theme],n.config??{}):n.config,o=Wo(n.actions)?n.actions:EP({},cfe,n.actions??{}),s={...ffe,...n.i18n},a=n.renderer??"canvas",u=n.logLevel??zi.Warn,l=n.downloadFileName??"visualization",c=typeof e=="string"?document.querySelector(e):e;if(!c)throw new Error(`${e} does not exist`);if(n.defaultStyle!==!1){const E="vega-embed-style",{root:S,rootContainer:w}=vfe(c);if(!S.getElementById(E)){const _=document.createElement("style");_.id=E,_.innerHTML=n.defaultStyle===void 0||n.defaultStyle===!0?ufe.toString():n.defaultStyle,w.appendChild(_)}}const f=mfe(t,n.mode);let d=dfe[f](t,r);if(f==="vega-lite"&&d.$schema){const E=cP(d.$schema);wP(og.vega,`^${E.version.slice(1)}`)||console.warn(`The compiled spec uses Vega ${E.version}, but current version is v${og.vega}.`)}c.classList.add("vega-embed"),o&&c.classList.add("has-actions"),c.innerHTML="";let h=c;if(o){const E=document.createElement("div");E.classList.add(gfe),c.appendChild(E),h=E}const g=n.patch;if(g&&(d=g instanceof Function?g(d):cm(d,g,!0,!1).newDocument),n.formatLocale&&zi.formatLocale(n.formatLocale),n.timeFormatLocale&&zi.timeFormatLocale(n.timeFormatLocale),n.expressionFunctions)for(const E in n.expressionFunctions){const S=n.expressionFunctions[E];"fn"in S?zi.expressionFunction(E,S.fn,S.visitor):S instanceof Function&&zi.expressionFunction(E,S)}const{ast:p}=n,m=zi.parse(d,f==="vega-lite"?{}:r,{ast:p}),y=new(n.viewClass||zi.View)(m,{loader:i,logLevel:u,renderer:a,...p?{expr:zi.expressionInterpreter??n.expr??lte}:{}});if(y.addSignalListener("autosize",(E,S)=>{const{type:w}=S;w=="fit-x"?(h.classList.add("fit-x"),h.classList.remove("fit-y")):w=="fit-y"?(h.classList.remove("fit-x"),h.classList.add("fit-y")):w=="fit"?h.classList.add("fit-x","fit-y"):h.classList.remove("fit-x","fit-y")}),n.tooltip!==!1){const{loader:E,tooltip:S}=n,w=E&&!SP(E)?E==null?void 0:E.baseURL:void 0,_=pfe(S)?S:new Dce({baseURL:w,...S===!0?{}:S}).call;y.tooltip(_)}let{hover:b}=n;if(b===void 0&&(b=f==="vega"),b){const{hoverSet:E,updateSet:S}=typeof b=="boolean"?{}:b;y.hover(E,S)}n&&(n.width!=null&&y.width(n.width),n.height!=null&&y.height(n.height),n.padding!=null&&y.padding(n.padding)),await y.initialize(h,n.bind).runAsync();let v;if(o!==!1){let E=c;if(n.defaultStyle!==!1||n.forceActionsMenu){const w=document.createElement("details");w.title=s.CLICK_TO_VIEW_ACTIONS,c.append(w),E=w;const _=document.createElement("summary");_.innerHTML=hfe,w.append(_),v=A=>{w.contains(A.target)||w.removeAttribute("open")},document.addEventListener("click",v)}const S=document.createElement("div");if(E.append(S),S.classList.add("vega-actions"),o===!0||o.export!==!1){for(const w of["svg","png"])if(o===!0||o.export===!0||o.export[w]){const _=s[`${w.toUpperCase()}_ACTION`],A=document.createElement("a"),k=Y(n.scaleFactor)?n.scaleFactor[w]:n.scaleFactor;A.text=_,A.href="#",A.target="_blank",A.download=`${l}.${w}`,A.addEventListener("mousedown",async function(C){C.preventDefault();const O=await y.toImageURL(w,k);this.href=O}),S.append(A)}}if(o===!0||o.source!==!1){const w=document.createElement("a");w.text=s.SOURCE_ACTION,w.href="#",w.addEventListener("click",function(_){Zk(m0(t),n.sourceHeader??"",n.sourceFooter??"",f),_.preventDefault()}),S.append(w)}if(f==="vega-lite"&&(o===!0||o.compiled!==!1)){const w=document.createElement("a");w.text=s.COMPILED_ACTION,w.href="#",w.addEventListener("click",function(_){Zk(m0(d),n.sourceHeader??"",n.sourceFooter??"","vega"),_.preventDefault()}),S.append(w)}if(o===!0||o.editor!==!1){const w=n.editorUrl??"https://vega.github.io/editor/",_=document.createElement("a");_.text=s.EDITOR_ACTION,_.href="#",_.addEventListener("click",function(A){afe(window,w,{config:r,mode:g?"vega":f,renderer:a,spec:m0(g?d:t)}),A.preventDefault()}),S.append(_)}}function x(){v&&document.removeEventListener("click",v),y.finalize()}return{view:y,spec:t,vgSpec:d,finalize:x,embedOptions:n}}function Ju(e,t,n){return e.fields=t||[],e.fname=n,e}function wfe(e){return e.length===1?Efe(e[0]):Sfe(e)}const Efe=e=>function(t){return t[e]},Sfe=e=>{const t=e.length;return function(n){for(let i=0;i<t;++i)n=n[e[i]];return n}};function Q0(e){throw Error(e)}function _fe(e){const t=[],n=e.length;let i=null,r=0,o="",s,a,u;e=e+"";function l(){t.push(o+e.substring(s,a)),o="",s=a+1}for(s=a=0;a<n;++a)if(u=e[a],u==="\\")o+=e.substring(s,a++),s=a;else if(u===i)l(),i=null,r=-1;else{if(i)continue;s===r&&u==='"'||s===r&&u==="'"?(s=a+1,i=u):u==="."&&!r?a>s?l():s=a+1:u==="["?(a>s&&l(),r=s=a+1):u==="]"&&(r||Q0("Access path missing open bracket: "+e),r>0&&l(),r=0,s=a+1)}return r&&Q0("Access path missing closing bracket: "+e),i&&Q0("Access path missing closing quote: "+e),a>s&&(a++,l()),t}function Afe(e,t,n){const i=_fe(e);return e=i.length===1?i[0]:e,Ju(wfe(i),[e],e)}Afe("id");Ju(e=>e,[],"identity");Ju(()=>0,[],"zero");Ju(()=>1,[],"one");Ju(()=>!0,[],"true");Ju(()=>!1,[],"false");const $fe=(e,t)=>(e<t||e==null)&&t!=null?-1:(e>t||t==null)&&e!=null?1:(t=t instanceof Date?+t:t,(e=e instanceof Date?+e:e)!==e&&t===t?-1:t!==t&&e===e?1:0);function kfe(e,t,n){let i;t.x2&&(t.x?(n&&e.x>e.x2&&(i=e.x,e.x=e.x2,e.x2=i),e.width=e.x2-e.x):e.x=e.x2-(e.width||0)),t.xc&&(e.x=e.xc-(e.width||0)/2),t.y2&&(t.y?(n&&e.y>e.y2&&(i=e.y,e.y=e.y2,e.y2=i),e.height=e.y2-e.y):e.y=e.y2-(e.height||0)),t.yc&&(e.y=e.yc-(e.height||0)/2)}var Cfe={NaN:NaN,E:Math.E,LN2:Math.LN2,LN10:Math.LN10,LOG2E:Math.LOG2E,LOG10E:Math.LOG10E,PI:Math.PI,SQRT1_2:Math.SQRT1_2,SQRT2:Math.SQRT2,MIN_VALUE:Number.MIN_VALUE,MAX_VALUE:Number.MAX_VALUE},Ffe={"*":(e,t)=>e*t,"+":(e,t)=>e+t,"-":(e,t)=>e-t,"/":(e,t)=>e/t,"%":(e,t)=>e%t,">":(e,t)=>e>t,"<":(e,t)=>e<t,"<=":(e,t)=>e<=t,">=":(e,t)=>e>=t,"==":(e,t)=>e==t,"!=":(e,t)=>e!=t,"===":(e,t)=>e===t,"!==":(e,t)=>e!==t,"&":(e,t)=>e&t,"|":(e,t)=>e|t,"^":(e,t)=>e^t,"<<":(e,t)=>e<<t,">>":(e,t)=>e>>t,">>>":(e,t)=>e>>>t},Tfe={"+":e=>+e,"-":e=>-e,"~":e=>~e,"!":e=>!e};const Mfe=Array.prototype.slice,hs=(e,t,n)=>{const i=n?n(t[0]):t[0];return i[e].apply(i,Mfe.call(t,1))},Dfe=(e,t,n,i,r,o,s)=>new Date(e,t||0,n??1,i||0,r||0,o||0,s||0);var Ofe={isNaN:Number.isNaN,isFinite:Number.isFinite,abs:Math.abs,acos:Math.acos,asin:Math.asin,atan:Math.atan,atan2:Math.atan2,ceil:Math.ceil,cos:Math.cos,exp:Math.exp,floor:Math.floor,log:Math.log,max:Math.max,min:Math.min,pow:Math.pow,random:Math.random,round:Math.round,sin:Math.sin,sqrt:Math.sqrt,tan:Math.tan,clamp:(e,t,n)=>Math.max(t,Math.min(n,e)),now:Date.now,utc:Date.UTC,datetime:Dfe,date:e=>new Date(e).getDate(),day:e=>new Date(e).getDay(),year:e=>new Date(e).getFullYear(),month:e=>new Date(e).getMonth(),hours:e=>new Date(e).getHours(),minutes:e=>new Date(e).getMinutes(),seconds:e=>new Date(e).getSeconds(),milliseconds:e=>new Date(e).getMilliseconds(),time:e=>new Date(e).getTime(),timezoneoffset:e=>new Date(e).getTimezoneOffset(),utcdate:e=>new Date(e).getUTCDate(),utcday:e=>new Date(e).getUTCDay(),utcyear:e=>new Date(e).getUTCFullYear(),utcmonth:e=>new Date(e).getUTCMonth(),utchours:e=>new Date(e).getUTCHours(),utcminutes:e=>new Date(e).getUTCMinutes(),utcseconds:e=>new Date(e).getUTCSeconds(),utcmilliseconds:e=>new Date(e).getUTCMilliseconds(),length:e=>e.length,join:function(){return hs("join",arguments)},indexof:function(){return hs("indexOf",arguments)},lastindexof:function(){return hs("lastIndexOf",arguments)},slice:function(){return hs("slice",arguments)},reverse:e=>e.slice().reverse(),sort:e=>e.slice().sort($fe),parseFloat,parseInt,upper:e=>String(e).toUpperCase(),lower:e=>String(e).toLowerCase(),substring:function(){return hs("substring",arguments,String)},split:function(){return hs("split",arguments,String)},replace:function(){return hs("replace",arguments,String)},trim:e=>String(e).trim(),btoa:e=>btoa(e),atob:e=>atob(e),regexp:RegExp,test:(e,t)=>RegExp(e).test(t)};const Rfe=["view","item","group","xy","x","y"],ob=new Set([Function,eval,setTimeout,setInterval]);typeof setImmediate=="function"&&ob.add(setImmediate);const Nfe={Literal:(e,t)=>t.value,Identifier:(e,t)=>{const n=t.name;return e.memberDepth>0?n:n==="datum"?e.datum:n==="event"?e.event:n==="item"?e.item:Cfe[n]||e.params["$"+n]},MemberExpression:(e,t)=>{const n=!t.computed,i=e(t.object);n&&(e.memberDepth+=1);const r=e(t.property);if(n&&(e.memberDepth-=1),ob.has(i[r])){console.error(`Prevented interpretation of member "${r}" which could lead to insecure code execution`);return}return i[r]},CallExpression:(e,t)=>{const n=t.arguments;let i=t.callee.name;return i.startsWith("_")&&(i=i.slice(1)),i==="if"?e(n[0])?e(n[1]):e(n[2]):(e.fn[i]||Ofe[i]).apply(e.fn,n.map(e))},ArrayExpression:(e,t)=>t.elements.map(e),BinaryExpression:(e,t)=>Ffe[t.operator](e(t.left),e(t.right)),UnaryExpression:(e,t)=>Tfe[t.operator](e(t.argument)),ConditionalExpression:(e,t)=>e(t.test)?e(t.consequent):e(t.alternate),LogicalExpression:(e,t)=>t.operator==="&&"?e(t.left)&&e(t.right):e(t.left)||e(t.right),ObjectExpression:(e,t)=>t.properties.reduce((n,i)=>{e.memberDepth+=1;const r=e(i.key);return e.memberDepth-=1,ob.has(e(i.value))?console.error(`Prevented interpretation of property "${r}" which could lead to insecure code execution`):n[r]=e(i.value),n},{})};function El(e,t,n,i,r,o){const s=a=>Nfe[a.type](s,a);return s.memberDepth=0,s.fn=Object.create(t),s.params=n,s.datum=i,s.event=r,s.item=o,Rfe.forEach(a=>s.fn[a]=function(){return r.vega[a](...arguments)}),s(e)}var Lfe={operator(e,t){const n=t.ast,i=e.functions;return r=>El(n,i,r)},parameter(e,t){const n=t.ast,i=e.functions;return(r,o)=>El(n,i,o,r)},event(e,t){const n=t.ast,i=e.functions;return r=>El(n,i,void 0,void 0,r)},handler(e,t){const n=t.ast,i=e.functions;return(r,o)=>{const s=o.item&&o.item.datum;return El(n,i,r,s,o)}},encode(e,t){const{marktype:n,channels:i}=t,r=e.functions,o=n==="group"||n==="image"||n==="rect";return(s,a)=>{const u=s.datum;let l=0,c;for(const f in i)c=El(i[f].ast,r,a,u,void 0,s),s[f]!==c&&(s[f]=c,l=1);return n!=="rule"&&kfe(s,i,o),l}}};const Pfe={DATAFRAME_INDEX:"(index)"};function Ife(e){return!e||e.dimensions.numDataRows===0?null:sg(e)}function zfe(e){const t=sb(e);if(ab(t))return null;const n={};for(const[i,r]of Object.entries(t))n[i]=sg(r);return n}function sb(e){if((e==null?void 0:e.length)===0)return null;const t={};return e.forEach(n=>{if(!n)return;const i=n.hasName?n.name:null;t[i]=n.data}),t}function sg(e,t=0){if(e.dimensions.numDataRows===0)return[];const n=[],{numDataRows:i,numDataColumns:r,numIndexColumns:o}=e.dimensions,s=e.columnTypes[0]??void 0,a=s&&s.type===MP.INDEX&&(DP(s)||FE(s)||TE(s));for(let u=t;u<i;u++){const l={};if(a){const{content:c}=e.getCell(u,0);l[Pfe.DATAFRAME_INDEX]=typeof c=="bigint"?Number(c):c}for(let c=0;c<r;c++){const f=c+o,{content:d,contentType:h}=e.getCell(u,f);if((d instanceof Date||typeof d=="number"&&Number.isFinite(d))&&(FE(h)||TE(h))&&!OP(h)){const g=new Date(d).getTimezoneOffset()*60*1e3;l[e.columnNames[0][f]]=d.valueOf()+g}else l[e.columnNames[0][f]]=typeof d=="bigint"?Number(d):d}n.push(l)}return n}const Bfe=150,Ufe=rC.getLogger("useVegaLiteSelections"),jfe=(e,t,n)=>{const{id:i,formId:r,selectionMode:o}=e,s=wt.useCallback(u=>{o.forEach(c=>{u.addSignalListener(c,RP(Bfe,(f,d)=>{const h=u.getState({data:(b,v)=>o.some(x=>`${x}_store`===b),recurse:!1});ME(h)&&t.setElementState(i,"viewState",h);let g=d;"vlPoint"in d&&"or"in d.vlPoint&&(g=d.vlPoint.or);const p={id:i,formId:r},m=JSON.parse(t.getStringValue(p)||"{}"),y={selection:{...(m==null?void 0:m.selection)||{},[f]:g||{}}};DE(m,y)||t.setStringValue(p,JSON.stringify(y),{fromUi:!0},n)}))});const l=t.getElementState(i,"viewState");if(ME(l))try{return u.setState(l)}catch(c){Ufe.warn("Failed to restore view state",c)}return u},[i,o,t,r,n]),a=wt.useCallback(()=>{const u={selection:{}};o.forEach(d=>{u.selection[d]={}});const l={id:i,formId:r},c=t.getStringValue(l),f=c?JSON.parse(c):u;DE(f,u)||t.setStringValue(l,JSON.stringify(u),{fromUi:!0},n)},[i,r,n,o,t]);return{maybeConfigureSelections:s,onFormCleared:a}},nC="source",qfe=rC.getLogger("useVegaEmbed");function Wfe(e,t,n){const i=wt.useRef(null),r=wt.useRef(null),o=wt.useRef(nC),s=wt.useRef(null),a=wt.useRef([]),{maybeConfigureSelections:u,onFormCleared:l}=jfe(e,t,n);yI({widgetMgr:t,element:e,onFormCleared:l});const{data:c,datasets:f}=e;wt.useEffect(()=>{i.current===null&&(s.current=c,a.current=f)},[c,f]);const d=wt.useCallback(()=>{r.current&&r.current(),r.current=null,i.current=null},[]),h=wt.useCallback(async(m,y)=>{if(m.current===null)throw new Error("Element missing.");d();const b={ast:!0,expr:Lfe,tooltip:{disableDefaultStyle:!0},defaultStyle:!1,forceActionsMenu:!0},{vgSpec:v,view:x,finalize:E}=await bfe(m.current,y,b);i.current=u(x),r.current=E;const S=zfe(a.current),w=S?Object.keys(S):[];if(w.length===1){const[A]=w;o.current=A}else w.length===0&&v.data&&(o.current=nC);const _=Ife(s.current);if(_&&i.current.insert(o.current,_),S)for(const[A,k]of Object.entries(S))i.current.insert(A,k);return await i.current.runAsync(),await i.current.resize().runAsync(),i.current},[d,u]),g=wt.useCallback((m,y,b,v)=>{if(!v||v.dimensions.numDataRows===0)try{m.remove(y,Pn)}finally{return}if(!b||b.dimensions.numDataRows===0){m.insert(y,sg(v));return}v.hash!==b.hash&&(m.data(y,sg(v)),qfe.info(`Had to clear the ${y} dataset before inserting data through Vega view.`))},[]),p=wt.useCallback(async(m,y)=>{var S;if(i.current===null)return null;const b=s.current,v=a.current;(b||m)&&g(i.current,o.current,b,m);const x=sb(v)??{},E=sb(y)??{};for(const[w,_]of Object.entries(E)){const A=w||o.current,k=x[A];g(i.current,A,k,_)}for(const w of Object.keys(x))!E.hasOwnProperty(w)&&w!==o.current&&g(i.current,w,null,null);return await((S=i.current)==null?void 0:S.resize().runAsync()),s.current=m,a.current=y,i.current},[g]);return{createView:h,updateView:p,finalizeView:d}}const Hfe=({disableFullscreenMode:e,element:t,fragmentId:n,widgetMgr:i})=>{const{expanded:r,width:o,height:s,expand:a,collapse:u}=oC(sC),l=wt.useRef(null),c=_I(t),{createView:f,updateView:d,finalizeView:h}=Wfe(c,i,n),{data:g,datasets:p,spec:m}=c;return wt.useEffect(()=>(l.current!==null&&f(l,m),h),[f,h,m,o,s]),wt.useEffect(()=>{d(g,p)},[g,p,d]),NP(OE,{width:o,height:s,useContainerWidth:c.useContainerWidth,children:[dm(PP,{target:OE,isFullScreen:r,onExpand:a,onCollapse:u,disableFullscreenMode:e}),dm(LP,{styles:[bI]}),dm(vI,{"data-testid":"stVegaLiteChart",className:"stVegaLiteChart",useContainerWidth:c.useContainerWidth,isFullScreen:r,ref:l})]})},Pde=IP(Hfe);export{Pde as default};
|