streamlit-nightly 1.42.3.dev20250222__py2.py3-none-any.whl → 1.42.3.dev20250224__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/dataframe_util.py +6 -1
- streamlit/elements/bokeh_chart.py +6 -0
- streamlit/elements/markdown.py +2 -0
- streamlit/static/index.html +1 -1
- streamlit/static/static/js/{FileDownload.esm.B1kyp21I.js → FileDownload.esm.Db6P60XC.js} +1 -1
- streamlit/static/static/js/FileHelper.LHDgAkEu.js +5 -0
- streamlit/static/static/js/{FormClearHelper.CEl0YyS3.js → FormClearHelper.BkPbs0OF.js} +1 -1
- streamlit/static/static/js/{Hooks.B_-0sclb.js → Hooks.CW1Ujj-E.js} +1 -1
- streamlit/static/static/js/{InputInstructions.M8GsfWtP.js → InputInstructions.CHpHVupe.js} +1 -1
- streamlit/static/static/js/{ProgressBar.DDliFXvs.js → ProgressBar.CSZV-k_M.js} +2 -2
- streamlit/static/static/js/{RenderInPortalIfExists.DON5no2j.js → RenderInPortalIfExists.CrI9B0Qh.js} +1 -1
- streamlit/static/static/js/{Toolbar.DGwjBtCI.js → Toolbar.CfNF-56q.js} +1 -1
- streamlit/static/static/js/{base-input.Dz6cKnV_.js → base-input.BBFJwxWO.js} +4 -4
- streamlit/static/static/js/{createSuper.bXxYJzro.js → createSuper.rz8EjYR0.js} +1 -1
- streamlit/static/static/js/{data-grid-overlay-editor.BrHDbHOn.js → data-grid-overlay-editor.DUagmDpG.js} +1 -1
- streamlit/static/static/js/{downloader.BUh1naKp.js → downloader.DEY2_Oao.js} +1 -1
- streamlit/static/static/js/{es6.C8XVTTHj.js → es6.Cbt8Qb0v.js} +2 -2
- streamlit/static/static/js/{iframeResizer.contentWindow.DGWt48-l.js → iframeResizer.contentWindow.DlY1zPt7.js} +1 -1
- streamlit/static/static/js/{index.6zGrdP7S.js → index.7HEH_7fJ.js} +15 -15
- streamlit/static/static/js/{index.DvUg88R_.js → index.8pg9ijwI.js} +1 -1
- streamlit/static/static/js/{index.jSEMrPEJ.js → index.B5Q1lb1E.js} +1 -1
- streamlit/static/static/js/{index.DgCaLwAb.js → index.BFFhpOhV.js} +1 -1
- streamlit/static/static/js/{index.DU4gaNU_.js → index.BcIDRdbw.js} +1 -1
- streamlit/static/static/js/index.Bhf5i-o4.js +1 -0
- streamlit/static/static/js/{index.DcA_kXA1.js → index.BtBNIxWC.js} +2 -2
- streamlit/static/static/js/{index.BhKdTR4z.js → index.Bv1JbhEf.js} +1 -1
- streamlit/static/static/js/index.C29vTftb.js +3865 -0
- streamlit/static/static/js/{index.94WymsOx.js → index.C3FZ8TOb.js} +3 -3
- streamlit/static/static/js/index.C41AtD-D.js +1 -0
- streamlit/static/static/js/{index.C5zcxetk.js → index.C9kvqGu0.js} +1 -1
- streamlit/static/static/js/{index.DO1Rv491.js → index.CIDueoC2.js} +1 -1
- streamlit/static/static/js/{index.C2skmlN3.js → index.CUFUpykP.js} +2 -2
- streamlit/static/static/js/index.CUWXxL_C.js +1 -0
- streamlit/static/static/js/{index.BBotNZr-.js → index.CUepHEom.js} +1 -1
- streamlit/static/static/js/index.C_SUbLL7.js +1 -0
- streamlit/static/static/js/index.CdiPATR3.js +197 -0
- streamlit/static/static/js/index.CgZ_3VRU.js +1 -0
- streamlit/static/static/js/{index.BiCX2JZK.js → index.CjN5S59O.js} +1 -1
- streamlit/static/static/js/{index.B66JaJi3.js → index.Con6tiNg.js} +1 -1
- streamlit/static/static/js/{index.D-4pSvTG.js → index.D1sfL1bE.js} +1 -1
- streamlit/static/static/js/{index.CNDCHhth.js → index.D2PC_wwi.js} +1 -1
- streamlit/static/static/js/index.D8mp5ppE.js +201 -0
- streamlit/static/static/js/{index.C2VChsA1.js → index.DEz7mrAp.js} +1 -1
- streamlit/static/static/js/{index.BrXMfzqp.js → index.DPZJrrNj.js} +1 -1
- streamlit/static/static/js/{index.DB9G9YYY.js → index.Df3vkO_v.js} +1 -1
- streamlit/static/static/js/{index.BXFE-6NA.js → index.DuUcgXrv.js} +1 -1
- streamlit/static/static/js/{index.lCzpOFcS.js → index.DxvQWdtj.js} +1 -1
- streamlit/static/static/js/{index.D_tVZ0u0.js → index.DymllY6d.js} +2 -2
- streamlit/static/static/js/{index.Da7VTJGp.js → index.G1PSqufB.js} +2 -2
- streamlit/static/static/js/{index.B1Y_k9Fh.js → index.I2Ij_yHL.js} +1 -1
- streamlit/static/static/js/{index.NifETEVc.js → index.InwDjRN5.js} +1 -1
- streamlit/static/static/js/{index.iYzAfcLx.js → index.LmMDdxLh.js} +1 -1
- streamlit/static/static/js/{index.C9nK-VoQ.js → index.LypQPPkP.js} +3 -3
- streamlit/static/static/js/index.RDHMaPCV.js +1 -0
- streamlit/static/static/js/index.jj20zRA4.js +1 -0
- streamlit/static/static/js/{input.DqK048_c.js → input.QeLiGsyn.js} +2 -2
- streamlit/static/static/js/{memory.BYwXutbg.js → memory.0fYVo8Wx.js} +1 -1
- streamlit/static/static/js/{mergeWith.CwfhUp-s.js → mergeWith.AOqADio_.js} +1 -1
- streamlit/static/static/js/{number-overlay-editor.B-1TJraW.js → number-overlay-editor.DAvAckzz.js} +1 -1
- streamlit/static/static/js/{possibleConstructorReturn.CCjgmGB4.js → possibleConstructorReturn.C4RsC1R8.js} +1 -1
- streamlit/static/static/js/{sandbox.CzVH3fBX.js → sandbox.DT2p3KTe.js} +1 -1
- streamlit/static/static/js/{textarea.D47OO5VD.js → textarea.DQh9RYKV.js} +2 -2
- streamlit/static/static/js/{timepicker.Dq2FqiYO.js → timepicker.Br_cR0hi.js} +4 -4
- streamlit/static/static/js/{toConsumableArray.7OyX1dIj.js → toConsumableArray.CzYSWELu.js} +1 -1
- streamlit/static/static/js/{uniqueId.naIyoATl.js → uniqueId.BdUnRe3-.js} +1 -1
- streamlit/static/static/js/{useBasicWidgetState.DH0ClB0l.js → useBasicWidgetState.6R32QW2v.js} +1 -1
- streamlit/static/static/js/{useOnInputChange.3GZT2mEx.js → useOnInputChange.C4OiWI1_.js} +1 -1
- streamlit/static/static/js/withFullScreenWrapper.BLeP_b5i.js +1 -0
- streamlit/user_info.py +8 -2
- {streamlit_nightly-1.42.3.dev20250222.dist-info → streamlit_nightly-1.42.3.dev20250224.dist-info}/METADATA +1 -1
- {streamlit_nightly-1.42.3.dev20250222.dist-info → streamlit_nightly-1.42.3.dev20250224.dist-info}/RECORD +75 -75
- streamlit/static/static/js/FileDropzone.uWzTac7M.js +0 -5
- streamlit/static/static/js/index.BUnE-2Mi.js +0 -201
- streamlit/static/static/js/index.BxBwZJQr.js +0 -1
- streamlit/static/static/js/index.CNYNhiEk.js +0 -1
- streamlit/static/static/js/index.CUKOkOB2.js +0 -197
- streamlit/static/static/js/index.Ceuq3IzZ.js +0 -1
- streamlit/static/static/js/index.ChSsIvr7.js +0 -3865
- streamlit/static/static/js/index.DKFH0WYB.js +0 -1
- streamlit/static/static/js/index.DQT0NMTW.js +0 -1
- streamlit/static/static/js/index.DiXeiIyQ.js +0 -1
- streamlit/static/static/js/index.Dl_RyApM.js +0 -1
- streamlit/static/static/js/withFullScreenWrapper.HzikaPlG.js +0 -1
- {streamlit_nightly-1.42.3.dev20250222.data → streamlit_nightly-1.42.3.dev20250224.data}/scripts/streamlit.cmd +0 -0
- {streamlit_nightly-1.42.3.dev20250222.dist-info → streamlit_nightly-1.42.3.dev20250224.dist-info}/WHEEL +0 -0
- {streamlit_nightly-1.42.3.dev20250222.dist-info → streamlit_nightly-1.42.3.dev20250224.dist-info}/entry_points.txt +0 -0
- {streamlit_nightly-1.42.3.dev20250222.dist-info → streamlit_nightly-1.42.3.dev20250224.dist-info}/top_level.txt +0 -0
@@ -1,201 +0,0 @@
|
|
1
|
-
import{aw as QL,n as ZL,z as Qe,aE as eP,aF as hE,aG as tP,aH as nP,aI as pa,aJ as Dd,L as iP,y as rP,r as wt,K as Gy,g as oP,ab as sP,am as aP,ai as gE,aj as pE,U as uP,aK as lP,M as mE,az as yE,aq as Dk,C as cP,j as dm,aL as fP}from"./index.6zGrdP7S.js";import{S as bE,T as dP}from"./Toolbar.DGwjBtCI.js";import{u as Rk,E as Nk,w as hP}from"./withFullScreenWrapper.HzikaPlG.js";import{m as gP}from"./mergeWith.CwfhUp-s.js";import{a as ic,n as pP,b as mP,c as ag,t as Ds,p as yP,d as bP,e as vP,i as Wo,f as ug,g as vE,l as ku,h as Vy,j as lg,k as xE,m as go,o as Va,q as xP,r as qo,s as wP,u as EP,v as SP,w as _P}from"./threshold.DjX0wlsa.js";import{f as $P,a as z0,b as Lk,c as AP,R as cg,r as Pk,d as Xy,e as Yy,C as Ky,g as wE,h as EE,i as fg,j as I0,n as It,k as Oc,l as kP,m as CP,o as FP,p as TP,q as MP,s as OP,t as DP,u as RP,v as NP,w as LP,x as PP,y as Rd}from"./value.CgPGBV_l.js";import{P as zP,i as IP,a as BP,b as UP,p as Jy,T as jP,n as WP,t as qP,d as HP}from"./timer.CAwTRJ_g.js";import{u as GP}from"./FormClearHelper.CEl0YyS3.js";const VP=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:QL(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"}}}}}),XP=ZL("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 SE(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:Dd(t),domain:!1,domainWidth:1,domainColor:Dd(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:nP(t),diverging:tP(t),ramp:hE(t),heatmap:hE(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:eP(t)},bar:{binSpacing:Qe(t.spacing.twoXS),discreteBandSize:{band:.85}},axisDiscrete:{grid:!1},axisXPoint:{grid:!1},axisTemporal:{grid:!1},axisXBand:{grid:!1}};return e?gP({},n,e,(i,r)=>Array.isArray(r)?r:void 0):n}function YP(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:Dd(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:Dd(t),continuousHeight:Qe(t.sizes.defaultChartHeight),continuousWidth:Qe(t.sizes.defaultChartWidth)},mark:{tooltip:!0}};return e?iP({},s,e):s}const KP=20;function JP(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)&&Gy(t.select.encodings)&&(t.select.encodings=Object.keys(e.encoding)))})}const QP=(e,t,n,i,r,o,s,a)=>{var l,c;const u=JSON.parse(e);if(n==="streamlit"?u.config=SE(u.config,r):((c=(l=u.usermeta)==null?void 0:l.embedOptions)==null?void 0:c.theme)==="streamlit"?(u.config=SE(u.config,r),u.usermeta.embedOptions.theme=void 0):u.config=YP(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={}),Gy(u.padding.bottom)&&(u.padding.bottom=KP),u.datasets)throw new Error("Datasets should not be passed as part of the spec");return i.length>0&&JP(u),u},ZP=e=>{const t=rP(),{expanded:n,width:i,height:r}=Rk(Nk),{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(()=>QP(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 _n(e,t,n){return e.fields=t||[],e.fname=n,e}function Je(e){return e==null?null:e.fname}function jt(e){return e==null?null:e.fields}function zk(e){return e.length===1?ez(e[0]):tz(e)}const ez=e=>function(t){return t[e]},tz=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 ur(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 Jn(e,t,n){const i=ur(e);return e=i.length===1?i[0]:e,_n((n&&n.get||zk)(i),[e],t||e)}const Dc=Jn("id"),Gt=_n(e=>e,[],"identity"),ho=_n(()=>0,[],"zero"),Cu=_n(()=>1,[],"one"),Ln=_n(()=>!0,[],"true"),ro=_n(()=>!1,[],"false");function nz(e,t,n){const i=[t].concat([].slice.call(n));console[e].apply(console,i)}const Ik=0,Qy=1,Zy=2,Bk=3,Uk=4;function eb(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:nz,i=e||Ik;return{level(r){return arguments.length?(i=+r,this):i},error(){return i>=Qy&&n(t||"error","ERROR",arguments),this},warn(){return i>=Zy&&n(t||"warn","WARN",arguments),this},info(){return i>=Bk&&n(t||"log","INFO",arguments),this},debug(){return i>=Uk&&n(t||"log","DEBUG",arguments),this}}}var L=Array.isArray;function X(e){return e===Object(e)}const _E=e=>e!=="__proto__";function Fu(){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=iz(i.signals,r.signals);else{const s=o==="legend"?{layout:1}:o==="style"?!0:null;Tu(i,o,r[o],s)}return i},{})}function Tu(e,t,n,i){if(!_E(t))return;let r,o;if(X(n)&&!L(n)){o=X(e[t])?e[t]:e[t]={};for(r in n)i&&(i===!0||i[r])?Tu(o,r,n[r]):_E(r)&&(o[r]=n[r])}else e[t]=n}function iz(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 xe(e){return e[e.length-1]}function Bt(e){return e==null||e===""?null:+e}const jk=e=>t=>e*Math.exp(t),Wk=e=>t=>Math.log(e*t),qk=e=>t=>Math.sign(t)*Math.log1p(Math.abs(t/e)),Hk=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(xe(e)),s=(o-r)*t;return[i(r-s),i(o-s)]}function Gk(e,t){return dg(e,t,Bt,Gt)}function Vk(e,t){var n=Math.sign(e[0]);return dg(e,t,Wk(n),jk(n))}function Xk(e,t,n){return dg(e,t,Nd(n),Nd(1/n))}function Yk(e,t,n){return dg(e,t,qk(n),Hk(n))}function hg(e,t,n,i,r){const o=i(e[0]),s=i(xe(e)),a=t!=null?i(t):(o+s)/2;return[r(a+(o-a)*n),r(a+(s-a)*n)]}function tb(e,t,n){return hg(e,t,n,Bt,Gt)}function nb(e,t,n){const i=Math.sign(e[0]);return hg(e,t,n,Wk(i),jk(i))}function Ld(e,t,n,i){return hg(e,t,n,Nd(i),Nd(1/i))}function ib(e,t,n,i){return hg(e,t,n,qk(i),Hk(i))}function Kk(e){return 1+~~(new Date(e).getMonth()/3)}function Jk(e){return 1+~~(new Date(e).getUTCMonth()/3)}function Y(e){return e!=null?L(e)?e:[e]:[]}function Qk(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 fe(e){return typeof e=="function"}const rz="descending";function rb(e,t,n){n=n||{},t=Y(t)||[];const i=[],r=[],o={},s=n.comparator||oz;return Y(e).forEach((a,u)=>{a!=null&&(i.push(t[u]===rz?-1:1),r.push(a=fe(a)?a:Jn(a,null,n)),(jt(a)||[]).forEach(l=>o[l]=1))}),r.length===0?null:_n(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),oz=(e,t)=>e.length===1?sz(e[0],t[0]):az(e,t,e.length),sz=(e,t)=>function(n,i){return gg(e(n),e(i))*t},az=(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 Vt(e){return fe(e)?e:()=>e}function ob(e,t){let n;return i=>{n&&clearTimeout(n),n=setTimeout(()=>(t(i),n=null),e)}}function ce(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 Zi(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 Zk(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 uz=Object.prototype.hasOwnProperty;function J(e,t){return uz.call(e,t)}const _f={};function Mu(e){let t={},n;function i(o){return J(t,o)&&t[o]!==_f}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]===_f&&--r.empty),t[o]=s,this},delete(o){return i(o)&&(--r.size,++r.empty,t[o]=_f),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!==_f&&(!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 eC(e,t,n,i,r,o){if(!n&&n!==0)return o;const s=+n;let a=e[0],u=xe(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}),ce(i,n)}function Ma(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 Ho(e){return typeof e=="boolean"}function _o(e){return Object.prototype.toString.call(e)==="[object Date]"}function tC(e){return e&&fe(e[Symbol.iterator])}function $e(e){return typeof e=="number"}function nC(e){return Object.prototype.toString.call(e)==="[object RegExp]"}function K(e){return typeof e=="string"}function sb(e,t,n){e&&(e=t?Y(e).map(a=>a.replace(/\\(.)/g,"$1")):Y(e));const i=e&&e.length,r=n&&n.get||zk,o=a=>r(t?[a]:ur(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 _n(s,e,"key")}function iC(e,t){const n=e[0],i=xe(e),r=+t;return r?r===1?i:n+r*(i-n):n}const lz=1e4;function rC(e){e=+e||lz;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 oC(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 El(e,t){let n="";for(;--t>=0;)n+=e;return n}function sC(e,t,n,i){const r=n||" ",o=e+"",s=t-o.length;return s<=0?o:i==="left"?El(r,s)+o:i==="center"?El(r,~~(s/2))+o+El(r,Math.ceil(s/2)):o+El(r,s)}function Rc(e){return e&&xe(e)-e[0]||0}function H(e){return L(e)?"["+e.map(H)+"]":X(e)||K(e)?JSON.stringify(e).replace("\u2028","\\u2028").replace("\u2029","\\u2029"):e}function ab(e){return e==null||e===""?null:!e||e==="false"||e==="0"?!1:!!e}const cz=e=>$e(e)||_o(e)?e:Date.parse(e);function ub(e,t){return t=t||cz,e==null||e===""?null:t(e)}function lb(e){return e==null||e===""?null:e+""}function vi(e){const t={},n=e.length;for(let i=0;i<n;++i)t[e[i]]=!0;return t}function aC(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 ao(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 $E={},hm={},gm=34,Qu=10,pm=13;function uC(e){return new Function("d","return {"+e.map(function(t,n){return JSON.stringify(t)+": d["+n+'] || ""'}).join(",")+"}")}function fz(e,t){var n=uC(e);return function(i,r){return t(n(i),r,e)}}function AE(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 dn(e,t){var n=e+"",i=n.length;return i<t?new Array(t-i+1).join(0)+n:n}function dz(e){return e<0?"-"+dn(-e,6):e>9999?"+"+dn(e,6):dn(e,4)}function hz(e){var t=e.getUTCHours(),n=e.getUTCMinutes(),i=e.getUTCSeconds(),r=e.getUTCMilliseconds();return isNaN(e)?"Invalid Date":dz(e.getUTCFullYear())+"-"+dn(e.getUTCMonth()+1,2)+"-"+dn(e.getUTCDate(),2)+(r?"T"+dn(t,2)+":"+dn(n,2)+":"+dn(i,2)+"."+dn(r,3)+"Z":i?"T"+dn(t,2)+":"+dn(n,2)+":"+dn(i,2)+"Z":n||t?"T"+dn(t,2)+":"+dn(n,2)+"Z":"")}function gz(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?fz(m,d):uC(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,$E;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!==$E&&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=AE(f)),[d.map(c).join(e)].concat(o(f,d)).join(`
|
3
|
-
`)}function a(f,d){return d==null&&(d=AE(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?hz(f):t.test(f+="")?'"'+f.replace(/"/g,'""')+'"':f}return{parse:i,parseRows:r,format:s,formatBody:a,formatRows:u,formatRow:l,formatValue:c}}function pz(e){return e}function mz(e){if(e==null)return pz;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 yz(e,t){for(var n,i=e.length,r=i-t;r<--i;)n=e[r],e[r++]=e[i],e[i]=n}function bz(e,t){return typeof t=="string"&&(t=e.objects[t]),t.type==="GeometryCollection"?{type:"FeatureCollection",features:t.geometries.map(function(n){return kE(e,n)})}:kE(e,t)}function kE(e,t){var n=t.id,i=t.bbox,r=t.properties==null?{}:t.properties,o=lC(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 lC(e,t){var n=mz(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&&yz(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 vz(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 xz(e){return lC(e,wz.apply(this,arguments))}function wz(e,t,n){var i,r,o;if(arguments.length>1)i=Ez(e,t,n);else for(r=0,i=new Array(o=e.arcs.length);r<o;++r)i[r]=r;return{type:"MultiLineString",arcs:vz(e,i)}}function Ez(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 Sz(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 _z(e,t){const n=Sz(e,t);return n&&Math.sqrt(n)}class on{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 CE extends Map{constructor(t,n=dC){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(B0(this,t))}has(t){return super.has(B0(this,t))}set(t,n){return super.set(cC(this,t),n)}delete(t){return super.delete(fC(this,t))}}class Pd extends Set{constructor(t,n=dC){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(B0(this,t))}add(t){return super.add(cC(this,t))}delete(t){return super.delete(fC(this,t))}}function B0({_intern:e,_key:t},n){const i=t(n);return e.has(i)?e.get(i):n}function cC({_intern:e,_key:t},n){const i=t(n);return e.has(i)?e.get(i):(e.set(i,n),n)}function fC({_intern:e,_key:t},n){const i=t(n);return e.has(i)&&(n=e.get(i),e.delete(i)),n}function dC(e){return e!==null&&typeof e=="object"?e.valueOf():e}function $z(e,t){return Array.from(t,n=>e[n])}function Az(e=ic){if(e===ic)return hC;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 hC(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 U0(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 gC(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?hC:Az(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));gC(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 j0(e,t,n){if(e=Float64Array.from(pP(e,n)),!(!(i=e.length)||isNaN(t=+t))){if(t<=0||i<2)return U0(e);if(t>=1)return _s(e);var i,r=(i-1)*t,o=Math.floor(r),s=_s(gC(e,o).subarray(0,o+1)),a=U0(e.subarray(o+1));return s+(a-s)*(r-o)}}function pC(e,t,n=mP){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 kz(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 mC(e,t){return j0(e,.5,t)}function*Cz(e){for(const t of e)yield*t}function yC(e){return Array.from(Cz(e))}function Tn(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 bC(e,t){let n=0;for(let i of e)(i=+i)&&(n+=i);return n}function Fz(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 Mz(...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 Xa=lt(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);Xa.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):Xa);Xa.range;const Fr=1e3,Hn=Fr*60,Tr=Hn*60,jr=Tr*24,cb=jr*7,FE=jr*30,bm=jr*365,Mr=lt(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*Fr)},(e,t)=>(t-e)/Fr,e=>e.getUTCSeconds());Mr.range;const pg=lt(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Fr)},(e,t)=>{e.setTime(+e+t*Hn)},(e,t)=>(t-e)/Hn,e=>e.getMinutes());pg.range;const mg=lt(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*Hn)},(e,t)=>(t-e)/Hn,e=>e.getUTCMinutes());mg.range;const yg=lt(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Fr-e.getMinutes()*Hn)},(e,t)=>{e.setTime(+e+t*Tr)},(e,t)=>(t-e)/Tr,e=>e.getHours());yg.range;const bg=lt(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*Tr)},(e,t)=>(t-e)/Tr,e=>e.getUTCHours());bg.range;const Nr=lt(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Hn)/jr,e=>e.getDate()-1);Nr.range;const $o=lt(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/jr,e=>e.getUTCDate()-1);$o.range;const vC=lt(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/jr,e=>Math.floor(e/jr));vC.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())*Hn)/cb)}const Ou=Qs(0),zd=Qs(1),Oz=Qs(2),Dz=Qs(3),Ya=Qs(4),Rz=Qs(5),Nz=Qs(6);Ou.range;zd.range;Oz.range;Dz.range;Ya.range;Rz.range;Nz.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)/cb)}const Du=Zs(0),Id=Zs(1),Lz=Zs(2),Pz=Zs(3),Ka=Zs(4),zz=Zs(5),Iz=Zs(6);Du.range;Id.range;Lz.range;Pz.range;Ka.range;zz.range;Iz.range;const rc=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());rc.range;const oc=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());oc.range;const er=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());er.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)});er.range;const tr=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());tr.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)});tr.range;function xC(e,t,n,i,r,o){const s=[[Mr,1,Fr],[Mr,5,5*Fr],[Mr,15,15*Fr],[Mr,30,30*Fr],[o,1,Hn],[o,5,5*Hn],[o,15,15*Hn],[o,30,30*Hn],[r,1,Tr],[r,3,3*Tr],[r,6,6*Tr],[r,12,12*Tr],[i,1,jr],[i,2,2*jr],[n,1,cb],[t,1,FE],[t,3,3*FE],[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(Ds(l/bm,c/bm,f));if(h===0)return Xa.every(Math.max(Ds(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[Bz,Uz]=xC(tr,oc,Du,vC,bg,mg),[jz,Wz]=xC(er,rc,Ou,Nr,yg,pg),Ct="year",bn="quarter",Wt="month",st="week",vn="date",zt="day",nr="dayofyear",Pn="hours",zn="minutes",Qn="seconds",xi="milliseconds",fb=[Ct,bn,Wt,st,vn,zt,nr,Pn,zn,Qn,xi],vm=fb.reduce((e,t,n)=>(e[t]=1+n,e),{});function db(e){const t=Y(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[bn]||n[Wt]||n[vn]?1:0)+(n[nr]?1:0)>1&&N(`Incompatible time units: ${e}`),t.sort((r,o)=>vm[r]-vm[o]),t}const qz={[Ct]:"%Y ",[bn]:"Q%q ",[Wt]:"%b ",[vn]:"%d ",[st]:"W%U ",[zt]:"%a ",[nr]:"%j ",[Pn]:"%H:00",[zn]:"00:%M",[Qn]:":%S",[xi]:".%L",[`${Ct}-${Wt}`]:"%Y-%m ",[`${Ct}-${Wt}-${vn}`]:"%Y-%m-%d ",[`${Pn}-${zn}`]:"%H:%M"};function wC(e,t){const n=ce({},qz,t),i=db(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 hb(e){return ms.setFullYear(e),ms.setMonth(0),ms.setDate(1),ms.setHours(0,0,0,0),ms}function EC(e){return _C(new Date(e))}function SC(e){return W0(new Date(e))}function _C(e){return Nr.count(hb(e.getFullYear())-1,e)}function W0(e){return Ou.count(hb(e.getFullYear())-1,e)}function q0(e){return hb(e).getDay()}function Hz(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 $C(e){return kC(new Date(e))}function AC(e){return H0(new Date(e))}function kC(e){const t=Date.UTC(e.getUTCFullYear(),0,1);return $o.count(t-1,e)}function H0(e){const t=Date.UTC(e.getUTCFullYear(),0,1);return Du.count(t-1,e)}function G0(e){return ms.setTime(Date.UTC(e,0,1)),ms.getUTCDay()}function Gz(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 CC(e,t,n,i,r){const o=t||1,s=xe(e),a=(y,b,v)=>(v=v||y,Vz(n[v],i[v],y===s&&o,b)),u=new Date,l=vi(e),c=l[Ct]?a(Ct):Vt(2012),f=l[Wt]?a(Wt):l[bn]?a(bn):ho,d=l[st]&&l[zt]?a(zt,1,st+zt):l[st]?a(st,1):l[zt]?a(zt,1):l[vn]?a(vn,1):l[nr]?a(nr,1):Cu,h=l[Pn]?a(Pn):ho,g=l[zn]?a(zn):ho,p=l[Qn]?a(Qn):ho,m=l[xi]?a(xi):ho;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 Vz(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 Ja(e,t,n){return t+e*7-(n+6)%7}const Xz={[Ct]:e=>e.getFullYear(),[bn]:e=>Math.floor(e.getMonth()/3),[Wt]:e=>e.getMonth(),[vn]:e=>e.getDate(),[Pn]:e=>e.getHours(),[zn]:e=>e.getMinutes(),[Qn]:e=>e.getSeconds(),[xi]:e=>e.getMilliseconds(),[nr]:e=>_C(e),[st]:e=>W0(e),[st+zt]:(e,t)=>Ja(W0(e),e.getDay(),q0(t)),[zt]:(e,t)=>Ja(1,e.getDay(),q0(t))},Yz={[bn]:e=>3*e,[st]:(e,t)=>Ja(e,0,q0(t))};function FC(e,t){return CC(e,t||1,Xz,Yz,Hz)}const Kz={[Ct]:e=>e.getUTCFullYear(),[bn]:e=>Math.floor(e.getUTCMonth()/3),[Wt]:e=>e.getUTCMonth(),[vn]:e=>e.getUTCDate(),[Pn]:e=>e.getUTCHours(),[zn]:e=>e.getUTCMinutes(),[Qn]:e=>e.getUTCSeconds(),[xi]:e=>e.getUTCMilliseconds(),[nr]:e=>kC(e),[st]:e=>H0(e),[zt]:(e,t)=>Ja(1,e.getUTCDay(),G0(t)),[st+zt]:(e,t)=>Ja(H0(e),e.getUTCDay(),G0(t))},Jz={[bn]:e=>3*e,[st]:(e,t)=>Ja(e,0,G0(t))};function TC(e,t){return CC(e,t||1,Kz,Jz,Gz)}const Qz={[Ct]:er,[bn]:rc.every(3),[Wt]:rc,[st]:Ou,[vn]:Nr,[zt]:Nr,[nr]:Nr,[Pn]:yg,[zn]:pg,[Qn]:Mr,[xi]:Xa},Zz={[Ct]:tr,[bn]:oc.every(3),[Wt]:oc,[st]:Du,[vn]:$o,[zt]:$o,[nr]:$o,[Pn]:bg,[zn]:mg,[Qn]:Mr,[xi]:Xa};function Ru(e){return Qz[e]}function Nu(e){return Zz[e]}function MC(e,t,n){return e?e.offset(t,n):void 0}function OC(e,t,n){return MC(Ru(e),t,n)}function DC(e,t,n){return MC(Nu(e),t,n)}function RC(e,t,n,i){return e?e.range(t,n,i):void 0}function NC(e,t,n,i){return RC(Ru(e),t,n,i)}function LC(e,t,n,i){return RC(Nu(e),t,n,i)}const Sl=1e3,_l=Sl*60,$l=_l*60,vg=$l*24,eI=vg*7,TE=vg*30,V0=vg*365,PC=[Ct,Wt,vn,Pn,zn,Qn,xi],Al=PC.slice(0,-1),kl=Al.slice(0,-1),Cl=kl.slice(0,-1),tI=Cl.slice(0,-1),nI=[Ct,st],ME=[Ct,Wt],zC=[Ct],el=[[Al,1,Sl],[Al,5,5*Sl],[Al,15,15*Sl],[Al,30,30*Sl],[kl,1,_l],[kl,5,5*_l],[kl,15,15*_l],[kl,30,30*_l],[Cl,1,$l],[Cl,3,3*$l],[Cl,6,6*$l],[Cl,12,12*$l],[tI,1,vg],[nI,1,eI],[ME,1,TE],[ME,3,3*TE],[zC,1,V0]];function IC(e){const t=e.extent,n=e.maxbins||40,i=Math.abs(Rc(t))/n;let r=ag(a=>a[2]).right(el,i),o,s;return r===el.length?(o=zC,s=Ds(t[0]/V0,t[1]/V0,n)):r?(r=el[i/el[r-1][2]<el[r][2]/i?r-1:r],o=r[0],s=r[1]):(o=PC,s=Math.max(Ds(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 BC(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:P,A:z,b:U,B:te,c:null,d:PE,e:PE,f:$I,g:NI,G:PI,H:EI,I:SI,j:_I,L:UC,m:AI,M:kI,p:ne,q:de,Q:BE,s:UE,S:CI,u:FI,U:TI,V:MI,w:OI,W:DI,x:null,X:null,y:RI,Y:LI,Z:zI,"%":IE},x={a:Se,A:we,b:Pe,B:Ri,c:null,d:zE,e:zE,f:jI,g:QI,G:e6,H:II,I:BI,j:UI,L:WC,m:WI,M:qI,p:ns,q:no,Q:BE,s:UE,S:HI,u:GI,U:VI,V:XI,w:YI,W:KI,x:null,X:null,y:JI,Y:ZI,Z:t6,"%":IE},E={a:C,A:T,b:D,B:k,c:F,d:NE,e:NE,f:bI,g:RE,G:DE,H:LE,I:LE,j:gI,L:yI,m:hI,M:pI,p:$,q:dI,Q:xI,s:wI,S:mI,u:aI,U:uI,V:lI,w:sI,W:cI,x:A,X:M,y:RE,Y:DE,Z:fI,"%":vI};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(Q,he){return function(pe){var q=[],xt=-1,Te=0,Ot=Q.length,ft,Ni,Sf;for(pe instanceof Date||(pe=new Date(+pe));++xt<Ot;)Q.charCodeAt(xt)===37&&(q.push(Q.slice(Te,xt)),(Ni=OE[ft=Q.charAt(++xt)])!=null?ft=Q.charAt(++xt):Ni=ft==="e"?" ":"0",(Sf=he[ft])&&(ft=Sf(pe,Ni)),q.push(ft),Te=xt+1);return q.push(Q.slice(Te,xt)),q.join("")}}function w(Q,he){return function(pe){var q=tl(1900,void 0,1),xt=_(q,Q,pe+="",0),Te,Ot;if(xt!=pe.length)return null;if("Q"in q)return new Date(q.Q);if("s"in q)return new Date(q.s*1e3+("L"in q?q.L:0));if(he&&!("Z"in q)&&(q.Z=0),"p"in q&&(q.H=q.H%12+q.p*12),q.m===void 0&&(q.m="q"in q?q.q:0),"V"in q){if(q.V<1||q.V>53)return null;"w"in q||(q.w=1),"Z"in q?(Te=wm(tl(q.y,0,1)),Ot=Te.getUTCDay(),Te=Ot>4||Ot===0?Id.ceil(Te):Id(Te),Te=$o.offset(Te,(q.V-1)*7),q.y=Te.getUTCFullYear(),q.m=Te.getUTCMonth(),q.d=Te.getUTCDate()+(q.w+6)%7):(Te=xm(tl(q.y,0,1)),Ot=Te.getDay(),Te=Ot>4||Ot===0?zd.ceil(Te):zd(Te),Te=Nr.offset(Te,(q.V-1)*7),q.y=Te.getFullYear(),q.m=Te.getMonth(),q.d=Te.getDate()+(q.w+6)%7)}else("W"in q||"U"in q)&&("w"in q||(q.w="u"in q?q.u%7:"W"in q?1:0),Ot="Z"in q?wm(tl(q.y,0,1)).getUTCDay():xm(tl(q.y,0,1)).getDay(),q.m=0,q.d="W"in q?(q.w+6)%7+q.W*7-(Ot+5)%7:q.w+q.U*7-(Ot+6)%7);return"Z"in q?(q.H+=q.Z/100|0,q.M+=q.Z%100,wm(q)):xm(q)}}function _(Q,he,pe,q){for(var xt=0,Te=he.length,Ot=pe.length,ft,Ni;xt<Te;){if(q>=Ot)return-1;if(ft=he.charCodeAt(xt++),ft===37){if(ft=he.charAt(xt++),Ni=E[ft in OE?he.charAt(xt++):ft],!Ni||(q=Ni(Q,pe,q))<0)return-1}else if(ft!=pe.charCodeAt(q++))return-1}return q}function $(Q,he,pe){var q=l.exec(he.slice(pe));return q?(Q.p=c.get(q[0].toLowerCase()),pe+q[0].length):-1}function C(Q,he,pe){var q=h.exec(he.slice(pe));return q?(Q.w=g.get(q[0].toLowerCase()),pe+q[0].length):-1}function T(Q,he,pe){var q=f.exec(he.slice(pe));return q?(Q.w=d.get(q[0].toLowerCase()),pe+q[0].length):-1}function D(Q,he,pe){var q=y.exec(he.slice(pe));return q?(Q.m=b.get(q[0].toLowerCase()),pe+q[0].length):-1}function k(Q,he,pe){var q=p.exec(he.slice(pe));return q?(Q.m=m.get(q[0].toLowerCase()),pe+q[0].length):-1}function F(Q,he,pe){return _(Q,t,he,pe)}function A(Q,he,pe){return _(Q,n,he,pe)}function M(Q,he,pe){return _(Q,i,he,pe)}function P(Q){return s[Q.getDay()]}function z(Q){return o[Q.getDay()]}function U(Q){return u[Q.getMonth()]}function te(Q){return a[Q.getMonth()]}function ne(Q){return r[+(Q.getHours()>=12)]}function de(Q){return 1+~~(Q.getMonth()/3)}function Se(Q){return s[Q.getUTCDay()]}function we(Q){return o[Q.getUTCDay()]}function Pe(Q){return u[Q.getUTCMonth()]}function Ri(Q){return a[Q.getUTCMonth()]}function ns(Q){return r[+(Q.getUTCHours()>=12)]}function no(Q){return 1+~~(Q.getUTCMonth()/3)}return{format:function(Q){var he=S(Q+="",v);return he.toString=function(){return Q},he},parse:function(Q){var he=w(Q+="",!1);return he.toString=function(){return Q},he},utcFormat:function(Q){var he=S(Q+="",x);return he.toString=function(){return Q},he},utcParse:function(Q){var he=w(Q+="",!0);return he.toString=function(){return Q},he}}}var OE={"-":"",_:" ",0:"0"},bt=/^\s*\d+/,iI=/^%/,rI=/[\\^$*+?|[\]().{}]/g;function Ae(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 oI(e){return e.replace(rI,"\\$&")}function nl(e){return new RegExp("^(?:"+e.map(oI).join("|")+")","i")}function il(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function sI(e,t,n){var i=bt.exec(t.slice(n,n+1));return i?(e.w=+i[0],n+i[0].length):-1}function aI(e,t,n){var i=bt.exec(t.slice(n,n+1));return i?(e.u=+i[0],n+i[0].length):-1}function uI(e,t,n){var i=bt.exec(t.slice(n,n+2));return i?(e.U=+i[0],n+i[0].length):-1}function lI(e,t,n){var i=bt.exec(t.slice(n,n+2));return i?(e.V=+i[0],n+i[0].length):-1}function cI(e,t,n){var i=bt.exec(t.slice(n,n+2));return i?(e.W=+i[0],n+i[0].length):-1}function DE(e,t,n){var i=bt.exec(t.slice(n,n+4));return i?(e.y=+i[0],n+i[0].length):-1}function RE(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 fI(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 dI(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 hI(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 NE(e,t,n){var i=bt.exec(t.slice(n,n+2));return i?(e.d=+i[0],n+i[0].length):-1}function gI(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 LE(e,t,n){var i=bt.exec(t.slice(n,n+2));return i?(e.H=+i[0],n+i[0].length):-1}function pI(e,t,n){var i=bt.exec(t.slice(n,n+2));return i?(e.M=+i[0],n+i[0].length):-1}function mI(e,t,n){var i=bt.exec(t.slice(n,n+2));return i?(e.S=+i[0],n+i[0].length):-1}function yI(e,t,n){var i=bt.exec(t.slice(n,n+3));return i?(e.L=+i[0],n+i[0].length):-1}function bI(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 vI(e,t,n){var i=iI.exec(t.slice(n,n+1));return i?n+i[0].length:-1}function xI(e,t,n){var i=bt.exec(t.slice(n));return i?(e.Q=+i[0],n+i[0].length):-1}function wI(e,t,n){var i=bt.exec(t.slice(n));return i?(e.s=+i[0],n+i[0].length):-1}function PE(e,t){return Ae(e.getDate(),t,2)}function EI(e,t){return Ae(e.getHours(),t,2)}function SI(e,t){return Ae(e.getHours()%12||12,t,2)}function _I(e,t){return Ae(1+Nr.count(er(e),e),t,3)}function UC(e,t){return Ae(e.getMilliseconds(),t,3)}function $I(e,t){return UC(e,t)+"000"}function AI(e,t){return Ae(e.getMonth()+1,t,2)}function kI(e,t){return Ae(e.getMinutes(),t,2)}function CI(e,t){return Ae(e.getSeconds(),t,2)}function FI(e){var t=e.getDay();return t===0?7:t}function TI(e,t){return Ae(Ou.count(er(e)-1,e),t,2)}function jC(e){var t=e.getDay();return t>=4||t===0?Ya(e):Ya.ceil(e)}function MI(e,t){return e=jC(e),Ae(Ya.count(er(e),e)+(er(e).getDay()===4),t,2)}function OI(e){return e.getDay()}function DI(e,t){return Ae(zd.count(er(e)-1,e),t,2)}function RI(e,t){return Ae(e.getFullYear()%100,t,2)}function NI(e,t){return e=jC(e),Ae(e.getFullYear()%100,t,2)}function LI(e,t){return Ae(e.getFullYear()%1e4,t,4)}function PI(e,t){var n=e.getDay();return e=n>=4||n===0?Ya(e):Ya.ceil(e),Ae(e.getFullYear()%1e4,t,4)}function zI(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+Ae(t/60|0,"0",2)+Ae(t%60,"0",2)}function zE(e,t){return Ae(e.getUTCDate(),t,2)}function II(e,t){return Ae(e.getUTCHours(),t,2)}function BI(e,t){return Ae(e.getUTCHours()%12||12,t,2)}function UI(e,t){return Ae(1+$o.count(tr(e),e),t,3)}function WC(e,t){return Ae(e.getUTCMilliseconds(),t,3)}function jI(e,t){return WC(e,t)+"000"}function WI(e,t){return Ae(e.getUTCMonth()+1,t,2)}function qI(e,t){return Ae(e.getUTCMinutes(),t,2)}function HI(e,t){return Ae(e.getUTCSeconds(),t,2)}function GI(e){var t=e.getUTCDay();return t===0?7:t}function VI(e,t){return Ae(Du.count(tr(e)-1,e),t,2)}function qC(e){var t=e.getUTCDay();return t>=4||t===0?Ka(e):Ka.ceil(e)}function XI(e,t){return e=qC(e),Ae(Ka.count(tr(e),e)+(tr(e).getUTCDay()===4),t,2)}function YI(e){return e.getUTCDay()}function KI(e,t){return Ae(Id.count(tr(e)-1,e),t,2)}function JI(e,t){return Ae(e.getUTCFullYear()%100,t,2)}function QI(e,t){return e=qC(e),Ae(e.getUTCFullYear()%100,t,2)}function ZI(e,t){return Ae(e.getUTCFullYear()%1e4,t,4)}function e6(e,t){var n=e.getUTCDay();return e=n>=4||n===0?Ka(e):Ka.ceil(e),Ae(e.getUTCFullYear()%1e4,t,4)}function t6(){return"+0000"}function IE(){return"%"}function BE(e){return+e}function UE(e){return Math.floor(+e/1e3)}var ma,gb,HC,pb,GC;n6({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 n6(e){return ma=BC(e),gb=ma.format,HC=ma.parse,pb=ma.utcFormat,GC=ma.utcParse,ma}function Fl(e){const t={};return n=>t[n]||(t[n]=e(n))}function i6(e,t){return n=>{const i=e(n),r=i.indexOf(t);if(r<0)return i;let o=r6(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 r6(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 VC(e){const t=Fl(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 i6(t(r),t(".1f")(1)[1])}else return t(r)},formatSpan(i,r,o,s){s=z0(s??",f");const a=Ds(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=vP(a,u))||(s.precision=l),n(s,u);case"":case"e":case"g":case"p":case"r":{isNaN(l=bP(a,u))||(s.precision=l-(s.type==="e"));break}case"f":case"%":{isNaN(l=yP(a))||(s.precision=l-(s.type==="%")*2);break}}return t(s)}}}let X0;XC();function XC(){return X0=VC({format:Lk,formatPrefix:AP})}function YC(e){return VC($P(e))}function Bd(e){return arguments.length?X0=YC(e):X0}function jE(e,t,n){n=n||{},X(n)||N(`Invalid time multi-format specifier: ${n}`);const i=t(Qn),r=t(zn),o=t(Pn),s=t(vn),a=t(st),u=t(Wt),l=t(bn),c=t(Ct),f=e(n[xi]||".%L"),d=e(n[Qn]||":%S"),h=e(n[zn]||"%I:%M"),g=e(n[Pn]||"%I %p"),p=e(n[vn]||n[zt]||"%a %d"),m=e(n[st]||"%b %d"),y=e(n[Wt]||"%B"),b=e(n[bn]||"%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 KC(e){const t=Fl(e.format),n=Fl(e.utcFormat);return{timeFormat:i=>K(i)?t(i):jE(t,Ru,i),utcFormat:i=>K(i)?n(i):jE(n,Nu,i),timeParse:Fl(e.parse),utcParse:Fl(e.utcParse)}}let Y0;JC();function JC(){return Y0=KC({format:gb,parse:HC,utcFormat:pb,utcParse:GC})}function QC(e){return KC(BC(e))}function sc(e){return arguments.length?Y0=QC(e):Y0}const K0=(e,t)=>ce({},e,t);function ZC(e,t){const n=e?YC(e):Bd(),i=t?QC(t):sc();return K0(n,i)}function mb(e,t){const n=arguments.length;return n&&n!==2&&N("defaultLocale expects either zero or two arguments."),n?K0(Bd(e),sc(t)):K0(Bd(),sc())}function o6(){return XC(),JC(),mb()}const s6=/^(data:|([A-Za-z]+:)?\/\/)/,a6=/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp|file|data):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i,u6=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205f\u3000]/g,WE="file://";function l6(e,t){return n=>({options:n||{},sanitize:f6,load:c6,fileAccess:!1,file:d6(t),http:g6(e)})}async function c6(e,t){const n=await this.sanitize(e,t),i=n.href;return n.localFile?this.file(i):this.http(i,t)}async function f6(e,t){t=ce({},this.options,t);const n=this.fileAccess,i={href:null};let r,o,s;const a=a6.test(e.replace(u6,""));(e==null||typeof e!="string"||!a)&&N("Sanitize failure, invalid URI: "+H(e));const u=s6.test(e);return(s=t.baseURL)&&!u&&(!e.startsWith("/")&&!s.endsWith("/")&&(e="/"+e),e=s+e),o=(r=e.startsWith(WE))||t.mode==="file"||t.mode!=="http"&&!u&&n,r?e=e.slice(WE.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 d6(e){return e?t=>new Promise((n,i)=>{e.readFile(t,(r,o)=>{r?i(r):n(o)})}):h6}async function h6(){N("No file system access.")}function g6(e){return e?async function(t,n){const i=ce({},this.options.http,n),r=n&&n.response,o=await e(t,i);return o.ok?fe(o[r])?o[r]():o.text():N(o.status+""+o.statusText)}:p6}async function p6(){N("No HTTP fetch method available.")}const m6=e=>e!=null&&e===e,y6=e=>e==="true"||e==="false"||e===!0||e===!1,b6=e=>!Number.isNaN(Date.parse(e)),eF=e=>!Number.isNaN(+e)&&!(e instanceof Date),v6=e=>eF(e)&&Number.isInteger(+e),J0={boolean:ab,integer:Bt,number:Bt,date:ub,string:lb,unknown:Gt},$f=[y6,v6,eF,b6],x6=["boolean","integer","number","date"];function tF(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]&&m6(u)&&!$f[a](u)&&(r[a]=0,++s,s===$f.length))return"string";return x6[r.reduce((o,s)=>o===0?s:o,0)-1]}function nF(e,t){return t.reduce((n,i)=>(n[i]=tF(e,i),n),{})}function qE(e){const t=function(n,i){const r={delimiter:e};return yb(n,i?ce(i,r):r)};return t.responseType="text",t}function yb(e,t){return t.header&&(e=t.header.map(H).join(t.delimiter)+`
|
6
|
-
`+e),gz(t.delimiter).parse(e+"")}yb.responseType="text";function w6(e){return typeof Buffer=="function"&&fe(Buffer.isBuffer)?Buffer.isBuffer(e):!1}function bb(e,t){const n=t&&t.property?Jn(t.property):Gt;return X(e)&&!w6(e)?E6(n(e),t):n(JSON.parse(e))}bb.responseType="json";function E6(e,t){return!L(e)&&tC(e)&&(e=[...e]),t&&t.copy?JSON.parse(JSON.stringify(e)):e}const S6={interior:(e,t)=>e!==t,exterior:(e,t)=>e===t};function iF(e,t){let n,i,r,o;return e=bb(e,t),t&&t.feature?(n=bz,r=t.feature):t&&t.mesh?(n=xz,r=t.mesh,o=S6[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]}iF.responseType="json";const ld={dsv:yb,csv:qE(","),tsv:qE(" "),json:bb,topojson:iF};function vb(e,t){return arguments.length>1?(ld[e]=t,this):J(ld,e)?ld[e]:null}function rF(e){const t=vb(e);return t&&t.responseType||"text"}function oF(e,t,n,i){t=t||{};const r=vb(t.type||"json");return r||N("Unknown data format type: "+t.type),e=r(e,t),t.parse&&_6(e,t.parse,n,i),J(e,"columns")&&delete e.columns,e}function _6(e,t,n,i){if(!e.length)return;const r=sc();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=nF(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(!J0[g])throw Error("Illegal format pattern: "+h+":"+g);return J0[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=l6(typeof fetch<"u"&&fetch,null);function wg(e){const t=e||Gt,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 sF=Symbol("vega_id");let $6=1;function Eg(e){return!!(e&&re(e))}function re(e){return e[sF]}function aF(e,t){return e[sF]=t,e}function Ce(e){const t=e===Object(e)?e:{data:e};return re(t)?t:aF(t,$6++)}function xb(e){return Sg(e,Ce({}))}function Sg(e,t){for(const n in e)t[n]=e[n];return t}function uF(e,t){return aF(t,re(e))}function ea(e,t){return e?t?(n,i)=>e(n,i)||re(t(n))-re(t(i)):(n,i)=>e(n,i)||re(n)-re(i):null}function lF(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=Y(a),l=u.length;for(let c=0;c<l;++c)e.push(u[c]);return this},remove(a){const u=fe(a)?i:t,l=Y(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:Vt(l)};return fe(a)?(c.filter=a,r.push(c)):(c.tuple=a,n.push(c)),this},encode(a,u){return fe(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[re(u[f])]=1;for(f=0,d=t.length;f<d;++f)p=t[f],l[re(p)]=-1;for(f=0,d=i.length;f<d;++f)g=i[f],u.forEach(b=>{g(b)&&(l[re(b)]=-1)});for(f=0,d=e.length;f<d;++f)p=e[f],m=re(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[re(p)]<0&&a.rem.push(p);function y(b,v,x){x?b[v]=x(b):a.encode=v,s||(c[re(b)]=b)}for(f=0,d=n.length;f<d;++f)h=n[f],p=h.tuple,g=h.field,m=l[re(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[re(b)]>0&&y(b,h.field,h.value)}),a.modifies(h.field);if(s)a.mod=t.length||i.length?u.filter(b=>l[re(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]=L(n)?1+n.length:-1),r},modified(e,t){const n=this[fd];if(arguments.length){if(L(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 A6=0;const k6="pulse",C6=new _g,F6=1,T6=2;function ze(e,t,n,i){this.id=++A6,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 HE(e){return function(t){const n=this.flags;return arguments.length===0?!!(n&e):(this.flags=t?n|e:n&~e,this)}}ze.prototype={targets(){return this._targets||(this._targets=wg(Dc))},set(e){return this.value!==e?(this.value=e,1):0},skip:HE(F6),modified:HE(T6),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 ze?(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===k6)Y(a).forEach(f=>{f instanceof ze?f!==this&&(f.targets().add(this),o.push(f)):N("Pulse parameters must be operator instances.")}),this.source=a;else if(L(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||C6,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 M6(e,t,n,i){let r=1,o;return e instanceof ze?o=e:e&&e.prototype instanceof ze?o=new e:fe(e)?o=new ze(null,e):(r=0,o=new ze(e,t)),this.rank(o),r&&(i=n,n=t),n&&this.connect(o,o.parameters(n,i)),this.touch(o),o}function O6(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 D6=0;function $g(e,t,n){this.id=++D6,this.value=null,n&&(this.receive=n),e&&(this._filter=e),t&&(this._apply=t)}function oo(e,t,n){return new $g(e,t,n)}$g.prototype={_filter:Ln,_apply:Gt,targets(){return this._targets||(this._targets=wg(Dc))},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=oo(e);return this.targets().add(t),t},apply(e){const t=oo(null,e);return this.targets().add(t),t},merge(){const e=oo();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=oo();return this.targets().add(oo(null,null,ob(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(oo(null,null,()=>n=!0)),t.targets().add(oo(null,null,()=>n=!1)),this.filter(()=>n)},detach(){this._filter=Ln,this._targets=null}};function R6(e,t,n,i){const r=this,o=oo(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=Y(e);const u=a.length;for(let l=0;l<u;++l)a[l].addEventListener(t,s);return o}function N6(e,t){const n=this.locale();return oF(e,t,n.timeParse,n.utcParse)}function L6(e,t,n){return t=this.parse(t,n),this.pulse(e,this.changeset().insert(t))}async function P6(e,t){const n=this;let i=0,r;try{r=await n.loader().load(e,{context:"dataflow",response:rF(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 z6(e,t,n){const i=this,r=i._pending||I6(i);r.requests+=1;const o=await i.request(t,n);return i.pulse(e,i.changeset().remove(Ln).insert(o.data||[])),r.done(),o}function I6(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 B6={skip:!0};function U6(e,t,n,i,r){return(e instanceof ze?W6:j6)(this,e,t,n,i,r),this}function j6(e,t,n,i,r,o){const s=ce({},o,B6);let a,u;fe(n)||(n=Vt(n)),i===void 0?a=l=>e.touch(n(l)):fe(i)?(u=new ze(null,i,r,!1),a=l=>{u.evaluate(l);const c=n(l),f=u.value;lF(f)?e.pulse(c,f,o):e.update(c,f,s)}):a=l=>e.update(n(l),i,s),t.apply(a)}function W6(e,t,n,i,r,o){if(i===void 0)t.targets().add(n);else{const s=o||{},a=new ze(null,q6(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 q6(e,t){return t=fe(t)?t:Vt(t),e?function(n,i){const r=t(n,i);return e.skip()||(e.skip(r!==this.value).value=r),r}:t}function H6(e){e.rank=++this._rank}function G6(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={},Ui=1,uo=2,_r=4,V6=Ui|uo,GE=Ui|_r,ya=Ui|uo|_r,VE=8,rl=16,XE=32,YE=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 ao(e,t,i=>n.push(i)),n}function KE(e,t){const n={};return e.visit(t,i=>{n[re(i)]=1}),i=>n[re(i)]?null:i}function Af(e,t){return e?(n,i)=>e(n,i)&&t(n,i):t}Ao.prototype={StopPropagation:Ud,ADD:Ui,REM:uo,MOD:_r,ADD_REM:V6,ADD_MOD:GE,ALL:ya,REFLOW:VE,SOURCE:rl,NO_SOURCE:XE,NO_FIELDS:YE,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&YE)&&(n.fields=e.fields),t&Ui?(n.addF=e.addF,n.add=e.add):(n.addF=null,n.add=[]),t&uo?(n.remF=e.remF,n.rem=e.rem):(n.remF=null,n.rem=[]),t&_r?(n.modF=e.modF,n.mod=e.mod):(n.modF=null,n.mod=[]),t&XE?(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&Ui&&this.add.length||t&uo&&this.rem.length||t&_r&&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(_r,KE(this,Ui))),this},clean(e){return arguments.length?(this.cleans=!!e,this):this.cleans},modifies(e){const t=this.fields||(this.fields={});return L(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?L(e)?e.some(i=>n[i]):n[e]:!!n:!1},filter(e,t){const n=this;return e&Ui&&(n.addF=Af(n.addF,t)),e&uo&&(n.remF=Af(n.remF,t)),e&_r&&(n.modF=Af(n.modF,t)),e&rl&&(n.srcF=Af(n.srcF,t)),n},materialize(e){e=e||ya;const t=this;return e&Ui&&t.addF&&(t.add=Em(t.add,t.addF),t.addF=null),e&uo&&t.remF&&(t.rem=Em(t.rem,t.remF),t.remF=null),e&_r&&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 ao(n.source,n.srcF,i),n;e&Ui&&ao(n.add,n.addF,i),e&uo&&ao(n.rem,n.remF,i),e&_r&&ao(n.mod,n.modF,i);const r=n.source;if(e&VE&&r){const o=n.add.length+n.mod.length;o===r.length||(o?ao(r,KE(n,GE),i):ao(r,n.srcF,i))}return n}};function wb(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(wb,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?L(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 X6(e,t,n){const i=this,r=[];if(i._pulse)return cF(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(Dc);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 Y6(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 K6(e,t,n){return this._pulse?cF(this):(this.evaluate(e,t,n),this)}function J6(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 cF(e){return e.error("Dataflow already running. Use runAsync() to chain invocations."),e}function Q6(e,t){const n=e.stamp<this._clock;n&&(e.stamp=this._clock),(n||t)&&(e.qrank=e.rank,this._heap.push(e))}function Z6(e,t){const n=e.source,i=this._clock;return n&&L(n)?new wb(this,i,n.map(r=>r.pulse),t):this._input[e.id]||e4(this._pulse,n&&n.pulse)}function e4(e,t){return t&&t.stamp===e.stamp?t:(e=e.fork(),t&&t!==Ud&&(e.source=t.source),e)}const Eb={skip:!1,force:!1};function t4(e,t){const n=t||Eb;return this._pulse?this._enqueue(e):this._touched.add(e),n.skip&&e.skip(!0),this}function n4(e,t,n){const i=n||Eb;return(e.set(t)||i.force)&&this.touch(e,i),this}function i4(e,t,n){this.touch(e,n||Eb);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 r4(e){let t=[];return{clear:()=>t=[],size:()=>t.length,peek:()=>t[0],push:n=>(t.push(n),fF(t,0,t.length-1,e)),pop:()=>{const n=t.pop();let i;return t.length?(i=t[0],t[0]=n,o4(t,0,e)):i=n,i}}}function fF(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 o4(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,fF(e,i,t,n)}function za(){this.logger(eb()),this.logLevel(Qy),this._clock=0,this._rank=0,this._locale=mb();try{this._loader=xg()}catch{}this._touched=wg(Dc),this._input={},this._pulse=null,this._heap=r4((e,t)=>e.qrank-t.qrank),this._postrun=[]}function ol(e){return function(){return this._log[e].apply(this,arguments)}}za.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:M6,connect:O6,rank:H6,rerank:G6,pulse:i4,touch:t4,update:n4,changeset:ta,ingest:L6,parse:N6,preload:z6,request:P6,events:R6,on:U6,evaluate:X6,run:K6,runAsync:Y6,runAfter:J6,_enqueue:Q6,_getPulse:Z6};function O(e,t){ze.call(this,e,null,t)}G(O,ze,{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 Qa={};function dF(e){const t=hF(e);return t&&t.Definition||null}function hF(e){return e=e&&e.toLowerCase(),J(Qa,e)?Qa[e]:null}function*gF(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 Sb(e,t,n){const i=Float64Array.from(gF(e,n));return i.sort(ic),t.map(r=>pC(i,r))}function _b(e,t){return Sb(e,[.25,.5,.75],t)}function $b(e,t){const n=e.length,i=_z(e,t),r=_b(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 pF(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 Zn=Math.random;function s4(e){Zn=e}function mF(e,t,n,i){if(!e.length)return[void 0,void 0];const r=Float64Array.from(gF(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[~~(Zn()*o)];c[l]=a/o}return c.sort(ic),[j0(c,n/2),j0(c,1-n/2)]}function yF(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?a4(o,t+t/4):o}function a4(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 u4(e){return function(){return e=(1103515245*e+12345)%2147483647,e/2147483647}}function l4(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*Zn())},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 bF=Math.sqrt(2*Math.PI),c4=Math.SQRT2;let sl=NaN;function Ag(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=Zn()*2-1,i=Zn()*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 Ab(e,t,n){n=n??1;const i=(e-(t||0))/n;return Math.exp(-.5*i*i)/(n*bF)}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)*c4*f4(2*e-1)}function f4(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 kb(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:()=>Ag(n,i),pdf:o=>Ab(o,n,i),cdf:o=>kg(o,n,i),icdf:o=>Cg(o,n,i)};return r.mean(e).stdev(t)}function Cb(e,t){const n=kb();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=$b(e)),r):t},sample(){return e[~~(Zn()*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 Fb(e,t){return e=e||0,t=t??1,Math.exp(e+Ag()*t)}function Tb(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*bF*e)}function Mb(e,t,n){return kg(Math.log(e),t,n)}function Ob(e,t,n){return Math.exp(Cg(e,t,n))}function vF(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:()=>Fb(n,i),pdf:o=>Tb(o,n,i),cdf:o=>Mb(o,n,i),icdf:o=>Ob(o,n,i)};return r.mean(e).stdev(t)}function xF(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=Zn();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 Db(e,t){return t==null&&(t=e??1,e=0),e+(t-e)*Zn()}function Rb(e,t,n){return n==null&&(n=t??1,t=0),e>=t&&e<=n?1/(n-t):0}function Nb(e,t,n){return n==null&&(n=t??1,t=0),e<t?0:e>n?1:(e-t)/(n-t)}function Lb(e,t,n){return n==null&&(n=t??1,t=0),e>=0&&e<=1?t+e*(n-t):NaN}function wF(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:()=>Db(n,i),pdf:o=>Rb(o,n,i),cdf:o=>Nb(o,n,i),icdf:o=>Lb(o,n,i)};return t==null&&(t=e??1,e=0),r.min(e).max(t)}function Pb(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 Nc(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 Lc(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 Lu(e,t,n,i,r){let o=0,s=0;return Lc(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;Lc(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=Nc(i,r,o,s),l=c=>u[0]+u[1]*c;return{coef:u,predict:l,rSquared:Lu(e,t,n,r,l)}}function EF(e,t,n){let i=0,r=0,o=0,s=0,a=0;Lc(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=Nc(i,r,o,s),l=c=>u[0]+u[1]*Math.log(c);return{coef:u,predict:l,rSquared:Lu(e,t,n,r,l)}}function SF(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;Lc(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]=Nc(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:Lu(e,t,n,s,y)}}function _F(e,t,n){let i=0,r=0,o=0,s=0,a=0,u=0;Lc(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=Nc(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:Lu(e,t,n,a,c)}}function Ib(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:Lu(e,t,n,s,S)}}function $F(e,t,n,i){if(i===0)return Pb(e,t,n);if(i===1)return zb(e,t,n);if(i===2)return Ib(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=h4(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:d4(f,y,-s,a),predict:b,rSquared:Lu(e,t,n,a,b)}}function d4(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 h4(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 JE=2,QE=1e-12;function AF(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<=JE;){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,$=0;const C=1/Math.abs(r[x]-y||1);for(let k=b;k<=v;++k){const F=r[k],A=o[k],M=g4(Math.abs(y-F)*C)*d[k],P=F*M;E+=M,S+=P,w+=A*M,_+=A*P,$+=F*P}const[T,D]=Nc(S/E,w/E,_/E,$/E);c[m]=T+D*y,f[m]=Math.abs(o[m]-c[m]),p4(r,m+1,g)}if(h===JE)break;const p=mC(f);if(Math.abs(p)<QE)break;for(let m=0,y,b;m<u;++m)y=f[m]/(6*p),d[m]=y>=1?QE:(b=1-y*y)*b}return m4(r,c,s,a)}function g4(e){return(e=1-e*e*e)*e*e}function p4(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 m4(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 y4=.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=b4(f[1],c);for(;d;){const p=r((f[0]+d[0])/2);p[0]-f[0]>=u&&v4(f,p,d,h,g)>y4?c.push(p):(f=d,l.push(d),c.pop()),d=c[c.length-1]}return l}function b4(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 v4(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 x4(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 Q0(e){return!e||!e.length?function(){return""}:e.length===1?e[0]:x4(e)}function kF(e,t,n){return n||e+(t?"_"+t:"")}const Sm=()=>{},w4={init:Sm,add:Sm,rem:Sm,idx:0},ac={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}},Pc=Object.keys(ac).filter(e=>e!=="__count__");function E4(e,t){return(n,i)=>ce({name:e,aggregate_param:i,out:n||e},w4,t)}[...Pc,"__count__"].forEach(e=>{ac[e]=E4(e,ac[e])});function CF(e,t,n){return ac[e](n,t)}function FF(e,t){return e.idx-t.idx}function S4(e){const t={};e.forEach(i=>t[i.name]=i);const n=i=>{i.req&&i.req.forEach(r=>{t[r]||n(t[r]=ac[r]())})};return e.forEach(n),Object.values(t).sort(FF)}function _4(){this.valid=0,this.missing=0,this._ops.forEach(e=>e.aggregate_param==null?e.init(this):e.init(this,e.aggregate_param))}function $4(e,t){if(e==null||e===""){++this.missing;return}e===e&&(++this.valid,this._ops.forEach(n=>n.add(this,e,t)))}function A4(e,t){if(e==null||e===""){--this.missing;return}e===e&&(--this.valid,this._ops.forEach(n=>n.rem(this,e,t)))}function k4(e){return this._out.forEach(t=>e[t.out]=t.value(this)),e}function TF(e,t){const n=t||Gt,i=S4(e),r=e.slice().sort(FF);function o(s){this._ops=i,this._out=r,this.cell=s,this.init()}return o.prototype.init=_4,o.prototype.add=$4,o.prototype.rem=A4,o.prototype.set=k4,o.prototype.get=n,o.fields=e.map(s=>s.out),o}function Bb(e){this._key=e?Jn(e):re,this.reset()}const Mt=Bb.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=Zk(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=_b(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=mF(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 To(e){O.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}To.Definition={type:"Aggregate",metadata:{generates:!0,changes:!0},params:[{name:"groupby",type:"field",array:!0},{name:"ops",type:"enum",array:!0,values:Pc},{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(To,O,{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=Y(jt(b)),x=v.length;let E=0,S;for(;E<x;++E)i[S=v[E]]||(i[S]=1,t.push(S))}this._dims=Y(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:Q0(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=kF(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(CF(d,h,m))}return this._measures=this._measures.map(b=>TF(b,b.field)),Object.create(null)},cellkey:Q0(),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 Bb),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?uF(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 C4=1e-14;function Ub(e){O.call(this,null,e)}Ub.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(Ub,O,{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(jt(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=pF(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=Bt(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(C4+(c-r)/i))};return u.start=r,u.stop=n.stop,u.step=i,this.value=_n(u,jt(t),e.name||"bin_"+Je(t))}});function MF(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?oC(u,r,o.sort(u)):r.concat(o),o=[]),r)}}function jb(e){O.call(this,[],e)}jb.Definition={type:"Collect",metadata:{source:!0},params:[{name:"sort",type:"compare"}]};G(jb,O,{transform(e,t){const n=t.fork(t.ALL),i=MF(re,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 OF(e){ze.call(this,null,F4,e)}G(OF,ze);function F4(e){return this.value&&!e.modified()?this.value:rb(e.fields,e.orders)}function Wb(e){O.call(this,null,e)}Wb.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 T4(e,t,n){switch(t){case"upper":e=e.toUpperCase();break;case"lower":e=e.toLowerCase();break}return e.match(n)}G(Wb,O,{transform(e,t){const n=f=>d=>{for(var h=T4(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 qb(e){O.call(this,null,e)}qb.Definition={type:"Cross",metadata:{generates:!0},params:[{name:"filter",type:"expr"},{name:"as",type:"string",array:!0,length:2,default:["a","b"]}]};G(qb,O,{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=M4(a,r,o,e.filter||Ln)):n.mod=a,n.source=this.value,n.modifies(i)}});function M4(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 ZE={kde:Cb,mixture:xF,normal:kb,lognormal:vF,uniform:wF},O4="distributions",eS="function",D4="field";function DF(e,t){const n=e[eS];J(ZE,n)||N("Unknown distribution function: "+n);const i=ZE[n]();for(const r in e)r===D4?i.data((e.from||t()).map(e[r])):r===O4?i[r](e[r].map(o=>DF(o,t))):typeof i[r]===eS&&i[r](e[r]);return i}function Hb(e){O.call(this,null,e)}const RF=[{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}]}],R4={key:{function:"mixture"},params:[{name:"distributions",type:"param",array:!0,params:RF},{name:"weights",type:"number",array:!0}]};Hb.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:RF.concat(R4)},{name:"as",type:"string",array:!0,default:["value","density"]}]};G(Hb,O,{transform(e,t){const n=t.fork(t.NO_SOURCE|t.NO_FIELDS);if(!this.value||t.changed()||e.modified()){const i=DF(e.distribution,N4(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||Zi(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 N4(e){return()=>e.materialize(e.SOURCE).source}function NF(e,t){return e?e.map((n,i)=>t[i]||Je(n)):null}function Gb(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 LF="bin";function Vb(e){O.call(this,null,e)}Vb.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:LF}]};const L4=(e,t)=>Rc(Zi(e,t))/30;G(Vb,O,{transform(e,t){if(this.value&&!(e.modified()||t.changed()))return t;const n=t.materialize(t.SOURCE).source,i=Gb(t.source,e.groupby,Gt),r=e.smooth||!1,o=e.field,s=e.step||L4(n,o),a=ea((g,p)=>o(g)-o(p)),u=e.as||LF,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 yF(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 PF(e){ze.call(this,null,P4,e),this.modified(!0)}G(PF,ze);function P4(e){const t=e.expr;return this.value&&!e.modified("expr")?this.value:_n(n=>t(n,e),jt(t),Je(t))}function Xb(e){O.call(this,[void 0,void 0],e)}Xb.Definition={type:"Extent",metadata:{},params:[{name:"field",type:"field",required:!0}]};G(Xb,O,{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=Bt(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 Yb(e,t){ze.call(this,e),this.parent=t,this.count=0}G(Yb,ze,{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){O.call(this,{},e),this._keys=Mu();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,O,{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 Yb(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=re(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(re(u),l),a(l).add(u)}),s||t.modified(i.fields)?t.visit(t.MOD,u=>{const l=re(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(re(u))).mod(u)}),s&&t.visit(t.REFLOW,u=>{const l=re(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 zF(e){ze.call(this,null,z4,e)}G(zF,ze);function z4(e){return this.value&&!e.modified()?this.value:L(e.name)?Y(e.name).map(t=>Jn(t)):Jn(e.name,e.as)}function Kb(e){O.call(this,Mu(),e)}Kb.Definition={type:"Filter",metadata:{changes:!0},params:[{name:"expr",type:"expr",required:!0}]};G(Kb,O,{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=re(f);i.has(d)?i.delete(d):s.push(f)}),t.visit(t.ADD,f=>{u(f,e)?o.push(f):i.set(re(f),1)});function c(f){const d=re(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 Jb(e){O.call(this,[],e)}Jb.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(Jb,O,{transform(e,t){const n=t.fork(t.NO_SOURCE),i=e.fields,r=NF(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=xb(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 Qb(e){O.call(this,[],e)}Qb.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(Qb,O,{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=xb(l),f[s]=r[c],f[a]=i[c](l),n.add.push(f)}),this.value=n.source=n.add,n.modifies(o)}});function Zb(e){O.call(this,null,e)}Zb.Definition={type:"Formula",metadata:{modifies:!0},params:[{name:"expr",type:"expr",required:!0},{name:"as",type:"string",required:!0},{name:"initonly",type:"boolean"}]};G(Zb,O,{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 IF(e){O.call(this,[],e)}G(IF,O,{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 kf={value:"value",median:mC,mean:kz,min:U0,max:_s},I4=[];function ev(e){O.call(this,[],e)}ev.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 B4(e){var t=e.method||kf.value,n;if(kf[t]==null)N("Unrecognized imputation method: "+t);else return t===kf.value?(n=e.value!==void 0?e.value:0,()=>n):kf[t]}function U4(e){const t=e.field;return n=>n?t(n):NaN}G(ev,O,{transform(e,t){var n=t.fork(t.ALL),i=B4(e),r=U4(e),o=Je(e.field),s=Je(e.key),a=(e.groupby||[]).map(Je),u=j4(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 j4(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):I4)+"",(f=u[c])||(f=u[c]=[],o.push(f),f.values=l),f[h-1]=m;return o.domain=s,o}function tv(e){To.call(this,e)}tv.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:Pc},{name:"as",type:"string",null:!0,array:!0},{name:"key",type:"field"}]};G(tv,To,{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=>{ce(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 nv(e){O.call(this,null,e)}nv.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(nv,O,{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=Gb(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=Zi(i,e.field)),f=d=e.steps||d),r.forEach(h=>{const g=Cb(h,s)[a],p=e.counts?h.length:1,m=c||Zi(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 BF(e){ze.call(this,null,W4,e)}G(BF,ze);function W4(e){return this.value&&!e.modified()?this.value:sb(e.fields,e.flat)}function UF(e){O.call(this,[],e),this._pending=null}G(UF,O,{transform(e,t){const n=t.dataflow;return this._pending?_m(this,t,this._pending):q4(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=Y(r.data),o=>o.touch(this)))}:n.request(e.url,e.format).then(i=>_m(this,t,Y(i.data)))}});function q4(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 iv(e){O.call(this,{},e)}iv.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(iv,O,{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 jF(e){ze.call(this,null,H4,e)}G(jF,ze);function H4(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 WF(e){ze.call(this,null,G4,e)}G(WF,ze);function G4(e){return this.value&&!e.modified()?this.value:e.values.reduce((t,n)=>t.concat(n),[])}function qF(e){O.call(this,null,e)}G(qF,O,{transform(e,t){return this.modified(e.modified()),this.value=e,t.fork(t.NO_SOURCE|t.NO_FIELDS)}});function rv(e){To.call(this,e)}rv.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:Pc,default:"sum"},{name:"limit",type:"number",default:0},{name:"key",type:"field"}]};G(rv,To,{_transform:To.prototype.transform,transform(e,t){return this._transform(V4(e,t),t)}});function V4(e,t){const n=e.field,i=e.value,r=(e.op==="count"?"__count__":e.op)||"sum",o=jt(n).concat(jt(i)),s=Y4(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=>X4(a,n,i,o)),as:s.map(a=>a+""),modified:e.modified.bind(e)}}function X4(e,t,n,i){return _n(r=>t(r)===e?n(r):NaN,i,e+"")}function Y4(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 HF(e){Mg.call(this,e)}G(HF,Mg,{transform(e,t){const n=e.subflow,i=e.field,r=o=>this.subflow(re(o),n,t,o);return(e.modified("field")||i&&t.modified(jt(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 ov(e){O.call(this,null,e)}ov.Definition={type:"Project",metadata:{generates:!0,changes:!0},params:[{name:"fields",type:"field",array:!0},{name:"as",type:"string",null:!0,array:!0}]};G(ov,O,{transform(e,t){const n=t.fork(t.NO_SOURCE),i=e.fields,r=NF(e.fields,e.as||[]),o=i?(a,u)=>K4(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=re(a);n.rem.push(s[u]),s[u]=null}),t.visit(t.ADD,a=>{const u=o(a,Ce({}));s[re(a)]=u,n.add.push(u)}),t.visit(t.MOD,a=>{n.mod.push(o(a,s[re(a)]))}),n}});function K4(e,t,n,i){for(let r=0,o=n.length;r<o;++r)t[i[r]]=n[r](e);return t}function GF(e){O.call(this,null,e)}G(GF,O,{transform(e,t){return this.value=e.value,e.modified("value")?t.fork(t.NO_SOURCE|t.NO_FIELDS):t.StopPropagation}});function sv(e){O.call(this,null,e)}sv.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 J4=1e-14;G(sv,O,{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=Gb(r,e.groupby,e.field),s=(e.groupby||[]).map(Je),a=[],u=e.step||.01,l=e.probs||Tn(u/2,1-J4,u),c=l.length;return o.forEach(f=>{const d=Sb(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 VF(e){O.call(this,null,e)}G(VF,O,{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=re(r);n.rem.push(i[o]),i[o]=null}),t.visit(t.ADD,r=>{const o=xb(r);i[re(r)]=o,n.add.push(o)}),t.visit(t.MOD,r=>{const o=i[re(r)];for(const s in r)o[s]=r[s],n.modifies(s);n.mod.push(o)})),n}});function av(e){O.call(this,[],e),this.count=0}av.Definition={type:"Sample",metadata:{},params:[{name:"size",type:"number",default:1e3}]};G(av,O,{transform(e,t){const n=t.fork(t.NO_SOURCE),i=e.modified("size"),r=e.size,o=this.value.reduce((c,f)=>(c[re(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)*Zn()),d<s.length&&d>=u&&(f=s[d],o[re(f)]&&n.rem.push(f),s[d]=c)),++a}if(t.rem.length&&(t.visit(t.REM,c=>{const f=re(c);o[f]&&(o[f]=-1,n.rem.push(c)),--a}),s=s.filter(c=>o[re(c)]!==-1)),(t.rem.length||i)&&s.length<r&&t.source&&(u=a=s.length,t.visit(t.SOURCE,c=>{o[re(c)]||l(c)}),u=-1),i&&s.length>r){const c=s.length-r;for(let f=0;f<c;++f)o[re(s[f])]=-1,n.rem.push(s[f]);s=s.slice(c)}return t.mod.length&&t.visit(t.MOD,c=>{o[re(c)]&&n.mod.push(c)}),t.add.length&&t.visit(t.ADD,l),(t.add.length||u<0)&&(n.add=s.filter(c=>!o[re(c)])),this.count=a,this.value=n.source=s,n}});function uv(e){O.call(this,null,e)}uv.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(uv,O,{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=Tn(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 XF(e){O.call(this,null,e),this.modified(!0)}G(XF,O,{transform(e,t){return this.value=t.source,t.changed()?t.fork(t.NO_SOURCE|t.NO_FIELDS):t.StopPropagation}});function lv(e){O.call(this,null,e)}const YF=["unit0","unit1"];lv.Definition={type:"TimeUnit",metadata:{modifies:!0},params:[{name:"field",type:"field",required:!0},{name:"interval",type:"boolean",default:!0},{name:"units",type:"enum",values:fb,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:YF}]};G(lv,O,{transform(e,t){const n=e.field,i=e.interval!==!1,r=e.timezone==="utc",o=this._floor(e,t),s=(r?Nu:Ru)(o.unit).offset,a=e.as||YF,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(jt(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}:IC({extent:e.extent||Zi(t.materialize(t.SOURCE).source,e.field),maxbins:e.maxbins}),o=db(i),s=this.value||{},a=(n?TC:FC)(o,r);return a.unit=xe(o),a.units=o,a.step=r,a.start=s.start,a.stop=s.stop,this.value=a}});function KF(e){O.call(this,Mu(),e)}G(KF,O,{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 JF(e){O.call(this,null,e)}G(JF,O,{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 Q4(e,t,n,i){const r=uc[e](t,n);return{init:r.init||ho,update:function(o,s){s[i]=r.next(o)}}}const uc={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=uc.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=uc.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=Z4(e,r,i.index))<0?(n=r.length,t=null):t=e(r[n])}}}};function Z4(e,t,n){for(let i=t.length;n<i;++n)if(e(t[n])!=null)return n;return-1}const e9=Object.keys(uc);function QF(e){const t=Y(e.ops),n=Y(e.fields),i=Y(e.params),r=Y(e.aggregate_params),o=Y(e.as),s=this.outputs=[],a=this.windows=[],u={},l={},c=[],f=[];let d=!0;function h(g){Y(jt(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=kF(g,v,o[p]);if(h(m),s.push(x),J(uc,g))a.push(Q4(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(CF(g,b,x))}}),(c.length||f.length)&&(this.cell=t9(f,c,d)),this.inputs=Object.keys(u)}const ZF=QF.prototype;ZF.init=function(){this.windows.forEach(e=>e.init()),this.cell&&this.cell.init()};ZF.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 t9(e,t,n){e=e.map(u=>TF(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 Bb;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 cv(e){O.call(this,{},e),this._mlen=0,this._mods=[]}cv.Definition={type:"Window",metadata:{modifies:!0},params:[{name:"sort",type:"compare"},{name:"groupby",type:"field",array:!0},{name:"ops",type:"enum",array:!0,values:e9.concat(Pc)},{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(cv,O,{transform(e,t){this.stamp=t.stamp;const n=e.modified(),i=ea(e.sort),r=Q0(e.groupby),o=a=>this.group(r(a));let s=this.state;(!s||n)&&(s=this.state=new QF(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)n9(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]=MF(re),t.stamp=-1),t.stamp<this.stamp&&(t.stamp=this.stamp,this._mods[this._mlen++]=t),t}});function n9(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||Vt(-1)};t.init();for(let f=0;f<u;++f)i9(c,s,f,u),o&&r9(c,l),t.update(c,a[f])}function i9(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 r9(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 o9=Object.freeze(Object.defineProperty({__proto__:null,aggregate:To,bin:Ub,collect:jb,compare:OF,countpattern:Wb,cross:qb,density:Hb,dotbin:Vb,expression:PF,extent:Xb,facet:Mg,field:zF,filter:Kb,flatten:Jb,fold:Qb,formula:Zb,generate:IF,impute:ev,joinaggregate:tv,kde:nv,key:BF,load:UF,lookup:iv,multiextent:jF,multivalues:WF,params:qF,pivot:rv,prefacet:HF,project:ov,proxy:GF,quantile:sv,relay:VF,sample:av,sequence:uv,sieve:XF,subflow:Yb,timeunit:lv,tupleindex:KF,values:JF,window:cv},Symbol.toStringTag,{value:"Module"}));function Fe(e){return function(){return e}}const tS=Math.abs,Dt=Math.atan2,is=Math.cos,s9=Math.max,$m=Math.min,Li=Math.sin,ws=Math.sqrt,Nt=1e-12,Za=Math.PI,jd=Za/2,eT=2*Za;function a9(e){return e>1?0:e<-1?Za:Math.acos(e)}function nS(e){return e>=1?jd:e<=-1?-jd:Math.asin(e)}function Og(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 zP(t)}function u9(e){return e.innerRadius}function l9(e){return e.outerRadius}function c9(e){return e.startAngle}function f9(e){return e.endAngle}function d9(e){return e&&e.padAngle}function h9(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<Nt))return d=(c*(t-o)-f*(e-r))/d,[e+d*u,t+d*l]}function Cf(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(s9(0,E*E*x-S*S)),_=(S*v-b*w)/x,$=(-S*b-v*w)/x,C=(S*v+b*w)/x,T=(-S*b+v*w)/x,D=_-m,k=$-y,F=C-m,A=T-y;return D*D+k*k>F*F+A*A&&(_=C,$=T),{cx:_,cy:$,x01:-c,y01:-f,x11:_*(r/E-1),y11:$*(r/E-1)}}function g9(){var e=u9,t=l9,n=Fe(0),i=null,r=c9,o=f9,s=d9,a=null,u=Og(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=tS(p-g),y=p>g;if(a||(a=c=u()),h<d&&(f=h,h=d,d=f),!(h>Nt))a.moveTo(0,0);else if(m>eT-Nt)a.moveTo(h*is(g),h*Li(g)),a.arc(0,0,h,g,p,!y),d>Nt&&(a.moveTo(d*is(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,$=_>Nt&&(i?+i.apply(this,arguments):ws(d*d+h*h)),C=$m(tS(h-d)/2,+n.apply(this,arguments)),T=C,D=C,k,F;if($>Nt){var A=nS($/d*Li(_)),M=nS($/h*Li(_));(S-=A*2)>Nt?(A*=y?1:-1,x+=A,E-=A):(S=0,x=E=(g+p)/2),(w-=M*2)>Nt?(M*=y?1:-1,b+=M,v-=M):(w=0,b=v=(g+p)/2)}var P=h*is(b),z=h*Li(b),U=d*is(E),te=d*Li(E);if(C>Nt){var ne=h*is(v),de=h*Li(v),Se=d*is(x),we=d*Li(x),Pe;if(m<Za)if(Pe=h9(P,z,Se,we,ne,de,U,te)){var Ri=P-Pe[0],ns=z-Pe[1],no=ne-Pe[0],Q=de-Pe[1],he=1/Li(a9((Ri*no+ns*Q)/(ws(Ri*Ri+ns*ns)*ws(no*no+Q*Q)))/2),pe=ws(Pe[0]*Pe[0]+Pe[1]*Pe[1]);T=$m(C,(d-pe)/(he-1)),D=$m(C,(h-pe)/(he+1))}else T=D=0}w>Nt?D>Nt?(k=Cf(Se,we,P,z,h,D,y),F=Cf(ne,de,U,te,h,D,y),a.moveTo(k.cx+k.x01,k.cy+k.y01),D<C?a.arc(k.cx,k.cy,D,Dt(k.y01,k.x01),Dt(F.y01,F.x01),!y):(a.arc(k.cx,k.cy,D,Dt(k.y01,k.x01),Dt(k.y11,k.x11),!y),a.arc(0,0,h,Dt(k.cy+k.y11,k.cx+k.x11),Dt(F.cy+F.y11,F.cx+F.x11),!y),a.arc(F.cx,F.cy,D,Dt(F.y11,F.x11),Dt(F.y01,F.x01),!y))):(a.moveTo(P,z),a.arc(0,0,h,b,v,!y)):a.moveTo(P,z),!(d>Nt)||!(S>Nt)?a.lineTo(U,te):T>Nt?(k=Cf(U,te,ne,de,d,-T,y),F=Cf(P,z,Se,we,d,-T,y),a.lineTo(k.cx+k.x01,k.cy+k.y01),T<C?a.arc(k.cx,k.cy,T,Dt(k.y01,k.x01),Dt(F.y01,F.x01),!y):(a.arc(k.cx,k.cy,T,Dt(k.y01,k.x01),Dt(k.y11,k.x11),!y),a.arc(0,0,d,Dt(k.cy+k.y11,k.cx+k.x11),Dt(F.cy+F.y11,F.cx+F.x11),y),a.arc(F.cx,F.cy,T,Dt(F.y11,F.x11),Dt(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-Za/2;return[is(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 tT(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function nT(e){this._context=e}nT.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 fv(e){return new nT(e)}function iT(e){return e[0]}function rT(e){return e[1]}function oT(e,t){var n=Fe(!0),i=null,r=fv,o=null,s=Og(a);e=typeof e=="function"?e:e===void 0?iT:Fe(e),t=typeof t=="function"?t:t===void 0?rT:Fe(t);function a(u){var l,c=(u=tT(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 sT(e,t,n){var i=null,r=Fe(!0),o=null,s=fv,a=null,u=Og(l);e=typeof e=="function"?e:e===void 0?iT:Fe(+e),t=typeof t=="function"?t:Fe(t===void 0?0:+t),n=typeof n=="function"?n:n===void 0?rT:Fe(+n);function l(f){var d,h,g,p=(f=tT(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 oT().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 p9={draw(e,t){const n=ws(t/Za);e.moveTo(n,0),e.arc(0,0,n,0,eT)}};function m9(e,t){let n=null,i=Og(r);e=typeof e=="function"?e:Fe(e||p9),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 Mo(){}function Wd(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 Dg(e){this._context=e}Dg.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:Wd(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:Wd(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function y9(e){return new Dg(e)}function aT(e){this._context=e}aT.prototype={areaStart:Mo,areaEnd:Mo,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:Wd(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function b9(e){return new aT(e)}function uT(e){this._context=e}uT.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:Wd(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function v9(e){return new uT(e)}function lT(e,t){this._basis=new Dg(e),this._beta=t}lT.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 x9=function e(t){function n(i){return t===1?new Dg(i):new lT(i,t)}return n.beta=function(i){return e(+i)},n}(.85);function qd(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 dv(e,t){this._context=e,this._k=(1-t)/6}dv.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:qd(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:qd(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 w9=function e(t){function n(i){return new dv(i,t)}return n.tension=function(i){return e(+i)},n}(0);function hv(e,t){this._context=e,this._k=(1-t)/6}hv.prototype={areaStart:Mo,areaEnd:Mo,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:qd(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 E9=function e(t){function n(i){return new hv(i,t)}return n.tension=function(i){return e(+i)},n}(0);function gv(e,t){this._context=e,this._k=(1-t)/6}gv.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:qd(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 S9=function e(t){function n(i){return new gv(i,t)}return n.tension=function(i){return e(+i)},n}(0);function pv(e,t,n){var i=e._x1,r=e._y1,o=e._x2,s=e._y2;if(e._l01_a>Nt){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>Nt){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 cT(e,t){this._context=e,this._alpha=t}cT.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:pv(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 _9=function e(t){function n(i){return t?new cT(i,t):new dv(i,0)}return n.alpha=function(i){return e(+i)},n}(.5);function fT(e,t){this._context=e,this._alpha=t}fT.prototype={areaStart:Mo,areaEnd:Mo,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:pv(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 $9=function e(t){function n(i){return t?new fT(i,t):new hv(i,0)}return n.alpha=function(i){return e(+i)},n}(.5);function dT(e,t){this._context=e,this._alpha=t}dT.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:pv(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 A9=function e(t){function n(i){return t?new dT(i,t):new gv(i,0)}return n.alpha=function(i){return e(+i)},n}(.5);function hT(e){this._context=e}hT.prototype={areaStart:Mo,areaEnd:Mo,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 k9(e){return new hT(e)}function iS(e){return e<0?-1:1}function rS(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(iS(o)+iS(s))*Math.min(Math.abs(o),Math.abs(s),.5*Math.abs(a))||0}function oS(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function Am(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:Am(this,this._t0,oS(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,Am(this,oS(this,n=rS(this,e,t)),n);break;default:Am(this,this._t0,n=rS(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function gT(e){this._context=new pT(e)}(gT.prototype=Object.create(Hd.prototype)).point=function(e,t){Hd.prototype.point.call(this,t,e)};function pT(e){this._context=e}pT.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 C9(e){return new Hd(e)}function F9(e){return new gT(e)}function mT(e){this._context=e}mT.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=sS(e),r=sS(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 sS(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 T9(e){return new mT(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 M9(e){return new Rg(e,.5)}function O9(e){return new Rg(e,0)}function D9(e){return new Rg(e,1)}function ko(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 R9=()=>typeof Image<"u"?Image:null,Z0=Symbol("implicit");function mv(){var e=new CE,t=[],n=[],i=Z0;function r(o){let s=e.get(o);if(s===void 0){if(i!==Z0)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 CE;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)},Wo.apply(r,arguments),r}const yT=Math.PI/180,bT=180/Math.PI,Gd=18,vT=.96422,xT=1,wT=.82521,ET=4/29,Ia=6/29,ST=3*Ia*Ia,N9=Ia*Ia*Ia;function _T(e){if(e instanceof Yi)return new Yi(e.l,e.a,e.b,e.opacity);if(e instanceof Or)return $T(e);e instanceof cg||(e=Pk(e));var t=Tm(e.r),n=Tm(e.g),i=Tm(e.b),r=km((.2225045*t+.7168786*n+.0606169*i)/xT),o,s;return t===n&&n===i?o=s=r:(o=km((.4360747*t+.3850649*n+.1430804*i)/vT),s=km((.0139322*t+.0971045*n+.7141733*i)/wT)),new Yi(116*r-16,500*(o-r),200*(r-s),e.opacity)}function Vd(e,t,n,i){return arguments.length===1?_T(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}Xy(Yi,Vd,Yy(Ky,{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=vT*Cm(t),e=xT*Cm(e),n=wT*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>N9?Math.pow(e,1/3):e/ST+ET}function Cm(e){return e>Ia?e*e*e:ST*(e-ET)}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 L9(e){if(e instanceof Or)return new Or(e.h,e.c,e.l,e.opacity);if(e instanceof Yi||(e=_T(e)),e.a===0&&e.b===0)return new Or(NaN,0<e.l&&e.l<100?0:NaN,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*bT;return new Or(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}function Xd(e,t,n,i){return arguments.length===1?L9(e):new Or(e,t,n,i??1)}function Or(e,t,n,i){this.h=+e,this.c=+t,this.l=+n,this.opacity=+i}function $T(e){if(isNaN(e.h))return new Yi(e.l,0,0,e.opacity);var t=e.h*yT;return new Yi(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}Xy(Or,Xd,Yy(Ky,{brighter(e){return new Or(this.h,this.c,this.l+Gd*(e??1),this.opacity)},darker(e){return new Or(this.h,this.c,this.l-Gd*(e??1),this.opacity)},rgb(){return $T(this).rgb()}}));var AT=-.14861,yv=1.78277,bv=-.29227,Ng=-.90649,lc=1.97294,aS=lc*Ng,uS=lc*yv,lS=yv*bv-Ng*AT;function P9(e){if(e instanceof $s)return new $s(e.h,e.s,e.l,e.opacity);e instanceof cg||(e=Pk(e));var t=e.r/255,n=e.g/255,i=e.b/255,r=(lS*i+aS*t-uS*n)/(lS+aS-uS),o=i-r,s=(lc*(n-r)-bv*o)/Ng,a=Math.sqrt(s*s+o*o)/(lc*r*(1-r)),u=a?Math.atan2(s,o)*bT-120:NaN;return new $s(u<0?u+360:u,a,r,e.opacity)}function e1(e,t,n,i){return arguments.length===1?P9(e):new $s(e,t,n,i??1)}function $s(e,t,n,i){this.h=+e,this.s=+t,this.l=+n,this.opacity=+i}Xy($s,e1,Yy(Ky,{brighter(e){return e=e==null?EE:Math.pow(EE,e),new $s(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?wE:Math.pow(wE,e),new $s(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=isNaN(this.h)?0:(this.h+120)*yT,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*(AT*i+yv*r)),255*(t+n*(bv*i+Ng*r)),255*(t+n*(lc*i)),this.opacity)}}));function z9(e){var t=e.length;return function(n){return e[Math.max(0,Math.min(t-1,Math.floor(n*t)))]}}function I9(e,t){var n=fg(+e,+t);return function(i){var r=n(i);return r-360*Math.floor(r/360)}}function kT(e){return function(t,n){var i=e((t=I0(t)).h,(n=I0(n)).h),r=It(t.s,n.s),o=It(t.l,n.l),s=It(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 B9=kT(fg);var U9=kT(It);function j9(e,t){var n=It((e=Vd(e)).l,(t=Vd(t)).l),i=It(e.a,t.a),r=It(e.b,t.b),o=It(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 CT(e){return function(t,n){var i=e((t=Xd(t)).h,(n=Xd(n)).h),r=It(t.c,n.c),o=It(t.l,n.l),s=It(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 W9=CT(fg);var q9=CT(It);function FT(e){return function t(n){n=+n;function i(r,o){var s=e((r=e1(r)).h,(o=e1(o)).h),a=It(r.s,o.s),u=It(r.l,o.l),l=It(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 H9=FT(fg);var G9=FT(It);function vv(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 V9(e,t){for(var n=new Array(t),i=0;i<t;++i)n[i]=e(i/(t-1));return n}const X9=Object.freeze(Object.defineProperty({__proto__:null,interpolate:Oc,interpolateArray:kP,interpolateBasis:CP,interpolateBasisClosed:FP,interpolateCubehelix:H9,interpolateCubehelixLong:G9,interpolateDate:TP,interpolateDiscrete:z9,interpolateHcl:W9,interpolateHclLong:q9,interpolateHsl:B9,interpolateHslLong:U9,interpolateHue:I9,interpolateLab:j9,interpolateNumber:MP,interpolateNumberArray:OP,interpolateObject:DP,interpolateRgb:RP,interpolateRgbBasis:NP,interpolateRgbBasisClosed:LP,interpolateRound:ug,interpolateString:PP,interpolateTransformCss:IP,interpolateTransformSvg:BP,interpolateZoom:UP,piecewise:vv,quantize:V9},Symbol.toStringTag,{value:"Module"}));function TT(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,vE),n):e.slice()},n.unknown=function(i){return arguments.length?(t=i,n):t},n.copy=function(){return TT(e).unknown(t)},e=arguments.length?Array.from(e,vE):[0,1],ku(n)}function MT(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 cS(e){return Math.log(e)}function fS(e){return Math.exp(e)}function Y9(e){return-Math.log(-e)}function K9(e){return-Math.exp(-e)}function J9(e){return isFinite(e)?+("1e"+e):e<0?0:e}function Q9(e){return e===10?J9:e===Math.E?Math.exp:t=>Math.pow(e,t)}function Z9(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 dS(e){return(t,n)=>-e(-t,n)}function xv(e){const t=e(cS,fS),n=t.domain;let i=10,r,o;function s(){return r=Z9(i),o=Q9(i),n()[0]<0?(r=dS(r),o=dS(o),e(Y9,K9)):e(cS,fS),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=xE(l,c,m))}else y=xE(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=Lk(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(MT(n(),{floor:a=>o(Math.floor(r(a))),ceil:a=>o(Math.ceil(r(a)))})),t}function OT(){const e=xv(Vy()).domain([1,10]);return e.copy=()=>lg(e,OT()).base(e.base()),Wo.apply(e,arguments),e}function hS(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function gS(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function wv(e){var t=1,n=e(hS(t),gS(t));return n.constant=function(i){return arguments.length?e(hS(t=+i),gS(t)):t},ku(n)}function DT(){var e=wv(Vy());return e.copy=function(){return lg(e,DT()).constant(e.constant())},Wo.apply(e,arguments)}function pS(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function e8(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function t8(e){return e<0?-e*e:e*e}function Ev(e){var t=e(go,go),n=1;function i(){return n===1?e(go,go):n===.5?e(e8,t8):e(pS(n),pS(1/n))}return t.exponent=function(r){return arguments.length?(n=+r,i()):n},ku(t)}function Sv(){var e=Ev(Vy());return e.copy=function(){return lg(e,Sv()).exponent(e.exponent())},Wo.apply(e,arguments),e}function n8(){return Sv.apply(null,arguments).exponent(.5)}function RT(){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]=pC(e,s/a);return o}function o(s){return s==null||isNaN(s=+s)?i:t[Va(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(ic),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 RT().domain(e).range(t).unknown(i)},Wo.apply(o,arguments)}function NT(){var e=0,t=1,n=1,i=[.5],r=[0,1],o;function s(u){return u!=null&&u<=u?r[Va(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 NT().domain([e,t]).range(r).unknown(o)},Wo.apply(ku(s),arguments)}function i8(e){return new Date(e)}function r8(e){return e instanceof Date?+e:+new Date(+e)}function _v(e,t,n,i,r,o,s,a,u,l){var c=xP(),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,r8)):d().map(i8)},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(MT(w,S)):c},c.copy=function(){return lg(c,_v(e,t,n,i,r,o,s,a,u,l))},c}function o8(){return Wo.apply(_v(jz,Wz,er,rc,Ou,Nr,yg,pg,Mr,gb).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function s8(){return Wo.apply(_v(Bz,Uz,tr,oc,Du,$o,bg,mg,Mr,pb).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function Lg(){var e=0,t=1,n,i,r,o,s=go,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 Go(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function $v(){var e=ku(Lg()(go));return e.copy=function(){return Go(e,$v())},qo.apply(e,arguments)}function LT(){var e=xv(Lg()).domain([1,10]);return e.copy=function(){return Go(e,LT()).base(e.base())},qo.apply(e,arguments)}function PT(){var e=wv(Lg());return e.copy=function(){return Go(e,PT()).constant(e.constant())},qo.apply(e,arguments)}function Av(){var e=Ev(Lg());return e.copy=function(){return Go(e,Av()).exponent(e.exponent())},qo.apply(e,arguments)}function a8(){return Av.apply(null,arguments).exponent(.5)}function Pg(){var e=0,t=.5,n=1,i=1,r,o,s,a,u,l=go,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=vv(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 zT(){var e=ku(Pg()(go));return e.copy=function(){return Go(e,zT())},qo.apply(e,arguments)}function IT(){var e=xv(Pg()).domain([.1,1,10]);return e.copy=function(){return Go(e,IT()).base(e.base())},qo.apply(e,arguments)}function BT(){var e=wv(Pg());return e.copy=function(){return Go(e,BT()).constant(e.constant())},qo.apply(e,arguments)}function kv(){var e=Ev(Pg());return e.copy=function(){return Go(e,kv()).exponent(e.exponent())},qo.apply(e,arguments)}function u8(){return kv.apply(null,arguments).exponent(.5)}function lr(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 l8=lr("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf"),c8=lr("7fc97fbeaed4fdc086ffff99386cb0f0027fbf5b17666666"),f8=lr("1b9e77d95f027570b3e7298a66a61ee6ab02a6761d666666"),d8=lr("4269d0efb118ff725c6cc5b03ca951ff8ab7a463f297bbf59c6b4e9498a0"),h8=lr("a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928"),g8=lr("fbb4aeb3cde3ccebc5decbe4fed9a6ffffcce5d8bdfddaecf2f2f2"),p8=lr("b3e2cdfdcdaccbd5e8f4cae4e6f5c9fff2aef1e2cccccccc"),m8=lr("e41a1c377eb84daf4a984ea3ff7f00ffff33a65628f781bf999999"),y8=lr("66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3"),b8=lr("8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f");function Cv(e,t,n){const i=e-t+n*2;return e?i>0?i:1:0}const v8="identity",eu="linear",Wr="log",zc="pow",Ic="sqrt",zg="symlog",Rs="time",Ns="utc",Ki="sequential",Pu="diverging",tu="quantile",Ig="quantize",Bg="threshold",Fv="ordinal",t1="point",UT="band",Tv="bin-ordinal",ct="continuous",Bc="discrete",Uc="discretizing",ii="interpolating",Mv="temporal";function x8(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 w8(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 Ov(){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=Cv(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=Tn(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,Va(h,p)-1),b=p===m?y:Va(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 Ov().domain(t()).range(i).round(s).paddingInner(a).paddingOuter(u).align(l)},c()}function jT(e){const t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,e.copy=function(){return jT(t())},e}function E8(){return jT(Ov().paddingInner(1))}var S8=Array.prototype.map;function _8(e){return S8.call(e,Bt)}const $8=Array.prototype.slice;function WT(){let e=[],t=[];function n(i){return i==null||i!==i?void 0:t[(Va(e,i)-1)%t.length]}return n.domain=function(i){return arguments.length?(e=_8(i),n):e.slice()},n.range=function(i){return arguments.length?(t=$8.call(i),n):t.slice()},n.tickFormat=function(i,r){return SP(e[0],xe(e),i??10,r)},n.copy=function(){return WT().domain(n.domain()).range(n.range())},n}const Yd=new Map,qT=Symbol("vega_scale");function HT(e){return e[qT]=!0,e}function A8(e){return e&&e[qT]===!0}function k8(e,t,n){const i=function(){const o=t();return o.invertRange||(o.invertRange=o.invert?x8(o):o.invertExtent?w8(o):void 0),o.type=e,HT(o)};return i.metadata=vi(Y(n)),i}function ke(e,t,n){return arguments.length>1?(Yd.set(e,k8(e,t,n)),this):GT(e)?Yd.get(e):void 0}ke(v8,TT);ke(eu,wP,ct);ke(Wr,OT,[ct,Wr]);ke(zc,Sv,ct);ke(Ic,n8,ct);ke(zg,DT,ct);ke(Rs,o8,[ct,Mv]);ke(Ns,s8,[ct,Mv]);ke(Ki,$v,[ct,ii]);ke(`${Ki}-${eu}`,$v,[ct,ii]);ke(`${Ki}-${Wr}`,LT,[ct,ii,Wr]);ke(`${Ki}-${zc}`,Av,[ct,ii]);ke(`${Ki}-${Ic}`,a8,[ct,ii]);ke(`${Ki}-${zg}`,PT,[ct,ii]);ke(`${Pu}-${eu}`,zT,[ct,ii]);ke(`${Pu}-${Wr}`,IT,[ct,ii,Wr]);ke(`${Pu}-${zc}`,kv,[ct,ii]);ke(`${Pu}-${Ic}`,u8,[ct,ii]);ke(`${Pu}-${zg}`,BT,[ct,ii]);ke(tu,RT,[Uc,tu]);ke(Ig,NT,Uc);ke(Bg,EP,Uc);ke(Tv,WT,[Bc,Uc]);ke(Fv,mv,Bc);ke(UT,Ov,Bc);ke(t1,E8,Bc);function GT(e){return Yd.has(e)}function na(e,t){const n=Yd.get(e);return n&&n.metadata[t]}function Dv(e){return na(e,ct)}function nu(e){return na(e,Bc)}function n1(e){return na(e,Uc)}function VT(e){return na(e,Wr)}function C8(e){return na(e,Mv)}function XT(e){return na(e,ii)}function YT(e){return na(e,tu)}const F8=["clamp","base","constant","exponent"];function KT(e,t){const n=t[0],i=xe(t)-n;return function(r){return e(n+r*i)}}function Ug(e,t,n){return vv(Rv(t||"rgb",n),e)}function JT(e,t){const n=new Array(t),i=t+1;for(let r=0;r<t;)n[r]=e(++r/i);return n}function QT(e,t,n){const i=n-t;let r,o,s;return!i||!Number.isFinite(i)?Vt(.5):(r=(o=e.type).indexOf("-"),o=r<0?o:o.slice(r+1),s=ke(o)().domain([t,n]).range([0,1]),F8.forEach(a=>e[a]?s[a](e[a]()):0),s)}function Rv(e,t){const n=X9[T8(e)];return t!=null&&n&&n.gamma?n.gamma(t):n}function T8(e){return"interpolate"+e.toLowerCase().split("-").map(t=>t[0].toUpperCase()+t.slice(1)).join("")}const M8={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"},O8={accent:c8,category10:l8,category20:"1f77b4aec7e8ff7f0effbb782ca02c98df8ad62728ff98969467bdc5b0d58c564bc49c94e377c2f7b6d27f7f7fc7c7c7bcbd22dbdb8d17becf9edae5",category20b:"393b795254a36b6ecf9c9ede6379398ca252b5cf6bcedb9c8c6d31bd9e39e7ba52e7cb94843c39ad494ad6616be7969c7b4173a55194ce6dbdde9ed6",category20c:"3182bd6baed69ecae1c6dbefe6550dfd8d3cfdae6bfdd0a231a35474c476a1d99bc7e9c0756bb19e9ac8bcbddcdadaeb636363969696bdbdbdd9d9d9",dark2:f8,observable10:d8,paired:h8,pastel1:g8,pastel2:p8,set1:m8,set2:y8,set3:b8,tableau10:"4c78a8f58518e4575672b7b254a24beeca3bb279a2ff9da69d755dbab0ac",tableau20:"4c78a89ecae9f58518ffbf7954a24b88d27ab79a20f2cf5b43989483bcb6e45756ff9d9879706ebab0acd67195fcbfd2b279a2d6a5c99e765fd8b5a5"};function ZT(e){if(L(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 eM(e,t){for(const n in e)Nv(n,t(e[n]))}const mS={};eM(O8,ZT);eM(M8,e=>Ug(ZT(e)));function Nv(e,t){return e=e&&e.toLowerCase(),arguments.length>1?(mS[e]=t,this):mS[e]}const dd="symbol",D8="discrete",R8="gradient",N8=e=>L(e)?e.map(t=>String(t)):String(e),L8=(e,t)=>e[1]-t[1],P8=(e,t)=>t[1]-e[1];function Lv(e,t,n){let i;return $e(t)&&(e.bins&&(t=Math.max(t,e.bins.length)),n!=null&&(t=Math.min(t,Math.floor(Rc(e.domain())/n||1)+1))),X(t)&&(i=t.step,t=t.interval),K(t)&&(t=e.type===Rs?Ru(t):e.type==Ns?Nu(t):N("Only time and utc scales accept interval strings."),i&&(t=t.every(i))),t}function tM(e,t,n){let i=e.range(),r=i[0],o=xe(i),s=L8;if(r>o&&(i=o,o=r,r=i,s=P8),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],xe(t)];for(;t.length>n&&t.length>=3;)t=t.filter((u,l)=>!(l%2));t.length<3&&(t=a)}return t}function Pv(e,t){return e.bins?tM(e,e.bins,t):e.ticks?e.ticks(t):e.domain()}function nM(e,t,n,i,r,o){const s=t.type;let a=N8;if(s===Rs||r===Rs)a=e.timeFormat(i);else if(s===Ns||r===Ns)a=e.utcFormat(i);else if(VT(s)){const u=e.formatFloat(i);if(o||t.bins)a=u;else{const l=iM(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 iM(e,t,n){const i=Pv(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 i1={[tu]:"quantiles",[Ig]:"thresholds",[Bg]:"domain"},rM={[tu]:"quantiles",[Ig]:"domain"};function oM(e,t){return e.bins?B8(e.bins):e.type===Wr?iM(e,t,!0):i1[e.type]?I8(e[i1[e.type]]()):Pv(e,t)}function z8(e,t,n){const i=t[rM[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 I8(e){const t=[-1/0].concat(e);return t.max=1/0,t}function B8(e){const t=e.slice(0,-1);return t.max=xe(e),t}const U8=e=>i1[e.type]||e.bins;function sM(e,t,n,i,r,o,s){const a=rM[t.type]&&o!==Rs&&o!==Ns?z8(e,t,r):nM(e,t,n,r,o,s);return i===dd&&U8(t)?j8(a):i===D8?W8(a):q8(a)}const j8=e=>(t,n,i)=>{const r=yS(i[n+1],yS(i.max,1/0)),o=bS(t,e),s=bS(r,e);return o&&s?o+" – "+s:s?"< "+s:"≥ "+o},yS=(e,t)=>e??t,W8=e=>(t,n)=>n?e(t):null,q8=e=>t=>e(t),bS=(e,t)=>Number.isFinite(e)?t(e):null;function H8(e){const t=e.domain(),n=t.length-1;let i=+t[0],r=+xe(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 G8(e,t,n,i){const r=i||t.type;return K(n)&&C8(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"):sM(e,t,5,null,n,i,!0)}function aM(e,t,n){n=n||{};const i=Math.max(3,n.maxlen||7),r=G8(e,t,n.format,n.formatType);if(n1(t.type)){const o=oM(t).slice(1).map(r),s=o.length;return`${s} boundar${s===1?"y":"ies"}: ${o.join(", ")}`}else if(nu(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(xe(o))}`}}let uM=0;function V8(){uM=0}const Kd="p_";function zv(e){return e&&e.gradient}function lM(e,t,n){const i=e.gradient;let r=e.id,o=i==="radial"?Kd:"";return r||(r=e.id="gradient_"+uM++,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 cM(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 vS={basis:{curve:y9},"basis-closed":{curve:b9},"basis-open":{curve:v9},bundle:{curve:x9,tension:"beta",value:.85},cardinal:{curve:w9,tension:"tension",value:0},"cardinal-open":{curve:S9,tension:"tension",value:0},"cardinal-closed":{curve:E9,tension:"tension",value:0},"catmull-rom":{curve:_9,tension:"alpha",value:.5},"catmull-rom-closed":{curve:$9,tension:"alpha",value:.5},"catmull-rom-open":{curve:A9,tension:"alpha",value:.5},linear:{curve:fv},"linear-closed":{curve:k9},monotone:{horizontal:F9,vertical:C9},natural:{curve:T9},step:{curve:M9},"step-after":{curve:D9},"step-before":{curve:O9}};function Iv(e,t,n){var i=J(vS,e)&&vS[e],r=null;return i&&(r=i.curve||i[t||"vertical"],i.tension&&n!=null&&(r=r[i.tension](n))),r}const X8={m:2,l:2,h:1,v:1,z:0,c:6,s:4,q:4,t:2,a:7},Y8=/[mlhvzcsqta]([^mlhvzcsqta]+|$)/gi,K8=/^[+-]?(([0-9]*\.[0-9]+)|([0-9]+\.)|([0-9]+))([eE][+-]?[0-9]+)?/,J8=/^((\s+,?\s*)|(,\s*))/,Q8=/^[01]/;function iu(e){const t=[];return(e.match(Y8)||[]).forEach(i=>{let r=i[0];const o=r.toLowerCase(),s=X8[o],a=Z8(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 Z8(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)?Q8:K8,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(J8);u!==null&&(r+=u[0].length)}return i}const Oo=Math.PI/180,e7=1e-14,ys=Math.PI/2,qi=Math.PI*2,ba=Math.sqrt(3)/2;var Mm={},Om={},fM=[].join;function t7(e,t,n,i,r,o,s,a,u){const l=fM.call(arguments);if(Mm[l])return Mm[l];const c=s*Oo,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 $=1/((S-x)*(S-x)+(w-E)*(w-E))-.25;$<0&&($=0);let C=Math.sqrt($);o==r&&(C=-C);const T=.5*(x+S)-C*(w-E),D=.5*(E+w)+C*(S-x),k=Math.atan2(E-D,x-T);let A=Math.atan2(w-D,S-T)-k;A<0&&o===1?A+=qi:A>0&&o===0&&(A-=qi);const M=Math.ceil(Math.abs(A/(ys+.001))),P=[];for(let z=0;z<M;++z){const U=k+z*A/M,te=k+(z+1)*A/M;P[z]=[T,D,U,te,n,i,f,d]}return Mm[l]=P}function n7(e){const t=fM.call(e);if(Om[t])return Om[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,$=w+x*y,C=_-x*m;return Om[t]=[c*E+f*S,d*E+h*S,c*$+f*C,d*$+h*C,c*w+f*_,d*w+h*_]}const Un=["l",0,0,0,0,0,0,0];function i7(e,t,n){const i=Un[0]=e[0];if(i==="a"||i==="A")Un[1]=t*e[1],Un[2]=n*e[2],Un[3]=e[3],Un[4]=e[4],Un[5]=e[5],Un[6]=t*e[6],Un[7]=n*e[7];else if(i==="h"||i==="H")Un[1]=t*e[1];else if(i==="v"||i==="V")Un[1]=n*e[1];else for(var r=1,o=e.length;r<o;++r)Un[r]=(r%2==1?t:n)*e[r];return Un}function cc(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=i7(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":xS(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":xS(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 xS(e,t,n,i){const r=t7(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=n7(r[o]);e.bezierCurveTo(s[0],s[1],s[2],s[3],s[4],s[5])}}const wS=.5773502691896257,ES={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*wS,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*wS;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 dM(e){return J(ES,e)?ES[e]:r7(e)}var Dm={};function r7(e){if(!J(Dm,e)){const t=iu(e);Dm[e]={draw:function(n,i){cc(n,t,0,0,Math.sqrt(i)/2)}}}return Dm[e]}const io=.448084975506;function o7(e){return e.x}function s7(e){return e.y}function a7(e){return e.width}function u7(e){return e.height}function xr(e){return typeof e=="function"?e:()=>+e}function Ff(e,t,n){return Math.max(t,Math.min(e,n))}function hM(){var e=o7,t=s7,n=a7,i=u7,r=xr(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=Ff(+r.call(this,c),0,b),x=Ff(+o.call(this,c),0,b),E=Ff(+s.call(this,c),0,b),S=Ff(+a.call(this,c),0,b);if(u||(u=h=Jy()),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-io*x,p,w,p+io*x,w,p+x),u.lineTo(w,_-S),u.bezierCurveTo(w,_-io*S,w-io*S,_,w-S,_),u.lineTo(g+E,_),u.bezierCurveTo(g+io*E,_,g,_-io*E,g,_-E),u.lineTo(g,p+v),u.bezierCurveTo(g,p+io*v,g+io*v,p,g+v,p),u.closePath()}if(h)return u=null,h+""||null}return l.x=function(c){return arguments.length?(e=xr(c),l):e},l.y=function(c){return arguments.length?(t=xr(c),l):t},l.width=function(c){return arguments.length?(n=xr(c),l):n},l.height=function(c){return arguments.length?(i=xr(c),l):i},l.cornerRadius=function(c,f,d,h){return arguments.length?(r=xr(c),o=f!=null?xr(f):r,a=d!=null?xr(d):r,s=h!=null?xr(h):o,l):r},l.context=function(c){return arguments.length?(u=c??null,l):u},l}function gM(){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=Jy()),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 jc(e,t){return e??t}const Wc=e=>e.x||0,qc=e=>e.y||0,l7=e=>e.width||0,c7=e=>e.height||0,f7=e=>(e.x||0)+(e.width||0),d7=e=>(e.y||0)+(e.height||0),h7=e=>e.startAngle||0,g7=e=>e.endAngle||0,p7=e=>e.padAngle||0,m7=e=>e.innerRadius||0,y7=e=>e.outerRadius||0,b7=e=>e.cornerRadius||0,v7=e=>jc(e.cornerRadiusTopLeft,e.cornerRadius)||0,x7=e=>jc(e.cornerRadiusTopRight,e.cornerRadius)||0,w7=e=>jc(e.cornerRadiusBottomRight,e.cornerRadius)||0,E7=e=>jc(e.cornerRadiusBottomLeft,e.cornerRadius)||0,S7=e=>jc(e.size,64),_7=e=>e.size||1,jg=e=>e.defined!==!1,$7=e=>dM(e.shape||"circle"),A7=g9().startAngle(h7).endAngle(g7).padAngle(p7).innerRadius(m7).outerRadius(y7).cornerRadius(b7),k7=sT().x(Wc).y1(qc).y0(d7).defined(jg),C7=sT().y(qc).x1(Wc).x0(f7).defined(jg),F7=oT().x(Wc).y(qc).defined(jg),T7=hM().x(Wc).y(qc).width(l7).height(c7).cornerRadius(v7,x7,w7,E7),M7=m9().type($7).size(S7),O7=gM().x(Wc).y(qc).defined(jg).size(_7);function Bv(e){return e.cornerRadius||e.cornerRadiusTopLeft||e.cornerRadiusTopRight||e.cornerRadiusBottomRight||e.cornerRadiusBottomLeft}function D7(e,t){return A7.context(e)(t)}function R7(e,t){const n=t[0],i=n.interpolate||"linear";return(n.orient==="horizontal"?C7:k7).curve(Iv(i,n.orient,n.tension)).context(e)(t)}function N7(e,t){const n=t[0],i=n.interpolate||"linear";return F7.curve(Iv(i,n.orient,n.tension)).context(e)(t)}function zu(e,t,n,i){return T7.context(e)(t,n,i)}function L7(e,t){return(t.mark.shape||t.shape).context(e)(t)}function P7(e,t){return M7.context(e)(t)}function z7(e,t){return O7.context(e)(t)}var pM=1;function mM(){pM=1}function Uv(e,t,n){var i=t.clip,r=e._defs,o=t.clip_id||(t.clip_id="clip"+pM++),s=r.clipping[o]||(r.clipping[o]={id:o});return fe(i)?s.path=i(null):Bv(n)?s.path=zu(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 Wg(e){this.mark=e,this.bounds=this.bounds||new it}function qg(e){Wg.call(this,e),this.items=this.items||[]}G(qg,Wg);class yM{constructor(t){this._pending=0,this._loader=t||xg()}pending(){return this._pending}sanitizeURL(t){const n=this;return SS(n),n._loader.sanitize(t,{context:"href"}).then(i=>(al(n),i)).catch(()=>(al(n),null))}loadImage(t){const n=this,i=R9();return SS(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 SS(e){e._pending+=1}function al(e){e._pending-=1}function Vr(e,t,n){if(t.stroke&&t.opacity!==0&&t.strokeOpacity!==0){const i=t.strokeWidth!=null?+t.strokeWidth:1;e.expand(i+(n?I7(t,i):0))}return e}function I7(e,t){return e.strokeJoin&&e.strokeJoin!=="miter"?0:t}const B7=qi-1e-8;let Hg,hd,gd,Es,r1,pd,o1,s1;const po=(e,t)=>Hg.add(e,t),md=(e,t)=>po(hd=e,gd=t),_S=e=>po(e,Hg.y1),$S=e=>po(Hg.x1,e),bs=(e,t)=>r1*e+o1*t,vs=(e,t)=>pd*e+s1*t,Rm=(e,t)=>po(bs(e,t),vs(e,t)),Nm=(e,t)=>md(bs(e,t),vs(e,t));function Hc(e,t){return Hg=e,t?(Es=t*Oo,r1=s1=Math.cos(Es),pd=Math.sin(Es),o1=-pd):(r1=s1=1,Es=pd=o1=0),U7}const U7={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)):(po(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);AS(hd,r,s,_S),AS(gd,o,a,$S),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);kS(hd,s,u,c,_S),kS(gd,a,l,f,$S),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)>B7)po(e-n,t-n),po(e+n,t+n);else{const s=l=>po(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 AS(e,t,n,i){const r=(e-t)/(e+n-2*t);0<r&&r<1&&i(e+(t-e)*r)}function kS(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)>e7?(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(CS(u,e,t,n,i)),0<l&&l<1&&r(CS(l,e,t,n,i))}function CS(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 Co=(Co=ko(1,1))?Co.getContext("2d"):null;const a1=new it;function jv(e){return function(t,n){if(!Co)return!0;e(Co,t),a1.clear().union(t.bounds).intersect(n).round();const{x1:i,y1:r,x2:o,y2:s}=a1;for(let a=r;a<=s;++a)for(let u=i;u<=o;++u)if(Co.isPointInPath(u,a))return!0;return!1}}function Wv(e,t){return t.contains(e.x||0,e.y||0)}function bM(e,t){const n=e.x||0,i=e.y||0,r=e.width||0,o=e.height||0;return t.intersects(a1.set(n,i,n+r,i+o))}function vM(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 Oa(t,n,i,r,o)}function Oa(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 ru(e,t){e.globalCompositeOperation=t.blend||"source-over"}function ai(e,t){return e??t}function FS(e,t){const n=t.length;for(let i=0;i<n;++i)e.addColorStop(t[i].offset,t[i].color);return e}function j7(e,t,n){const i=n.width(),r=n.height();let o;if(t.gradient==="radial")o=e.createRadialGradient(n.x1+ai(t.x1,.5)*i,n.y1+ai(t.y1,.5)*r,Math.max(i,r)*ai(t.r1,0),n.x1+ai(t.x2,.5)*i,n.y1+ai(t.y2,.5)*r,Math.max(i,r)*ai(t.r2,.5));else{const s=ai(t.x1,0),a=ai(t.y1,0),u=ai(t.x2,1),l=ai(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=ko(Math.ceil(i),Math.ceil(r)),f=c.getContext("2d");return f.scale(i,r),f.fillStyle=FS(f.createLinearGradient(s,a,u,l),t.stops),f.fillRect(0,0,i,r),e.createPattern(c,"no-repeat")}}return FS(o,t.stops)}function xM(e,t,n){return zv(n)?j7(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=xM(e,t,t.fill),!0):!1}var W7=[];function ou(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=xM(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||W7),e.lineDashOffset=t.strokeDashOffset||0),!0):!1)}function q7(e,t){return e.zindex-t.zindex||e.index-t.index}function qv(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(q7)}function wi(e,t){var n=e.items,i,r;if(!n||!n.length)return;const o=qv(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=qv(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 Hv(e){return function(t,n,i){wi(n,r=>{(!i||i.intersects(r.bounds))&&wM(e,t,r,r)})}}function H7(e){return function(t,n,i){n.items.length&&(!i||i.intersects(n.bounds))&&wM(e,t,n.items[0],n.items)}}function wM(e,t,n,i){var r=n.opacity==null?1:n.opacity;r!==0&&(e(t,i)||(ru(t,n),n.fill&&Jd(t,n,r)&&t.fill(),n.stroke&&ou(t,n,r)&&t.stroke()))}function Gg(e){return e=e||Ln,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 Gc(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 Gv(e){return Gg(Gc(e))}function As(e,t){return"translate("+e+","+t+")"}function Vv(e){return"rotate("+e+")"}function G7(e,t){return"scale("+e+","+t+")"}function EM(e){return As(e.x||0,e.y||0)}function V7(e){return As(e.x||0,e.y||0)+(e.angle?" "+Vv(e.angle):"")}function X7(e){return As(e.x||0,e.y||0)+(e.angle?" "+Vv(e.angle):"")+(e.scaleX||e.scaleY?" "+G7(e.scaleX||1,e.scaleY||1):"")}function Xv(e,t,n){function i(s,a){s("transform",V7(a)),s("d",t(null,a))}function r(s,a){return t(Hc(s,a.angle),a),Vr(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*=Oo),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:Hv(o),pick:Gv(o),isect:n||jv(o)}}var Y7=Xv("arc",D7);function K7(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 J7(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 Q7(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 Yv(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(Hc(u),c),Vr(u,c[0]))}function o(u,l){u.beginPath(),t(u,l)}const s=Gc(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:H7(o),pick:a,isect:Wv,tip:n}}var Z7=Yv("area",R7,K7);function eB(e,t){var n=t.clip;e.save(),fe(n)?(e.beginPath(),n(e),e.clip()):SM(e,t.group)}function SM(e,t){e.beginPath(),Bv(t)?zu(e,t,0,0):e.rect(0,0,t.width||0,t.height||0),e.clip()}function _M(e){const t=ai(e.strokeWidth,1);return e.strokeOffset!=null?e.strokeOffset:e.stroke&&t>.5&&t<1.5?.5-Math.abs(t-1):0}function tB(e,t){e("transform",EM(t))}function $M(e,t){const n=_M(t);e("d",zu(null,t,n,n))}function nB(e,t){e("class","background"),e("aria-hidden",!0),$M(e,t)}function iB(e,t){e("class","foreground"),e("aria-hidden",!0),t.strokeForeground?$M(e,t):e("d","")}function rB(e,t,n){const i=t.clip?Uv(n,t,t):null;e("clip-path",i)}function oB(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),Vr(e,t),e.translate(t.x||0,t.y||0)}function fc(e,t,n,i){const r=_M(t);e.beginPath(),zu(e,t,(n||0)+r,(i||0)+r)}const sB=Gc(fc),aB=Gc(fc,!1),uB=Gc(fc,!0);function lB(e,t,n,i){wi(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&&(fc(e,r,o,s),ru(e,r),r.fill&&Jd(e,r,u)&&e.fill(),r.stroke&&!a&&ou(e,r,u)&&e.stroke()),e.save(),e.translate(o,s),r.clip&&SM(e,r),n&&n.translate(-o,-s),wi(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&&(fc(e,r,o,s),ru(e,r),ou(e,r,u)&&e.stroke())})}function cB(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&&Bv(u)&&!uB(e,u,s,a))return e.restore(),null;const m=u.strokeForeground,y=t.interactive!==!1;return y&&m&&u.stroke&&aB(e,u,s,a)?(e.restore(),u):(l=Qd(u,b=>fB(b,c,f)?this.pick(b,n,i,c,f):null),!l&&y&&(u.fill||!m&&u.stroke)&&sB(e,u,s,a)&&(l=u),e.restore(),l||null)})}function fB(e,t,n){return(e.interactive!==!1||e.marktype==="group")&&e.bounds&&e.bounds.contains(t,n)}var dB={type:"group",tag:"g",nested:!1,attr:tB,bound:oB,draw:lB,pick:cB,isect:bM,content:rB,background:nB,foreground:iB},dc={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",version:"1.1"};function Kv(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 Jv(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 Qv(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 Xg(e,t){return e==="middle"?t/2:e==="bottom"?t:0}function hB(e,t,n){const i=Kv(t,n),r=Jv(t,i),o=Qv(t,i),s=(t.x||0)-Vg(t.align,r),a=(t.y||0)-Xg(t.baseline,o),u=!i.src&&i.toDataURL?i.toDataURL():i.src||"";e("href",u,dc["xmlns:xlink"],"xlink:href"),e("transform",As(s,a)),e("width",r),e("height",o),e("preserveAspectRatio",t.aspect===!1?"none":"xMidYMid")}function gB(e,t){const n=t.image,i=Jv(t,n),r=Qv(t,n),o=(t.x||0)-Vg(t.align,i),s=(t.y||0)-Xg(t.baseline,r);return e.set(o,s,o+i,s+r)}function pB(e,t,n){wi(t,i=>{if(n&&!n.intersects(i.bounds))return;const r=Kv(i,this);let o=Jv(i,r),s=Qv(i,r);if(o===0||s===0)return;let a=(i.x||0)-Vg(i.align,o),u=(i.y||0)-Xg(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)&&(ru(e,i),e.globalAlpha=(l=i.opacity)!=null?l:1,e.imageSmoothingEnabled=i.smooth!==!1,e.drawImage(r,a,u,o,s))})}var mB={type:"image",tag:"image",nested:!1,attr:hB,bound:gB,draw:pB,pick:Gg(),isect:Ln,get:Kv,xOffset:Vg,yOffset:Xg},yB=Yv("line",N7,J7);function bB(e,t){var n=t.scaleX||1,i=t.scaleY||1;(n!==1||i!==1)&&e("vector-effect","non-scaling-stroke"),e("transform",X7(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)*Oo,u=t.pathCache;(!u||u.path!==n)&&((t.pathCache=u=iu(n)).path=n),a&&e.rotate&&e.translate?(e.translate(i,r),e.rotate(a),cc(e,u,0,0,o,s),e.rotate(-a),e.translate(-i,-r)):cc(e,u,i,r,o,s)}function vB(e,t){return yd(Hc(e,t.angle),t)?e.set(0,0,0,0):Vr(e,t,!0)}var xB={type:"path",tag:"path",nested:!1,attr:bB,bound:vB,draw:Hv(yd),pick:Gv(yd),isect:jv(yd)};function wB(e,t){e("d",zu(null,t))}function EB(e,t){var n,i;return Vr(e.set(n=t.x||0,i=t.y||0,n+t.width||0,i+t.height||0),t)}function TS(e,t){e.beginPath(),zu(e,t)}var SB={type:"rect",tag:"path",nested:!1,attr:wB,bound:EB,draw:Hv(TS),pick:Gv(TS),isect:bM};function _B(e,t){e("transform",EM(t)),e("x2",t.x2!=null?t.x2-(t.x||0):0),e("y2",t.y2!=null?t.y2-(t.y||0):0)}function $B(e,t){var n,i;return Vr(e.set(n=t.x||0,i=t.y||0,t.x2!=null?t.x2:n,t.y2!=null?t.y2:i),t)}function AM(e,t,n){var i,r,o,s;return t.stroke&&ou(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 AB(e,t,n){wi(t,i=>{if(!(n&&!n.intersects(i.bounds))){var r=i.opacity==null?1:i.opacity;r&&AM(e,i,r)&&(ru(e,i),e.stroke())}})}function kB(e,t,n,i){return e.isPointInStroke?AM(e,t,1)&&e.isPointInStroke(n,i):!1}var CB={type:"rule",tag:"line",nested:!1,attr:_B,bound:$B,draw:AB,pick:Gg(kB),isect:vM},FB=Xv("shape",L7),TB=Xv("symbol",P7,Wv);const MS=rC();var Dn={height:cr,measureWidth:Zv,estimateWidth:Zd,width:Zd,canvas:kM};kM(!0);function kM(e){Dn.width=e&&Co?Zv:Zd}function Zd(e,t){return CM(Ro(e,t),cr(e))}function CM(e,t){return~~(.8*e.length*t)}function Zv(e,t){return cr(e)<=0||!(t=Ro(e,t))?0:FM(t,Yg(e))}function FM(e,t){const n=`(${t}) ${e}`;let i=MS.get(n);return i===void 0&&(Co.font=t,i=Co.measureText(e).width,MS.set(n,i)),i}function cr(e){return e.fontSize!=null?+e.fontSize||0:11}function Do(e){return e.lineHeight!=null?e.lineHeight:cr(e)+2}function MB(e){return L(e)?e.length>1?e:e[0]:e}function Vc(e){return MB(e.lineBreak&&e.text&&!L(e.text)?e.text.split(e.lineBreak):e.text)}function ex(e){const t=Vc(e);return(L(t)?t.length-1:0)*Do(e)}function Ro(e,t){const n=t==null?"":(t+"").trim();return e.limit>0&&n.length?DB(e,n):n}function OB(e){if(Dn.width===Zv){const t=Yg(e);return n=>FM(n,t)}else if(Dn.width===Zd){const t=cr(e);return n=>CM(n,t)}else return t=>Dn.width(e,t)}function DB(e,t){var n=+e.limit,i=OB(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 Yg(e,t){return(e.fontStyle?e.fontStyle+" ":"")+(e.fontVariant?e.fontVariant+" ":"")+(e.fontWeight?e.fontWeight+" ":"")+cr(e)+"px "+Xc(e,t)}function tx(e){var t=e.baseline,n=cr(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 RB={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 NB(e,t){var n=t.dx||0,i=(t.dy||0)+tx(t),r=Kg(t),o=r.x1,s=r.y1,a=t.angle||0,u;e("text-anchor",RB[t.align]||"start"),a?(u=As(o,s)+" "+Vv(a),(n||i)&&(u+=" "+As(n,i))):u=As(o+n,s+i),e("transform",u)}function nx(e,t,n){var i=Dn.height(t),r=t.align,o=Kg(t),s=o.x1,a=o.y1,u=t.dx||0,l=(t.dy||0)+tx(t)-Math.round(.8*i),c=Vc(t),f;if(L(c)?(i+=Do(t)*(c.length-1),f=c.reduce((d,h)=>Math.max(d,Dn.width(t,h)),0)):f=Dn.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*Oo,s,a);else if(n===2)return e.rotatedPoints(t.angle*Oo,s,a);return e}function LB(e,t,n){wi(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=Yg(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*Oo),s=a=0),s+=i.dx||0,a+=(i.dy||0)+tx(i),c=Vc(i),ru(e,i),L(c))for(l=Do(i),u=0;u<c.length;++u)f=Ro(i,c[u]),i.fill&&Jd(e,i,r)&&e.fillText(f,s,a),i.stroke&&ou(e,i,r)&&e.strokeText(f,s,a),a+=l;else f=Ro(i,c),i.fill&&Jd(e,i,r)&&e.fillText(f,s,a),i.stroke&&ou(e,i,r)&&e.strokeText(f,s,a);i.angle&&e.restore()}})}function PB(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=nx(Wl,t,1),c=-t.angle*Oo,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 zB(e,t){const n=nx(Wl,e,2);return Oa(t,n[0],n[1],n[2],n[3])||Oa(t,n[0],n[1],n[4],n[5])||Oa(t,n[4],n[5],n[6],n[7])||Oa(t,n[2],n[3],n[6],n[7])}var IB={type:"text",tag:"text",nested:!1,attr:NB,bound:nx,draw:LB,pick:Gg(PB),isect:zB},BB=Yv("trail",z7,Q7),In={arc:Y7,area:Z7,group:dB,image:mB,line:yB,path:xB,rect:SB,rule:CB,shape:FB,symbol:TB,text:IB,trail:BB};function u1(e,t,n){var i=In[e.mark.marktype],r=t||i.bound;return i.nested&&(e=e.mark),r(e.bounds||(e.bounds=new it),e,n)}var OS={mark:null};function TM(e,t,n){var i=In[e.marktype],r=i.bound,o=e.items,s=o&&o.length,a,u,l,c;if(i.nested)return s?l=o[0]:(OS.mark=e,l=OS),c=u1(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(u1(o[a],r,n));return e.bounds=t}const UB=["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 MM(e,t){return JSON.stringify(e,UB,t)}function OM(e){const t=typeof e=="string"?JSON.parse(e):e;return DM(t)}function DM(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"&&DM(n[r]);return t&&TM(e),e}class RM{constructor(t){arguments.length?this.root=OM(t):(this.root=DS({marktype:"group",name:"root",role:"frame"}),this.root.items=[new qg(this.root)])}toJSON(t){return MM(this.root,t||0)}mark(t,n,i){n=n||this.root.items[0];const r=DS(t,n);return n.items[i]=r,r.zindex&&(r.group.zdirty=!0),r}}function DS(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 mo(e,t,n){return!e&&typeof document<"u"&&document.createElement&&(e=document),e?n?e.createElementNS(n,t):e.createElement(t):null}function ix(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=mo(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 NM(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 jB(e,t,n,i){var r=e&&e.mark,o,s;if(r&&(o=In[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 rx=class{constructor(t,n){this._active=null,this._handlers={},this._loader=t||xg(),this._tooltip=n||WB}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=mo(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=jB(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 WB(e,t,n,i){e.element().setAttribute("title",i||"")}class Yc{constructor(t){this._el=null,this._bgcolor=null,this._loader=new yM(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 qB="keydown",HB="keypress",GB="keyup",LM="dragenter",bd="dragleave",PM="dragover",l1="pointerdown",VB="pointerup",eh="pointermove",vd="pointerout",zM="pointerover",c1="mousedown",XB="mouseup",IM="mousemove",th="mouseout",BM="mouseover",nh="click",YB="dblclick",KB="wheel",UM="mousewheel",ih="touchstart",rh="touchmove",oh="touchend",JB=[qB,HB,GB,LM,bd,PM,l1,VB,eh,vd,zM,c1,XB,IM,th,BM,nh,YB,KB,UM,ih,rh,oh],f1=eh,ql=th,d1=nh;class Kc extends rx{constructor(t,n){super(t,n),this._down=null,this._touch=null,this._first=!0,this._events={},this.events=JB,this.pointermove=NS([eh,IM],[zM,BM],[vd,th]),this.dragover=NS([PM],[LM],[bd]),this.pointerout=LS([vd,th]),this.dragleave=LS([bd])}initialize(t,n,i){return this._canvas=t&&ix(t,"canvas"),[nh,c1,l1,eh,vd,bd].forEach(r=>RS(this,r)),super.initialize(t,n,i)}canvas(){return this._canvas}context(){return this._canvas.getContext("2d")}DOMMouseScroll(t){this.fire(UM,t)}pointerdown(t){this._down=this._active,this.fire(l1,t)}mousedown(t){this._down=this._active,this.fire(c1,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===d1&&r&&r.href?this.handleHref(n,r,r.href):(t===f1||t===ql)&&this.handleTooltip(n,r,t!==ql),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&&(RS(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 In[t.marktype].pick.call(this,s,t,n,i,r,o)}}const QB=e=>e===ih||e===rh||e===oh?[ih,rh,oh]:[e];function RS(e,t){QB(t).forEach(n=>ZB(e,n))}function ZB(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 Tl(e,t,n){t.forEach(i=>e.fire(i,n))}function NS(e,t,n){return function(i){const r=this._active,o=this.pickEvent(i);o===r?Tl(this,e,i):((!r||!r.exit)&&Tl(this,n,i),this._active=o,Tl(this,t,i),Tl(this,e,i))}}function LS(e){return function(t){Tl(this,e,t),this._active=null}}function eU(){return typeof window<"u"&&window.devicePixelRatio||1}function tU(e,t,n,i,r,o){const s=typeof HTMLElement<"u"&&e instanceof HTMLElement&&e.parentNode!=null,a=e.getContext("2d"),u=s?eU():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 Yc{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:ko(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)tU(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=nU(r,o,s);i.save();const l=this._redraw||a.empty()?(this._redraw=!1,u.expand(1)):iU(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=In[n.marktype];n.clip&&eB(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 nU=(e,t,n)=>new it().set(0,0,t,n).translate(-e[0],-e[1]);function iU(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 jM extends rx{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!==ql)})}initialize(t,n,i){let r=this._svg;return r&&(r.removeEventListener(d1,this._hrefHandler),r.removeEventListener(f1,this._tooltipHandler),r.removeEventListener(ql,this._tooltipHandler)),this._svg=r=t&&ix(t,"svg"),r&&(r.addEventListener(d1,this._hrefHandler),r.addEventListener(f1,this._tooltipHandler),r.addEventListener(ql,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)},WM="aria-hidden",ox="aria-label",sx="role",ax="aria-roledescription",qM="graphics-object",ux="graphics-symbol",HM=(e,t,n)=>({[sx]:e,[ax]:t,[ox]:n||void 0}),rU=vi(["axis-domain","axis-grid","axis-label","axis-tick","axis-title","legend-band","legend-entry","legend-gradient","legend-label","legend-title","legend-symbol","title"]),PS={axis:{desc:"axis",caption:aU},legend:{desc:"legend",caption:uU},"title-text":{desc:"title",caption:e=>`Title text '${IS(e)}'`},"title-subtitle":{desc:"subtitle",caption:e=>`Subtitle text '${IS(e)}'`}},zS={ariaRole:sx,ariaRoleDescription:ax,description:ox};function GM(e,t){const n=t.aria===!1;if(e(WM,n||void 0),n||t.description==null)for(const i in zS)e(zS[i],void 0);else{const i=t.mark.marktype;e(ox,t.description),e(sx,t.ariaRole||(i==="group"?qM:ux)),e(ax,t.ariaRoleDescription||`${i} mark`)}}function VM(e){return e.aria===!1?{[WM]:!0}:rU[e.role]?null:PS[e.role]?sU(e,PS[e.role]):oU(e)}function oU(e){const t=e.marktype,n=t==="group"||t==="text"||e.items.some(i=>i.description!=null&&i.aria!==!1);return HM(n?qM:ux,`${t} mark container`,e.description)}function sU(e,t){try{const n=e.items[0],i=t.caption||(()=>"");return HM(t.role||ux,t.desc,n.description||i(n))}catch{return null}}function IS(e){return Y(e.text).join(" ")}function aU(e){const t=e.datum,n=e.orient,i=t.title?XM(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 ${nu(a)?"discrete":a} scale with ${aM(s,o,e)}`}function uU(e){const t=e.datum,n=t.title?XM(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 cU(i)+(n?` titled '${n}'`:"")+` for ${lU(o)} with ${aM(u,a,e)}`}function XM(e){try{return Y(xe(e.items).items[0].text).join(" ")}catch{return null}}function lU(e){return e=e.map(t=>t+(t==="fill"||t==="stroke"?" color":"")),e.length<2?e[0]:e.slice(0,-1).join(", ")+" and "+xe(e)}function cU(e){return e.length?e[0].toUpperCase()+e.slice(1):e}const YM=e=>(e+"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">"),fU=e=>YM(e).replace(/"/g,""").replace(/\t/g,"	").replace(/\n/g,"
").replace(/\r/g,"
");function lx(){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}="${fU(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+=YM(u),a),toString:()=>e};return a}const KM=e=>JM(lx(),e)+"";function JM(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):JM(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"},QM={fill:"none","stroke-miterlimit":10},ul=0,BS="http://www.w3.org/2000/xmlns/",rt=dc.xmlns;class cx extends Yc{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(BS,"xmlns",rt),this._svg.setAttributeNS(BS,"xmlns:xlink",dc["xmlns:xlink"]),this._svg.setAttribute("version",dc.version),this._svg.setAttribute("class","marks"),Wn(t,1),this._root=ot(this._svg,ul,"g",rt),yo(this._root,QM),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&&(yo(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),yo(i,{width:this._width,height:this._height,fill:n}));const r=KM(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=In[o]),r.zdirty&&r.dirty!==n&&(this._dirtyAll=!1,US(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,US(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=In[s],u=n.interactive===!1?"none":null,l=a.tag==="g",c=jS(n,t,i,"g",o);if(s!=="group"&&r!=null&&!r.includes(s))return Wn(c,0),n._svg;c.setAttribute("class",NM(n));const f=VM(n);for(const p in f)Kt(c,p,f[p]);l||Kt(c,"pointer-events",u),Kt(c,"clip-path",n.clip?Uv(this,n,n.group):null);let d=null,h=0;const g=p=>{const m=this.isDirty(p),y=jS(p,c,d,a.tag,o);m&&(this._update(a,y,p),l&&gU(this,y,p,r)),d=y,++h};return a.nested?n.items.length&&g(n.items[0]):wi(n,g),Wn(c,h),c}_update(t,n,i){Dr=n,Pt=n.__values__,GM(Hl,i),t.attr(Hl,i,this);const r=mU[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===Pt[i])continue;const o=ah[i];r==null?t.removeAttribute(o):(zv(r)&&(r=lM(r,this._defs.gradient,ZM())),t.setAttribute(o,r+"")),Pt[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=dU(i,n.gradient[o],r);for(const o in n.clipping)i||(n.el=i=ot(t,ul+1,"defs",rt)),r=hU(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 US(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 dU(e,t,n){let i,r,o;if(t.gradient==="radial"){let s=ot(e,n++,"pattern",rt);yo(s,{id:Kd+t.id,viewBox:"0,0,1,1",width:"100%",height:"100%",preserveAspectRatio:"xMidYMid slice"}),s=ot(s,0,"rect",rt),yo(s,{width:1,height:1,fill:`url(${ZM()}#${t.id})`}),e=ot(e,n++,"radialGradient",rt),yo(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),yo(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 hU(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),yo(i,{x:0,y:0,width:t.width,height:t.height})),Wn(e,1),n+1}function gU(e,t,n,i){t=t.lastChild.previousSibling;let r,o=0;wi(n,s=>{r=e.mark(t,s,r,i),++o}),Wn(t,1+o)}function jS(e,t,n,i,r){let o=e._svg,s;if(!o&&(s=t.ownerDocument,o=mo(s,i,rt),e._svg=o,e.mark&&(o.__data__=e,o.__values__={fill:"default"},i==="g"))){const a=mo(s,"path",rt);o.appendChild(a),a.__data__=e;const u=mo(s,"g",rt);o.appendChild(u),u.__data__=e;const l=mo(s,"path",rt);o.appendChild(l),l.__data__=e,l.__values__={fill:"default"}}return(o.ownerSVGElement!==r||pU(o,n))&&t.insertBefore(o,n?n.nextSibling:t.firstChild),o}function pU(e,t){return e.parentNode&&e.parentNode.childNodes.length>1&&e.previousSibling!=t}let Dr=null,Pt=null;const mU={group(e,t,n){const i=Dr=t.childNodes[2];Pt=i.__values__,e.foreground(Hl,n,this),Pt=t.__values__,Dr=t.childNodes[1],e.content(Hl,n,this);const r=Dr=t.childNodes[0];e.background(Hl,n,this);const o=n.mark.interactive===!1?"none":null;if(o!==Pt.events&&(Kt(i,"pointer-events",o),Kt(r,"pointer-events",o),Pt.events=o),n.strokeForeground&&n.stroke){const s=n.fill;Kt(i,"display",null),this.style(r,n),Kt(r,"stroke",null),s&&(n.fill=null),Pt=i.__values__,this.style(i,n),s&&(n.fill=s),Dr=null}else Kt(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=Vc(n);let r,o,s,a;L(i)?(o=i.map(u=>Ro(n,u)),r=o.join(`
|
7
|
-
`),r!==Pt.text&&(Wn(t,0),s=t.ownerDocument,a=Do(n),o.forEach((u,l)=>{const c=mo(s,"tspan",rt);c.__data__=n,c.textContent=u,l&&(c.setAttribute("x",0),c.setAttribute("dy",a)),t.appendChild(c)}),Pt.text=r)):(o=Ro(n,i),o!==Pt.text&&(t.textContent=o,Pt.text=o)),Kt(t,"font-family",Xc(n)),Kt(t,"font-size",cr(n)+"px"),Kt(t,"font-style",n.fontStyle),Kt(t,"font-variant",n.fontVariant),Kt(t,"font-weight",n.fontWeight)}};function Hl(e,t,n){t!==Pt[e]&&(n?yU(Dr,e,t,n):Kt(Dr,e,t),Pt[e]=t)}function xd(e,t,n){n!==Pt[t]&&(n==null?e.style.removeProperty(t):e.style.setProperty(t,n+""),Pt[t]=n)}function yo(e,t){for(const n in t)Kt(e,n,t[n])}function Kt(e,t,n){n!=null?e.setAttribute(t,n):e.removeAttribute(t)}function yU(e,t,n,i){n!=null?e.setAttributeNS(i,t,n):e.removeAttributeNS(i,t)}function ZM(){let e;return typeof window>"u"?"":(e=window.location).hash?e.href.slice(0,-e.hash.length):e.href}class eO extends Yc{constructor(t){super(t),this._text=null,this._defs={gradient:{},clipping:{}}}svg(){return this._text}_render(t){const n=lx();n.open("svg",ce({},dc,{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",QM,{transform:"translate("+this._origin+")"}),this.mark(n,t),n.close(),this.defs(n),this._text=n.close()+"",this}mark(t,n){const i=In[n.marktype],r=i.tag,o=[GM,i.attr];t.open("g",{class:NM(n),"clip-path":n.clip?Uv(this,n,n.group):null},VM(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=Vc(a);if(L(l)){const c={x:0,dy:Do(a)};for(let f=0;f<l.length;++f)t.open("tspan",f?c:null).text(Ro(a,l[f])).close()}else t.text(Ro(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)),wi(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]):wi(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&&bU(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 bU(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"]=cr(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=lM(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 li={svgMarkTypes:["text"],svgOnTop:!0,debug:!1};function vU(e){li.svgMarkTypes=e.svgMarkTypes??["text"],li.svgOnTop=e.svgOnTop??!0,li.debug=e.debug??!1}class h1 extends Yc{constructor(t){super(t),this._svgRenderer=new cx(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",li.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=li.svgOnTop?a:s,this._canvasEl=li.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 li.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=>!li.svgMarkTypes.includes(o));this._svgRenderer.render(t,li.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 li.svgOnTop?this._canvasRenderer.background(t):this._svgRenderer.background(t),this}}class tO extends Kc{constructor(t,n){super(t,n)}initialize(t,n,i){const r=ot(ot(t,0,"div"),li.svgOnTop?0:1,"div");return super.initialize(r,n,i)}}const nO="canvas",iO="hybrid",rO="png",oO="svg",sO="none",bo={Canvas:nO,PNG:rO,SVG:oO,Hybrid:iO,None:sO},Ls={};Ls[nO]=Ls[rO]={renderer:sh,headless:sh,handler:Kc};Ls[oO]={renderer:cx,headless:eO,handler:jM};Ls[iO]={renderer:h1,headless:h1,handler:tO};Ls[sO]={};function Qg(e,t){return e=String(e||"").toLowerCase(),arguments.length>1?(Ls[e]=t,this):Ls[e]}function aO(e,t,n){const i=[],r=new it().union(t),o=e.marktype;return o?uO(e,r,n,i):o==="group"?lO(e,r,n,i):N("Intersect scene must be mark node or group item.")}function uO(e,t,n,i){if(xU(e,t,n)){const r=e.items,o=e.marktype,s=r.length;let a=0;if(o==="group")for(;a<s;++a)lO(r[a],t,n,i);else for(const u=In[o].isect;a<s;++a){const l=r[a];cO(l,t,u)&&i.push(l)}}return i}function xU(e,t,n){return e.bounds&&t.intersects(e.bounds)&&(e.marktype==="group"||e.interactive!==!1&&(!n||n(e)))}function lO(e,t,n,i){n&&n(e.mark)&&cO(e,t,In.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)uO(r[u],t,n,i);t.translate(s,a)}return i}function cO(e,t,n){const i=e.bounds;return t.encloses(i)||t.intersects(i)&&n(e,t)}const Pm=new it;function fO(e){const t=e.clip;if(fe(t))t(Hc(Pm.clear()));else if(t)Pm.set(0,0,e.group.width,e.group.height);else return;e.bounds.intersect(Pm)}const wU=1e-9;function fx(e,t,n){return e===t?!0:n==="path"?dO(e,t):e instanceof Date&&t instanceof Date?+e==+t:$e(e)&&$e(t)?Math.abs(e-t)<=wU:!e||!t||!X(e)&&!X(t)?e==t:EU(e,t)}function dO(e,t){return fx(iu(e),iu(t))}function EU(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],!fx(e[r],t[r],r))return!1;return typeof e==typeof t}function SU(){mM(),V8()}const su="top",di="left",hi="right",No="bottom",_U="top-left",$U="top-right",AU="bottom-left",kU="bottom-right",dx="start",g1="middle",Jt="end",CU="x",FU="y",Zg="group",hx="axis",gx="title",TU="frame",MU="scope",px="legend",hO="row-header",gO="row-footer",pO="row-title",mO="column-header",yO="column-footer",bO="column-title",OU="padding",DU="symbol",vO="fit",xO="fit-x",wO="fit-y",RU="pad",mx="none",Tf="all",p1="each",yx="flush",vo="column",xo="row";function EO(e){O.call(this,null,e)}G(EO,O,{transform(e,t){const n=t.dataflow,i=e.mark,r=i.marktype,o=In[r],s=o.bound;let a=i.bounds,u;if(o.nested)i.items.length&&n.dirty(i.items[0]),a=Mf(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(Mf(l,s))),i.role){case hx:case px:case gx:t.reflow()}else u=t.changed(t.REM),t.visit(t.ADD,l=>{a.union(Mf(l,s))}),t.visit(t.MOD,l=>{u=u||a.alignsWith(l.bounds),n.dirty(l),a.union(Mf(l,s))}),u&&(a.clear(),i.items.forEach(l=>a.union(l.bounds)));return fO(i),t.modifies("bounds")}});function Mf(e,t,n){return t(e.bounds.clear(),e,n)}const WS=":vega_identifier:";function bx(e){O.call(this,0,e)}bx.Definition={type:"Identifier",metadata:{modifies:!0},params:[{name:"as",type:"string",required:!0}]};G(bx,O,{transform(e,t){const n=NU(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 NU(e){return e._signals[WS]||(e._signals[WS]=e.add(0))}function SO(e){O.call(this,null,e)}G(SO,O,{transform(e,t){let n=this.value;n||(n=t.dataflow.scenegraph().mark(e.markdef,LU(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?qg:Wg;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 LU(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 _O(e){O.call(this,null,e)}const qS={parity:e=>e.filter((t,n)=>n%2?t.opacity=0:1),greedy:(e,t)=>{let n;return e.filter((i,r)=>!r||!$O(n.bounds,i.bounds,t)?(n=i,1):i.opacity=0)}},$O=(e,t,n)=>n>Math.max(t.x1-e.x2,e.x1-t.x2,t.y1-e.y2,e.y1-t.y2),HS=(e,t)=>{for(var n=1,i=e.length,r=e[0].bounds,o;n<i;r=o,++n)if($O(r,o=e[n].bounds,t))return!0},PU=e=>{const t=e.bounds;return t.width()>1&&t.height()>1},zU=(e,t,n)=>{var i=e.range(),r=new it;return t===su||t===No?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)},GS=e=>(e.forEach(t=>t.opacity=1),e),VS=(e,t)=>e.reflow(t.modified()).modifies("opacity");G(_O,O,{transform(e,t){const n=qS[e.method]||qS.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")&&(GS(r),t=VS(t,e)),t;if(r=r.filter(PU),!r.length)return;if(e.sort&&(r=r.slice().sort(e.sort)),o=GS(r),t=VS(t,e),o.length>=3&&HS(o,i)){do o=n(o,i);while(o.length>=3&&HS(o,i));o.length<3&&!xe(r).opacity&&(o.length>1&&(xe(o).opacity=0),xe(r).opacity=1)}e.boundScale&&e.boundTolerance>=0&&(s=zU(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 AO(e){O.call(this,null,e)}G(AO,O,{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 Lt=new it;function Da(e,t,n){return e[t]===n?0:(e[t]=n,1)}function IU(e){var t=e.items[0].orient;return t===di||t===hi}function BU(e){let t=+e.grid;return[e.ticks?t++:-1,e.labels?t++:-1,t+ +e.domain]}function UU(e,t,n,i){var r=t.items[0],o=r.datum,s=r.translate!=null?r.translate:.5,a=r.orient,u=BU(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&&ex(g),b=0,v=0,x,E;switch(Lt.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 su: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 di: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 hi: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 No: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 Vr(m.translate(b,v),r),Da(r,"x",b+s)|Da(r,"y",v+s)&&(r.bounds=Lt,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 XS=(e,t)=>Math.floor(Math.min(e,t)),YS=(e,t)=>Math.ceil(Math.max(e,t));function jU(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 hx:case px:case gx:break;case hO:s.rowheaders.push(...o);break;case gO:s.rowfooters.push(...o);break;case mO:s.colheaders.push(...o);break;case yO:s.colfooters.push(...o);break;case pO:s.rowtitle=o[0];break;case bO:s.coltitle=o[0];break;default:s.marks.push(...o)}return s}function WU(e){return new it().set(0,0,e.width||0,e.height||0)}function qU(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=X(e)?e[t]:e;return i??(n!==void 0?n:0)}function KS(e){return e<0?Math.ceil(-e):0}function kO(e,t,n){var i=!n.nodirty,r=n.bounds===yx?WU:qU,o=Lt.set(0,0,0,0),s=je(n.align,vo),a=je(n.align,xo),u=je(n.padding,vo),l=je(n.padding,xo),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,_,$,C,T,D,k,F,A,M;for(w=0;w<c;++w)g[w]=0;for(w=0;w<f;++w)y[w]=0;for(w=0;w<d;++w)T=t[w],C=E[w]=r(T),T.x=T.x||0,v[w]=0,T.y=T.y||0,x[w]=0,_=w%c,$=~~(w/c),p=Math.max(p,D=Math.ceil(C.x2)),b=Math.max(b,k=Math.ceil(C.y2)),g[_]=Math.max(g[_],D),y[$]=Math.max(y[$],k),h[w]=u+KS(C.x1),m[w]=l+KS(C.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===p1)for(_=1;_<c;++_){for(M=0,w=_;w<d;w+=c)M<h[w]&&(M=h[w]);for(w=_;w<d;w+=c)h[w]=M+g[_-1]}else if(s===Tf){for(M=0,w=0;w<d;++w)w%c&&M<h[w]&&(M=h[w]);for(w=0;w<d;++w)w%c&&(h[w]=M+p)}else for(s=!1,_=1;_<c;++_)for(w=_;w<d;w+=c)h[w]+=g[_-1];if(a===p1)for($=1;$<f;++$){for(M=0,w=$*c,S=w+c;w<S;++w)M<m[w]&&(M=m[w]);for(w=$*c;w<S;++w)m[w]=M+y[$-1]}else if(a===Tf){for(M=0,w=c;w<d;++w)M<m[w]&&(M=m[w]);for(w=c;w<d;++w)m[w]=M+b}else for(a=!1,$=1;$<f;++$)for(w=$*c,S=w+c;w<S;++w)m[w]+=y[$-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(A=0,w=_;w<d;w+=c)A+=m[w],x[w]+=A-t[w].y;if(s&&je(n.center,vo)&&f>1)for(w=0;w<d;++w)C=s===Tf?p:g[w%c],F=C-E[w].x2-t[w].x-v[w],F>0&&(v[w]+=F/2);if(a&&je(n.center,xo)&&c!==1)for(w=0;w<d;++w)C=a===Tf?b:y[~~(w/c)],A=C-E[w].y2-t[w].y-x[w],A>0&&(x[w]+=A/2);for(w=0;w<d;++w)o.union(E[w].translate(v[w],x[w]));switch(F=je(n.anchor,CU),A=je(n.anchor,FU),je(n.anchor,vo)){case Jt:F-=o.width();break;case g1:F-=o.width()/2}switch(je(n.anchor,xo)){case Jt:A-=o.height();break;case g1:A-=o.height()/2}for(F=Math.round(F),A=Math.round(A),o.clear(),w=0;w<d;++w)t[w].mark.bounds.clear();for(w=0;w<d;++w)T=t[w],T.x+=v[w]+=F,T.y+=x[w]+=A,o.union(T.mark.bounds.union(T.bounds.translate(v[w],x[w]))),i&&e.dirty(T);return o}function HU(e,t,n){var i=jU(t),r=i.marks,o=n.bounds===yx?GU:VU,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=kO(e,r,n);y.empty()&&y.set(0,0,0,0),i.rowheaders&&(p=je(n.headerBand,xo,null),c=Df(e,i.rowheaders,r,a,u,-je(s,"rowHeader"),XS,0,o,"x1",0,a,1,p)),i.colheaders&&(p=je(n.headerBand,vo,null),f=Df(e,i.colheaders,r,a,a,-je(s,"columnHeader"),XS,1,o,"y1",0,1,a,p)),i.rowfooters&&(p=je(n.footerBand,xo,null),d=Df(e,i.rowfooters,r,a,u,je(s,"rowFooter"),YS,0,o,"x2",a-1,a,1,p)),i.colfooters&&(p=je(n.footerBand,vo,null),h=Df(e,i.colfooters,r,a,a,je(s,"columnFooter"),YS,1,o,"y2",l-a,1,a,p)),i.rowtitle&&(g=je(n.titleAnchor,xo),m=je(s,"rowTitle"),m=g===Jt?d+m:c-m,p=je(n.titleBand,xo,.5),JS(e,i.rowtitle,m,0,y,p)),i.coltitle&&(g=je(n.titleAnchor,vo),m=je(s,"columnTitle"),m=g===Jt?h+m:f-m,p=je(n.titleBand,vo,.5),JS(e,i.coltitle,m,1,y,p))}function GU(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 VU(e,t){return e.bounds[t]}function Df(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,_,$;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()),$=p):(_=p,$=h==null?w.y:Math.round(w.bounds.y1+h*w.bounds.height())),E.union(S.bounds.translate(_-(S.x||0),$-(S.y||0))),S.x=_,S.y=$,e.dirty(S),m=s(m,E[l])}return m}function JS(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 XU(e,t){const n=e[t]||{};return(i,r)=>n[i]!=null?n[i]:e[i]!=null?e[i]:r}function YU(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 KU(e,t,n,i,r,o,s){const a=XU(n,t),u=YU(e,a("offset",0)),l=a("anchor",dx),c=l===Jt?1:l===g1?.5:0,f={align:p1,bounds:a("bounds",yx),columns:a("direction")==="vertical"?1:e.length,padding:a("margin",8),center:a("center"),nodirty:!0};switch(t){case di:f.anchor={x:Math.floor(i.x1)-u,column:Jt,y:c*(s||i.height()+2*i.y1),row:l};break;case hi:f.anchor={x:Math.ceil(i.x2)+u,y:c*(s||i.height()+2*i.y1),row:l};break;case su:f.anchor={y:Math.floor(r.y1)-u,row:Jt,x:c*(o||r.width()+2*r.x1),column:l};break;case No:f.anchor={y:Math.ceil(r.y2)+u,x:c*(o||r.width()+2*r.x1),column:l};break;case _U:f.anchor={x:u,y:u};break;case $U:f.anchor={x:o-u,y:u,column:Jt};break;case AU:f.anchor={x:u,y:s-u,row:Jt};break;case kU:f.anchor={x:o-u,y:s-u,column:Jt,row:Jt};break}return f}function JU(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(),ZU(e,n,n.items[0].items[0]),o=QU(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===DU&&ej(n.items[0].items[0].items[0].items),r!==mx&&(n.x=s=0,n.y=a=0),n.width=u,n.height=l,Vr(o.set(s,a,s+u,a+l),n),n.mark.bounds.clear().union(o),n}function QU(e,t){return e.items.forEach(n=>t.union(n.bounds)),t.x1=e.padding,t.y1=e.padding,t}function ZU(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 di:r+=Math.ceil(s.bounds.width())+u;break;case hi:case No:break;default:o+=s.bounds.height()+u}switch((r||o)&&ll(e,n,r,o),s.orient){case di:c+=va(t,n,s,a,1,1);break;case hi:l+=va(t,n,s,Jt,0,0)+u,c+=va(t,n,s,a,1,1);break;case No:l+=va(t,n,s,a,0,0),c+=va(t,n,s,Jt,-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:ex(n);return Math.round(i===dx?f:i===Jt?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 ej(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 tj(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===di||a===hi?i:n,g=0,p=0,m=0,y=0,b=0,v;if(s!==Zg?a===di?(g=r.y2,h=r.y1):a===hi?(g=r.y1,h=r.y2):(g=r.x1,h=r.x2):a===di&&(g=i,h=0),v=u===dx?g:u===Jt?h:(g+h)/2,d&&d.text){switch(a){case su:case No:b=f.bounds.height()+c;break;case di:y=f.bounds.width()+c;break;case hi:y=-f.bounds.width()-c;break}Lt.clear().union(d.bounds),Lt.translate(y-(d.x||0),b-(d.y||0)),Da(d,"x",y)|Da(d,"y",b)&&(e.dirty(d),d.bounds.clear().union(Lt),d.mark.bounds.clear().union(Lt),e.dirty(d)),Lt.clear().union(d.bounds)}else Lt.clear();switch(Lt.union(f.bounds),a){case su:p=v,m=r.y1-Lt.height()-l;break;case di:p=r.x1-Lt.width()-l,m=v;break;case hi:p=r.x2+Lt.width()+l,m=v;break;case No:p=v,m=r.y2+l;break;default:p=o.x,m=o.y}return Da(o,"x",p)|Da(o,"y",m)&&(Lt.translate(p,m),e.dirty(o),o.bounds.clear().union(Lt),t.bounds.clear().union(Lt),e.dirty(o)),o.bounds}function CO(e){O.call(this,null,e)}G(CO,O,{transform(e,t){const n=t.dataflow;return e.mark.items.forEach(i=>{e.layout&&HU(n,i,e.layout),ij(n,i,e)}),nj(e.mark.group)?t.reflow():t}});function nj(e){return e&&e.mark.role!=="legend-entry"}function ij(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 hx:h=IU(f)?a:u,h.union(UU(e,f,r,o));break;case gx:c=f;break;case px:l.push(JU(e,f));break;case TU:case MU:case hO:case gO:case pO:case mO:case yO:case bO: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||hi,d!==mx&&(m[d]||(m[d]=[])).push(y)});for(const y in m){const b=m[y];kO(e,b,KU(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===vO||n.autosize.type===xO||n.autosize.type===wO))switch(y.orient){case di:case hi:s.add(b.x1,0).add(b.x2,0);break;case su:case No:s.add(0,b.y1).add(0,b.y2)}else s.union(b)})}s.union(a).union(u),c&&s.union(tj(e,c,r,o,s)),t.clip&&s.set(0,0,t.width||0,t.height||0),rj(e,t,s,n)}function rj(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===OU){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===vO?(u=Math.max(0,s-l-d),c=Math.max(0,a-f-h)):o===xO?(u=Math.max(0,s-l-d),a=c+f+h):o===wO?(s=u+l+d,c=Math.max(0,a-f-h)):o===RU&&(s=u+l+d,a=c+f+h),e._resizeView(s,a,u,c,[l,f],r.resize)}const oj=Object.freeze(Object.defineProperty({__proto__:null,bound:EO,identifier:bx,mark:SO,overlap:_O,render:AO,viewlayout:CO},Symbol.toStringTag,{value:"Module"}));function FO(e){O.call(this,null,e)}G(FO,O,{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=Lv(o,s,e.minstep),u=e.format||nM(n,o,a,e.formatSpecifier,e.formatType,!!e.values),l=e.values?tM(o,e.values,a):Pv(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){O.call(this,null,e)}function sj(){return Ce({})}function aj(e){const t=Mu().test(n=>n.exit);return t.lookup=n=>t.get(e(n)),t}G(TO,O,{transform(e,t){var n=t.dataflow,i=t.fork(t.NO_SOURCE|t.NO_FIELDS),r=e.item||sj,o=e.key||re,s=this.value;return L(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=aj(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 MO(e){O.call(this,null,e)}G(MO,O,{transform(e,t){var n=t.fork(t.ADD_REM),i=e.mod||!1,r=e.encoders,o=t.encode;if(L(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||ro,u=r.enter||ro,l=r.exit||ro,c=(o&&!s?r[o]:a)||ro;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!==ro&&c!==a&&(t.visit(t.ADD,f=>{c(f,e)}),n.modifies(c.output))),t.changed(t.REM)&&l!==ro&&(t.visit(t.REM,f=>{l(f,e)}),n.modifies(l.output)),s||c!==ro){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 OO(e){O.call(this,[],e)}G(OO,O,{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=Lv(s,e.count==null?5:e.count,e.minstep),l=!!e.values||o===dd,c=e.format||sM(n,s,u,o,e.formatSpecifier,e.formatType,l),f=e.values||oM(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,fe(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=Vt(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===R8?(d=s.domain(),h=QT(s,d[0],xe(d)),f.length<3&&!e.values&&d[0]!==xe(d)&&(f=[d[0],xe(d)]),r=f.map((y,b)=>Ce({index:b,label:c(y,b,f),value:y,perc:h(y)}))):(g=f.length-1,h=H8(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 uj=e=>e.source.x,lj=e=>e.source.y,cj=e=>e.target.x,fj=e=>e.target.y;function vx(e){O.call(this,{},e)}vx.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(vx,O,{transform(e,t){var n=e.sourceX||uj,i=e.sourceY||lj,r=e.targetX||cj,o=e.targetY||fj,s=e.as||"path",a=e.orient||"vertical",u=e.shape||"line",l=QS.get(u+"-"+a)||QS.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 DO=(e,t,n,i)=>"M"+e+","+t+"L"+n+","+i,dj=(e,t,n,i)=>DO(t*Math.cos(e),t*Math.sin(e),i*Math.cos(n),i*Math.sin(n)),RO=(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},hj=(e,t,n,i)=>RO(t*Math.cos(e),t*Math.sin(e),i*Math.cos(n),i*Math.sin(n)),NO=(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},gj=(e,t,n,i)=>NO(t*Math.cos(e),t*Math.sin(e),i*Math.cos(n),i*Math.sin(n)),pj=(e,t,n,i)=>"M"+e+","+t+"V"+i+"H"+n,mj=(e,t,n,i)=>"M"+e+","+t+"H"+n+"V"+i,yj=(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},bj=(e,t,n,i)=>{const r=(e+n)/2;return"M"+e+","+t+"C"+r+","+t+" "+r+","+i+" "+n+","+i},vj=(e,t,n,i)=>{const r=(t+i)/2;return"M"+e+","+t+"C"+e+","+r+" "+n+","+r+" "+n+","+i},xj=(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},QS=Mu({line:DO,"line-radial":dj,arc:RO,"arc-radial":hj,curve:NO,"curve-radial":gj,"orthogonal-horizontal":pj,"orthogonal-vertical":mj,"orthogonal-radial":yj,"diagonal-horizontal":bj,"diagonal-vertical":vj,"diagonal-radial":xj});function xx(e){O.call(this,null,e)}xx.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(xx,O,{transform(e,t){var n=e.as||["startAngle","endAngle"],i=n[0],r=n[1],o=e.field||Cu,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)/bC(l),h=Tn(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 wj=5;function Ej(e){const t=e.type;return!e.bins&&(t===eu||t===zc||t===Ic)}function LO(e){return Dv(e)&&e!==Ki}const Sj=vi(["set","modified","clear","type","scheme","schemeExtent","schemeCount","domain","domainMin","domainMid","domainMax","domainRaw","domainImplicit","nice","zero","bins","range","rangeStep","round","reverse","interpolate","interpolateGamma"]);function PO(e){O.call(this,null,e),this.modified(!0)}G(PO,O,{transform(e,t){var n=t.dataflow,i=this.value,r=_j(e);(!i||r!==i.type)&&(this.value=i=ke(r)());for(r in e)if(!Sj[r]){if(r==="padding"&&LO(i.type))continue;fe(i[r])?i[r](e[r]):n.warn("Unsupported scale property: "+r)}return Tj(i,e,Fj(i,e,Aj(i,e,n))),t.fork(t.NO_SOURCE|t.NO_FIELDS)}});function _j(e){var t=e.type,n="",i;return t===Ki?Ki+"-"+eu:($j(e)&&(i=e.rawDomain?e.rawDomain.length:e.domain?e.domain.length+ +(e.domainMid!=null):0,n=i===2?Ki+"-":i===3?Pu+"-":""),(n+t||eu).toLowerCase())}function $j(e){const t=e.type;return Dv(t)&&t!==Rs&&t!==Ns&&(e.scheme||e.range&&e.range.length&&e.range.every(K))}function Aj(e,t,n){const i=kj(e,t.domainRaw,n);if(i>-1)return i;var r=t.domain,o=e.type,s=t.zero||t.zero===void 0&&Ej(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 LO(o)&&t.padding&&r[0]!==xe(r)&&(r=Cj(o,r,t.range,t.padding,t.exponent,t.constant)),e.domain(zO(o,r,n)),o===Fv&&e.unknown(t.domainImplicit?Z0:void 0),t.nice&&e.nice&&e.nice(t.nice!==!0&&Lv(e,t.nice)||null),r.length}function kj(e,t,n){return t?(e.domain(zO(e.type,t,n)),t.length):-1}function Cj(e,t,n,i,r,o){var s=Math.abs(xe(n)-n[0]),a=s/(s-2*i),u=e===Wr?nb(t,null,a):e===Ic?Ld(t,null,a,.5):e===zc?Ld(t,null,a,r||1):e===zg?ib(t,null,a,o||1):tb(t,null,a);return t=t.slice(),t[0]=u[0],t[t.length-1]=u[1],t}function zO(e,t,n){if(VT(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 Fj(e,t,n){let i=t.bins;if(i&&!L(i)){const r=e.domain(),o=r[0],s=xe(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=Tn(u,l+a/2,a)}return i?e.bins=i:e.bins&&delete e.bins,e.type===Tv&&(i?!t.domain&&!t.domainRaw&&(e.domain(i),n=i.length):e.bins=e.domain()),n}function Tj(e,t,n){var i=e.type,r=t.round||!1,o=t.range;if(t.rangeStep!=null)o=Mj(i,t,n);else if(t.scheme&&(o=Oj(i,t,n),fe(o))){if(e.interpolator)return e.interpolator(o);N(`Scale type ${i} does not support interpolating color schemes.`)}if(o&&XT(i))return e.interpolator(Ug(m1(o,t.reverse),t.interpolate,t.interpolateGamma));o&&t.interpolate&&e.interpolate?e.interpolate(Rv(t.interpolate,t.interpolateGamma)):fe(e.round)?e.round(r):fe(e.rangeRound)&&e.interpolate(r?ug:Oc),o&&e.range(m1(o,t.reverse))}function Mj(e,t,n){e!==UT&&e!==t1&&N("Only band and point scales support rangeStep.");var i=(t.paddingOuter!=null?t.paddingOuter:t.padding)||0,r=e===t1?1:(t.paddingInner!=null?t.paddingInner:t.padding)||0;return[0,t.rangeStep*Cv(n,r,i)]}function Oj(e,t,n){var i=t.schemeExtent,r,o;return L(t.scheme)?o=Ug(t.scheme,t.interpolate,t.interpolateGamma):(r=t.scheme.toLowerCase(),o=Nv(r),o||N(`Unrecognized scheme name: ${t.scheme}`)),n=e===Bg?n+1:e===Tv?n-1:e===tu||e===Ig?+t.schemeCount||wj:n,XT(e)?ZS(o,i,t.reverse):fe(o)?JT(ZS(o,i),n):e===Fv?o:o.slice(0,n)}function ZS(e,t,n){return fe(e)&&(t||n)?KT(e,m1(t||[0,1],n)):e}function m1(e,t){return t?e.slice().reverse():e}function IO(e){O.call(this,null,e)}G(IO,O,{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 e_="zero",BO="center",UO="normalize",jO=["y0","y1"];function wx(e){O.call(this,null,e)}wx.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:e_,values:[e_,BO,UO]},{name:"as",type:"string",array:!0,length:2,default:jO}]};G(wx,O,{transform(e,t){var n=e.as||jO,i=n[0],r=n[1],o=ea(e.sort),s=e.field||Cu,a=e.offset===BO?Dj:e.offset===UO?Rj:Nj,u,l,c,f;for(u=Lj(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 Dj(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 Rj(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 Nj(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 Lj(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 Pj=Object.freeze(Object.defineProperty({__proto__:null,axisticks:FO,datajoin:TO,encode:MO,legendentries:OO,linkpath:vx,pie:xx,scale:PO,sortitems:IO,stack:wx},Symbol.toStringTag,{value:"Module"}));var ae=1e-6,y1=1e-12,me=Math.PI,Ye=me/2,lh=me/4,an=me*2,Ze=180/me,ge=me/180,ve=Math.abs,Iu=Math.atan,ei=Math.atan2,se=Math.cos,Rf=Math.ceil,WO=Math.exp,b1=Math.hypot,ch=Math.log,zm=Math.pow,oe=Math.sin,Gn=Math.sign||function(e){return e>0?1:e<0?-1:0},un=Math.sqrt,Ex=Math.tan;function qO(e){return e>1?0:e<-1?me:Math.acos(e)}function xn(e){return e>1?Ye:e<-1?-Ye:Math.asin(e)}function At(){}function fh(e,t){e&&n_.hasOwnProperty(e.type)&&n_[e.type](e,t)}var t_={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)}},n_={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){v1(e.coordinates,t,0)},MultiLineString:function(e,t){for(var n=e.coordinates,i=-1,r=n.length;++i<r;)v1(n[i],t,0)},Polygon:function(e,t){i_(e.coordinates,t)},MultiPolygon:function(e,t){for(var n=e.coordinates,i=-1,r=n.length;++i<r;)i_(n[i],t)},GeometryCollection:function(e,t){for(var n=e.geometries,i=-1,r=n.length;++i<r;)fh(n[i],t)}};function v1(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 i_(e,t){var n=-1,i=e.length;for(t.polygonStart();++n<i;)v1(e[n],t,1);t.polygonEnd()}function kr(e,t){e&&t_.hasOwnProperty(e.type)?t_[e.type](e,t):fh(e,t)}var dh=new on,hh=new on,HO,GO,x1,w1,E1,ir={point:At,lineStart:At,lineEnd:At,polygonStart:function(){dh=new on,ir.lineStart=zj,ir.lineEnd=Ij},polygonEnd:function(){var e=+dh;hh.add(e<0?an+e:e),this.lineStart=this.lineEnd=this.point=At},sphere:function(){hh.add(an)}};function zj(){ir.point=Bj}function Ij(){VO(HO,GO)}function Bj(e,t){ir.point=VO,HO=e,GO=t,e*=ge,t*=ge,x1=e,w1=se(t=t/2+lh),E1=oe(t)}function VO(e,t){e*=ge,t*=ge,t=t/2+lh;var n=e-x1,i=n>=0?1:-1,r=i*n,o=se(t),s=oe(t),a=E1*s,u=w1*o+a*se(r),l=a*i*oe(r);dh.add(ei(l,u)),x1=e,w1=o,E1=s}function Uj(e){return hh=new on,kr(e,ir),hh*2}function gh(e){return[ei(e[1],e[0]),xn(e[2])]}function Ps(e){var t=e[0],n=e[1],i=se(n);return[i*se(t),i*oe(t),oe(n)]}function Nf(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function au(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 Im(e,t){e[0]+=t[0],e[1]+=t[1],e[2]+=t[2]}function Lf(e,t){return[e[0]*t,e[1]*t,e[2]*t]}function ph(e){var t=un(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]/=t,e[1]/=t,e[2]/=t}var He,gn,Ve,Cn,gs,XO,YO,Ba,Gl,lo,qr,$r={point:S1,lineStart:r_,lineEnd:o_,polygonStart:function(){$r.point=JO,$r.lineStart=jj,$r.lineEnd=Wj,Gl=new on,ir.polygonStart()},polygonEnd:function(){ir.polygonEnd(),$r.point=S1,$r.lineStart=r_,$r.lineEnd=o_,dh<0?(He=-(Ve=180),gn=-(Cn=90)):Gl>ae?Cn=90:Gl<-1e-6&&(gn=-90),qr[0]=He,qr[1]=Ve},sphere:function(){He=-(Ve=180),gn=-(Cn=90)}};function S1(e,t){lo.push(qr=[He=e,Ve=e]),t<gn&&(gn=t),t>Cn&&(Cn=t)}function KO(e,t){var n=Ps([e*ge,t*ge]);if(Ba){var i=au(Ba,n),r=[i[1],-i[0],0],o=au(r,i);ph(o),o=gh(o);var s=e-gs,a=s>0?1:-1,u=o[0]*Ze*a,l,c=ve(s)>180;c^(a*gs<u&&u<a*e)?(l=o[1]*Ze,l>Cn&&(Cn=l)):(u=(u+360)%360-180,c^(a*gs<u&&u<a*e)?(l=-o[1]*Ze,l<gn&&(gn=l)):(t<gn&&(gn=t),t>Cn&&(Cn=t))),c?e<gs?kn(He,e)>kn(He,Ve)&&(Ve=e):kn(e,Ve)>kn(He,Ve)&&(He=e):Ve>=He?(e<He&&(He=e),e>Ve&&(Ve=e)):e>gs?kn(He,e)>kn(He,Ve)&&(Ve=e):kn(e,Ve)>kn(He,Ve)&&(He=e)}else lo.push(qr=[He=e,Ve=e]);t<gn&&(gn=t),t>Cn&&(Cn=t),Ba=n,gs=e}function r_(){$r.point=KO}function o_(){qr[0]=He,qr[1]=Ve,$r.point=S1,Ba=null}function JO(e,t){if(Ba){var n=e-gs;Gl.add(ve(n)>180?n+(n>0?360:-360):n)}else XO=e,YO=t;ir.point(e,t),KO(e,t)}function jj(){ir.lineStart()}function Wj(){JO(XO,YO),ir.lineEnd(),ve(Gl)>ae&&(He=-(Ve=180)),qr[0]=He,qr[1]=Ve,Ba=null}function kn(e,t){return(t-=e)<0?t+360:t}function qj(e,t){return e[0]-t[0]}function s_(e,t){return e[0]<=e[1]?e[0]<=t&&t<=e[1]:t<e[0]||e[1]<t}function Hj(e){var t,n,i,r,o,s,a;if(Cn=Ve=-(He=gn=1/0),lo=[],kr(e,$r),n=lo.length){for(lo.sort(qj),t=1,i=lo[0],o=[i];t<n;++t)r=lo[t],s_(i,r[0])||s_(i,r[1])?(kn(i[0],r[1])>kn(i[0],i[1])&&(i[1]=r[1]),kn(r[0],i[1])>kn(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=kn(i[1],r[0]))>s&&(s=a,He=r[0],Ve=i[1])}return lo=qr=null,He===1/0||gn===1/0?[[NaN,NaN],[NaN,NaN]]:[[He,gn],[Ve,Cn]]}var Ml,mh,yh,bh,vh,xh,wh,Eh,_1,$1,A1,QO,ZO,Qt,Zt,en,gi={sphere:At,point:Sx,lineStart:a_,lineEnd:u_,polygonStart:function(){gi.lineStart=Xj,gi.lineEnd=Yj},polygonEnd:function(){gi.lineStart=a_,gi.lineEnd=u_}};function Sx(e,t){e*=ge,t*=ge;var n=se(t);Jc(n*se(e),n*oe(e),oe(t))}function Jc(e,t,n){++Ml,yh+=(e-yh)/Ml,bh+=(t-bh)/Ml,vh+=(n-vh)/Ml}function a_(){gi.point=Gj}function Gj(e,t){e*=ge,t*=ge;var n=se(t);Qt=n*se(e),Zt=n*oe(e),en=oe(t),gi.point=Vj,Jc(Qt,Zt,en)}function Vj(e,t){e*=ge,t*=ge;var n=se(t),i=n*se(e),r=n*oe(e),o=oe(t),s=ei(un((s=Zt*o-en*r)*s+(s=en*i-Qt*o)*s+(s=Qt*r-Zt*i)*s),Qt*i+Zt*r+en*o);mh+=s,xh+=s*(Qt+(Qt=i)),wh+=s*(Zt+(Zt=r)),Eh+=s*(en+(en=o)),Jc(Qt,Zt,en)}function u_(){gi.point=Sx}function Xj(){gi.point=Kj}function Yj(){eD(QO,ZO),gi.point=Sx}function Kj(e,t){QO=e,ZO=t,e*=ge,t*=ge,gi.point=eD;var n=se(t);Qt=n*se(e),Zt=n*oe(e),en=oe(t),Jc(Qt,Zt,en)}function eD(e,t){e*=ge,t*=ge;var n=se(t),i=n*se(e),r=n*oe(e),o=oe(t),s=Zt*o-en*r,a=en*i-Qt*o,u=Qt*r-Zt*i,l=b1(s,a,u),c=xn(l),f=l&&-c/l;_1.add(f*s),$1.add(f*a),A1.add(f*u),mh+=c,xh+=c*(Qt+(Qt=i)),wh+=c*(Zt+(Zt=r)),Eh+=c*(en+(en=o)),Jc(Qt,Zt,en)}function Jj(e){Ml=mh=yh=bh=vh=xh=wh=Eh=0,_1=new on,$1=new on,A1=new on,kr(e,gi);var t=+_1,n=+$1,i=+A1,r=b1(t,n,i);return r<y1&&(t=xh,n=wh,i=Eh,mh<ae&&(t=yh,n=bh,i=vh),r=b1(t,n,i),r<y1)?[NaN,NaN]:[ei(n,t)*Ze,xn(i/r)*Ze]}function k1(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 C1(e,t){return ve(e)>me&&(e-=Math.round(e/an)*an),[e,t]}C1.invert=C1;function tD(e,t,n){return(e%=an)?t||n?k1(c_(e),f_(t,n)):c_(e):t||n?f_(t,n):C1}function l_(e){return function(t,n){return t+=e,ve(t)>me&&(t-=Math.round(t/an)*an),[t,n]}}function c_(e){var t=l_(e);return t.invert=l_(-e),t}function f_(e,t){var n=se(e),i=oe(e),r=se(t),o=oe(t);function s(a,u){var l=se(u),c=se(a)*l,f=oe(a)*l,d=oe(u),h=d*n+c*i;return[ei(f*r-h*o,c*n-d*i),xn(h*r+f*o)]}return s.invert=function(a,u){var l=se(u),c=se(a)*l,f=oe(a)*l,d=oe(u),h=d*r-f*o;return[ei(f*r+d*o,c*n+h*i),xn(h*n-c*i)]},s}function Qj(e){e=tD(e[0]*ge,e[1]*ge,e.length>2?e[2]*ge:0);function t(n){return n=e(n[0]*ge,n[1]*ge),n[0]*=Ze,n[1]*=Ze,n}return t.invert=function(n){return n=e.invert(n[0]*ge,n[1]*ge),n[0]*=Ze,n[1]*=Ze,n},t}function Zj(e,t,n,i,r,o){if(n){var s=se(t),a=oe(t),u=i*n;r==null?(r=t+i*an,o=t-u/2):(r=d_(s,r),o=d_(s,o),(i>0?r<o:r>o)&&(r+=i*an));for(var l,c=r;i>0?c>o:c<o;c-=u)l=gh([s,-a*se(c),-a*oe(c)]),e.point(l[0],l[1])}}function d_(e,t){t=Ps(t),t[0]-=e,ph(t);var n=qO(-t[1]);return((-t[2]<0?-n:n)+an-ae)%an}function nD(){var e=[],t;return{point:function(n,i,r){t.push([n,i,r])},lineStart:function(){e.push(t=[])},lineEnd:At,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 ve(e[0]-t[0])<ae&&ve(e[1]-t[1])<ae}function Pf(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 iD(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 Pf(m,g,null,!0)),s.push(b.o=new Pf(m,null,b,!1)),o.push(b=new Pf(y,g,null,!1)),s.push(b.o=new Pf(y,null,b,!0))}}),!!o.length){for(s.sort(t),h_(o),h_(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 h_(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 ve(e[0])<=me?e[0]:Gn(e[0])*((ve(e[0])+me)%an-me)}function eW(e,t){var n=Bm(t),i=t[1],r=oe(i),o=[oe(n),-se(n),0],s=0,a=0,u=new on;r===1?i=Ye+ae:r===-1&&(i=-Ye-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=oe(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=oe(E),w=se(E),_=x-g,$=_>=0?1:-1,C=$*_,T=C>me,D=m*S;if(u.add(ei(D*$*oe(C),y*w+D*se(C))),s+=T?_+$*an:_,T^g>=n^x>=n){var k=au(Ps(h),Ps(v));ph(k);var F=au(o,k);ph(F);var A=(T^_>=0?-1:1)*xn(F[2]);(i>A||i===A&&(k[0]||k[1]))&&(a+=T^_>=0?1:-1)}}return(s<-1e-6||s<ae&&u<-1e-12)^a&1}function rD(e,t,n,i){return function(r){var o=t(r),s=nD(),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=yC(c);var x=eW(l,i);c.length?(u||(r.polygonStart(),u=!0),iD(c,nW,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,_,$,C;if(f.pop(),l.push(f),f=null,!!w){if(x&1){if($=E[0],(_=$.length-1)>0){for(u||(r.polygonStart(),u=!0),r.lineStart(),S=0;S<_;++S)r.point((C=$[S])[0],C[1]);r.lineEnd()}return}w>1&&x&2&&E.push(E.pop().concat(E.shift())),c.push(E.filter(tW))}}return d}}function tW(e){return e.length>1}function nW(e,t){return((e=e.x)[0]<0?e[1]-Ye-ae:Ye-e[1])-((t=t.x)[0]<0?t[1]-Ye-ae:Ye-t[1])}const g_=rD(function(){return!0},iW,oW,[-me,-Ye]);function iW(e){var t=NaN,n=NaN,i=NaN,r;return{lineStart:function(){e.lineStart(),r=1},point:function(o,s){var a=o>0?me:-me,u=ve(o-t);ve(u-me)<ae?(e.point(t,n=(n+s)/2>0?Ye:-Ye),e.point(i,n),e.lineEnd(),e.lineStart(),e.point(a,n),e.point(o,n),r=0):i!==a&&u>=me&&(ve(t-i)<ae&&(t-=i*ae),ve(o-a)<ae&&(o-=a*ae),n=rW(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 rW(e,t,n,i){var r,o,s=oe(e-n);return ve(s)>ae?Iu((oe(t)*(o=se(i))*oe(n)-oe(i)*(r=se(t))*oe(e))/(r*o*s)):(t+i)/2}function oW(e,t,n,i){var r;if(e==null)r=n*Ye,i.point(-me,r),i.point(0,r),i.point(me,r),i.point(me,0),i.point(me,-r),i.point(0,-r),i.point(-me,-r),i.point(-me,0),i.point(-me,r);else if(ve(e[0]-t[0])>ae){var o=e[0]<t[0]?me:-me;r=n*o/2,i.point(-o,r),i.point(0,r),i.point(o,r)}else i.point(t[0],t[1])}function sW(e){var t=se(e),n=2*ge,i=t>0,r=ve(t)>ae;function o(c,f,d,h){Zj(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?me:-me),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=au(h,g),y=Nf(m,m),b=m[0],v=y-b*b;if(!v)return!d&&c;var x=t*y/v,E=-t*b/v,S=au(p,m),w=Lf(p,x),_=Lf(m,E);Im(w,_);var $=S,C=Nf(w,$),T=Nf($,$),D=C*C-T*(Nf(w,w)-1);if(!(D<0)){var k=un(D),F=Lf($,(-C-k)/T);if(Im(F,w),F=gh(F),!d)return F;var A=c[0],M=f[0],P=c[1],z=f[1],U;M<A&&(U=A,A=M,M=U);var te=M-A,ne=ve(te-me)<ae,de=ne||te<ae;if(!ne&&z<P&&(U=P,P=z,z=U),de?ne?P+z>0^F[1]<(ve(F[0]-A)<ae?P:z):P<=F[1]&&F[1]<=z:te>me^(A<=F[0]&&F[0]<=M)){var Se=Lf($,(-C+k)/T);return Im(Se,w),[F,gh(Se)]}}}function l(c,f){var d=i?e:me-e,h=0;return c<-d?h|=1:c>d&&(h|=2),f<-d?h|=4:f>d&&(h|=8),h}return rD(s,a,o,i?[0,-e]:[-me,e-me])}function aW(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,If=-1e9;function oD(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 ve(l[0]-e)<ae?c>0?0:3:ve(l[0]-n)<ae?c>0?2:1:ve(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=nD(),d,h,g,p,m,y,b,v,x,E,S,w={point:_,lineStart:D,lineEnd:k,polygonStart:C,polygonEnd:T};function _(A,M){r(A,M)&&c.point(A,M)}function $(){for(var A=0,M=0,P=h.length;M<P;++M)for(var z=h[M],U=1,te=z.length,ne=z[0],de,Se,we=ne[0],Pe=ne[1];U<te;++U)de=we,Se=Pe,ne=z[U],we=ne[0],Pe=ne[1],Se<=i?Pe>i&&(we-de)*(i-Se)>(Pe-Se)*(e-de)&&++A:Pe<=i&&(we-de)*(i-Se)<(Pe-Se)*(e-de)&&--A;return A}function C(){c=f,d=[],h=[],S=!0}function T(){var A=$(),M=S&&A,P=(d=yC(d)).length;(M||P)&&(l.polygonStart(),M&&(l.lineStart(),o(null,null,1,l),l.lineEnd()),P&&iD(d,a,A,o,l),l.polygonEnd()),c=l,d=h=g=null}function D(){w.point=F,h&&h.push(g=[]),E=!0,x=!1,b=v=NaN}function k(){d&&(F(p,m),y&&x&&f.rejoin(),d.push(f.result())),w.point=_,x&&c.lineEnd()}function F(A,M){var P=r(A,M);if(h&&g.push([A,M]),E)p=A,m=M,y=P,E=!1,P&&(c.lineStart(),c.point(A,M));else if(P&&x)c.point(A,M);else{var z=[b=Math.max(If,Math.min(zf,b)),v=Math.max(If,Math.min(zf,v))],U=[A=Math.max(If,Math.min(zf,A)),M=Math.max(If,Math.min(zf,M))];aW(z,U,e,t,n,i)?(x||(c.lineStart(),c.point(z[0],z[1])),c.point(U[0],U[1]),P||c.lineEnd(),S=!1):P&&(c.lineStart(),c.point(A,M),S=!1)}b=A,v=M,x=P}return w}}function p_(e,t,n){var i=Tn(e,t-ae,n).concat(t);return function(r){return i.map(function(o){return[r,o]})}}function m_(e,t,n){var i=Tn(e,t-ae,n).concat(t);return function(r){return i.map(function(o){return[o,r]})}}function uW(){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 Tn(Rf(i/c)*c,n,c).map(g).concat(Tn(Rf(a/f)*f,s,f).map(p)).concat(Tn(Rf(t/u)*u,e,u).filter(function(v){return ve(v%c)>ae}).map(d)).concat(Tn(Rf(o/l)*l,r,l).filter(function(v){return ve(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=p_(o,r,90),h=m_(t,e,m),g=p_(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 hc=e=>e;var Um=new on,F1=new on,sD,aD,T1,M1,Cr={point:At,lineStart:At,lineEnd:At,polygonStart:function(){Cr.lineStart=lW,Cr.lineEnd=fW},polygonEnd:function(){Cr.lineStart=Cr.lineEnd=Cr.point=At,Um.add(ve(F1)),F1=new on},result:function(){var e=Um/2;return Um=new on,e}};function lW(){Cr.point=cW}function cW(e,t){Cr.point=uD,sD=T1=e,aD=M1=t}function uD(e,t){F1.add(M1*e-T1*t),T1=e,M1=t}function fW(){uD(sD,aD)}var uu=1/0,Sh=uu,gc=-uu,_h=gc,$h={point:dW,lineStart:At,lineEnd:At,polygonStart:At,polygonEnd:At,result:function(){var e=[[uu,Sh],[gc,_h]];return gc=_h=-(Sh=uu=1/0),e}};function dW(e,t){e<uu&&(uu=e),e>gc&&(gc=e),t<Sh&&(Sh=t),t>_h&&(_h=t)}var O1=0,D1=0,Ol=0,Ah=0,kh=0,Ra=0,R1=0,N1=0,Dl=0,lD,cD,Hi,Gi,qn={point:zs,lineStart:y_,lineEnd:b_,polygonStart:function(){qn.lineStart=pW,qn.lineEnd=mW},polygonEnd:function(){qn.point=zs,qn.lineStart=y_,qn.lineEnd=b_},result:function(){var e=Dl?[R1/Dl,N1/Dl]:Ra?[Ah/Ra,kh/Ra]:Ol?[O1/Ol,D1/Ol]:[NaN,NaN];return O1=D1=Ol=Ah=kh=Ra=R1=N1=Dl=0,e}};function zs(e,t){O1+=e,D1+=t,++Ol}function y_(){qn.point=hW}function hW(e,t){qn.point=gW,zs(Hi=e,Gi=t)}function gW(e,t){var n=e-Hi,i=t-Gi,r=un(n*n+i*i);Ah+=r*(Hi+e)/2,kh+=r*(Gi+t)/2,Ra+=r,zs(Hi=e,Gi=t)}function b_(){qn.point=zs}function pW(){qn.point=yW}function mW(){fD(lD,cD)}function yW(e,t){qn.point=fD,zs(lD=Hi=e,cD=Gi=t)}function fD(e,t){var n=e-Hi,i=t-Gi,r=un(n*n+i*i);Ah+=r*(Hi+e)/2,kh+=r*(Gi+t)/2,Ra+=r,r=Gi*e-Hi*t,R1+=r*(Hi+e),N1+=r*(Gi+t),Dl+=r*3,zs(Hi=e,Gi=t)}function dD(e){this._context=e}dD.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,an);break}}},result:At};var L1=new on,jm,hD,gD,Rl,Nl,pc={point:At,lineStart:function(){pc.point=bW},lineEnd:function(){jm&&pD(hD,gD),pc.point=At},polygonStart:function(){jm=!0},polygonEnd:function(){jm=null},result:function(){var e=+L1;return L1=new on,e}};function bW(e,t){pc.point=pD,hD=Rl=e,gD=Nl=t}function pD(e,t){Rl-=e,Nl-=t,L1.add(un(Rl*Rl+Nl*Nl)),Rl=e,Nl=t}let v_,Ch,x_,w_;class E_{constructor(t){this._append=t==null?mD:vW(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!==x_||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`,x_=i,Ch=this._append,w_=this._,this._=r}this._+=w_;break}}}result(){const t=this._;return this._="",t.length?t:null}}function mD(e){let t=1;this._+=e[0];for(const n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function vW(e){const t=Math.floor(e);if(!(t>=0))throw new RangeError(`invalid digits: ${e}`);if(t>15)return mD;if(t!==v_){const n=10**t;v_=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 yD(e,t){let n=3,i=4.5,r,o;function s(a){return a&&(typeof i=="function"&&o.pointRadius(+i.apply(this,arguments)),kr(a,r(o))),o.result()}return s.area=function(a){return kr(a,r(Cr)),Cr.result()},s.measure=function(a){return kr(a,r(pc)),pc.result()},s.bounds=function(a){return kr(a,r($h)),$h.result()},s.centroid=function(a){return kr(a,r(qn)),qn.result()},s.projection=function(a){return arguments.length?(r=a==null?(e=null,hc):(e=a).stream,s):e},s.context=function(a){return arguments.length?(o=a==null?(t=null,new E_(n)):new dD(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 E_(n)),s},s.projection(e).digits(n).context(t)}function ep(e){return function(t){var n=new P1;for(var i in e)n[i]=e[i];return n.stream=t,n}}function P1(){}P1.prototype={constructor:P1,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 _x(e,t,n){var i=e.clipExtent&&e.clipExtent();return e.scale(150).translate([0,0]),i!=null&&e.clipExtent(null),kr(n,e.stream($h)),t($h.result()),i!=null&&e.clipExtent(i),e}function tp(e,t,n){return _x(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 $x(e,t,n){return tp(e,[[0,0],t],n)}function Ax(e,t,n){return _x(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 kx(e,t,n){return _x(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 S_=16,xW=se(30*ge);function __(e,t){return+t?EW(e,t):wW(e)}function wW(e){return ep({point:function(t,n){t=e(t,n),this.stream.point(t[0],t[1])}})}function EW(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=un(x*x+E*E+S*S),_=xn(S/=w),$=ve(ve(S)-1)<ae||ve(o-f)<ae?(o+f)/2:ei(E,x),C=e($,_),T=C[0],D=C[1],k=T-i,F=D-r,A=b*k-y*F;(A*A/v>t||ve((y*k+b*F)/v-.5)>.3||s*d+a*h+u*g<xW)&&(n(i,r,o,s,a,u,T,D,$,x/=w,E/=w,S,p,m),m.point(T,D),n(T,D,$,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(_,$){_=e(_,$),i.point(_[0],_[1])}function b(){f=NaN,m.point=v,i.lineStart()}function v(_,$){var C=Ps([_,$]),T=e(_,$);n(f,d,c,h,g,p,f=T[0],d=T[1],c=_,h=C[0],g=C[1],p=C[2],S_,i),i.point(f,d)}function x(){m.point=y,i.lineEnd()}function E(){b(),m.point=S,m.lineEnd=w}function S(_,$){v(r=_,$),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,S_,i),m.lineEnd=x,x()}return m}}var SW=ep({point:function(e,t){this.stream.point(e*ge,t*ge)}});function _W(e){return ep({point:function(t,n){var i=e(t,n);return this.stream.point(i[0],i[1])}})}function $W(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 $_(e,t,n,i,r,o){if(!o)return $W(e,t,n,i,r);var s=se(o),a=oe(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 fr(e){return bD(function(){return e})()}function bD(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=g_,m=null,y,b,v,x=hc,E=.5,S,w,_,$,C;function T(A){return _(A[0]*ge,A[1]*ge)}function D(A){return A=_.invert(A[0],A[1]),A&&[A[0]*Ze,A[1]*Ze]}T.stream=function(A){return $&&C===A?$:$=SW(_W(c)(p(S(x(C=A)))))},T.preclip=function(A){return arguments.length?(p=A,g=void 0,F()):p},T.postclip=function(A){return arguments.length?(x=A,m=y=b=v=null,F()):x},T.clipAngle=function(A){return arguments.length?(p=+A?sW(g=A*ge):(g=null,g_),F()):g*Ze},T.clipExtent=function(A){return arguments.length?(x=A==null?(m=y=b=v=null,hc):oD(m=+A[0][0],y=+A[0][1],b=+A[1][0],v=+A[1][1]),F()):m==null?null:[[m,y],[b,v]]},T.scale=function(A){return arguments.length?(n=+A,k()):n},T.translate=function(A){return arguments.length?(i=+A[0],r=+A[1],k()):[i,r]},T.center=function(A){return arguments.length?(o=A[0]%360*ge,s=A[1]%360*ge,k()):[o*Ze,s*Ze]},T.rotate=function(A){return arguments.length?(a=A[0]%360*ge,u=A[1]%360*ge,l=A.length>2?A[2]%360*ge:0,k()):[a*Ze,u*Ze,l*Ze]},T.angle=function(A){return arguments.length?(f=A%360*ge,k()):f*Ze},T.reflectX=function(A){return arguments.length?(d=A?-1:1,k()):d<0},T.reflectY=function(A){return arguments.length?(h=A?-1:1,k()):h<0},T.precision=function(A){return arguments.length?(S=__(w,E=A*A),F()):un(E)},T.fitExtent=function(A,M){return tp(T,A,M)},T.fitSize=function(A,M){return $x(T,A,M)},T.fitWidth=function(A,M){return Ax(T,A,M)},T.fitHeight=function(A,M){return kx(T,A,M)};function k(){var A=$_(n,0,0,d,h,f).apply(null,t(o,s)),M=$_(n,i-A[0],r-A[1],d,h,f);return c=tD(a,u,l),w=k1(t,M),_=k1(c,w),S=__(w,E),F()}function F(){return $=C=null,T}return function(){return t=e.apply(this,arguments),T.invert=t.invert&&D,k()}}function Cx(e){var t=0,n=me/3,i=bD(e),r=i(t,n);return r.parallels=function(o){return arguments.length?i(t=o[0]*ge,n=o[1]*ge):[t*Ze,n*Ze]},r}function AW(e){var t=se(e);function n(i,r){return[i*t,oe(r)/t]}return n.invert=function(i,r){return[i/t,xn(r*t)]},n}function kW(e,t){var n=oe(e),i=(n+oe(t))/2;if(ve(i)<ae)return AW(e);var r=1+n*(2*i-n),o=un(r)/i;function s(a,u){var l=un(r-2*i*oe(u))/i;return[l*oe(a*=i),o-l*se(a)]}return s.invert=function(a,u){var l=o-u,c=ei(a,ve(l))*Gn(l);return l*i<0&&(c-=me*Gn(a)*Gn(l)),[c/i,xn((r-(a*a+l*l)*i*i)/(2*i))]},s}function Fh(){return Cx(kW).scale(155.424).center([0,33.6442])}function vD(){return Fh().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])}function CW(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 FW(){var e,t,n=vD(),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=CW([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 $x(c,d,h)},c.fitWidth=function(d,h){return Ax(c,d,h)},c.fitHeight=function(d,h){return kx(c,d,h)};function f(){return e=t=null,c}return c.scale(1070)}function xD(e){return function(t,n){var i=se(t),r=se(n),o=e(i*r);return o===1/0?[2,0]:[o*r*oe(t),o*oe(n)]}}function Qc(e){return function(t,n){var i=un(t*t+n*n),r=e(i),o=oe(r),s=se(r);return[ei(t*o,i*s),xn(i&&n*o/i)]}}var wD=xD(function(e){return un(2/(1+e))});wD.invert=Qc(function(e){return 2*xn(e/2)});function TW(){return fr(wD).scale(124.75).clipAngle(180-.001)}var ED=xD(function(e){return(e=qO(e))&&e/oe(e)});ED.invert=Qc(function(e){return e});function MW(){return fr(ED).scale(79.4188).clipAngle(180-.001)}function np(e,t){return[e,ch(Ex((Ye+t)/2))]}np.invert=function(e,t){return[e,2*Iu(WO(t))-Ye]};function OW(){return SD(np).scale(961/an)}function SD(e){var t=fr(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=me*i(),d=t(Qj(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 Bf(e){return Ex((Ye+e)/2)}function DW(e,t){var n=se(e),i=e===t?oe(e):ch(n/se(t))/ch(Bf(t)/Bf(e)),r=n*zm(Bf(e),i)/i;if(!i)return np;function o(s,a){r>0?a<-Ye+ae&&(a=-Ye+ae):a>Ye-ae&&(a=Ye-ae);var u=r/zm(Bf(a),i);return[u*oe(i*s),r-u*se(i*s)]}return o.invert=function(s,a){var u=r-a,l=Gn(i)*un(s*s+u*u),c=ei(s,ve(u))*Gn(u);return u*i<0&&(c-=me*Gn(s)*Gn(u)),[c/i,2*Iu(zm(r/l,1/i))-Ye]},o}function RW(){return Cx(DW).scale(109.5).parallels([30,30])}function Th(e,t){return[e,t]}Th.invert=Th;function NW(){return fr(Th).scale(152.63)}function LW(e,t){var n=se(e),i=e===t?oe(e):(n-se(t))/(t-e),r=n/i+e;if(ve(i)<ae)return Th;function o(s,a){var u=r-a,l=i*s;return[u*oe(l),r-u*se(l)]}return o.invert=function(s,a){var u=r-a,l=ei(s,ve(u))*Gn(u);return u*i<0&&(l-=me*Gn(s)*Gn(u)),[l/i,r-Gn(i)*un(s*s+u*u)]},o}function PW(){return Cx(LW).scale(131.154).center([0,13.9389])}var Vl=1.340264,Xl=-.081106,Yl=893e-6,Kl=.003796,Mh=un(3)/2,zW=12;function _D(e,t){var n=xn(Mh*oe(t)),i=n*n,r=i*i*i;return[e*se(n)/(Mh*(Vl+3*Xl*i+r*(7*Yl+9*Kl*i))),n*(Vl+Xl*i+r*(Yl+Kl*i))]}_D.invert=function(e,t){for(var n=t,i=n*n,r=i*i*i,o=0,s,a,u;o<zW&&(a=n*(Vl+Xl*i+r*(Yl+Kl*i))-t,u=Vl+3*Xl*i+r*(7*Yl+9*Kl*i),n-=s=a/u,i=n*n,r=i*i*i,!(ve(s)<y1));++o);return[Mh*e*(Vl+3*Xl*i+r*(7*Yl+9*Kl*i))/se(n),xn(oe(n)/Mh)]};function IW(){return fr(_D).scale(177.158)}function $D(e,t){var n=se(t),i=se(e)*n;return[n*oe(e)/i,oe(t)/i]}$D.invert=Qc(Iu);function BW(){return fr($D).scale(144.049).clipAngle(60)}function UW(){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=hc,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,hc):oD(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*ge,a=oe(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 $x(v,x,E)},v.fitWidth=function(x,E){return Ax(v,x,E)},v.fitHeight=function(x,E){return kx(v,x,E)},v}function AD(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)))]}AD.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(ve(r)>ae&&--i>0);return[e/(.8707+(o=n*n)*(-.131979+o*(-.013791+o*o*o*(.003971-.001529*o)))),n]};function jW(){return fr(AD).scale(175.295)}function kD(e,t){return[se(t)*oe(e),oe(t)]}kD.invert=Qc(xn);function WW(){return fr(kD).scale(249.5).clipAngle(90+ae)}function CD(e,t){var n=se(t),i=1+se(e)*n;return[n*oe(e)/i,oe(t)/i]}CD.invert=Qc(function(e){return 2*Iu(e)});function qW(){return fr(CD).scale(250).clipAngle(142)}function FD(e,t){return[ch(Ex((Ye+t)/2)),-e]}FD.invert=function(e,t){return[-t,2*Iu(WO(e))-Ye]};function HW(){var e=SD(FD),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 GW=Math.abs,z1=Math.cos,Oh=Math.sin,VW=1e-6,TD=Math.PI,I1=TD/2,A_=XW(2);function k_(e){return e>1?I1:e<-1?-I1:Math.asin(e)}function XW(e){return e>0?Math.sqrt(e):0}function YW(e,t){var n=e*Oh(t),i=30,r;do t-=r=(t+Oh(t)-n)/(1+z1(t));while(GW(r)>VW&&--i>0);return t/2}function KW(e,t,n){function i(r,o){return[e*r*z1(o=YW(n,o)),t*Oh(o)]}return i.invert=function(r,o){return o=k_(o/t),[r/(e*z1(o)),k_((2*o+Oh(2*o))/n)]},i}var JW=KW(A_/I1,A_,TD);function QW(){return fr(JW).scale(169.529)}const ZW=yD(),B1=["clipAngle","clipExtent","scale","translate","center","rotate","parallels","precision","reflectX","reflectY","coefficient","distance","fraction","lobes","parallel","radius","ratio","spacing","tilt"];function eq(e,t){return function n(){const i=t();return i.type=e,i.path=yD().projection(i),i.copy=i.copy||function(){const r=n();return B1.forEach(o=>{i[o]&&r[o](i[o]())}),r.path.pointRadius(i.path.pointRadius()),r},HT(i)}}function Fx(e,t){if(!e||typeof e!="string")throw new Error("Projection type must be a name string.");return e=e.toLowerCase(),arguments.length>1?(Dh[e]=eq(e,t),this):Dh[e]||null}function MD(e){return e&&e.path||ZW}const Dh={albers:vD,albersusa:FW,azimuthalequalarea:TW,azimuthalequidistant:MW,conicconformal:RW,conicequalarea:Fh,conicequidistant:PW,equalEarth:IW,equirectangular:NW,gnomonic:BW,identity:UW,mercator:OW,mollweide:QW,naturalEarth1:jW,orthographic:WW,stereographic:qW,transversemercator:HW};for(const e in Dh)Fx(e,Dh[e]);function tq(){}const wr=[[],[[[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 OD(){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),nq(d)>0?c.push([d]):f.push(d)}),f.forEach(d=>{for(var h=0,g=c.length,p;h<g;++h)if(iq((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,wr[m<<1].forEach(v);++h<e-1;)p=m,m=u[h+1]>=l,wr[p|m<<1].forEach(v);for(wr[m<<0].forEach(v);++g<t-1;){for(h=-1,m=u[g*e+e]>=l,y=u[g*e]>=l,wr[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,wr[p|m<<1|y<<2|b<<3].forEach(v);wr[m|y<<3].forEach(v)}for(h=-1,y=u[g*e]>=l,wr[y<<2].forEach(v);++h<e-1;)b=y,y=u[g*e+h+1]>=l,wr[y<<2|b<<3].forEach(v);wr[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),$,C;($=d[w])?(C=f[_])?(delete d[$.end],delete f[C.start],$===C?($.ring.push(S),c($.ring)):f[$.start]=d[C.end]={start:$.start,end:C.end,ring:$.ring.concat(C.ring)}):(delete d[$.end],$.ring.push(S),d[$.end=_]=$):($=f[_])?(C=d[w])?(delete f[$.start],delete d[C.end],$===C?($.ring.push(S),c($.ring)):f[C.start]=d[$.end]={start:C.start,end:$.end,ring:C.ring.concat($.ring)}):(delete f[$.start],$.ring.unshift(E),f[$.start=w]=$):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:tq,i):n===a},i}function nq(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 iq(e,t){for(var n=-1,i=t.length,r;++n<i;)if(r=rq(e,t[n]))return r;return 0}function rq(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(oq(u,f,t))return 0;c>i!=h>i&&n<(d-l)*(i-c)/(h-c)+l&&(r=-r)}return r}function oq(e,t,n){var i;return sq(e,t,n)&&aq(e[i=+(e[0]===t[0])],n[i],t[i])}function sq(e,t,n){return(t[0]-e[0])*(n[1]-e[1])===(n[0]-e[0])*(t[1]-e[1])}function aq(e,t,n){return e<=t&&t<=n||n<=t&&t<=e}function DD(e,t,n){return function(i){var r=Zi(i),o=n?Math.min(r[0],0):r[0],s=r[1],a=s-o,u=t?Ds(o,s,e):a/(e+1);return Tn(o+u,s,u)}}function Tx(e){O.call(this,null,e)}Tx.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(Tx,O,{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||Gt,o=OD().smooth(e.smooth!==!1),s=e.thresholds||uq(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,L(s)?s:s(c.values));lq(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 uq(e,t,n){const i=DD(n.levels||10,n.nice,n.zero!==!1);return n.resolve!=="shared"?i:i(e.map(r=>_s(t(r).values)))}function lq(e,t,n,i){let r=i.scale||t.scale,o=i.translate||t.translate;if(fe(r)&&(r=r(n,i)),fe(o)&&(o=o(n,i)),(r===1||r==null)&&!o)return;const s=($e(r)?r:r[0])||1,a=($e(r)?r:r[1])||1,u=o&&o[0]||0,l=o&&o[1]||0;e.forEach(RD(t,s,a,u,l))}function RD(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 C_(e,t,n){const i=e>=0?e:$b(t,n);return Math.round((Math.sqrt(4*i*i+1)-1)/2)}function Wm(e){return fe(e)?e:Vt(+e)}function ND(){var e=u=>u[0],t=u=>u[1],n=Cu,i=[-1,-1],r=960,o=500,s=2;function a(u,l){const c=C_(i[0],u,e)>>s,f=C_(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/bC(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=Wm(u),a):e},a.y=function(u){return arguments.length?(t=Wm(u),a):t},a.weight=function(u){return arguments.length?(n=Wm(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=Y(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 Mx(e){O.call(this,null,e)}Mx.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 cq=["x","y","weight","size","cellSize","bandwidth"];function LD(e,t){return cq.forEach(n=>t[n]!=null?e[n](t[n]):0),e}G(Mx,O,{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=fq(i,e.groupby),o=(e.groupby||[]).map(Je),s=LD(ND(),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 fq(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 Ox(e){O.call(this,null,e)}Ox.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(Ox,O,{transform(e,t){if(this.value&&!t.changed()&&!e.modified())return t.StopPropagation;var n=t.fork(t.NO_SOURCE|t.NO_FIELDS),i=OD().smooth(e.smooth!==!1),r=e.values,o=e.thresholds||DD(e.count||10,e.nice,!!r),s=e.size,a,u;return r||(r=t.materialize(t.SOURCE).source,a=LD(ND(),e)(r,!0),u=RD(a,a.scale||1,a.scale||1,0,0),s=[a.width,a.height],r=a.values),o=L(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 U1="Feature",Dx="FeatureCollection",dq="MultiPoint";function Rx(e){O.call(this,null,e)}Rx.Definition={type:"GeoJSON",metadata:{},params:[{name:"fields",type:"field",array:!0,length:2},{name:"geojson",type:"field"}]};G(Rx,O,{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&&Gt,u=t.ADD,l;l=e.modified()||t.changed(t.REM)||t.modified(jt(a))||o&&t.modified(jt(o))||s&&t.modified(jt(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:U1,geometry:{type:dq,coordinates:i}})),this.value={type:Dx,features:n}}});function Nx(e){O.call(this,null,e)}Nx.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(Nx,O,{transform(e,t){var n=t.fork(t.ALL),i=this.value,r=e.field||Gt,o=e.as||"path",s=n.SOURCE;!i||e.modified()?(this.value=i=MD(e.projection),n.materialize().reflow()):s=r===Gt||t.modified(r.fields)?n.ADD_MOD:n.ADD;const a=hq(i,e.pointRadius);return n.visit(s,u=>u[o]=i(r(u))),i.pointRadius(a),n.modifies(o)}});function hq(e,t){const n=e.pointRadius();return e.context(null),t!=null&&e.pointRadius(t),n}function Lx(e){O.call(this,null,e)}Lx.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(Lx,O,{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 Px(e){O.call(this,null,e)}Px.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(Px,O,{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=gq(MD(e.projection),e.field||Jn("datum"),e.pointRadius),n.materialize().reflow(),o=n.SOURCE),n.visit(o,s=>s[r]=i),n.modifies(r)}});function gq(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){O.call(this,[],e),this.generator=uW()}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,O,{transform(e,t){var n=this.value,i=this.generator,r;if(!n.length||e.modified())for(const o in e)fe(i[o])&&i[o](e[o]);return r=i(),n.length?t.mod.push(uF(n[0],r)):t.add.push(Ce(r)),n[0]=r,t}});function Ix(e){O.call(this,null,e)}Ix.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(Ix,O,{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||Gt,o=mq(e.opacity,e),s=pq(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=ce({},l,u);i||(f.$max=_s(c.values||[])),l[a]=yq(c,f,s.dep?s:Vt(s(f)),o.dep?o:Vt(o(f)))}),t.reflow(!0).modifies(a)}});function pq(e,t){let n;return fe(e)?(n=i=>Rd(e(i,t)),n.dep=PD(e)):n=Vt(Rd(e||"#888")),n}function mq(e,t){let n;return fe(e)?(n=i=>e(i,t),n.dep=PD(e)):e?n=Vt(e):(n=i=>i.$value/i.$max||0,n.dep=!0),n}function PD(e){if(!fe(e))return!1;const t=vi(jt(e));return t.$x||t.$y||t.$value||t.$max}function yq(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]:ho,d=ko(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 zD(e){O.call(this,null,e),this.modified(!0)}G(zD,O,{transform(e,t){let n=this.value;return!n||e.modified("type")?(this.value=n=vq(e.type),B1.forEach(i=>{e[i]!=null&&F_(n,i,e[i])})):B1.forEach(i=>{e.modified(i)&&F_(n,i,e[i])}),e.pointRadius!=null&&n.path.pointRadius(e.pointRadius),e.fit&&bq(n,e),t.fork(t.NO_SOURCE|t.NO_FIELDS)}});function bq(e,t){const n=xq(t.fit);t.extent?e.fitExtent(t.extent,n):t.size&&e.fitSize(t.size,n)}function vq(e){const t=Fx((e||"mercator").toLowerCase());return t||N("Unrecognized projection type: "+e),t()}function F_(e,t,n){fe(e[t])&&e[t](n)}function xq(e){return e=Y(e),e.length===1?e[0]:{type:Dx,features:e.reduce((t,n)=>t.concat(wq(n)),[])}}function wq(e){return e.type===Dx?e.features:Y(e).filter(t=>t!=null).map(t=>t.type===U1?t:{type:U1,geometry:t})}const Eq=Object.freeze(Object.defineProperty({__proto__:null,contour:Ox,geojson:Rx,geopath:Nx,geopoint:Lx,geoshape:Px,graticule:zx,heatmap:Ix,isocontour:Tx,kde2d:Mx,projection:zD},Symbol.toStringTag,{value:"Module"}));function Sq(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 _q(e){const t=+this._x.call(null,e),n=+this._y.call(null,e);return ID(this.cover(t,n),t,n,e)}function ID(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 $q(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)ID(this,s[n],a[n],e[n]);return this}function Aq(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 kq(){var e=[];return this.visit(function(t){if(!t.length)do e.push(t.data);while(t=t.next)}),e}function Cq(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 tn(e,t,n,i,r){this.node=e,this.x0=t,this.y0=n,this.x1=i,this.y1=r}function Fq(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 tn(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 tn(h[3],m,y,u,l),new tn(h[2],s,y,m,l),new tn(h[1],m,a,u,y),new tn(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 Tq(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 Mq(e){for(var t=0,n=e.length;t<n;++t)this.remove(e[t]);return this}function Oq(){return this._root}function Dq(){var e=0;return this.visit(function(t){if(!t.length)do++e;while(t=t.next)}),e}function Rq(e){var t=[],n,i=this._root,r,o,s,a,u;for(i&&t.push(new tn(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 tn(r,l,c,a,u)),(r=i[2])&&t.push(new tn(r,o,c,l,u)),(r=i[1])&&t.push(new tn(r,l,s,a,c)),(r=i[0])&&t.push(new tn(r,o,s,l,c))}return this}function Nq(e){var t=[],n=[],i;for(this._root&&t.push(new tn(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 tn(o,s,a,c,f)),(o=r[1])&&t.push(new tn(o,c,a,u,f)),(o=r[2])&&t.push(new tn(o,s,f,c,l)),(o=r[3])&&t.push(new tn(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 Lq(e){return e[0]}function Pq(e){return arguments.length?(this._x=e,this):this._x}function zq(e){return e[1]}function Iq(e){return arguments.length?(this._y=e,this):this._y}function Bx(e,t,n){var i=new Ux(t??Lq,n??zq,NaN,NaN,NaN,NaN);return e==null?i:i.addAll(e)}function Ux(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 T_(e){for(var t={data:e.data},n=t;e=e.next;)n=n.next={data:e.data};return t}var cn=Bx.prototype=Ux.prototype;cn.copy=function(){var e=new Ux(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=T_(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]=T_(i));return e};cn.add=_q;cn.addAll=$q;cn.cover=Aq;cn.data=kq;cn.extent=Cq;cn.find=Fq;cn.remove=Tq;cn.removeAll=Mq;cn.root=Oq;cn.size=Dq;cn.visit=Rq;cn.visitAfter=Nq;cn.x=Pq;cn.y=Iq;function nn(e){return function(){return e}}function wo(e){return(e()-.5)*1e-6}function Bq(e){return e.x+e.vx}function Uq(e){return e.y+e.vy}function jq(e){var t,n,i,r=1,o=1;typeof e!="function"&&(e=nn(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=Bx(t,Bq,Uq).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,$=v.r,C=p+$;if(_){if(_.index>d.index){var T=h-_.x-_.vx,D=g-_.y-_.vy,k=T*T+D*D;k<C*C&&(T===0&&(T=wo(i),k+=T*T),D===0&&(D=wo(i),k+=D*D),k=(C-(k=Math.sqrt(k)))/k*r,d.vx+=(T*=k)*(C=($*=$)/(m+$)),d.vy+=(D*=k)*C,_.vx-=T*(C=1-C),_.vy-=D*C)}return}return x>h+C||S<h-C||E>g+C||w<g-C}}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:nn(+l),u(),s):e},s}function Wq(e){return e.index}function M_(e,t){var n=e.get(t);if(!n)throw new Error("node not found: "+t);return n}function qq(e){var t=Wq,n=f,i,r=nn(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,_,$,C;v<b;++v)x=e[v],E=x.source,S=x.target,w=S.x+S.vx-E.x-E.vx||wo(l),_=S.y+S.vy-E.y-E.vy||wo(l),$=Math.sqrt(w*w+_*_),$=($-o[v])/$*m*i[v],w*=$,_*=$,S.vx-=w*(C=u[v]),S.vy-=_*C,E.vx+=w*(C=1-C),E.vy+=_*C}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=M_(v,x.source)),typeof x.target!="object"&&(x.target=M_(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:nn(+m),g(),d):n},d.distance=function(m){return arguments.length?(r=typeof m=="function"?m:nn(+m),p(),d):r},d}function Hq(e,t,n){var i=new jP,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?WP():+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 Gq=1664525,Vq=1013904223,O_=4294967296;function Xq(){let e=1;return()=>(e=(Gq*e+Vq)%O_)/O_}function Yq(e){return e.x}function Kq(e){return e.y}var Jq=10,Qq=Math.PI*(3-Math.sqrt(5));function Zq(e){var t,n=1,i=.001,r=1-Math.pow(i,1/300),o=0,s=.6,a=new Map,u=qP(f),l=HP("tick","end"),c=Xq();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=Jq*Math.sqrt(.5+p),v=p*Qq;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 eH(){var e,t,n,i,r=nn(-30),o,s=1,a=1/0,u=.81;function l(h){var g,p=e.length,m=Bx(e,Yq,Kq).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=wo(n),x+=y*y),b===0&&(b=wo(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=wo(n),x+=y*y),b===0&&(b=wo(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:nn(+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 tH(e){var t=nn(.1),n,i,r;typeof e!="function"&&(e=nn(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:nn(+a),s(),o):t},o.x=function(a){return arguments.length?(e=typeof a=="function"?a:nn(+a),s(),o):e},o}function nH(e){var t=nn(.1),n,i,r;typeof e!="function"&&(e=nn(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:nn(+a),s(),o):t},o.y=function(a){return arguments.length?(e=typeof a=="function"?a:nn(+a),s(),o):e},o}const D_={center:Sq,collide:jq,nbody:eH,link:qq,x:tH,y:nH},Ll="forces",j1=["alpha","alphaMin","alphaTarget","velocityDecay","forces"],iH=["static","iterations"],BD=["x","y","vx","vy"];function jx(e){O.call(this,null,e)}jx.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:BD}]};G(jx,O,{transform(e,t){var n=this.value,i=t.changed(t.ADD_REM),r=e.modified(j1),o=e.iterations||300;if(n?(i&&(t.modifies("index"),n.nodes(t.source)),(r||t.changed(t.MOD))&&UD(n,e,0,t)):(this.value=n=oH(t.source,e),n.on("tick",rH(t.dataflow,this)),e.static||(i=!0,n.tick()),t.modifies("index")),r||i||e.modified(iH)||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!==Ll||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(BD)}});function rH(e,t){return()=>e.touch(t).run()}function oH(e,t){const n=Zq(e),i=n.stop,r=n.restart;let o=!1;return n.stopped=()=>o,n.restart=()=>(o=!1,r()),n.stop=()=>(o=!0,i()),UD(n,t,!0).on("end",()=>o=!0)}function UD(e,t,n,i){var r=Y(t.forces),o,s,a,u;for(o=0,s=j1.length;o<s;++o)a=j1[o],a!==Ll&&t.modified(a)&&e[a](t[a]);for(o=0,s=r.length;o<s;++o)u=Ll+o,a=n||t.modified(Ll,o)?aH(r[o]):i&&sH(r[o],i)?e.force(u):null,a&&e.force(u,a);for(s=e.numForces||0;o<s;++o)e.force(Ll+o,null);return e.numForces=r.length,e}function sH(e,t){var n,i;for(n in e)if(fe(i=e[n])&&t.modified(jt(i)))return 1;return 0}function aH(e){var t,n;J(D_,e.force)||N("Unrecognized force: "+e.force),t=D_[e.force]();for(n in e)fe(t[n])&&uH(t[n],e[n],e);return t}function uH(e,t,n){e(fe(t)?i=>t(i,n):t)}const lH=Object.freeze(Object.defineProperty({__proto__:null,force:jx},Symbol.toStringTag,{value:"Module"}));function cH(e,t){return e.parent===t.parent?1:2}function fH(e){return e.reduce(dH,0)/e.length}function dH(e,t){return e+t.x}function hH(e){return 1+e.reduce(gH,0)}function gH(e,t){return Math.max(e,t.y)}function pH(e){for(var t;t=e.children;)e=t[0];return e}function mH(e){for(var t;t=e.children;)e=t[t.length-1];return e}function yH(){var e=cH,t=1,n=1,i=!1;function r(o){var s,a=0;o.eachAfter(function(d){var h=d.children;h?(d.x=fH(h),d.y=hH(h)):(d.x=s?a+=e(d,s):0,d.y=0,s=d)});var u=pH(o),l=mH(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 bH(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 vH(){return this.eachAfter(bH)}function xH(e,t){let n=-1;for(const i of this)e.call(t,i,++n,this);return this}function wH(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 EH(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 SH(e,t){let n=-1;for(const i of this)if(e.call(t,i,++n,this))return i}function _H(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 $H(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})}function AH(e){for(var t=this,n=kH(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 kH(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 CH(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t}function FH(){return Array.from(this)}function TH(){var e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e}function MH(){var e=this,t=[];return e.each(function(n){n!==e&&t.push({source:n.parent,target:n})}),t}function*OH(){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 Wx(e,t){e instanceof Map?(e=[void 0,e],t===void 0&&(t=NH)):t===void 0&&(t=RH);for(var n=new lu(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 lu(s[a])),o.parent=i,o.depth=i.depth+1;return n.eachBefore(jD)}function DH(){return Wx(this).eachBefore(LH)}function RH(e){return e.children}function NH(e){return Array.isArray(e)?e[1]:null}function LH(e){e.data.value!==void 0&&(e.value=e.data.value),e.data=e.data.data}function jD(e){var t=0;do e.height=t;while((e=e.parent)&&e.height<++t)}function lu(e){this.data=e,this.depth=this.height=0,this.parent=null}lu.prototype=Wx.prototype={constructor:lu,count:vH,each:xH,eachAfter:EH,eachBefore:wH,find:SH,sum:_H,sort:$H,path:AH,ancestors:CH,descendants:FH,leaves:TH,links:MH,copy:DH,[Symbol.iterator]:OH};function Ed(e){return e==null?null:WD(e)}function WD(e){if(typeof e!="function")throw new Error;return e}function xs(){return 0}function Fa(e){return function(){return e}}const PH=1664525,zH=1013904223,R_=4294967296;function IH(){let e=1;return()=>(e=(PH*e+zH)%R_)/R_}function BH(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function UH(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 jH(e,t){for(var n=0,i=(e=UH(Array.from(e),t)).length,r=[],o,s;n<i;)o=e[n],s&&qD(s,o)?++n:(s=qH(r=WH(r,o)),n=0);return s}function WH(e,t){var n,i;if(qm(t,e))return[t];for(n=0;n<e.length;++n)if(Uf(t,e[n])&&qm(Pl(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(Uf(Pl(e[n],e[i]),t)&&Uf(Pl(e[n],t),e[i])&&Uf(Pl(e[i],t),e[n])&&qm(HD(e[n],e[i],t),e))return[e[n],e[i],t];throw new Error}function Uf(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 qD(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 qm(e,t){for(var n=0;n<t.length;++n)if(!qD(e,t[n]))return!1;return!0}function qH(e){switch(e.length){case 1:return HH(e[0]);case 2:return Pl(e[0],e[1]);case 3:return HD(e[0],e[1],e[2])}}function HH(e){return{x:e.x,y:e.y,r:e.r}}function Pl(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 HD(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,$=(d*y-h*m)/E,C=w*w+$*$-1,T=2*(o+S*w+_*$),D=S*S+_*_-o*o,k=-(Math.abs(C)>1e-6?(T+Math.sqrt(T*T-4*C*D))/(2*C):D/T);return{x:i+S+w*k,y:r+_+$*k,r:k}}function N_(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 L_(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 P_(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 jf(e){this._=e,this.next=null,this.previous=null}function GH(e,t){if(!(o=(e=BH(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;N_(i,n,r=e[2]),n=new jf(n),i=new jf(i),r=new jf(r),n.next=r.previous=i,i.next=n.previous=r,r.next=i.previous=n;e:for(u=3;u<o;++u){N_(n._,i._,r=e[u]),r=new jf(r),l=i.next,c=n.previous,f=i._.r,d=n._.r;do if(f<=d){if(L_(l._,r._)){i=l,n.next=i,i.previous=n,--u;continue e}f+=l._.r,l=l.next}else{if(L_(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=P_(n);(r=r.next)!==i;)(a=P_(r))<s&&(n=r,s=a);i=n.next}for(n=[i._],r=i;(r=r.next)!==i;)n.push(r._);for(r=jH(n,t),u=0;u<o;++u)n=e[u],n.x-=r.x,n.y-=r.y;return r.r}function VH(e){return Math.sqrt(e.value)}function XH(){var e=null,t=1,n=1,i=xs;function r(o){const s=IH();return o.x=t/2,o.y=n/2,e?o.eachBefore(z_(e)).eachAfter(Hm(i,.5,s)).eachBefore(I_(1)):o.eachBefore(z_(VH)).eachAfter(Hm(xs,1,s)).eachAfter(Hm(i,o.r/Math.min(t,n),s)).eachBefore(I_(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:Fa(+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=GH(r,n),a)for(o=0;o<s;++o)r[o].r-=a;i.r=u+a}}}function I_(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 GD(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 Zc(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 YH(){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(GD),s}function o(s,a){return function(u){u.children&&Zc(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 KH={depth:-1},B_={},Gm={};function JH(e){return e.id}function QH(e){return e.parentId}function U_(){var e=JH,t=QH,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)=>ZH(n(x,E,r))),b=y.map(j_),v=new Set(y).add("");for(const x of b)v.has(x)||(v.add(x),y.push(x),b.push(j_(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 lu(l),(g=s(l,c,r))!=null&&(g+="")&&(p=h.id=g,m.set(p,m.has(p)?B_: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===B_)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=KH,f.eachBefore(function(y){y.depth=y.parent.depth+1,--u}).eachBefore(jD),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 ZH(e){e=`${e}`;let t=e.length;return W1(e,t-1)&&!W1(e,t-2)&&(e=e.slice(0,-1)),e[0]==="/"?e:`/${e}`}function j_(e){let t=e.length;if(t<2)return"";for(;--t>1&&!W1(e,t););return e.slice(0,t)}function W1(e,t){if(e[t]==="/"){let n=0;for(;t>0&&e[--t]==="\\";)++n;if(!(n&1))return!0}return!1}function eG(e,t){return e.parent===t.parent?1:2}function Vm(e){var t=e.children;return t?t[0]:e.t}function Xm(e){var t=e.children;return t?t[t.length-1]:e.t}function tG(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 nG(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 iG(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(lu.prototype);function rG(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 oG(){var e=eG,t=1,n=1,i=null;function r(l){var c=rG(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){nG(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=Xm(g),d=Vm(d),g&&d;)p=Vm(p),h=Xm(h),h.a=l,x=g.z+b-d.z-m+e(g._,d._),x>0&&(tG(iG(g,l,f),l,x),m+=x,y+=x),b+=g.m,m+=d.m,v+=p.m,y+=h.m;g&&!Xm(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 VD=(1+Math.sqrt(5))/2;function XD(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?Zc(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 YD=function e(t){function n(i,r,o,s,a){XD(t,i,r,o,s,a)}return n.ratio=function(i){return e((i=+i)>1?i:1)},n}(VD);function sG(){var e=YD,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(GD),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=WD(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:Fa(+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:Fa(+d),c):s},c.paddingRight=function(d){return arguments.length?(a=typeof d=="function"?d:Fa(+d),c):a},c.paddingBottom=function(d){return arguments.length?(u=typeof d=="function"?d:Fa(+d),c):u},c.paddingLeft=function(d){return arguments.length?(l=typeof d=="function"?d:Fa(+d),c):l},c}function aG(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,$=h-_;if(m-g>y-p){var C=h?(g*$+m*_)/h:m;c(f,E,_,g,p,C,y),c(E,d,$,C,p,m,y)}else{var T=h?(p*$+y*_)/h:y;c(f,E,_,g,p,m,T),c(E,d,$,g,T,m,y)}}}function uG(e,t,n,i,r){(e.depth&1?ip:Zc)(e,t,n,i,r)}const lG=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?Zc(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=XD(t,i,r,o,s,a),u.ratio=t}return n.ratio=function(i){return e((i=+i)>1?i:1)},n}(VD);function q1(e,t,n){const i={};return e.each(r=>{const o=r.data;n(o)&&(i[t(o)]=r)}),e.lookup=i,e}function qx(e){O.call(this,null,e)}qx.Definition={type:"Nest",metadata:{treesource:!0,changes:!0},params:[{name:"keys",type:"field",array:!0},{name:"generate",type:"boolean"}]};const cG=e=>e.values;G(qx,O,{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=Wx({values:Y(e.keys).reduce((s,a)=>(s.key(a),s),fG()).entries(r.source)},cG),n&&o.each(s=>{s.children&&(s=Ce(s.data),r.add.push(s),r.source.push(s))}),q1(o,re,re)),r.source.root=o,r}});function fG(){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 Xr(e){O.call(this,null,e)}const dG=(e,t)=>e.parent===t.parent?1:2;G(Xr,O,{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)),hG(n,this.params,e),n.separation&&n.separation(e.separation!==!1?dG:Cu);try{this.value=n(r)}catch(s){N(s)}return r.each(s=>gG(s,i,o)),t.reflow(e.modified()).modifies(o).modifies("leaf")}});function hG(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 gG(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 H1=["x","y","r","depth","children"];function Hx(e){Xr.call(this,e)}Hx.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:H1.length,default:H1}]};G(Hx,Xr,{layout:XH,params:["radius","size","padding"],fields:H1});const G1=["x0","y0","x1","y1","depth","children"];function Gx(e){Xr.call(this,e)}Gx.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:G1.length,default:G1}]};G(Gx,Xr,{layout:YH,params:["size","round","padding"],fields:G1});function Vx(e){O.call(this,null,e)}Vx.Definition={type:"Stratify",metadata:{treesource:!0},params:[{name:"key",type:"field",required:!0},{name:"parentKey",type:"field",required:!0}]};G(Vx,O,{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?q1(U_().id(e.key).parentId(e.parentKey)(r.source),e.key,Ln):q1(U_()([{}]),e.key,e.key)),r.source.root=this.value=n,r}});const W_={tidy:oG,cluster:yH},V1=["x","y","depth","children"];function Xx(e){Xr.call(this,e)}Xx.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:V1.length,default:V1}]};G(Xx,Xr,{layout(e){const t=e||"tidy";if(J(W_,t))return W_[t]();N("Unrecognized Tree layout method: "+t)},params:["size","nodeSize"],fields:V1});function Yx(e){O.call(this,[],e)}Yx.Definition={type:"TreeLinks",metadata:{tree:!0,generates:!0,changes:!0},params:[]};G(Yx,O,{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[re(s)]=1),i.each(s=>{const a=s.data,u=s.parent&&s.parent.data;u&&o[re(a)]&&o[re(u)]&&r.add.push(Ce({source:u,target:a}))}),this.value=r.add):t.changed(t.MOD)&&(t.visit(t.MOD,s=>o[re(s)]=1),n.forEach(s=>{(o[re(s.source)]||o[re(s.target)])&&r.mod.push(s)})),r}});const q_={binary:aG,dice:Zc,slice:ip,slicedice:uG,squarify:YD,resquarify:lG},X1=["x0","y0","x1","y1","depth","children"];function Kx(e){Xr.call(this,e)}Kx.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:X1.length,default:X1}]};G(Kx,Xr,{layout(){const e=sG();return e.ratio=t=>{const n=e.tile();n.ratio&&e.tile(n.ratio(t))},e.method=t=>{J(q_,t)?e.tile(q_[t]):N("Unrecognized Treemap layout method: "+t)},e},params:["method","ratio","size","round","padding","paddingInner","paddingOuter","paddingTop","paddingRight","paddingBottom","paddingLeft"],fields:X1});const pG=Object.freeze(Object.defineProperty({__proto__:null,nest:qx,pack:Hx,partition:Gx,stratify:Vx,tree:Xx,treelinks:Yx,treemap:Kx},Symbol.toStringTag,{value:"Module"})),Ym=4278190080;function mG(e,t){const n=e.bitmap();return(t||[]).forEach(i=>n.set(e(i.boundary[0]),e(i.boundary[3]))),[n,void 0]}function yG(e,t,n,i,r){const o=e.width,s=e.height,a=i||r,u=ko(o,s).getContext("2d"),l=ko(o,s).getContext("2d"),c=a&&ko(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]&Ym,w=d[x]&Ym,S=a&&h[x]&Ym,(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))}):In[i].draw(e,{items:n?t.map(bG):t})}function bG(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 Er=5,Xt=31,mc=32,co=new Uint32Array(mc+1),fi=new Uint32Array(mc+1);fi[0]=0;co[0]=~fi[0];for(let e=1;e<=mc;++e)fi[e]=fi[e-1]<<1|1,co[e]=~fi[e];function vG(e,t){const n=new Uint32Array(~~((e*t+mc)/mc));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>>>Er]&1<<(a&Xt)},set:(o,s)=>{const a=s*e+o;i(a>>>Er,1<<(a&Xt))},clear:(o,s)=>{const a=s*e+o;r(a>>>Er,~(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>>>Er,h=f>>>Er,d===h){if(n[d]&co[c&Xt]&fi[(f&Xt)+1])return!0}else{if(n[d]&co[c&Xt]||n[h]&fi[(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>>>Er,d=c>>>Er,f===d)i(f,co[l&Xt]&fi[(c&Xt)+1]);else for(i(f,co[l&Xt]),i(d,fi[(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>>>Er,d=c>>>Er,f===d)r(f,fi[l&Xt]|co[(c&Xt)+1]);else for(r(f,fi[l&Xt]),r(d,co[(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 xG(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=()=>vG(r,o),s.ratio=i,s.padding=n,s.width=e,s.height=t,s}function wG(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=Dn.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 Eo(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 EG(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)&&!Eo(e,g,p,h,d,m,s,a)&&!Eo(e,g,p,h,d,h,s,null)){for(;y-m>=1;)b=(m+y)/2,Eo(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=Dn.width(l.datum,l.datum.text);let g=n?d:0,p=!1,m=!1,y=0,b,v,x,E,S,w,_,$,C,T,D,k,F,A,M,P,z;for(let U=0;U<f;++U){for(b=c[U].x,x=c[U].y,v=c[U].x2===void 0?b:c[U].x2,E=c[U].y2===void 0?x:c[U].y2,b>v&&(z=b,b=v,v=z),x>E&&(z=x,x=E,E=z),C=e(b),D=e(v),T=~~((C+D)/2),k=e(x),A=e(E),F=~~((k+A)/2),_=T;_>=C;--_)for($=F;$>=k;--$)P=u(_,$,g,h,d),P&&([l.x,l.y,g,p]=P);for(_=T;_<=D;++_)for($=F;$<=A;++$)P=u(_,$,g,h,d),P&&([l.x,l.y,g,p]=P);!p&&!n&&(M=Math.abs(v-b+E-x),S=(b+v)/2,w=(x+E)/2,M>=y&&!Rh(S,w,h,d,r,o)&&!Eo(e,S,w,d,h,d,s,null)&&(y=M,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 SG=[-1,-1,1,1],_G=[-1,1,-1,1];function $G(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=Dn.width(l.datum,l.datum.text),g=[];let p=n?d:0,m=!1,y=!1,b=0,v,x,E,S,w,_,$,C,T,D,k,F;for(let A=0;A<f;++A){for(v=c[A].x,E=c[A].y,x=c[A].x2===void 0?v:c[A].x2,S=c[A].y2===void 0?E:c[A].y2,g.push([e((v+x)/2),e((E+S)/2)]);g.length;)if([$,C]=g.pop(),!(s.get($,C)||a.get($,C)||u.get($,C))){u.set($,C);for(let M=0;M<4;++M)w=$+SG[M],_=C+_G[M],u.outOfBounds(w,_,w,_)||g.push([w,_]);if(w=e.invert($),_=e.invert(C),T=p,D=o,!Rh(w,_,h,d,r,o)&&!Eo(e,w,_,d,h,T,s,a)&&!Eo(e,w,_,d,h,d,s,null)){for(;D-T>=1;)k=(T+D)/2,Eo(e,w,_,d,h,k,s,a)?D=k:T=k;T>p&&(l.x=w,l.y=_,p=T,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)&&!Eo(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 AG=["right","center","left"],kG=["bottom","middle","top"];function CG(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,_,$,C,T;for(let D=0;D<u;++D){if(h=(n[D]&3)-1,g=(n[D]>>>2&3)-1,p=h===0&&g===0||i[D]<0,m=h&&g?Math.SQRT1_2:1,y=i[D]<0?-1:1,b=c[1+h]+i[D]*h*m,w=c[4+g]+y*f*g/2+i[D]*g*m,x=w-f/2,E=w+f/2,_=e(b),C=e(x),T=e(E),!d)if(H_(_,_,C,T,s,a,b,b,x,E,c,p))d=Dn.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),$=e(v),H_(_,$,C,T,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=AG[h*y+1],l.baseline=kG[g*y+1],s.setRange(_,C,$,T),!0}return!1}}function H_(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,FG={"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},TG={naive:wG,"reduced-search":EG,floodfill:$G};function MG(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=OG(i,f),h=DG(r,f),g=RG(e[0].datum),p=g==="group"&&e[0].datum.items[u].marktype,m=p==="area",y=NG(g,p,a,u),b=l===null||l===1/0,v=m&&c==="naive";let x=-1,E=-1;const S=e.map(C=>{const T=b?Dn.width(C,C.text):void 0;return x=Math.max(x,T),E=Math.max(E,C.fontSize),{datum:C,opacity:0,x:void 0,y:void 0,align:void 0,baseline:void 0,boundary:y(C),textWidth:T}});l=l===null||l===1/0?Math.max(x,E)+Math.max(...i):l;const w=xG(t[0],t[1],l);let _;if(!v){n&&S.sort((D,k)=>n(D.datum,k.datum));let C=!1;for(let D=0;D<h.length&&!C;++D)C=h[D]===5||d[D]<0;const T=(g&&s||m)&&e.map(D=>D.datum);_=o.length||T?yG(w,T||[],o,C,m):mG(w,s&&S)}const $=m?TG[c](w,_,s,u):CG(w,_,h,d);return S.forEach(C=>C.opacity=+$(C)),S}function OG(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 DG(e,t){const n=new Int8Array(t),i=e.length;for(let r=0;r<i;++r)n[r]|=FG[e[r]];for(let r=i;r<t;++r)n[r]=n[i-1];return n}function RG(e){return e&&e.mark&&e.mark.marktype}function NG(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 Y1=["x","y","opacity","align","baseline"],KD=["top-left","left","bottom-left","top","bottom","top-right","right","bottom-right"];function Jx(e){O.call(this,null,e)}Jx.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:KD},{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:Y1.length,default:Y1}]};G(Jx,O,{transform(e,t){function n(o){const s=e[o];return fe(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||Y1;return MG(t.materialize(t.SOURCE).source||[],e.size,e.sort,Y(e.offset==null?1:e.offset),Y(e.anchor||KD),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 LG=Object.freeze(Object.defineProperty({__proto__:null,label:Jx},Symbol.toStringTag,{value:"Module"}));function JD(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 Qx(e){O.call(this,null,e)}Qx.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(Qx,O,{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=JD(i,e.groupby),o=(e.groupby||[]).map(Je),s=o.length,a=e.as||[Je(e.x),Je(e.y)],u=[];r.forEach(l=>{AF(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 K1={constant:Pb,linear:zb,log:EF,exp:SF,pow:_F,quad:Ib,poly:$F},PG=(e,t)=>e==="poly"?t:e==="quad"?2:1;function Zx(e){O.call(this,null,e)}Zx.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(K1)},{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(Zx,O,{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=JD(i,e.groupby),o=(e.groupby||[]).map(Je),s=e.method||"linear",a=e.order==null?3:e.order,u=PG(s,a),l=e.as||[Je(e.x),Je(e.y)],c=K1[s],f=[];let d=e.extent;J(K1,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||Zi(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 zG=Object.freeze(Object.defineProperty({__proto__:null,loess:Qx,regression:Zx},Symbol.toStringTag,{value:"Module"})),Lr=11102230246251565e-32,Rt=134217729,IG=(3+8*Lr)*Lr;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 BG(e,t){let n=t[0];for(let i=1;i<e;i++)n+=t[i];return n}function ef(e){return new Float64Array(e)}const UG=(3+16*Lr)*Lr,jG=(2+12*Lr)*Lr,WG=(9+64*Lr)*Lr*Lr,Ea=ef(4),G_=ef(8),V_=ef(12),X_=ef(16),Yt=ef(4);function qG(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 $=e-r,C=n-r,T=t-o,D=i-o;x=$*D,d=Rt*$,h=d-(d-$),g=$-h,d=Rt*D,p=d-(d-D),m=D-p,E=g*m-(x-h*p-g*p-h*m),S=T*C,d=Rt*T,h=d-(d-T),g=T-h,d=Rt*C,p=d-(d-C),m=C-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 k=BG(4,Ea),F=jG*s;if(k>=F||-k>=F||(f=e-$,a=e-($+f)+(f-r),f=n-C,l=n-(C+f)+(f-r),f=t-T,u=t-(T+f)+(f-o),f=i-D,c=i-(D+f)+(f-o),a===0&&u===0&&l===0&&c===0)||(F=WG*s+IG*Math.abs(k),k+=$*c+D*a-(T*l+C*u),k>=F||-k>=F))return k;x=a*D,d=Rt*a,h=d-(d-a),g=a-h,d=Rt*D,p=d-(d-D),m=D-p,E=g*m-(x-h*p-g*p-h*m),S=u*C,d=Rt*u,h=d-(d-u),g=u-h,d=Rt*C,p=d-(d-C),m=C-p,w=g*m-(S-h*p-g*p-h*m),y=E-w,f=E-y,Yt[0]=E-(y+f)+(f-w),b=x+y,f=b-x,v=x-(b-f)+(y-f),y=v-S,f=v-y,Yt[1]=v-(y+f)+(f-S),_=b+y,f=_-b,Yt[2]=b-(_-f)+(y-f),Yt[3]=_;const A=i0(4,Ea,4,Yt,G_);x=$*c,d=Rt*$,h=d-(d-$),g=$-h,d=Rt*c,p=d-(d-c),m=c-p,E=g*m-(x-h*p-g*p-h*m),S=T*l,d=Rt*T,h=d-(d-T),g=T-h,d=Rt*l,p=d-(d-l),m=l-p,w=g*m-(S-h*p-g*p-h*m),y=E-w,f=E-y,Yt[0]=E-(y+f)+(f-w),b=x+y,f=b-x,v=x-(b-f)+(y-f),y=v-S,f=v-y,Yt[1]=v-(y+f)+(f-S),_=b+y,f=_-b,Yt[2]=b-(_-f)+(y-f),Yt[3]=_;const M=i0(A,G_,4,Yt,V_);x=a*c,d=Rt*a,h=d-(d-a),g=a-h,d=Rt*c,p=d-(d-c),m=c-p,E=g*m-(x-h*p-g*p-h*m),S=u*l,d=Rt*u,h=d-(d-u),g=u-h,d=Rt*l,p=d-(d-l),m=l-p,w=g*m-(S-h*p-g*p-h*m),y=E-w,f=E-y,Yt[0]=E-(y+f)+(f-w),b=x+y,f=b-x,v=x-(b-f)+(y-f),y=v-S,f=v-y,Yt[1]=v-(y+f)+(f-S),_=b+y,f=_-b,Yt[2]=b-(_-f)+(y-f),Yt[3]=_;const P=i0(M,V_,4,Yt,X_);return X_[P-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)>=UG*l?u:-qG(e,t,n,i,r,o,l)}const Y_=Math.pow(2,-52),qf=new Uint32Array(512);class Nh{static from(t,n=YG,i=KG){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 $=0;$<s;$++){const C=t[2*$],T=t[2*$+1];C<a&&(a=C),T<u&&(u=T),C>l&&(l=C),T>c&&(c=T),this._ids[$]=$}const f=(a+l)/2,d=(u+c)/2;let h,g,p;for(let $=0,C=1/0;$<s;$++){const T=r0(f,d,t[2*$],t[2*$+1]);T<C&&(h=$,C=T)}const m=t[2*h],y=t[2*h+1];for(let $=0,C=1/0;$<s;$++){if($===h)continue;const T=r0(m,y,t[2*$],t[2*$+1]);T<C&&T>0&&(g=$,C=T)}let b=t[2*g],v=t[2*g+1],x=1/0;for(let $=0;$<s;$++){if($===h||$===g)continue;const C=VG(m,y,b,v,t[2*$],t[2*$+1]);C<x&&(p=$,x=C)}let E=t[2*p],S=t[2*p+1];if(x===1/0){for(let T=0;T<s;T++)this._dists[T]=t[2*T]-t[0]||t[2*T+1]-t[1];Na(this._ids,this._dists,0,s-1);const $=new Uint32Array(s);let C=0;for(let T=0,D=-1/0;T<s;T++){const k=this._ids[T],F=this._dists[k];F>D&&($[C++]=k,D=F)}this.hull=$.subarray(0,C),this.triangles=new Uint32Array(0),this.halfedges=new Uint32Array(0);return}if(Wf(m,y,b,v,E,S)<0){const $=g,C=b,T=v;g=p,b=E,v=S,p=$,E=C,S=T}const w=XG(m,y,b,v,E,S);this._cx=w.x,this._cy=w.y;for(let $=0;$<s;$++)this._dists[$]=r0(t[2*$],t[2*$+1],w.x,w.y);Na(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 $=0,C,T;$<this._ids.length;$++){const D=this._ids[$],k=t[2*D],F=t[2*D+1];if($>0&&Math.abs(k-C)<=Y_&&Math.abs(F-T)<=Y_||(C=k,T=F,D===h||D===g||D===p))continue;let A=0;for(let te=0,ne=this._hashKey(k,F);te<this._hashSize&&(A=o[(ne+te)%this._hashSize],!(A!==-1&&A!==i[A]));te++);A=n[A];let M=A,P;for(;P=i[M],Wf(k,F,t[2*M],t[2*M+1],t[2*P],t[2*P+1])>=0;)if(M=P,M===A){M=-1;break}if(M===-1)continue;let z=this._addTriangle(M,D,i[M],-1,-1,r[M]);r[D]=this._legalize(z+2),r[M]=z,_++;let U=i[M];for(;P=i[U],Wf(k,F,t[2*U],t[2*U+1],t[2*P],t[2*P+1])<0;)z=this._addTriangle(U,D,P,r[D],-1,r[U]),r[D]=this._legalize(z+2),i[U]=U,_--,U=P;if(M===A)for(;P=n[M],Wf(k,F,t[2*P],t[2*P+1],t[2*M],t[2*M+1])<0;)z=this._addTriangle(P,D,M,-1,r[M],r[P]),this._legalize(z+2),r[P]=z,i[M]=M,_--,M=P;this._hullStart=n[D]=M,i[M]=n[U]=D,i[D]=U,o[this._hashKey(k,F)]=D,o[this._hashKey(t[2*M],t[2*M+1])]=M}this.hull=new Uint32Array(_);for(let $=0,C=this._hullStart;$<_;$++)this.hull[$]=C,C=i[C];this.triangles=this._triangles.subarray(0,this.trianglesLen),this.halfedges=this._halfedges.subarray(0,this.trianglesLen)}_hashKey(t,n){return Math.floor(HG(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=qf[--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(GG(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<qf.length&&(qf[o++]=b)}else{if(o===0)break;t=qf[--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 HG(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 GG(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 VG(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 XG(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 Na(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?(Na(e,t,o,i),Na(e,t,n,s-1)):(Na(e,t,n,s-1),Na(e,t,o,i))}}function cl(e,t,n){const i=e[t];e[t]=e[n],e[n]=i}function YG(e){return e[0]}function KG(e){return e[1]}const K_=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)>K_||Math.abs(this._y1-o)>K_)&&(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 J1{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 JG=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],$=t[E],C=t[E+1],T=t[S],D=t[S+1],k=$-w,F=C-_,A=T-w,M=D-_,P=(k*M-F*A)*2;if(Math.abs(P)<1e-9){if(o===void 0){o=s=0;for(const U of n)o+=t[U*2],s+=t[U*2+1];o/=n.length,s/=n.length}const z=1e9*Math.sign((o-w)*M-(s-_)*A);b=(w+T)/2-z*M,v=(_+D)/2+z*A}else{const z=1/P,U=k*k+F*F,te=A*A+M*M;b=w+(M*U-F*te)*z,v=_+(k*te-A*U)*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 J1;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 QG=2*Math.PI,Sa=Math.pow;function ZG(e){return e[0]}function eV(e){return e[1]}function tV(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 nV(e,t,n){return[e+Math.sin(e+t)*n,t+Math.cos(e-t)*n]}class e2{static from(t,n=ZG,i=eV,r){return new e2("length"in t?iV(t,n,i,r):Float64Array.from(rV(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&&tV(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=nV(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 JG(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,QG)}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 J1;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 J1;return this.renderTriangle(t,n),n.value()}}function iV(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*rV(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 t2(e){O.call(this,null,e)}t2.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 oV=[-1e5,-1e5,1e5,1e5];G(t2,O,{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]]:oV;const o=this.value=e2.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&&!aV(u)?sV(u):null}return t.reflow(e.modified()).modifies(n)}});function sV(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 aV(e){return e.length===2&&e[0][0]===e[1][0]&&e[0][1]===e[1][1]}const uV=Object.freeze(Object.defineProperty({__proto__:null,voronoi:t2},Symbol.toStringTag,{value:"Module"}));var o0=Math.PI/180,zl=64,$d=2048;function lV(){var e=[256,256],t,n,i,r,o,s,a,u=QD,l=[],c=Math.random,f={};f.layout=function(){for(var g=d(ko()),p=pV((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,cV(g,E,x,b),E.hasText&&h(p,E,m)&&(v.push(E),m?dV(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=$d/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,_,$;(w=x(S+=E))&&(_=~~w[0],$=~~w[1],!(Math.min(Math.abs(_),Math.abs($))>=v));)if(p.x=y+_,p.y=b+$,!(p.x+p.x0<0||p.y+p.y0<0||p.x+p.x1>e[0]||p.y+p.y1>e[1])&&(!m||!fV(p,g,e[0]))&&(!m||hV(p,m))){for(var C=p.sprite,T=p.width>>5,D=e[0]>>5,k=p.x-(T<<4),F=k&127,A=32-F,M=p.y1-p.y0,P=(p.y+p.y0)*D+(k>>5),z,U=0;U<M;U++){z=0;for(var te=0;te<=T;te++)g[P+te]|=z<<A|(te<T?(z=C[U*T+te])>>>F:0);P+=D}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=rs(g),f):n},f.fontStyle=function(g){return arguments.length?(r=rs(g),f):r},f.fontWeight=function(g){return arguments.length?(o=rs(g),f):o},f.rotate=function(g){return arguments.length?(s=rs(g),f):s},f.text=function(g){return arguments.length?(t=rs(g),f):t},f.spiral=function(g){return arguments.length?(u=mV[g]||g,f):u},f.fontSize=function(g){return arguments.length?(i=rs(g),f):i},f.padding=function(g){return arguments.length?(a=rs(g),f):a},f.random=function(g){return arguments.length?(c=g,f):c},f}function cV(e,t,n,i){if(!t.sprite){var r=e.context,o=e.ratio;r.clearRect(0,0,(zl<<5)/o,$d/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>=$d)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,$d/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 $=f*g+(h>>5),C=E[(a+g)*(zl<<5)+(s+h)<<2]?1<<31-h%32:0;S[$]|=C,w|=C}w?_=g:(t.y0++,d--,g--,a++)}t.y1=t.y0+_,t.sprite=S.slice(0,(t.y1-t.y0)*f)}}}function fV(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 dV(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 hV(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 QD(e){var t=e[0]/e[1];return function(n){return[t*(n*=.1)*Math.cos(n),n*Math.sin(n)]}}function gV(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 pV(e){for(var t=[],n=-1;++n<e;)t[n]=0;return t}function rs(e){return typeof e=="function"?e:function(){return e}}var mV={archimedean:QD,rectangular:gV};const ZD=["x","y","font","fontSize","fontStyle","fontWeight","angle"],yV=["text","font","rotate","fontSize","fontStyle","fontWeight"];function n2(e){O.call(this,lV(),e)}n2.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:ZD}]};G(n2,O,{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 fe(p)&&t.modified(p.fields)}const i=e.modified();if(!(i||t.changed(t.ADD_REM)||yV.some(n)))return;const r=t.materialize(t.SOURCE).source,o=this.value,s=e.as||ZD;let a=e.fontSize||14,u;if(fe(a)?u=e.fontSizeRange:a=Vt(a),u){const g=a,p=ke("sqrt")().domain(Zi(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(Zn).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 bV=Object.freeze(Object.defineProperty({__proto__:null,wordcloud:n2},Symbol.toStringTag,{value:"Module"})),vV=e=>new Uint8Array(e),xV=e=>new Uint16Array(e),Jl=e=>new Uint32Array(e);function wV(){let e=8,t=[],n=Jl(0),i=Hf(0,e),r=Hf(0,e);return{data:()=>t,seen:()=>n=EV(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=Hf(o,e,i),r=Hf(o,e))}}}function EV(e,t,n){return e.length>=t?e:(n=n||new e.constructor(t),n.set(e),n)}function Hf(e,t,n){const i=(t<257?vV:t<65537?xV:Jl)(e);return n&&i.set(n),i}function J_(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 Q_(){let e=Jl(0),t=[],n=0;function i(a,u,l){if(!u.length)return[];const c=n,f=u.length,d=Jl(f);let h=Array(f),g,p,m;for(m=0;m<f;++m)h[m]=a(u[m]),d[m]=m;if(h=SV(h,d),c)g=t,p=e,t=Array(c+f),e=Jl(c+f),_V(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),[_P(u,a[0],0,l),Va(u,a[1],0,l)]}return{insert:i,remove:r,bisect:s,reindex:o,index:()=>e,size:()=>n}}function SV(e,t){return e.sort.call(t,(n,i)=>{const r=e[n],o=e[i];return r<o?-1:r>o?1:0}),$z(e,t)}function _V(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 i2(e){O.call(this,wV(),e),this._indices=null,this._dims=null}i2.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(i2,O,{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]=Q_()),o.push(J_(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=Q_(),g[y]=p=m.insert(w,t.source,0)),s[E]=J_(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 r2(e){O.call(this,null,e)}r2.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(r2,O,{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 $V=Object.freeze(Object.defineProperty({__proto__:null,crossfilter:i2,resolvefilter:r2},Symbol.toStringTag,{value:"Module"})),AV="RawCode",Is="Literal",kV="Property",CV="Identifier",FV="ArrayExpression",TV="BinaryExpression",eR="CallExpression",MV="ConditionalExpression",OV="LogicalExpression",DV="MemberExpression",RV="ObjectExpression",NV="UnaryExpression";function Ai(e){this.type=e}Ai.prototype.visit=function(e){let t,n,i;if(e(this))return 1;for(t=LV(this),n=0,i=t.length;n<i;++n)if(t[n].visit(e))return 1};function LV(e){switch(e.type){case FV:return e.elements;case TV:case OV:return[e.left,e.right];case eR:return[e.callee].concat(e.arguments);case MV:return[e.test,e.consequent,e.alternate];case DV:return[e.object,e.property];case RV:return e.properties;case kV:return[e.key,e.value];case NV:return[e.argument];case CV:case Is:case AV:default:return[]}}var dr,Z,R,qt,Me,rp=1,tf=2,Bs=3,Vo=4,op=5,ia=6,hn=7,nf=8,PV=9;dr={};dr[rp]="Boolean";dr[tf]="<end>";dr[Bs]="Identifier";dr[Vo]="Keyword";dr[op]="Null";dr[ia]="Numeric";dr[hn]="Punctuator";dr[nf]="String";dr[PV]="RegularExpression";var zV="ArrayExpression",IV="BinaryExpression",BV="CallExpression",UV="ConditionalExpression",tR="Identifier",jV="Literal",WV="LogicalExpression",qV="MemberExpression",HV="ObjectExpression",GV="Property",VV="UnaryExpression",ht="Unexpected token %0",XV="Unexpected number",YV="Unexpected string",KV="Unexpected identifier",JV="Unexpected reserved word",QV="Unexpected end of input",Q1="Invalid regular expression",s0="Invalid regular expression: missing /",nR="Octal literals are not allowed in strict mode.",ZV="Duplicate data property in object literal not allowed in strict mode",kt="ILLEGAL",yc="Disabled.",eX=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]"),tX=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 o2(e){return"0123456789abcdefABCDEF".includes(e)}function Ql(e){return"01234567".includes(e)}function nX(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 bc(e){return e===10||e===13||e===8232||e===8233}function rf(e){return e===36||e===95||e>=65&&e<=90||e>=97&&e<=122||e===92||e>=128&&eX.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&&tX.test(String.fromCharCode(e))}const iX={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 iR(){for(;R<qt;){const e=Z.charCodeAt(R);if(nX(e)||bc(e))++R;else break}}function Z1(e){var t,n,i,r=0;for(n=e==="u"?4:2,t=0;t<n;++t)R<qt&&o2(Z[R])?(i=Z[R++],r=r*16+"0123456789abcdef".indexOf(i.toLowerCase())):_e({},ht,kt);return String.fromCharCode(r)}function rX(){var e,t,n,i;for(e=Z[R],t=0,e==="}"&&_e({},ht,kt);R<qt&&(e=Z[R++],!!o2(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 rR(){var e,t;for(e=Z.charCodeAt(R++),t=String.fromCharCode(e),e===92&&(Z.charCodeAt(R)!==117&&_e({},ht,kt),++R,e=Z1("u"),(!e||e==="\\"||!rf(e.charCodeAt(0)))&&_e({},ht,kt),t=e);R<qt&&(e=Z.charCodeAt(R),!!Lh(e));)++R,t+=String.fromCharCode(e),e===92&&(t=t.substr(0,t.length-1),Z.charCodeAt(R)!==117&&_e({},ht,kt),++R,e=Z1("u"),(!e||e==="\\"||!Lh(e.charCodeAt(0)))&&_e({},ht,kt),t+=e);return t}function oX(){var e,t;for(e=R++;R<qt;){if(t=Z.charCodeAt(R),t===92)return R=e,rR();if(Lh(t))++R;else break}return Z.slice(e,R)}function sX(){var e,t,n;return e=R,t=Z.charCodeAt(R)===92?rR():oX(),t.length===1?n=Bs:iX.hasOwnProperty(t)?n=Vo: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=Z.charCodeAt(R),n,i=Z[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:hn,value:String.fromCharCode(t),start:e,end:R};default:if(n=Z.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:hn,value:String.fromCharCode(t)+String.fromCharCode(n),start:e,end:R};case 33:case 61:return R+=2,Z.charCodeAt(R)===61&&++R,{type:hn,value:Z.slice(e,R),start:e,end:R}}}if(s=Z.substr(R,4),s===">>>=")return R+=4,{type:hn,value:s,start:e,end:R};if(o=s.substr(0,3),o===">>>"||o==="<<="||o===">>=")return R+=3,{type:hn,value:o,start:e,end:R};if(r=o.substr(0,2),i===r[1]&&"+-<>&|".includes(i)||r==="=>")return R+=2,{type:hn,value:r,start:e,end:R};if(r==="//"&&_e({},ht,kt),"<>=!+-*%&|^/".includes(i))return++R,{type:hn,value:i,start:e,end:R};_e({},ht,kt)}function aX(e){let t="";for(;R<qt&&o2(Z[R]);)t+=Z[R++];return t.length===0&&_e({},ht,kt),rf(Z.charCodeAt(R))&&_e({},ht,kt),{type:ia,value:parseInt("0x"+t,16),start:e,end:R}}function uX(e){let t="0"+Z[R++];for(;R<qt&&Ql(Z[R]);)t+=Z[R++];return(rf(Z.charCodeAt(R))||Ar(Z.charCodeAt(R)))&&_e({},ht,kt),{type:ia,value:parseInt(t,8),octal:!0,start:e,end:R}}function Z_(){var e,t,n;if(n=Z[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=Z[R++],n=Z[R],e==="0"){if(n==="x"||n==="X")return++R,aX(t);if(Ql(n))return uX(t);n&&Ar(n.charCodeAt(0))&&_e({},ht,kt)}for(;Ar(Z.charCodeAt(R));)e+=Z[R++];n=Z[R]}if(n==="."){for(e+=Z[R++];Ar(Z.charCodeAt(R));)e+=Z[R++];n=Z[R]}if(n==="e"||n==="E")if(e+=Z[R++],n=Z[R],(n==="+"||n==="-")&&(e+=Z[R++]),Ar(Z.charCodeAt(R)))for(;Ar(Z.charCodeAt(R));)e+=Z[R++];else _e({},ht,kt);return rf(Z.charCodeAt(R))&&_e({},ht,kt),{type:ia,value:parseFloat(e),start:t,end:R}}function lX(){var e="",t,n,i,r,o=!1;for(t=Z[R],sp(t==="'"||t==='"',"String literal must starts with a quote"),n=R,++R;R<qt;)if(i=Z[R++],i===t){t="";break}else if(i==="\\")if(i=Z[R++],!i||!bc(i.charCodeAt(0)))switch(i){case"u":case"x":Z[R]==="{"?(++R,e+=rX()):e+=Z1(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:Ql(i)?(r="01234567".indexOf(i),r!==0&&(o=!0),R<qt&&Ql(Z[R])&&(o=!0,r=r*8+"01234567".indexOf(Z[R++]),"0123".includes(i)&&R<qt&&Ql(Z[R])&&(r=r*8+"01234567".indexOf(Z[R++]))),e+=String.fromCharCode(r)):e+=i;break}else i==="\r"&&Z[R]===`
|
9
|
-
`&&++R;else{if(bc(i.charCodeAt(0)))break;e+=i}return t!==""&&_e({},ht,kt),{type:nf,value:e,octal:o,start:n,end:R}}function cX(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({},Q1)}).replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"x"));try{new RegExp(n)}catch{_e({},Q1)}try{return new RegExp(e,t)}catch{return null}}function fX(){var e,t,n,i,r;for(e=Z[R],sp(e==="/","Regular expression literal must start with a slash"),t=Z[R++],n=!1,i=!1;R<qt;)if(e=Z[R++],t+=e,e==="\\")e=Z[R++],bc(e.charCodeAt(0))&&_e({},s0),t+=e;else if(bc(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 dX(){var e,t,n;for(t="",n="";R<qt&&(e=Z[R],!!Lh(e.charCodeAt(0)));)++R,e==="\\"&&R<qt?_e({},ht,kt):(n+=e,t+=e);return n.search(/[^gimuy]/g)>=0&&_e({},Q1,n),{value:n,literal:t}}function hX(){var e,t,n,i;return Me=null,iR(),e=R,t=fX(),n=dX(),i=cX(t.value,n.value),{literal:t.literal+n.literal,value:i,regex:{pattern:t.value,flags:n.value},start:e,end:R}}function gX(e){return e.type===Bs||e.type===Vo||e.type===rp||e.type===op}function oR(){if(iR(),R>=qt)return{type:tf,start:R,end:R};const e=Z.charCodeAt(R);return rf(e)?sX():e===40||e===41||e===59?a0():e===39||e===34?lX():e===46?Ar(Z.charCodeAt(R+1))?Z_():a0():Ar(e)?Z_():a0()}function pn(){const e=Me;return R=e.end,Me=oR(),R=e.end,e}function sR(){const e=R;Me=oR(),R=e}function pX(e){const t=new Ai(zV);return t.elements=e,t}function e$(e,t,n){const i=new Ai(e==="||"||e==="&&"?WV:IV);return i.operator=e,i.left=t,i.right=n,i}function mX(e,t){const n=new Ai(BV);return n.callee=e,n.arguments=t,n}function yX(e,t,n){const i=new Ai(UV);return i.test=e,i.consequent=t,i.alternate=n,i}function s2(e){const t=new Ai(tR);return t.name=e,t}function Il(e){const t=new Ai(jV);return t.value=e.value,t.raw=Z.slice(e.start,e.end),e.regex&&(t.raw==="//"&&(t.raw="/(?:)/"),t.regex=e.regex),t}function t$(e,t,n){const i=new Ai(qV);return i.computed=e==="[",i.object=t,i.property=n,i.computed||(n.member=!0),i}function bX(e){const t=new Ai(HV);return t.properties=e,t}function n$(e,t,n){const i=new Ai(GV);return i.key=t,i.value=n,i.kind=e,i}function vX(e,t){const n=new Ai(VV);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===tf&&_e(e,QV),e.type===ia&&_e(e,XV),e.type===nf&&_e(e,YV),e.type===Bs&&_e(e,KV),e.type===Vo&&_e(e,JV),_e(e,ht,e.value)}function Ht(e){const t=pn();(t.type!==hn||t.value!==e)&&ap(t)}function Be(e){return Me.type===hn&&Me.value===e}function u0(e){return Me.type===Vo&&Me.value===e}function xX(){const e=[];for(R=Me.start,Ht("[");!Be("]");)Be(",")?(pn(),e.push(null)):(e.push(Us()),Be("]")||Ht(","));return pn(),pX(e)}function i$(){R=Me.start;const e=pn();return e.type===nf||e.type===ia?(e.octal&&_e(e,nR),Il(e)):s2(e.value)}function wX(){var e,t,n,i;if(R=Me.start,e=Me,e.type===Bs)return n=i$(),Ht(":"),i=Us(),n$("init",n,i);if(e.type===tf||e.type===hn)ap(e);else return t=i$(),Ht(":"),i=Us(),n$("init",t,i)}function EX(){var e=[],t,n,i,r={},o=String;for(R=Me.start,Ht("{");!Be("}");)t=wX(),t.key.type===tR?n=t.key.name:n=o(t.key.value),i="$"+n,Object.prototype.hasOwnProperty.call(r,i)?_e({},ZV):r[i]=!0,e.push(t),Be("}")||Ht(",");return Ht("}"),bX(e)}function SX(){Ht("(");const e=a2();return Ht(")"),e}const _X={if:1};function $X(){var e,t,n;if(Be("("))return SX();if(Be("["))return xX();if(Be("{"))return EX();if(e=Me.type,R=Me.start,e===Bs||_X[Me.value])n=s2(pn().value);else if(e===nf||e===ia)Me.octal&&_e(Me,nR),n=Il(pn());else{if(e===Vo)throw new Error(yc);e===rp?(t=pn(),t.value=t.value==="true",n=Il(t)):e===op?(t=pn(),t.value=null,n=Il(t)):Be("/")||Be("/=")?(n=Il(hX()),sR()):ap(pn())}return n}function AX(){const e=[];if(Ht("("),!Be(")"))for(;R<qt&&(e.push(Us()),!Be(")"));)Ht(",");return Ht(")"),e}function kX(){R=Me.start;const e=pn();return gX(e)||ap(e),s2(e.value)}function CX(){return Ht("."),kX()}function FX(){Ht("[");const e=a2();return Ht("]"),e}function TX(){var e,t,n;for(e=$X();;)if(Be("."))n=CX(),e=t$(".",e,n);else if(Be("("))t=AX(),e=mX(e,t);else if(Be("["))n=FX(),e=t$("[",e,n);else break;return e}function r$(){const e=TX();if(Me.type===hn&&(Be("++")||Be("--")))throw new Error(yc);return e}function Ad(){var e,t;if(Me.type!==hn&&Me.type!==Vo)t=r$();else{if(Be("++")||Be("--"))throw new Error(yc);if(Be("+")||Be("-")||Be("~")||Be("!"))e=pn(),t=Ad(),t=vX(e.value,t);else{if(u0("delete")||u0("void")||u0("typeof"))throw new Error(yc);t=r$()}}return t}function o$(e){let t=0;if(e.type!==hn&&e.type!==Vo)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 MX(){var e,t,n,i,r,o,s,a,u,l;if(e=Me,u=Ad(),i=Me,r=o$(i),r===0)return u;for(i.prec=r,pn(),t=[e,Me],s=Ad(),o=[u,i,s];(r=o$(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=e$(a,u,s),o.push(n);i=pn(),i.prec=r,o.push(i),t.push(Me),n=Ad(),o.push(n)}for(l=o.length-1,n=o[l],t.pop();l>1;)t.pop(),n=e$(o[l-1].value,o[l-2],n),l-=2;return n}function Us(){var e,t,n;return e=MX(),Be("?")&&(pn(),t=Us(),Ht(":"),n=Us(),e=yX(e,t,n)),e}function a2(){const e=Us();if(Be(","))throw new Error(yc);return e}function u2(e){Z=e,R=0,qt=Z.length,Me=null,sR();const t=a2();if(Me.type!==tf)throw new Error("Unexpect token after expression.");return t}var aR={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 uR(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 OX(e){const t=e&&e.length-1;return t&&(e[0]==='"'&&e[t]==='"'||e[0]==="'"&&e[t]==="'")?e.slice(1,-1):e}function lR(e){e=e||{};const t=e.allowed?vi(e.allowed):{},n=e.forbidden?vi(e.forbidden):{},i=e.constants||aR,r=(e.functions||uR)(f),o=e.globalvar,s=e.fieldvar,a=fe(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[OX(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),fe(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 s$=Symbol("vega_selection_getter");function cR(e){return(!e.getter||!e.getter[s$])&&(e.getter=Jn(e.field),e.getter[s$]=!0),e.getter}const l2="intersect",a$="union",DX="vlMulti",RX="vlPoint",u$="or",NX="and",Wi="_vgsid_",vc=Jn(Wi),LX="E",PX="R",zX="R-E",IX="R-LE",BX="R-RE",Ph="index:unit";function l$(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=cR(a)(e),_o(s)&&(s=Bt(s)),_o(i[o])&&(i[o]=Bt(i[o])),L(i[o])&&_o(i[o][0])&&(i[o]=i[o].map(Bt)),a.type===LX){if(L(i[o])?i[o].indexOf(s)<0:s!==i[o])return!1}else if(a.type===PX){if(!Ma(s,i[o]))return!1}else if(a.type===BX){if(!Ma(s,i[o],!0,!1))return!1}else if(a.type===zX){if(!Ma(s,i[o],!1,!1))return!1}else if(a.type===IX&&!Ma(s,i[o],!1,!0))return!1;return!0}function UX(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===l2,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=l$(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=l$(t,l),s^h)return h;return a&&s}const fR=ag(vc),jX=fR.left,WX=fR.right;function qX(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===l2,a=vc(t),u=jX(r,a);if(u===r.length||vc(r[u])!==a)return!1;if(o&&s){if(o.size===1)return!0;if(WX(r,a)-u<o.size)return!1}return!0}function HX(e,t){return e.map(n=>ce(t.fields?{values:t.fields.map(i=>cR(i)(n.datum))}:{[Wi]:vc(n.datum)},t))}function GX(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,Y(f[E]));n&&(m=a[d]||(a[d]=[]),m.push(Y(f).reduce((w,_,$)=>(w[c[$].field]=_,w),{})))}else h=Wi,g=vc(l),p=s[h]||(s[h]={}),m=p[d]||(p[d]=[]),m.push(g),n&&(m=a[d]||(a[d]=[]),m.push({[Wi]:g}));if(t=t||a$,s[Wi]?s[Wi]=l0[`${Wi}_${t}`](...Object.values(s[Wi])):Object.keys(s).forEach(w=>{s[w]=Object.keys(s[w]).map(_=>s[w][_]).reduce((_,$)=>_===void 0?$:l0[`${u[w]}_${t}`](_,$))}),o=Object.keys(a),n&&o.length){const w=i?RX:DX;s[w]=t===a$?{[u$]:o.reduce((_,$)=>(_.push(...a[$]),_),[])}:{[NX]:o.map(_=>({[u$]:a[_]}))}}return s}var l0={[`${Wi}_union`]:Mz,[`${Wi}_intersect`]:Fz,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=Bt(t[0]),i=Bt(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=Bt(t[0]),i=Bt(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 VX=":",XX="@";function c2(e,t,n,i){t[0].type!==Is&&N("First argument to selection functions must be a string literal.");const r=t[0].value,o=t.length>=2&&xe(t).value,s="unit",a=XX+s,u=VX+r;o===l2&&!J(i,a)&&(i[a]=n.getData(r).indataRef(n,s)),J(i,u)||(i[u]=n.getData(r).tuplesRef())}function dR(e){const t=this.context.data[e];return t?t.values.value:[]}function YX(e,t,n){const i=this.context.data[e]["index:"+t],r=i?i.value.get(n):void 0;return r&&r.count}function KX(e,t){const n=this.context.dataflow,i=this.context.data[e],r=i.input;return n.pulse(r,n.changeset().remove(Ln).insert(t)),1}function JX(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 of=e=>function(t,n){const i=this.context.dataflow.locale();return t===null?"null":i[e](n)(t)},QX=of("format"),hR=of("timeFormat"),ZX=of("utcFormat"),eY=of("timeParse"),tY=of("utcParse"),Gf=new Date(2e3,0,1);function up(e,t,n){return!Number.isInteger(e)||!Number.isInteger(t)?"":(Gf.setYear(2e3),Gf.setMonth(e),Gf.setDate(t),hR.call(this,Gf,n))}function nY(e){return up.call(this,e,1,"%B")}function iY(e){return up.call(this,e,1,"%b")}function rY(e){return up.call(this,0,2+e,"%A")}function oY(e){return up.call(this,0,2+e,"%a")}const sY=":",aY="@",ey="%",gR="$";function f2(e,t,n,i){t[0].type!==Is&&N("First argument to data functions must be a string literal.");const r=t[0].value,o=sY+r;if(!J(o,i))try{i[o]=n.getData(r).tuplesRef()}catch{}}function uY(e,t,n,i){t[0].type!==Is&&N("First argument to indata must be a string literal."),t[1].type!==Is&&N("Second argument to indata must be a string literal.");const r=t[0].value,o=t[1].value,s=aY+o;J(s,i)||(i[s]=n.getData(r).indataRef(n,o))}function sn(e,t,n,i){if(t[0].type===Is)c$(n,i,t[0].value);else for(e in n.scales)c$(n,i,e)}function c$(e,t,n){const i=ey+n;if(!J(t,i))try{t[i]=e.scaleRef(n)}catch{}}function hr(e,t){if(fe(e))return e;if(K(e)){const n=t.scales[e];return n&&A8(n.value)?n.value:void 0}}function lY(e,t,n){t.__bandwidth=r=>r&&r.bandwidth?r.bandwidth():0,n._bandwidth=sn,n._range=sn,n._scale=sn;const i=r=>"_["+(r.type===Is?H(ey+r.value):H(ey)+"+"+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 d2(e,t){return function(n,i,r){if(n){const o=hr(n,(r||this).context);return o&&o.path[e](i)}else return t(i)}}const cY=d2("area",Uj),fY=d2("bounds",Hj),dY=d2("centroid",Jj);function hY(e,t){const n=hr(e,(t||this).context);return n&&n.scale()}function gY(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 h2(e,t,n){try{e[t].apply(e,["EXPRESSION"].concat([].slice.call(n)))}catch(i){e.warn(i)}return n[n.length-1]}function pY(){return h2(this.context.dataflow,"warn",arguments)}function mY(){return h2(this.context.dataflow,"info",arguments)}function yY(){return h2(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 ty(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 bY(e,t){const n=ty(e),i=ty(t),r=Math.max(n,i),o=Math.min(n,i);return(r+.05)/(o+.05)}function vY(){const e=[].slice.call(arguments);return e.unshift({}),ce(...e)}function pR(e,t){return e===t||e!==e&&t!==t?!0:L(e)?L(t)&&e.length===t.length?xY(e,t):!1:X(e)&&X(t)?mR(e,t):!1}function xY(e,t){for(let n=0,i=e.length;n<i;++n)if(!pR(e[n],t[n]))return!1;return!0}function mR(e,t){for(const n in e)if(!pR(e[n],t[n]))return!1;return!0}function f$(e){return t=>mR(e,t)}function wY(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?Ln:L(n)||Eg(n)?n:f$(n),c.remove(f)),t&&c.insert(t),i&&(f=f$(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 EY(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 SY(e){const t=e.touches;return Math.atan2(t[0].clientY-t[1].clientY,t[0].clientX-t[1].clientX)}const d$={};function _Y(e,t){const n=d$[t]||(d$[t]=Jn(t));return L(e)?e.map(n):n(e)}function g2(e){return L(e)||ArrayBuffer.isView(e)?e:null}function p2(e){return g2(e)||(K(e)?e:null)}function $Y(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 g2(e).join(...n)}function AY(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 p2(e).indexOf(...n)}function kY(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 p2(e).lastIndexOf(...n)}function CY(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 p2(e).slice(...n)}function FY(e,t,n){return fe(n)&&N("Function argument passed to replace."),String(e).replace(t,n)}function TY(e){return g2(e).slice().reverse()}function MY(e,t,n){return Cv(e||0,t||0,n||0)}function OY(e,t){const n=hr(e,(t||this).context);return n&&n.bandwidth?n.bandwidth():0}function DY(e,t){const n=hr(e,(t||this).context);return n?n.copy():void 0}function RY(e,t){const n=hr(e,(t||this).context);return n?n.domain():[]}function NY(e,t,n){const i=hr(e,(n||this).context);return i?L(t)?(i.invertRange||i.invert)(t):(i.invert||i.invertExtent)(t):void 0}function LY(e,t){const n=hr(e,(t||this).context);return n&&n.range?n.range():[]}function PY(e,t,n){const i=hr(e,(n||this).context);return i?i(t):void 0}function zY(e,t,n,i,r){e=hr(e,(r||this).context);const o=cM(t,n);let s=e.domain(),a=s[0],u=xe(s),l=Gt;return u-a?l=QT(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!==xe(s)&&s.push(u)),s.forEach(c=>o.stop(l(c),e(c))),o}function IY(e,t,n){const i=hr(e,(n||this).context);return function(r){return i?i.path.context(r)(t):""}}function BY(e){let t=null;return function(n){return n?cc(n,t=t||iu(e)):e}}const yR=e=>e.data;function bR(e,t){const n=dR.call(t,e);return n.root&&n.root.lookup||{}}function UY(e,t,n){const i=bR(e,this),r=i[t],o=i[n];return r&&o?r.path(o).map(yR):void 0}function jY(e,t){const n=bR(e,this)[t];return n?n.ancestors().map(yR):void 0}const vR=()=>typeof window<"u"&&window||null;function WY(){const e=vR();return e?e.screen:{}}function qY(){const e=vR();return e?[e.innerWidth,e.innerHeight]:[void 0,void 0]}function HY(){const e=this.context.dataflow,t=e.container&&e.container();return t?[t.clientWidth,t.clientHeight]:[void 0,void 0]}function xR(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 aO(s,o,GY(t))}function GY(e){let t=null;if(e){const n=Y(e.marktype),i=Y(e.markname);t=r=>(!n.length||n.some(o=>r.marktype===o))&&(!i.length||i.some(o=>r.name===o))}return t}function VY(e,t,n){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:5;e=Y(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 XY(e){return Y(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 YY(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),xR([[s.x1,s.y1],[s.x2,s.y2]],e,o).filter(u=>KY(u.x,u.y,t))}function KY(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 xc={random(){return Zn()},cumulativeNormal:kg,cumulativeLogNormal:Mb,cumulativeUniform:Nb,densityNormal:Ab,densityLogNormal:Tb,densityUniform:Rb,quantileNormal:Cg,quantileLogNormal:Ob,quantileUniform:Lb,sampleNormal:Ag,sampleLogNormal:Fb,sampleUniform:Db,isArray:L,isBoolean:Ho,isDate:_o,isDefined(e){return e!==void 0},isNumber:$e,isObject:X,isRegExp:nC,isString:K,isTuple:Eg,isValid(e){return e!=null&&e===e},toBoolean:ab,toDate(e){return ub(e)},toNumber:Bt,toString:lb,indexof:AY,join:$Y,lastindexof:kY,replace:FY,reverse:TY,slice:CY,flush:eC,lerp:iC,merge:vY,pad:sC,peek:xe,pluck:_Y,span:Rc,inrange:Ma,truncate:aC,rgb:Rd,lab:Vd,hcl:Xd,hsl:I0,luminance:ty,contrast:bY,sequence:Tn,format:QX,utcFormat:ZX,utcParse:tY,utcOffset:DC,utcSequence:LC,timeFormat:hR,timeParse:eY,timeOffset:OC,timeSequence:NC,timeUnitSpecifier:wC,monthFormat:nY,monthAbbrevFormat:iY,dayFormat:rY,dayAbbrevFormat:oY,quarter:Kk,utcquarter:Jk,week:SC,utcweek:AC,dayofyear:EC,utcdayofyear:$C,warn:pY,info:mY,debug:yY,extent(e){return Zi(e)},inScope:gY,intersect:xR,clampRange:Qk,pinchDistance:EY,pinchAngle:SY,screen:WY,containerSize:HY,windowSize:qY,bandspace:MY,setdata:KX,pathShape:BY,panLinear:Gk,panLog:Vk,panPow:Xk,panSymlog:Yk,zoomLinear:tb,zoomLog:nb,zoomPow:Ld,zoomSymlog:ib,encode:JX,modify:wY,lassoAppend:VY,lassoPath:XY,intersectLasso:YY},JY=["view","item","group","xy","x","y"],QY="event.vega.",wR="this.",m2={},ER={forbidden:["_"],allowed:["datum","event","item"],fieldvar:"datum",globalvar:e=>`_[${H(gR+e)}]`,functions:ZY,constants:aR,visitors:m2},ny=lR(ER);function ZY(e){const t=uR(e);JY.forEach(n=>t[n]=QY+n);for(const n in xc)t[n]=wR+n;return ce(t,lY(e,xc,m2)),t}function nt(e,t,n){return arguments.length===1?xc[e]:(xc[e]=t,n&&(m2[e]=n),ny&&(ny.functions[e]=wR+e),this)}nt("bandwidth",OY,sn);nt("copy",DY,sn);nt("domain",RY,sn);nt("range",LY,sn);nt("invert",NY,sn);nt("scale",PY,sn);nt("gradient",zY,sn);nt("geoArea",cY,sn);nt("geoBounds",fY,sn);nt("geoCentroid",dY,sn);nt("geoShape",IY,sn);nt("geoScale",hY,sn);nt("indata",YX,uY);nt("data",dR,f2);nt("treePath",UY,f2);nt("treeAncestors",jY,f2);nt("vlSelectionTest",UX,c2);nt("vlSelectionIdTest",qX,c2);nt("vlSelectionResolve",GX,c2);nt("vlSelectionTuples",HX);function rr(e,t){const n={};let i;try{e=K(e)?e:H(e)+"",i=u2(e)}catch{N("Expression parse error: "+e)}i.visit(o=>{if(o.type!==eR)return;const s=o.callee.name,a=ER.visitors[s];a&&a(s,o.arguments,t,n)});const r=ny(i);return r.globals.forEach(o=>{const s=gR+o;!J(n,s)&&t.getSignal(o)&&(n[s]=t.signalRef(o))}),{$expr:ce({code:r.code},t.options.ast?{ast:i}:null),$fields:r.fields,$params:n}}function eK(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 tK=vi(["rule"]),h$=vi(["group","image","rect"]);function nK(e,t){let n="";return tK[t]||(e.x2&&(e.x?(h$[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?(h$[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 y2(e){return(e+"").toLowerCase()}function iK(e){return y2(e)==="operator"}function rK(e){return y2(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 oK(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 sK={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+=nK(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)`),oK(u,l,-a,a)},r=Function("a","b","var u, v; return "+e.map(i).join("")+"0;");return n?r.bind(n):r}}};function aK(e){const t=this;iK(e.type)||!e.type?t.operator(e,e.update?t.operatorExpression(e.update):null):t.transform(e,e.type)}function uK(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 lK(e,t){t=t||{};const n=this;for(const i in e){const r=e[i];t[i]=L(r)?r.map(o=>g$(o,n,t)):g$(r,n,t)}return t}function g$(e,t,n){if(!e||!X(e))return e;for(let i=0,r=p$.length,o;i<r;++i)if(o=p$[i],J(e,o.key))return o.parse(e,t,n);return e}var p$=[{key:"$ref",parse:cK},{key:"$key",parse:dK},{key:"$expr",parse:fK},{key:"$field",parse:hK},{key:"$encode",parse:pK},{key:"$compare",parse:gK},{key:"$context",parse:mK},{key:"$subflow",parse:yK},{key:"$tupleid",parse:bK}];function cK(e,t){return t.get(e.$ref)||N("Operator not defined: "+e.$ref)}function fK(e,t,n){e.$params&&t.parseParameters(e.$params,n);const i="e:"+e.$expr.code;return t.fn[i]||(t.fn[i]=_n(t.parameterExpression(e.$expr),e.$fields))}function dK(e,t){const n="k:"+e.$key+"_"+!!e.$flat;return t.fn[n]||(t.fn[n]=sb(e.$key,e.$flat,t.expr.codegen))}function hK(e,t){if(!e.$field)return null;const n="f:"+e.$field+"_"+e.$name;return t.fn[n]||(t.fn[n]=Jn(e.$field,e.$name,t.expr.codegen))}function gK(e,t){const n="c:"+e.$compare+"_"+e.$order,i=Y(e.$compare).map(r=>r&&r.$tupleid?re:r);return t.fn[n]||(t.fn[n]=rb(i,e.$order,t.expr.codegen))}function pK(e,t){const n=e.$encode,i={};for(const r in n){const o=n[r];i[r]=_n(t.encodeExpression(o.$expr),o.$fields),i[r].output=o.$output}return i}function mK(e,t){return t}function yK(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 bK(){return re}function vK(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 xK(e){var t=this,n=X(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 wK={skip:!0};function EK(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 SK(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],wK)}),Object.keys(i||{}).forEach(o=>{n.pulse(t.data[o].input,n.changeset().remove(Ln).insert(i[o]))}),(e.subcontext||[]).forEach((o,s)=>{const a=t.subcontext[s];a&&a.setState(o)})}function SR(e,t,n,i){return new _R(e,t,n,i)}function _R(e,t,n,i){this.dataflow=e,this.transforms=t,this.events=e.events.bind(e),this.expr=i||sK,this.signals={},this.scales={},this.nodes={},this.data={},this.fn={},n&&(this.functions=Object.create(n),this.functions.context=this)}function m$(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)}_R.prototype=m$.prototype={fork(){const e=new m$(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),rK(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[y2(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:eK,parseOperator:aK,parseOperatorParameters:uK,parseParameters:lK,parseStream:vK,parseUpdate:xK,getState:EK,setState:SK};function _K(e){const t=e.container();t&&(t.setAttribute("role","graphics-document"),t.setAttribute("aria-roleDescription","visualization"),$R(t,e.description()))}function $R(e,t){e&&(t==null?e.removeAttribute("aria-label"):e.setAttribute("aria-label",t))}function $K(e){e.add(null,t=>(e._background=t.bg,e._resize=1,t.bg),{bg:e._signals.background})}const f0="default";function AK(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),iy(e,i&&i!==f0?i:r||i),r},{cursor:t})}function iy(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 zh(e,t){var n=e._runtime.data;return J(n,t)||N("Unrecognized data set: "+t),n[t]}function kK(e,t){return arguments.length<2?zh(this,e).values.value:lp.call(this,e,ta().remove(Ln).insert(t))}function lp(e,t){lF(t)||N("Second argument to changes must be a changeset.");const n=zh(this,e);return n.modified=!0,this.pulse(n.input,t)}function CK(e,t){return lp.call(this,e,ta().insert(t))}function FK(e,t){return lp.call(this,e,ta().remove(t))}function AR(e){var t=e.padding();return Math.max(0,e._viewWidth+t.left+t.right)}function kR(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 TK(e){var t=cp(e),n=AR(e),i=kR(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 MK(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=OK(e,n,o),t}function OK(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:Vt(e),item:Vt(t||{}),group:r,xy:o,x:s=>o(s)[0],y:s=>o(s)[1]}}const y$="view",DK="timer",RK="window",NK={trap:!1};function LK(e){const t=ce({defaults:{}},e),n=(i,r)=>{r.forEach(o=>{L(i[o])&&(i[o]=vi(i[o]))})};return n(t.defaults,["prevent","allow"]),n(t,["view","window","selector"]),t}function CR(e,t,n,i){e._eventListeners.push({type:n,sources:Y(t),handler:i})}function PK(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 Vf(e,t,n){const i=e._eventConfig&&e._eventConfig[t];return i===!1||X(i)&&!i[n]?(e.warn(`Blocked ${t} ${n} event listener.`),!1):!0}function zK(e,t,n){var i=this,r=new $g(n),o=function(l,c){i.runAsync(null,()=>{e===y$&&PK(i,t)&&l.preventDefault(),r.receive(MK(i,l,c))})},s;if(e===DK)Vf(i,"timer",t)&&i.timer(o,t);else if(e===y$)Vf(i,"view",t)&&i.addEventListener(t,o,NK);else if(e===RK?Vf(i,"window",t)&&typeof window<"u"&&(s=[window]):typeof document<"u"&&Vf(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);CR(i,s,t,o)}return r}function b$(e){return e.item}function v$(e){return e.item.mark.source}function x$(e){return function(t,n){return n.vega.view().changeset().encode(n.item,e)}}function IK(e,t){return e=[e||"hover"],t=[t||"update",e[0]],this.on(this.events("view","pointerover",b$),v$,x$(e)),this.on(this.events("view","pointerout",b$),v$,x$(t)),this}function BK(){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 Rn(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 UK="vega-bind",jK="vega-bind-name",WK="vega-bind-radio";function qK(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=ob(i.debounce,r.update))),(i.input==null&&i.element?HK:VK)(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 HK(e,t,n,i){const r=n.event||"input",o=()=>e.update(t.value);i.signal(n.signal,t.value),t.addEventListener(r,o),CR(i,t,r,o),e.set=s=>{t.value=s,t.dispatchEvent(GK(r))}}function GK(e){return typeof Event<"u"?new Event(e):{type:e}}function VK(e,t,n,i){const r=i.signal(n.signal),o=Rn("div",{class:UK}),s=n.input==="radio"?o:o.appendChild(Rn("label"));s.appendChild(Rn("span",{class:jK},n.name||n.signal)),t.appendChild(o);let a=XK;switch(n.input){case"checkbox":a=YK;break;case"select":a=KK;break;case"radio":a=JK;break;case"range":a=QK;break}a(e,s,n,r)}function XK(e,t,n,i){const r=Rn("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 YK(e,t,n,i){const r={type:"checkbox",name:n.signal};i&&(r.checked=!0);const o=Rn("input",r);t.appendChild(o),o.addEventListener("change",()=>e.update(o.checked)),e.elements=[o],e.set=s=>o.checked=!!s||null}function KK(e,t,n,i){const r=Rn("select",{name:n.signal}),o=n.labels||[];n.options.forEach((s,a)=>{const u={value:s};Ih(s,i)&&(u.selected=!0),r.appendChild(Rn("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(Ih(n.options[a],s)){r.selectedIndex=a;return}}}function JK(e,t,n,i){const r=Rn("span",{class:WK}),o=n.labels||[];t.appendChild(r),e.elements=n.options.map((s,a)=>{const u={type:"radio",name:n.signal,value:s};Ih(s,i)&&(u.checked=!0);const l=Rn("input",u);l.addEventListener("change",()=>e.update(s));const c=Rn("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)Ih(a[l].value,s)&&(a[l].checked=!0)}}function QK(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||Ds(o,r,100),a=Rn("input",{type:"range",name:n.signal,min:o,max:r,step:s});a.value=i;const u=Rn("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 Ih(e,t){return e===t||e+""==t+""}function FR(e,t,n,i,r,o){return t=t||new i(e.loader()),t.initialize(n,AR(e),kR(e),cp(e),r,o).background(e.background())}function b2(e,t){return t?function(){try{t.apply(this,arguments)}catch(n){e.error(n)}}:null}function ZK(e,t,n,i){const r=new i(e.loader(),b2(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 eJ(e,t){const n=this,i=n._renderType,r=n._eventConfig.bind,o=Qg(i);e=n._el=e?d0(n,e,!0):null,_K(n),o||n.error("Unrecognized renderer type: "+i);const s=o.handler||Kc,a=e?o.renderer:o.headless;return n._renderer=a?FR(n,n._renderer,e,a):null,n._handler=ZK(n,n._handler,e,s),n._redraw=!0,e&&r!=="none"&&(t=t?n._elBind=d0(n,t,!0):e.appendChild(Rn("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=>{qK(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,tJ=e=>({top:e,bottom:e,left:e,right:e});function w$(e){return X(e)?{top:dl(e.top),bottom:dl(e.bottom),left:dl(e.left),right:dl(e.right)}:tJ(dl(e))}async function v2(e,t,n,i){const r=Qg(t),o=r&&r.headless;return o||N("Unrecognized renderer type: "+t),await e.runAsync(),FR(e,null,null,o,n,i).renderAsync(e._scenegraph.root)}async function nJ(e,t){e!==bo.Canvas&&e!==bo.SVG&&e!==bo.PNG&&N("Unrecognized image type: "+e);const n=await v2(this,e,t);return e===bo.SVG?iJ(n.svg(),"image/svg+xml"):n.canvas().toDataURL("image/png")}function iJ(e,t){const n=new Blob([e],{type:t});return window.URL.createObjectURL(n)}async function rJ(e,t){return(await v2(this,bo.Canvas,e,t)).canvas()}async function oJ(e){return(await v2(this,bo.SVG,e)).svg()}function sJ(e,t,n){return SR(e,Qa,xc,n).parse(t)}function aJ(e){var t=this._runtime.scales;return J(t,e)||N("Unrecognized scale or projection: "+e),t[e].value}var TR="width",MR="height",x2="padding",E$={skip:!0};function OR(e,t){var n=e.autosize(),i=e.padding();return t-(n&&n.contains===x2?i.left+i.right:0)}function DR(e,t){var n=e.autosize(),i=e.padding();return t-(n&&n.contains===x2?i.top+i.bottom:0)}function uJ(e){var t=e._signals,n=t[TR],i=t[MR],r=t[x2];function o(){e._autosize=e._resize=1}e._resizeWidth=e.add(null,a=>{e._width=a.size,e._viewWidth=OR(e,a.size),o()},{size:n}),e._resizeHeight=e.add(null,a=>{e._height=a.size,e._viewHeight=DR(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 lJ(e,t,n,i,r,o){this.runAfter(s=>{let a=0;s._autosize=0,s.width()!==n&&(a=1,s.signal(TR,n,E$),s._resizeWidth.skip(!0)),s.height()!==i&&(a=1,s.signal(MR,i,E$),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 cJ(e){return this._runtime.getState(e||{data:fJ,signals:dJ,recurse:!0})}function fJ(e,t){return t.modified&&L(t.input.value)&&!e.startsWith("_:vega:_")}function dJ(e,t){return!(e==="parent"||t instanceof Qa.proxy)}function hJ(e){return this.runAsync(null,t=>{t._trigger=!1,t._runtime.setState(e)},t=>{t._trigger=!0}),this}function gJ(e,t){function n(i){e({timestamp:Date.now(),elapsed:i})}this._timers.push(Hq(n,t))}function pJ(e,t,n,i){const r=e.element();r&&r.setAttribute("title",mJ(i))}function mJ(e){return e==null?"":L(e)?RR(e):X(e)&&!_o(e)?yJ(e):e+""}function yJ(e){return Object.keys(e).map(t=>{const n=e[t];return t+": "+(L(n)?RR(n):NR(n))}).join(`
|
13
|
-
`)}function RR(e){return"["+e.map(NR).join(", ")+"]"}function NR(e){return L(e)?"[…]":X(e)&&!_o(e)?"{…}":e}function bJ(){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 LR(e,t){const n=this;if(t=t||{},za.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=ce({},e.locale,t.locale);n.locale(ZC(o.number,o.time))}n._el=null,n._elBind=null,n._renderType=t.renderer||bo.Canvas,n._scenegraph=new RM;const i=n._scenegraph.root;n._renderer=null,n._tooltip=t.tooltip||pJ,n._redraw=!0,n._handler=new Kc().scene(i),n._globalCursor=!1,n._preventDefault=!1,n._timers=[],n._eventListeners=[],n._resizeListeners=[],n._eventConfig=LK(e.eventConfig),n.globalCursor(n._eventConfig.globalCursor);const r=sJ(n,e,t.expr);n._runtime=r,n._signals=r.signals,n._bind=(e.bindings||[]).map(o=>({state:null,param:ce({},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=OR(n,n._width),n._viewHeight=DR(n,n._height),n._origin=[0,0],n._resize=0,n._autosize=1,uJ(n),$K(n),AK(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 PR(e,t){const n=(e._targets||[]).filter(i=>i._update&&i._update.handler===t);return n.length?n[0]:null}function S$(e,t,n,i){let r=PR(n,i);return r||(r=b2(e,()=>i(t,n.value)),r.handler=i,e.on(n,null,r)),e}function _$(e,t,n){const i=PR(t,n);return i&&t._targets.remove(i),e}G(LR,za,{async evaluate(e,t,n){if(await za.prototype.evaluate.call(this,e,t),this._redraw||this._resize)try{this._renderer&&(this._resize&&(this._resize=0,TK(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&&$R(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",w$(e)):w$(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&&(za.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:lJ,addEventListener(e,t,n){let i=t;return n&&n.trap===!1||(i=b2(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 S$(this,e,Xf(this,e),t)},removeSignalListener(e,t){return _$(this,Xf(this,e),t)},addDataListener(e,t){return S$(this,e,zh(this,e).values,t)},removeDataListener(e,t){return _$(this,zh(this,e).values,t)},globalCursor(e){if(arguments.length){if(this._globalCursor!==!!e){const t=iy(this,null);this._globalCursor=!!e,t&&iy(this,t)}return this}else return this._globalCursor},preventDefault(e){return arguments.length?(this._preventDefault=e,this):this._preventDefault},timer:gJ,events:zK,finalize:BK,hover:IK,data:kK,change:lp,insert:CK,remove:FK,scale:aJ,initialize:eJ,toImageURL:nJ,toCanvas:rJ,toSVG:oJ,getState:cJ,setState:hJ,_watchPixelRatio:bJ});const vJ="view",Bh="[",Uh="]",zR="{",IR="}",xJ=":",BR=",",wJ="@",EJ=">",SJ=/[[\]{}]/,_J={"*":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 UR,jR;function Xo(e,t,n){return UR=t||vJ,jR=n||_J,WR(e.trim()).map(ry)}function $J(e){return jR[e]}function Zl(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 WR(e){const t=[],n=e.length;let i=0,r=0;for(;r<n;)r=Zl(e,r,BR,Bh+zR,Uh+IR),t.push(e.substring(i,r).trim()),i=++r;if(t.length===0)throw"Empty event selector: "+e;return t}function ry(e){return e[0]==="["?AJ(e):kJ(e)}function AJ(e){const t=e.length;let n=1,i;if(n=Zl(e,n,Uh,Bh,Uh),n===t)throw"Empty between selector: "+e;if(i=WR(e.substring(1,n)),i.length!==2)throw"Between selector must have two elements: "+e;if(e=e.slice(n+1).trim(),e[0]!==EJ)throw"Expected '>' after between selector: "+e;i=i.map(ry);const r=ry(e.slice(1).trim());return r.between?{between:i,stream:r}:(r.between=i,r)}function kJ(e){const t={source:UR},n=[];let i=[0,0],r=0,o=0,s=e.length,a=0,u,l;if(e[s-1]===IR){if(a=e.lastIndexOf(zR),a>=0){try{i=CJ(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]===wJ&&(r=++a),u=Zl(e,a,xJ),u<s&&(n.push(e.substring(o,u).trim()),o=a=++u),a=Zl(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=Zl(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)||SJ.test(n[s-1]))throw"Invalid event selector: "+e;return s>1?(t.type=n[1],r?t.markname=n[0].slice(1):$J(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 CJ(e){const t=e.split(BR);if(!e.length||t.length>2)throw e;return t.map(n=>{const i=+n;if(i!==i)throw e;return i})}function FJ(e){return X(e)?e:{type:e||"pad"}}const hl=e=>+e||0,TJ=e=>({top:e,bottom:e,left:e,right:e});function MJ(e){return X(e)?e.signal?e:{top:hl(e.top),bottom:hl(e.bottom),left:hl(e.left),right:hl(e.right)}:TJ(hl(e))}const gt=e=>X(e)&&!L(e)?ce({},e):{value:e};function $$(e,t,n,i){return n!=null?(X(n)&&!L(n)||L(n)&&n.length&&X(n[0])?e.update[t]=n:e[i||"enter"][t]={value:n},1):0}function Tt(e,t,n){for(const i in t)$$(e,i,t[i]);for(const i in n)$$(e,i,n[i],"update")}function Bu(e,t,n){for(const i in t)n&&J(n,i)||(e[i]=ce(e[i]||{},t[i]));return e}function Ta(e,t){return t&&(t.enter&&t.enter[e]||t.update&&t.update[e])}const w2="mark",E2="frame",S2="scope",OJ="axis",DJ="axis-domain",RJ="axis-grid",NJ="axis-label",LJ="axis-tick",PJ="axis-title",zJ="legend",IJ="legend-band",BJ="legend-entry",UJ="legend-gradient",qR="legend-label",jJ="legend-symbol",WJ="legend-title",qJ="title",HJ="title-text",GJ="title-subtitle";function VJ(e,t,n,i,r){const o={},s={};let a,u,l,c;u="lineBreak",t==="text"&&r[u]!=null&&!Ta(u,e)&&h0(o,u,r[u]),(n=="legend"||String(n).startsWith("axis"))&&(n=null),c=n===E2?r.group:n===w2?ce({},r.mark,r[t]):null;for(u in c)l=Ta(u,e)||(u==="fill"||u==="stroke")&&(Ta("fill",e)||Ta("stroke",e)),l||h0(o,u,c[u]);Y(i).forEach(f=>{const d=r.style&&r.style[f];for(const h in d)Ta(h,e)||h0(o,h,d[h])}),e=ce({},e);for(u in o)c=o[u],c.signal?(a=a||{})[u]=c:s[u]=c;return e.enter=ce(s,e.enter),a&&(e.update=ce(a,e.update)),e}function h0(e,t,n){e[t]=n&&n.signal?{signal:n.signal}:{value:n}}const HR=e=>K(e)?H(e):e.signal?`(${e.signal})`:GR(e);function fp(e){if(e.gradient!=null)return YJ(e);let t=e.signal?`(${e.signal})`:e.color?XJ(e.color):e.field!=null?GR(e.field):e.value!==void 0?H(e.value):void 0;return e.scale!=null&&(t=KJ(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 Yf=(e,t,n,i)=>`(${e}(${[t,n,i].map(fp).join(",")})+'')`;function XJ(e){return e.c?Yf("hcl",e.h,e.c,e.l):e.h||e.s?Yf("hsl",e.h,e.s,e.l):e.l||e.a?Yf("lab",e.l,e.a,e.b):e.r||e.g||e.b?Yf("rgb",e.r,e.g,e.b):null}function YJ(e){const t=[e.start,e.stop,e.count].map(n=>n==null?null:H(n));for(;t.length&&xe(t)==null;)t.pop();return t.unshift(HR(e.gradient)),`gradient(${t.join(",")})`}function kd(e){return X(e)?"("+fp(e)+")":e}function GR(e){return VR(X(e)?e:{datum:e})}function VR(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)?ur(i).map(H).join("]["):VR(i)),t+"["+i+"]"}function KJ(e,t){const n=HR(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 JJ(e){let t="";return e.forEach(n=>{const i=fp(n);t+=n.test?`(${n.test})?${i}:`:i}),xe(t)===":"&&(t+="null"),t}function XR(e,t,n,i,r,o){const s={};o=o||{},o.encoders={$encode:s},e=VJ(e,t,n,i,r.config);for(const a in e)s[a]=QJ(e[a],t,o,r);return o}function QJ(e,t,n,i){const r={},o={};for(const s in e)e[s]!=null&&(r[s]=eQ(ZJ(e[s]),i,n,o));return{$expr:{marktype:t,channels:r},$fields:Object.keys(o),$output:Object.keys(e)}}function ZJ(e){return L(e)?JJ(e):fp(e)}function eQ(e,t,n,i){const r=rr(e,t);return r.$fields.forEach(o=>i[o]=1),ce(n,r.$params),r.$expr}const tQ="outer",nQ=["value","update","init","react","bind"];function A$(e,t){N(e+' for "outer" push: '+H(t))}function YR(e,t){const n=e.name;if(e.push===tQ)t.signals[n]||A$("No prior signal definition",n),nQ.forEach(i=>{e[i]!==void 0&&A$("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 oy(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 oy(e,t,n,i)}function jh(e,t){return dp("operator",e,t)}function ie(e){const t={$ref:e.id};return e.id<0&&(e.refs=e.refs||[]).push(t),t}function wc(e,t){return t?{$field:e,$name:t}:{$field:e}}const sy=wc("key");function k$(e,t){return{$compare:e,$order:t}}function iQ(e,t){const n={$key:e};return t&&(n.$flat=!0),n}const rQ="ascending",oQ="descending";function sQ(e){return X(e)?(e.order===oQ?"-":"+")+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 _2="scope",ay="view";function ut(e){return e&&e.signal}function aQ(e){return e&&e.expr}function Cd(e){if(ut(e))return!0;if(X(e)){for(const t in e)if(Cd(e[t]))return!0}return!1}function ci(e,t){return e??t}function ks(e){return e&&e.signal||e}const C$="timer";function Ec(e,t){return(e.merge?lQ:e.stream?cQ:e.type?fQ:N("Invalid stream specification: "+H(e)))(e,t)}function uQ(e){return e===_2?ay:e||ay}function lQ(e,t){const n=e.merge.map(r=>Ec(r,t)),i=$2({merge:n},e,t);return t.addStream(i).id}function cQ(e,t){const n=Ec(e.stream,t),i=$2({stream:n},e,t);return t.addStream(i).id}function fQ(e,t){let n;e.type===C$?(n=t.event(C$,e.throttle),e={between:e.between,filter:e.filter}):n=t.event(uQ(e.source),e.type);const i=$2({stream:n},e,t);return Object.keys(i).length===1?n:t.addStream(i).id}function $2(e,t,n){let i=t.between;return i&&(i.length!==2&&N('Stream "between" parameter must have 2 entries: '+H(t)),e.between=[Ec(i[0],n),Ec(i[1],n)]),i=t.filter?[].concat(t.filter):[],(t.marktype||t.markname||t.markrole)&&i.push(dQ(t.marktype,t.markname,t.markrole)),t.source===_2&&i.push("inScope(event.item)"),i.length&&(e.filter=rr("("+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 dQ(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 hQ={code:"_.$value",ast:{type:"Identifier",value:"value"}};function gQ(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=Xo(o,t.isSubscope()?_2:ay)),o=Y(o).filter(u=>u.signal||u.scale?(a.push(u),0):1),a.length>1&&(a=[mQ(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)?rr(s,t):s.expr!=null?rr(s.expr,t):s.value!=null?s.value:s.signal!=null?{$expr:hQ,$params:{$value:t.signalRef(s.signal)}}:N("Invalid signal update specification."),e.force&&(r.options={force:!0}),a.forEach(u=>t.addUpdate(ce(pQ(u,t),r)))}function pQ(e,t){return{source:e.signal?t.signalRef(e.signal):e.scale?t.scaleRef(e.scale):Ec(e,t)}}function mQ(e){return{signal:"["+e.map(t=>t.scale?'scale("'+t.scale+'")':t.signal)+"]"}}function yQ(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=rr(i,t),n.update=i.$expr,n.params=i.$params),e.on&&e.on.forEach(r=>gQ(r,t,n.id))}const Le=e=>(t,n,i)=>dp(e,n,t||void 0,i),KR=Le("aggregate"),bQ=Le("axisticks"),JR=Le("bound"),ki=Le("collect"),F$=Le("compare"),vQ=Le("datajoin"),QR=Le("encode"),xQ=Le("expression"),wQ=Le("facet"),EQ=Le("field"),SQ=Le("key"),_Q=Le("legendentries"),$Q=Le("load"),AQ=Le("mark"),kQ=Le("multiextent"),CQ=Le("multivalues"),FQ=Le("overlap"),TQ=Le("params"),ZR=Le("prefacet"),MQ=Le("projection"),OQ=Le("proxy"),DQ=Le("relay"),e3=Le("render"),RQ=Le("scale"),ra=Le("sieve"),NQ=Le("sortitems"),t3=Le("viewlayout"),LQ=Le("values");let PQ=0;const n3={min:"min",max:"max",count:"sum"};function zQ(e,t){const n=e.type||"linear";GT(n)||N("Unrecognized scale type: "+H(n)),t.addScale(e.name,{type:n,domain:void 0})}function IQ(e,t){const n=t.getScale(e.name).params;let i;n.domain=i3(e.domain,e,t),e.range!=null&&(n.range=o3(e,t,n)),e.interpolate!=null&&YQ(e.interpolate,n),e.nice!=null&&(n.nice=XQ(e.nice,t)),e.bins!=null&&(n.bins=VQ(e.bins,t));for(i in e)J(n,i)||i==="name"||(n[i]=Vn(e[i],t))}function Vn(e,t){return X(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=>Vn(n,t))}function gp(e){N("Can not find data set: "+H(e))}function i3(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):(L(e)?BQ:e.fields?jQ:UQ)(e,t,n)}function BQ(e,t,n){return e.map(i=>Vn(i,n))}function UQ(e,t,n){const i=n.getData(e.data);return i||gp(e.data),nu(t.type)?i.valuesRef(n,e.field,r3(e.sort,!1)):YT(t.type)?i.domainRef(n,e.field):i.extentRef(n,e.field)}function jQ(e,t,n){const i=e.data,r=e.fields.reduce((o,s)=>(s=K(s)?{data:i,field:s}:L(s)||s.signal?WQ(s,n):s,o.push(s),o),[]);return(nu(t.type)?qQ:YT(t.type)?HQ:GQ)(e,n,r)}function WQ(e,t){const n="_:vega:_"+PQ++,i=ki({});if(L(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 qQ(e,t,n){const i=r3(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:sy,pulse:s};i&&(r=i.op||"count",o=i.field?hp(r,i.field):"count",a.ops=[n3[r]],a.fields=[t.fieldRef(o)],a.as=[o]),r=t.add(KR(a));const u=t.add(ki({pulse:ie(r)}));return o=t.add(LQ({field:sy,sort:t.sortRef(i),pulse:ie(u)})),ie(o)}function r3(e,t){return e&&(!e.field&&!e.op?X(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&&!n3[e.op]&&N("Multiple domain scales can not be sorted using "+e.op)),e}function HQ(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 ie(t.add(CQ({values:i})))}function GQ(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 ie(t.add(kQ({extents:i})))}function VQ(e,t){return e.signal||L(e)?Fd(e,t):t.objectProperty(e)}function XQ(e,t){return e.signal?t.signalRef(e.signal):X(e)?{interval:Vn(e.interval),step:Vn(e.step)}:Vn(e)}function YQ(e,t){t.interpolate=Vn(e.type||e),e.gamma!=null&&(t.interpolateGamma=Vn(e.gamma))}function o3(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=ce({},e,{range:i[r]}),o3(e,t,n);r==="width"?r=[0,{signal:"width"}]:r==="height"?r=nu(e.type)?[0,{signal:"height"}]:[{signal:"height"},0]:N("Unrecognized scale range value: "+H(r))}else if(r.scheme){n.scheme=L(r.scheme)?Fd(r.scheme,t):Vn(r.scheme,t),r.extent&&(n.schemeExtent=Fd(r.extent,t)),r.count&&(n.schemeCount=Vn(r.count,t));return}else if(r.step){n.rangeStep=Vn(r.step,t);return}else{if(nu(e.type)&&!L(r))return i3(r,e,t);L(r)||N("Unsupported range type: "+H(r))}return r.map(o=>(L(o)?Fd:Vn)(o,t))}function KQ(e,t){const n=t.config.projection||{},i={};for(const r in e)r!=="name"&&(i[r]=uy(e[r],r,t));for(const r in n)i[r]==null&&(i[r]=uy(n[r],r,t));t.addProjection(e.name,i)}function uy(e,t,n){return L(e)?e.map(i=>uy(i,t,n)):X(e)?e.signal?n.signalRef(e.signal):t==="fit"?e:N("Unsupported parameter object: "+H(e)):e}const Ci="top",Uu="left",ju="right",Lo="bottom",s3="center",JQ="vertical",QQ="start",ZQ="middle",eZ="end",ly="index",A2="label",tZ="offset",cu="perc",nZ="perc2",Yn="value",sf="guide-label",k2="guide-title",iZ="group-title",rZ="group-subtitle",T$="symbol",Td="gradient",cy="discrete",fy="size",oZ="shape",sZ="fill",aZ="stroke",uZ="strokeWidth",lZ="strokeDash",cZ="opacity",C2=[fy,oZ,sZ,aZ,uZ,lZ,cZ],af={name:1,style:1,interactive:1},Ee={value:0},Kn={value:1},pp="group",a3="rect",F2="rule",fZ="symbol",oa="text";function Sc(e){return e.type=pp,e.interactive=e.interactive||!1,e}function $n(e,t){const n=(i,r)=>ci(e[i],ci(t[i],r));return n.isVertical=i=>JQ===ci(e.direction,t.direction||(i?t.symbolDirection:t.gradientDirection)),n.gradientLength=()=>ci(e.gradientLength,t.gradientLength||t.gradientWidth),n.gradientThickness=()=>ci(e.gradientThickness,t.gradientThickness||t.gradientHeight),n.entryColumns=()=>ci(e.columns,ci(t.columns,+n.isVertical(!0))),n}function u3(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 dZ(e,t,n){const i=t.config.style[n];return i&&i[e]}function mp(e,t,n){return`item.anchor === '${QQ}' ? ${e} : item.anchor === '${eZ}' ? ${t} : ${n}`}const T2=mp(H(Uu),H(ju),H(s3));function hZ(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'`},X(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 l3(e,t){return t?e?X(e)?Object.assign({},e,{offset:l3(e.offset,t)}):{value:e,offset:t}:t:e}function Bn(e,t){return t?(e.name=t.name,e.style=t.style||e.style,e.interactive=!!t.interactive,e.encode=Bu(e.encode,t,af)):e.interactive=!1,e}function gZ(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:Ee,x:Ee,y:Ee,width:gt(f),height:gt(d)},update:ce({},u,{opacity:Kn,fill:{gradient:t,start:l,stop:c}}),exit:{opacity:Ee}};return Tt(h,{stroke:r("gradientStrokeColor"),strokeWidth:r("gradientStrokeWidth")},{opacity:r("gradientOpacity")}),Bn({type:a3,role:UJ,encode:h},i)}function pZ(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:Ee,fill:{scale:t,field:Yn}};g[l]={signal:h+"datum."+cu,mult:u},g[c]=Ee,g[f]={signal:h+"datum."+nZ,mult:u},g[d]=gt(a);const p={enter:g,update:ce({},g,{opacity:Kn}),exit:{opacity:Ee}};return Tt(p,{stroke:o("gradientStrokeColor"),strokeWidth:o("gradientStrokeWidth")},{opacity:o("gradientOpacity")}),Bn({type:a3,role:IJ,key:Yn,from:r,encode:p},i)}const mZ=`datum.${cu}<=0?"${Uu}":datum.${cu}>=1?"${ju}":"${s3}"`,yZ=`datum.${cu}<=0?"${Lo}":datum.${cu}>=1?"${Ci}":"${ZQ}"`;function M$(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:Ee},update:c={opacity:Kn,text:{field:A2}},exit:{opacity:Ee}};return Tt(g,{fill:r("labelColor"),fillOpacity:r("labelOpacity"),font:r("labelFont"),fontSize:r("labelFontSize"),fontStyle:r("labelFontStyle"),fontWeight:r("labelFontWeight"),limit:ci(e.labelLimit,t.gradientLabelLimit)}),o?(l.align={value:"left"},l.baseline=c.baseline={signal:yZ},f="y",d="x",h="1-"):(l.align=c.align={signal:mZ},l.baseline={value:"top"},f="x",d="y"),l[f]=c[f]={signal:h+"datum."+cu,mult:a},l[d]=c[d]=s,s.offset=ci(e.labelOffset,t.gradientLabelOffset)||0,u=u?{separation:r("labelSeparation"),method:u,order:"datum."+ly}:void 0,Bn({type:oa,role:qR,style:sf,key:Yn,from:i,encode:g,overlap:u},n)}function bZ(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.${tZ} : datum.${fy}`,h=l?gt(l):{field:fy},g=`datum.${ly}`,p=`max(1, ${r})`;let m,y,b,v,x;h.mult=.5,m={enter:y={opacity:Ee,x:{signal:d,mult:.5,offset:c},y:h},update:b={opacity:Kn,x:y.x,y:y.y},exit:{opacity:Ee}};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")}),C2.forEach(C=>{e[C]&&(b[C]=y[C]={scale:e[C],field:Yn})});const w=Bn({type:fZ,role:jJ,key:Yn,from:f,clip:l?!0:void 0,encode:m},n.symbols),_=gt(c);_.offset=o("labelOffset"),m={enter:y={opacity:Ee,x:{signal:d,offset:_},y:h},update:b={opacity:Kn,text:{field:A2},x:y.x,y:y.y},exit:{opacity:Ee}},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 $=Bn({type:oa,role:qR,style:sf,key:Yn,from:f,encode:m},n.labels);return m={enter:{noBound:{value:!l},width:Ee,height:l?gt(l):Ee,opacity:Ee},exit:{opacity:Ee},update:b={opacity:Kn,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:ly}},Sc({role:S2,from:i,encode:Bu(m,s,af),marks:[w,$],name:u,interactive:a,sort:x})}function vZ(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 M2='item.orient === "left"',O2='item.orient === "right"',yp=`(${M2} || ${O2})`,xZ=`datum.vgrad && ${yp}`,wZ=mp('"top"','"bottom"','"middle"'),EZ=mp('"right"','"left"','"center"'),SZ=`datum.vgrad && ${O2} ? (${EZ}) : (${yp} && !(datum.vgrad && ${M2})) ? "left" : ${T2}`,_Z=`item._anchor || (${yp} ? "middle" : "start")`,$Z=`${xZ} ? (${M2} ? -90 : 90) : 0`,AZ=`${yp} ? (datum.vgrad ? (${O2} ? "bottom" : "top") : ${wZ}) : "top"`;function kZ(e,t,n,i){const r=$n(e,t),o={enter:{opacity:Ee},update:{opacity:Kn,x:{field:{group:"padding"}},y:{field:{group:"padding"}}},exit:{opacity:Ee}};return Tt(o,{orient:r("titleOrient"),_anchor:r("titleAnchor"),anchor:{signal:_Z},angle:{signal:$Z},align:{signal:SZ},baseline:{signal:AZ},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")}),Bn({type:oa,role:WJ,style:k2,from:i,encode:o},n)}function CZ(e,t){let n;return X(e)&&(e.signal?n=e.signal:e.path?n="pathShape("+O$(e.path)+")":e.sphere&&(n="geoShape("+O$(e.sphere)+', {type: "Sphere"})')),n?t.signalRef(n):!!e}function O$(e){return X(e)&&e.signal?e.signal:H(e)}function c3(e){const t=e.role||"";return t.startsWith("axis")||t.startsWith("legend")||t.startsWith("title")?t:e.type===pp?S2:t||w2}function FZ(e){return{marktype:e.type,name:e.name||void 0,role:e.role||c3(e),zindex:+e.zindex||void 0,aria:e.aria,description:e.description}}function TZ(e,t){return e&&e.signal?t.signalRef(e.signal):e!==!1}function D2(e,t){const n=dF(e.type);n||N("Unrecognized transform type: "+H(e.type));const i=dp(n.type.toLowerCase(),null,f3(n,e,t));return e.signal&&t.addSignal(e.signal,t.proxy(i)),i.metadata=n.metadata||{},i}function f3(e,t,n){const i={},r=e.params.length;for(let o=0;o<r;++o){const s=e.params[o];i[s.name]=MZ(s,t,n)}return i}function MZ(e,t,n){const i=e.type,r=t[e.name];if(i==="index")return OZ(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 DZ(e,t,n);if(i==="projection")return n.projectionRef(t[e.name])}return e.array&&!ut(r)?r.map(o=>D$(e,o,n)):D$(e,r,n)}function D$(e,t,n){const i=e.type;if(ut(t))return N$(i)?N("Expression references can not be signals."):g0(i)?n.fieldRef(t):L$(i)?n.compareRef(t):n.signalRef(t.signal);{const r=e.expr||g0(i);return r&&RZ(t)?n.exprRef(t.expr,t.as):r&&NZ(t)?wc(t.field,t.as):N$(i)?rr(t,n):LZ(i)?ie(n.getData(t).values):g0(i)?wc(t):L$(i)?n.compareRef(t):t}}function OZ(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 DZ(e,t,n){const i=t[e.name];return e.array?(L(i)||N("Expected an array of sub-parameters. Instead: "+H(i)),i.map(r=>R$(e,r,n))):R$(e,i,n)}function R$(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=ce(f3(r,t,n),r.key);return ie(n.add(TQ(o)))}const RZ=e=>e&&e.expr,NZ=e=>e&&e.field,LZ=e=>e==="data",N$=e=>e==="expr",g0=e=>e==="field",L$=e=>e==="compare";function PZ(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=ie(n.getData(e.data).aggregate):(o=D2(ce({type:"aggregate",groupby:Y(i.groupby)},i.aggregate),n),o.params.key=n.keyRef(i.groupby),o.params.pulse=Md(i,n),s=a=ie(n.add(o))),r=n.keyRef(i.groupby,!0))):s=ie(n.add(ki(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:ie(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=ie(t[a-1]),e.add(t[a]),t[a].type==="aggregate"&&(s=t[a]);return new js(e,o,r,i,s)};function d3(e){return K(e)?e:null}function P$(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=sQ(o);let l=d3(r),c,f;if(l!=null&&(e=t.scope,l=l+(u?"|"+u:""),c=a[l]),!c){const d=o?{field:sy,pulse:t.countsRef(e,r,o)}:{field:e.fieldRef(r),pulse:ie(t.output)};u&&(d.sort=e.sortRef(o)),f=e.add(dp(i,void 0,d)),s&&(t.index[r]=f),c=ie(f),l!=null&&(a[l]=c)}return c}js.prototype={countsRef(e,t,n){const i=this,r=i.counts||(i.counts={}),o=d3(t);let s,a,u;return o!=null&&(e=i.scope,s=r[o]),s?n&&n.field&&P$(e,s.agg.params,n):(u={groupby:e.fieldRef(t,"key"),pulse:ie(i.output)},n&&n.field&&P$(e,u,n),a=e.add(KR(u)),s=e.add(ki({pulse:ie(a)})),s={agg:a,ref:ie(s)},o!=null&&(r[o]=s)),s.ref},tuplesRef(){return ie(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 zZ(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(ZR({field:t.fieldRef(i.field),pulse:o})):i.groupby?s=t.add(wQ({key:t.keyRef(i.groupby),group:ie(t.proxy(n.parent)),pulse:o})):N("Facet must specify groupby or field: "+H(i));const a=t.fork(),u=a.add(ki()),l=a.add(ra({pulse:ie(u)}));a.addData(r,new js(a,u,u,l)),a.addSignal("parent",null),s.params.subflow={$subflow:a.parse(e).toRuntime()}}function IZ(e,t,n){const i=t.add(ZR({pulse:n.pulse})),r=t.fork();r.add(ra()),r.addSignal("parent",null),i.params.subflow={$subflow:r.parse(e).toRuntime()}}function h3(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=rr(l,t);u.update=c.$expr,u.params=c.$params}function bp(e,t){const n=c3(e),i=e.type===pp,r=e.from&&e.from.facet,o=e.overlap;let s=e.layout||n===S2||n===E2,a,u,l,c,f,d,h;const g=n===w2||s||r,p=PZ(e.from,i,t);u=t.add(vQ({key:p.key||(e.key?wc(e.key):void 0),pulse:p.pulse,clean:!i}));const m=ie(u);u=l=t.add(ki({pulse:m})),u=t.add(AQ({markdef:FZ(e),interactive:TZ(e.interactive,t),clip:CZ(e.clip,t),context:{$context:!0},groups:t.lookup(),parent:t.signals.parent?t.signalRef("parent"):null,index:t.markpath(),pulse:ie(u)}));const y=ie(u);u=c=t.add(QR(XR(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=D2(S,t),_=w.metadata;(_.generates||_.changes)&&N("Mark transforms should not generate new data."),_.nomod||(c.params.mod=!0),w.params.pulse=ie(u),t.add(u=w)}),e.sort&&(u=t.add(NQ({sort:t.compareRef(e.sort),pulse:ie(u)})));const b=ie(u);(r||s)&&(s=t.add(t3({layout:t.objectProperty(e.layout),legends:t.legends,mark:y,pulse:b})),d=ie(s));const v=t.add(JR({mark:y,pulse:d||b}));h=ie(v),i&&(g&&(a=t.operators,a.pop(),s&&a.pop()),t.pushState(b,d||h,m),r?zZ(e,t,p):g?IZ(e,t,p):t.parse(e),t.popState(),g&&(s&&a.push(s),a.push(v))),o&&(h=BZ(o,h,t));const x=t.add(e3({pulse:h})),E=t.add(ra({pulse:ie(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."),h3(S,t,f)}))}function BZ(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 ie(n.add(FQ(s)))}function UZ(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;C2.forEach(v=>e[v]?(l[v]=e[v],c=c||e[v]):0),c||N("Missing valid scale for legend.");const g=jZ(e,t.scaleType(c)),p={title:e.title!=null,scales:l,type:g,vgrad:g!=="symbol"&&r.isVertical()},m=ie(t.add(ki(null,[p]))),y={enter:{x:{value:0},y:{value:0}}},b=ie(t.add(_Q(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=[gZ(e,c,n,i.gradient),M$(e,n,i.labels,b)],d.count=d.count||t.signalRef(`max(2,2*floor((${ks(r.gradientLength())})/100))`)):g===cy?h=[pZ(e,c,n,i.gradient,b),M$(e,n,i.labels,b)]:(f=vZ(e,n),h=[bZ(e,n,i,b,ks(f.columns))],d.size=HZ(e,t,h[0].marks)),h=[Sc({role:BJ,from:m,encode:y,marks:h,layout:f,interactive:a})],p.title&&h.push(kZ(e,n,i.title,m)),bp(Sc({role:zJ,from:m,encode:Bu(qZ(r,e,n),o,af),marks:h,aria:r("aria"),description:r("description"),zindex:r("zindex"),name:s,interactive:a,style:u}),t)}function jZ(e,t){let n=e.type||T$;return!e.type&&WZ(e)===1&&(e.fill||e.stroke)&&(n=Dv(t)?Td:n1(t)?cy:T$),n!==Td?n:n1(t)?cy:Td}function WZ(e){return C2.reduce((t,n)=>t+(e[n]?1:0),0)}function qZ(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 HZ(e,t,n){const i=ks(z$("size",e,n)),r=ks(z$("strokeWidth",e,n)),o=ks(GZ(n[1].encode,t,sf));return rr(`max(ceil(sqrt(${i})+${r}),${o})`,t)}function z$(e,t,n){return t[e]?`scale("${t[e]}",datum)`:u3(e,n[0].encode)}function GZ(e,t,n){return u3("fontSize",e)||dZ("fontSize",t,n)}const VZ=`item.orient==="${Uu}"?-90:item.orient==="${ju}"?90:0`;function XZ(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=ie(t.add(ki(null,[l])));return u.push(JZ(e,n,YZ(e),c)),e.subtitle&&u.push(QZ(e,n,i.subtitle,c)),bp(Sc({role:qJ,from:c,encode:KZ(n,r),marks:u,aria:n("aria"),description:n("description"),zindex:n("zindex"),name:o,interactive:s,style:a}),t)}function YZ(e){const t=e.encode;return t&&t.title||ce({name:e.name,interactive:e.interactive,style:e.style},t)}function KZ(e,t){const n={enter:{},update:{}};return Tt(n,{orient:e("orient"),anchor:e("anchor"),align:{signal:T2},angle:{signal:VZ},limit:e("limit"),frame:e("frame"),offset:e("offset")||0,padding:e("subtitlePadding")}),Bu(n,t,af)}function JZ(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")}),Bn({type:oa,role:HJ,style:iZ,from:i,encode:s},n)}function QZ(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")}),Bn({type:oa,role:GJ,style:rZ,from:i,encode:s},n)}function ZZ(e,t){const n=[];e.transform&&e.transform.forEach(i=>{n.push(D2(i,t))}),e.on&&e.on.forEach(i=>{h3(i,t,e.name)}),t.addDataPipeline(e.name,eee(e,t,n))}function eee(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(I$(t,e)),i.push(r=os())):i.push(r=os({$ingest:e.values,$format:e.format})):e.url?Cd(e.url)||Cd(e.format)?(i.push(I$(t,e)),i.push(r=os())):i.push(r=os({$request:e.url,$format:e.format})):e.source&&(r=a=Y(e.source).map(d=>ie(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=os()),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]=DQ({derive:o,pulse:l?a:a[0]}),(o||l)&&i.splice(1,0,os())),r||i.push(os()),i.push(ra({})),i}function os(e){const t=ki({},e);return t.metadata={source:!0},t}function I$(e,t){return $Q({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 g3=e=>e===Lo||e===Ci,vp=(e,t,n)=>ut(e)?ree(e.signal,t,n):e===Uu||e===Ci?t:n,pt=(e,t,n)=>ut(e)?nee(e.signal,t,n):g3(e)?t:n,yi=(e,t,n)=>ut(e)?iee(e.signal,t,n):g3(e)?n:t,p3=(e,t,n)=>ut(e)?oee(e.signal,t,n):e===Ci?{value:t}:{value:n},tee=(e,t,n)=>ut(e)?see(e.signal,t,n):e===ju?{value:t}:{value:n},nee=(e,t,n)=>m3(`${e} === '${Ci}' || ${e} === '${Lo}'`,t,n),iee=(e,t,n)=>m3(`${e} !== '${Ci}' && ${e} !== '${Lo}'`,t,n),ree=(e,t,n)=>R2(`${e} === '${Uu}' || ${e} === '${Ci}'`,t,n),oee=(e,t,n)=>R2(`${e} === '${Ci}'`,t,n),see=(e,t,n)=>R2(`${e} === '${ju}'`,t,n),m3=(e,t,n)=>(t=t!=null?gt(t):t,n=n!=null?gt(n):n,B$(t)&&B$(n)?(t=t?t.signal||H(t.value):null,n=n?n.signal||H(n.value):null,{signal:`${e} ? (${t}) : (${n})`}):[ce({test:e},t)].concat(n||[])),B$=e=>e==null||Object.keys(e).length===1,R2=(e,t,n)=>({signal:`${e} ? (${La(t)}) : (${La(n)})`}),aee=(e,t,n,i,r)=>({signal:(i!=null?`${e} === '${Uu}' ? (${La(i)}) : `:"")+(n!=null?`${e} === '${Lo}' ? (${La(n)}) : `:"")+(r!=null?`${e} === '${ju}' ? (${La(r)}) : `:"")+(t!=null?`${e} === '${Ci}' ? (${La(t)}) : `:"")+"(null)"}),La=e=>ut(e)?e.signal:e==null?null:H(e),uee=(e,t)=>t===0?0:ut(e)?{signal:`(${e.signal}) * ${t}`}:{value:e*t},Ua=(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[k2][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[sf][r]}return null}function U$(e){const t={};for(const n of e)if(n)for(const i in n)t[i]=1;return Object.keys(t)}function lee(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=U$([n.axisX,n.axisY]),d=U$([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]=aee(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===Ci||s===Lo?n.axisX:n.axisY,u=n["axis"+s[0].toUpperCase()+s.slice(1)];return a||u||o?ce({},r,a,u,o):r}function cee(e,t,n,i){const r=$n(e,t),o=e.orient;let s,a;const u={enter:s={opacity:Ee},update:a={opacity:Kn},exit:{opacity:Ee}};Tt(u,{stroke:r("domainColor"),strokeCap:r("domainCap"),strokeDash:r("domainDash"),strokeDashOffset:r("domainDashOffset"),strokeWidth:r("domainWidth"),strokeOpacity:r("domainOpacity")});const l=j$(e,0),c=j$(e,1);return s.x=a.x=pt(o,l,Ee),s.x2=a.x2=pt(o,c),s.y=a.y=yi(o,l,Ee),s.y2=a.y2=yi(o,c),Bn({type:F2,role:DJ,from:i,encode:u},n)}function j$(e,t){return{scale:e.scale,range:t}}function fee(e,t,n,i,r){const o=$n(e,t),s=e.orient,a=e.gridScale,u=vp(s,1,-1),l=dee(e.offset,u);let c,f,d;const h={enter:c={opacity:Ee},update:d={opacity:Kn},exit:f={opacity:Ee}};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:Yn,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}:ce(p,{mult:u,offset:l});return c.x=d.x=pt(s,g,m),c.y=d.y=yi(s,g,m),c.x2=d.x2=yi(s,y),c.y2=d.y2=pt(s,y),f.x=pt(s,g),f.y=yi(s,g),Bn({type:F2,role:RJ,key:Yn,from:i,encode:h},n)}function dee(e,t){if(t!==1)if(!X(e))e=ut(t)?{signal:`(${t.signal}) * (${e||0})`}:t*(e||0);else{let n=e=ce({},e);for(;n.mult!=null;)if(X(n.mult))n=n.mult=ce({},n.mult);else return n.mult=ut(t)?{signal:`(${n.mult}) * (${t.signal})`}:n.mult*t,e;n.mult=t}return e}function hee(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:Ee},update:f={opacity:Kn},exit:c={opacity:Ee}};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:Yn,band:o.band,extra:o.extra,offset:o.offset,round:s("tickRound")};return f.y=l.y=pt(a,Ee,g),f.y2=l.y2=pt(a,h),c.x=pt(a,g),f.x=l.x=yi(a,Ee,g),f.x2=l.x2=yi(a,h),c.y=yi(a,g),Bn({type:F2,role:LJ,key:Yn,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 gee(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:Yn,band:.5,offset:l3(o.offset,s("labelOffset"))},b=pt(a,g?p0(u,c,'"left"','"right"','"center"'):{value:"center"},tee(a,"left","right")),v=pt(a,p3(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:Ee,x:pt(a,y,m),y:yi(a,y,m)},S={enter:E,update:p={opacity:Kn,text:{field:A2},x:E.x,y:E.y,align:b,baseline:v},exit:{opacity:Ee,x:E.x,y:E.y}};Tt(S,{dx:!d&&g?pt(a,x):null,dy:!h&&g?yi(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=Ua(p.align,b)),p.baseline!==v&&(p.baseline=Ua(p.baseline,v)),Bn({type:oa,role:NJ,style:sf,key:Yn,from:i,encode:S,overlap:_},n)}function pee(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:Ee,anchor:gt(r("titleAnchor",null)),align:{signal:T2}},update:u=ce({},a,{opacity:Kn,text:gt(e.title)}),exit:{opacity:Ee}},c={signal:`lerp(range("${e.scale}"), ${mp(0,1,.5)})`};return u.x=pt(o,c),u.y=yi(o,c),a.angle=pt(o,Ee,uee(s,90)),a.baseline=pt(o,p3(o,Lo,Ci),{value:Lo}),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")}),mee(r,o,l,n),l.update.align=Ua(l.update.align,a.align),l.update.angle=Ua(l.update.angle,a.angle),l.update.baseline=Ua(l.update.baseline,a.baseline),Bn({type:oa,role:PJ,style:k2,from:i,encode:l},n)}function mee(e,t,n,i){const r=(a,u)=>a!=null?(n.update[u]=Ua(gt(a),n.update[u]),!1):!Ta(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 yee(e,t){const n=lee(e,t),i=e.encode||{},r=i.axis||{},o=r.name||void 0,s=r.interactive,a=r.style,u=$n(e,n),l=hZ(u),c={scale:e.scale,ticks:!!u("ticks"),labels:!!u("labels"),grid:!!u("grid"),domain:!!u("domain"),title:e.title!=null},f=ie(t.add(ki({},[c]))),d=ie(t.add(bQ({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(fee(e,n,i.grid,d,l)),c.ticks&&(g=u("tickSize"),h.push(hee(e,n,i.ticks,d,g,l))),c.labels&&(g=c.ticks?g:0,h.push(gee(e,n,i.labels,d,g,l))),c.domain&&h.push(cee(e,n,i.domain,f)),c.title&&h.push(pee(e,n,i.title,f)),bp(Sc({role:OJ,from:f,encode:Bu(bee(u,e),r,af),marks:h,aria:u("aria"),description:u("description"),zindex:u("zindex"),name:o,interactive:s,style:a}),t)}function bee(e,t){const n={enter:{},update:{}};return Tt(n,{orient:e("orient"),offset:e("offset")||0,position:ci(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 y3(e,t,n){const i=Y(e.signals),r=Y(e.scales);return n||i.forEach(o=>YR(o,t)),Y(e.projections).forEach(o=>KQ(o,t)),r.forEach(o=>zQ(o,t)),Y(e.data).forEach(o=>ZZ(o,t)),r.forEach(o=>IQ(o,t)),(n||i).forEach(o=>yQ(o,t)),Y(e.axes).forEach(o=>yee(o,t)),Y(e.marks).forEach(o=>bp(o,t)),Y(e.legends).forEach(o=>UZ(o,t)),e.title&&XZ(e.title,t),t.parseLambdas(),t}const vee=e=>Bu({enter:{x:{value:0},y:{value:0}},update:{width:{signal:"width"},height:{signal:"height"}}},e);function xee(e,t){const n=t.config,i=ie(t.root=t.add(jh())),r=wee(e,n);r.forEach(l=>YR(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(ki()),s=t.add(QR(XR(vee(e.encode),pp,E2,e.style,t,{pulse:ie(o)}))),a=t.add(t3({layout:t.objectProperty(e.layout),legends:t.legends,autosize:t.signalRef("autosize"),mark:i,pulse:ie(s)}));t.operators.pop(),t.pushState(ie(s),ie(a),null),y3(e,t,r),t.operators.push(a);let u=t.add(JR({mark:i,pulse:ie(a)}));return u=t.add(e3({pulse:ie(u)})),u=t.add(ra({pulse:ie(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 wee(e,t){const n=s=>ci(e[s],t[s]),i=[pl("background",n("background")),pl("autosize",FJ(n("autosize"))),pl("padding",MJ(n("padding"))),pl("width",n("width")||0),pl("height",n("height")||0)],r=i.reduce((s,a)=>(s[a.name]=a,s),{}),o={};return Y(e.signals).forEach(s=>{J(r,s.name)?s=ce(r[s.name],s):i.push(s),o[s.name]=s}),Y(t.signals).forEach(s=>{!J(o,s.name)&&!J(r,s.name)&&i.push(s)}),i}function b3(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 W$(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}b3.prototype=W$.prototype={parse(e){return y3(e,this)},fork(){return new W$(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 oy?ie(e):e;return this.add(OQ({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(ie(this.add(ra({pulse:e})))),this._parent.push(t),this._lookup.push(n?ie(this.proxy(n)):null),this._markpath.push(-1)},popState(){this._encode.pop(),this._parent.pop(),this._lookup.pop(),this._markpath.pop()},parent(){return xe(this._parent)},encode(){return xe(this._encode)},lookup(){return xe(this._lookup)},markpath(){const e=this._markpath;return++e[e.length-1]},fieldRef(e,t){if(K(e))return wc(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=ie(this.add(EQ(r)))}return i},compareRef(e){let t=!1;const n=o=>ut(o)?(t=!0,this.signalRef(o.signal)):aQ(o)?(t=!0,this.exprRef(o.expr)):o,i=Y(e.field).map(n),r=Y(e.order).map(n);return t?ie(this.add(F$({fields:i,orders:r}))):k$(i,r)},keyRef(e,t){let n=!1;const i=o=>ut(o)?(n=!0,ie(r[o.signal])):o,r=this.signals;return e=Y(e).map(i),n?ie(this.add(SQ({fields:e,flat:t}))):iQ(e,t)},sortRef(e){if(!e)return e;const t=hp(e.op,e.field),n=e.order||rQ;return n.signal?ie(this.add(F$({fields:t,orders:this.signalRef(n.signal)}))):k$(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 oy?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]?ie(this.signals[e]):(J(this.lambdas,e)||(this.lambdas[e]=this.add(jh(null))),ie(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=rr(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||!X(e)?e:this.signalRef(e.signal||N2(e))},exprRef(e,t){const n={expr:rr(e,this)};return t&&(n.expr.$name=t),ie(this.add(xQ(n)))},addBinding(e,t){this.bindings||N("Nested signals do not support binding: "+H(e)),this.bindings.push(ce({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,RQ(t))},addProjection(e,t){this.addScaleProj(e,MQ(t))},getScale(e){return this.scales[e]||N("Unrecognized scale name: "+H(e)),this.scales[e]},scaleRef(e){return ie(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 N2(e){return(L(e)?Eee:See)(e)}function Eee(e){const t=e.length;let n="[";for(let i=0;i<t;++i){const r=e[i];n+=(i>0?",":"")+(X(r)?r.signal||N2(r):H(r))}return n+"]"}function See(e){let t="{",n=0,i,r;for(i in e)r=e[i],t+=(++n>1?",":"")+H(i)+":"+(X(r)?r.signal||N2(r):H(r));return t+"}"}function _ee(){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 $ee(e,t,n){return X(e)||N("Input Vega specification must be an object."),t=Fu(_ee(),t,e.config),xee(e,new b3(t,n)).toRuntime()}var Aee="5.30.0";ce(Qa,o9,oj,Pj,Eq,lH,LG,pG,zG,uV,bV,$V);const kee=Object.freeze(Object.defineProperty({__proto__:null,Bounds:it,CanvasHandler:Kc,CanvasRenderer:sh,DATE:vn,DAY:zt,DAYOFYEAR:nr,Dataflow:za,Debug:Uk,Error:Qy,EventStream:$g,Gradient:cM,GroupItem:qg,HOURS:Pn,Handler:rx,HybridHandler:tO,HybridRenderer:h1,Info:Bk,Item:Wg,MILLISECONDS:xi,MINUTES:zn,MONTH:Wt,Marks:In,MultiPulse:wb,None:Ik,Operator:ze,Parameters:_g,Pulse:Ao,QUARTER:bn,RenderType:bo,Renderer:Yc,ResourceLoader:yM,SECONDS:Qn,SVGHandler:jM,SVGRenderer:cx,SVGStringRenderer:eO,Scenegraph:RM,TIME_UNITS:fb,Transform:O,View:LR,WEEK:st,Warn:Zy,YEAR:Ct,accessor:_n,accessorFields:jt,accessorName:Je,array:Y,ascending:gg,bandwidthNRD:$b,bin:pF,bootstrapCI:mF,boundClip:fO,boundContext:Hc,boundItem:u1,boundMark:TM,boundStroke:Vr,changeset:ta,clampRange:Qk,codegenExpression:lR,compare:rb,constant:Vt,cumulativeLogNormal:Mb,cumulativeNormal:kg,cumulativeUniform:Nb,dayofyear:EC,debounce:ob,defaultLocale:mb,definition:dF,densityLogNormal:Tb,densityNormal:Ab,densityUniform:Rb,domChild:ot,domClear:Wn,domCreate:mo,domFind:ix,dotbin:yF,error:N,expressionFunction:nt,extend:ce,extent:Zi,extentIndex:Zk,falsy:ro,fastmap:Mu,field:Jn,flush:eC,font:Yg,fontFamily:Xc,fontSize:cr,format:ld,formatLocale:Bd,formats:vb,hasOwnProperty:J,id:Dc,identity:Gt,inferType:tF,inferTypes:nF,ingest:Ce,inherits:G,inrange:Ma,interpolate:Rv,interpolateColors:Ug,interpolateRange:KT,intersect:aO,intersectBoxLine:Oa,intersectPath:jv,intersectPoint:Wv,intersectRule:vM,isArray:L,isBoolean:Ho,isDate:_o,isFunction:fe,isIterable:tC,isNumber:$e,isObject:X,isRegExp:nC,isString:K,isTuple:Eg,key:sb,lerp:iC,lineHeight:Do,loader:xg,locale:ZC,logger:eb,lruCache:rC,markup:lx,merge:oC,mergeConfig:Fu,multiLineOffset:ex,one:Cu,pad:sC,panLinear:Gk,panLog:Vk,panPow:Xk,panSymlog:Yk,parse:$ee,parseExpression:u2,parseSelector:Xo,path:Jy,pathCurves:Iv,pathEqual:dO,pathParse:iu,pathRectangle:hM,pathRender:cc,pathSymbols:dM,pathTrail:gM,peek:xe,point:Jg,projection:Fx,quantileLogNormal:Ob,quantileNormal:Cg,quantileUniform:Lb,quantiles:Sb,quantizeInterpolator:JT,quarter:Kk,quartiles:_b,get random(){return Zn},randomInteger:l4,randomKDE:Cb,randomLCG:u4,randomLogNormal:vF,randomMixture:xF,randomNormal:kb,randomUniform:wF,read:oF,regressionConstant:Pb,regressionExp:SF,regressionLinear:zb,regressionLoess:AF,regressionLog:EF,regressionPoly:$F,regressionPow:_F,regressionQuad:Ib,renderModule:Qg,repeat:El,resetDefaultLocale:o6,resetSVGClipId:mM,resetSVGDefIds:SU,responseType:rF,runtimeContext:SR,sampleCurve:Tg,sampleLogNormal:Fb,sampleNormal:Ag,sampleUniform:Db,scale:ke,sceneEqual:fx,sceneFromJSON:OM,scenePickVisit:Qd,sceneToJSON:MM,sceneVisit:wi,sceneZOrder:qv,scheme:Nv,serializeXML:KM,setHybridRendererOptions:vU,setRandom:s4,span:Rc,splitAccessPath:ur,stringValue:H,textMetrics:Dn,timeBin:IC,timeFloor:FC,timeFormatLocale:sc,timeInterval:Ru,timeOffset:OC,timeSequence:NC,timeUnitSpecifier:wC,timeUnits:db,toBoolean:ab,toDate:ub,toNumber:Bt,toSet:vi,toString:lb,transform:hF,transforms:Qa,truncate:aC,truthy:Ln,tupleid:re,typeParsers:J0,utcFloor:TC,utcInterval:Nu,utcOffset:DC,utcSequence:LC,utcdayofyear:$C,utcquarter:Jk,utcweek:AC,version:Aee,visitArray:ao,week:SC,writeConfig:Tu,zero:ho,zoomLinear:tb,zoomLog:nb,zoomPow:Ld,zoomSymlog:ib},Symbol.toStringTag,{value:"Module"}));/*!
|
14
|
-
* https://github.com/Starcounter-Jack/JSON-Patch
|
15
|
-
* (c) 2017-2022 Joachim Wester
|
16
|
-
* MIT licensed
|
17
|
-
*/var Cee=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)}}(),Fee=Object.prototype.hasOwnProperty;function dy(e,t){return Fee.call(e,t)}function hy(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)dy(e,r)&&i.push(r);return i}function Mn(e){switch(typeof e){case"object":return JSON.parse(JSON.stringify(e));case"undefined":return null;default:return e}}function gy(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 v3(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function py(e){if(e===void 0)return!0;if(e){if(Array.isArray(e)){for(var t=0,n=e.length;t<n;t++)if(py(e[t]))return!0}else if(typeof e=="object"){for(var i=hy(e),r=i.length,o=0;o<r;o++)if(py(e[i[o]]))return!0}}return!1}function q$(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(`
|
18
|
-
`)}var x3=function(e){Cee(t,e);function t(n,i,r,o,s){var a=this.constructor,u=e.call(this,q$(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=q$(n,{name:i,index:r,operation:o,tree:s}),u}return t}(Error),Xe=x3,Tee=Mn,Pa={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=Wh(n,this.path);i&&(i=Mn(i));var r=Cs(n,{op:"remove",path:this.from}).removed;return Cs(n,{op:"add",path:this.path,value:r}),{newDocument:n,removed:i}},copy:function(e,t,n){var i=Wh(n,this.from);return Cs(n,{op:"add",path:this.path,value:Mn(i)}),{newDocument:n}},test:function(e,t,n){return{newDocument:n,test:_c(e[t],this.value)}},_get:function(e,t,n){return this.value=e[t],{newDocument:n}}},Mee={add:function(e,t,n){return gy(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:Pa.move,copy:Pa.copy,test:Pa.test,_get:Pa._get};function Wh(e,t){if(t=="")return e;var n={op:"_get",path:t};return Cs(e,n),n.value}function Cs(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):qh(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=Wh(e,t.from),t.op==="move"&&(s.removed=e),s;if(t.op==="test"){if(s.test=_c(e,t.value),s.test===!1)throw new Xe("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 Xe("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",o,t,e);return s}}else{i||(e=Mn(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=qh;;){if(h=u[c],h&&h.indexOf("~")!=-1&&(h=v3(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&&!gy(h))throw new Xe("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);gy(h)&&(h=~~h)}if(c>=f){if(n&&t.op==="add"&&h>l.length)throw new Xe("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=Mee[t.op].call(t,l,h,e);if(s.test===!1)throw new Xe("Test operation failed","TEST_OPERATION_FAILED",o,t,e);return s}}else if(c>=f){var s=Pa[t.op].call(t,l,h,e);if(s.test===!1)throw new Xe("Test operation failed","TEST_OPERATION_FAILED",o,t,e);return s}if(l=l[h],n&&c<f&&(!l||typeof l!="object"))throw new Xe("Cannot perform operation at the desired path","OPERATION_PATH_UNRESOLVABLE",o,t,e)}}}function xp(e,t,n,i,r){if(i===void 0&&(i=!0),r===void 0&&(r=!0),n&&!Array.isArray(t))throw new Xe("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");i||(e=Mn(e));for(var o=new Array(t.length),s=0,a=t.length;s<a;s++)o[s]=Cs(e,t[s],n,!0,r,s),e=o[s].newDocument;return o.newDocument=e,o}function Oee(e,t,n){var i=Cs(e,t);if(i.test===!1)throw new Xe("Test operation failed","TEST_OPERATION_FAILED",n,t,e);return i.newDocument}function qh(e,t,n,i){if(typeof e!="object"||e===null||Array.isArray(e))throw new Xe("Operation is not an object","OPERATION_NOT_AN_OBJECT",t,e,n);if(Pa[e.op]){if(typeof e.path!="string")throw new Xe("Operation `path` property is not a string","OPERATION_PATH_INVALID",t,e,n);if(e.path.indexOf("/")!==0&&e.path.length>0)throw new Xe('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 Xe("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 Xe("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")&&py(e.value))throw new Xe("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 Xe("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 Xe("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=w3([s],n);if(a&&a.name==="OPERATION_PATH_UNRESOLVABLE")throw new Xe("Cannot perform the operation from a path that does not exist","OPERATION_FROM_UNRESOLVABLE",t,e,n)}}}else throw new Xe("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",t,e,n)}function w3(e,t,n){try{if(!Array.isArray(e))throw new Xe("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");if(t)xp(Mn(t),Mn(e),n||!0);else{n=n||qh;for(var i=0;i<e.length;i++)n(e[i],i,t,void 0)}}catch(r){if(r instanceof Xe)return r;throw r}}function _c(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(!_c(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],!_c(e[s],t[s]))return!1;return!0}return e!==e&&t!==t}const Dee=Object.freeze(Object.defineProperty({__proto__:null,JsonPatchError:Xe,_areEquals:_c,applyOperation:Cs,applyPatch:xp,applyReducer:Oee,deepClone:Tee,getValueByPointer:Wh,validate:w3,validator:qh},Symbol.toStringTag,{value:"Module"}));/*!
|
19
|
-
* https://github.com/Starcounter-Jack/JSON-Patch
|
20
|
-
* (c) 2017-2021 Joachim Wester
|
21
|
-
* MIT license
|
22
|
-
*/var L2=new WeakMap,Ree=function(){function e(t){this.observers=new Map,this.obj=t}return e}(),Nee=function(){function e(t,n){this.callback=t,this.observer=n}return e}();function Lee(e){return L2.get(e)}function Pee(e,t){return e.observers.get(t)}function zee(e,t){e.observers.delete(t.callback)}function Iee(e,t){t.unobserve()}function Bee(e,t){var n=[],i,r=Lee(e);if(!r)r=new Ree(e),L2.set(e,r);else{var o=Pee(r,t);i=o&&o.observer}if(i)return i;if(i={},r.value=Mn(e),t){i.callback=t,i.next=null;var s=function(){my(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(){my(i),clearTimeout(i.next),zee(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 Nee(t,i)),i}function my(e,t){t===void 0&&(t=!1);var n=L2.get(e.object);P2(n.value,e.object,e.patches,"",t),e.patches.length&&xp(n.value,e.patches);var i=e.patches;return i.length>0&&(e.patches=[],e.callback&&e.callback(i)),i}function P2(e,t,n,i,r){if(t!==e){typeof t.toJSON=="function"&&(t=t.toJSON());for(var o=hy(t),s=hy(e),a=!1,u=s.length-1;u>=0;u--){var l=s[u],c=e[l];if(dy(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)?P2(c,f,n,i+"/"+ps(l),r):c!==f&&(r&&n.push({op:"test",path:i+"/"+ps(l),value:Mn(c)}),n.push({op:"replace",path:i+"/"+ps(l),value:Mn(f)}))}else Array.isArray(e)===Array.isArray(t)?(r&&n.push({op:"test",path:i+"/"+ps(l),value:Mn(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];!dy(e,l)&&t[l]!==void 0&&n.push({op:"add",path:i+"/"+ps(l),value:Mn(t[l])})}}}function Uee(e,t,n){n===void 0&&(n=!1);var i=[];return P2(e,t,i,"",n),i}const jee=Object.freeze(Object.defineProperty({__proto__:null,compare:Uee,generate:my,observe:Bee,unobserve:Iee},Symbol.toStringTag,{value:"Module"}));Object.assign({},Dee,jee,{JsonPatchError:x3,deepClone:Mn,escapePathComponent:ps,unescapePathComponent:v3});var m0,H$;function Wee(){if(H$)return m0;H$=1;var e=/("(?:[^\\"]|\\.)*")|[:,]/g;return m0=function(n,i){var r,o,s;return i=i||{},r=JSON.stringify([1],void 0,i.indent===void 0?2:i.indent).slice(2,-3),o=r===""?1/0:i.maxLength===void 0?80:i.maxLength,s=i.replacer,function a(u,l,c){var f,d,h,g,p,m,y,b,v,x,E,S;if(u&&typeof u.toJSON=="function"&&(u=u.toJSON()),E=JSON.stringify(u,s),E===void 0)return E;if(y=o-l.length-c,E.length<=y&&(v=E.replace(e,function(w,_){return _||w+" "}),v.length<=y))return v;if(s!=null&&(u=JSON.parse(E),s=void 0),typeof u=="object"&&u!==null){if(b=l+r,h=[],d=0,Array.isArray(u))for(x="[",f="]",y=u.length;d<y;d++)h.push(a(u[d],b,d===y-1?0:1)||"null");else for(x="{",f="}",m=Object.keys(u),y=m.length;d<y;d++)g=m[d],p=JSON.stringify(g)+": ",S=a(u[g],b,p.length+(d===y-1?0:1)),S!==void 0&&h.push(p+S);if(h.length>0)return[x,r+h.join(`,
|
23
|
-
`+b),f].join(`
|
24
|
-
`+l)}return E}(n,"",0)},m0}var qee=Wee();const y0=oP(qee);function Hee(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 Gee={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},Vee={"*":(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},Xee={"+":e=>+e,"-":e=>-e,"~":e=>~e,"!":e=>!e};const Yee=Array.prototype.slice,ss=(e,t,n)=>{const i=n?n(t[0]):t[0];return i[e].apply(i,Yee.call(t,1))},Kee=(e,t,n,i,r,o,s)=>new Date(e,t||0,n??1,i||0,r||0,o||0,s||0);var Jee={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:Kee,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 ss("join",arguments)},indexof:function(){return ss("indexOf",arguments)},lastindexof:function(){return ss("lastIndexOf",arguments)},slice:function(){return ss("slice",arguments)},reverse:e=>e.slice().reverse(),parseFloat,parseInt,upper:e=>String(e).toUpperCase(),lower:e=>String(e).toLowerCase(),substring:function(){return ss("substring",arguments,String)},split:function(){return ss("split",arguments,String)},replace:function(){return ss("replace",arguments,String)},trim:e=>String(e).trim(),regexp:RegExp,test:(e,t)=>RegExp(e).test(t)};const Qee=["view","item","group","xy","x","y"],yy=new Set([Function,eval,setTimeout,setInterval]);typeof setImmediate=="function"&&yy.add(setImmediate);const Zee={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:Gee[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),yy.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]||Jee[i]).apply(e.fn,n.map(e))},ArrayExpression:(e,t)=>t.elements.map(e),BinaryExpression:(e,t)=>Vee[t.operator](e(t.left),e(t.right)),UnaryExpression:(e,t)=>Xee[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,yy.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=>Zee[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,Qee.forEach(a=>s.fn[a]=function(){return r.vega[a](...arguments)}),s(e)}var E3={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"&&Hee(s,i,o),l}}};const ete="5.21.0",tte={version:ete};function z2(e){return B(e,"or")}function I2(e){return B(e,"and")}function B2(e){return B(e,"not")}function Od(e,t){if(B2(e))Od(e.not,t);else if(I2(e))for(const n of e.and)Od(n,t);else if(z2(e))for(const n of e.or)Od(n,t);else t(e)}function ja(e,t){return B2(e)?{not:ja(e.not,t)}:I2(e)?{and:e.and.map(n=>ja(n,t))}:z2(e)?{or:e.or.map(n=>ja(n,t))}:t(e)}const ue=structuredClone;function S3(e){throw new Error(e)}function fu(e,t){const n={};for(const i of t)J(e,i)&&(n[i]=e[i]);return n}function mn(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 be(e){if($e(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 by(e){return e===!1||e===null}function ye(e,t){return e.includes(t)}function du(e,t){let n=0;for(const[i,r]of e.entries())if(t(r,i,n++))return!0;return!1}function U2(e,t){let n=0;for(const[i,r]of e.entries())if(!t(r,i,n++))return!1;return!0}function _3(e,...t){for(const n of t)nte(e,n??{});return e}function nte(e,t){for(const n of I(t))Tu(e,n,t[n],!0)}function Vi(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 ite(e,t){const n=I(e),i=I(t);if(n.length!==i.length)return!1;for(const r of n)if(e[r]!==t[r])return!1;return!0}function $3(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function j2(e,t){for(const n of e)if(t.has(n))return!0;return!1}function vy(e){const t=new Set;for(const n of e){const r=ur(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 W2(e,t){return e===void 0||t===void 0?!0:j2(vy(e),vy(t))}function Re(e){return I(e).length===0}const I=Object.keys,Ft=Object.values,Po=Object.entries;function $c(e){return e===!0||e===!1}function We(e){const t=e.replace(/\W/g,"_");return(e.match(/^\d+/)?"_":"")+t}function ec(e,t){return B2(e)?`!(${ec(e.not,t)})`:I2(e)?`(${e.and.map(n=>ec(n,t)).join(") && (")})`:z2(e)?`(${e.or.map(n=>ec(n,t)).join(") || (")})`:t(e)}function Hh(e,t){if(t.length===0)return!0;const n=t.shift();return n in e&&Hh(e[n],t)&&delete e[n],Re(e)}function uf(e){return e.charAt(0).toUpperCase()+e.substr(1)}function q2(e,t="datum"){const n=ur(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 A3(e,t="datum"){return`${t}[${H(ur(e).join("."))}]`}function rte(e){return e.replace(/(\[|\]|\.|'|")/g,"\\$1")}function ti(e){return`${ur(e).map(rte).join("\\.")}`}function Ws(e,t,n){return e.replace(new RegExp(t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),"g"),n)}function Wu(e){return`${ur(e).join(".")}`}function hu(e){return e?ur(e).length:0}function et(...e){return e.find(t=>t!==void 0)}let k3=42;function C3(e){const t=++k3;return e?String(e)+t:t}function ote(){k3=42}function F3(e){return T3(e)?e:`__${e}`}function T3(e){return e.startsWith("__")}function Ac(e){if(e!==void 0)return(e%360+360)%360}function wp(e){return $e(e)?!0:!isNaN(e)&&!isNaN(parseFloat(e))}const G$=Object.getPrototypeOf(structuredClone({}));function On(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(!On(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(!On(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!==G$.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString&&e.toString!==G$.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(!On(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 B(e,t){return X(e)&&J(e,t)&&e[t]!==void 0}const Pr="row",zr="column",Ep="facet",qe="x",vt="y",Fi="x2",gr="y2",Yo="xOffset",qu="yOffset",Ti="radius",Yr="radius2",ri="theta",Kr="theta2",Mi="latitude",Oi="longitude",Di="latitude2",ni="longitude2",wn="color",pr="fill",mr="stroke",En="shape",Jr="size",sa="angle",Qr="opacity",Ko="fillOpacity",Jo="strokeOpacity",Qo="strokeWidth",Zo="strokeDash",lf="text",gu="order",cf="detail",Sp="key",qs="tooltip",_p="href",$p="url",Ap="description",ste={x:1,y:1,x2:1,y2:1},M3={theta:1,theta2:1,radius:1,radius2:1};function O3(e){return J(M3,e)}const H2={longitude:1,longitude2:1,latitude:1,latitude2:1};function D3(e){switch(e){case Mi:return"y";case Di:return"y2";case Oi:return"x";case ni:return"x2"}}function R3(e){return J(H2,e)}const ate=I(H2),G2={...ste,...M3,...H2,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 Wa(e){return e===wn||e===pr||e===mr}const N3={row:1,column:1,facet:1},Xn=I(N3),V2={...G2,...N3},ute=I(V2),{order:Hfe,detail:Gfe,tooltip:Vfe,...lte}=V2,{row:Xfe,column:Yfe,facet:Kfe,...cte}=lte;function fte(e){return J(cte,e)}function L3(e){return J(V2,e)}const dte=[Fi,gr,Di,ni,Kr,Yr];function P3(e){return aa(e)!==e}function aa(e){switch(e){case Fi:return qe;case gr:return vt;case Di:return Mi;case ni:return Oi;case Kr:return ri;case Yr:return Ti}return e}function zo(e){if(O3(e))switch(e){case ri:return"startAngle";case Kr:return"endAngle";case Ti:return"outerRadius";case Yr:return"innerRadius"}return e}function yr(e){switch(e){case qe:return Fi;case vt:return gr;case Mi:return Di;case Oi:return ni;case ri:return Kr;case Ti:return Yr}}function Sn(e){switch(e){case qe:case Fi:return"width";case vt:case gr:return"height"}}function z3(e){switch(e){case qe:return"xOffset";case vt:return"yOffset";case Fi:return"x2Offset";case gr:return"y2Offset";case ri:return"thetaOffset";case Ti:return"radiusOffset";case Kr:return"theta2Offset";case Yr:return"radius2Offset"}}function X2(e){switch(e){case qe:return"xOffset";case vt:return"yOffset"}}function hte(e){switch(e){case"xOffset":return"x";case"yOffset":return"y"}}const gte=I(G2),{x:Jfe,y:Qfe,x2:Zfe,y2:ede,xOffset:tde,yOffset:nde,latitude:ide,longitude:rde,latitude2:ode,longitude2:sde,theta:ade,theta2:ude,radius:lde,radius2:cde,...Y2}=G2,pte=I(Y2),K2={x:1,y:1},Zr=I(K2);function tt(e){return J(K2,e)}const J2={theta:1,radius:1},mte=I(J2);function kp(e){return e==="width"?qe:vt}const I3={xOffset:1,yOffset:1};function ff(e){return J(I3,e)}const{text:fde,tooltip:dde,href:hde,url:gde,description:pde,detail:mde,key:yde,order:bde,...B3}=Y2,yte=I(B3);function bte(e){return J(Y2,e)}function vte(e){switch(e){case wn:case pr:case mr:case Jr:case En:case Qr:case Qo:case Zo:return!0;case Ko:case Jo:case sa:return!1}}const U3={...K2,...J2,...I3,...B3},Q2=I(U3);function br(e){return J(U3,e)}function xte(e,t){return Ete(e)[t]}const j3={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:vde,...wte}=j3;function Ete(e){switch(e){case wn:case pr:case mr:case Ap:case cf:case Sp:case qs:case _p:case gu:case Qr:case Ko:case Jo:case Qo:case Ep:case Pr:case zr:return j3;case qe:case vt:case Yo:case qu:case Mi:case Oi:return wte;case Fi:case gr:case Di:case ni:return{area:"always",bar:"always",image:"always",rect:"always",rule:"always",circle:"binned",point:"binned",square:"binned",tick:"binned",line:"binned",trail:"binned"};case Jr:return{point:"always",tick:"always",rule:"always",circle:"always",square:"always",bar:"always",text:"always",line:"always",trail:"always"};case Zo:return{line:"always",point:"always",tick:"always",rule:"always",circle:"always",square:"always",bar:"always",geoshape:"always"};case En:return{point:"always",geoshape:"always"};case lf:return{text:"always"};case sa:return{point:"always",square:"always",text:"always"};case $p:return{image:"always"};case ri:return{text:"always",arc:"always"};case Ti:return{text:"always",arc:"always"};case Kr:case Yr:return{arc:"always"}}}function b0(e){switch(e){case qe:case vt:case ri:case Ti:case Yo:case qu:case Jr:case sa:case Qo:case Qr:case Ko:case Jo:case Fi:case gr:case Kr:case Yr:return;case Ep:case Pr:case zr:case En:case Zo:case lf:case qs:case _p:case $p:case Ap:return"discrete";case wn:case pr:case mr:return"flexible";case Mi:case Oi:case Di:case ni:case cf:case Sp:case gu:return}}const Ste={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},_te={count:1,min:1,max:1};function Hr(e){return B(e,"argmin")}function es(e){return B(e,"argmax")}function Z2(e){return K(e)&&J(Ste,e)}const $te=new Set(["count","valid","missing","distinct"]);function Cp(e){return K(e)&&$te.has(e)}function Ate(e){return K(e)&&ye(["min","max"],e)}const kte=new Set(["count","sum","distinct","valid","missing"]),Cte=new Set(["mean","average","median","q1","q3","min","max"]);function W3(e){return Ho(e)&&(e=Bp(e,void 0)),"bin"+I(e).map(t=>Fp(e[t])?We(`_${t}_${Po(e[t])}`):We(`_${t}_${e[t]}`)).join("")}function Ie(e){return e===!0||ua(e)&&!e.binned}function Et(e){return e==="binned"||ua(e)&&e.binned===!0}function ua(e){return X(e)}function Fp(e){return B(e,"param")}function V$(e){switch(e){case Pr:case zr:case Jr:case wn:case pr:case mr:case Qo:case Qr:case Ko:case Jo:case En:return 6;case Zo:return 4;default:return 10}}function df(e){return B(e,"expr")}function St(e,{level:t}={level:0}){const n=I(e||{}),i={};for(const r of n)i[r]=t===0?Fn(e[r]):St(e[r],{level:t-1});return i}function q3(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=fu(e,["align","baseline","dx","dy","limit"]);return{titleMarkConfig:m,subtitleMarkConfig:v,nonMarkTitleProperties:y,subtitle:b}}function fo(e){return K(e)||L(e)&&K(e[0])}function ee(e){return B(e,"signal")}function la(e){return B(e,"step")}function Fte(e){return L(e)?!1:B(e,"fields")&&!B(e,"data")}function Tte(e){return L(e)?!1:B(e,"fields")&&B(e,"data")}function Rr(e){return L(e)?!1:B(e,"field")&&B(e,"data")}const Mte={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},Ote=I(Mte),Dte={arc:1,area:1,group:1,image:1,line:1,path:1,rect:1,rule:1,shape:1,symbol:1,text:1,trail:1},xy=["cornerRadius","cornerRadiusTopLeft","cornerRadiusTopRight","cornerRadiusBottomLeft","cornerRadiusBottomRight"];function H3(e){const t=L(e.condition)?e.condition.map(X$):X$(e.condition);return{...Fn(e),condition:t}}function Fn(e){if(df(e)){const{expr:t,...n}=e;return{signal:t,...n}}return e}function X$(e){if(df(e)){const{expr:t,...n}=e;return{signal:t,...n}}return e}function Ue(e){if(df(e)){const{expr:t,...n}=e;return{signal:t,...n}}return ee(e)?e:e!==void 0?{value:e}:void 0}function Rte(e){return ee(e)?e.signal:H(e)}function Y$(e){return ee(e)?e.signal:H(e.value)}function pi(e){return ee(e)?e.signal:e==null?null:H(e)}function Nte(e,t,n){for(const i of n){const r=or(i,t.markDef,t.config);r!==void 0&&(e[i]=Ue(r))}return e}function G3(e){return[].concat(e.type,e.style??[])}function De(e,t,n,i={}){const{vgChannel:r,ignoreVgConfig:o}=i;return r&&B(t,r)?t[r]:t[e]!==void 0?t[e]:o&&(!r||r===e)?void 0:or(e,t,n,i)}function or(e,t,n,{vgChannel:i}={}){const r=wy(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 wy(e,t,n){return V3(e,G3(t),n)}function V3(e,t,n){t=Y(t);let i;for(const r of t){const o=n[r];B(o,e)&&(i=o[e])}return i}function X3(e,t){return Y(e).reduce((n,i)=>(n.field.push(V(i,t)),n.order.push(i.sort??"ascending"),n),{field:[],order:[]})}function Y3(e,t){const n=[...e];return t.forEach(i=>{for(const r of n)if(On(r,i))return;n.push(i)}),n}function K3(e,t){return On(e,t)||!t?e:e?[...Y(e),...Y(t)].join(", "):t}function J3(e,t){const n=e.value,i=t.value;if(n==null||i===null)return{explicit:e.explicit,value:null};if((fo(n)||ee(n))&&(fo(i)||ee(i)))return{explicit:e.explicit,value:K3(n,i)};if(fo(n)||ee(n))return{explicit:e.explicit,value:n};if(fo(i)||ee(i))return{explicit:e.explicit,value:i};if(!fo(n)&&!ee(n)&&!fo(i)&&!ee(i))return{explicit:e.explicit,value:Y3(n,i)};throw new Error("It should never reach here")}function ew(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 Lte='Autosize "fit" only works for single views and layered views.';function K$(e){return`${e=="width"?"Width":"Height"} "container" only works for single views and layered views.`}function J$(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 Q$(e){return e?`Dropping "fit-${e}" because spec has discrete ${Sn(e)}.`:'Dropping "fit" because spec has discrete size.'}function tw(e){return`Unknown field for ${e}. Cannot calculate view size.`}function Z$(e){return`Cannot project a selection on encoding channel "${e}", which has no field.`}function Pte(e,t){return`Cannot project a selection on encoding channel "${e}" as it uses an aggregate function ("${t}").`}function zte(e){return`The "nearest" transform is not supported for ${e} marks.`}function Q3(e){return`Selection not supported for ${e} yet.`}function Ite(e){return`Cannot find a selection named "${e}".`}const Bte="Scale bindings are currently only supported for scales with unbinned, continuous domains.",Ute="Sequntial scales are deprecated. The available quantitative scale type values are linear, log, pow, sqrt, symlog, time and utc",jte="Legend bindings are only supported for selections over an individual field or encoding channel.";function Wte(e){return`Lookups can only be performed on selection parameters. "${e}" is a variable parameter.`}function qte(e){return`Cannot define and lookup the "${e}" selection in the same view. Try moving the lookup into a second, layered view?`}const Hte="The same selection must be used to override scale domains in a layered view.",Gte='Interval selections should be initialized using "x", "y", "longitude", or "latitude" keys.';function Vte(e){return`Unknown repeated value "${e}".`}function eA(e){return`The "columns" property cannot be used when "${e}" has nested row/column.`}const Xte="Axes cannot be shared in concatenated or repeated views yet (https://github.com/vega/vega-lite/issues/2415).";function Yte(e){return`Unrecognized parse "${e}".`}function tA(e,t,n){return`An ancestor parsed field "${e}" as ${n} but a child wants to parse the field as ${t}.`}const Kte="Attempt to add the same child twice.";function Jte(e){return`Ignoring an invalid transform: ${Ne(e)}.`}const Qte='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 nA(e){return`Config.customFormatTypes is not true, thus custom format type and format for channel ${e} are dropped.`}function Zte(e){const{parentProjection:t,projection:n}=e;return`Layer's shared projection ${Ne(t)} is overridden by a child projection ${Ne(n)}.`}const ene="Arc marks uses theta channel rather than angle, replacing angle with theta.";function tne(e){return`${e}Offset dropped because ${e} is continuous`}function nne(e,t,n){return`Channel ${e} is a ${t}. Converted to {value: ${Ne(n)}}.`}function Z3(e){return`Invalid field type "${e}".`}function ine(e,t){return`Invalid field type "${e}" for aggregate: "${t}", using "quantitative" instead.`}function rne(e){return`Invalid aggregation operator "${e}".`}function eN(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 one(e){return`Position range does not support relative band size for ${e}.`}function Ey(e,t){return`Dropping ${Ne(e)} from channel "${t}" since it does not contain any data field, datum, value, or signal.`}const sne="Line marks cannot encode size with a non-groupby field. You may want to use trail marks instead.";function Tp(e,t,n){return`${e} dropped as it is incompatible with "${t}".`}function ane(e){return`${e}-encoding is dropped as ${e} is not a valid encoding channel.`}function une(e){return`${e} encoding should be discrete (ordinal / nominal / binned).`}function lne(e){return`${e} encoding should be discrete (ordinal / nominal / binned) or use a discretizing scale (e.g. threshold).`}function cne(e){return`Facet encoding dropped as ${e.join(" and ")} ${e.length>1?"are":"is"} also specified.`}function v0(e,t){return`Using discrete channel "${e}" to encode "${t}" field can be misleading as it does not encode ${t==="ordinal"?"order":"magnitude"}.`}function fne(e){return`The ${e} for range marks cannot be an expression`}function dne(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 hne(e,t){return`Specified orient "${e}" overridden with "${t}".`}function gne(e){return`Cannot use the scale property "${e}" with non-color channel.`}function pne(e){return`Cannot use the relative band size with ${e} scale.`}function mne(e){return`Using unaggregated domain with raw field has no effect (${Ne(e)}).`}function yne(e){return`Unaggregated domain not applicable for "${e}" since it produces values outside the origin domain of the source data.`}function bne(e){return`Unaggregated domain is currently unsupported for log scale (${Ne(e)}).`}function vne(e){return`Cannot apply size to non-oriented mark "${e}".`}function xne(e,t,n){return`Channel "${e}" does not work with "${t}" scale. We are using "${n}" scale instead.`}function wne(e,t){return`FieldDef does not work with "${e}" scale. We are using "${t}" scale instead.`}function tN(e,t,n){return`${n}-scale's "${t}" is dropped as it does not work with ${e} scale.`}function nN(e){return`The step for "${e}" is dropped because the ${e==="width"?"x":"y"} is continuous.`}function Ene(e,t,n,i){return`Conflicting ${t.toString()} property "${e.toString()}" (${Ne(n)} and ${Ne(i)}). Using ${Ne(n)}.`}function Sne(e,t,n,i){return`Conflicting ${t.toString()} property "${e.toString()}" (${Ne(n)} and ${Ne(i)}). Using the union of the two domains.`}function _ne(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 $ne(e){return`Dropping sort property ${Ne(e)} as unioned domains only support boolean or op "count", "min", and "max".`}const iA="Domains that should be unioned has conflicting sort properties. Sort will be set to true.",Ane="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.",kne="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.",Cne="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 Fne(e){return`Cannot stack "${e}" if there is already "${e}2".`}function Tne(e){return`Stack is applied to a non-linear scale (${e}).`}function Mne(e){return`Stacking is applied even though the aggregate function is non-summative ("${e}").`}function Gh(e,t){return`Invalid ${e}: ${Ne(t)}.`}function One(e){return`Dropping day from datetime ${Ne(e)} as day cannot be combined with other units.`}function Dne(e,t){return`${t?"extent ":""}${t&&e?"and ":""}${e?"center ":""}${t&&e?"are ":"is "}not needed when data are aggregated.`}function Rne(e,t,n){return`${e} is not usually used with ${t} for ${n}.`}function Nne(e,t){return`Continuous axis should not have customized aggregation function ${e}; ${t} already agregates the axis.`}function rA(e){return`1D error band does not support ${e}.`}function iN(e){return`Channel ${e} is required for "binned" bin.`}function Lne(e){return`Channel ${e} should not be used with "binned" bin.`}function Pne(e){return`Domain for ${e} is required for threshold scale.`}const rN=eb(Zy);let pu=rN;function zne(e){return pu=e,pu}function Ine(){return pu=rN,pu}function j(...e){pu.warn(...e)}function Bne(...e){pu.debug(...e)}function ca(e){if(e&&X(e)){for(const t of iw)if(B(e,t))return!0}return!1}const oN=["january","february","march","april","may","june","july","august","september","october","november","december"],Une=oN.map(e=>e.substr(0,3)),sN=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"],jne=sN.map(e=>e.substr(0,3));function Wne(e){if(wp(e)&&(e=+e),$e(e))return e>4&&j(Gh("quarter",e)),e-1;throw new Error(Gh("quarter",e))}function qne(e){if(wp(e)&&(e=+e),$e(e))return e-1;{const t=e.toLowerCase(),n=oN.indexOf(t);if(n!==-1)return n;const i=t.substr(0,3),r=Une.indexOf(i);if(r!==-1)return r;throw new Error(Gh("month",e))}}function Hne(e){if(wp(e)&&(e=+e),$e(e))return e%7;{const t=e.toLowerCase(),n=sN.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(Gh("day",e))}}function nw(e,t){const n=[];if(t&&e.day!==void 0&&I(e).length>1&&(j(One(e)),e=ue(e),delete e.day),e.year!==void 0?n.push(e.year):n.push(2012),e.month!==void 0){const i=t?qne(e.month):e.month;n.push(i)}else if(e.quarter!==void 0){const i=t?Wne(e.quarter):e.quarter;n.push($e(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?Hne(e.day):e.day;n.push($e(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=nw(e,!0).join(", ");return e.utc?`utc(${n})`:`datetime(${n})`}function Gne(e){const n=nw(e,!1).join(", ");return e.utc?`utc(${n})`:`datetime(${n})`}function Vne(e){const t=nw(e,!0);return e.utc?+new Date(Date.UTC(...t)):+new Date(...t)}const aN={year:1,quarter:1,month:1,week:1,day:1,dayofyear:1,date:1,hours:1,minutes:1,seconds:1,milliseconds:1},iw=I(aN);function Xne(e){return J(aN,e)}function fa(e){return X(e)?e.binned:uN(e)}function uN(e){return e&&e.startsWith("binned")}function rw(e){return e.startsWith("utc")}function Yne(e){return e.substring(3)}const Kne={"year-month":"%b %Y ","year-month-date":"%b %d, %Y "};function Mp(e){return iw.filter(t=>cN(e,t))}function lN(e){const t=Mp(e);return t[t.length-1]}function cN(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 Jne(e,t,{end:n}={end:!1}){const i=q2(t),r=rw(e)?"utc":"";function o(u){return u==="quarter"?`(${r}quarter(${i})-1)`:`${r}${u}(${i})`}let s;const a={};for(const u of iw)cN(e,u)&&(a[u]=o(u),s=u);return n&&(a[s]+="+1"),Gne(a)}function fN(e){if(!e)return;const t=Mp(e);return`timeUnitSpecifier(${Ne(t)}, ${Ne(Kne)})`}function Qne(e,t,n){if(!e)return;const i=fN(e);return`${n||rw(e)?"utc":"time"}Format(${t}, ${i})`}function mt(e){if(!e)return;let t;return K(e)?uN(e)?t={unit:e.substring(6),binned:!0}:t={unit:e}:X(e)&&(t={...e,...e.unit?{unit:e.unit}:{}}),rw(t.unit)&&(t.utc=!0,t.unit=Yne(t.unit)),t}function Zne(e){const{utc:t,...n}=mt(e);return n.unit?(t?"utc":"")+I(n).map(i=>We(`${i==="unit"?"":`_${i}_`}${n[i]}`)).join(""):(t?"utc":"")+"timeunit"+I(n).map(i=>We(`_${i}_${n[i]}`)).join("")}function dN(e,t=n=>n){const n=mt(e),i=lN(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}=hN(i,n.step),a={...r,[s]:+r[s]+o};return`${t(Hs(a))} - ${t(Hs(r))}`}}const eie={year:1,month:1,date:1,hours:1,minutes:1,seconds:1,milliseconds:1};function tie(e){return J(eie,e)}function hN(e,t=1){if(tie(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 nie(e){return B(e,"param")}function ow(e){return!!(e!=null&&e.field)&&e.equal!==void 0}function sw(e){return!!(e!=null&&e.field)&&e.lt!==void 0}function aw(e){return!!(e!=null&&e.field)&&e.lte!==void 0}function uw(e){return!!(e!=null&&e.field)&&e.gt!==void 0}function lw(e){return!!(e!=null&&e.field)&&e.gte!==void 0}function cw(e){if(e!=null&&e.field){if(L(e.range)&&e.range.length===2)return!0;if(ee(e.range))return!0}return!1}function fw(e){return!!(e!=null&&e.field)&&(L(e.oneOf)||L(e.in))}function iie(e){return!!(e!=null&&e.field)&&e.valid!==void 0}function gN(e){return fw(e)||ow(e)||cw(e)||sw(e)||uw(e)||aw(e)||lw(e)}function zi(e,t){return Up(e,{timeUnit:t,wrapTime:!0})}function rie(e,t){return e.map(n=>zi(n,t))}function pN(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:Jne(r,n)})`:s;if(ow(e))return`${a}===${zi(e.equal,r)}`;if(sw(e)){const u=e.lt;return`${a}<${zi(u,r)}`}else if(uw(e)){const u=e.gt;return`${a}>${zi(u,r)}`}else if(aw(e)){const u=e.lte;return`${a}<=${zi(u,r)}`}else if(lw(e)){const u=e.gte;return`${a}>=${zi(u,r)}`}else{if(fw(e))return`indexof([${rie(e.oneOf,r).join(",")}], ${a}) !== -1`;if(iie(e))return Op(a,e.valid);if(cw(e)){const{range:u}=St(e),l=ee(u)?{signal:`${u.signal}[0]`}:u[0],c=ee(u)?{signal:`${u.signal}[1]`}:u[1];if(l!==null&&c!==null&&t)return"inrange("+a+", ["+zi(l,r)+", "+zi(c,r)+"])";const f=[];return l!==null&&f.push(`${a} >= ${zi(l,r)}`),c!==null&&f.push(`${a} <= ${zi(c,r)}`),f.length>0?f.join(" && "):"true"}}throw new Error(`Invalid field predicate: ${Ne(e)}`)}function Op(e,t=!0){return t?`isValid(${e}) && isFinite(+${e})`:`!isValid(${e}) || !isFinite(+${e})`}function oie(e){return gN(e)&&e.timeUnit?{...e,timeUnit:mt(e.timeUnit)}:e}const hf={quantitative:"quantitative",ordinal:"ordinal",temporal:"temporal",nominal:"nominal",geojson:"geojson"};function sie(e){return e==="quantitative"||e==="temporal"}function mN(e){return e==="ordinal"||e==="nominal"}const Gs=hf.quantitative,dw=hf.ordinal,mu=hf.temporal,hw=hf.nominal,Hu=hf.geojson;function aie(e){if(e)switch(e=e.toLowerCase(),e){case"q":case Gs:return"quantitative";case"t":case mu:return"temporal";case"o":case dw:return"ordinal";case"n":case hw:return"nominal";case Hu:return"geojson"}}const _t={LINEAR:"linear",LOG:"log",POW:"pow",SQRT:"sqrt",TIME:"time",UTC:"utc",POINT:"point",BAND:"band"},Sy={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 uie(e,t){const n=Sy[e],i=Sy[t];return n===i||n==="ordinal-position"&&i==="time"||i==="ordinal-position"&&n==="time"}const lie={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 oA(e){return lie[e]}const yN=new Set(["linear","log","pow","sqrt","symlog"]),bN=new Set([...yN,"time","utc"]);function vN(e){return yN.has(e)}const xN=new Set(["quantile","quantize","threshold"]),cie=new Set([...bN,...xN,"sequential","identity"]),fie=new Set(["ordinal","bin-ordinal","point","band"]);function yt(e){return fie.has(e)}function Ei(e){return cie.has(e)}function Xi(e){return bN.has(e)}function yu(e){return xN.has(e)}const die={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 hie(e){return!K(e)&&B(e,"name")}function wN(e){return B(e,"param")}function gie(e){return B(e,"unionWith")}function pie(e){return X(e)&&"field"in e}const mie={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:xde,domain:wde,range:Ede,rangeMax:Sde,rangeMin:_de,scheme:$de,...yie}=mie,bie=I(yie);function _y(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 Xi(e)||e==="band"||e==="point";case"padding":case"rangeMin":case"rangeMax":return Xi(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 Xi(e);case"nice":return Xi(e)||e==="quantize"||e==="threshold";case"exponent":return e==="pow";case"base":return e==="log";case"constant":return e==="symlog";case"zero":return Ei(e)&&!ye(["log","time","utc","threshold","quantile"],e)}}function EN(e,t){switch(t){case"interpolate":case"scheme":case"domainMid":return Wa(e)?void 0:gne(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 vie(e,t){return ye([dw,hw],t)?e===void 0||yt(e):t===mu?ye([_t.TIME,_t.UTC,void 0],e):t===Gs?vN(e)||yu(e)||e===void 0:!0}function xie(e,t,n=!1){if(!br(e))return!1;switch(e){case qe:case vt:case Yo:case qu:case ri:case Ti:return Xi(t)||t==="band"?!0:t==="point"?!n:!1;case Jr:case Qo:case Qr:case Ko:case Jo:case sa:return Xi(t)||yu(t)||ye(["band","point","ordinal"],t);case wn:case pr:case mr:return t!=="band";case Zo:case En:return t==="ordinal"||yu(t)}}function wie(e){return X(e)&&"value"in e}const fn={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"},SN=fn.arc,Dp=fn.area,Rp=fn.bar,Eie=fn.image,Np=fn.line,Lp=fn.point,Sie=fn.rect,Vh=fn.rule,_N=fn.text,gw=fn.tick,_ie=fn.trail,pw=fn.circle,mw=fn.square,$N=fn.geoshape;function ts(e){return["line","area","trail"].includes(e)}function kc(e){return["rect","bar","image","arc","tick"].includes(e)}const $ie=new Set(I(fn));function sr(e){return B(e,"type")}const Aie=["stroke","strokeWidth","strokeDash","strokeDashOffset","strokeOpacity","strokeJoin","strokeMiterLimit"],kie=["fill","fillOpacity"],Cie=[...Aie,...kie],Fie={color:1,filled:1,invalid:1,order:1,radius2:1,theta2:1,timeUnitBandSize:1,timeUnitBandPosition:1},sA=I(Fie),x0=["binSpacing","continuousBandSize","discreteBandSize","minBandSize"],Tie={area:["line","point"],bar:x0,rect:x0,line:["point"],tick:["bandSize","thickness",...x0]},Mie={color:"#4c78a8",invalid:"break-paths-show-path-domains",timeUnitBandSize:1},Oie={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},AN=I(Oie);function Vs(e){return B(e,"band")}const Die={horizontal:["cornerRadiusTopRight","cornerRadiusBottomRight"],vertical:["cornerRadiusTopLeft","cornerRadiusTopRight"]},Rie=5,yw={binSpacing:0,continuousBandSize:Rie,minBandSize:.25,timeUnitBandPosition:.5},Nie={...yw,binSpacing:1},Lie={...yw,thickness:1};function Pie(e){return sr(e)?e.type:e}function kN(e,{isPath:t}){return e===void 0||e==="break-paths-show-path-domains"?t?"break-paths-show-domains":"filter":e===null?"show":e}function bw({markDef:e,config:t,scaleChannel:n,scaleType:i,isCountAggregate:r}){var a,u;if(!i||!Ei(i)||r)return"always-valid";const o=kN(De("invalid",e,t),{isPath:ts(e.type)});return((u=(a=t.scale)==null?void 0:a.invalid)==null?void 0:u[n])!==void 0?"show":o}function zie(e){return e==="break-paths-filter-domains"||e==="break-paths-show-domains"}function CN({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 FN({scaleChannel:e,channelDef:t,scale:n,scaleName:i,markDef:r,config:o}){var c;const s=n==null?void 0:n.get("type"),a=_i(t),u=Cp(a==null?void 0:a.aggregate),l=bw({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:Op(V(a,{expr:"datum"}),!1),...Iie(f,n,i)}}}function Iie(e,t,n){if(wie(e)){const{value:i}=e;return ee(i)?{signal:i.signal}:{value:i}}return CN({scale:t,scaleName:n,mode:"zeroOrMin"})}function vw(e){const{channel:t,channelDef:n,markDef:i,scale:r,scaleName:o,config:s}=e,a=aa(t),u=xw(e),l=FN({scaleChannel:a,channelDef:n,scale:r,scaleName:o,markDef:i,config:s});return l!==void 0?[l,u]:u}function Bie(e){const{datum:t}=e;return ca(t)?Hs(t):`${Ne(t)}`}function Fs(e,t,n,i){const r={};if(t&&(r.scale=t),vr(e)){const{datum:o}=e;ca(o)?r.signal=Hs(o):ee(o)?r.signal=o.signal:df(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 Xh({scaleName:e,fieldOrDatumDef:t,fieldOrDatumDef2:n,offset:i,startSuffix:r,endSuffix:o="end",bandPosition:s=.5}){const a=!ee(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=ee(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 Uie({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 xw({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(le(t)){const f=s==null?void 0:s.get("type");if(ln(t)){c??(c=Io({fieldDef:t,fieldDef2:n,markDef:i,config:r}));const{bin:d,timeUnit:h,type:g}=t;if(Ie(d)||c&&h&&g===mu)return a!=null&&a.impute?Fs(t,o,{binSuffix:"mid"},{offset:u}):c&&!yt(f)?Xh({scaleName:o,fieldOrDatumDef:t,bandPosition:c,offset:u}):Fs(t,o,bf(t,e)?{binSuffix:"range"}:{},{offset:u});if(Et(d)){if(W(n))return Xh({scaleName:o,fieldOrDatumDef:t,fieldOrDatumDef2:n,bandPosition:c,offset:u});j(iN(e===qe?Fi:gr))}}return Fs(t,o,yt(f)?{binSuffix:"range"}:{},{offset:u,band:f==="band"?c??t.bandPosition??.5:void 0})}else if(Si(t)){const f=t.value,d=u?{offset:u}:{};return{...tc(e,f),...d}}}return fe(l)&&(l=l()),l&&{...l,...u?{offset:u}:{}}}function tc(e,t){return ye(["x","x2"],e)&&t==="width"?{field:{group:"width"}}:ye(["y","y2"],e)&&t==="height"?{field:{group:"height"}}:Ue(t)}function Xs(e){return e&&e!=="number"&&e!=="time"}function TN(e,t,n){return`${e}(${t}${n?`, ${Ne(n)}`:""})`}const jie=" – ";function ww({fieldOrDatumDef:e,format:t,formatType:n,expr:i,normalizeStack:r,config:o}){var u,l;if(Xs(n))return mi({fieldOrDatumDef:e,format:t,formatType:n,expr:i,config:o});const s=MN(e,i,r),a=bu(e);if(t===void 0&&n===void 0&&o.customFormatTypes){if(a==="quantitative"){if(r&&o.normalizedNumberFormatType)return mi({fieldOrDatumDef:e,format:o.normalizedNumberFormat,formatType:o.normalizedNumberFormatType,expr:i,config:o});if(o.numberFormatType)return mi({fieldOrDatumDef:e,format:o.numberFormat,formatType:o.numberFormatType,expr:i,config:o})}if(a==="temporal"&&o.timeFormatType&&W(e)&&e.timeUnit===void 0)return mi({fieldOrDatumDef:e,format:o.timeFormat,formatType:o.timeFormatType,expr:i,config:o})}if(xu(e)){const c=qie({field:s,timeUnit:W(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=$y({type:a,specifiedFormat:t,config:o,normalizeStack:r}),W(e)&&Ie(e.bin)){const c=V(e,{expr:i,binSuffix:"end"});return{signal:gf(s,c,t,n,o)}}else return t||bu(e)==="quantitative"?{signal:`${RN(s,t)}`}:{signal:`isValid(${s}) ? ${s} : ""+${s}`}}function MN(e,t,n){return W(e)?n?`${V(e,{expr:t,suffix:"end"})}-${V(e,{expr:t,suffix:"start"})}`:V(e,{expr:t}):Bie(e)}function mi({fieldOrDatumDef:e,format:t,formatType:n,expr:i,normalizeStack:r,config:o,field:s}){if(s??(s=MN(e,i,r)),s!=="datum.value"&&W(e)&&Ie(e.bin)){const a=V(e,{expr:i,binSuffix:"end"});return{signal:gf(s,a,t,n,o)}}return{signal:TN(n,s,t)}}function ON(e,t,n,i,r,o){var s;if(!(K(i)&&Xs(i))&&!(n===void 0&&i===void 0&&r.customFormatTypes&&bu(e)==="quantitative"&&(r.normalizedNumberFormatType&&vu(e)&&e.stack==="normalize"||r.numberFormatType))){if(vu(e)&&e.stack==="normalize"&&r.normalizedNumberFormat)return $y({type:"quantitative",config:r,normalizeStack:!0});if(xu(e)){const a=W(e)?(s=mt(e.timeUnit))==null?void 0:s.unit:void 0;return a===void 0&&r.customFormatTypes&&r.timeFormatType?void 0:Wie({specifiedFormat:n,timeUnit:a,config:r,omitTimeFormatConfig:o})}return $y({type:t,specifiedFormat:n,config:r})}}function DN(e,t,n){var i;if(e&&(ee(e)||e==="number"||e==="time"))return e;if(xu(t)&&n!=="time"&&n!=="utc")return W(t)&&((i=mt(t==null?void 0:t.timeUnit))!=null&&i.utc)?"utc":"time"}function $y({type:e,specifiedFormat:t,config:n,normalizeStack:i}){if(K(t))return t;if(e===Gs)return i?n.normalizedNumberFormat:n.numberFormat}function Wie({specifiedFormat:e,timeUnit:t,config:n,omitTimeFormatConfig:i}){return e||(t?{signal:fN(t)}:i?void 0:n.timeFormat)}function RN(e,t){return`format(${e}, "${t||""}")`}function aA(e,t,n,i){return Xs(n)?TN(n,e,t):RN(e,(K(t)?t:void 0)??i.numberFormat)}function gf(e,t,n,i,r){if(n===void 0&&i===void 0&&r.customFormatTypes&&r.numberFormatType)return gf(e,t,r.numberFormat,r.numberFormatType,r);const o=aA(e,n,i,r),s=aA(t,n,i,r);return`${Op(e,!1)} ? "null" : ${o} + "${jie}" + ${s}`}function qie({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}')`):Qne(t,e,o)}const Pp="min",Hie={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 uA(e){return J(Hie,e)}function Gie(e){return B(e,"encoding")}function Ir(e){return e&&(e.op==="count"||B(e,"field"))}function NN(e){return e&&L(e)}function pf(e){return B(e,"row")||B(e,"column")}function Ew(e){return B(e,"header")}function zp(e){return B(e,"facet")}function Vie(e){return B(e,"param")}function Xie(e){return!K(e)&&B(e,"repeat")}function lA(e){const{field:t,timeUnit:n,bin:i,aggregate:r}=e;return{...n?{timeUnit:n}:{},...i?{bin:i}:{},...r?{aggregate:r}:{},field:t}}function Sw(e){return B(e,"sort")}function Io({fieldDef:e,fieldDef2:t,markDef:n,config:i}){if(le(e)&&e.bandPosition!==void 0)return e.bandPosition;if(W(e)){const{timeUnit:r,bin:o}=e;if(r&&!t)return or("timeUnitBandPosition",n,i);if(Ie(o))return .5}}function LN({channel:e,fieldDef:t,fieldDef2:n,markDef:i,config:r,scaleType:o,useVlSizeChannel:s}){var l,c,f;const a=Sn(e),u=De(s?"size":a,i,r,{vgChannel:a});if(u!==void 0)return u;if(W(t)){const{timeUnit:d,bin:h}=t;if(d&&!n)return{band:or("timeUnitBandSize",i,r)};if(Ie(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 PN(e,t,n,i){return Ie(e.bin)||e.timeUnit&&ln(e)&&e.type==="temporal"?Io({fieldDef:e,fieldDef2:t,markDef:n,config:i})!==void 0:!1}function zN(e){return B(e,"sort")&&!B(e,"field")}function mf(e){return B(e,"condition")}function Ip(e){const t=e==null?void 0:e.condition;return!!t&&!L(t)&&W(t)}function yf(e){const t=e==null?void 0:e.condition;return!!t&&!L(t)&&le(t)}function Yie(e){const t=e==null?void 0:e.condition;return!!t&&(L(t)||Si(t))}function W(e){return B(e,"field")||(e==null?void 0:e.aggregate)==="count"}function bu(e){return e==null?void 0:e.type}function vr(e){return B(e,"datum")}function So(e){return ln(e)&&!Kh(e)||Yh(e)}function cA(e){return ln(e)&&e.type==="quantitative"&&!e.bin||Yh(e)}function Yh(e){return vr(e)&&$e(e.datum)}function le(e){return W(e)||vr(e)}function ln(e){return e&&(B(e,"field")||e.aggregate==="count")&&B(e,"type")}function Si(e){return B(e,"value")}function da(e){return B(e,"scale")||B(e,"sort")}function vu(e){return B(e,"axis")||B(e,"stack")||B(e,"impute")}function IN(e){return B(e,"legend")}function BN(e){return B(e,"format")||B(e,"formatType")}function Kie(e){return mn(e,["legend","axis","header","scale"])}function Jie(e){return B(e,"op")}function V(e,t={}){let n=e.field;const i=t.prefix;let r=t.suffix,o="";if(Zie(e))n=F3("count");else{let s;if(!t.nofn)if(Jie(e))s=e.op;else{const{bin:a,aggregate:u,timeUnit:l}=e;Ie(a)?(s=W3(a),r=(t.binSuffix??"")+(t.suffix??"")):u?es(u)?(o=`["${n}"]`,n=`argmax_${u.argmax}`):Hr(u)?(o=`["${n}"]`,n=`argmin_${u.argmin}`):s=String(u):l&&!fa(l)&&(s=Zne(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?Wu(n):t.expr?A3(n,t.expr)+o:ti(n)+o}function Kh(e){switch(e.type){case"nominal":case"ordinal":case"geojson":return!0;case"quantitative":return W(e)&&!!e.bin;case"temporal":return!1}throw new Error(Z3(e.type))}function Qie(e){var t;return da(e)&&yu((t=e.scale)==null?void 0:t.type)}function Zie(e){return e.aggregate==="count"}function ere(e,t){var s;const{field:n,bin:i,timeUnit:r,aggregate:o}=e;if(o==="count")return t.countTitle;if(Ie(i))return`${n} (binned)`;if(r&&!fa(r)){const a=(s=mt(r))==null?void 0:s.unit;if(a)return`${n} (${Mp(a).join("-")})`}else if(o)return es(o)?`${n} for max ${o.argmax}`:Hr(o)?`${n} for min ${o.argmin}`:`${uf(o)} of ${n}`;return n}function tre(e){const{aggregate:t,bin:n,timeUnit:i,field:r}=e;if(es(t))return`${r} for argmax(${t.argmax})`;if(Hr(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"||Ie(n)&&"bin";return s?`${s.toUpperCase()}(${r})`:r}const UN=(e,t)=>{switch(t.fieldTitle){case"plain":return e.field;case"functional":return tre(e);default:return ere(e,t)}};let jN=UN;function WN(e){jN=e}function nre(){WN(UN)}function qa(e,t,{allowDisabling:n,includeDefault:i=!0}){var a;const r=(a=_w(e))==null?void 0:a.title;if(!W(e))return r??e.title;const o=e,s=i?$w(o,t):void 0;return n?et(r,o.title,s):r??o.title??s}function _w(e){if(vu(e)&&e.axis)return e.axis;if(IN(e)&&e.legend)return e.legend;if(Ew(e)&&e.header)return e.header}function $w(e,t){return jN(e,t)}function Jh(e){if(BN(e)){const{format:t,formatType:n}=e;return{format:t,formatType:n}}else{const t=_w(e)??{},{format:n,formatType:i}=t;return{format:n,formatType:i}}}function ire(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(Sw(e)&&L(e.sort))return"ordinal";const{aggregate:n,bin:i,timeUnit:r}=e;if(r)return"temporal";if(i||n&&!es(n)&&!Hr(n))return"quantitative";if(da(e)&&((o=e.scale)!=null&&o.type))switch(Sy[e.scale.type]){case"numeric":case"discretizing":return"quantitative";case"time":return"temporal"}return"nominal"}function _i(e){if(W(e))return e;if(Ip(e))return e.condition}function at(e){if(le(e))return e;if(yf(e))return e.condition}function qN(e,t,n,i={}){if(K(e)||$e(e)||Ho(e)){const r=K(e)?"string":$e(e)?"number":"boolean";return j(nne(t,r,e)),{value:e}}return le(e)?Qh(e,t,n,i):yf(e)?{...e,condition:Qh(e.condition,t,n,i)}:e}function Qh(e,t,n,i){if(BN(e)){const{format:r,formatType:o,...s}=e;if(Xs(o)&&!n.customFormatTypes)return j(nA(t)),Qh(s,t,n,i)}else{const r=vu(e)?"axis":IN(e)?"legend":Ew(e)?"header":null;if(r&&e[r]){const{format:o,formatType:s,...a}=e[r];if(Xs(s)&&!n.customFormatTypes)return j(nA(t)),Qh({...e,[r]:a},t,n,i)}}return W(e)?Aw(e,t,i):rre(e)}function rre(e){let t=e.type;if(t)return e;const{datum:n}=e;return t=$e(n)?"quantitative":K(n)?"nominal":ca(n)?"temporal":void 0,{...e,type:t}}function Aw(e,t,{compositeMark:n=!1}={}){const{aggregate:i,timeUnit:r,bin:o,field:s}=e,a={...e};if(!n&&i&&!Z2(i)&&!es(i)&&!Hr(i)&&(j(rne(i)),delete a.aggregate),r&&(a.timeUnit=mt(r)),s&&(a.field=`${s}`),Ie(o)&&(a.bin=Bp(o,t)),Et(o)&&!tt(t)&&j(Lne(t)),ln(a)){const{type:u}=a,l=aie(u);u!==l&&(a.type=l),u!=="quantitative"&&Cp(i)&&(j(ine(u,i)),a.type="quantitative")}else if(!P3(t)){const u=ire(a,t);a.type=u}if(ln(a)){const{compatible:u,warning:l}=ore(a,t)||{};u===!1&&j(l)}if(Sw(a)&&K(a.sort)){const{sort:u}=a;if(uA(u))return{...a,sort:{encoding:u}};const l=u.substring(1);if(u.charAt(0)==="-"&&uA(l))return{...a,sort:{encoding:l,order:"descending"}}}if(Ew(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 Bp(e,t){return Ho(e)?{maxbins:V$(t)}:e==="binned"?{binned:!0}:!e.maxbins&&!e.step?{...e,maxbins:V$(t)}:e}const $a={compatible:!0};function ore(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 Pr:case zr:case Ep:return Kh(e)?$a:{compatible:!1,warning:une(t)};case qe:case vt:case Yo:case qu:case wn:case pr:case mr:case lf:case cf:case Sp:case qs:case _p:case $p:case sa:case ri:case Ti:case Ap:return $a;case Oi:case ni:case Mi:case Di:return n!==Gs?{compatible:!1,warning:`Channel ${t} should be used with a quantitative field only, not ${e.type} field.`}:$a;case Qr:case Ko:case Jo:case Qo:case Jr:case Kr:case Yr:case Fi:case gr:return n==="nominal"&&!e.sort?{compatible:!1,warning:`Channel ${t} should not be used with an unsorted discrete field.`}:$a;case En:case Zo:return!Kh(e)&&!Qie(e)?{compatible:!1,warning:lne(t)}:$a;case gu:return e.type==="nominal"&&!("sort"in e)?{compatible:!1,warning:"Channel order is inappropriate for nominal field, which has no inherent order."}:$a}}function xu(e){const{formatType:t}=Jh(e);return t==="time"||!t&&sre(e)}function sre(e){return e&&(e.type==="temporal"||W(e)&&!!e.timeUnit)}function Up(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 df(e)?a=e.expr:ee(e)?a=e.signal:ca(e)?(s=!0,a=Hs(e)):(K(e)||$e(e))&&s&&(a=`datetime(${Ne(e)})`,Xne(o)&&($e(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 HN(e,t){const{type:n}=e;return t.map(i=>{const r=W(e)&&!fa(e.timeUnit)?e.timeUnit:void 0,o=Up(i,{timeUnit:r,type:n,undefinedIfExprNotRequired:!0});return o!==void 0?{signal:o}:i})}function bf(e,t){return Ie(e.bin)?br(t)&&["ordinal","nominal"].includes(e.type):(console.warn("Only call this method for binned field defs."),!1)}const fA={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 vf(e){return e==null?void 0:e.condition}const GN=["domain","grid","labels","ticks","title"],are={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"},VN={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},ure={...VN,style:1,labelExpr:1,encoding:1};function dA(e){return J(ure,e)}const lre={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},XN=I(lre);function eo(e){return B(e,"mark")}class jp{constructor(t,n){this.name=t,this.run=n}hasMatchingType(t){return eo(t)?Pie(t.mark)===this.name:!1}}function Ts(e,t){const n=e&&e[t];return n?L(n)?du(n,i=>!!i.field):W(n)||Ip(n):!1}function YN(e,t){const n=e&&e[t];return n?L(n)?du(n,i=>!!i.field):W(n)||vr(n)||yf(n):!1}function KN(e,t){if(tt(t)){const n=e[t];if((W(n)||vr(n))&&(mN(n.type)||W(n)&&n.timeUnit)){const i=X2(t);return YN(e,i)}}return!1}function JN(e){return du(ute,t=>{if(Ts(e,t)){const n=e[t];if(L(n))return du(n,i=>!!i.aggregate);{const i=_i(n);return i&&!!i.aggregate}}return!1})}function QN(e,t){const n=[],i=[],r=[],o=[],s={};return kw(e,(a,u)=>{if(W(a)){const{field:l,aggregate:c,bin:f,timeUnit:d,...h}=a;if(c||d||f){const g=_w(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(es(c)?(b="argmax",m=V({op:"argmax",field:c.argmax},{forAs:!0}),y.field=`${m}.${l}`):Hr(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),ln(a)&&Ie(f)){if(i.push({bin:f,field:l,as:m}),n.push(V(a,{binSuffix:"end"})),bf(a,u)&&n.push(V(a,{binSuffix:"range"})),tt(u)){const b={field:`${m}_end`};s[`${u}2`]=b}y.bin="binned",P3(u)||(y.type=Gs)}else if(d&&!fa(d)){r.push({timeUnit:d,field:l,as:m});const b=ln(a)&&a.type!==mu&&"time";b&&(u===lf||u===qs?y.formatType=b:bte(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 cre(e,t,n){const i=xte(t,n);if(i){if(i==="binned"){const r=e[t===Fi?qe:vt];return!!(W(r)&&W(e[t])&&Et(r.bin))}}else return!1;return!0}function fre(e,t,n,i){const r={};for(const o of I(e))L3(o)||j(ane(o));for(let o of gte){if(!e[o])continue;const s=e[o];if(ff(o)){const a=hte(o),u=r[a];if(W(u)&&sie(u.type)&&W(s)&&!u.timeUnit){j(tne(a));continue}}if(o==="angle"&&t==="arc"&&!e.theta&&(j(ene),o=ri),!cre(e,o,t)){j(Tp(o,t));continue}if(o===Jr&&t==="line"){const a=_i(e[o]);if(a!=null&&a.aggregate){j(sne);continue}}if(o===wn&&(n?"fill"in e:"stroke"in e)){j(eN("encoding",{fill:"fill"in e,stroke:"stroke"in e}));continue}if(o===cf||o===gu&&!L(s)&&!Si(s)||o===qs&&L(s)){if(s){if(o===gu){const a=e[o];if(zN(a)){r[o]=a;continue}}r[o]=Y(s).reduce((a,u)=>(W(u)?a.push(Aw(u,o)):j(Ey(u,o)),a),[])}}else{if(o===qs&&s===null)r[o]=null;else if(!W(s)&&!vr(s)&&!Si(s)&&!mf(s)&&!ee(s)){j(Ey(s,o));continue}r[o]=qN(s,o,i)}}return r}function Wp(e,t){const n={};for(const i of I(e)){const r=qN(e[i],i,t,{compositeMark:!0});n[i]=r}return n}function dre(e){const t=[];for(const n of I(e))if(Ts(e,n)){const i=e[n],r=Y(i);for(const o of r)W(o)?t.push(o):Ip(o)&&t.push(o.condition)}return t}function kw(e,t,n){if(e)for(const i of I(e)){const r=e[i];if(L(r))for(const o of r)t.call(n,o,i);else t.call(n,r,i)}}function hre(e,t,n,i){return e?I(e).reduce((r,o)=>{const s=e[o];return L(s)?s.reduce((a,u)=>t.call(i,a,u,o),r):t.call(i,r,s,o)},n):n}function ZN(e,t){return I(t).reduce((n,i)=>{switch(i){case qe:case vt:case _p:case Ap:case $p:case Fi:case gr:case Yo:case qu:case ri:case Kr:case Ti:case Yr:case Mi:case Oi:case Di:case ni:case lf:case En:case sa:case qs:return n;case gu:if(e==="line"||e==="trail")return n;case cf:case Sp:{const r=t[i];if(L(r)||W(r))for(const o of Y(r))o.aggregate||n.push(V(o,{}));return n}case Jr:if(e==="trail")return n;case wn:case pr:case mr:case Qr:case Ko:case Jo:case Zo:case Qo:{const r=_i(t[i]);return r&&!r.aggregate&&n.push(V(r,{})),n}}},[])}function gre(e){const{tooltip:t,...n}=e;if(!t)return{filteredEncoding:n};let i,r;if(L(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 L(r)&&r.length===1&&(r=r[0]),{customTooltipWithoutAggregatedField:r,filteredEncoding:n}}function Ay(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 ${Cw(t)}`:"";return{field:s+t.field,type:t.type,title:ee(a)?{signal:`${a}"${escape(u)}"`}:a+u}}),o=dre(n).map(Kie);return{tooltip:[...r,...Vi(o,be)]}}function Cw(e){const{title:t,field:n}=e;return et(t,n)}function Fw(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=Cw(n);return e5(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 e5(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}:{},...sr(i.mark)?i.mark:{type:i.mark},style:`${a}-${String(t)}`,...Ho(e[t])?{}:e[t]}}]:[]}function t5(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:Kf(o,n),continuousAxisChannelDef2:Kf(s,n),continuousAxisChannelDefError:Kf(a,n),continuousAxisChannelDefError2:Kf(u,n),continuousAxis:r}}function Kf(e,t){if(e!=null&&e.aggregate){const{aggregate:n,...i}=e;return n!==t&&j(Nne(n,t)),i}else return e}function n5(e,t){const{mark:n,encoding:i}=e,{x:r,y:o}=i;if(sr(n)&&n.orient)return n.orient;if(So(r)){if(So(o)){const s=W(r)&&r.aggregate,a=W(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 xu(o)&&!xu(r)?"horizontal":"vertical"}return"horizontal"}else{if(So(o))return"vertical";throw new Error(`Need a valid continuous axis for ${t}s`)}}const Zh="boxplot",pre=["box","median","outliers","rule","ticks"],mre=new jp(Zh,r5);function i5(e){return $e(e)?"tukey":e}function r5(e,{config:t}){e={...e,encoding:Wp(e.encoding,t)};const{mark:n,encoding:i,params:r,projection:o,...s}=e,a=sr(n)?n:{type:n};r&&j(Q3("boxplot"));const u=a.extent??t.boxplot.extent,l=De("size",a,t),c=a.invalid,f=i5(u),{bins:d,timeUnits:h,transform:g,continuousAxisChannelDef:p,continuousAxis:m,groupby:y,aggregate:b,encodingWithoutContinuousAxis:v,ticksOrient:x,boxOrient:E,customTooltipWithoutAggregatedField:S}=yre(e,u,t),w=Wu(p.field),{color:_,size:$,...C}=v,T=Sf=>Fw(a,m,p,Sf,t.boxplot),D=T(C),k=T(v),F=(X(t.boxplot.box)?t.boxplot.box.color:t.mark.color)||"#4c78a8",A=T({...C,...$?{size:$}:{},color:{condition:{test:`datum['lower_box_${p.field}'] >= datum['upper_box_${p.field}']`,..._||{value:F}}}}),M=Ay([{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),P={type:"tick",color:"black",opacity:1,orient:x,invalid:c,aria:!1},z=f==="min-max"?M:Ay([{fieldPrefix:"upper_whisker_",titlePrefix:"Upper Whisker"},{fieldPrefix:"lower_whisker_",titlePrefix:"Lower Whisker"}],p,v),U=[...D({partName:"rule",mark:{type:"rule",invalid:c,aria:!1},positionPrefix:"lower_whisker",endPositionPrefix:"lower_box",extraEncoding:z}),...D({partName:"rule",mark:{type:"rule",invalid:c,aria:!1},positionPrefix:"upper_box",endPositionPrefix:"upper_whisker",extraEncoding:z}),...D({partName:"ticks",mark:P,positionPrefix:"lower_whisker",extraEncoding:z}),...D({partName:"ticks",mark:P,positionPrefix:"upper_whisker",extraEncoding:z})],te=[...f!=="tukey"?U:[],...k({partName:"box",mark:{type:"bar",...l?{size:l}:{},orient:E,invalid:c,ariaRoleDescription:"box"},positionPrefix:"lower_box",endPositionPrefix:"upper_box",extraEncoding:M}),...A({partName:"median",mark:{type:"tick",invalid:c,...X(t.boxplot.median)&&t.boxplot.median.color?{color:t.boxplot.median.color}:{},...l?{size:l}:{},orient:x,aria:!1},positionPrefix:"mid_box",extraEncoding:M})];if(f==="min-max")return{...s,transform:(s.transform??[]).concat(g),layer:te};const ne=`datum["lower_box_${p.field}"]`,de=`datum["upper_box_${p.field}"]`,Se=`(${de} - ${ne})`,we=`${ne} - ${u} * ${Se}`,Pe=`${de} + ${u} * ${Se}`,Ri=`datum["${p.field}"]`,ns={joinaggregate:o5(p.field),groupby:y},no={transform:[{filter:`(${we} <= ${Ri}) && (${Ri} <= ${Pe})`},{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:U},{tooltip:Q,...he}=C,{scale:pe,axis:q}=p,xt=Cw(p),Te=mn(q,["title"]),Ot=e5(a,"outliers",t.boxplot,{transform:[{filter:`(${Ri} < ${we}) || (${Ri} > ${Pe})`}],mark:"point",encoding:{[m]:{field:p.field,type:p.type,...xt!==void 0?{title:xt}:{},...pe!==void 0?{scale:pe}:{},...Re(Te)?{}:{axis:Te}},...he,..._?{color:_}:{},...S?{tooltip:S}:{}}})[0];let ft;const Ni=[...d,...h,ns];return Ot?ft={transform:Ni,layer:[Ot,no]}:(ft=no,ft.transform.unshift(...Ni)),{...s,layer:[ft,{transform:g,layer:te}]}}function o5(e){const t=Wu(e);return[{op:"q1",field:e,as:`lower_box_${t}`},{op:"q3",field:e,as:`upper_box_${t}`}]}function yre(e,t,n){const i=n5(e,Zh),{continuousAxisChannelDef:r,continuousAxis:o}=t5(e,i,Zh),s=r.field,a=Wu(s),u=i5(t),l=[...o5(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}=gre(d),{bins:p,timeUnits:m,aggregate:y,groupby:b,encoding:v}=QN(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 Tw="errorbar",bre=["ticks","rule"],vre=new jp(Tw,s5);function s5(e,{config:t}){e={...e,encoding:Wp(e.encoding,t)};const{transform:n,continuousAxisChannelDef:i,continuousAxis:r,encodingWithoutContinuousAxis:o,ticksOrient:s,markDef:a,outerSpec:u,tooltipEncoding:l}=a5(e,Tw,t);delete o.size;const c=Fw(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 xre(e,t){const{encoding:n}=e;if(wre(n))return{orient:n5(e,t),inputType:"raw"};const i=Ere(n),r=Sre(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(le(a)&&le(u))throw new Error(`${t} cannot have both x2 and y2`);if(le(a)){if(So(o))return{orient:"horizontal",inputType:"aggregated-upper-lower"};throw new Error(`Both x and x2 have to be quantitative in ${t}`)}else if(le(u)){if(So(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(le(u)&&!le(a))throw new Error(`${t} cannot have xError2 without xError`);if(le(c)&&!le(l))throw new Error(`${t} cannot have yError2 without yError`);if(le(a)&&le(l))throw new Error(`${t} cannot have both xError and yError with both are quantiative`);if(le(a)){if(So(o))return{orient:"horizontal",inputType:"aggregated-error"};throw new Error("All x, xError, and xError2 (if exist) have to be quantitative")}else if(le(l)){if(So(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 wre(e){return(le(e.x)||le(e.y))&&!le(e.x2)&&!le(e.y2)&&!le(e.xError)&&!le(e.xError2)&&!le(e.yError)&&!le(e.yError2)}function Ere(e){return le(e.x2)||le(e.y2)}function Sre(e){return le(e.xError)||le(e.xError2)||le(e.yError)||le(e.yError2)}function a5(e,t,n){const{mark:i,encoding:r,params:o,projection:s,...a}=e,u=sr(i)?i:{type:i};o&&j(Q3(t));const{orient:l,inputType:c}=xre(e,t),{continuousAxisChannelDef:f,continuousAxisChannelDef2:d,continuousAxisChannelDefError:h,continuousAxisChannelDefError2:g,continuousAxis:p}=t5(e,l,t),{errorBarSpecificAggregate:m,postAggregateCalculates:y,tooltipSummary:b,tooltipTitleWithFieldName:v}=_re(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:$,timeUnits:C,aggregate:T,groupby:D,encoding:k}=QN(_,n),F=[...T,...m],A=c!=="raw"?[]:D,M=Ay(b,f,k,v);return{transform:[...a.transform??[],...$,...C,...F.length===0?[]:[{aggregate:F,groupby:A}],...y],groupby:A,continuousAxisChannelDef:f,continuousAxis:p,encodingWithoutContinuousAxis:k,ticksOrient:l==="vertical"?"horizontal":"vertical",markDef:u,outerSpec:a,tooltipEncoding:M}}function _re(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(Rne(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:uf(h)},{fieldPrefix:"upper_",titlePrefix:hA(h,g,"+")},{fieldPrefix:"lower_",titlePrefix:hA(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(Dne(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:Ws(Ws(h.calculate,'datum["',""),'"]',"")})}return{postAggregateCalculates:l,errorBarSpecificAggregate:u,tooltipSummary:f,tooltipTitleWithFieldName:d}}function hA(e,t,n){return`${uf(e)} ${n} ${t}`}const Mw="errorband",$re=["band","borders"],Are=new jp(Mw,u5);function u5(e,{config:t}){e={...e,encoding:Wp(e.encoding,t)};const{transform:n,continuousAxisChannelDef:i,continuousAxis:r,encodingWithoutContinuousAxis:o,markDef:s,outerSpec:a,tooltipEncoding:u}=a5(e,Mw,t),l=s,c=Fw(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(rA("interpolate")):l.tension&&j(rA("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 l5={};function Ow(e,t,n){const i=new jp(e,t);l5[e]={normalizer:i,parts:n}}function kre(){return I(l5)}Ow(Zh,r5,pre);Ow(Tw,s5,bre);Ow(Mw,u5,$re);const Cre=["gradientHorizontalMaxLength","gradientHorizontalMinLength","gradientVerticalMaxLength","gradientVerticalMinLength","unselectedOpacity"],c5={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"},f5={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"},Fre=I(c5),Tre=I(f5),Mre={header:1,headerRow:1,headerColumn:1,headerFacet:1},d5=I(Mre),h5=["size","shape","fill","stroke","strokeDash","strokeWidth","opacity"],Ore={gradientHorizontalMaxLength:200,gradientHorizontalMinLength:100,gradientVerticalMaxLength:200,gradientVerticalMinLength:64,unselectedOpacity:.35},Dre={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_",Rre={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 Dw(e){return e==="legend"||!!(e!=null&&e.legend)}function w0(e){return Dw(e)&&X(e)}function Rw(e){return!!(e!=null&&e.select)}function g5(e){const t=[];for(const n of e||[]){if(Rw(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 Nre(e){return qp(e)||Lw(e)||Nw(e)}function Nw(e){return B(e,"concat")}function qp(e){return B(e,"vconcat")}function Lw(e){return B(e,"hconcat")}function p5({step:e,offsetIsDiscrete:t}){return t?e.for??"offset":"position"}function ar(e){return B(e,"step")}function gA(e){return B(e,"view")||B(e,"width")||B(e,"height")}const pA=20,Lre={align:1,bounds:1,center:1,columns:1,spacing:1},Pre=I(Lre);function zre(e,t,n){const i=n[t],r={},{spacing:o,columns:s}=i;o!==void 0&&(r.spacing=o),s!==void 0&&(zp(e)&&!pf(e.facet)||Nw(e))&&(r.columns=s),qp(e)&&(r.columns=1);for(const a of Pre)if(e[a]!==void 0)if(a==="spacing"){const u=e[a];r[a]=$e(u)?u:{row:u.row??o,column:u.column??o}}else r[a]=e[a];return r}function ky(e,t){return e[t]??e[t==="width"?"continuousWidth":"continuousHeight"]}function Cy(e,t){const n=eg(e,t);return ar(n)?n.step:m5}function eg(e,t){const n=e[t]??e[t==="width"?"discreteWidth":"discreteHeight"];return et(n,{step:e.step})}const m5=20,Ire={continuousWidth:200,continuousHeight:200,step:m5},Bre={background:"white",padding:5,timeFormat:"%b %d, %Y",countTitle:"Count of Records",view:Ire,mark:Mie,arc:{},area:{},bar:Nie,circle:{},geoshape:{},image:{},line:{},point:{},rect:yw,rule:{color:"black"},square:{},text:{color:"black"},tick:Lie,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:die,projection:{},legend:Ore,header:{titlePadding:10,labelPadding:10},headerColumn:{},headerRow:{},headerFacet:{},selection:Rre,style:{},title:{},facet:{spacing:pA},concat:{spacing:pA},normalizedNumberFormat:".0%"},Sr=["#4c78a8","#f58518","#e45756","#72b7b2","#54a24b","#eeca3b","#b279a2","#ff9da6","#9d755d","#bab0ac"],mA={text:11,guideLabel:10,guideTitle:11,groupTitle:13,groupSubtitle:12},yA={blue:Sr[0],orange:Sr[1],red:Sr[2],teal:Sr[3],green:Sr[4],yellow:Sr[5],purple:Sr[6],pink:Sr[7],brown:Sr[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 Ure(e={}){return{signals:[{name:"color",value:X(e)?{...yA,...e}:yA}],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 jre(e){return{signals:[{name:"fontSize",value:X(e)?{...mA,...e}:mA}],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 Wre(e){return{text:{font:e},style:{"guide-label":{font:e},"guide-title":{font:e},"group-title":{font:e},"group-subtitle":{font:e}}}}function y5(e){const t=I(e||{}),n={};for(const i of t){const r=e[i];n[i]=vf(r)?H3(r):Fn(r)}return n}function qre(e){const t=I(e),n={};for(const i of t)n[i]=y5(e[i]);return n}const Hre=[...AN,...XN,...d5,"background","padding","legend","lineBreak","scale","style","title","view"];function b5(e={}){const{color:t,font:n,fontSize:i,selection:r,...o}=e,s=Fu({},ue(Bre),n?Wre(n):{},t?Ure(t):{},i?jre(i):{},o||{});r&&Tu(s,"selection",r,!0);const a=mn(s,Hre);for(const u of["background","lineBreak","padding"])s[u]&&(a[u]=Fn(s[u]));for(const u of AN)s[u]&&(a[u]=St(s[u]));for(const u of XN)s[u]&&(a[u]=y5(s[u]));for(const u of d5)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),...I(c).length>0?{invalid:c}:{}}}return s.style&&(a.style=qre(s.style)),s.title&&(a.title=St(s.title)),s.view&&(a.view=St(s.view)),a}const Gre=new Set(["view",...$ie]),Vre=["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"],Xre={view:["continuousWidth","continuousHeight","discreteWidth","discreteHeight","step"],...Tie};function Yre(e){e=ue(e);for(const t of Vre)delete e[t];if(e.axis)for(const t in e.axis)vf(e.axis[t])&&delete e.axis[t];if(e.legend)for(const t of Cre)delete e.legend[t];if(e.mark){for(const t of sA)delete e.mark[t];e.mark.tooltip&&X(e.mark.tooltip)&&delete e.mark.tooltip}e.params&&(e.signals=(e.signals||[]).concat(g5(e.params)),delete e.params);for(const t of Gre){for(const i of sA)delete e[t][i];const n=Xre[t];if(n)for(const i of n)delete e[t][i];Jre(e,t)}for(const t of kre())delete e[t];Kre(e);for(const t in e)X(e[t])&&Re(e[t])&&delete e[t];return Re(e)?void 0:e}function Kre(e){const{titleMarkConfig:t,subtitleMarkConfig:n,subtitle:i}=q3(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 Jre(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 Hp(e){return B(e,"layer")}function Qre(e){return B(e,"repeat")}function Zre(e){return!L(e.repeat)&&B(e.repeat,"layer")}class Pw{map(t,n){return zp(t)?this.mapFacet(t,n):Qre(t)?this.mapRepeat(t,n):Lw(t)?this.mapHConcat(t,n):qp(t)?this.mapVConcat(t,n):Nw(t)?this.mapConcat(t,n):this.mapLayerOrUnit(t,n)}mapLayerOrUnit(t,n){if(Hp(t))return this.mapLayer(t,n);if(eo(t))return this.mapUnit(t,n);throw new Error(ew(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 eoe={zero:1,center:1,normalize:1};function toe(e){return J(eoe,e)}const noe=new Set([SN,Rp,Dp,Vh,Lp,pw,mw,Np,_N,gw]),ioe=new Set([Rp,Dp,SN]);function Aa(e){return W(e)&&bu(e)==="quantitative"&&!e.bin}function bA(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(W(s)&&W(a))if(Aa(s)&&Aa(a)){if(s.stack)return t;if(a.stack)return r;const u=W(s)&&!!s.aggregate,l=W(a)&&!!a.aggregate;if(u!==l)return u?t:r;if(o){if(n==="vertical")return r;if(n==="horizontal")return t}}else{if(Aa(s))return t;if(Aa(a))return r}else{if(Aa(s))return o&&n==="vertical"?void 0:t;if(Aa(a))return o&&n==="horizontal"?void 0:r}}function roe(e){switch(e){case"x":return"y";case"y":return"x";case"theta":return"radius";case"radius":return"theta"}}function v5(e,t){var p,m;const n=sr(e)?e:{type:e},i=n.type;if(!noe.has(i))return null;const r=bA(t,"x",n)||bA(t,"theta",n);if(!r)return null;const o=t[r],s=W(o)?V(o,{}):void 0,a=roe(r),u=[],l=new Set;if(t[a]){const y=t[a],b=W(y)?V(y,{}):void 0;b&&b!==s&&(u.push(a),l.add(b))}const c=a==="x"?"xOffset":"yOffset",f=t[c],d=W(f)?V(f,{}):void 0;d&&d!==s&&(u.push(c),l.add(d));const h=pte.reduce((y,b)=>{if(b!=="tooltip"&&Ts(t,b)){const v=t[b];for(const x of Y(v)){const E=_i(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?Ho(o.stack)?g=o.stack?"zero":null:g=o.stack:ioe.has(i)&&(g="zero"),!g||!toe(g)||JN(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(Tne(o.scale.type)),le(t[yr(r)])?(o.stack!==void 0&&j(Fne(r)),null):(W(o)&&o.aggregate&&!kte.has(o.aggregate)&&j(Mne(o.aggregate)),{groupbyChannels:u,groupbyFields:l,fieldChannel:r,impute:o.impute===null?!1:ts(i),stackBy:h,offset:g}))}function x5(e,t,n){const i=St(e),r=De("orient",i,n);if(i.orient=uoe(i.type,t,r),r!==void 0&&r!==i.orient&&j(hne(i.orient,r)),i.type==="bar"&&i.orient){const u=De("cornerRadiusEnd",i,n);if(u!==void 0){const l=i.orient==="horizontal"&&t.x2||i.orient==="vertical"&&t.y2?["cornerRadius"]:Die[i.orient];for(const c of l)i[c]=u;i.cornerRadiusEnd!==void 0&&delete i.cornerRadiusEnd}}const o=De("opacity",i,n),s=De("fillOpacity",i,n);return o===void 0&&s===void 0&&(i.opacity=soe(i.type,t)),De("cursor",i,n)===void 0&&(i.cursor=ooe(i,t,n)),i}function ooe(e,t,n){return t.href||e.href||De("href",e,n)?"pointer":e.cursor}function soe(e,t){if(ye([Lp,gw,pw,mw],e)&&!JN(t))return .7}function aoe(e,t,{graticule:n}){if(n)return!1;const i=or("filled",e,t),r=e.type;return et(i,r!==Lp&&r!==Np&&r!==Vh)}function uoe(e,t,n){switch(e){case Lp:case pw:case mw:case _N:case Sie:case Eie:return}const{x:i,y:r,x2:o,y2:s}=t;switch(e){case Rp:if(W(i)&&(Et(i.bin)||W(r)&&r.aggregate&&!i.aggregate))return"vertical";if(W(r)&&(Et(r.bin)||W(i)&&i.aggregate&&!r.aggregate))return"horizontal";if(s||o){if(n)return n;if(!o)return(W(i)&&i.type===Gs&&!Ie(i.bin)||Yh(i))&&W(r)&&Et(r.bin)?"horizontal":"vertical";if(!s)return(W(r)&&r.type===Gs&&!Ie(r.bin)||Yh(r))&&W(i)&&Et(i.bin)?"vertical":"horizontal"}case Vh:if(o&&!(W(i)&&Et(i.bin))&&s&&!(W(r)&&Et(r.bin)))return;case Dp:if(s)return W(r)&&Et(r.bin)?"horizontal":"vertical";if(o)return W(i)&&Et(i.bin)?"vertical":"horizontal";if(e===Vh){if(i&&!r)return"vertical";if(r&&!i)return"horizontal"}case Np:case gw:{const a=cA(i),u=cA(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=ln(i)&&i.type===mu,c=ln(r)&&r.type===mu;if(l&&!c)return"vertical";if(!l&&c)return"horizontal"}return}}return"vertical"}function loe(e){const{point:t,line:n,...i}=e;return I(i).length>1?i:i.type}function coe(e){for(const t of["line","area","rule","trail"])e[t]&&(e={...e,[t]:mn(e[t],["point","line"])});return e}function E0(e,t={},n){return e.point==="transparent"?{opacity:0}:e.point?X(e.point)?e.point:{}:e.point!==void 0?null:t.point||n.shape?X(t.point)?t.point:{}:void 0}function vA(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 foe{constructor(){this.name="path-overlay"}hasMatchingType(t,n){if(eo(t)){const{mark:i,encoding:r}=t,o=sr(i)?i:{type:i};switch(o.type){case"line":case"rule":case"trail":return!!E0(o,n[o.type],r);case"area":return!!E0(o,n[o.type],r)||!!vA(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=Wp(l,r),d=sr(a)?a:{type:a},h=E0(d,r[d.type],f),g=d.type==="area"&&vA(d,r[d.type]),p=[{name:u,...o?{params:o}:{},mark:loe({...d.type==="area"&&d.opacity===void 0&&d.fillOpacity===void 0?{opacity:.7}:{},...d}),encoding:mn(f,["shape"])}],m=v5(x5(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=mn(y,["y2","x2"]),g&&p.push({...s?{projection:s}:{},mark:{type:"line",...fu(d,["clip","interpolate","tension","tooltip"]),...g},encoding:y}),h&&p.push({...s?{projection:s}:{},mark:{type:"point",opacity:1,filled:!0,...fu(d,["clip","tooltip"]),...h},encoding:y}),i({...c,layer:p},{...n,config:coe(r)})}}function doe(e,t){return t?pf(e)?E5(e,t):w5(e,t):e}function S0(e,t){return t?E5(e,t):e}function Fy(e,t,n){const i=t[e];if(Xie(i)){if(i.repeat in n)return{...t,[e]:n[i.repeat]};j(Vte(i.repeat));return}return t}function w5(e,t){if(e=Fy("field",e,t),e!==void 0){if(e===null)return null;if(Sw(e)&&Ir(e.sort)){const n=Fy("field",e.sort,t);e={...e,...n?{sort:n}:{}}}return e}}function xA(e,t){if(W(e))return w5(e,t);{const n=Fy("datum",e,t);return n!==e&&!n.type&&(n.type="nominal"),n}}function wA(e,t){if(le(e)){const n=xA(e,t);if(n)return n;if(mf(e))return{condition:e.condition}}else{if(yf(e)){const n=xA(e.condition,t);if(n)return{...e,condition:n};{const{condition:i,...r}=e;return r}}return e}}function E5(e,t){const n={};for(const i in e)if(B(e,i)){const r=e[i];if(L(r))n[i]=r.map(o=>wA(o,t)).filter(o=>o);else{const o=wA(r,t);o!==void 0&&(n[i]=o)}}return n}class hoe{constructor(){this.name="RuleForRangedLine"}hasMatchingType(t){if(eo(t)){const{encoding:n,mark:i}=t;if(i==="line"||sr(i)&&i.type==="line")for(const r of dte){const o=aa(r),s=n[o];if(n[r]&&(W(s)&&!Et(s.bin)||vr(s)))return!0}}return!1}run(t,n,i){const{encoding:r,mark:o}=t;return j(dne(!!r.x2,!!r.y2)),i({...t,mark:X(o)?{...o,type:"rule"}:"rule"},n)}}class goe extends Pw{constructor(){super(...arguments),this.nonFacetUnitNormalizers=[mre,vre,Are,new foe,new hoe]}map(t,n){if(eo(t)){const i=Ts(t.encoding,Pr),r=Ts(t.encoding,zr),o=Ts(t.encoding,Ep);if(i||r||o)return this.mapFacetedUnit(t,n)}return super.map(t,n)}mapUnit(t,n){const{parentEncoding:i,parentProjection:r}=n,o=S0(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 Zre(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_${We(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;!L(i)&&t.columns&&(t=mn(t,["columns"]),j(eA("repeat")));const a=[],{repeater:u={},repeaterPrefix:l=""}=n,c=!L(i)&&i.row||[u?u.row:null],f=!L(i)&&i.column||[u?u.column:null],d=L(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__"+(L(i)?`${We(g)}`:(i.row?`row_${We(p)}`:"")+(i.column?`column_${We(m)}`:"")),v=this.map(r,{...n,repeater:y,repeaterPrefix:b});v.name=b,a.push(mn(v,["data"]))}const h=L(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 pf(i)&&t.columns&&(t=mn(t,["columns"]),j(eA("facet"))),super.mapFacet(t,n)}mapUnitWithParentEncodingOrProjection(t,n){const{encoding:i,projection:r}=t,{parentEncoding:o,parentProjection:s,config:a}=n,u=SA({parentProjection:s,projection:r}),l=EA({parentEncoding:o,encoding:S0(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=S0(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(cne([...i?[Pr]:[],...r?[zr]:[]]));const s={},a={};for(const u of[Pr,zr]){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:doe(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:EA({parentEncoding:n,encoding:o,layer:!0}),parentProjection:SA({parentProjection:i,projection:s})};return super.mapLayer({...a,...t.name?{name:[u.repeaterPrefix,t.name].filter(l=>l).join("_")}:{}},u)}}function EA({parentEncoding:e,encoding:t={},layer:n}){let i={};if(e){const r=new Set([...I(e),...I(t)]);for(const o of r){const s=t[o],a=e[o];if(le(s)){const u={...a,...s};i[o]=u}else yf(s)?i[o]={...s,condition:{...a,...s.condition}}:s||s===null?i[o]=s:(n||Si(a)||ee(a)||le(a)||L(a))&&(i[o]=a)}}else i=t;return!i||Re(i)?void 0:i}function SA(e){const{parentProjection:t,projection:n}=e;return t&&n&&j(Zte({parentProjection:t,projection:n})),n??t}function zw(e){return B(e,"filter")}function poe(e){return B(e,"stop")}function S5(e){return B(e,"lookup")}function moe(e){return B(e,"data")}function yoe(e){return B(e,"param")}function boe(e){return B(e,"pivot")}function voe(e){return B(e,"density")}function xoe(e){return B(e,"quantile")}function woe(e){return B(e,"regression")}function Eoe(e){return B(e,"loess")}function Soe(e){return B(e,"sample")}function _oe(e){return B(e,"window")}function $oe(e){return B(e,"joinaggregate")}function Aoe(e){return B(e,"flatten")}function koe(e){return B(e,"calculate")}function _5(e){return B(e,"bin")}function Coe(e){return B(e,"impute")}function Foe(e){return B(e,"timeUnit")}function Toe(e){return B(e,"aggregate")}function Moe(e){return B(e,"stack")}function Ooe(e){return B(e,"fold")}function Doe(e){return B(e,"extent")&&!B(e,"density")&&!B(e,"regression")}function Roe(e){return e.map(t=>zw(t)?{filter:ja(t.filter,oie)}:t)}class Noe extends Pw{map(t,n){return n.emptySelections??(n.emptySelections={}),n.selectionPredicates??(n.selectionPredicates={}),t=_A(t,n),super.map(t,n)}mapLayerOrUnit(t,n){if(t=_A(t,n),t.encoding){const i={};for(const[r,o]of Po(t.encoding))i[r]=$5(o,n);t={...t,encoding:i}}return super.mapLayerOrUnit(t,n)}mapUnit(t,n){const{selection:i,...r}=t;return i?{...r,params:Po(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 _A(e,t){const{transform:n,...i}=e;if(n){const r=n.map(o=>{if(zw(o))return{filter:Ty(o,t)};if(_5(o)&&ua(o.bin))return{...o,bin:A5(o.bin)};if(S5(o)){const{selection:s,...a}=o.from;return s?{...o,from:{param:s,...a}}:o}return o});return{...i,transform:r}}return e}function $5(e,t){var i,r;const n=ue(e);if(W(n)&&ua(n.bin)&&(n.bin=A5(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(mf(n))if(L(n.condition))n.condition=n.condition.map(o=>{const{selection:s,param:a,test:u,...l}=o;return a?o:{...l,test:Ty(o,t)}});else{const{selection:o,param:s,test:a,...u}=$5(n.condition,t);n.condition=s?n.condition:{...u,test:Ty(n.condition,t)}}return n}function A5(e){const t=e.extent;if(t!=null&&t.selection){const{selection:n,...i}=t;return{...e,extent:{...i,param:n}}}return e}function Ty(e,t){const n=i=>ja(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):ja(e.test||e.filter,i=>i.selection?n(i.selection):i)}class My extends Pw{map(t,n){const i=n.selections??[];if(t.params&&!eo(t)){const r=[];for(const o of t.params)Rw(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))||L(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=My.prototype[e];My.prototype[e]=function(n,i){return t.call(this,n,Loe(n,i))}}function Loe(e,t){return e.name?{...t,path:(t.path??[]).concat(e.name)}:t}function k5(e,t){t===void 0&&(t=b5(e.config));const n=Boe(e,t),{width:i,height:r}=e,o=Uoe(n,{width:i,height:r,autosize:e.autosize},t);return{...n,...o?{autosize:o}:{}}}const Poe=new goe,zoe=new Noe,Ioe=new My;function Boe(e,t={}){const n={config:t};return Ioe.map(Poe.map(zoe.map(e,n),n),n)}function $A(e){return K(e)?{type:e}:e??{}}function Uoe(e,t,n){let{width:i,height:r}=t;const o=eo(e)||Hp(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(K$("width")),i=void 0),r=="container"&&(j(K$("height")),r=void 0));const a={type:"pad",...s,...n?$A(n.autosize):{},...$A(e.autosize)};if(a.type==="fit"&&!o&&(j(Lte),a.type="pad"),i=="container"&&!(a.type=="fit"||a.type=="fit-x")&&j(J$("width")),r=="container"&&!(a.type=="fit"||a.type=="fit-y")&&j(J$("height")),!On(a,{type:"pad"}))return a}function joe(e){return["fit","fit-x","fit-y"].includes(e)}function Woe(e){return e?`fit-${kp(e)}`:"fit"}const qoe=["background","padding"];function AA(e,t){const n={};for(const i of qoe)e&&e[i]!==void 0&&(n[i]=Fn(e[i]));return t&&(n.params=e.params),n}class to{constructor(t={},n={}){this.explicit=t,this.implicit=n}clone(){return new to(ue(this.explicit),ue(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 I(t.combine())){const i=t.getWithExplicit(n);this.setWithExplicit(n,i)}}}function ji(e){return{explicit:!0,value:e}}function An(e){return{explicit:!1,value:e}}function C5(e){return(t,n,i,r)=>{const o=e(t.value,n.value);return o>0?t:o<0?n:Gp(t,n,i,r)}}function Gp(e,t,n,i){return e.explicit&&t.explicit&&j(Ene(n,i,e.value,t.value)),e}function Bo(e,t,n,i,r=Gp){return e===void 0||e.value===void 0?t:e.explicit&&!t.explicit?e:t.explicit&&!e.explicit?t:On(e.value,t.value)?e:r(e,t,n,i)}class Hoe extends to{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 wu(e){return B(e,"url")}function Cc(e){return B(e,"values")}function F5(e){return B(e,"name")&&!wu(e)&&!Cc(e)&&!Fo(e)}function Fo(e){return e&&(T5(e)||M5(e)||Iw(e))}function T5(e){return B(e,"sequence")}function M5(e){return B(e,"sphere")}function Iw(e){return B(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 O5({invalid:e,isPath:t}){switch(kN(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 Goe(e){const{marks:t,scales:n}=O5(e);return t===n?Ke.Main:n==="include-invalid-values"?Ke.PreFilterInvalid:Ke.PostFilterInvalid}function D5(e){const{signals:t,hasLegend:n,index:i,...r}=e;return r.field=ti(r.field),r}function Ys(e,t=!0,n=Gt){if(L(e)){const i=e.map(r=>Ys(r,t,n));return t?`[${i.join(", ")}]`:i}else if(ca(e))return n(t?Hs(e):Vne(e));return t?n(Ne(e)):e}function Voe(e,t){for(const n of Ft(e.component.selection??{})){const i=n.name;let r=`${i}${Uo}, ${n.resolve==="global"?"true":`{unit: ${Ms(e)}}`}`;for(const o of Kp)o.defined(n)&&(o.signals&&(t=o.signals(e,n,t)),o.modifyExpr&&(r=o.modifyExpr(e,n,r)));t.push({name:i+Sse,on:[{events:{signal:n.name+Uo},update:`modify(${H(n.name+Ks)}, ${r})`}]})}return Bw(t)}function Xoe(e,t){if(e.component.selection&&I(e.component.selection).length){const n=H(e.getName("cell"));t.unshift({name:"facet",value:{},on:[{events:Xo("pointermove","scope"),update:`isTuple(facet) ? facet : group(${n}).datum`}]})}return Bw(t)}function Yoe(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:`${J5}(${o}, ${H(a)}${u}`})}n=!0;for(const a of Kp)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"}]}),Bw(t)}function Koe(e,t){const n=[...t],i=Ms(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(D5);o.values=r.project.hasSelectionId?r.init.map(u=>({unit:i,[$i]:Ys(u,!1)[0]})):r.init.map(u=>({unit:i,fields:a,values:Ys(u,!1)}))}n.filter(a=>a.name===r.name+Ks).length||n.push(o)}return n}function R5(e,t){for(const n of Ft(e.component.selection??{}))for(const i of Kp)i.defined(n)&&i.marks&&(t=i.marks(e,n,t));return t}function Joe(e,t){for(const n of e.children)Ge(n)&&(t=R5(n,t));return t}function Qoe(e,t,n,i){const r=nL(e,t.param,t);return{signal:Ei(n.get("type"))&&L(i)&&i[0]>i[1]?`isValid(${r}) && reverse(${r})`:r}}function Bw(e){return e.map(t=>(t.on&&!t.on.length&&delete t.on,t))}class Oe{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(Kte);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 yn extends Oe{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 ${C3()}`),this._hash}getSource(){return this.refCounts[this._name]++,this._source}isRequired(){return!!this.refCounts[this._name]}setSource(t){this._source=t}}function _0(e){return e.as!==void 0}function kA(e){return`${e}_end`}class Ji extends Oe{clone(){return new Ji(null,ue(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[be(l)]=l)}return r},{});return Re(i)?null:new Ji(t,i)}static makeFromTransform(t,n){const{timeUnit:i,...r}={...n},o=mt(i),s={...r,timeUnit:o};return new Ji(t,{[be(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 Po(this.timeUnits)){const o=_0(r)?r.as:`${r.field}_end`;t.has(o)||(n[i]=r)}this.timeUnits=n}producedFields(){return new Set(Ft(this.timeUnits).map(t=>_0(t)?t.as:kA(t.field)))}dependentFields(){return new Set(Ft(this.timeUnits).map(t=>t.field))}hash(){return`TimeUnit ${be(this.timeUnits)}`}assemble(){const t=[];for(const n of Ft(this.timeUnits)){const{rectBandPosition:i}=n,r=mt(n.timeUnit);if(_0(n)){const{field:o,as:s}=n,{unit:a,utc:u,...l}=r,c=[s,`${s}_end`];t.push({field:ti(o),type:"timeunit",...a?{units:Mp(a)}:{},...u?{timezone:"utc"}:{},...l,as:c}),t.push(...CA(c,i,r))}else if(n){const{field:o}=n,s=o.replaceAll("\\.","."),a=N5({timeUnit:r,field:s}),u=kA(s);t.push({type:"formula",expr:a,as:u}),t.push(...CA([s,u],i,r))}}return t}}const Vp="offsetted_rect_start",Xp="offsetted_rect_end";function N5({timeUnit:e,field:t,reverse:n}){const{unit:i,utc:r}=e,o=lN(i),{part:s,step:a}=hN(o,e.step);return`${r?"utcOffset":"timeOffset"}('${s}', datum['${t}'], ${n?-a:a})`}function CA([e,t],n,i){if(n!==void 0&&n!==.5){const r=`datum['${e}']`,o=`datum['${t}']`;return[{type:"formula",expr:FA([N5({timeUnit:i,field:e,reverse:!0}),r],n+.5),as:`${e}_${Vp}`},{type:"formula",expr:FA([r,o],n+.5),as:`${e}_${Xp}`}]}return[]}function FA([e,t],n){return`${1-n} * ${e} + ${n} * ${t}`}const xf="_tuple_fields";class Zoe{constructor(...t){this.items=t,this.hasChannel={},this.hasField={},this.hasSelectionId=!1}}const ese={defined:()=>!0,parse:(e,t,n)=>{const i=t.name,r=t.project??(t.project=new Zoe),o={},s={},a=new Set,u=(g,p)=>{const m=p==="visual"?g.channel:g.field;let y=We(`${i}_${m}`);for(let b=1;a.has(y);b++)y=We(`${i}_${m}_${b}`);return a.add(y),{[p]:y}},l=t.type,c=e.config.selection[l],f=n.value!==void 0?Y(n.value):null;let{fields:d,encodings:h}=X(n.select)?n.select:{};if(!d&&!h&&f){for(const g of f)if(X(g))for(const p of I(g))fte(p)?(h||(h=[])).push(p):l==="interval"?(j(Gte),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(Pte(g,p.aggregate));continue}else if(!m){j(Z$(g));continue}if(p.timeUnit&&!fa(p.timeUnit)){m=e.vgField(g);const y={timeUnit:p.timeUnit,as:m,field:p.field};s[be(y)]=y}if(!o[m]){const y=l==="interval"&&br(g)&&Ei(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,R3(g)?(b.geoChannel=g,b.channel=D3(g),r.hasChannel[b.channel]=o[m]):r.hasChannel[g]=o[m]}}else j(Z$(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=>X(g)?g[p.geoChannel||p.channel]!==void 0?g[p.geoChannel||p.channel]:g[p.field]:g))),Re(s)||(r.timeUnit=new Ji(null,s))},signals:(e,t,n)=>{const i=t.name+xf;return n.filter(o=>o.name===i).length>0||t.project.hasSelectionId?n:n.concat({name:i,value:t.project.items.map(D5)})}},Br={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(!br(r))continue;const o=e.getScaleComponent(r),s=o?o.get("type"):void 0;if(s=="sequential"&&j(Ute),!o||!Ei(s)){j(Bte);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||TA(e)||i.length===0)return n;const r=n.find(s=>s.name===t.name);let o=r.update;if(o.includes(J5))r.update=`{${i.map(s=>`${H(ti(s.field))}: ${s.signals.data}`).join(", ")}}`;else{for(const s of i){const a=`${H(ti(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&&!TA(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 Oy(e,t){return`domain(${H(e.scaleName(t))})`}function TA(e){return e.parent&&Ku(e.parent)&&!e.parent.parent}const Ha="_brush",L5="_scale_trigger",yl="geo_interval_init_tick",P5="_init",tse="_center",nse={defined:e=>e.type==="interval",parse:(e,t,n)=>{var i;if(e.hasProjection){const r={...X(n.select)?n.select:{}};r.fields=[$i],r.encodings||(r.encodings=n.value?I(n.value):[Oi,Mi]),n.select={type:"interval",...r}}if(t.translate&&!Br.defined(t)){const r=`!event.item || event.item.mark.name !== ${H(t.name+Ha)}`;for(const o of t.events){if(!o.between){j(`${o} is not an ordered event stream for interval selections.`);continue}const s=Y((i=o.between[0]).filter??(i.filter=[]));s.includes(r)||s.push(r)}}},signals:(e,t,n)=>{const i=t.name,r=i+Uo,o=Ft(t.project.hasChannel).filter(a=>a.channel===qe||a.channel===vt),s=t.init?t.init[0]:null;if(n.push(...o.reduce((a,u)=>a.concat(ise(e,t,u,s&&s[u.index])),[])),e.hasProjection){const a=H(e.projectionName()),u=e.projectionName()+tse,{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+P5,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: ${Ms(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(!Br.defined(t)){const l=i+L5,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=Ei(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: ${Ms(e)}, fields: ${i+xf}, values`;return n.concat({name:r,...s?{init:`{${u}: ${Ys(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(Br.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 I(l))l[m]=[{test:`${u}.length && ${u}[0].unit === ${Ms(e)}`,...l[m]},{value:0}];const{fill:c,fillOpacity:f,cursor:d,...h}=t.mark,g=I(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+Ha}_bg`,type:"rect",clip:!0,encode:{enter:{fill:{value:c},fillOpacity:{value:f}},update:l}},...n,{name:i+Ha,type:"rect",clip:!0,encode:{enter:{...p?{cursor:{value:p}}:{},fill:{value:"transparent"}},update:{...l,...g}}}]}};function ise(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===qe?"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=Br.defined(t),g=e.getScaleComponent(o),p=g?g.get("type"):void 0,m=i?{init:Ys(i,!0,u)}:{value:[]};return f.push({events:{signal:t.name+L5},update:Ei(p)?`[${u(`${d}[0]`)}, ${u(`${d}[1]`)}]`:"[0, 0]"}),h?[{name:d,on:[]}]:[{name:s,...m,on:f},{name:d,...i?{init:Ys(i)}:{},on:[{events:{signal:s},update:`${s}[0] === ${s}[1] ? null : invert(${a}, ${s})`}]}]}else{const d=o===qe?0:1,h=t.name+P5,g=i?{init:`[${h}[0][${d}], ${h}[1][${d}]]`}:{value:[]};return[{name:s,...g,on:f}]}}const rse={defined:e=>e.type==="point",signals:(e,t,n)=>{const i=t.name,r=i+xf,o=t.project,s="(item().isVoronoi ? datum.datum : datum)",a=Ft(e.component.selection??{}).reduce((f,d)=>d.type==="interval"?f.concat(d.name+Ha):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: ${Ms(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+Uo,on:c?[{events:c,update:`${u} ? {${l}} : null`,force:!0}]:[]}])}};function Gu({model:e,channelDef:t,vgChannel:n,invalidValueRef:i,mainRefFn:r}){const o=mf(t)&&t.condition;let s=[];o&&(s=Y(o).map(l=>{const c=r(l);if(Vie(l)){const{param:f,empty:d}=l;return{test:tL(e,{param:f,empty:d}),...c}}else return{test:ig(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 Uw(e,t="text"){const n=e.encoding[t];return Gu({model:e,channelDef:n,vgChannel:t,mainRefFn:i=>Yp(i,e.config),invalidValueRef:void 0})}function Yp(e,t,n="datum"){if(e){if(Si(e))return Ue(e.value);if(le(e)){const{format:i,formatType:r}=Jh(e);return ww({fieldOrDatumDef:e,format:i,formatType:r,expr:n,config:t})}}}function z5(e,t={}){const{encoding:n,markDef:i,config:r,stack:o}=e,s=n.tooltip;if(L(s))return{tooltip:MA({tooltip:s},o,r,t)};{const a=t.reactiveGeom?"datum.datum":"datum";return Gu({model:e,channelDef:s,vgChannel:"tooltip",mainRefFn:l=>{const c=Yp(l,r,a);if(c)return c;if(l===null)return;let f=De("tooltip",i,r);if(f===!0&&(f={content:"encoding"}),K(f))return{value:f};if(X(f))return ee(f)?f:f.content==="encoding"?MA(n,o,r,t):{signal:a}},invalidValueRef:void 0})}}function I5(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=ln(c)?c:{...c,type:e[d].type},g=h.title||$w(h,r),p=Y(g).join(", ").replaceAll(/"/g,'\\"');let m;if(tt(f)){const y=f==="x"?"x2":"y2",b=_i(e[y]);if(Et(h.bin)&&b){const v=V(h,{expr:s}),x=V(b,{expr:s}),{format:E,formatType:S}=Jh(h);m=gf(v,x,E,S,r),o.add(y)}}if((tt(f)||f===ri||f===Ti)&&t&&t.fieldChannel===f&&t.offset==="normalize"){const{format:y,formatType:b}=Jh(h);m=ww({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})}kw(e,(c,f)=>{W(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 MA(e,t,n,{reactiveGeom:i}={}){const r=I5(e,t,n,{reactiveGeom:i}),o=Po(r).map(([s,a])=>`"${s}": ${a}`);return o.length>0?{signal:`{${o.join(", ")}}`}:void 0}function ose(e){const{markDef:t,config:n}=e,i=De("aria",t,n);return i===!1?{}:{...i?{aria:i}:{},...sse(e),...ase(e)}}function sse(e){const{mark:t,markDef:n,config:i}=e;if(i.aria===!1)return{};const r=De("ariaRoleDescription",n,i);return r!=null?{ariaRoleDescription:{value:r}}:J(Dte,t)?{}:{ariaRoleDescription:{value:t}}}function ase(e){const{encoding:t,markDef:n,config:i,stack:r}=e,o=t.description;if(o)return Gu({model:e,channelDef:o,vgChannel:"description",mainRefFn:u=>Yp(u,e.config),invalidValueRef:void 0});const s=De("description",n,i);if(s!=null)return{description:Ue(s)};if(i.aria===!1)return{};const a=I5(t,r,i);if(!Re(a))return{description:{signal:Po(a).map(([u,l],c)=>`"${c>0?"; ":""}${u}: " + (${l})`).join(" + ")}}}function $t(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=De(e,i,o,{vgChannel:s,ignoreVgConfig:!mf(l)})),u!==void 0&&(a=Ue(u)));const c={markDef:i,config:o,scaleName:t.scaleName(e),scale:t.getScaleComponent(e)},f=FN({...c,scaleChannel:e,channelDef:l});return Gu({model:t,channelDef:l,vgChannel:s??e,invalidValueRef:f,mainRefFn:h=>xw({...c,channel:e,channelDef:h,stack:null,defaultRef:a})})}function B5(e,t={filled:void 0}){const{markDef:n,encoding:i,config:r}=e,{type:o}=n,s=t.filled??De("filled",n,r),a=ye(["bar","point","circle","square","geoshape"],o)?"transparent":void 0,u=De(s===!0?"color":void 0,n,r,{vgChannel:"fill"})??r.mark[s===!0&&"color"]??a,l=De(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(eN("property",{fill:"fill"in n,stroke:"stroke"in n})),{...f,...$t("color",e,{vgChannel:c,defaultValue:s?u:l}),...$t("fill",e,{defaultValue:i.fill?u:void 0}),...$t("stroke",e,{defaultValue:i.stroke?l:void 0})}}function use(e){const{encoding:t,mark:n}=e,i=t.order;return!ts(n)&&Si(i)?Gu({model:e,channelDef:i,vgChannel:"zindex",mainRefFn:r=>Ue(r.value),invalidValueRef:void 0}):{}}function Eu({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:xw({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 rn(e,t,{defaultPos:n,vgChannel:i}){const{encoding:r,markDef:o,config:s,stack:a}=t,u=r[e],l=r[yr(e)],c=t.scaleName(e),f=t.getScaleComponent(e),{offset:d,offsetType:h}=Eu({channel:e,markDef:o,encoding:r,model:t,bandPosition:.5}),g=jw({model:t,defaultPos:n,channel:e,scaleName:c,scale:f}),p=!u&&tt(e)&&(r.latitude||r.longitude)?{field:t.getName(e)}:lse({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 lse(e){const{channel:t,channelDef:n,scaleName:i,stack:r,offset:o,markDef:s}=e;if(le(n)&&r&&t===r.fieldChannel){if(W(n)){let a=n.bandPosition;if(a===void 0&&s.type==="text"&&(t==="radius"||t==="theta")&&(a=.5),a!==void 0)return Xh({scaleName:i,fieldOrDatumDef:n,startSuffix:"start",bandPosition:a,offset:o})}return Fs(n,i,{suffix:"end"},{offset:o})}return vw(e)}function jw({model:e,defaultPos:t,channel:n,scaleName:i,scale:r}){const{markDef:o,config:s}=e;return()=>{const a=aa(n),u=zo(n),l=De(n,o,s,{vgChannel:u});if(l!==void 0)return tc(n,l);switch(t){case"zeroOrMin":return OA({scaleName:i,scale:r,mode:"zeroOrMin",mainChannel:a,config:s});case"zeroOrMax":return OA({scaleName:i,scale:r,mode:{zeroOrMax:{widthSignal:e.width.signal,heightSignal:e.height.signal}},mainChannel:a,config:s});case"mid":return{...e[Sn(n)],mult:.5}}}}function OA({mainChannel:e,config:t,...n}){const i=CN(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 cse={left:"x",center:"xc",right:"x2"},fse={top:"y",middle:"yc",bottom:"y2"};function U5(e,t,n,i="middle"){if(e==="radius"||e==="theta")return zo(e);const r=e==="x"?"align":"baseline",o=De(r,t,n);let s;return ee(o)?(j(fne(r)),s=void 0):s=o,e==="x"?cse[s||(i==="top"?"left":"center")]:fse[s||i]}function tg(e,t,{defaultPos:n,defaultPos2:i,range:r}){return r?j5(e,t,{defaultPos:n,defaultPos2:i}):rn(e,t,{defaultPos:n})}function j5(e,t,{defaultPos:n,defaultPos2:i}){const{markDef:r,config:o}=t,s=yr(e),a=Sn(e),u=dse(t,i,s),l=u[a]?U5(e,r,o):zo(e);return{...rn(e,t,{defaultPos:n,vgChannel:l}),...u}}function dse(e,t,n){const{encoding:i,mark:r,markDef:o,stack:s,config:a}=e,u=aa(n),l=Sn(n),c=zo(n),f=i[u],d=e.scaleName(u),h=e.getScaleComponent(u),{offset:g}=n in i||n in o?Eu({channel:n,markDef:o,encoding:i,model:e}):Eu({channel:u,markDef:o,encoding:i,model:e});if(!f&&(n==="x2"||n==="y2")&&(i.latitude||i.longitude)){const m=Sn(n),y=e.markDef[m];return y!=null?{[m]:{value:y}}:{[c]:{field:e.getName(n)}}}const p=hse({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}:Jf(n,o)||Jf(n,{[n]:wy(n,o,a.style),[l]:wy(l,o,a.style)})||Jf(n,a[r])||Jf(n,a.mark)||{[c]:jw({model:e,defaultPos:t,channel:n,scaleName:d,scale:h})()}}function hse({channel:e,channelDef:t,channel2Def:n,markDef:i,config:r,scaleName:o,scale:s,stack:a,offset:u,defaultRef:l}){return le(t)&&a&&e.charAt(0)===a.fieldChannel.charAt(0)?Fs(t,o,{suffix:"start"},{offset:u}):vw({channel:e,channelDef:n,scaleName:o,scale:s,stack:a,markDef:i,config:r,offset:u,defaultRef:l})}function Jf(e,t){const n=Sn(e),i=zo(e);if(t[i]!==void 0)return{[i]:tc(e,t[i])};if(t[e]!==void 0)return{[i]:tc(e,t[e])};if(t[n]){const r=t[n];if(Vs(r))j(one(n));else return{[n]:tc(e,r)}}}function Gr(e,t){const{config:n,encoding:i,markDef:r}=e,o=r.type,s=yr(t),a=Sn(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??De("size",r,n,{vgChannel:a}),g=z3(t),p=o==="bar"&&(t==="x"?d==="vertical":d==="horizontal")||o==="tick"&&(t==="y"?d==="vertical":d==="horizontal");return W(u)&&(Ie(u.bin)||Et(u.bin)||u.timeUnit&&!l)&&!(h&&!Vs(h))&&!i[g]&&!yt(f)?mse({fieldDef:u,fieldDef2:l,channel:t,model:e}):(le(u)&&yt(f)||p)&&!l?pse(u,t,e):j5(t,e,{defaultPos:"zeroOrMax",defaultPos2:"zeroOrMin"})}function gse(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=or("minBandSize",{type:s},i);return{signal:c?`max(${pi(c)}, ${l})`:l}}else r.band!==1&&(j(pne(u)),r=void 0)}else return{mult:r.band,field:{group:e}};else{if(ee(r))return r;if(r)return{value:r}}if(n){const u=n.get("range");if(la(u)&&$e(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(ee(d))return{signal:`(1 - (${d.signal})) * ${e}`};if($e(d))return{signal:`${1-d} * ${e}`}}return{value:Cy(i.view,e)-2}}function pse(e,t,n){var $,C;const{markDef:i,encoding:r,config:o,stack:s}=n,a=i.orient,u=n.scaleName(t),l=n.getScaleComponent(t),c=Sn(t),f=yr(t),d=z3(t),h=n.scaleName(d),g=n.getScaleComponent(X2(t)),p=i.type==="tick"||a==="horizontal"&&t==="y"||a==="vertical"&&t==="x";let m;(r.size||i.size)&&(p?m=$t("size",n,{vgChannel:c,defaultRef:Ue(i.size)}):j(vne(i.type)));const y=!!m,b=LN({channel:t,fieldDef:e,markDef:i,config:o,scaleType:($=l||g)==null?void 0:$.get("type"),useVlSizeChannel:p});m=m||{[c]:gse(c,h||u,g||l,o,b,!!e,i.type)};const v=((C=l||g)==null?void 0:C.get("type"))==="band"&&Vs(b)&&!y?"top":"middle",x=U5(t,i,o,v),E=x==="xc"||x==="yc",{offset:S,offsetType:w}=Eu({channel:t,markDef:i,encoding:r,model:n,bandPosition:E?.5:0}),_=vw({channel:t,channelDef:e,markDef:i,config:o,scaleName:u,scale:l,stack:s,offset:S,defaultRef:jw({model:n,defaultPos:"mid",channel:t,scaleName:u,scale:l}),bandPosition:E?w==="encoding"?0:.5:ee(b)?{signal:`(1-${b})/2`}:Vs(b)?(1-b.band)/2:0});if(c)return{[x]:_,...m};{const T=zo(f),D=m[c],k=S?{...D,offset:S}:D;return{[x]:_,[T]:L(_)?[_[0],{..._[1],offset:k}]:{..._,offset:k}}}}function DA(e,t,n,i,r,o,s){if(O3(e))return 0;const a=e==="x"||e==="y2",u=a?-t/2:t/2;if(ee(n)||ee(r)||ee(i)||o){const l=pi(n),c=pi(r),f=pi(i),d=pi(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 mse({fieldDef:e,fieldDef2:t,channel:n,model:i}){var C;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=LN({channel:n,fieldDef:e,markDef:o,config:r,scaleType:l}),d=(C=i.component.axes[n])==null?void 0:C[0],h=(d==null?void 0:d.get("translate"))??.5,g=tt(n)?De("binSpacing",o,r)??0:0,p=yr(n),m=zo(n),y=zo(p),b=or("minBandSize",o,r),{offset:v}=Eu({channel:n,markDef:o,encoding:s,model:i,bandPosition:0}),{offset:x}=Eu({channel:p,markDef:o,encoding:s,model:i,bandPosition:0}),E=Uie({fieldDef:e,scaleName:u}),S=DA(n,g,c,h,v,b,E),w=DA(p,g,c,h,x??v,b,E),_=ee(f)?{signal:`(1-${f.signal})/2`}:Vs(f)?(1-f.band)/2:.5,$=Io({fieldDef:e,fieldDef2:t,markDef:o,config:r});if(Ie(e.bin)||e.timeUnit){const T=e.timeUnit&&$!==.5;return{[y]:RA({fieldDef:e,scaleName:u,bandPosition:_,offset:w,useRectOffsetField:T}),[m]:RA({fieldDef:e,scaleName:u,bandPosition:ee(_)?{signal:`1-${_.signal}`}:1-_,offset:S,useRectOffsetField:T})}}else if(Et(e.bin)){const T=Fs(e,u,{},{offset:w});if(W(t))return{[y]:T,[m]:Fs(t,u,{},{offset:S})};if(ua(e.bin)&&e.bin.step)return{[y]:T,[m]:{signal:`scale("${u}", ${V(e,{expr:"datum"})} + ${e.bin.step})`,offset:S}}}j(iN(p))}function RA({fieldDef:e,scaleName:t,bandPosition:n,offset:i,useRectOffsetField:r}){return Xh({scaleName:t,fieldOrDatumDef:e,bandPosition:n,offset:i,...r?{startSuffix:Vp,endSuffix:Xp}:{}})}const yse=new Set(["aria","width","height"]);function oi(e,t){const{fill:n=void 0,stroke:i=void 0}=t.color==="include"?B5(e):{};return{...bse(e.markDef,t),...NA("fill",n),...NA("stroke",i),...$t("opacity",e),...$t("fillOpacity",e),...$t("strokeOpacity",e),...$t("strokeWidth",e),...$t("strokeDash",e),...use(e),...z5(e),...Uw(e,"href"),...ose(e)}}function NA(e,t){return t?{[e]:t}:{}}function bse(e,t){return Ote.reduce((n,i)=>(!yse.has(i)&&B(e,i)&&t[i]!=="ignore"&&(n[i]=Ue(e[i])),n),{})}function Ww(e){const{config:t,markDef:n}=e,i=new Set;if(e.forEachFieldDef((r,o)=>{var l;let s;if(!br(o)||!(s=e.getScaleType(o)))return;const a=Cp(r.aggregate),u=bw({scaleChannel:o,markDef:n,config:t,scaleType:s,isCountAggregate:a});if(zie(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=>Op(o,!0)).join(" && ")}}}function LA(e,t){if(t!==void 0)return{[e]:Ue(t)}}const $0="voronoi",W5={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(ts(o))return j(zte(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},...z5(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}},q5={defined:e=>e.type==="point"&&e.resolve==="global"&&e.bind&&e.bind!=="scales"&&!Dw(e.bind),parse:(e,t,n)=>Q5(t,n),topLevelSignals:(e,t,n)=>{const i=t.name,r=t.project,o=t.bind,s=t.init&&t.init[0],a=W5.defined(t)?"(item().isVoronoi ? datum.datum : datum)":"datum";return r.items.forEach((u,l)=>{const c=We(`${i}_${u.field}`);n.filter(d=>d.name===c).length||n.unshift({name:c,...s?{init:Ys(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+Uo),s=i+xf,a=r.items.map(l=>We(`${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}},ng="_toggle",H5={defined:e=>e.type==="point"&&!!e.toggle,signals:(e,t,n)=>n.concat({name:t.name+ng,value:!1,on:[{events:t.events,update:t.toggle}]}),modifyExpr:(e,t)=>{const n=t.name+Uo,i=t.name+ng;return`${i} ? null : ${n}, `+(t.resolve==="global"?`${i} ? null : true, `:`${i} ? null : {unit: ${Ms(e)}}, `)+`${i} ? ${n} : null`}},vse={defined:e=>e.clear!==void 0&&e.clear!==!1,parse:(e,t)=>{t.clear&&(t.clear=K(t.clear)?Xo(t.clear,"view"):t.clear)},topLevelSignals:(e,t,n)=>{if(q5.defined(t))for(const i of t.project.items){const r=n.findIndex(o=>o.name===We(`${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+Uo);i(r,"null"),H5.defined(t)&&(r=n.findIndex(o=>o.name===t.name+ng),i(r,"false"))}return n}},G5={defined:e=>{const t=e.resolve==="global"&&e.bind&&Dw(e.bind),n=e.project.items.length===1&&e.project.items[0].field!==$i;return t&&!n&&j(jte),t&&n},parse:(e,t,n)=>{const i=ue(n);if(i.select=K(i.select)?{type:i.select,toggle:t.toggle}:{...i.select,toggle:t.toggle},Q5(t,i),X(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=Y(a.filter??[]),a.filter.includes(s)||a.filter.push(s)}const r=w0(t.bind)?t.bind.legend:"click",o=K(r)?Xo(r,"view"):Y(r);t.bind={legend:{merge:o}}},topLevelSignals:(e,t,n)=>{const i=t.name,r=w0(t.bind)&&t.bind.legend,o=s=>a=>{const u=ue(a);return u.markname=s,u};for(const s of t.project.items){if(!s.hasLegend)continue;const a=`${We(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+Uo),s=i+xf,a=r.items.filter(d=>d.hasLegend).map(d=>We(`${i}_${We(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+ng),f=w0(t.bind)&&t.bind.legend;return c&&(t.events?c.on.push({...c.on[0],events:f}):c.on[0].events=f),n}};function xse(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&&G5.defined(o)){const a=n.get("selections")??[];a.push(o.name),n.set("selections",a,!1),s.hasLegend=!0}}}const V5="_translate_anchor",X5="_translate_delta",wse={defined:e=>e.type==="interval"&&e.translate,signals:(e,t,n)=>{const i=t.name,r=Br.defined(t),o=i+V5,{x:s,y:a}=t.project.hasChannel;let u=Xo(t.translate,"scope");return r||(u=u.map(l=>(l.between[0].markname=i+Ha,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?Oy(e,qe):`slice(${s.signals.visual})`}`:"")+(a!==void 0?`, extent_y: ${r?Oy(e,vt):`slice(${a.signals.visual})`}`:"")+"}"}]},{name:i+X5,value:{},on:[{events:u,update:`{x: ${o}.x - x(unit), y: ${o}.y - y(unit)}`}]}),s!==void 0&&PA(e,t,s,"width",n),a!==void 0&&PA(e,t,a,"height",n),n}};function PA(e,t,n,i,r){const o=t.name,s=o+V5,a=o+X5,u=n.channel,l=Br.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===qe?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 Y5="_zoom_anchor",K5="_zoom_delta",Ese={defined:e=>e.type==="interval"&&e.zoom,signals:(e,t,n)=>{const i=t.name,r=Br.defined(t),o=i+K5,{x:s,y:a}=t.project.hasChannel,u=H(e.scaleName(qe)),l=H(e.scaleName(vt));let c=Xo(t.zoom,"scope");return r||(c=c.map(f=>(f.markname=i+Ha,f))),n.push({name:i+Y5,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&&zA(e,t,s,"width",n),a!==void 0&&zA(e,t,a,"height",n),n}};function zA(e,t,n,i,r){const o=t.name,s=n.channel,a=Br.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?Oy(e,s):u.name,h=o+K5,g=`${o}${Y5}.${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",Uo="_tuple",Sse="_modify",J5="vlSelectionResolve",Kp=[rse,nse,ese,H5,q5,Br,G5,vse,wse,Ese,W5];function _se(e){let t=e.parent;for(;t&&!Nn(t);)t=t.parent;return t}function Ms(e,{escape:t}={escape:!0}){let n=t?H(e.name):e.name;const i=_se(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 qw(e){return Ft(e.component.selection??{}).reduce((t,n)=>t||n.project.hasSelectionId,!1)}function Q5(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 Dy(e){const t=[];return e.type==="Identifier"?[e.name]:e.type==="Literal"?[e.value]:(e.type==="MemberExpression"&&(t.push(...Dy(e.object)),t.push(...Dy(e.property))),t)}function Z5(e){return e.object.type==="MemberExpression"?Z5(e.object):e.object.name==="datum"}function eL(e){const t=u2(e),n=new Set;return t.visit(i=>{i.type==="MemberExpression"&&Z5(i)&&n.add(Dy(i).slice(1).join("."))}),n}class Vu extends Oe{clone(){return new Vu(null,this.model,ue(this.filter))}constructor(t,n,i){super(t),this.model=n,this.filter=i,this.expr=ig(this.model,this.filter,this),this._dependentFields=eL(this.expr)}dependentFields(){return this._dependentFields}producedFields(){return new Set}assemble(){return{type:"filter",expr:this.expr}}hash(){return`Filter ${this.expr}`}}function $se(e,t){const n={},i=e.config.selection;if(!t||!t.length)return n;for(const r of t){const o=We(r.name),s=r.select,a=K(s)?s:s.type,u=X(s)?ue(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]=ue(l[d]??u[d])));const c=n[o]={...u,name:o,type:a,init:r.value,bind:r.bind,events:K(u.on)?Xo(u.on,"scope"):Y(ue(u.on))},f=ue(r);for(const d of Kp)d.defined(c)&&d.parse&&d.parse(e,c,f)}return n}function tL(e,t,n,i="datum"){const r=K(t)?t:t.param,o=We(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 nL(e,t,n){const i=We(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(ti(o))}]`}function Ase(e,t){for(const[n,i]of Po(e.component.selection??{})){const r=e.getName(`lookup_${n}`);e.component.data.outputNodes[r]=i.materialized=new yn(new Vu(t,e,{param:n}),r,Ke.Lookup,e.component.data.outputNodeRefCounts)}}function ig(e,t,n){return ec(t,i=>K(i)?i:nie(i)?tL(e,i,n):pN(i))}function kse(e,t){if(e)return L(e)&&!fo(e)?e.map(n=>$w(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 Bl(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=are[g],m=c[g];if(p&&p!==t&&p!=="both")delete c[g];else if(vf(m)){const{condition:y,...b}=m,v=Y(y),x=fA[g];if(x){const{vgProp:E,part:S}=x,w=[...v.map(_=>{const{test:$,...C}=_;return{test:ig(null,$),...C}}),b];A0(c,S,E,w),delete c[g]}else if(x===null){const E={signal:v.map(S=>{const{test:w,..._}=S;return`${ig(null,w)} ? ${Y$(_)} : `}).join("")+Y$(b)};c[g]=E}}else if(ee(m)){const y=fA[g];if(y){const{vgProp:b,part:v}=y;A0(c,v,b,m),delete c[g]}}ye(["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&&ee(c.encode.labels.update.text)&&(g=Ws(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 GN)e.hasAxisPart(g)||delete c.encode[g];Re(c.encode)&&delete c.encode}const h=kse(u,n);return{scale:s,orient:o,grid:!1,...h?{title:h}:{},...c,...n.aria===!1?{aria:!1}:{},zindex:et(l,0)}}}}function iL(e){const{axes:t}=e.component,n=[];for(const i of Zr)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 Cse(e,t){const{x:n=[],y:i=[]}=e;return[...n.map(r=>Bl(r,"grid",t)),...i.map(r=>Bl(r,"grid",t)),...n.map(r=>Bl(r,"main",t)),...i.map(r=>Bl(r,"main",t))].filter(r=>r)}function IA(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([...I(s),...I(a)]),l={};for(const c of u.values())l[c]={signal:`${i.signal} === "${o}" ? ${pi(s[c])} : ${pi(a[c])}`};return l}return t[r]})])}function Fse(e,t,n,i){const r=t==="band"?["axisDiscrete","axisBand"]:t==="point"?["axisDiscrete","axisPoint"]:vN(t)?["axisQuantitative"]:t==="time"||t==="utc"?["axisTemporal"]:[],o=e==="x"?"axisX":"axisY",s=ee(n)?"axisOrient":`axis${uf(n)}`,a=[...r,...r.map(l=>o+l.substr(4))],u=["axis",s,o];return{vlOnlyAxisConfig:IA(a,i,e,n),vgAxisConfig:IA(u,i,e,n),axisConfigStyle:Tse([...u,...a],i)}}function Tse(e,t){var i;const n=[{}];for(const r of e){let o=(i=t[r])==null?void 0:i.style;if(o){o=Y(o);for(const s of o)n.push(t.style[s])}}return Object.assign.apply(null,n)}function Ry(e,t,n,i={}){var o;const r=V3(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 BA={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??Mse(n,e),gridScale:({model:e,channel:t})=>Ose(e,t),labelAlign:({axis:e,labelAngle:t,orient:n,channel:i})=>e.labelAlign||oL(t,n,i),labelAngle:({labelAngle:e})=>e,labelBaseline:({axis:e,labelAngle:t,orient:n,channel:i})=>e.labelBaseline||rL(t,n,i),labelFlush:({axis:e,fieldOrDatumDef:t,channel:n})=>e.labelFlush??Rse(t.type,n),labelOverlap:({axis:e,fieldOrDatumDef:t,scaleType:n})=>e.labelOverlap??Nse(t.type,n,W(t)&&!!t.timeUnit,W(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??Pse({fieldOrDatumDef:i,scaleType:r,size:s,values:n.values})},tickMinStep:zse,title:({axis:e,model:t,channel:n})=>{if(e.title!==void 0)return e.title;const i=sL(t,n);if(i!==void 0)return i;const r=t.typedFieldDef(n),o=n==="x"?"x2":"y2",s=t.fieldDef(o);return Y3(r?[lA(r)]:[],W(s)?[lA(s)]:[])},values:({axis:e,fieldOrDatumDef:t})=>Ise(e,t),zindex:({axis:e,fieldOrDatumDef:t,mark:n})=>e.zindex??Bse(n,t)};function Mse(e,t){return!yt(e)&&W(t)&&!Ie(t==null?void 0:t.bin)&&!Et(t==null?void 0:t.bin)}function Ose(e,t){const n=t==="x"?"y":"x";if(e.getScaleComponent(n))return e.scaleName(n)}function Dse(e,t,n,i,r){const o=t==null?void 0:t.labelAngle;if(o!==void 0)return ee(o)?o:Ac(o);{const{configValue:s}=Ry("labelAngle",i,t==null?void 0:t.style,r);return s!==void 0?Ac(s):n===qe&&ye([hw,dw],e.type)&&!(W(e)&&e.timeUnit)?270:void 0}}function Ny(e){return`(((${e.signal} % 360) + 360) % 360)`}function rL(e,t,n,i){if(e!==void 0)if(n==="x"){if(ee(e)){const r=Ny(e),o=ee(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(ee(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(ee(e)){const r=Ny(e),o=ee(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(ee(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 oL(e,t,n){if(e===void 0)return;const i=n==="x",r=i?0:90,o=i?"bottom":"left";if(ee(e)){const s=Ny(e),a=ee(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(ee(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 Rse(e,t){if(t==="x"&&ye(["quantitative","temporal"],e))return!0}function Nse(e,t,n,i){if(n&&!X(i)||e!=="nominal"&&e!=="ordinal")return t==="log"||t==="symlog"?"greedy":!0}function Lse(e){return e==="x"?"bottom":"left"}function Pse({fieldOrDatumDef:e,scaleType:t,size:n,values:i}){var r;if(!i&&!yt(t)&&t!=="log"){if(W(e)){if(Ie(e.bin))return{signal:`ceil(${n.signal}/10)`};if(e.timeUnit&&ye(["month","hours","day","quarter"],(r=mt(e.timeUnit))==null?void 0:r.unit))return}return{signal:`ceil(${n.signal}/40)`}}}function zse({format:e,fieldOrDatumDef:t}){if(e==="d")return 1;if(W(t)){const{timeUnit:n}=t;if(n){const i=dN(n);if(i)return{signal:i}}}}function sL(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 K3(o,s);if(o)return o;if(s)return s;if(o!==void 0)return o;if(s!==void 0)return s}function Ise(e,t){const n=e.values;if(L(n))return HN(t,n);if(ee(n))return n}function Bse(e,t){return e==="rect"&&Kh(t)?1:0}class Su extends Oe{clone(){return new Su(null,ue(this.transform))}constructor(t,n){super(t),this.transform=n,this._dependentFields=eL(this.transform.calculate)}static parseAllForSortIndex(t,n){return n.forEachFieldDef((i,r)=>{if(da(i)&&NN(i.sort)){const{field:o,timeUnit:s}=i,a=i.sort,u=a.map((l,c)=>`${pN({field:o,timeUnit:s,equal:l})} ? ${c} : `).join("")+a.length;t=new Su(t,{calculate:u,as:_u(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 ${be(this.transform)}`}}function _u(e,t,n){return V(e,{prefix:t,suffix:"sort_index",...n})}function Jp(e,t){return ye(["top","bottom"],t)?"column":ye(["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 Qp(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 Hw=["row","column"],Gw=["header","footer"];function Use(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}=Qp(["titleAnchor","titleAngle","titleOrient"],r.header,i,t),u=Jp(t,a),l=Ac(s);return{name:`${t}-title`,type:"group",role:`${u}-title`,title:{text:n,...t==="row"?{orient:"left"}:{},style:"guide-title",...uL(l,u),...aL(u,l,o),...lL(i,r,t,Fre,c5)}}}function aL(e,t,n="middle"){switch(n){case"start":return{align:"left"};case"end":return{align:"right"}}const i=oL(t,e==="row"?"left":"top",e==="row"?"y":"x");return i?{align:i}:{}}function uL(e,t){const n=rL(e,t==="row"?"left":"top",t==="row"?"y":"x",!0);return n?{baseline:n}:{}}function jse(e,t){const n=e.component.layoutHeaders[t],i=[];for(const r of Gw)if(n[r])for(const o of n[r]){const s=qse(e,t,r,n,o);s!=null&&i.push(s)}return i}function Wse(e,t){const{sort:n}=e;return Ir(n)?{field:V(n,{expr:"datum"}),order:n.order??"ascending"}:L(n)?{field:_u(e,t,{expr:"datum"}),order:"ascending"}:{field:V(e,{expr:"datum"}),order:n??"ascending"}}function Ly(e,t,n){const{format:i,formatType:r,labelAngle:o,labelAnchor:s,labelOrient:a,labelExpr:u}=Qp(["format","formatType","labelAngle","labelAnchor","labelOrient","labelExpr"],e.header,n,t),l=ww({fieldOrDatumDef:e,format:i,formatType:r,expr:"parent",config:n}).signal,c=Jp(t,a);return{text:{signal:u?Ws(Ws(u,"datum.label",l),"datum.value",V(e,{expr:"parent"})):l},...t==="row"?{orient:"left"}:{},style:"guide-label",frame:"group",...uL(o,c),...aL(c,o,s),...lL(n,e,t,Tre,f5)}}function qse(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}=Qp(["labelOrient"],s.header,a,t);(t==="row"&&!ye(["top","bottom"],f)||t==="column"&&!ye(["left","right"],f))&&(o=Ly(s,t,a))}const u=Nn(e)&&!pf(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:Wse(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 Hse={column:{start:0,end:1},row:{start:1,end:0}};function Gse(e,t){return Hse[t][e]}function Vse(e,t){const n={};for(const i of Xn){const r=e[i];if(r!=null&&r.facetFieldDef){const{titleAnchor:o,titleOrient:s}=Qp(["titleAnchor","titleOrient"],r.facetFieldDef.header,t,i),a=Jp(i,s),u=Gse(o,a);u!==void 0&&(n[a]=u)}}return Re(n)?void 0:n}function lL(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 Vw(e){return[...Qf(e,"width"),...Qf(e,"height"),...Qf(e,"childWidth"),...Qf(e,"childHeight")]}function Qf(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 Nn(e.parent)&&e.parent.component.resolve.scale[n]==="independent"?[UA(u,a)]:[UA(u,a),{name:r,update:cL(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=ky(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 UA(e,t){const n=`${e}_step`;return ee(t.step)?{name:n,update:t.step.signal}:{name:n,value:t.step}}function cL(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}, ${pi(s)}, ${pi(o)}) * ${e}_step`}function fL(e){return e==="childWidth"?"width":e==="childHeight"?"height":e}function dL(e,t){return I(e).reduce((n,i)=>({...n,...Gu({model:t,channelDef:e[i],vgChannel:i,mainRefFn:r=>Ue(r.value),invalidValueRef:void 0})}),{})}function hL(e,t){if(Nn(t))return e==="theta"?"independent":"shared";if(Ku(t))return"shared";if(eE(t))return tt(e)||e==="theta"||e==="radius"?"independent":"shared";throw new Error("invalid model type for resolve")}function Xw(e,t){const n=e.scale[t],i=tt(t)?"axis":"legend";return n==="independent"?(e[i][t]==="shared"&&j(_ne(t)),"independent"):e[i][t]||"shared"}const Xse={...Dre,disable:1,labelExpr:1,selections:1,opacity:1,shape:1,stroke:1,fill:1,size:1,strokeWidth:1,strokeDash:1,encode:1},gL=I(Xse);class Yse extends to{}const jA={symbols:Kse,gradient:Jse,labels:Qse,entries:Zse};function Kse(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={...Nte({},n,Cie),...B5(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?pL(a.opacity)??s.opacity:void 0;if(f.fill){if(i==="fill"||c&&i===wn)delete f.fill;else if(B(f.fill,"field"))h?delete f.fill:(f.fill=Ue(u.legend.symbolBaseFillColor??"black"),f.fillOpacity=Ue(p??1));else if(L(f.fill)){const m=Py(a.fill??a.color)??s.fill??(c&&s.color);m&&(f.fill=Ue(m))}}if(f.stroke){if(i==="stroke"||!c&&i===wn)delete f.stroke;else if(B(f.stroke,"field")||g)delete f.stroke;else if(L(f.stroke)){const m=et(Py(a.stroke||a.color),s.stroke,c?s.color:void 0);m&&(f.stroke={value:m})}}if(i!==Qr){const m=W(t)&&yL(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 Jse(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?pL(s.opacity)||o.opacity:void 0;return l&&(a.opacity=Ue(l)),a={...a,...e},Re(a)?void 0:a}function Qse(e,{fieldOrDatumDef:t,model:n,channel:i,legendCmpt:r}){const o=n.legend(i)||{},s=n.config,a=W(t)?yL(n,r,t):void 0,u=a?[{test:a,value:1},{value:s.legend.unselectedOpacity}]:void 0,{format:l,formatType:c}=o;let f;Xs(c)?f=mi({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=mi({fieldOrDatumDef:t,field:"datum.value",format:s.numberFormat,formatType:s.numberFormatType,config:s}):t.type==="temporal"&&s.timeFormatType&&W(t)&&t.timeUnit===void 0&&(f=mi({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 Zse(e,{legendCmpt:t}){const n=t.get("selections");return n!=null&&n.length?{...e,fill:{value:"transparent"}}:e}function pL(e){return mL(e,(t,n)=>Math.max(t,n.value))}function Py(e){return mL(e,(t,n)=>et(t,n.value))}function mL(e,t){if(Yie(e))return Y(e.condition).reduce(t,e.value);if(Si(e))return e.value}function yL(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(We(o)+Ks)})) || (${o}[${r}] && indexof(${o}[${r}], datum.value) >= 0))`).join(" || ")}const WA={direction:({direction:e})=>e,format:({fieldOrDatumDef:e,legend:t,config:n})=>{const{format:i,formatType:r}=t;return ON(e,e.type,i,r,n,!1)},formatType:({legend:e,fieldOrDatumDef:t,scaleType:n})=>{const{formatType:i}=e;return DN(i,t,n)},gradientLength:e=>{const{legend:t,legendConfig:n}=e;return t.gradientLength??n.gradientLength??sae(e)},labelOverlap:({legend:e,legendConfig:t,scaleType:n})=>e.labelOverlap??t.labelOverlap??aae(n),symbolType:({legend:e,markDef:t,channel:n,encoding:i})=>e.symbolType??tae(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(Wa(n)&&Xi(t)){if(e==="gradient")return}else if(e==="symbol")return;return e},values:({fieldOrDatumDef:e,legend:t})=>eae(t,e)};function eae(e,t){const n=e.values;if(L(n))return HN(t,n);if(ee(n))return n}function tae(e,t,n,i){if(t!=="shape"){const r=Py(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 nae(e){const{legend:t}=e;return et(t.type,iae(e))}function iae({channel:e,timeUnit:t,scaleType:n}){if(Wa(e)){if(ye(["quarter","month","day"],t))return"symbol";if(Xi(n))return"gradient"}return"symbol"}function rae({legendConfig:e,legendType:t,orient:n,legend:i}){return i.direction??e[t?"gradientDirection":"symbolDirection"]??oae(n,t)}function oae(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 sae({legendConfig:e,model:t,direction:n,orient:i,scaleType:r}){const{gradientHorizontalMaxLength:o,gradientHorizontalMinLength:s,gradientVerticalMaxLength:a,gradientVerticalMinLength:u}=e;if(Xi(r))return n==="horizontal"?i==="top"||i==="bottom"?qA(t,"width",s,o):s:qA(t,"height",u,a)}function qA(e,t,n,i){return{signal:`clamp(${e.getSizeSignalRef(t).signal}, ${n}, ${i})`}}function aae(e){if(ye(["quantile","threshold","log","symlog"],e))return"greedy"}function bL(e){const t=Ge(e)?uae(e):dae(e);return e.component.legends=t,t}function uae(e){const{encoding:t}=e,n={};for(const i of[wn,...h5]){const r=at(t[i]);!r||!e.getScaleComponent(i)||i===En&&W(r)&&r.type===Hu||(n[i]=fae(e,i))}return n}function lae(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 cae(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 fae(e,t){var x;let n=e.legend(t);const{markDef:i,encoding:r,config:o}=e,s=o.legend,a=new Yse({},lae(e,t));xse(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=W(c)?(x=mt(c.timeUnit))==null?void 0:x.unit:void 0,d=n.orient||o.legend.orient||"right",h=nae({legend:n,channel:t,timeUnit:f,scaleType:l}),g=rae({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 gL){if(h==="gradient"&&E.startsWith("symbol")||h==="symbol"&&E.startsWith("gradient"))continue;const S=E in WA?WA[E](p):n[E];if(S!==void 0){const w=cae(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=dL(m[E]??{},e),w=E in jA?jA[E](S,v):S;w!==void 0&&!Re(w)&&(b[E]={...y!=null&&y.length&&W(c)?{name:`${We(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 dae(e){const{legends:t,resolve:n}=e.component;for(const i of e.children){bL(i);for(const r of I(i.component.legends))n.legend[r]=Xw(e.component.resolve,r),n.legend[r]==="shared"&&(t[r]=vL(t[r],i.component.legends[r]),t[r]||(n.legend[r]="independent",delete t[r]))}for(const i of I(t))for(const r of e.children)r.component.legends[i]&&n.legend[i]==="shared"&&delete r.component.legends[i];return t}function vL(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 gL){const c=Bo(e.getWithExplicit(l),t.getWithExplicit(l),l,"legend",(f,d)=>{switch(l){case"symbolType":return hae(f,d);case"title":return J3(f,d);case"type":return r=!0,An("symbol")}return Gp(f,d,l,"legend")});e.setWithExplicit(l,c)}return r&&((s=(o=e.implicit)==null?void 0:o.encode)!=null&&s.gradient&&Hh(e.implicit,["encode","gradient"]),(u=(a=e.explicit)==null?void 0:a.encode)!=null&&u.gradient&&Hh(e.explicit,["encode","gradient"])),e}function hae(e,t){return t.value==="circle"?t:e}function gae(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 xL(e){const t=e.component.legends,n={};for(const r of I(t)){const o=e.getScaleComponent(r),s=Ne(o.get("domains"));if(n[s])for(const a of n[s])vL(a,t[r])||n[s].push(t[r]);else n[s]=[t[r].clone()]}return Ft(n).flat().map(r=>pae(r,e.config)).filter(r=>r!==void 0)}function pae(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 h5)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&&ee(o.encode.labels.update.text)&&(l=Ws(i,"datum.label",o.encode.labels.update.text.signal)),gae(o,"labels","text",{signal:l})}return o}}function mae(e){return Ku(e)||eE(e)?yae(e):wL(e)}function yae(e){return e.children.reduce((t,n)=>t.concat(n.assembleProjections()),wL(e))}function wL(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=ee(a)?a.signal:`data('${e.lookupDataSource(a)}')`;return ye(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 bae=["type","clipAngle","clipExtent","center","rotate","precision","reflectX","reflectY","coefficient","distance","fraction","lobes","parallel","radius","ratio","spacing","tilt"];class EL extends to{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 SL(e){e.component.projection=Ge(e)?vae(e):Eae(e)}function vae(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?xae(e):void 0,o=new EL(e.projectionName(!0),{...St(e.config.projection),...t},i,r);return o.get("type")||o.set("type","equalEarth",!1),o}}function xae(e){const t=[],{encoding:n}=e;for(const i of[[Oi,Mi],[ni,Di]])(at(n[i[0]])||at(n[i[1]]))&&t.push({signal:e.getName(`geojson_${t.length}`)});return e.channelHasField(En)&&e.typedFieldDef(En).type===Hu&&t.push({signal:e.getName(`geojson_${t.length}`)}),t.length===0&&t.push(e.requestDataName(Ke.Main)),t}function wae(e,t){const n=U2(bae,r=>!!(!J(e.explicit,r)&&!J(t.explicit,r)||J(e.explicit,r)&&J(t.explicit,r)&&On(e.get(r),t.get(r))));if(On(e.size,t.size)){if(n)return e;if(On(e.explicit,{}))return t;if(On(t.explicit,{}))return e}return null}function Eae(e){if(e.children.length===0)return;let t;for(const i of e.children)SL(i);const n=U2(e.children,i=>{const r=i.component.projection;if(r)if(t){const o=wae(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 EL(i,t.specifiedProjection,t.size,ue(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 Sae(e,t,n,i){if(bf(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:gf(o,s,r.format,r.formatType,i)}}return{}}function _L(e,t){return`${W3(e)}_${t}`}function _ae(e,t){return{signal:e.getName(`${t}_bins`),extentSignal:e.getName(`${t}_extent`)}}function Yw(e,t,n){const i=Bp(n,void 0)??{},r=_L(i,t);return e.getName(`${r}_bins`)}function $ae(e){return"as"in e}function HA(e,t,n){let i,r;$ae(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={...Bp(t,void 0)},s=_L(o,e.field),{signal:a,extentSignal:u}=_ae(n,s);if(Fp(o.extent)){const c=o.extent;r=nL(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 Qi extends Oe{clone(){return new Qi(null,ue(this.bins))}constructor(t,n){super(t),this.bins=n}static makeFromEncoding(t,n){const i=n.reduceFieldDef((r,o,s)=>{if(ln(o)&&Ie(o.bin)){const{key:a,binComponent:u}=HA(o,o.bin,n);r[a]={...u,...r[a],...Sae(n,o,s,n.config)}}return r},{});return Re(i)?null:new Qi(t,i)}static makeFromTransform(t,n,i){const{key:r,binComponent:o}=HA(n,n.bin,i);return new Qi(t,{[r]:o})}merge(t,n){for(const i of I(t.bins))i in this.bins?(n(t.bins[i].signal,this.bins[i].signal),this.bins[i].as=Vi([...this.bins[i].as,...t.bins[i].as],be)):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 ${be(this.bins)}`}assemble(){return Ft(this.bins).flatMap(t=>{const n=[],[i,...r]=t.as,{extent:o,...s}=t.bin,a={type:"bin",field:ti(t.field),as:i,signal:t.signal,...Fp(o)?{extent:null}:{extent:o},...t.span?{span:{signal:`span(${t.span})`}}:{},...s};!o&&t.extentSignal&&(n.push({type:"extent",field:ti(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 Aae(e,t,n,i){var o;const r=Ge(i)?i.encoding[yr(t)]:void 0;if(ln(n)&&Ge(i)&&PN(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:Vp})),e.add(V(n,{suffix:Xp}))),n.bin&&bf(n,t)&&e.add(V(n,{binSuffix:"range"}))}else if(R3(t)){const s=D3(t);e.add(i.getName(s))}else e.add(V(n));return da(n)&&pie((o=n.scale)==null?void 0:o.range)&&e.add(n.scale.range.field),e}function kae(e,t){for(const n of I(t)){const i=t[n];for(const r of I(i))n in e?e[n][r]=new Set([...e[n][r]??[],...i[r]]):e[n]={[r]:i[r]}}}class bi extends Oe{clone(){return new bi(null,new Set(this.dimensions),ue(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(Hr(u)||es(u)){const c=Hr(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})]);br(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 Aae(o,a,s,n)}),o.size+I(r).length===0)?null:new bi(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+I(o).length===0?null:new bi(t,r,o)}merge(t){return $3(this.dimensions,t.dimensions)?(kae(this.measures,t.measures),!0):(Bne("different dimensions, cannot merge"),!1)}addDimensions(t){t.forEach(this.dimensions.add,this.dimensions)}dependentFields(){return new Set([...this.dimensions,...I(this.measures)])}producedFields(){const t=new Set;for(const n of I(this.measures))for(const i of I(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 ${be({dimensions:this.dimensions,measures:this.measures})}`}assemble(){const t=[],n=[],i=[];for(const o of I(this.measures))for(const s of I(this.measures[o]))for(const a of this.measures[o][s])i.push(a),t.push(s),n.push(o==="*"?null:ti(o));return{type:"aggregate",groupby:[...this.dimensions].map(ti),ops:t,fields:n,as:i}}}class Xu extends Oe{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),...Ie(a)?[V(s,{binSuffix:"end"})]:[]],...Ir(u)?{sortField:u}:L(u)?{sortIndexField:_u(s,o)}:{}}}}this.childModel=n.child}hash(){let t="Facet";for(const n of Xn)this[n]&&(t+=` ${n.charAt(0)}:${be(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 Zr){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=Zp(this.childModel,n),a=Zw(s);a?t[n]=a:j(tw(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=Pp,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 Hw){for(const c of Gw){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[zr,Pr])this[a]&&t.push(this.assembleRowColumnHeaderData(a,n,i));if(s){const a=this.assembleFacetHeaderData(i);a&&t.push(...a)}return t}}function GA(e){return e.startsWith("'")&&e.endsWith("'")||e.startsWith('"')&&e.endsWith('"')?e.slice(1,-1):e}function Cae(e,t){const n=q2(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=GA(t.slice(5,t.length));return`timeParse(${n},'${i}')`}else if(t.startsWith("utc:")){const i=GA(t.slice(4,t.length));return`utcParse(${n},'${i}')`}else return j(Yte(t)),null}function Fae(e){const t={};return Od(e.filter,n=>{if(gN(n)){let i=null;ow(n)?i=Fn(n.equal):aw(n)?i=Fn(n.lte):sw(n)?i=Fn(n.lt):uw(n)?i=Fn(n.gt):lw(n)?i=Fn(n.gte):cw(n)?i=n.range[0]:fw(n)&&(i=(n.oneOf??n.in)[0]),i&&(ca(i)?t[n.field]="date":$e(i)?t[n.field]="number":K(i)&&(t[n.field]="string")),n.timeUnit&&(t[n.field]="date")}}),t}function Tae(e){const t={};function n(i){xu(i)?t[i.field]="date":i.type==="quantitative"&&Ate(i.aggregate)?t[i.field]="number":hu(i.field)>1?i.field in t||(t[i.field]="flatten"):da(i)&&Ir(i.sort)&&hu(i.sort.field)>1&&(i.sort.field in t||(t[i.sort.field]="flatten"))}if((Ge(e)||Nn(e))&&e.forEachFieldDef((i,r)=>{if(ln(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(ts(i)&&!e.encoding.order){const s=r.orient==="horizontal"?"y":"x",a=o[s];W(a)&&a.type==="quantitative"&&!(a.field in t)&&(t[a.field]="number")}}return t}function Mae(e){const t={};if(Ge(e)&&e.component.selection)for(const n of I(e.component.selection)){const i=e.component.selection[n];for(const r of i.project.items)!r.channel&&hu(r.field)>1&&(t[r.field]="flatten")}return t}class Ut extends Oe{clone(){return new Ut(null,ue(this._parse))}constructor(t,n){super(t),this._parse=n}hash(){return`Parse ${be(this._parse)}`}static makeExplicit(t,n,i){var s;let r={};const o=n.data;return!Fo(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 I(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(tA(a,i[a],u.value)))}for(const a of I(n)){const u=r.get(a);u!==void 0&&(u===n[a]?delete n[a]:j(tA(a,n[a],u)))}const o=new to(n,i);r.copyAll(o);const s={};for(const a of I(o.combine())){const u=o.get(a);u!==null&&(s[a]=u)}return I(s).length===0||r.parseNothing?null:new Ut(t,s)}get parse(){return this._parse}merge(t){this._parse={...this._parse,...t.parse},t.remove()}assembleFormatParse(){const t={};for(const n of I(this._parse)){const i=this._parse[n];hu(n)===1&&(t[n]=i)}return t}producedFields(){return new Set(I(this._parse))}dependentFields(){return new Set(I(this._parse))}assembleTransforms(t=!1){return I(this._parse).filter(n=>t?hu(n)>1:!0).map(n=>{const i=Cae(n,this._parse[n]);return i?{type:"formula",expr:i,as:Wu(n)}:null}).filter(n=>n!==null)}}class jo extends Oe{clone(){return new jo(null)}constructor(t){super(t)}dependentFields(){return new Set}producedFields(){return new Set([$i])}hash(){return"Identifier"}assemble(){return{type:"identifier",as:$i}}}class wf extends Oe{clone(){return new wf(null,this.params)}constructor(t,n){super(t),this.params=n}dependentFields(){return new Set}producedFields(){}hash(){return`Graticule ${be(this.params)}`}assemble(){return{type:"graticule",...this.params===!0?{}:this.params}}}class Ef extends Oe{clone(){return new Ef(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 ${be(this.params)}`}assemble(){return{type:"sequence",...this.params}}}class Js extends Oe{constructor(t){super(null),t??(t={name:"source"});let n;if(Fo(t)||(n=t.format?{...mn(t.format,["parse"])}:{}),Cc(t))this._data={values:t.values};else if(wu(t)){if(this._data={url:t.url},!n.type){let i=/(?:\.([^.]+))?$/.exec(t.url)[1];ye(["json","csv","tsv","dsv","topojson"],i)||(i="json"),n.type=i}}else M5(t)?this._data={values:[{type:"Sphere"}]}:(F5(t)||Fo(t))&&(this._data={});this._generator=Fo(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 VA=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},Oae=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)},Ul;function Kw(e){return e instanceof Js||e instanceof wf||e instanceof Ef}class Jw{constructor(){Ul.set(this,void 0),VA(this,Ul,!1,"f")}setModified(){VA(this,Ul,!0,"f")}get modifiedFlag(){return Oae(this,Ul,"f")}}Ul=new WeakMap;class ha extends Jw{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 Qw extends Jw{optimize(t){this.run(t);for(const n of t.children)this.optimize(n);return this.modifiedFlag}}class Dae extends Qw{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 I(i))i[r].length>1&&(this.setModified(),this.mergeNodes(t,i[r]))}}class Rae extends Qw{constructor(t){super(),this.requiresSelectionId=t&&qw(t)}run(t){t instanceof jo&&(this.requiresSelectionId&&(Kw(t.parent)||t.parent instanceof bi||t.parent instanceof Ut)||(this.setModified(),t.remove()))}}class Nae extends Jw{optimize(t){return this.run(t,new Set),this.modifiedFlag}run(t,n){let i=new Set;t instanceof Ji&&(i=t.producedFields(),j2(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 Lae extends Qw{constructor(){super()}run(t){t instanceof yn&&!t.isRequired()&&(this.setModified(),t.remove())}}class Pae extends ha{run(t){if(!Kw(t)&&!(t.numChildren()>1)){for(const n of t.children)if(n instanceof Ut)if(t instanceof Ut)this.setModified(),t.merge(n);else{if(W2(t.producedFields(),n.dependentFields()))continue;this.setModified(),n.swapWithParent()}}}}class zae extends ha{run(t){const n=[...t.children],i=t.children.filter(r=>r instanceof Ut);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 I(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 Ut(t,r);for(const a of n){if(a instanceof Ut)for(const u of I(r))delete a.parse[u];t.removeChild(a),a.parent=s,a instanceof Ut&&I(a.parse).length===0&&a.remove()}}}}}class Iae extends ha{run(t){t instanceof yn||t.numChildren()>0||t instanceof Xu||t instanceof Js||(this.setModified(),t.remove())}}class Bae extends ha{run(t){const n=t.children.filter(r=>r instanceof Ji),i=n.pop();for(const r of n)this.setModified(),i.merge(r)}}class Uae extends ha{run(t){const n=t.children.filter(r=>r instanceof bi),i={};for(const r of n){const o=be(r.groupBy);o in i||(i[o]=[]),i[o].push(r)}for(const r of I(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 jae extends ha{constructor(t){super(),this.model=t}run(t){const n=!(Kw(t)||t instanceof Vu||t instanceof Ut||t instanceof jo),i=[],r=[];for(const o of t.children)o instanceof Qi&&(n&&!W2(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 Qi?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 Wae extends ha{run(t){const n=[...t.children];if(!du(n,s=>s instanceof yn)||t.numChildren()<=1)return;const r=[];let o;for(const s of n)if(s instanceof yn){let a=s;for(;a.numChildren()===1;){const[u]=a.children;if(u instanceof yn)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 Oe{clone(){return new ga(null,ue(this.transform))}constructor(t,n){super(t),this.transform=n}addDimensions(t){this.transform.groupby=Vi(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 ${be(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 Oe{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=br(f)&&n.getScaleComponent(f);if(d){const h=d.get("type"),{aggregate:g}=c,p=bw({scaleChannel:f,markDef:o,config:r,scaleType:h,isCountAggregate:Cp(g)});p!=="show"&&p!=="always-valid"&&(l[c.field]=c)}return l},{});return I(u).length?new Au(t,u):null}dependentFields(){return new Set(I(this.filter))}producedFields(){return new Set}hash(){return`FilterInvalid ${be(this.filter)}`}assemble(){const t=I(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}) || (${zy(o)}))`):r.type==="quantitative"&&n.push(zy(o))),n},[]);return t.length>0?{type:"filter",expr:t.join(" && ")}:null}}function zy(e){return`isValid(${e}) && isFinite(+${e})`}function qae(e){return e.stack.stackBy.reduce((t,n)=>{const i=n.fieldDef,r=V(i);return r&&t.push(r),t},[])}function Hae(e){return L(e)&&e.every(t=>K(t))&&e.length>1}class Ur extends Oe{clone(){return new Ur(null,ue(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 Hae(o)?c=o:K(o)?c=[o,`${o}_end`]:c=[`${n.stack}_start`,`${n.stack}_end`],new Ur(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 _i(g)}).filter(h=>!!h),c=qae(n),f=n.encoding.order;let d;if(L(f)||W(f))d=X3(f);else{const h=zN(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 Ur(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 ${be(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:`${zy(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 Oe{clone(){return new Yu(null,ue(this.transform))}constructor(t,n){super(t),this.transform=n}addDimensions(t){this.transform.groupby=Vi(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 ${be(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=>Z2(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 Gae(e){function t(n){if(!(n instanceof Xu)){const i=n.clone();if(i instanceof yn){const r=By+i.getSource();i.setSource(r),e.model.component.data.outputNodes[r]=i}else(i instanceof bi||i instanceof Ur||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 Iy(e){if(e instanceof Xu)if(e.numChildren()===1&&!(e.children[0]instanceof yn)){const t=e.children[0];(t instanceof bi||t instanceof Ur||t instanceof Yu||t instanceof ga)&&t.addDimensions(e.fields),t.swapWithParent(),Iy(e)}else{const t=e.model.component.data.main;$L(t);const n=Gae(e),i=e.children.map(n).flat();for(const r of i)r.parent=t}else e.children.map(Iy)}function $L(e){if(e instanceof yn&&e.type===Ke.Main&&e.numChildren()===1){const t=e.children[0];t instanceof Xu||(t.swapWithParent(),$L(e))}}const By="scale_",Zf=5;function Uy(e){for(const t of e){for(const n of t.children)if(n.parent!==t)return!1;if(!Uy(t.children))return!1}return!0}function si(e,t){let n=!1;for(const i of t)n=e.optimize(i)||n;return n}function XA(e,t,n){let i=e.sources,r=!1;return r=si(new Lae,i)||r,r=si(new Rae(t),i)||r,i=i.filter(o=>o.numChildren()>0),r=si(new Iae,i)||r,i=i.filter(o=>o.numChildren()>0),n||(r=si(new Pae,i)||r,r=si(new jae(t),i)||r,r=si(new Nae,i)||r,r=si(new zae,i)||r,r=si(new Uae,i)||r,r=si(new Bae,i)||r,r=si(new Dae,i)||r,r=si(new Wae,i)||r),e.sources=i,r}function Vae(e,t){Uy(e.sources);let n=0,i=0;for(let r=0;r<Zf&&XA(e,t,!0);r++)n++;e.sources.map(Iy);for(let r=0;r<Zf&&XA(e,t,!1);r++)i++;Uy(e.sources),Math.max(n,i)===Zf&&j(`Maximum optimization runs(${Zf}) reached.`)}class dt{constructor(t){Object.defineProperty(this,"signal",{enumerable:!0,get:t})}static fromName(t,n){return new dt(()=>t(n))}}function AL(e){Ge(e)?Xae(e):Yae(e)}function Xae(e){const t=e.component.scales;for(const n of I(t)){const i=Jae(e,n);if(t[n].setWithExplicit("domains",i),Zae(e,n),e.component.data.isFaceted){let o=e;for(;!Nn(o)&&o.parent;)o=o.parent;if(o.component.resolve.scale[n]==="shared")for(const a of i.value)Rr(a)&&(a.data=By+a.data.replace(By,""))}}}function Yae(e){for(const n of e.children)AL(n);const t=e.component.scales;for(const n of I(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=Bo(i,s.getWithExplicit("domains"),"domains","scale",jy);const a=s.get("selectionExtent");r&&a&&r.param!==a.param&&j(Hte),r=a}}t[n].setWithExplicit("domains",i),r&&t[n].set("selectionExtent",r,!0)}}function Kae(e,t,n,i){if(e==="unaggregated"){const{valid:r,reason:o}=YA(t,n);if(!r){j(o);return}}else if(e===void 0&&i.useUnaggregatedDomain){const{valid:r}=YA(t,n);if(r)return"unaggregated"}return e}function Jae(e,t){const n=e.getScaleComponent(t).get("type"),{encoding:i}=e,r=Kae(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)?Bo(so(n,r,e,"x"),so(n,r,e,"x2"),"domain","scale",jy):so(n,r,e,"x2"):t==="y"&&at(i.y2)?at(i.y)?Bo(so(n,r,e,"y"),so(n,r,e,"y2"),"domain","scale",jy):so(n,r,e,"y2"):so(n,r,e,t)}function Qae(e,t,n){return e.map(i=>({signal:`{data: ${Up(i,{timeUnit:n,type:t})}}`}))}function k0(e,t,n){var r;const i=(r=mt(n))==null?void 0:r.unit;return t==="temporal"||i?Qae(e,t,i):[e]}function so(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=Goe({invalid:or("invalid",o,a),isPath:ts(s)});if(gie(t)){const p=so(e,void 0,n,i),m=k0(t.unionWith,c,f);return ji([...m,...p.value])}else{if(ee(t))return ji([t]);if(t&&t!=="unaggregated"&&!wN(t))return ji(k0(t,c,f))}if(u&&i===u.fieldChannel){if(u.offset==="normalize")return An([[0,1]]);const p=n.requestDataName(d);return An([{data:p,field:n.vgField(i,{suffix:"start"})},{data:p,field:n.vgField(i,{suffix:"end"})}])}const h=br(i)&&W(l)?eue(n,i,e):void 0;if(vr(l)){const p=k0([l.datum],c,f);return An(p)}const g=l;if(t==="unaggregated"){const{field:p}=l;return An([{data:n.requestDataName(d),field:V({field:p,aggregate:"min"})},{data:n.requestDataName(d),field:V({field:p,aggregate:"max"})}])}else if(Ie(g.bin)){if(yt(e))return An(e==="bin-ordinal"?[]:[{data:$c(h)?n.requestDataName(d):n.requestDataName(Ke.Raw),field:n.vgField(i,bf(g,i)?{binSuffix:"range"}:{}),sort:h===!0||!X(h)?{field:n.vgField(i,{}),op:"min"}:h}]);{const{bin:p}=g;if(Ie(p)){const m=Yw(n,g.field,p);return An([new dt(()=>{const y=n.getSignalName(m);return`[${y}.start, ${y}.stop]`})])}else return An([{data:n.requestDataName(d),field:n.vgField(i,{})}])}}else if(g.timeUnit&&ye(["time","utc"],e)){const p=r[yr(i)];if(PN(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 An([{data:m,field:n.vgField(i,b?{suffix:Vp}:{})},{data:m,field:n.vgField(i,{suffix:b?Xp:"end"})}])}}return An(h?[{data:$c(h)?n.requestDataName(d):n.requestDataName(Ke.Raw),field:n.vgField(i),sort:h}]:[{data:n.requestDataName(d),field:n.vgField(i)}])}function C0(e,t){const{op:n,field:i,order:r}=e;return{op:n??(t?"sum":Pp),...i?{field:ti(i)}:{},...r?{order:r}:{}}}function Zae(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=wN(i)?i:void 0,s=ua(r)&&Fp(r.extent)?r.extent:void 0;(o||s)&&n.set("selectionExtent",o??s,!0)}function eue(e,t,n){if(!yt(n))return;const i=e.fieldDef(t),r=i.sort;if(NN(r))return{op:"min",field:_u(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 C0(r,a)}else if(Gie(r)){const{encoding:a,order:u}=r,l=e.fieldDef(a),{aggregate:c,field:f}=l,d=o&&!s.has(f);if(Hr(c)||es(c))return C0({field:V(l),order:u},d);if(Z2(c)||!c)return C0({op:c,field:f,order:u},d)}else{if(r==="descending")return{op:"min",field:e.vgField(t),order:"descending"};if(ye(["ascending",void 0],r))return!0}}function YA(e,t){const{aggregate:n,type:i}=e;return n?K(n)&&!Cte.has(n)?{valid:!1,reason:yne(n)}:i==="quantitative"&&t==="log"?{valid:!1,reason:bne(e)}:{valid:!0}:{valid:!1,reason:mne(e)}}function jy(e,t,n,i){return e.explicit&&t.explicit&&j(Sne(n,i,e.value,t.value)),{explicit:e.explicit,value:[...e.value,...t.value]}}function tue(e){const t=Vi(e.map(s=>{if(Rr(s)){const{sort:a,...u}=s;return u}return s}),be),n=Vi(e.map(s=>{if(Rr(s)){const a=s.sort;return a!==void 0&&!$c(a)&&("op"in a&&a.op==="count"&&delete a.field,a.order==="ascending"&&delete a.order),a}}).filter(s=>s!==void 0),be);if(t.length===0)return;if(t.length===1){const s=e[0];if(Rr(s)&&n.length>0){let a=n[0];if(n.length>1){j(iA);const u=n.filter(l=>X(l)&&"op"in l&&l.op!=="min");n.every(l=>X(l)&&"op"in l)&&u.length===1?a=u[0]:a=!0}else if(X(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=Vi(n.map(s=>$c(s)||!("op"in s)||K(s.op)&&J(_te,s.op)?s:(j($ne(s)),!0)),be);let r;i.length===1?r=i[0]:i.length>1&&(j(iA),r=!0);const o=Vi(e.map(s=>Rr(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 Zw(e){if(Rr(e)&&K(e.field))return e.field;if(Fte(e)){let t;for(const n of e.fields)if(Rr(n)&&K(n.field)){if(!t)t=n.field;else if(t!==n.field)return j(Ane),t}return j(kne),t}else if(Tte(e)){j(Cne);const t=e.fields[0];return K(t)?t:void 0}}function Zp(e,t){const i=e.component.scales[t].get("domains").map(r=>(Rr(r)&&(r.data=e.lookupDataSource(r.data)),r));return tue(i)}function kL(e){return Ku(e)||eE(e)?e.children.reduce((t,n)=>t.concat(kL(n)),KA(e)):KA(e)}function KA(e){return I(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=nue(r.range,o,n,e),h=Zp(e,n),g=a?Qoe(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 nue(e,t,n,i){if(tt(n)){if(la(e))return{step:{signal:`${t}_step`}}}else if(X(e)&&Rr(e))return{...e,data:i.lookupDataSource(e.data)};return e}class CL extends to{constructor(t,n){super({},{name:t}),this.merged=!1,this.setWithExplicit("type",n)}domainHasZero(){const t=this.get("type");if(ye([_t.LOG,_t.TIME,_t.UTC],t))return"definitely-not";const n=this.get("zero");if(n===!0||n===void 0&&ye([_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(L(a)){const u=a[0],l=a[a.length-1];if($e(u)&&$e(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 iue=["range","scheme"];function rue(e){const t=e.component.scales;for(const n of Q2){const i=t[n];if(!i)continue;const r=oue(n,e);i.setWithExplicit("range",r)}}function JA(e,t){const n=e.fieldDef(t);if(n!=null&&n.bin){const{bin:i,field:r}=n,o=Sn(t),s=e.getName(o);if(X(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(Ie(i)){const a=Yw(e,r,i);return new dt(()=>{const u=e.getSignalName(a),l=`(${u}.stop - ${u}.start) / ${u}.step`;return`${e.getSignalName(s)} / (${l})`})}}}function oue(e,t){const n=t.specifiedScales[e],{size:i}=t,o=t.getScaleComponent(e).get("type");for(const f of iue)if(n[f]!==void 0){const d=_y(o,f),h=EN(e,f);if(!d)j(tN(o,f,e));else if(h)j(h);else switch(f){case"range":{const g=n.range;if(L(g)){if(tt(e))return ji(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(X(g))return ji({data:t.requestDataName(Ke.Main),field:g.field,sort:{op:"min",field:t.vgField(e)}});return ji(g)}case"scheme":return ji(sue(n[f]))}}const s=e===qe||e==="xOffset"?"width":"height",a=i[s];if(ar(a)){if(tt(e))if(yt(o)){const f=TL(a,t,e);if(f)return ji({step:f})}else j(nN(s));else if(ff(e)){const f=e===Yo?"x":"y";if(t.getScaleComponent(f).get("type")==="band"){const g=ML(a,o);if(g)return ji(g)}}}const{rangeMin:u,rangeMax:l}=n,c=aue(e,t);return(u!==void 0||l!==void 0)&&_y(o,"rangeMin")&&L(c)&&c.length===2?ji([u??c[0],l??c[1]]):An(c)}function sue(e){return hie(e)?{scheme:e.name,...mn(e,["name"])}:{scheme:e}}function FL(e,t,n,{center:i}={}){const r=Sn(e),o=t.getName(r),s=t.getSignalName.bind(t);return e===vt&&Ei(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 aue(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 qe:case vt:{if(ye(["point","band"],u)){const f=OL(e,n,i.view);if(ar(f))return{step:TL(f,t,e)}}return FL(e,t,u)}case Yo:case qu:return uue(e,t,u);case Jr:{const f=fue(r,i),d=due(r,n,t,i);return yu(u)?cue(f,d,lue(u,i,l,e)):[f,d]}case ri:return[0,Math.PI*2];case sa:return[0,360];case Ti:return[0,new dt(()=>{const f=t.getSignalName(Nn(t.parent)?"child_width":"width"),d=t.getSignalName(Nn(t.parent)?"child_height":"height");return`min(${f},${d})/2`})];case Qo:return[i.scale.minStrokeWidth,i.scale.maxStrokeWidth];case Zo:return[[1,0],[4,2],[2,1],[1,1],[1,2,4,2]];case En:return"symbol";case wn:case pr:case mr:return u==="ordinal"?s==="nominal"?"category":"ordinal":c!==void 0?"diverging":r==="rect"||r==="geoshape"?"heatmap":"ramp";case Qr:case Ko:case Jo:return[i.scale.minOpacity,i.scale.maxOpacity]}}function TL(e,t,n){const{encoding:i}=t,r=t.getScaleComponent(n),o=X2(n),s=i[o];if(p5({step:e,offsetIsDiscrete:le(s)&&mN(s.type)})==="offset"&&YN(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-${Rte(f)})`}}else return e.step}function ML(e,t){if(p5({step:e,offsetIsDiscrete:yt(t)})==="offset")return{step:e.step}}function uue(e,t,n){const i=e===Yo?"x":"y",r=t.getScaleComponent(i);if(!r)return FL(i,t,n,{center:!0});const o=r.get("type"),s=t.scaleName(i),{markDef:a,config:u}=t;if(o==="band"){const l=OL(i,t.size,t.config.view);if(ar(l)){const c=ML(l,n);if(c)return c}return[0,{signal:`bandwidth('${s}')`}]}else{const l=t.encoding[i];if(W(l)&&l.timeUnit){const c=dN(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=ee(f)?`${f.signal}/2`+h:`${f/2+d}`,p=ee(f)?`(1 - ${f.signal}/2)`+h:`${1-f/2+d}`;return[{signal:`${g} * (${c})`},{signal:`${p} * (${c})`}]}return[0,{signal:c}]}return S3(`Cannot use ${e} scale if ${i} scale is not discrete.`)}}function OL(e,t,n){const i=e===qe?"width":"height",r=t[i];return r||eg(n,i)}function lue(e,t,n,i){switch(e){case"quantile":return t.scale.quantileCount;case"quantize":return t.scale.quantizeCount;case"threshold":return n!==void 0&&L(n)?n.length+1:(j(Pne(i)),3)}}function cue(e,t,n){const i=()=>{const r=pi(t),o=pi(e),s=`(${r} - ${o}) / (${n} - 1)`;return`sequence(${o}, ${r} + ${s}, ${s})`};return ee(t)?new dt(i):{signal:i()}}function fue(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(Tp("size",e))}const QA=.95;function due(e,t,n,i){const r={x:JA(n,"x"),y:JA(n,"y")};switch(e){case"bar":case"tick":{if(i.scale.maxBandSize!==void 0)return i.scale.maxBandSize;const o=ZA(t,r,i.view);return $e(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=ZA(t,r,i.view);return $e(o)?Math.pow(QA*o,2):new dt(()=>`pow(${QA} * ${o.signal}, 2)`)}}throw new Error(Tp("size",e))}function ZA(e,t,n){const i=ar(e.width)?e.width.step:Cy(n,"width"),r=ar(e.height)?e.height.step:Cy(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 DL(e,t){Ge(e)?hue(e,t):NL(e,t)}function hue(e,t){const n=e.component.scales,{config:i,encoding:r,markDef:o,specifiedScales:s}=e;for(const a of I(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=_y(h,t),y=EN(a,t);if(d!==void 0&&(m?y&&j(y):j(tN(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:Up(u[t],{type:v,timeUnit:b})},!0):l.set(t,u[t],!0);break;default:l.copyKeyFromObject(t,u)}}else{const b=B(ek,t)?ek[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:KN(r,a),hasSecondaryRangeChannel:!!r[yr(a)]}):i.scale[t];b!==void 0&&l.set(t,b,!1)}}}const ek={bins:({model:e,fieldOrDatumDef:t})=>W(t)?gue(e,t):void 0,interpolate:({channel:e,fieldOrDatumDef:t})=>pue(e,t.type),nice:({scaleType:e,channel:t,domain:n,domainMin:i,domainMax:r,fieldOrDatumDef:o})=>mue(e,t,n,i,r,o),padding:({channel:e,scaleType:t,fieldOrDatumDef:n,markDef:i,config:r})=>yue(e,t,r.scale,n,i,r.bar),paddingInner:({scalePadding:e,channel:t,markDef:n,scaleType:i,config:r,hasNestedOffsetScale:o})=>bue(e,t,n.type,i,r.scale,o),paddingOuter:({scalePadding:e,channel:t,scaleType:n,scalePaddingInner:i,config:r,hasNestedOffsetScale:o})=>vue(e,t,n,i,r.scale,o),reverse:({fieldOrDatumDef:e,scaleType:t,channel:n,config:i})=>{const r=W(e)?e.sort:void 0;return xue(t,r,n,i.scale)},zero:({channel:e,fieldOrDatumDef:t,domain:n,markDef:i,scaleType:r,config:o,hasSecondaryRangeChannel:s})=>wue(e,t,n,i,r,o.scale,s)};function RL(e){Ge(e)?rue(e):NL(e,"range")}function NL(e,t){const n=e.component.scales;for(const i of e.children)t==="range"?RL(i):DL(i,t);for(const i of I(n)){let r;for(const o of e.children){const s=o.component.scales[i];if(s){const a=s.getWithExplicit(t);r=Bo(r,a,t,"scale",C5((u,l)=>{switch(t){case"range":return u.step&&l.step?u.step-l.step:0}return 0}))}}n[i].setWithExplicit(t,r)}}function gue(e,t){const n=t.bin;if(Ie(n)){const i=Yw(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 pue(e,t){if(ye([wn,pr,mr],e)&&t!=="nominal")return"hcl"}function mue(e,t,n,i,r,o){var s;if(!((s=_i(o))!=null&&s.bin||L(n)||r!=null||i!=null||ye([_t.TIME,_t.UTC],e)))return tt(t)?!0:void 0}function yue(e,t,n,i,r,o){if(tt(e)){if(Xi(t)){if(n.continuousPadding!==void 0)return n.continuousPadding;const{type:s,orient:a}=r;if(s==="bar"&&!(W(i)&&(i.bin||i.timeUnit))&&(a==="vertical"&&e==="x"||a==="horizontal"&&e==="y"))return o.continuousBandSize}if(t===_t.POINT)return n.pointPadding}}function bue(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(ff(t)&&i===_t.BAND)return r.offsetBandPaddingInner}}function vue(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,ee(i)?{signal:`${i.signal}/2`}:i/2)}else if(ff(t)){if(n===_t.POINT)return .5;if(n===_t.BAND)return r.offsetBandPaddingOuter}}}function xue(e,t,n,i){if(n==="x"&&i.xReverse!==void 0)return Ei(e)&&t==="descending"?ee(i.xReverse)?{signal:`!${i.xReverse.signal}`}:!i.xReverse:i.xReverse;if(Ei(e)&&t==="descending")return!0}function wue(e,t,n,i,r,o,s){if(!!n&&n!=="unaggregated"&&Ei(r)){if(L(n)){const u=n[0],l=n[n.length-1];if($e(u)&&u<=0&&$e(l)&&l>=0)return!0}return!1}if(e==="size"&&t.type==="quantitative"&&!yu(r))return!0;if(!(W(t)&&t.bin)&&ye([...Zr,...mte],e)){const{orient:u,type:l}=i;return ye(["bar","area","line","trail"],l)&&(u==="horizontal"&&e==="y"||u==="vertical"&&e==="x")?!1:ye(["bar","area"],l)&&!s?!0:o==null?void 0:o.zero}return!1}function Eue(e,t,n,i,r=!1){const o=Sue(t,n,i,r),{type:s}=e;return br(t)?s!==void 0?xie(t,s)?W(n)&&!vie(s,n.type)?(j(wne(s,o)),o):s:(j(xne(t,s,o)),o):o:null}function Sue(e,t,n,i){var r;switch(t.type){case"nominal":case"ordinal":{if(Wa(e)||b0(e)==="discrete")return e==="shape"&&t.type==="ordinal"&&j(v0(e,"ordinal")),"ordinal";if(tt(e)||ff(e)){if(ye(["rect","bar","image","rule","tick"],n.type)||i)return"band"}else if(n.type==="arc"&&e in J2)return"band";const o=n[Sn(e)];return Vs(o)||vu(t)&&((r=t.axis)!=null&&r.tickBand)?"band":"point"}case"temporal":return Wa(e)?"time":b0(e)==="discrete"?(j(v0(e,"temporal")),"ordinal"):W(t)&&t.timeUnit&&mt(t.timeUnit).utc?"utc":"time";case"quantitative":return Wa(e)?W(t)&&Ie(t.bin)?"bin-ordinal":"linear":b0(e)==="discrete"?(j(v0(e,"quantitative")),"ordinal"):"linear";case"geojson":return}throw new Error(Z3(t.type))}function _ue(e,{ignoreRange:t}={}){LL(e),AL(e);for(const n of bie)DL(e,n);t||RL(e)}function LL(e){Ge(e)?e.component.scales=$ue(e):e.component.scales=kue(e)}function $ue(e){const{encoding:t,mark:n,markDef:i}=e,r={};for(const o of Q2){const s=at(t[o]);if(s&&n===$N&&o===En&&s.type===Hu)continue;let a=s&&s.scale;if(s&&a!==null&&a!==!1){a??(a={});const u=KN(t,o),l=Eue(a,o,s,i,u);r[o]=new CL(e.scaleName(`${o}`,!0),{value:l,explicit:a.type===l})}}return r}const Aue=C5((e,t)=>oA(e)-oA(t));function kue(e){var t;const n=e.component.scales={},i={},r=e.component.resolve;for(const o of e.children){LL(o);for(const s of I(o.component.scales))if((t=r.scale)[s]??(t[s]=hL(s,e)),r.scale[s]==="shared"){const a=i[s],u=o.component.scales[s].getWithExplicit("type");a?uie(a.value,u.value)?i[s]=Bo(a,u,"type","scale",Aue):(r.scale[s]="independent",delete i[s]):i[s]=u}}for(const o of I(i)){const s=e.scaleName(o,!0),a=i[o];n[o]=new CL(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 F0{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 Nn(e){return(e==null?void 0:e.type)==="facet"}function eE(e){return(e==null?void 0:e.type)==="concat"}function Ku(e){return(e==null?void 0:e.type)==="layer"}class tE{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=fo(t.title)?{text:t.title}:t.title?St(t.title):void 0,this.scaleNameMap=i?i.scaleNameMap:new F0,this.projectionNameMap=i?i.projectionNameMap:new F0,this.signalNameMap=i?i.signalNameMap:new F0,this.data=t.data,this.description=t.description,this.transforms=Roe(t.transform??[]),this.layout=n==="layer"||n==="unit"?{}:zre(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:zp(t)||(i==null?void 0:i.component.data.isFaceted)&&t.data===void 0},layoutSize:new to,layoutHeaders:{row:{},column:{},facet:{}},mark:null,resolve:{scale:{},axis:{},legend:{},...s?ue(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(){_ue(this)}parseProjection(){SL(this)}renameTopLevelLayoutSizeSignal(){this.getName("width")!=="width"&&this.renameSignal(this.getName("width"),"width"),this.getName("height")!=="height"&&this.renameSignal(this.getName("height"),"height")}parseLegends(){bL(this)}assembleEncodeFromView(t){const{style:n,...i}=t,r={};for(const o of I(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=Vse(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(Use(this,i));for(const i of Hw)n=n.concat(jse(this,i));return n}assembleAxes(){return Cse(this.component.axes,this.config)}assembleLegends(){return xL(this)}assembleProjections(){return mae(this)}assembleTitle(){const{encoding:t,...n}=this.title??{},i={...q3(this.config.title).nonMarkTitleProperties,...n,...t?{encode:{update:t}}:{}};if(i.text)return ye(["unit","layer"],this.type)?ye(["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||Nn(this.parent)?kL(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 We((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(Nn(this.parent)){const n=fL(t),i=kp(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=Zp(this,i),l=Zw(u);if(l){const c=V({aggregate:"distinct",field:l},{expr:"datum"});return{signal:cL(a,r,c)}}else return j(tw(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(L3(t)&&br(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(Ite(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 PL extends tE{vgField(t,n={}){const i=this.fieldDef(t);if(i)return V(i,n)}reduceFieldDef(t,n){return hre(this.getMapping(),(i,r,o)=>{const s=_i(r);return s?t(i,s,o):i},n)}forEachFieldDef(t,n){kw(this.getMapping(),(i,r)=>{const o=_i(i);o&&t(o,r)},n)}}class em extends Oe{clone(){return new em(null,ue(this.transform))}constructor(t,n){super(t),this.transform=n,this.transform=ue(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 ${be(this.transform)}`}assemble(){const{density:t,...n}=this.transform,i={type:"kde",field:t,...n};return i.resolve=this.transform.resolve,i}}class tm extends Oe{clone(){return new tm(null,ue(this.transform))}constructor(t,n){super(t),this.transform=n,this.transform=ue(n)}dependentFields(){return new Set([this.transform.extent])}producedFields(){return new Set([])}hash(){return`ExtentTransform ${be(this.transform)}`}assemble(){const{extent:t,param:n}=this.transform;return{type:"extent",field:t,signal:n}}}class nm extends Oe{clone(){return new nm(this.parent,ue(this.transform))}constructor(t,n){super(t),this.transform=n,this.transform=ue(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 ${be(this.transform)}`}assemble(){const{flatten:t,as:n}=this.transform;return{type:"flatten",fields:t,as:n}}}class im extends Oe{clone(){return new im(null,ue(this.transform))}constructor(t,n){super(t),this.transform=n,this.transform=ue(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 ${be(this.transform)}`}assemble(){const{fold:t,as:n}=this.transform;return{type:"fold",fields:t,as:n}}}class Ga extends Oe{clone(){return new Ga(null,ue(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,Mi],[ni,Di]]){const o=r.map(s=>{const a=at(n.encoding[s]);return W(a)?a.field:vr(a)?{expr:`${a.datum}`}:Si(a)?{expr:`${a.value}`}:void 0});(o[0]||o[1])&&(t=new Ga(t,o,null,n.getName(`geojson_${i++}`)))}if(n.channelHasField(En)){const r=n.typedFieldDef(En);r.type===Hu&&(t=new Ga(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} ${be(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 Oe{clone(){return new Fc(null,this.projection,ue(this.fields),ue(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,Mi],[ni,Di]]){const r=i.map(s=>{const a=at(n.encoding[s]);return W(a)?a.field:vr(a)?{expr:`${a.datum}`}:Si(a)?{expr:`${a.value}`}:void 0}),o=i[0]===ni?"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} ${be(this.fields)} ${be(this.as)}`}assemble(){return{type:"geopoint",projection:this.projection,fields:this.fields,as:this.as}}}class Os extends Oe{clone(){return new Os(null,ue(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 Os(t,n)}static makeFromEncoding(t,n){const i=n.encoding,r=i.x,o=i.y;if(W(r)&&W(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=ZN(n.mark,i);return new Os(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 ${be(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:poe(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 rm extends Oe{clone(){return new rm(null,ue(this.transform))}constructor(t,n){super(t),this.transform=n,this.transform=ue(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 ${be(this.transform)}`}assemble(){const{loess:t,on:n,...i}=this.transform;return{type:"loess",x:n,y:t,...i}}}class Tc extends Oe{clone(){return new Tc(null,ue(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(moe(s)){let u=BL(s.data,o);u||(u=new Js(s.data),o.push(u));const l=n.getName(`lookup_${r}`);a=new yn(u,l,Ke.Lookup,n.component.data.outputNodeRefCounts),n.component.data.outputNodes[l]=a}else if(yoe(s)){const u=s.param;i={as:u,...i};let l;try{l=n.getSelectionComponent(We(u),u)}catch{throw new Error(Wte(u))}if(a=l.materialized,!a)throw new Error(qte(u))}return new Tc(t,i,a.getSource())}dependentFields(){return new Set([this.transform.lookup])}producedFields(){return new Set(this.transform.as?Y(this.transform.as):this.transform.from.fields)}hash(){return`Lookup ${be({transform:this.transform,secondary:this.secondary})}`}assemble(){let t;if(this.transform.from.fields)t={values:this.transform.from.fields,...this.transform.as?{as:Y(this.transform.as)}:{}};else{let n=this.transform.as;K(n)||(j(Qte),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 om extends Oe{clone(){return new om(null,ue(this.transform))}constructor(t,n){super(t),this.transform=n,this.transform=ue(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 ${be(this.transform)}`}assemble(){const{quantile:t,...n}=this.transform;return{type:"quantile",field:t,...n}}}class sm extends Oe{clone(){return new sm(null,ue(this.transform))}constructor(t,n){super(t),this.transform=n,this.transform=ue(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 ${be(this.transform)}`}assemble(){const{regression:t,on:n,...i}=this.transform;return{type:"regression",x:n,y:t,...i}}}class am extends Oe{clone(){return new am(null,ue(this.transform))}constructor(t,n){super(t),this.transform=n}addDimensions(t){this.transform.groupby=Vi((this.transform.groupby??[]).concat(t),n=>n)}producedFields(){}dependentFields(){return new Set([this.transform.pivot,this.transform.value,...this.transform.groupby??[]])}hash(){return`PivotTransform ${be(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 um extends Oe{clone(){return new um(null,ue(this.transform))}constructor(t,n){super(t),this.transform=n}dependentFields(){return new Set}producedFields(){return new Set}hash(){return`SampleTransform ${be(this.transform)}`}assemble(){return{type:"sample",size:this.transform.sample}}}function zL(e){let t=0;function n(i,r){if(i instanceof Js&&!i.isGenerator&&!wu(i.data)&&(e.push(r),r={name:null,source:r.name,transform:[]}),i instanceof Ut&&(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 Xu){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 wf||i instanceof Ef||i instanceof Au||i instanceof Vu||i instanceof Su||i instanceof Fc||i instanceof bi||i instanceof Tc||i instanceof Yu||i instanceof ga||i instanceof im||i instanceof nm||i instanceof em||i instanceof rm||i instanceof om||i instanceof sm||i instanceof jo||i instanceof um||i instanceof am||i instanceof tm)&&r.transform.push(i.assemble()),(i instanceof Qi||i instanceof Ji||i instanceof Os||i instanceof Ur||i instanceof Ga)&&r.transform.push(...i.assemble()),i instanceof yn&&(r.source&&r.transform.length===0?i.setSource(r.source):i.parent instanceof yn?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 yn&&(!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 Cue(e){const t=[],n=zL(t);for(const i of e.children)n(i,{source:e.name,name:null,transform:[]});return t}function Fue(e,t){const n=[],i=zL(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 Tue(e){return e==="top"||e==="left"||ee(e)?"header":"footer"}function Mue(e){for(const t of Xn)Oue(e,t);tk(e,"x"),tk(e,"y")}function Oue(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=L(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=ye(["bottom","right"],c)?"footer":"header";o.layoutHeaders[t]={title:a.header!==null?l:null,facetFieldDef:a,[d]:t==="facet"?[]:[IL(e,t,f)]}}}function IL(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 tk(e,t){const{child:n}=e;if(n.component.axes[t]){const{layoutHeaders:i,resolve:r}=e.component;if(r.axis[t]=Xw(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=Tue(a.get("orient"));s[u]??(s[u]=[IL(e,o,!1)]);const l=Bl(a,"main",e.config,{header:!0});l&&s[u][0].axes.push(l),a.mainExtracted=!0}}}}function Due(e){nE(e),rg(e,"width"),rg(e,"height")}function Rue(e){nE(e);const t=e.layout.columns===1?"width":"childWidth",n=e.layout.columns===void 0?"height":"childHeight";rg(e,t),rg(e,n)}function nE(e){for(const t of e.children)t.parseLayoutSize()}function rg(e,t){const n=fL(t),i=kp(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]??hL(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=Bo(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 Nue(e){const{size:t,component:n}=e;for(const i of Zr){const r=Sn(i);if(t[r]){const o=t[r];n.layoutSize.set(r,ar(o)?"step":o,!0)}else{const o=Lue(e,r);n.layoutSize.set(r,o,!1)}}}function Lue(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=eg(i.view,t);return la(s)||ar(a)?"step":a}else return ky(i.view,t)}else{if(e.hasProjection||e.mark==="arc")return ky(i.view,t);{const o=eg(i.view,t);return ar(o)?o.step:o}}}function Wy(e,t,n){return V(t,{suffix:`by_${V(e)}`,...n})}class nc extends PL{constructor(t,n,i,r){super(t,"facet",n,i,r,t.resolve),this.child=aE(t.spec,this,this.getName("child"),void 0,r),this.children=[this.child],this.facet=this.initFacet(t.facet)}initFacet(t){if(!pf(t))return{facet:this.initFacetFieldDef(t,"facet")};const n=I(t),i={};for(const r of n){if(![Pr,zr].includes(r)){j(Tp(r,"facet"));break}const o=t[r];if(o.field===void 0){j(Ey(o,r));break}i[r]=this.initFacetFieldDef(o,r)}return i}initFacetFieldDef(t,n){const i=Aw(t,n);return i.header?i.header=St(i.header):i.header===null&&(i.header=null),i}channelHasField(t){return B(this.facet,t)}fieldDef(t){return this.facet[t]}parseData(){this.component.data=lm(this),this.child.parseData()}parseLayoutSize(){nE(this)}parseSelections(){this.child.parseSelections(),this.component.selection=this.child.component.selection}parseMarkGroup(){this.child.parseMarkGroup()}parseAxesAndHeaders(){this.child.parseAxesAndHeaders(),Mue(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 Gw){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=Jp(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 nc))return{signal:`length(data('${this.getName("column_domain")}'))`}}assembleGroupStyle(){}assembleGroup(t){return this.parent&&this.parent instanceof nc?{...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 nc){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 Zr){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=Zp(this.child,r),l=Zw(u);l?(t.push(l),n.push("distinct"),i.push(`distinct_${l}`)):j(tw(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(Ie(d)&&u.push(V(f,{binSuffix:"end"})),Ir(h)){const{field:g,op:p=Pp}=h,m=Wy(f,h);i&&r?(o.push(m),s.push("max"),a.push(m)):(o.push(g),s.push(p),a.push(m))}else if(L(h)){const g=_u(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)?[Wy(i,i.sort,{expr:"datum"})]:L(i.sort)?[_u(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:!L(r)&&r)||"ascending"]}return[]}assembleLabelTitle(){var r;const{facet:t,config:n}=this;if(t.facet)return Ly(t.facet,"facet",n);const i={row:["top","bottom"],column:["left","right"]};for(const o of Hw)if(t[o]){const s=$u("labelOrient",(r=t[o])==null?void 0:r.header,n,o);if(i[o].includes(s))return Ly(t[o],o,n)}}assembleMarks(){const{child:t}=this,n=this.component.data.facetRoot,i=Cue(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(Xoe(this,[]))}]}getMapping(){return this.facet}}function Pue(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=Pp}=o.sort;e=r=new ga(e,{joinaggregate:[{op:a,field:s,as:Wy(o,o.sort,{forAs:!0})}],groupby:[V(o)]})}return r}return null}function BL(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(On(e.values,a.values))return s}else if(wu(e)&&wu(a)){if(e.url===a.url)return s}else if(F5(e)&&e.name===s.dataName)return s}}return null}function zue(e,t){if(e.data||!e.parent){if(e.data===null){const i=new Js({values:[]});return t.push(i),i}const n=BL(e.data,t);if(n)return Fo(e.data)||(n.data.format=_3({},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 Iue(e,t,n){let i=0;for(const r of t.transforms){let o,s;if(koe(r))s=e=new Su(e,r),o="derived";else if(zw(r)){const a=Fae(r);s=e=Ut.makeWithAncestors(e,{},a,n)??e,e=new Vu(e,t,r.filter)}else if(_5(r))s=e=Qi.makeFromTransform(e,r,t),o="number";else if(Foe(r))o="date",n.getWithExplicit(r.field).value===void 0&&(e=new Ut(e,{[r.field]:o}),n.set(r.field,o,!1)),s=e=Ji.makeFromTransform(e,r);else if(Toe(r))s=e=bi.makeFromTransform(e,r),o="number",qw(t)&&(e=new jo(e));else if(S5(r))s=e=Tc.make(e,t,r,i++),o="derived";else if(_oe(r))s=e=new Yu(e,r),o="number";else if($oe(r))s=e=new ga(e,r),o="number";else if(Moe(r))s=e=Ur.makeFromTransform(e,r),o="derived";else if(Ooe(r))s=e=new im(e,r),o="derived";else if(Doe(r))s=e=new tm(e,r),o="derived";else if(Aoe(r))s=e=new nm(e,r),o="derived";else if(boe(r))s=e=new am(e,r),o="derived";else if(Soe(r))e=new um(e,r);else if(Coe(r))s=e=Os.makeFromTransform(e,r),o="derived";else if(voe(r))s=e=new em(e,r),o="derived";else if(xoe(r))s=e=new om(e,r),o="derived";else if(woe(r))s=e=new sm(e,r),o="derived";else if(Eoe(r))s=e=new rm(e,r),o="derived";else{j(Jte(r));continue}if(s&&o!==void 0)for(const a of s.producedFields()??[])n.set(a,o,!1)}return e}function lm(e){var m;let t=zue(e,e.component.data.sources);const{outputNodes:n,outputNodeRefCounts:i}=e.component.data,r=e.data,s=!(r&&(Fo(r)||wu(r)||Cc(r)))&&e.parent?e.parent.component.data.ancestorParse.clone():new Hoe;Fo(r)?(T5(r)?t=new Ef(t,r.sequence):Iw(r)&&(t=new wf(t,r.graticule)),s.parseNothing=!0):((m=r==null?void 0:r.format)==null?void 0:m.parse)===null&&(s.parseNothing=!0),t=Ut.makeExplicit(t,e,s)??t,t=new jo(t);const a=e.parent&&Ku(e.parent);(Ge(e)||Nn(e))&&a&&(t=Qi.makeFromEncoding(t,e)??t),e.transforms.length>0&&(t=Iue(t,e,s));const u=Mae(e),l=Tae(e);t=Ut.makeWithAncestors(t,{},{...u,...l},s)??t,Ge(e)&&(t=Ga.parseAll(t,e),t=Fc.parseAll(t,e)),(Ge(e)||Nn(e))&&(a||(t=Qi.makeFromEncoding(t,e)??t),t=Ji.makeFromEncoding(t,e)??t,t=Su.parseAllForSortIndex(t,e));const c=t=ed(Ke.Raw,e,t);if(Ge(e)){const y=bi.makeFromEncoding(t,e);y&&(t=y,qw(e)&&(t=new jo(t))),t=Os.makeFromEncoding(t,e)??t,t=Ur.makeFromEncoding(t,e)??t}let f,d;if(Ge(e)){const{markDef:y,mark:b,config:v}=e,x=De("invalid",y,v),{marks:E,scales:S}=d=O5({invalid:x,isPath:ts(b)});E!==S&&S==="include-invalid-values"&&(f=t=ed(Ke.PreFilterInvalid,e,t)),E==="exclude-invalid-values"&&(t=Au.make(t,e,d)??t)}const h=t=ed(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=ed(Ke.PostFilterInvalid,e,t))}Ge(e)&&Ase(e,h);let p=null;if(Nn(e)){const y=e.getName("facet");t=Pue(t,e.facet)??t,p=new Xu(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 ed(e,t,n){const{outputNodes:i,outputNodeRefCounts:r}=t.component.data,o=t.getDataName(e),s=new yn(n,o,e,r);return i[o]=s,s}class Bue extends tE{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(Xte),this.children=this.getChildren(t).map((l,c)=>aE(l,this,this.getName(`concat_${c}`),void 0,r))}parseData(){this.component.data=lm(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 I(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:Lw(t)?t.hconcat:t.concat}parseLayoutSize(){Rue(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=Vw(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 Uue(e){return e===!1||e===null}const jue={disable:1,gridScale:1,scale:1,...VN,labelExpr:1,encode:1},UL=I(jue);class iE extends to{constructor(t={},n={},i=!1){super(),this.explicit=t,this.implicit=n,this.mainExtracted=i}clone(){return new iE(ue(this.explicit),ue(this.implicit),this.mainExtracted)}hasAxisPart(t){return t==="axis"?!0:t==="grid"||t==="title"?!!this.get(t):!Uue(this.get(t))}hasOrientSignalRef(){return ee(this.explicit.orient)}}function Wue(e,t,n){const{encoding:i,config:r}=e,o=at(i[t])??at(i[yr(t)]),s=e.axis(t)||{},{format:a,formatType:u}=s;if(Xs(u))return{text:mi({fieldOrDatumDef:o,field:"datum.value",format:a,formatType:u,config:r}),...n};if(a===void 0&&u===void 0&&r.customFormatTypes){if(bu(o)==="quantitative"){if(vu(o)&&o.stack==="normalize"&&r.normalizedNumberFormatType)return{text:mi({fieldOrDatumDef:o,field:"datum.value",format:r.normalizedNumberFormat,formatType:r.normalizedNumberFormatType,config:r}),...n};if(r.numberFormatType)return{text:mi({fieldOrDatumDef:o,field:"datum.value",format:r.numberFormat,formatType:r.numberFormatType,config:r}),...n}}if(bu(o)==="temporal"&&r.timeFormatType&&W(o)&&!o.timeUnit)return{text:mi({fieldOrDatumDef:o,field:"datum.value",format:r.timeFormat,formatType:r.timeFormatType,config:r}),...n}}return n}function que(e){return Zr.reduce((t,n)=>(e.component.scales[n]&&(t[n]=[Jue(n,e)]),t),{})}const Hue={bottom:"top",top:"bottom",left:"right",right:"left"};function Gue(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 I(r.component.axes))n.axis[o]=Xw(e.component.resolve,o),n.axis[o]==="shared"&&(t[o]=Vue(t[o],r.component.axes[o]),t[o]||(n.axis[o]="independent",delete t[o]))}for(const r of Zr){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(!ee(a)){if(i[a]>0&&!u){const l=Hue[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 Vue(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]=Xue(r,o)}}}else return t.map(n=>n.clone());return e}function Xue(e,t){for(const n of UL){const i=Bo(e.getWithExplicit(n),t.getWithExplicit(n),n,"axis",(r,o)=>{switch(n){case"title":return J3(r,o);case"gridScale":return{explicit:r.explicit,value:et(r.value,o.value)}}return Gp(r,o,n,"axis")});e.setWithExplicit(n,i)}return e}function Yue(e,t,n,i,r){if(t==="disable")return n!==void 0;switch(n=n||{},t){case"titleAngle":case"labelAngle":return e===(ee(n.labelAngle)?n.labelAngle:Ac(n.labelAngle));case"values":return!!n.values;case"encode":return!!n.encoding||!!n.labelAngle;case"title":if(e===sL(i,r))return!0}return e===n[t]}const Kue=new Set(["grid","translate","format","formatType","orient","labelExpr","tickCount","position","tickMinStep"]);function Jue(e,t){var y,b;let n=t.axis(e);const i=new iE,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)||Lse(e),u=t.getScaleComponent(e).get("type"),l=Fse(e,u,a,t.config),c=n!==void 0?!n:Ry("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=Dse(r,n,e,s.style,l),d=DN(n.formatType,r,u),h=ON(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 UL){const x=v in BA?BA[v](g):dA(v)?n[v]:void 0,E=x!==void 0,S=Yue(x,v,n,t,e);if(E&&S)i.set(v,x,S);else{const{configValue:w=void 0,configFrom:_=void 0}=dA(v)&&v!=="values"?Ry(v,s.style,n.style,l):{},$=w!==void 0;E&&!$?i.set(v,x,S):(_!=="vgAxisConfig"||Kue.has(v)&&$||vf(w)||ee(w))&&i.set(v,w,!1)}}const p=n.encoding??{},m=GN.reduce((v,x)=>{if(!i.hasAxisPart(x))return v;const E=dL(p[x]??{},t),S=x==="labels"?Wue(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 Que({encoding:e,size:t}){for(const n of Zr){const i=Sn(n);ar(t[i])&&So(e[n])&&(delete t[i],j(nN(i)))}return t}const Zue={vgMark:"arc",encodeEntry:e=>({...oi(e,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore",theta:"ignore"}),...rn("x",e,{defaultPos:"mid"}),...rn("y",e,{defaultPos:"mid"}),...Gr(e,"radius"),...Gr(e,"theta")})},ele={vgMark:"area",encodeEntry:e=>({...oi(e,{align:"ignore",baseline:"ignore",color:"include",orient:"include",size:"ignore",theta:"ignore"}),...tg("x",e,{defaultPos:"zeroOrMin",defaultPos2:"zeroOrMin",range:e.markDef.orient==="horizontal"}),...tg("y",e,{defaultPos:"zeroOrMin",defaultPos2:"zeroOrMin",range:e.markDef.orient==="vertical"}),...Ww(e)})},tle={vgMark:"rect",encodeEntry:e=>({...oi(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...Gr(e,"x"),...Gr(e,"y")})},nle={vgMark:"shape",encodeEntry:e=>({...oi(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&&W(n)&&n.type===Hu?{field:V(n,{expr:"datum"})}:{}}]}},ile={vgMark:"image",encodeEntry:e=>({...oi(e,{align:"ignore",baseline:"ignore",color:"ignore",orient:"ignore",size:"ignore",theta:"ignore"}),...Gr(e,"x"),...Gr(e,"y"),...Uw(e,"url")})},rle={vgMark:"line",encodeEntry:e=>({...oi(e,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore",theta:"ignore"}),...rn("x",e,{defaultPos:"mid"}),...rn("y",e,{defaultPos:"mid"}),...$t("size",e,{vgChannel:"strokeWidth"}),...Ww(e)})},ole={vgMark:"trail",encodeEntry:e=>({...oi(e,{align:"ignore",baseline:"ignore",color:"include",size:"include",orient:"ignore",theta:"ignore"}),...rn("x",e,{defaultPos:"mid"}),...rn("y",e,{defaultPos:"mid"}),...$t("size",e),...Ww(e)})};function rE(e,t){const{config:n}=e;return{...oi(e,{align:"ignore",baseline:"ignore",color:"include",size:"include",orient:"ignore",theta:"ignore"}),...rn("x",e,{defaultPos:"mid"}),...rn("y",e,{defaultPos:"mid"}),...$t("size",e),...$t("angle",e),...sle(e,n,t)}}function sle(e,t,n){return n?{shape:{value:n}}:$t("shape",e)}const ale={vgMark:"symbol",encodeEntry:e=>rE(e)},ule={vgMark:"symbol",encodeEntry:e=>rE(e,"circle")},lle={vgMark:"symbol",encodeEntry:e=>rE(e,"square")},cle={vgMark:"rect",encodeEntry:e=>({...oi(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...Gr(e,"x"),...Gr(e,"y")})},fle={vgMark:"rule",encodeEntry:e=>{const{markDef:t}=e,n=t.orient;return!e.encoding.x&&!e.encoding.y&&!e.encoding.latitude&&!e.encoding.longitude?{}:{...oi(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...tg("x",e,{defaultPos:n==="horizontal"?"zeroOrMax":"mid",defaultPos2:"zeroOrMin",range:n!=="vertical"}),...tg("y",e,{defaultPos:n==="vertical"?"zeroOrMax":"mid",defaultPos2:"zeroOrMin",range:n!=="horizontal"}),...$t("size",e,{vgChannel:"strokeWidth"})}}},dle={vgMark:"text",encodeEntry:e=>{const{config:t,encoding:n}=e;return{...oi(e,{align:"include",baseline:"include",color:"include",size:"ignore",orient:"ignore",theta:"include"}),...rn("x",e,{defaultPos:"mid"}),...rn("y",e,{defaultPos:"mid"}),...Uw(e),...$t("size",e,{vgChannel:"fontSize"}),...$t("angle",e),...LA("align",hle(e.markDef,n,t)),...LA("baseline",gle(e.markDef,n,t)),...rn("radius",e,{defaultPos:null}),...rn("theta",e,{defaultPos:null})}}};function hle(e,t,n){if(De("align",e,n)===void 0)return"center"}function gle(e,t,n){if(De("baseline",e,n)===void 0)return"middle"}const ple={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{...oi(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...Gr(e,r),...rn(o,e,{defaultPos:"mid",vgChannel:o==="y"?"yc":"xc"}),[s]:Ue(De("thickness",n,t))}}},td={arc:Zue,area:ele,bar:tle,circle:ule,geoshape:nle,image:ile,line:rle,point:ale,rect:cle,rule:fle,square:lle,text:dle,tick:ple,trail:ole};function mle(e){if(ye([Np,Dp,_ie],e.mark)){const t=ZN(e.mark,e.encoding);if(t.length>0)return yle(e,t)}else if(e.mark===Rp){const t=xy.some(n=>De(n,e.markDef,e.config));if(e.stack&&!e.fieldDef("size")&&t)return ble(e)}return oE(e)}const nk="faceted_path_";function yle(e,t){return[{name:e.getName("pathgroup"),type:"group",from:{facet:{name:nk+e.requestDataName(Ke.Main),data:e.requestDataName(Ke.Main),groupby:t}},encode:{update:{width:{field:{group:"width"}},height:{field:{group:"height"}}}},marks:oE(e,{fromPrefix:nk})}]}const ik="stack_group_";function ble(e){var l;const[t]=oE(e,{fromPrefix:ik}),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={...fu(t.encode.update,["y","yc","y2","height",...xy]),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={...mn(t.encode.update,["y","yc","y2"]),height:{field:{group:"height"}}}):(o={...fu(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={...mn(t.encode.update,["x","xc","x2"]),width:{field:{group:"width"}}});for(const c of xy){const f=or(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=or(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:ik+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 vle(e){const{encoding:t,stack:n,mark:i,markDef:r,config:o}=e,s=t.order;if(!(!L(s)&&Si(s)&&by(s.value)||!s&&by(De("order",r,o)))){if((L(s)||W(s))&&!n)return X3(s,{expr:"datum"});if(ts(i)){const a=r.orient==="horizontal"?"y":"x",u=t[a];if(W(u))return{field:a}}}}function oE(e,t={fromPrefix:""}){const{mark:n,markDef:i,encoding:r,config:o}=e,s=et(i.clip,xle(e),wle(e)),a=G3(i),u=r.key,l=vle(e),c=Ele(e),f=De("aria",i,o),d=td[n].postEncodingTransform?td[n].postEncodingTransform(e):null;return[{name:e.getName("marks"),type:td[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:td[n].encodeEntry(e)},...d?{transform:d}:{}}]}function xle(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 wle(e){const t=e.component.projection;return t&&!t.isFit?!0:void 0}function Ele(e){if(!e.component.selection)return null;const t=I(e.component.selection).length;let n=t,i=e.parent;for(;i&&n===0;)n=I(i.component.selection).length,i=i.parent;return n?{interactive:t>0||e.mark==="geoshape"||!!e.encoding.tooltip||!!e.markDef.tooltip}:null}class jL extends PL{constructor(t,n,i,r={},o){super(t,"unit",n,i,o,void 0,gA(t)?t.view:void 0),this.specifiedScales={},this.specifiedAxes={},this.specifiedLegends={},this.specifiedProjection={},this.selection=[],this.children=[];const s=sr(t.mark)?{...t.mark}:{type:t.mark},a=s.type;s.filled===void 0&&(s.filled=aoe(s,o,{graticule:t.data&&Iw(t.data)}));const u=this.encoding=fre(t.encoding||{},a,s.filled,o);this.markDef=x5(s,u,o),this.size=Que({encoding:u,size:gA(t)?{...r,...t.width?{width:t.width}:{},...t.height?{height:t.height}:{}}:r}),this.stack=v5(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=>Rw(l))}get hasProjection(){const{encoding:t}=this,n=this.mark===$N,i=t&&ate.some(r=>le(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 Q2.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 L(n)&&(r.domain=n.map(Fn)),L(i)&&(r.range=i.map(Fn)),r}initAxes(t){return Zr.reduce((n,i)=>{const r=t[i];if(le(r)||i===qe&&le(t.x2)||i===vt&&le(t.y2)){const o=le(r)?r.axis:void 0;n[i]=o&&this.initAxis({...o})}return n},{})}initAxis(t){const n=I(t),i={};for(const r of n){const o=t[r];i[r]=vf(o)?H3(o):Fn(o)}return i}initLegends(t){return yte.reduce((n,i)=>{const r=at(t[i]);if(r&&vte(i)){const o=r.legend;n[i]=o&&St(o)}return n},{})}parseData(){this.component.data=lm(this)}parseLayoutSize(){Nue(this)}parseSelections(){this.component.selection=$se(this,this.selection)}parseMarkGroup(){this.component.mark=mle(this)}parseAxesAndHeaders(){this.component.axes=que(this)}assembleSelectionTopLevelSignals(t){return Yoe(this,t)}assembleSignals(){return[...iL(this),...Voe(this,[])]}assembleSelectionData(t){return Koe(this,t)}assembleLayout(){return null}assembleLayoutSignals(){return Vw(this)}assembleMarks(){let t=this.component.mark??[];return(!this.parent||!Ku(this.parent))&&(t=R5(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 Ts(this.encoding,t)}fieldDef(t){const n=this.encoding[t];return _i(n)}typedFieldDef(t){const n=this.fieldDef(t);return ln(n)?n:null}}class sE extends tE{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(Hp(a))return new sE(a,this,this.getName(`layer_${u}`),s,o);if(eo(a))return new jL(a,this,this.getName(`layer_${u}`),s,o);throw new Error(ew(a))})}parseData(){this.component.data=lm(this);for(const t of this.children)t.parseData()}parseLayoutSize(){Due(this)}parseSelections(){this.component.selection={};for(const t of this.children){t.parseSelections();for(const n of I(t.component.selection))this.component.selection[n]=t.component.selection[n]}}parseMarkGroup(){for(const t of this.children)t.parseMarkGroup()}parseAxesAndHeaders(){Gue(this)}assembleSelectionTopLevelSignals(t){return this.children.reduce((n,i)=>i.assembleSelectionTopLevelSignals(n),t)}assembleSignals(){return this.children.reduce((t,n)=>t.concat(n.assembleSignals()),iL(this))}assembleLayoutSignals(){return this.children.reduce((t,n)=>t.concat(n.assembleLayoutSignals()),Vw(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 Y(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 Joe(this,this.children.flatMap(t=>t.assembleMarks()))}assembleLegends(){return this.children.reduce((t,n)=>t.concat(n.assembleLegends()),xL(this))}}function aE(e,t,n,i,r){if(zp(e))return new nc(e,t,n,r);if(Hp(e))return new sE(e,t,n,i,r);if(eo(e))return new jL(e,t,n,i,r);if(Nre(e))return new Bue(e,t,n,r);throw new Error(ew(e))}function Sle(e,t={}){t.logger&&zne(t.logger),t.fieldTitle&&WN(t.fieldTitle);try{const n=b5(Fu(t.config,e.config)),i=k5(e,n),r=aE(i,null,"",void 0,n);return r.parse(),Vae(r.component.data,r),{spec:$le(r,_le(e,i.autosize,n,r),e.datasets,e.usermeta),normalized:i}}finally{t.logger&&Ine(),t.fieldTitle&&nre()}}function _le(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&&joe(t.type)){if(r==="step"&&o==="step")j(Q$()),t.type="pad";else if(r==="step"||o==="step"){const s=r==="step"?"width":"height";j(Q$(kp(s)));const a=s==="width"?"height":"width";t.type=Woe(a)}}return{...I(t).length===1&&t.type?t.type==="pad"?{}:{autosize:t.type}:{autosize:t},...AA(n,!1),...AA(e,!0)}}function $le(e,t,n={},i){const r=e.config?Yre(e.config):void 0,o=[].concat(e.assembleSelectionData([]),Fue(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([]),...g5(f)]),...r?{config:r}:{},...i?{usermeta:i}:{}}}const Ale=tte.version,kle=Object.freeze(Object.defineProperty({__proto__:null,accessPathDepth:hu,accessPathWithDatum:q2,compile:Sle,contains:ye,deepEqual:On,deleteNestedProperty:Hh,duplicate:ue,entries:Po,every:U2,fieldIntersection:W2,flatAccessWithDatum:A3,getFirstDefined:et,hasIntersection:j2,hasProperty:B,hash:be,internalField:F3,isBoolean:$c,isEmpty:Re,isEqual:ite,isInternalField:T3,isNullOrFalse:by,isNumeric:wp,keys:I,logicalExpr:ec,mergeDeep:_3,never:S3,normalize:k5,normalizeAngle:Ac,omit:mn,pick:fu,prefixGenerator:vy,removePathFromField:Wu,replaceAll:Ws,replacePathInField:ti,resetIdCounter:ote,setEqual:$3,some:du,stringify:Ne,titleCase:uf,unique:Vi,uniqueId:C3,vals:Ft,varName:We,version:Ale},Symbol.toStringTag,{value:"Module"}));function WL(e){const[t,n]=/schema\/([\w-]+)\/([\w\.\-]+)\.json$/g.exec(e).slice(1,3);return{library:t,version:n}}var Cle="2.15.0",Fle={version:Cle};const ka="#fff",rk="#888",Tle={background:"#333",view:{stroke:rk},title:{color:ka,subtitleColor:ka},style:{"guide-label":{fill:ka},"guide-title":{fill:ka}},axis:{domainColor:ka,gridColor:rk,tickColor:ka}},as="#4572a7",Mle={background:"#fff",arc:{fill:as},area:{fill:as},line:{stroke:as,strokeWidth:2},path:{stroke:as},rect:{fill:as},shape:{stroke:as},symbol:{fill:as,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"]}},us="#30a2da",T0="#cbcbcb",Ole="#999",Dle="#333",ok="#f0f0f0",sk="#333",Rle={arc:{fill:us},area:{fill:us},axis:{domainColor:T0,grid:!0,gridColor:T0,gridWidth:1,labelColor:Ole,labelFontSize:10,titleColor:Dle,tickColor:T0,tickSize:10,titleFontSize:14,titlePadding:10,labelPadding:4},axisBand:{grid:!1},background:ok,group:{fill:ok},legend:{labelColor:sk,labelFontSize:11,padding:1,symbolSize:30,symbolType:"square",titleColor:sk,titleFontSize:14,titlePadding:10},line:{stroke:us,strokeWidth:2},path:{stroke:us,strokeWidth:.5},rect:{fill:us},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:us},bar:{binSpacing:2,fill:us,stroke:null},title:{anchor:"start",fontSize:24,fontWeight:600,offset:20}},ls="#000",Nle={group:{fill:"#e5e5e5"},arc:{fill:ls},area:{fill:ls},line:{stroke:ls},path:{stroke:ls},rect:{fill:ls},shape:{stroke:ls},symbol:{fill:ls,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"]}},Lle=22,Ple="normal",ak="Benton Gothic, sans-serif",uk=11.5,zle="normal",cs="#82c6df",M0="Benton Gothic Bold, sans-serif",lk="normal",ck=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"]},Ile={background:"#ffffff",title:{anchor:"start",color:"#000000",font:M0,fontSize:Lle,fontWeight:Ple},arc:{fill:cs},area:{fill:cs},line:{stroke:cs,strokeWidth:2},path:{stroke:cs},rect:{fill:cs},shape:{stroke:cs},symbol:{fill:cs,size:30},axis:{labelFont:ak,labelFontSize:uk,labelFontWeight:zle,titleFont:M0,titleFontSize:ck,titleFontWeight:lk},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:ak,labelFontSize:uk,symbolType:"square",titleFont:M0,titleFontSize:ck,titleFontWeight:lk},range:{category:bl["category-6"],diverging:bl["fireandice-6"],heatmap:bl["fire-7"],ordinal:bl["fire-7"],ramp:bl["fire-7"]}},fs="#ab5787",nd="#979797",Ble={background:"#f9f9f9",arc:{fill:fs},area:{fill:fs},line:{stroke:fs},path:{stroke:fs},rect:{fill:fs},shape:{stroke:fs},symbol:{fill:fs,size:30},axis:{domainColor:nd,domainWidth:.5,gridWidth:.2,labelColor:nd,tickColor:nd,tickWidth:.2,titleColor:nd},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"]}},ds="#3e5c69",Ule={background:"#fff",arc:{fill:ds},area:{fill:ds},line:{stroke:ds},path:{stroke:ds},rect:{fill:ds},shape:{stroke:ds},symbol:{fill:ds},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"]}},jn="#1696d2",fk="#000000",jle="#FFFFFF",id="Lato",O0="Lato",Wle="Lato",qle="#DEDDDD",Hle=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"]},Gle={background:jle,title:{anchor:"start",fontSize:Hle,font:id},axisX:{domain:!0,domainColor:fk,domainWidth:1,grid:!1,labelFontSize:12,labelFont:O0,labelAngle:0,tickColor:fk,tickSize:5,titleFontSize:12,titlePadding:10,titleFont:id},axisY:{domain:!1,domainWidth:1,grid:!0,gridColor:qle,gridWidth:1,labelFontSize:12,labelFont:O0,labelPadding:8,ticks:!1,titleFontSize:12,titlePadding:10,titleFont:id,titleAngle:0,titleY:-10,titleX:18},legend:{labelFontSize:12,labelFont:O0,symbolSize:100,titleFontSize:12,titlePadding:10,titleFont:id,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:jn},rect:{fill:jn},line:{color:jn,stroke:jn,strokeWidth:5},trail:{color:jn,stroke:jn,strokeWidth:0,size:1},path:{stroke:jn,strokeWidth:.5},point:{filled:!0},text:{font:Wle,color:jn,fontSize:11,align:"center",fontWeight:400,size:11},style:{bar:{fill:jn,stroke:null}},arc:{fill:jn},shape:{stroke:jn},symbol:{fill:jn,size:30}},hs="#3366CC",dk="#ccc",rd="Arial, sans-serif",Vle={arc:{fill:hs},area:{fill:hs},path:{stroke:hs},rect:{fill:hs},shape:{stroke:hs},symbol:{stroke:hs},circle:{fill:hs},background:"#fff",padding:{top:10,right:10,bottom:10,left:10},style:{"guide-label":{font:rd,fontSize:12},"guide-title":{font:rd,fontSize:12},"group-title":{font:rd,fontSize:12}},title:{font:rd,fontSize:14,fontWeight:"bold",dy:-3,anchor:"start"},axis:{gridColor:dk,tickColor:dk,domain:!1,grid:!0},range:{category:["#4285F4","#DB4437","#F4B400","#0F9D58","#AB47BC","#00ACC1","#FF7043","#9E9D24","#5C6BC0","#F06292","#00796B","#C2185B"],heatmap:["#c6dafc","#5e97f6","#2a56c6"]}},uE=e=>e*(1/3+1),hk=uE(9),gk=uE(10),pk=uE(12),xl="Segoe UI",mk="wf_standard-font, helvetica, arial, sans-serif",yk="#252423",wl="#605E5C",bk="transparent",Xle="#C8C6C4",ui="#118DFF",Yle="#12239E",Kle="#E66C37",Jle="#6B007B",Qle="#E044A7",Zle="#744EC2",ece="#D9B300",tce="#D64550",qL=ui,HL="#DEEFFF",vk=[HL,qL],nce=[HL,"#c7e4ff","#b0d9ff","#9aceff","#83c3ff","#6cb9ff","#55aeff","#3fa3ff","#2898ff",qL],ice={view:{stroke:bk},background:bk,font:xl,header:{titleFont:mk,titleFontSize:pk,titleColor:yk,labelFont:xl,labelFontSize:gk,labelColor:wl},axis:{ticks:!1,grid:!1,domain:!1,labelColor:wl,labelFontSize:hk,titleFont:mk,titleColor:yk,titleFontSize:pk,titleFontWeight:"normal"},axisQuantitative:{tickCount:3,grid:!0,gridColor:Xle,gridDash:[1,5],labelFlush:!1},axisBand:{tickExtra:!0},axisX:{labelPadding:5},axisY:{labelPadding:10},bar:{fill:ui},line:{stroke:ui,strokeWidth:3,strokeCap:"round",strokeJoin:"round"},text:{font:xl,fontSize:hk,fill:wl},arc:{fill:ui},area:{fill:ui,line:!0,opacity:.6},path:{stroke:ui},rect:{fill:ui},point:{fill:ui,filled:!0,size:75},shape:{stroke:ui},symbol:{fill:ui,strokeWidth:1.5,size:50},legend:{titleFont:xl,titleFontWeight:"bold",titleColor:wl,labelFont:xl,labelFontSize:gk,labelColor:wl,symbolType:"circle",symbolSize:75},range:{category:[ui,Yle,Kle,Jle,Qle,Zle,ece,tce],diverging:vk,heatmap:vk,ordinal:nce}},D0='IBM Plex Sans,system-ui,-apple-system,BlinkMacSystemFont,".sfnstext-regular",sans-serif',rce='IBM Plex Sans Condensed, system-ui, -apple-system, BlinkMacSystemFont, ".SFNSText-Regular", sans-serif',R0=400,od={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"}},oce=["#8a3ffc","#33b1ff","#007d79","#ff7eb6","#fa4d56","#fff1f1","#6fdc8c","#4589ff","#d12771","#d2a106","#08bdba","#bae6ff","#ba4e00","#d4bbff"],sce=["#6929c4","#1192e8","#005d5d","#9f1853","#fa4d56","#570408","#198038","#002d9c","#ee538b","#b28600","#009d9a","#012749","#8a3800","#a56eff"];function cm({theme:e,background:t}){const n=["white","g10"].includes(e)?"light":"dark",i=od.gridBg[e],r=od.textPrimary[e],o=od.textSecondary[e],s=n==="dark"?oce:sce,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:rce,labelFontWeight:R0,titleColor:r,titleFontWeight:600,titleFontSize:12,grid:!0,gridColor:od.layerAccent01[e],labelAngle:0},axisX:{titlePadding:10},axisY:{titlePadding:2.5},style:{"guide-label":{font:D0,fill:o,fontWeight:R0},"guide-title":{font:D0,fill:o,fontWeight:R0}},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 ace=cm({theme:"white",background:"#ffffff"}),uce=cm({theme:"g10",background:"#f4f4f4"}),lce=cm({theme:"g90",background:"#262626"}),cce=cm({theme:"g100",background:"#161616"}),fce=Fle.version,dce=Object.freeze(Object.defineProperty({__proto__:null,carbong10:uce,carbong100:cce,carbong90:lce,carbonwhite:ace,dark:Tle,excel:Mle,fivethirtyeight:Rle,ggplot2:Nle,googlecharts:Vle,latimes:Ile,powerbi:ice,quartz:Ble,urbaninstitute:Gle,version:fce,vox:Ule},Symbol.toStringTag,{value:"Module"}));function hce(e,t,n,i){if(L(e))return`[${e.map(r=>t(K(r)?r:xk(r,n))).join(", ")}]`;if(X(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&&(X(c)&&(c=xk(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 gce(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 xk(e,t){return JSON.stringify(e,gce(t))}var pce=`#vg-tooltip-element {
|
25
|
-
visibility: hidden;
|
26
|
-
padding: 8px;
|
27
|
-
position: fixed;
|
28
|
-
z-index: 1000;
|
29
|
-
font-family: sans-serif;
|
30
|
-
font-size: 11px;
|
31
|
-
border-radius: 3px;
|
32
|
-
box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
|
33
|
-
/* The default theme is the light theme. */
|
34
|
-
background-color: rgba(255, 255, 255, 0.95);
|
35
|
-
border: 1px solid #d9d9d9;
|
36
|
-
color: black;
|
37
|
-
}
|
38
|
-
#vg-tooltip-element.visible {
|
39
|
-
visibility: visible;
|
40
|
-
}
|
41
|
-
#vg-tooltip-element h2 {
|
42
|
-
margin-top: 0;
|
43
|
-
margin-bottom: 10px;
|
44
|
-
font-size: 13px;
|
45
|
-
}
|
46
|
-
#vg-tooltip-element table {
|
47
|
-
border-spacing: 0;
|
48
|
-
}
|
49
|
-
#vg-tooltip-element table tr {
|
50
|
-
border: none;
|
51
|
-
}
|
52
|
-
#vg-tooltip-element table tr td {
|
53
|
-
overflow: hidden;
|
54
|
-
text-overflow: ellipsis;
|
55
|
-
padding-top: 2px;
|
56
|
-
padding-bottom: 2px;
|
57
|
-
}
|
58
|
-
#vg-tooltip-element table tr td.key {
|
59
|
-
color: #808080;
|
60
|
-
max-width: 150px;
|
61
|
-
text-align: right;
|
62
|
-
padding-right: 4px;
|
63
|
-
}
|
64
|
-
#vg-tooltip-element table tr td.value {
|
65
|
-
display: block;
|
66
|
-
max-width: 300px;
|
67
|
-
max-height: 7em;
|
68
|
-
text-align: left;
|
69
|
-
}
|
70
|
-
#vg-tooltip-element.dark-theme {
|
71
|
-
background-color: rgba(32, 32, 32, 0.9);
|
72
|
-
border: 1px solid #f5f5f5;
|
73
|
-
color: white;
|
74
|
-
}
|
75
|
-
#vg-tooltip-element.dark-theme td.key {
|
76
|
-
color: #bfbfbf;
|
77
|
-
}
|
78
|
-
`;const GL="vg-tooltip-element",mce={offsetX:10,offsetY:10,id:GL,styleId:"vega-tooltip-style",theme:"light",disableDefaultStyle:!1,sanitize:yce,maxDepth:2,formatTooltip:hce,baseURL:""};function yce(e){return String(e).replace(/&/g,"&").replace(/</g,"<")}function bce(e){if(!/^[A-Za-z]+[-:.\w]*$/.test(e))throw new Error("Invalid HTML ID");return pce.toString().replace(GL,e)}function vce(e,t,n,i){let r=e.clientX+n;r+t.width>window.innerWidth&&(r=+e.clientX-n-t.width);let o=e.clientY+i;return o+t.height>window.innerHeight&&(o=+e.clientY-i-t.height),{x:r,y:o}}class xce{constructor(t){this.options={...mce,...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=bce(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}=vce(n,this.el.getBoundingClientRect(),this.options.offsetX,this.options.offsetY);this.el.style.top=`${s}px`,this.el.style.left=`${o}px`}}var N0={};function wce(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}class Ece{constructor(){this.max=1e3,this.map=new Map}get(t){const n=this.map.get(t);if(n!==void 0)return this.map.delete(t),this.map.set(t,n),n}delete(t){return this.map.delete(t)}set(t,n){if(!this.delete(t)&&n!==void 0){if(this.map.size>=this.max){const r=this.map.keys().next().value;this.delete(r)}this.map.set(t,n)}return this}}var Sce=Ece;const _ce=Object.freeze({loose:!0}),$ce=Object.freeze({}),Ace=e=>e?typeof e!="object"?_ce:e:$ce;var lE=Ace,qy={exports:{}};const VL=256,kce=Number.MAX_SAFE_INTEGER||9007199254740991,Cce=16,Fce=VL-6;var cE={MAX_LENGTH:VL,MAX_SAFE_COMPONENT_LENGTH:Cce,MAX_SAFE_BUILD_LENGTH:Fce,MAX_SAFE_INTEGER:kce,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2};const Tce=typeof process=="object"&&N0&&N0.NODE_DEBUG&&/\bsemver\b/i.test(N0.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};var fm=Tce;(function(e,t){const{MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:i,MAX_LENGTH:r}=cE,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*$")})(qy,qy.exports);var fE=qy.exports;const wk=/^[0-9]+$/,Mce=(e,t)=>{const n=wk.test(e),i=wk.test(t);return n&&i&&(e=+e,t=+t),e===t?0:n&&!i?-1:i&&!n?1:e<t?-1:1};var Oce={compareIdentifiers:Mce};const sd=fm,{MAX_LENGTH:Ek,MAX_SAFE_INTEGER:ad}=cE,{safeRe:Sk,t:_k}=fE,Dce=lE,{compareIdentifiers:Ca}=Oce;let Rce=class Ii{constructor(t,n){if(n=Dce(n),t instanceof Ii){if(t.loose===!!n.loose&&t.includePrerelease===!!n.includePrerelease)return t;t=t.version}else if(typeof t!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof t}".`);if(t.length>Ek)throw new TypeError(`version is longer than ${Ek} characters`);sd("SemVer",t,n),this.options=n,this.loose=!!n.loose,this.includePrerelease=!!n.includePrerelease;const i=t.trim().match(n.loose?Sk[_k.LOOSE]:Sk[_k.FULL]);if(!i)throw new TypeError(`Invalid Version: ${t}`);if(this.raw=t,this.major=+i[1],this.minor=+i[2],this.patch=+i[3],this.major>ad||this.major<0)throw new TypeError("Invalid major version");if(this.minor>ad||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>ad||this.patch<0)throw new TypeError("Invalid patch version");i[4]?this.prerelease=i[4].split(".").map(r=>{if(/^[0-9]+$/.test(r)){const o=+r;if(o>=0&&o<ad)return o}return r}):this.prerelease=[],this.build=i[5]?i[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(t){if(sd("SemVer.compare",this.version,this.options,t),!(t instanceof Ii)){if(typeof t=="string"&&t===this.version)return 0;t=new Ii(t,this.options)}return t.version===this.version?0:this.compareMain(t)||this.comparePre(t)}compareMain(t){return t instanceof Ii||(t=new Ii(t,this.options)),Ca(this.major,t.major)||Ca(this.minor,t.minor)||Ca(this.patch,t.patch)}comparePre(t){if(t instanceof Ii||(t=new Ii(t,this.options)),this.prerelease.length&&!t.prerelease.length)return-1;if(!this.prerelease.length&&t.prerelease.length)return 1;if(!this.prerelease.length&&!t.prerelease.length)return 0;let n=0;do{const i=this.prerelease[n],r=t.prerelease[n];if(sd("prerelease compare",n,i,r),i===void 0&&r===void 0)return 0;if(r===void 0)return 1;if(i===void 0)return-1;if(i===r)continue;return Ca(i,r)}while(++n)}compareBuild(t){t instanceof Ii||(t=new Ii(t,this.options));let n=0;do{const i=this.build[n],r=t.build[n];if(sd("build compare",n,i,r),i===void 0&&r===void 0)return 0;if(r===void 0)return 1;if(i===void 0)return-1;if(i===r)continue;return Ca(i,r)}while(++n)}inc(t,n,i){switch(t){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",n,i);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",n,i);break;case"prepatch":this.prerelease.length=0,this.inc("patch",n,i),this.inc("pre",n,i);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",n,i),this.inc("pre",n,i);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 r=Number(i)?1:0;if(!n&&i===!1)throw new Error("invalid increment argument: identifier is empty");if(this.prerelease.length===0)this.prerelease=[r];else{let o=this.prerelease.length;for(;--o>=0;)typeof this.prerelease[o]=="number"&&(this.prerelease[o]++,o=-2);if(o===-1){if(n===this.prerelease.join(".")&&i===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(r)}}if(n){let o=[n,r];i===!1&&(o=[n]),Ca(this.prerelease[0],n)===0?isNaN(this.prerelease[1])&&(this.prerelease=o):this.prerelease=o}break}default:throw new Error(`invalid increment argument: ${t}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};var dE=Rce;const $k=dE,Nce=(e,t,n)=>new $k(e,n).compare(new $k(t,n));var Ju=Nce;const Lce=Ju,Pce=(e,t,n)=>Lce(e,t,n)===0;var zce=Pce;const Ice=Ju,Bce=(e,t,n)=>Ice(e,t,n)!==0;var Uce=Bce;const jce=Ju,Wce=(e,t,n)=>jce(e,t,n)>0;var qce=Wce;const Hce=Ju,Gce=(e,t,n)=>Hce(e,t,n)>=0;var Vce=Gce;const Xce=Ju,Yce=(e,t,n)=>Xce(e,t,n)<0;var Kce=Yce;const Jce=Ju,Qce=(e,t,n)=>Jce(e,t,n)<=0;var Zce=Qce;const efe=zce,tfe=Uce,nfe=qce,ife=Vce,rfe=Kce,ofe=Zce,sfe=(e,t,n,i)=>{switch(t){case"===":return typeof e=="object"&&(e=e.version),typeof n=="object"&&(n=n.version),e===n;case"!==":return typeof e=="object"&&(e=e.version),typeof n=="object"&&(n=n.version),e!==n;case"":case"=":case"==":return efe(e,n,i);case"!=":return tfe(e,n,i);case">":return nfe(e,n,i);case">=":return ife(e,n,i);case"<":return rfe(e,n,i);case"<=":return ofe(e,n,i);default:throw new TypeError(`Invalid operator: ${t}`)}};var afe=sfe,L0,Ak;function ufe(){if(Ak)return L0;Ak=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(">")))}}L0=t;const n=lE,{safeRe:i,t:r}=fE,o=afe,s=fm,a=dE,u=XL();return L0}var P0,kk;function XL(){if(kk)return P0;kk=1;class e{constructor(F,A){if(A=i(A),F instanceof e)return F.loose===!!A.loose&&F.includePrerelease===!!A.includePrerelease?F:new e(F.raw,A);if(F instanceof r)return this.raw=F.value,this.set=[[F]],this.format(),this;if(this.options=A,this.loose=!!A.loose,this.includePrerelease=!!A.includePrerelease,this.raw=F.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map(M=>this.parseRange(M.trim())).filter(M=>M.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const M=this.set[0];if(this.set=this.set.filter(P=>!g(P[0])),this.set.length===0)this.set=[M];else if(this.set.length>1){for(const P of this.set)if(P.length===1&&p(P[0])){this.set=[P];break}}}this.format()}format(){return this.range=this.set.map(F=>F.join(" ").trim()).join("||").trim(),this.range}toString(){return this.range}parseRange(F){const M=((this.options.includePrerelease&&d)|(this.options.loose&&h))+":"+F,P=n.get(M);if(P)return P;const z=this.options.loose,U=z?a[u.HYPHENRANGELOOSE]:a[u.HYPHENRANGE];F=F.replace(U,T(this.options.includePrerelease)),o("hyphen replace",F),F=F.replace(a[u.COMPARATORTRIM],l),o("comparator trim",F),F=F.replace(a[u.TILDETRIM],c),o("tilde trim",F),F=F.replace(a[u.CARETTRIM],f),o("caret trim",F);let te=F.split(" ").map(we=>y(we,this.options)).join(" ").split(/\s+/).map(we=>C(we,this.options));z&&(te=te.filter(we=>(o("loose invalid filter",we,this.options),!!we.match(a[u.COMPARATORLOOSE])))),o("range list",te);const ne=new Map,de=te.map(we=>new r(we,this.options));for(const we of de){if(g(we))return[we];ne.set(we.value,we)}ne.size>1&&ne.has("")&&ne.delete("");const Se=[...ne.values()];return n.set(M,Se),Se}intersects(F,A){if(!(F instanceof e))throw new TypeError("a Range is required");return this.set.some(M=>m(M,A)&&F.set.some(P=>m(P,A)&&M.every(z=>P.every(U=>z.intersects(U,A)))))}test(F){if(!F)return!1;if(typeof F=="string")try{F=new s(F,this.options)}catch{return!1}for(let A=0;A<this.set.length;A++)if(D(this.set[A],F,this.options))return!0;return!1}}P0=e;const t=Sce,n=new t,i=lE,r=ufe(),o=fm,s=dE,{safeRe:a,t:u,comparatorTrimReplace:l,tildeTrimReplace:c,caretTrimReplace:f}=fE,{FLAG_INCLUDE_PRERELEASE:d,FLAG_LOOSE:h}=cE,g=k=>k.value==="<0.0.0-0",p=k=>k.value==="",m=(k,F)=>{let A=!0;const M=k.slice();let P=M.pop();for(;A&&M.length;)A=M.every(z=>P.intersects(z,F)),P=M.pop();return A},y=(k,F)=>(o("comp",k,F),k=E(k,F),o("caret",k),k=v(k,F),o("tildes",k),k=w(k,F),o("xrange",k),k=$(k,F),o("stars",k),k),b=k=>!k||k.toLowerCase()==="x"||k==="*",v=(k,F)=>k.trim().split(/\s+/).map(A=>x(A,F)).join(" "),x=(k,F)=>{const A=F.loose?a[u.TILDELOOSE]:a[u.TILDE];return k.replace(A,(M,P,z,U,te)=>{o("tilde",k,M,P,z,U,te);let ne;return b(P)?ne="":b(z)?ne=`>=${P}.0.0 <${+P+1}.0.0-0`:b(U)?ne=`>=${P}.${z}.0 <${P}.${+z+1}.0-0`:te?(o("replaceTilde pr",te),ne=`>=${P}.${z}.${U}-${te} <${P}.${+z+1}.0-0`):ne=`>=${P}.${z}.${U} <${P}.${+z+1}.0-0`,o("tilde return",ne),ne})},E=(k,F)=>k.trim().split(/\s+/).map(A=>S(A,F)).join(" "),S=(k,F)=>{o("caret",k,F);const A=F.loose?a[u.CARETLOOSE]:a[u.CARET],M=F.includePrerelease?"-0":"";return k.replace(A,(P,z,U,te,ne)=>{o("caret",k,P,z,U,te,ne);let de;return b(z)?de="":b(U)?de=`>=${z}.0.0${M} <${+z+1}.0.0-0`:b(te)?z==="0"?de=`>=${z}.${U}.0${M} <${z}.${+U+1}.0-0`:de=`>=${z}.${U}.0${M} <${+z+1}.0.0-0`:ne?(o("replaceCaret pr",ne),z==="0"?U==="0"?de=`>=${z}.${U}.${te}-${ne} <${z}.${U}.${+te+1}-0`:de=`>=${z}.${U}.${te}-${ne} <${z}.${+U+1}.0-0`:de=`>=${z}.${U}.${te}-${ne} <${+z+1}.0.0-0`):(o("no pr"),z==="0"?U==="0"?de=`>=${z}.${U}.${te}${M} <${z}.${U}.${+te+1}-0`:de=`>=${z}.${U}.${te}${M} <${z}.${+U+1}.0-0`:de=`>=${z}.${U}.${te} <${+z+1}.0.0-0`),o("caret return",de),de})},w=(k,F)=>(o("replaceXRanges",k,F),k.split(/\s+/).map(A=>_(A,F)).join(" ")),_=(k,F)=>{k=k.trim();const A=F.loose?a[u.XRANGELOOSE]:a[u.XRANGE];return k.replace(A,(M,P,z,U,te,ne)=>{o("xRange",k,M,P,z,U,te,ne);const de=b(z),Se=de||b(U),we=Se||b(te),Pe=we;return P==="="&&Pe&&(P=""),ne=F.includePrerelease?"-0":"",de?P===">"||P==="<"?M="<0.0.0-0":M="*":P&&Pe?(Se&&(U=0),te=0,P===">"?(P=">=",Se?(z=+z+1,U=0,te=0):(U=+U+1,te=0)):P==="<="&&(P="<",Se?z=+z+1:U=+U+1),P==="<"&&(ne="-0"),M=`${P+z}.${U}.${te}${ne}`):Se?M=`>=${z}.0.0${ne} <${+z+1}.0.0-0`:we&&(M=`>=${z}.${U}.0${ne} <${z}.${+U+1}.0-0`),o("xRange return",M),M})},$=(k,F)=>(o("replaceStars",k,F),k.trim().replace(a[u.STAR],"")),C=(k,F)=>(o("replaceGTE0",k,F),k.trim().replace(a[F.includePrerelease?u.GTE0PRE:u.GTE0],"")),T=k=>(F,A,M,P,z,U,te,ne,de,Se,we,Pe)=>(b(M)?A="":b(P)?A=`>=${M}.0.0${k?"-0":""}`:b(z)?A=`>=${M}.${P}.0${k?"-0":""}`:U?A=`>=${A}`:A=`>=${A}${k?"-0":""}`,b(de)?ne="":b(Se)?ne=`<${+de+1}.0.0-0`:b(we)?ne=`<${de}.${+Se+1}.0-0`:Pe?ne=`<=${de}.${Se}.${we}-${Pe}`:k?ne=`<${de}.${Se}.${+we+1}-0`:ne=`<=${ne}`,`${A} ${ne}`.trim()),D=(k,F,A)=>{for(let M=0;M<k.length;M++)if(!k[M].test(F))return!1;if(F.prerelease.length&&!A.includePrerelease){for(let M=0;M<k.length;M++)if(o(k[M].semver),k[M].semver!==r.ANY&&k[M].semver.prerelease.length>0){const P=k[M].semver;if(P.major===F.major&&P.minor===F.minor&&P.patch===F.patch)return!0}return!1}return!0};return P0}const lfe=XL(),cfe=(e,t,n)=>{try{t=new lfe(t,n)}catch{return!1}return t.test(e)};var ffe=cfe,YL=wce(ffe);function dfe(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 hfe=`.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 KL(e,...t){for(const n of t)gfe(e,n);return e}function gfe(e,t){for(const n of Object.keys(t))Tu(e,n,t[n],!0)}const Bi=kee;let Mc=kle;const ud=typeof window<"u"?window:void 0;var Ok;Mc===void 0&&((Ok=ud==null?void 0:ud.vl)!=null&&Ok.compile)&&(Mc=ud.vl);const pfe={export:{svg:!0,png:!0},source:!0,compiled:!0,editor:!0},mfe={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"},jl={vega:"Vega","vega-lite":"Vega-Lite"},og={vega:Bi.version,"vega-lite":Mc?Mc.version:"not available"},yfe={vega:e=>e,"vega-lite":(e,t)=>Mc.compile(e,{config:t}).spec},bfe=`
|
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>`,vfe="chart-wrapper";function xfe(e){return typeof e=="function"}function Ck(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=`${jl[i]} JSON Source`}function wfe(e,t){if(e.$schema){const n=WL(e.$schema);t&&t!==n.library&&console.warn(`The given visualization spec is written in ${jl[n.library]}, but mode argument sets ${jl[t]??t}.`);const i=n.library;return YL(og[i],`^${n.version.slice(1)}`)||console.warn(`The input spec uses ${jl[i]} ${n.version}, but the current version of ${jl[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 JL(e){return!!(e&&"load"in e)}function Fk(e){return JL(e)?e:Bi.loader(e)}function Efe(e){var n;const t=((n=e.usermeta)==null?void 0:n.embedOptions)??{};return K(t.defaultStyle)&&(t.defaultStyle=!1),t}async function Sfe(e,t,n={}){let i,r;K(t)?(r=Fk(n.loader),i=JSON.parse(await r.load(t))):i=t;const o=Efe(i),s=o.loader;(!r||s)&&(r=Fk(n.loader??s));const a=await Tk(o,r),u=await Tk(n,r),l={...KL(u,a),config:Fu(u.config??{},a.config??{})};return await $fe(e,i,l,r)}async function Tk(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 _fe(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 $fe(e,t,n={},i){const r=n.theme?Fu(dce[n.theme],n.config??{}):n.config,o=Ho(n.actions)?n.actions:KL({},pfe,n.actions??{}),s={...mfe,...n.i18n},a=n.renderer??"canvas",u=n.logLevel??Bi.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}=_fe(c);if(!S.getElementById(E)){const _=document.createElement("style");_.id=E,_.innerHTML=n.defaultStyle===void 0||n.defaultStyle===!0?hfe.toString():n.defaultStyle,w.appendChild(_)}}const f=wfe(t,n.mode);let d=yfe[f](t,r);if(f==="vega-lite"&&d.$schema){const E=WL(d.$schema);YL(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(vfe),c.appendChild(E),h=E}const g=n.patch;if(g&&(d=g instanceof Function?g(d):xp(d,g,!0,!1).newDocument),n.formatLocale&&Bi.formatLocale(n.formatLocale),n.timeFormatLocale&&Bi.timeFormatLocale(n.timeFormatLocale),n.expressionFunctions)for(const E in n.expressionFunctions){const S=n.expressionFunctions[E];"fn"in S?Bi.expressionFunction(E,S.fn,S.visitor):S instanceof Function&&Bi.expressionFunction(E,S)}const{ast:p}=n,m=Bi.parse(d,f==="vega-lite"?{}:r,{ast:p}),y=new(n.viewClass||Bi.View)(m,{loader:i,logLevel:u,renderer:a,...p?{expr:Bi.expressionInterpreter??n.expr??E3}:{}});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&&!JL(E)?E==null?void 0:E.baseURL:void 0,_=xfe(S)?S:new xce({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=bfe,w.append(_),v=$=>{w.contains($.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`],$=document.createElement("a"),C=X(n.scaleFactor)?n.scaleFactor[w]:n.scaleFactor;$.text=_,$.href="#",$.target="_blank",$.download=`${l}.${w}`,$.addEventListener("mousedown",async function(T){T.preventDefault();const D=await y.toImageURL(w,C);this.href=D}),S.append($)}}if(o===!0||o.source!==!1){const w=document.createElement("a");w.text=s.SOURCE_ACTION,w.href="#",w.addEventListener("click",function(_){Ck(y0(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(_){Ck(y0(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($){dfe(window,w,{config:r,mode:g?"vega":f,renderer:a,spec:y0(g?d:t)}),$.preventDefault()}),S.append(_)}}function x(){v&&document.removeEventListener("click",v),y.finalize()}return{view:y,spec:t,vgSpec:d,finalize:x,embedOptions:n}}const Afe={DATAFRAME_INDEX:"(index)"};function kfe(e){return!e||e.dimensions.numDataRows===0?null:sg(e)}function Cfe(e){const t=Hy(e);if(Gy(t))return null;const n={};for(const[i,r]of Object.entries(t))n[i]=sg(r);return n}function Hy(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===sP.INDEX&&(aP(s)||gE(s)||pE(s));for(let u=t;u<i;u++){const l={};if(a){const{content:c}=e.getCell(u,0);l[Afe.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))&&(gE(h)||pE(h))&&!uP(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 Ffe=150,Tfe=Dk.getLogger("useVegaLiteSelections"),Mfe=(e,t,n)=>{const{id:i,formId:r,selectionMode:o}=e,s=wt.useCallback(u=>{o.forEach(c=>{u.addSignalListener(c,lP(Ffe,(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||{}}};yE(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){Tfe.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;yE(f,u)||t.setStringValue(l,JSON.stringify(u),{fromUi:!0},n)},[i,r,n,o,t]);return{maybeConfigureSelections:s,onFormCleared:a}},Mk="source",Ofe=Dk.getLogger("useVegaEmbed");function Dfe(e,t,n){const i=wt.useRef(null),r=wt.useRef(null),o=wt.useRef(Mk),s=wt.useRef(null),a=wt.useRef([]),{maybeConfigureSelections:u,onFormCleared:l}=Mfe(e,t,n);GP({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:E3,tooltip:{disableDefaultStyle:!0},defaultStyle:!1,forceActionsMenu:!0},{vgSpec:v,view:x,finalize:E}=await Sfe(m.current,y,b);i.current=u(x),r.current=E;const S=Cfe(a.current),w=S?Object.keys(S):[];if(w.length===1){const[$]=w;o.current=$}else w.length===0&&v.data&&(o.current=Mk);const _=kfe(s.current);if(_&&i.current.insert(o.current,_),S)for(const[$,C]of Object.entries(S))i.current.insert($,C);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,Ln)}finally{return}if(!b||b.dimensions.numDataRows===0){m.insert(y,sg(v));return}v.hash!==b.hash&&(m.data(y,sg(v)),Ofe.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=Hy(v)??{},E=Hy(y)??{};for(const[w,_]of Object.entries(E)){const $=w||o.current,C=x[$];g(i.current,$,C,_)}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 Rfe=({disableFullscreenMode:e,element:t,fragmentId:n,widgetMgr:i})=>{const{expanded:r,width:o,height:s,expand:a,collapse:u}=Rk(Nk),l=wt.useRef(null),c=ZP(t),{createView:f,updateView:d,finalizeView:h}=Dfe(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]),cP(bE,{width:o,height:s,useContainerWidth:c.useContainerWidth,children:[dm(dP,{target:bE,isFullScreen:r,onExpand:a,onCollapse:u,disableFullscreenMode:e}),dm(fP,{styles:[VP]}),dm(XP,{"data-testid":"stVegaLiteChart",className:"stVegaLiteChart",useContainerWidth:c.useContainerWidth,isFullScreen:r,ref:l})]})},Ade=hP(Rfe);export{Ade as default};
|