isorite 0.9.1 → 0.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (125) hide show
  1. package/dist/core.js +175 -14
  2. package/dist/main.js +1217 -52
  3. package/notes/algorithms/the-quadtree/subdivision.svg +15 -0
  4. package/notes/algorithms/the-quadtree.md +2 -0
  5. package/package.json +2 -1
  6. package/plugin/server.ts +1 -1
  7. package/web/_app/immutable/assets/{0.CTbO0owi.css → 0.DcsDj0O1.css} +1 -1
  8. package/web/_app/immutable/assets/5.DbDKXCoO.css +1 -0
  9. package/web/_app/immutable/assets/NoteEditor.S3q5lmKq.css +1 -0
  10. package/web/_app/immutable/assets/drawn.CHbcoujQ.css +1 -0
  11. package/web/_app/immutable/chunks/{8wVGBFSs.js → -2Meesge.js} +3 -3
  12. package/web/_app/immutable/chunks/{BL3mLym4.js → 9z49435t.js} +1 -1
  13. package/web/_app/immutable/chunks/{DMAYXnpq.js → BA8Hpxhg.js} +1 -1
  14. package/web/_app/immutable/chunks/{CKSRTWxH.js → BAclEN0O.js} +1 -1
  15. package/web/_app/immutable/chunks/{DECNRCf2.js → BLmF1B2i.js} +1 -1
  16. package/web/_app/immutable/chunks/{CiVjR8gq.js → BTclWEfx.js} +1 -1
  17. package/web/_app/immutable/chunks/{Cp_JbuGh.js → BWVMfAMh.js} +1 -1
  18. package/web/_app/immutable/chunks/{D4fLEcOQ.js → BXAOBcPb.js} +1 -1
  19. package/web/_app/immutable/chunks/BYSDTLqw.js +1 -0
  20. package/web/_app/immutable/chunks/{DDuWClBR.js → BgT6ZdzK.js} +1 -1
  21. package/web/_app/immutable/chunks/{CO2Y5y64.js → Bq2GBAJ0.js} +1 -1
  22. package/web/_app/immutable/chunks/BqrMZ9MX.js +1 -0
  23. package/web/_app/immutable/chunks/{BN6xhG8e.js → Bt7VOT5H.js} +1 -1
  24. package/web/_app/immutable/chunks/{BGbXxNFa.js → BuUzVkG2.js} +1 -1
  25. package/web/_app/immutable/chunks/{Brxvm_b1.js → By4S_gy5.js} +1 -1
  26. package/web/_app/immutable/chunks/{CRIvE37b.js → BymwHy7o.js} +1 -1
  27. package/web/_app/immutable/chunks/{BrqJKzQU.js → CD6xPodA.js} +1 -1
  28. package/web/_app/immutable/chunks/{BXF2XoRC.js → CMeq8te_.js} +1 -1
  29. package/web/_app/immutable/chunks/CODXTnUW.js +523 -0
  30. package/web/_app/immutable/chunks/{CEufJyoj.js → CQd9D8Nc.js} +1 -1
  31. package/web/_app/immutable/chunks/{BrGmYbJT.js → CT_Ry4q8.js} +1 -1
  32. package/web/_app/immutable/chunks/{CQadubS9.js → C_amgxV1.js} +1 -1
  33. package/web/_app/immutable/chunks/{GRrQoDGJ.js → CfL6O_ia.js} +1 -1
  34. package/web/_app/immutable/chunks/{spNKdrPy.js → CjtKPNlv.js} +1 -1
  35. package/web/_app/immutable/chunks/{DxLkKbK2.js → Cl5zRP_n.js} +1 -1
  36. package/web/_app/immutable/chunks/{CETSRtnV.js → CyFLqlvP.js} +1 -1
  37. package/web/_app/immutable/chunks/{Bq5hCPe1.js → Czz9qOh8.js} +1 -1
  38. package/web/_app/immutable/chunks/{BguXRgvc.js → D3-rqfsM.js} +1 -1
  39. package/web/_app/immutable/chunks/{bcQIrid8.js → D5XlJBy8.js} +1 -1
  40. package/web/_app/immutable/chunks/{TuFg0KqZ.js → D5vocsTl.js} +1 -1
  41. package/web/_app/immutable/chunks/{CTscJvp6.js → D95RKsvN.js} +1 -1
  42. package/web/_app/immutable/chunks/{BzI3yqBQ.js → DBC2xjOo.js} +1 -1
  43. package/web/_app/immutable/chunks/DDVefAkE.js +7 -0
  44. package/web/_app/immutable/chunks/{BsLNwr5A.js → DF89zyH-.js} +1 -1
  45. package/web/_app/immutable/chunks/DGmSCGD3.js +1 -0
  46. package/web/_app/immutable/chunks/{DacMdKjW.js → DNjLZcwq.js} +1 -1
  47. package/web/_app/immutable/chunks/{C-dfcq9W.js → DRX-TQzj.js} +1 -1
  48. package/web/_app/immutable/chunks/{BunrC_8P.js → DX4bJJO0.js} +1 -1
  49. package/web/_app/immutable/chunks/{EQVRMnZU.js → DXK7PB4g.js} +1 -1
  50. package/web/_app/immutable/chunks/{mbLqADPr.js → DXTK-eyo.js} +1 -1
  51. package/web/_app/immutable/chunks/{DII7jNnq.js → DaulBP5z.js} +1 -1
  52. package/web/_app/immutable/chunks/{wCTXGvXm.js → DbNETcPs.js} +1 -1
  53. package/web/_app/immutable/chunks/Db_gdTNI.js +1 -0
  54. package/web/_app/immutable/chunks/{CX-xckzu.js → DfCZPwp1.js} +1 -1
  55. package/web/_app/immutable/chunks/{DKNOMI4Y.js → Dh1lBxfx.js} +1 -1
  56. package/web/_app/immutable/chunks/DktGnzDy.js +151 -0
  57. package/web/_app/immutable/chunks/{BgczuZKA.js → DkxkvOjx.js} +1 -1
  58. package/web/_app/immutable/chunks/{0M1khDs2.js → DlXrOzlh.js} +1 -1
  59. package/web/_app/immutable/chunks/{B85D_PlV.js → Dpa4Syyy.js} +1 -1
  60. package/web/_app/immutable/chunks/DshHzxgH.js +1 -0
  61. package/web/_app/immutable/chunks/DuLysVkb.js +1 -0
  62. package/web/_app/immutable/chunks/{CdY1YAit.js → EMo1IeTW.js} +1 -1
  63. package/web/_app/immutable/chunks/F7HCRtmu.js +1 -0
  64. package/web/_app/immutable/chunks/Iqr2CudW.js +3 -0
  65. package/web/_app/immutable/chunks/{CoyQYage.js → RFxekmX-.js} +1 -1
  66. package/web/_app/immutable/chunks/{vk5Wkr31.js → RlApGeew.js} +1 -1
  67. package/web/_app/immutable/chunks/{CLVUDRRk.js → Xm0YTnxV.js} +1 -1
  68. package/web/_app/immutable/chunks/{CZ8wTb_M.js → gPtCGHiy.js} +1 -1
  69. package/web/_app/immutable/chunks/{B3aPQAYq.js → mLFVM17H.js} +1 -1
  70. package/web/_app/immutable/chunks/{D4SKbj9K.js → oWM_kgYq.js} +1 -1
  71. package/web/_app/immutable/chunks/{wj7G6pU5.js → rghE0CVz.js} +1 -1
  72. package/web/_app/immutable/chunks/{B9YLdnR_.js → tUSDgbpy.js} +1 -1
  73. package/web/_app/immutable/chunks/{DTdlqvEb.js → vfDvz3qP.js} +1 -1
  74. package/web/_app/immutable/chunks/{BRKS-CCX.js → whhiiiga.js} +1 -1
  75. package/web/_app/immutable/chunks/wxBqjpRy.js +1 -0
  76. package/web/_app/immutable/entry/app.wp4GfiBT.js +2 -0
  77. package/web/_app/immutable/entry/start.PPXyd7_0.js +1 -0
  78. package/web/_app/immutable/nodes/0.JerS9yOA.js +26 -0
  79. package/web/_app/immutable/nodes/1.C-RxYNx3.js +1 -0
  80. package/web/_app/immutable/nodes/2.Bbkruoyi.js +1 -0
  81. package/web/_app/immutable/nodes/3.BkpGKa9k.js +1 -0
  82. package/web/_app/immutable/nodes/4.Bj25nsxG.js +2 -0
  83. package/web/_app/immutable/nodes/5.D9sfzyBX.js +9 -0
  84. package/web/_app/immutable/nodes/6.Di1re0aR.js +1 -0
  85. package/web/_app/immutable/nodes/7.MWEn-qPC.js +1 -0
  86. package/web/_app/version.json +1 -1
  87. package/web/index.html +18 -17
  88. package/web/kit/chart.js +55 -0
  89. package/web/kit/isorite.css +32 -0
  90. package/web/kit/kit.css +80 -0
  91. package/web/kit/kit.js +543 -0
  92. package/web/kit/licenses/d3.txt +13 -0
  93. package/web/kit/licenses/interval-tree-1d.txt +22 -0
  94. package/web/kit/licenses/isoformat.txt +13 -0
  95. package/web/kit/licenses/katex.txt +21 -0
  96. package/web/kit/licenses/observablehq-plot.txt +13 -0
  97. package/web/kit/licenses/three.txt +21 -0
  98. package/web/kit/math.css +1 -0
  99. package/web/kit/math.js +257 -0
  100. package/web/kit/model.js +4236 -0
  101. package/web/kit/plain.css +16 -0
  102. package/web/_app/immutable/assets/5.TsqJFEFF.css +0 -1
  103. package/web/_app/immutable/assets/NoteEditor.8wWtZK_A.css +0 -1
  104. package/web/_app/immutable/chunks/CBWiKnLz.js +0 -1
  105. package/web/_app/immutable/chunks/CHbKgHy3.js +0 -1
  106. package/web/_app/immutable/chunks/CJ1dhP0p.js +0 -1
  107. package/web/_app/immutable/chunks/CLkY0zVi.js +0 -1
  108. package/web/_app/immutable/chunks/D-aFnd2T.js +0 -1
  109. package/web/_app/immutable/chunks/DRQEUdad.js +0 -1
  110. package/web/_app/immutable/chunks/DZYaqCwi.js +0 -1
  111. package/web/_app/immutable/chunks/D_19S_Iu.js +0 -1
  112. package/web/_app/immutable/chunks/DcgxJ8bF.js +0 -673
  113. package/web/_app/immutable/chunks/Ddgejj-u.js +0 -1
  114. package/web/_app/immutable/chunks/nMarIA7J.js +0 -3
  115. package/web/_app/immutable/chunks/vUsuwDSf.js +0 -6
  116. package/web/_app/immutable/entry/app.CswuY3sh.js +0 -2
  117. package/web/_app/immutable/entry/start.D8ZvSyBD.js +0 -1
  118. package/web/_app/immutable/nodes/0.DBoa3NAQ.js +0 -26
  119. package/web/_app/immutable/nodes/1.DrwFerb8.js +0 -1
  120. package/web/_app/immutable/nodes/2.DPmbppXV.js +0 -1
  121. package/web/_app/immutable/nodes/3.BW7AbIrS.js +0 -1
  122. package/web/_app/immutable/nodes/4.B5HAyMKs.js +0 -2
  123. package/web/_app/immutable/nodes/5.BvScSoCM.js +0 -5
  124. package/web/_app/immutable/nodes/6.Bna6qY2G.js +0 -1
  125. package/web/_app/immutable/nodes/7.BxQaF3lD.js +0 -1
@@ -0,0 +1,55 @@
1
+ (function(){var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),s=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},c=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},l=(n,r,o)=>(o=n==null?{}:e(i(n)),c(r||!n||!n.__esModule||!a.call(n,`default`)?t(o,`default`,{value:n,enumerable:!0}):o,n));function u(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function d(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function f(e){let t,n,r;e.length===2?(t=e===u||e===d?e:p,n=e,r=e):(t=u,n=(t,n)=>u(e(t),n),r=(t,n)=>e(t)-n);function i(e,r,i=0,a=e.length){if(i<a){if(t(r,r)!==0)return a;do{let t=i+a>>>1;n(e[t],r)<0?i=t+1:a=t}while(i<a)}return i}function a(e,r,i=0,a=e.length){if(i<a){if(t(r,r)!==0)return a;do{let t=i+a>>>1;n(e[t],r)<=0?i=t+1:a=t}while(i<a)}return i}function o(e,t,n=0,a=e.length){let o=i(e,t,n,a-1);return o>n&&r(e[o-1],t)>-r(e[o],t)?o-1:o}return{left:i,center:o,right:a}}function p(){return 0}function m(e){return e===null?NaN:+e}function*h(e,t){if(t===void 0)for(let t of e)t!=null&&(t=+t)>=t&&(yield t);else{let n=-1;for(let r of e)(r=t(r,++n,e))!=null&&(r=+r)>=r&&(yield r)}}let g=f(u),_=g.right;g.left,f(m).center;let v=b(w),y=b(C);function b(e){return function(t,n,r=n){if(!((n=+n)>=0))throw RangeError(`invalid rx`);if(!((r=+r)>=0))throw RangeError(`invalid ry`);let{data:i,width:a,height:o}=t;if(!((a=Math.floor(a))>=0))throw RangeError(`invalid width`);if(!((o=Math.floor(o===void 0?i.length/a:o))>=0))throw RangeError(`invalid height`);if(!a||!o||!n&&!r)return t;let s=n&&e(n),c=r&&e(r),l=i.slice();return s&&c?(x(s,l,i,a,o),x(s,i,l,a,o),x(s,l,i,a,o),S(c,i,l,a,o),S(c,l,i,a,o),S(c,i,l,a,o)):s?(x(s,i,l,a,o),x(s,l,i,a,o),x(s,i,l,a,o)):c&&(S(c,i,l,a,o),S(c,l,i,a,o),S(c,i,l,a,o)),t}}function x(e,t,n,r,i){for(let a=0,o=r*i;a<o;)e(t,n,a,a+=r,1)}function S(e,t,n,r,i){for(let a=0,o=r*i;a<r;++a)e(t,n,a,a+o,r)}function C(e){let t=w(e);return(e,n,r,i,a)=>{r<<=2,i<<=2,a<<=2,t(e,n,r+0,i+0,a),t(e,n,r+1,i+1,a),t(e,n,r+2,i+2,a),t(e,n,r+3,i+3,a)}}function w(e){let t=Math.floor(e);if(t===e)return T(e);let n=e-t,r=2*e+1;return(e,i,a,o,s)=>{if(!((o-=s)>=a))return;let c=t*i[a],l=s*t,u=l+s;for(let e=a,t=a+l;e<t;e+=s)c+=i[Math.min(o,e)];for(let t=a,d=o;t<=d;t+=s)c+=i[Math.min(o,t+l)],e[t]=(c+n*(i[Math.max(a,t-u)]+i[Math.min(o,t+u)]))/r,c-=i[Math.max(a,t-l)]}}function T(e){let t=2*e+1;return(n,r,i,a,o)=>{if(!((a-=o)>=i))return;let s=e*r[i],c=o*e;for(let e=i,t=i+c;e<t;e+=o)s+=r[Math.min(a,e)];for(let e=i,l=a;e<=l;e+=o)s+=r[Math.min(a,e+c)],n[e]=s/t,s-=r[Math.max(i,e-c)]}}function E(e,t){let n=0;if(t===void 0)for(let t of e)t!=null&&(t=+t)>=t&&++n;else{let r=-1;for(let i of e)(i=t(i,++r,e))!=null&&(i=+i)>=i&&++n}return n}function D(e){return e.length|0}function O(e){return!(e>0)}function k(e){return typeof e!=`object`||`length`in e?e:Array.from(e)}function A(e){return t=>e(...t)}function ee(...e){let t=typeof e[e.length-1]==`function`&&A(e.pop());e=e.map(k);let n=e.map(D),r=e.length-1,i=Array(r+1).fill(0),a=[];if(r<0||n.some(O))return a;for(;;){a.push(i.map((t,n)=>e[n][t]));let o=r;for(;++i[o]===n[o];){if(o===0)return t?a.map(t):a;i[o--]=0}}}function te(e,t){var n=0,r=0;return Float64Array.from(e,t===void 0?e=>n+=+e||0:i=>n+=+t(i,r++,e)||0)}function ne(e,t){let n=0,r,i=0,a=0;if(t===void 0)for(let t of e)t!=null&&(t=+t)>=t&&(r=t-i,i+=r/++n,a+=r*(t-i));else{let o=-1;for(let s of e)(s=t(s,++o,e))!=null&&(s=+s)>=s&&(r=s-i,i+=r/++n,a+=r*(s-i))}if(n>1)return a/(n-1)}function re(e,t){let n=ne(e,t);return n&&Math.sqrt(n)}function j(e,t){let n,r;if(t===void 0)for(let t of e)t!=null&&(n===void 0?t>=t&&(n=r=t):(n>t&&(n=t),r<t&&(r=t)));else{let i=-1;for(let a of e)(a=t(a,++i,e))!=null&&(n===void 0?a>=a&&(n=r=a):(n>a&&(n=a),r<a&&(r=a)))}return[n,r]}var ie=class{constructor(){this._partials=/* @__PURE__ */ new Float64Array(32),this._n=0}add(e){let t=this._partials,n=0;for(let r=0;r<this._n&&r<32;r++){let i=t[r],a=e+i,o=Math.abs(e)<Math.abs(i)?e-(a-i):i-(a-e);o&&(t[n++]=o),e=a}return t[n]=e,this._n=n+1,this}valueOf(){let e=this._partials,t=this._n,n,r,i,a=0;if(t>0){for(a=e[--t];t>0&&(n=a,r=e[--t],a=n+r,i=r-(a-n),!i););t>0&&(i<0&&e[t-1]<0||i>0&&e[t-1]>0)&&(r=i*2,n=a+r,r==n-a&&(a=n))}return a}},ae=class extends Map{constructor(e,t=ue){if(super(),Object.defineProperties(this,{_intern:{value:/* @__PURE__ */ new Map},_key:{value:t}}),e!=null)for(let[t,n]of e)this.set(t,n)}get(e){return super.get(se(this,e))}has(e){return super.has(se(this,e))}set(e,t){return super.set(ce(this,e),t)}delete(e){return super.delete(le(this,e))}},oe=class extends Set{constructor(e,t=ue){if(super(),Object.defineProperties(this,{_intern:{value:/* @__PURE__ */ new Map},_key:{value:t}}),e!=null)for(let t of e)this.add(t)}has(e){return super.has(se(this,e))}add(e){return super.add(ce(this,e))}delete(e){return super.delete(le(this,e))}};function se({_intern:e,_key:t},n){let r=t(n);return e.has(r)?e.get(r):n}function ce({_intern:e,_key:t},n){let r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function le({_intern:e,_key:t},n){let r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function ue(e){return typeof e==`object`&&e?e.valueOf():e}function de(e){return e}function fe(e,...t){return he(e,de,de,t)}function pe(e,t,...n){return he(e,de,t,n)}function me(e,t,...n){return he(e,Array.from,t,n)}function he(e,t,n,r){return(function e(i,a){if(a>=r.length)return n(i);let o=new ae,s=r[a++],c=-1;for(let e of i){let t=s(e,++c,i),n=o.get(t);n?n.push(e):o.set(t,[e])}for(let[t,n]of o)o.set(t,e(n,a));return t(o)})(e,0)}function ge(e,t){return Array.from(t,t=>e[t])}function _e(e,...t){if(typeof e[Symbol.iterator]!=`function`)throw TypeError(`values is not iterable`);e=Array.from(e);let[n]=t;if(n&&n.length!==2||t.length>1){let r=Uint32Array.from(e,(e,t)=>t);return t.length>1?(t=t.map(t=>e.map(t)),r.sort((e,n)=>{for(let r of t){let t=ye(r[e],r[n]);if(t)return t}})):(n=e.map(n),r.sort((e,t)=>ye(n[e],n[t]))),ge(e,r)}return e.sort(ve(n))}function ve(e=u){if(e===u)return ye;if(typeof e!=`function`)throw TypeError(`compare is not a function`);return(t,n)=>{let r=e(t,n);return r||r===0?r:(e(n,n)===0)-(e(t,t)===0)}}function ye(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:+(e>t))}function be(e,t,n){return(t.length===2?_e(fe(e,n),(([e,n],[r,i])=>t(n,i)||u(e,r))):_e(pe(e,t,n),(([e,t],[n,r])=>u(t,r)||u(e,n)))).map(([e])=>e)}let xe=Math.sqrt(50),Se=Math.sqrt(10),Ce=Math.sqrt(2);function we(e,t,n){let r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),a=r/10**i,o=a>=xe?10:a>=Se?5:a>=Ce?2:1,s,c,l;return i<0?(l=10**-i/o,s=Math.round(e*l),c=Math.round(t*l),s/l<e&&++s,c/l>t&&--c,l=-l):(l=10**i*o,s=Math.round(e/l),c=Math.round(t/l),s*l<e&&++s,c*l>t&&--c),c<s&&.5<=n&&n<2?we(e,t,n*2):[s,c,l]}function Te(e,t,n){if(t=+t,e=+e,n=+n,!(n>0))return[];if(e===t)return[e];let r=t<e,[i,a,o]=r?we(t,e,n):we(e,t,n);if(!(a>=i))return[];let s=a-i+1,c=Array(s);if(r){if(o<0)for(let e=0;e<s;++e)c[e]=(a-e)/-o;else for(let e=0;e<s;++e)c[e]=(a-e)*o}else if(o<0)for(let e=0;e<s;++e)c[e]=(i+e)/-o;else for(let e=0;e<s;++e)c[e]=(i+e)*o;return c}function Ee(e,t,n){return t=+t,e=+e,n=+n,we(e,t,n)[2]}function De(e,t,n){t=+t,e=+e,n=+n;let r=t<e,i=r?Ee(t,e,n):Ee(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}function Oe(e,t,n){let r;for(;;){let i=Ee(e,t,n);if(i===r||i===0||!isFinite(i))return[e,t];i>0?(e=Math.floor(e/i)*i,t=Math.ceil(t/i)*i):i<0&&(e=Math.ceil(e*i)/i,t=Math.floor(t*i)/i),r=i}}function ke(e){return Math.max(1,Math.ceil(Math.log(E(e))/Math.LN2)+1)}function Ae(e,t){let n;if(t===void 0)for(let t of e)t!=null&&(n<t||n===void 0&&t>=t)&&(n=t);else{let r=-1;for(let i of e)(i=t(i,++r,e))!=null&&(n<i||n===void 0&&i>=i)&&(n=i)}return n}function je(e,t){let n,r=-1,i=-1;if(t===void 0)for(let t of e)++i,t!=null&&(n<t||n===void 0&&t>=t)&&(n=t,r=i);else for(let a of e)(a=t(a,++i,e))!=null&&(n<a||n===void 0&&a>=a)&&(n=a,r=i);return r}function Me(e,t){let n;if(t===void 0)for(let t of e)t!=null&&(n>t||n===void 0&&t>=t)&&(n=t);else{let r=-1;for(let i of e)(i=t(i,++r,e))!=null&&(n>i||n===void 0&&i>=i)&&(n=i)}return n}function Ne(e,t){let n,r=-1,i=-1;if(t===void 0)for(let t of e)++i,t!=null&&(n>t||n===void 0&&t>=t)&&(n=t,r=i);else for(let a of e)(a=t(a,++i,e))!=null&&(n>a||n===void 0&&a>=a)&&(n=a,r=i);return r}function Pe(e,t,n=0,r=1/0,i){if(t=Math.floor(t),n=Math.floor(Math.max(0,n)),r=Math.floor(Math.min(e.length-1,r)),!(n<=t&&t<=r))return e;for(i=i===void 0?ye:ve(i);r>n;){if(r-n>600){let a=r-n+1,o=t-n+1,s=Math.log(a),c=.5*Math.exp(2*s/3),l=.5*Math.sqrt(s*c*(a-c)/a)*(o-a/2<0?-1:1),u=Math.max(n,Math.floor(t-o*c/a+l)),d=Math.min(r,Math.floor(t+(a-o)*c/a+l));Pe(e,t,u,d,i)}let a=e[t],o=n,s=r;for(Fe(e,n,t),i(e[r],a)>0&&Fe(e,n,r);o<s;){for(Fe(e,o,s),++o,--s;i(e[o],a)<0;)++o;for(;i(e[s],a)>0;)--s}i(e[n],a)===0?Fe(e,n,s):(++s,Fe(e,s,r)),s<=t&&(n=s+1),t<=s&&(r=s-1)}return e}function Fe(e,t,n){let r=e[t];e[t]=e[n],e[n]=r}function Ie(e,t=u){let n,r=!1;if(t.length===1){let i;for(let a of e){let e=t(a);(r?u(e,i)>0:u(e,e)===0)&&(n=a,i=e,r=!0)}}else for(let i of e)(r?t(i,n)>0:t(i,i)===0)&&(n=i,r=!0);return n}function Le(e,t,n){if(e=Float64Array.from(h(e,n)),(r=e.length)&&!isNaN(t=+t)){if(t<=0||r<2)return Me(e);if(t>=1)return Ae(e);var r,i=(r-1)*t,a=Math.floor(i),o=Ae(Pe(e,a).subarray(0,a+1));return o+(Me(e.subarray(a+1))-o)*(i-a)}}function Re(e,t,n=m){if((r=e.length)&&!isNaN(t=+t)){if(t<=0||r<2)return+n(e[0],0,e);if(t>=1)return+n(e[r-1],r-1,e);var r,i=(r-1)*t,a=Math.floor(i),o=+n(e[a],a,e);return o+(+n(e[a+1],a+1,e)-o)*(i-a)}}function ze(e,t,n){let r=E(e),i=Le(e,.75)-Le(e,.25);return r&&i?Math.ceil((n-t)/(2*i*r**(-1/3))):1}function Be(e,t,n){let r=E(e),i=re(e);return r&&i?Math.ceil((n-t)*Math.cbrt(r)/(3.49*i)):1}function Ve(e,t){let n=0,r=0;if(t===void 0)for(let t of e)t!=null&&(t=+t)>=t&&(++n,r+=t);else{let i=-1;for(let a of e)(a=t(a,++i,e))!=null&&(a=+a)>=a&&(++n,r+=a)}if(n)return r/n}function He(e,t){return Le(e,.5,t)}function*Ue(e){for(let t of e)yield*t}function We(e){return Array.from(Ue(e))}function Ge(e,t){let n=new ae;if(t===void 0)for(let t of e)t!=null&&t>=t&&n.set(t,(n.get(t)||0)+1);else{let r=-1;for(let i of e)(i=t(i,++r,e))!=null&&i>=i&&n.set(i,(n.get(i)||0)+1)}let r,i=0;for(let[e,t]of n)t>i&&(i=t,r=e);return r}function Ke(e,t=qe){let n=[],r,i=!1;for(let a of e)i&&n.push(t(r,a)),r=a,i=!0;return n}function qe(e,t){return[e,t]}function Je(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=Math.max(0,Math.ceil((t-e)/n))|0,a=Array(i);++r<i;)a[r]=e+r*n;return a}function Ye(e,t=u){if(typeof e[Symbol.iterator]!=`function`)throw TypeError(`values is not iterable`);let n=Array.from(e),r=new Float64Array(n.length);t.length!==2&&(n=n.map(t),t=u);let i=(e,r)=>t(n[e],n[r]),a,o;return e=Uint32Array.from(n,(e,t)=>t),e.sort(t===u?(e,t)=>ye(n[e],n[t]):ve(i)),e.forEach((e,t)=>{let n=i(e,a===void 0?e:a);n>=0?((a===void 0||n>0)&&(a=e,o=t),r[e]=o):r[e]=NaN}),r}function Xe(e,t=u){let n,r=!1;if(t.length===1){let i;for(let a of e){let e=t(a);(r?u(e,i)<0:u(e,e)===0)&&(n=a,i=e,r=!0)}}else for(let i of e)(r?t(i,n)<0:t(i,i)===0)&&(n=i,r=!0);return n}function Ze(e,t){let n=0;if(t===void 0)for(let t of e)(t=+t)&&(n+=t);else{let r=-1;for(let i of e)(i=+t(i,++r,e))&&(n+=i)}return n}function Qe(e){if(typeof e[Symbol.iterator]!=`function`)throw TypeError(`values is not iterable`);return Array.from(e).reverse()}function $e(e){return e}var et=1,tt=2,nt=3,rt=4,at=1e-6;function ot(e){return`translate(`+e+`,0)`}function st(e){return`translate(0,`+e+`)`}function ct(e){return t=>+e(t)}function lt(e,t){return t=Math.max(0,e.bandwidth()-t*2)/2,e.round()&&(t=Math.round(t)),n=>+e(n)+t}function ut(){return!this.__axis}function dt(e,t){var n=[],r=null,i=null,a=6,o=6,s=3,c=typeof window<`u`&&window.devicePixelRatio>1?0:.5,l=e===et||e===rt?-1:1,u=e===rt||e===tt?`x`:`y`,d=e===et||e===nt?ot:st;function f(f){var p=r??(t.ticks?t.ticks.apply(t,n):t.domain()),m=i??(t.tickFormat?t.tickFormat.apply(t,n):$e),h=Math.max(a,0)+s,g=t.range(),_=+g[0]+c,v=+g[g.length-1]+c,y=(t.bandwidth?lt:ct)(t.copy(),c),b=f.selection?f.selection():f,x=b.selectAll(`.domain`).data([null]),S=b.selectAll(`.tick`).data(p,t).order(),C=S.exit(),w=S.enter().append(`g`).attr(`class`,`tick`),T=S.select(`line`),E=S.select(`text`);x=x.merge(x.enter().insert(`path`,`.tick`).attr(`class`,`domain`).attr(`stroke`,`currentColor`)),S=S.merge(w),T=T.merge(w.append(`line`).attr(`stroke`,`currentColor`).attr(u+`2`,l*a)),E=E.merge(w.append(`text`).attr(`fill`,`currentColor`).attr(u,l*h).attr(`dy`,e===et?`0em`:e===nt?`0.71em`:`0.32em`)),f!==b&&(x=x.transition(f),S=S.transition(f),T=T.transition(f),E=E.transition(f),C=C.transition(f).attr(`opacity`,at).attr(`transform`,function(e){return isFinite(e=y(e))?d(e+c):this.getAttribute(`transform`)}),w.attr(`opacity`,at).attr(`transform`,function(e){var t=this.parentNode.__axis;return d((t&&isFinite(t=t(e))?t:y(e))+c)})),C.remove(),x.attr(`d`,e===rt||e===tt?o?`M`+l*o+`,`+_+`H`+c+`V`+v+`H`+l*o:`M`+c+`,`+_+`V`+v:o?`M`+_+`,`+l*o+`V`+c+`H`+v+`V`+l*o:`M`+_+`,`+c+`H`+v),S.attr(`opacity`,1).attr(`transform`,function(e){return d(y(e)+c)}),T.attr(u+`2`,l*a),E.attr(u,l*h).text(m),b.filter(ut).attr(`fill`,`none`).attr(`font-size`,10).attr(`font-family`,`sans-serif`).attr(`text-anchor`,e===tt?`start`:e===rt?`end`:`middle`),b.each(function(){this.__axis=y})}return f.scale=function(e){return arguments.length?(t=e,f):t},f.ticks=function(){return n=Array.from(arguments),f},f.tickArguments=function(e){return arguments.length?(n=e==null?[]:Array.from(e),f):n.slice()},f.tickValues=function(e){return arguments.length?(r=e==null?null:Array.from(e),f):r&&r.slice()},f.tickFormat=function(e){return arguments.length?(i=e,f):i},f.tickSize=function(e){return arguments.length?(a=o=+e,f):a},f.tickSizeInner=function(e){return arguments.length?(a=+e,f):a},f.tickSizeOuter=function(e){return arguments.length?(o=+e,f):o},f.tickPadding=function(e){return arguments.length?(s=+e,f):s},f.offset=function(e){return arguments.length?(c=+e,f):c},f}function ft(e){return dt(nt,e)}var pt={value:()=>{}};function mt(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+``)||r in n||/[\s.]/.test(r))throw Error(`illegal type: `+r);n[r]=[]}return new ht(n)}function ht(e){this._=e}function gt(e,t){return e.trim().split(/^|\s+/).map(function(e){var n=``,r=e.indexOf(`.`);if(r>=0&&(n=e.slice(r+1),e=e.slice(0,r)),e&&!t.hasOwnProperty(e))throw Error(`unknown type: `+e);return{type:e,name:n}})}ht.prototype=mt.prototype={constructor:ht,on:function(e,t){var n=this._,r=gt(e+``,n),i,a=-1,o=r.length;if(arguments.length<2){for(;++a<o;)if((i=(e=r[a]).type)&&(i=_t(n[i],e.name)))return i}else{if(t!=null&&typeof t!=`function`)throw Error(`invalid callback: `+t);for(;++a<o;)if(i=(e=r[a]).type)n[i]=vt(n[i],e.name,t);else if(t==null)for(i in n)n[i]=vt(n[i],e.name,null);return this}},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new ht(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var n=Array(i),r=0,i,a;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw Error(`unknown type: `+e);for(a=this._[e],r=0,i=a.length;r<i;++r)a[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw Error(`unknown type: `+e);for(var r=this._[e],i=0,a=r.length;i<a;++i)r[i].value.apply(t,n)}};function _t(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function vt(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=pt,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var yt={svg:`http://www.w3.org/2000/svg`,xhtml:`http://www.w3.org/1999/xhtml`,xlink:`http://www.w3.org/1999/xlink`,xml:`http://www.w3.org/XML/1998/namespace`,xmlns:`http://www.w3.org/2000/xmlns/`};function bt(e){var t=e+=``,n=t.indexOf(`:`);return n>=0&&(t=e.slice(0,n))!==`xmlns`&&(e=e.slice(n+1)),yt.hasOwnProperty(t)?{space:yt[t],local:e}:e}function xt(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===`http://www.w3.org/1999/xhtml`&&t.documentElement.namespaceURI===`http://www.w3.org/1999/xhtml`?t.createElement(e):t.createElementNS(n,e)}}function St(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Ct(e){var t=bt(e);return(t.local?St:xt)(t)}function wt(){}function Tt(e){return e==null?wt:function(){return this.querySelector(e)}}function Et(e){typeof e!=`function`&&(e=Tt(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=Array(o),c,l,u=0;u<o;++u)(c=a[u])&&(l=e.call(c,c.__data__,u,a))&&(`__data__`in c&&(l.__data__=c.__data__),s[u]=l);return new hr(r,this._parents)}function Dt(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function Ot(){return[]}function kt(e){return e==null?Ot:function(){return this.querySelectorAll(e)}}function At(e){return function(){return Dt(e.apply(this,arguments))}}function jt(e){e=typeof e==`function`?At(e):kt(e);for(var t=this._groups,n=t.length,r=[],i=[],a=0;a<n;++a)for(var o=t[a],s=o.length,c,l=0;l<s;++l)(c=o[l])&&(r.push(e.call(c,c.__data__,l,o)),i.push(c));return new hr(r,i)}function Mt(e){return function(){return this.matches(e)}}function Nt(e){return function(t){return t.matches(e)}}var Pt=Array.prototype.find;function Ft(e){return function(){return Pt.call(this.children,e)}}function It(){return this.firstElementChild}function Lt(e){return this.select(e==null?It:Ft(typeof e==`function`?e:Nt(e)))}var Rt=Array.prototype.filter;function zt(){return Array.from(this.children)}function Bt(e){return function(){return Rt.call(this.children,e)}}function Vt(e){return this.selectAll(e==null?zt:Bt(typeof e==`function`?e:Nt(e)))}function Ht(e){typeof e!=`function`&&(e=Mt(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=[],c,l=0;l<o;++l)(c=a[l])&&e.call(c,c.__data__,l,a)&&s.push(c);return new hr(r,this._parents)}function Ut(e){return Array(e.length)}function Wt(){return new hr(this._enter||this._groups.map(Ut),this._parents)}function Gt(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Gt.prototype={constructor:Gt,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function Kt(e){return function(){return e}}function qt(e,t,n,r,i,a){for(var o=0,s,c=t.length,l=a.length;o<l;++o)(s=t[o])?(s.__data__=a[o],r[o]=s):n[o]=new Gt(e,a[o]);for(;o<c;++o)(s=t[o])&&(i[o]=s)}function Jt(e,t,n,r,i,a,o){var s,c,l=/* @__PURE__ */ new Map,u=t.length,d=a.length,f=Array(u),p;for(s=0;s<u;++s)(c=t[s])&&(f[s]=p=o.call(c,c.__data__,s,t)+``,l.has(p)?i[s]=c:l.set(p,c));for(s=0;s<d;++s)p=o.call(e,a[s],s,a)+``,(c=l.get(p))?(r[s]=c,c.__data__=a[s],l.delete(p)):n[s]=new Gt(e,a[s]);for(s=0;s<u;++s)(c=t[s])&&l.get(f[s])===c&&(i[s]=c)}function Yt(e){return e.__data__}function Xt(e,t){if(!arguments.length)return Array.from(this,Yt);var n=t?Jt:qt,r=this._parents,i=this._groups;typeof e!=`function`&&(e=Kt(e));for(var a=i.length,o=Array(a),s=Array(a),c=Array(a),l=0;l<a;++l){var u=r[l],d=i[l],f=d.length,p=Zt(e.call(u,u&&u.__data__,l,r)),m=p.length,h=s[l]=Array(m),g=o[l]=Array(m);n(u,d,h,g,c[l]=Array(f),p,t);for(var _=0,v=0,y,b;_<m;++_)if(y=h[_]){for(_>=v&&(v=_+1);!(b=g[v])&&++v<m;);y._next=b||null}}return o=new hr(o,r),o._enter=s,o._exit=c,o}function Zt(e){return typeof e==`object`&&`length`in e?e:Array.from(e)}function Qt(){return new hr(this._exit||this._groups.map(Ut),this._parents)}function $t(e,t,n){var r=this.enter(),i=this,a=this.exit();return typeof e==`function`?(r=e(r),r&&=r.selection()):r=r.append(e+``),t!=null&&(i=t(i),i&&=i.selection()),n==null?a.remove():n(a),r&&i?r.merge(i).order():i}function en(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,i=n.length,a=r.length,o=Math.min(i,a),s=Array(i),c=0;c<o;++c)for(var l=n[c],u=r[c],d=l.length,f=s[c]=Array(d),p,m=0;m<d;++m)(p=l[m]||u[m])&&(f[m]=p);for(;c<i;++c)s[c]=n[c];return new hr(s,this._parents)}function tn(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],i=r.length-1,a=r[i],o;--i>=0;)(o=r[i])&&(a&&o.compareDocumentPosition(a)^4&&a.parentNode.insertBefore(o,a),a=o);return this}function nn(e){e||=rn;function t(t,n){return t&&n?e(t.__data__,n.__data__):!t-!n}for(var n=this._groups,r=n.length,i=Array(r),a=0;a<r;++a){for(var o=n[a],s=o.length,c=i[a]=Array(s),l,u=0;u<s;++u)(l=o[u])&&(c[u]=l);c.sort(t)}return new hr(i,this._parents).order()}function rn(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function an(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function on(){return Array.from(this)}function sn(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,a=r.length;i<a;++i){var o=r[i];if(o)return o}return null}function cn(){let e=0;for(let t of this)++e;return e}function ln(){return!this.node()}function un(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var i=t[n],a=0,o=i.length,s;a<o;++a)(s=i[a])&&e.call(s,s.__data__,a,i);return this}function dn(e){return function(){this.removeAttribute(e)}}function fn(e){return function(){this.removeAttributeNS(e.space,e.local)}}function pn(e,t){return function(){this.setAttribute(e,t)}}function mn(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function hn(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function gn(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function _n(e,t){var n=bt(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((t==null?n.local?fn:dn:typeof t==`function`?n.local?gn:hn:n.local?mn:pn)(n,t))}function vn(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function yn(e){return function(){this.style.removeProperty(e)}}function bn(e,t,n){return function(){this.style.setProperty(e,t,n)}}function xn(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function Sn(e,t,n){return arguments.length>1?this.each((t==null?yn:typeof t==`function`?xn:bn)(e,t,n??``)):Cn(this.node(),e)}function Cn(e,t){return e.style.getPropertyValue(t)||vn(e).getComputedStyle(e,null).getPropertyValue(t)}function wn(e){return function(){delete this[e]}}function Tn(e,t){return function(){this[e]=t}}function En(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function Dn(e,t){return arguments.length>1?this.each((t==null?wn:typeof t==`function`?En:Tn)(e,t)):this.node()[e]}function On(e){return e.trim().split(/^|\s+/)}function kn(e){return e.classList||new An(e)}function An(e){this._node=e,this._names=On(e.getAttribute(`class`)||``)}An.prototype={add:function(e){this._names.indexOf(e)<0&&(this._names.push(e),this._node.setAttribute(`class`,this._names.join(` `)))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute(`class`,this._names.join(` `)))},contains:function(e){return this._names.indexOf(e)>=0}};function jn(e,t){for(var n=kn(e),r=-1,i=t.length;++r<i;)n.add(t[r])}function Mn(e,t){for(var n=kn(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}function Nn(e){return function(){jn(this,e)}}function Pn(e){return function(){Mn(this,e)}}function Fn(e,t){return function(){(t.apply(this,arguments)?jn:Mn)(this,e)}}function In(e,t){var n=On(e+``);if(arguments.length<2){for(var r=kn(this.node()),i=-1,a=n.length;++i<a;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof t==`function`?Fn:t?Nn:Pn)(n,t))}function Ln(){this.textContent=``}function Rn(e){return function(){this.textContent=e}}function zn(e){return function(){var t=e.apply(this,arguments);this.textContent=t??``}}function Bn(e){return arguments.length?this.each(e==null?Ln:(typeof e==`function`?zn:Rn)(e)):this.node().textContent}function Vn(){this.innerHTML=``}function Hn(e){return function(){this.innerHTML=e}}function Un(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??``}}function Wn(e){return arguments.length?this.each(e==null?Vn:(typeof e==`function`?Un:Hn)(e)):this.node().innerHTML}function Gn(){this.nextSibling&&this.parentNode.appendChild(this)}function Kn(){return this.each(Gn)}function qn(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Jn(){return this.each(qn)}function Yn(e){var t=typeof e==`function`?e:Ct(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function Xn(){return null}function Zn(e,t){var n=typeof e==`function`?e:Ct(e),r=t==null?Xn:typeof t==`function`?t:Tt(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function Qn(){var e=this.parentNode;e&&e.removeChild(this)}function $n(){return this.each(Qn)}function er(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function tr(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function nr(e){return this.select(e?tr:er)}function rr(e){return arguments.length?this.property(`__data__`,e):this.node().__data__}function ir(e){return function(t){e.call(this,t,this.__data__)}}function ar(e){return e.trim().split(/^|\s+/).map(function(e){var t=``,n=e.indexOf(`.`);return n>=0&&(t=e.slice(n+1),e=e.slice(0,n)),{type:e,name:t}})}function or(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,i=t.length,a;n<i;++n)a=t[n],(!e.type||a.type===e.type)&&a.name===e.name?this.removeEventListener(a.type,a.listener,a.options):t[++r]=a;++r?t.length=r:delete this.__on}}}function sr(e,t,n){return function(){var r=this.__on,i,a=ir(t);if(r){for(var o=0,s=r.length;o<s;++o)if((i=r[o]).type===e.type&&i.name===e.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=a,i.options=n),i.value=t;return}}this.addEventListener(e.type,a,n),i={type:e.type,name:e.name,value:t,listener:a,options:n},r?r.push(i):this.__on=[i]}}function cr(e,t,n){var r=ar(e+``),i,a=r.length,o;if(arguments.length<2){var s=this.node().__on;if(s){for(var c=0,l=s.length,u;c<l;++c)for(i=0,u=s[c];i<a;++i)if((o=r[i]).type===u.type&&o.name===u.name)return u.value}}else{for(s=t?sr:or,i=0;i<a;++i)this.each(s(r[i],t,n));return this}}function lr(e,t,n){var r=vn(e),i=r.CustomEvent;typeof i==`function`?i=new i(t,n):(i=r.document.createEvent(`Event`),n?(i.initEvent(t,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(t,!1,!1)),e.dispatchEvent(i)}function ur(e,t){return function(){return lr(this,e,t)}}function dr(e,t){return function(){return lr(this,e,t.apply(this,arguments))}}function fr(e,t){return this.each((typeof t==`function`?dr:ur)(e,t))}function*pr(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,a=r.length,o;i<a;++i)(o=r[i])&&(yield o)}var mr=[null];function hr(e,t){this._groups=e,this._parents=t}function gr(){return new hr([[document.documentElement]],mr)}function _r(){return this}hr.prototype=gr.prototype={constructor:hr,select:Et,selectAll:jt,selectChild:Lt,selectChildren:Vt,filter:Ht,data:Xt,enter:Wt,exit:Qt,join:$t,merge:en,selection:_r,order:tn,sort:nn,call:an,nodes:on,node:sn,size:cn,empty:ln,each:un,attr:_n,style:Sn,property:Dn,classed:In,text:Bn,html:Wn,raise:Kn,lower:Jn,append:Yn,insert:Zn,remove:$n,clone:nr,datum:rr,on:cr,dispatch:fr,[Symbol.iterator]:pr};function vr(e){return typeof e==`string`?new hr([[document.querySelector(e)]],[document.documentElement]):new hr([[e]],mr)}function yr(e){let t;for(;t=e.sourceEvent;)e=t;return e}function br(e,t){if(e=yr(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.y]}if(t.getBoundingClientRect){var i=t.getBoundingClientRect();return[e.clientX-i.left-t.clientLeft,e.clientY-i.top-t.clientTop]}}return[e.pageX,e.pageY]}function xr(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Sr(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Cr(){}var wr=.7,Tr=1/wr,Er=`\\s*([+-]?\\d+)\\s*`,Dr=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*`,Or=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*`,kr=/^#([0-9a-f]{3,8})$/,Ar=RegExp(`^rgb\\(${Er},${Er},${Er}\\)$`),jr=RegExp(`^rgb\\(${Or},${Or},${Or}\\)$`),Mr=RegExp(`^rgba\\(${Er},${Er},${Er},${Dr}\\)$`),Nr=RegExp(`^rgba\\(${Or},${Or},${Or},${Dr}\\)$`),Pr=RegExp(`^hsl\\(${Dr},${Or},${Or}\\)$`),Fr=RegExp(`^hsla\\(${Dr},${Or},${Or},${Dr}\\)$`),Ir={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};xr(Cr,Vr,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Lr,formatHex:Lr,formatHex8:Rr,formatHsl:zr,formatRgb:Br,toString:Br});function Lr(){return this.rgb().formatHex()}function Rr(){return this.rgb().formatHex8()}function zr(){return ei(this).formatHsl()}function Br(){return this.rgb().formatRgb()}function Vr(e){var t,n;return e=(e+``).trim().toLowerCase(),(t=kr.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?Hr(t):n===3?new Kr(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Ur(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Ur(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=Ar.exec(e))?new Kr(t[1],t[2],t[3],1):(t=jr.exec(e))?new Kr(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Mr.exec(e))?Ur(t[1],t[2],t[3],t[4]):(t=Nr.exec(e))?Ur(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=Pr.exec(e))?$r(t[1],t[2]/100,t[3]/100,1):(t=Fr.exec(e))?$r(t[1],t[2]/100,t[3]/100,t[4]):Ir.hasOwnProperty(e)?Hr(Ir[e]):e===`transparent`?new Kr(NaN,NaN,NaN,0):null}function Hr(e){return new Kr(e>>16&255,e>>8&255,e&255,1)}function Ur(e,t,n,r){return r<=0&&(e=t=n=NaN),new Kr(e,t,n,r)}function Wr(e){return e instanceof Cr||(e=Vr(e)),e?(e=e.rgb(),new Kr(e.r,e.g,e.b,e.opacity)):new Kr}function Gr(e,t,n,r){return arguments.length===1?Wr(e):new Kr(e,t,n,r??1)}function Kr(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}xr(Kr,Gr,Sr(Cr,{brighter(e){return e=e==null?Tr:Tr**+e,new Kr(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?wr:wr**+e,new Kr(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Kr(Zr(this.r),Zr(this.g),Zr(this.b),Xr(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:qr,formatHex:qr,formatHex8:Jr,formatRgb:Yr,toString:Yr}));function qr(){return`#${Qr(this.r)}${Qr(this.g)}${Qr(this.b)}`}function Jr(){return`#${Qr(this.r)}${Qr(this.g)}${Qr(this.b)}${Qr((isNaN(this.opacity)?1:this.opacity)*255)}`}function Yr(){let e=Xr(this.opacity);return`${e===1?`rgb(`:`rgba(`}${Zr(this.r)}, ${Zr(this.g)}, ${Zr(this.b)}${e===1?`)`:`, ${e})`}`}function Xr(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Zr(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Qr(e){return e=Zr(e),(e<16?`0`:``)+e.toString(16)}function $r(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new ni(e,t,n,r)}function ei(e){if(e instanceof ni)return new ni(e.h,e.s,e.l,e.opacity);if(e instanceof Cr||(e=Vr(e)),!e)return new ni;if(e instanceof ni)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),a=Math.max(t,n,r),o=NaN,s=a-i,c=(a+i)/2;return s?(o=t===a?(n-r)/s+(n<r)*6:n===a?(r-t)/s+2:(t-n)/s+4,s/=c<.5?a+i:2-a-i,o*=60):s=c>0&&c<1?0:o,new ni(o,s,c,e.opacity)}function ti(e,t,n,r){return arguments.length===1?ei(e):new ni(e,t,n,r??1)}function ni(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}xr(ni,ti,Sr(Cr,{brighter(e){return e=e==null?Tr:Tr**+e,new ni(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?wr:wr**+e,new ni(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new Kr(ai(e>=240?e-240:e+120,i,r),ai(e,i,r),ai(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new ni(ri(this.h),ii(this.s),ii(this.l),Xr(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){let e=Xr(this.opacity);return`${e===1?`hsl(`:`hsla(`}${ri(this.h)}, ${ii(this.s)*100}%, ${ii(this.l)*100}%${e===1?`)`:`, ${e})`}`}}));function ri(e){return e=(e||0)%360,e<0?e+360:e}function ii(e){return Math.max(0,Math.min(1,e||0))}function ai(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}let oi=Math.PI/180,si=180/Math.PI,ci=.96422,li=.82521,ui=4/29,di=6/29,fi=3*di*di;function pi(e){if(e instanceof hi)return new hi(e.l,e.a,e.b,e.opacity);if(e instanceof Si)return Ci(e);e instanceof Kr||(e=Wr(e));var t=yi(e.r),n=yi(e.g),r=yi(e.b),i=gi((.2225045*t+.7168786*n+.0606169*r)/1),a,o;return t===n&&n===r?a=o=i:(a=gi((.4360747*t+.3850649*n+.1430804*r)/ci),o=gi((.0139322*t+.0971045*n+.7141733*r)/li)),new hi(116*i-16,500*(a-i),200*(i-o),e.opacity)}function mi(e,t,n,r){return arguments.length===1?pi(e):new hi(e,t,n,r??1)}function hi(e,t,n,r){this.l=+e,this.a=+t,this.b=+n,this.opacity=+r}xr(hi,mi,Sr(Cr,{brighter(e){return new hi(this.l+18*(e??1),this.a,this.b,this.opacity)},darker(e){return new hi(this.l-18*(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=ci*_i(t),e=1*_i(e),n=li*_i(n),new Kr(vi(3.1338561*t-1.6168667*e-.4906146*n),vi(-.9787684*t+1.9161415*e+.033454*n),vi(.0719453*t-.2289914*e+1.4052427*n),this.opacity)}}));function gi(e){return e>.008856451679035631?e**(1/3):e/fi+ui}function _i(e){return e>di?e*e*e:fi*(e-ui)}function vi(e){return 255*(e<=.0031308?12.92*e:1.055*e**(1/2.4)-.055)}function yi(e){return(e/=255)<=.04045?e/12.92:((e+.055)/1.055)**2.4}function bi(e){if(e instanceof Si)return new Si(e.h,e.c,e.l,e.opacity);if(e instanceof hi||(e=pi(e)),e.a===0&&e.b===0)return new Si(NaN,0<e.l&&e.l<100?0:NaN,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*si;return new Si(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}function xi(e,t,n,r){return arguments.length===1?bi(e):new Si(e,t,n,r??1)}function Si(e,t,n,r){this.h=+e,this.c=+t,this.l=+n,this.opacity=+r}function Ci(e){if(isNaN(e.h))return new hi(e.l,0,0,e.opacity);var t=e.h*oi;return new hi(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}xr(Si,xi,Sr(Cr,{brighter(e){return new Si(this.h,this.c,this.l+18*(e??1),this.opacity)},darker(e){return new Si(this.h,this.c,this.l-18*(e??1),this.opacity)},rgb(){return Ci(this).rgb()}}));var wi=-.14861,Ti=1.78277,Ei=-.29227,Di=-.90649,Oi=1.97294,ki=Oi*Di,Ai=Oi*Ti,ji=Ti*Ei-Di*wi;function Mi(e){if(e instanceof Pi)return new Pi(e.h,e.s,e.l,e.opacity);e instanceof Kr||(e=Wr(e));var t=e.r/255,n=e.g/255,r=e.b/255,i=(ji*r+ki*t-Ai*n)/(ji+ki-Ai),a=r-i,o=(Oi*(n-i)-Ei*a)/Di,s=Math.sqrt(o*o+a*a)/(Oi*i*(1-i)),c=s?Math.atan2(o,a)*si-120:NaN;return new Pi(c<0?c+360:c,s,i,e.opacity)}function Ni(e,t,n,r){return arguments.length===1?Mi(e):new Pi(e,t,n,r??1)}function Pi(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}xr(Pi,Ni,Sr(Cr,{brighter(e){return e=e==null?Tr:Tr**+e,new Pi(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?wr:wr**+e,new Pi(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=isNaN(this.h)?0:(this.h+120)*oi,t=+this.l,n=isNaN(this.s)?0:this.s*t*(1-t),r=Math.cos(e),i=Math.sin(e);return new Kr(255*(t+n*(wi*r+Ti*i)),255*(t+n*(Ei*r+Di*i)),255*(t+Oi*r*n),this.opacity)}}));function Fi(e,t,n,r,i){var a=e*e,o=a*e;return((1-3*e+3*a-o)*t+(4-6*a+3*o)*n+(1+3*e+3*a-3*o)*r+o*i)/6}function Ii(e){var t=e.length-1;return function(n){var r=n<=0?n=0:n>=1?(n=1,t-1):Math.floor(n*t),i=e[r],a=e[r+1],o=r>0?e[r-1]:2*i-a,s=r<t-1?e[r+2]:2*a-i;return Fi((n-r/t)*t,o,i,a,s)}}var Li=e=>()=>e;function Ri(e,t){return function(n){return e+n*t}}function zi(e,t,n){return e**=+n,t=t**+n-e,n=1/n,function(r){return(e+r*t)**+n}}function Bi(e,t){var n=t-e;return n?Ri(e,n>180||n<-180?n-360*Math.round(n/360):n):Li(isNaN(e)?t:e)}function Vi(e){return(e=+e)==1?Hi:function(t,n){return n-t?zi(t,n,e):Li(isNaN(t)?n:t)}}function Hi(e,t){var n=t-e;return n?Ri(e,n):Li(isNaN(e)?t:e)}var Ui=(function e(t){var n=Vi(t);function r(e,t){var r=n((e=Gr(e)).r,(t=Gr(t)).r),i=n(e.g,t.g),a=n(e.b,t.b),o=Hi(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=a(t),e.opacity=o(t),e+``}}return r.gamma=e,r})(1);function Wi(e){return function(t){for(var n=t.length,r=Array(n),i=Array(n),a=Array(n),o=0,s;o<n;++o)s=Gr(t[o]),r[o]=s.r||0,i[o]=s.g||0,a[o]=s.b||0;return r=e(r),i=e(i),a=e(a),s.opacity=1,function(e){return s.r=r(e),s.g=i(e),s.b=a(e),s+``}}}var Gi=Wi(Ii);function Ki(e,t){t||=[];var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(a){for(i=0;i<n;++i)r[i]=e[i]*(1-a)+t[i]*a;return r}}function qi(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function Ji(e,t){for(var n=t?t.length:0,r=e?Math.min(n,e.length):0,i=Array(r),a=Array(n),o=0;o<r;++o)i[o]=ra(e[o],t[o]);for(;o<n;++o)a[o]=t[o];return function(e){for(o=0;o<r;++o)a[o]=i[o](e);return a}}function Yi(e,t){var n=/* @__PURE__ */ new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function Xi(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function Zi(e,t){var n={},r={},i;for(i in(typeof e!=`object`||!e)&&(e={}),(typeof t!=`object`||!t)&&(t={}),t)i in e?n[i]=ra(e[i],t[i]):r[i]=t[i];return function(e){for(i in n)r[i]=n[i](e);return r}}var Qi=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,$i=new RegExp(Qi.source,`g`);function ea(e){return function(){return e}}function ta(e){return function(t){return e(t)+``}}function na(e,t){var n=Qi.lastIndex=$i.lastIndex=0,r,i,a,o=-1,s=[],c=[];for(e+=``,t+=``;(r=Qi.exec(e))&&(i=$i.exec(t));)(a=i.index)>n&&(a=t.slice(n,a),s[o]?s[o]+=a:s[++o]=a),(r=r[0])===(i=i[0])?s[o]?s[o]+=i:s[++o]=i:(s[++o]=null,c.push({i:o,x:Xi(r,i)})),n=$i.lastIndex;return n<t.length&&(a=t.slice(n),s[o]?s[o]+=a:s[++o]=a),s.length<2?c[0]?ta(c[0].x):ea(t):(t=c.length,function(e){for(var n=0,r;n<t;++n)s[(r=c[n]).i]=r.x(e);return s.join(``)})}function ra(e,t){var n=typeof t,r;return t==null||n===`boolean`?Li(t):(n===`number`?Xi:n===`string`?(r=Vr(t))?(t=r,Ui):na:t instanceof Vr?Ui:t instanceof Date?Yi:qi(t)?Ki:Array.isArray(t)?Ji:typeof t.valueOf!=`function`&&typeof t.toString!=`function`||isNaN(t)?Zi:Xi)(e,t)}function ia(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}var aa=180/Math.PI,oa={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function sa(e,t,n,r,i,a){var o,s,c;return(o=Math.sqrt(e*e+t*t))&&(e/=o,t/=o),(c=e*n+t*r)&&(n-=e*c,r-=t*c),(s=Math.sqrt(n*n+r*r))&&(n/=s,r/=s,c/=s),e*r<t*n&&(e=-e,t=-t,c=-c,o=-o),{translateX:i,translateY:a,rotate:Math.atan2(t,e)*aa,skewX:Math.atan(c)*aa,scaleX:o,scaleY:s}}var ca;function la(e){let t=new(typeof DOMMatrix==`function`?DOMMatrix:WebKitCSSMatrix)(e+``);return t.isIdentity?oa:sa(t.a,t.b,t.c,t.d,t.e,t.f)}function ua(e){return e==null||(ca||=document.createElementNS(`http://www.w3.org/2000/svg`,`g`),ca.setAttribute(`transform`,e),!(e=ca.transform.baseVal.consolidate()))?oa:(e=e.matrix,sa(e.a,e.b,e.c,e.d,e.e,e.f))}function da(e,t,n,r){function i(e){return e.length?e.pop()+` `:``}function a(e,r,i,a,o,s){if(e!==i||r!==a){var c=o.push(`translate(`,null,t,null,n);s.push({i:c-4,x:Xi(e,i)},{i:c-2,x:Xi(r,a)})}else(i||a)&&o.push(`translate(`+i+t+a+n)}function o(e,t,n,a){e===t?t&&n.push(i(n)+`rotate(`+t+r):(e-t>180?t+=360:t-e>180&&(e+=360),a.push({i:n.push(i(n)+`rotate(`,null,r)-2,x:Xi(e,t)}))}function s(e,t,n,a){e===t?t&&n.push(i(n)+`skewX(`+t+r):a.push({i:n.push(i(n)+`skewX(`,null,r)-2,x:Xi(e,t)})}function c(e,t,n,r,a,o){if(e!==n||t!==r){var s=a.push(i(a)+`scale(`,null,`,`,null,`)`);o.push({i:s-4,x:Xi(e,n)},{i:s-2,x:Xi(t,r)})}else(n!==1||r!==1)&&a.push(i(a)+`scale(`+n+`,`+r+`)`)}return function(t,n){var r=[],i=[];return t=e(t),n=e(n),a(t.translateX,t.translateY,n.translateX,n.translateY,r,i),o(t.rotate,n.rotate,r,i),s(t.skewX,n.skewX,r,i),c(t.scaleX,t.scaleY,n.scaleX,n.scaleY,r,i),t=n=null,function(e){for(var t=-1,n=i.length,a;++t<n;)r[(a=i[t]).i]=a.x(e);return r.join(``)}}}var fa=da(la,`px, `,`px)`,`deg)`),pa=da(ua,`, `,`)`,`)`);function ma(e){return function(t,n){var r=e((t=ti(t)).h,(n=ti(n)).h),i=Hi(t.s,n.s),a=Hi(t.l,n.l),o=Hi(t.opacity,n.opacity);return function(e){return t.h=r(e),t.s=i(e),t.l=a(e),t.opacity=o(e),t+``}}}var ha=ma(Bi);function ga(e,t){var n=Hi((e=mi(e)).l,(t=mi(t)).l),r=Hi(e.a,t.a),i=Hi(e.b,t.b),a=Hi(e.opacity,t.opacity);return function(t){return e.l=n(t),e.a=r(t),e.b=i(t),e.opacity=a(t),e+``}}function _a(e){return function(t,n){var r=e((t=xi(t)).h,(n=xi(n)).h),i=Hi(t.c,n.c),a=Hi(t.l,n.l),o=Hi(t.opacity,n.opacity);return function(e){return t.h=r(e),t.c=i(e),t.l=a(e),t.opacity=o(e),t+``}}}var va=_a(Bi);function ya(e){return(function t(n){n=+n;function r(t,r){var i=e((t=Ni(t)).h,(r=Ni(r)).h),a=Hi(t.s,r.s),o=Hi(t.l,r.l),s=Hi(t.opacity,r.opacity);return function(e){return t.h=i(e),t.s=a(e),t.l=o(e**+n),t.opacity=s(e),t+``}}return r.gamma=t,r})(1)}ya(Bi);var ba=ya(Hi);function xa(e,t){t===void 0&&(t=e,e=ra);for(var n=0,r=t.length-1,i=t[0],a=Array(r<0?0:r);n<r;)a[n]=e(i,i=t[++n]);return function(e){var t=Math.max(0,Math.min(r-1,Math.floor(e*=r)));return a[t](e-t)}}function Sa(e,t){for(var n=Array(t),r=0;r<t;++r)n[r]=e(r/(t-1));return n}var Ca=0,wa=0,Ta=0,Ea=1e3,Da,Oa,ka=0,Aa=0,ja=0,Ma=typeof performance==`object`&&performance.now?performance:Date,Na=typeof window==`object`&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Pa(){return Aa||=(Na(Fa),Ma.now()+ja)}function Fa(){Aa=0}function Ia(){this._call=this._time=this._next=null}Ia.prototype=La.prototype={constructor:Ia,restart:function(e,t,n){if(typeof e!=`function`)throw TypeError(`callback is not a function`);n=(n==null?Pa():+n)+(t==null?0:+t),!this._next&&Oa!==this&&(Oa?Oa._next=this:Da=this,Oa=this),this._call=e,this._time=n,Ha()},stop:function(){this._call&&(this._call=null,this._time=1/0,Ha())}};function La(e,t,n){var r=new Ia;return r.restart(e,t,n),r}function Ra(){Pa(),++Ca;for(var e=Da,t;e;)(t=Aa-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Ca}function za(){Aa=(ka=Ma.now())+ja,Ca=wa=0;try{Ra()}finally{Ca=0,Va(),Aa=0}}function Ba(){var e=Ma.now(),t=e-ka;t>Ea&&(ja-=t,ka=e)}function Va(){for(var e,t=Da,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:Da=n);Oa=e,Ha(r)}function Ha(e){Ca||(wa&&=clearTimeout(wa),e-Aa>24?(e<1/0&&(wa=setTimeout(za,e-Ma.now()-ja)),Ta&&=clearInterval(Ta)):(Ta||=(ka=Ma.now(),setInterval(Ba,Ea)),Ca=1,Na(za)))}function Ua(e,t,n){var r=new Ia;return t=t==null?0:+t,r.restart(n=>{r.stop(),e(n+t)},t,n),r}var Wa=mt(`start`,`end`,`cancel`,`interrupt`),Ga=[];function Ka(e,t,n,r,i,a){var o=e.__transition;if(!o)e.__transition={};else if(n in o)return;Xa(e,n,{name:t,index:r,group:i,on:Wa,tween:Ga,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:0})}function qa(e,t){var n=Ya(e,t);if(n.state>0)throw Error(`too late; already scheduled`);return n}function Ja(e,t){var n=Ya(e,t);if(n.state>3)throw Error(`too late; already running`);return n}function Ya(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw Error(`transition not found`);return n}function Xa(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=La(a,0,n.time);function a(e){n.state=1,n.timer.restart(o,n.delay,n.time),n.delay<=e&&o(e-n.delay)}function o(a){var l,u,d,f;if(n.state!==1)return c();for(l in r)if(f=r[l],f.name===n.name){if(f.state===3)return Ua(o);f.state===4?(f.state=6,f.timer.stop(),f.on.call(`interrupt`,e,e.__data__,f.index,f.group),delete r[l]):+l<t&&(f.state=6,f.timer.stop(),f.on.call(`cancel`,e,e.__data__,f.index,f.group),delete r[l])}if(Ua(function(){n.state===3&&(n.state=4,n.timer.restart(s,n.delay,n.time),s(a))}),n.state=2,n.on.call(`start`,e,e.__data__,n.index,n.group),n.state===2){for(n.state=3,i=Array(d=n.tween.length),l=0,u=-1;l<d;++l)(f=n.tween[l].value.call(e,e.__data__,n.index,n.group))&&(i[++u]=f);i.length=u+1}}function s(t){for(var r=t<n.duration?n.ease.call(null,t/n.duration):(n.timer.restart(c),n.state=5,1),a=-1,o=i.length;++a<o;)i[a].call(e,r);n.state===5&&(n.on.call(`end`,e,e.__data__,n.index,n.group),c())}function c(){for(var i in n.state=6,n.timer.stop(),delete r[t],r)return;delete e.__transition}}function Za(e,t){var n=e.__transition,r,i,a=!0,o;if(n){for(o in t=t==null?null:t+``,n)(r=n[o]).name===t?(i=r.state>2&&r.state<5,r.state=6,r.timer.stop(),r.on.call(i?`interrupt`:`cancel`,e,e.__data__,r.index,r.group),delete n[o]):a=!1;a&&delete e.__transition}}function Qa(e){return this.each(function(){Za(this,e)})}function $a(e,t){var n,r;return function(){var i=Ja(this,e),a=i.tween;if(a!==n){r=n=a;for(var o=0,s=r.length;o<s;++o)if(r[o].name===t){r=r.slice(),r.splice(o,1);break}}i.tween=r}}function eo(e,t,n){var r,i;if(typeof n!=`function`)throw Error();return function(){var a=Ja(this,e),o=a.tween;if(o!==r){i=(r=o).slice();for(var s={name:t,value:n},c=0,l=i.length;c<l;++c)if(i[c].name===t){i[c]=s;break}c===l&&i.push(s)}a.tween=i}}function to(e,t){var n=this._id;if(e+=``,arguments.length<2){for(var r=Ya(this.node(),n).tween,i=0,a=r.length,o;i<a;++i)if((o=r[i]).name===e)return o.value;return null}return this.each((t==null?$a:eo)(n,e,t))}function no(e,t,n){var r=e._id;return e.each(function(){var e=Ja(this,r);(e.value||={})[t]=n.apply(this,arguments)}),function(e){return Ya(e,r).value[t]}}function ro(e,t){var n;return(typeof t==`number`?Xi:t instanceof Vr?Ui:(n=Vr(t))?(t=n,Ui):na)(e,t)}function io(e){return function(){this.removeAttribute(e)}}function ao(e){return function(){this.removeAttributeNS(e.space,e.local)}}function oo(e,t,n){var r,i=n+``,a;return function(){var o=this.getAttribute(e);return o===i?null:o===r?a:a=t(r=o,n)}}function so(e,t,n){var r,i=n+``,a;return function(){var o=this.getAttributeNS(e.space,e.local);return o===i?null:o===r?a:a=t(r=o,n)}}function co(e,t,n){var r,i,a;return function(){var o,s=n(this),c;return s==null?void this.removeAttribute(e):(o=this.getAttribute(e),c=s+``,o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s)))}}function lo(e,t,n){var r,i,a;return function(){var o,s=n(this),c;return s==null?void this.removeAttributeNS(e.space,e.local):(o=this.getAttributeNS(e.space,e.local),c=s+``,o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s)))}}function uo(e,t){var n=bt(e),r=n===`transform`?pa:ro;return this.attrTween(e,typeof t==`function`?(n.local?lo:co)(n,r,no(this,`attr.`+e,t)):t==null?(n.local?ao:io)(n):(n.local?so:oo)(n,r,t))}function fo(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function po(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function mo(e,t){var n,r;function i(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&po(e,i)),n}return i._value=t,i}function ho(e,t){var n,r;function i(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&fo(e,i)),n}return i._value=t,i}function go(e,t){var n=`attr.`+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!=`function`)throw Error();var r=bt(e);return this.tween(n,(r.local?mo:ho)(r,t))}function _o(e,t){return function(){qa(this,e).delay=+t.apply(this,arguments)}}function vo(e,t){return t=+t,function(){qa(this,e).delay=t}}function yo(e){var t=this._id;return arguments.length?this.each((typeof e==`function`?_o:vo)(t,e)):Ya(this.node(),t).delay}function bo(e,t){return function(){Ja(this,e).duration=+t.apply(this,arguments)}}function xo(e,t){return t=+t,function(){Ja(this,e).duration=t}}function So(e){var t=this._id;return arguments.length?this.each((typeof e==`function`?bo:xo)(t,e)):Ya(this.node(),t).duration}function Co(e,t){if(typeof t!=`function`)throw Error();return function(){Ja(this,e).ease=t}}function wo(e){var t=this._id;return arguments.length?this.each(Co(t,e)):Ya(this.node(),t).ease}function To(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!=`function`)throw Error();Ja(this,e).ease=n}}function Eo(e){if(typeof e!=`function`)throw Error();return this.each(To(this._id,e))}function Do(e){typeof e!=`function`&&(e=Mt(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=[],c,l=0;l<o;++l)(c=a[l])&&e.call(c,c.__data__,l,a)&&s.push(c);return new ns(r,this._parents,this._name,this._id)}function Oo(e){if(e._id!==this._id)throw Error();for(var t=this._groups,n=e._groups,r=t.length,i=n.length,a=Math.min(r,i),o=Array(r),s=0;s<a;++s)for(var c=t[s],l=n[s],u=c.length,d=o[s]=Array(u),f,p=0;p<u;++p)(f=c[p]||l[p])&&(d[p]=f);for(;s<r;++s)o[s]=t[s];return new ns(o,this._parents,this._name,this._id)}function ko(e){return(e+``).trim().split(/^|\s+/).every(function(e){var t=e.indexOf(`.`);return t>=0&&(e=e.slice(0,t)),!e||e===`start`})}function Ao(e,t,n){var r,i,a=ko(t)?qa:Ja;return function(){var o=a(this,e),s=o.on;s!==r&&(i=(r=s).copy()).on(t,n),o.on=i}}function jo(e,t){var n=this._id;return arguments.length<2?Ya(this.node(),n).on.on(e):this.each(Ao(n,e,t))}function Mo(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function No(){return this.on(`end.remove`,Mo(this._id))}function Po(e){var t=this._name,n=this._id;typeof e!=`function`&&(e=Tt(e));for(var r=this._groups,i=r.length,a=Array(i),o=0;o<i;++o)for(var s=r[o],c=s.length,l=a[o]=Array(c),u,d,f=0;f<c;++f)(u=s[f])&&(d=e.call(u,u.__data__,f,s))&&(`__data__`in u&&(d.__data__=u.__data__),l[f]=d,Ka(l[f],t,n,f,l,Ya(u,n)));return new ns(a,this._parents,t,n)}function Fo(e){var t=this._name,n=this._id;typeof e!=`function`&&(e=kt(e));for(var r=this._groups,i=r.length,a=[],o=[],s=0;s<i;++s)for(var c=r[s],l=c.length,u,d=0;d<l;++d)if(u=c[d]){for(var f=e.call(u,u.__data__,d,c),p,m=Ya(u,n),h=0,g=f.length;h<g;++h)(p=f[h])&&Ka(p,t,n,h,f,m);a.push(f),o.push(u)}return new ns(a,o,t,n)}var Io=gr.prototype.constructor;function Lo(){return new Io(this._groups,this._parents)}function Ro(e,t){var n,r,i;return function(){var a=Cn(this,e),o=(this.style.removeProperty(e),Cn(this,e));return a===o?null:a===n&&o===r?i:i=t(n=a,r=o)}}function zo(e){return function(){this.style.removeProperty(e)}}function Bo(e,t,n){var r,i=n+``,a;return function(){var o=Cn(this,e);return o===i?null:o===r?a:a=t(r=o,n)}}function Vo(e,t,n){var r,i,a;return function(){var o=Cn(this,e),s=n(this),c=s+``;return s??(c=s=(this.style.removeProperty(e),Cn(this,e))),o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s))}}function Ho(e,t){var n,r,i,a=`style.`+t,o=`end.`+a,s;return function(){var c=Ja(this,e),l=c.on,u=c.value[a]==null?s||=zo(t):void 0;(l!==n||i!==u)&&(r=(n=l).copy()).on(o,i=u),c.on=r}}function Uo(e,t,n){var r=(e+=``)==`transform`?fa:ro;return t==null?this.styleTween(e,Ro(e,r)).on(`end.style.`+e,zo(e)):typeof t==`function`?this.styleTween(e,Vo(e,r,no(this,`style.`+e,t))).each(Ho(this._id,e)):this.styleTween(e,Bo(e,r,t),n).on(`end.style.`+e,null)}function Wo(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function Go(e,t,n){var r,i;function a(){var a=t.apply(this,arguments);return a!==i&&(r=(i=a)&&Wo(e,a,n)),r}return a._value=t,a}function Ko(e,t,n){var r=`style.`+(e+=``);if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!=`function`)throw Error();return this.tween(r,Go(e,t,n??``))}function qo(e){return function(){this.textContent=e}}function Jo(e){return function(){var t=e(this);this.textContent=t??``}}function Yo(e){return this.tween(`text`,typeof e==`function`?Jo(no(this,`text`,e)):qo(e==null?``:e+``))}function Xo(e){return function(t){this.textContent=e.call(this,t)}}function Zo(e){var t,n;function r(){var r=e.apply(this,arguments);return r!==n&&(t=(n=r)&&Xo(r)),t}return r._value=e,r}function Qo(e){var t=`text`;if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!=`function`)throw Error();return this.tween(t,Zo(e))}function $o(){for(var e=this._name,t=this._id,n=rs(),r=this._groups,i=r.length,a=0;a<i;++a)for(var o=r[a],s=o.length,c,l=0;l<s;++l)if(c=o[l]){var u=Ya(c,t);Ka(c,e,n,l,o,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new ns(r,this._parents,e,n)}function es(){var e,t,n=this,r=n._id,i=n.size();return new Promise(function(a,o){var s={value:o},c={value:function(){--i===0&&a()}};n.each(function(){var n=Ja(this,r),i=n.on;i!==e&&(t=(e=i).copy(),t._.cancel.push(s),t._.interrupt.push(s),t._.end.push(c)),n.on=t}),i===0&&a()})}var ts=0;function ns(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function rs(){return++ts}var is=gr.prototype;ns.prototype={constructor:ns,select:Po,selectAll:Fo,selectChild:is.selectChild,selectChildren:is.selectChildren,filter:Do,merge:Oo,selection:Lo,transition:$o,call:is.call,nodes:is.nodes,node:is.node,size:is.size,empty:is.empty,each:is.each,on:jo,attr:uo,attrTween:go,style:Uo,styleTween:Ko,text:Yo,textTween:Qo,remove:No,tween:to,delay:yo,duration:So,ease:wo,easeVarying:Eo,end:es,[Symbol.iterator]:is[Symbol.iterator]};function as(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var os={time:null,delay:0,duration:250,ease:as};function ss(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw Error(`transition ${t} not found`);return n}function cs(e){var t,n;e instanceof ns?(t=e._id,e=e._name):(t=rs(),(n=os).time=Pa(),e=e==null?null:e+``);for(var r=this._groups,i=r.length,a=0;a<i;++a)for(var o=r[a],s=o.length,c,l=0;l<s;++l)(c=o[l])&&Ka(c,e,t,l,o,n||ss(c,t));return new ns(r,this._parents,e,t)}gr.prototype.interrupt=Qa,gr.prototype.transition=cs;let{abs:ls,max:us,min:ds}=Math;[`w`,`e`].map(fs),[`n`,`s`].map(fs),[`n`,`w`,`e`,`s`,`nw`,`ne`,`sw`,`se`].map(fs);function fs(e){return{type:e}}let ps=Math.PI,ms=2*ps,hs=1e-6,gs=ms-hs;function _s(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function vs(e){let t=Math.floor(e);if(!(t>=0))throw Error(`invalid digits: ${e}`);if(t>15)return _s;let n=10**t;return function(e){this._+=e[0];for(let t=1,r=e.length;t<r;++t)this._+=Math.round(arguments[t]*n)/n+e[t]}}var ys=class{constructor(e){this._x0=this._y0=this._x1=this._y1=null,this._=``,this._append=e==null?_s:vs(e)}moveTo(e,t){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(e,t){this._append`L${this._x1=+e},${this._y1=+t}`}quadraticCurveTo(e,t,n,r){this._append`Q${+e},${+t},${this._x1=+n},${this._y1=+r}`}bezierCurveTo(e,t,n,r,i,a){this._append`C${+e},${+t},${+n},${+r},${this._x1=+i},${this._y1=+a}`}arcTo(e,t,n,r,i){if(e=+e,t=+t,n=+n,r=+r,i=+i,i<0)throw Error(`negative radius: ${i}`);let a=this._x1,o=this._y1,s=n-e,c=r-t,l=a-e,u=o-t,d=l*l+u*u;if(this._x1===null)this._append`M${this._x1=e},${this._y1=t}`;else if(d>hs){if(!(Math.abs(u*s-c*l)>hs)||!i)this._append`L${this._x1=e},${this._y1=t}`;else{let f=n-a,p=r-o,m=s*s+c*c,h=f*f+p*p,g=Math.sqrt(m),_=Math.sqrt(d),v=i*Math.tan((ps-Math.acos((m+d-h)/(2*g*_)))/2),y=v/_,b=v/g;Math.abs(y-1)>hs&&this._append`L${e+y*l},${t+y*u}`,this._append`A${i},${i},0,0,${+(u*f>l*p)},${this._x1=e+b*s},${this._y1=t+b*c}`}}}arc(e,t,n,r,i,a){if(e=+e,t=+t,n=+n,a=!!a,n<0)throw Error(`negative radius: ${n}`);let o=n*Math.cos(r),s=n*Math.sin(r),c=e+o,l=t+s,u=1^a,d=a?r-i:i-r;this._x1===null?this._append`M${c},${l}`:(Math.abs(this._x1-c)>hs||Math.abs(this._y1-l)>hs)&&this._append`L${c},${l}`,n&&(d<0&&(d=d%ms+ms),d>gs?this._append`A${n},${n},0,1,${u},${e-o},${t-s}A${n},${n},0,1,${u},${this._x1=c},${this._y1=l}`:d>hs&&this._append`A${n},${n},0,${+(d>=ps)},${u},${this._x1=e+n*Math.cos(i)},${this._y1=t+n*Math.sin(i)}`)}rect(e,t,n,r){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}h${n=+n}v${+r}h${-n}Z`}toString(){return this._}};ys.prototype;function bs(e=3){return new ys(+e)}var xs=Array.prototype.slice;function Ss(e,t){return e-t}function Cs(e){for(var t=0,n=e.length,r=e[n-1][1]*e[0][0]-e[n-1][0]*e[0][1];++t<n;)r+=e[t-1][1]*e[t][0]-e[t-1][0]*e[t][1];return r}var ws=e=>()=>e;function Ts(e,t){for(var n=-1,r=t.length,i;++n<r;)if(i=Es(e,t[n]))return i;return 0}function Es(e,t){for(var n=t[0],r=t[1],i=-1,a=0,o=e.length,s=o-1;a<o;s=a++){var c=e[a],l=c[0],u=c[1],d=e[s],f=d[0],p=d[1];if(Ds(c,d,t))return 0;u>r!=p>r&&n<(f-l)*(r-u)/(p-u)+l&&(i=-i)}return i}function Ds(e,t,n){var r;return Os(e,t,n)&&ks(e[r=+(e[0]===t[0])],n[r],t[r])}function Os(e,t,n){return(t[0]-e[0])*(n[1]-e[1])===(n[0]-e[0])*(t[1]-e[1])}function ks(e,t,n){return e<=t&&t<=n||n<=t&&t<=e}function As(){}var js=[[],[[[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 Ms(){var e=1,t=1,n=ke,r=c;function i(e){var t=n(e);if(Array.isArray(t))t=t.slice().sort(Ss);else{let n=j(e,Ns);for(t=Te(...Oe(n[0],n[1],t),t);t[t.length-1]>=n[1];)t.pop();for(;t[1]<n[0];)t.shift()}return t.map(t=>a(e,t))}function a(e,t){let n=t==null?NaN:+t;if(isNaN(n))throw Error(`invalid value: ${t}`);var i=[],a=[];return o(e,n,function(t){r(t,e,n),Cs(t)>0?i.push([t]):a.push(t)}),a.forEach(function(e){for(var t=0,n=i.length,r;t<n;++t)if(Ts((r=i[t])[0],e)!==-1){r.push(e);return}}),{type:`MultiPolygon`,value:t,coordinates:i}}function o(n,r,i){var a=[],o=[],c=l=-1,l,u,d=Ps(n[0],r),f,p;for(js[d<<1].forEach(m);++c<e-1;)u=d,d=Ps(n[c+1],r),js[u|d<<1].forEach(m);for(js[d|0].forEach(m);++l<t-1;){for(c=-1,d=Ps(n[l*e+e],r),f=Ps(n[l*e],r),js[d<<1|f<<2].forEach(m);++c<e-1;)u=d,d=Ps(n[l*e+e+c+1],r),p=f,f=Ps(n[l*e+c+1],r),js[u|d<<1|f<<2|p<<3].forEach(m);js[d|f<<3].forEach(m)}for(c=-1,f=n[l*e]>=r,js[f<<2].forEach(m);++c<e-1;)p=f,f=Ps(n[l*e+c+1],r),js[f<<2|p<<3].forEach(m);js[f<<3].forEach(m);function m(e){var t=[e[0][0]+c,e[0][1]+l],n=[e[1][0]+c,e[1][1]+l],r=s(t),u=s(n),d,f;(d=o[r])?(f=a[u])?(delete o[d.end],delete a[f.start],d===f?(d.ring.push(n),i(d.ring)):a[d.start]=o[f.end]={start:d.start,end:f.end,ring:d.ring.concat(f.ring)}):(delete o[d.end],d.ring.push(n),o[d.end=u]=d):(d=a[u])?(f=o[r])?(delete a[d.start],delete o[f.end],d===f?(d.ring.push(n),i(d.ring)):a[f.start]=o[d.end]={start:f.start,end:d.end,ring:f.ring.concat(d.ring)}):(delete a[d.start],d.ring.unshift(t),a[d.start=r]=d):a[r]=o[u]={start:r,end:u,ring:[t,n]}}}function s(t){return t[0]*2+t[1]*(e+1)*4}function c(n,r,i){n.forEach(function(n){var a=n[0],o=n[1],s=a|0,c=o|0,l=Fs(r[c*e+s]);a>0&&a<e&&s===a&&(n[0]=Is(a,Fs(r[c*e+s-1]),l,i)),o>0&&o<t&&c===o&&(n[1]=Is(o,Fs(r[(c-1)*e+s]),l,i))})}return i.contour=a,i.size=function(n){if(!arguments.length)return[e,t];var r=Math.floor(n[0]),a=Math.floor(n[1]);if(!(r>=0&&a>=0))throw Error(`invalid size`);return e=r,t=a,i},i.thresholds=function(e){return arguments.length?(n=typeof e==`function`?e:ws(Array.isArray(e)?xs.call(e):e),i):n},i.smooth=function(e){return arguments.length?(r=e?c:As,i):r===c},i}function Ns(e){return isFinite(e)?e:NaN}function Ps(e,t){return e!=null&&+e>=t}function Fs(e){return e==null||isNaN(e=+e)?-1/0:e}function Is(e,t,n,r){let i=r-t,a=n-t,o=isFinite(i)||isFinite(a)?i/a:Math.sign(i)/Math.sign(a);return isNaN(o)?e:e+o-.5}function Ls(e){return e[0]}function Rs(e){return e[1]}function zs(){return 1}function Bs(){var e=Ls,t=Rs,n=zs,r=960,i=500,a=20,o=2,s=a*3,c=r+s*2>>o,l=i+s*2>>o,u=ws(20);function d(r){var i=new Float32Array(c*l),u=2**-o,d=-1;for(let a of r){var f=(e(a,++d,r)+s)*u,p=(t(a,d,r)+s)*u,m=+n(a,d,r);if(m&&f>=0&&f<c&&p>=0&&p<l){var h=Math.floor(f),g=Math.floor(p),_=f-h-.5,y=p-g-.5;i[h+g*c]+=(1-_)*(1-y)*m,i[h+1+g*c]+=_*(1-y)*m,i[h+1+(g+1)*c]+=_*y*m,i[h+(g+1)*c]+=(1-_)*y*m}}return v({data:i,width:c,height:l},a*u),i}function f(e){var t=d(e),n=u(t),r=2**(2*o);return Array.isArray(n)||(n=Te(Number.MIN_VALUE,Ae(t)/r,n)),Ms().size([c,l]).thresholds(n.map(e=>e*r))(t).map((e,t)=>(e.value=+n[t],p(e)))}f.contours=function(e){var t=d(e),n=Ms().size([c,l]),r=2**(2*o),i=e=>{e=+e;var i=p(n.contour(t,e*r));return i.value=e,i};return Object.defineProperty(i,"max",{get:()=>Ae(t)/r}),i};function p(e){return e.coordinates.forEach(m),e}function m(e){e.forEach(h)}function h(e){e.forEach(g)}function g(e){e[0]=e[0]*2**o-s,e[1]=e[1]*2**o-s}function _(){return s=a*3,c=r+s*2>>o,l=i+s*2>>o,f}return f.x=function(t){return arguments.length?(e=typeof t==`function`?t:ws(+t),f):e},f.y=function(e){return arguments.length?(t=typeof e==`function`?e:ws(+e),f):t},f.weight=function(e){return arguments.length?(n=typeof e==`function`?e:ws(+e),f):n},f.size=function(e){if(!arguments.length)return[r,i];var t=+e[0],n=+e[1];if(!(t>=0&&n>=0))throw Error(`invalid size`);return r=t,i=n,_()},f.cellSize=function(e){if(!arguments.length)return 1<<o;if(!((e=+e)>=1))throw Error(`invalid cell size`);return o=Math.floor(Math.log(e)/Math.LN2),_()},f.thresholds=function(e){return arguments.length?(u=typeof e==`function`?e:ws(Array.isArray(e)?xs.call(e):e),f):u},f.bandwidth=function(e){if(!arguments.length)return Math.sqrt(a*(a+1));if(!((e=+e)>=0))throw Error(`invalid bandwidth`);return a=(Math.sqrt(4*e*e+1)-1)/2,_()},f}let Vs=134217729;function Hs(e,t,n,r,i){let a,o,s,c,l=t[0],u=r[0],d=0,f=0;u>l==u>-l?(a=l,l=t[++d]):(a=u,u=r[++f]);let p=0;if(d<e&&f<n)for(u>l==u>-l?(o=l+a,s=a-(o-l),l=t[++d]):(o=u+a,s=a-(o-u),u=r[++f]),a=o,s!==0&&(i[p++]=s);d<e&&f<n;)u>l==u>-l?(o=a+l,c=o-a,s=a-(o-c)+(l-c),l=t[++d]):(o=a+u,c=o-a,s=a-(o-c)+(u-c),u=r[++f]),a=o,s!==0&&(i[p++]=s);for(;d<e;)o=a+l,c=o-a,s=a-(o-c)+(l-c),l=t[++d],a=o,s!==0&&(i[p++]=s);for(;f<n;)o=a+u,c=o-a,s=a-(o-c)+(u-c),u=r[++f],a=o,s!==0&&(i[p++]=s);return(a!==0||p===0)&&(i[p++]=a),p}function Us(e,t){let n=t[0];for(let r=1;r<e;r++)n+=t[r];return n}function M(e){return new Float64Array(e)}let Ws=M(4),Gs=M(8),Ks=M(12),qs=M(16),Js=M(4);function Ys(e,t,n,r,i,a,o){let s,c,l,u,d,f,p,m,h,g,_,v,y,b,x,S,C,w,T=e-i,E=n-i,D=t-a,O=r-a;b=T*O,f=Vs*T,p=f-(f-T),m=T-p,f=Vs*O,h=f-(f-O),g=O-h,x=m*g-(b-p*h-m*h-p*g),S=D*E,f=Vs*D,p=f-(f-D),m=D-p,f=Vs*E,h=f-(f-E),g=E-h,C=m*g-(S-p*h-m*h-p*g),_=x-C,d=x-_,Ws[0]=x-(_+d)+(d-C),v=b+_,d=v-b,y=b-(v-d)+(_-d),_=y-S,d=y-_,Ws[1]=y-(_+d)+(d-S),w=v+_,d=w-v,Ws[2]=v-(w-d)+(_-d),Ws[3]=w;let k=Us(4,Ws),A=22204460492503146e-32*o;if(k>=A||-k>=A||(d=e-T,s=e-(T+d)+(d-i),d=n-E,l=n-(E+d)+(d-i),d=t-D,c=t-(D+d)+(d-a),d=r-O,u=r-(O+d)+(d-a),s===0&&c===0&&l===0&&u===0)||(A=11093356479670487e-47*o+33306690738754706e-32*Math.abs(k),k+=T*u+O*s-(D*l+E*c),k>=A||-k>=A))return k;b=s*O,f=Vs*s,p=f-(f-s),m=s-p,f=Vs*O,h=f-(f-O),g=O-h,x=m*g-(b-p*h-m*h-p*g),S=c*E,f=Vs*c,p=f-(f-c),m=c-p,f=Vs*E,h=f-(f-E),g=E-h,C=m*g-(S-p*h-m*h-p*g),_=x-C,d=x-_,Js[0]=x-(_+d)+(d-C),v=b+_,d=v-b,y=b-(v-d)+(_-d),_=y-S,d=y-_,Js[1]=y-(_+d)+(d-S),w=v+_,d=w-v,Js[2]=v-(w-d)+(_-d),Js[3]=w;let ee=Hs(4,Ws,4,Js,Gs);b=T*u,f=Vs*T,p=f-(f-T),m=T-p,f=Vs*u,h=f-(f-u),g=u-h,x=m*g-(b-p*h-m*h-p*g),S=D*l,f=Vs*D,p=f-(f-D),m=D-p,f=Vs*l,h=f-(f-l),g=l-h,C=m*g-(S-p*h-m*h-p*g),_=x-C,d=x-_,Js[0]=x-(_+d)+(d-C),v=b+_,d=v-b,y=b-(v-d)+(_-d),_=y-S,d=y-_,Js[1]=y-(_+d)+(d-S),w=v+_,d=w-v,Js[2]=v-(w-d)+(_-d),Js[3]=w;let te=Hs(ee,Gs,4,Js,Ks);b=s*u,f=Vs*s,p=f-(f-s),m=s-p,f=Vs*u,h=f-(f-u),g=u-h,x=m*g-(b-p*h-m*h-p*g),S=c*l,f=Vs*c,p=f-(f-c),m=c-p,f=Vs*l,h=f-(f-l),g=l-h,C=m*g-(S-p*h-m*h-p*g),_=x-C,d=x-_,Js[0]=x-(_+d)+(d-C),v=b+_,d=v-b,y=b-(v-d)+(_-d),_=y-S,d=y-_,Js[1]=y-(_+d)+(d-S),w=v+_,d=w-v,Js[2]=v-(w-d)+(_-d),Js[3]=w;let ne=Hs(te,Ks,4,Js,qs);return qs[ne-1]}function Xs(e,t,n,r,i,a){let o=(t-a)*(n-i),s=(e-i)*(r-a),c=o-s,l=Math.abs(o+s);return Math.abs(c)>=33306690738754716e-32*l?c:-Ys(e,t,n,r,i,a,l)}M(4),M(4),M(4),M(4),M(4),M(4),M(4),M(4),M(4),M(8),M(8),M(8),M(4),M(8),M(8),M(16),M(12),M(192),M(192),M(4),M(4),M(4),M(4),M(4),M(4),M(4),M(4),M(8),M(8),M(8),M(8),M(8),M(8),M(8),M(8),M(8),M(4),M(4),M(4),M(8),M(16),M(16),M(16),M(32),M(32),M(48),M(64),M(1152),M(1152),M(4),M(4),M(4),M(4),M(4),M(4),M(4),M(4),M(4),M(4),M(24),M(24),M(24),M(24),M(24),M(24),M(24),M(24),M(24),M(24),M(1152),M(1152),M(1152),M(1152),M(1152),M(2304),M(2304),M(3456),M(5760),M(8),M(8),M(8),M(16),M(24),M(48),M(48),M(96),M(192),M(384),M(384),M(384),M(768),M(96),M(96),M(96),M(1152);let Zs=2**-52,Qs=/* @__PURE__ */ new Uint32Array(512);var $s=class e{static from(t,n=sc,r=cc){let i=t.length,a=new Float64Array(i*2);for(let e=0;e<i;e++){let i=t[e];a[2*e]=n(i),a[2*e+1]=r(i)}return new e(a)}constructor(e){let t=e.length>>1;if(t>0&&typeof e[0]!=`number`)throw Error(`Expected coords to contain numbers.`);this.coords=e;let n=Math.max(2*t-5,0);this._triangles=new Uint32Array(n*3),this._halfedges=new Int32Array(n*3),this._hashSize=Math.ceil(Math.sqrt(t)),this._hullPrev=new Uint32Array(t),this._hullNext=new Uint32Array(t),this._hullTri=new Uint32Array(t),this._hullHash=new Int32Array(this._hashSize),this._ids=new Uint32Array(t),this._dists=new Float64Array(t),this.trianglesLen=0,this._cx=0,this._cy=0,this._hullStart=0,this.hull=this._triangles,this.triangles=this._triangles,this.halfedges=this._halfedges,this.update()}update(){let{coords:e,_hullPrev:t,_hullNext:n,_hullTri:r,_hullHash:i}=this,a=e.length>>1,o=1/0,s=1/0,c=-1/0,l=-1/0;for(let t=0;t<a;t++){let n=e[2*t],r=e[2*t+1];n<o&&(o=n),r<s&&(s=r),n>c&&(c=n),r>l&&(l=r),this._ids[t]=t}let u=(o+c)/2,d=(s+l)/2,f=0,p=0,m=0;for(let t=0,n=1/0;t<a;t++){let r=tc(u,d,e[2*t],e[2*t+1]);r<n&&(f=t,n=r)}let h=e[2*f],g=e[2*f+1];for(let t=0,n=1/0;t<a;t++){if(t===f)continue;let r=tc(h,g,e[2*t],e[2*t+1]);r<n&&r>0&&(p=t,n=r)}let _=e[2*p],v=e[2*p+1],y=1/0;for(let t=0;t<a;t++){if(t===f||t===p)continue;let n=rc(h,g,_,v,e[2*t],e[2*t+1]);n<y&&(m=t,y=n)}let b=e[2*m],x=e[2*m+1];if(y===1/0){for(let t=0;t<a;t++)this._dists[t]=e[2*t]-e[0]||e[2*t+1]-e[1];ac(this._ids,this._dists,0,a-1);let t=new Uint32Array(a),n=0;for(let e=0,r=-1/0;e<a;e++){let i=this._ids[e],a=this._dists[i];a>r&&(t[n++]=i,r=a)}this.hull=t.subarray(0,n),this.triangles=/* @__PURE__ */ new Uint32Array,this.halfedges=/* @__PURE__ */ new Int32Array;return}if(Xs(h,g,_,v,b,x)<0){let e=p,t=_,n=v;p=m,_=b,v=x,m=e,b=t,x=n}let S=ic(h,g,_,v,b,x);this._cx=S.x,this._cy=S.y;for(let t=0;t<a;t++)this._dists[t]=tc(e[2*t],e[2*t+1],S.x,S.y);ac(this._ids,this._dists,0,a-1),this._hullStart=f;let C=3;n[f]=t[m]=p,n[p]=t[f]=m,n[m]=t[p]=f,r[f]=0,r[p]=1,r[m]=2,i.fill(-1),i[this._hashKey(h,g)]=f,i[this._hashKey(_,v)]=p,i[this._hashKey(b,x)]=m,this.trianglesLen=0,this._addTriangle(f,p,m,-1,-1,-1);for(let a=0,o=0,s=0;a<this._ids.length;a++){let c=this._ids[a],l=e[2*c],u=e[2*c+1];if(a>0&&Math.abs(l-o)<=Zs&&Math.abs(u-s)<=Zs||(o=l,s=u,c===f||c===p||c===m))continue;let d=0;for(let e=0,t=this._hashKey(l,u);e<this._hashSize&&(d=i[(t+e)%this._hashSize],d===-1||d===n[d]);e++);d=t[d];let h=d,g;for(;g=n[h],Xs(l,u,e[2*h],e[2*h+1],e[2*g],e[2*g+1])>=0;)if(h=g,h===d){h=-1;break}if(h===-1)continue;let _=this._addTriangle(h,c,n[h],-1,-1,r[h]);r[c]=this._legalize(_+2),r[h]=_,C++;let v=n[h];for(;g=n[v],Xs(l,u,e[2*v],e[2*v+1],e[2*g],e[2*g+1])<0;)_=this._addTriangle(v,c,g,r[c],-1,r[v]),r[c]=this._legalize(_+2),n[v]=v,C--,v=g;if(h===d)for(;g=t[h],Xs(l,u,e[2*g],e[2*g+1],e[2*h],e[2*h+1])<0;)_=this._addTriangle(g,c,h,-1,r[h],r[g]),this._legalize(_+2),r[g]=_,n[h]=h,C--,h=g;this._hullStart=t[c]=h,n[h]=t[v]=c,n[c]=v,i[this._hashKey(l,u)]=c,i[this._hashKey(e[2*h],e[2*h+1])]=h}this.hull=new Uint32Array(C);for(let e=0,t=this._hullStart;e<C;e++)this.hull[e]=t,t=n[t];this.triangles=this._triangles.subarray(0,this.trianglesLen),this.halfedges=this._halfedges.subarray(0,this.trianglesLen)}_hashKey(e,t){return Math.floor(ec(e-this._cx,t-this._cy)*this._hashSize)%this._hashSize}_legalize(e){let{_triangles:t,_halfedges:n,coords:r}=this,i=0,a=0;for(;;){let o=n[e],s=e-e%3;if(a=s+(e+2)%3,o===-1){if(i===0)break;e=Qs[--i];continue}let c=o-o%3,l=s+(e+1)%3,u=c+(o+2)%3,d=t[a],f=t[e],p=t[l],m=t[u];if(nc(r[2*d],r[2*d+1],r[2*f],r[2*f+1],r[2*p],r[2*p+1],r[2*m],r[2*m+1])){t[e]=m,t[o]=d;let r=n[u];if(r===-1){let t=this._hullStart;do{if(this._hullTri[t]===u){this._hullTri[t]=e;break}t=this._hullPrev[t]}while(t!==this._hullStart)}this._link(e,r),this._link(o,n[a]),this._link(a,u);let s=c+(o+1)%3;i<Qs.length&&(Qs[i++]=s)}else{if(i===0)break;e=Qs[--i]}}return a}_link(e,t){this._halfedges[e]=t,t!==-1&&(this._halfedges[t]=e)}_addTriangle(e,t,n,r,i,a){let o=this.trianglesLen;return this._triangles[o]=e,this._triangles[o+1]=t,this._triangles[o+2]=n,this._link(o,r),this._link(o+1,i),this._link(o+2,a),this.trianglesLen+=3,o}};function ec(e,t){let n=e/(Math.abs(e)+Math.abs(t));return(t>0?3-n:1+n)/4}function tc(e,t,n,r){let i=e-n,a=t-r;return i*i+a*a}function nc(e,t,n,r,i,a,o,s){let c=e-o,l=t-s,u=n-o,d=r-s,f=i-o,p=a-s,m=c*c+l*l,h=u*u+d*d,g=f*f+p*p;return c*(d*g-h*p)-l*(u*g-h*f)+m*(u*p-d*f)<0}function rc(e,t,n,r,i,a){let o=n-e,s=r-t,c=i-e,l=a-t,u=o*o+s*s,d=c*c+l*l,f=.5/(o*l-s*c),p=(l*u-s*d)*f,m=(o*d-c*u)*f;return p*p+m*m}function ic(e,t,n,r,i,a){let o=n-e,s=r-t,c=i-e,l=a-t,u=o*o+s*s,d=c*c+l*l,f=.5/(o*l-s*c);return{x:e+(l*u-s*d)*f,y:t+(o*d-c*u)*f}}function ac(e,t,n,r){if(r-n<=20)for(let i=n+1;i<=r;i++){let r=e[i],a=t[r],o=i-1;for(;o>=n&&t[e[o]]>a;)e[o+1]=e[o--];e[o+1]=r}else{let i=n+r>>1,a=n+1,o=r;oc(e,i,a),t[e[n]]>t[e[r]]&&oc(e,n,r),t[e[a]]>t[e[r]]&&oc(e,a,r),t[e[n]]>t[e[a]]&&oc(e,n,a);let s=e[a],c=t[s];for(;;){do a++;while(t[e[a]]<c);do o--;while(t[e[o]]>c);if(o<a)break;oc(e,a,o)}e[n+1]=e[o],e[o]=s,r-a+1>=o-n?(ac(e,t,a,r),ac(e,t,n,o-1)):(ac(e,t,n,o-1),ac(e,t,a,r))}}function oc(e,t,n){let r=e[t];e[t]=e[n],e[n]=r}function sc(e){return e[0]}function cc(e){return e[1]}let lc=1e-6;var uc=class{constructor(){this._x0=this._y0=this._x1=this._y1=null,this._=``}moveTo(e,t){this._+=`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._+=`Z`)}lineTo(e,t){this._+=`L${this._x1=+e},${this._y1=+t}`}arc(e,t,n){e=+e,t=+t,n=+n;let r=e+n,i=t;if(n<0)throw Error(`negative radius`);this._x1===null?this._+=`M${r},${i}`:(Math.abs(this._x1-r)>lc||Math.abs(this._y1-i)>lc)&&(this._+=`L`+r+`,`+i),n&&(this._+=`A${n},${n},0,1,1,${e-n},${t}A${n},${n},0,1,1,${this._x1=r},${this._y1=i}`)}rect(e,t,n,r){this._+=`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}h${+n}v${+r}h${-n}Z`}value(){return this._||null}},dc=class{constructor(){this._=[]}moveTo(e,t){this._.push([e,t])}closePath(){this._.push(this._[0].slice())}lineTo(e,t){this._.push([e,t])}value(){return this._.length?this._:null}},fc=class{constructor(e,[t,n,r,i]=[0,0,960,500]){if(!((r=+r)>=(t=+t))||!((i=+i)>=(n=+n)))throw Error(`invalid bounds`);this.delaunay=e,this._circumcenters=new Float64Array(e.points.length*2),this.vectors=new Float64Array(e.points.length*2),this.xmax=r,this.xmin=t,this.ymax=i,this.ymin=n,this._init()}update(){return this.delaunay.update(),this._init(),this}_init(){let{delaunay:{points:e,hull:t,triangles:n},vectors:r}=this,i,a,o=this.circumcenters=this._circumcenters.subarray(0,n.length/3*2);for(let r=0,s=0,c=n.length,l,u;r<c;r+=3,s+=2){let c=n[r]*2,d=n[r+1]*2,f=n[r+2]*2,p=e[c],m=e[c+1],h=e[d],g=e[d+1],_=e[f],v=e[f+1],y=h-p,b=g-m,x=_-p,S=v-m,C=(y*S-b*x)*2;if(Math.abs(C)<1e-9){if(i===void 0){i=a=0;for(let n of t)i+=e[n*2],a+=e[n*2+1];i/=t.length,a/=t.length}let n=1e9*Math.sign((i-p)*S-(a-m)*x);l=(p+_)/2-n*S,u=(m+v)/2+n*x}else{let e=1/C,t=y*y+b*b,n=x*x+S*S;l=p+(S*t-b*n)*e,u=m+(y*n-x*t)*e}o[s]=l,o[s+1]=u}let s=t[t.length-1],c,l=s*4,u,d=e[2*s],f,p=e[2*s+1];r.fill(0);for(let n=0;n<t.length;++n)s=t[n],c=l,u=d,f=p,l=s*4,d=e[2*s],p=e[2*s+1],r[c+2]=r[l]=f-p,r[c+3]=r[l+1]=d-u}render(e){let t=e==null?e=new uc:void 0,{delaunay:{halfedges:n,inedges:r,hull:i},circumcenters:a,vectors:o}=this;if(i.length<=1)return null;for(let t=0,r=n.length;t<r;++t){let r=n[t];if(r<t)continue;let i=Math.floor(t/3)*2,o=Math.floor(r/3)*2,s=a[i],c=a[i+1],l=a[o],u=a[o+1];this._renderSegment(s,c,l,u,e)}let s,c=i[i.length-1];for(let t=0;t<i.length;++t){s=c,c=i[t];let n=Math.floor(r[c]/3)*2,l=a[n],u=a[n+1],d=s*4,f=this._project(l,u,o[d+2],o[d+3]);f&&this._renderSegment(l,u,f[0],f[1],e)}return t&&t.value()}renderBounds(e){let t=e==null?e=new uc:void 0;return e.rect(this.xmin,this.ymin,this.xmax-this.xmin,this.ymax-this.ymin),t&&t.value()}renderCell(e,t){let n=t==null?t=new uc:void 0,r=this._clip(e);if(r===null||!r.length)return;t.moveTo(r[0],r[1]);let i=r.length;for(;r[0]===r[i-2]&&r[1]===r[i-1]&&i>1;)i-=2;for(let e=2;e<i;e+=2)(r[e]!==r[e-2]||r[e+1]!==r[e-1])&&t.lineTo(r[e],r[e+1]);return t.closePath(),n&&n.value()}*cellPolygons(){let{delaunay:{points:e}}=this;for(let t=0,n=e.length/2;t<n;++t){let e=this.cellPolygon(t);e&&(e.index=t,yield e)}}cellPolygon(e){let t=new dc;return this.renderCell(e,t),t.value()}_renderSegment(e,t,n,r,i){let a,o=this._regioncode(e,t),s=this._regioncode(n,r);o===0&&s===0?(i.moveTo(e,t),i.lineTo(n,r)):(a=this._clipSegment(e,t,n,r,o,s))&&(i.moveTo(a[0],a[1]),i.lineTo(a[2],a[3]))}contains(e,t,n){return t=+t,t!==t||(n=+n,n!==n)?!1:this.delaunay._step(e,t,n)===e}*neighbors(e){let t=this._clip(e);if(t)for(let n of this.delaunay.neighbors(e)){let e=this._clip(n);if(e){loop:for(let r=0,i=t.length;r<i;r+=2)for(let a=0,o=e.length;a<o;a+=2)if(t[r]===e[a]&&t[r+1]===e[a+1]&&t[(r+2)%i]===e[(a+o-2)%o]&&t[(r+3)%i]===e[(a+o-1)%o]){yield n;break loop}}}}_cell(e){let{circumcenters:t,delaunay:{inedges:n,halfedges:r,triangles:i}}=this,a=n[e];if(a===-1)return null;let o=[],s=a;do{let n=Math.floor(s/3);if(o.push(t[n*2],t[n*2+1]),s=s%3==2?s-2:s+1,i[s]!==e)break;s=r[s]}while(s!==a&&s!==-1);return o}_clip(e){if(e===0&&this.delaunay.hull.length===1)return[this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax,this.xmin,this.ymin];let t=this._cell(e);if(t===null)return null;let{vectors:n}=this,r=e*4;return this._simplify(n[r]||n[r+1]?this._clipInfinite(e,t,n[r],n[r+1],n[r+2],n[r+3]):this._clipFinite(e,t))}_clipFinite(e,t){let n=t.length,r=null,i,a,o=t[n-2],s=t[n-1],c,l=this._regioncode(o,s),u,d=0;for(let f=0;f<n;f+=2)if(i=o,a=s,o=t[f],s=t[f+1],c=l,l=this._regioncode(o,s),c===0&&l===0)u=d,d=0,r?r.push(o,s):r=[o,s];else{let t,n,f,p,m;if(c===0){if((t=this._clipSegment(i,a,o,s,c,l))===null)continue;[n,f,p,m]=t}else{if((t=this._clipSegment(o,s,i,a,l,c))===null)continue;[p,m,n,f]=t,u=d,d=this._edgecode(n,f),u&&d&&this._edge(e,u,d,r,r.length),r?r.push(n,f):r=[n,f]}u=d,d=this._edgecode(p,m),u&&d&&this._edge(e,u,d,r,r.length),r?r.push(p,m):r=[p,m]}if(r)u=d,d=this._edgecode(r[0],r[1]),u&&d&&this._edge(e,u,d,r,r.length);else if(this.contains(e,(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(e,t,n,r,i,a){let o=i<a;for(o&&([e,t,n,r,i,a]=[n,r,e,t,a,i]);;){if(i===0&&a===0)return o?[n,r,e,t]:[e,t,n,r];if(i&a)return null;let s,c,l=i||a;l&8?(s=e+(n-e)*(this.ymax-t)/(r-t),c=this.ymax):l&4?(s=e+(n-e)*(this.ymin-t)/(r-t),c=this.ymin):l&2?(c=t+(r-t)*(this.xmax-e)/(n-e),s=this.xmax):(c=t+(r-t)*(this.xmin-e)/(n-e),s=this.xmin),i?(e=s,t=c,i=this._regioncode(e,t)):(n=s,r=c,a=this._regioncode(n,r))}}_clipInfinite(e,t,n,r,i,a){let o=Array.from(t),s;if((s=this._project(o[0],o[1],n,r))&&o.unshift(s[0],s[1]),(s=this._project(o[o.length-2],o[o.length-1],i,a))&&o.push(s[0],s[1]),o=this._clipFinite(e,o))for(let t=0,n=o.length,r,i=this._edgecode(o[n-2],o[n-1]);t<n;t+=2)r=i,i=this._edgecode(o[t],o[t+1]),r&&i&&(t=this._edge(e,r,i,o,t),n=o.length);else this.contains(e,(this.xmin+this.xmax)/2,(this.ymin+this.ymax)/2)&&(o=[this.xmin,this.ymin,this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax]);return o}_edge(e,t,n,r,i){for(;t!==n;){let n,a;switch(t){case 5:t=4;continue;case 4:t=6,n=this.xmax,a=this.ymin;break;case 6:t=2;continue;case 2:t=10,n=this.xmax,a=this.ymax;break;case 10:t=8;continue;case 8:t=9,n=this.xmin,a=this.ymax;break;case 9:t=1;continue;case 1:t=5,n=this.xmin,a=this.ymin}(r[i]!==n||r[i+1]!==a)&&this.contains(e,n,a)&&(r.splice(i,0,n,a),i+=2)}return i}_project(e,t,n,r){let i=1/0,a,o,s;if(r<0){if(t<=this.ymin)return null;(a=(this.ymin-t)/r)<i&&(s=this.ymin,o=e+(i=a)*n)}else if(r>0){if(t>=this.ymax)return null;(a=(this.ymax-t)/r)<i&&(s=this.ymax,o=e+(i=a)*n)}if(n>0){if(e>=this.xmax)return null;(a=(this.xmax-e)/n)<i&&(o=this.xmax,s=t+(i=a)*r)}else if(n<0){if(e<=this.xmin)return null;(a=(this.xmin-e)/n)<i&&(o=this.xmin,s=t+(i=a)*r)}return[o,s]}_edgecode(e,t){return(e===this.xmin?1:e===this.xmax?2:0)|(t===this.ymin?4:t===this.ymax?8:0)}_regioncode(e,t){return(e<this.xmin?1:e>this.xmax?2:0)|(t<this.ymin?4:t>this.ymax?8:0)}_simplify(e){if(e&&e.length>4){for(let t=0;t<e.length;t+=2){let n=(t+2)%e.length,r=(t+4)%e.length;(e[t]===e[n]&&e[n]===e[r]||e[t+1]===e[n+1]&&e[n+1]===e[r+1])&&(e.splice(n,2),t-=2)}e.length||(e=null)}return e}};let pc=2*Math.PI,mc=Math.pow;function hc(e){return e[0]}function gc(e){return e[1]}function _c(e){let{triangles:t,coords:n}=e;for(let e=0;e<t.length;e+=3){let r=2*t[e],i=2*t[e+1],a=2*t[e+2];if((n[a]-n[r])*(n[i+1]-n[r+1])-(n[i]-n[r])*(n[a+1]-n[r+1])>1e-10)return!1}return!0}function vc(e,t,n){return[e+Math.sin(e+t)*n,t+Math.cos(e-t)*n]}var yc=class e{static from(t,n=hc,r=gc,i){return new e(`length`in t?bc(t,n,r,i):Float64Array.from(xc(t,n,r,i)))}constructor(e){this._delaunator=new $s(e),this.inedges=new Int32Array(e.length/2),this._hullIndex=new Int32Array(e.length/2),this.points=this._delaunator.coords,this._init()}update(){return this._delaunator.update(),this._init(),this}_init(){let e=this._delaunator,t=this.points;if(e.hull&&e.hull.length>2&&_c(e)){this.collinear=Int32Array.from({length:t.length/2},(e,t)=>t).sort((e,n)=>t[2*e]-t[2*n]||t[2*e+1]-t[2*n+1]);let e=this.collinear[0],n=this.collinear[this.collinear.length-1],r=[t[2*e],t[2*e+1],t[2*n],t[2*n+1]],i=1e-8*Math.hypot(r[3]-r[1],r[2]-r[0]);for(let e=0,n=t.length/2;e<n;++e){let n=vc(t[2*e],t[2*e+1],i);t[2*e]=n[0],t[2*e+1]=n[1]}this._delaunator=new $s(t)}else delete this.collinear;let n=this.halfedges=this._delaunator.halfedges,r=this.hull=this._delaunator.hull,i=this.triangles=this._delaunator.triangles,a=this.inedges.fill(-1),o=this._hullIndex.fill(-1);for(let e=0,t=n.length;e<t;++e){let t=i[e%3==2?e-2:e+1];(n[e]===-1||a[t]===-1)&&(a[t]=e)}for(let e=0,t=r.length;e<t;++e)o[r[e]]=e;r.length<=2&&r.length>0&&(this.triangles=(/* @__PURE__ */ new Int32Array(3)).fill(-1),this.halfedges=(/* @__PURE__ */ new Int32Array(3)).fill(-1),this.triangles[0]=r[0],a[r[0]]=1,r.length===2&&(a[r[1]]=0,this.triangles[1]=r[1],this.triangles[2]=r[1]))}voronoi(e){return new fc(this,e)}*neighbors(e){let{inedges:t,hull:n,_hullIndex:r,halfedges:i,triangles:a,collinear:o}=this;if(o){let t=o.indexOf(e);t>0&&(yield o[t-1]),t<o.length-1&&(yield o[t+1]);return}let s=t[e];if(s===-1)return;let c=s,l=-1;do{if(yield l=a[c],c=c%3==2?c-2:c+1,a[c]!==e)return;if(c=i[c],c===-1){let t=n[(r[e]+1)%n.length];t!==l&&(yield t);return}}while(c!==s)}find(e,t,n=0){if(e=+e,e!==e||(t=+t,t!==t))return-1;let r=n,i;for(;(i=this._step(n,e,t))>=0&&i!==n&&i!==r;)n=i;return i}_step(e,t,n){let{inedges:r,hull:i,_hullIndex:a,halfedges:o,triangles:s,points:c}=this;if(r[e]===-1||!c.length)return(e+1)%(c.length>>1);let l=e,u=mc(t-c[e*2],2)+mc(n-c[e*2+1],2),d=r[e],f=d;do{let r=s[f],d=mc(t-c[r*2],2)+mc(n-c[r*2+1],2);if(d<u&&(u=d,l=r),f=f%3==2?f-2:f+1,s[f]!==e)break;if(f=o[f],f===-1){if(f=i[(a[e]+1)%i.length],f!==r&&mc(t-c[f*2],2)+mc(n-c[f*2+1],2)<u)return f;break}}while(f!==d);return l}render(e){let t=e==null?e=new uc:void 0,{points:n,halfedges:r,triangles:i}=this;for(let t=0,a=r.length;t<a;++t){let a=r[t];if(a<t)continue;let o=i[t]*2,s=i[a]*2;e.moveTo(n[o],n[o+1]),e.lineTo(n[s],n[s+1])}return this.renderHull(e),t&&t.value()}renderPoints(e,t){t===void 0&&(!e||typeof e.moveTo!=`function`)&&(t=e,e=null),t=t==null?2:+t;let n=e==null?e=new uc:void 0,{points:r}=this;for(let n=0,i=r.length;n<i;n+=2){let i=r[n],a=r[n+1];e.moveTo(i+t,a),e.arc(i,a,t,0,pc)}return n&&n.value()}renderHull(e){let t=e==null?e=new uc:void 0,{hull:n,points:r}=this,i=n[0]*2,a=n.length;e.moveTo(r[i],r[i+1]);for(let t=1;t<a;++t){let i=2*n[t];e.lineTo(r[i],r[i+1])}return e.closePath(),t&&t.value()}hullPolygon(){let e=new dc;return this.renderHull(e),e.value()}renderTriangle(e,t){let n=t==null?t=new uc:void 0,{points:r,triangles:i}=this,a=i[e*=3]*2,o=i[e+1]*2,s=i[e+2]*2;return t.moveTo(r[a],r[a+1]),t.lineTo(r[o],r[o+1]),t.lineTo(r[s],r[s+1]),t.closePath(),n&&n.value()}*trianglePolygons(){let{triangles:e}=this;for(let t=0,n=e.length/3;t<n;++t)yield this.trianglePolygon(t)}trianglePolygon(e){let t=new dc;return this.renderTriangle(e,t),t.value()}};function bc(e,t,n,r){let i=e.length,a=new Float64Array(i*2);for(let o=0;o<i;++o){let i=e[o];a[o*2]=t.call(r,i,o,e),a[o*2+1]=n.call(r,i,o,e)}return a}function*xc(e,t,n,r){let i=0;for(let a of e)yield t.call(r,a,i,e),yield n.call(r,a,i,e),++i}function Sc(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString(`en`).replace(/,/g,``):e.toString(10)}function Cc(e,t){if(!isFinite(e)||e===0)return null;var n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf(`e`),r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function wc(e){return e=Cc(Math.abs(e)),e?e[1]:NaN}function Tc(e,t){return function(n,r){for(var i=n.length,a=[],o=0,s=e[0],c=0;i>0&&s>0&&(c+s+1>r&&(s=Math.max(1,r-c)),a.push(n.substring(i-=s,i+s)),!((c+=s+1)>r));)s=e[o=(o+1)%e.length];return a.reverse().join(t)}}function Ec(e){return function(t){return t.replace(/[0-9]/g,function(t){return e[+t]})}}var Dc=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Oc(e){if(!(t=Dc.exec(e)))throw Error(`invalid format: `+e);var t;return new kc({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}Oc.prototype=kc.prototype;function kc(e){this.fill=e.fill===void 0?` `:e.fill+``,this.align=e.align===void 0?`>`:e.align+``,this.sign=e.sign===void 0?`-`:e.sign+``,this.symbol=e.symbol===void 0?``:e.symbol+``,this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?``:e.type+``}kc.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?`0`:``)+(this.width===void 0?``:Math.max(1,this.width|0))+(this.comma?`,`:``)+(this.precision===void 0?``:`.`+Math.max(0,this.precision|0))+(this.trim?`~`:``)+this.type};function Ac(e){out:for(var t=e.length,n=1,r=-1,i;n<t;++n)switch(e[n]){case`.`:r=i=n;break;case`0`:r===0&&(r=n),i=n;break;default:if(!+e[n])break out;r>0&&(r=0)}return r>0?e.slice(0,r)+e.slice(i+1):e}var jc;function Mc(e,t){var n=Cc(e,t);if(!n)return jc=void 0,e.toPrecision(t);var r=n[0],i=n[1],a=i-(jc=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,o=r.length;return a===o?r:a>o?r+Array(a-o+1).join(`0`):a>0?r.slice(0,a)+`.`+r.slice(a):`0.`+Array(1-a).join(`0`)+Cc(e,Math.max(0,t+a-1))[0]}function Nc(e,t){var n=Cc(e,t);if(!n)return e+``;var r=n[0],i=n[1];return i<0?`0.`+Array(-i).join(`0`)+r:r.length>i+1?r.slice(0,i+1)+`.`+r.slice(i+1):r+Array(i-r.length+2).join(`0`)}var Pc={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+``,d:Sc,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>Nc(e*100,t),r:Nc,s:Mc,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function Fc(e){return e}var Ic=Array.prototype.map,Lc=[`y`,`z`,`a`,`f`,`p`,`n`,`µ`,`m`,``,`k`,`M`,`G`,`T`,`P`,`E`,`Z`,`Y`];function Rc(e){var t=e.grouping===void 0||e.thousands===void 0?Fc:Tc(Ic.call(e.grouping,Number),e.thousands+``),n=e.currency===void 0?``:e.currency[0]+``,r=e.currency===void 0?``:e.currency[1]+``,i=e.decimal===void 0?`.`:e.decimal+``,a=e.numerals===void 0?Fc:Ec(Ic.call(e.numerals,String)),o=e.percent===void 0?`%`:e.percent+``,s=e.minus===void 0?`−`:e.minus+``,c=e.nan===void 0?`NaN`:e.nan+``;function l(e,l){e=Oc(e);var u=e.fill,d=e.align,f=e.sign,p=e.symbol,m=e.zero,h=e.width,g=e.comma,_=e.precision,v=e.trim,y=e.type;y===`n`?(g=!0,y=`g`):Pc[y]||(_===void 0&&(_=12),v=!0,y=`g`),(m||u===`0`&&d===`=`)&&(m=!0,u=`0`,d=`=`);var b=(l&&l.prefix!==void 0?l.prefix:``)+(p===`$`?n:p===`#`&&/[boxX]/.test(y)?`0`+y.toLowerCase():``),x=(p===`$`?r:/[%p]/.test(y)?o:``)+(l&&l.suffix!==void 0?l.suffix:``),S=Pc[y],C=/[defgprs%]/.test(y);_=_===void 0?6:/[gprs]/.test(y)?Math.max(1,Math.min(21,_)):Math.max(0,Math.min(20,_));function w(e){var n=b,r=x,o,l,p;if(y===`c`)r=S(e)+r,e=``;else{e=+e;var w=e<0||1/e<0;if(e=isNaN(e)?c:S(Math.abs(e),_),v&&(e=Ac(e)),w&&+e==0&&f!==`+`&&(w=!1),n=(w?f===`(`?f:s:f===`-`||f===`(`?``:f)+n,r=(y===`s`&&!isNaN(e)&&jc!==void 0?Lc[8+jc/3]:``)+r+(w&&f===`(`?`)`:``),C){for(o=-1,l=e.length;++o<l;)if(p=e.charCodeAt(o),48>p||p>57){r=(p===46?i+e.slice(o+1):e.slice(o))+r,e=e.slice(0,o);break}}}g&&!m&&(e=t(e,1/0));var T=n.length+e.length+r.length,E=T<h?Array(h-T+1).join(u):``;switch(g&&m&&(e=t(E+e,E.length?h-r.length:1/0),E=``),d){case`<`:e=n+e+r+E;break;case`=`:e=n+E+e+r;break;case`^`:e=E.slice(0,T=E.length>>1)+n+e+r+E.slice(T);break;default:e=E+n+e+r}return a(e)}return w.toString=function(){return e+``},w}function u(e,t){var n=Math.max(-8,Math.min(8,Math.floor(wc(t)/3)))*3,r=10**-n,i=l((e=Oc(e),e.type=`f`,e),{suffix:Lc[8+n/3]});return function(e){return i(r*e)}}return{format:l,formatPrefix:u}}var zc,Bc,Vc;Hc({thousands:`,`,grouping:[3],currency:[`$`,``]});function Hc(e){return zc=Rc(e),Bc=zc.format,Vc=zc.formatPrefix,zc}function Uc(e){return Math.max(0,-wc(Math.abs(e)))}function Wc(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(wc(t)/3)))*3-wc(Math.abs(e)))}function Gc(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,wc(t)-wc(e))+1}var N=1e-6,P=Math.PI,Kc=P/2,qc=P/4,Jc=P*2,Yc=180/P,F=P/180,I=Math.abs,Xc=Math.atan,Zc=Math.atan2,L=Math.cos,Qc=Math.ceil,$c=Math.exp,el=Math.hypot,tl=Math.log,nl=Math.pow,R=Math.sin,rl=Math.sign||function(e){return e>0?1:e<0?-1:0},il=Math.sqrt,al=Math.tan;function ol(e){return e>1?0:e<-1?P:Math.acos(e)}function sl(e){return e>1?Kc:e<-1?-Kc:Math.asin(e)}function cl(){}function ll(e,t){e&&dl.hasOwnProperty(e.type)&&dl[e.type](e,t)}var ul={Feature:function(e,t){ll(e.geometry,t)},FeatureCollection:function(e,t){for(var n=e.features,r=-1,i=n.length;++r<i;)ll(n[r].geometry,t)}},dl={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,r=-1,i=n.length;++r<i;)e=n[r],t.point(e[0],e[1],e[2])},LineString:function(e,t){fl(e.coordinates,t,0)},MultiLineString:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)fl(n[r],t,0)},Polygon:function(e,t){pl(e.coordinates,t)},MultiPolygon:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)pl(n[r],t)},GeometryCollection:function(e,t){for(var n=e.geometries,r=-1,i=n.length;++r<i;)ll(n[r],t)}};function fl(e,t,n){var r=-1,i=e.length-n,a;for(t.lineStart();++r<i;)a=e[r],t.point(a[0],a[1],a[2]);t.lineEnd()}function pl(e,t){var n=-1,r=e.length;for(t.polygonStart();++n<r;)fl(e[n],t,1);t.polygonEnd()}function ml(e,t){e&&ul.hasOwnProperty(e.type)?ul[e.type](e,t):ll(e,t)}function hl(e){return[Zc(e[1],e[0]),sl(e[2])]}function gl(e){var t=e[0],n=e[1],r=L(n);return[r*L(t),r*R(t),R(n)]}function _l(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function vl(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 yl(e,t){e[0]+=t[0],e[1]+=t[1],e[2]+=t[2]}function bl(e,t){return[e[0]*t,e[1]*t,e[2]*t]}function xl(e){var t=il(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]/=t,e[1]/=t,e[2]/=t}var Sl,Cl,wl,Tl,El,Dl,Ol,kl,Al,jl,Ml,Nl,Pl,Fl,Il,Ll,Rl={sphere:cl,point:zl,lineStart:Vl,lineEnd:Wl,polygonStart:function(){Rl.lineStart=Gl,Rl.lineEnd=Kl},polygonEnd:function(){Rl.lineStart=Vl,Rl.lineEnd=Wl}};function zl(e,t){e*=F,t*=F;var n=L(t);Bl(n*L(e),n*R(e),R(t))}function Bl(e,t,n){++Sl,wl+=(e-wl)/Sl,Tl+=(t-Tl)/Sl,El+=(n-El)/Sl}function Vl(){Rl.point=Hl}function Hl(e,t){e*=F,t*=F;var n=L(t);Fl=n*L(e),Il=n*R(e),Ll=R(t),Rl.point=Ul,Bl(Fl,Il,Ll)}function Ul(e,t){e*=F,t*=F;var n=L(t),r=n*L(e),i=n*R(e),a=R(t),o=Zc(il((o=Il*a-Ll*i)*o+(o=Ll*r-Fl*a)*o+(o=Fl*i-Il*r)*o),Fl*r+Il*i+Ll*a);Cl+=o,Dl+=o*(Fl+(Fl=r)),Ol+=o*(Il+(Il=i)),kl+=o*(Ll+(Ll=a)),Bl(Fl,Il,Ll)}function Wl(){Rl.point=zl}function Gl(){Rl.point=ql}function Kl(){Jl(Nl,Pl),Rl.point=zl}function ql(e,t){Nl=e,Pl=t,e*=F,t*=F,Rl.point=Jl;var n=L(t);Fl=n*L(e),Il=n*R(e),Ll=R(t),Bl(Fl,Il,Ll)}function Jl(e,t){e*=F,t*=F;var n=L(t),r=n*L(e),i=n*R(e),a=R(t),o=Il*a-Ll*i,s=Ll*r-Fl*a,c=Fl*i-Il*r,l=el(o,s,c),u=sl(l),d=l&&-u/l;Al.add(d*o),jl.add(d*s),Ml.add(d*c),Cl+=u,Dl+=u*(Fl+(Fl=r)),Ol+=u*(Il+(Il=i)),kl+=u*(Ll+(Ll=a)),Bl(Fl,Il,Ll)}function Yl(e){Sl=Cl=wl=Tl=El=Dl=Ol=kl=0,Al=new ie,jl=new ie,Ml=new ie,ml(e,Rl);var t=+Al,n=+jl,r=+Ml,i=el(t,n,r);return i<1e-12&&(t=Dl,n=Ol,r=kl,Cl<1e-6&&(t=wl,n=Tl,r=El),i=el(t,n,r),i<1e-12)?[NaN,NaN]:[Zc(n,t)*Yc,sl(r/i)*Yc]}function Xl(e,t){function n(n,r){return n=e(n,r),t(n[0],n[1])}return e.invert&&t.invert&&(n.invert=function(n,r){return n=t.invert(n,r),n&&e.invert(n[0],n[1])}),n}function Zl(e,t){return I(e)>P&&(e-=Math.round(e/Jc)*Jc),[e,t]}Zl.invert=Zl;function Ql(e,t,n){return(e%=Jc)?t||n?Xl(eu(e),tu(t,n)):eu(e):t||n?tu(t,n):Zl}function $l(e){return function(t,n){return t+=e,I(t)>P&&(t-=Math.round(t/Jc)*Jc),[t,n]}}function eu(e){var t=$l(e);return t.invert=$l(-e),t}function tu(e,t){var n=L(e),r=R(e),i=L(t),a=R(t);function o(e,t){var o=L(t),s=L(e)*o,c=R(e)*o,l=R(t),u=l*n+s*r;return[Zc(c*i-u*a,s*n-l*r),sl(u*i+c*a)]}return o.invert=function(e,t){var o=L(t),s=L(e)*o,c=R(e)*o,l=R(t),u=l*i-c*a;return[Zc(c*i+l*a,s*n+u*r),sl(u*n-s*r)]},o}function nu(e){e=Ql(e[0]*F,e[1]*F,e.length>2?e[2]*F:0);function t(t){return t=e(t[0]*F,t[1]*F),t[0]*=Yc,t[1]*=Yc,t}return t.invert=function(t){return t=e.invert(t[0]*F,t[1]*F),t[0]*=Yc,t[1]*=Yc,t},t}function ru(e,t,n,r,i,a){if(n){var o=L(t),s=R(t),c=r*n;i==null?(i=t+r*Jc,a=t-c/2):(i=iu(o,i),a=iu(o,a),(r>0?i<a:i>a)&&(i+=r*Jc));for(var l,u=i;r>0?u>a:u<a;u-=c)l=hl([o,-s*L(u),-s*R(u)]),e.point(l[0],l[1])}}function iu(e,t){t=gl(t),t[0]-=e,xl(t);var n=ol(-t[1]);return((-t[2]<0?-n:n)+Jc-N)%Jc}function au(){var e=[],t;return{point:function(e,n,r){t.push([e,n,r])},lineStart:function(){e.push(t=[])},lineEnd:cl,rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}}function ou(e,t){return I(e[0]-t[0])<1e-6&&I(e[1]-t[1])<1e-6}function su(e,t,n,r){this.x=e,this.z=t,this.o=n,this.e=r,this.v=!1,this.n=this.p=null}function cu(e,t,n,r,i){var a=[],o=[],s,c;if(e.forEach(function(e){if(!((t=e.length-1)<=0)){var t,n=e[0],r=e[t],c;if(ou(n,r)){if(!n[2]&&!r[2]){for(i.lineStart(),s=0;s<t;++s)i.point((n=e[s])[0],n[1]);i.lineEnd();return}r[0]+=2*N}a.push(c=new su(n,e,null,!0)),o.push(c.o=new su(n,null,c,!1)),a.push(c=new su(r,e,null,!1)),o.push(c.o=new su(r,null,c,!0))}}),a.length){for(o.sort(t),lu(a),lu(o),s=0,c=o.length;s<c;++s)o[s].e=n=!n;for(var l=a[0],u,d;;){for(var f=l,p=!0;f.v;)if((f=f.n)===l)return;u=f.z,i.lineStart();do{if(f.v=f.o.v=!0,f.e){if(p)for(s=0,c=u.length;s<c;++s)i.point((d=u[s])[0],d[1]);else r(f.x,f.n.x,1,i);f=f.n}else{if(p)for(u=f.p.z,s=u.length-1;s>=0;--s)i.point((d=u[s])[0],d[1]);else r(f.x,f.p.x,-1,i);f=f.p}f=f.o,u=f.z,p=!p}while(!f.v);i.lineEnd()}}}function lu(e){if(t=e.length){for(var t,n=0,r=e[0],i;++n<t;)r.n=i=e[n],i.p=r,r=i;r.n=i=e[0],i.p=r}}function uu(e){return I(e[0])<=P?e[0]:rl(e[0])*((I(e[0])+P)%Jc-P)}function du(e,t){var n=uu(t),r=t[1],i=R(r),a=[R(n),-L(n),0],o=0,s=0,c=new ie;i===1?r=Kc+N:i===-1&&(r=-Kc-N);for(var l=0,u=e.length;l<u;++l)if(f=(d=e[l]).length)for(var d,f,p=d[f-1],m=uu(p),h=p[1]/2+qc,g=R(h),_=L(h),v=0;v<f;++v,m=b,g=S,_=C,p=y){var y=d[v],b=uu(y),x=y[1]/2+qc,S=R(x),C=L(x),w=b-m,T=w>=0?1:-1,E=T*w,D=E>P,O=g*S;if(c.add(Zc(O*T*R(E),_*C+O*L(E))),o+=D?w+T*Jc:w,D^m>=n^b>=n){var k=vl(gl(p),gl(y));xl(k);var A=vl(a,k);xl(A);var ee=(D^w>=0?-1:1)*sl(A[2]);(r>ee||r===ee&&(k[0]||k[1]))&&(s+=D^w>=0?1:-1)}}return(o<-1e-6||o<1e-6&&c<-1e-12)^s&1}function fu(e,t,n,r){return function(i){var a=t(i),o=au(),s=t(o),c=!1,l,u,d,f={point:p,lineStart:h,lineEnd:g,polygonStart:function(){f.point=_,f.lineStart=v,f.lineEnd=y,u=[],l=[]},polygonEnd:function(){f.point=p,f.lineStart=h,f.lineEnd=g,u=We(u);var e=du(l,r);u.length?(c||=(i.polygonStart(),!0),cu(u,mu,e,n,i)):e&&(c||=(i.polygonStart(),!0),i.lineStart(),n(null,null,1,i),i.lineEnd()),c&&=(i.polygonEnd(),!1),u=l=null},sphere:function(){i.polygonStart(),i.lineStart(),n(null,null,1,i),i.lineEnd(),i.polygonEnd()}};function p(t,n){e(t,n)&&i.point(t,n)}function m(e,t){a.point(e,t)}function h(){f.point=m,a.lineStart()}function g(){f.point=p,a.lineEnd()}function _(e,t){d.push([e,t]),s.point(e,t)}function v(){s.lineStart(),d=[]}function y(){_(d[0][0],d[0][1]),s.lineEnd();var e=s.clean(),t=o.result(),n,r=t.length,a,f,p;if(d.pop(),l.push(d),d=null,r){if(e&1){if(f=t[0],(a=f.length-1)>0){for(c||=(i.polygonStart(),!0),i.lineStart(),n=0;n<a;++n)i.point((p=f[n])[0],p[1]);i.lineEnd()}}else r>1&&e&2&&t.push(t.pop().concat(t.shift())),u.push(t.filter(pu))}}return f}}function pu(e){return e.length>1}function mu(e,t){return((e=e.x)[0]<0?e[1]-Kc-N:Kc-e[1])-((t=t.x)[0]<0?t[1]-Kc-N:Kc-t[1])}var hu=fu(function(){return!0},gu,vu,[-P,-Kc]);function gu(e){var t=NaN,n=NaN,r=NaN,i;return{lineStart:function(){e.lineStart(),i=1},point:function(a,o){var s=a>0?P:-P,c=I(a-t);I(c-P)<1e-6?(e.point(t,n=(n+o)/2>0?Kc:-Kc),e.point(r,n),e.lineEnd(),e.lineStart(),e.point(s,n),e.point(a,n),i=0):r!==s&&c>=P&&(I(t-r)<1e-6&&(t-=r*N),I(a-s)<1e-6&&(a-=s*N),n=_u(t,n,a,o),e.point(r,n),e.lineEnd(),e.lineStart(),e.point(s,n),i=0),e.point(t=a,n=o),r=s},lineEnd:function(){e.lineEnd(),t=n=NaN},clean:function(){return 2-i}}}function _u(e,t,n,r){var i,a,o=R(e-n);return I(o)>1e-6?Xc((R(t)*(a=L(r))*R(n)-R(r)*(i=L(t))*R(e))/(i*a*o)):(t+r)/2}function vu(e,t,n,r){var i;if(e==null)i=n*Kc,r.point(-P,i),r.point(0,i),r.point(P,i),r.point(P,0),r.point(P,-i),r.point(0,-i),r.point(-P,-i),r.point(-P,0),r.point(-P,i);else if(I(e[0]-t[0])>1e-6){var a=e[0]<t[0]?P:-P;i=n*a/2,r.point(-a,i),r.point(0,i),r.point(a,i)}else r.point(t[0],t[1])}function yu(e){var t=L(e),n=2*F,r=t>0,i=I(t)>N;function a(t,r,i,a){ru(a,e,n,i,t,r)}function o(e,n){return L(e)*L(n)>t}function s(e){var t,n,a,s,u;return{lineStart:function(){s=a=!1,u=1},point:function(d,f){var p=[d,f],m,h=o(d,f),g=r?h?0:l(d,f):h?l(d+(d<0?P:-P),f):0;if(!t&&(s=a=h)&&e.lineStart(),h!==a&&(m=c(t,p),(!m||ou(t,m)||ou(p,m))&&(p[2]=1)),h!==a)u=0,h?(e.lineStart(),m=c(p,t),e.point(m[0],m[1])):(m=c(t,p),e.point(m[0],m[1],2),e.lineEnd()),t=m;else if(i&&t&&r^h){var _;!(g&n)&&(_=c(p,t,!0))&&(u=0,r?(e.lineStart(),e.point(_[0][0],_[0][1]),e.point(_[1][0],_[1][1]),e.lineEnd()):(e.point(_[1][0],_[1][1]),e.lineEnd(),e.lineStart(),e.point(_[0][0],_[0][1],3)))}h&&(!t||!ou(t,p))&&e.point(p[0],p[1]),t=p,a=h,n=g},lineEnd:function(){a&&e.lineEnd(),t=null},clean:function(){return u|(s&&a)<<1}}}function c(e,n,r){var i=gl(e),a=gl(n),o=[1,0,0],s=vl(i,a),c=_l(s,s),l=s[0],u=c-l*l;if(!u)return!r&&e;var d=t*c/u,f=-t*l/u,p=vl(o,s),m=bl(o,d);yl(m,bl(s,f));var h=p,g=_l(m,h),_=_l(h,h),v=g*g-_*(_l(m,m)-1);if(!(v<0)){var y=il(v),b=bl(h,(-g-y)/_);if(yl(b,m),b=hl(b),!r)return b;var x=e[0],S=n[0],C=e[1],w=n[1],T;S<x&&(T=x,x=S,S=T);var E=S-x,D=I(E-P)<N,O=D||E<1e-6;if(!D&&w<C&&(T=C,C=w,w=T),O?D?C+w>0^b[1]<(I(b[0]-x)<1e-6?C:w):C<=b[1]&&b[1]<=w:E>P^(x<=b[0]&&b[0]<=S)){var k=bl(h,(-g+y)/_);return yl(k,m),[b,hl(k)]}}}function l(t,n){var i=r?e:P-e,a=0;return t<-i?a|=1:t>i&&(a|=2),n<-i?a|=4:n>i&&(a|=8),a}return fu(o,s,a,r?[0,-e]:[-P,e-P])}function bu(e,t,n,r,i,a){var o=e[0],s=e[1],c=t[0],l=t[1],u=0,d=1,f=c-o,p=l-s,m=n-o;if(!(!f&&m>0)){if(m/=f,f<0){if(m<u)return;m<d&&(d=m)}else if(f>0){if(m>d)return;m>u&&(u=m)}if(m=i-o,!(!f&&m<0)){if(m/=f,f<0){if(m>d)return;m>u&&(u=m)}else if(f>0){if(m<u)return;m<d&&(d=m)}if(m=r-s,!(!p&&m>0)){if(m/=p,p<0){if(m<u)return;m<d&&(d=m)}else if(p>0){if(m>d)return;m>u&&(u=m)}if(m=a-s,!(!p&&m<0)){if(m/=p,p<0){if(m>d)return;m>u&&(u=m)}else if(p>0){if(m<u)return;m<d&&(d=m)}return u>0&&(e[0]=o+u*f,e[1]=s+u*p),d<1&&(t[0]=o+d*f,t[1]=s+d*p),!0}}}}}var xu=1e9,Su=-xu;function Cu(e,t,n,r){function i(i,a){return e<=i&&i<=n&&t<=a&&a<=r}function a(i,a,s,l){var u=0,d=0;if(i==null||(u=o(i,s))!==(d=o(a,s))||c(i,a)<0^s>0)do l.point(u===0||u===3?e:n,u>1?r:t);while((u=(u+s+4)%4)!==d);else l.point(a[0],a[1])}function o(r,i){return I(r[0]-e)<1e-6?i>0?0:3:I(r[0]-n)<1e-6?i>0?2:1:I(r[1]-t)<1e-6?+(i>0):i>0?3:2}function s(e,t){return c(e.x,t.x)}function c(e,t){var n=o(e,1),r=o(t,1);return n===r?n===0?t[1]-e[1]:n===1?e[0]-t[0]:n===2?e[1]-t[1]:t[0]-e[0]:n-r}return function(o){var c=o,l=au(),u,d,f,p,m,h,g,_,v,y,b,x={point:S,lineStart:E,lineEnd:D,polygonStart:w,polygonEnd:T};function S(e,t){i(e,t)&&c.point(e,t)}function C(){for(var t=0,n=0,i=d.length;n<i;++n)for(var a=d[n],o=1,s=a.length,c=a[0],l,u,f=c[0],p=c[1];o<s;++o)l=f,u=p,c=a[o],f=c[0],p=c[1],u<=r?p>r&&(f-l)*(r-u)>(p-u)*(e-l)&&++t:p<=r&&(f-l)*(r-u)<(p-u)*(e-l)&&--t;return t}function w(){c=l,u=[],d=[],b=!0}function T(){var e=C(),t=b&&e,n=(u=We(u)).length;(t||n)&&(o.polygonStart(),t&&(o.lineStart(),a(null,null,1,o),o.lineEnd()),n&&cu(u,s,e,a,o),o.polygonEnd()),c=o,u=d=f=null}function E(){x.point=O,d&&d.push(f=[]),y=!0,v=!1,g=_=NaN}function D(){u&&(O(p,m),h&&v&&l.rejoin(),u.push(l.result())),x.point=S,v&&c.lineEnd()}function O(a,o){var s=i(a,o);if(d&&f.push([a,o]),y)p=a,m=o,h=s,y=!1,s&&(c.lineStart(),c.point(a,o));else if(s&&v)c.point(a,o);else{var l=[g=Math.max(Su,Math.min(xu,g)),_=Math.max(Su,Math.min(xu,_))],u=[a=Math.max(Su,Math.min(xu,a)),o=Math.max(Su,Math.min(xu,o))];bu(l,u,e,t,n,r)?(v||(c.lineStart(),c.point(l[0],l[1])),c.point(u[0],u[1]),s||c.lineEnd(),b=!1):s&&(c.lineStart(),c.point(a,o),b=!1)}g=a,_=o,v=s}return x}}function wu(e,t,n){var r=Je(e,t-N,n).concat(t);return function(e){return r.map(function(t){return[e,t]})}}function Tu(e,t,n){var r=Je(e,t-N,n).concat(t);return function(e){return r.map(function(t){return[t,e]})}}function Eu(){var e,t,n,r,i,a,o,s,c=10,l=c,u=90,d=360,f,p,m,h,g=2.5;function _(){return{type:`MultiLineString`,coordinates:v()}}function v(){return Je(Qc(r/u)*u,n,u).map(m).concat(Je(Qc(s/d)*d,o,d).map(h)).concat(Je(Qc(t/c)*c,e,c).filter(function(e){return I(e%u)>N}).map(f)).concat(Je(Qc(a/l)*l,i,l).filter(function(e){return I(e%d)>N}).map(p))}return _.lines=function(){return v().map(function(e){return{type:`LineString`,coordinates:e}})},_.outline=function(){return{type:`Polygon`,coordinates:[m(r).concat(h(o).slice(1),m(n).reverse().slice(1),h(s).reverse().slice(1))]}},_.extent=function(e){return arguments.length?_.extentMajor(e).extentMinor(e):_.extentMinor()},_.extentMajor=function(e){return arguments.length?(r=+e[0][0],n=+e[1][0],s=+e[0][1],o=+e[1][1],r>n&&(e=r,r=n,n=e),s>o&&(e=s,s=o,o=e),_.precision(g)):[[r,s],[n,o]]},_.extentMinor=function(n){return arguments.length?(t=+n[0][0],e=+n[1][0],a=+n[0][1],i=+n[1][1],t>e&&(n=t,t=e,e=n),a>i&&(n=a,a=i,i=n),_.precision(g)):[[t,a],[e,i]]},_.step=function(e){return arguments.length?_.stepMajor(e).stepMinor(e):_.stepMinor()},_.stepMajor=function(e){return arguments.length?(u=+e[0],d=+e[1],_):[u,d]},_.stepMinor=function(e){return arguments.length?(c=+e[0],l=+e[1],_):[c,l]},_.precision=function(c){return arguments.length?(g=+c,f=wu(a,i,90),p=Tu(t,e,g),m=wu(s,o,90),h=Tu(r,n,g),_):g},_.extentMajor([[-180,-90+N],[180,90-N]]).extentMinor([[-180,-80-N],[180,80+N]])}function Du(){return Eu()()}var Ou=e=>e,ku=new ie,Au=new ie,ju,Mu,Nu,Pu,Fu={point:cl,lineStart:cl,lineEnd:cl,polygonStart:function(){Fu.lineStart=Iu,Fu.lineEnd=zu},polygonEnd:function(){Fu.lineStart=Fu.lineEnd=Fu.point=cl,ku.add(I(Au)),Au=new ie},result:function(){var e=ku/2;return ku=new ie,e}};function Iu(){Fu.point=Lu}function Lu(e,t){Fu.point=Ru,ju=Nu=e,Mu=Pu=t}function Ru(e,t){Au.add(Pu*e-Nu*t),Nu=e,Pu=t}function zu(){Ru(ju,Mu)}var Bu=1/0,Vu=Bu,Hu=-Bu,Uu=Hu,Wu={point:Gu,lineStart:cl,lineEnd:cl,polygonStart:cl,polygonEnd:cl,result:function(){var e=[[Bu,Vu],[Hu,Uu]];return Hu=Uu=-(Vu=Bu=1/0),e}};function Gu(e,t){e<Bu&&(Bu=e),e>Hu&&(Hu=e),t<Vu&&(Vu=t),t>Uu&&(Uu=t)}var Ku=0,qu=0,Ju=0,Yu=0,Xu=0,Zu=0,Qu=0,$u=0,ed=0,td,nd,rd,id,ad={point:od,lineStart:sd,lineEnd:ud,polygonStart:function(){ad.lineStart=dd,ad.lineEnd=fd},polygonEnd:function(){ad.point=od,ad.lineStart=sd,ad.lineEnd=ud},result:function(){var e=ed?[Qu/ed,$u/ed]:Zu?[Yu/Zu,Xu/Zu]:Ju?[Ku/Ju,qu/Ju]:[NaN,NaN];return Ku=qu=Ju=Yu=Xu=Zu=Qu=$u=ed=0,e}};function od(e,t){Ku+=e,qu+=t,++Ju}function sd(){ad.point=cd}function cd(e,t){ad.point=ld,od(rd=e,id=t)}function ld(e,t){var n=e-rd,r=t-id,i=il(n*n+r*r);Yu+=i*(rd+e)/2,Xu+=i*(id+t)/2,Zu+=i,od(rd=e,id=t)}function ud(){ad.point=od}function dd(){ad.point=pd}function fd(){md(td,nd)}function pd(e,t){ad.point=md,od(td=rd=e,nd=id=t)}function md(e,t){var n=e-rd,r=t-id,i=il(n*n+r*r);Yu+=i*(rd+e)/2,Xu+=i*(id+t)/2,Zu+=i,i=id*e-rd*t,Qu+=i*(rd+e),$u+=i*(id+t),ed+=i*3,od(rd=e,id=t)}function hd(e){this._context=e}hd.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,Jc)}},result:cl};var gd=new ie,_d,vd,yd,bd,xd,Sd={point:cl,lineStart:function(){Sd.point=Cd},lineEnd:function(){_d&&wd(vd,yd),Sd.point=cl},polygonStart:function(){_d=!0},polygonEnd:function(){_d=null},result:function(){var e=+gd;return gd=new ie,e}};function Cd(e,t){Sd.point=wd,vd=bd=e,yd=xd=t}function wd(e,t){bd-=e,xd-=t,gd.add(il(bd*bd+xd*xd)),bd=e,xd=t}let Td,Ed,Dd,Od;var kd=class{constructor(e){this._append=e==null?Ad:jd(e),this._radius=4.5,this._=``}pointRadius(e){return this._radius=+e,this}polygonStart(){this._line=0}polygonEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){this._line===0&&(this._+=`Z`),this._point=NaN}point(e,t){switch(this._point){case 0:this._append`M${e},${t}`,this._point=1;break;case 1:this._append`L${e},${t}`;break;default:if(this._append`M${e},${t}`,this._radius!==Dd||this._append!==Ed){let e=this._radius,t=this._;this._=``,this._append`m0,${e}a${e},${e} 0 1,1 0,${-2*e}a${e},${e} 0 1,1 0,${2*e}z`,Dd=e,Ed=this._append,Od=this._,this._=t}this._+=Od}}result(){let e=this._;return this._=``,e.length?e:null}};function Ad(e){let t=1;this._+=e[0];for(let n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function jd(e){let t=Math.floor(e);if(!(t>=0))throw RangeError(`invalid digits: ${e}`);if(t>15)return Ad;if(t!==Td){let e=10**t;Td=t,Ed=function(t){let n=1;this._+=t[0];for(let r=t.length;n<r;++n)this._+=Math.round(arguments[n]*e)/e+t[n]}}return Ed}function Md(e,t){let n=3,r=4.5,i,a;function o(e){return e&&(typeof r==`function`&&a.pointRadius(+r.apply(this,arguments)),ml(e,i(a))),a.result()}return o.area=function(e){return ml(e,i(Fu)),Fu.result()},o.measure=function(e){return ml(e,i(Sd)),Sd.result()},o.bounds=function(e){return ml(e,i(Wu)),Wu.result()},o.centroid=function(e){return ml(e,i(ad)),ad.result()},o.projection=function(t){return arguments.length?(i=t==null?(e=null,Ou):(e=t).stream,o):e},o.context=function(e){return arguments.length?(a=e==null?(t=null,new kd(n)):new hd(t=e),typeof r!=`function`&&a.pointRadius(r),o):t},o.pointRadius=function(e){return arguments.length?(r=typeof e==`function`?e:(a.pointRadius(+e),+e),o):r},o.digits=function(e){if(!arguments.length)return n;if(e==null)n=null;else{let t=Math.floor(e);if(!(t>=0))throw RangeError(`invalid digits: ${e}`);n=t}return t===null&&(a=new kd(n)),o},o.projection(e).digits(n).context(t)}function Nd(e){return{stream:Pd(e)}}function Pd(e){return function(t){var n=new Fd;for(var r in e)n[r]=e[r];return n.stream=t,n}}function Fd(){}Fd.prototype={constructor:Fd,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 Id(e,t,n){var r=e.clipExtent&&e.clipExtent();return e.scale(150).translate([0,0]),r!=null&&e.clipExtent(null),ml(n,e.stream(Wu)),t(Wu.result()),r!=null&&e.clipExtent(r),e}function Ld(e,t,n){return Id(e,function(n){var r=t[1][0]-t[0][0],i=t[1][1]-t[0][1],a=Math.min(r/(n[1][0]-n[0][0]),i/(n[1][1]-n[0][1])),o=+t[0][0]+(r-a*(n[1][0]+n[0][0]))/2,s=+t[0][1]+(i-a*(n[1][1]+n[0][1]))/2;e.scale(150*a).translate([o,s])},n)}function Rd(e,t,n){return Ld(e,[[0,0],t],n)}function zd(e,t,n){return Id(e,function(n){var r=+t,i=r/(n[1][0]-n[0][0]),a=(r-i*(n[1][0]+n[0][0]))/2,o=-i*n[0][1];e.scale(150*i).translate([a,o])},n)}function Bd(e,t,n){return Id(e,function(n){var r=+t,i=r/(n[1][1]-n[0][1]),a=-i*n[0][0],o=(r-i*(n[1][1]+n[0][1]))/2;e.scale(150*i).translate([a,o])},n)}var Vd=16,Hd=L(30*F);function Ud(e,t){return+t?Gd(e,t):Wd(e)}function Wd(e){return Pd({point:function(t,n){t=e(t,n),this.stream.point(t[0],t[1])}})}function Gd(e,t){function n(r,i,a,o,s,c,l,u,d,f,p,m,h,g){var _=l-r,v=u-i,y=_*_+v*v;if(y>4*t&&h--){var b=o+f,x=s+p,S=c+m,C=il(b*b+x*x+S*S),w=sl(S/=C),T=I(I(S)-1)<1e-6||I(a-d)<1e-6?(a+d)/2:Zc(x,b),E=e(T,w),D=E[0],O=E[1],k=D-r,A=O-i,ee=v*k-_*A;(ee*ee/y>t||I((_*k+v*A)/y-.5)>.3||o*f+s*p+c*m<Hd)&&(n(r,i,a,o,s,c,D,O,T,b/=C,x/=C,S,h,g),g.point(D,O),n(D,O,T,b,x,S,l,u,d,f,p,m,h,g))}}return function(t){var r,i,a,o,s,c,l,u,d,f,p,m,h={point:g,lineStart:_,lineEnd:y,polygonStart:function(){t.polygonStart(),h.lineStart=b},polygonEnd:function(){t.polygonEnd(),h.lineStart=_}};function g(n,r){n=e(n,r),t.point(n[0],n[1])}function _(){u=NaN,h.point=v,t.lineStart()}function v(r,i){var a=gl([r,i]),o=e(r,i);n(u,d,l,f,p,m,u=o[0],d=o[1],l=r,f=a[0],p=a[1],m=a[2],Vd,t),t.point(u,d)}function y(){h.point=g,t.lineEnd()}function b(){_(),h.point=x,h.lineEnd=S}function x(e,t){v(r=e,t),i=u,a=d,o=f,s=p,c=m,h.point=v}function S(){n(u,d,l,f,p,m,i,a,r,o,s,c,Vd,t),h.lineEnd=y,y()}return h}}var Kd=Pd({point:function(e,t){this.stream.point(e*F,t*F)}});function qd(e){return Pd({point:function(t,n){var r=e(t,n);return this.stream.point(r[0],r[1])}})}function Jd(e,t,n,r,i){function a(a,o){return a*=r,o*=i,[t+e*a,n-e*o]}return a.invert=function(a,o){return[(a-t)/e*r,(n-o)/e*i]},a}function Yd(e,t,n,r,i,a){if(!a)return Jd(e,t,n,r,i);var o=L(a),s=R(a),c=o*e,l=s*e,u=o/e,d=s/e,f=(s*n-o*t)/e,p=(s*t+o*n)/e;function m(e,a){return e*=r,a*=i,[c*e-l*a+t,n-l*e-c*a]}return m.invert=function(e,t){return[r*(u*e-d*t+f),i*(p-d*e-u*t)]},m}function Xd(e){return Zd(function(){return e})()}function Zd(e){var t,n=150,r=480,i=250,a=0,o=0,s=0,c=0,l=0,u,d=0,f=1,p=1,m=null,h=hu,g=null,_,v,y,b=Ou,x=.5,S,C,w,T,E;function D(e){return w(e[0]*F,e[1]*F)}function O(e){return e=w.invert(e[0],e[1]),e&&[e[0]*Yc,e[1]*Yc]}D.stream=function(e){return T&&E===e?T:T=Kd(qd(u)(h(S(b(E=e)))))},D.preclip=function(e){return arguments.length?(h=e,m=void 0,A()):h},D.postclip=function(e){return arguments.length?(b=e,g=_=v=y=null,A()):b},D.clipAngle=function(e){return arguments.length?(h=+e?yu(m=e*F):(m=null,hu),A()):m*Yc},D.clipExtent=function(e){return arguments.length?(b=e==null?(g=_=v=y=null,Ou):Cu(g=+e[0][0],_=+e[0][1],v=+e[1][0],y=+e[1][1]),A()):g==null?null:[[g,_],[v,y]]},D.scale=function(e){return arguments.length?(n=+e,k()):n},D.translate=function(e){return arguments.length?(r=+e[0],i=+e[1],k()):[r,i]},D.center=function(e){return arguments.length?(a=e[0]%360*F,o=e[1]%360*F,k()):[a*Yc,o*Yc]},D.rotate=function(e){return arguments.length?(s=e[0]%360*F,c=e[1]%360*F,l=e.length>2?e[2]%360*F:0,k()):[s*Yc,c*Yc,l*Yc]},D.angle=function(e){return arguments.length?(d=e%360*F,k()):d*Yc},D.reflectX=function(e){return arguments.length?(f=e?-1:1,k()):f<0},D.reflectY=function(e){return arguments.length?(p=e?-1:1,k()):p<0},D.precision=function(e){return arguments.length?(S=Ud(C,x=e*e),A()):il(x)},D.fitExtent=function(e,t){return Ld(D,e,t)},D.fitSize=function(e,t){return Rd(D,e,t)},D.fitWidth=function(e,t){return zd(D,e,t)},D.fitHeight=function(e,t){return Bd(D,e,t)};function k(){var e=Yd(n,0,0,f,p,d).apply(null,t(a,o)),m=Yd(n,r-e[0],i-e[1],f,p,d);return u=Ql(s,c,l),C=Xl(t,m),w=Xl(u,C),S=Ud(C,x),A()}function A(){return T=E=null,D}return function(){return t=e.apply(this,arguments),D.invert=t.invert&&O,k()}}function Qd(e){var t=0,n=P/3,r=Zd(e),i=r(t,n);return i.parallels=function(e){return arguments.length?r(t=e[0]*F,n=e[1]*F):[t*Yc,n*Yc]},i}function $d(e){var t=L(e);function n(e,n){return[e*t,R(n)/t]}return n.invert=function(e,n){return[e/t,sl(n*t)]},n}function ef(e,t){var n=R(e),r=(n+R(t))/2;if(I(r)<1e-6)return $d(e);var i=1+n*(2*r-n),a=il(i)/r;function o(e,t){var n=il(i-2*r*R(t))/r;return[n*R(e*=r),a-n*L(e)]}return o.invert=function(e,t){var n=a-t,o=Zc(e,I(n))*rl(n);return n*r<0&&(o-=P*rl(e)*rl(n)),[o/r,sl((i-(e*e+n*n)*r*r)/(2*r))]},o}function tf(){return Qd(ef).scale(155.424).center([0,33.6442])}function nf(){return tf().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])}function rf(e){var t=e.length;return{point:function(n,r){for(var i=-1;++i<t;)e[i].point(n,r)},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 af(){var e,t,n=nf(),r,i=tf().rotate([154,0]).center([-2,58.5]).parallels([55,65]),a,o=tf().rotate([157,0]).center([-3,19.9]).parallels([8,18]),s,c,l={point:function(e,t){c=[e,t]}};function u(e){var t=e[0],n=e[1];return c=null,r.point(t,n),c||(a.point(t,n),c)||(s.point(t,n),c)}u.invert=function(e){var t=n.scale(),r=n.translate(),a=(e[0]-r[0])/t,s=(e[1]-r[1])/t;return(s>=.12&&s<.234&&a>=-.425&&a<-.214?i:s>=.166&&s<.234&&a>=-.214&&a<-.115?o:n).invert(e)},u.stream=function(r){return e&&t===r?e:e=rf([n.stream(t=r),i.stream(r),o.stream(r)])},u.precision=function(e){return arguments.length?(n.precision(e),i.precision(e),o.precision(e),d()):n.precision()},u.scale=function(e){return arguments.length?(n.scale(e),i.scale(e*.35),o.scale(e),u.translate(n.translate())):n.scale()},u.translate=function(e){if(!arguments.length)return n.translate();var t=n.scale(),c=+e[0],u=+e[1];return r=n.translate(e).clipExtent([[c-.455*t,u-.238*t],[c+.455*t,u+.238*t]]).stream(l),a=i.translate([c-.307*t,u+.201*t]).clipExtent([[c-.425*t+N,u+.12*t+N],[c-.214*t-N,u+.234*t-N]]).stream(l),s=o.translate([c-.205*t,u+.212*t]).clipExtent([[c-.214*t+N,u+.166*t+N],[c-.115*t-N,u+.234*t-N]]).stream(l),d()},u.fitExtent=function(e,t){return Ld(u,e,t)},u.fitSize=function(e,t){return Rd(u,e,t)},u.fitWidth=function(e,t){return zd(u,e,t)},u.fitHeight=function(e,t){return Bd(u,e,t)};function d(){return e=t=null,u}return u.scale(1070)}function of(e){return function(t,n){var r=L(t),i=L(n),a=e(r*i);return a===1/0?[2,0]:[a*i*R(t),a*R(n)]}}function sf(e){return function(t,n){var r=il(t*t+n*n),i=e(r),a=R(i),o=L(i);return[Zc(t*a,r*o),sl(r&&n*a/r)]}}var cf=of(function(e){return il(2/(1+e))});cf.invert=sf(function(e){return 2*sl(e/2)});function lf(){return Xd(cf).scale(124.75).clipAngle(179.999)}var uf=of(function(e){return(e=ol(e))&&e/R(e)});uf.invert=sf(function(e){return e});function df(){return Xd(uf).scale(79.4188).clipAngle(179.999)}function ff(e,t){return[e,tl(al((Kc+t)/2))]}ff.invert=function(e,t){return[e,2*Xc($c(t))-Kc]};function pf(){return mf(ff).scale(961/Jc)}function mf(e){var t=Xd(e),n=t.center,r=t.scale,i=t.translate,a=t.clipExtent,o=null,s,c,l;t.scale=function(e){return arguments.length?(r(e),u()):r()},t.translate=function(e){return arguments.length?(i(e),u()):i()},t.center=function(e){return arguments.length?(n(e),u()):n()},t.clipExtent=function(e){return arguments.length?(e==null?o=s=c=l=null:(o=+e[0][0],s=+e[0][1],c=+e[1][0],l=+e[1][1]),u()):o==null?null:[[o,s],[c,l]]};function u(){var n=P*r(),i=t(nu(t.rotate()).invert([0,0]));return a(o==null?[[i[0]-n,i[1]-n],[i[0]+n,i[1]+n]]:e===ff?[[Math.max(i[0]-n,o),s],[Math.min(i[0]+n,c),l]]:[[o,Math.max(i[1]-n,s)],[c,Math.min(i[1]+n,l)]])}return u()}function hf(e){return al((Kc+e)/2)}function gf(e,t){var n=L(e),r=e===t?R(e):tl(n/L(t))/tl(hf(t)/hf(e)),i=n*nl(hf(e),r)/r;if(!r)return ff;function a(e,t){i>0?t<-Kc+1e-6&&(t=-Kc+N):t>Kc-1e-6&&(t=Kc-N);var n=i/nl(hf(t),r);return[n*R(r*e),i-n*L(r*e)]}return a.invert=function(e,t){var n=i-t,a=rl(r)*il(e*e+n*n),o=Zc(e,I(n))*rl(n);return n*r<0&&(o-=P*rl(e)*rl(n)),[o/r,2*Xc(nl(i/a,1/r))-Kc]},a}function _f(){return Qd(gf).scale(109.5).parallels([30,30])}function vf(e,t){return[e,t]}vf.invert=vf;function yf(){return Xd(vf).scale(152.63)}function bf(e,t){var n=L(e),r=e===t?R(e):(n-L(t))/(t-e),i=n/r+e;if(I(r)<1e-6)return vf;function a(e,t){var n=i-t,a=r*e;return[n*R(a),i-n*L(a)]}return a.invert=function(e,t){var n=i-t,a=Zc(e,I(n))*rl(n);return n*r<0&&(a-=P*rl(e)*rl(n)),[a/r,i-rl(r)*il(e*e+n*n)]},a}function xf(){return Qd(bf).scale(131.154).center([0,13.9389])}var Sf=1.340264,Cf=-.081106,wf=893e-6,Tf=.003796,Ef=il(3)/2,Df=12;function Of(e,t){var n=sl(Ef*R(t)),r=n*n,i=r*r*r;return[e*L(n)/(Ef*(Sf+3*Cf*r+i*(7*wf+9*Tf*r))),n*(Sf+Cf*r+i*(wf+Tf*r))]}Of.invert=function(e,t){for(var n=t,r=n*n,i=r*r*r,a=0,o,s,c;a<Df&&(s=n*(Sf+Cf*r+i*(wf+Tf*r))-t,c=Sf+3*Cf*r+i*(7*wf+9*Tf*r),n-=o=s/c,r=n*n,i=r*r*r,!(I(o)<1e-12));++a);return[Ef*e*(Sf+3*Cf*r+i*(7*wf+9*Tf*r))/L(n),sl(R(n)/Ef)]};function kf(){return Xd(Of).scale(177.158)}function Af(e,t){var n=L(t),r=L(e)*n;return[n*R(e)/r,R(t)/r]}Af.invert=sf(Xc);function jf(){return Xd(Af).scale(144.049).clipAngle(60)}function Mf(e,t){return[L(t)*R(e),R(t)]}Mf.invert=sf(sl);function Nf(){return Xd(Mf).scale(249.5).clipAngle(90+N)}function Pf(e,t){var n=L(t),r=1+L(e)*n;return[n*R(e)/r,R(t)/r]}Pf.invert=sf(function(e){return 2*Xc(e)});function Ff(){return Xd(Pf).scale(250).clipAngle(142)}function If(e,t){return[tl(al((Kc+t)/2)),-e]}If.invert=function(e,t){return[-t,2*Xc($c(e))-Kc]};function Lf(){var e=mf(If),t=e.center,n=e.rotate;return e.center=function(e){return arguments.length?t([-e[1],e[0]]):(e=t(),[e[1],-e[0]])},e.rotate=function(e){return arguments.length?n([e[0],e[1],e.length>2?e[2]+90:90]):(e=n(),[e[0],e[1],e[2]-90])},n([0,0,90]).scale(159.155)}function Rf(e,t){return e.parent===t.parent?1:2}function zf(e){return e.reduce(Bf,0)/e.length}function Bf(e,t){return e+t.x}function Vf(e){return 1+e.reduce(Hf,0)}function Hf(e,t){return Math.max(e,t.y)}function Uf(e){for(var t;t=e.children;)e=t[0];return e}function Wf(e){for(var t;t=e.children;)e=t[t.length-1];return e}function Gf(){var e=Rf,t=1,n=1,r=!1;function i(i){var a,o=0;i.eachAfter(function(t){var n=t.children;n?(t.x=zf(n),t.y=Vf(n)):(t.x=a?o+=e(t,a):0,t.y=0,a=t)});var s=Uf(i),c=Wf(i),l=s.x-e(s,c)/2,u=c.x+e(c,s)/2;return i.eachAfter(r?function(e){e.x=(e.x-i.x)*t,e.y=(i.y-e.y)*n}:function(e){e.x=(e.x-l)/(u-l)*t,e.y=(1-(i.y?e.y/i.y:1))*n})}return i.separation=function(t){return arguments.length?(e=t,i):e},i.size=function(e){return arguments.length?(r=!1,t=+e[0],n=+e[1],i):r?null:[t,n]},i.nodeSize=function(e){return arguments.length?(r=!0,t=+e[0],n=+e[1],i):r?[t,n]:null},i}function Kf(e){var t=0,n=e.children,r=n&&n.length;if(!r)t=1;else for(;--r>=0;)t+=n[r].value;e.value=t}function qf(){return this.eachAfter(Kf)}function Jf(e,t){let n=-1;for(let r of this)e.call(t,r,++n,this);return this}function Yf(e,t){for(var n=this,r=[n],i,a,o=-1;n=r.pop();)if(e.call(t,n,++o,this),i=n.children)for(a=i.length-1;a>=0;--a)r.push(i[a]);return this}function Xf(e,t){for(var n=this,r=[n],i=[],a,o,s,c=-1;n=r.pop();)if(i.push(n),a=n.children)for(o=0,s=a.length;o<s;++o)r.push(a[o]);for(;n=i.pop();)e.call(t,n,++c,this);return this}function Zf(e,t){let n=-1;for(let r of this)if(e.call(t,r,++n,this))return r}function Qf(e){return this.eachAfter(function(t){for(var n=+e(t.data)||0,r=t.children,i=r&&r.length;--i>=0;)n+=r[i].value;t.value=n})}function $f(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})}function ep(e){for(var t=this,n=tp(t,e),r=[t];t!==n;)t=t.parent,r.push(t);for(var i=r.length;e!==n;)r.splice(i,0,e),e=e.parent;return r}function tp(e,t){if(e===t)return e;var n=e.ancestors(),r=t.ancestors(),i=null;for(e=n.pop(),t=r.pop();e===t;)i=e,e=n.pop(),t=r.pop();return i}function np(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t}function rp(){return Array.from(this)}function ip(){var e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e}function ap(){var e=this,t=[];return e.each(function(n){n!==e&&t.push({source:n.parent,target:n})}),t}function*op(){var e=this,t,n=[e],r,i,a;do for(t=n.reverse(),n=[];e=t.pop();)if(yield e,r=e.children)for(i=0,a=r.length;i<a;++i)n.push(r[i]);while(n.length)}function sp(e,t){e instanceof Map?(e=[void 0,e],t===void 0&&(t=up)):t===void 0&&(t=lp);for(var n=new pp(e),r,i=[n],a,o,s,c;r=i.pop();)if((o=t(r.data))&&(c=(o=Array.from(o)).length))for(r.children=o,s=c-1;s>=0;--s)i.push(a=o[s]=new pp(o[s])),a.parent=r,a.depth=r.depth+1;return n.eachBefore(fp)}function cp(){return sp(this).eachBefore(dp)}function lp(e){return e.children}function up(e){return Array.isArray(e)?e[1]:null}function dp(e){e.data.value!==void 0&&(e.value=e.data.value),e.data=e.data.data}function fp(e){var t=0;do e.height=t;while((e=e.parent)&&e.height<++t)}function pp(e){this.data=e,this.depth=this.height=0,this.parent=null}pp.prototype=sp.prototype={constructor:pp,count:qf,each:Jf,eachAfter:Xf,eachBefore:Yf,find:Zf,sum:Qf,sort:$f,path:ep,ancestors:np,descendants:rp,leaves:ip,links:ap,copy:cp,[Symbol.iterator]:op};function mp(e){return e==null?null:hp(e)}function hp(e){if(typeof e!=`function`)throw Error();return e}var gp={depth:-1},_p={},vp={};function yp(e){return e.id}function bp(e){return e.parentId}function xp(){var e=yp,t=bp,n;function r(r){var i=Array.from(r),a=e,o=t,s,c,l,u,d,f,p,m,h=/* @__PURE__ */ new Map;if(n!=null){let e=i.map((e,t)=>Sp(n(e,t,r))),t=e.map(Cp),s=new Set(e).add(``);for(let n of t)s.has(n)||(s.add(n),e.push(n),t.push(Cp(n)),i.push(vp));a=(t,n)=>e[n],o=(e,n)=>t[n]}for(l=0,s=i.length;l<s;++l)c=i[l],f=i[l]=new pp(c),(p=a(c,l,r))!=null&&(p+=``)&&(m=f.id=p,h.set(m,h.has(m)?_p:f)),(p=o(c,l,r))!=null&&(p+=``)&&(f.parent=p);for(l=0;l<s;++l)if(f=i[l],p=f.parent){if(d=h.get(p),!d)throw Error(`missing: `+p);if(d===_p)throw Error(`ambiguous: `+p);d.children?d.children.push(f):d.children=[f],f.parent=d}else{if(u)throw Error(`multiple roots`);u=f}if(!u)throw Error(`no root`);if(n!=null){for(;u.data===vp&&u.children.length===1;)u=u.children[0],--s;for(let e=i.length-1;e>=0&&(f=i[e],f.data===vp);--e)f.data=null}if(u.parent=gp,u.eachBefore(function(e){e.depth=e.parent.depth+1,--s}).eachBefore(fp),u.parent=null,s>0)throw Error(`cycle`);return u}return r.id=function(t){return arguments.length?(e=mp(t),r):e},r.parentId=function(e){return arguments.length?(t=mp(e),r):t},r.path=function(e){return arguments.length?(n=mp(e),r):n},r}function Sp(e){e=`${e}`;let t=e.length;return wp(e,t-1)&&!wp(e,t-2)&&(e=e.slice(0,-1)),e[0]===`/`?e:`/${e}`}function Cp(e){let t=e.length;if(t<2)return``;for(;--t>1&&!wp(e,t););return e.slice(0,t)}function wp(e,t){if(e[t]===`/`){let n=0;for(;t>0&&e[--t]===`\\`;)++n;if(!(n&1))return!0}return!1}function Tp(e,t){return e.parent===t.parent?1:2}function Ep(e){var t=e.children;return t?t[0]:e.t}function Dp(e){var t=e.children;return t?t[t.length-1]:e.t}function Op(e,t,n){var r=n/(t.i-e.i);t.c-=r,t.s+=n,e.c+=r,t.z+=n,t.m+=n}function kp(e){for(var t=0,n=0,r=e.children,i=r.length,a;--i>=0;)a=r[i],a.z+=t,a.m+=t,t+=a.s+(n+=a.c)}function Ap(e,t,n){return e.a.parent===t.parent?e.a:n}function jp(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}jp.prototype=Object.create(pp.prototype);function Mp(e){for(var t=new jp(e,0),n,r=[t],i,a,o,s;n=r.pop();)if(a=n._.children)for(n.children=Array(s=a.length),o=s-1;o>=0;--o)r.push(i=n.children[o]=new jp(a[o],o)),i.parent=n;return(t.parent=new jp(null,0)).children=[t],t}function Np(){var e=Tp,t=1,n=1,r=null;function i(i){var s=Mp(i);if(s.eachAfter(a),s.parent.m=-s.z,s.eachBefore(o),r)i.eachBefore(c);else{var l=i,u=i,d=i;i.eachBefore(function(e){e.x<l.x&&(l=e),e.x>u.x&&(u=e),e.depth>d.depth&&(d=e)});var f=l===u?1:e(l,u)/2,p=f-l.x,m=t/(u.x+f+p),h=n/(d.depth||1);i.eachBefore(function(e){e.x=(e.x+p)*m,e.y=e.depth*h})}return i}function a(t){var n=t.children,r=t.parent.children,i=t.i?r[t.i-1]:null;if(n){kp(t);var a=(n[0].z+n[n.length-1].z)/2;i?(t.z=i.z+e(t._,i._),t.m=t.z-a):t.z=a}else i&&(t.z=i.z+e(t._,i._));t.parent.A=s(t,i,t.parent.A||r[0])}function o(e){e._.x=e.z+e.parent.m,e.m+=e.parent.m}function s(t,n,r){if(n){for(var i=t,a=t,o=n,s=i.parent.children[0],c=i.m,l=a.m,u=o.m,d=s.m,f;o=Dp(o),i=Ep(i),o&&i;)s=Ep(s),a=Dp(a),a.a=t,f=o.z+u-i.z-c+e(o._,i._),f>0&&(Op(Ap(o,t,r),t,f),c+=f,l+=f),u+=o.m,c+=i.m,d+=s.m,l+=a.m;o&&!Dp(a)&&(a.t=o,a.m+=u-l),i&&!Ep(s)&&(s.t=i,s.m+=c-d,r=t)}return r}function c(e){e.x*=t,e.y=e.depth*n}return i.separation=function(t){return arguments.length?(e=t,i):e},i.size=function(e){return arguments.length?(r=!1,t=+e[0],n=+e[1],i):r?null:[t,n]},i.nodeSize=function(e){return arguments.length?(r=!0,t=+e[0],n=+e[1],i):r?[t,n]:null},i}let Pp=1/4294967296;function Fp(e=Math.random()){let t=(0<=e&&e<1?e/Pp:Math.abs(e))|0;return()=>(t=1664525*t+1013904223|0,Pp*(t>>>0))}function Ip(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e)}return this}function Lp(e,t){switch(arguments.length){case 0:break;case 1:typeof e==`function`?this.interpolator(e):this.range(e);break;default:this.domain(e),typeof t==`function`?this.interpolator(t):this.range(t)}return this}let Rp=Symbol(`implicit`);function zp(){var e=new ae,t=[],n=[],r=Rp;function i(i){let a=e.get(i);if(a===void 0){if(r!==Rp)return r;e.set(i,a=t.push(i)-1)}return n[a%n.length]}return i.domain=function(n){if(!arguments.length)return t.slice();t=[],e=new ae;for(let r of n)e.has(r)||e.set(r,t.push(r)-1);return i},i.range=function(e){return arguments.length?(n=Array.from(e),i):n.slice()},i.unknown=function(e){return arguments.length?(r=e,i):r},i.copy=function(){return zp(t,n).unknown(r)},Ip.apply(i,arguments),i}function Bp(){var e=zp().unknown(void 0),t=e.domain,n=e.range,r=0,i=1,a,o,s=!1,c=0,l=0,u=.5;delete e.unknown;function d(){var e=t().length,d=i<r,f=d?i:r,p=d?r:i;a=(p-f)/Math.max(1,e-c+l*2),s&&(a=Math.floor(a)),f+=(p-f-a*(e-c))*u,o=a*(1-c),s&&(f=Math.round(f),o=Math.round(o));var m=Je(e).map(function(e){return f+a*e});return n(d?m.reverse():m)}return e.domain=function(e){return arguments.length?(t(e),d()):t()},e.range=function(e){return arguments.length?([r,i]=e,r=+r,i=+i,d()):[r,i]},e.rangeRound=function(e){return[r,i]=e,r=+r,i=+i,s=!0,d()},e.bandwidth=function(){return o},e.step=function(){return a},e.round=function(e){return arguments.length?(s=!!e,d()):s},e.padding=function(e){return arguments.length?(c=Math.min(1,l=+e),d()):c},e.paddingInner=function(e){return arguments.length?(c=Math.min(1,e),d()):c},e.paddingOuter=function(e){return arguments.length?(l=+e,d()):l},e.align=function(e){return arguments.length?(u=Math.max(0,Math.min(1,e)),d()):u},e.copy=function(){return Bp(t(),[r,i]).round(s).paddingInner(c).paddingOuter(l).align(u)},Ip.apply(d(),arguments)}function Vp(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return Vp(t())},e}function Hp(){return Vp(Bp.apply(null,arguments).paddingInner(1))}function Up(e){return function(){return e}}function Wp(e){return+e}var Gp=[0,1];function Kp(e){return e}function qp(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:Up(isNaN(t)?NaN:.5)}function Jp(e,t){var n;return e>t&&(n=e,e=t,t=n),function(n){return Math.max(e,Math.min(t,n))}}function Yp(e,t,n){var r=e[0],i=e[1],a=t[0],o=t[1];return i<r?(r=qp(i,r),a=n(o,a)):(r=qp(r,i),a=n(a,o)),function(e){return a(r(e))}}function Xp(e,t,n){var r=Math.min(e.length,t.length)-1,i=Array(r),a=Array(r),o=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++o<r;)i[o]=qp(e[o],e[o+1]),a[o]=n(t[o],t[o+1]);return function(t){var n=_(e,t,1,r)-1;return a[n](i[n](t))}}function Zp(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function Qp(){var e=Gp,t=Gp,n=ra,r,i,a,o=Kp,s,c,l;function u(){var n=Math.min(e.length,t.length);return o!==Kp&&(o=Jp(e[0],e[n-1])),s=n>2?Xp:Yp,c=l=null,d}function d(i){return i==null||isNaN(i=+i)?a:(c||=s(e.map(r),t,n))(r(o(i)))}return d.invert=function(n){return o(i((l||=s(t,e.map(r),Xi))(n)))},d.domain=function(t){return arguments.length?(e=Array.from(t,Wp),u()):e.slice()},d.range=function(e){return arguments.length?(t=Array.from(e),u()):t.slice()},d.rangeRound=function(e){return t=Array.from(e),n=ia,u()},d.clamp=function(e){return arguments.length?(o=e?!0:Kp,u()):o!==Kp},d.interpolate=function(e){return arguments.length?(n=e,u()):n},d.unknown=function(e){return arguments.length?(a=e,d):a},function(e,t){return r=e,i=t,u()}}function $p(){return Qp()(Kp,Kp)}function em(e,t,n,r){var i=De(e,t,n),a;switch(r=Oc(r??`,f`),r.type){case`s`:var o=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(a=Wc(i,o))&&(r.precision=a),Vc(r,o);case``:case`e`:case`g`:case`p`:case`r`:r.precision==null&&!isNaN(a=Gc(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=a-(r.type===`e`));break;case`f`:case`%`:r.precision==null&&!isNaN(a=Uc(i))&&(r.precision=a-(r.type===`%`)*2)}return Bc(r)}function tm(e){var t=e.domain;return e.ticks=function(e){var n=t();return Te(n[0],n[n.length-1],e??10)},e.tickFormat=function(e,n){var r=t();return em(r[0],r[r.length-1],e??10,n)},e.nice=function(n){n??=10;var r=t(),i=0,a=r.length-1,o=r[i],s=r[a],c,l,u=10;for(s<o&&(l=o,o=s,s=l,l=i,i=a,a=l);u-->0;){if(l=Ee(o,s,n),l===c)return r[i]=o,r[a]=s,t(r);if(l>0)o=Math.floor(o/l)*l,s=Math.ceil(s/l)*l;else if(l<0)o=Math.ceil(o*l)/l,s=Math.floor(s*l)/l;else break;c=l}return e},e}function nm(){var e=$p();return e.copy=function(){return Zp(e,nm())},Ip.apply(e,arguments),tm(e)}function rm(e){var t;function n(e){return e==null||isNaN(e=+e)?t:e}return n.invert=n,n.domain=n.range=function(t){return arguments.length?(e=Array.from(t,Wp),n):e.slice()},n.unknown=function(e){return arguments.length?(t=e,n):t},n.copy=function(){return rm(e).unknown(t)},e=arguments.length?Array.from(e,Wp):[0,1],tm(n)}function im(e,t){e=e.slice();var n=0,r=e.length-1,i=e[n],a=e[r],o;return a<i&&(o=n,n=r,r=o,o=i,i=a,a=o),e[n]=t.floor(i),e[r]=t.ceil(a),e}function am(e){return Math.log(e)}function om(e){return Math.exp(e)}function sm(e){return-Math.log(-e)}function cm(e){return-Math.exp(-e)}function lm(e){return isFinite(e)?+(`1e`+e):e<0?0:e}function um(e){return e===10?lm:e===Math.E?Math.exp:t=>e**+t}function dm(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 fm(e){return(t,n)=>-e(-t,n)}function pm(e){let t=e(am,om),n=t.domain,r=10,i,a;function o(){return i=dm(r),a=um(r),n()[0]<0?(i=fm(i),a=fm(a),e(sm,cm)):e(am,om),t}return t.base=function(e){return arguments.length?(r=+e,o()):r},t.domain=function(e){return arguments.length?(n(e),o()):n()},t.ticks=e=>{let t=n(),o=t[0],s=t[t.length-1],c=s<o;c&&([o,s]=[s,o]);let l=i(o),u=i(s),d,f,p=e==null?10:+e,m=[];if(!(r%1)&&u-l<p){if(l=Math.floor(l),u=Math.ceil(u),o>0){for(;l<=u;++l)for(d=1;d<r;++d)if(f=l<0?d/a(-l):d*a(l),!(f<o)){if(f>s)break;m.push(f)}}else for(;l<=u;++l)for(d=r-1;d>=1;--d)if(f=l>0?d/a(-l):d*a(l),!(f<o)){if(f>s)break;m.push(f)}m.length*2<p&&(m=Te(o,s,p))}else m=Te(l,u,Math.min(u-l,p)).map(a);return c?m.reverse():m},t.tickFormat=(e,n)=>{if(e??=10,n??=r===10?`s`:`,`,typeof n!=`function`&&(!(r%1)&&(n=Oc(n)).precision==null&&(n.trim=!0),n=Bc(n)),e===1/0)return n;let o=Math.max(1,r*e/t.ticks().length);return e=>{let t=e/a(Math.round(i(e)));return t*r<r-.5&&(t*=r),t<=o?n(e):``}},t.nice=()=>n(im(n(),{floor:e=>a(Math.floor(i(e))),ceil:e=>a(Math.ceil(i(e)))})),t}function mm(){let e=pm(Qp()).domain([1,10]);return e.copy=()=>Zp(e,mm()).base(e.base()),Ip.apply(e,arguments),e}function hm(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function gm(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function _m(e){var t=1,n=e(hm(t),gm(t));return n.constant=function(n){return arguments.length?e(hm(t=+n),gm(t)):t},tm(n)}function vm(){var e=_m(Qp());return e.copy=function(){return Zp(e,vm()).constant(e.constant())},Ip.apply(e,arguments)}function ym(e){return function(t){return t<0?-((-t)**+e):t**+e}}function bm(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function xm(e){return e<0?-e*e:e*e}function Sm(e){var t=e(Kp,Kp),n=1;function r(){return n===1?e(Kp,Kp):n===.5?e(bm,xm):e(ym(n),ym(1/n))}return t.exponent=function(e){return arguments.length?(n=+e,r()):n},tm(t)}function Cm(){var e=Sm(Qp());return e.copy=function(){return Zp(e,Cm()).exponent(e.exponent())},Ip.apply(e,arguments),e}function wm(){var e=[],t=[],n=[],r;function i(){var r=0,i=Math.max(1,t.length);for(n=Array(i-1);++r<i;)n[r-1]=Re(e,r/i);return a}function a(e){return e==null||isNaN(e=+e)?r:t[_(n,e)]}return a.invertExtent=function(r){var i=t.indexOf(r);return i<0?[NaN,NaN]:[i>0?n[i-1]:e[0],i<n.length?n[i]:e[e.length-1]]},a.domain=function(t){if(!arguments.length)return e.slice();e=[];for(let n of t)n!=null&&!isNaN(n=+n)&&e.push(n);return e.sort(u),i()},a.range=function(e){return arguments.length?(t=Array.from(e),i()):t.slice()},a.unknown=function(e){return arguments.length?(r=e,a):r},a.quantiles=function(){return n.slice()},a.copy=function(){return wm().domain(e).range(t).unknown(r)},Ip.apply(a,arguments)}function Tm(){var e=[.5],t=[0,1],n,r=1;function i(i){return i!=null&&i<=i?t[_(e,i,0,r)]:n}return i.domain=function(n){return arguments.length?(e=Array.from(n),r=Math.min(e.length,t.length-1),i):e.slice()},i.range=function(n){return arguments.length?(t=Array.from(n),r=Math.min(e.length,t.length-1),i):t.slice()},i.invertExtent=function(n){var r=t.indexOf(n);return[e[r-1],e[r]]},i.unknown=function(e){return arguments.length?(n=e,i):n},i.copy=function(){return Tm().domain(e).range(t).unknown(n)},Ip.apply(i,arguments)}let Em=/* @__PURE__ */ new Date,Dm=/* @__PURE__ */ new Date;function Om(e,t,n,r){function i(t){return e(t=arguments.length===0?/* @__PURE__ */ new Date:/* @__PURE__ */ new Date(+t)),t}return i.floor=t=>(e(t=/* @__PURE__ */ new Date(+t)),t),i.ceil=n=>(e(n=/* @__PURE__ */ new Date(n-1)),t(n,1),e(n),n),i.round=e=>{let t=i(e),n=i.ceil(e);return e-t<n-e?t:n},i.offset=(e,n)=>(t(e=/* @__PURE__ */ new Date(+e),n==null?1:Math.floor(n)),e),i.range=(n,r,a)=>{let o=[];if(n=i.ceil(n),a=a==null?1:Math.floor(a),!(n<r)||!(a>0))return o;let s;do o.push(s=/* @__PURE__ */ new Date(+n)),t(n,a),e(n);while(s<n&&n<r);return o},i.filter=n=>Om(t=>{if(t>=t)for(;e(t),!n(t);)t.setTime(t-1)},(e,r)=>{if(e>=e){if(r<0)for(;++r<=0;)for(;t(e,-1),!n(e););else for(;--r>=0;)for(;t(e,1),!n(e););}}),n&&(i.count=(t,r)=>(Em.setTime(+t),Dm.setTime(+r),e(Em),e(Dm),Math.floor(n(Em,Dm))),i.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?i.filter(r?t=>r(t)%e===0:t=>i.count(0,t)%e===0):i)),i}let km=Om(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);km.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?Om(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):km),km.range;let Am=1e3,jm=Am*60,Mm=jm*60,Nm=Mm*24,Pm=Nm*7,Fm=Nm*30,Im=Nm*365,Lm=Om(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*Am)},(e,t)=>(t-e)/Am,e=>e.getUTCSeconds());Lm.range;let Rm=Om(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Am)},(e,t)=>{e.setTime(+e+t*jm)},(e,t)=>(t-e)/jm,e=>e.getMinutes());Rm.range;let zm=Om(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*jm)},(e,t)=>(t-e)/jm,e=>e.getUTCMinutes());zm.range;let Bm=Om(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Am-e.getMinutes()*jm)},(e,t)=>{e.setTime(+e+t*Mm)},(e,t)=>(t-e)/Mm,e=>e.getHours());Bm.range;let Vm=Om(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*Mm)},(e,t)=>(t-e)/Mm,e=>e.getUTCHours());Vm.range;let Hm=Om(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*jm)/Nm,e=>e.getDate()-1);Hm.range;let Um=Om(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Nm,e=>e.getUTCDate()-1);Um.range;let Wm=Om(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Nm,e=>Math.floor(e/Nm));Wm.range;function Gm(e){return Om(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(e,t)=>{e.setDate(e.getDate()+t*7)},(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*jm)/Pm)}let Km=Gm(0),qm=Gm(1),Jm=Gm(2),Ym=Gm(3),Xm=Gm(4),Zm=Gm(5),Qm=Gm(6);Km.range,qm.range,Jm.range,Ym.range,Xm.range,Zm.range,Qm.range;function $m(e){return Om(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t*7)},(e,t)=>(t-e)/Pm)}let eh=$m(0),th=$m(1),nh=$m(2),rh=$m(3),ih=$m(4),ah=$m(5),oh=$m(6);eh.range,th.range,nh.range,rh.range,ih.range,ah.range,oh.range;let sh=Om(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());sh.range;let ch=Om(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());ch.range;let lh=Om(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());lh.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Om(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)}),lh.range;let uh=Om(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());uh.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Om(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)}),uh.range;function dh(e,t,n,r,i,a){let o=[[Lm,1,Am],[Lm,5,5*Am],[Lm,15,15*Am],[Lm,30,30*Am],[a,1,jm],[a,5,5*jm],[a,15,15*jm],[a,30,30*jm],[i,1,Mm],[i,3,3*Mm],[i,6,6*Mm],[i,12,12*Mm],[r,1,Nm],[r,2,2*Nm],[n,1,Pm],[t,1,Fm],[t,3,3*Fm],[e,1,Im]];function s(e,t,n){let r=t<e;r&&([e,t]=[t,e]);let i=n&&typeof n.range==`function`?n:c(e,t,n),a=i?i.range(e,+t+1):[];return r?a.reverse():a}function c(t,n,r){let i=Math.abs(n-t)/r,a=f(([,,e])=>e).right(o,i);if(a===o.length)return e.every(De(t/Im,n/Im,r));if(a===0)return km.every(Math.max(De(t,n,r),1));let[s,c]=o[i/o[a-1][2]<o[a][2]/i?a-1:a];return s.every(c)}return[s,c]}let[fh,ph]=dh(uh,ch,eh,Wm,Vm,zm),[mh,hh]=dh(lh,sh,Km,Hm,Bm,Rm);function gh(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 _h(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 vh(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function yh(e){var t=e.dateTime,n=e.date,r=e.time,i=e.periods,a=e.days,o=e.shortDays,s=e.months,c=e.shortMonths,l=Th(i),u=Eh(i),d=Th(a),f=Eh(a),p=Th(o),m=Eh(o),h=Th(s),g=Eh(s),_=Th(c),v=Eh(c),y={a:ne,A:re,b:j,B:ie,c:null,d:qh,e:qh,f:Qh,g:lg,G:dg,H:Jh,I:Yh,j:Xh,L:Zh,m:$h,M:eg,p:ae,q:oe,Q:Pg,s:Fg,S:tg,u:ng,U:rg,V:ag,w:og,W:sg,x:null,X:null,y:cg,Y:ug,Z:fg,"%":Ng},b={a:se,A:ce,b:le,B:ue,c:null,d:pg,e:pg,f:vg,g:kg,G:jg,H:mg,I:hg,j:gg,L:_g,m:yg,M:bg,p:de,q:fe,Q:Pg,s:Fg,S:xg,u:Sg,U:Cg,V:Tg,w:Eg,W:Dg,x:null,X:null,y:Og,Y:Ag,Z:Mg,"%":Ng},x={a:E,A:D,b:O,B:k,c:A,d:Lh,e:Lh,f:Uh,g:Nh,G:Mh,H:zh,I:zh,j:Rh,L:Hh,m:Ih,M:Bh,p:T,q:Fh,Q:Gh,s:Kh,S:Vh,u:Oh,U:kh,V:Ah,w:Dh,W:jh,x:ee,X:te,y:Nh,Y:Mh,Z:Ph,"%":Wh};y.x=S(n,y),y.X=S(r,y),y.c=S(t,y),b.x=S(n,b),b.X=S(r,b),b.c=S(t,b);function S(e,t){return function(n){var r=[],i=-1,a=0,o=e.length,s,c,l;for(n instanceof Date||(n=/* @__PURE__ */ new Date(+n));++i<o;)e.charCodeAt(i)===37&&(r.push(e.slice(a,i)),(c=bh[s=e.charAt(++i)])==null?c=s===`e`?` `:`0`:s=e.charAt(++i),(l=t[s])&&(s=l(n,c)),r.push(s),a=i+1);return r.push(e.slice(a,i)),r.join(``)}}function C(e,t){return function(n){var r=vh(1900,void 0,1),i=w(r,e,n+=``,0),a,o;if(i!=n.length)return null;if(`Q`in r)return new Date(r.Q);if(`s`in r)return new Date(r.s*1e3+(`L`in r?r.L:0));if(t&&!(`Z`in r)&&(r.Z=0),`p`in r&&(r.H=r.H%12+r.p*12),r.m===void 0&&(r.m=`q`in r?r.q:0),`V`in r){if(r.V<1||r.V>53)return null;`w`in r||(r.w=1),`Z`in r?(a=_h(vh(r.y,0,1)),o=a.getUTCDay(),a=o>4||o===0?th.ceil(a):th(a),a=Um.offset(a,(r.V-1)*7),r.y=a.getUTCFullYear(),r.m=a.getUTCMonth(),r.d=a.getUTCDate()+(r.w+6)%7):(a=gh(vh(r.y,0,1)),o=a.getDay(),a=o>4||o===0?qm.ceil(a):qm(a),a=Hm.offset(a,(r.V-1)*7),r.y=a.getFullYear(),r.m=a.getMonth(),r.d=a.getDate()+(r.w+6)%7)}else(`W`in r||`U`in r)&&(`w`in r||(r.w=`u`in r?r.u%7:+(`W`in r)),o=`Z`in r?_h(vh(r.y,0,1)).getUTCDay():gh(vh(r.y,0,1)).getDay(),r.m=0,r.d=`W`in r?(r.w+6)%7+r.W*7-(o+5)%7:r.w+r.U*7-(o+6)%7);return`Z`in r?(r.H+=r.Z/100|0,r.M+=r.Z%100,_h(r)):gh(r)}}function w(e,t,n,r){for(var i=0,a=t.length,o=n.length,s,c;i<a;){if(r>=o)return-1;if(s=t.charCodeAt(i++),s===37){if(s=t.charAt(i++),c=x[s in bh?t.charAt(i++):s],!c||(r=c(e,n,r))<0)return-1}else if(s!=n.charCodeAt(r++))return-1}return r}function T(e,t,n){var r=l.exec(t.slice(n));return r?(e.p=u.get(r[0].toLowerCase()),n+r[0].length):-1}function E(e,t,n){var r=p.exec(t.slice(n));return r?(e.w=m.get(r[0].toLowerCase()),n+r[0].length):-1}function D(e,t,n){var r=d.exec(t.slice(n));return r?(e.w=f.get(r[0].toLowerCase()),n+r[0].length):-1}function O(e,t,n){var r=_.exec(t.slice(n));return r?(e.m=v.get(r[0].toLowerCase()),n+r[0].length):-1}function k(e,t,n){var r=h.exec(t.slice(n));return r?(e.m=g.get(r[0].toLowerCase()),n+r[0].length):-1}function A(e,n,r){return w(e,t,n,r)}function ee(e,t,r){return w(e,n,t,r)}function te(e,t,n){return w(e,r,t,n)}function ne(e){return o[e.getDay()]}function re(e){return a[e.getDay()]}function j(e){return c[e.getMonth()]}function ie(e){return s[e.getMonth()]}function ae(e){return i[+(e.getHours()>=12)]}function oe(e){return 1+~~(e.getMonth()/3)}function se(e){return o[e.getUTCDay()]}function ce(e){return a[e.getUTCDay()]}function le(e){return c[e.getUTCMonth()]}function ue(e){return s[e.getUTCMonth()]}function de(e){return i[+(e.getUTCHours()>=12)]}function fe(e){return 1+~~(e.getUTCMonth()/3)}return{format:function(e){var t=S(e+=``,y);return t.toString=function(){return e},t},parse:function(e){var t=C(e+=``,!1);return t.toString=function(){return e},t},utcFormat:function(e){var t=S(e+=``,b);return t.toString=function(){return e},t},utcParse:function(e){var t=C(e+=``,!0);return t.toString=function(){return e},t}}}var bh={"-":``,_:` `,0:`0`},xh=/^\s*\d+/,Sh=/^%/,Ch=/[\\^$*+?|[\]().{}]/g;function z(e,t,n){var r=e<0?`-`:``,i=(r?-e:e)+``,a=i.length;return r+(a<n?Array(n-a+1).join(t)+i:i)}function wh(e){return e.replace(Ch,`\\$&`)}function Th(e){return RegExp(`^(?:`+e.map(wh).join(`|`)+`)`,`i`)}function Eh(e){return new Map(e.map((e,t)=>[e.toLowerCase(),t]))}function Dh(e,t,n){var r=xh.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function Oh(e,t,n){var r=xh.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function kh(e,t,n){var r=xh.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function Ah(e,t,n){var r=xh.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function jh(e,t,n){var r=xh.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function Mh(e,t,n){var r=xh.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function Nh(e,t,n){var r=xh.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function Ph(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||`00`)),n+r[0].length):-1}function Fh(e,t,n){var r=xh.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function Ih(e,t,n){var r=xh.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function Lh(e,t,n){var r=xh.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function Rh(e,t,n){var r=xh.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function zh(e,t,n){var r=xh.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function Bh(e,t,n){var r=xh.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function Vh(e,t,n){var r=xh.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function Hh(e,t,n){var r=xh.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function Uh(e,t,n){var r=xh.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function Wh(e,t,n){var r=Sh.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function Gh(e,t,n){var r=xh.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function Kh(e,t,n){var r=xh.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function qh(e,t){return z(e.getDate(),t,2)}function Jh(e,t){return z(e.getHours(),t,2)}function Yh(e,t){return z(e.getHours()%12||12,t,2)}function Xh(e,t){return z(1+Hm.count(lh(e),e),t,3)}function Zh(e,t){return z(e.getMilliseconds(),t,3)}function Qh(e,t){return Zh(e,t)+`000`}function $h(e,t){return z(e.getMonth()+1,t,2)}function eg(e,t){return z(e.getMinutes(),t,2)}function tg(e,t){return z(e.getSeconds(),t,2)}function ng(e){var t=e.getDay();return t===0?7:t}function rg(e,t){return z(Km.count(lh(e)-1,e),t,2)}function ig(e){var t=e.getDay();return t>=4||t===0?Xm(e):Xm.ceil(e)}function ag(e,t){return e=ig(e),z(Xm.count(lh(e),e)+(lh(e).getDay()===4),t,2)}function og(e){return e.getDay()}function sg(e,t){return z(qm.count(lh(e)-1,e),t,2)}function cg(e,t){return z(e.getFullYear()%100,t,2)}function lg(e,t){return e=ig(e),z(e.getFullYear()%100,t,2)}function ug(e,t){return z(e.getFullYear()%1e4,t,4)}function dg(e,t){var n=e.getDay();return e=n>=4||n===0?Xm(e):Xm.ceil(e),z(e.getFullYear()%1e4,t,4)}function fg(e){var t=e.getTimezoneOffset();return(t>0?`-`:(t*=-1,`+`))+z(t/60|0,`0`,2)+z(t%60,`0`,2)}function pg(e,t){return z(e.getUTCDate(),t,2)}function mg(e,t){return z(e.getUTCHours(),t,2)}function hg(e,t){return z(e.getUTCHours()%12||12,t,2)}function gg(e,t){return z(1+Um.count(uh(e),e),t,3)}function _g(e,t){return z(e.getUTCMilliseconds(),t,3)}function vg(e,t){return _g(e,t)+`000`}function yg(e,t){return z(e.getUTCMonth()+1,t,2)}function bg(e,t){return z(e.getUTCMinutes(),t,2)}function xg(e,t){return z(e.getUTCSeconds(),t,2)}function Sg(e){var t=e.getUTCDay();return t===0?7:t}function Cg(e,t){return z(eh.count(uh(e)-1,e),t,2)}function wg(e){var t=e.getUTCDay();return t>=4||t===0?ih(e):ih.ceil(e)}function Tg(e,t){return e=wg(e),z(ih.count(uh(e),e)+(uh(e).getUTCDay()===4),t,2)}function Eg(e){return e.getUTCDay()}function Dg(e,t){return z(th.count(uh(e)-1,e),t,2)}function Og(e,t){return z(e.getUTCFullYear()%100,t,2)}function kg(e,t){return e=wg(e),z(e.getUTCFullYear()%100,t,2)}function Ag(e,t){return z(e.getUTCFullYear()%1e4,t,4)}function jg(e,t){var n=e.getUTCDay();return e=n>=4||n===0?ih(e):ih.ceil(e),z(e.getUTCFullYear()%1e4,t,4)}function Mg(){return`+0000`}function Ng(){return`%`}function Pg(e){return+e}function Fg(e){return Math.floor(e/1e3)}var Ig,Lg,Rg;zg({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 zg(e){return Ig=yh(e),Lg=Ig.format,Ig.parse,Rg=Ig.utcFormat,Ig.utcParse,Ig}function Bg(e){return new Date(e)}function Vg(e){return e instanceof Date?+e:+/* @__PURE__ */ new Date(+e)}function Hg(e,t,n,r,i,a,o,s,c,l){var u=$p(),d=u.invert,f=u.domain,p=l(`.%L`),m=l(`:%S`),h=l(`%I:%M`),g=l(`%I %p`),_=l(`%a %d`),v=l(`%b %d`),y=l(`%B`),b=l(`%Y`);function x(e){return(c(e)<e?p:s(e)<e?m:o(e)<e?h:a(e)<e?g:r(e)<e?i(e)<e?_:v:n(e)<e?y:b)(e)}return u.invert=function(e){return new Date(d(e))},u.domain=function(e){return arguments.length?f(Array.from(e,Vg)):f().map(Bg)},u.ticks=function(t){var n=f();return e(n[0],n[n.length-1],t??10)},u.tickFormat=function(e,t){return t==null?x:l(t)},u.nice=function(e){var n=f();return(!e||typeof e.range!=`function`)&&(e=t(n[0],n[n.length-1],e??10)),e?f(im(n,e)):u},u.copy=function(){return Zp(u,Hg(e,t,n,r,i,a,o,s,c,l))},u}function Ug(){return Ip.apply(Hg(mh,hh,lh,sh,Km,Hm,Bm,Rm,Lm,Lg).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function Wg(){return Ip.apply(Hg(fh,ph,uh,ch,eh,Um,Vm,zm,Lm,Rg).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function Gg(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function Kg(){var e=0,t=.5,n=1,r=1,i,a,o,s,c,l=Kp,u,d=!1,f;function p(e){return isNaN(e=+e)?f:(e=.5+((e=+u(e))-a)*(r*e<r*a?s:c),l(d?Math.max(0,Math.min(1,e)):e))}p.domain=function(l){return arguments.length?([e,t,n]=l,i=u(e=+e),a=u(t=+t),o=u(n=+n),s=i===a?0:.5/(a-i),c=a===o?0:.5/(o-a),r=a<i?-1:1,p):[e,t,n]},p.clamp=function(e){return arguments.length?(d=!!e,p):d},p.interpolator=function(e){return arguments.length?(l=e,p):l};function m(e){return function(t){var n,r,i;return arguments.length?([n,r,i]=t,l=xa(e,[n,r,i]),p):[l(0),l(.5),l(1)]}}return p.range=m(ra),p.rangeRound=m(ia),p.unknown=function(e){return arguments.length?(f=e,p):f},function(l){return u=l,i=l(e),a=l(t),o=l(n),s=i===a?0:.5/(a-i),c=a===o?0:.5/(o-a),r=a<i?-1:1,p}}function qg(){var e=tm(Kg()(Kp));return e.copy=function(){return Gg(e,qg())},Lp.apply(e,arguments)}function Jg(){var e=pm(Kg()).domain([.1,1,10]);return e.copy=function(){return Gg(e,Jg()).base(e.base())},Lp.apply(e,arguments)}function Yg(){var e=_m(Kg());return e.copy=function(){return Gg(e,Yg()).constant(e.constant())},Lp.apply(e,arguments)}function Xg(){var e=Sm(Kg());return e.copy=function(){return Gg(e,Xg()).exponent(e.exponent())},Lp.apply(e,arguments)}function B(e){for(var t=e.length/6|0,n=Array(t),r=0;r<t;)n[r]=`#`+e.slice(r*6,++r*6);return n}var Zg=B(`1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf`),Qg=B(`7fc97fbeaed4fdc086ffff99386cb0f0027fbf5b17666666`),$g=B(`1b9e77d95f027570b3e7298a66a61ee6ab02a6761d666666`),e_=B(`4269d0efb118ff725c6cc5b03ca951ff8ab7a463f297bbf59c6b4e9498a0`),t_=B(`a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928`),n_=B(`fbb4aeb3cde3ccebc5decbe4fed9a6ffffcce5d8bdfddaecf2f2f2`),r_=B(`b3e2cdfdcdaccbd5e8f4cae4e6f5c9fff2aef1e2cccccccc`),i_=B(`e41a1c377eb84daf4a984ea3ff7f00ffff33a65628f781bf999999`),a_=B(`66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3`),o_=B(`8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f`),s_=B(`4e79a7f28e2ce1575976b7b259a14fedc949af7aa1ff9da79c755fbab0ab`),V=e=>Gi(e[e.length-1]),c_=[,,,`d8b365f5f5f55ab4ac`,`a6611adfc27d80cdc1018571`,`a6611adfc27df5f5f580cdc1018571`,`8c510ad8b365f6e8c3c7eae55ab4ac01665e`,`8c510ad8b365f6e8c3f5f5f5c7eae55ab4ac01665e`,`8c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e`,`8c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e`,`5430058c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e003c30`,`5430058c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e003c30`].map(B),l_=V(c_),u_=[,,,`af8dc3f7f7f77fbf7b`,`7b3294c2a5cfa6dba0008837`,`7b3294c2a5cff7f7f7a6dba0008837`,`762a83af8dc3e7d4e8d9f0d37fbf7b1b7837`,`762a83af8dc3e7d4e8f7f7f7d9f0d37fbf7b1b7837`,`762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b7837`,`762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b7837`,`40004b762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b783700441b`,`40004b762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b783700441b`].map(B),d_=V(u_),f_=[,,,`e9a3c9f7f7f7a1d76a`,`d01c8bf1b6dab8e1864dac26`,`d01c8bf1b6daf7f7f7b8e1864dac26`,`c51b7de9a3c9fde0efe6f5d0a1d76a4d9221`,`c51b7de9a3c9fde0eff7f7f7e6f5d0a1d76a4d9221`,`c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221`,`c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221`,`8e0152c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221276419`,`8e0152c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221276419`].map(B),p_=V(f_),m_=[,,,`998ec3f7f7f7f1a340`,`5e3c99b2abd2fdb863e66101`,`5e3c99b2abd2f7f7f7fdb863e66101`,`542788998ec3d8daebfee0b6f1a340b35806`,`542788998ec3d8daebf7f7f7fee0b6f1a340b35806`,`5427888073acb2abd2d8daebfee0b6fdb863e08214b35806`,`5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b35806`,`2d004b5427888073acb2abd2d8daebfee0b6fdb863e08214b358067f3b08`,`2d004b5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b358067f3b08`].map(B),h_=V(m_),g_=[,,,`ef8a62f7f7f767a9cf`,`ca0020f4a58292c5de0571b0`,`ca0020f4a582f7f7f792c5de0571b0`,`b2182bef8a62fddbc7d1e5f067a9cf2166ac`,`b2182bef8a62fddbc7f7f7f7d1e5f067a9cf2166ac`,`b2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac`,`b2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac`,`67001fb2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac053061`,`67001fb2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac053061`].map(B),__=V(g_),v_=[,,,`ef8a62ffffff999999`,`ca0020f4a582bababa404040`,`ca0020f4a582ffffffbababa404040`,`b2182bef8a62fddbc7e0e0e09999994d4d4d`,`b2182bef8a62fddbc7ffffffe0e0e09999994d4d4d`,`b2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d`,`b2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d`,`67001fb2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d1a1a1a`,`67001fb2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d1a1a1a`].map(B),y_=V(v_),b_=[,,,`fc8d59ffffbf91bfdb`,`d7191cfdae61abd9e92c7bb6`,`d7191cfdae61ffffbfabd9e92c7bb6`,`d73027fc8d59fee090e0f3f891bfdb4575b4`,`d73027fc8d59fee090ffffbfe0f3f891bfdb4575b4`,`d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4`,`d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4`,`a50026d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4313695`,`a50026d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4313695`].map(B),x_=V(b_),S_=[,,,`fc8d59ffffbf91cf60`,`d7191cfdae61a6d96a1a9641`,`d7191cfdae61ffffbfa6d96a1a9641`,`d73027fc8d59fee08bd9ef8b91cf601a9850`,`d73027fc8d59fee08bffffbfd9ef8b91cf601a9850`,`d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850`,`d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850`,`a50026d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850006837`,`a50026d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850006837`].map(B),C_=V(S_),w_=[,,,`fc8d59ffffbf99d594`,`d7191cfdae61abdda42b83ba`,`d7191cfdae61ffffbfabdda42b83ba`,`d53e4ffc8d59fee08be6f59899d5943288bd`,`d53e4ffc8d59fee08bffffbfe6f59899d5943288bd`,`d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd`,`d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd`,`9e0142d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd5e4fa2`,`9e0142d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd5e4fa2`].map(B),T_=V(w_),E_=[,,,`e5f5f999d8c92ca25f`,`edf8fbb2e2e266c2a4238b45`,`edf8fbb2e2e266c2a42ca25f006d2c`,`edf8fbccece699d8c966c2a42ca25f006d2c`,`edf8fbccece699d8c966c2a441ae76238b45005824`,`f7fcfde5f5f9ccece699d8c966c2a441ae76238b45005824`,`f7fcfde5f5f9ccece699d8c966c2a441ae76238b45006d2c00441b`].map(B),D_=V(E_),O_=[,,,`e0ecf49ebcda8856a7`,`edf8fbb3cde38c96c688419d`,`edf8fbb3cde38c96c68856a7810f7c`,`edf8fbbfd3e69ebcda8c96c68856a7810f7c`,`edf8fbbfd3e69ebcda8c96c68c6bb188419d6e016b`,`f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d6e016b`,`f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d810f7c4d004b`].map(B),k_=V(O_),A_=[,,,`e0f3dba8ddb543a2ca`,`f0f9e8bae4bc7bccc42b8cbe`,`f0f9e8bae4bc7bccc443a2ca0868ac`,`f0f9e8ccebc5a8ddb57bccc443a2ca0868ac`,`f0f9e8ccebc5a8ddb57bccc44eb3d32b8cbe08589e`,`f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe08589e`,`f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe0868ac084081`].map(B),j_=V(A_),M_=[,,,`fee8c8fdbb84e34a33`,`fef0d9fdcc8afc8d59d7301f`,`fef0d9fdcc8afc8d59e34a33b30000`,`fef0d9fdd49efdbb84fc8d59e34a33b30000`,`fef0d9fdd49efdbb84fc8d59ef6548d7301f990000`,`fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301f990000`,`fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301fb300007f0000`].map(B),N_=V(M_),P_=[,,,`ece2f0a6bddb1c9099`,`f6eff7bdc9e167a9cf02818a`,`f6eff7bdc9e167a9cf1c9099016c59`,`f6eff7d0d1e6a6bddb67a9cf1c9099016c59`,`f6eff7d0d1e6a6bddb67a9cf3690c002818a016450`,`fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016450`,`fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016c59014636`].map(B),F_=V(P_),I_=[,,,`ece7f2a6bddb2b8cbe`,`f1eef6bdc9e174a9cf0570b0`,`f1eef6bdc9e174a9cf2b8cbe045a8d`,`f1eef6d0d1e6a6bddb74a9cf2b8cbe045a8d`,`f1eef6d0d1e6a6bddb74a9cf3690c00570b0034e7b`,`fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0034e7b`,`fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0045a8d023858`].map(B),L_=V(I_),R_=[,,,`e7e1efc994c7dd1c77`,`f1eef6d7b5d8df65b0ce1256`,`f1eef6d7b5d8df65b0dd1c77980043`,`f1eef6d4b9dac994c7df65b0dd1c77980043`,`f1eef6d4b9dac994c7df65b0e7298ace125691003f`,`f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125691003f`,`f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125698004367001f`].map(B),z_=V(R_),B_=[,,,`fde0ddfa9fb5c51b8a`,`feebe2fbb4b9f768a1ae017e`,`feebe2fbb4b9f768a1c51b8a7a0177`,`feebe2fcc5c0fa9fb5f768a1c51b8a7a0177`,`feebe2fcc5c0fa9fb5f768a1dd3497ae017e7a0177`,`fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a0177`,`fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a017749006a`].map(B),V_=V(B_),H_=[,,,`edf8b17fcdbb2c7fb8`,`ffffcca1dab441b6c4225ea8`,`ffffcca1dab441b6c42c7fb8253494`,`ffffccc7e9b47fcdbb41b6c42c7fb8253494`,`ffffccc7e9b47fcdbb41b6c41d91c0225ea80c2c84`,`ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea80c2c84`,`ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea8253494081d58`].map(B),U_=V(H_),W_=[,,,`f7fcb9addd8e31a354`,`ffffccc2e69978c679238443`,`ffffccc2e69978c67931a354006837`,`ffffccd9f0a3addd8e78c67931a354006837`,`ffffccd9f0a3addd8e78c67941ab5d238443005a32`,`ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443005a32`,`ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443006837004529`].map(B),G_=V(W_),K_=[,,,`fff7bcfec44fd95f0e`,`ffffd4fed98efe9929cc4c02`,`ffffd4fed98efe9929d95f0e993404`,`ffffd4fee391fec44ffe9929d95f0e993404`,`ffffd4fee391fec44ffe9929ec7014cc4c028c2d04`,`ffffe5fff7bcfee391fec44ffe9929ec7014cc4c028c2d04`,`ffffe5fff7bcfee391fec44ffe9929ec7014cc4c02993404662506`].map(B),q_=V(K_),J_=[,,,`ffeda0feb24cf03b20`,`ffffb2fecc5cfd8d3ce31a1c`,`ffffb2fecc5cfd8d3cf03b20bd0026`,`ffffb2fed976feb24cfd8d3cf03b20bd0026`,`ffffb2fed976feb24cfd8d3cfc4e2ae31a1cb10026`,`ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cb10026`,`ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cbd0026800026`].map(B),Y_=V(J_),X_=[,,,`deebf79ecae13182bd`,`eff3ffbdd7e76baed62171b5`,`eff3ffbdd7e76baed63182bd08519c`,`eff3ffc6dbef9ecae16baed63182bd08519c`,`eff3ffc6dbef9ecae16baed64292c62171b5084594`,`f7fbffdeebf7c6dbef9ecae16baed64292c62171b5084594`,`f7fbffdeebf7c6dbef9ecae16baed64292c62171b508519c08306b`].map(B),Z_=V(X_),Q_=[,,,`e5f5e0a1d99b31a354`,`edf8e9bae4b374c476238b45`,`edf8e9bae4b374c47631a354006d2c`,`edf8e9c7e9c0a1d99b74c47631a354006d2c`,`edf8e9c7e9c0a1d99b74c47641ab5d238b45005a32`,`f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45005a32`,`f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45006d2c00441b`].map(B),$_=V(Q_),ev=[,,,`f0f0f0bdbdbd636363`,`f7f7f7cccccc969696525252`,`f7f7f7cccccc969696636363252525`,`f7f7f7d9d9d9bdbdbd969696636363252525`,`f7f7f7d9d9d9bdbdbd969696737373525252252525`,`fffffff0f0f0d9d9d9bdbdbd969696737373525252252525`,`fffffff0f0f0d9d9d9bdbdbd969696737373525252252525000000`].map(B),tv=V(ev),nv=[,,,`efedf5bcbddc756bb1`,`f2f0f7cbc9e29e9ac86a51a3`,`f2f0f7cbc9e29e9ac8756bb154278f`,`f2f0f7dadaebbcbddc9e9ac8756bb154278f`,`f2f0f7dadaebbcbddc9e9ac8807dba6a51a34a1486`,`fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a34a1486`,`fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a354278f3f007d`].map(B),rv=V(nv),iv=[,,,`fee0d2fc9272de2d26`,`fee5d9fcae91fb6a4acb181d`,`fee5d9fcae91fb6a4ade2d26a50f15`,`fee5d9fcbba1fc9272fb6a4ade2d26a50f15`,`fee5d9fcbba1fc9272fb6a4aef3b2ccb181d99000d`,`fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181d99000d`,`fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181da50f1567000d`].map(B),av=V(iv),ov=[,,,`fee6cefdae6be6550d`,`feeddefdbe85fd8d3cd94701`,`feeddefdbe85fd8d3ce6550da63603`,`feeddefdd0a2fdae6bfd8d3ce6550da63603`,`feeddefdd0a2fdae6bfd8d3cf16913d948018c2d04`,`fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d948018c2d04`,`fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d94801a636037f2704`].map(B),sv=V(ov);function cv(e){return e=Math.max(0,Math.min(1,e)),`rgb(`+Math.max(0,Math.min(255,Math.round(-4.54-e*(35.34-e*(2381.73-e*(6402.7-e*(7024.72-e*2710.57)))))))+`, `+Math.max(0,Math.min(255,Math.round(32.49+e*(170.73+e*(52.82-e*(131.46-e*(176.58-e*67.37)))))))+`, `+Math.max(0,Math.min(255,Math.round(81.24+e*(442.36-e*(2482.43-e*(6167.24-e*(6614.94-e*2475.67)))))))+`)`}var lv=ba(Ni(300,.5,0),Ni(-240,.5,1)),uv=ba(Ni(-100,.75,.35),Ni(80,1.5,.8)),dv=ba(Ni(260,.75,.35),Ni(80,1.5,.8)),fv=Ni();function pv(e){(e<0||e>1)&&(e-=Math.floor(e));var t=Math.abs(e-.5);return fv.h=360*e-100,fv.s=1.5-1.5*t,fv.l=.8-.9*t,fv+``}var mv=Gr(),hv=Math.PI/3,gv=Math.PI*2/3;function _v(e){var t;return e=(.5-e)*Math.PI,mv.r=255*(t=Math.sin(e))*t,mv.g=255*(t=Math.sin(e+hv))*t,mv.b=255*(t=Math.sin(e+gv))*t,mv+``}function vv(e){return e=Math.max(0,Math.min(1,e)),`rgb(`+Math.max(0,Math.min(255,Math.round(34.61+e*(1172.33-e*(10793.56-e*(33300.12-e*(38394.49-e*14825.05)))))))+`, `+Math.max(0,Math.min(255,Math.round(23.31+e*(557.33+e*(1225.33-e*(3574.96-e*(1073.77+e*707.56)))))))+`, `+Math.max(0,Math.min(255,Math.round(27.2+e*(3211.1-e*(15327.97-e*(27814-e*(22569.18-e*6838.66)))))))+`)`}function yv(e){var t=e.length;return function(n){return e[Math.max(0,Math.min(t-1,Math.floor(n*t)))]}}var bv=yv(B(`44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725`)),xv=yv(B(`00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf`)),Sv=yv(B(`00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4`)),Cv=yv(B(`0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921`));function wv(e){return function(){return e}}let Tv=Math.cos,Ev=Math.min,Dv=Math.sin,Ov=Math.sqrt,kv=Math.PI;kv/2;let Av=2*kv;function jv(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{let e=Math.floor(n);if(!(e>=0))throw RangeError(`invalid digits: ${n}`);t=e}return e},()=>new ys(t)}Array.prototype.slice;function Mv(e){return typeof e==`object`&&`length`in e?e:Array.from(e)}function Nv(e){this._context=e}Nv.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)}}};function Pv(e){return new Nv(e)}function Fv(e){return e[0]}function Iv(e){return e[1]}function Lv(e,t){var n=wv(!0),r=null,i=Pv,a=null,o=jv(s);e=typeof e==`function`?e:e===void 0?Fv:wv(e),t=typeof t==`function`?t:t===void 0?Iv:wv(t);function s(s){var c,l=(s=Mv(s)).length,u,d=!1,f;for(r??(a=i(f=o())),c=0;c<=l;++c)!(c<l&&n(u=s[c],c,s))===d&&((d=!d)?a.lineStart():a.lineEnd()),d&&a.point(+e(u,c,s),+t(u,c,s));if(f)return a=null,f+``||null}return s.x=function(t){return arguments.length?(e=typeof t==`function`?t:wv(+t),s):e},s.y=function(e){return arguments.length?(t=typeof e==`function`?e:wv(+e),s):t},s.defined=function(e){return arguments.length?(n=typeof e==`function`?e:wv(!!e),s):n},s.curve=function(e){return arguments.length?(i=e,r!=null&&(a=i(r)),s):i},s.context=function(e){return arguments.length?(e==null?r=a=null:a=i(r=e),s):r},s}function Rv(e,t,n){var r=null,i=wv(!0),a=null,o=Pv,s=null,c=jv(l);e=typeof e==`function`?e:e===void 0?Fv:wv(+e),t=typeof t==`function`?t:wv(t===void 0?0:+t),n=typeof n==`function`?n:n===void 0?Iv:wv(+n);function l(l){var u,d,f,p=(l=Mv(l)).length,m,h=!1,g,_=Array(p),v=Array(p);for(a??(s=o(g=c())),u=0;u<=p;++u){if(!(u<p&&i(m=l[u],u,l))===h){if(h=!h)d=u,s.areaStart(),s.lineStart();else{for(s.lineEnd(),s.lineStart(),f=u-1;f>=d;--f)s.point(_[f],v[f]);s.lineEnd(),s.areaEnd()}}h&&(_[u]=+e(m,u,l),v[u]=+t(m,u,l),s.point(r?+r(m,u,l):_[u],n?+n(m,u,l):v[u]))}if(g)return s=null,g+``||null}function u(){return Lv().defined(i).curve(o).context(a)}return l.x=function(t){return arguments.length?(e=typeof t==`function`?t:wv(+t),r=null,l):e},l.x0=function(t){return arguments.length?(e=typeof t==`function`?t:wv(+t),l):e},l.x1=function(e){return arguments.length?(r=e==null?null:typeof e==`function`?e:wv(+e),l):r},l.y=function(e){return arguments.length?(t=typeof e==`function`?e:wv(+e),n=null,l):t},l.y0=function(e){return arguments.length?(t=typeof e==`function`?e:wv(+e),l):t},l.y1=function(e){return arguments.length?(n=e==null?null:typeof e==`function`?e:wv(+e),l):n},l.lineX0=l.lineY0=function(){return u().x(e).y(t)},l.lineY1=function(){return u().x(e).y(n)},l.lineX1=function(){return u().x(r).y(t)},l.defined=function(e){return arguments.length?(i=typeof e==`function`?e:wv(!!e),l):i},l.curve=function(e){return arguments.length?(o=e,a!=null&&(s=o(a)),l):o},l.context=function(e){return arguments.length?(e==null?a=s=null:s=o(a=e),l):a},l}var zv=class{constructor(e,t){this._context=e,this._x=t}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(e,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._x?this._context.bezierCurveTo(this._x0=(this._x0+e)/2,this._y0,this._x0,t,e,t):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+t)/2,e,this._y0,e,t)}this._x0=e,this._y0=t}};function Bv(e){return new zv(e,!0)}function Vv(e){return new zv(e,!1)}let Hv=Ov(3);var Uv={draw(e,t){let n=Ov(t+Ev(t/28,.75))*.59436,r=n/2,i=r*Hv;e.moveTo(0,n),e.lineTo(0,-n),e.moveTo(-i,-r),e.lineTo(i,r),e.moveTo(-i,r),e.lineTo(i,-r)}},Wv={draw(e,t){let n=Ov(t/kv);e.moveTo(n,0),e.arc(0,0,n,0,Av)}},Gv={draw(e,t){let n=Ov(t/5)/2;e.moveTo(-3*n,-n),e.lineTo(-n,-n),e.lineTo(-n,-3*n),e.lineTo(n,-3*n),e.lineTo(n,-n),e.lineTo(3*n,-n),e.lineTo(3*n,n),e.lineTo(n,n),e.lineTo(n,3*n),e.lineTo(-n,3*n),e.lineTo(-n,n),e.lineTo(-3*n,n),e.closePath()}};let Kv=Ov(1/3),qv=Kv*2;var Jv={draw(e,t){let n=Ov(t/qv),r=n*Kv;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},Yv={draw(e,t){let n=Ov(t)*.62625;e.moveTo(0,-n),e.lineTo(n,0),e.lineTo(0,n),e.lineTo(-n,0),e.closePath()}},Xv={draw(e,t){let n=Ov(t-Ev(t/7,2))*.87559;e.moveTo(-n,0),e.lineTo(n,0),e.moveTo(0,n),e.lineTo(0,-n)}},Zv={draw(e,t){let n=Ov(t),r=-n/2;e.rect(r,r,n,n)}},Qv={draw(e,t){let n=Ov(t)*.4431;e.moveTo(n,n),e.lineTo(n,-n),e.lineTo(-n,-n),e.lineTo(-n,n),e.closePath()}};let $v=Dv(kv/10)/Dv(7*kv/10),ey=Dv(Av/10)*$v,ty=-Tv(Av/10)*$v;var ny={draw(e,t){let n=Ov(t*.8908130915292852),r=ey*n,i=ty*n;e.moveTo(0,-n),e.lineTo(r,i);for(let t=1;t<5;++t){let a=Av*t/5,o=Tv(a),s=Dv(a);e.lineTo(s*n,-o*n),e.lineTo(o*r-s*i,s*r+o*i)}e.closePath()}};let ry=Ov(3);var iy={draw(e,t){let n=-Ov(t/(ry*3));e.moveTo(0,n*2),e.lineTo(-ry*n,-n),e.lineTo(ry*n,-n),e.closePath()}};let ay=Ov(3);var oy={draw(e,t){let n=Ov(t)*.6824,r=n/2,i=n*ay/2;e.moveTo(0,-n),e.lineTo(i,r),e.lineTo(-i,r),e.closePath()}};let sy=-.5,cy=Ov(3)/2,ly=1/Ov(12),uy=(ly/2+1)*3;var dy={draw(e,t){let n=Ov(t/uy),r=n/2,i=n*ly,a=r,o=n*ly+n,s=-a,c=o;e.moveTo(r,i),e.lineTo(a,o),e.lineTo(s,c),e.lineTo(sy*r-cy*i,cy*r+sy*i),e.lineTo(sy*a-cy*o,cy*a+sy*o),e.lineTo(sy*s-cy*c,cy*s+sy*c),e.lineTo(sy*r+cy*i,sy*i-cy*r),e.lineTo(sy*a+cy*o,sy*o-cy*a),e.lineTo(sy*s+cy*c,sy*c-cy*s),e.closePath()}},fy={draw(e,t){let n=Ov(t-Ev(t/6,1.7))*.6189;e.moveTo(-n,-n),e.lineTo(n,n),e.moveTo(-n,n),e.lineTo(n,-n)}};let py=[Wv,Gv,Jv,Zv,ny,iy,dy],my=[Wv,Xv,fy,oy,Uv,Qv,Yv];function hy(){}function gy(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 _y(e){this._context=e}_y.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:gy(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(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:gy(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function vy(e){return new _y(e)}function yy(e){this._context=e}yy.prototype={areaStart:hy,areaEnd:hy,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)}},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:gy(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function by(e){return new yy(e)}function xy(e){this._context=e}xy.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,r=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:gy(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Sy(e){return new xy(e)}function Cy(e,t){this._basis=new _y(e),this._beta=t}Cy.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 r=e[0],i=t[0],a=e[n]-r,o=t[n]-i,s=-1,c;++s<=n;)c=s/n,this._basis.point(this._beta*e[s]+(1-this._beta)*(r+c*a),this._beta*t[s]+(1-this._beta)*(i+c*o));this._x=this._y=null,this._basis.lineEnd()},point:function(e,t){this._x.push(+e),this._y.push(+t)}};var wy=(function e(t){function n(e){return t===1?new _y(e):new Cy(e,t)}return n.beta=function(t){return e(+t)},n})(.85);function Ty(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 Ey(e,t){this._context=e,this._k=(1-t)/6}Ey.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:Ty(this,this._x1,this._y1)}(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:Ty(this,e,t)}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var Dy=(function e(t){function n(e){return new Ey(e,t)}return n.tension=function(t){return e(+t)},n})(0);function Oy(e,t){this._context=e,this._k=(1-t)/6}Oy.prototype={areaStart:hy,areaEnd:hy,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)}},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:Ty(this,e,t)}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var ky=(function e(t){function n(e){return new Oy(e,t)}return n.tension=function(t){return e(+t)},n})(0);function Ay(e,t){this._context=e,this._k=(1-t)/6}Ay.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:Ty(this,e,t)}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var jy=(function e(t){function n(e){return new Ay(e,t)}return n.tension=function(t){return e(+t)},n})(0);function My(e,t,n){var r=e._x1,i=e._y1,a=e._x2,o=e._y2;if(e._l01_a>1e-12){var s=2*e._l01_2a+3*e._l01_a*e._l12_a+e._l12_2a,c=3*e._l01_a*(e._l01_a+e._l12_a);r=(r*s-e._x0*e._l12_2a+e._x2*e._l01_2a)/c,i=(i*s-e._y0*e._l12_2a+e._y2*e._l01_2a)/c}if(e._l23_a>1e-12){var l=2*e._l23_2a+3*e._l23_a*e._l12_a+e._l12_2a,u=3*e._l23_a*(e._l23_a+e._l12_a);a=(a*l+e._x1*e._l23_2a-t*e._l12_2a)/u,o=(o*l+e._y1*e._l23_2a-n*e._l12_2a)/u}e._context.bezierCurveTo(r,i,a,o,e._x2,e._y2)}function Ny(e,t){this._context=e,this._alpha=t}Ny.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)}(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,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=(n*n+r*r)**+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:My(this,e,t)}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}};var Py=(function e(t){function n(e){return t?new Ny(e,t):new Ey(e,0)}return n.alpha=function(t){return e(+t)},n})(.5);function Fy(e,t){this._context=e,this._alpha=t}Fy.prototype={areaStart:hy,areaEnd:hy,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)}},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=(n*n+r*r)**+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:My(this,e,t)}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}};var Iy=(function e(t){function n(e){return t?new Fy(e,t):new Oy(e,0)}return n.alpha=function(t){return e(+t)},n})(.5);function Ly(e,t){this._context=e,this._alpha=t}Ly.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,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=(n*n+r*r)**+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:My(this,e,t)}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}};var Ry=(function e(t){function n(e){return t?new Ly(e,t):new Ay(e,0)}return n.alpha=function(t){return e(+t)},n})(.5);function zy(e){this._context=e}zy.prototype={areaStart:hy,areaEnd:hy,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 By(e){return new zy(e)}function Vy(e){return e<0?-1:1}function Hy(e,t,n){var r=e._x1-e._x0,i=t-e._x1,a=(e._y1-e._y0)/(r||i<0&&-0),o=(n-e._y1)/(i||r<0&&-0),s=(a*i+o*r)/(r+i);return(Vy(a)+Vy(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(s))||0}function Uy(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function Wy(e,t,n){var r=e._x0,i=e._y0,a=e._x1,o=e._y1,s=(a-r)/3;e._context.bezierCurveTo(r+s,i+s*t,a-s,o-s*n,a,o)}function Gy(e){this._context=e}Gy.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:Wy(this,this._t0,Uy(this,this._t0))}(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,Wy(this,Uy(this,n=Hy(this,e,t)),n);break;default:Wy(this,this._t0,n=Hy(this,e,t))}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function Ky(e){this._context=new qy(e)}(Ky.prototype=Object.create(Gy.prototype)).point=function(e,t){Gy.prototype.point.call(this,t,e)};function qy(e){this._context=e}qy.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,r,i,a){this._context.bezierCurveTo(t,e,r,n,a,i)}};function Jy(e){return new Gy(e)}function Yy(e){return new Ky(e)}function Xy(e){this._context=e}Xy.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 r=Zy(e),i=Zy(t),a=0,o=1;o<n;++a,++o)this._context.bezierCurveTo(r[0][a],i[0][a],r[1][a],i[1][a],e[o],t[o])}(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 Zy(e){var t,n=e.length-1,r,i=Array(n),a=Array(n),o=Array(n);for(i[0]=0,a[0]=2,o[0]=e[0]+2*e[1],t=1;t<n-1;++t)i[t]=1,a[t]=4,o[t]=4*e[t]+2*e[t+1];for(i[n-1]=2,a[n-1]=7,o[n-1]=8*e[n-1]+e[n],t=1;t<n;++t)r=i[t]/a[t-1],a[t]-=r,o[t]-=r*o[t-1];for(i[n-1]=o[n-1]/a[n-1],t=n-2;t>=0;--t)i[t]=(o[t]-i[t+1])/a[t];for(a[n-1]=(e[n]+i[n-1])/2,t=0;t<n-1;++t)a[t]=2*e[t+1]-i[t+1];return[i,a]}function Qy(e){return new Xy(e)}function $y(e,t){this._context=e,this._t=t}$y.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)}}this._x=e,this._y=t}};function eb(e){return new $y(e,.5)}function tb(e){return new $y(e,0)}function nb(e){return new $y(e,1)}function rb(e,t,n){this.k=e,this.x=t,this.y=n}rb.prototype={constructor:rb,scale:function(e){return e===1?this:new rb(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new rb(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return`translate(`+this.x+`,`+this.y+`) scale(`+this.k+`)`}};var ib=new rb(1,0,0);ab.prototype=rb.prototype;function ab(e){for(;!e.__zoom;)if(!(e=e.parentNode))return ib;return e.__zoom}function ob(e){return e!=null&&!Number.isNaN(e)}function sb(e,t){return+ob(t)-ob(e)||u(e,t)}function cb(e,t){return+ob(t)-ob(e)||d(e,t)}function lb(e){return e!=null&&`${e}`!=``}function ub(e){return isFinite(e)?e:NaN}function db(e){return e>0&&isFinite(e)?e:NaN}function fb(e){return e<0&&isFinite(e)?e:NaN}function pb(e,t){if(e instanceof Date||(e=/* @__PURE__ */ new Date(+e)),isNaN(e))return typeof t==`function`?t(e):t;let n=e.getUTCHours(),r=e.getUTCMinutes(),i=e.getUTCSeconds(),a=e.getUTCMilliseconds();return`${mb(e.getUTCFullYear(),4)}-${hb(e.getUTCMonth()+1,2)}-${hb(e.getUTCDate(),2)}${n||r||i||a?`T${hb(n,2)}:${hb(r,2)}${i||a?`:${hb(i,2)}${a?`.${hb(a,3)}`:``}`:``}Z`:``}`}function mb(e){return e<0?`-${hb(-e,6)}`:e>9999?`+${hb(e,6)}`:hb(e,4)}function hb(e,t){return`${e}`.padStart(t,`0`)}let gb=/^(?:[-+]\d{2})?\d{4}(?:-\d{2}(?:-\d{2})?)?(?:T\d{2}:\d{2}(?::\d{2}(?:\.\d{3})?)?(?:Z|[-+]\d{2}:?\d{2})?)?$/;function _b(e,t){return gb.test(e+=``)?new Date(e):typeof t==`function`?t(e):t}function vb(e){if(e==null)return;let t=e[0],n=e[e.length-1];return d(t,n)}let yb=1e3,bb=yb*60,xb=bb*60,Sb=xb*24,Cb=Sb*7,wb=Sb*30,Tb=Sb*365,Eb=[[`millisecond`,1],[`2 milliseconds`,2],[`5 milliseconds`,5],[`10 milliseconds`,10],[`20 milliseconds`,20],[`50 milliseconds`,50],[`100 milliseconds`,100],[`200 milliseconds`,200],[`500 milliseconds`,500],[`second`,yb],[`5 seconds`,5*yb],[`15 seconds`,15*yb],[`30 seconds`,30*yb],[`minute`,bb],[`5 minutes`,5*bb],[`15 minutes`,15*bb],[`30 minutes`,30*bb],[`hour`,xb],[`3 hours`,3*xb],[`6 hours`,6*xb],[`12 hours`,12*xb],[`day`,Sb],[`2 days`,2*Sb],[`week`,Cb],[`2 weeks`,2*Cb],[`month`,wb],[`3 months`,3*wb],[`6 months`,6*wb],[`year`,Tb],[`2 years`,2*Tb],[`5 years`,5*Tb],[`10 years`,10*Tb],[`20 years`,20*Tb],[`50 years`,50*Tb],[`100 years`,100*Tb]],Db=/* @__PURE__ */ new Map([[`second`,yb],[`minute`,bb],[`hour`,xb],[`day`,Sb],[`monday`,Cb],[`tuesday`,Cb],[`wednesday`,Cb],[`thursday`,Cb],[`friday`,Cb],[`saturday`,Cb],[`sunday`,Cb],[`week`,Cb],[`month`,wb],[`year`,Tb]]),Ob=/* @__PURE__ */ new Map([[`second`,Lm],[`minute`,Rm],[`hour`,Bm],[`day`,Hm],[`monday`,qm],[`tuesday`,Jm],[`wednesday`,Ym],[`thursday`,Xm],[`friday`,Zm],[`saturday`,Qm],[`sunday`,Km],[`week`,Km],[`month`,sh],[`year`,lh]]),kb=/* @__PURE__ */ new Map([[`second`,Lm],[`minute`,zm],[`hour`,Vm],[`day`,Wm],[`monday`,th],[`tuesday`,nh],[`wednesday`,rh],[`thursday`,ih],[`friday`,ah],[`saturday`,oh],[`sunday`,eh],[`week`,eh],[`month`,ch],[`year`,uh]]),Ab=Symbol(`intervalDuration`),jb=Symbol(`intervalType`);for(let[e,t]of Ob)t[Ab]=Db.get(e),t[jb]=`time`;for(let[e,t]of kb)t[Ab]=Db.get(e),t[jb]=`utc`;let Mb=[[`year`,uh,`utc`],[`month`,ch,`utc`],[`day`,Wm,`utc`,6*wb],[`hour`,Vm,`utc`,3*Sb],[`minute`,zm,`utc`,6*xb],[`second`,Lm,`utc`,30*bb]],Nb=[[`year`,lh,`time`],[`month`,sh,`time`],[`day`,Hm,`time`,6*wb],[`hour`,Bm,`time`,3*Sb],[`minute`,Rm,`time`,6*xb],[`second`,Lm,`time`,30*bb]],Pb=[Mb[0],Nb[0],Mb[1],Nb[1],Mb[2],Nb[2],...Mb.slice(3)];function Fb(e){let t=`${e}`.toLowerCase();t.endsWith(`s`)&&(t=t.slice(0,-1));let n=1,r=/^(?:(\d+)\s+)/.exec(t);switch(r&&(t=t.slice(r[0].length),n=+r[1]),t){case`quarter`:t=`month`,n*=3;break;case`half`:t=`month`,n*=6}let i=kb.get(t);if(!i)throw Error(`unknown interval: ${e}`);if(n>1&&!i.every)throw Error(`non-periodic interval: ${t}`);return[t,n]}function Ib(e){return Rb(Fb(e),`time`)}function Lb(e){return Rb(Fb(e),`utc`)}function Rb([e,t],n){let r=(n===`time`?Ob:kb).get(e);return t>1&&(r=r.every(t),r[Ab]=Db.get(e)*t,r[jb]=n),r}function zb(e,t){if(!(t>1))return;let n=e[Ab];if(!Eb.some(([,e])=>e===n)||n%Sb==0&&Sb<n&&n<wb)return;let[r]=Eb[f(([,e])=>Math.log(e)).center(Eb,Math.log(n*t))];return(e[jb]===`time`?Ib:Lb)(r)}function Bb(e,t,n){let r=t===`time`?Lg:Rg;if(n==null)return r(e===`year`?`%Y`:e===`month`?`%Y-%m`:e===`day`?`%Y-%m-%d`:e===`hour`||e===`minute`?`%Y-%m-%dT%H:%M`:e===`second`?`%Y-%m-%dT%H:%M:%S`:`%Y-%m-%dT%H:%M:%S.%L`);let i=Vb(n);switch(e){case`millisecond`:return Wb(r(`.%L`),r(`:%M:%S`),i);case`second`:return Wb(r(`:%S`),r(`%-I:%M`),i);case`minute`:return Wb(r(`%-I:%M`),r(`%p`),i);case`hour`:return Wb(r(`%-I %p`),r(`%b %-d`),i);case`day`:return Wb(r(`%-d`),r(`%b`),i);case`month`:return Wb(r(`%b`),r(`%Y`),i);case`year`:return r(`%Y`)}throw Error(`unable to format time ticks`)}function Vb(e){return e===`left`||e===`right`?(e,t)=>`\n${e}\n${t}`:e===`top`?(e,t)=>`${t}\n${e}`:(e,t)=>`${e}\n${t}`}function Hb(e){return e===`time`?Nb:e===`utc`?Mb:Pb}function Ub(e,t,n){let r=Ae(Ke(t,(e,t)=>Math.abs(t-e)));if(r<1e3)return Bb(`millisecond`,`utc`,n);for(let[i,a,o,s]of Hb(e)){if(r>s||i===`hour`&&!r)break;if(t.every(e=>a.floor(e)>=e))return Bb(i,o,n)}}function Wb(e,t,n){return(r,i,a)=>{let o=e(r,i),s=t(r,i),c=i-vb(a);return i!==c&&a[c]!==void 0&&s===t(a[c],c)?o:n(o,s)}}let Gb=Object.getPrototypeOf(Uint8Array),Kb=Object.prototype.toString;function qb(e){return e instanceof Array||e instanceof Gb}function Jb(e){return e instanceof Gb&&!Xb(e)}function Yb(e){return e?.prototype instanceof Gb&&!Zb(e)}function Xb(e){return e instanceof BigInt64Array||e instanceof BigUint64Array}function Zb(e){return e===BigInt64Array||e===BigUint64Array}let Qb=Symbol(`reindex`);function H(e,t,n){let r=typeof t;return r===`string`?wS(e)?nx(e.getChild(t),n):ex(e,ax(t),n):r===`function`?ex(e,t,n):r===`number`||t instanceof Date||r===`boolean`?G(e,px(t),n):typeof t?.transform==`function`?tx(t.transform(e),n):$b(tx(t,n),e?.[Qb])}function $b(e,t){return e!=null&&t?zx(e,t):e}function ex(e,t,n){return G(e,Yb(n)?(e,n)=>gx(t(e,n)):t,n)}function tx(e,t){return t===void 0?wx(e):TS(e)?nx(e,t):e instanceof t?e:t.from(e,Yb(t)&&!Jb(e)?gx:void 0)}function nx(e,t){return e==null?e:(t===void 0||t===Array)&&ES(e.type)?_x(rx(e)):tx(rx(e),t)}function rx(e){return e.nullCount?e.toJSON():e.toArray()}let ix=[null],ax=e=>t=>{let n=t[e];return n===void 0&&t.type===`Feature`?t.properties?.[e]:n},ox={transform:Rx},U={transform:e=>e},sx=()=>1,cx=()=>!0,lx=e=>e==null?e:`${e}`,W=e=>e==null?e:+e,ux=e=>e?e[0]:void 0,dx=e=>e?e[1]:void 0,fx=e=>e?e[2]:void 0,px=e=>()=>e;function mx(e){let t=`${e}`.slice(1)/100;return(e,n)=>Le(e,t,n)}function hx(e){return Jb(e)?e:G(e,gx,Float64Array)}function gx(e){return e==null?NaN:Number(e)}function _x(e){return G(e,vx)}function vx(e){return e instanceof Date&&!isNaN(e)?e:typeof e==`string`?_b(e):e==null||isNaN(e=Number(e))?void 0:new Date(e)}function yx(e,t){return e===void 0&&(e=t),e===null?[void 0,`none`]:mS(e)?[void 0,e]:[e,void 0]}function bx(e,t){return e===void 0&&(e=t),e===null||typeof e==`number`?[void 0,e]:[e,void 0]}function xx(e,t,n){if(e!=null)return Sx(e,t,n)}function Sx(e,t,n){let r=`${e}`.toLowerCase();if(!n.includes(r))throw Error(`invalid ${t}: ${e}`);return r}function Cx(e){return wS(e)?e:wx(e)}function wx(e){if(e==null||qb(e))return e;if(TS(e))return nx(e);if(Tx(e))switch(e.type){case`FeatureCollection`:return e.features;case`GeometryCollection`:return e.geometries;default:return[e]}return Array.from(e)}function Tx(e){switch(e?.type){case`FeatureCollection`:case`GeometryCollection`:case`Feature`:case`LineString`:case`MultiLineString`:case`MultiPoint`:case`MultiPolygon`:case`Point`:case`Polygon`:case`Sphere`:return!0;default:return!1}}function G(e,t,n=Array){return e==null?e:e instanceof n?e.map(t):n.from(e,t)}function Ex(e,t=Array){return e instanceof t?e.slice():t.from(e)}function Dx({x:e,x1:t,x2:n}){return e!==void 0||t!==void 0||n!==void 0}function Ox({y:e,y1:t,y2:n}){return e!==void 0||t!==void 0||n!==void 0}function kx(e){return Dx(e)||Ox(e)||e.interval!==void 0}function Ax(e){return e?.toString===Kb}function jx(e){return Ax(e)&&(e.type!==void 0||e.domain!==void 0)}function Mx(e){return Ax(e)&&typeof e.transform!=`function`}function Nx(e){return Mx(e)&&e.value===void 0&&e.channel===void 0}function Px(e,t,n,r=U){return t===void 0&&n===void 0?(t=0,n=e===void 0?r:e):t===void 0?t=e===void 0?0:e:n===void 0&&(n=e===void 0?0:e),[t,n]}function Fx(e,t){return e===void 0&&t===void 0?[ux,dx]:[e,t]}function Ix({z:e,fill:t,stroke:n}={}){return e===void 0&&([e]=yx(t)),e===void 0&&([e]=yx(n)),e}function Lx(e){return qb(e)?e.length:e?.numRows}function Rx(e){let t=Lx(e),n=new Uint32Array(t);for(let e=0;e<t;++e)n[e]=e;return n}function zx(e,t){return qb(e)?G(t,t=>e[t],e.constructor):G(t,t=>e.at(t))}function Bx(e){return e.length===1?(t,n)=>e(zx(n,t)):e}function Vx(e,t,n){return e.subarray?e.subarray(t,n):e.slice(t,n)}function Hx(e){return typeof e==`object`&&e?e.valueOf():e}function Ux(e,t){if(t[e]!==void 0)return t[e];switch(e){case`x1`:case`x2`:e=`x`;break;case`y1`:case`y2`:e=`y`}return t[e]}function Wx(e){let t;return[{transform:()=>t,label:Kx(e)},e=>t=e]}function Gx(e){return e==null?[e]:Wx(e)}function Kx(e,t){return typeof e==`string`?e:e&&e.label!==void 0?e.label:t}function qx(e,t){return{transform(n){let r=e.transform(n),i=t.transform(n);return cS(r)||cS(i)?G(r,(e,t)=>/* @__PURE__ */ new Date((+r[t]+ +i[t])/2)):G(r,(e,t)=>(+r[t]+ +i[t])/2,Float64Array)},label:e.label}}function Jx(e,t){let n=Yx(t?.interval,t?.type);return n?G(e,n):e}function Yx(e,t){let n=Xx(e,t);return n&&(e=>ob(e)?n.floor(e):e)}function Xx(e,t){if(e!=null){if(typeof e==`number`)return Zx(e);if(typeof e==`string`)return(t===`time`?Ib:Lb)(e);if(typeof e.floor!=`function`)throw Error(`invalid interval; missing floor method`);if(typeof e.offset!=`function`)throw Error(`invalid interval; missing offset method`);return e}}function Zx(e){e=+e,0<e&&e<1&&Number.isInteger(1/e)&&(e=-1/e);let t=Math.abs(e);return e<0?{floor:e=>Math.floor(e*t)/t,offset:(e,n=1)=>(e*t+Math.floor(n))/t,range:(e,n)=>Je(Math.ceil(e*t),n*t).map(e=>e/t)}:{floor:e=>Math.floor(e/t)*t,offset:(e,n=1)=>e+t*Math.floor(n),range:(e,n)=>Je(Math.ceil(e/t),n/t).map(e=>e*t)}}function Qx(e,t){if(e=Xx(e,t),e&&typeof e.range!=`function`)throw Error(`invalid interval: missing range method`);return e}function $x(e,t){if(e=Qx(e,t),e&&typeof e.ceil!=`function`)throw Error(`invalid interval: missing ceil method`);return e}function eS(e){return tS(e)&&typeof e?.floor==`function`&&e.floor()instanceof Date}function tS(e){return typeof e?.range==`function`}function nS(e){return e===void 0||Mx(e)?e:{value:e}}function rS(e){return e==null?null:{transform:t=>H(t,e,Float64Array),label:Kx(e)}}function iS(e){if(!aS(e))return!1;for(let t of e)if(t!=null)return typeof t==`object`&&`0`in t&&`1`in t}function aS(e){return e&&typeof e[Symbol.iterator]==`function`}function oS(e){for(let t of e)if(t!=null)return typeof t!=`object`||t instanceof Date}function sS(e){for(let t of e){if(t==null)continue;let e=typeof t;return e===`string`||e===`boolean`}}function cS(e){for(let t of e)if(t!=null)return t instanceof Date}function lS(e){for(let t of e)if(t!=null)return typeof t==`string`&&isNaN(t)&&_b(t)}function uS(e){for(let t of e)if(t!=null){if(typeof t!=`string`)return!1;if(t.trim())return!isNaN(t)}}function dS(e){for(let t of e)if(t!=null)return typeof t==`number`}function fS(e,t){let n;for(let r of e)if(r!=null){if(!t(r))return!1;n=!0}return n}let pS=new Set(`none,currentcolor,transparent,aliceblue,antiquewhite,aqua,aquamarine,azure,beige,bisque,black,blanchedalmond,blue,blueviolet,brown,burlywood,cadetblue,chartreuse,chocolate,coral,cornflowerblue,cornsilk,crimson,cyan,darkblue,darkcyan,darkgoldenrod,darkgray,darkgreen,darkgrey,darkkhaki,darkmagenta,darkolivegreen,darkorange,darkorchid,darkred,darksalmon,darkseagreen,darkslateblue,darkslategray,darkslategrey,darkturquoise,darkviolet,deeppink,deepskyblue,dimgray,dimgrey,dodgerblue,firebrick,floralwhite,forestgreen,fuchsia,gainsboro,ghostwhite,gold,goldenrod,gray,green,greenyellow,grey,honeydew,hotpink,indianred,indigo,ivory,khaki,lavender,lavenderblush,lawngreen,lemonchiffon,lightblue,lightcoral,lightcyan,lightgoldenrodyellow,lightgray,lightgreen,lightgrey,lightpink,lightsalmon,lightseagreen,lightskyblue,lightslategray,lightslategrey,lightsteelblue,lightyellow,lime,limegreen,linen,magenta,maroon,mediumaquamarine,mediumblue,mediumorchid,mediumpurple,mediumseagreen,mediumslateblue,mediumspringgreen,mediumturquoise,mediumvioletred,midnightblue,mintcream,mistyrose,moccasin,navajowhite,navy,oldlace,olive,olivedrab,orange,orangered,orchid,palegoldenrod,palegreen,paleturquoise,palevioletred,papayawhip,peachpuff,peru,pink,plum,powderblue,purple,rebeccapurple,red,rosybrown,royalblue,saddlebrown,salmon,sandybrown,seagreen,seashell,sienna,silver,skyblue,slateblue,slategray,slategrey,snow,springgreen,steelblue,tan,teal,thistle,tomato,turquoise,violet,wheat,white,whitesmoke,yellow`.split(`,`));function mS(e){return typeof e==`string`&&(e=e.toLowerCase().trim(),/^#[0-9a-f]{3,8}$/.test(e)||/^(?:url|var|rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch|color|color-mix)\(.*\)$/.test(e)||pS.has(e))}function hS(e){return typeof e==`number`&&(0<=e&&e<=1||isNaN(e))}function K(e){return e==null||gS(e)}function gS(e){return/^\s*none\s*$/i.test(e)}function _S(e){return/^\s*round\s*$/i.test(e)}function vS(e,t){return xx(e,t,[`middle`,`top-left`,`top`,`top-right`,`right`,`bottom-right`,`bottom`,`bottom-left`,`left`])}function yS(e=`middle`){return vS(e,`frameAnchor`)}function bS(e={},...t){let n=e;for(let r of t)for(let t in r)if(n[t]===void 0){let i=r[t];n===e?n={...n,[t]:i}:n[t]=i}return n}function xS(e){console.warn(`named iterables are deprecated; please use an object instead`);let t=/* @__PURE__ */ new Set;return Object.fromEntries(Array.from(e,e=>{let{name:n}=e;if(n==null)throw Error(`missing name`);let r=`${n}`;if(r===`__proto__`)throw Error(`illegal name: ${r}`);if(t.has(r))throw Error(`duplicate name: ${r}`);return t.add(r),[n,e]}))}function SS(e){return aS(e)?xS(e):e}function CS(e){return e===!0?e=`frame`:e===!1?e=null:!Tx(e)&&e!=null&&(e=Sx(e,`clip`,[`frame`,`sphere`]),e===`sphere`&&(e={type:`Sphere`})),e}function wS(e){return e&&typeof e.getChild==`function`&&typeof e.toArray==`function`&&e.schema&&Array.isArray(e.schema.fields)}function TS(e){return e&&typeof e.toArray==`function`&&e.type}function ES(e){return e&&(e.typeId===8||e.typeId===10)&&e.unit===1}let DS=Symbol(`position`),OS=Symbol(`color`),kS=Symbol(`radius`),AS=Symbol(`length`),jS=Symbol(`opacity`),MS=Symbol(`symbol`),NS=Symbol(`projection`),q=/* @__PURE__ */ new Map([[`x`,DS],[`y`,DS],[`fx`,DS],[`fy`,DS],[`r`,kS],[`color`,OS],[`opacity`,jS],[`symbol`,MS],[`length`,AS],[`projection`,NS]]);function PS(e){return e===DS||e===NS}function FS(e){return e===DS||e===kS||e===AS||e===jS}let IS=Math.sqrt(3),LS=2/IS,RS=/* @__PURE__ */ new Map([[`asterisk`,Uv],[`circle`,Wv],[`cross`,Gv],[`diamond`,Jv],[`diamond2`,Yv],[`hexagon`,{draw(e,t){let n=Math.sqrt(t/Math.PI),r=n*LS,i=r/2;e.moveTo(0,r),e.lineTo(n,i),e.lineTo(n,-i),e.lineTo(0,-r),e.lineTo(-n,-i),e.lineTo(-n,i),e.closePath()}}],[`plus`,Xv],[`square`,Zv],[`square2`,Qv],[`star`,ny],[`times`,fy],[`triangle`,iy],[`triangle2`,oy],[`wye`,dy]]);function zS(e){return e&&typeof e.draw==`function`}function BS(e){return zS(e)?!0:typeof e==`string`&&RS.has(e.toLowerCase())}function VS(e){if(e==null||zS(e))return e;let t=RS.get(`${e}`.toLowerCase());if(t)return t;throw Error(`invalid symbol: ${e}`)}function HS(e){if(e==null||zS(e))return[void 0,e];if(typeof e==`string`){let t=RS.get(`${e}`.toLowerCase());if(t)return[void 0,t]}return[e,void 0]}function US({filter:e,sort:t,reverse:n,transform:r,initializer:i,...a}={},o){if(r===void 0&&(e!=null&&(r=YS(e)),t!=null&&!Nx(t)&&(r=GS(r,eC(t))),n&&(r=GS(r,ZS))),o!=null&&i!=null)throw Error(`transforms cannot be applied after initializers`);return{...a,...(t===null||Nx(t))&&{sort:t},transform:GS(r,o)}}function WS({filter:e,sort:t,reverse:n,initializer:r,...i}={},a){return r===void 0&&(e!=null&&(r=YS(e)),t!=null&&!Nx(t)&&(r=KS(r,eC(t))),n&&(r=KS(r,ZS))),{...i,...(t===null||Nx(t))&&{sort:t},initializer:KS(r,a)}}function GS(e,t){return e==null?t===null?void 0:t:t==null?e===null?void 0:e:function(n,r,i){return{data:n,facets:r}=e.call(this,n,r,i),t.call(this,Cx(n),r,i)}}function KS(e,t){return e==null?t===null?void 0:t:t==null?e===null?void 0:e:function(n,r,i,...a){let o,s,c,l,u,d;return{data:s=n,facets:c=r,channels:o}=e.call(this,n,r,i,...a),{data:u=s,facets:d=c,channels:l}=t.call(this,s,c,{...i,...o},...a),{data:u,facets:d,channels:{...o,...l}}}}function qS(e,t){return(e.initializer==null?US:WS)(e,t)}function JS(e,t){return qS(t,YS(e))}function YS(e){return(t,n)=>{let r=H(t,e);return{data:t,facets:n.map(e=>e.filter(e=>r[e]))}}}function XS({sort:e,...t}={}){return{...qS(t,ZS),sort:Nx(e)?e:null}}function ZS(e,t){return{data:e,facets:t.map(e=>e.slice().reverse())}}function QS({seed:e,sort:t,...n}={}){return{...qS(n,nC(e==null?Math.random:Fp(e))),sort:Nx(t)?t:null}}function $S(e,{sort:t,...n}={}){return{...(Mx(e)&&e.channel!==void 0?WS:qS)(n,eC(e)),sort:Nx(t)?t:null}}function eC(e){return(typeof e==`function`&&e.length!==1?tC:nC)(e)}function tC(e){return(t,n)=>{let r=qb(t)?(n,r)=>e(t[n],t[r]):(n,r)=>e(t.get(n),t.get(r));return{data:t,facets:n.map(e=>e.slice().sort(r))}}}function nC(e){let t,n;({channel:t,value:e,order:n}={...nS(e)});let r=t?.startsWith(`-`);if(r&&(t=t.slice(1)),n===void 0&&(n=r?cb:sb),typeof n!=`function`)switch(`${n}`.toLowerCase()){case`ascending`:n=sb;break;case`descending`:n=cb;break;default:throw Error(`invalid order: ${n}`)}return(r,i,a)=>{let o;if(t===void 0)o=H(r,e);else{if(a===void 0)throw Error(`channel sort requires an initializer`);if(o=a[t],!o)return{};o=o.value}let s=(e,t)=>n(o[e],o[t]);return{data:r,facets:i.map(e=>e.slice().sort(s))}}}function rC(e,t){return sC(null,null,e,t)}function iC(e={y:`count`},t={}){let{x:n=U}=t;if(n==null)throw Error(`missing channel: x`);return sC(n,null,e,t)}function aC(e={x:`count`},t={}){let{y:n=U}=t;if(n==null)throw Error(`missing channel: y`);return sC(null,n,e,t)}function oC(e={fill:`count`},t={}){let{x:n,y:r}=t;if([n,r]=Fx(n,r),n==null)throw Error(`missing channel: x`);if(r==null)throw Error(`missing channel: y`);return sC(n,r,e,t)}function sC(e,t,{data:n=DC,filter:r,sort:i,reverse:a,...o}={},s={}){o=gC(o,s),n=yC(n,U),i=i==null?void 0:_C(`sort`,i,s),r=r==null?void 0:vC(`filter`,r,s);let[c,l]=Gx(e),[u,d]=Gx(t),{z:f,fill:p,stroke:m,x1:h,x2:g,y1:_,y2:v,...y}=s,[b,x]=Gx(f),[S]=yx(p),[C]=yx(m),[w,T]=Gx(S),[E,D]=Gx(C);return{...`z`in s&&{z:b||f},...`fill`in s&&{fill:w||p},...`stroke`in s&&{stroke:E||m},...US(y,(s,c,u)=>{let p=Jx(H(s,e),u?.x),m=Jx(H(s,t),u?.y),h=H(s,f),g=H(s,S),_=H(s,C),v=xC(o,{z:h,fill:g,stroke:_}),y=[],b=[],w=p&&l([]),E=m&&d([]),O=h&&x([]),k=g&&T([]),A=_&&D([]),ee=0;for(let e of o)e.initialize(s);i&&i.initialize(s),r&&r.initialize(s);for(let e of c){let t=[];for(let t of o)t.scope(`facet`,e);i&&i.scope(`facet`,e),r&&r.scope(`facet`,e);for(let[a,c]of pC(e,v))for(let[e,l]of pC(c,m))for(let[c,u]of pC(l,p)){let l={data:s};if(p&&(l.x=c),m&&(l.y=e),v&&(l.z=a),!r||r.reduce(u,l)){t.push(ee++),b.push(n.reduceIndex(u,s,l)),p&&w.push(c),m&&E.push(e),h&&O.push(v===h?a:h[u[0]]),g&&k.push(v===g?a:g[u[0]]),_&&A.push(v===_?a:_[u[0]]);for(let e of o)e.reduce(u,l);i&&i.reduce(u,l)}}y.push(t)}return SC(y,i,a),{data:b,facets:y}}),...!cC(o,`x`)&&(c?{x:c}:{x1:h,x2:g}),...!cC(o,`y`)&&(u?{y:u}:{y1:_,y2:v}),...Object.fromEntries(o.map(({name:e,output:t})=>[e,t]))}}function cC(e,...t){for(let{name:n}of e)if(t.includes(n))return!0;return!1}function lC(e,t,n=uC){let r=Object.entries(e);return t.title!=null&&e.title===void 0&&r.push([`title`,kC]),t.href!=null&&e.href===void 0&&r.push([`href`,OC]),r.filter(([,e])=>e!==void 0).map(([e,r])=>r===null?dC(e):n(e,r,t))}function uC(e,t,n,r=fC){let i;Ax(t)&&`reduce`in t&&(i=t.scale,t=t.reduce);let a=r(e,t,n),[o,s]=Wx(a.label),c;return{name:e,output:i===void 0?o:{value:o,scale:i},initialize(e){a.initialize(e),c=s([])},scope(e,t){a.scope(e,t)},reduce(e,t){c.push(a.reduce(e,t))}}}function dC(e){return{name:e,initialize(){},scope(){},reduce(){}}}function fC(e,t,n,r=mC){let i=Ux(e,n),a=r(t,i),o,s;return{label:Kx(a===jC?null:i,a.label),initialize(e){o=i===void 0?e:H(e,i),a.scope===`data`&&(s=a.reduceIndex(Rx(e),o))},scope(e,t){a.scope===e&&(s=a.reduceIndex(t,o))},reduce(e,t){return a.scope==null?a.reduceIndex(e,o,t):a.reduceIndex(e,o,s,t)}}}function pC(e,t){return t?fe(e,e=>t[e]):[[,e]]}function mC(e,t,n=hC){if(e==null)return n(e);if(typeof e.reduceIndex==`function`)return e;if(typeof e.reduce==`function`&&Ax(e))return CC(e);if(typeof e==`function`)return wC(e);if(/^p\d{2}$/i.test(e))return TC(mx(e));switch(`${e}`.toLowerCase()){case`first`:return OC;case`last`:return AC;case`identity`:return DC;case`count`:return jC;case`distinct`:return MC;case`sum`:return t==null?jC:NC;case`proportion`:return PC(t,`data`);case`proportion-facet`:return PC(t,`facet`);case`deviation`:return TC(re);case`min`:return TC(Me);case`min-index`:return TC(Ne);case`max`:return TC(Ae);case`max-index`:return TC(je);case`mean`:return EC(Ve);case`median`:return EC(He);case`variance`:return TC(ne);case`mode`:return TC(Ge)}return n(e)}function hC(e){throw Error(`invalid reduce: ${e}`)}function gC(e,t){return lC(e,t,_C)}function _C(e,t,n){return uC(e,t,n,vC)}function vC(e,t,n){return fC(e,t,n,yC)}function yC(e,t){return mC(e,t,bC)}function bC(e){switch(`${e}`.toLowerCase()){case`x`:return FC;case`y`:return IC;case`z`:return LC}throw Error(`invalid group reduce: ${e}`)}function xC(e,t){for(let n in t){let r=t[n];if(r!==void 0&&!e.some(e=>e.name===n))return r}}function SC(e,t,n){if(t){let n=t.output.transform(),r=(e,t)=>sb(n[e],n[t]);e.forEach(e=>e.sort(r))}n&&e.forEach(e=>e.reverse())}function CC(e){return console.warn(`deprecated reduce interface; implement reduceIndex instead.`),{...e,reduceIndex:e.reduce.bind(e)}}function wC(e){return{reduceIndex(t,n,r){return e(zx(n,t),r)}}}function TC(e){return{reduceIndex(t,n){return e(t,e=>n[e])}}}function EC(e){return{reduceIndex(t,n){let r=e(t,e=>n[e]);return cS(n)?new Date(r):r}}}let DC={reduceIndex(e,t){return zx(t,e)}},OC={reduceIndex(e,t){return t[e[0]]}},kC={reduceIndex(e,t){let n=_e(pe(e,e=>e.length,e=>t[e]),dx),r=n.slice(-5).reverse();if(r.length<n.length){let e=n.slice(0,-4);r[4]=[`… ${e.length.toLocaleString(`en-US`)} more`,Ze(e,dx)]}return r.map(([e,t])=>`${e} (${t.toLocaleString(`en-US`)})`).join(`
2
+ `)}},AC={reduceIndex(e,t){return t[e[e.length-1]]}},jC={label:`Frequency`,reduceIndex(e){return e.length}},MC={label:`Distinct`,reduceIndex(e,t){let n=new oe;for(let r of e)n.add(t[r]);return n.size}},NC=TC(Ze);function PC(e,t){return e==null?{scope:t,label:`Frequency`,reduceIndex:(e,t,n=1)=>e.length/n}:{scope:t,reduceIndex:(e,t,n=1)=>Ze(e,e=>t[e])/n}}let FC={reduceIndex(e,t,{x:n}){return n}},IC={reduceIndex(e,t,{y:n}){return n}},LC={reduceIndex(e,t,{z:n}){return n}};function RC(e){if(typeof e!=`function`)throw Error(`invalid test function: ${e}`);return{reduceIndex(t,n,{data:r}){return n[t.find(qb(r)?t=>e(r[t],t,r):t=>e(r.get(t),t,r))]}}}function zC(e,{scale:t,type:n,value:r,filter:i,hint:a,label:o=Kx(r)},s){return a===void 0&&typeof r?.transform==`function`&&(a=r.hint),HC(s,{scale:t,type:n,value:H(e,r),label:o,filter:i,hint:a})}function BC(e,t){return Object.fromEntries(Object.entries(e).map(([e,n])=>[e,zC(t,n,e)]))}function VC(e,t){let n=Object.fromEntries(Object.entries(e).map(([e,{scale:n,value:r}])=>{let i=n==null?null:t[n];return[e,i==null?r:G(r,i)]}));return n.channels=e,n}function HC(e,t){let{scale:n,value:r}=t;if(n===!0||n===`auto`)switch(e){case`fill`:case`stroke`:case`color`:t.scale=n!==!0&&fS(r,mS)?null:`color`,t.defaultScale=`color`;break;case`fillOpacity`:case`strokeOpacity`:case`opacity`:t.scale=n!==!0&&fS(r,hS)?null:`opacity`,t.defaultScale=`opacity`;break;case`symbol`:n!==!0&&fS(r,BS)?(t.scale=null,t.value=G(r,VS)):t.scale=`symbol`,t.defaultScale=`symbol`;break;default:t.scale=q.has(e)?e:null}else if(n===!1)t.scale=null;else if(n!=null&&!q.has(n))throw Error(`unknown scale: ${n}`);return t}function UC(e,t,n,r,i){let{order:a,reverse:o,reduce:s=!0,limit:c}=i;for(let l in i){if(!q.has(l))continue;let{value:u,order:d=a,reverse:f=o,reduce:p=s,limit:m=c}=nS(i[l]),h=u?.startsWith(`-`);if(h&&(u=u.slice(1)),d=d===void 0?h===(u===`width`||u===`height`)?YC:XC:JC(d),p==null||p===!1)continue;let g=l===`fx`||l===`fy`?GC(t,r[l]):WC(n,l);if(!g)throw Error(`missing channel for scale: ${l}`);let _=g.value,[v=0,y=1/0]=aS(m)?m:m<0?[m]:[0,m];if(u==null)g.domain=()=>{let e=Array.from(new oe(_));return f&&(e=e.reverse()),(v!==0||y!==1/0)&&(e=e.slice(v,y)),e};else{let t=u===`data`?e:u===`height`?KC(n,`y1`,`y2`):u===`width`?KC(n,`x1`,`x2`):qC(n,u,u===`y`?`y2`:u===`x`?`x2`:void 0),r=mC(p===!0?`max`:p,t);g.domain=()=>{let e=me(Rx(_),e=>r.reduceIndex(e,t),e=>_[e]);return d&&e.sort(d),f&&e.reverse(),(v!==0||y!==1/0)&&(e=e.slice(v,y)),e.map(ux)}}}}function WC(e,t){for(let n in e){let r=e[n];if(r.scale===t)return r}}function GC(e,t){let n=e.original;if(n===e)return t;let r=t.value,i=t.value=[];for(let t=0;t<n.length;++t){let a=r[n[t][0]];for(let n of e[t])i[n]=a}return t}function KC(e,t,n){let r=qC(e,t);return G(qC(e,n),(e,t)=>Math.abs(e-r[t]),Float64Array)}function qC(e,t,n){let r=e[t];if(!r&&n!==void 0&&(r=e[n]),r)return r.value;throw Error(`missing channel: ${t}`)}function JC(e){if(e==null||typeof e==`function`)return e;switch(`${e}`.toLowerCase()){case`ascending`:return YC;case`descending`:return XC}throw Error(`invalid order: ${e}`)}function YC([e,t],[n,r]){return sb(t,r)||sb(e,n)}function XC([e,t],[n,r]){return cb(t,r)||sb(e,n)}function ZC(e,t){let n=e[t];if(n){for(;n.source;)n=n.source;return n.source===null?null:n}}let QC=/* @__PURE__ */ new Map([[`accent`,Qg],[`category10`,Zg],[`dark2`,$g],[`observable10`,e_],[`paired`,t_],[`pastel1`,n_],[`pastel2`,r_],[`set1`,i_],[`set2`,a_],[`set3`,o_],[`tableau10`,s_]]);function $C(e){return e!=null&&QC.has(`${e}`.toLowerCase())}let ew=new Map([...QC,[`brbg`,nw(c_,l_)],[`prgn`,nw(u_,d_)],[`piyg`,nw(f_,p_)],[`puor`,nw(m_,h_)],[`rdbu`,nw(g_,__)],[`rdgy`,nw(v_,y_)],[`rdylbu`,nw(b_,x_)],[`rdylgn`,nw(S_,C_)],[`spectral`,nw(w_,T_)],[`burd`,rw(g_,__)],[`buylrd`,rw(b_,x_)],[`blues`,tw(X_,Z_)],[`greens`,tw(Q_,$_)],[`greys`,tw(ev,tv)],[`oranges`,tw(ov,sv)],[`purples`,tw(nv,rv)],[`reds`,tw(iv,av)],[`turbo`,iw(vv)],[`viridis`,iw(bv)],[`magma`,iw(xv)],[`inferno`,iw(Sv)],[`plasma`,iw(Cv)],[`cividis`,iw(cv)],[`cubehelix`,iw(lv)],[`warm`,iw(uv)],[`cool`,iw(dv)],[`bugn`,tw(E_,D_)],[`bupu`,tw(O_,k_)],[`gnbu`,tw(A_,j_)],[`orrd`,tw(M_,N_)],[`pubu`,tw(I_,L_)],[`pubugn`,tw(P_,F_)],[`purd`,tw(R_,z_)],[`rdpu`,tw(B_,V_)],[`ylgn`,tw(W_,G_)],[`ylgnbu`,tw(H_,U_)],[`ylorbr`,tw(K_,q_)],[`ylorrd`,tw(J_,Y_)],[`rainbow`,aw(pv)],[`sinebow`,aw(_v)]]);function tw(e,t){return({length:n})=>n===1?[e[3][1]]:n===2?[e[3][1],e[3][2]]:(n=Math.max(3,Math.floor(n)),n>9?Sa(t,n):e[n])}function nw(e,t){return({length:n})=>n===2?[e[3][0],e[3][2]]:(n=Math.max(3,Math.floor(n)),n>11?Sa(t,n):e[n])}function rw(e,t){return({length:n})=>n===2?[e[3][2],e[3][0]]:(n=Math.max(3,Math.floor(n)),n>11?Sa(e=>t(1-e),n):e[n].slice().reverse())}function iw(e){return({length:t})=>Sa(e,Math.max(2,Math.floor(t)))}function aw(e){return({length:t})=>Sa(e,Math.floor(t)+1).slice(0,-1)}function ow(e){let t=`${e}`.toLowerCase();if(!ew.has(t))throw Error(`unknown ordinal scheme: ${t}`);return ew.get(t)}function sw(e,t){let n=ow(e),r=typeof n==`function`?n({length:t}):n;return r.length===t?r:r.slice(0,t)}function cw(e,t=`greys`){let n=/* @__PURE__ */ new Set,[r,i]=sw(t,2);for(let t of e)if(t!=null){if(t===!0)n.add(i);else if(t===!1)n.add(r);else return}return[...n]}let lw=/* @__PURE__ */ new Map([[`brbg`,l_],[`prgn`,d_],[`piyg`,p_],[`puor`,h_],[`rdbu`,__],[`rdgy`,y_],[`rdylbu`,x_],[`rdylgn`,C_],[`spectral`,T_],[`burd`,e=>__(1-e)],[`buylrd`,e=>x_(1-e)],[`blues`,Z_],[`greens`,$_],[`greys`,tv],[`purples`,rv],[`reds`,av],[`oranges`,sv],[`turbo`,vv],[`viridis`,bv],[`magma`,xv],[`inferno`,Sv],[`plasma`,Cv],[`cividis`,cv],[`cubehelix`,lv],[`warm`,uv],[`cool`,dv],[`bugn`,D_],[`bupu`,k_],[`gnbu`,j_],[`orrd`,N_],[`pubugn`,F_],[`pubu`,L_],[`purd`,z_],[`rdpu`,V_],[`ylgnbu`,U_],[`ylgn`,G_],[`ylorbr`,q_],[`ylorrd`,Y_],[`rainbow`,pv],[`sinebow`,_v]]);function uw(e){let t=`${e}`.toLowerCase();if(!lw.has(t))throw Error(`unknown quantitative scheme: ${t}`);return lw.get(t)}let dw=/* @__PURE__ */ new Set([`brbg`,`prgn`,`piyg`,`puor`,`rdbu`,`rdgy`,`rdylbu`,`rdylgn`,`spectral`,`burd`,`buylrd`]);function fw(e){return e!=null&&dw.has(`${e}`.toLowerCase())}let pw=e=>t=>e(1-t),mw=[0,1],hw=/* @__PURE__ */ new Map([[`number`,Xi],[`rgb`,Ui],[`hsl`,ha],[`hcl`,va],[`lab`,ga]]);function gw(e){let t=`${e}`.toLowerCase();if(!hw.has(t))throw Error(`unknown interpolator: ${t}`);return hw.get(t)}function _w(e,t,n,{type:r,nice:i,clamp:a,zero:o,domain:s=jw(e,n),unknown:c,round:l,scheme:u,interval:d,range:f=q.get(e)===kS?Nw(n,s):q.get(e)===AS?Pw(n,s):q.get(e)===jS?mw:void 0,interpolate:p=q.get(e)===OS?u==null&&f!==void 0?Ui:uw(u===void 0?r===`cyclical`?`rainbow`:`turbo`:u):l?ia:Xi,reverse:m}){if(s=vw(s),d=Qx(d,r),(r===`cyclical`||r===`sequential`)&&(r=`linear`),typeof p!=`function`&&(p=gw(p)),m=!!m,f!==void 0&&s.length!==(f=vw(f)).length){if(p.length===1)throw Error(`invalid piecewise interpolator`);p=xa(p,f),f=void 0}if(p.length===1?(m&&=(p=pw(p),!1),f===void 0&&(f=Float64Array.from(s,(e,t)=>t/(s.length-1)),f.length===2&&(f=mw)),t.interpolate((f===mw?px:Lw)(p))):t.interpolate(p),o){let[e,t]=j(s);(e>0||t<0)&&(s=Ex(s),(vb(s)||1)===Math.sign(e)?s[0]=0:s[s.length-1]=0)}return m&&(s=Qe(s)),t.domain(s).unknown(c),i&&(t.nice(yw(i,r)),s=t.domain()),f!==void 0&&t.range(f),a&&t.clamp(a),{type:r,domain:s,range:f,scale:t,interpolate:p,interval:d}}function vw(e){return e=wx(e),e.length>=2?e:[e[0],e[0]]}function yw(e,t){return e===!0?void 0:typeof e==`number`?e:$x(e,t)}function bw(e,t,n){return _w(e,nm(),t,n)}function xw(e,t,n){return Sw(e,t,{...n,exponent:.5})}function Sw(e,t,{exponent:n=1,...r}){return _w(e,Cm().exponent(n),t,{...r,type:`pow`})}function Cw(e,t,{base:n=10,domain:r=Fw(t),...i}){return _w(e,mm().base(n),t,{...i,domain:r})}function ww(e,t,{constant:n=1,...r}){return _w(e,vm().constant(n),t,r)}function Tw(e,t,{range:n,quantiles:r=n===void 0?5:(n=[...n]).length,n:i=r,scheme:a=`rdylbu`,domain:o=Iw(t),unknown:s,interpolate:c,reverse:l}){return n===void 0&&(n=c===void 0?q.get(e)===OS?sw(a,i):void 0:Sa(c,i)),o.length>0&&(o=wm(o,n===void 0?{length:i}:n).quantiles()),Dw(e,t,{domain:o,range:n,reverse:l,unknown:s})}function Ew(e,t,{range:n,n:r=n===void 0?5:(n=[...n]).length,scheme:i=`rdylbu`,domain:a=jw(e,t),unknown:o,interpolate:s,reverse:c}){let[l,u]=j(a),d;return n===void 0?(d=Te(l,u,r),d[0]<=l&&d.splice(0,1),d[d.length-1]>=u&&d.pop(),r=d.length+1,n=s===void 0?q.get(e)===OS?sw(i,r):void 0:Sa(s,r)):(d=Sa(Xi(l,u),r+1).slice(1,-1),l instanceof Date&&(d=d.map(e=>new Date(e)))),vb(wx(a))<0&&d.reverse(),Dw(e,t,{domain:d,range:n,reverse:c,unknown:o})}function Dw(e,t,{domain:n=[0],unknown:r,scheme:i=`rdylbu`,interpolate:a,range:o=a===void 0?q.get(e)===OS?sw(i,n.length+1):void 0:Sa(a,n.length+1),reverse:s}){n=wx(n);let c=vb(n);if(!isNaN(c)&&!Ow(n,c))throw Error(`the ${e} scale has a non-monotonic domain`);return s&&(o=Qe(o)),{type:`threshold`,scale:Tm(c<0?Qe(n):n,o===void 0?[]:o).unknown(r),domain:n,range:o}}function Ow(e,t){for(let n=1,r=e.length,i=e[0];n<r;++n){let r=d(i,i=e[n]);if(r!==0&&r!==t)return!1}return!0}function kw(e){return{type:`identity`,scale:FS(q.get(e))?rm():e=>e}}function Aw(e,t=ub){return e.length?[Me(e,({value:e})=>e===void 0?e:Me(e,t)),Ae(e,({value:e})=>e===void 0?e:Ae(e,t))]:[0,1]}function jw(e,t){let n=q.get(e);return(n===kS||n===jS||n===AS?Mw:Aw)(t)}function Mw(e){return[0,e.length?Ae(e,({value:e})=>e===void 0?e:Ae(e,ub)):1]}function Nw(e,t){let n=e.find(({radius:e})=>e!==void 0);if(n!==void 0)return[0,n.radius];let r=Le(e,.5,({value:e})=>e===void 0?NaN:Le(e,.25,db)),i=t.map(e=>3*Math.sqrt(e/r)),a=30/Ae(i);return a<1?i.map(e=>e*a):i}function Pw(e,t){let n=He(e,({value:e})=>e===void 0?NaN:He(e,Math.abs)),r=t.map(e=>12*e/n),i=60/Ae(r);return i<1?r.map(e=>e*i):r}function Fw(e){for(let{value:t}of e)if(t!==void 0)for(let n of t){if(n>0)return Aw(e,db);if(n<0)return Aw(e,fb)}return[1,10]}function Iw(e){let t=[];for(let{value:n}of e)if(n!==void 0)for(let e of n)t.push(e);return t}function Lw(e){return(t,n)=>r=>e(t+r*(n-t))}let Rw=0,zw;function Bw(){let e=Rw;return Rw=0,zw=void 0,e}function Vw(e){e!==zw&&(zw=e,console.warn(e),++Rw)}function Hw(e,t,n,r,{type:i,nice:a,clamp:o,domain:s=Aw(r),unknown:c,pivot:l=0,scheme:u,range:f,symmetric:p=!0,interpolate:m=q.get(e)===OS?u==null&&f!==void 0?Ui:uw(u===void 0?`rdbu`:u):Xi,reverse:h}){l=+l,s=wx(s);let[g,_]=s;if(s.length>2&&Vw(`Warning: the diverging ${e} scale domain contains extra elements.`),d(g,_)<0&&([g,_]=[_,g],h=!h),g=Math.min(g,l),_=Math.max(_,l),typeof m!=`function`&&(m=gw(m)),f!==void 0&&(m=m.length===1?Lw(m)(...f):xa(m,f)),h&&(m=pw(m)),p){let e=n.apply(l),t=e-n.apply(g),r=n.apply(_)-e;t<r?g=n.invert(e-r):t>r&&(_=n.invert(e+t))}return t.domain([g,l,_]).unknown(c).interpolator(m),o&&t.clamp(o),a&&t.nice(a),{type:i,domain:[g,_],pivot:l,interpolate:m,scale:t}}function Uw(e,t,n){return Hw(e,qg(),Jw,t,n)}function Ww(e,t,n){return Gw(e,t,{...n,exponent:.5})}function Gw(e,t,{exponent:n=1,...r}){return Hw(e,Xg().exponent(n=+n),Zw(n),t,{...r,type:`diverging-pow`})}function Kw(e,t,{base:n=10,pivot:r=1,domain:i=Aw(t,r<0?fb:db),...a}){return Hw(e,Jg().base(n=+n),Yw,t,{domain:i,pivot:r,...a})}function qw(e,t,{constant:n=1,...r}){return Hw(e,Yg().constant(n=+n),Qw(n),t,r)}let Jw={apply(e){return e},invert(e){return e}},Yw={apply:Math.log,invert:Math.exp},Xw={apply(e){return Math.sign(e)*Math.sqrt(Math.abs(e))},invert(e){return e*e*Math.sign(e)}};function Zw(e){return e===.5?Xw:{apply(t){return Math.sign(t)*Math.abs(t)**+e},invert(t){return Math.sign(t)*Math.abs(t)**(1/e)}}}function Qw(e){return{apply(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))},invert(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}}function $w(e,t,n,r){return _w(e,t,n,r)}function eT(e,t,n){return $w(e,Ug(),t,n)}function tT(e,t,n){return $w(e,Wg(),t,n)}let nT=Symbol(`ordinal`);function rT(e,t,n,{type:r,interval:i,domain:a,range:o,reverse:s,hint:c}){return i=Qx(i,r),a===void 0&&(a=cT(n,i,e)),(r===`categorical`||r===nT)&&(r=`ordinal`),s&&(a=Qe(a)),a=t.domain(a).domain(),o!==void 0&&(typeof o==`function`&&(o=o(a)),t.range(o)),{type:r,domain:a,range:o,scale:t,hint:c,interval:i}}function iT(e,t,{type:n,interval:r,domain:i,range:a,scheme:o,unknown:s,...c}){r=Qx(r,n),i===void 0&&(i=cT(t,r,e));let l;if(q.get(e)===MS)l=uT(t),a=a===void 0?dT(l):G(a,VS);else if(q.get(e)===OS&&(a===void 0&&(n===`ordinal`||n===nT)&&(a=cw(i,o),a!==void 0&&(o=void 0)),o===void 0&&a===void 0&&(o=n===`ordinal`?`turbo`:`observable10`),o!==void 0)){if(a!==void 0){let e=uw(o),t=a[0],n=a[1]-a[0];a=({length:r})=>Sa(r=>e(t+n*r),r)}else a=ow(o)}if(s===Rp)throw Error(`implicit unknown on ${e} scale is not supported`);return rT(e,zp().unknown(s),t,{...c,type:n,domain:i,range:a,hint:l})}function aT(e,t,{align:n=.5,padding:r=.5,...i}){return sT(Hp().align(n).padding(r),t,i,e)}function oT(e,t,{align:n=.5,padding:r=.1,paddingInner:i=r,paddingOuter:a=e===`fx`||e===`fy`?0:r,...o}){return sT(Bp().align(n).paddingInner(i).paddingOuter(a),t,o,e)}function sT(e,t,n,r){let{round:i}=n;return i!==void 0&&e.round(i=!!i),e=rT(r,e,t,n),e.round=i,e}function cT(e,t,n){let r=new oe;for(let{value:t,domain:n}of e){if(n!==void 0)return n();if(t!==void 0)for(let e of t)r.add(e)}if(t!==void 0){let[e,n]=j(r).map(t.floor,t);return t.range(e,t.offset(n))}if(r.size>1e4&&q.get(n)===DS)throw Error(`implicit ordinal domain of ${n} scale has more than 10,000 values`);return _e(r,sb)}function lT(e,t){let n;for(let{hint:r}of e){let e=r?.[t];if(e!==void 0){if(n===void 0)n=e;else if(n!==e)return}}return n}function uT(e){return{fill:lT(e,`fill`),stroke:lT(e,`stroke`)}}function dT(e){return K(e.fill)?my:py}function fT(e,{label:t,inset:n=0,insetTop:r=n,insetRight:i=n,insetBottom:a=n,insetLeft:o=n,round:s,nice:c,clamp:l,zero:u,align:d,padding:f,projection:p,facet:{label:m=t}={},...h}={}){let g={};for(let[n,_]of e){let e=h[n],v=TT(n,_,{round:q.get(n)===DS?s:void 0,nice:c,clamp:l,zero:u,align:d,padding:f,projection:p,...e});if(v){let{label:s=n===`fx`||n===`fy`?m:t,percent:c,transform:l,inset:u,insetTop:d=u===void 0?n===`y`?r:0:u,insetRight:f=u===void 0?n===`x`?i:0:u,insetBottom:p=u===void 0?n===`y`?a:0:u,insetLeft:h=u===void 0?n===`x`?o:0:u}=e||{};if(l==null)l=void 0;else if(typeof l!=`function`)throw Error(`invalid scale transform; not a function`);v.percent=!!c,v.label=s===void 0?hT(_,v):s,v.transform=l,n===`x`||n===`fx`?(v.insetLeft=+h,v.insetRight=+f):(n===`y`||n===`fy`)&&(v.insetTop=+d,v.insetBottom=+p),g[n]=v}}return g}function pT(e){let t={},n={scales:t};for(let[r,i]of Object.entries(e)){let{scale:e,type:a,interval:o,label:s}=i;t[r]=zT(i),n[r]=e,e.type=a,o!=null&&(e.interval=o),s!=null&&(e.label=s)}return n}function mT(e,t){let{x:n,y:r,fx:i,fy:a}=e,o=i||a?_T(t):t;i&&yT(i,o),a&&bT(a,o);let s=i||a?vT(e,t):t;n&&yT(n,s),r&&bT(r,s)}function hT(e=[],t){let n;for(let{label:t}of e)if(t!==void 0){if(n===void 0)n=t;else if(n!==t)return}if(n!==void 0)return!jT(t)&&t.percent&&(n=`${n} (%)`),{inferred:!0,toString:()=>n}}function gT(e){return Math.sign(vb(e.domain()))*Math.sign(vb(e.range()))}function _T(e){let{marginTop:t,marginRight:n,marginBottom:r,marginLeft:i,width:a,height:o,facet:{marginTop:s,marginRight:c,marginBottom:l,marginLeft:u}}=e;return{marginTop:Math.max(t,s),marginRight:Math.max(n,c),marginBottom:Math.max(r,l),marginLeft:Math.max(i,u),width:a,height:o}}function vT({fx:e,fy:t},n){let{marginTop:r,marginRight:i,marginBottom:a,marginLeft:o,width:s,height:c}=_T(n);return{marginTop:r,marginRight:i,marginBottom:a,marginLeft:o,width:e?e.scale.bandwidth()+o+i:s,height:t?t.scale.bandwidth()+r+a:c,facet:{width:s,height:c}}}function yT(e,t){if(e.range===void 0){let{insetLeft:n,insetRight:r}=e,{width:i,marginLeft:a=0,marginRight:o=0}=t,s=a+n,c=i-o-r;e.range=[s,Math.max(s,c)],jT(e)||(e.range=CT(e)),e.scale.range(e.range)}xT(e)}function bT(e,t){if(e.range===void 0){let{insetTop:n,insetBottom:r}=e,{height:i,marginTop:a=0,marginBottom:o=0}=t,s=a+n,c=i-o-r;e.range=[Math.max(s,c),s],jT(e)?e.range.reverse():e.range=CT(e),e.scale.range(e.range)}xT(e)}function xT(e){e.round===void 0&&NT(e)&&ST(e)<=30&&e.scale.round(!0)}function ST({scale:e}){let t=e.domain().length,[n,r]=e.range(),i=e.paddingInner?e.paddingInner():1,a=e.paddingOuter?e.paddingOuter():e.padding(),o=t-i,s=Math.abs(r-n)/Math.max(1,o+a*2);return(s-Math.floor(s))*o}function CT(e){let t=e.scale.domain().length+MT(e);if(!(t>2))return e.range;let[n,r]=e.range;return Array.from({length:t},(e,i)=>n+i/(t-1)*(r-n))}function wT(e,t,n){return TT(e,n===void 0?void 0:[{hint:n}],{...t})}function TT(e,t=[],n={}){let r=kT(e,t,n);if(n.type===void 0&&n.domain===void 0&&n.range===void 0&&n.interval==null&&e!==`fx`&&e!==`fy`&&jT({type:r})){let n=t.map(({value:e})=>e).filter(e=>e!==void 0);n.some(cS)?Vw(`Warning: some data associated with the ${e} scale are dates. Dates are typically associated with a "utc" or "time" scale rather than a "${ET(r)}" scale. If you are using a bar mark, you probably want a rect mark with the interval option instead; if you are using a group transform, you probably want a bin transform instead. If you want to treat this data as ordinal, you can specify the interval of the ${e} scale (e.g., d3.utcDay), or you can suppress this warning by setting the type of the ${e} scale to "${ET(r)}".`):n.some(lS)?Vw(`Warning: some data associated with the ${e} scale are strings that appear to be dates (e.g., YYYY-MM-DD). If these strings represent dates, you should parse them to Date objects. Dates are typically associated with a "utc" or "time" scale rather than a "${ET(r)}" scale. If you are using a bar mark, you probably want a rect mark with the interval option instead; if you are using a group transform, you probably want a bin transform instead. If you want to treat this data as ordinal, you can suppress this warning by setting the type of the ${e} scale to "${ET(r)}".`):n.some(uS)&&Vw(`Warning: some data associated with the ${e} scale are strings that appear to be numbers. If these strings represent numbers, you should parse or coerce them to numbers. Numbers are typically associated with a "linear" scale rather than a "${ET(r)}" scale. If you want to treat this data as ordinal, you can specify the interval of the ${e} scale (e.g., 1 for integers), or you can suppress this warning by setting the type of the ${e} scale to "${ET(r)}".`)}switch(n.type=r,r){case`diverging`:case`diverging-sqrt`:case`diverging-pow`:case`diverging-log`:case`diverging-symlog`:case`cyclical`:case`sequential`:case`linear`:case`sqrt`:case`threshold`:case`quantile`:case`pow`:case`log`:case`symlog`:n=FT(t,n,hx);break;case`identity`:switch(q.get(e)){case DS:n=FT(t,n,hx);break;case MS:n=FT(t,n,IT)}break;case`utc`:case`time`:n=FT(t,n,_x)}switch(r){case`diverging`:return Uw(e,t,n);case`diverging-sqrt`:return Ww(e,t,n);case`diverging-pow`:return Gw(e,t,n);case`diverging-log`:return Kw(e,t,n);case`diverging-symlog`:return qw(e,t,n);case`categorical`:case`ordinal`:case nT:return iT(e,t,n);case`cyclical`:case`sequential`:case`linear`:return bw(e,t,n);case`sqrt`:return xw(e,t,n);case`threshold`:return Dw(e,t,n);case`quantile`:return Tw(e,t,n);case`quantize`:return Ew(e,t,n);case`pow`:return Sw(e,t,n);case`log`:return Cw(e,t,n);case`symlog`:return ww(e,t,n);case`utc`:return tT(e,t,n);case`time`:return eT(e,t,n);case`point`:return aT(e,t,n);case`band`:return oT(e,t,n);case`identity`:return kw(e);case void 0:return;default:throw Error(`unknown scale type: ${r}`)}}function ET(e){return typeof e==`symbol`?e.description:e}function DT(e){return typeof e==`string`?`${e}`.toLowerCase():e}let OT={toString:()=>`projection`};function kT(e,t,{type:n,domain:r,range:i,scheme:a,pivot:o,projection:s}){if(n=DT(n),e===`fx`||e===`fy`)return`band`;(e===`x`||e===`y`)&&s!=null&&(n=OT);for(let e of t){let t=DT(e.type);if(t!==void 0){if(n===void 0)n=t;else if(n!==t)throw Error(`scale incompatible with channel: ${n} !== ${t}`)}}if(n===OT)return;if(n!==void 0)return n;if(r===void 0&&!t.some(({value:e})=>e!==void 0))return;let c=q.get(e);if(c===kS)return`sqrt`;if(c===jS||c===AS)return`linear`;if(c===MS)return`ordinal`;let l=(r??i)?.length;if(l<2||l>2)return AT(c);if(r!==void 0){if(sS(r))return AT(c);if(cS(r))return`utc`}else{let e=t.map(({value:e})=>e).filter(e=>e!==void 0);if(e.some(sS))return AT(c);if(e.some(cS))return`utc`}if(c===OS){if(o!=null||fw(a))return`diverging`;if($C(a))return`categorical`}return`linear`}function AT(e){switch(e){case DS:return`point`;case OS:return nT;default:return`ordinal`}}function jT({type:e}){return e===`ordinal`||e===`point`||e===`band`||e===nT}function MT({type:e}){return e===`threshold`}function NT({type:e}){return e===`point`||e===`band`}function PT(e){if(e===void 0)return!0;let t=e.domain(),n=e(t[0]);for(let r=1,i=t.length;r<i;++r)if(e(t[r])-n)return!1;return!0}function FT(e,{domain:t,...n},r){for(let n of e)n.value!==void 0&&(t===void 0&&(t=n.value?.domain),n.value=r(n.value));return{domain:t===void 0?t:r(t),...n}}function IT(e){return G(e,VS)}function LT(e={}){let t;for(let n in e)if(q.has(n)&&jx(e[n])){if(t!==void 0)throw Error(`ambiguous scale definition; multiple scales found`);t=zT(wT(n,e[n]))}if(t===void 0)throw Error(`invalid scale definition; no scale found`);return t}function RT(e){return t=>{if(!q.has(t=`${t}`))throw Error(`unknown scale: ${t}`);return e[t]}}function zT({scale:e,type:t,domain:n,range:r,interpolate:i,interval:a,transform:o,percent:s,pivot:c}){if(t===`identity`)return{type:`identity`,apply:e=>e,invert:e=>e};let l=e.unknown?e.unknown():void 0;return{type:t,domain:Ex(n),...r!==void 0&&{range:Ex(r)},...o!==void 0&&{transform:o},...s&&{percent:s},...l!==void 0&&{unknown:l},...a!==void 0&&{interval:a},...i!==void 0&&{interpolate:i},...e.clamp&&{clamp:e.clamp()},...c!==void 0&&{pivot:c,symmetric:!1},...e.base&&{base:e.base()},...e.exponent&&{exponent:e.exponent()},...e.constant&&{constant:e.constant()},...e.align&&{align:e.align(),round:e.round()},...e.padding&&(e.paddingInner?{paddingInner:e.paddingInner(),paddingOuter:e.paddingOuter()}:{padding:e.padding()}),...e.bandwidth&&{bandwidth:e.bandwidth(),step:e.step()},apply:t=>e(t),...e.invert&&{invert:t=>e.invert(t)}}}function BT(e,t){let{fx:n,fy:r}=fT(e,t),i=n?.scale.domain(),a=r?.scale.domain();return i&&a?ee(i,a).map(([e,t],n)=>({x:e,y:t,i:n})):i?i.map((e,t)=>({x:e,i:t})):a?a.map((e,t)=>({y:e,i:t})):void 0}function VT(e,{x:t,y:n}){return t&&=JT(t),n&&=JT(n),e.filter(t&&n?e=>t.has(e.x)&&n.has(e.y):t?e=>t.has(e.x):e=>n.has(e.y)).sort(t&&n?(e,r)=>t.get(e.x)-t.get(r.x)||n.get(e.y)-n.get(r.y):t?(e,n)=>t.get(e.x)-t.get(n.x):(e,t)=>n.get(e.y)-n.get(t.y))}function HT(e,{fx:t,fy:n}){let r=Rx(e),i=t?.value,a=n?.value;return t&&n?pe(r,e=>(e.fx=i[e[0]],e.fy=a[e[0]],e),e=>i[e],e=>a[e]):t?pe(r,e=>(e.fx=i[e[0]],e),e=>i[e]):pe(r,e=>(e.fy=a[e[0]],e),e=>a[e])}function UT(e,t,{marginTop:n,marginLeft:r}){let i=e?({x:t})=>e(t)-r:()=>0,a=t?({y:e})=>t(e)-n:()=>0;return function(e){this.tagName===`svg`?(this.setAttribute(`x`,i(e)),this.setAttribute(`y`,a(e))):this.setAttribute(`transform`,`translate(${i(e)},${a(e)})`)}}function WT(e){let t=[],n=new Uint32Array(Ze(e,e=>e.length));for(let r of e){let i=0;for(let t of e)r!==t&&(n.set(t,i),i+=t.length);t.push(n.slice(0,i))}return t}let GT=/* @__PURE__ */ new Map([[`top`,QT],[`right`,tE],[`bottom`,$T],[`left`,eE],[`top-left`,sE(QT,eE)],[`top-right`,sE(QT,tE)],[`bottom-left`,sE($T,eE)],[`bottom-right`,sE($T,tE)],[`top-empty`,nE],[`right-empty`,aE],[`bottom-empty`,rE],[`left-empty`,iE],[`empty`,oE]]);function KT(e){if(e==null)return null;let t=GT.get(`${e}`.toLowerCase());if(t)return t;throw Error(`invalid facet anchor: ${e}`)}let qT=/* @__PURE__ */ new WeakMap;function JT(e){let t=qT.get(e);return t||qT.set(e,t=new ae(G(e,(e,t)=>[e,t]))),t}function YT(e,t){return JT(e).get(t)}function XT(e,t,n){return t=Hx(t),n=Hx(n),e.find(e=>Object.is(Hx(e.x),t)&&Object.is(Hx(e.y),n))}function ZT(e,t,n){return XT(e,t,n)?.empty}function QT(e,{y:t},{y:n}){return!t||YT(t,n)===0}function $T(e,{y:t},{y:n}){return!t||YT(t,n)===t.length-1}function eE(e,{x:t},{x:n}){return!t||YT(t,n)===0}function tE(e,{x:t},{x:n}){return!t||YT(t,n)===t.length-1}function nE(e,{y:t},{x:n,y:r,empty:i}){if(i)return!1;if(!t)return;let a=YT(t,r);if(a>0)return ZT(e,n,t[a-1])}function rE(e,{y:t},{x:n,y:r,empty:i}){if(i)return!1;if(!t)return;let a=YT(t,r);if(a<t.length-1)return ZT(e,n,t[a+1])}function iE(e,{x:t},{x:n,y:r,empty:i}){if(i)return!1;if(!t)return;let a=YT(t,n);if(a>0)return ZT(e,t[a-1],r)}function aE(e,{x:t},{x:n,y:r,empty:i}){if(i)return!1;if(!t)return;let a=YT(t,n);if(a<t.length-1)return ZT(e,t[a+1],r)}function oE(e,t,{empty:n}){return n}function sE(e,t){return function(){return e.apply(null,arguments)&&t.apply(null,arguments)}}function cE(e,{channels:{fx:t,fy:n},groups:r}){return t&&n?e.map(({x:e,y:t})=>r.get(e)?.get(t)??[]):t?e.map(({x:e})=>r.get(e)??[]):e.map(({y:e})=>r.get(e)??[])}let lE=Math.PI,uE=2*lE,dE=.618;function fE({projection:e,inset:t=0,insetTop:n=t,insetRight:r=t,insetBottom:i=t,insetLeft:a=t}={},o){if(e==null)return;if(typeof e.stream==`function`)return e;let s,c,l=`frame`;if(Ax(e)){let t;if({type:e,domain:c,inset:t,insetTop:n=t===void 0?n:t,insetRight:r=t===void 0?r:t,insetBottom:i=t===void 0?i:t,insetLeft:a=t===void 0?a:t,clip:l=l,...s}=e,e==null)return}typeof e!=`function`&&({type:e}=pE(e));let{width:u,height:d,marginLeft:f,marginRight:p,marginTop:m,marginBottom:h}=o,g=u-f-p-a-r,_=d-m-h-n-i;if(e=e?.({width:g,height:_,clip:l,...s}),e==null)return;l=mE(l,f,m,u-p,d-h);let v=f+a,y=m+n,b;if(c!=null){let[[t,n],[r,i]]=Md(e).bounds(c),a=Math.min(g/(r-t),_/(i-n));a>0?(v-=(a*(t+r)-g)/2,y-=(a*(n+i)-_)/2,b=Nd({point(e,t){this.stream.point(e*a+v,t*a+y)}})):Vw(`Warning: the projection could not be fit to the specified domain; using the default scale.`)}return b??=v===0&&y===0?_E():Nd({point(e,t){this.stream.point(e+v,t+y)}}),{stream:t=>e.stream(b.stream(l(t)))}}function pE(e){switch(`${e}`.toLowerCase()){case`albers-usa`:return hE(af,.7463,.4673);case`albers`:return gE(nf,.7463,.4673);case`azimuthal-equal-area`:return hE(lf,4,4);case`azimuthal-equidistant`:return hE(df,uE,uE);case`conic-conformal`:return gE(_f,uE,uE);case`conic-equal-area`:return gE(tf,6.1702,2.9781);case`conic-equidistant`:return gE(xf,7.312,3.6282);case`equal-earth`:return hE(kf,5.4133,2.6347);case`equirectangular`:return hE(yf,uE,lE);case`gnomonic`:return hE(jf,3.4641,3.4641);case`identity`:return{type:_E};case`reflect-y`:return{type:vE};case`mercator`:return hE(pf,uE,uE);case`orthographic`:return hE(Nf,2,2);case`stereographic`:return hE(Ff,2,2);case`transverse-mercator`:return hE(Lf,uE,uE);default:throw Error(`unknown projection type: ${e}`)}}function mE(e,t,n,r,i){if(e===!1||e==null||typeof e==`number`)return e=>e;switch(e===!0&&(e=`frame`),`${e}`.toLowerCase()){case`frame`:return Cu(t,n,r,i);default:throw Error(`unknown projection clip type: ${e}`)}}function hE(e,t,n){return{type:({width:r,height:i,rotate:a,precision:o=.15,clip:s})=>{let c=e();return o!=null&&c.precision?.(o),a!=null&&c.rotate?.(a),typeof s==`number`&&c.clipAngle?.(s),r!=null&&(c.scale(Math.min(r/t,i/n)),c.translate([r/2,i/2])),c},aspectRatio:n/t}}function gE(e,t,n){let{type:r,aspectRatio:i}=hE(e,t,n);return{type:e=>{let{parallels:t,domain:n,width:i,height:a}=e,o=r(e);return t!=null&&(o.parallels(t),n===void 0&&i!=null&&o.fitSize([i,a],{type:`Sphere`})),o},aspectRatio:i}}let _E=px({stream:e=>e}),vE=px(Nd({point(e,t){this.stream.point(e,-t)}}));function yE(e,t,n,r){let i=n[e],a=n[t],o=i.length,s=n[e]=new Float64Array(o).fill(NaN),c=n[t]=new Float64Array(o).fill(NaN),l,u=r.stream({point(e,t){s[l]=e,c[l]=t}});for(l=0;l<o;++l)u.point(i[l],a[l])}function bE({projection:e}={}){return e==null?!1:typeof e.stream==`function`||(Ax(e)&&(e=e.type),e!=null)}function xE(e){if(typeof e?.stream==`function`)return dE;if(Ax(e)){let t,n;if({domain:t,type:e,...n}=e,t!=null&&e!=null){let[[r,i],[a,o]]=Md((typeof e==`string`?pE(e).type:e)({...n,width:100,height:100})).bounds(t),s=(o-i)/(a-r);return s&&isFinite(s)?s<.2?.2:s>5?5:s:dE}}if(e!=null){if(typeof e!=`function`){let{aspectRatio:t}=pE(e);if(t)return t}return dE}}function SE(e,t,{projection:n}){let{x:r,y:i}=e,a={};return r&&(a.x=r),i&&(a.y=i),a=VC(a,t),n&&r?.scale===`x`&&i?.scale===`y`&&yE(`x`,`y`,a,n),r&&(a.x=hx(a.x)),i&&(a.y=hx(a.y)),a}function CE(e){let t=[],n=[],r={scale:`x`,value:t},i={scale:`y`,value:n},a={point(e,r){t.push(e),n.push(r)},lineStart(){},lineEnd(){},polygonStart(){},polygonEnd(){},sphere(){}};for(let t of e.value)ml(t,a);return[r,i]}function wE({x:e,y:t}){if(e||t)return e??=e=>e,t??=e=>e,Nd({point(n,r){this.stream.point(e(n),t(r))}})}function TE(e={}){let{document:t=typeof window<`u`?window.document:void 0,clip:n}=e;return{document:t,clip:CS(n)}}function J(e,{document:t}){return vr(Ct(e).call(t.documentElement))}let EE=Symbol(`unset`);function DE(e){return(e.length===1?OE:kE)(e)}function OE(e){let t,n=EE;return r=>(Object.is(n,r)||(n=r,t=e(r)),t)}function kE(e){let t,n;return(...r)=>((n?.length!==r.length||n.some((e,t)=>!Object.is(e,r[t])))&&(n=r,t=e(...r)),t)}let AE=DE(e=>new Intl.NumberFormat(e)),jE=DE((e,t)=>new Intl.DateTimeFormat(e,{timeZone:`UTC`,...t&&{month:t}})),ME=DE((e,t)=>new Intl.DateTimeFormat(e,{timeZone:`UTC`,...t&&{weekday:t}}));function NE(e=`en-US`){let t=AE(e);return e=>e!=null&&!isNaN(e)?t.format(e):void 0}function PE(e=`en-US`,t=`short`){let n=jE(e,t);return e=>e!=null&&!isNaN(e=+new Date(Date.UTC(2e3,+e)))?n.format(e):void 0}function FE(e=`en-US`,t=`short`){let n=ME(e,t);return e=>e!=null&&!isNaN(e=+new Date(Date.UTC(2001,0,+e)))?n.format(e):void 0}function IE(e){return pb(e,`Invalid Date`)}function LE(e=`en-US`){let t=NE(e);return e=>(e instanceof Date?IE:typeof e==`number`?t:lx)(e)}let RE=LE(),zE=(typeof window<`u`?window.devicePixelRatio>1:typeof it>`u`)?0:.5,BE=0,VE=0;function HE(){return`plot-clip-${++BE}`}function UE(){return`plot-pattern-${++VE}`}function WE(e,{title:t,href:n,ariaLabel:r,ariaDescription:i,ariaHidden:a,target:o,fill:s,fillOpacity:c,stroke:l,strokeWidth:u,strokeOpacity:d,strokeLinejoin:f,strokeLinecap:p,strokeMiterlimit:m,strokeDasharray:h,strokeDashoffset:g,opacity:_,mixBlendMode:v,imageFilter:y,paintOrder:b,pointerEvents:x,shapeRendering:S,channels:C},{ariaLabel:w,fill:T=`currentColor`,fillOpacity:E,stroke:D=`none`,strokeOpacity:O,strokeWidth:k,strokeLinecap:A,strokeLinejoin:ee,strokeMiterlimit:te,paintOrder:ne}){T===null&&(s=null,c=null),D===null&&(l=null,d=null),K(T)?!K(D)&&(!K(s)||C?.fill)&&(D=`none`):K(D)&&(!K(l)||C?.stroke)&&(T=`none`);let[re,j]=yx(s,T),[ie,ae]=bx(c,E),[oe,se]=yx(l,D),[ce,le]=bx(d,O),[ue,de]=bx(_);gS(se)||(u===void 0&&(u=k),p===void 0&&(p=A),f===void 0&&(f=ee),m===void 0&&!_S(f)&&(m=te),!gS(j)&&b===void 0&&(b=ne));let[fe,pe]=bx(u);return T!==null&&(e.fill=cD(j,`currentColor`),e.fillOpacity=lD(ae,1)),D!==null&&(e.stroke=cD(se,`none`),e.strokeWidth=lD(pe,1),e.strokeOpacity=lD(le,1),e.strokeLinejoin=cD(f,`miter`),e.strokeLinecap=cD(p,`butt`),e.strokeMiterlimit=lD(m,4),e.strokeDasharray=cD(h,`none`),e.strokeDashoffset=cD(g,`0`)),e.target=lx(o),e.ariaLabel=lx(w),e.ariaDescription=lx(i),e.ariaHidden=lx(a),e.opacity=lD(de,1),e.mixBlendMode=cD(v,`normal`),e.imageFilter=cD(y,`none`),e.paintOrder=cD(b,`normal`),e.pointerEvents=cD(x,`auto`),e.shapeRendering=cD(S,`auto`),{title:{value:t,optional:!0,filter:null},href:{value:n,optional:!0,filter:null},ariaLabel:{value:r,optional:!0,filter:null},fill:{value:re,scale:`auto`,optional:!0},fillOpacity:{value:ie,scale:`auto`,optional:!0},stroke:{value:oe,scale:`auto`,optional:!0},strokeOpacity:{value:ce,scale:`auto`,optional:!0},strokeWidth:{value:fe,optional:!0},opacity:{value:ue,scale:`auto`,optional:!0}}}function GE(e,t){t&&e.filter(e=>lb(t[e])).append(`title`).call(qE,t)}function KE(e,t){t&&e.filter(([e])=>lb(t[e])).append(`title`).call(JE,t)}function qE(e,t){t&&e.text(e=>RE(t[e]))}function JE(e,t){t&&e.text(([e])=>RE(t[e]))}function YE(e,{target:t,tip:n},{ariaLabel:r,title:i,fill:a,fillOpacity:o,stroke:s,strokeOpacity:c,strokeWidth:l,opacity:u,href:d}){r&&Z(e,`aria-label`,e=>r[e]),a&&Z(e,`fill`,e=>a[e]),o&&Z(e,`fill-opacity`,e=>o[e]),s&&Z(e,`stroke`,e=>s[e]),c&&Z(e,`stroke-opacity`,e=>c[e]),l&&Z(e,`stroke-width`,e=>l[e]),u&&Z(e,`opacity`,e=>u[e]),d&&oD(e,e=>d[e],t),n||GE(e,i)}function XE(e,{target:t,tip:n},{ariaLabel:r,title:i,fill:a,fillOpacity:o,stroke:s,strokeOpacity:c,strokeWidth:l,opacity:u,href:d}){r&&Z(e,`aria-label`,([e])=>r[e]),a&&Z(e,`fill`,([e])=>a[e]),o&&Z(e,`fill-opacity`,([e])=>o[e]),s&&Z(e,`stroke`,([e])=>s[e]),c&&Z(e,`stroke-opacity`,([e])=>c[e]),l&&Z(e,`stroke-width`,([e])=>l[e]),u&&Z(e,`opacity`,([e])=>u[e]),d&&oD(e,([e])=>d[e],t),n||KE(e,i)}function ZE({ariaLabel:e,title:t,fill:n,fillOpacity:r,stroke:i,strokeOpacity:a,strokeWidth:o,opacity:s,href:c},{tip:l}){return[e,l?void 0:t,n,r,i,a,o,s,c].filter(e=>e!==void 0)}function QE(e,t,n){let r=fe(e,e=>t[e]);return n===void 0&&r.size>1+e.length>>1&&Vw(`Warning: the implicit z channel has high cardinality. This may occur when the fill or stroke channel is associated with quantitative data rather than ordinal or categorical data. You can suppress this warning by setting the z option explicitly; if this data represents a single series, set z to null.`),r.values()}function*$E(e,t,n,r){let{z:i}=n,{z:a}=r,o=ZE(r,n),s=[...t,...o];for(let t of a?QE(e,a,i):[e]){let e,n;out:for(let r of t){for(let e of s)if(!ob(e[r])){n&&n.push(-1);continue out}if(e===void 0)n&&(yield n),e=o.map(e=>Hx(e[r])),n=[r];else{n.push(r);for(let t=0;t<o.length;++t)if(Hx(o[t][r])!==e[t]){yield n,e=o.map(e=>Hx(e[r])),n=[r];continue out}}}n&&(yield n)}}function eD(e,t,n,r){let i,{clip:a=r.clip}=t;a===`frame`?(e=J(`svg:g`,r).each(function(){this.appendChild(e.node()),e.node=()=>this}),i=nD(r,n)):a&&(i=aD(a,r)),Z(e,`aria-label`,t.ariaLabel),Z(e,`aria-description`,t.ariaDescription),Z(e,`aria-hidden`,t.ariaHidden),Z(e,`clip-path`,i)}function tD(e){let t=/* @__PURE__ */ new WeakMap;return(n,r)=>{let i=t.get(n);if(!i){let a=HE();vr(n.ownerSVGElement).append(`clipPath`).attr(`id`,a).call(e,n,r),t.set(n,i=`url(#${a})`)}return i}}let nD=tD((e,t,n)=>{let{width:r,height:i,marginLeft:a,marginRight:o,marginTop:s,marginBottom:c}=n;e.append(`rect`).attr(`x`,a).attr(`y`,s).attr(`width`,r-o-a).attr(`height`,i-s-c)}),rD=/* @__PURE__ */ new WeakMap,iD={type:`Sphere`};function aD(e,t){let n,r;if((n=rD.get(t))||rD.set(t,n=/* @__PURE__ */ new WeakMap),e.type===`Sphere`&&(e=iD),!(r=n.get(e))){let i=HE();vr(t.ownerSVGElement).append(`clipPath`).attr(`id`,i).append(`path`).attr(`d`,t.path()(e)),n.set(e,r=`url(#${i})`)}return r}function Y(e,t,n,r){eD(e,t,n,r),Z(e,`class`,t.className),Z(e,`fill`,t.fill),Z(e,`fill-opacity`,t.fillOpacity),Z(e,`stroke`,t.stroke),Z(e,`stroke-width`,t.strokeWidth),Z(e,`stroke-opacity`,t.strokeOpacity),Z(e,`stroke-linejoin`,t.strokeLinejoin),Z(e,`stroke-linecap`,t.strokeLinecap),Z(e,`stroke-miterlimit`,t.strokeMiterlimit),Z(e,`stroke-dasharray`,t.strokeDasharray),Z(e,`stroke-dashoffset`,t.strokeDashoffset),Z(e,`shape-rendering`,t.shapeRendering),Z(e,`filter`,t.imageFilter),Z(e,`paint-order`,t.paintOrder);let{pointerEvents:i=r.pointerSticky===!1?`none`:void 0}=t;Z(e,`pointer-events`,i)}function X(e,t){sD(e,`mix-blend-mode`,t.mixBlendMode),Z(e,`opacity`,t.opacity)}function oD(e,t,n){e.each(function(e){let r=t(e);if(r!=null){let e=this.ownerDocument.createElementNS(yt.svg,`a`);e.setAttribute(`fill`,`inherit`),e.setAttributeNS(yt.xlink,`href`,r),n!=null&&e.setAttribute(`target`,n),this.parentNode.insertBefore(e,this).appendChild(this)}})}function Z(e,t,n){n!=null&&e.attr(t,n)}function sD(e,t,n){n!=null&&e.style(t,n)}function Q(e,t,{x:n,y:r},i=zE,a=zE){i+=t.dx,a+=t.dy,n?.bandwidth&&(i+=n.bandwidth()/2),r?.bandwidth&&(a+=r.bandwidth()/2),(i||a)&&e.attr(`transform`,`translate(${i},${a})`)}function cD(e,t){if((e=lx(e))!==t)return e}function lD(e,t){if((e=W(e))!==t)return e}let uD=/^-?([_a-z]|[\240-\377]|\\[0-9a-f]{1,6}(\r\n|[ \t\r\n\f])?|\\[^\r\n\f0-9a-f])([_a-z0-9-]|[\240-\377]|\\[0-9a-f]{1,6}(\r\n|[ \t\r\n\f])?|\\[^\r\n\f0-9a-f])*$/i;function dD(e){if(e===void 0)return`plot-d6a7b5`;if(e=`${e}`,!uD.test(e))throw Error(`invalid class name: ${e}`);return e}function fD(e,t){if(typeof t==`string`)e.property(`style`,t);else if(t!=null)for(let n of e)Object.assign(n.style,t)}function pD({frameAnchor:e},{width:t,height:n,marginTop:r,marginRight:i,marginBottom:a,marginLeft:o}){return[/left$/.test(e)?o:/right$/.test(e)?t-i:(o+t-i)/2,/^top/.test(e)?r:/^bottom/.test(e)?n-a:(r+n-a)/2]}var $=class{constructor(e,t={},n={},r){let{facet:i=`auto`,facetAnchor:a,fx:o,fy:s,sort:c,dx:l=0,dy:u=0,margin:d=0,marginTop:f=d,marginRight:p=d,marginBottom:m=d,marginLeft:h=d,className:g,clip:_=r?.clip,channels:v,tip:y,render:b}=n;if(this.data=e,this.sort=Nx(c)?c:null,this.initializer=WS(n).initializer,this.transform=this.initializer?n.transform:US(n).transform,i===null||i===!1?this.facet=null:(this.facet=Sx(i===!0?`include`:i,`facet`,[`auto`,`include`,`exclude`,`super`]),this.fx=e===ix&&typeof o==`string`?[o]:o,this.fy=e===ix&&typeof s==`string`?[s]:s),this.facetAnchor=KT(a),t=SS(t),v!==void 0&&(t={...gD(v),...t}),r!==void 0&&(t={...WE(this,n,r),...t}),this.channels=Object.fromEntries(Object.entries(t).map(([t,n])=>{if(Mx(n.value)){let{value:e,label:t=n.label,scale:r=n.scale}=n.value;n={...n,label:t,scale:r,value:e}}if(e===ix&&typeof n.value==`string`){let{value:e}=n;n={...n,value:[e]}}return[t,n]}).filter(([e,{value:t,optional:n}])=>{if(t!=null)return!0;if(n)return!1;throw Error(`missing channel value: ${e}`)})),this.dx=+l,this.dy=+u,this.marginTop=+f,this.marginRight=+p,this.marginBottom=+m,this.marginLeft=+h,this.clip=CS(_),this.tip=_D(y),this.className=lx(g),this.facet===`super`){if(o||s)throw Error(`super-faceting cannot use fx or fy`);for(let e in this.channels){let{scale:n}=t[e];if(n===`x`||n===`y`)throw Error(`super-faceting cannot use x or y`)}}b!=null&&(this.render=hD(b,this.render))}initialize(e,t,n){let r=Cx(this.data);e===void 0&&r!=null&&(e=[Rx(r)]);let i=e;this.transform!=null&&({facets:e,data:r}=this.transform(r,e,n),r=Cx(r)),e!==void 0&&(e.original=i);let a=BC(this.channels,r);return this.sort!=null&&UC(r,e,a,t,this.sort),{data:r,facets:e,channels:a}}filter(e,t,n){for(let r in t){let{filter:i=ob}=t[r];if(i!==null){let t=n[r];e=e.filter(e=>i(t[e]))}}return e}project(e,t,n){for(let r in e)if(e[r].scale===`x`&&/^x|x$/.test(r)){let i=r.replace(/^x|x$/,`y`);i in e&&e[i].scale===`y`&&yE(r,i,t,n.projection)}}scale(e,t,n){let r=VC(e,t);return n.projection&&this.project(e,r,n),r}};function mD(...e){return e.plot=$.prototype.plot,e}function hD(e,t){if(e==null)return t===null?void 0:t;if(t==null)return e===null?void 0:e;if(typeof e!=`function`)throw TypeError(`invalid render transform: ${e}`);if(typeof t!=`function`)throw TypeError(`invalid render transform: ${t}`);return function(n,r,i,a,o,s){return e.call(this,n,r,i,a,o,(e,n,r,i,a)=>t.call(this,e,n,r,i,a,s))}}function gD(e){return Object.fromEntries(Object.entries(SS(e)).map(([e,t])=>(t=typeof t==`string`?{value:t,label:e}:nS(t),t.filter===void 0&&t.scale==null&&(t={...t,filter:null}),[e,t])))}function _D(e){return e===!0?`xy`:e===!1||e==null?null:typeof e==`string`?Sx(e,`tip`,[`x`,`y`,`xy`]):e}function vD(e,t){return e?.tip===!0?{...e,tip:t}:Ax(e?.tip)&&e.tip.pointer===void 0?{...e,tip:{...e.tip,pointer:t}}:e}function yD(e,t,n={}){let r=.5-zE,i=.5+zE,a=.5+zE,o=.5-zE;for(let{marginTop:e,marginRight:n,marginBottom:s,marginLeft:c}of t)e>r&&(r=e),n>i&&(i=n),s>a&&(a=s),c>o&&(o=c);let{margin:s,marginTop:c=s===void 0?r:s,marginRight:l=s===void 0?i:s,marginBottom:u=s===void 0?a:s,marginLeft:d=s===void 0?o:s}=n;c=+c,l=+l,u=+u,d=+d;let{width:f=640,height:p=bD(e,n,{width:f,marginTopDefault:r,marginRightDefault:i,marginBottomDefault:a,marginLeftDefault:o})+Math.max(0,c-r+u-a)}=n;f=+f,p=+p;let m={width:f,height:p,marginTop:c,marginRight:l,marginBottom:u,marginLeft:d};if(e.fx||e.fy){let{margin:e,marginTop:t=e===void 0?c:e,marginRight:r=e===void 0?l:e,marginBottom:i=e===void 0?u:e,marginLeft:a=e===void 0?d:e}=n.facet??{};t=+t,r=+r,i=+i,a=+a,m.facet={marginTop:t,marginRight:r,marginBottom:i,marginLeft:a}}return m}function bD({x:e,y:t,fy:n,fx:r},{projection:i,aspectRatio:a},{width:o,marginTopDefault:s,marginRightDefault:c,marginBottomDefault:l,marginLeftDefault:u}){let d=n&&n.scale.domain().length||1,f=xE(i);if(f){let e=r?r.scale.domain().length:1,t=(1.1*d-.1)/(1.1*e-.1)*f,n=Math.max(.1,Math.min(10,t));return Math.round((o-u-c)*n+s+l)}let p=t?jT(t)?t.scale.domain().length||1:Math.max(7,17/d):1;if(a!=null){if(a=+a,!(isFinite(a)&&a>0))throw Error(`invalid aspectRatio: ${a}`);let i=xD(`y`,t)/(xD(`x`,e)*a),d=r?r.scale.bandwidth():1,f=n?n.scale.bandwidth():1;return(i*(d*(o-u-c)-e.insetLeft-e.insetRight)+t.insetTop+t.insetBottom)/f+s+l}return!!(t||n)*Math.max(1,Math.min(60,p*d))*20+!!r*30+60}function xD(e,t){if(!t)throw Error(`aspectRatio requires ${e} scale`);let{type:n,domain:r}=t,i;switch(n){case`linear`:case`utc`:case`time`:i=Number;break;case`pow`:{let e=t.scale.exponent();i=t=>t**+e;break}case`log`:i=Math.log;break;case`point`:case`band`:return r.length;default:throw Error(`unsupported ${e} scale for aspectRatio: ${n}`)}let[a,o]=j(r);return Math.abs(i(o)-i(a))}let SD=/* @__PURE__ */ new WeakMap;function CD(e,t,{x:n,y:r,px:i,py:a,maxRadius:o=40,channels:s,render:c,...l}={}){return o=+o,i!=null&&(n??=null,s={...s,px:{value:i,scale:`x`}}),a!=null&&(r??=null,s={...s,py:{value:a,scale:`y`}}),{x:n,y:r,channels:s,...l,render:hD(function(n,r,i,a,s,c){s={...s,pointerSticky:!1};let l=s.ownerSVGElement,{data:u}=s.getMarkState(this),d=SD.get(l);d||SD.set(l,d={sticky:!1,roots:[],renders:[]});let f=d.renders.push(te)-1,{x:p,y:m,fx:h,fy:g}=r,_=h?h(n.fx)-a.marginLeft:0,v=g?g(n.fy)-a.marginTop:0;p?.bandwidth&&(_+=p.bandwidth()/2),m?.bandwidth&&(v+=m.bandwidth()/2);let y=n.fi!=null,b;if(y){let e=d.facetStates;e||(d.facetStates=e=/* @__PURE__ */ new Map),b=e.get(this),b||e.set(this,b=/* @__PURE__ */ new Map)}let[x,S]=pD(this,a),{px:C,py:w}=i,T=C?e=>C[e]:DD(i,x),E=w?e=>w[e]:OD(i,S),D,O,k,A;function ee(e,t){if(y){if(A&&=cancelAnimationFrame(A),e==null)b.delete(n.fi);else{b.set(n.fi,t),A=requestAnimationFrame(()=>{A=null;for(let[r,i]of b)if(i<t||i===t&&r<n.fi){e=null;break}te(e)});return}}te(e)}function te(e){if(D===e&&k===d.sticky)return;D=e,k=s.pointerSticky=d.sticky;let t=D==null?[]:[D];y&&(t.fx=n.fx,t.fy=n.fy,t.fi=n.fi);let o=c(t,r,i,a,s);if(O){if(y){let e=O.parentNode,t=O.getAttribute(`transform`),n=o.getAttribute(`transform`);t?o.setAttribute(`transform`,t):o.removeAttribute(`transform`),n?e.setAttribute(`transform`,n):e.removeAttribute(`transform`),o.removeAttribute(`aria-label`),o.removeAttribute(`aria-description`),o.removeAttribute(`aria-hidden`)}O.replaceWith(o)}if(d.roots[f]=O=o,!(D==null&&b?.size>1)){let e=D==null?null:qb(u)?u[D]:u.get(D);s.dispatchValue(e)}return o}function ne(r){if(d.sticky||r.pointerType===`mouse`&&r.buttons===1)return;let[i,s]=br(r);i-=_,s-=v;let c=i<a.marginLeft||i>a.width-a.marginRight?1:e,l=s<a.marginTop||s>a.height-a.marginBottom?1:t,u=null,f=o*o;for(let e of n){let t=c*(T(e)-i),n=l*(E(e)-s),r=t*t+n*n;r<=f&&(u=e,f=r)}if(u!=null&&(e!==1||t!==1)){let e=T(u)-i,t=E(u)-s;f=e*e+t*t}ee(u,f)}function re(e){e.pointerType===`mouse`&&D!=null&&(d.sticky&&d.roots.some(t=>t?.contains(e.target))||(d.sticky?(d.sticky=!1,d.renders.forEach(e=>e(null))):(d.sticky=!0,te(D)),e.stopImmediatePropagation()))}function j(e){e.pointerType===`mouse`&&(d.sticky||ee(null))}return l.addEventListener(`pointerenter`,ne),l.addEventListener(`pointermove`,ne),l.addEventListener(`pointerdown`,re),l.addEventListener(`pointerleave`,j),te(null)},c)}}function wD(e){return CD(1,1,e)}function TD(e){return CD(1,.01,e)}function ED(e){return CD(.01,1,e)}function DD({x1:e,x2:t,x:n=e},r){return e&&t?n=>(e[n]+t[n])/2:n?e=>n[e]:()=>r}function OD({y1:e,y2:t,y:n=e},r){return e&&t?n=>(e[n]+t[n])/2:n?e=>n[e]:()=>r}function kD(e){return jT(e)&&e.interval===void 0?void 0:`tabular-nums`}function AD(e,t){let{label:n=e.label,tickSize:r=6,width:i=240,height:a=44+r,marginTop:o=18,marginRight:s=0,marginBottom:c=16+r,marginLeft:l=0,style:u,ticks:d=(i-l-s)/64,tickFormat:f,fontVariant:p=kD(e),round:m=!0,opacity:h,className:g}=t,_=TE(t);g=dD(g),h=bx(h)[1],f===null&&(f=()=>null);let v=J(`svg`,_).attr(`class`,`${g}-ramp`).attr(`font-family`,`system-ui, sans-serif`).attr(`font-size`,10).attr(`width`,i).attr(`height`,a).attr(`viewBox`,`0 0 ${i} ${a}`).call(e=>e.append(`style`).text(`:where(.${g}-ramp) {
3
+ display: block;
4
+ height: auto;
5
+ height: intrinsic;
6
+ max-width: 100%;
7
+ overflow: visible;
8
+ }
9
+ :where(.${g}-ramp text) {
10
+ white-space: pre;
11
+ }`)).call(fD,u),y=e=>e.selectAll(`.tick line`).attr(`y1`,o+c-a),b,x=m?(e,t)=>e.rangeRound(t):(e,t)=>e.range(t),{type:S,domain:C,range:w,interpolate:T,scale:E,pivot:D}=e;if(T){let e=w===void 0?T:xa(T.length===1?Lw(T):T,w);b=x(E.copy(),Sa(Xi(l,i-s),Math.min(C.length+(D!==void 0),w===void 0?1/0:w.length)));let t=_.document.createElement(`canvas`);t.width=256,t.height=1;let n=t.getContext(`2d`);for(let t=0;t<256;++t)n.fillStyle=e(t/255),n.fillRect(t,0,1,1);v.append(`image`).attr(`opacity`,h).attr(`x`,l).attr(`y`,o).attr(`width`,i-l-s).attr(`height`,a-o-c).attr(`preserveAspectRatio`,`none`).attr(`xlink:href`,t.toDataURL())}else if(S===`threshold`){let e=C,t=f===void 0?e=>e:typeof f==`string`?Bc(f):f;b=x(nm().domain([-1,w.length-1]),[l,i-s]),v.append(`g`).attr(`fill-opacity`,h).selectAll().data(w).enter().append(`rect`).attr(`x`,(e,t)=>b(t-1)).attr(`y`,o).attr(`width`,(e,t)=>b(t)-b(t-1)).attr(`height`,a-o-c).attr(`fill`,e=>e),d=G(e,(e,t)=>t),f=n=>t(e[n],n)}else b=x(Bp().domain(C),[l,i-s]),v.append(`g`).attr(`fill-opacity`,h).selectAll().data(C).enter().append(`rect`).attr(`x`,b).attr(`y`,o).attr(`width`,Math.max(0,b.bandwidth()-1)).attr(`height`,a-o-c).attr(`fill`,E),y=()=>{};return v.append(`g`).attr(`transform`,`translate(0,${a-c})`).call(ft(b).ticks(Array.isArray(d)?null:d,typeof f==`string`?f:void 0).tickFormat(typeof f==`function`?f:void 0).tickSize(r).tickValues(Array.isArray(d)?d:null)).attr(`font-size`,null).attr(`font-family`,null).attr(`font-variant`,cD(p,`normal`)).call(y).call(e=>e.select(`.domain`).remove()),n!==void 0&&v.append(`text`).attr(`x`,l).attr(`y`,o-6).attr(`fill`,`currentColor`).attr(`font-weight`,`bold`).text(n),v.node()}let jD=Math.PI/180;function MD(e,{marker:t,markerStart:n=t,markerMid:r=t,markerEnd:i=t}={}){e.markerStart=ND(n),e.markerMid=ND(r),e.markerEnd=ND(i)}function ND(e){if(e==null||e===!1)return null;if(e===!0)return ID;if(typeof e==`function`)return e;switch(`${e}`.toLowerCase()){case`none`:return null;case`arrow`:return PD(`auto`);case`arrow-reverse`:return PD(`auto-start-reverse`);case`dot`:return FD;case`circle`:case`circle-fill`:return ID;case`circle-stroke`:return LD;case`tick`:return RD(`auto`);case`tick-x`:return RD(90);case`tick-y`:return RD(0)}throw Error(`invalid marker: ${e}`)}function PD(e){return(t,n)=>J(`svg:marker`,n).attr(`viewBox`,`-5 -5 10 10`).attr(`markerWidth`,6.67).attr(`markerHeight`,6.67).attr(`orient`,e).attr(`fill`,`none`).attr(`stroke`,t).attr(`stroke-width`,1.5).attr(`stroke-linecap`,`round`).attr(`stroke-linejoin`,`round`).call(e=>e.append(`path`).attr(`d`,`M-1.5,-3l3,3l-3,3`)).node()}function FD(e,t){return J(`svg:marker`,t).attr(`viewBox`,`-5 -5 10 10`).attr(`markerWidth`,6.67).attr(`markerHeight`,6.67).attr(`fill`,e).attr(`stroke`,`none`).call(e=>e.append(`circle`).attr(`r`,2.5)).node()}function ID(e,t){return J(`svg:marker`,t).attr(`viewBox`,`-5 -5 10 10`).attr(`markerWidth`,6.67).attr(`markerHeight`,6.67).attr(`fill`,e).attr(`stroke`,`var(--plot-background)`).attr(`stroke-width`,1.5).call(e=>e.append(`circle`).attr(`r`,3)).node()}function LD(e,t){return J(`svg:marker`,t).attr(`viewBox`,`-5 -5 10 10`).attr(`markerWidth`,6.67).attr(`markerHeight`,6.67).attr(`fill`,`var(--plot-background)`).attr(`stroke`,e).attr(`stroke-width`,1.5).call(e=>e.append(`circle`).attr(`r`,3)).node()}function RD(e){return(t,n)=>J(`svg:marker`,n).attr(`viewBox`,`-3 -3 6 6`).attr(`markerWidth`,6).attr(`markerHeight`,6).attr(`orient`,e).attr(`stroke`,t).call(e=>e.append(`path`).attr(`d`,`M0,-3v6`)).node()}let zD=0;function BD(e,t,{stroke:n},r){return UD(e,t,n&&(e=>n[e]),null,r)}function VD(e,t,{stroke:n,z:r},i){return UD(e,t,n&&(([e])=>n[e]),r,i)}function HD(e,t){let n=new Uint8Array(t.length),r=e.data().filter(e=>e.length>1),i=r.length;for(let e=0,a=EE;e<i;++e){let i=r[e];if(i.length>1){let e=i[0];a!==(a=Hx(t[e]))&&(n[e]|=1)}}for(let e=i-1,a=EE;e>=0;--e){let i=r[e];if(i.length>1){let e=i[0];a!==(a=Hx(t[e]))&&(n[e]|=2)}}return([e])=>n[e]}function UD(e,{markerStart:t,markerMid:n,markerEnd:r,stroke:i},a=()=>i,o,s){if(!t&&!n&&!r)return;let c=/* @__PURE__ */ new Map,l=o&&HD(e,o);function u(e,t,n){return function(r){if(n&&!n(r))return;let i=a(r),o=c.get(t);o||c.set(t,o=/* @__PURE__ */ new Map);let l=o.get(i);if(!l){let e=this.parentNode.insertBefore(t(i,s),this),n=`plot-marker-${++zD}`;e.setAttribute(`id`,n),o.set(i,l=`url(#${n})`)}this.setAttribute(e,l)}}t&&e.each(u(`marker-start`,t,l&&(e=>l(e)&1))),n&&l&&e.each(u(`marker-start`,n,e=>!(l(e)&1))),n&&e.each(u(`marker-mid`,n)),r&&e.each(u(`marker-end`,r,l&&(e=>l(e)&2)))}function WD({inset:e,insetLeft:t,insetRight:n,...r}={}){return[t,n]=KD(e,t,n),{inset:e,insetLeft:t,insetRight:n,...r}}function GD({inset:e,insetTop:t,insetBottom:n,...r}={}){return[t,n]=KD(e,t,n),{inset:e,insetTop:t,insetBottom:n,...r}}function KD(e,t,n){return e===void 0&&t===void 0&&n===void 0?zE?[1,0]:[.5,.5]:[t,n]}function qD(e,{interval:t}){return e={...nS(e)},e.interval=Xx(e.interval===void 0?t:e.interval),e}function JD(e,t,n,r){let{[e]:i,[`${e}1`]:a,[`${e}2`]:o}=n,{value:s,interval:c}=qD(i,n);if(s==null||c==null&&!r)return n;let l=Kx(i);if(c==null){let t,i={transform:e=>t||=H(e,s),label:l};return{...n,[e]:void 0,[`${e}1`]:a===void 0?i:a,[`${e}2`]:o===void 0&&!(a===o&&r)?i:o}}let u,d;function f(e){return d!==void 0&&e===u?d:d=G(H(u=e,s),e=>c.floor(e))}return t({...n,[e]:void 0,[`${e}1`]:a===void 0?{transform:f,label:l}:a,[`${e}2`]:o===void 0?{transform:e=>f(e).map(e=>c.offset(e)),label:l}:o})}function YD(e,t,n){let{[e]:r}=n,{value:i,interval:a}=qD(r,n);return i==null||a==null?n:t({...n,[e]:{label:Kx(r),transform:e=>{let t=G(H(e,i),e=>a.floor(e)),n=t.map(e=>a.offset(e));return t.map(cS(t)?(e,t)=>e==null||isNaN(e=+e)||(t=n[t],t==null)||isNaN(t=+t)?void 0:/* @__PURE__ */ new Date((e+t)/2):(e,t)=>e==null||(t=n[t],t==null)?NaN:(+e+ +t)/2)}}})}function XD(e={}){return JD(`x`,WD,e,!0)}function ZD(e={}){return JD(`y`,GD,e,!0)}function QD(e={}){return JD(`x`,WD,e)}function $D(e={}){return JD(`y`,GD,e)}function eO(e={}){return YD(`x`,WD,e)}function tO(e={}){return YD(`y`,GD,e)}let nO={ariaLabel:`rule`,fill:null,stroke:`currentColor`};var rO=class extends ${constructor(e,t={}){let{x:n,y1:r,y2:i,inset:a=0,insetTop:o=a,insetBottom:s=a}=t;super(e,{x:{value:n,scale:`x`,optional:!0},y1:{value:r,scale:`y`,optional:!0},y2:{value:i,scale:`y`,optional:!0}},vD(t,`x`),nO),this.insetTop=W(o),this.insetBottom=W(s),MD(this,t)}render(e,t,n,r,i){let{x:a,y:o}=t,{x:s,y1:c,y2:l}=n,{width:u,height:d,marginTop:f,marginRight:p,marginLeft:m,marginBottom:h}=r,{insetTop:g,insetBottom:_}=this;return J(`svg:g`,i).call(Y,this,r,i).call(Q,this,{x:s&&a},zE,0).call(t=>t.selectAll().data(e).enter().append(`line`).call(X,this).attr(`x1`,s?e=>s[e]:(m+u-p)/2).attr(`x2`,s?e=>s[e]:(m+u-p)/2).attr(`y1`,c&&!PT(o)?e=>c[e]+g:f+g).attr(`y2`,l&&!PT(o)?o.bandwidth?e=>l[e]+o.bandwidth()-_:e=>l[e]-_:d-h-_).call(YE,this,n).call(BD,this,n,i)).node()}},iO=class extends ${constructor(e,t={}){let{x1:n,x2:r,y:i,inset:a=0,insetRight:o=a,insetLeft:s=a}=t;super(e,{y:{value:i,scale:`y`,optional:!0},x1:{value:n,scale:`x`,optional:!0},x2:{value:r,scale:`x`,optional:!0}},vD(t,`y`),nO),this.insetRight=W(o),this.insetLeft=W(s),MD(this,t)}render(e,t,n,r,i){let{x:a,y:o}=t,{y:s,x1:c,x2:l}=n,{width:u,height:d,marginTop:f,marginRight:p,marginLeft:m,marginBottom:h}=r,{insetLeft:g,insetRight:_}=this;return J(`svg:g`,i).call(Y,this,r,i).call(Q,this,{y:s&&o},0,zE).call(t=>t.selectAll().data(e).enter().append(`line`).call(X,this).attr(`x1`,c&&!PT(a)?e=>c[e]+g:m+g).attr(`x2`,l&&!PT(a)?a.bandwidth?e=>l[e]+a.bandwidth()-_:e=>l[e]-_:u-p-_).attr(`y1`,s?e=>s[e]:(f+d-h)/2).attr(`y2`,s?e=>s[e]:(f+d-h)/2).call(YE,this,n).call(BD,this,n,i)).node()}};function aO(e,t){let{x:n=U,y:r,y1:i,y2:a,...o}=$D(t);return[i,a]=sO(r,i,a),new rO(e,{...o,x:n,y1:i,y2:a})}function oO(e,t){let{y:n=U,x:r,x1:i,x2:a,...o}=QD(t);return[i,a]=sO(r,i,a),new iO(e,{...o,y:n,x1:i,x2:a})}function sO(e,t,n){if(e==null){if(t===void 0){if(n!==void 0)return[0,n]}else if(n===void 0)return[0,t]}else if(t===void 0)return n===void 0?[0,e]:[e,n];else if(n===void 0)return[e,t];return[t,n]}function cO(e,...t){let n=t.length;for(let r=0,i=!0;r<n;++r)typeof t[r]!=`function`&&(i&&=(e=e.slice(),!1),e.splice(r,2,e[r]+t[r]+e[r+1]),t.splice(r,1),--r,--n);return r=>{let i=e[0];for(let a=0;a<n;++a)i+=t[a](r)+e[a+1];return i}}let lO={ariaLabel:`text`,strokeLinejoin:`round`,strokeWidth:3,paintOrder:`stroke`};var uO=class extends ${constructor(e,t={}){let{x:n,y:r,text:i=aS(e)&&oS(e)?U:ox,frameAnchor:a,textAnchor:o=/right$/i.test(a)?`end`:/left$/i.test(a)?`start`:`middle`,lineAnchor:s=/^top/i.test(a)?`top`:/^bottom/i.test(a)?`bottom`:`middle`,lineHeight:c=1,lineWidth:l=1/0,textOverflow:u,monospace:d,fontFamily:f=d?`ui-monospace, monospace`:void 0,fontSize:p,fontStyle:m,fontVariant:h,fontWeight:g,rotate:_}=t,[v,y]=bx(_,0),[b,x]=yO(p);if(super(e,{x:{value:n,scale:`x`,optional:!0},y:{value:r,scale:`y`,optional:!0},fontSize:{value:b,optional:!0},rotate:{value:rS(v),optional:!0},text:{value:i,filter:lb,optional:!0}},t,lO),this.rotate=y,this.textAnchor=cD(o,`middle`),this.lineAnchor=Sx(s,`lineAnchor`,[`top`,`middle`,`bottom`]),this.lineHeight=+c,this.lineWidth=+l,this.textOverflow=dO(u),this.monospace=!!d,this.fontFamily=lx(f),this.fontSize=x,this.fontStyle=lx(m),this.fontVariant=lx(h),this.fontWeight=lx(g),this.frameAnchor=yS(a),!(this.lineWidth>=0))throw Error(`invalid lineWidth: ${l}`);this.splitLines=TO(this),this.clipLine=EO(this)}render(e,t,n,r,i){let{x:a,y:o}=t,{x:s,y:c,rotate:l,text:u,title:d,fontSize:f}=n,{rotate:p}=this,[m,h]=pD(this,r);return J(`svg:g`,i).call(Y,this,r,i).call(gO,this,u,r).call(Q,this,{x:s&&a,y:c&&o}).call(t=>t.selectAll().data(e).enter().append(`text`).call(X,this).call(fO,this,u,d).attr(`transform`,cO`translate(${s?e=>s[e]:m},${c?e=>c[e]:h})${l?e=>` rotate(${l[e]})`:p?` rotate(${p})`:``}`).call(Z,`font-size`,f&&(e=>f[e])).call(YE,this,n)).node()}};function dO(e){return e==null?null:Sx(e,`textOverflow`,[`clip`,`ellipsis`,`clip-start`,`clip-end`,`ellipsis-start`,`ellipsis-middle`,`ellipsis-end`]).replace(/^(clip|ellipsis)$/,`$1-end`)}function fO(e,t,n,r){if(!n)return;let{lineAnchor:i,lineHeight:a,textOverflow:o,splitLines:s,clipLine:c}=t;e.each(function(e){let t=s(RE(n[e])??``).map(c),l=t.length,u=i===`top`?.71:i===`bottom`?1-l:(164-l*100)/200;if(l>1){let e=0;for(let n=0;n<l;++n){if(++e,!t[n])continue;let r=this.ownerDocument.createElementNS(yt.svg,`tspan`);r.setAttribute(`x`,0),n===e-1?r.setAttribute(`y`,`${(u+n)*a}em`):r.setAttribute(`dy`,`${e*a}em`),r.textContent=t[n],this.appendChild(r),e=0}}else u&&this.setAttribute(`y`,`${u*a}em`),this.textContent=t[0];if(o&&!r&&t[0]!==n[e]){let t=this.ownerDocument.createElementNS(yt.svg,`title`);t.textContent=n[e],this.appendChild(t)}})}function pO(e,{x:t,y:n,...r}={}){return r.frameAnchor===void 0&&([t,n]=Fx(t,n)),new uO(e,{...r,x:t,y:n})}function mO(e,{x:t=U,...n}={}){return new uO(e,tO({...n,x:t}))}function hO(e,{y:t=U,...n}={}){return new uO(e,eO({...n,y:t}))}function gO(e,t,n){Z(e,`text-anchor`,t.textAnchor),Z(e,`font-family`,t.fontFamily),Z(e,`font-size`,t.fontSize),Z(e,`font-style`,t.fontStyle),Z(e,`font-variant`,t.fontVariant===void 0?_O(n):t.fontVariant),Z(e,`font-weight`,t.fontWeight)}function _O(e){return e&&(dS(e)||cS(e))?`tabular-nums`:void 0}let vO=/* @__PURE__ */ new Set([`inherit`,`initial`,`revert`,`unset`,`xx-small`,`x-small`,`small`,`medium`,`large`,`x-large`,`xx-large`,`xxx-large`,`larger`,`smaller`]);function yO(e){return e==null||typeof e==`number`?[void 0,e]:typeof e==`string`?(e=e.trim().toLowerCase(),vO.has(e)||/^[+-]?\d*\.?\d+(e[+-]?\d+)?(\w*|%)$/.test(e)?[void 0,e]:[e,void 0]):[e,void 0]}function bO(e,t,n){let r=[],i,a=0;for(let[o,s,c]of xO(e))i===void 0&&(i=o),a>i&&n(e,i,s)>t&&(r.push(e.slice(i,a)+(e[a-1]===`­`?`-`:``)),i=o),c?(r.push(e.slice(i,s)),i=void 0):a=s;return r}function*xO(e){let t=0,n=0,r=e.length;for(;n<r;){let r=1;switch(e[n]){case`­`:case`-`:++n,yield[t,n,!1],t=n;break;case` `:for(yield[t,n,!1];e[++n]===` `;);t=n;break;case`\r`:e[n+1]===`
12
+ `&&++r;case`
13
+ `:yield[t,n,!0],n+=r,t=n;break;default:++n}}yield[t,n,!0]}let SO={a:56,b:63,c:57,d:63,e:58,f:37,g:62,h:60,i:26,j:26,k:55,l:26,m:88,n:60,o:60,p:62,q:62,r:39,s:54,t:38,u:60,v:55,w:79,x:54,y:55,z:55,A:69,B:67,C:73,D:74,E:61,F:58,G:76,H:75,I:28,J:55,K:67,L:58,M:89,N:75,O:78,P:65,Q:78,R:67,S:65,T:65,U:75,V:69,W:98,X:69,Y:67,Z:67,0:64,1:48,2:62,3:64,4:66,5:63,6:65,7:58,8:65,9:65," ":29,"!":32,'"':49,"'":31,"(":39,")":39,",":31,"-":48,".":31,"/":32,":":31,";":31,"?":52,"‘":31,"’":31,"“":47,"”":47,"…":82};function CO(e,t=0,n=e.length){let r=0;for(let i=t;i<n;i=NO(e,i))r+=SO[e[i]]??(RO(e,i)?120:SO.e);return r}function wO(e,t=0,n=e.length){let r=0;for(let i=t;i<n;i=NO(e,i))r+=RO(e,i)?126:63;return r}function TO({monospace:e,lineWidth:t,textOverflow:n}){if(n!=null||t==1/0)return e=>e.split(/\r\n?|\n/g);let r=e?wO:CO,i=t*100;return e=>bO(e,i,r)}function EO({monospace:e,lineWidth:t,textOverflow:n}){if(n==null||t==1/0)return e=>e;let r=e?wO:CO,i=t*100;switch(n){case`clip-start`:return e=>AO(e,i,r,``);case`clip-end`:return e=>OO(e,i,r,``);case`ellipsis-start`:return e=>AO(e,i,r,`…`);case`ellipsis-middle`:return e=>kO(e,i,r,`…`);case`ellipsis-end`:return e=>OO(e,i,r,`…`)}}function DO(e,t,n,r){let i=[],a=0;for(let o=0,s=0,c=e.length;o<c;o=s){s=NO(e,o);let c=n(e,o,s);if(a+c>t){for(a+=r;a>t&&o>0;)s=o,o=i.pop(),a-=n(e,o,s);return[o,t-a]}a+=c,i.push(o)}return[-1,0]}function OO(e,t,n,r){e=e.trim();let i=n(r),[a]=DO(e,t,n,i);return a<0?e:e.slice(0,a).trimEnd()+r}function kO(e,t,n,r){e=e.trim();let i=n(e);if(i<=t)return e;let a=n(r)/2,[o,s]=DO(e,t/2,n,a),[c]=DO(e,i-t/2-s+a,n,-a);return c<0?r:e.slice(0,o).trimEnd()+r+e.slice(NO(e,c)).trimStart()}function AO(e,t,n,r){e=e.trim();let i=n(e);if(i<=t)return e;let a=n(r),[o]=DO(e,i-t+a,n,-a);return o<0?r:r+e.slice(NO(e,o)).trimStart()}let jO=/[\p{Combining_Mark}\p{Emoji_Modifier}]+/uy,MO=/\p{Extended_Pictographic}/uy;function NO(e,t){return t+=FO(e,t)?2:1,LO(e,t)&&(t=jO.lastIndex),IO(e,t)?NO(e,t+1):t}function PO(e,t){return e.charCodeAt(t)<128}function FO(e,t){let n=e.charCodeAt(t);if(n>=55296&&n<56320){let n=e.charCodeAt(t+1);return n>=56320&&n<57344}return!1}function IO(e,t){return e.charCodeAt(t)===8205}function LO(e,t){return!PO(e,t)&&(jO.lastIndex=t,jO.test(e))}function RO(e,t){return!PO(e,t)&&(MO.lastIndex=t,MO.test(e))}let zO={ariaLabel:`vector`,fill:`none`,stroke:`currentColor`,strokeWidth:1.5,strokeLinejoin:`round`,strokeLinecap:`round`},BO={draw(e,t,n){let r=t*n/17.5;e.moveTo(0,0),e.lineTo(0,-t),e.moveTo(-r,r-t),e.lineTo(0,-t),e.lineTo(r,r-t)}},VO={draw(e,t,n){e.moveTo(-n,0),e.lineTo(0,-t),e.lineTo(n,0)}},HO=/* @__PURE__ */ new Map([[`arrow`,BO],[`spike`,VO]]);function UO(e){return e&&typeof e.draw==`function`}function WO(e){if(UO(e))return e;let t=HO.get(`${e}`.toLowerCase());if(t)return t;throw Error(`invalid shape: ${e}`)}var GO=class extends ${constructor(e,t={}){let{x:n,y:r,r:i=3.5,length:a,rotate:o,shape:s=BO,anchor:c=`middle`,frameAnchor:l}=t,[u,d]=bx(a,12),[f,p]=bx(o,0);super(e,{x:{value:n,scale:`x`,optional:!0},y:{value:r,scale:`y`,optional:!0},length:{value:u,scale:`length`,optional:!0},rotate:{value:f,optional:!0}},t,zO),this.r=+i,this.length=d,this.rotate=p,this.shape=WO(s),this.anchor=Sx(c,`anchor`,[`start`,`middle`,`end`]),this.frameAnchor=yS(l)}render(e,t,n,r,i){let{x:a,y:o}=t,{x:s,y:c,length:l,rotate:u}=n,{length:d,rotate:f,anchor:p,shape:m,r:h}=this,[g,_]=pD(this,r);return J(`svg:g`,i).call(Y,this,r,i).call(Q,this,{x:s&&a,y:c&&o}).call(t=>t.selectAll().data(e).enter().append(`path`).call(X,this).attr(`transform`,cO`translate(${s?e=>s[e]:g},${c?e=>c[e]:_})${u?e=>` rotate(${u[e]})`:f?` rotate(${f})`:``}${p===`start`?``:p===`end`?l?e=>` translate(0,${l[e]})`:` translate(0,${d})`:l?e=>` translate(0,${l[e]/2})`:` translate(0,${d/2})`}`).attr(`d`,l?e=>{let t=bs();return m.draw(t,l[e],h),t}:(()=>{let e=bs();return m.draw(e,d,h),e})()).call(YE,this,n)).node()}};function KO(e,t={}){let{x:n,y:r,...i}=t;return t.frameAnchor===void 0&&([n,r]=Fx(n,r)),new GO(e,{...i,x:n,y:r})}function qO(e,t={}){let{x:n=U,...r}=t;return new GO(e,{...r,x:n})}function JO(e,t={}){let{y:n=U,...r}=t;return new GO(e,{...r,y:n})}function YO(e,t={}){let{shape:n=VO,stroke:r=zO.stroke,strokeWidth:i=1,fill:a=r,fillOpacity:o=.3,anchor:s=`start`,...c}=t;return KO(e,{...c,shape:n,stroke:r,strokeWidth:i,fill:a,fillOpacity:o,anchor:s})}function XO(e,t){return arguments.length<2&&!aS(e)&&(t=e,e=null),t===void 0&&(t={}),[e,t]}function ZO({anchor:e}={},t){return e===void 0?t[0]:Sx(e,`anchor`,t)}function QO(e){return ZO(e,[`left`,`right`])}function $O(e){return ZO(e,[`right`,`left`])}function ek(e){return ZO(e,[`bottom`,`top`])}function tk(e){return ZO(e,[`top`,`bottom`])}function nk(){let[e,t]=XO(...arguments);return ok(`y`,QO(t),e,t)}function rk(){let[e,t]=XO(...arguments);return ok(`fy`,$O(t),e,t)}function ik(){let[e,t]=XO(...arguments);return sk(`x`,ek(t),e,t)}function ak(){let[e,t]=XO(...arguments);return sk(`fx`,tk(t),e,t)}function ok(e,t,n,{color:r=`currentColor`,opacity:i=1,stroke:a=r,strokeOpacity:o=i,strokeWidth:s=1,fill:c=r,fillOpacity:l=i,textAnchor:u,textStroke:d,textStrokeOpacity:f,textStrokeWidth:p,tickSize:m=e===`y`?6:0,tickPadding:h,tickRotate:g,x:_,margin:v,marginTop:y=v===void 0?20:v,marginRight:b=v===void 0?t===`right`?40:0:v,marginBottom:x=v===void 0?20:v,marginLeft:S=v===void 0?t===`left`?40:0:v,label:C,labelAnchor:w,labelArrow:T,labelOffset:E,ariaLabel:D=`${e}-axis`,...O}){return m=W(m),h=W(h),g=W(g),w!==void 0&&(w=Sx(w,`labelAnchor`,[`center`,`top`,`bottom`])),T=jk(T),mD(m&&!K(a)?ck(e,t,n,{stroke:a,strokeOpacity:o,strokeWidth:s,tickSize:m,tickPadding:h,tickRotate:g,x:_,ariaLabel:D,...O}):null,K(c)?null:uk(e,t,n,{fill:c,fillOpacity:l,stroke:d,strokeOpacity:f,strokeWidth:p,textAnchor:u,tickSize:m,tickPadding:h,tickRotate:g,x:_,marginTop:y,marginRight:b,marginBottom:x,marginLeft:S,ariaLabel:D,...O}),!K(c)&&C!==null?pO([],yk({fill:c,fillOpacity:l,...O},function(n,r,i,a,o){let s=a[e],{marginTop:c,marginRight:l,marginBottom:u,marginLeft:d}=e===`y`&&o.inset||o,f=w??(s.bandwidth?`center`:`top`),p=E??(t===`right`?l:d)-3;return f===`center`?(this.textAnchor=void 0,this.lineAnchor=t===`right`?`bottom`:`top`,this.frameAnchor=t,this.rotate=-90):(this.textAnchor=t===`right`?`end`:`start`,this.lineAnchor=f,this.frameAnchor=`${f}-${t}`,this.rotate=0),this.dy=f===`top`?3-c:f===`bottom`?u-3:0,this.dx=t===`right`?p:-p,this.ariaLabel=`${D} label`,{facets:[[0]],channels:{text:{value:[Ak(e,s,{anchor:t,label:C,labelAnchor:f,labelArrow:T})]}}}})):null)}function sk(e,t,n,{color:r=`currentColor`,opacity:i=1,stroke:a=r,strokeOpacity:o=i,strokeWidth:s=1,fill:c=r,fillOpacity:l=i,textAnchor:u,textStroke:d,textStrokeOpacity:f,textStrokeWidth:p,tickSize:m=e===`x`?6:0,tickPadding:h,tickRotate:g,y:_,margin:v,marginTop:y=v===void 0?t===`top`?30:0:v,marginRight:b=v===void 0?20:v,marginBottom:x=v===void 0?t===`bottom`?30:0:v,marginLeft:S=v===void 0?20:v,label:C,labelAnchor:w,labelArrow:T,labelOffset:E,ariaLabel:D=`${e}-axis`,...O}){return m=W(m),h=W(h),g=W(g),w!==void 0&&(w=Sx(w,`labelAnchor`,[`center`,`left`,`right`])),T=jk(T),mD(m&&!K(a)?lk(e,t,n,{stroke:a,strokeOpacity:o,strokeWidth:s,tickSize:m,tickPadding:h,tickRotate:g,y:_,ariaLabel:D,...O}):null,K(c)?null:dk(e,t,n,{fill:c,fillOpacity:l,stroke:d,strokeOpacity:f,strokeWidth:p,textAnchor:u,tickSize:m,tickPadding:h,tickRotate:g,y:_,marginTop:y,marginRight:b,marginBottom:x,marginLeft:S,ariaLabel:D,...O}),!K(c)&&C!==null?pO([],yk({fill:c,fillOpacity:l,...O},function(n,r,i,a,o){let s=a[e],{marginTop:c,marginRight:l,marginBottom:u,marginLeft:d}=e===`x`&&o.inset||o,f=w??(s.bandwidth?`center`:`right`),p=E??(t===`top`?c:u)-3;return f===`center`?(this.frameAnchor=t,this.textAnchor=void 0):(this.frameAnchor=`${t}-${f}`,this.textAnchor=f===`right`?`end`:`start`),this.lineAnchor=t,this.dy=t===`top`?-p:p,this.dx=f===`right`?l-3:f===`left`?3-d:0,this.ariaLabel=`${D} label`,{facets:[[0]],channels:{text:{value:[Ak(e,s,{anchor:t,label:C,labelAnchor:f,labelArrow:T})]}}}})):null)}function ck(e,t,n,{strokeWidth:r=1,strokeLinecap:i=null,strokeLinejoin:a=null,facetAnchor:o=t+(e===`y`?`-empty`:``),frameAnchor:s=t,tickSize:c,inset:l=0,insetLeft:u=l,insetRight:d=l,dx:f=0,y:p=e===`y`?void 0:null,ariaLabel:m,...h}){return bk(JO,e,n,{ariaLabel:`${m} tick`,ariaHidden:!0},{strokeWidth:r,strokeLinecap:i,strokeLinejoin:a,facetAnchor:o,frameAnchor:s,y:p,...h,dx:t===`left`?+f-zE+ +u:+f+zE-d,anchor:`start`,length:c,shape:t===`left`?Dk:Ok})}function lk(e,t,n,{strokeWidth:r=1,strokeLinecap:i=null,strokeLinejoin:a=null,facetAnchor:o=t+(e===`x`?`-empty`:``),frameAnchor:s=t,tickSize:c,inset:l=0,insetTop:u=l,insetBottom:d=l,dy:f=0,x:p=e===`x`?void 0:null,ariaLabel:m,...h}){return bk(qO,e,n,{ariaLabel:`${m} tick`,ariaHidden:!0},{strokeWidth:r,strokeLinejoin:a,strokeLinecap:i,facetAnchor:o,frameAnchor:s,x:p,...h,dy:t===`bottom`?+f-zE-d:+f+zE+ +u,anchor:`start`,length:c,shape:t===`bottom`?Tk:Ek})}function uk(e,t,n,{facetAnchor:r=t+(e===`y`?`-empty`:``),frameAnchor:i=t,tickSize:a,tickRotate:o=0,tickPadding:s=Math.max(3,9-a)+(Math.abs(o)>60?4*Math.cos(o*jD):0),text:c,textAnchor:l=Math.abs(o)>60?`middle`:t===`left`?`end`:`start`,lineAnchor:u=o>60?`top`:o<-60?`bottom`:`middle`,fontVariant:d,inset:f=0,insetLeft:p=f,insetRight:m=f,dx:h=0,ariaLabel:g,y:_=e===`y`?void 0:null,...v}){return bk(hO,e,n,{ariaLabel:`${g} tick label`},{facetAnchor:r,frameAnchor:i,text:c,textAnchor:l,lineAnchor:u,fontVariant:d,rotate:o,y:_,...v,dx:t===`left`?+h-a-s+ +p:+h+ +a+ +s-m},function(e,n,r,i,a){d===void 0&&(this.fontVariant=kk(e)),c===void 0&&(a.text=Sk(e,n,r,i,t))})}function dk(e,t,n,{facetAnchor:r=t+(e===`x`?`-empty`:``),frameAnchor:i=t,tickSize:a,tickRotate:o=0,tickPadding:s=Math.max(3,9-a)+(Math.abs(o)>=10?4*Math.cos(o*jD):0),text:c,textAnchor:l=Math.abs(o)>=10?o<0^t===`bottom`?`start`:`end`:`middle`,lineAnchor:u=Math.abs(o)>=10?`middle`:t===`bottom`?`top`:`bottom`,fontVariant:d,inset:f=0,insetTop:p=f,insetBottom:m=f,dy:h=0,x:g=e===`x`?void 0:null,ariaLabel:_,...v}){return bk(mO,e,n,{ariaLabel:`${_} tick label`},{facetAnchor:r,frameAnchor:i,text:c===void 0?null:c,textAnchor:l,lineAnchor:u,fontVariant:d,rotate:o,x:g,...v,dy:t===`bottom`?+h+ +a+ +s-m:+h-a-s+ +p},function(e,n,r,i,a){d===void 0&&(this.fontVariant=kk(e)),c===void 0&&(a.text=Sk(e,n,r,i,t))})}function fk(){let[e,t]=XO(...arguments);return gk(`y`,QO(t),e,t)}function pk(){let[e,t]=XO(...arguments);return gk(`fy`,$O(t),e,t)}function mk(){let[e,t]=XO(...arguments);return _k(`x`,ek(t),e,t)}function hk(){let[e,t]=XO(...arguments);return _k(`fx`,tk(t),e,t)}function gk(e,t,n,{y:r=e===`y`?void 0:null,x:i=null,x1:a=t===`left`?i:null,x2:o=t===`right`?i:null,ariaLabel:s=`${e}-grid`,ariaHidden:c=!0,...l}){return bk(oO,e,n,{ariaLabel:s,ariaHidden:c},{y:r,x1:a,x2:o,...vk(l)})}function _k(e,t,n,{x:r=e===`x`?void 0:null,y:i=null,y1:a=t===`top`?i:null,y2:o=t===`bottom`?i:null,ariaLabel:s=`${e}-grid`,ariaHidden:c=!0,...l}){return bk(aO,e,n,{ariaLabel:s,ariaHidden:c},{x:r,y1:a,y2:o,...vk(l)})}function vk({color:e=`currentColor`,opacity:t=.1,stroke:n=e,strokeOpacity:r=t,strokeWidth:i=1,...a}){return{stroke:n,strokeOpacity:r,strokeWidth:i,...a}}function yk({fill:e,fillOpacity:t,fontFamily:n,fontSize:r,fontStyle:i,fontVariant:a,fontWeight:o,monospace:s,pointerEvents:c,shapeRendering:l,clip:u=!1},d){return[,e]=yx(e),[,t]=bx(t),{facet:`super`,x:null,y:null,fill:e,fillOpacity:t,fontFamily:n,fontSize:r,fontStyle:i,fontVariant:a,fontWeight:o,monospace:s,pointerEvents:c,shapeRendering:l,clip:u,initializer:d}}function bk(e,t,n,r,i,a){let o;function s(e,n,r,s,c,l){let u=e==null&&(t===`fx`||t===`fy`),{[t]:d}=s;if(!d)throw Error(`missing scale: ${t}`);let f=d.domain(),{interval:p,ticks:m,tickFormat:h,tickSpacing:g=t===`x`?80:35}=i;if(typeof m==`string`&&Mk(d)&&(p=m,m=void 0),m===void 0&&(m=Qx(p,d.type)??xk(d,g)),e==null){if(aS(m))e=wx(m);else if(tS(m))e=wk(m,...j(f));else if(d.interval){let t=d.interval;if(d.ticks){let[n,r]=j(f),i=(r-n)/t[Ab];t=zb(t,i/m)??t,e=wk(t,n,r)}else{e=f;let n=e.length;t=zb(t,n/m)??t,t!==d.interval&&(e=wk(t,...j(e)))}if(t===d.interval){let t=Math.round(e.length/m);t>1&&(e=e.filter((e,n)=>n%t===0))}}else e=d.ticks?d.ticks(m):f;if(!d.ticks&&e.length&&e!==f){let n=new oe(f);e=e.filter(e=>n.has(e)),e.length||Vw(`Warning: the ${t}-axis ticks appear to not align with the scale domain, resulting in no ticks. Try different ticks?`)}t===`y`||t===`x`?n=[Rx(e)]:o[t]={scale:t,value:U}}a?.call(this,d,e,m,h,o);let _=Object.fromEntries(Object.entries(o).map(([t,n])=>[t,{...n,value:H(e,n.value)}]));return u&&(n=l.filterFacets(e,_)),{data:e,facets:n,channels:_}}let c=WS(i).initializer,l=e(n,WS({...i,initializer:s},c));return n==null?(o=l.channels,l.channels={}):o={},r!==void 0&&Object.assign(l,r),l.clip===void 0&&(l.clip=!1),l}function xk(e,t){let[n,r]=j(e.range());return(r-n)/t}function Sk(e,t,n,r,i){return{value:Ck(e,t,n,r,i)}}function Ck(e,t,n,r,i){return typeof r==`function`&&!(e.type===`log`&&e.tickFormat)?r:r===void 0&&t&&cS(t)?Ub(e.type,t,i)??RE:e.tickFormat?e.tickFormat(typeof n==`number`?n:null,r):typeof r==`string`&&e.domain().length>0?(cS(e.domain())?Rg:Bc)(r):r===void 0?RE:px(r)}function wk(e,t,n){return e.range(t,e.offset(e.floor(n)))}let Tk={draw(e,t){e.moveTo(0,0),e.lineTo(0,t)}},Ek={draw(e,t){e.moveTo(0,0),e.lineTo(0,-t)}},Dk={draw(e,t){e.moveTo(0,0),e.lineTo(-t,0)}},Ok={draw(e,t){e.moveTo(0,0),e.lineTo(t,0)}};function kk(e){return e.bandwidth&&!e.interval?void 0:`tabular-nums`}function Ak(e,t,{anchor:n,label:r=t.label,labelAnchor:i,labelArrow:a}={}){if(!(r==null||r.inferred&&Mk(t)&&/^(date|time|year)$/i.test(r))){if(r=String(r),a===`auto`&&(a=(!t.bandwidth||t.interval)&&!/[↑↓→←]/.test(r)),!a)return r;if(a===!0){let n=gT(t);n&&(a=/x$/.test(e)||i===`center`?/x$/.test(e)===n<0?`left`:`right`:n<0?`up`:`down`)}switch(a){case`left`:return`← ${r}`;case`right`:return`${r} →`;case`up`:return n===`right`?`${r} ↑`:`↑ ${r}`;case`down`:return n===`right`?`${r} ↓`:`↓ ${r}`}return r}}function jk(e=`auto`){return K(e)?!1:typeof e==`boolean`?e:Sx(e,`labelArrow`,[`auto`,`up`,`right`,`down`,`left`])}function Mk(e){return cS(e.domain())}function Nk(e,t){if(t==null)return t;let n=e(t);if(!n)throw Error(`scale not found: ${t}`);return n}function Pk(e,{opacity:t,...n}={}){if(!jT(e)&&!MT(e))throw Error(`swatches legend requires ordinal or threshold color scale (not ${e.type})`);return Ik(e,n,(e,n,r,i)=>e.append(`svg`).attr(`width`,r).attr(`height`,i).attr(`fill`,n.scale).attr(`fill-opacity`,bx(t)[1]).append(`rect`).attr(`width`,`100%`).attr(`height`,`100%`))}function Fk(e,{fill:t=e.hint?.fill===void 0?`none`:e.hint.fill,fillOpacity:n=1,stroke:r=e.hint?.stroke===void 0?K(t)?`currentColor`:`none`:e.hint.stroke,strokeOpacity:i=1,strokeWidth:a=1.5,r:o=4.5,...s}={},c){let[l,u]=yx(t),[d,f]=yx(r),p=Nk(c,l),m=Nk(c,d),h=o*o*Math.PI;return n=bx(n)[1],i=bx(i)[1],a=bx(a)[1],Ik(e,s,(t,r,o,s)=>t.append(`svg`).attr(`viewBox`,`-8 -8 16 16`).attr(`width`,o).attr(`height`,s).attr(`fill`,l===`color`?e=>p.scale(e):u).attr(`fill-opacity`,n).attr(`stroke`,d===`color`?e=>m.scale(e):f).attr(`stroke-opacity`,i).attr(`stroke-width`,a).append(`path`).attr(`d`,t=>{let n=bs();return e.scale(t).draw(n,h),n}))}function Ik(e,t={},n){let{columns:r,tickFormat:i,fontVariant:a=kD(e),swatchSize:o=15,swatchWidth:s=o,swatchHeight:c=o,marginLeft:l=0,className:u,style:d,width:f}=t,p=TE(t);u=dD(u),i=Ck(e.scale,e.domain,void 0,i);let m=J(`div`,p).attr(`class`,`${u}-swatches ${u}-swatches-${r==null?`wrap`:`columns`}`),h;return r==null?(h=`:where(.${u}-swatches-wrap) {
14
+ display: flex;
15
+ align-items: center;
16
+ min-height: 33px;
17
+ flex-wrap: wrap;
18
+ }
19
+ :where(.${u}-swatches-wrap .${u}-swatch) {
20
+ display: inline-flex;
21
+ align-items: center;
22
+ margin-right: 1em;
23
+ }`,m.selectAll().data(e.domain).enter().append(`span`).attr(`class`,`${u}-swatch`).call(n,e,s,c).append(function(){return this.ownerDocument.createTextNode(i.apply(this,arguments))})):(h=`:where(.${u}-swatches-columns .${u}-swatch) {
24
+ display: flex;
25
+ align-items: center;
26
+ break-inside: avoid;
27
+ padding-bottom: 1px;
28
+ }
29
+ :where(.${u}-swatches-columns .${u}-swatch::before) {
30
+ flex-shrink: 0;
31
+ }
32
+ :where(.${u}-swatches-columns .${u}-swatch-label) {
33
+ white-space: nowrap;
34
+ overflow: hidden;
35
+ text-overflow: ellipsis;
36
+ }`,m.style(`columns`,r).selectAll().data(e.domain).enter().append(`div`).attr(`class`,`${u}-swatch`).call(n,e,s,c).call(e=>e.append(`div`).attr(`class`,`${u}-swatch-label`).attr(`title`,i).text(i))),m.call(e=>e.insert(`style`,`*`).text(`:where(.${u}-swatches) {
37
+ font-family: system-ui, sans-serif;
38
+ font-size: 10px;
39
+ margin-bottom: 0.5em;
40
+ }
41
+ :where(.${u}-swatch > svg) {
42
+ margin-right: 0.5em;
43
+ overflow: visible;
44
+ }
45
+ ${h}`)).style(`margin-left`,l?`${+l}px`:null).style(`width`,f===void 0?null:`${+f}px`).style(`font-variant`,cD(a,`normal`)).call(fD,d).node()}let Lk=/* @__PURE__ */ new Map([[`symbol`,Fk],[`color`,Vk],[`opacity`,Hk]]);function Rk(e={}){for(let[t,n]of Lk){let r=e[t];if(jx(r)){let i=TE(e),a;if(t===`symbol`){let{fill:t,stroke:n=t===void 0&&jx(e.color)?`color`:void 0}=e;a={fill:t,stroke:n}}return n(wT(t,r,a),Bk(i,r,e),t=>jx(e[t])?wT(t,e[t]):null)}}throw Error(`unknown legend type; no scale found`)}function zk(e,t,n={}){return(r,i)=>{if(!Lk.has(r))throw Error(`unknown legend type: ${r}`);if(r in e)return Lk.get(r)(e[r],Bk(t,n[r],i),t=>e[t])}}function Bk({className:e,...t},{label:n,ticks:r,tickFormat:i}={},a){return bS(a,{className:e,...t},{label:n,ticks:r,tickFormat:i})}function Vk(e,{legend:t=!0,...n}){if(t===!0&&(t=e.type===`ordinal`?`swatches`:`ramp`),e.domain!==void 0)switch(`${t}`.toLowerCase()){case`swatches`:return Pk(e,n);case`ramp`:return AD(e,n);default:throw Error(`unknown legend type: ${t}`)}}function Hk({type:e,interpolate:t,...n},{legend:r=!0,color:i=Gr(0,0,0),...a}){if(!t)throw Error(`${e} opacity scales are not supported`);if(r===!0&&(r=`ramp`),`${r}`.toLowerCase()!==`ramp`)throw Error(`${r} opacity legends are not supported`);return Vk({type:e,...n,interpolate:Uk(i)},{legend:r,...a})}function Uk(e){let{r:t,g:n,b:r}=Gr(e)||Gr(0,0,0);return e=>`rgba(${t},${n},${r},${e})`}function Wk(e,t,n){let r=[];for(let[i,a]of Lk){let o=n[i];if(o?.legend&&i in e){let n=a(e[i],Bk(t,e[i],o),t=>e[t]);n!=null&&r.push(n)}}return r}function Gk(e={},t=`x`){return Dx(e)?e:{...e,[t]:U}}function Kk(e={},t=`y`){return Ox(e)?e:{...e,[t]:U}}function qk(e,t){if(t.length===1)return{data:e,facets:t};let n=Lx(e),r=new Uint8Array(n),i=0;for(let e of t)for(let t of e)r[t]&&++i,r[t]=1;if(i===0)return{data:e,facets:t};e=Ex(e);let a=e[Qb]=new Uint32Array(n+i);t=t.map(e=>Ex(e,Uint32Array));let o=n;r.fill(0);for(let n of t)for(let t=0,i=n.length;t<i;++t){let i=n[t];r[i]?(n[t]=o,e[o]=e[i],a[o]=i,++o):a[i]=i,r[i]=1}return{data:e,facets:t}}function Jk(e={},t={}){arguments.length===1&&([e,t]=nA(e));let{y1:n,y:r=n,x:i,...a}=t,[o,s,c,l]=iA(r,i,`y`,`x`,e,a);return{...o,y1:n,y:s,x1:c,x2:l,x:qx(c,l)}}function Yk(e={},t={}){arguments.length===1&&([e,t]=nA(e));let{y1:n,y:r=n,x:i}=t,[a,o,s]=iA(r,i,`y`,`x`,e,t);return{...a,y1:n,y:o,x:s}}function Xk(e={},t={}){arguments.length===1&&([e,t]=nA(e));let{y1:n,y:r=n,x:i}=t,[a,o,,s]=iA(r,i,`y`,`x`,e,t);return{...a,y1:n,y:o,x:s}}function Zk(e={},t={}){arguments.length===1&&([e,t]=nA(e));let{x1:n,x:r=n,y:i,...a}=t,[o,s,c,l]=iA(r,i,`x`,`y`,e,a);return{...o,x1:n,x:s,y1:c,y2:l,y:qx(c,l)}}function Qk(e={},t={}){arguments.length===1&&([e,t]=nA(e));let{x1:n,x:r=n,y:i}=t,[a,o,s]=iA(r,i,`x`,`y`,e,t);return{...a,x1:n,x:o,y:s}}function $k(e={},t={}){arguments.length===1&&([e,t]=nA(e));let{x1:n,x:r=n,y:i}=t,[a,o,,s]=iA(r,i,`x`,`y`,e,t);return{...a,x1:n,x:o,y:s}}function eA({x:e,x1:t,x2:n,...r}={}){return r=vD(r,`y`),t===void 0&&n===void 0?Jk({x:e,...r}):([t,n]=Px(e,t,n),{...r,x1:t,x2:n})}function tA({y:e,y1:t,y2:n,...r}={}){return r=vD(r,`x`),t===void 0&&n===void 0?Zk({y:e,...r}):([t,n]=Px(e,t,n),{...r,y1:t,y2:n})}function nA(e){let{offset:t,order:n,reverse:r,...i}=e;return[{offset:t,order:n,reverse:r},i]}let rA={length:!0};function iA(e,t=sx,n,r,{offset:i,order:a,reverse:o},s){if(t===null)throw Error(`stack requires ${r}`);let c=Ix(s),[l,u]=Gx(e),[d,f]=Wx(t),[p,m]=Wx(t);return d.hint=p.hint=rA,i=aA(i),a=fA(a,i,r),[US(s,(r,s,l)=>{({data:r,facets:s}=qk(r,s));let d=e==null?void 0:u(Jx(H(r,e),l?.[n])),p=H(r,t,Float64Array),h=H(r,c),g=a&&a(r,d,p,h),_=Lx(r),v=f(new Float64Array(_)),y=m(new Float64Array(_)),b=[];for(let e of s){let t=d?Array.from(fe(e,e=>d[e]).values()):[e];if(g)for(let e of t)e.sort(g);for(let e of t){let t=0,n=0;o&&e.reverse();for(let r of e){let e=p[r];e<0?t=y[r]=(v[r]=t)+e:e>0?n=y[r]=(v[r]=n)+e:y[r]=v[r]=n}}b.push(t)}return i&&i(b,v,y,h),{data:r,facets:s}}),l,d,p]}function aA(e){if(e!=null){if(typeof e==`function`)return e;switch(`${e}`.toLowerCase()){case`expand`:case`normalize`:return sA;case`center`:case`silhouette`:return cA;case`wiggle`:return lA}throw Error(`unknown offset: ${e}`)}}function oA(e,t){let n=0,r=0;for(let i of e){let e=t[i];e<n&&(n=e),e>r&&(r=e)}return[n,r]}function sA(e,t,n){for(let r of e)for(let e of r){let[r,i]=oA(e,n);for(let a of e){let e=1/(i-r||1);t[a]=e*(t[a]-r),n[a]=e*(n[a]-r)}}}function cA(e,t,n){for(let r of e){for(let e of r){let[r,i]=oA(e,n);for(let a of e){let e=(i+r)/2;t[a]-=e,n[a]-=e}}uA(r,t,n)}dA(e,t,n)}function lA(e,t,n,r){for(let i of e){let e=new ae,a=0;for(let o of i){let i=-1,s=o.map(e=>Math.abs(n[e]-t[e])),c=o.map(a=>{i=r?r[a]:++i;let o=n[a]-t[a],s=e.has(i)?o-e.get(i):0;return e.set(i,o),s}),l=[0,...te(c)];for(let e of o)t[e]+=a,n[e]+=a;let u=Ze(s);u&&(a-=Ze(s,(e,t)=>(c[t]/2+l[t])*e)/u)}uA(i,t,n)}dA(e,t,n)}function uA(e,t,n){let r=Me(e,e=>Me(e,e=>t[e]));for(let i of e)for(let e of i)t[e]-=r,n[e]-=r}function dA(e,t,n){let r=e.length;if(r===1)return;let i=e.map(e=>e.flat()),a=i.map(e=>(Me(e,e=>t[e])+Ae(e,e=>n[e]))/2),o=Me(a);for(let e=0;e<r;e++){let r=o-a[e];for(let a of i[e])t[a]+=r,n[a]+=r}}function fA(e,t,n){if(e===void 0&&t===lA)return _A(sb);if(e!=null){if(typeof e==`string`){let t=e.startsWith(`-`),r=t?cb:sb;switch((t?e.slice(1):e).toLowerCase()){case`value`:case n:return pA(r);case`z`:return mA(r);case`sum`:return hA(r);case`appearance`:return gA(r);case`inside-out`:return _A(r)}return vA(ax(e))}if(typeof e==`function`)return(e.length===1?vA:yA)(e);if(qb(e))return bA(e);throw Error(`invalid order: ${e}`)}}function pA(e){return(t,n,r)=>(t,n)=>e(r[t],r[n])}function mA(e){return(t,n,r,i)=>(t,n)=>e(i[t],i[n])}function hA(e){return xA(e,(e,t,n,r)=>be(Rx(e),e=>Ze(e,e=>n[e]),e=>r[e]))}function gA(e){return xA(e,(e,t,n,r)=>be(Rx(e),e=>t[Ie(e,e=>n[e])],e=>r[e]))}function _A(e){return xA(e,(e,t,n,r)=>{let i=Rx(e),a=be(i,e=>t[Ie(e,e=>n[e])],e=>r[e]),o=pe(i,e=>Ze(e,e=>n[e]),e=>r[e]),s=[],c=[],l=0;for(let e of a)l<0?(l+=o.get(e),s.push(e)):(l-=o.get(e),c.push(e));return c.reverse().concat(s)})}function vA(e){return t=>{let n=H(t,e);return(e,t)=>sb(n[e],n[t])}}function yA(e){return t=>qb(t)?(n,r)=>e(t[n],t[r]):(n,r)=>e(t.get(n),t.get(r))}function bA(e){return xA(sb,()=>e)}function xA(e,t){return(n,r,i,a)=>{if(!a)throw Error(`missing channel: z`);let o=new ae(t(n,r,i,a).map((e,t)=>[e,t]));return(t,n)=>e(o.get(a[t]),o.get(a[n]))}}let SA={ariaLabel:`rect`};var CA=class extends ${constructor(e,t={}){let{x1:n,y1:r,x2:i,y2:a}=t;super(e,{x1:{value:n,scale:`x`,type:n!=null&&i==null?`band`:void 0,optional:!0},y1:{value:r,scale:`y`,type:r!=null&&a==null?`band`:void 0,optional:!0},x2:{value:i,scale:`x`,optional:!0},y2:{value:a,scale:`y`,optional:!0}},t,SA),wA(this,t),TA(this,t)}render(e,t,n,r,i){let{x:a,y:o}=t,{x1:s,y1:c,x2:l,y2:u}=n,{marginTop:d,marginRight:f,marginBottom:p,marginLeft:m,width:h,height:g}=r,{projection:_}=i,{insetTop:v,insetRight:y,insetBottom:b,insetLeft:x}=this,{rx:S,ry:C,rx1y1:w,rx1y2:T,rx2y1:E,rx2y2:D}=this;(s||l)&&!_&&PT(a)&&(s=l=null),(c||u)&&!_&&PT(o)&&(c=u=null);let O=a?.bandwidth?a.bandwidth():0,k=o?.bandwidth?o.bandwidth():0;return J(`svg:g`,i).call(Y,this,r,i).call(Q,this,{},0,0).call(t=>t.selectAll().data(e).enter().call(w||T||E||D?e=>e.append(`path`).call(X,this).call(EA,s&&l?e=>s[e]+(l[e]<s[e]?-y:x):s?e=>s[e]+x:m+x,c&&u?e=>c[e]+(u[e]<c[e]?-b:v):c?e=>c[e]+v:d+v,s&&l?e=>l[e]-(l[e]<s[e]?-x:y):s?e=>s[e]+O-y:h-f-y,c&&u?e=>u[e]-(u[e]<c[e]?-v:b):c?e=>c[e]+k-b:g-p-b,this).call(YE,this,n):e=>e.append(`rect`).call(X,this).attr(`x`,s?l?e=>Math.min(s[e],l[e])+x:e=>s[e]+x:m+x).attr(`y`,c?u?e=>Math.min(c[e],u[e])+v:e=>c[e]+v:d+v).attr(`width`,s?l?e=>Math.max(0,Math.abs(l[e]-s[e])+O-x-y):O-x-y:h-f-m-y-x).attr(`height`,c?u?e=>Math.max(0,Math.abs(c[e]-u[e])+k-v-b):k-v-b:g-d-p-v-b).call(Z,`rx`,S).call(Z,`ry`,C).call(YE,this,n))).node()}};function wA(e,{inset:t=0,insetTop:n=t,insetRight:r=t,insetBottom:i=t,insetLeft:a=t}={}){e.insetTop=W(n),e.insetRight=W(r),e.insetBottom=W(i),e.insetLeft=W(a)}function TA(e,{r:t,rx:n,ry:r,rx1:i=t,ry1:a=t,rx2:o=t,ry2:s=t,rx1y1:c=i===void 0?a===void 0?0:+a:+i,rx1y2:l=i===void 0?s===void 0?0:+s:+i,rx2y1:u=o===void 0?a===void 0?0:+a:+o,rx2y2:d=o===void 0?s===void 0?0:+s:+o}={}){c||l||u||d?(e.rx1y1=c,e.rx1y2=l,e.rx2y1=u,e.rx2y2=d):(e.rx=cD(n,`auto`),e.ry=cD(r,`auto`))}function EA(e,t,n,r,i,a){let{rx1y1:o,rx1y2:s,rx2y1:c,rx2y2:l}=a;typeof t!=`function`&&(t=px(t)),typeof n!=`function`&&(n=px(n)),typeof r!=`function`&&(r=px(r)),typeof i!=`function`&&(i=px(i));let u=Math.max(Math.abs(o+c),Math.abs(s+l)),d=Math.max(Math.abs(o+s),Math.abs(c+l));e.attr(`d`,e=>{let a=t(e),f=n(e),p=r(e),m=i(e),h=a>p,g=f>m,_=h?p:a,v=h?a:p,y=g?m:f,b=g?f:m,x=Math.min(1,(v-_)/u,(b-y)/d),S=x*(h?g?l:c:g?s:o),C=x*(h?g?s:o:g?l:c),w=x*(h?g?o:s:g?c:l),T=x*(h?g?c:l:g?o:s);return`M${_},${y+OA(S,T)}A${S},${S} 0 0 ${S<0?0:1} ${_+DA(S,T)},${y}H${v-DA(C,w)}A${C},${C} 0 0 ${C<0?0:1} ${v},${y+OA(C,w)}V${b-OA(w,C)}A${w},${w} 0 0 ${w<0?0:1} ${v-DA(w,C)},${b}H${_+DA(T,S)}A${T},${T} 0 0 ${T<0?0:1} ${_},${b-OA(T,S)}Z`})}function DA(e,t){return t<0?e:Math.abs(e)}function OA(e,t){return t<0?Math.abs(e):e}function kA(e,t){return new CA(e,XD(ZD(t)))}function AA(e,t={}){return kx(t)||(t={...t,y:ox,x2:U,interval:1}),new CA(e,eA(ZD(Gk(t))))}function jA(e,t={}){return kx(t)||(t={...t,x:ox,y2:U,interval:1}),new CA(e,tA(XD(Kk(t))))}let MA={ariaLabel:`frame`,fill:`none`,stroke:`currentColor`,clip:!1},NA={ariaLabel:`frame`,fill:null,stroke:`currentColor`,strokeLinecap:`square`,clip:!1};var PA=class extends ${constructor(e={}){let{anchor:t=null}=e;super(ix,void 0,e,t==null?MA:NA),this.anchor=xx(t,`anchor`,[`top`,`right`,`bottom`,`left`]),wA(this,e),t||TA(this,e)}render(e,t,n,r,i){let{marginTop:a,marginRight:o,marginBottom:s,marginLeft:c,width:l,height:u}=r,{anchor:d,insetTop:f,insetRight:p,insetBottom:m,insetLeft:h}=this,{rx:g,ry:_,rx1y1:v,rx1y2:y,rx2y1:b,rx2y2:x}=this,S=c+h,C=l-o-p,w=a+f,T=u-s-m;return J(d?`svg:line`:v||y||b||x?`svg:path`:`svg:rect`,i).datum(0).call(Y,this,r,i).call(X,this).call(YE,this,n).call(Q,this,{}).call(d===`left`?e=>e.attr(`x1`,S).attr(`x2`,S).attr(`y1`,w).attr(`y2`,T):d===`right`?e=>e.attr(`x1`,C).attr(`x2`,C).attr(`y1`,w).attr(`y2`,T):d===`top`?e=>e.attr(`x1`,S).attr(`x2`,C).attr(`y1`,w).attr(`y2`,w):d===`bottom`?e=>e.attr(`x1`,S).attr(`x2`,C).attr(`y1`,T).attr(`y2`,T):v||y||b||x?e=>e.call(EA,S,w,C,T,this):e=>e.attr(`x`,S).attr(`y`,w).attr(`width`,C-S).attr(`height`,T-w).attr(`rx`,g).attr(`ry`,_)).node()}};function FA(e){return new PA(e)}let IA={ariaLabel:`tip`,fill:`var(--plot-background)`,stroke:`currentColor`},LA=/* @__PURE__ */ new Set([`geometry`,`href`,`src`,`ariaLabel`,`scales`]);var RA=class extends ${constructor(e,t={}){t.tip&&(t={...t,tip:!1}),t.title===void 0&&aS(e)&&oS(e)&&(t={...t,title:U});let{x:n,y:r,x1:i,x2:a,y1:o,y2:s,anchor:c,preferredAnchor:l=`bottom`,monospace:u,fontFamily:d=u?`ui-monospace, monospace`:void 0,fontSize:f,fontStyle:p,fontVariant:m,fontWeight:h,lineHeight:g=1,lineWidth:_=20,frameAnchor:v,format:y,textAnchor:b=`start`,textOverflow:x,textPadding:S=8,title:C,pointerSize:w=12,pathFilter:T=`drop-shadow(0 3px 4px rgba(0,0,0,0.2))`}=t;super(e,{x:{value:i!=null&&a!=null?null:n,scale:`x`,optional:!0},y:{value:o!=null&&s!=null?null:r,scale:`y`,optional:!0},x1:{value:i,scale:`x`,optional:a==null},y1:{value:o,scale:`y`,optional:s==null},x2:{value:a,scale:`x`,optional:i==null},y2:{value:s,scale:`y`,optional:o==null},title:{value:C,optional:!0}},t,IA),this.anchor=vS(c,`anchor`),this.preferredAnchor=vS(l,`preferredAnchor`),this.frameAnchor=yS(v),this.textAnchor=cD(b,`middle`),this.textPadding=+S,this.pointerSize=+w,this.pathFilter=lx(T),this.lineHeight=+g,this.lineWidth=+_,this.textOverflow=dO(x),this.monospace=!!u,this.fontFamily=lx(d),this.fontSize=W(f),this.fontStyle=lx(p),this.fontVariant=lx(m),this.fontWeight=lx(h);for(let e in IA)e in this.channels&&(this[e]=IA[e]);this.splitLines=TO(this),this.clipLine=EO(this),this.format=typeof y==`string`||typeof y==`function`?{title:y}:{...y}}render(e,t,n,r,i){let a=this,{x:o,y:s,fx:c,fy:l}=t,{ownerSVGElement:u,document:d}=i,{anchor:f,monospace:p,lineHeight:m,lineWidth:h}=this,{textPadding:g,pointerSize:_,pathFilter:v}=this,{marginTop:y,marginLeft:b}=r,{x1:x,y1:S,x2:C,y2:w,x:T=x??C,y:E=S??w}=n,D=c?c(e.fx)-b:0,O=l?l(e.fy)-y:0,[k,A]=pD(this,r),ee=DD(n,k),te=OD(n,A),ne=p?wO:CO,re=ne(`…`),j,ie;`title`in n?(j=UA.call(this,{title:n.channels.title},t),ie=GA):(j=UA.call(this,n.channels,t),ie=KA);let ae=J(`svg:g`,i).call(Y,this,r,i).call(gO,this).call(Q,this,{x:T&&o,y:E&&s}).call(r=>r.selectAll().data(e).enter().append(`g`).attr(`transform`,e=>`translate(${Math.round(ee(e))},${Math.round(te(e))})`).call(X,this).call(e=>e.append(`path`).attr(`filter`,v)).call(r=>r.append(`text`).each(function(r){let i=vr(this);this.setAttribute(`fill`,`currentColor`),this.setAttribute(`fill-opacity`,1),this.setAttribute(`stroke`,`none`);let o=ie.call(a,r,e,j,t,n);if(typeof o==`string`)for(let e of a.splitLines(o))oe(i,{value:a.clipLine(e)});else{let e=/* @__PURE__ */ new Set;for(let t of o){let{label:n=``}=t;n&&e.has(n)||(e.add(n),oe(i,t))}}})));function oe(e,{label:t,value:n,color:r,opacity:i}){t??=``,n??=``;let a=r!=null||i!=null,o,s=h*100,[c]=DO(t,s,ne,re);if(c>=0)t=t.slice(0,c).trimEnd()+`…`,o=n.trim(),n=``;else{(t||!n&&!a)&&(n=` `+n);let[e]=DO(n,s-ne(t),ne,re);e>=0&&(o=n.trim(),n=n.slice(0,e).trimEnd()+`…`)}let l=e.append(`tspan`).attr(`x`,0).attr(`dy`,`${m}em`).text(`​`);t&&l.append(`tspan`).attr(`font-weight`,`bold`).text(t),n&&l.append(()=>d.createTextNode(n)),a&&l.append(`tspan`).text(` ■`).attr(`fill`,r).attr(`fill-opacity`,i).style(`user-select`,`none`),o&&l.append(`title`).text(o)}function se(){let{width:e,height:t}=r.facet??r;ae.selectChildren().each(function(n){let{x:r,width:i,height:o}=this.getBBox();i=Math.round(i),o=Math.round(o);let s=f;if(s===void 0){let r=ee(n)+D,c=te(n)+O,l=r+i+_+g*2<e,u=r-i-_-g*2>0,d=c+o+_+g*2<t,f=c-o-_-g*2>0;s=l&&u?d&&f?a.preferredAnchor:f?`bottom`:`top`:d&&f?l?`left`:`right`:(l||u)&&(d||f)?`${f?`bottom`:`top`}-${l?`left`:`right`}`:a.preferredAnchor}let c=this.firstChild,l=this.lastChild;if(c.setAttribute(`d`,HA(s,_,g,i,o)),r)for(let e of l.childNodes)e.setAttribute(`x`,-r);l.setAttribute(`y`,`${+BA(s,l.childNodes.length,m).toFixed(6)}em`),l.setAttribute(`transform`,`translate(${VA(s,_,g,i,o)})`)}),ae.attr(`visibility`,null)}return e.length&&(ae.attr(`visibility`,`hidden`),u.isConnected?Promise.resolve().then(se):typeof requestAnimationFrame<`u`&&requestAnimationFrame(se)),ae.node()}};function zA(e,{x:t,y:n,...r}={}){return r.frameAnchor===void 0&&([t,n]=Fx(t,n)),new RA(e,{...r,x:t,y:n})}function BA(e,t,n){return/^top(?:-|$)/.test(e)?.94-n:-.29-t*n}function VA(e,t,n,r,i){switch(e){case`middle`:return[-r/2,i/2];case`top-left`:return[n,t+n];case`top`:return[-r/2,t/2+n];case`top-right`:return[-r-n,t+n];case`right`:return[-t/2-r-n,i/2];case`bottom-left`:return[n,-t-n];case`bottom`:return[-r/2,-t/2-n];case`bottom-right`:return[-r-n,-t-n];case`left`:return[n+t/2,i/2]}}function HA(e,t,n,r,i){let a=r+n*2,o=i+n*2;switch(e){case`middle`:return`M${-a/2},${-o/2}h${a}v${o}h${-a}z`;case`top-left`:return`M0,0l${t},${t}h${a-t}v${o}h${-a}z`;case`top`:return`M0,0l${t/2},${t/2}h${(a-t)/2}v${o}h${-a}v${-o}h${(a-t)/2}z`;case`top-right`:return`M0,0l${-t},${t}h${t-a}v${o}h${a}z`;case`right`:return`M0,0l${-t/2},${-t/2}v${t/2-o/2}h${-a}v${o}h${a}v${t/2-o/2}z`;case`bottom-left`:return`M0,0l${t},${-t}h${a-t}v${-o}h${-a}z`;case`bottom`:return`M0,0l${t/2},${-t/2}h${(a-t)/2}v${-o}h${-a}v${o}h${(a-t)/2}z`;case`bottom-right`:return`M0,0l${-t},${-t}h${t-a}v${-o}h${a}z`;case`left`:return`M0,0l${t/2},${-t/2}v${t/2-o/2}h${a}v${o}h${-a}v${t/2-o/2}z`}}function UA(e,t){let n={},r=this.format;r=WA(r,e,`x`),r=WA(r,e,`y`),this.format=r;for(let t in r){let i=r[t];if(i!==null&&i!==!1){if(t===`fx`||t===`fy`)n[t]=!0;else{let r=ZC(e,t);r&&(n[t]=r)}}}for(let t in e){if(t in n||t in r||LA.has(t)||(t===`x`||t===`y`)&&e.geometry)continue;let i=ZC(e,t);if(i){if(i.scale==null&&i.defaultScale===`color`)continue;n[t]=i}}this.facet&&(t.fx&&!(`fx`in r)&&(n.fx=!0),t.fy&&!(`fy`in r)&&(n.fy=!0));for(let e in n){let r=this.format[e];if(typeof r==`string`){let i=n[e]?.value??t[e]?.domain()??[];this.format[e]=(cS(i)?Rg:Bc)(r)}else if(r===void 0||r===!0){let n=t[e];this.format[e]=n?.bandwidth?Ck(n,n.domain()):RE}}return n}function WA(e,t,n){if(!(n in e))return e;let r=`${n}1`,i=`${n}2`;if((r in e||!(r in t))&&(i in e||!(i in t)))return e;let a=Object.entries(e),o=e[n];return a.splice(a.findIndex(([e])=>e===n)+1,0,[r,o],[i,o]),Object.fromEntries(a)}function GA(e,t,{title:n}){return this.format.title(n.value[e],e)}function*KA(e,t,n,r,i){for(let a in n){if(a===`fx`||a===`fy`){yield{label:YA(r,n,a),value:this.format[a](t[a],e)};continue}if(a===`x1`&&`x2`in n||a===`y1`&&`y2`in n)continue;let o=n[a];if(a===`x2`&&`x1`in n)yield{label:JA(r,n,`x`),value:qA(this.format.x2,n.x1,o,e)};else if(a===`y2`&&`y1`in n)yield{label:JA(r,n,`y`),value:qA(this.format.y2,n.y1,o,e)};else{let t=o.value[e],s=o.scale;if(!ob(t)&&s==null)continue;yield{label:YA(r,n,a),value:this.format[a](t,e),color:s===`color`?i[a][e]:null,opacity:s===`opacity`?i[a][e]:null}}}}function qA(e,t,n,r){return n.hint?.length?`${e(n.value[r]-t.value[r],r)}`:`${e(t.value[r],r)}–${e(n.value[r],r)}`}function JA(e,t,n){let r=YA(e,t,`${n}1`,n),i=YA(e,t,`${n}2`,n);return r===i?r:`${r}–${i}`}function YA(e,t,n,r=n){let i=t[n],a=e[i?.scale??n];return String(a?.label??i?.label??r)}function XA(e={}){let{facet:t,style:n,title:r,subtitle:i,caption:a,ariaLabel:o,ariaDescription:s}=e,c=dD(e.className),l=e.marks===void 0?[]:$A(e.marks);l.push(...uj(l));let u=sj(t,e),d=/* @__PURE__ */ new Map;for(let t of l){let n=cj(t,u,e);n&&d.set(t,n)}let f=/* @__PURE__ */ new Map;u&&aj(f,[u],e),aj(f,d,e);let p=$A(dj(l,f,e));for(let t of p){let n=cj(t,u,e);n&&d.set(t,n)}l.unshift(...p);let m=BT(f,e);if(m!==void 0){let e=u?cE(m,u):void 0;for(let t of l){if(t.facet===null||t.facet===`super`)continue;let n=d.get(t);n!==void 0&&(n.facetsIndex=t.fx!=null||t.fy!=null?cE(m,n):e)}let t=/* @__PURE__ */ new Set;for(let{facetsIndex:e}of d.values())e?.forEach((e,n)=>{e?.length>0&&t.add(n)});m.forEach(0<t.size&&t.size<m.length?(e,n)=>e.empty=!t.has(n):e=>e.empty=!1);for(let e of l)if(e.facet===`exclude`){let t=d.get(e);t!==void 0&&(t.facetsIndex=WT(t.facetsIndex))}}for(let t of q.keys())jx(e[t])&&t!==`fx`&&t!==`fy`&&f.set(t,[]);let h=/* @__PURE__ */ new Map;for(let t of l){if(h.has(t))throw Error(`duplicate mark; each mark must be unique`);let{facetsIndex:n,channels:r}=d.get(t)??{},{data:i,facets:a,channels:o}=t.initialize(n,r,e);nj(o,e),h.set(t,{data:i,facets:a,channels:o})}let g=fT(aj(f,h,e),e),_=yD(g,l,e);mT(g,_);let v=pT(g),{fx:y,fy:b}=v,x=y||b?vT(g,_):_,S=y||b?Sj(v,_):_,C=TE(e),w=C.document,T=Ct(`svg`).call(w.documentElement),E=T;C.ownerSVGElement=T,C.className=c,C.projection=fE(e,x),C.path=function(){return Md(this.projection??wE(v))},C.filterFacets=(e,t)=>cE(m,{channels:t,groups:HT(e,t)}),C.getMarkState=e=>{let t=h.get(e),n=d.get(e);return{...t,channels:{...t.channels,...n?.channels}}},C.dispatchValue=e=>{E.value!==e&&(E.value=e,E.dispatchEvent(new C.document.defaultView.Event(`input`,{bubbles:!0})))};let D=/* @__PURE__ */ new Set;for(let[t,n]of h)if(t.initializer!=null){let r=t.facet===`super`?S:x,i=t.initializer(n.data,n.facets,n.channels,v,r,C);if(i.data!==void 0&&(n.data=i.data),i.facets!==void 0&&(n.facets=i.facets),i.channels!==void 0){let{fx:r,fy:a,...o}=i.channels;ij(o),Object.assign(n.channels,o);for(let t of Object.values(o)){let{scale:n}=t;n!=null&&!PS(q.get(n))&&(rj(t,e),D.add(n))}(r!=null||a!=null)&&d.set(t,!0)}}if(D.size){let t=/* @__PURE__ */ new Map;aj(t,h,e,e=>D.has(e)),aj(f,h,e,e=>D.has(e));let n=xj(fT(t,e),g),{scales:r,...i}=pT(n);Object.assign(g,n),Object.assign(v,i),Object.assign(v.scales,r)}let O,k;m!==void 0&&(O={x:y?.domain(),y:b?.domain()},m=VT(m,O),k=UT(y,b,_));for(let[e,t]of h)t.values=e.scale(t.channels,v,C);let{width:A,height:ee}=_;vr(T).attr(`class`,c).attr(`fill`,`currentColor`).attr(`font-family`,`system-ui, sans-serif`).attr(`font-size`,10).attr(`text-anchor`,`middle`).attr(`width`,A).attr(`height`,ee).attr(`viewBox`,`0 0 ${A} ${ee}`).attr(`aria-label`,o).attr(`aria-description`,s).call(e=>e.append(`style`).text(`:where(.${c}) {
46
+ --plot-background: white;
47
+ display: block;
48
+ height: auto;
49
+ height: intrinsic;
50
+ max-width: 100%;
51
+ }
52
+ :where(.${c} text),
53
+ :where(.${c} tspan) {
54
+ white-space: pre;
55
+ }`)).call(fD,n);for(let e of l){let{channels:t,values:n,facets:r}=h.get(e);if(m===void 0||e.facet===`super`){let i=null;if(r&&(i=r[0],i=e.filter(i,t,n),i.length===0))continue;let a=e.render(i,v,n,S,C);if(a==null)continue;T.appendChild(a)}else{let i;for(let a of m){if(!(e.facetAnchor?.(m,O,a)??!a.empty))continue;let o=null;if(r){let i=d.has(e);if(o=r[i?a.i:0],o=e.filter(o,t,n),o.length===0)continue;!i&&o===r[0]&&(o=Vx(o)),o.fx=a.x,o.fy=a.y,o.fi=a.i}let s=e.render(o,v,n,x,C);if(s!=null){(i??=vr(T).append(`g`)).append(()=>s).datum(a);for(let e of[`aria-label`,`aria-description`,`aria-hidden`,`transform`])s.hasAttribute(e)&&(i.attr(e,s.getAttribute(e)),s.removeAttribute(e))}}i?.selectChildren().each(k)}}let te=Wk(g,C,e),{figure:ne=r!=null||i!=null||a!=null||te.length>0}=e;ne&&(E=w.createElement(`figure`),E.className=`${c}-figure`,E.style.maxWidth=`initial`,r!=null&&E.append(ZA(w,r,`h2`)),i!=null&&E.append(ZA(w,i,`h3`)),E.append(...te,T),a!=null&&E.append(QA(w,a)),`value`in T&&(E.value=T.value,delete T.value)),E.scale=RT(v.scales),E.legend=zk(g,C,e);let re=Bw();return re>0&&vr(T).append(`text`).attr(`x`,A).attr(`y`,20).attr(`dy`,`-1em`).attr(`text-anchor`,`end`).attr(`font-family`,`initial`).text(`⚠️`).append(`title`).text(`${re.toLocaleString(`en-US`)} warning${re===1?``:`s`}. Please check the console.`),E}function ZA(e,t,n){if(t.ownerDocument)return t;let r=e.createElement(n);return r.append(t),r}function QA(e,t){let n=e.createElement(`figcaption`);return n.append(t),n}function $A(e){return e.flat(1/0).filter(e=>e!=null).map(ej)}function ej(e){return typeof e.render==`function`?e:new tj(e)}var tj=class extends ${constructor(e){if(typeof e!=`function`)throw TypeError(`invalid mark; missing render function`);super(),this.render=e}render(){}};function nj(e,t){for(let n in e)rj(e[n],t);return e}function rj(e,t){let{scale:n,transform:r=!0}=e;if(n==null||!r)return;let{type:i,percent:a,interval:o,transform:s=a?e=>e==null?NaN:e*100:Yx(o,i)}=t[n]??{};s!=null&&(e.value=G(e.value,s),e.transform=!1)}function ij(e){for(let t in e)HC(t,e[t])}function aj(e,t,n,r=cx){for(let{channels:i}of t.values())for(let t in i){let a=i[t],{scale:o}=a;if(o!=null&&r(o)){if(o===`projection`){if(!bE(n)){let t=n.x?.domain===void 0,r=n.y?.domain===void 0;if(t||r){let[n,i]=CE(a);t&&oj(e,`x`,n),r&&oj(e,`y`,i)}}}else oj(e,o,a)}}return e}function oj(e,t,n){let r=e.get(t);r===void 0?e.set(t,[n]):r.push(n)}function sj(e,t){if(e==null)return;let{x:n,y:r}=e;if(n==null&&r==null)return;let i=Cx(e.data);if(i==null)throw Error(`missing facet data`);let a={};return n!=null&&(a.fx=zC(i,{value:n,scale:`fx`})),r!=null&&(a.fy=zC(i,{value:r,scale:`fy`})),nj(a,t),{channels:a,groups:HT(i,a),data:e.data}}function cj(e,t,n){if(e.facet===null||e.facet===`super`)return;let{fx:r,fy:i}=e;if(r!=null||i!=null){let t=Cx(e.data??r??i);if(t===void 0)throw Error(`missing facet data in ${e.ariaLabel}`);if(t===null)return;let a={};return r!=null&&(a.fx=zC(t,{value:r,scale:`fx`})),i!=null&&(a.fy=zC(t,{value:i,scale:`fy`})),nj(a,n),{channels:a,groups:HT(t,a)}}if(t===void 0)return;let{channels:a,groups:o,data:s}=t;if(e.facet!==`auto`||e.data===s)return{channels:a,groups:o};s.length>0&&(o.size>1||o.size===1&&a.fx&&a.fy&&[...o][0][1].size>1)&&Lx(Cx(e.data))===Lx(s)&&Vw(`Warning: the ${e.ariaLabel} mark appears to use faceted data, but isn’t faceted. The mark data has the same length as the facet data and the mark facet option is "auto", but the mark data and facet data are distinct. If this mark should be faceted, set the mark facet option to true; otherwise, suppress this warning by setting the mark facet option to false.`)}function lj(e,t={}){return WS({...t,x:null,y:null},(t,n,r,i,a,o)=>o.getMarkState(e))}function uj(e){let t=[];for(let n of e){let e=n.tip;if(e){e===!0?e={}:typeof e==`string`&&(e={pointer:e});let{pointer:r,preferredAnchor:i}=e;r=/^x$/i.test(r)?TD:/^y$/i.test(r)?ED:wD,e=r(lj(n,e)),e.title=null,i===void 0&&(e.preferredAnchor=r===ED?`left`:`bottom`);let a=zA(n.data,e);a.facet=n.facet,a.facetAnchor=n.facetAnchor,t.push(a)}}return t}function dj(e,t,n){let{projection:r,x:i={},y:a={},fx:o={},fy:s={},axis:c,grid:l,facet:u={},facet:{axis:d=c,grid:f}=u,x:{axis:p=c,grid:m=p===null?null:l}=i,y:{axis:h=c,grid:g=h===null?null:l}=a,fx:{axis:_=d,grid:v=_===null?null:f}=o,fy:{axis:y=d,grid:b=y===null?null:f}=s}=n;(r||!jx(i)&&!bj(`x`,e))&&(p=m=null),(r||!jx(a)&&!bj(`y`,e))&&(h=g=null),t.has(`fx`)||(_=v=null),t.has(`fy`)||(y=b=null),p===void 0&&(p=!yj(e,`x`)),h===void 0&&(h=!yj(e,`y`)),_===void 0&&(_=!yj(e,`fx`)),y===void 0&&(y=!yj(e,`fy`)),p===!0&&(p=`bottom`),h===!0&&(h=`left`),_===!0&&(_=p===`top`||p===null?`bottom`:`top`),y===!0&&(y=h===`right`||h===null?`left`:`right`);let x=[];return pj(x,b,pk,s),fj(x,y,rk,`right`,`left`,u,s),pj(x,v,hk,o),fj(x,_,ak,`top`,`bottom`,u,o),pj(x,g,fk,a),fj(x,h,nk,`left`,`right`,n,a),pj(x,m,mk,i),fj(x,p,ik,`bottom`,`top`,n,i),x}function fj(e,t,n,r,i,a,o){if(!t)return;let s=mj(t);o=hj(s?r:t,a,o);let{line:c}=o;(n===nk||n===ik)&&c&&!gS(c)&&e.push(FA(gj(o))),e.push(n(o)),s&&e.push(n({...o,anchor:i,label:null}))}function pj(e,t,n,r){t&&!gS(t)&&e.push(n(_j(t,r)))}function mj(e){return/^\s*both\s*$/i.test(e)}function hj(e,t,{line:n=t.line,ticks:r,tickSize:i,tickSpacing:a,tickPadding:o,tickFormat:s,tickRotate:c,fontVariant:l,ariaLabel:u,ariaDescription:d,label:f=t.label,labelAnchor:p,labelArrow:m=t.labelArrow,labelOffset:h}){return{anchor:e,line:n,ticks:r,tickSize:i,tickSpacing:a,tickPadding:o,tickFormat:s,tickRotate:c,fontVariant:l,ariaLabel:u,ariaDescription:d,label:f,labelAnchor:p,labelArrow:m,labelOffset:h}}function gj(e){let{anchor:t,line:n}=e;return{anchor:t,facetAnchor:t+`-empty`,stroke:n===!0?void 0:n}}function _j(e,{stroke:t=mS(e)?e:void 0,ticks:n=vj(e)?e:void 0,tickSpacing:r,ariaLabel:i,ariaDescription:a}){return{stroke:t,ticks:n,tickSpacing:r,ariaLabel:i,ariaDescription:a}}function vj(e){switch(typeof e){case`number`:return!0;case`string`:return!mS(e)}return aS(e)||typeof e?.range==`function`}function yj(e,t){let n=`${t}-axis `;return e.some(e=>e.ariaLabel?.startsWith(n))}function bj(e,t){for(let n of t)for(let t in n.channels){let{scale:r}=n.channels[t];if(r===e||r===`projection`)return!0}return!1}function xj(e,t){for(let n in e){let r=e[n],i=t[n];r.label===void 0&&i&&(r.label=i.label)}return e}function Sj({fx:e,fy:t},n){let{marginTop:r,marginRight:i,marginBottom:a,marginLeft:o,width:s,height:c}=_T(n),l=e&&Cj(e),u=t&&Cj(t);return{marginTop:t?u[0]:r,marginRight:e?s-l[1]:i,marginBottom:t?c-u[1]:a,marginLeft:e?l[0]:o,inset:{marginTop:n.marginTop,marginRight:n.marginRight,marginBottom:n.marginBottom,marginLeft:n.marginLeft},width:s,height:c}}function Cj(e){let t=e.domain();if(t.length===0)return[0,e.bandwidth()];let n=e(t[0]),r=e(t[t.length-1]);return r<n&&([n,r]=[r,n]),[n,r+e.bandwidth()]}let wj=/* @__PURE__ */ new Map([[`basis`,vy],[`basis-closed`,by],[`basis-open`,Sy],[`bundle`,wy],[`bump-x`,Bv],[`bump-y`,Vv],[`cardinal`,Dy],[`cardinal-closed`,ky],[`cardinal-open`,jy],[`catmull-rom`,Py],[`catmull-rom-closed`,Iy],[`catmull-rom-open`,Ry],[`linear`,Pv],[`linear-closed`,By],[`monotone-x`,Jy],[`monotone-y`,Yy],[`natural`,Qy],[`step`,eb],[`step-after`,nb],[`step-before`,tb]]);function Tj(e=Pv,t){if(typeof e==`function`)return e;let n=wj.get(`${e}`.toLowerCase());if(!n)throw Error(`unknown curve: ${e}`);if(t!==void 0){if(`beta`in n)return n.beta(t);if(`tension`in n)return n.tension(t);if(`alpha`in n)return n.alpha(t)}return n}function Ej(e=Dj,t){return typeof e!=`function`&&`${e}`.toLowerCase()===`auto`?Dj:Tj(e,t)}function Dj(e){return Pv(e)}function Oj(e={y:`count`},t={}){[e,t]=Fj(e,t);let{x:n,y:r}=t;return Pj(Ij(n,t,U),null,null,r,e,WD(t))}function kj(e={x:`count`},t={}){[e,t]=Fj(e,t);let{x:n,y:r}=t;return Pj(null,Ij(r,t,U),n,null,e,GD(t))}function Aj(e={fill:`count`},t={}){[e,t]=Fj(e,t);let{x:n,y:r}=Lj(t);return Pj(n,r,null,null,e,WD(GD(t)))}function jj(e,t,n={}){if(n?.interval==null)return n;let{reduce:r=OC}=n,i={filter:null};return n[t]!=null&&(i[t]=r),n[`${t}1`]!=null&&(i[`${t}1`]=r),n[`${t}2`]!=null&&(i[`${t}2`]=r),e(i,n)}function Mj(e={}){return jj(Oj,`y`,vD(e,`x`))}function Nj(e={}){return jj(kj,`x`,vD(e,`y`))}function Pj(e,t,n,r,{data:i=DC,filter:a=jC,sort:o,reverse:s,...c}={},l={}){e=Rj(e),t=Rj(t),c=Bj(c,l),i=Uj(i,U),o=o==null?void 0:Vj(`sort`,o,l),a=a==null?void 0:Hj(`filter`,a,l),n!=null&&cC(c,`x`,`x1`,`x2`)&&(n=null),r!=null&&cC(c,`y`,`y1`,`y2`)&&(r=null);let[u,d]=Gx(e),[f,p]=Gx(e),[m,h]=Gx(t),[g,_]=Gx(t),[v,y]=n==null?r==null?[]:[r,`y`]:[n,`x`],[b,x]=Gx(v),{x:S,y:C,z:w,fill:T,stroke:E,x1:D,x2:O,y1:k,y2:A,domain:ee,cumulative:te,thresholds:ne,interval:re,...j}=l,[ie,ae]=Gx(w),[oe]=yx(T),[se]=yx(E),[ce,le]=Gx(oe),[ue,de]=Gx(se);return{...`z`in l&&{z:ie||w},...`fill`in l&&{fill:ce||T},...`stroke`in l&&{stroke:ue||E},...US(j,(n,r,l)=>{let u=Jx(H(n,v),l?.[y]),f=H(n,w),m=H(n,oe),g=H(n,se),b=xC(c,{z:f,fill:m,stroke:g}),S=[],C=[],T=u&&x([]),E=f&&ae([]),D=m&&le([]),O=g&&de([]),k=e&&d([]),A=e&&p([]),ee=t&&h([]),te=t&&_([]),ne=qj(e,t,n),re=0;for(let e of c)e.initialize(n);o&&o.initialize(n),a&&a.initialize(n);for(let e of r){let t=[];for(let t of c)t.scope(`facet`,e);o&&o.scope(`facet`,e),a&&a.scope(`facet`,e);for(let[r,s]of pC(e,b))for(let[e,l]of pC(s,u))for(let[s,d]of ne(l))if(b&&(d.z=r),!a||a.reduce(s,d)){t.push(re++),C.push(i.reduceIndex(s,n,d)),u&&T.push(e),f&&E.push(b===f?r:f[(s.length>0?s:l)[0]]),m&&D.push(b===m?r:m[(s.length>0?s:l)[0]]),g&&O.push(b===g?r:g[(s.length>0?s:l)[0]]),k&&(k.push(d.x1),A.push(d.x2)),ee&&(ee.push(d.y1),te.push(d.y2));for(let e of c)e.reduce(s,d);o&&o.reduce(s,d)}S.push(t)}return SC(S,o,s),{data:C,facets:S}}),...!cC(c,`x`)&&(u?{x1:u,x2:f,x:qx(u,f)}:{x:S,x1:D,x2:O}),...!cC(c,`y`)&&(m?{y1:m,y2:g,y:qx(m,g)}:{y:C,y1:k,y2:A}),...b&&{[y]:b},...Object.fromEntries(c.map(({name:e,output:t})=>[e,t]))}}function Fj({cumulative:e,domain:t,thresholds:n,interval:r,...i},a){return[i,{cumulative:e,domain:t,thresholds:n,interval:r,...a}]}function Ij(e,{cumulative:t,domain:n,thresholds:r,interval:i},a){return e={...nS(e)},e.domain===void 0&&(e.domain=n),e.cumulative===void 0&&(e.cumulative=t),e.thresholds===void 0&&(e.thresholds=r),e.interval===void 0&&(e.interval=i),e.value===void 0&&(e.value=a),e.thresholds=zj(e.thresholds,e.interval),e}function Lj(e){let{x:t,y:n}=e;return t=Ij(t,e),n=Ij(n,e),[t.value,n.value]=Fx(t.value,n.value),{x:t,y:n}}function Rj(e){if(e==null)return;let{value:t,cumulative:n,domain:r=j,thresholds:i}=e,a=e=>{let a=H(e,t),o;if(cS(a)||Kj(i)){a=G(a,vx,Float64Array);let[e,t]=typeof r==`function`?r(a):r,n=typeof i==`function`&&!tS(i)?i(a,e,t):i;typeof n==`number`&&(n=ph(e,t,n)),tS(n)&&(r===j&&(e=n.floor(e),t=n.offset(n.floor(t))),n=n.range(e,n.offset(t))),o=n}else{a=hx(a);let[e,t]=typeof r==`function`?r(a):r,n=typeof i==`function`&&!tS(i)?i(a,e,t):i;if(typeof n==`number`){if(r===j){let r=Ee(e,t,n);if(isFinite(r)){if(r>0){let i=Math.round(e/r),a=Math.round(t/r);i*r<=e||--i,a*r>t||++a;let o=a-i+1;n=new Float64Array(o);for(let e=0;e<o;++e)n[e]=(i+e)*r}else if(r<0){r=-r;let i=Math.round(e*r),a=Math.round(t*r);i/r<=e||--i,a/r>t||++a;let o=a-i+1;n=new Float64Array(o);for(let e=0;e<o;++e)n[e]=(i+e)/r}else n=[e]}else n=[e]}else n=Te(e,t,n)}else tS(n)&&(r===j&&(e=n.floor(e),t=n.offset(n.floor(t))),n=n.range(e,n.offset(t)));o=n}let s=[];if(o.length===1)s.push([o[0],o[0]]);else for(let e=1;e<o.length;++e)s.push([o[e-1],o[e]]);return s.bin=(n<0?Xj:n>0?Yj:Jj)(s,o,a),s};return a.label=Kx(t),a}function zj(e,t,n=Gj){if(e===void 0)return t===void 0?n:Qx(t);if(typeof e==`string`){switch(e.toLowerCase()){case`freedman-diaconis`:return ze;case`scott`:return Be;case`sturges`:return ke;case`auto`:return Gj}return Lb(e)}return e}function Bj(e,t){return lC(e,t,Vj)}function Vj(e,t,n){return uC(e,t,n,Hj)}function Hj(e,t,n){return fC(e,t,n,Uj)}function Uj(e,t){return mC(e,t,Wj)}function Wj(e){switch(`${e}`.toLowerCase()){case`x`:return Qj;case`x1`:return eM;case`x2`:return tM;case`y`:return $j;case`y1`:return nM;case`y2`:return rM;case`z`:return LC}throw Error(`invalid bin reduce: ${e}`)}function Gj(e,t,n){return Math.min(200,Be(e,t,n))}function Kj(e){return eS(e)||aS(e)&&cS(e)}function qj(e,t,n){let r=e?.(n),i=t?.(n);return r&&i?function*(e){let t=r.bin(e);for(let[e,[a,o]]of r.entries()){let r=i.bin(t[e]);for(let[e,[t,s]]of i.entries())yield[r[e],{data:n,x1:a,y1:t,x2:o,y2:s}]}}:r?function*(e){let t=r.bin(e);for(let[e,[i,a]]of r.entries())yield[t[e],{data:n,x1:i,x2:a}]}:function*(e){let t=i.bin(e);for(let[e,[r,a]]of i.entries())yield[t[e],{data:n,y1:r,y2:a}]}}function Jj(e,t,n){return t=hx(t),r=>{let i=e.map(()=>[]);for(let e of r)i[_(t,n[e])-1]?.push(e);return i}}function Yj(e,t,n){let r=Jj(e,t,n);return e=>{let t=r(e);for(let e=1,n=t.length;e<n;++e){let n=t[e-1],r=t[e];for(let e of n)r.push(e)}return t}}function Xj(e,t,n){let r=Jj(e,t,n);return e=>{let t=r(e);for(let e=t.length-2;e>=0;--e){let n=t[e+1],r=t[e];for(let e of n)r.push(e)}return t}}function Zj(e,t){let n=(+e+ +t)/2;return e instanceof Date?new Date(n):n}let Qj={reduceIndex(e,t,{x1:n,x2:r}){return Zj(n,r)}},$j={reduceIndex(e,t,{y1:n,y2:r}){return Zj(n,r)}},eM={reduceIndex(e,t,{x1:n}){return n}},tM={reduceIndex(e,t,{x2:n}){return n}},nM={reduceIndex(e,t,{y1:n}){return n}},rM={reduceIndex(e,t,{y2:n}){return n}},iM={ariaLabel:`area`,strokeWidth:1,strokeLinecap:`round`,strokeLinejoin:`round`,strokeMiterlimit:1};var aM=class extends ${constructor(e,t={}){let{x1:n,y1:r,x2:i,y2:a,z:o,curve:s,tension:c}=t;super(e,{x1:{value:n,scale:`x`},y1:{value:r,scale:`y`},x2:{value:i,scale:`x`,optional:!0},y2:{value:a,scale:`y`,optional:!0},z:{value:Ix(t),optional:!0}},t,iM),this.z=o,this.curve=Tj(s,c)}filter(e){return e}render(e,t,n,r,i){let{x1:a,y1:o,x2:s=a,y2:c=o}=n;return J(`svg:g`,i).call(Y,this,r,i).call(Q,this,t,0,0).call(t=>t.selectAll().data($E(e,[a,o,s,c],this,n)).enter().append(`path`).call(X,this).call(XE,this,n).attr(`d`,Rv().curve(this.curve).defined(e=>e>=0).x0(e=>a[e]).y0(e=>o[e]).x1(e=>s[e]).y1(e=>c[e]))).node()}};function oM(e,t){return t===void 0?cM(e,{x:ux,y:dx}):new aM(e,t)}function sM(e,t){let{y:n=ox,...r}=Nj(t);return new aM(e,eA(Gk({...r,y1:n,y2:void 0},n===ox?`x2`:`x`)))}function cM(e,t){let{x:n=ox,...r}=Mj(t);return new aM(e,tA(Kk({...r,x1:n,x2:void 0},n===ox?`y2`:`y`)))}let lM={ariaLabel:`link`,fill:`none`,stroke:`currentColor`,strokeMiterlimit:1};var uM=class extends ${constructor(e,t={}){let{x1:n,y1:r,x2:i,y2:a,curve:o,tension:s}=t;super(e,{x1:{value:n,scale:`x`},y1:{value:r,scale:`y`},x2:{value:i,scale:`x`,optional:!0},y2:{value:a,scale:`y`,optional:!0}},t,lM),this.curve=Ej(o,s),MD(this,t)}project(e,t,n){this.curve!==Dj&&super.project(e,t,n)}render(e,t,n,r,i){let{x1:a,y1:o,x2:s=a,y2:c=o}=n,{curve:l}=this;return J(`svg:g`,i).call(Y,this,r,i).call(Q,this,t).call(t=>t.selectAll().data(e).enter().append(`path`).call(X,this).attr(`d`,l===Dj&&i.projection?dM(i.path(),a,o,s,c):e=>{let t=bs(),n=l(t);return n.lineStart(),n.point(a[e],o[e]),n.point(s[e],c[e]),n.lineEnd(),t}).call(YE,this,n).call(BD,this,n,i)).node()}};function dM(e,t,n,r,i){return t=hx(t),n=hx(n),r=hx(r),i=hx(i),a=>e({type:`LineString`,coordinates:[[t[a],n[a]],[r[a],i[a]]]})}function fM(e,{x:t,x1:n,x2:r,y:i,y1:a,y2:o,...s}={}){return[n,r]=pM(t,n,r),[a,o]=pM(i,a,o),new uM(e,{...s,x1:n,x2:r,y1:a,y2:o})}function pM(e,t,n){if(e===void 0){if(t===void 0){if(n!==void 0)return[n]}else if(n===void 0)return[t]}else if(t===void 0)return n===void 0?[e]:[e,n];else if(n===void 0)return[e,t];return[t,n]}let mM={ariaLabel:`arrow`,fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeMiterlimit:1,strokeWidth:1.5};var hM=class extends ${constructor(e,t={}){let{x1:n,y1:r,x2:i,y2:a,bend:o=0,headAngle:s=60,headLength:c=8,inset:l=0,insetStart:u=l,insetEnd:d=l,sweep:f}=t;super(e,{x1:{value:n,scale:`x`},y1:{value:r,scale:`y`},x2:{value:i,scale:`x`,optional:!0},y2:{value:a,scale:`y`,optional:!0}},t,mM),this.bend=o===!0?22.5:Math.max(-90,Math.min(90,o)),this.headAngle=+s,this.headLength=+c,this.insetStart=+u,this.insetEnd=+d,this.sweep=gM(f)}render(e,t,n,r,i){let{x1:a,y1:o,x2:s=a,y2:c=o,SW:l}=n,{strokeWidth:u,bend:d,headAngle:f,headLength:p,insetStart:m,insetEnd:h}=this,g=l?e=>l[e]:px(u===void 0?1:u),_=f*jD/2,v=p/1.5;return J(`svg:g`,i).call(Y,this,r,i).call(Q,this,t).call(t=>t.selectAll().data(e).enter().append(`path`).call(X,this).attr(`d`,e=>{let t=a[e],n=o[e],r=s[e],i=c[e],l=Math.hypot(r-t,i-n);if(l<=m+h)return null;let u=Math.atan2(i-n,r-t),f=Math.min(v*g(e),l/3),p=this.sweep(t,n,r,i)*d*jD,y=Math.hypot(l/Math.tan(p),l)/2;if(m||h){if(y<1e5){let e=Math.sign(p),[a,o]=_M([t,n],[r,i],y,e);if(m&&([t,n]=vM([a,o,y],[t,n,m],-e*Math.sign(m))),h){let[t,n]=vM([a,o,y],[r,i,h],e*Math.sign(h));u+=Math.atan2(n-o,t-a)-Math.atan2(i-o,r-a),r=t,i=n}}else{let e=r-t,a=i-n,o=Math.hypot(e,a);m&&(t+=e/o*m,n+=a/o*m),h&&(r-=e/o*h,i-=a/o*h)}}let b=u+p,x=b+_,S=b-_,C=r-f*Math.cos(x),w=i-f*Math.sin(x),T=r-f*Math.cos(S),E=i-f*Math.sin(S),D=y<1e5?`A${y},${y} 0,0,${+(p>0)} `:`L`,O=f?`M${C},${w}L${r},${i}L${T},${E}`:``;return`M${t},${n}${D}${r},${i}${O}`}).call(YE,this,n)).node()}};function gM(e=1){if(typeof e==`number`)return px(Math.sign(e));if(typeof e==`function`)return(t,n,r,i)=>Math.sign(e(t,n,r,i));switch(Sx(e,`sweep`,[`+x`,`-x`,`+y`,`-y`])){case`+x`:return(e,t,n)=>u(e,n);case`-x`:return(e,t,n)=>d(e,n);case`+y`:return(e,t,n,r)=>u(t,r);case`-y`:return(e,t,n,r)=>d(t,r)}}function _M([e,t],[n,r],i,a){let o=n-e,s=r-t,c=Math.hypot(o,s),l=a*Math.sqrt(i*i-c*c/4)/c;return[(e+n)/2-s*l,(t+r)/2+o*l]}function vM([e,t,n],[r,i,a],o){let s=r-e,c=i-t,l=Math.hypot(s,c),u=(s*s+c*c-a*a+n*n)/(2*l),d=o*Math.sqrt(n*n-u*u);return[e+(s*u+c*d)/l,t+(c*u-s*d)/l]}function yM(e,{x:t,x1:n,x2:r,y:i,y1:a,y2:o,...s}={}){return[n,r]=pM(t,n,r),[a,o]=pM(i,a,o),new hM(e,{...s,x1:n,x2:r,y1:a,y2:o})}let bM={ariaLabel:`bar`};var xM=class extends ${constructor(e,t,n={},r=bM){super(e,t,n,r),wA(this,n),TA(this,n)}render(e,t,n,r,i){let{rx:a,ry:o,rx1y1:s,rx1y2:c,rx2y1:l,rx2y2:u}=this,d=this._x(t,n,r),f=this._y(t,n,r),p=this._width(t,n,r),m=this._height(t,n,r);return J(`svg:g`,i).call(Y,this,r,i).call(this._transform,this,t).call(t=>t.selectAll().data(e).enter().call(s||c||l||u?e=>e.append(`path`).call(X,this).call(EA,d,f,SM(d,p),SM(f,m),this).call(YE,this,n):e=>e.append(`rect`).call(X,this).attr(`x`,d).attr(`width`,p).attr(`y`,f).attr(`height`,m).call(Z,`rx`,a).call(Z,`ry`,o).call(YE,this,n))).node()}_x(e,{x:t},{marginLeft:n}){let{insetLeft:r}=this;return t?e=>t[e]+r:n+r}_y(e,{y:t},{marginTop:n}){let{insetTop:r}=this;return t?e=>t[e]+r:n+r}_width({x:e},{x:t},{marginRight:n,marginLeft:r,width:i}){let{insetLeft:a,insetRight:o}=this,s=t&&e?e.bandwidth():i-n-r;return Math.max(0,s-a-o)}_height({y:e},{y:t},{marginTop:n,marginBottom:r,height:i}){let{insetTop:a,insetBottom:o}=this,s=t&&e?e.bandwidth():i-n-r;return Math.max(0,s-a-o)}};function SM(e,t){return typeof e==`function`&&typeof t==`function`?n=>e(n)+t(n):typeof e==`function`?n=>e(n)+t:typeof t==`function`?n=>e+t(n):e+t}var CM=class extends xM{constructor(e,t={},n){let{x1:r,x2:i,y:a}=t;super(e,{x1:{value:r,scale:`x`},x2:{value:i,scale:`x`},y:{value:a,scale:`y`,type:`band`,optional:!0}},t,n)}_transform(e,t,{x:n}){e.call(Q,t,{x:n},0,0)}_x({x:e},{x1:t,x2:n},{marginLeft:r}){let{insetLeft:i}=this;return PT(e)?r+i:e=>Math.min(t[e],n[e])+i}_width({x:e},{x1:t,x2:n},{marginRight:r,marginLeft:i,width:a}){let{insetLeft:o,insetRight:s}=this;return PT(e)?a-r-i-o-s:e=>Math.max(0,Math.abs(n[e]-t[e])-o-s)}},wM=class extends xM{constructor(e,t={},n){let{x:r,y1:i,y2:a}=t;super(e,{y1:{value:i,scale:`y`},y2:{value:a,scale:`y`},x:{value:r,scale:`x`,type:`band`,optional:!0}},t,n)}_transform(e,t,{y:n}){e.call(Q,t,{y:n},0,0)}_y({y:e},{y1:t,y2:n},{marginTop:r}){let{insetTop:i}=this;return PT(e)?r+i:e=>Math.min(t[e],n[e])+i}_height({y:e},{y1:t,y2:n},{marginTop:r,marginBottom:i,height:a}){let{insetTop:o,insetBottom:s}=this;return PT(e)?a-r-i-o-s:e=>Math.max(0,Math.abs(n[e]-t[e])-o-s)}};function TM(e,t={}){return kx(t)||(t={...t,y:ox,x2:U}),new CM(e,eA(QD(Gk(t))))}function EM(e,t={}){return kx(t)||(t={...t,x:ox,y2:U}),new wM(e,tA($D(Kk(t))))}let DM={ariaLabel:`cell`};var OM=class extends xM{constructor(e,{x:t,y:n,...r}={}){super(e,{x:{value:t,scale:`x`,type:`band`,optional:!0},y:{value:n,scale:`y`,type:`band`,optional:!0}},r,DM)}_transform(e,t){e.call(Q,t,{},0,0)}};function kM(e,{x:t,y:n,...r}={}){return[t,n]=Fx(t,n),new OM(e,{...r,x:t,y:n})}function AM(e,{x:t=ox,fill:n,stroke:r,...i}={}){return n===void 0&&yx(r)[0]===void 0&&(n=U),new OM(e,{...i,x:t,fill:n,stroke:r})}function jM(e,{y:t=ox,fill:n,stroke:r,...i}={}){return n===void 0&&yx(r)[0]===void 0&&(n=U),new OM(e,{...i,y:t,fill:n,stroke:r})}let MM={ariaLabel:`dot`,fill:`none`,stroke:`currentColor`,strokeWidth:1.5};function NM(e){return e.sort===void 0&&e.reverse===void 0?$S({channel:`-r`},e):e}var PM=class extends ${constructor(e,t={}){let{x:n,y:r,r:i,rotate:a,symbol:o=Wv,frameAnchor:s}=t,[c,l]=bx(a,0),[u,d]=HS(o),[f,p]=bx(i,u==null?3:4.5);super(e,{x:{value:n,scale:`x`,optional:!0},y:{value:r,scale:`y`,optional:!0},r:{value:f,scale:`r`,filter:db,optional:!0},rotate:{value:c,optional:!0},symbol:{value:u,scale:`auto`,optional:!0}},NM(t),MM),this.r=p,this.rotate=l,this.symbol=d,this.frameAnchor=yS(s);let{channels:m}=this,{symbol:h}=m;if(h){let{fill:e,stroke:t}=m;h.hint={fill:e?e.value===h.value?`color`:`currentColor`:this.fill??`currentColor`,stroke:t?t.value===h.value?`color`:`currentColor`:this.stroke??`none`}}}render(e,t,n,r,i){let{x:a,y:o}=t,{x:s,y:c,r:l,rotate:u,symbol:d}=n,{r:f,rotate:p,symbol:m}=this,[h,g]=pD(this,r),_=m===Wv,v=l?void 0:f*f*Math.PI;return fb(f)&&(e=[]),J(`svg:g`,i).call(Y,this,r,i).call(Q,this,{x:s&&a,y:c&&o}).call(t=>t.selectAll().data(e).enter().append(_?`circle`:`path`).call(X,this).call(_?e=>{e.attr(`cx`,s?e=>s[e]:h).attr(`cy`,c?e=>c[e]:g).attr(`r`,l?e=>l[e]:f)}:e=>{e.attr(`transform`,cO`translate(${s?e=>s[e]:h},${c?e=>c[e]:g})${u?e=>` rotate(${u[e]})`:p?` rotate(${p})`:``}`).attr(`d`,l&&d?e=>{let t=bs();return d[e].draw(t,l[e]*l[e]*Math.PI),t}:l?e=>{let t=bs();return m.draw(t,l[e]*l[e]*Math.PI),t}:d?e=>{let t=bs();return d[e].draw(t,v),t}:(()=>{let e=bs();return m.draw(e,v),e})())}).call(YE,this,n)).node()}};function FM(e,{x:t,y:n,...r}={}){return r.frameAnchor===void 0&&([t,n]=Fx(t,n)),new PM(e,{...r,x:t,y:n})}function IM(e,{x:t=U,...n}={}){return new PM(e,tO({...n,x:t}))}function LM(e,{y:t=U,...n}={}){return new PM(e,eO({...n,y:t}))}function RM(e,t){return FM(e,{...t,symbol:`circle`})}function zM(e,t){return FM(e,{...t,symbol:`hexagon`})}let BM={ariaLabel:`line`,fill:`none`,stroke:`currentColor`,strokeWidth:1.5,strokeLinecap:`round`,strokeLinejoin:`round`,strokeMiterlimit:1};var VM=class extends ${constructor(e,t={}){let{x:n,y:r,z:i,curve:a,tension:o}=t;super(e,{x:{value:n,scale:`x`},y:{value:r,scale:`y`},z:{value:Ix(t),optional:!0}},t,BM),this.z=i,this.curve=Ej(a,o),MD(this,t)}filter(e){return e}project(e,t,n){this.curve!==Dj&&super.project(e,t,n)}render(e,t,n,r,i){let{x:a,y:o}=n,{curve:s}=this;return J(`svg:g`,i).call(Y,this,r,i).call(Q,this,t).call(t=>t.selectAll().data($E(e,[a,o],this,n)).enter().append(`path`).call(X,this).call(XE,this,n).call(VD,this,n,i).attr(`d`,s===Dj&&i.projection?HM(i.path(),a,o):Lv().curve(s).defined(e=>e>=0).x(e=>a[e]).y(e=>o[e]))).node()}};function HM(e,t,n){return t=hx(t),n=hx(n),r=>{let i=[],a=[i];for(let e of r)e===-1?(i=[],a.push(i)):i.push([t[e],n[e]]);return e({type:`MultiLineString`,coordinates:a})}}function UM(e,{x:t,y:n,...r}={}){return[t,n]=Fx(t,n),new VM(e,{...r,x:t,y:n})}function WM(e,{x:t=U,y:n=ox,...r}={}){return new VM(e,Nj({...r,x:t,y:n}))}function GM(e,{x:t=ox,y:n=U,...r}={}){return new VM(e,Mj({...r,x:t,y:n}))}function KM(e,t){t=YM(t);let{x:n,y:r,color:i,size:a}=t,o=XM(e,n),s=XM(e,r),c=XM(e,i),l=XM(e,a),{fx:u,fy:d,x:{value:f,reduce:p,zero:m,...h},y:{value:g,reduce:_,zero:v,...y},color:{value:b,color:x,reduce:S},size:{value:C,reduce:w},mark:T}=t;if(p===void 0&&(p=_==null&&f==null&&C==null&&g!=null?`count`:null),_===void 0&&(_=p==null&&g==null&&C==null&&f!=null?`count`:null),w===void 0&&C==null&&S==null&&p==null&&_==null&&(f==null||sS(o))&&(g==null||sS(s))&&(w=`count`),m===void 0&&(m=QM(p)?!0:void 0),v===void 0&&(v=QM(_)?!0:void 0),f==null&&g==null)throw Error(`must specify x or y`);if(p!=null&&g==null)throw Error(`reducing x requires y`);if(_!=null&&f==null)throw Error(`reducing y requires x`);T===void 0&&(T=C!=null||w!=null?`dot`:QM(p)||QM(_)||S!=null?`bar`:f!=null&&g!=null?sS(o)||sS(s)||p==null&&_==null&&!JM(o)&&!JM(s)?`dot`:`line`:f!=null||g!=null?`rule`:null);let E,D,O;switch(T){case`dot`:O=FM,D=`stroke`;break;case`line`:O=o&&s||p!=null||_!=null?v||_!=null||o&&JM(o)?GM:m||p!=null||s&&JM(s)?WM:UM:o?WM:GM,D=`stroke`,tN(c)&&(E=null);break;case`area`:O=!(v||_!=null)&&(m||p!=null||s&&JM(s))?sM:cM,D=`fill`,tN(c)&&(E=null);break;case`rule`:O=o?aO:oO,D=`stroke`;break;case`bar`:O=p==null?_==null?S!=null||w!=null?o&&sS(o)&&s&&sS(s)?kM:o&&sS(o)?EM:s&&sS(s)?TM:kA:o&&dS(o)&&!(s&&dS(s))?TM:s&&dS(s)&&!(o&&dS(o))?EM:kM:sS(o)?$M(_)&&s&&sS(s)?kM:EM:jA:sS(s)?$M(p)&&o&&sS(o)?kM:TM:AA,D=`fill`;break;default:throw Error(`invalid mark: ${T}`)}let k={fx:u,fy:d,x:o??void 0,y:s??void 0,[D]:c??x,z:E,r:l??void 0,tip:!0},A,ee={[D]:S??void 0,r:w??void 0};if(p!=null&&_!=null)throw Error(`cannot reduce both x and y`);return _==null?p==null?(S!=null||w!=null)&&(o&&s?A=sS(o)&&sS(s)?oC:sS(o)?kj:sS(s)?Oj:Aj:o?A=sS(o)?iC:Oj:s&&(A=sS(s)?aC:kj)):(ee.x=p,A=sS(s)?aC:kj):(ee.y=_,A=sS(o)?iC:Oj),(A===Aj||A===Oj)&&(k.x={value:o,...h}),(A===Aj||A===kj)&&(k.y={value:s,...y}),m===void 0&&(m=o&&A!==Aj&&A!==Oj&&(O===TM||O===sM||O===AA||O===oO)),v===void 0&&(v=s&&A!==Aj&&A!==kj&&(O===EM||O===cM||O===jA||O===aO)),{fx:u??null,fy:d??null,x:{value:f??null,reduce:p??null,zero:!!m,...h},y:{value:g??null,reduce:_??null,zero:!!v,...y},color:{value:b??null,reduce:S??null,...x!==void 0&&{color:x}},size:{value:C??null,reduce:w??null},mark:T,markImpl:rN[O],markOptions:k,transformImpl:rN[A],transformOptions:ee,colorMode:D}}function qM(e,t){let n=KM(e,t),{fx:r,fy:i,x:{zero:a},y:{zero:o},markOptions:s,transformOptions:c,colorMode:l}=n,u=nN[n.markImpl],d=nN[n.transformImpl],f=r!=null||i!=null?FA({strokeOpacity:.1}):null,p=[a?aO([0]):null,o?oO([0]):null],m=u(e,d?d(c,s):s);return l===`stroke`?mD(f,p,m):mD(f,m,p)}function JM(e){let t,n;for(let r of e){if(r==null)continue;if(t===void 0){t=r;continue}let e=Math.sign(u(t,r));if(e){if(n!==void 0&&e!==n)return!1;t=r,n=e}}return!0}function YM({x:e,y:t,color:n,size:r,fx:i,fy:a,mark:o}={}){return Mx(e)||(e=ZM(e)),Mx(t)||(t=ZM(t)),Mx(n)||(n=mS(n)?{color:n}:ZM(n)),Mx(r)||(r=ZM(r)),Mx(i)&&({value:i}=ZM(i)),Mx(a)&&({value:a}=ZM(a)),o!=null&&(o=`${o}`.toLowerCase()),{x:e,y:t,color:n,size:r,fx:i,fy:a,mark:o}}function XM(e,t){let n=H(e,t.value);return n&&(n.label=Kx(t.value)),n}function ZM(e){return eN(e)?{reduce:e}:{value:e}}function QM(e){return/^(?:distinct|count|sum|proportion)$/i.test(e)}function $M(e){return/^(?:first|last|mode)$/i.test(e)}function eN(e){if(e==null)return!1;if(typeof e.reduceIndex==`function`||typeof e.reduce==`function`&&Ax(e)||/^p\d{2}$/i.test(e))return!0;switch(`${e}`.toLowerCase()){case`first`:case`last`:case`count`:case`distinct`:case`sum`:case`proportion`:case`proportion-facet`:case`deviation`:case`min`:case`min-index`:case`max`:case`max-index`:case`mean`:case`median`:case`variance`:case`mode`:return!0}return!1}function tN(e){return e?new oe(e).size>e.length>>1:!1}let nN={dot:FM,line:UM,lineX:WM,lineY:GM,areaX:sM,areaY:cM,ruleX:aO,ruleY:oO,barX:TM,barY:EM,rect:kA,rectX:AA,rectY:jA,cell:kM,bin:Aj,binX:Oj,binY:kj,group:oC,groupX:iC,groupY:aC},rN=Object.fromEntries(Object.entries(nN).map(([e,t])=>[t,e]));function iN(e,t={}){let{x:n,x1:r,x2:i}=t;n===void 0&&r===void 0&&i===void 0&&(t={...t,x:n=U});let a={};return n!=null&&(a.x=e),r!=null&&(a.x1=e),i!=null&&(a.x2=e),oN(a,t)}function aN(e,t={}){let{y:n,y1:r,y2:i}=t;n===void 0&&r===void 0&&i===void 0&&(t={...t,y:n=U});let a={};return n!=null&&(a.y=e),r!=null&&(a.y1=e),i!=null&&(a.y2=e),oN(a,t)}function oN(e={},t={}){let n=Ix(t),r=Object.entries(e).map(([e,n])=>{let r=Ux(e,t);if(r==null)throw Error(`missing channel: ${e}`);let[i,a]=Wx(r);return{key:e,input:r,output:i,setOutput:a,map:sN(n)}});return{...US(t,(e,t)=>{let i=H(e,n),a=r.map(({input:t})=>H(e,t)),o=r.map(({setOutput:t})=>t(Array(e.length)));for(let e of t)for(let t of i?fe(e,e=>i[e]).values():[e])r.forEach(({map:e},n)=>e.mapIndex(t,a[n],o[n]));return{data:e,facets:t}}),...Object.fromEntries(r.map(({key:e,output:t})=>[e,t]))}}function sN(e){if(e==null)throw Error(`missing map`);if(typeof e.mapIndex==`function`)return e;if(typeof e.map==`function`&&Ax(e))return cN(e);if(typeof e==`function`)return uN(Bx(e));switch(`${e}`.toLowerCase()){case`cumsum`:return dN;case`rank`:return uN((e,t)=>Ye(e,e=>t[e]));case`quantile`:return uN((e,t)=>lN(e,e=>t[e]))}throw Error(`invalid map: ${e}`)}function cN(e){return console.warn(`deprecated map interface; implement mapIndex instead.`),{mapIndex:e.map.bind(e)}}function lN(e,t){let n=E(e,t)-1;return Ye(e,t).map(e=>e/n)}function uN(e){return{mapIndex(t,n,r){let i=e(t,n);if(i.length!==t.length)throw Error(`map function returned a mismatched length`);for(let e=0,n=t.length;e<n;++e)r[t[e]]=i[e]}}}let dN={mapIndex(e,t,n){let r=0;for(let i of e)n[i]=r+=t[i]}};function fN(e={},t){return arguments.length===1&&(t=e),iN(mN(e),t)}function pN(e={},t){return arguments.length===1&&(t=e),aN(mN(e),t)}function mN(e={}){typeof e==`number`&&(e={k:e});let{k:t,reduce:n,shift:r,anchor:i,strict:a}=e;if(i===void 0&&r!==void 0&&(i=gN(r),Vw(`Warning: the shift option is deprecated; please use anchor "${i}" instead.`)),!((t=Math.floor(t))>0))throw Error(`invalid k: ${t}`);return _N(n)(t,hN(i,t),a)}function hN(e=`middle`,t){switch(`${e}`.toLowerCase()){case`middle`:return t-1>>1;case`start`:return 0;case`end`:return t-1}throw Error(`invalid anchor: ${e}`)}function gN(e){switch(`${e}`.toLowerCase()){case`centered`:return`middle`;case`leading`:return`start`;case`trailing`:return`end`}throw Error(`invalid shift: ${e}`)}function _N(e=`mean`){if(typeof e==`string`){if(/^p\d{2}$/i.test(e))return vN(mx(e));switch(e.toLowerCase()){case`deviation`:return vN(re);case`max`:return yN((e,t)=>Ae(e,e=>t[e]));case`mean`:return xN;case`median`:return vN(He);case`min`:return yN((e,t)=>Me(e,e=>t[e]));case`mode`:return yN((e,t)=>Ge(e,e=>t[e]));case`sum`:return bN;case`variance`:return vN(ne);case`difference`:return EN;case`ratio`:return DN;case`first`:return ON;case`last`:return kN}}if(typeof e!=`function`)throw Error(`invalid reduce: ${e}`);return yN(Bx(e))}function vN(e){return(t,n,r)=>r?{mapIndex(r,i,a){let o=e=>i[e]==null?NaN:+i[e],s=0;for(let e=0;e<t-1;++e)isNaN(o(e))&&++s;for(let i=0,c=r.length-t+1;i<c;++i)isNaN(o(i+t-1))&&++s,a[r[i+n]]=s===0?e(Vx(r,i,i+t),o):NaN,isNaN(o(i))&&--s}}:{mapIndex(r,i,a){let o=e=>i[e]==null?NaN:+i[e];for(let i=-n;i<0;++i)a[r[i+n]]=e(Vx(r,0,i+t),o);for(let i=0,s=r.length-n;i<s;++i)a[r[i+n]]=e(Vx(r,i,i+t),o)}}}function yN(e){return(t,n,r)=>r?{mapIndex(r,i,a){let o=0;for(let e=0;e<t-1;++e)o+=ob(i[r[e]]);for(let s=0,c=r.length-t+1;s<c;++s)o+=ob(i[r[s+t-1]]),o===t&&(a[r[s+n]]=e(Vx(r,s,s+t),i)),o-=ob(i[r[s]])}}:{mapIndex(r,i,a){for(let o=-n;o<0;++o)a[r[o+n]]=e(Vx(r,0,o+t),i);for(let o=0,s=r.length-n;o<s;++o)a[r[o+n]]=e(Vx(r,o,o+t),i)}}}function bN(e,t,n){return n?{mapIndex(n,r,i){let a=0,o=0;for(let t=0;t<e-1;++t){let e=r[n[t]];e===null||isNaN(e)?++a:o+=+e}for(let s=0,c=n.length-e+1;s<c;++s){let c=r[n[s]],l=r[n[s+e-1]];l===null||isNaN(l)?++a:o+=+l,i[n[s+t]]=a===0?o:NaN,c===null||isNaN(c)?--a:o-=+c}}}:{mapIndex(n,r,i){let a=0,o=n.length;for(let i=0,s=Math.min(o,e-t-1);i<s;++i)a+=+r[n[i]]||0;for(let s=-t,c=o-t;s<c;++s)a+=+r[n[s+e-1]]||0,i[n[s+t]]=a,a-=+r[n[s]]||0}}}function xN(e,t,n){if(n){let r=bN(e,t,n);return{mapIndex(n,i,a){r.mapIndex(n,i,a);for(let r=0,i=n.length-e+1;r<i;++r)a[n[r+t]]/=e}}}return{mapIndex(n,r,i){let a=0,o=0,s=n.length;for(let i=0,c=Math.min(s,e-t-1);i<c;++i){let e=r[n[i]];e!==null&&!isNaN(e=+e)&&(a+=e,++o)}for(let c=-t,l=s-t;c<l;++c){let s=r[n[c+e-1]],l=r[n[c]];s!==null&&!isNaN(s=+s)&&(a+=s,++o),i[n[c+t]]=a/o,l!==null&&!isNaN(l=+l)&&(a-=l,--o)}}}}function SN(e,t,n,r){for(let i=n+r;n<i;++n){let r=e[t[n]];if(ob(r))return r}}function CN(e,t,n,r){for(let i=n+r-1;i>=n;--i){let n=e[t[i]];if(ob(n))return n}}function wN(e,t,n,r){for(let i=n+r;n<i;++n){let r=e[t[n]];if(r!==null&&!isNaN(r=+r))return r}}function TN(e,t,n,r){for(let i=n+r-1;i>=n;--i){let n=e[t[i]];if(n!==null&&!isNaN(n=+n))return n}}function EN(e,t,n){return n?{mapIndex(n,r,i){for(let a=0,o=n.length-e;a<o;++a){let o=r[n[a]],s=r[n[a+e-1]];i[n[a+t]]=o===null||s===null?NaN:s-o}}}:{mapIndex(n,r,i){for(let a=-t,o=n.length-e+t+1;a<o;++a)i[n[a+t]]=TN(r,n,a,e)-wN(r,n,a,e)}}}function DN(e,t,n){return n?{mapIndex(n,r,i){for(let a=0,o=n.length-e;a<o;++a){let o=r[n[a]],s=r[n[a+e-1]];i[n[a+t]]=o===null||s===null?NaN:s/o}}}:{mapIndex(n,r,i){for(let a=-t,o=n.length-e+t+1;a<o;++a)i[n[a+t]]=TN(r,n,a,e)/wN(r,n,a,e)}}}function ON(e,t,n){return n?{mapIndex(n,r,i){for(let a=0,o=n.length-e;a<o;++a)i[n[a+t]]=r[n[a]]}}:{mapIndex(n,r,i){for(let a=-t,o=n.length-e+t+1;a<o;++a)i[n[a+t]]=SN(r,n,a,e)}}}function kN(e,t,n){return n?{mapIndex(n,r,i){for(let a=0,o=n.length-e;a<o;++a)i[n[a+t]]=r[n[a+e-1]]}}:{mapIndex(n,r,i){for(let a=-t,o=n.length-e+t+1;a<o;++a)i[n[a+t]]=CN(r,n,a,e)}}}let AN={n:20,k:2,color:`currentColor`,opacity:.2,strict:!0,anchor:`end`};function jN(e,{x:t=U,y:n,k:r=AN.k,color:i=AN.color,opacity:a=AN.opacity,fill:o=i,fillOpacity:s=a,stroke:c=i,strokeOpacity:l,strokeWidth:u,...d}={}){return mD(K(o)?null:sM(e,oN({x1:NN({k:-r,...d}),x2:NN({k:r,...d})},{x1:t,x2:t,y:n,fill:o,fillOpacity:s,...d})),K(c)?null:WM(e,oN({x:NN(d)},{x:t,y:n,stroke:c,strokeOpacity:l,strokeWidth:u,...d})))}function MN(e,{x:t,y:n=U,k:r=AN.k,color:i=AN.color,opacity:a=AN.opacity,fill:o=i,fillOpacity:s=a,stroke:c=i,strokeOpacity:l,strokeWidth:u,...d}={}){return mD(K(o)?null:cM(e,oN({y1:NN({k:-r,...d}),y2:NN({k:r,...d})},{x:t,y1:n,y2:n,fill:o,fillOpacity:s,...d})),K(c)?null:GM(e,oN({y:NN(d)},{x:t,y:n,stroke:c,strokeOpacity:l,strokeWidth:u,...d})))}function NN({n:e=AN.n,k:t=0,strict:n=AN.strict,anchor:r=AN.anchor}={}){return mN({k:e,reduce:e=>Ve(e)+t*(re(e)||0),strict:n,anchor:r})}let PN={ariaLabel:`tick`,fill:null,stroke:`currentColor`};var FN=class extends ${constructor(e,t,n){super(e,t,n,PN),MD(this,n)}render(e,t,n,r,i){return J(`svg:g`,i).call(Y,this,r,i).call(this._transform,this,t).call(a=>a.selectAll().data(e).enter().append(`line`).call(X,this).attr(`x1`,this._x1(t,n,r)).attr(`x2`,this._x2(t,n,r)).attr(`y1`,this._y1(t,n,r)).attr(`y2`,this._y2(t,n,r)).call(YE,this,n).call(BD,this,n,i)).node()}},IN=class extends FN{constructor(e,t={}){let{x:n,y:r,inset:i=0,insetTop:a=i,insetBottom:o=i}=t;super(e,{x:{value:n,scale:`x`},y:{value:r,scale:`y`,type:`band`,optional:!0}},t),this.insetTop=W(a),this.insetBottom=W(o)}_transform(e,t,{x:n}){e.call(Q,t,{x:n},zE,0)}_x1(e,{x:t}){return e=>t[e]}_x2(e,{x:t}){return e=>t[e]}_y1({y:e},{y:t},{marginTop:n}){let{insetTop:r}=this;return t&&e?e=>t[e]+r:n+r}_y2({y:e},{y:t},{height:n,marginBottom:r}){let{insetBottom:i}=this;return t&&e?n=>t[n]+e.bandwidth()-i:n-r-i}},LN=class extends FN{constructor(e,t={}){let{x:n,y:r,inset:i=0,insetRight:a=i,insetLeft:o=i}=t;super(e,{y:{value:r,scale:`y`},x:{value:n,scale:`x`,type:`band`,optional:!0}},t),this.insetRight=W(a),this.insetLeft=W(o)}_transform(e,t,{y:n}){e.call(Q,t,{y:n},0,zE)}_x1({x:e},{x:t},{marginLeft:n}){let{insetLeft:r}=this;return t&&e?e=>t[e]+r:n+r}_x2({x:e},{x:t},{width:n,marginRight:r}){let{insetRight:i}=this;return t&&e?n=>t[n]+e.bandwidth()-i:n-r-i}_y1(e,{y:t}){return e=>t[e]}_y2(e,{y:t}){return e=>t[e]}};function RN(e,{x:t=U,...n}={}){return new IN(e,{...n,x:t})}function zN(e,{y:t=U,...n}={}){return new LN(e,{...n,y:t})}function BN(e,{x:t=U,y:n=null,r,fill:i=`#ccc`,fillOpacity:a,stroke:o=`currentColor`,strokeOpacity:s,strokeWidth:c=2,sort:l,...u}={}){let d=n==null?rC:aC;return mD(oO(e,d({x1:UN,x2:WN},{x:t,y:n,stroke:o,strokeOpacity:s,...u})),TM(e,d({x1:`p25`,x2:`p75`},{x:t,y:n,fill:i,fillOpacity:a,...u})),RN(e,d({x:`p50`},{x:t,y:n,stroke:o,strokeOpacity:s,strokeWidth:c,sort:l,...u})),FM(e,oN({x:HN},{x:t,y:n,z:n,r,stroke:o,strokeOpacity:s,...u})))}function VN(e,{y:t=U,x:n=null,r,fill:i=`#ccc`,fillOpacity:a,stroke:o=`currentColor`,strokeOpacity:s,strokeWidth:c=2,sort:l,...u}={}){let d=n==null?rC:iC;return mD(aO(e,d({y1:UN,y2:WN},{x:n,y:t,stroke:o,strokeOpacity:s,...u})),EM(e,d({y1:`p25`,y2:`p75`},{x:n,y:t,fill:i,fillOpacity:a,...u})),zN(e,d({y:`p50`},{x:n,y:t,stroke:o,strokeOpacity:s,strokeWidth:c,sort:l,...u})),FM(e,oN({y:HN},{x:n,y:t,z:n,r,stroke:o,strokeOpacity:s,...u})))}function HN(e){let t=UN(e),n=WN(e);return e.map(e=>e<t||e>n?e:NaN)}function UN(e){let t=GN(e)*2.5-KN(e)*1.5;return Me(e,e=>e>=t?e:NaN)}function WN(e){let t=KN(e)*2.5-GN(e)*1.5;return Ae(e,e=>e<=t?e:NaN)}function GN(e){return Le(e,.25)}function KN(e){return Le(e,.75)}let qN={ariaLabel:`raster`,stroke:null,pixelSize:1};function JN(e,t){let n=+e;if(isNaN(n))throw Error(`invalid ${t}: ${e}`);return n}function YN(e,t){let n=Math.floor(e);if(isNaN(n))throw Error(`invalid ${t}: ${e}`);return n}var XN=class extends ${constructor(e,t,n={},r){let{width:i,height:a,x:o,y:s,x1:c=o==null?0:void 0,y1:l=s==null?0:void 0,x2:u=o==null?i:void 0,y2:d=s==null?a:void 0,pixelSize:f=r.pixelSize,blur:p=0,interpolate:m}=n;if(i!=null&&(i=YN(i,`width`)),a!=null&&(a=YN(a,`height`)),c!=null&&(c=JN(c,`x1`)),l!=null&&(l=JN(l,`y1`)),u!=null&&(u=JN(u,`x2`)),d!=null&&(d=JN(d,`y2`)),o==null&&(c==null||u==null))throw Error(`missing x`);if(s==null&&(l==null||d==null))throw Error(`missing y`);e!=null&&i!=null&&a!=null&&(o===void 0&&c!=null&&u!=null&&(o=hP(c,u,i,a)),s===void 0&&l!=null&&d!=null&&(s=gP(l,d,i,a))),super(e,{x:{value:o,scale:`x`,optional:!0},y:{value:s,scale:`y`,optional:!0},x1:{value:c==null?null:[c],scale:`x`,optional:!0,filter:null},y1:{value:l==null?null:[l],scale:`y`,optional:!0,filter:null},x2:{value:u==null?null:[u],scale:`x`,optional:!0,filter:null},y2:{value:d==null?null:[d],scale:`y`,optional:!0,filter:null},...t},n,r),this.width=i,this.height=a,this.pixelSize=JN(f,`pixelSize`),this.blur=JN(p,`blur`),this.interpolate=o==null||s==null?null:rP(m)}},ZN=class extends XN{constructor(e,t={}){let{imageRendering:n}=t;if(e==null){let{fill:e,fillOpacity:n}=t;bx(n)[0]!==void 0&&(t=nP(`fillOpacity`,t)),yx(e)[0]!==void 0&&(t=nP(`fill`,t))}super(e,void 0,t,qN),this.imageRendering=cD(n,`auto`)}scale(e,{color:t,...n},r){return super.scale(e,n,r)}render(e,t,n,r,i){let a=t[n.channels.fill?.scale]??(e=>e),{x:o,y:s}=n,{document:c}=i,[l,u,d,f]=eP(n,r,i),p=d-l,m=f-u,{pixelSize:h,width:g=Math.round(Math.abs(p)/h),height:_=Math.round(Math.abs(m)/h)}=this,v=g*_,{fill:b,fillOpacity:x}=n,S=0;if(this.interpolate){let t=g/p,n=_/m,r=G(o,e=>(e-l)*t,Float64Array),i=G(s,e=>(e-u)*n,Float64Array);b&&=this.interpolate(e,g,_,r,i,b),x&&=this.interpolate(e,g,_,r,i,x)}else this.data==null&&e&&(S=e.fi*v);let C=c.createElement(`canvas`);C.width=g,C.height=_;let w=C.getContext(`2d`),T=w.createImageData(g,_),E=T.data,{r:D,g:O,b:k}=Gr(this.fill)??{r:0,g:0,b:0},A=(this.fillOpacity??1)*255;for(let e=0;e<v;++e){let t=e<<2;if(b){let n=a(b[e+S]);if(n==null){E[t+3]=0;continue}({r:D,g:O,b:k}=Gr(n))}x&&(A=x[e+S]*255),E[t+0]=D,E[t+1]=O,E[t+2]=k,E[t+3]=A}return this.blur>0&&y(T,this.blur),w.putImageData(T,0,0),J(`svg:g`,i).call(Y,this,r,i).call(Q,this,t).call(e=>e.append(`image`).attr(`transform`,`translate(${l},${u}) scale(${Math.sign(d-l)},${Math.sign(f-u)})`).attr(`width`,Math.abs(p)).attr(`height`,Math.abs(m)).attr(`preserveAspectRatio`,`none`).call(Z,`image-rendering`,this.imageRendering).call(X,this).attr(`xlink:href`,C.toDataURL())).node()}};function QN(e,t,n){arguments.length<3&&(n=t,t=null);let{x:r,y:i,[e]:a,...o}=n;return r===void 0&&i===void 0&&iS(t)&&(r=ux,i=dx,a===void 0&&(a=fx)),[t,{...o,x:r,y:i,[e]:a}]}function $N(){let[e,t]=QN(`fill`,...arguments);return new ZN(e,e==null||t.fill!==void 0||t.fillOpacity!==void 0?t:{...t,fill:U})}function eP({x1:e,y1:t,x2:n,y2:r},i,{projection:a}){let{width:o,height:s,marginTop:c,marginRight:l,marginBottom:u,marginLeft:d}=i;return[e&&a==null?e[0]:d,t&&a==null?t[0]:c,n&&a==null?n[0]:o-l,r&&a==null?r[0]:s-u]}function tP({x1:e,y1:t,x2:n,y2:r},i,a,o){let s={};return e&&(s.x1=e),t&&(s.y1=t),n&&(s.x2=n),r&&(s.y2=r),eP(VC(s,i),a,o)}function nP(e,t={}){let{[e]:n}=t;if(typeof n!=`function`)throw Error(`invalid ${e}: not a function`);return WS({...t,[e]:void 0},function(r,i,a,o,s,c){let{x:l,y:u}=o;if(!l)throw Error(`missing scale: x`);if(!u)throw Error(`missing scale: y`);let[d,f,p,m]=tP(a,o,s,c),h=p-d,g=m-f,{pixelSize:_}=this,{width:v=Math.round(Math.abs(h)/_),height:y=Math.round(Math.abs(g)/_)}=t,b=Array(v*y*(i?i.length:1)),x=h/v,S=g/y,C=0;for(let e of i??[void 0])for(let t=.5;t<y;++t)for(let r=.5;r<v;++r,++C)b[C]=n(l.invert(d+r*x),u.invert(f+t*S),e);return{data:b,facets:i,channels:{[e]:{value:b,scale:`auto`}}}})}function rP(e){if(typeof e==`function`)return e;if(e==null)return iP;switch(`${e}`.toLowerCase()){case`none`:return iP;case`nearest`:return uP;case`barycentric`:return aP();case`random-walk`:return dP()}throw Error(`invalid interpolate: ${e}`)}function iP(e,t,n,r,i,a){let o=Array(t*n);for(let s of e)r[s]<0||r[s]>=t||i[s]<0||i[s]>=n||(o[Math.floor(i[s])*t+Math.floor(r[s])]=a[s]);return o}function aP({random:e=Fp(42)}={}){return(t,n,r,i,a,o)=>{let{points:s,triangles:c,hull:l}=yc.from(t,e=>i[e],e=>a[e]),u=new o.constructor(n*r).fill(NaN),d=new Uint8Array(n*r),f=mP(o,e);for(let e=0;e<c.length;e+=3){let i=c[e],a=c[e+1],l=c[e+2],p=s[2*i],m=s[2*a],h=s[2*l],g=s[2*i+1],_=s[2*a+1],v=s[2*l+1],y=Math.min(p,m,h),b=Math.max(p,m,h),x=Math.min(g,_,v),S=Math.max(g,_,v),C=(_-v)*(p-h)+(g-v)*(h-m);if(!C)continue;let w=o[t[i]],T=o[t[a]],E=o[t[l]];for(let e=Math.floor(y);e<b;++e)for(let t=Math.floor(x);t<S;++t){if(e<0||e>=n||t<0||t>=r)continue;let i=e+.5,a=t+.5,o=Math.sign(C),s=(_-v)*(i-h)+(a-v)*(h-m);if(s*o<0)continue;let c=(v-g)*(i-h)+(a-v)*(p-h);if(c*o<0)continue;let l=C-(s+c);if(l*o<0)continue;let y=e+n*t;u[y]=f(w,s/C,T,c/C,E,l/C,e,t),d[y]=1}}return oP(u,d,i,a,o,n,r,l,t,f),u}}function oP(e,t,n,r,i,a,o,s,c,l){n=Float64Array.from(s,e=>n[c[e]]),r=Float64Array.from(s,e=>r[c[e]]),i=Array.from(s,e=>i[c[e]]);let u=n.length,d=Array.from({length:u},(e,t)=>lP(t,n,r)),f=0;for(let s=0;s<o;++s){let o=s+.5;for(let c=0;c<a;++c){let p=c+a*s;if(!t[p]){let t=c+.5;for(let a=0;a<u;++a){let m=(u+f+(a%2?(a+1)/2:-a/2))%u;if(d[m](t,o)){let a=sP(n.at(m-1),r.at(m-1),n[m],r[m],t,o);e[p]=l(i.at(m-1),a,i[m],1-a,i[m],0,c,s),f=m;break}}}}}}function sP(e,t,n,r,i,a){let o=n-e,s=r-t,c=o*(n-i)+s*(r-a),l=o*(i-e)+s*(a-t);return c>0&&l>0?c/(c+l):+(c>l)}function cP(e,t,n,r){return e*r-n*t}function lP(e,t,n){let r=t.length,i=t.at(e-2),a=n.at(e-2),o=t.at(e-1),s=n.at(e-1),c=t[e],l=n[e],u=t.at(e+1-r),d=n.at(e+1-r),f=o-c,p=s-l,m=i-o,h=a-s,g=c-u,_=l-d,v=Math.hypot(f,p),y=Math.hypot(m,h),b=Math.hypot(g,_);return(e,t)=>{let n=e-o,r=t-s,i=e-c,a=t-l;return cP(n,r,i,a)>-1e-6&&cP(n,r,f,p)*y-cP(n,r,m,h)*v>-1e-6&&cP(i,a,g,_)*v-cP(i,a,f,p)*b<=0}}function uP(e,t,n,r,i,a){let o=new a.constructor(t*n),s=yc.from(e,e=>r[e],e=>i[e]),c,l;for(let r=.5,i=0;r<n;++r){l=c;for(let n=.5;n<t;++n,++i)l=s.find(n,r,l),n===.5&&(c=l),o[i]=a[e[l]]}return o}function dP({random:e=Fp(42),minDistance:t=.5,maxSteps:n=2}={}){return(r,i,a,o,s,c)=>{let l=new c.constructor(i*a),u=yc.from(r,e=>o[e],e=>s[e]),d,f,p;for(let m=.5,h=0;m<a;++m){f=d;for(let a=.5;a<i;++a,++h){let i=a,g=m;p=f=u.find(i,g,f),a===.5&&(d=f);let _,v=0;for(;(_=Math.hypot(o[r[p]]-i,s[r[p]]-g))>t&&v<n;){let t=e(a,m,v)*2*Math.PI;i+=Math.cos(t)*_,g+=Math.sin(t)*_,p=u.find(i,g,p),++v}l[h]=c[r[p]]}}return l}}function fP(e,t,n,r,i,a){return t*e+r*n+a*i}function pP(e){return(t,n,r,i,a,o,s,c)=>{let l=e(s,c);return l<n?t:l<n+i?r:a}}function mP(e,t){return dS(e)||cS(e)?fP:pP(t)}function hP(e,t,n){return{transform(r){let i=r.length,a=new Float64Array(i),o=(t-e)/n,s=e+o/2;for(let e=0;e<i;++e)a[e]=e%n*o+s;return a}}}function gP(e,t,n,r){return{transform(i){let a=i.length,o=new Float64Array(a),s=(t-e)/r,c=e+s/2;for(let e=0;e<a;++e)o[e]=Math.floor(e/n)%r*s+c;return o}}}let _P={ariaLabel:`contour`,fill:`none`,stroke:`currentColor`,strokeMiterlimit:1,pixelSize:2};var vP=class extends XN{constructor(e,{smooth:t=!0,value:n,...r}={}){let i=WE({},r,_P);if(n===void 0){for(let e in i)if(i[e].value!=null){if(n!==void 0)throw Error(`ambiguous contour value`);n=r[e],r[e]=`value`}}if(n!=null){let e={transform:e=>e.map(e=>e.value),label:Kx(n)};for(let t in i)r[t]===`value`&&(r[t]=e)}if(e==null){if(n==null)throw Error(`missing contour value`);r=nP(`value`,{value:n,...r}),n=null}else{let{interpolate:e}=r;n===void 0&&(n=U),e===void 0&&(r.interpolate=`nearest`)}super(e,{value:{value:n,optional:!0}},yP(r),_P);let a={geometry:{value:U}};for(let e in this.channels){let t=this.channels[e],{scale:n}=t;n!==`x`&&n!==`y`&&e!==`value`&&(a[e]=t,delete this.channels[e])}this.contourChannels=a,this.smooth=!!t}filter(e,{x:t,y:n,value:r,...i},a){return super.filter(e,i,a)}render(e,t,n,r,i){let{geometry:a}=n,o=Md();return J(`svg:g`,i).call(Y,this,r,i).call(Q,this,t).call(t=>{t.selectAll().data(e).enter().append(`path`).call(X,this).attr(`d`,e=>o(a[e])).call(YE,this,n)}).node()}};function yP({thresholds:e,interval:t,...n}){return e=zj(e,t,ke),WS(n,function(t,n,r,i,a,o){let[s,c,l,u]=tP(r,i,a,o),d=l-s,f=u-c,{pixelSize:p,width:m=Math.round(Math.abs(d)/p),height:h=Math.round(Math.abs(f)/p)}=this,g=m/d,_=h/f,y=r.value.value,b=[];if(this.interpolate){let{x:e,y:t}=SE(r,i,o),a=G(e,e=>(e-s)*g,Float64Array),l=G(t,e=>(e-c)*_,Float64Array),u=[r.x,r.y,r.value],d=[a,l,y];for(let e of n){let t=this.filter(e,u,d);b.push(this.interpolate(t,m,h,a,l,y))}}else if(n){let e=m*h,t=n.length;for(let n=0;n<t;++n)b.push(y.slice(n*e,n*e+e))}else b.push(y);if(this.blur>0)for(let e of b)v({data:e,width:m,height:h},this.blur);let x=bP(e,y,...SP(b));if(x===null)throw Error(`unsupported thresholds: ${e}`);let{contour:S}=Ms().size([m,h]).smooth(this.smooth),C=[],w=[];for(let e of b)w.push(Je(C.length,C.push(...G(x,t=>S(e,t)))));for(let{coordinates:e}of C)for(let t of e)for(let e of t)for(let t of e)t[0]=t[0]/g+s,t[1]=t[1]/_+c;return{data:C,facets:w,channels:BC(this.contourChannels,C)}})}function bP(e,t,n,r){if(typeof e?.range==`function`)return e.range(e.floor(n),r);if(typeof e==`function`&&(e=e(t,n,r)),typeof e!=`number`)return wx(e);let i=Te(...Oe(n,r,e),e);for(;i[i.length-1]>=r;)i.pop();for(;i[1]<n;)i.shift();return i}function xP(){return new vP(...QN(`value`,...arguments))}function SP(e){return[Me(e,e=>Me(e,CP)),Ae(e,e=>Ae(e,CP))]}function CP(e){return isFinite(e)?e:NaN}function wP(e,t){return DP(wD,e,t)}function TP(e,t={}){return DP(TD,e,t)}function EP(e,t={}){return DP(ED,e,t)}function DP(e,t,n={}){let{x:r,y:i,maxRadius:a}=n,o=e({px:r,py:i,maxRadius:a}),s=[];r!=null&&s.push(aO(t,AP(`x`,{...o,inset:-6},n))),i!=null&&s.push(oO(t,AP(`y`,{...o,inset:-6},n))),r!=null&&s.push(pO(t,jP(`x`,{...o,dy:9,frameAnchor:`bottom`,lineAnchor:`top`},n))),i!=null&&s.push(pO(t,jP(`y`,{...o,dx:-9,frameAnchor:`left`,textAnchor:`end`},n)));for(let e of s)e.ariaLabel=`crosshair ${e.ariaLabel}`;return mD(...s)}function OP(e,{channels:t,...n},{facet:r,facetAnchor:i,fx:a,fy:o,[e]:s,channels:c,transform:l,initializer:u}){return{...n,facet:r,facetAnchor:i,fx:a,fy:o,[e]:s,channels:{...t,...c},transform:l,initializer:kP(e,u)}}function kP(e,t){return t==null?t:function(n,r,{x:i,y:a,px:o,py:s,...c},...l){let{channels:{x:u,y:d,...f}={},...p}=t.call(this,n,r,{...c,x:o,y:s},...l);return{channels:{...f,...u&&{px:u,...e===`x`&&{x:u}},...d&&{py:d,...e===`y`&&{y:d}}},...p}}}function AP(e,t,n){let{color:r=`currentColor`,opacity:i=.2,ruleStroke:a=r,ruleStrokeOpacity:o=i,ruleStrokeWidth:s}=n;return{...OP(e,t,n),stroke:a,strokeOpacity:o,strokeWidth:s}}function jP(e,t,n){let{color:r=`currentColor`,textFill:i=r,textFillOpacity:a,textStroke:o=`var(--plot-background)`,textStrokeOpacity:s,textStrokeWidth:c=5}=n;return{...OP(e,t,MP(e,n)),fill:i,fillOpacity:a,stroke:o,strokeOpacity:s,strokeWidth:c}}function MP(e,t){return WS(t,(t,n,r)=>({channels:{text:{value:ZC(r,e)?.value}}}))}let NP={ariaLabel:`delaunay link`,fill:`none`,stroke:`currentColor`,strokeMiterlimit:1},PP={ariaLabel:`delaunay mesh`,fill:null,stroke:`currentColor`,strokeOpacity:.2},FP={ariaLabel:`hull`,fill:`none`,stroke:`currentColor`,strokeWidth:1.5,strokeMiterlimit:1},IP={ariaLabel:`voronoi`,fill:`none`,stroke:`currentColor`,strokeMiterlimit:1},LP={ariaLabel:`voronoi mesh`,fill:null,stroke:`currentColor`,strokeOpacity:.2};var RP=class extends ${constructor(e,t={}){let{x:n,y:r,z:i,curve:a,tension:o}=t;super(e,{x:{value:n,scale:`x`,optional:!0},y:{value:r,scale:`y`,optional:!0},z:{value:i,optional:!0}},t,NP),this.curve=Tj(a,o),MD(this,t)}render(e,t,n,r,i){let{x:a,y:o}=t,{x:s,y:c,z:l}=n,{curve:u}=this,[d,f]=pD(this,r),p=s?e=>s[e]:px(d),m=c?e=>c[e]:px(f),h=this;function g(e){let t=-1,r=[],a={};for(let e in n)a[e]=[];let o=[],s=[],c=[],l=[];function d(i,u){i=e[i],u=e[u],r.push(++t),o[t]=p(i),c[t]=m(i),s[t]=p(u),l[t]=m(u);for(let e in n)a[e].push(n[e][u])}let{halfedges:f,hull:g,triangles:_}=yc.from(e,p,m);for(let e=0;e<f.length;++e){let t=f[e];t>e&&d(_[e],_[t])}for(let e=0;e<g.length;++e)d(g[e],g[(e+1)%g.length]);vr(this).selectAll().data(r).enter().append(`path`).call(X,h).attr(`d`,e=>{let t=bs(),n=u(t);return n.lineStart(),n.point(o[e],c[e]),n.point(s[e],l[e]),n.lineEnd(),t}).call(YE,h,a).call(BD,h,a,i)}return J(`svg:g`,i).call(Y,this,r,i).call(Q,this,{x:s&&a,y:c&&o}).call(l?t=>t.selectAll().data(fe(e,e=>l[e]).values()).enter().append(`g`).each(g):t=>t.datum(e).each(g)).node()}},zP=class extends ${constructor(e,t={},n,r=({z:e})=>e){let{x:i,y:a}=t;super(e,{x:{value:i,scale:`x`,optional:!0},y:{value:a,scale:`y`,optional:!0},z:{value:r(t),optional:!0}},t,n)}render(e,t,n,r,i){let{x:a,y:o}=t,{x:s,y:c,z:l}=n,[u,d]=pD(this,r),f=s?e=>s[e]:px(u),p=c?e=>c[e]:px(d),m=this;function h(e){let t=yc.from(e,f,p);vr(this).append(`path`).datum(e[0]).call(X,m).attr(`d`,m._render(t,r)).call(YE,m,n)}return J(`svg:g`,i).call(Y,this,r,i).call(Q,this,{x:s&&a,y:c&&o}).call(l?t=>t.selectAll().data(fe(e,e=>l[e]).values()).enter().append(`g`).each(h):t=>t.datum(e).each(h)).node()}},BP=class extends zP{constructor(e,t={}){super(e,t,PP),this.fill=`none`}_render(e){return e.render()}},VP=class extends zP{constructor(e,t={}){super(e,t,FP,Ix)}_render(e){return e.renderHull()}},HP=class extends ${constructor(e,t={}){let{x:n,y:r,z:i}=t;super(e,{x:{value:n,scale:`x`,optional:!0},y:{value:r,scale:`y`,optional:!0},z:{value:i,optional:!0}},WS(t,function(e,t,n,r,i,a){let{x:o,y:s,z:c}=n;({x:o,y:s}=SE(n,r,a)),c=c?.value;let l=Array((o??s).length).fill(null),[u,d]=pD(this,i),f=o?e=>o[e]:px(u),p=s?e=>s[e]:px(d);for(let e of t){o&&(e=e.filter(e=>ob(f(e)))),s&&(e=e.filter(e=>ob(p(e))));for(let[,t]of pC(e,c)){let e=WP(yc.from(t,f,p),i);for(let n=0,r=t.length;n<r;++n)l[t[n]]=e.renderCell(n)}}return{data:e,facets:t,channels:{cells:{value:l}}}}),IP)}render(e,t,n,r,i){let{x:a,y:o}=t,{x:s,y:c,cells:l}=n;return J(`svg:g`,i).call(Y,this,r,i).call(Q,this,{x:s&&a,y:c&&o}).call(t=>{t.selectAll().data(e).enter().append(`path`).call(X,this).attr(`d`,e=>l[e]).call(YE,this,n)}).node()}},UP=class extends zP{constructor(e,t){super(e,t,LP),this.fill=`none`}_render(e,t){return WP(e,t).render()}};function WP(e,t){let{width:n,height:r,marginTop:i,marginRight:a,marginBottom:o,marginLeft:s}=t;return e.voronoi([s,i,n-a,r-o])}function GP(e,t,{x:n,y:r,...i}={}){return[n,r]=Fx(n,r),new e(t,{...i,x:n,y:r})}function KP(e,t){return GP(RP,e,t)}function qP(e,t){return GP(BP,e,t)}function JP(e,t){return GP(VP,e,t)}function YP(e,{x:t,y:n,initializer:r,...i}={}){return GP(HP,e,{...US({...i,x:t,y:n},qk),initializer:r})}function XP(e,t){return GP(UP,e,t)}let ZP={ariaLabel:`density`,fill:`none`,stroke:`currentColor`,strokeMiterlimit:1};var QP=class extends ${constructor(e,{x:t,y:n,z:r,weight:i,fill:a,stroke:o,...s}={}){let c=nF(a)&&(a=`currentColor`,!0),l=nF(o)&&(o=`currentColor`,!0);super(e,{x:{value:t,scale:`x`,optional:!0},y:{value:n,scale:`y`,optional:!0},z:{value:Ix({z:r,fill:a,stroke:o}),optional:!0},weight:{value:i,optional:!0}},tF({...s,fill:a,stroke:o},c,l),ZP),c&&(this.fill=void 0),l&&(this.stroke=void 0),this.z=r}filter(e){return e}render(e,t,n,r,i){let{contours:a}=n,o=Md();return J(`svg:g`,i).call(Y,this,r,i).call(Q,this,{}).call(t=>t.selectAll().data(e).enter().append(`path`).call(X,this).call(YE,this,n).attr(`d`,e=>o(a[e]))).node()}};function $P(e,{x:t,y:n,...r}={}){return[t,n]=Fx(t,n),new QP(e,{...r,x:t,y:n})}let eF=/* @__PURE__ */ new Set([`x`,`y`,`z`,`weight`]);function tF(e,t,n){let{bandwidth:r,thresholds:i}=e;return r=r===void 0?20:+r,i=i===void 0?20:typeof i?.[Symbol.iterator]==`function`?hx(i):+i,WS(e,function(e,a,o,s,c,l){let u=o.weight?hx(o.weight.value):null,d=o.z?.value,{z:f}=this,[p,m]=pD(this,c),{width:h,height:g}=c,{x:_,y:v}=SE(o,s,l),y=Object.fromEntries(Object.entries(o).filter(([e])=>!eF.has(e)).map(([e,t])=>[e,{...t,value:[]}])),b=t&&[],x=n&&[],S=Bs().x(_?e=>_[e]:p).y(v?e=>v[e]:m).weight(u?e=>u[e]:1).size([h,g]).bandwidth(r),C=[];for(let e of a){let t=[];C.push(t);for(let n of d?QE(e,d,f):[e]){let e=S.contours(n);t.push([n,e])}}let w=i;if(!(w instanceof Gb)){let e=0;for(let t of C)for(let[,n]of t){let t=n.max;t>e&&(e=t)}w=Float64Array.from({length:i-1},(t,n)=>e*100*(n+1)/i)}let T=[],E=[];for(let e of C){let t=[];T.push(t);for(let[n,r]of e)for(let e of w){t.push(E.length),E.push(r(e/100)),b&&b.push(e),x&&x.push(e);for(let e in y)y[e].value.push(o[e].value[n[0]])}}return b&&b.push(0),x&&x.push(0),{data:e,facets:T,channels:{...y,...b&&{fill:{value:b,scale:`color`}},...x&&{stroke:{value:x,scale:`color`}},contours:{value:E}}}})}function nF(e){return/^density$/i.test(e)}function rF(e,t){return aF(`x`,e,t)}function iF(e,t){return aF(`y`,e,t)}function aF(e,t,{x1:n,x2:r,y1:i,y2:a,x:o=n===void 0&&r===void 0?e===`y`?ox:U:void 0,y:s=i===void 0&&a===void 0?e===`x`?ox:U:void 0,fill:c,positiveFill:l=`#3ca951`,negativeFill:u=`#4269d0`,fillOpacity:d=1,positiveFillOpacity:f=d,negativeFillOpacity:p=d,stroke:m,strokeOpacity:h,z:g=yx(m)[0],clip:_,tip:v,render:y,...b}={}){return[n,r]=oF(o,n,r),[i,a]=oF(s,i,a),n===r&&i===a&&(e===`y`?i=sF(0):n=sF(0)),{tip:v}=vD({tip:v},e===`y`?`x`:`y`),mD(K(l)?null:Object.assign(oM(t,{x1:n,x2:r,y1:i,y2:a,z:g,fill:l,fillOpacity:f,render:hD(y,cF(e,!0)),clip:_,...b}),{ariaLabel:`positive difference`}),K(u)?null:Object.assign(oM(t,{x1:n,x2:r,y1:i,y2:a,z:g,fill:u,fillOpacity:p,render:hD(y,cF(e,!1)),clip:_,...b}),{ariaLabel:`negative difference`}),UM(t,{x:r,y:a,z:g,stroke:m,strokeOpacity:h,tip:v,clip:!0,...b}))}function oF(e,t,n){return t===void 0&&n===void 0?t=n=sF(e):t===void 0?(n=sF(n),t=e===void 0?n:sF(e)):n===void 0?(t=sF(t),n=e===void 0?t:sF(e)):(t=sF(t),n=sF(n)),[t,n]}function sF(e){let t,{value:n,label:r=Kx(n)}=nS(e);return{transform:e=>t||=H(e,n),label:r}}function cF(e,t){let n=e===`x`?`y`:`x`,r=`${n}1`,i=`${n}2`,a=`${e}1`,o=`${e}2`;return(n,s,c,l,u,d)=>{let{[r]:f,[i]:p}=c,m=new Float32Array(f.length),h=new Float32Array(p.length),g=l[e===`y`?`height`:`width`];(t===gT(s[e])<0?m:h).fill(g);let _=d(n,s,{...c,[i]:f,[o]:h},l,u),v=d(n,s,{...c,[r]:p,[a]:m},l,u),y=_.querySelector(`g`)??_,b=v.querySelector(`g`)??v;for(let e=0;y.firstChild;e+=2){let t=HE(),n=J(`svg:clipPath`,u).attr(`id`,t).node();n.appendChild(y.firstChild),b.childNodes[e].setAttribute(`clip-path`,`url(#${t})`),b.insertBefore(n,b.childNodes[e])}return v}}function lF({geometry:e=U,...t}={}){let n=DE(t=>H(t,e));return WS({...t,x:null,y:null,geometry:{transform:n}},(e,t,r,i,a,o)=>{let s=n(e),c=s.length,l=new Float64Array(c),u=new Float64Array(c),{centroid:d}=o.path();for(let e=0;e<c;++e)[l[e],u[e]]=d(s[e]);return{data:e,facets:t,channels:{x:{value:l,scale:null,source:null},y:{value:u,scale:null,source:null}}}})}function uF({geometry:e=U,...t}={}){let n=DE(t=>H(t,e)),r=DE(e=>H(n(e),Yl));return{...t,x:{transform:e=>Float64Array.from(r(e),([e])=>e)},y:{transform:e=>Float64Array.from(r(e),([,e])=>e)},geometry:{transform:n}}}let dF={ariaLabel:`geo`,fill:`none`,stroke:`currentColor`,strokeWidth:1,strokeLinecap:`round`,strokeLinejoin:`round`,strokeMiterlimit:1};var fF=class extends ${constructor(e,t={}){let[n,r]=bx(t.r,3);super(e,{x:{value:t.tip?t.x:null,scale:`x`,optional:!0},y:{value:t.tip?t.y:null,scale:`y`,optional:!0},r:{value:n,scale:`r`,filter:db,optional:!0},geometry:{value:t.geometry,scale:`projection`}},NM(t),dF),this.r=r}render(e,t,n,r,i){let{geometry:a,r:o}=n,s=i.path(),{r:c}=this;return fb(c)?e=[]:c!==void 0&&s.pointRadius(c),J(`svg:g`,i).call(Y,this,r,i).call(Q,this,t).call(t=>{t.selectAll().data(e).enter().append(`path`).call(X,this).attr(`d`,o?e=>s.pointRadius(o[e])(a[e]):e=>s(a[e])).call(YE,this,n)}).node()}};function pF(e,t={}){return t.tip&&t.x===void 0&&t.y===void 0?t=lF(t):t.geometry===void 0&&(t={...t,geometry:U}),new fF(e,t)}function mF({strokeWidth:e=1.5,...t}={}){return pF({type:`Sphere`},{strokeWidth:e,...t})}function hF({strokeOpacity:e=.1,...t}={}){return pF(Du(),{strokeOpacity:e,...t})}let gF=.5;function _F(e={fill:`count`},{binWidth:t,...n}={}){let{z:r}=n;return t=t===void 0?20:W(t),e=gC(e,n),cC(e,`fill`)&&(n.channels={...n.channels,fill:{value:[]}}),n.symbol===void 0&&(n.symbol=`hexagon`),n.r===void 0&&!cC(e,`r`)&&(n.r=t/2),WS(n,(n,i,a,o,s,c)=>{let{x:l,y:u,z:d,fill:f,stroke:p,symbol:m}=a;if(l===void 0)throw Error(`missing channel: x`);if(u===void 0)throw Error(`missing channel: y`);({x:l,y:u}=SE(a,o,c)),d=d?d.value:H(n,r),f=f?.value,p=p?.value,m=m?.value;let h=xC(e,{z:d,fill:f,stroke:p,symbol:m}),g=d&&[],_=f&&[],v=p&&[],y=m&&[],b=[],x=[],S=[],C=-1;for(let t of e)t.initialize(n);for(let r of i){let i=[];for(let t of e)t.scope(`facet`,r);for(let[a,o]of pC(r,h))for(let{index:r,extent:s}of vF(n,o,l,u,t)){i.push(++C),x.push(s.x),S.push(s.y),d&&g.push(h===d?a:d[r[0]]),f&&_.push(h===f?a:f[r[0]]),p&&v.push(h===p?a:p[r[0]]),m&&y.push(h===m?a:m[r[0]]);for(let t of e)t.reduce(r,s)}b.push(i)}let w=a.x.scale,T=a.y.scale;return{data:n,facets:b,channels:{x:{value:x,source:o[w]?{value:G(x,o[w].invert),scale:w}:null},y:{value:S,source:o[T]?{value:G(S,o[T].invert),scale:T}:null},...d&&{z:{value:g}},...f&&{fill:{value:_,scale:`auto`}},...p&&{stroke:{value:v,scale:`auto`}},...m&&{symbol:{value:y,scale:`auto`}},...Object.fromEntries(e.map(({name:e,output:n})=>[e,{scale:`auto`,label:n.label,radius:e===`r`?t/2:void 0,value:n.transform()}]))}}})}function vF(e,t,n,r,i){let a=1.5/IS*i,o=/* @__PURE__ */ new Map;for(let s of t){let t=n[s],c=r[s];if(isNaN(t)||isNaN(c))continue;let l=Math.round(c=(c-0)/a),u=Math.round(t=(t-gF)/i-(l&1)/2),d=c-l;if(Math.abs(d)*3>1){let e=t-u,n=u+(t<u?-1:1)/2,r=l+(c<l?-1:1),i=t-n,a=c-r;e*e+d*d>i*i+a*a&&(u=n+(l&1?1:-1)/2,l=r)}let f=`${u},${l}`,p=o.get(f);p===void 0&&(p={index:[],extent:{data:e,x:(u+(l&1)/2)*i+gF,y:l*a+0}},o.set(f,p)),p.index.push(s)}return o.values()}let yF={ariaLabel:`hexgrid`,fill:`none`,stroke:`currentColor`,strokeOpacity:.1};function bF(e){return new xF(e)}var xF=class extends ${constructor({binWidth:e=20,clip:t=!0,...n}={}){super(ix,void 0,{clip:t,...n},yF),this.binWidth=W(e)}render(e,t,n,r,i){let{binWidth:a}=this,{marginTop:o,marginRight:s,marginBottom:c,marginLeft:l,width:u,height:d}=r,f=l-gF,p=u-s-gF,m=o-0,h=d-c-0,g=a/2,_=g*LS,v=_/2,y=g*2,b=_*1.5,x=Math.floor(f/y),S=Math.ceil(p/y),C=Math.floor((m+v)/b),w=Math.ceil((h-v)/b)+1,T=`m0,${SF(-_)}l${SF(g)},${SF(v)}v${SF(_)}l${SF(-g)},${SF(v)}`,E=T;for(let e=C;e<w;++e)for(let t=x;t<S;++t)E+=`M${SF(t*y+(e&1)*g)},${SF(e*b)}${T}`;return J(`svg:g`,i).datum(0).call(Y,this,r,i).call(Q,this,{},zE+gF,zE+0).call(e=>e.append(`path`).call(X,this).call(YE,this,n).attr(`d`,E)).node()}};function SF(e){return Math.round(e*1e3)/1e3}let CF={ariaLabel:`image`,fill:null,stroke:null};function wF(e){return/^\.*\//.test(e)}function TF(e){return/^(blob|data|file|http|https):/i.test(e)}function EF(e){return typeof e==`string`&&(wF(e)||TF(e))?[void 0,e]:[e,void 0]}var DF=class extends ${constructor(e,t={}){let{x:n,y:r,r:i,width:a,height:o,rotate:s,src:c,preserveAspectRatio:l,crossOrigin:u,frameAnchor:d,imageRendering:f}=t;i??=void 0,i===void 0&&a===void 0&&o===void 0?a=o=16:a===void 0&&o!==void 0?a=o:o===void 0&&a!==void 0&&(o=a);let[p,m]=EF(c),[h,g]=bx(i),[_,v]=bx(a,g===void 0?void 0:g*2),[y,b]=bx(o,g===void 0?void 0:g*2),[x,S]=bx(s,0);super(e,{x:{value:n,scale:`x`,optional:!0},y:{value:r,scale:`y`,optional:!0},r:{value:h,scale:`r`,filter:db,optional:!0},width:{value:_,filter:db,optional:!0},height:{value:y,filter:db,optional:!0},rotate:{value:x,optional:!0},src:{value:p,optional:!0}},NM(t),CF),this.src=m,this.width=v,this.rotate=S,this.height=b,this.r=g,this.preserveAspectRatio=cD(l,`xMidYMid`),this.crossOrigin=lx(u),this.frameAnchor=yS(d),this.imageRendering=cD(f,`auto`)}render(e,t,n,r,i){let{x:a,y:o}=t,{x:s,y:c,width:l,height:u,r:d,rotate:f,src:p}=n,{r:m,width:h,height:g,rotate:_}=this,[v,y]=pD(this,r);return J(`svg:g`,i).call(Y,this,r,i).call(Q,this,{x:s&&a,y:c&&o}).call(t=>t.selectAll().data(e).enter().append(`image`).call(X,this).attr(`x`,OF(s,l,d,v,h,m)).attr(`y`,OF(c,u,d,y,g,m)).attr(`width`,l?e=>l[e]:h===void 0?d?e=>d[e]*2:m*2:h).attr(`height`,u?e=>u[e]:g===void 0?d?e=>d[e]*2:m*2:g).attr(`transform`,f?e=>`rotate(${f[e]})`:_?`rotate(${_})`:null).attr(`transform-origin`,f||_?cO`${s?e=>s[e]:v}px ${c?e=>c[e]:y}px`:null).call(Z,`href`,p?e=>p[e]:this.src).call(Z,`preserveAspectRatio`,this.preserveAspectRatio).call(Z,`crossorigin`,this.crossOrigin).call(Z,`image-rendering`,this.imageRendering).call(Z,`clip-path`,d?e=>`circle(${d[e]}px)`:m===void 0?null:`circle(${m}px)`).call(YE,this,n)).node()}};function OF(e,t,n,r,i,a){return t&&e?n=>e[n]-t[n]/2:t?e=>r-t[e]/2:e&&i!==void 0?t=>e[t]-i/2:i===void 0?n&&e?t=>e[t]-n[t]:n?e=>r-n[e]:e?t=>e[t]-a:r-a:r-i/2}function kF(e,{x:t,y:n,...r}={}){return r.frameAnchor===void 0&&([t,n]=Fx(t,n)),new DF(e,{...r,x:t,y:n})}function AF(e,t,n){var r=1e-8,i=t-1,a=n-1,o=0,s,c,l,u,d,f,p,m,h,g,_;if(e<=0)return 0;if(e>=1)return 1;for(t>=1&&n>=1?(l=e<.5?e:1-e,u=Math.sqrt(-2*Math.log(l)),p=(2.30753+u*.27061)/(1+u*(.99229+u*.04481))-u,e<.5&&(p=-p),m=(p*p-3)/6,h=2/(1/(2*t-1)+1/(2*n-1)),g=p*Math.sqrt(m+h)/h-(1/(2*n-1)-1/(2*t-1))*(m+5/6-2/(3*h)),p=t/(t+n*Math.exp(2*g))):(s=Math.log(t/(t+n)),c=Math.log(n/(t+n)),u=Math.exp(t*s)/t,d=Math.exp(n*c)/n,g=u+d,p=e<u/g?(t*g*e)**(1/t):1-(n*g*(1-e))**(1/n)),_=-NF(t)-NF(n)+NF(t+n);o<10;o++){if(p===0||p===1)return p;if(f=jF(p,t,n)-e,u=Math.exp(i*Math.log(p)+a*Math.log(1-p)+_),d=f/u,p-=u=d/(1-.5*Math.min(1,d*(i/p-a/(1-p)))),p<=0&&(p=.5*(p+u)),p>=1&&(p=.5*(p+u+1)),Math.abs(u)<r*p&&o>0)break}return p}function jF(e,t,n){var r=e===0||e===1?0:Math.exp(NF(t+n)-NF(t)-NF(n)+t*Math.log(e)+n*Math.log(1-e));return e<0||e>1?!1:e<(t+1)/(t+n+2)?r*MF(e,t,n)/t:1-r*MF(1-e,n,t)/n}function MF(e,t,n){var r=1e-30,i=1,a=t+n,o=t+1,s=t-1,c=1,l=1-a*e/o,u,d,f,p;for(Math.abs(l)<r&&(l=r),l=1/l,p=l;i<=100&&(u=2*i,d=i*(n-i)*e/((s+u)*(t+u)),l=1+d*l,Math.abs(l)<r&&(l=r),c=1+d/c,Math.abs(c)<r&&(c=r),l=1/l,p*=l*c,d=-(t+i)*(a+i)*e/((t+u)*(o+u)),l=1+d*l,Math.abs(l)<r&&(l=r),c=1+d/c,Math.abs(c)<r&&(c=r),l=1/l,f=l*c,p*=f,!(Math.abs(f-1)<3e-7));i++);return p}function NF(e){var t=0,n=[76.18009172947146,-86.5053203294167,24.01409824083091,-1.231739572450155,.001208650973866179,-5395239384953e-18],r=1.000000000190015,i,a,o=(a=i=e)+5.5;for(o-=(i+.5)*Math.log(o);t<6;t++)r+=n[t]/++a;return Math.log(2.506628274631*r/i)-o}function PF(e,t){var n=AF(2*Math.min(e,1-e),.5*t,.5);return n=Math.sqrt(t*(1-n)/n),e>.5?n:-n}let FF={ariaLabel:`linear-regression`,fill:`currentColor`,fillOpacity:.1,stroke:`currentColor`,strokeWidth:1.5,strokeLinecap:`round`,strokeLinejoin:`round`,strokeMiterlimit:1};var IF=class extends ${constructor(e,t={}){let{x:n,y:r,z:i,ci:a=.95,precision:o=4}=t;if(super(e,{x:{value:n,scale:`x`},y:{value:r,scale:`y`},z:{value:Ix(t),optional:!0}},t,FF),this.z=i,this.ci=+a,this.precision=+o,!(0<=this.ci&&this.ci<1))throw Error(`invalid ci; not in [0, 1): ${a}`);if(!(this.precision>0))throw Error(`invalid precision: ${o}`)}render(e,t,n,r,i){let{x:a,y:o,z:s}=n,{ci:c}=this;return J(`svg:g`,i).call(Y,this,r,i).call(Q,this,t).call(t=>t.selectAll().data(s?QE(e,s,this.z):[e]).enter().call(e=>e.append(`path`).attr(`fill`,`none`).call(X,this).call(XE,this,{...n,fill:null,fillOpacity:null}).attr(`d`,e=>this._renderLine(e,a,o)).call(c&&!gS(this.fill)?e=>e.select(LF).attr(`stroke`,`none`).call(X,this).call(XE,this,{...n,stroke:null,strokeOpacity:null,strokeWidth:null}).attr(`d`,e=>this._renderBand(e,a,o)):()=>{}))).node()}};function LF(){return this.parentNode.insertBefore(this.ownerDocument.createElementNS(yt.svg,`path`),this)}var RF=class extends IF{constructor(e,t){super(e,t)}_renderBand(e,t,n){let{ci:r,precision:i}=this,[a,o]=j(e,e=>n[e]),s=HF(e,n,t),c=UF(e,n,t,(1-r)/2,s);return Rv().y(e=>e).x0(e=>c(e,-1)).x1(e=>c(e,1))(Je(a,o-i/2,i).concat(o))}_renderLine(e,t,n){let[r,i]=j(e,e=>n[e]),a=HF(e,n,t);return`M${a(r)},${r}L${a(i)},${i}`}},zF=class extends IF{constructor(e,t){super(e,t)}_renderBand(e,t,n){let{ci:r,precision:i}=this,[a,o]=j(e,e=>t[e]),s=HF(e,t,n),c=UF(e,t,n,(1-r)/2,s);return Rv().x(e=>e).y0(e=>c(e,-1)).y1(e=>c(e,1))(Je(a,o-i/2,i).concat(o))}_renderLine(e,t,n){let[r,i]=j(e,e=>t[e]),a=HF(e,t,n);return`M${r},${a(r)}L${i},${a(i)}`}};function BF(e,{y:t=ox,x:n=U,stroke:r,fill:i=K(r)?`currentColor`:r,...a}={}){return new RF(e,Nj({...a,x:n,y:t,fill:i,stroke:r}))}function VF(e,{x:t=ox,y:n=U,stroke:r,fill:i=K(r)?`currentColor`:r,...a}={}){return new zF(e,Mj({...a,x:t,y:n,fill:i,stroke:r}))}function HF(e,t,n){let r=0,i=0,a=0,o=0;for(let s of e){let e=t[s],c=n[s];r+=e,i+=c,a+=e*c,o+=e*e}let s=e.length,c=(s*a-r*i)/(s*o-r*r),l=(i-c*r)/s;return e=>c*e+l}function UF(e,t,n,r,i){let a=Ze(e,e=>t[e])/e.length,o=0,s=0;for(let r of e)o+=(t[r]-a)**2,s+=(n[r]-i(t[r]))**2;let c=Math.sqrt(s/(e.length-2)),l=PF(r,e.length-2);return(t,n)=>{let r=i(t),s=c*Math.sqrt(1/e.length+(t-a)**2/o);return r+n*l*s}}function WF({path:e=U,delimiter:t,frameAnchor:n,treeLayout:r=Np,treeSort:i,treeSeparation:a,treeAnchor:o,treeFilter:s,...c}={}){o=KF(o),i=YF(i),s!=null&&(s=rI(s)),n===void 0&&(n=o.frameAnchor);let l=QF(t),u=_I(c,rI),[d,f]=Wx(),[p,m]=Wx();return{x:d,y:p,frameAnchor:n,...US(c,(t,n)=>{let c=l(H(t,e)),d=f([]),p=m([]),h=-1,g=[],_=[],v=xp().path(e=>c[e]),y=qb(t)?e=>e.data=t[e.data]:e=>e.data=t.get(e.data),b=r();b.nodeSize&&b.nodeSize([1,1]),b.separation&&a!==void 0&&b.separation(a??sx);for(let e of u)e[gI]=e[mI]([]);for(let e of n){let t=[],n=v(e.filter(e=>c[e]!=null)).each(y);i!=null&&n.sort(i),b(n);for(let e of n.descendants())if(s==null||s(e)){t.push(++h),g[h]=e.data,o.position(e,h,d,p);for(let t of u)t[gI][h]=t[hI](e)}_.push(t)}return{data:g,facets:_}}),...Object.fromEntries(u)}}function GF({path:e=U,delimiter:t,curve:n=`bump-x`,stroke:r=`#555`,strokeWidth:i=1.5,strokeOpacity:a=.5,treeLayout:o=Np,treeSort:s,treeSeparation:c,treeAnchor:l,treeFilter:u,...d}={}){l=KF(l),s=YF(s),u!=null&&(u=iI(u)),d={curve:n,stroke:r,strokeWidth:i,strokeOpacity:a,...d};let f=QF(t),p=_I(d,iI),[m,h]=Wx(),[g,_]=Wx(),[v,y]=Wx(),[b,x]=Wx();return{x1:m,x2:g,y1:v,y2:b,...US(d,(t,n)=>{let r=f(H(t,e)),i=h([]),a=_([]),d=y([]),m=x([]),g=-1,v=[],b=[],S=xp().path(e=>r[e]),C=o();C.nodeSize&&C.nodeSize([1,1]),C.separation&&c!==void 0&&C.separation(c??sx);for(let e of p)e[gI]=e[mI]([]);for(let e of n){let n=[],o=S(e.filter(e=>r[e]!=null)).each(e=>e.data=t[e.data]);s!=null&&o.sort(s),C(o);for(let{source:e,target:t}of o.links())if(u==null||u(t,e)){n.push(++g),v[g]=t.data,l.position(e,g,i,d),l.position(t,g,a,m);for(let n of p)n[gI][g]=n[hI](t,e)}b.push(n)}return{data:v,facets:b}}),...Object.fromEntries(p)}}function KF(e=`left`){switch(`${e}`.trim().toLowerCase()){case`left`:return qF;case`right`:return JF}throw Error(`invalid tree anchor: ${e}`)}let qF={frameAnchor:`left`,dx:6,position({x:e,y:t},n,r,i){r[n]=t,i[n]=-e}},JF={frameAnchor:`right`,dx:-6,position({x:e,y:t},n,r,i){r[n]=-t,i[n]=-e}};function YF(e){return e==null||typeof e==`function`?e:`${e}`.trim().toLowerCase().startsWith(`node:`)?XF(rI(e)):XF(ZF(e))}function XF(e){return(t,n)=>sb(e(t),e(n))}function ZF(e){return t=>t.data?.[e]}function QF(e=`/`){if(e=`${e}`,e===`/`)return e=>e;if(e.length!==1)throw Error(`delimiter must be exactly one character`);let t=e.charCodeAt(0);return e=>e.map(e=>$F(e,t))}function $F(e,t){if(t===92)throw Error(`delimiter cannot be backslash`);let n=!1;for(let r=0,i=e.length;r<i;++r){switch(e.charCodeAt(r)){case 92:if(!n){n=!0;continue}break;case t:n?(e=e.slice(0,r-1)+e.slice(r),--r,--i):e=e.slice(0,r)+`/`+e.slice(r+1);break;case 47:n?(e=e.slice(0,r)+`\\\\`+e.slice(r),r+=2,i+=2):(e=e.slice(0,r)+`\\`+e.slice(r),++r,++i)}n=!1}return e}function eI(e){let t=!1;for(let n=0,r=e.length;n<r;++n){switch(e.charCodeAt(n)){case 92:if(!t){t=!0;continue}case 47:t&&(e=e.slice(0,n-1)+e.slice(n),--n,--r)}t=!1}return e}function tI(e){return Ax(e)&&typeof e.node==`function`}function nI(e){return Ax(e)&&typeof e.link==`function`}function rI(e){if(tI(e))return e.node;if(e=`${e}`.trim().toLowerCase(),e.startsWith(`node:`)){switch(e){case`node:name`:return oI;case`node:path`:return aI;case`node:internal`:return lI;case`node:external`:return uI;case`node:depth`:return sI;case`node:height`:return cI}throw Error(`invalid node value: ${e}`)}}function iI(e){if(tI(e))return e.node;if(nI(e))return e.link;if(e=`${e}`.trim().toLowerCase(),e.startsWith(`node:`)||e.startsWith(`parent:`)){switch(e){case`parent:name`:return dI(oI);case`parent:path`:return dI(aI);case`parent:depth`:return dI(sI);case`parent:height`:return dI(cI);case`node:name`:return oI;case`node:path`:return aI;case`node:internal`:return lI;case`node:external`:return uI;case`node:depth`:return sI;case`node:height`:return cI}throw Error(`invalid link value: ${e}`)}}function aI(e){return e.id}function oI(e){return fI(e.id)}function sI(e){return e.depth}function cI(e){return e.height}function lI(e){return!!e.children}function uI(e){return!e.children}function dI(e){return(t,n)=>n==null?void 0:e(n)}function fI(e){let t=e.length;for(;--t>0&&!pI(e,t););return eI(e.slice(t+1))}function pI(e,t){if(e[t]===`/`){let n=0;for(;t>0&&e[--t]===`\\`;)++n;if(!(n&1))return!0}return!1}let mI=2,hI=3,gI=4;function _I(e,t){let n=[];for(let r in e){let i=e[r],a=t(i);a!==void 0&&n.push([r,...Wx(i),a])}return n}function vI(e,{fill:t,stroke:n,strokeWidth:r,strokeOpacity:i,strokeLinejoin:a,strokeLinecap:o,strokeMiterlimit:s,strokeDasharray:c,strokeDashoffset:l,marker:u,markerStart:d=u,markerEnd:f=u,dot:p=K(d)&&K(f),text:m=`node:name`,textStroke:h=`var(--plot-background)`,title:g=`node:path`,dx:_,dy:v,textAnchor:y,treeLayout:b=Np,textLayout:x=b===Np||b===Gf?`mirrored`:`normal`,tip:S,...C}={}){if(_===void 0&&(_=KF(C.treeAnchor).dx),y!==void 0)throw Error(`textAnchor is not a configurable tree option`);x=Sx(x,`textLayout`,[`mirrored`,`normal`]);function w(n){return pO(e,WF({treeLayout:b,text:m,fill:t===void 0?`currentColor`:t,stroke:h,dx:_,dy:v,title:g,...n,...C}))}return mD(fM(e,GF({treeLayout:b,markerStart:d,markerEnd:f,stroke:n===void 0?t===void 0?`node:internal`:t:n,strokeWidth:r,strokeOpacity:i,strokeLinejoin:a,strokeLinecap:o,strokeMiterlimit:s,strokeDasharray:c,strokeDashoffset:l,...C})),p?FM(e,WF({treeLayout:b,fill:t===void 0?`node:internal`:t,title:g,tip:S,...C})):null,m==null?null:x===`mirrored`?[w({textAnchor:`start`,treeFilter:`node:external`}),w({textAnchor:`end`,treeFilter:`node:internal`,dx:-_})]:w())}function yI(e,t){return vI(e,{...t,treeLayout:Gf})}let bI={ariaLabel:`waffle`};var xI=class extends CM{constructor(e,{unit:t=1,gap:n=1,round:r,multiple:i,...a}={}){super(e,CI(`x`,a),bI),this.unit=Math.max(0,t),this.gap=+n,this.round=kI(r),this.multiple=AI(i)}},SI=class extends wM{constructor(e,{unit:t=1,gap:n=1,round:r,multiple:i,...a}={}){super(e,CI(`y`,a),bI),this.unit=Math.max(0,t),this.gap=+n,this.round=kI(r),this.multiple=AI(i)}};function CI(e,t){let n=e===`y`?`x`:`y`,r=`${e}1`,i=`${e}2`;return WS(wI(t),function(t,a,o,s,c){let{round:l,unit:u}=this,d=o[r].value,f=o[i].value,p=VC({...n in o&&{[n]:o[n]},[r]:o[r],[i]:o[i]},s),m=this[e===`y`?`_width`:`_height`](s,p,c),h=this[e===`y`?`_x`:`_y`](s,p,c),g=u*jI(s.scales[e]),{multiple:_=Math.max(1,Math.floor(Math.sqrt(m/g)))}=this,v=Math.min(m/_,g*_),y=g*_,b=(m-_*v)/2,x=typeof h==`function`?e=>h(e)+b:h+b,S=s[e](0),C=e===`y`?([e,t])=>[e*v,-t*y]:([e,t])=>[t*y,e*v],w=typeof x==`function`?e=>x(e)-m/2:()=>x,[T,E]=e===`y`?[0,1]:[1,0],D=f.length,O=Array(D),k=new Float64Array(D),A=new Float64Array(D);for(let e=0;e<D;++e){O[e]=TI(l(d[e]/u),l(f[e]/u),_).map(C);let t=O[e].pop();k[e]=t[T]+w(e),A[e]=t[E]+S}return{channels:{polygon:{value:O,source:null,filter:null},[`c${n}`]:{value:[v,x],source:null,filter:null},[`c${e}`]:{value:[y,S],source:null,filter:null},[n]:{value:k,scale:null,source:null},[r]:{value:A,scale:null,source:o[r]},[i]:{value:A,scale:null,source:o[i]}}}})}function wI({render:e,...t}){return{...t,render:hD(e,function(e,t,n,r,i){let{gap:a,rx:o,ry:s}=this,{channels:c,ariaLabel:l,href:u,title:d,...f}=n,{document:p}=i,m=c.polygon.value,[h,g]=c.cx.value,[_,v]=c.cy.value,y=UE(),b=p.createElementNS(yt.svg,`pattern`);b.setAttribute(`width`,h),b.setAttribute(`height`,_),b.setAttribute(`patternUnits`,`userSpaceOnUse`);let x=b.appendChild(p.createElementNS(yt.svg,`rect`));return x.setAttribute(`x`,a/2),x.setAttribute(`y`,a/2),x.setAttribute(`width`,h-a),x.setAttribute(`height`,_-a),o!=null&&x.setAttribute(`rx`,o),s!=null&&x.setAttribute(`ry`,s),J(`svg:g`,i).call(Y,this,r,i).call(this._transform,this,t).call(t=>t.selectAll().data(e).enter().append(()=>b.cloneNode(!0)).attr(`id`,e=>`${y}-${e}`).select(`rect`).call(X,this).call(YE,this,f)).call(t=>t.selectAll().data(e).enter().append(`path`).attr(`transform`,cO`translate(${g},${v})`).attr(`d`,e=>`M${m[e].join(`L`)}Z`).attr(`fill`,e=>`url(#${y}-${e})`).attr(`stroke`,this.stroke==null?null:`none`).call(YE,this,{ariaLabel:l,href:u,title:d})).node()})}}function TI(e,t,n){if(t<e)return TI(t,e,n);if(e<0)return EI(e,t,n,Math.ceil(-Math.min(e,t)/n));let r=Math.floor(e%n),i=Math.ceil(e%n),a=Math.floor(t%n),o=Math.ceil(t%n),s=Math.floor(e/n),c=Math.ceil(e/n),l=Math.floor(t/n),u=Math.ceil(t/n),d=[];return u>c&&d.push([0,c]),d.push([r,c],[r,s+e%1],[i,s+e%1]),e%n>n-1||(d.push([i,s]),l>s&&d.push([n,s])),l>s&&d.push([n,l]),d.push([o,l],[o,l+t%1],[a,l+t%1]),t%n<1||(d.push([a,u]),u>c&&d.push([0,u])),d.push(DI(e,t,n)),d}function EI(e,t,n,r){return TI(e+r*n,t+r*n,n).map(([e,t])=>[e,t-r])}function DI(e,t,n){let r=Math.floor(t/n)-Math.floor(e/n);return r===0?OI(e,t,n):r===1?Math.floor(t%n)>Math.ceil(e%n)?[(Math.floor(t%n)+Math.ceil(e%n))/2,Math.floor(t/n)]:t%n>n-e%n?OI(t-t%n,t,n):OI(e,n*Math.ceil(e/n),n):[n/2,(Math.round(e/n)+Math.round(t/n))/2]}function OI(e,t,n){let r=Math.floor(t)-Math.floor(e);return r===0?[Math.floor(e%n)+.5,Math.floor(e/n)+(e+t)/2%1]:r===1?t%1-e%1>.5?[Math.ceil(e%n),Math.floor(t/n)+(e%1+t%1)/2]:t%1>1-e%1?[Math.floor(t%n)+.5,Math.floor(t/n)+t%1/2]:[Math.floor(e%n)+.5,Math.floor(e/n)+(1+e%1)/2]:[Math.ceil(e%n)+Math.ceil(Math.floor(t)-Math.ceil(e))/2,Math.floor(e/n)+(t>=1+e?.5:(e+t)/2%1)]}function kI(e){if(e===void 0||e===!1)return Number;if(e===!0)return Math.round;if(typeof e!=`function`)throw Error(`invalid round: ${e}`);return e}function AI(e){return e===void 0?void 0:Math.max(1,Math.floor(e))}function jI({domain:e,range:t}){return MI(t)/MI(e)}function MI(e){let[t,n]=j(e);return n-t}function NI(e,{tip:t,...n}={}){return kx(n)||(n={...n,y:ox,x2:U}),new xI(e,{tip:FI(t),...eA(QD(Gk(n)))})}function PI(e,{tip:t,...n}={}){return kx(n)||(n={...n,x:ox,y2:U}),new SI(e,{tip:FI(t),...tA($D(Kk(n)))})}function FI(e){return e===!0?{maxRadius:1/0}:Ax(e)&&e.maxRadius===void 0?{...e,maxRadius:1/0}:void 0}var II=/* @__PURE__ */ o(((e,t)=>{function n(e,t,n,r,i){for(var a=i+1;r<=i;){var o=r+i>>>1,s=e[o];(n===void 0?s-t:n(s,t))>=0?(a=o,i=o-1):r=o+1}return a}function r(e,t,n,r,i){for(var a=i+1;r<=i;){var o=r+i>>>1,s=e[o];(n===void 0?s-t:n(s,t))>0?(a=o,i=o-1):r=o+1}return a}function i(e,t,n,r,i){for(var a=r-1;r<=i;){var o=r+i>>>1,s=e[o];(n===void 0?s-t:n(s,t))<0?(a=o,r=o+1):i=o-1}return a}function a(e,t,n,r,i){for(var a=r-1;r<=i;){var o=r+i>>>1,s=e[o];(n===void 0?s-t:n(s,t))<=0?(a=o,r=o+1):i=o-1}return a}function o(e,t,n,r,i){for(;r<=i;){var a=r+i>>>1,o=e[a],s=n===void 0?o-t:n(o,t);if(s===0)return a;s<=0?r=a+1:i=a-1}return-1}function s(e,t,n,r,i,a){return typeof n==`function`?a(e,t,n,r===void 0?0:r|0,i===void 0?e.length-1:i|0):a(e,t,void 0,n===void 0?0:n|0,r===void 0?e.length-1:r|0)}t.exports={ge:function(e,t,r,i,a){return s(e,t,r,i,a,n)},gt:function(e,t,n,i,a){return s(e,t,n,i,a,r)},lt:function(e,t,n,r,a){return s(e,t,n,r,a,i)},le:function(e,t,n,r,i){return s(e,t,n,r,i,a)},eq:function(e,t,n,r,i){return s(e,t,n,r,i,o)}}})),LI=/* @__PURE__ */ l((/* @__PURE__ */ o(((e,t)=>{var n=II(),r=0,i=1,a=2;t.exports=x;function o(e,t,n,r,i){this.mid=e,this.left=t,this.right=n,this.leftPoints=r,this.rightPoints=i,this.count=(t?t.count:0)+(n?n.count:0)+r.length}var s=o.prototype;function c(e,t){e.mid=t.mid,e.left=t.left,e.right=t.right,e.leftPoints=t.leftPoints,e.rightPoints=t.rightPoints,e.count=t.count}function l(e,t){var n=v(t);e.mid=n.mid,e.left=n.left,e.right=n.right,e.leftPoints=n.leftPoints,e.rightPoints=n.rightPoints,e.count=n.count}function u(e,t){var n=e.intervals([]);n.push(t),l(e,n)}function d(e,t){var n=e.intervals([]),a=n.indexOf(t);return a<0?r:(n.splice(a,1),l(e,n),i)}s.intervals=function(e){return e.push.apply(e,this.leftPoints),this.left&&this.left.intervals(e),this.right&&this.right.intervals(e),e},s.insert=function(e){var t=this.count-this.leftPoints.length;if(this.count+=1,e[1]<this.mid)this.left?4*(this.left.count+1)>3*(t+1)?u(this,e):this.left.insert(e):this.left=v([e]);else if(e[0]>this.mid)this.right?4*(this.right.count+1)>3*(t+1)?u(this,e):this.right.insert(e):this.right=v([e]);else{var r=n.ge(this.leftPoints,e,g),i=n.ge(this.rightPoints,e,_);this.leftPoints.splice(r,0,e),this.rightPoints.splice(i,0,e)}},s.remove=function(e){var t=this.count-this.leftPoints;if(e[1]<this.mid){if(!this.left)return r;if(4*(this.right?this.right.count:0)>3*(t-1))return d(this,e);var o=this.left.remove(e);return o===a?(this.left=null,--this.count,i):(o===i&&--this.count,o)}if(e[0]>this.mid){if(!this.right)return r;if(4*(this.left?this.left.count:0)>3*(t-1))return d(this,e);var o=this.right.remove(e);return o===a?(this.right=null,--this.count,i):(o===i&&--this.count,o)}if(this.count===1)return this.leftPoints[0]===e?a:r;if(this.leftPoints.length===1&&this.leftPoints[0]===e){if(this.left&&this.right){for(var s=this,l=this.left;l.right;)s=l,l=l.right;if(s===this)l.right=this.right;else{var u=this.left,o=this.right;s.count-=l.count,s.right=l.left,l.left=u,l.right=o}c(this,l),this.count=(this.left?this.left.count:0)+(this.right?this.right.count:0)+this.leftPoints.length}else this.left?c(this,this.left):c(this,this.right);return i}for(var u=n.ge(this.leftPoints,e,g);u<this.leftPoints.length&&this.leftPoints[u][0]===e[0];++u)if(this.leftPoints[u]===e){--this.count,this.leftPoints.splice(u,1);for(var o=n.ge(this.rightPoints,e,_);o<this.rightPoints.length&&this.rightPoints[o][1]===e[1];++o)if(this.rightPoints[o]===e)return this.rightPoints.splice(o,1),i}return r};function f(e,t,n){for(var r=0;r<e.length&&e[r][0]<=t;++r){var i=n(e[r]);if(i)return i}}function p(e,t,n){for(var r=e.length-1;r>=0&&e[r][1]>=t;--r){var i=n(e[r]);if(i)return i}}function m(e,t){for(var n=0;n<e.length;++n){var r=t(e[n]);if(r)return r}}s.queryPoint=function(e,t){if(e<this.mid){if(this.left){var n=this.left.queryPoint(e,t);if(n)return n}return f(this.leftPoints,e,t)}if(e>this.mid){if(this.right){var n=this.right.queryPoint(e,t);if(n)return n}return p(this.rightPoints,e,t)}return m(this.leftPoints,t)},s.queryInterval=function(e,t,n){if(e<this.mid&&this.left){var r=this.left.queryInterval(e,t,n);if(r)return r}if(t>this.mid&&this.right){var r=this.right.queryInterval(e,t,n);if(r)return r}return t<this.mid?f(this.leftPoints,t,n):e>this.mid?p(this.rightPoints,e,n):m(this.leftPoints,n)};function h(e,t){return e-t}function g(e,t){return e[0]-t[0]||e[1]-t[1]}function _(e,t){return e[1]-t[1]||e[0]-t[0]}function v(e){if(e.length===0)return null;for(var t=[],n=0;n<e.length;++n)t.push(e[n][0],e[n][1]);t.sort(h);for(var r=t[t.length>>1],i=[],a=[],s=[],n=0;n<e.length;++n){var c=e[n];c[1]<r?i.push(c):r<c[0]?a.push(c):s.push(c)}var l=s,u=s.slice();return l.sort(g),u.sort(_),new o(r,v(i),v(a),l,u)}function y(e){this.root=e}var b=y.prototype;b.insert=function(e){this.root?this.root.insert(e):this.root=new o(e[0],null,null,[e],[e])},b.remove=function(e){if(this.root){var t=this.root.remove(e);return t===a&&(this.root=null),t!==r}return!1},b.queryPoint=function(e,t){if(this.root)return this.root.queryPoint(e,t)},b.queryInterval=function(e,t,n){if(e<=t&&this.root)return this.root.queryInterval(e,t,n)},Object.defineProperty(b,"count",{get:function(){return this.root?this.root.count:0}}),Object.defineProperty(b,"intervals",{get:function(){return this.root?this.root.intervals([]):[]}});function x(e){return!e||e.length===0?new y(null):new y(v(e))}})))(),1);let RI=({marginLeft:e})=>[1,e],zI=({width:e,marginRight:t})=>[-1,e-t],BI=({width:e,marginLeft:t,marginRight:n})=>[0,(t+e-n)/2],VI=({marginTop:e})=>[1,e],HI=({height:e,marginBottom:t})=>[-1,e-t],UI=({height:e,marginTop:t,marginBottom:n})=>[0,(t+e-n)/2];function WI(e){return typeof e==`string`?{anchor:e}:e}function GI(e={},t={}){arguments.length===1&&([e,t]=qI(e));let{anchor:n=`left`,padding:r=1,r:i=t.r}=WI(e);switch(`${n}`.toLowerCase()){case`left`:n=RI;break;case`right`:n=zI;break;case`middle`:n=BI;break;default:throw Error(`unknown dodge anchor: ${n}`)}return JI(`x`,`y`,n,W(r),i,t)}function KI(e={},t={}){arguments.length===1&&([e,t]=qI(e));let{anchor:n=`bottom`,padding:r=1,r:i=t.r}=WI(e);switch(`${n}`.toLowerCase()){case`top`:n=VI;break;case`bottom`:n=HI;break;case`middle`:n=UI;break;default:throw Error(`unknown dodge anchor: ${n}`)}return JI(`y`,`x`,n,W(r),i,t)}function qI(e){let{anchor:t,padding:n,...r}=e,{r:i}=r;return[{anchor:t,padding:n,r:i},r]}function JI(e,t,n,r,i,a){if(i!=null&&typeof i!=`number`){let{channels:e,sort:t,reverse:n}=a;e=SS(e),e?.r===void 0&&(a={...a,channels:{...e,r:{value:i,scale:`r`}}}),t===void 0&&n===void 0&&(a.sort={channel:`-r`})}return WS(a,function(a,o,s,c,l,u){let{[t]:d,r:f}=s;if(!s[t])throw Error(`missing channel: ${t}`);({[t]:d}=SE(s,c,u));let p=f?void 0:i===void 0?this.r===void 0?3:this.r:W(i);f&&=H(f.value,c[f.scale]||U,Float64Array);let[m,h]=n(l),g=m?XI:YI,_=new Float64Array(d.length),v=f?e=>f[e]:()=>p;for(let e of o){let t=(0,LI.default)();e=e.filter(f?e=>ub(d[e])&&db(f[e]):e=>ub(d[e]));let n=new Float64Array(2*e.length+2);for(let i of e){let e=v(i),a=m?e+r:0,o=d[i]-e,s=d[i]+e,c=2;t.queryInterval(o-r,s+r,([,,e])=>{let t=_[e]-a,o=d[i]-d[e],s=r+(f?f[i]+f[e]:2*p),l=Math.sqrt(s*s-o*o);n[c++]=t-l,n[c++]=t+l});let l=n.slice(0,c);m&&(l=l.filter(e=>e>=0));out:for(let e of l.sort(g)){for(let t=0;t<c;t+=2)if(n[t]+1e-6<e&&e<n[t+1]-1e-6)continue out;_[i]=e+a;break}t.insert([o,s,i])}}m||=1;for(let e of o)for(let t of e)_[t]=_[t]*m+h;return{data:a,facets:o,channels:{[e]:{value:_,source:null},[t]:{value:d,source:s[t]},...f&&{r:{value:f,source:s.r}}}}})}function YI(e,t){return Math.abs(e)-Math.abs(t)}function XI(e,t){return e-t}function ZI(e,t){return arguments.length===1&&({basis:e,...t}=e),iN($I(e),t)}function QI(e,t){return arguments.length===1&&({basis:e,...t}=e),aN($I(e),t)}function $I(e){if(e===void 0)return rL;if(typeof e==`function`)return eL(Bx(e));if(/^p\d{2}$/i.test(e))return tL(mx(e));switch(`${e}`.toLowerCase()){case`deviation`:return aL;case`first`:return rL;case`last`:return iL;case`max`:return oL;case`mean`:return sL;case`median`:return cL;case`min`:return lL;case`sum`:return uL;case`extent`:return nL}throw Error(`invalid basis: ${e}`)}function eL(e){return{mapIndex(t,n,r){let i=+e(t,n);for(let e of t)r[e]=n[e]===null?NaN:n[e]/i}}}function tL(e){return eL((t,n)=>e(t,e=>n[e]))}let nL={mapIndex(e,t,n){let[r,i]=j(e,e=>t[e]),a=i-r;for(let i of e)n[i]=t[i]===null?NaN:(t[i]-r)/a}},rL=eL((e,t)=>{for(let n=0;n<e.length;++n){let r=t[e[n]];if(ob(r))return r}}),iL=eL((e,t)=>{for(let n=e.length-1;n>=0;--n){let r=t[e[n]];if(ob(r))return r}}),aL={mapIndex(e,t,n){let r=Ve(e,e=>t[e]),i=re(e,e=>t[e]);for(let a of e)n[a]=t[a]===null?NaN:i?(t[a]-r)/i:0}},oL=tL(Ae),sL=tL(Ve),cL=tL(He),lL=tL(Me),uL=tL(Ze);function dL(e,t){return pL(`x`,e,t)}function fL(e,t){return pL(`y`,e,t)}function pL(e,t,n={}){let r,i=1;if(typeof t==`number`)i=t,r=(e,t)=>+e+t;else{if(typeof t==`string`){let e=t.startsWith(`-`)?-1:1;[t,i]=Fb(t.replace(/^[+-]/,``)),i*=e}t=Xx(t),r=(e,n)=>t.offset(e,n)}let a=`${e}1`,o=`${e}2`,s=oN({[a]:e=>e.map(e=>r(e,i)),[o]:e=>e},n),c=s[o].transform;return s[o].transform=()=>{let e=c(),[t,n]=j(e);return e.domain=i<0?[t,r(n,i)]:[r(t,i),n],e},s}function mL(e,t={}){if(typeof e==`string`)switch(e.toLowerCase()){case`first`:return gL(t);case`last`:return _L(t)}if(typeof e==`function`)return EL(null,e,t);let n,r;for(n in e){if(r!==void 0)throw Error(`ambiguous selector; multiple inputs`);r=hL(e[n])}if(r===void 0)throw Error(`invalid selector: ${e}`);return EL(n,r,t)}function hL(e){if(typeof e==`function`)return e;switch(`${e}`.toLowerCase()){case`min`:return wL;case`max`:return TL}throw Error(`unknown selector: ${e}`)}function gL(e){return EL(null,SL,e)}function _L(e){return EL(null,CL,e)}function vL(e){return EL(`x`,wL,e)}function yL(e){return EL(`y`,wL,e)}function bL(e){return EL(`x`,TL,e)}function xL(e){return EL(`y`,TL,e)}function*SL(e){yield e[0]}function*CL(e){yield e[e.length-1]}function*wL(e,t){yield Xe(e,e=>t[e])}function*TL(e,t){yield Ie(e,e=>t[e])}function EL(e,t,n){if(e!=null){if(n[e]==null)throw Error(`missing channel: ${e}`);e=n[e]}let r=Ix(n);return US(n,(n,i)=>{let a=H(n,r),o=H(n,e),s=[];for(let e of i){let n=[];for(let r of a?fe(e,e=>a[e]).values():[e])for(let e of t(r,o))n.push(e);s.push(n)}return{data:n,facets:s}})}var DL=/* @__PURE__ */ s({Area:()=>aM,Arrow:()=>hM,BarX:()=>CM,BarY:()=>wM,Cell:()=>OM,Contour:()=>vP,Density:()=>QP,Dot:()=>PM,Frame:()=>PA,Geo:()=>fF,Hexgrid:()=>xF,Image:()=>DF,Line:()=>VM,Link:()=>uM,Mark:()=>$,Raster:()=>ZN,Rect:()=>CA,RuleX:()=>rO,RuleY:()=>iO,Text:()=>uO,TickX:()=>IN,TickY:()=>LN,Tip:()=>RA,Vector:()=>GO,WaffleX:()=>xI,WaffleY:()=>SI,area:()=>oM,areaX:()=>sM,areaY:()=>cM,arrow:()=>yM,auto:()=>qM,autoSpec:()=>KM,axisFx:()=>ak,axisFy:()=>rk,axisX:()=>ik,axisY:()=>nk,barX:()=>TM,barY:()=>EM,bin:()=>Aj,binX:()=>Oj,binY:()=>kj,bollinger:()=>NN,bollingerX:()=>jN,bollingerY:()=>MN,boxX:()=>BN,boxY:()=>VN,cell:()=>kM,cellX:()=>AM,cellY:()=>jM,centroid:()=>lF,circle:()=>RM,cluster:()=>yI,column:()=>Wx,contour:()=>xP,crosshair:()=>wP,crosshairX:()=>TP,crosshairY:()=>EP,delaunayLink:()=>KP,delaunayMesh:()=>qP,density:()=>$P,differenceX:()=>rF,differenceY:()=>iF,dodgeX:()=>GI,dodgeY:()=>KI,dot:()=>FM,dotX:()=>IM,dotY:()=>LM,filter:()=>JS,find:()=>RC,formatIsoDate:()=>IE,formatMonth:()=>PE,formatNumber:()=>NE,formatWeekday:()=>FE,frame:()=>FA,geo:()=>pF,geoCentroid:()=>uF,graticule:()=>hF,gridFx:()=>hk,gridFy:()=>pk,gridX:()=>mk,gridY:()=>fk,group:()=>oC,groupX:()=>iC,groupY:()=>aC,groupZ:()=>rC,hexagon:()=>zM,hexbin:()=>_F,hexgrid:()=>bF,hull:()=>JP,identity:()=>U,image:()=>kF,indexOf:()=>ox,initializer:()=>WS,interpolateNearest:()=>uP,interpolateNone:()=>iP,interpolatorBarycentric:()=>aP,interpolatorRandomWalk:()=>dP,legend:()=>Rk,line:()=>UM,lineX:()=>WM,lineY:()=>GM,linearRegressionX:()=>BF,linearRegressionY:()=>VF,link:()=>fM,map:()=>oN,mapX:()=>iN,mapY:()=>aN,marks:()=>mD,normalize:()=>$I,normalizeX:()=>ZI,normalizeY:()=>QI,numberInterval:()=>Zx,plot:()=>XA,pointer:()=>wD,pointerX:()=>TD,pointerY:()=>ED,raster:()=>$N,rect:()=>kA,rectX:()=>AA,rectY:()=>jA,reverse:()=>XS,ruleX:()=>aO,ruleY:()=>oO,scale:()=>LT,select:()=>mL,selectFirst:()=>gL,selectLast:()=>_L,selectMaxX:()=>bL,selectMaxY:()=>xL,selectMinX:()=>vL,selectMinY:()=>yL,shiftX:()=>dL,shiftY:()=>fL,shuffle:()=>QS,sort:()=>$S,sphere:()=>mF,spike:()=>YO,stackX:()=>Jk,stackX1:()=>Yk,stackX2:()=>Xk,stackY:()=>Zk,stackY1:()=>Qk,stackY2:()=>$k,text:()=>pO,textX:()=>mO,textY:()=>hO,tickX:()=>RN,tickY:()=>zN,timeInterval:()=>Ib,tip:()=>zA,transform:()=>US,tree:()=>vI,treeLink:()=>GF,treeNode:()=>WF,utcInterval:()=>Lb,valueof:()=>H,vector:()=>KO,vectorX:()=>qO,vectorY:()=>JO,voronoi:()=>YP,voronoiMesh:()=>XP,waffleX:()=>NI,waffleY:()=>PI,window:()=>mN,windowX:()=>fN,windowY:()=>pN});$.prototype.plot=function({marks:e=[],...t}={}){return XA({...t,marks:[...e,this]})};let OL=(e,t,n=``)=>e.getAttribute(t)??n,kL=e=>e.split(/[\s,]+/).filter(Boolean),AL=e=>{let t=e.match(/^abs\((.+)\)$/);return t?{name:t[1].trim(),abs:!0}:{name:e,abs:!1}},jL=e=>e.replace(/^abs\((.+)\)$/,`|$1|`).replaceAll(`_`,` `),ML=e=>e.startsWith(`$`)?String(window.iso.state[e.slice(1)]??`linear`):e;function NL(e,t,n){return{width:t,height:n,marginLeft:56,marginBottom:40,marginTop:24,marginRight:18,style:{background:`transparent`,color:e.soft,fontFamily:e.ui,fontSize:`11px`,overflow:`visible`},color:{range:e.series.length?e.series:[e.lattice,e.growth,e.malachite,e.rose]}}}var PL=class extends HTMLElement{plot=null;#e=0;#t;get rows(){return this.#t}set rows(e){this.#t=e,this.isConnected&&this.render()}connectedCallback(){this.dataset.on||(this.dataset.on=`1`,new ResizeObserver(()=>{Math.abs(this.clientWidth-this.#e)>2&&this.render()}).observe(this),window.iso._.live(this,()=>this.render()))}async render(){let e=this.clientWidth;if(!e)return;this.#e=e;let t=window.iso.tokens(),n=+OL(this,`height`,`260`),r=OL(this,`x`),i=kL(OL(this,`y`)),a=OL(this,`by`),o=OL(this,`at`),s=[r,...i,a].filter(Boolean).map(e=>AL(e).name);if(this.plot){let e=this.hasAttribute(`data`)||this.#t?await window.iso._.rowsFor(this,s):[];if(!e)return;try{this.replaceChildren(this.plot(DL,e,t))}catch(e){window.iso.complain(e)}return}if(!this.hasAttribute(`data`)&&this.#t===void 0)return;if(!r||!i.length){window.iso.complain(`<iso-chart data="${OL(this,`data`)}"> needs x="…" and y="…"`);return}let c=await window.iso._.rowsFor(this,s);if(!c)return;let l=AL(r),u=(e,t)=>{let n=e[t.name];return t.abs&&typeof n==`number`?Math.abs(n):n},d=i.length>1?`series`:a||null,f=c.flatMap(e=>i.map(t=>({x:u(e,l),y:u(e,AL(t)),series:i.length>1?jL(t):a?e[a]:jL(t),row:e}))),p=ML(OL(this,`x-scale`,`linear`)),m=ML(OL(this,`y-scale`,`linear`)),h=f.filter(e=>(p!==`log`||typeof e.x==`number`&&e.x>0)&&(m!==`log`||typeof e.y==`number`&&e.y>0));f.length&&h.length<f.length/2&&window.iso.complain(`<iso-chart data="${OL(this,`data`)}">: ${f.length-h.length} of ${f.length} points are zero or below, so a log scale leaves them out${/^abs\(/.test(i[0])?``:` (abs(${i[0]}) charts their size)`}`);let g=OL(this,`type`,`line`),_=d?`series`:void 0,v=d?`series`:t.series[0]??t.lattice,y=h.some(e=>typeof e.x==`string`),b=h.length/Math.max(1,new Set(h.map(e=>e.series)).size)<=40,x=[],S=y?[...new Set(h.map(e=>String(e.x)))]:[],C=Math.max(0,...S.map(e=>e.length)),w=y&&S.length*(C*6.6+8)>e-80;if(g===`bar`?x.push(y&&!w?EM(h,{x:`x`,y:`y`,fill:v,tip:!0}):TM(h,{y:`x`,x:`y`,fill:v,tip:!0})):g===`dot`?x.push(FM(h,{x:`x`,y:`y`,fill:v,r:2.5,tip:!0})):g===`area`?x.push(cM(h,{x:`x`,y:`y`,z:_,fill:v,fillOpacity:.25}),GM(h,{x:`x`,y:`y`,z:_,stroke:v,strokeWidth:1.5})):(x.push(UM(h,{x:`x`,y:`y`,z:_,stroke:v,strokeWidth:1.6,curve:g===`step`?`step`:`linear`})),b&&x.push(FM(h,{x:`x`,y:`y`,stroke:v,fill:t.ground1,r:3})),x.push(zA(h,wD({x:`x`,y:`y`,stroke:t.lineStrong,fill:t.ground2,title:e=>`${d?`${e.series}\n`:``}${jL(r)} ${LL(e.x)}\n${i.length>1?``:`${jL(i[0])} `}${LL(e.y)}`})))),o){let e=window.iso.state[o];if(typeof e==`number`){if(AL(r).name===o||!(o in(c[0]??{})))x.push(aO([e],{stroke:t.growth,strokeDasharray:`3,3`}));else{let n=/* @__PURE__ */ new Map;for(let t of h){let r=t.row[o],i=n.get(t.series);typeof r==`number`&&(!i||Math.abs(r-e)<Math.abs(i.row[o]-e))&&n.set(t.series,t)}x.push(FM([...n.values()],{x:`x`,y:`y`,fill:v,stroke:t.text,strokeWidth:1.5,r:5.5}))}}else window.iso.complain(`<iso-chart at="${o}">: iso.state.${o} isn't a number yet (an iso-slider or iso-play named ${o} sets it)`)}let T=e=>{let t=e.filter(e=>typeof e==`number`&&e>0);if(!t.length)return[];let n=[];for(let e=Math.ceil(Math.log10(Math.min(...t))-1e-9);e<=Math.floor(Math.log10(Math.max(...t))+1e-9);e++)n.push(10**e);return n};p===`log`&&!w&&x.unshift(mk(T(h.map(e=>e.x)),{stroke:t.line,strokeOpacity:1})),m===`log`&&!w&&x.unshift(fk(T(h.map(e=>e.y)),{stroke:t.line,strokeOpacity:1})),x.push(FA({stroke:t.line,anchor:`bottom`}),FA({stroke:t.line,anchor:`left`}));let E=d&&new Set(h.map(e=>e.series)).size>1;try{let a=NL(t,e,w?Math.max(n,S.length*26+60):n);w&&(a.marginLeft=Math.min(e/2,C*6.6+16));let o=XA({...a,marks:x,...w?{x:{label:OL(this,`y-label`,i.length>1?``:jL(i[0])),grid:!0,labelAnchor:`center`,labelArrow:`none`,tickFormat:IL(`linear`)},y:{label:null}}:{x:{...y?{}:{type:p},label:OL(this,`x-label`,jL(r)),grid:!y&&p!==`log`,labelAnchor:`center`,labelArrow:`none`,nice:p!==`log`,...y?{}:{tickFormat:IL(p)}},y:{type:m,label:OL(this,`y-label`,i.length>1?``:jL(i[0])),grid:m!==`log`,labelArrow:`none`,nice:m!==`log`,tickFormat:IL(m)}},color:{...NL(t,0,0).color,...d?{domain:[...new Set(h.map(e=>e.series))]}:{}}});for(let e of o.querySelectorAll(`[aria-label$='grid'] line, [aria-label$='grid'] path`))e.setAttribute(`stroke`,t.line),e.setAttribute(`stroke-opacity`,`1`);let s=E?`<div class="iso-legend">${o.scale(`color`).domain.map((e,t,n)=>`<span><i style="background:${o.scale(`color`).range[t%n.length]}"></i>${FL(String(e))}</span>`).join(``)}</div>`:``;this.innerHTML=s,this.append(o)}catch(e){window.iso.complain(`<iso-chart data="${OL(this,`data`)}">: ${e.message}`)}}};let FL=e=>e.replace(/[&<>"]/g,e=>({"&":`&amp;`,"<":`&lt;`,">":`&gt;`,'"':`&quot;`})[e]),IL=e=>e=>typeof e==`number`?window.iso.format(e):String(e),LL=e=>typeof e==`number`?window.iso.format(e):String(e);window.iso._.define(`iso-chart`,PL),window.Plot=DL})();