@stlite/desktop 0.42.5 → 0.44.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 (163) hide show
  1. package/bin/dump_artifacts.js +1 -1
  2. package/build/asset-manifest.json +79 -74
  3. package/build/index.html +1 -1
  4. package/build/static/css/8050.c24b25fa.chunk.css +1 -0
  5. package/build/static/css/9699.7ce51b75.chunk.css +1 -0
  6. package/build/static/css/main.fb5f4d99.css +1 -0
  7. package/build/static/js/1046.ea522608.chunk.js +1 -0
  8. package/build/static/js/1122.422f58fc.chunk.js +1 -0
  9. package/build/static/js/1189.71b89117.chunk.js +1 -0
  10. package/build/static/js/1261.242b7386.chunk.js +1 -0
  11. package/build/static/js/142.dbf9ec20.chunk.js +1 -0
  12. package/build/static/js/144.046792d9.chunk.js +1 -0
  13. package/build/static/js/1729.d59ed152.chunk.js +1 -0
  14. package/build/static/js/1740.2c71a97a.chunk.js +1 -0
  15. package/build/static/js/1839.0d0dcac8.chunk.js +1 -0
  16. package/build/static/js/2372.844b5190.chunk.js +2 -0
  17. package/build/static/js/2372.844b5190.chunk.js.LICENSE.txt +10 -0
  18. package/build/static/js/2385.2cbc4e3c.chunk.js +1 -0
  19. package/build/static/js/2448.e6f85eda.chunk.js +1 -0
  20. package/build/static/js/2753.c27b6faa.chunk.js +1 -0
  21. package/build/static/js/2873.f5c04f3b.chunk.js +1 -0
  22. package/build/static/js/2940.dd2240b9.chunk.js +1 -0
  23. package/build/static/js/3208.55e0b2fa.chunk.js +1 -0
  24. package/build/static/js/4021.ec2e87b0.chunk.js +1 -0
  25. package/build/static/js/4482.a9238ad0.chunk.js +1 -0
  26. package/build/static/js/4494.6bb6fb20.chunk.js +1 -0
  27. package/build/static/js/4694.aa16aaee.chunk.js +1 -0
  28. package/build/static/js/4721.2185bda3.chunk.js +1 -0
  29. package/build/static/js/4724.374578aa.chunk.js +1 -0
  30. package/build/static/js/4785.76a05d79.chunk.js +1 -0
  31. package/build/static/js/4831.391fe620.chunk.js +1 -0
  32. package/build/static/js/4949.391c96be.chunk.js +2 -0
  33. package/build/static/js/{2961.54b0c743.chunk.js.LICENSE.txt → 4949.391c96be.chunk.js.LICENSE.txt} +15 -15
  34. package/build/static/js/5299.beb80829.chunk.js +1 -0
  35. package/build/static/js/6093.209cd165.chunk.js +1 -0
  36. package/build/static/js/6134.b9e5b2db.chunk.js +1 -0
  37. package/build/static/js/6679.f4ee1d77.chunk.js +2 -0
  38. package/build/static/js/6679.f4ee1d77.chunk.js.LICENSE.txt +62 -0
  39. package/build/static/js/6802.df955c77.chunk.js +1 -0
  40. package/build/static/js/6865.12e417bf.chunk.js +1 -0
  41. package/build/static/js/698.116a166b.chunk.js +1 -0
  42. package/build/static/js/7125.afecc159.chunk.js +1 -0
  43. package/build/static/js/{7332.2f57919b.chunk.js → 7332.cb5400eb.chunk.js} +1 -1
  44. package/build/static/js/7579.ea965a43.chunk.js +1 -0
  45. package/build/static/js/7696.c9589682.chunk.js +1 -0
  46. package/build/static/js/790.4b5acd65.chunk.js +1 -0
  47. package/build/static/js/8050.029f3dc8.chunk.js +1 -0
  48. package/build/static/js/8097.4837946f.chunk.js +2 -0
  49. package/build/static/js/{3603.e3f6f11d.chunk.js → 8186.2f2e42e5.chunk.js} +2 -2
  50. package/build/static/js/865.143ae622.chunk.js +1 -0
  51. package/build/static/js/8801.77babe65.chunk.js +1 -0
  52. package/build/static/js/8850.6abc7336.chunk.js +1 -0
  53. package/build/static/js/9005.87bae37e.chunk.js +1 -0
  54. package/build/static/js/9166.f234f6b4.chunk.js +2 -0
  55. package/build/static/js/9166.f234f6b4.chunk.js.LICENSE.txt +13 -0
  56. package/build/static/js/9311.7c7348b0.chunk.js +1 -0
  57. package/build/static/js/9320.14465db9.chunk.js +1 -0
  58. package/build/static/js/9449.a2c361bb.chunk.js +2 -0
  59. package/build/static/js/9449.a2c361bb.chunk.js.LICENSE.txt +40 -0
  60. package/build/static/js/9699.df050cd6.chunk.js +1 -0
  61. package/build/static/js/9813.1821ef79.chunk.js +1 -0
  62. package/build/static/js/main.ca9c9d66.js +28 -0
  63. package/build/static/js/{main.52e22014.js.LICENSE.txt → main.ca9c9d66.js.LICENSE.txt} +23 -23
  64. package/build/static/media/SourceCodePro-Bold.17a68a0751a813474a0e.woff2 +0 -0
  65. package/build/static/media/SourceCodePro-BoldItalic.d45b7a3df103d441d78b.woff2 +0 -0
  66. package/build/static/media/SourceCodePro-Italic.ec122a420df4175e74f2.woff2 +0 -0
  67. package/build/static/media/SourceCodePro-Regular.84b900b88d09398d86b0.woff2 +0 -0
  68. package/build/static/media/SourceCodePro-SemiBold.17291d1c493cb25eb2c3.woff2 +0 -0
  69. package/build/static/media/SourceCodePro-SemiBoldItalic.f879ae27307c3926522b.woff2 +0 -0
  70. package/build/static/media/SourceSansPro-Bold.118dea98980e20a81ced.woff2 +0 -0
  71. package/build/static/media/SourceSansPro-BoldItalic.1d664be59d2eb5fef029.woff2 +0 -0
  72. package/build/static/media/SourceSansPro-Italic.8a9bfea74d43927d6eec.woff2 +0 -0
  73. package/build/static/media/SourceSansPro-Regular.0d69e5ff5e92ac64a0c9.woff2 +0 -0
  74. package/build/static/media/SourceSansPro-SemiBold.abed79cd0df1827e18cf.woff2 +0 -0
  75. package/build/static/media/SourceSansPro-SemiBoldItalic.befb0a2824eabc5ce36b.woff2 +0 -0
  76. package/build/static/media/SourceSerifPro-Bold.d7975b56594770699ae0.woff2 +0 -0
  77. package/build/static/media/SourceSerifPro-BoldItalic.913697a7178b128caa4c.woff2 +0 -0
  78. package/build/static/media/SourceSerifPro-Italic.d3529cb5797663ac5d88.woff2 +0 -0
  79. package/build/static/media/SourceSerifPro-Regular.e6c37aa3926474cc93e1.woff2 +0 -0
  80. package/build/static/media/SourceSerifPro-SemiBold.5c1d378dd5990ef334ca.woff2 +0 -0
  81. package/build/static/media/SourceSerifPro-SemiBoldItalic.249e948b885d0c7d30a8.woff2 +0 -0
  82. package/build/static/media/index.c05687ef19f5bac24939.cjs +1 -0
  83. package/build/static/media/index.cf5b321a6e04bf47c12e.cjs +1 -0
  84. package/build/static/media/index.db61103fb7fdd62b9c44.cjs +1 -0
  85. package/build/static/media/index.f29488c1099d5e3883ac.cjs +1 -0
  86. package/package.json +5 -5
  87. package/build/static/css/5099.60b7ada4.chunk.css +0 -1
  88. package/build/static/css/main.73ab603a.css +0 -1
  89. package/build/static/js/1318.57c335d2.chunk.js +0 -1
  90. package/build/static/js/142.3d0fb3e3.chunk.js +0 -1
  91. package/build/static/js/172.0ee3e7c6.chunk.js +0 -5
  92. package/build/static/js/1839.29b0ce99.chunk.js +0 -1
  93. package/build/static/js/2327.b8572a38.chunk.js +0 -1
  94. package/build/static/js/2775.c1ed54fa.chunk.js +0 -5
  95. package/build/static/js/291.aa03bc71.chunk.js +0 -1
  96. package/build/static/js/2961.54b0c743.chunk.js +0 -2
  97. package/build/static/js/3580.31cb6ce5.chunk.js +0 -1
  98. package/build/static/js/3744.6440bac0.chunk.js +0 -2
  99. package/build/static/js/3744.6440bac0.chunk.js.LICENSE.txt +0 -5
  100. package/build/static/js/3975.5538132d.chunk.js +0 -1
  101. package/build/static/js/4140.edb6c36a.chunk.js +0 -1
  102. package/build/static/js/4141.623ab362.chunk.js +0 -9
  103. package/build/static/js/4320.5977ee6b.chunk.js +0 -2
  104. package/build/static/js/4320.5977ee6b.chunk.js.LICENSE.txt +0 -20
  105. package/build/static/js/5093.304fcb1e.chunk.js +0 -1
  106. package/build/static/js/5099.51feed45.chunk.js +0 -1
  107. package/build/static/js/5177.21c4f353.chunk.js +0 -2
  108. package/build/static/js/5241.0326c97c.chunk.js +0 -1
  109. package/build/static/js/5440.c7134ed1.chunk.js +0 -1
  110. package/build/static/js/5617.837c33c0.chunk.js +0 -1
  111. package/build/static/js/6557.fd2f35c8.chunk.js +0 -1
  112. package/build/static/js/6679.a8b5d830.chunk.js +0 -2
  113. package/build/static/js/6679.a8b5d830.chunk.js.LICENSE.txt +0 -60
  114. package/build/static/js/6683.aab9fa01.chunk.js +0 -1
  115. package/build/static/js/6756.2cb6963c.chunk.js +0 -1
  116. package/build/static/js/6862.886eab8e.chunk.js +0 -1
  117. package/build/static/js/6865.b0803b6b.chunk.js +0 -1
  118. package/build/static/js/6913.30734208.chunk.js +0 -17
  119. package/build/static/js/6939.c09d92c1.chunk.js +0 -1
  120. package/build/static/js/787.a500c8a4.chunk.js +0 -1
  121. package/build/static/js/792.04aad606.chunk.js +0 -1
  122. package/build/static/js/8035.dc118cc9.chunk.js +0 -1
  123. package/build/static/js/8295.c3cd87de.chunk.js +0 -1
  124. package/build/static/js/8418.aed275df.chunk.js +0 -1
  125. package/build/static/js/8486.e56533d6.chunk.js +0 -1
  126. package/build/static/js/865.9e23130b.chunk.js +0 -1
  127. package/build/static/js/9004.6a66722a.chunk.js +0 -1
  128. package/build/static/js/9042.a6fcbc74.chunk.js +0 -5
  129. package/build/static/js/9107.b49ea9ea.chunk.js +0 -5
  130. package/build/static/js/9130.8e10440e.chunk.js +0 -1
  131. package/build/static/js/9166.1a468fb9.chunk.js +0 -2
  132. package/build/static/js/9166.1a468fb9.chunk.js.LICENSE.txt +0 -13
  133. package/build/static/js/9382.c417d448.chunk.js +0 -1
  134. package/build/static/js/9615.c725e9d2.chunk.js +0 -1
  135. package/build/static/js/9733.e3808291.chunk.js +0 -2
  136. package/build/static/js/9733.e3808291.chunk.js.LICENSE.txt +0 -8
  137. package/build/static/js/9915.fe11690a.chunk.js +0 -1
  138. package/build/static/js/main.52e22014.js +0 -28
  139. package/build/static/media/SourceCodePro-Bold.52ac8f3034507f1d9e53.ttf +0 -0
  140. package/build/static/media/SourceCodePro-BoldItalic.05b618077343fbbd92b7.ttf +0 -0
  141. package/build/static/media/SourceCodePro-Italic.454577c22304619db035.ttf +0 -0
  142. package/build/static/media/SourceCodePro-Regular.70cc7ff27245e82ad414.ttf +0 -0
  143. package/build/static/media/SourceCodePro-SemiBold.4d4c53c06b5bebed1cf3.ttf +0 -0
  144. package/build/static/media/SourceCodePro-SemiBoldItalic.2f5470bc8b2cd27a5c4b.ttf +0 -0
  145. package/build/static/media/SourceSansPro-Bold.12e6acd2589d00c9d0aa.ttf +0 -0
  146. package/build/static/media/SourceSansPro-BoldItalic.7c4f9b00300acb82f0f6.ttf +0 -0
  147. package/build/static/media/SourceSansPro-Italic.3c01996d38a55834ddcb.ttf +0 -0
  148. package/build/static/media/SourceSansPro-Regular.efa76f8326aa5cee3bdd.ttf +0 -0
  149. package/build/static/media/SourceSansPro-SemiBold.43cc81b496222dc9ce3c.ttf +0 -0
  150. package/build/static/media/SourceSansPro-SemiBoldItalic.c30987e28fc21daba1ae.ttf +0 -0
  151. package/build/static/media/SourceSerifPro-Bold.bada4fe17051c992f22f.ttf +0 -0
  152. package/build/static/media/SourceSerifPro-BoldItalic.9f9b1eb2d82e26bb2f4a.ttf +0 -0
  153. package/build/static/media/SourceSerifPro-Italic.90931d6ad253cd8de8e4.ttf +0 -0
  154. package/build/static/media/SourceSerifPro-Regular.6f22301c30206f4bad62.ttf +0 -0
  155. package/build/static/media/SourceSerifPro-SemiBold.b27cb117978bab2c80a3.ttf +0 -0
  156. package/build/static/media/SourceSerifPro-SemiBoldItalic.1266f2c17835efdcff7b.ttf +0 -0
  157. package/build/static/media/index.09797f5e19b3c0491904.cjs +0 -1
  158. package/build/static/media/index.1e3d64b0fcde879f0060.cjs +0 -1
  159. package/build/static/media/index.85823dd8655ed4119d0c.cjs +0 -1
  160. package/build/static/media/index.b599194a631d76b49328.cjs +0 -1
  161. /package/build/static/css/{4320.1edfa457.chunk.css → 9449.1edfa457.chunk.css} +0 -0
  162. /package/build/static/js/{5177.21c4f353.chunk.js.LICENSE.txt → 8097.4837946f.chunk.js.LICENSE.txt} +0 -0
  163. /package/build/static/js/{3603.e3f6f11d.chunk.js.LICENSE.txt → 8186.2f2e42e5.chunk.js.LICENSE.txt} +0 -0
@@ -0,0 +1,2 @@
1
+ /*! For license information please see 8097.4837946f.chunk.js.LICENSE.txt */
2
+ (globalThis.webpackChunk_stlite_desktop=globalThis.webpackChunk_stlite_desktop||[]).push([[8097],{71486:(e,t,n)=>{var i=n(62894),r=n(40933)((function(e,t,n,r){i(e,t,n,r)}));e.exports=r},5361:(e,t,n)=>{"use strict";n.d(t,{ZP:()=>uv});var i={};n.r(i),n.d(i,{JsonPatchError:()=>v,_areEquals:()=>S,applyOperation:()=>k,applyPatch:()=>E,applyReducer:()=>D,deepClone:()=>b,getValueByPointer:()=>w,validate:()=>A,validator:()=>$});var r={};n.r(r),n.d(r,{compare:()=>R,generate:()=>N,observe:()=>T,unobserve:()=>O});var o={};n.r(o),n.d(o,{accessPathDepth:()=>De,accessPathWithDatum:()=>be,compile:()=>wm,contains:()=>Q,deepEqual:()=>ze,deleteNestedProperty:()=>ye,duplicate:()=>J,entries:()=>he,every:()=>te,fieldIntersection:()=>ue,flatAccessWithDatum:()=>xe,getFirstDefined:()=>$e,hasIntersection:()=>se,hash:()=>K,internalField:()=>Ce,isBoolean:()=>pe,isEmpty:()=>ce,isEqual:()=>oe,isInternalField:()=>Fe,isNullOrFalse:()=>Z,isNumeric:()=>Te,keys:()=>fe,logicalExpr:()=>ge,mergeDeep:()=>ne,never:()=>G,normalize:()=>Ou,normalizeAngle:()=>Oe,omit:()=>Y,pick:()=>V,prefixGenerator:()=>le,removePathFromField:()=>Ee,replaceAll:()=>ke,replacePathInField:()=>we,resetIdCounter:()=>Me,setEqual:()=>ae,some:()=>ee,stringify:()=>Re,titleCase:()=>ve,unique:()=>re,uniqueId:()=>Se,vals:()=>de,varName:()=>me,version:()=>km});var a={};n.r(a),n.d(a,{carbong10:()=>kg,carbong100:()=>Dg,carbong90:()=>Eg,carbonwhite:()=>wg,dark:()=>Sm,excel:()=>Cm,fivethirtyeight:()=>zm,ggplot2:()=>Pm,googlecharts:()=>rg,latimes:()=>qm,powerbi:()=>yg,quartz:()=>Xm,urbaninstitute:()=>eg,version:()=>$g,vox:()=>Gm});var s=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),l=Object.prototype.hasOwnProperty;function u(e,t){return l.call(e,t)}function c(e){if(Array.isArray(e)){for(var t=new Array(e.length),n=0;n<t.length;n++)t[n]=""+n;return t}if(Object.keys)return Object.keys(e);var i=[];for(var r in e)u(e,r)&&i.push(r);return i}function f(e){switch(typeof e){case"object":return JSON.parse(JSON.stringify(e));case"undefined":return null;default:return e}}function d(e){for(var t,n=0,i=e.length;n<i;){if(!((t=e.charCodeAt(n))>=48&&t<=57))return!1;n++}return!0}function h(e){return-1===e.indexOf("/")&&-1===e.indexOf("~")?e:e.replace(/~/g,"~0").replace(/\//g,"~1")}function p(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function m(e){if(void 0===e)return!0;if(e)if(Array.isArray(e)){for(var t=0,n=e.length;t<n;t++)if(m(e[t]))return!0}else if("object"===typeof e)for(var i=c(e),r=i.length,o=0;o<r;o++)if(m(e[i[o]]))return!0;return!1}function g(e,t){var n=[e];for(var i in t){var r="object"===typeof t[i]?JSON.stringify(t[i],null,2):t[i];"undefined"!==typeof r&&n.push(i+": "+r)}return n.join("\n")}var y=function(e){function t(t,n,i,r,o){var a=this.constructor,s=e.call(this,g(t,{name:n,index:i,operation:r,tree:o}))||this;return s.name=n,s.index=i,s.operation=r,s.tree=o,Object.setPrototypeOf(s,a.prototype),s.message=g(t,{name:n,index:i,operation:r,tree:o}),s}return s(t,e),t}(Error),v=y,b=f,x={add:function(e,t,n){return e[t]=this.value,{newDocument:n}},remove:function(e,t,n){var i=e[t];return delete e[t],{newDocument:n,removed:i}},replace:function(e,t,n){var i=e[t];return e[t]=this.value,{newDocument:n,removed:i}},move:function(e,t,n){var i=w(n,this.path);i&&(i=f(i));var r=k(n,{op:"remove",path:this.from}).removed;return k(n,{op:"add",path:this.path,value:r}),{newDocument:n,removed:i}},copy:function(e,t,n){var i=w(n,this.from);return k(n,{op:"add",path:this.path,value:f(i)}),{newDocument:n}},test:function(e,t,n){return{newDocument:n,test:S(e[t],this.value)}},_get:function(e,t,n){return this.value=e[t],{newDocument:n}}},_={add:function(e,t,n){return d(t)?e.splice(t,0,this.value):e[t]=this.value,{newDocument:n,index:t}},remove:function(e,t,n){return{newDocument:n,removed:e.splice(t,1)[0]}},replace:function(e,t,n){var i=e[t];return e[t]=this.value,{newDocument:n,removed:i}},move:x.move,copy:x.copy,test:x.test,_get:x._get};function w(e,t){if(""==t)return e;var n={op:"_get",path:t};return k(e,n),n.value}function k(e,t,n,i,r,o){if(void 0===n&&(n=!1),void 0===i&&(i=!0),void 0===r&&(r=!0),void 0===o&&(o=0),n&&("function"==typeof n?n(t,0,e,t.path):$(t,0)),""===t.path){var a={newDocument:e};if("add"===t.op)return a.newDocument=t.value,a;if("replace"===t.op)return a.newDocument=t.value,a.removed=e,a;if("move"===t.op||"copy"===t.op)return a.newDocument=w(e,t.from),"move"===t.op&&(a.removed=e),a;if("test"===t.op){if(a.test=S(e,t.value),!1===a.test)throw new v("Test operation failed","TEST_OPERATION_FAILED",o,t,e);return a.newDocument=e,a}if("remove"===t.op)return a.removed=e,a.newDocument=null,a;if("_get"===t.op)return t.value=e,a;if(n)throw new v("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",o,t,e);return a}i||(e=f(e));var s=(t.path||"").split("/"),l=e,u=1,c=s.length,h=void 0,m=void 0,g=void 0;for(g="function"==typeof n?n:$;;){if((m=s[u])&&-1!=m.indexOf("~")&&(m=p(m)),r&&("__proto__"==m||"prototype"==m&&u>0&&"constructor"==s[u-1]))throw new TypeError("JSON-Patch: modifying `__proto__` or `constructor/prototype` prop is banned for security reasons, if this was on purpose, please set `banPrototypeModifications` flag false and pass it to this function. More info in fast-json-patch README");if(n&&void 0===h&&(void 0===l[m]?h=s.slice(0,u).join("/"):u==c-1&&(h=t.path),void 0!==h&&g(t,0,e,h)),u++,Array.isArray(l)){if("-"===m)m=l.length;else{if(n&&!d(m))throw new v("Expected an unsigned base-10 integer value, making the new referenced value the array element with the zero-based index","OPERATION_PATH_ILLEGAL_ARRAY_INDEX",o,t,e);d(m)&&(m=~~m)}if(u>=c){if(n&&"add"===t.op&&m>l.length)throw new v("The specified index MUST NOT be greater than the number of elements in the array","OPERATION_VALUE_OUT_OF_BOUNDS",o,t,e);if(!1===(a=_[t.op].call(t,l,m,e)).test)throw new v("Test operation failed","TEST_OPERATION_FAILED",o,t,e);return a}}else if(u>=c){if(!1===(a=x[t.op].call(t,l,m,e)).test)throw new v("Test operation failed","TEST_OPERATION_FAILED",o,t,e);return a}if(l=l[m],n&&u<c&&(!l||"object"!==typeof l))throw new v("Cannot perform operation at the desired path","OPERATION_PATH_UNRESOLVABLE",o,t,e)}}function E(e,t,n,i,r){if(void 0===i&&(i=!0),void 0===r&&(r=!0),n&&!Array.isArray(t))throw new v("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");i||(e=f(e));for(var o=new Array(t.length),a=0,s=t.length;a<s;a++)o[a]=k(e,t[a],n,!0,r,a),e=o[a].newDocument;return o.newDocument=e,o}function D(e,t,n){var i=k(e,t);if(!1===i.test)throw new v("Test operation failed","TEST_OPERATION_FAILED",n,t,e);return i.newDocument}function $(e,t,n,i){if("object"!==typeof e||null===e||Array.isArray(e))throw new v("Operation is not an object","OPERATION_NOT_AN_OBJECT",t,e,n);if(!x[e.op])throw new v("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",t,e,n);if("string"!==typeof e.path)throw new v("Operation `path` property is not a string","OPERATION_PATH_INVALID",t,e,n);if(0!==e.path.indexOf("/")&&e.path.length>0)throw new v('Operation `path` property must start with "/"',"OPERATION_PATH_INVALID",t,e,n);if(("move"===e.op||"copy"===e.op)&&"string"!==typeof e.from)throw new v("Operation `from` property is not present (applicable in `move` and `copy` operations)","OPERATION_FROM_REQUIRED",t,e,n);if(("add"===e.op||"replace"===e.op||"test"===e.op)&&void 0===e.value)throw new v("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_REQUIRED",t,e,n);if(("add"===e.op||"replace"===e.op||"test"===e.op)&&m(e.value))throw new v("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_CANNOT_CONTAIN_UNDEFINED",t,e,n);if(n)if("add"==e.op){var r=e.path.split("/").length,o=i.split("/").length;if(r!==o+1&&r!==o)throw new v("Cannot perform an `add` operation at the desired path","OPERATION_PATH_CANNOT_ADD",t,e,n)}else if("replace"===e.op||"remove"===e.op||"_get"===e.op){if(e.path!==i)throw new v("Cannot perform the operation at a path that does not exist","OPERATION_PATH_UNRESOLVABLE",t,e,n)}else if("move"===e.op||"copy"===e.op){var a=A([{op:"_get",path:e.from,value:void 0}],n);if(a&&"OPERATION_PATH_UNRESOLVABLE"===a.name)throw new v("Cannot perform the operation from a path that does not exist","OPERATION_FROM_UNRESOLVABLE",t,e,n)}}function A(e,t,n){try{if(!Array.isArray(e))throw new v("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");if(t)E(f(t),f(e),n||!0);else{n=n||$;for(var i=0;i<e.length;i++)n(e[i],i,t,void 0)}}catch(r){if(r instanceof v)return r;throw r}}function S(e,t){if(e===t)return!0;if(e&&t&&"object"==typeof e&&"object"==typeof t){var n,i,r,o=Array.isArray(e),a=Array.isArray(t);if(o&&a){if((i=e.length)!=t.length)return!1;for(n=i;0!==n--;)if(!S(e[n],t[n]))return!1;return!0}if(o!=a)return!1;var s=Object.keys(e);if((i=s.length)!==Object.keys(t).length)return!1;for(n=i;0!==n--;)if(!t.hasOwnProperty(s[n]))return!1;for(n=i;0!==n--;)if(!S(e[r=s[n]],t[r]))return!1;return!0}return e!==e&&t!==t}var M=new WeakMap,C=function(e){this.observers=new Map,this.obj=e},F=function(e,t){this.callback=e,this.observer=t};function O(e,t){t.unobserve()}function T(e,t){var n,i=function(e){return M.get(e)}(e);if(i){var r=function(e,t){return e.observers.get(t)}(i,t);n=r&&r.observer}else i=new C(e),M.set(e,i);if(n)return n;if(n={},i.value=f(e),t){n.callback=t,n.next=null;var o=function(){N(n)},a=function(){clearTimeout(n.next),n.next=setTimeout(o)};"undefined"!==typeof window&&(window.addEventListener("mouseup",a),window.addEventListener("keyup",a),window.addEventListener("mousedown",a),window.addEventListener("keydown",a),window.addEventListener("change",a))}return n.patches=[],n.object=e,n.unobserve=function(){N(n),clearTimeout(n.next),function(e,t){e.observers.delete(t.callback)}(i,n),"undefined"!==typeof window&&(window.removeEventListener("mouseup",a),window.removeEventListener("keyup",a),window.removeEventListener("mousedown",a),window.removeEventListener("keydown",a),window.removeEventListener("change",a))},i.observers.set(t,new F(t,n)),n}function N(e,t){void 0===t&&(t=!1);var n=M.get(e.object);z(n.value,e.object,e.patches,"",t),e.patches.length&&E(n.value,e.patches);var i=e.patches;return i.length>0&&(e.patches=[],e.callback&&e.callback(i)),i}function z(e,t,n,i,r){if(t!==e){"function"===typeof t.toJSON&&(t=t.toJSON());for(var o=c(t),a=c(e),s=!1,l=a.length-1;l>=0;l--){var d=e[m=a[l]];if(!u(t,m)||void 0===t[m]&&void 0!==d&&!1===Array.isArray(t))Array.isArray(e)===Array.isArray(t)?(r&&n.push({op:"test",path:i+"/"+h(m),value:f(d)}),n.push({op:"remove",path:i+"/"+h(m)}),s=!0):(r&&n.push({op:"test",path:i,value:e}),n.push({op:"replace",path:i,value:t}),!0);else{var p=t[m];"object"==typeof d&&null!=d&&"object"==typeof p&&null!=p&&Array.isArray(d)===Array.isArray(p)?z(d,p,n,i+"/"+h(m),r):d!==p&&(!0,r&&n.push({op:"test",path:i+"/"+h(m),value:f(d)}),n.push({op:"replace",path:i+"/"+h(m),value:f(p)}))}}if(s||o.length!=a.length)for(l=0;l<o.length;l++){var m;u(e,m=o[l])||void 0===t[m]||n.push({op:"add",path:i+"/"+h(m),value:f(t[m])})}}}function R(e,t,n){void 0===n&&(n=!1);var i=[];return z(e,t,i,"",n),i}Object.assign({},i,r,{JsonPatchError:y,deepClone:f,escapePathComponent:h,unescapePathComponent:p});var P=n(58381),L=n.n(P),U=n(1110),B=n(79220);var j=n(45528);function I(e){return!!e.or}function q(e){return!!e.and}function W(e){return!!e.not}function H(e,t){if(W(e))H(e.not,t);else if(q(e))for(const n of e.and)H(n,t);else if(I(e))for(const n of e.or)H(n,t);else t(e)}function X(e,t){return W(e)?{not:X(e.not,t)}:q(e)?{and:e.and.map((e=>X(e,t)))}:I(e)?{or:e.or.map((e=>X(e,t)))}:t(e)}const J=structuredClone;function G(e){throw new Error(e)}function V(e,t){const n={};for(const i of t)(0,j.nr)(e,i)&&(n[i]=e[i]);return n}function Y(e,t){const n={...e};for(const i of t)delete n[i];return n}function K(e){if((0,j.hj)(e))return e;const t=(0,j.HD)(e)?e:Re(e);if(t.length<250)return t;let n=0;for(let i=0;i<t.length;i++){n=(n<<5)-n+t.charCodeAt(i),n&=n}return n}function Z(e){return!1===e||null===e}function Q(e,t){return e.includes(t)}function ee(e,t){let n=0;for(const[i,r]of e.entries())if(t(r,i,n++))return!0;return!1}function te(e,t){let n=0;for(const[i,r]of e.entries())if(!t(r,i,n++))return!1;return!0}function ne(e,...t){for(const n of t)ie(e,n??{});return e}function ie(e,t){for(const n of fe(t))(0,j.iL)(e,n,t[n],!0)}function re(e,t){const n=[],i={};let r;for(const o of e)r=t(o),r in i||(i[r]=1,n.push(o));return n}function oe(e,t){const n=fe(e),i=fe(t);if(n.length!==i.length)return!1;for(const r of n)if(e[r]!==t[r])return!1;return!0}function ae(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function se(e,t){for(const n of e)if(t.has(n))return!0;return!1}function le(e){const t=new Set;for(const n of e){const e=(0,j._k)(n).map(((e,t)=>0===t?e:`[${e}]`)),i=e.map(((t,n)=>e.slice(0,n+1).join("")));for(const n of i)t.add(n)}return t}function ue(e,t){return void 0===e||void 0===t||se(le(e),le(t))}function ce(e){return 0===fe(e).length}Set.prototype.toJSON=function(){return`Set(${[...this].map((e=>Re(e))).join(",")})`};const fe=Object.keys,de=Object.values,he=Object.entries;function pe(e){return!0===e||!1===e}function me(e){const t=e.replace(/\W/g,"_");return(e.match(/^\d+/)?"_":"")+t}function ge(e,t){return W(e)?`!(${ge(e.not,t)})`:q(e)?`(${e.and.map((e=>ge(e,t))).join(") && (")})`:I(e)?`(${e.or.map((e=>ge(e,t))).join(") || (")})`:t(e)}function ye(e,t){if(0===t.length)return!0;const n=t.shift();return n in e&&ye(e[n],t)&&delete e[n],ce(e)}function ve(e){return e.charAt(0).toUpperCase()+e.substr(1)}function be(e,t="datum"){const n=(0,j._k)(e),i=[];for(let r=1;r<=n.length;r++){const e=`[${n.slice(0,r).map(j.m8).join("][")}]`;i.push(`${t}${e}`)}return i.join(" && ")}function xe(e,t="datum"){return`${t}[${(0,j.m8)((0,j._k)(e).join("."))}]`}function _e(e){return e.replace(/(\[|\]|\.|'|")/g,"\\$1")}function we(e){return`${(0,j._k)(e).map(_e).join("\\.")}`}function ke(e,t,n){return e.replace(new RegExp(t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),"g"),n)}function Ee(e){return`${(0,j._k)(e).join(".")}`}function De(e){return e?(0,j._k)(e).length:0}function $e(...e){for(const t of e)if(void 0!==t)return t}let Ae=42;function Se(e){const t=++Ae;return e?String(e)+t:t}function Me(){Ae=42}function Ce(e){return Fe(e)?e:`__${e}`}function Fe(e){return e.startsWith("__")}function Oe(e){if(void 0!==e)return(e%360+360)%360}function Te(e){return!!(0,j.hj)(e)||!isNaN(e)&&!isNaN(parseFloat(e))}const Ne=Object.getPrototypeOf(structuredClone({}));function ze(e,t){if(e===t)return!0;if(e&&t&&"object"==typeof e&&"object"==typeof t){if(e.constructor.name!==t.constructor.name)return!1;let n,i;if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(i=n;0!==i--;)if(!ze(e[i],t[i]))return!1;return!0}if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(i of e.entries())if(!t.has(i[0]))return!1;for(i of e.entries())if(!ze(i[1],t.get(i[0])))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(i of e.entries())if(!t.has(i[0]))return!1;return!0}if(ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if(n=e.length,n!=t.length)return!1;for(i=n;0!==i--;)if(e[i]!==t[i])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf&&e.valueOf!==Ne.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString&&e.toString!==Ne.toString)return e.toString()===t.toString();const r=Object.keys(e);if(n=r.length,n!==Object.keys(t).length)return!1;for(i=n;0!==i--;)if(!Object.prototype.hasOwnProperty.call(t,r[i]))return!1;for(i=n;0!==i--;){const n=r[i];if(!ze(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function Re(e){const t=[];return function e(n){if(n&&n.toJSON&&"function"===typeof n.toJSON&&(n=n.toJSON()),void 0===n)return;if("number"==typeof n)return isFinite(n)?""+n:"null";if("object"!==typeof n)return JSON.stringify(n);let i,r;if(Array.isArray(n)){for(r="[",i=0;i<n.length;i++)i&&(r+=","),r+=e(n[i])||"null";return r+"]"}if(null===n)return"null";if(t.includes(n))throw new TypeError("Converting circular structure to JSON");const o=t.push(n)-1,a=Object.keys(n).sort();for(r="",i=0;i<a.length;i++){const t=a[i],o=e(n[t]);o&&(r&&(r+=","),r+=JSON.stringify(t)+":"+o)}return t.splice(o,1),`{${r}}`}(e)}const Pe="row",Le="column",Ue="facet",Be="x",je="y",Ie="x2",qe="y2",We="xOffset",He="yOffset",Xe="radius",Je="radius2",Ge="theta",Ve="theta2",Ye="latitude",Ke="longitude",Ze="latitude2",Qe="longitude2",et="color",tt="fill",nt="stroke",it="shape",rt="size",ot="angle",at="opacity",st="fillOpacity",lt="strokeOpacity",ut="strokeWidth",ct="strokeDash",ft="text",dt="order",ht="detail",pt="key",mt="tooltip",gt="href",yt="url",vt="description",bt={theta:1,theta2:1,radius:1,radius2:1};function xt(e){return e in bt}const _t={longitude:1,longitude2:1,latitude:1,latitude2:1};function wt(e){switch(e){case Ye:return"y";case Ze:return"y2";case Ke:return"x";case Qe:return"x2"}}function kt(e){return e in _t}const Et=fe(_t),Dt={x:1,y:1,x2:1,y2:1,...bt,..._t,xOffset:1,yOffset:1,color:1,fill:1,stroke:1,opacity:1,fillOpacity:1,strokeOpacity:1,strokeWidth:1,strokeDash:1,size:1,angle:1,shape:1,order:1,text:1,detail:1,key:1,tooltip:1,href:1,url:1,description:1};function $t(e){return e===et||e===tt||e===nt}const At={row:1,column:1,facet:1},St=fe(At),Mt={...Dt,...At},Ct=fe(Mt),{order:Ft,detail:Ot,tooltip:Tt,...Nt}=Mt,{row:zt,column:Rt,facet:Pt,...Lt}=Nt;fe(Nt),fe(Lt);function Ut(e){return!!Mt[e]}const Bt=[Ie,qe,Ze,Qe,Ve,Je];function jt(e){return It(e)!==e}function It(e){switch(e){case Ie:return Be;case qe:return je;case Ze:return Ye;case Qe:return Ke;case Ve:return Ge;case Je:return Xe}return e}function qt(e){if(xt(e))switch(e){case Ge:return"startAngle";case Ve:return"endAngle";case Xe:return"outerRadius";case Je:return"innerRadius"}return e}function Wt(e){switch(e){case Be:return Ie;case je:return qe;case Ye:return Ze;case Ke:return Qe;case Ge:return Ve;case Xe:return Je}}function Ht(e){switch(e){case Be:case Ie:return"width";case je:case qe:return"height"}}function Xt(e){switch(e){case Be:return"xOffset";case je:return"yOffset";case Ie:return"x2Offset";case qe:return"y2Offset";case Ge:return"thetaOffset";case Xe:return"radiusOffset";case Ve:return"theta2Offset";case Je:return"radius2Offset"}}function Jt(e){switch(e){case Be:return"xOffset";case je:return"yOffset"}}function Gt(e){switch(e){case"xOffset":return"x";case"yOffset":return"y"}}const Vt=fe(Dt),{x:Yt,y:Kt,x2:Zt,y2:Qt,xOffset:en,yOffset:tn,latitude:nn,longitude:rn,latitude2:on,longitude2:an,theta:sn,theta2:ln,radius:un,radius2:cn,...fn}=Dt,dn=fe(fn),hn={x:1,y:1},pn=fe(hn);function mn(e){return e in hn}const gn={theta:1,radius:1},yn=fe(gn);function vn(e){return"width"===e?Be:je}const bn={xOffset:1,yOffset:1};fe(bn);function xn(e){return e in bn}const{text:_n,tooltip:wn,href:kn,url:En,description:Dn,detail:$n,key:An,order:Sn,...Mn}=fn,Cn=fe(Mn);const Fn={...hn,...gn,...bn,...Mn},On=fe(Fn);function Tn(e){return!!Fn[e]}function Nn(e,t){return function(e){switch(e){case et:case tt:case nt:case vt:case ht:case pt:case mt:case gt:case dt:case at:case st:case lt:case ut:case Ue:case Pe:case Le:return zn;case Be:case je:case We:case He:case Ye:case Ke:return Pn;case Ie:case qe:case Ze:case Qe:return{area:"always",bar:"always",image:"always",rect:"always",rule:"always",circle:"binned",point:"binned",square:"binned",tick:"binned",line:"binned",trail:"binned"};case rt:return{point:"always",tick:"always",rule:"always",circle:"always",square:"always",bar:"always",text:"always",line:"always",trail:"always"};case ct:return{line:"always",point:"always",tick:"always",rule:"always",circle:"always",square:"always",bar:"always",geoshape:"always"};case it:return{point:"always",geoshape:"always"};case ft:return{text:"always"};case ot:return{point:"always",square:"always",text:"always"};case yt:return{image:"always"};case Ge:case Xe:return{text:"always",arc:"always"};case Ve:case Je:return{arc:"always"}}}(e)[t]}const zn={arc:"always",area:"always",bar:"always",circle:"always",geoshape:"always",image:"always",line:"always",rule:"always",point:"always",rect:"always",square:"always",trail:"always",text:"always",tick:"always"},{geoshape:Rn,...Pn}=zn;function Ln(e){switch(e){case Be:case je:case Ge:case Xe:case We:case He:case rt:case ot:case ut:case at:case st:case lt:case Ie:case qe:case Ve:case Je:return;case Ue:case Pe:case Le:case it:case ct:case ft:case mt:case gt:case yt:case vt:return"discrete";case et:case tt:case nt:return"flexible";case Ye:case Ke:case Ze:case Qe:case ht:case pt:case dt:return}}const Un={argmax:1,argmin:1,average:1,count:1,distinct:1,product:1,max:1,mean:1,median:1,min:1,missing:1,q1:1,q3:1,ci0:1,ci1:1,stderr:1,stdev:1,stdevp:1,sum:1,valid:1,values:1,variance:1,variancep:1},Bn={count:1,min:1,max:1};function jn(e){return!!e&&!!e.argmin}function In(e){return!!e&&!!e.argmax}function qn(e){return(0,j.HD)(e)&&!!Un[e]}const Wn=new Set(["count","valid","missing","distinct"]);function Hn(e){return(0,j.HD)(e)&&Wn.has(e)}const Xn=new Set(["count","sum","distinct","valid","missing"]),Jn=new Set(["mean","average","median","q1","q3","min","max"]);function Gn(e){return(0,j.jn)(e)&&(e=os(e,void 0)),"bin"+fe(e).map((t=>Zn(e[t])?me(`_${t}_${he(e[t])}`):me(`_${t}_${e[t]}`))).join("")}function Vn(e){return!0===e||Kn(e)&&!e.binned}function Yn(e){return"binned"===e||Kn(e)&&!0===e.binned}function Kn(e){return(0,j.Kn)(e)}function Zn(e){return e?.param}function Qn(e){switch(e){case Pe:case Le:case rt:case et:case tt:case nt:case ut:case at:case st:case lt:case it:return 6;case ct:return 4;default:return 10}}function ei(e){return!!e?.expr}function ti(e){const t=fe(e||{}),n={};for(const i of t)n[i]=fi(e[i]);return n}function ni(e){const{anchor:t,frame:n,offset:i,orient:r,angle:o,limit:a,color:s,subtitleColor:l,subtitleFont:u,subtitleFontSize:c,subtitleFontStyle:f,subtitleFontWeight:d,subtitleLineHeight:h,subtitlePadding:p,...m}=e,g={...t?{anchor:t}:{},...n?{frame:n}:{},...i?{offset:i}:{},...r?{orient:r}:{},...void 0!==o?{angle:o}:{},...void 0!==a?{limit:a}:{}},y={...l?{subtitleColor:l}:{},...u?{subtitleFont:u}:{},...c?{subtitleFontSize:c}:{},...f?{subtitleFontStyle:f}:{},...d?{subtitleFontWeight:d}:{},...h?{subtitleLineHeight:h}:{},...p?{subtitlePadding:p}:{}};return{titleMarkConfig:{...m,...s?{fill:s}:{}},subtitleMarkConfig:V(e,["align","baseline","dx","dy","limit"]),nonMarkTitleProperties:g,subtitle:y}}function ii(e){return(0,j.HD)(e)||(0,j.kJ)(e)&&(0,j.HD)(e[0])}function ri(e){return!!e?.signal}function oi(e){return!!e.step}function ai(e){return!(0,j.kJ)(e)&&("field"in e&&"data"in e)}const si=fe({aria:1,description:1,ariaRole:1,ariaRoleDescription:1,blend:1,opacity:1,fill:1,fillOpacity:1,stroke:1,strokeCap:1,strokeWidth:1,strokeOpacity:1,strokeDash:1,strokeDashOffset:1,strokeJoin:1,strokeOffset:1,strokeMiterLimit:1,startAngle:1,endAngle:1,padAngle:1,innerRadius:1,outerRadius:1,size:1,shape:1,interpolate:1,tension:1,orient:1,align:1,baseline:1,text:1,dir:1,dx:1,dy:1,ellipsis:1,limit:1,radius:1,theta:1,angle:1,font:1,fontSize:1,fontWeight:1,fontStyle:1,lineBreak:1,lineHeight:1,cursor:1,href:1,tooltip:1,cornerRadius:1,cornerRadiusTopLeft:1,cornerRadiusTopRight:1,cornerRadiusBottomLeft:1,cornerRadiusBottomRight:1,aspect:1,width:1,height:1,url:1,smooth:1}),li={arc:1,area:1,group:1,image:1,line:1,path:1,rect:1,rule:1,shape:1,symbol:1,text:1,trail:1},ui=["cornerRadius","cornerRadiusTopLeft","cornerRadiusTopRight","cornerRadiusBottomLeft","cornerRadiusBottomRight"];function ci(e){const t=(0,j.kJ)(e.condition)?e.condition.map(di):di(e.condition);return{...fi(e),condition:t}}function fi(e){if(ei(e)){const{expr:t,...n}=e;return{signal:t,...n}}return e}function di(e){if(ei(e)){const{expr:t,...n}=e;return{signal:t,...n}}return e}function hi(e){if(ei(e)){const{expr:t,...n}=e;return{signal:t,...n}}return ri(e)?e:void 0!==e?{value:e}:void 0}function pi(e){return ri(e)?e.signal:(0,j.m8)(e.value)}function mi(e){return ri(e)?e.signal:null==e?null:(0,j.m8)(e)}function gi(e,t,n){for(const i of n){const n=bi(i,t.markDef,t.config);void 0!==n&&(e[i]=hi(n))}return e}function yi(e){return[].concat(e.type,e.style??[])}function vi(e,t,n,i={}){const{vgChannel:r,ignoreVgConfig:o}=i;return r&&void 0!==t[r]?t[r]:void 0!==t[e]?t[e]:!o||r&&r!==e?bi(e,t,n,i):void 0}function bi(e,t,n,{vgChannel:i}={}){return $e(i?xi(e,t,n.style):void 0,xi(e,t,n.style),i?n[t.type][i]:void 0,n[t.type][e],i?n.mark[i]:n.mark[e])}function xi(e,t,n){return _i(e,yi(t),n)}function _i(e,t,n){let i;t=(0,j.IX)(t);for(const r of t){const t=n[r];t&&void 0!==t[e]&&(i=t[e])}return i}function wi(e,t){return(0,j.IX)(e).reduce(((e,n)=>(e.field.push(Ha(n,t)),e.order.push(n.sort??"ascending"),e)),{field:[],order:[]})}function ki(e,t){const n=[...e];return t.forEach((e=>{for(const t of n)if(ze(t,e))return;n.push(e)})),n}function Ei(e,t){return ze(e,t)||!t?e:e?[...(0,j.IX)(e),...(0,j.IX)(t)].join(", "):t}function Di(e,t){const n=e.value,i=t.value;if(null==n||null===i)return{explicit:e.explicit,value:null};if((ii(n)||ri(n))&&(ii(i)||ri(i)))return{explicit:e.explicit,value:Ei(n,i)};if(ii(n)||ri(n))return{explicit:e.explicit,value:n};if(ii(i)||ri(i))return{explicit:e.explicit,value:i};if(!ii(n)&&!ri(n)&&!ii(i)&&!ri(i))return{explicit:e.explicit,value:ki(n,i)};throw new Error("It should never reach here")}function $i(e){return`Invalid specification ${Re(e)}. Make sure the specification includes at least one of the following properties: "mark", "layer", "facet", "hconcat", "vconcat", "concat", or "repeat".`}const Ai='Autosize "fit" only works for single views and layered views.';function Si(e){return`${"width"==e?"Width":"Height"} "container" only works for single views and layered views.`}function Mi(e){return`${"width"==e?"Width":"Height"} "container" only works well with autosize "fit" or "fit-${"width"==e?"x":"y"}".`}function Ci(e){return e?`Dropping "fit-${e}" because spec has discrete ${Ht(e)}.`:'Dropping "fit" because spec has discrete size.'}function Fi(e){return`Unknown field for ${e}. Cannot calculate view size.`}function Oi(e){return`Cannot project a selection on encoding channel "${e}", which has no field.`}function Ti(e,t){return`Cannot project a selection on encoding channel "${e}" as it uses an aggregate function ("${t}").`}function Ni(e){return`Selection not supported for ${e} yet.`}const zi="The same selection must be used to override scale domains in a layered view.";function Ri(e){return`The "columns" property cannot be used when "${e}" has nested row/column.`}function Pi(e,t,n){return`An ancestor parsed field "${e}" as ${n} but a child wants to parse the field as ${t}.`}function Li(e){return`Config.customFormatTypes is not true, thus custom format type and format for channel ${e} are dropped.`}function Ui(e){return`${e}Offset dropped because ${e} is continuous`}function Bi(e){return`Invalid field type "${e}".`}function ji(e,t){const{fill:n,stroke:i}=t;return`Dropping color ${e} as the plot also has ${n&&i?"fill and stroke":n?"fill":"stroke"}.`}function Ii(e,t){return`Dropping ${Re(e)} from channel "${t}" since it does not contain any data field, datum, value, or signal.`}function qi(e,t,n){return`${e} dropped as it is incompatible with "${t}"${n?` when ${n}`:""}.`}function Wi(e){return`${e} encoding should be discrete (ordinal / nominal / binned).`}function Hi(e){return`${e} encoding should be discrete (ordinal / nominal / binned) or use a discretizing scale (e.g. threshold).`}function Xi(e,t){return`Using discrete channel "${e}" to encode "${t}" field can be misleading as it does not encode ${"ordinal"===t?"order":"magnitude"}.`}function Ji(e){return`Using unaggregated domain with raw field has no effect (${Re(e)}).`}function Gi(e){return`Unaggregated domain not applicable for "${e}" since it produces values outside the origin domain of the source data.`}function Vi(e){return`Unaggregated domain is currently unsupported for log scale (${Re(e)}).`}function Yi(e,t,n){return`${n}-scale's "${t}" is dropped as it does not work with ${e} scale.`}function Ki(e){return`The step for "${e}" is dropped because the ${"width"===e?"x":"y"} is continuous.`}const Zi="Domains that should be unioned has conflicting sort properties. Sort will be set to true.";function Qi(e,t){return`Invalid ${e}: ${Re(t)}.`}function er(e){return`1D error band does not support ${e}.`}function tr(e){return`Channel ${e} is required for "binned" bin.`}const nr=(0,j.kg)(j.uU);let ir=nr;function rr(){return ir=nr,ir}function or(...e){ir.warn(...e)}function ar(e){if(e&&(0,j.Kn)(e))for(const t of pr)if(t in e)return!0;return!1}new WeakMap;const sr=["january","february","march","april","may","june","july","august","september","october","november","december"],lr=sr.map((e=>e.substr(0,3))),ur=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"],cr=ur.map((e=>e.substr(0,3)));function fr(e,t){const n=[];if(t&&void 0!==e.day&&fe(e).length>1&&(or(function(e){return`Dropping day from datetime ${Re(e)} as day cannot be combined with other units.`}(e)),delete(e=J(e)).day),void 0!==e.year?n.push(e.year):n.push(2012),void 0!==e.month){const i=t?function(e){if(Te(e)&&(e=+e),(0,j.hj)(e))return e-1;{const t=e.toLowerCase(),n=sr.indexOf(t);if(-1!==n)return n;const i=t.substr(0,3),r=lr.indexOf(i);if(-1!==r)return r;throw new Error(Qi("month",e))}}(e.month):e.month;n.push(i)}else if(void 0!==e.quarter){const i=t?function(e){if(Te(e)&&(e=+e),(0,j.hj)(e))return e>4&&or(Qi("quarter",e)),e-1;throw new Error(Qi("quarter",e))}(e.quarter):e.quarter;n.push((0,j.hj)(i)?3*i:`${i}*3`)}else n.push(0);if(void 0!==e.date)n.push(e.date);else if(void 0!==e.day){const i=t?function(e){if(Te(e)&&(e=+e),(0,j.hj)(e))return e%7;{const t=e.toLowerCase(),n=ur.indexOf(t);if(-1!==n)return n;const i=t.substr(0,3),r=cr.indexOf(i);if(-1!==r)return r;throw new Error(Qi("day",e))}}(e.day):e.day;n.push((0,j.hj)(i)?i+1:`${i}+1`)}else n.push(1);for(const i of["hours","minutes","seconds","milliseconds"]){const t=e[i];n.push("undefined"===typeof t?0:t)}return n}function dr(e){const t=fr(e,!0).join(", ");return e.utc?`utc(${t})`:`datetime(${t})`}const hr={year:1,quarter:1,month:1,week:1,day:1,dayofyear:1,date:1,hours:1,minutes:1,seconds:1,milliseconds:1},pr=fe(hr);function mr(e){return(0,j.Kn)(e)?e.binned:gr(e)}function gr(e){return e&&e.startsWith("binned")}function yr(e){return e.startsWith("utc")}const vr={"year-month":"%b %Y ","year-month-date":"%b %d, %Y "};function br(e){return pr.filter((t=>_r(e,t)))}function xr(e){const t=br(e);return t[t.length-1]}function _r(e,t){const n=e.indexOf(t);return!(n<0)&&(!(n>0&&"seconds"===t&&"i"===e.charAt(n-1))&&(!(e.length>n+3&&"day"===t&&"o"===e.charAt(n+3))&&!(n>0&&"year"===t&&"f"===e.charAt(n-1))))}function wr(e,t,{end:n}={end:!1}){const i=be(t),r=yr(e)?"utc":"";let o;const a={};for(const l of pr)_r(e,l)&&(a[l]="quarter"===(s=l)?`(${r}quarter(${i})-1)`:`${r}${s}(${i})`,o=l);var s;return n&&(a[o]+="+1"),function(e){const t=fr(e,!1).join(", ");return e.utc?`utc(${t})`:`datetime(${t})`}(a)}function kr(e){if(!e)return;return`timeUnitSpecifier(${Re(br(e))}, ${Re(vr)})`}function Er(e){if(!e)return;let t;return(0,j.HD)(e)?t=gr(e)?{unit:e.substring(6),binned:!0}:{unit:e}:(0,j.Kn)(e)&&(t={...e,...e.unit?{unit:e.unit}:{}}),yr(t.unit)&&(t.utc=!0,t.unit=function(e){return e.substring(3)}(t.unit)),t}function Dr(e,t=(e=>e)){const n=Er(e),i=xr(n.unit);if(i&&"day"!==i){const e={year:2001,month:1,date:1,hours:0,minutes:0,seconds:0,milliseconds:0},{step:r,part:o}=Ar(i,n.step);return`${t(dr({...e,[o]:+e[o]+r}))} - ${t(dr(e))}`}}const $r={year:1,month:1,date:1,hours:1,minutes:1,seconds:1,milliseconds:1};function Ar(e,t=1){if(function(e){return!!$r[e]}(e))return{part:e,step:t};switch(e){case"day":case"dayofyear":return{part:"date",step:t};case"quarter":return{part:"month",step:3*t};case"week":return{part:"date",step:7*t}}}function Sr(e){return!!e?.field&&void 0!==e.equal}function Mr(e){return!!e?.field&&void 0!==e.lt}function Cr(e){return!!e?.field&&void 0!==e.lte}function Fr(e){return!!e?.field&&void 0!==e.gt}function Or(e){return!!e?.field&&void 0!==e.gte}function Tr(e){if(e?.field){if((0,j.kJ)(e.range)&&2===e.range.length)return!0;if(ri(e.range))return!0}return!1}function Nr(e){return!!e?.field&&((0,j.kJ)(e.oneOf)||(0,j.kJ)(e.in))}function zr(e){return Nr(e)||Sr(e)||Tr(e)||Mr(e)||Fr(e)||Cr(e)||Or(e)}function Rr(e,t){return ls(e,{timeUnit:t,wrapTime:!0})}function Pr(e,t=!0){const{field:n}=e,i=Er(e.timeUnit),{unit:r,binned:o}=i||{},a=Ha(e,{expr:"datum"}),s=r?`time(${o?a:wr(r,n)})`:a;if(Sr(e))return`${s}===${Rr(e.equal,r)}`;if(Mr(e)){return`${s}<${Rr(e.lt,r)}`}if(Fr(e)){return`${s}>${Rr(e.gt,r)}`}if(Cr(e)){return`${s}<=${Rr(e.lte,r)}`}if(Or(e)){return`${s}>=${Rr(e.gte,r)}`}if(Nr(e))return`indexof([${function(e,t){return e.map((e=>Rr(e,t)))}(e.oneOf,r).join(",")}], ${s}) !== -1`;if(function(e){return!!e?.field&&void 0!==e.valid}(e))return Lr(s,e.valid);if(Tr(e)){const{range:n}=e,i=ri(n)?{signal:`${n.signal}[0]`}:n[0],o=ri(n)?{signal:`${n.signal}[1]`}:n[1];if(null!==i&&null!==o&&t)return"inrange("+s+", ["+Rr(i,r)+", "+Rr(o,r)+"])";const a=[];return null!==i&&a.push(`${s} >= ${Rr(i,r)}`),null!==o&&a.push(`${s} <= ${Rr(o,r)}`),a.length>0?a.join(" && "):"true"}throw new Error(`Invalid field predicate: ${Re(e)}`)}function Lr(e,t=!0){return t?`isValid(${e}) && isFinite(+${e})`:`!isValid(${e}) || !isFinite(+${e})`}function Ur(e){return zr(e)&&e.timeUnit?{...e,timeUnit:Er(e.timeUnit)}:e}const Br={quantitative:"quantitative",ordinal:"ordinal",temporal:"temporal",nominal:"nominal",geojson:"geojson"};function jr(e){return"quantitative"===e||"temporal"===e}function Ir(e){return"ordinal"===e||"nominal"===e}const qr=Br.quantitative,Wr=Br.ordinal,Hr=Br.temporal,Xr=Br.nominal,Jr=Br.geojson;fe(Br);const Gr={LINEAR:"linear",LOG:"log",POW:"pow",SQRT:"sqrt",SYMLOG:"symlog",IDENTITY:"identity",SEQUENTIAL:"sequential",TIME:"time",UTC:"utc",QUANTILE:"quantile",QUANTIZE:"quantize",THRESHOLD:"threshold",BIN_ORDINAL:"bin-ordinal",ORDINAL:"ordinal",POINT:"point",BAND:"band"},Vr={linear:"numeric",log:"numeric",pow:"numeric",sqrt:"numeric",symlog:"numeric",identity:"numeric",sequential:"numeric",time:"time",utc:"time",ordinal:"ordinal","bin-ordinal":"bin-ordinal",point:"ordinal-position",band:"ordinal-position",quantile:"discretizing",quantize:"discretizing",threshold:"discretizing"};fe(Vr);function Yr(e,t){const n=Vr[e],i=Vr[t];return n===i||"ordinal-position"===n&&"time"===i||"ordinal-position"===i&&"time"===n}const Kr={linear:0,log:1,pow:1,sqrt:1,symlog:1,identity:1,sequential:1,time:0,utc:0,point:10,band:11,ordinal:0,"bin-ordinal":0,quantile:0,quantize:0,threshold:0};function Zr(e){return Kr[e]}const Qr=new Set(["linear","log","pow","sqrt","symlog"]),eo=new Set([...Qr,"time","utc"]);function to(e){return Qr.has(e)}const no=new Set(["quantile","quantize","threshold"]),io=new Set([...eo,...no,"sequential","identity"]),ro=new Set(["ordinal","bin-ordinal","point","band"]);new Set(["time","utc"]);function oo(e){return ro.has(e)}function ao(e){return io.has(e)}function so(e){return eo.has(e)}function lo(e){return no.has(e)}function uo(e){return e?.param}const co={type:1,domain:1,domainMax:1,domainMin:1,domainMid:1,domainRaw:1,align:1,range:1,rangeMax:1,rangeMin:1,scheme:1,bins:1,reverse:1,round:1,clamp:1,nice:1,base:1,exponent:1,constant:1,interpolate:1,zero:1,padding:1,paddingInner:1,paddingOuter:1},{type:fo,domain:ho,range:po,rangeMax:mo,rangeMin:go,scheme:yo,...vo}=(fe(co),co),bo=fe(vo);function xo(e,t){switch(t){case"type":case"domain":case"reverse":case"range":return!0;case"scheme":case"interpolate":return!["point","band","identity"].includes(e);case"bins":return!["point","band","identity","ordinal"].includes(e);case"round":return so(e)||"band"===e||"point"===e;case"padding":case"rangeMin":case"rangeMax":return so(e)||["point","band"].includes(e);case"paddingOuter":case"align":return["point","band"].includes(e);case"paddingInner":return"band"===e;case"domainMax":case"domainMid":case"domainMin":case"domainRaw":case"clamp":return so(e);case"nice":return so(e)||"quantize"===e||"threshold"===e;case"exponent":return"pow"===e;case"base":return"log"===e;case"constant":return"symlog"===e;case"zero":return ao(e)&&!Q(["log","time","utc","threshold","quantile"],e)}}function _o(e,t){switch(t){case"interpolate":case"scheme":case"domainMid":return $t(e)?void 0:`Cannot use the scale property "${t}" with non-color channel.`;case"align":case"type":case"bins":case"domain":case"domainMax":case"domainMin":case"domainRaw":case"range":case"base":case"exponent":case"constant":case"nice":case"padding":case"paddingInner":case"paddingOuter":case"rangeMax":case"rangeMin":case"reverse":case"round":case"clamp":case"zero":return}}const wo={arc:"arc",area:"area",bar:"bar",image:"image",line:"line",point:"point",rect:"rect",rule:"rule",text:"text",tick:"tick",trail:"trail",circle:"circle",square:"square",geoshape:"geoshape"},ko=wo.arc,Eo=wo.area,Do=wo.bar,$o=wo.image,Ao=wo.line,So=wo.point,Mo=wo.rect,Co=wo.rule,Fo=wo.text,Oo=wo.tick,To=wo.trail,No=wo.circle,zo=wo.square,Ro=wo.geoshape;function Po(e){return["line","area","trail"].includes(e)}function Lo(e){return["rect","bar","image","arc"].includes(e)}const Uo=new Set(fe(wo));function Bo(e){return e.type}const jo=["stroke","strokeWidth","strokeDash","strokeDashOffset","strokeOpacity","strokeJoin","strokeMiterLimit","fill","fillOpacity"],Io=fe({color:1,filled:1,invalid:1,order:1,radius2:1,theta2:1,timeUnitBandSize:1,timeUnitBandPosition:1}),qo=fe({mark:1,arc:1,area:1,bar:1,circle:1,image:1,line:1,point:1,rect:1,rule:1,square:1,text:1,tick:1,trail:1,geoshape:1});function Wo(e){return e&&void 0!=e.band}const Ho={horizontal:["cornerRadiusTopRight","cornerRadiusBottomRight"],vertical:["cornerRadiusTopLeft","cornerRadiusTopRight"]},Xo={binSpacing:1,continuousBandSize:5,minBandSize:.25,timeUnitBandPosition:.5},Jo={binSpacing:0,continuousBandSize:5,minBandSize:.25,timeUnitBandPosition:.5};function Go(e){const{channel:t,channelDef:n,markDef:i,scale:r,config:o}=e,a=Qo(e);return Fa(n)&&!Hn(n.aggregate)&&r&&so(r.get("type"))?function({fieldDef:e,channel:t,markDef:n,ref:i,config:r}){if(Po(n.type))return i;const o=vi("invalid",n,r);if(null===o)return[Vo(e,t),i];return i}({fieldDef:n,channel:t,markDef:i,ref:a,config:o}):a}function Vo(e,t){return{test:Yo(e,!0),..."y"===It(t)?{field:{group:"height"}}:{value:0}}}function Yo(e,t=!0){return Lr((0,j.HD)(e)?e:Ha(e,{expr:"datum"}),!t)}function Ko(e,t,n,i){const r={};if(t&&(r.scale=t),Ta(e)){const{datum:t}=e;ar(t)?r.signal=dr(t):ri(t)?r.signal=t.signal:ei(t)?r.signal=t.expr:r.value=t}else r.field=Ha(e,n);if(i){const{offset:e,band:t}=i;e&&(r.offset=e),t&&(r.band=t)}return r}function Zo({scaleName:e,fieldOrDatumDef:t,fieldOrDatumDef2:n,offset:i,startSuffix:r,endSuffix:o="end",bandPosition:a=.5}){const s=!ri(a)&&0<a&&a<1?"datum":void 0,l=Ha(t,{expr:s,suffix:r}),u=void 0!==n?Ha(n,{expr:s}):Ha(t,{suffix:o,expr:s}),c={};if(0===a||1===a){c.scale=e;const t=0===a?l:u;c.field=t}else{const t=ri(a)?`(1-${a.signal}) * ${l} + ${a.signal} * ${u}`:`${1-a} * ${l} + ${a} * ${u}`;c.signal=`scale("${e}", ${t})`}return i&&(c.offset=i),c}function Qo({channel:e,channelDef:t,channel2Def:n,markDef:i,config:r,scaleName:o,scale:a,stack:s,offset:l,defaultRef:u,bandPosition:c}){if(t){if(Pa(t)){const u=a?.get("type");if(La(t)){c??(c=Ea({fieldDef:t,fieldDef2:n,markDef:i,config:r}));const{bin:a,timeUnit:f,type:d}=t;if(Vn(a)||c&&f&&d===Hr)return s?.impute?Ko(t,o,{binSuffix:"mid"},{offset:l}):c&&!oo(u)?Zo({scaleName:o,fieldOrDatumDef:t,bandPosition:c,offset:l}):Ko(t,o,cs(t,e)?{binSuffix:"range"}:{},{offset:l});if(Yn(a)){if(Fa(n))return Zo({scaleName:o,fieldOrDatumDef:t,fieldOrDatumDef2:n,bandPosition:c,offset:l});or(tr(e===Be?Ie:qe))}}return Ko(t,o,oo(u)?{binSuffix:"range"}:{},{offset:l,band:"band"===u?c??t.bandPosition??.5:void 0})}if(Ua(t)){const n=l?{offset:l}:{};return{...ea(e,t.value),...n}}}return(0,j.mf)(u)&&(u=u()),u?{...u,...l?{offset:l}:{}}:u}function ea(e,t){return Q(["x","x2"],e)&&"width"===t?{field:{group:"width"}}:Q(["y","y2"],e)&&"height"===t?{field:{group:"height"}}:hi(t)}function ta(e){return e&&"number"!==e&&"time"!==e}function na(e,t,n){return`${e}(${t}${n?`, ${Re(n)}`:""})`}const ia=" \u2013 ";function ra({fieldOrDatumDef:e,format:t,formatType:n,expr:i,normalizeStack:r,config:o}){if(ta(n))return aa({fieldOrDatumDef:e,format:t,formatType:n,expr:i,config:o});const a=oa(e,i,r),s=Oa(e);if(void 0===t&&void 0===n&&o.customFormatTypes){if("quantitative"===s){if(r&&o.normalizedNumberFormatType)return aa({fieldOrDatumDef:e,format:o.normalizedNumberFormat,formatType:o.normalizedNumberFormatType,expr:i,config:o});if(o.numberFormatType)return aa({fieldOrDatumDef:e,format:o.numberFormat,formatType:o.numberFormatType,expr:i,config:o})}if("temporal"===s&&o.timeFormatType&&Fa(e)&&void 0===e.timeUnit)return aa({fieldOrDatumDef:e,format:o.timeFormat,formatType:o.timeFormatType,expr:i,config:o})}if(ss(e)){const n=function({field:e,timeUnit:t,format:n,formatType:i,rawTimeFormat:r,isUTCScale:o}){return!t||n?!t&&i?`${i}(${e}, '${n}')`:`${o?"utc":"time"}Format(${e}, '${n=(0,j.HD)(n)?n:r}')`:function(e,t,n){if(!e)return;const i=kr(e);return`${n||yr(e)?"utc":"time"}Format(${t}, ${i})`}(t,e,o)}({field:a,timeUnit:Fa(e)?Er(e.timeUnit)?.unit:void 0,format:t,formatType:o.timeFormatType,rawTimeFormat:o.timeFormat,isUTCScale:Ba(e)&&e.scale?.type===Gr.UTC});return n?{signal:n}:void 0}if(t=ua({type:s,specifiedFormat:t,config:o,normalizeStack:r}),Fa(e)&&Vn(e.bin)){return{signal:da(a,Ha(e,{expr:i,binSuffix:"end"}),t,n,o)}}return t||"quantitative"===Oa(e)?{signal:`${ca(a,t)}`}:{signal:`isValid(${a}) ? ${a} : ""+${a}`}}function oa(e,t,n){return Fa(e)?n?`${Ha(e,{expr:t,suffix:"end"})}-${Ha(e,{expr:t,suffix:"start"})}`:Ha(e,{expr:t}):function(e){const{datum:t}=e;return ar(t)?dr(t):`${Re(t)}`}(e)}function aa({fieldOrDatumDef:e,format:t,formatType:n,expr:i,normalizeStack:r,config:o,field:a}){if(a??(a=oa(e,i,r)),"datum.value"!==a&&Fa(e)&&Vn(e.bin)){return{signal:da(a,Ha(e,{expr:i,binSuffix:"end"}),t,n,o)}}return{signal:na(n,a,t)}}function sa(e,t,n,i,r,o){if(!(0,j.HD)(i)||!ta(i)){if(void 0===n&&void 0===i&&r.customFormatTypes&&"quantitative"===Oa(e)){if(r.normalizedNumberFormatType&&ja(e)&&"normalize"===e.stack)return;if(r.numberFormatType)return}if(ja(e)&&"normalize"===e.stack&&r.normalizedNumberFormat)return ua({type:"quantitative",config:r,normalizeStack:!0});if(ss(e)){const t=Fa(e)?Er(e.timeUnit)?.unit:void 0;if(void 0===t&&r.customFormatTypes&&r.timeFormatType)return;return function({specifiedFormat:e,timeUnit:t,config:n,omitTimeFormatConfig:i}){if(e)return e;if(t)return{signal:kr(t)};return i?void 0:n.timeFormat}({specifiedFormat:n,timeUnit:t,config:r,omitTimeFormatConfig:o})}return ua({type:t,specifiedFormat:n,config:r})}}function la(e,t,n){return e&&(ri(e)||"number"===e||"time"===e)?e:ss(t)&&"time"!==n&&"utc"!==n?Fa(t)&&Er(t?.timeUnit)?.utc?"utc":"time":void 0}function ua({type:e,specifiedFormat:t,config:n,normalizeStack:i}){return(0,j.HD)(t)?t:e===qr?i?n.normalizedNumberFormat:n.numberFormat:void 0}function ca(e,t){return`format(${e}, "${t||""}")`}function fa(e,t,n,i){return ta(n)?na(n,e,t):ca(e,((0,j.HD)(t)?t:void 0)??i.numberFormat)}function da(e,t,n,i,r){if(void 0===n&&void 0===i&&r.customFormatTypes&&r.numberFormatType)return da(e,t,r.numberFormat,r.numberFormatType,r);const o=fa(e,n,i,r),a=fa(t,n,i,r);return`${Lr(e,!1)} ? "null" : ${o} + "${ia}" + ${a}`}const ha="min",pa={x:1,y:1,color:1,fill:1,stroke:1,strokeWidth:1,size:1,shape:1,fillOpacity:1,strokeOpacity:1,opacity:1,text:1};function ma(e){return e in pa}function ga(e){return!!e?.encoding}function ya(e){return e&&("count"===e.op||!!e.field)}function va(e){return e&&(0,j.kJ)(e)}function ba(e){return"row"in e||"column"in e}function xa(e){return!!e&&"header"in e}function _a(e){return"facet"in e}function wa(e){const{field:t,timeUnit:n,bin:i,aggregate:r}=e;return{...n?{timeUnit:n}:{},...i?{bin:i}:{},...r?{aggregate:r}:{},field:t}}function ka(e){return"sort"in e}function Ea({fieldDef:e,fieldDef2:t,markDef:n,config:i}){if(Pa(e)&&void 0!==e.bandPosition)return e.bandPosition;if(Fa(e)){const{timeUnit:r,bin:o}=e;if(r&&!t)return bi("timeUnitBandPosition",n,i);if(Vn(o))return.5}}function Da({channel:e,fieldDef:t,fieldDef2:n,markDef:i,config:r,scaleType:o,useVlSizeChannel:a}){const s=Ht(e),l=vi(a?"size":s,i,r,{vgChannel:s});if(void 0!==l)return l;if(Fa(t)){const{timeUnit:e,bin:a}=t;if(e&&!n)return{band:bi("timeUnitBandSize",i,r)};if(Vn(a)&&!oo(o))return{band:1}}return Lo(i.type)?o?oo(o)?r[i.type]?.discreteBandSize||{band:1}:r[i.type]?.continuousBandSize:r[i.type]?.discreteBandSize:void 0}function $a(e,t,n,i){return!!(Vn(e.bin)||e.timeUnit&&La(e)&&"temporal"===e.type)&&void 0!==Ea({fieldDef:e,fieldDef2:t,markDef:n,config:i})}function Aa(e){return e&&!!e.sort&&!e.field}function Sa(e){return e&&"condition"in e}function Ma(e){const t=e?.condition;return!!t&&!(0,j.kJ)(t)&&Fa(t)}function Ca(e){const t=e?.condition;return!!t&&!(0,j.kJ)(t)&&Pa(t)}function Fa(e){return e&&(!!e.field||"count"===e.aggregate)}function Oa(e){return e?.type}function Ta(e){return e&&"datum"in e}function Na(e){return La(e)&&!Xa(e)||Ra(e)}function za(e){return La(e)&&"quantitative"===e.type&&!e.bin||Ra(e)}function Ra(e){return Ta(e)&&(0,j.hj)(e.datum)}function Pa(e){return Fa(e)||Ta(e)}function La(e){return e&&("field"in e||"count"===e.aggregate)&&"type"in e}function Ua(e){return e&&"value"in e&&"value"in e}function Ba(e){return e&&("scale"in e||"sort"in e)}function ja(e){return e&&("axis"in e||"stack"in e||"impute"in e)}function Ia(e){return e&&"legend"in e}function qa(e){return e&&("format"in e||"formatType"in e)}function Wa(e){return Y(e,["legend","axis","header","scale"])}function Ha(e,t={}){let n=e.field;const i=t.prefix;let r=t.suffix,o="";if(function(e){return"count"===e.aggregate}(e))n=Ce("count");else{let i;if(!t.nofn)if(function(e){return"op"in e}(e))i=e.op;else{const{bin:a,aggregate:s,timeUnit:l}=e;Vn(a)?(i=Gn(a),r=(t.binSuffix??"")+(t.suffix??"")):s?In(s)?(o=`["${n}"]`,n=`argmax_${s.argmax}`):jn(s)?(o=`["${n}"]`,n=`argmin_${s.argmin}`):i=String(s):l&&!mr(l)&&(i=function(e){const{utc:t,...n}=Er(e);return n.unit?(t?"utc":"")+fe(n).map((e=>me(`${"unit"===e?"":`_${e}_`}${n[e]}`))).join(""):(t?"utc":"")+"timeunit"+fe(n).map((e=>me(`_${e}_${n[e]}`))).join("")}(l),r=(!["range","mid"].includes(t.binSuffix)&&t.binSuffix||"")+(t.suffix??""))}i&&(n=n?`${i}_${n}`:i)}return r&&(n=`${n}_${r}`),i&&(n=`${i}_${n}`),t.forAs?Ee(n):t.expr?xe(n,t.expr)+o:we(n)+o}function Xa(e){switch(e.type){case"nominal":case"ordinal":case"geojson":return!0;case"quantitative":return Fa(e)&&!!e.bin;case"temporal":return!1}throw new Error(Bi(e.type))}const Ja=(e,t)=>{switch(t.fieldTitle){case"plain":return e.field;case"functional":return function(e){const{aggregate:t,bin:n,timeUnit:i,field:r}=e;if(In(t))return`${r} for argmax(${t.argmax})`;if(jn(t))return`${r} for argmin(${t.argmin})`;const o=i&&!mr(i)?Er(i):void 0,a=t||o?.unit||o?.maxbins&&"timeunit"||Vn(n)&&"bin";return a?`${a.toUpperCase()}(${r})`:r}(e);default:return function(e,t){const{field:n,bin:i,timeUnit:r,aggregate:o}=e;if("count"===o)return t.countTitle;if(Vn(i))return`${n} (binned)`;if(r&&!mr(r)){const e=Er(r)?.unit;if(e)return`${n} (${br(e).join("-")})`}else if(o)return In(o)?`${n} for max ${o.argmax}`:jn(o)?`${n} for min ${o.argmin}`:`${ve(o)} of ${n}`;return n}(e,t)}};let Ga=Ja;function Va(e){Ga=e}function Ya(e,t,{allowDisabling:n,includeDefault:i=!0}){const r=Ka(e)?.title;if(!Fa(e))return r??e.title;const o=e,a=i?Za(o,t):void 0;return n?$e(r,o.title,a):r??o.title??a}function Ka(e){return ja(e)&&e.axis?e.axis:Ia(e)&&e.legend?e.legend:xa(e)&&e.header?e.header:void 0}function Za(e,t){return Ga(e,t)}function Qa(e){if(qa(e)){const{format:t,formatType:n}=e;return{format:t,formatType:n}}{const t=Ka(e)??{},{format:n,formatType:i}=t;return{format:n,formatType:i}}}function es(e){return Fa(e)?e:Ma(e)?e.condition:void 0}function ts(e){return Pa(e)?e:Ca(e)?e.condition:void 0}function ns(e,t,n,i={}){if((0,j.HD)(e)||(0,j.hj)(e)||(0,j.jn)(e)){return or(function(e,t,n){return`Channel ${e} is a ${t}. Converted to {value: ${Re(n)}}.`}(t,(0,j.HD)(e)?"string":(0,j.hj)(e)?"number":"boolean",e)),{value:e}}return Pa(e)?is(e,t,n,i):Ca(e)?{...e,condition:is(e.condition,t,n,i)}:e}function is(e,t,n,i){if(qa(e)){const{format:r,formatType:o,...a}=e;if(ta(o)&&!n.customFormatTypes)return or(Li(t)),is(a,t,n,i)}else{const r=ja(e)?"axis":Ia(e)?"legend":xa(e)?"header":null;if(r&&e[r]){const{format:o,formatType:a,...s}=e[r];if(ta(a)&&!n.customFormatTypes)return or(Li(t)),is({...e,[r]:s},t,n,i)}}return Fa(e)?rs(e,t,i):function(e){let t=e.type;if(t)return e;const{datum:n}=e;return t=(0,j.hj)(n)?"quantitative":(0,j.HD)(n)?"nominal":ar(n)?"temporal":void 0,{...e,type:t}}(e)}function rs(e,t,{compositeMark:n=!1}={}){const{aggregate:i,timeUnit:r,bin:o,field:a}=e,s={...e};if(n||!i||qn(i)||In(i)||jn(i)||(or(function(e){return`Invalid aggregation operator "${e}".`}(i)),delete s.aggregate),r&&(s.timeUnit=Er(r)),a&&(s.field=`${a}`),Vn(o)&&(s.bin=os(o,t)),Yn(o)&&!mn(t)&&or(function(e){return`Channel ${e} should not be used with "binned" bin.`}(t)),La(s)){const{type:e}=s,t=function(e){if(e)switch(e=e.toLowerCase()){case"q":case qr:return"quantitative";case"t":case Hr:return"temporal";case"o":case Wr:return"ordinal";case"n":case Xr:return"nominal";case Jr:return"geojson"}}(e);e!==t&&(s.type=t),"quantitative"!==e&&Hn(i)&&(or(function(e,t){return`Invalid field type "${e}" for aggregate: "${t}", using "quantitative" instead.`}(e,i)),s.type="quantitative")}else if(!jt(t)){const e=function(e,t){switch(t){case"latitude":case"longitude":return"quantitative";case"row":case"column":case"facet":case"shape":case"strokeDash":return"nominal";case"order":return"ordinal"}if(ka(e)&&(0,j.kJ)(e.sort))return"ordinal";const{aggregate:n,bin:i,timeUnit:r}=e;if(r)return"temporal";if(i||n&&!In(n)&&!jn(n))return"quantitative";if(Ba(e)&&e.scale?.type)switch(Vr[e.scale.type]){case"numeric":case"discretizing":return"quantitative";case"time":return"temporal"}return"nominal"}(s,t);s.type=e}if(La(s)){const{compatible:e,warning:n}=function(e,t){const n=e.type;if("geojson"===n&&"shape"!==t)return{compatible:!1,warning:`Channel ${t} should not be used with a geojson data.`};switch(t){case Pe:case Le:case Ue:return Xa(e)?as:{compatible:!1,warning:Wi(t)};case Be:case je:case We:case He:case et:case tt:case nt:case ft:case ht:case pt:case mt:case gt:case yt:case ot:case Ge:case Xe:case vt:return as;case Ke:case Qe:case Ye:case Ze:return n!==qr?{compatible:!1,warning:`Channel ${t} should be used with a quantitative field only, not ${e.type} field.`}:as;case at:case st:case lt:case ut:case rt:case Ve:case Je:case Ie:case qe:return"nominal"!==n||e.sort?as:{compatible:!1,warning:`Channel ${t} should not be used with an unsorted discrete field.`};case it:case ct:return Xa(e)||Ba(i=e)&&lo(i.scale?.type)?as:{compatible:!1,warning:Hi(t)};case dt:return"nominal"!==e.type||"sort"in e?as:{compatible:!1,warning:"Channel order is inappropriate for nominal field, which has no inherent order."}}var i}(s,t)||{};!1===e&&or(n)}if(ka(s)&&(0,j.HD)(s.sort)){const{sort:e}=s;if(ma(e))return{...s,sort:{encoding:e}};const t=e.substr(1);if("-"===e.charAt(0)&&ma(t))return{...s,sort:{encoding:t,order:"descending"}}}if(xa(s)){const{header:e}=s;if(e){const{orient:t,...n}=e;if(t)return{...s,header:{...n,labelOrient:e.labelOrient||t,titleOrient:e.titleOrient||t}}}}return s}function os(e,t){return(0,j.jn)(e)?{maxbins:Qn(t)}:"binned"===e?{binned:!0}:e.maxbins||e.step?e:{...e,maxbins:Qn(t)}}const as={compatible:!0};function ss(e){const{formatType:t}=Qa(e);return"time"===t||!t&&((n=e)&&("temporal"===n.type||Fa(n)&&!!n.timeUnit));var n}function ls(e,{timeUnit:t,type:n,wrapTime:i,undefinedIfExprNotRequired:r}){const o=t&&Er(t)?.unit;let a,s=o||"temporal"===n;return ei(e)?a=e.expr:ri(e)?a=e.signal:ar(e)?(s=!0,a=dr(e)):((0,j.HD)(e)||(0,j.hj)(e))&&s&&(a=`datetime(${Re(e)})`,function(e){return!!hr[e]}(o)&&((0,j.hj)(e)&&e<1e4||(0,j.HD)(e)&&isNaN(Date.parse(e)))&&(a=dr({[o]:e}))),a?i&&s?`time(${a})`:a:r?void 0:Re(e)}function us(e,t){const{type:n}=e;return t.map((t=>{const i=ls(t,{timeUnit:Fa(e)&&!mr(e.timeUnit)?e.timeUnit:void 0,type:n,undefinedIfExprNotRequired:!0});return void 0!==i?{signal:i}:t}))}function cs(e,t){return Vn(e.bin)?Tn(t)&&["ordinal","nominal"].includes(e.type):(console.warn("Only call this method for binned field defs."),!1)}const fs={labelAlign:{part:"labels",vgProp:"align"},labelBaseline:{part:"labels",vgProp:"baseline"},labelColor:{part:"labels",vgProp:"fill"},labelFont:{part:"labels",vgProp:"font"},labelFontSize:{part:"labels",vgProp:"fontSize"},labelFontStyle:{part:"labels",vgProp:"fontStyle"},labelFontWeight:{part:"labels",vgProp:"fontWeight"},labelOpacity:{part:"labels",vgProp:"opacity"},labelOffset:null,labelPadding:null,gridColor:{part:"grid",vgProp:"stroke"},gridDash:{part:"grid",vgProp:"strokeDash"},gridDashOffset:{part:"grid",vgProp:"strokeDashOffset"},gridOpacity:{part:"grid",vgProp:"opacity"},gridWidth:{part:"grid",vgProp:"strokeWidth"},tickColor:{part:"ticks",vgProp:"stroke"},tickDash:{part:"ticks",vgProp:"strokeDash"},tickDashOffset:{part:"ticks",vgProp:"strokeDashOffset"},tickOpacity:{part:"ticks",vgProp:"opacity"},tickSize:null,tickWidth:{part:"ticks",vgProp:"strokeWidth"}};function ds(e){return e?.condition}const hs=["domain","grid","labels","ticks","title"],ps={grid:"grid",gridCap:"grid",gridColor:"grid",gridDash:"grid",gridDashOffset:"grid",gridOpacity:"grid",gridScale:"grid",gridWidth:"grid",orient:"main",bandPosition:"both",aria:"main",description:"main",domain:"main",domainCap:"main",domainColor:"main",domainDash:"main",domainDashOffset:"main",domainOpacity:"main",domainWidth:"main",format:"main",formatType:"main",labelAlign:"main",labelAngle:"main",labelBaseline:"main",labelBound:"main",labelColor:"main",labelFlush:"main",labelFlushOffset:"main",labelFont:"main",labelFontSize:"main",labelFontStyle:"main",labelFontWeight:"main",labelLimit:"main",labelLineHeight:"main",labelOffset:"main",labelOpacity:"main",labelOverlap:"main",labelPadding:"main",labels:"main",labelSeparation:"main",maxExtent:"main",minExtent:"main",offset:"both",position:"main",tickCap:"main",tickColor:"main",tickDash:"main",tickDashOffset:"main",tickMinStep:"both",tickOffset:"both",tickOpacity:"main",tickRound:"both",ticks:"main",tickSize:"main",tickWidth:"both",title:"main",titleAlign:"main",titleAnchor:"main",titleAngle:"main",titleBaseline:"main",titleColor:"main",titleFont:"main",titleFontSize:"main",titleFontStyle:"main",titleFontWeight:"main",titleLimit:"main",titleLineHeight:"main",titleOpacity:"main",titlePadding:"main",titleX:"main",titleY:"main",encode:"both",scale:"both",tickBand:"both",tickCount:"both",tickExtra:"both",translate:"both",values:"both",zindex:"both"},ms={orient:1,aria:1,bandPosition:1,description:1,domain:1,domainCap:1,domainColor:1,domainDash:1,domainDashOffset:1,domainOpacity:1,domainWidth:1,format:1,formatType:1,grid:1,gridCap:1,gridColor:1,gridDash:1,gridDashOffset:1,gridOpacity:1,gridWidth:1,labelAlign:1,labelAngle:1,labelBaseline:1,labelBound:1,labelColor:1,labelFlush:1,labelFlushOffset:1,labelFont:1,labelFontSize:1,labelFontStyle:1,labelFontWeight:1,labelLimit:1,labelLineHeight:1,labelOffset:1,labelOpacity:1,labelOverlap:1,labelPadding:1,labels:1,labelSeparation:1,maxExtent:1,minExtent:1,offset:1,position:1,tickBand:1,tickCap:1,tickColor:1,tickCount:1,tickDash:1,tickDashOffset:1,tickExtra:1,tickMinStep:1,tickOffset:1,tickOpacity:1,tickRound:1,ticks:1,tickSize:1,tickWidth:1,title:1,titleAlign:1,titleAnchor:1,titleAngle:1,titleBaseline:1,titleColor:1,titleFont:1,titleFontSize:1,titleFontStyle:1,titleFontWeight:1,titleLimit:1,titleLineHeight:1,titleOpacity:1,titlePadding:1,titleX:1,titleY:1,translate:1,values:1,zindex:1},gs={...ms,style:1,labelExpr:1,encoding:1};function ys(e){return!!gs[e]}fe(gs);const vs=fe({axis:1,axisBand:1,axisBottom:1,axisDiscrete:1,axisLeft:1,axisPoint:1,axisQuantitative:1,axisRight:1,axisTemporal:1,axisTop:1,axisX:1,axisXBand:1,axisXDiscrete:1,axisXPoint:1,axisXQuantitative:1,axisXTemporal:1,axisY:1,axisYBand:1,axisYDiscrete:1,axisYPoint:1,axisYQuantitative:1,axisYTemporal:1});function bs(e){return"mark"in e}class xs{constructor(e,t){this.name=e,this.run=t}hasMatchingType(e){return!!bs(e)&&(Bo(t=e.mark)?t.type:t)===this.name;var t}}function _s(e,t){const n=e&&e[t];return!!n&&((0,j.kJ)(n)?ee(n,(e=>!!e.field)):Fa(n)||Ma(n))}function ws(e,t){const n=e&&e[t];return!!n&&((0,j.kJ)(n)?ee(n,(e=>!!e.field)):Fa(n)||Ta(n)||Ca(n))}function ks(e,t){if(mn(t)){const n=e[t];if((Fa(n)||Ta(n))&&(Ir(n.type)||Fa(n)&&n.timeUnit)){return ws(e,Jt(t))}}return!1}function Es(e){return ee(Ct,(t=>{if(_s(e,t)){const n=e[t];if((0,j.kJ)(n))return ee(n,(e=>!!e.aggregate));{const e=es(n);return e&&!!e.aggregate}}return!1}))}function Ds(e,t){const n=[],i=[],r=[],o=[],a={};return Ss(e,((s,l)=>{if(Fa(s)){const{field:u,aggregate:c,bin:f,timeUnit:d,...h}=s;if(c||d||f){const e=Ka(s),p=e?.title;let m=Ha(s,{forAs:!0});const g={...p?[]:{title:Ya(s,t,{allowDisabling:!0})},...h,field:m};if(c){let e;if(In(c)?(e="argmax",m=Ha({op:"argmax",field:c.argmax},{forAs:!0}),g.field=`${m}.${u}`):jn(c)?(e="argmin",m=Ha({op:"argmin",field:c.argmin},{forAs:!0}),g.field=`${m}.${u}`):"boxplot"!==c&&"errorbar"!==c&&"errorband"!==c&&(e=c),e){const t={op:e,as:m};u&&(t.field=u),o.push(t)}}else if(n.push(m),La(s)&&Vn(f)){if(i.push({bin:f,field:u,as:m}),n.push(Ha(s,{binSuffix:"end"})),cs(s,l)&&n.push(Ha(s,{binSuffix:"range"})),mn(l)){const e={field:`${m}_end`};a[`${l}2`]=e}g.bin="binned",jt(l)||(g.type=qr)}else if(d&&!mr(d)){r.push({timeUnit:d,field:u,as:m});const e=La(s)&&s.type!==Hr&&"time";e&&(l===ft||l===mt?g.formatType=e:!function(e){return!!fn[e]}(l)?mn(l)&&(g.axis={formatType:e,...g.axis}):g.legend={formatType:e,...g.legend})}a[l]=g}else n.push(u),a[l]=e[l]}else a[l]=e[l]})),{bins:i,timeUnits:r,aggregate:o,groupby:n,encoding:a}}function $s(e,t,n){const i=Nn(t,n);if(!i)return!1;if("binned"===i){const n=e[t===Ie?Be:je];return!!(Fa(n)&&Fa(e[t])&&Yn(n.bin))}return!0}function As(e,t){const n={};for(const i of fe(e)){const r=ns(e[i],i,t,{compositeMark:!0});n[i]=r}return n}function Ss(e,t,n){if(e)for(const i of fe(e)){const r=e[i];if((0,j.kJ)(r))for(const e of r)t.call(n,e,i);else t.call(n,r,i)}}function Ms(e,t){return fe(t).reduce(((n,i)=>{switch(i){case Be:case je:case gt:case vt:case yt:case Ie:case qe:case We:case He:case Ge:case Ve:case Xe:case Je:case Ye:case Ke:case Ze:case Qe:case ft:case it:case ot:case mt:return n;case dt:if("line"===e||"trail"===e)return n;case ht:case pt:{const e=t[i];if((0,j.kJ)(e)||Fa(e))for(const t of(0,j.IX)(e))t.aggregate||n.push(Ha(t,{}));return n}case rt:if("trail"===e)return n;case et:case tt:case nt:case at:case st:case lt:case ct:case ut:{const e=es(t[i]);return e&&!e.aggregate&&n.push(Ha(e,{})),n}}}),[])}function Cs(e,t,n,i=!0){if("tooltip"in n)return{tooltip:n.tooltip};return{tooltip:[...e.map((({fieldPrefix:e,titlePrefix:n})=>{const r=i?` of ${Fs(t)}`:"";return{field:e+t.field,type:t.type,title:ri(n)?{signal:`${n}"${escape(r)}"`}:n+r}})),...re(function(e){const t=[];for(const n of fe(e))if(_s(e,n)){const i=e[n],r=(0,j.IX)(i);for(const e of r)Fa(e)?t.push(e):Ma(e)&&t.push(e.condition)}return t}(n).map(Wa),K)]}}function Fs(e){const{title:t,field:n}=e;return $e(t,n)}function Os(e,t,n,i,r){const{scale:o,axis:a}=n;return({partName:s,mark:l,positionPrefix:u,endPositionPrefix:c,extraEncoding:f={}})=>{const d=Fs(n);return Ts(e,s,r,{mark:l,encoding:{[t]:{field:`${u}_${n.field}`,type:n.type,...void 0!==d?{title:d}:{},...void 0!==o?{scale:o}:{},...void 0!==a?{axis:a}:{}},...(0,j.HD)(c)?{[`${t}2`]:{field:`${c}_${n.field}`}}:{},...i,...f}})}}function Ts(e,t,n,i){const{clip:r,color:o,opacity:a}=e,s=e.type;return e[t]||void 0===e[t]&&n[t]?[{...i,mark:{...n[t],...r?{clip:r}:{},...o?{color:o}:{},...a?{opacity:a}:{},...Bo(i.mark)?i.mark:{type:i.mark},style:`${s}-${String(t)}`,...(0,j.jn)(e[t])?{}:e[t]}}]:[]}function Ns(e,t,n){const{encoding:i}=e,r="vertical"===t?"y":"x",o=i[r],a=i[`${r}2`],s=i[`${r}Error`],l=i[`${r}Error2`];return{continuousAxisChannelDef:zs(o,n),continuousAxisChannelDef2:zs(a,n),continuousAxisChannelDefError:zs(s,n),continuousAxisChannelDefError2:zs(l,n),continuousAxis:r}}function zs(e,t){if(e?.aggregate){const{aggregate:n,...i}=e;return n!==t&&or(function(e,t){return`Continuous axis should not have customized aggregation function ${e}; ${t} already agregates the axis.`}(n,t)),i}return e}function Rs(e,t){const{mark:n,encoding:i}=e,{x:r,y:o}=i;if(Bo(n)&&n.orient)return n.orient;if(Na(r)){if(Na(o)){const e=Fa(r)&&r.aggregate,n=Fa(o)&&o.aggregate;if(e||n!==t){if(n||e!==t){if(e===t&&n===t)throw new Error("Both x and y cannot have aggregate");return ss(o)&&!ss(r)?"horizontal":"vertical"}return"horizontal"}return"vertical"}return"horizontal"}if(Na(o))return"vertical";throw new Error(`Need a valid continuous axis for ${t}s`)}const Ps="boxplot",Ls=new xs(Ps,Bs);function Us(e){return(0,j.hj)(e)?"tukey":e}function Bs(e,{config:t}){e={...e,encoding:As(e.encoding,t)};const{mark:n,encoding:i,params:r,projection:o,...a}=e,s=Bo(n)?n:{type:n};r&&or(Ni("boxplot"));const l=s.extent??t.boxplot.extent,u=vi("size",s,t),c=s.invalid,f=Us(l),{bins:d,timeUnits:h,transform:p,continuousAxisChannelDef:m,continuousAxis:g,groupby:y,aggregate:v,encodingWithoutContinuousAxis:b,ticksOrient:x,boxOrient:_,customTooltipWithoutAggregatedField:w}=function(e,t,n){const i=Rs(e,Ps),{continuousAxisChannelDef:r,continuousAxis:o}=Ns(e,i,Ps),a=r.field,s=Us(t),l=[...js(a),{op:"median",field:a,as:`mid_box_${a}`},{op:"min",field:a,as:("min-max"===s?"lower_whisker_":"min_")+a},{op:"max",field:a,as:("min-max"===s?"upper_whisker_":"max_")+a}],u="min-max"===s||"tukey"===s?[]:[{calculate:`datum["upper_box_${a}"] - datum["lower_box_${a}"]`,as:`iqr_${a}`},{calculate:`min(datum["upper_box_${a}"] + datum["iqr_${a}"] * ${t}, datum["max_${a}"])`,as:`upper_whisker_${a}`},{calculate:`max(datum["lower_box_${a}"] - datum["iqr_${a}"] * ${t}, datum["min_${a}"])`,as:`lower_whisker_${a}`}],{[o]:c,...f}=e.encoding,{customTooltipWithoutAggregatedField:d,filteredEncoding:h}=function(e){const{tooltip:t,...n}=e;if(!t)return{filteredEncoding:n};let i,r;if((0,j.kJ)(t)){for(const e of t)e.aggregate?(i||(i=[]),i.push(e)):(r||(r=[]),r.push(e));i&&(n.tooltip=i)}else t.aggregate?n.tooltip=t:r=t;return(0,j.kJ)(r)&&1===r.length&&(r=r[0]),{customTooltipWithoutAggregatedField:r,filteredEncoding:n}}(f),{bins:p,timeUnits:m,aggregate:g,groupby:y,encoding:v}=Ds(h,n),b="vertical"===i?"horizontal":"vertical",x=i,_=[...p,...m,{aggregate:[...g,...l],groupby:y},...u];return{bins:p,timeUnits:m,transform:_,groupby:y,aggregate:g,continuousAxisChannelDef:r,continuousAxis:o,encodingWithoutContinuousAxis:v,ticksOrient:b,boxOrient:x,customTooltipWithoutAggregatedField:d}}(e,l,t),{color:k,size:E,...D}=b,$=e=>Os(s,g,m,e,t.boxplot),A=$(D),S=$(b),M=$({...D,...E?{size:E}:{}}),C=Cs([{fieldPrefix:"min-max"===f?"upper_whisker_":"max_",titlePrefix:"Max"},{fieldPrefix:"upper_box_",titlePrefix:"Q3"},{fieldPrefix:"mid_box_",titlePrefix:"Median"},{fieldPrefix:"lower_box_",titlePrefix:"Q1"},{fieldPrefix:"min-max"===f?"lower_whisker_":"min_",titlePrefix:"Min"}],m,b),F={type:"tick",color:"black",opacity:1,orient:x,invalid:c,aria:!1},O="min-max"===f?C:Cs([{fieldPrefix:"upper_whisker_",titlePrefix:"Upper Whisker"},{fieldPrefix:"lower_whisker_",titlePrefix:"Lower Whisker"}],m,b),T=[...A({partName:"rule",mark:{type:"rule",invalid:c,aria:!1},positionPrefix:"lower_whisker",endPositionPrefix:"lower_box",extraEncoding:O}),...A({partName:"rule",mark:{type:"rule",invalid:c,aria:!1},positionPrefix:"upper_box",endPositionPrefix:"upper_whisker",extraEncoding:O}),...A({partName:"ticks",mark:F,positionPrefix:"lower_whisker",extraEncoding:O}),...A({partName:"ticks",mark:F,positionPrefix:"upper_whisker",extraEncoding:O})],N=[..."tukey"!==f?T:[],...S({partName:"box",mark:{type:"bar",...u?{size:u}:{},orient:_,invalid:c,ariaRoleDescription:"box"},positionPrefix:"lower_box",endPositionPrefix:"upper_box",extraEncoding:C}),...M({partName:"median",mark:{type:"tick",invalid:c,...(0,j.Kn)(t.boxplot.median)&&t.boxplot.median.color?{color:t.boxplot.median.color}:{},...u?{size:u}:{},orient:x,aria:!1},positionPrefix:"mid_box",extraEncoding:C})];if("min-max"===f)return{...a,transform:(a.transform??[]).concat(p),layer:N};const z=`datum["lower_box_${m.field}"]`,R=`datum["upper_box_${m.field}"]`,P=`(${R} - ${z})`,L=`${z} - ${l} * ${P}`,U=`${R} + ${l} * ${P}`,B=`datum["${m.field}"]`,I={joinaggregate:js(m.field),groupby:y},q={transform:[{filter:`(${L} <= ${B}) && (${B} <= ${U})`},{aggregate:[{op:"min",field:m.field,as:`lower_whisker_${m.field}`},{op:"max",field:m.field,as:`upper_whisker_${m.field}`},{op:"min",field:`lower_box_${m.field}`,as:`lower_box_${m.field}`},{op:"max",field:`upper_box_${m.field}`,as:`upper_box_${m.field}`},...v],groupby:y}],layer:T},{tooltip:W,...H}=D,{scale:X,axis:J}=m,G=Fs(m),V=Y(J,["title"]),K=Ts(s,"outliers",t.boxplot,{transform:[{filter:`(${B} < ${L}) || (${B} > ${U})`}],mark:"point",encoding:{[g]:{field:m.field,type:m.type,...void 0!==G?{title:G}:{},...void 0!==X?{scale:X}:{},...ce(V)?{}:{axis:V}},...H,...k?{color:k}:{},...w?{tooltip:w}:{}}})[0];let Z;const Q=[...d,...h,I];return K?Z={transform:Q,layer:[K,q]}:(Z=q,Z.transform.unshift(...Q)),{...a,layer:[Z,{transform:p,layer:N}]}}function js(e){return[{op:"q1",field:e,as:`lower_box_${e}`},{op:"q3",field:e,as:`upper_box_${e}`}]}const Is="errorbar",qs=new xs(Is,Ws);function Ws(e,{config:t}){e={...e,encoding:As(e.encoding,t)};const{transform:n,continuousAxisChannelDef:i,continuousAxis:r,encodingWithoutContinuousAxis:o,ticksOrient:a,markDef:s,outerSpec:l,tooltipEncoding:u}=Xs(e,Is,t);delete o.size;const c=Os(s,r,i,o,t.errorbar),f=s.thickness,d=s.size,h={type:"tick",orient:a,aria:!1,...void 0!==f?{thickness:f}:{},...void 0!==d?{size:d}:{}},p=[...c({partName:"ticks",mark:h,positionPrefix:"lower",extraEncoding:u}),...c({partName:"ticks",mark:h,positionPrefix:"upper",extraEncoding:u}),...c({partName:"rule",mark:{type:"rule",ariaRoleDescription:"errorbar",...void 0!==f?{size:f}:{}},positionPrefix:"lower",endPositionPrefix:"upper",extraEncoding:u})];return{...l,transform:n,...p.length>1?{layer:p}:{...p[0]}}}function Hs(e,t){const{encoding:n}=e;if(function(e){return(Pa(e.x)||Pa(e.y))&&!Pa(e.x2)&&!Pa(e.y2)&&!Pa(e.xError)&&!Pa(e.xError2)&&!Pa(e.yError)&&!Pa(e.yError2)}(n))return{orient:Rs(e,t),inputType:"raw"};const i=function(e){return Pa(e.x2)||Pa(e.y2)}(n),r=function(e){return Pa(e.xError)||Pa(e.xError2)||Pa(e.yError)||Pa(e.yError2)}(n),o=n.x,a=n.y;if(i){if(r)throw new Error(`${t} cannot be both type aggregated-upper-lower and aggregated-error`);const e=n.x2,i=n.y2;if(Pa(e)&&Pa(i))throw new Error(`${t} cannot have both x2 and y2`);if(Pa(e)){if(Na(o))return{orient:"horizontal",inputType:"aggregated-upper-lower"};throw new Error(`Both x and x2 have to be quantitative in ${t}`)}if(Pa(i)){if(Na(a))return{orient:"vertical",inputType:"aggregated-upper-lower"};throw new Error(`Both y and y2 have to be quantitative in ${t}`)}throw new Error("No ranged axis")}{const e=n.xError,i=n.xError2,r=n.yError,s=n.yError2;if(Pa(i)&&!Pa(e))throw new Error(`${t} cannot have xError2 without xError`);if(Pa(s)&&!Pa(r))throw new Error(`${t} cannot have yError2 without yError`);if(Pa(e)&&Pa(r))throw new Error(`${t} cannot have both xError and yError with both are quantiative`);if(Pa(e)){if(Na(o))return{orient:"horizontal",inputType:"aggregated-error"};throw new Error("All x, xError, and xError2 (if exist) have to be quantitative")}if(Pa(r)){if(Na(a))return{orient:"vertical",inputType:"aggregated-error"};throw new Error("All y, yError, and yError2 (if exist) have to be quantitative")}throw new Error("No ranged axis")}}function Xs(e,t,n){const{mark:i,encoding:r,params:o,projection:a,...s}=e,l=Bo(i)?i:{type:i};o&&or(Ni(t));const{orient:u,inputType:c}=Hs(e,t),{continuousAxisChannelDef:f,continuousAxisChannelDef2:d,continuousAxisChannelDefError:h,continuousAxisChannelDefError2:p,continuousAxis:m}=Ns(e,u,t),{errorBarSpecificAggregate:g,postAggregateCalculates:y,tooltipSummary:v,tooltipTitleWithFieldName:b}=function(e,t,n,i,r,o,a,s){let l=[],u=[];const c=t.field;let f,d=!1;if("raw"===o){const t=e.center?e.center:e.extent?"iqr"===e.extent?"median":"mean":s.errorbar.center,n=e.extent?e.extent:"mean"===t?"stderr":"iqr";if("median"===t!==("iqr"===n)&&or(function(e,t,n){return`${e} is not usually used with ${t} for ${n}.`}(t,n,a)),"stderr"===n||"stdev"===n)l=[{op:n,field:c,as:`extent_${c}`},{op:t,field:c,as:`center_${c}`}],u=[{calculate:`datum["center_${c}"] + datum["extent_${c}"]`,as:`upper_${c}`},{calculate:`datum["center_${c}"] - datum["extent_${c}"]`,as:`lower_${c}`}],f=[{fieldPrefix:"center_",titlePrefix:ve(t)},{fieldPrefix:"upper_",titlePrefix:Js(t,n,"+")},{fieldPrefix:"lower_",titlePrefix:Js(t,n,"-")}],d=!0;else{let e,t,i;"ci"===n?(e="mean",t="ci0",i="ci1"):(e="median",t="q1",i="q3"),l=[{op:t,field:c,as:`lower_${c}`},{op:i,field:c,as:`upper_${c}`},{op:e,field:c,as:`center_${c}`}],f=[{fieldPrefix:"upper_",titlePrefix:Ya({field:c,aggregate:i,type:"quantitative"},s,{allowDisabling:!1})},{fieldPrefix:"lower_",titlePrefix:Ya({field:c,aggregate:t,type:"quantitative"},s,{allowDisabling:!1})},{fieldPrefix:"center_",titlePrefix:Ya({field:c,aggregate:e,type:"quantitative"},s,{allowDisabling:!1})}]}}else{(e.center||e.extent)&&or((h=e.center,`${(p=e.extent)?"extent ":""}${p&&h?"and ":""}${h?"center ":""}${p&&h?"are ":"is "}not needed when data are aggregated.`)),"aggregated-upper-lower"===o?(f=[],u=[{calculate:`datum["${n.field}"]`,as:`upper_${c}`},{calculate:`datum["${c}"]`,as:`lower_${c}`}]):"aggregated-error"===o&&(f=[{fieldPrefix:"",titlePrefix:c}],u=[{calculate:`datum["${c}"] + datum["${i.field}"]`,as:`upper_${c}`}],r?u.push({calculate:`datum["${c}"] + datum["${r.field}"]`,as:`lower_${c}`}):u.push({calculate:`datum["${c}"] - datum["${i.field}"]`,as:`lower_${c}`}));for(const e of u)f.push({fieldPrefix:e.as.substring(0,6),titlePrefix:ke(ke(e.calculate,'datum["',""),'"]',"")})}var h,p;return{postAggregateCalculates:u,errorBarSpecificAggregate:l,tooltipSummary:f,tooltipTitleWithFieldName:d}}(l,f,d,h,p,c,t,n),{[m]:x,["x"===m?"x2":"y2"]:_,["x"===m?"xError":"yError"]:w,["x"===m?"xError2":"yError2"]:k,...E}=r,{bins:D,timeUnits:$,aggregate:A,groupby:S,encoding:M}=Ds(E,n),C=[...A,...g],F="raw"!==c?[]:S,O=Cs(v,f,M,b);return{transform:[...s.transform??[],...D,...$,...0===C.length?[]:[{aggregate:C,groupby:F}],...y],groupby:F,continuousAxisChannelDef:f,continuousAxis:m,encodingWithoutContinuousAxis:M,ticksOrient:"vertical"===u?"horizontal":"vertical",markDef:l,outerSpec:s,tooltipEncoding:O}}function Js(e,t,n){return`${ve(e)} ${n} ${t}`}const Gs="errorband",Vs=new xs(Gs,Ys);function Ys(e,{config:t}){e={...e,encoding:As(e.encoding,t)};const{transform:n,continuousAxisChannelDef:i,continuousAxis:r,encodingWithoutContinuousAxis:o,markDef:a,outerSpec:s,tooltipEncoding:l}=Xs(e,Gs,t),u=a,c=Os(u,r,i,o,t.errorband),f=void 0!==e.encoding.x&&void 0!==e.encoding.y;let d={type:f?"area":"rect"},h={type:f?"line":"rule"};const p={...u.interpolate?{interpolate:u.interpolate}:{},...u.tension&&u.interpolate?{tension:u.tension}:{}};return f?(d={...d,...p,ariaRoleDescription:"errorband"},h={...h,...p,aria:!1}):u.interpolate?or(er("interpolate")):u.tension&&or(er("tension")),{...s,transform:n,layer:[...c({partName:"band",mark:d,positionPrefix:"lower",endPositionPrefix:"upper",extraEncoding:l}),...c({partName:"borders",mark:h,positionPrefix:"lower",extraEncoding:l}),...c({partName:"borders",mark:h,positionPrefix:"upper",extraEncoding:l})]}}const Ks={};function Zs(e,t,n){const i=new xs(e,t);Ks[e]={normalizer:i,parts:n}}Zs(Ps,Bs,["box","median","outliers","rule","ticks"]),Zs(Is,Ws,["ticks","rule"]),Zs(Gs,Ys,["band","borders"]);const Qs=["gradientHorizontalMaxLength","gradientHorizontalMinLength","gradientVerticalMaxLength","gradientVerticalMinLength","unselectedOpacity"],el={titleAlign:"align",titleAnchor:"anchor",titleAngle:"angle",titleBaseline:"baseline",titleColor:"color",titleFont:"font",titleFontSize:"fontSize",titleFontStyle:"fontStyle",titleFontWeight:"fontWeight",titleLimit:"limit",titleLineHeight:"lineHeight",titleOrient:"orient",titlePadding:"offset"},tl={labelAlign:"align",labelAnchor:"anchor",labelAngle:"angle",labelBaseline:"baseline",labelColor:"color",labelFont:"font",labelFontSize:"fontSize",labelFontStyle:"fontStyle",labelFontWeight:"fontWeight",labelLimit:"limit",labelLineHeight:"lineHeight",labelOrient:"orient",labelPadding:"offset"},nl=fe(el),il=fe(tl),rl=fe({header:1,headerRow:1,headerColumn:1,headerFacet:1}),ol=["size","shape","fill","stroke","strokeDash","strokeWidth","opacity"],al={aria:1,clipHeight:1,columnPadding:1,columns:1,cornerRadius:1,description:1,direction:1,fillColor:1,format:1,formatType:1,gradientLength:1,gradientOpacity:1,gradientStrokeColor:1,gradientStrokeWidth:1,gradientThickness:1,gridAlign:1,labelAlign:1,labelBaseline:1,labelColor:1,labelFont:1,labelFontSize:1,labelFontStyle:1,labelFontWeight:1,labelLimit:1,labelOffset:1,labelOpacity:1,labelOverlap:1,labelPadding:1,labelSeparation:1,legendX:1,legendY:1,offset:1,orient:1,padding:1,rowPadding:1,strokeColor:1,symbolDash:1,symbolDashOffset:1,symbolFillColor:1,symbolLimit:1,symbolOffset:1,symbolOpacity:1,symbolSize:1,symbolStrokeColor:1,symbolStrokeWidth:1,symbolType:1,tickCount:1,tickMinStep:1,title:1,titleAlign:1,titleAnchor:1,titleBaseline:1,titleColor:1,titleFont:1,titleFontSize:1,titleFontStyle:1,titleFontWeight:1,titleLimit:1,titleLineHeight:1,titleOpacity:1,titleOrient:1,titlePadding:1,type:1,values:1,zindex:1},sl=(fe(al),"_vgsid_"),ll={point:{on:"click",fields:[sl],toggle:"event.shiftKey",resolve:"global",clear:"dblclick"},interval:{on:"[pointerdown, window:pointerup] > window:pointermove!",encodings:["x","y"],translate:"[pointerdown, window:pointerup] > window:pointermove!",zoom:"wheel!",mark:{fill:"#333",fillOpacity:.125,stroke:"white"},resolve:"global",clear:"dblclick"}};function ul(e){return"legend"===e||!!e?.legend}function cl(e){return ul(e)&&(0,j.Kn)(e)}function fl(e){return!!e?.select}function dl(e){const t=[];for(const n of e||[]){if(fl(n))continue;const{expr:e,bind:i,...r}=n;if(i&&e){const n={...r,bind:i,init:e};t.push(n)}else{const n={...r,...e?{update:e}:{},...i?{bind:i}:{}};t.push(n)}}return t}function hl(e){return"concat"in e}function pl(e){return"vconcat"in e}function ml(e){return"hconcat"in e}function gl({step:e,offsetIsDiscrete:t}){return t?e.for??"offset":"position"}function yl(e){return(0,j.Kn)(e)&&void 0!==e.step}function vl(e){return e.view||e.width||e.height}const bl=fe({align:1,bounds:1,center:1,columns:1,spacing:1});function xl(e,t){return e[t]??e["width"===t?"continuousWidth":"continuousHeight"]}function _l(e,t){const n=wl(e,t);return yl(n)?n.step:kl}function wl(e,t){return $e(e[t]??e["width"===t?"discreteWidth":"discreteHeight"],{step:e.step})}const kl=20;const El={background:"white",padding:5,timeFormat:"%b %d, %Y",countTitle:"Count of Records",view:{continuousWidth:200,continuousHeight:200,step:kl},mark:{color:"#4c78a8",invalid:"filter",timeUnitBandSize:1},arc:{},area:{},bar:Xo,circle:{},geoshape:{},image:{},line:{},point:{},rect:Jo,rule:{color:"black"},square:{},text:{color:"black"},tick:{thickness:1},trail:{},boxplot:{size:14,extent:1.5,box:{},median:{color:"white"},outliers:{},rule:{},ticks:null},errorbar:{center:"mean",rule:!0,ticks:!1},errorband:{band:{opacity:.3},borders:!1},scale:{pointPadding:.5,barBandPaddingInner:.1,rectBandPaddingInner:0,bandWithNestedOffsetPaddingInner:.2,bandWithNestedOffsetPaddingOuter:.2,minBandSize:2,minFontSize:8,maxFontSize:40,minOpacity:.3,maxOpacity:.8,minSize:9,minStrokeWidth:1,maxStrokeWidth:4,quantileCount:4,quantizeCount:4,zero:!0},projection:{},legend:{gradientHorizontalMaxLength:200,gradientHorizontalMinLength:100,gradientVerticalMaxLength:200,gradientVerticalMinLength:64,unselectedOpacity:.35},header:{titlePadding:10,labelPadding:10},headerColumn:{},headerRow:{},headerFacet:{},selection:ll,style:{},title:{},facet:{spacing:20},concat:{spacing:20},normalizedNumberFormat:".0%"},Dl=["#4c78a8","#f58518","#e45756","#72b7b2","#54a24b","#eeca3b","#b279a2","#ff9da6","#9d755d","#bab0ac"],$l={text:11,guideLabel:10,guideTitle:11,groupTitle:13,groupSubtitle:12},Al={blue:Dl[0],orange:Dl[1],red:Dl[2],teal:Dl[3],green:Dl[4],yellow:Dl[5],purple:Dl[6],pink:Dl[7],brown:Dl[8],gray0:"#000",gray1:"#111",gray2:"#222",gray3:"#333",gray4:"#444",gray5:"#555",gray6:"#666",gray7:"#777",gray8:"#888",gray9:"#999",gray10:"#aaa",gray11:"#bbb",gray12:"#ccc",gray13:"#ddd",gray14:"#eee",gray15:"#fff"};function Sl(e){const t=fe(e||{}),n={};for(const i of t){const t=e[i];n[i]=ds(t)?ci(t):fi(t)}return n}const Ml=[...qo,...vs,...rl,"background","padding","legend","lineBreak","scale","style","title","view"];function Cl(e={}){const{color:t,font:n,fontSize:i,selection:r,...o}=e,a=(0,j.fE)({},J(El),n?function(e){return{text:{font:e},style:{"guide-label":{font:e},"guide-title":{font:e},"group-title":{font:e},"group-subtitle":{font:e}}}}(n):{},t?function(e={}){return{signals:[{name:"color",value:(0,j.Kn)(e)?{...Al,...e}:Al}],mark:{color:{signal:"color.blue"}},rule:{color:{signal:"color.gray0"}},text:{color:{signal:"color.gray0"}},style:{"guide-label":{fill:{signal:"color.gray0"}},"guide-title":{fill:{signal:"color.gray0"}},"group-title":{fill:{signal:"color.gray0"}},"group-subtitle":{fill:{signal:"color.gray0"}},cell:{stroke:{signal:"color.gray8"}}},axis:{domainColor:{signal:"color.gray13"},gridColor:{signal:"color.gray8"},tickColor:{signal:"color.gray13"}},range:{category:[{signal:"color.blue"},{signal:"color.orange"},{signal:"color.red"},{signal:"color.teal"},{signal:"color.green"},{signal:"color.yellow"},{signal:"color.purple"},{signal:"color.pink"},{signal:"color.brown"},{signal:"color.grey8"}]}}}(t):{},i?function(e){return{signals:[{name:"fontSize",value:(0,j.Kn)(e)?{...$l,...e}:$l}],text:{fontSize:{signal:"fontSize.text"}},style:{"guide-label":{fontSize:{signal:"fontSize.guideLabel"}},"guide-title":{fontSize:{signal:"fontSize.guideTitle"}},"group-title":{fontSize:{signal:"fontSize.groupTitle"}},"group-subtitle":{fontSize:{signal:"fontSize.groupSubtitle"}}}}}(i):{},o||{});r&&(0,U.writeConfig)(a,"selection",r,!0);const s=Y(a,Ml);for(const l of["background","lineBreak","padding"])a[l]&&(s[l]=fi(a[l]));for(const l of qo)a[l]&&(s[l]=ti(a[l]));for(const l of vs)a[l]&&(s[l]=Sl(a[l]));for(const l of rl)a[l]&&(s[l]=ti(a[l]));return a.legend&&(s.legend=ti(a.legend)),a.scale&&(s.scale=ti(a.scale)),a.style&&(s.style=function(e){const t=fe(e),n={};for(const i of t)n[i]=Sl(e[i]);return n}(a.style)),a.title&&(s.title=ti(a.title)),a.view&&(s.view=ti(a.view)),s}const Fl=new Set(["view",...Uo]),Ol=["color","fontSize","background","padding","facet","concat","numberFormat","numberFormatType","normalizedNumberFormat","normalizedNumberFormatType","timeFormat","countTitle","header","axisQuantitative","axisTemporal","axisDiscrete","axisPoint","axisXBand","axisXPoint","axisXDiscrete","axisXQuantitative","axisXTemporal","axisYBand","axisYPoint","axisYDiscrete","axisYQuantitative","axisYTemporal","scale","selection","overlay"],Tl={view:["continuousWidth","continuousHeight","discreteWidth","discreteHeight","step"],area:["line","point"],bar:["binSpacing","continuousBandSize","discreteBandSize","minBandSize"],rect:["binSpacing","continuousBandSize","discreteBandSize","minBandSize"],line:["point"],tick:["bandSize","thickness"]};function Nl(e){e=J(e);for(const t of Ol)delete e[t];if(e.axis)for(const t in e.axis)ds(e.axis[t])&&delete e.axis[t];if(e.legend)for(const t of Qs)delete e.legend[t];if(e.mark){for(const t of Io)delete e.mark[t];e.mark.tooltip&&(0,j.Kn)(e.mark.tooltip)&&delete e.mark.tooltip}e.params&&(e.signals=(e.signals||[]).concat(dl(e.params)),delete e.params);for(const t of Fl){for(const i of Io)delete e[t][i];const n=Tl[t];if(n)for(const i of n)delete e[t][i];zl(e,t)}for(const t of fe(Ks))delete e[t];!function(e){const{titleMarkConfig:t,subtitleMarkConfig:n,subtitle:i}=ni(e.title);ce(t)||(e.style["group-title"]={...e.style["group-title"],...t});ce(n)||(e.style["group-subtitle"]={...e.style["group-subtitle"],...n});ce(i)?delete e.title:e.title=i}(e);for(const t in e)(0,j.Kn)(e[t])&&ce(e[t])&&delete e[t];return ce(e)?void 0:e}function zl(e,t,n,i){"view"===t&&(n="cell");const r={...i?e[t][i]:e[t],...e.style[n??t]};ce(r)||(e.style[n??t]=r),i||delete e[t]}function Rl(e){return"layer"in e}class Pl{map(e,t){return _a(e)?this.mapFacet(e,t):function(e){return"repeat"in e}(e)?this.mapRepeat(e,t):ml(e)?this.mapHConcat(e,t):pl(e)?this.mapVConcat(e,t):hl(e)?this.mapConcat(e,t):this.mapLayerOrUnit(e,t)}mapLayerOrUnit(e,t){if(Rl(e))return this.mapLayer(e,t);if(bs(e))return this.mapUnit(e,t);throw new Error($i(e))}mapLayer(e,t){return{...e,layer:e.layer.map((e=>this.mapLayerOrUnit(e,t)))}}mapHConcat(e,t){return{...e,hconcat:e.hconcat.map((e=>this.map(e,t)))}}mapVConcat(e,t){return{...e,vconcat:e.vconcat.map((e=>this.map(e,t)))}}mapConcat(e,t){const{concat:n,...i}=e;return{...i,concat:n.map((e=>this.map(e,t)))}}mapFacet(e,t){return{...e,spec:this.map(e.spec,t)}}mapRepeat(e,t){return{...e,spec:this.map(e.spec,t)}}}const Ll={zero:1,center:1,normalize:1};const Ul=new Set([ko,Do,Eo,Co,So,No,zo,Ao,Fo,Oo]),Bl=new Set([Do,Eo,ko]);function jl(e){return Fa(e)&&"quantitative"===Oa(e)&&!e.bin}function Il(e,t,{orient:n,type:i}){const r="x"===t?"y":"radius",o="x"===t&&["bar","area"].includes(i),a=e[t],s=e[r];if(Fa(a)&&Fa(s))if(jl(a)&&jl(s)){if(a.stack)return t;if(s.stack)return r;const e=Fa(a)&&!!a.aggregate;if(e!==(Fa(s)&&!!s.aggregate))return e?t:r;if(o){if("vertical"===n)return r;if("horizontal"===n)return t}}else{if(jl(a))return t;if(jl(s))return r}else{if(jl(a)){if(o&&"vertical"===n)return;return t}if(jl(s)){if(o&&"horizontal"===n)return;return r}}}function ql(e,t){const n=Bo(e)?e:{type:e},i=n.type;if(!Ul.has(i))return null;const r=Il(t,"x",n)||Il(t,"theta",n);if(!r)return null;const o=t[r],a=Fa(o)?Ha(o,{}):void 0,s=function(e){switch(e){case"x":return"y";case"y":return"x";case"theta":return"radius";case"radius":return"theta"}}(r),l=[],u=new Set;if(t[s]){const e=t[s],n=Fa(e)?Ha(e,{}):void 0;n&&n!==a&&(l.push(s),u.add(n))}const c="x"===s?"xOffset":"yOffset",f=t[c],d=Fa(f)?Ha(f,{}):void 0;d&&d!==a&&(l.push(c),u.add(d));const h=dn.reduce(((e,n)=>{if("tooltip"!==n&&_s(t,n)){const i=t[n];for(const t of(0,j.IX)(i)){const i=es(t);if(i.aggregate)continue;const r=Ha(i,{});r&&u.has(r)||e.push({channel:n,fieldDef:i})}}return e}),[]);let p;return void 0!==o.stack?p=(0,j.jn)(o.stack)?o.stack?"zero":null:o.stack:Bl.has(i)&&(p="zero"),p&&p in Ll?Es(t)&&0===h.length?null:o?.scale?.type&&o?.scale?.type!==Gr.LINEAR?(o?.stack&&or(function(e){return`Cannot stack non-linear scale (${e}).`}(o.scale.type)),null):Pa(t[Wt(r)])?(void 0!==o.stack&&or(`Cannot stack "${m=r}" if there is already "${m}2".`),null):(Fa(o)&&o.aggregate&&!Xn.has(o.aggregate)&&or(`Stacking is applied even though the aggregate function is non-summative ("${o.aggregate}").`),{groupbyChannels:l,groupbyFields:u,fieldChannel:r,impute:null!==o.impute&&Po(i),stackBy:h,offset:p}):null;var m}function Wl(e,t,n){const i=ti(e),r=vi("orient",i,n);if(i.orient=function(e,t,n){switch(e){case So:case No:case zo:case Fo:case Mo:case $o:return}const{x:i,y:r,x2:o,y2:a}=t;switch(e){case Do:if(Fa(i)&&(Yn(i.bin)||Fa(r)&&r.aggregate&&!i.aggregate))return"vertical";if(Fa(r)&&(Yn(r.bin)||Fa(i)&&i.aggregate&&!r.aggregate))return"horizontal";if(a||o){if(n)return n;if(!o)return(Fa(i)&&i.type===qr&&!Vn(i.bin)||Ra(i))&&Fa(r)&&Yn(r.bin)?"horizontal":"vertical";if(!a)return(Fa(r)&&r.type===qr&&!Vn(r.bin)||Ra(r))&&Fa(i)&&Yn(i.bin)?"vertical":"horizontal"}case Co:if(o&&(!Fa(i)||!Yn(i.bin))&&a&&(!Fa(r)||!Yn(r.bin)))return;case Eo:if(a)return Fa(r)&&Yn(r.bin)?"horizontal":"vertical";if(o)return Fa(i)&&Yn(i.bin)?"vertical":"horizontal";if(e===Co){if(i&&!r)return"vertical";if(r&&!i)return"horizontal"}case Ao:case Oo:{const t=za(i),o=za(r);if(n)return n;if(t&&!o)return"tick"!==e?"horizontal":"vertical";if(!t&&o)return"tick"!==e?"vertical":"horizontal";if(t&&o)return"vertical";{const e=La(i)&&i.type===Hr,t=La(r)&&r.type===Hr;if(e&&!t)return"vertical";if(!e&&t)return"horizontal"}return}}return"vertical"}(i.type,t,r),void 0!==r&&r!==i.orient&&or(`Specified orient "${i.orient}" overridden with "${r}".`),"bar"===i.type&&i.orient){const e=vi("cornerRadiusEnd",i,n);if(void 0!==e){const n="horizontal"===i.orient&&t.x2||"vertical"===i.orient&&t.y2?["cornerRadius"]:Ho[i.orient];for(const t of n)i[t]=e;void 0!==i.cornerRadiusEnd&&delete i.cornerRadiusEnd}}void 0===vi("opacity",i,n)&&(i.opacity=function(e,t){if(Q([So,Oo,No,zo],e)&&!Es(t))return.7;return}(i.type,t));return void 0===vi("cursor",i,n)&&(i.cursor=function(e,t,n){if(t.href||e.href||vi("href",e,n))return"pointer";return e.cursor}(i,t,n)),i}function Hl(e){const{point:t,line:n,...i}=e;return fe(i).length>1?i:i.type}function Xl(e){for(const t of["line","area","rule","trail"])e[t]&&(e={...e,[t]:Y(e[t],["point","line"])});return e}function Jl(e,t={},n){return"transparent"===e.point?{opacity:0}:e.point?(0,j.Kn)(e.point)?e.point:{}:void 0!==e.point?null:t.point||n.shape?(0,j.Kn)(t.point)?t.point:{}:void 0}function Gl(e,t={}){return e.line?!0===e.line?{}:e.line:void 0!==e.line?null:t.line?!0===t.line?{}:t.line:void 0}class Vl{constructor(){this.name="path-overlay"}hasMatchingType(e,t){if(bs(e)){const{mark:n,encoding:i}=e,r=Bo(n)?n:{type:n};switch(r.type){case"line":case"rule":case"trail":return!!Jl(r,t[r.type],i);case"area":return!!Jl(r,t[r.type],i)||!!Gl(r,t[r.type])}}return!1}run(e,t,n){const{config:i}=t,{params:r,projection:o,mark:a,name:s,encoding:l,...u}=e,c=As(l,i),f=Bo(a)?a:{type:a},d=Jl(f,i[f.type],c),h="area"===f.type&&Gl(f,i[f.type]),p=[{name:s,...r?{params:r}:{},mark:Hl({..."area"===f.type&&void 0===f.opacity&&void 0===f.fillOpacity?{opacity:.7}:{},...f}),encoding:Y(c,["shape"])}],m=ql(Wl(f,c,i),c);let g=c;if(m){const{fieldChannel:e,offset:t}=m;g={...c,[e]:{...c[e],...t?{stack:t}:{}}}}return g=Y(g,["y2","x2"]),h&&p.push({...o?{projection:o}:{},mark:{type:"line",...V(f,["clip","interpolate","tension","tooltip"]),...h},encoding:g}),d&&p.push({...o?{projection:o}:{},mark:{type:"point",opacity:1,filled:!0,...V(f,["clip","tooltip"]),...d},encoding:g}),n({...u,layer:p},{...t,config:Xl(i)})}}function Yl(e,t){return t?ba(e)?nu(e,t):Ql(e,t):e}function Kl(e,t){return t?nu(e,t):e}function Zl(e,t,n){const i=t[e];return(r=i)&&!(0,j.HD)(r)&&"repeat"in r?i.repeat in n?{...t,[e]:n[i.repeat]}:void or(function(e){return`Unknown repeated value "${e}".`}(i.repeat)):t;var r}function Ql(e,t){if(void 0!==(e=Zl("field",e,t))){if(null===e)return null;if(ka(e)&&ya(e.sort)){const n=Zl("field",e.sort,t);e={...e,...n?{sort:n}:{}}}return e}}function eu(e,t){if(Fa(e))return Ql(e,t);{const n=Zl("datum",e,t);return n===e||n.type||(n.type="nominal"),n}}function tu(e,t){if(!Pa(e)){if(Ca(e)){const n=eu(e.condition,t);if(n)return{...e,condition:n};{const{condition:t,...n}=e;return n}}return e}{const n=eu(e,t);if(n)return n;if(Sa(e))return{condition:e.condition}}}function nu(e,t){const n={};for(const i in e)if((0,j.nr)(e,i)){const r=e[i];if((0,j.kJ)(r))n[i]=r.map((e=>tu(e,t))).filter((e=>e));else{const e=tu(r,t);void 0!==e&&(n[i]=e)}}return n}class iu{constructor(){this.name="RuleForRangedLine"}hasMatchingType(e){if(bs(e)){const{encoding:t,mark:n}=e;if("line"===n||Bo(n)&&"line"===n.type)for(const e of Bt){const n=t[It(e)];if(t[e]&&(Fa(n)&&!Yn(n.bin)||Ta(n)))return!0}}return!1}run(e,t,n){const{encoding:i,mark:r}=e;var o,a;return or((o=!!i.x2,a=!!i.y2,`Line mark is for continuous lines and thus cannot be used with ${o&&a?"x2 and y2":o?"x2":"y2"}. We will use the rule mark (line segments) instead.`)),n({...e,mark:(0,j.Kn)(r)?{...r,type:"rule"}:"rule"},t)}}function ru({parentEncoding:e,encoding:t={},layer:n}){let i={};if(e){const r=new Set([...fe(e),...fe(t)]);for(const o of r){const r=t[o],a=e[o];if(Pa(r)){const e={...a,...r};i[o]=e}else Ca(r)?i[o]={...r,condition:{...a,...r.condition}}:r||null===r?i[o]=r:(n||Ua(a)||ri(a)||Pa(a)||(0,j.kJ)(a))&&(i[o]=a)}}else i=t;return!i||ce(i)?void 0:i}function ou(e){const{parentProjection:t,projection:n}=e;return t&&n&&or(function(e){const{parentProjection:t,projection:n}=e;return`Layer's shared projection ${Re(t)} is overridden by a child projection ${Re(n)}.`}({parentProjection:t,projection:n})),n??t}function au(e){return"filter"in e}function su(e){return void 0!==e?.stop}function lu(e){return"lookup"in e}function uu(e){return"pivot"in e}function cu(e){return"density"in e}function fu(e){return"quantile"in e}function du(e){return"regression"in e}function hu(e){return"loess"in e}function pu(e){return"sample"in e}function mu(e){return"window"in e}function gu(e){return"joinaggregate"in e}function yu(e){return"flatten"in e}function vu(e){return"calculate"in e}function bu(e){return"bin"in e}function xu(e){return"impute"in e}function _u(e){return"timeUnit"in e}function wu(e){return"aggregate"in e}function ku(e){return"stack"in e}function Eu(e){return"fold"in e}function Du(e){return"extent"in e&&!("density"in e)}function $u(e,t){const{transform:n,...i}=e;if(n){const e=n.map((e=>{if(au(e))return{filter:Mu(e,t)};if(bu(e)&&Kn(e.bin))return{...e,bin:Su(e.bin)};if(lu(e)){const{selection:t,...n}=e.from;return t?{...e,from:{param:t,...n}}:e}return e}));return{...i,transform:e}}return e}function Au(e,t){const n=J(e);if(Fa(n)&&Kn(n.bin)&&(n.bin=Su(n.bin)),Ba(n)&&n.scale?.domain?.selection){const{selection:e,...t}=n.scale.domain;n.scale.domain={...t,...e?{param:e}:{}}}if(Sa(n))if((0,U.isArray)(n.condition))n.condition=n.condition.map((e=>{const{selection:n,param:i,test:r,...o}=e;return i?e:{...o,test:Mu(e,t)}}));else{const{selection:e,param:i,test:r,...o}=Au(n.condition,t);n.condition=i?n.condition:{...o,test:Mu(n.condition,t)}}return n}function Su(e){const t=e.extent;if(t?.selection){const{selection:n,...i}=t;return{...e,extent:{...i,param:n}}}return e}function Mu(e,t){const n=e=>X(e,(e=>{var n;const i={param:e,empty:t.emptySelections[e]??!0};return(n=t.selectionPredicates)[e]??(n[e]=[]),t.selectionPredicates[e].push(i),i}));return e.selection?n(e.selection):X(e.test||e.filter,(e=>e.selection?n(e.selection):e))}class Cu extends Pl{map(e,t){const n=t.selections??[];if(e.params&&!bs(e)){const t=[];for(const i of e.params)fl(i)?n.push(i):t.push(i);e.params=t}return t.selections=n,super.map(e,t)}mapUnit(e,t){const n=t.selections;if(!n||!n.length)return e;const i=(t.path??[]).concat(e.name),r=[];for(const o of n)if(o.views&&o.views.length)for(const t of o.views)((0,U.isString)(t)&&(t===e.name||i.includes(t))||(0,U.isArray)(t)&&t.map((e=>i.indexOf(e))).every(((e,t,n)=>-1!==e&&(0===t||e>n[t-1]))))&&r.push(o);else r.push(o);return r.length&&(e.params=r),e}}for(const dv of["mapFacet","mapRepeat","mapHConcat","mapVConcat","mapLayer"]){const e=Cu.prototype[dv];Cu.prototype[dv]=function(t,n){return e.call(this,t,Fu(t,n))}}function Fu(e,t){return e.name?{...t,path:(t.path??[]).concat(e.name)}:t}function Ou(e,t){void 0===t&&(t=Cl(e.config));const n=function(e,t={}){const n={config:t};return zu.map(Tu.map(Nu.map(e,n),n),n)}(e,t),{width:i,height:r}=e,o=function(e,t,n){let{width:i,height:r}=t;const o=bs(e)||Rl(e),a={};o?"container"==i&&"container"==r?(a.type="fit",a.contains="padding"):"container"==i?(a.type="fit-x",a.contains="padding"):"container"==r&&(a.type="fit-y",a.contains="padding"):("container"==i&&(or(Si("width")),i=void 0),"container"==r&&(or(Si("height")),r=void 0));const s={type:"pad",...a,...n?Ru(n.autosize):{},...Ru(e.autosize)};"fit"!==s.type||o||(or(Ai),s.type="pad");"container"==i&&"fit"!=s.type&&"fit-x"!=s.type&&or(Mi("width"));"container"==r&&"fit"!=s.type&&"fit-y"!=s.type&&or(Mi("height"));if(ze(s,{type:"pad"}))return;return s}(n,{width:i,height:r,autosize:e.autosize},t);return{...n,...o?{autosize:o}:{}}}const Tu=new class extends Pl{constructor(){super(...arguments),this.nonFacetUnitNormalizers=[Ls,qs,Vs,new Vl,new iu]}map(e,t){if(bs(e)){const n=_s(e.encoding,Pe),i=_s(e.encoding,Le),r=_s(e.encoding,Ue);if(n||i||r)return this.mapFacetedUnit(e,t)}return super.map(e,t)}mapUnit(e,t){const{parentEncoding:n,parentProjection:i}=t,r=Kl(e.encoding,t.repeater),o={...e,...e.name?{name:[t.repeaterPrefix,e.name].filter((e=>e)).join("_")}:{},...r?{encoding:r}:{}};if(n||i)return this.mapUnitWithParentEncodingOrProjection(o,t);const a=this.mapLayerOrUnit.bind(this);for(const s of this.nonFacetUnitNormalizers)if(s.hasMatchingType(o,t.config))return s.run(o,t,a);return o}mapRepeat(e,t){return function(e){return!(0,j.kJ)(e.repeat)&&e.repeat.layer}(e)?this.mapLayerRepeat(e,t):this.mapNonLayerRepeat(e,t)}mapLayerRepeat(e,t){const{repeat:n,spec:i,...r}=e,{row:o,column:a,layer:s}=n,{repeater:l={},repeaterPrefix:u=""}=t;return o||a?this.mapRepeat({...e,repeat:{...o?{row:o}:{},...a?{column:a}:{}},spec:{repeat:{layer:s},spec:i}},t):{...r,layer:s.map((e=>{const n={...l,layer:e},r=`${(i.name?`${i.name}_`:"")+u}child__layer_${me(e)}`,o=this.mapLayerOrUnit(i,{...t,repeater:n,repeaterPrefix:r});return o.name=r,o}))}}mapNonLayerRepeat(e,t){const{repeat:n,spec:i,data:r,...o}=e;!(0,j.kJ)(n)&&e.columns&&(e=Y(e,["columns"]),or(Ri("repeat")));const a=[],{repeater:s={},repeaterPrefix:l=""}=t,u=!(0,j.kJ)(n)&&n.row||[s?s.row:null],c=!(0,j.kJ)(n)&&n.column||[s?s.column:null],f=(0,j.kJ)(n)&&n||[s?s.repeat:null];for(const h of f)for(const e of u)for(const r of c){const o={repeat:h,row:e,column:r,layer:s.layer},u=(i.name?`${i.name}_`:"")+l+"child__"+((0,j.kJ)(n)?`${me(h)}`:(n.row?`row_${me(e)}`:"")+(n.column?`column_${me(r)}`:"")),c=this.map(i,{...t,repeater:o,repeaterPrefix:u});c.name=u,a.push(Y(c,["data"]))}const d=(0,j.kJ)(n)?e.columns:n.column?n.column.length:1;return{data:i.data??r,align:"all",...o,columns:d,concat:a}}mapFacet(e,t){const{facet:n}=e;return ba(n)&&e.columns&&(e=Y(e,["columns"]),or(Ri("facet"))),super.mapFacet(e,t)}mapUnitWithParentEncodingOrProjection(e,t){const{encoding:n,projection:i}=e,{parentEncoding:r,parentProjection:o,config:a}=t,s=ou({parentProjection:o,projection:i}),l=ru({parentEncoding:r,encoding:Kl(n,t.repeater)});return this.mapUnit({...e,...s?{projection:s}:{},...l?{encoding:l}:{}},{config:a})}mapFacetedUnit(e,t){const{row:n,column:i,facet:r,...o}=e.encoding,{mark:a,width:s,projection:l,height:u,view:c,params:f,encoding:d,...h}=e,{facetMapping:p,layout:m}=this.getFacetMappingAndLayout({row:n,column:i,facet:r},t),g=Kl(o,t.repeater);return this.mapFacet({...h,...m,facet:p,spec:{...s?{width:s}:{},...u?{height:u}:{},...c?{view:c}:{},...l?{projection:l}:{},mark:a,encoding:g,...f?{params:f}:{}}},t)}getFacetMappingAndLayout(e,t){const{row:n,column:i,facet:r}=e;if(n||i){r&&or(`Facet encoding dropped as ${(o=[...n?[Pe]:[],...i?[Le]:[]]).join(" and ")} ${o.length>1?"are":"is"} also specified.`);const t={},a={};for(const n of[Pe,Le]){const i=e[n];if(i){const{align:e,center:r,spacing:o,columns:s,...l}=i;t[n]=l;for(const t of["align","center","spacing"])void 0!==i[t]&&(a[t]??(a[t]={}),a[t][n]=i[t])}}return{facetMapping:t,layout:a}}{const{align:e,center:n,spacing:i,columns:o,...a}=r;return{facetMapping:Yl(a,t.repeater),layout:{...e?{align:e}:{},...n?{center:n}:{},...i?{spacing:i}:{},...o?{columns:o}:{}}}}var o}mapLayer(e,{parentEncoding:t,parentProjection:n,...i}){const{encoding:r,projection:o,...a}=e,s={...i,parentEncoding:ru({parentEncoding:t,encoding:r,layer:!0}),parentProjection:ou({parentProjection:n,projection:o})};return super.mapLayer({...a,...e.name?{name:[s.repeaterPrefix,e.name].filter((e=>e)).join("_")}:{}},s)}},Nu=new class extends Pl{map(e,t){return t.emptySelections??(t.emptySelections={}),t.selectionPredicates??(t.selectionPredicates={}),e=$u(e,t),super.map(e,t)}mapLayerOrUnit(e,t){if((e=$u(e,t)).encoding){const n={};for(const[i,r]of he(e.encoding))n[i]=Au(r,t);e={...e,encoding:n}}return super.mapLayerOrUnit(e,t)}mapUnit(e,t){const{selection:n,...i}=e;return n?{...i,params:he(n).map((([e,n])=>{const{init:i,bind:r,empty:o,...a}=n;"single"===a.type?(a.type="point",a.toggle=!1):"multi"===a.type&&(a.type="point"),t.emptySelections[e]="none"!==o;for(const s of de(t.selectionPredicates[e]??{}))s.empty="none"!==o;return{name:e,value:i,select:a,bind:r}}))}:e}},zu=new Cu;function Ru(e){return(0,j.HD)(e)?{type:e}:e??{}}const Pu=["background","padding"];function Lu(e,t){const n={};for(const i of Pu)e&&void 0!==e[i]&&(n[i]=fi(e[i]));return t&&(n.params=e.params),n}class Uu{constructor(e={},t={}){this.explicit=e,this.implicit=t}clone(){return new Uu(J(this.explicit),J(this.implicit))}combine(){return{...this.explicit,...this.implicit}}get(e){return $e(this.explicit[e],this.implicit[e])}getWithExplicit(e){return void 0!==this.explicit[e]?{explicit:!0,value:this.explicit[e]}:void 0!==this.implicit[e]?{explicit:!1,value:this.implicit[e]}:{explicit:!1,value:void 0}}setWithExplicit(e,{value:t,explicit:n}){void 0!==t&&this.set(e,t,n)}set(e,t,n){return delete this[n?"implicit":"explicit"][e],this[n?"explicit":"implicit"][e]=t,this}copyKeyFromSplit(e,{explicit:t,implicit:n}){void 0!==t[e]?this.set(e,t[e],!0):void 0!==n[e]&&this.set(e,n[e],!1)}copyKeyFromObject(e,t){void 0!==t[e]&&this.set(e,t[e],!0)}copyAll(e){for(const t of fe(e.combine())){const n=e.getWithExplicit(t);this.setWithExplicit(t,n)}}}function Bu(e){return{explicit:!0,value:e}}function ju(e){return{explicit:!1,value:e}}function Iu(e){return(t,n,i,r)=>{const o=e(t.value,n.value);return o>0?t:o<0?n:qu(t,n,i,r)}}function qu(e,t,n,i){return e.explicit&&t.explicit&&or(function(e,t,n,i){return`Conflicting ${t.toString()} property "${e.toString()}" (${Re(n)} and ${Re(i)}). Using ${Re(n)}.`}(n,i,e.value,t.value)),e}function Wu(e,t,n,i,r=qu){return void 0===e||void 0===e.value?t:e.explicit&&!t.explicit?e:t.explicit&&!e.explicit?t:ze(e.value,t.value)?e:r(e,t,n,i)}class Hu extends Uu{constructor(e={},t={},n=!1){super(e,t),this.explicit=e,this.implicit=t,this.parseNothing=n}clone(){const e=super.clone();return e.parseNothing=this.parseNothing,e}}function Xu(e){return"url"in e}function Ju(e){return"values"in e}function Gu(e){return"name"in e&&!Xu(e)&&!Ju(e)&&!Vu(e)}function Vu(e){return e&&(Yu(e)||Ku(e)||Zu(e))}function Yu(e){return"sequence"in e}function Ku(e){return"sphere"in e}function Zu(e){return"graticule"in e}var Qu;!function(e){e[e.Raw=0]="Raw",e[e.Main=1]="Main",e[e.Row=2]="Row",e[e.Column=3]="Column",e[e.Lookup=4]="Lookup"}(Qu||(Qu={}));var ec=n(52847);function tc(e){const{signals:t,hasLegend:n,index:i,...r}=e;return r.field=we(r.field),r}function nc(e,t=!0,n=j.yR){if((0,j.kJ)(e)){const i=e.map((e=>nc(e,t,n)));return t?`[${i.join(", ")}]`:i}return ar(e)?n(t?dr(e):function(e){const t=fr(e,!0);return e.utc?+new Date(Date.UTC(...t)):+new Date(...t)}(e)):t?n(Re(e)):e}function ic(e,t){for(const n of de(e.component.selection??{})){const i=n.name;let r=`${i}${Mf}, ${"global"===n.resolve?"true":`{unit: ${Tf(e)}}`}`;for(const o of Of)o.defined(n)&&(o.signals&&(t=o.signals(e,n,t)),o.modifyExpr&&(r=o.modifyExpr(e,n,r)));t.push({name:i+Cf,on:[{events:{signal:n.name+Mf},update:`modify(${(0,j.m8)(n.name+Sf)}, ${r})`}]})}return ac(t)}function rc(e,t){if(e.component.selection&&fe(e.component.selection).length){const n=(0,j.m8)(e.getName("cell"));t.unshift({name:"facet",value:{},on:[{events:(0,ec.r)("pointermove","scope"),update:`isTuple(facet) ? facet : group(${n}).datum`}]})}return ac(t)}function oc(e,t){for(const n of de(e.component.selection??{}))for(const i of Of)i.defined(n)&&i.marks&&(t=i.marks(e,n,t));return t}function ac(e){return e.map((e=>(e.on&&!e.on.length&&delete e.on,e)))}class sc{constructor(e,t){this.debugName=t,this._children=[],this._parent=null,e&&(this.parent=e)}clone(){throw new Error("Cannot clone node")}get parent(){return this._parent}set parent(e){this._parent=e,e&&e.addChild(this)}get children(){return this._children}numChildren(){return this._children.length}addChild(e,t){this._children.includes(e)?or("Attempt to add the same child twice."):void 0!==t?this._children.splice(t,0,e):this._children.push(e)}removeChild(e){const t=this._children.indexOf(e);return this._children.splice(t,1),t}remove(){let e=this._parent.removeChild(this);for(const t of this._children)t._parent=this._parent,this._parent.addChild(t,e++)}insertAsParentOf(e){const t=e.parent;t.removeChild(this),this.parent=t,e.parent=this}swapWithParent(){const e=this._parent,t=e.parent;for(const i of this._children)i.parent=e;this._children=[],e.removeChild(this);const n=e.parent.removeChild(e);this._parent=t,t.addChild(this,n),e.parent=this}}class lc extends sc{clone(){const e=new this.constructor;return e.debugName=`clone_${this.debugName}`,e._source=this._source,e._name=`clone_${this._name}`,e.type=this.type,e.refCounts=this.refCounts,e.refCounts[e._name]=0,e}constructor(e,t,n,i){super(e,t),this.type=n,this.refCounts=i,this._source=this._name=t,this.refCounts&&!(this._name in this.refCounts)&&(this.refCounts[this._name]=0)}dependentFields(){return new Set}producedFields(){return new Set}hash(){return void 0===this._hash&&(this._hash=`Output ${Se()}`),this._hash}getSource(){return this.refCounts[this._name]++,this._source}isRequired(){return!!this.refCounts[this._name]}setSource(e){this._source=e}}function uc(e){return void 0!==e.as}function cc(e){return`${e}_end`}class fc extends sc{clone(){return new fc(null,J(this.timeUnits))}constructor(e,t){super(e),this.timeUnits=t}static makeFromEncoding(e,t){const n=t.reduceFieldDef(((e,n,i)=>{const{field:r,timeUnit:o}=n;if(o){let a;if(mr(o)){if(bp(t)){const{mark:e,markDef:i,config:s}=t,l=Ea({fieldDef:n,markDef:i,config:s});(Lo(e)||l)&&(a={timeUnit:Er(o),field:r})}}else a={as:Ha(n,{forAs:!0}),field:r,timeUnit:o};if(bp(t)){const{mark:e,markDef:r,config:o}=t,s=Ea({fieldDef:n,markDef:r,config:o});Lo(e)&&mn(i)&&.5!==s&&(a.rectBandPosition=s)}a&&(e[K(a)]=a)}return e}),{});return ce(n)?null:new fc(e,n)}static makeFromTransform(e,t){const{timeUnit:n,...i}={...t},r={...i,timeUnit:Er(n)};return new fc(e,{[K(r)]:r})}merge(e){this.timeUnits={...this.timeUnits};for(const t in e.timeUnits)this.timeUnits[t]||(this.timeUnits[t]=e.timeUnits[t]);for(const t of e.children)e.removeChild(t),t.parent=this;e.remove()}removeFormulas(e){const t={};for(const[n,i]of he(this.timeUnits)){const r=uc(i)?i.as:`${i.field}_end`;e.has(r)||(t[n]=i)}this.timeUnits=t}producedFields(){return new Set(de(this.timeUnits).map((e=>uc(e)?e.as:cc(e.field))))}dependentFields(){return new Set(de(this.timeUnits).map((e=>e.field)))}hash(){return`TimeUnit ${K(this.timeUnits)}`}assemble(){const e=[];for(const t of de(this.timeUnits)){const{rectBandPosition:n}=t,i=Er(t.timeUnit);if(uc(t)){const{field:r,as:o}=t,{unit:a,utc:s,...l}=i,u=[o,`${o}_end`];e.push({field:we(r),type:"timeunit",...a?{units:br(a)}:{},...s?{timezone:"utc"}:{},...l,as:u}),e.push(...mc(u,n,i))}else if(t){const{field:r}=t,o=r.replaceAll("\\.","."),a=pc({timeUnit:i,field:o}),s=cc(o);e.push({type:"formula",expr:a,as:s}),e.push(...mc([o,s],n,i))}}return e}}const dc="offsetted_rect_start",hc="offsetted_rect_end";function pc({timeUnit:e,field:t,reverse:n}){const{unit:i,utc:r}=e,o=xr(i),{part:a,step:s}=Ar(o,e.step);return`${r?"utcOffset":"timeOffset"}('${a}', datum['${t}'], ${n?-s:s})`}function mc([e,t],n,i){if(void 0!==n&&.5!==n){const r=`datum['${e}']`,o=`datum['${t}']`;return[{type:"formula",expr:gc([pc({timeUnit:i,field:e,reverse:!0}),r],n+.5),as:`${e}_${dc}`},{type:"formula",expr:gc([r,o],n+.5),as:`${e}_${hc}`}]}return[]}function gc([e,t],n){return`${1-n} * ${e} + ${n} * ${t}`}const yc="_tuple_fields";class vc{constructor(...e){this.items=e,this.hasChannel={},this.hasField={},this.hasSelectionId=!1}}const bc={defined:()=>!0,parse:(e,t,n)=>{const i=t.name,r=t.project??(t.project=new vc),o={},a={},s=new Set,l=(e,t)=>{const n="visual"===t?e.channel:e.field;let r=me(`${i}_${n}`);for(let o=1;s.has(r);o++)r=me(`${i}_${n}_${o}`);return s.add(r),{[t]:r}},u=t.type,c=e.config.selection[u],f=void 0!==n.value?(0,j.IX)(n.value):null;let{fields:d,encodings:h}=(0,j.Kn)(n.select)?n.select:{};if(!d&&!h&&f)for(const p of f)if((0,j.Kn)(p))for(const e of fe(p))Lt[e]?(h||(h=[])).push(e):"interval"===u?(or('Interval selections should be initialized using "x", "y", "longitude", or "latitude" keys.'),h=c.encodings):(d??(d=[])).push(e);d||h||(h=c.encodings,"fields"in c&&(d=c.fields));for(const p of h??[]){const t=e.fieldDef(p);if(t){let n=t.field;if(t.aggregate){or(Ti(p,t.aggregate));continue}if(!n){or(Oi(p));continue}if(t.timeUnit&&!mr(t.timeUnit)){n=e.vgField(p);const i={timeUnit:t.timeUnit,as:n,field:t.field};a[K(i)]=i}if(!o[n]){const i={field:n,channel:p,type:"interval"===u&&Tn(p)&&ao(e.getScaleComponent(p).get("type"))?"R":t.bin?"R-RE":"E",index:r.items.length};i.signals={...l(i,"data"),...l(i,"visual")},r.items.push(o[n]=i),r.hasField[n]=o[n],r.hasSelectionId=r.hasSelectionId||n===sl,kt(p)?(i.geoChannel=p,i.channel=wt(p),r.hasChannel[i.channel]=o[n]):r.hasChannel[p]=o[n]}}else or(Oi(p))}for(const p of d??[]){if(r.hasField[p])continue;const e={type:"E",field:p,index:r.items.length};e.signals={...l(e,"data")},r.items.push(e),r.hasField[p]=e,r.hasSelectionId=r.hasSelectionId||p===sl}f&&(t.init=f.map((e=>r.items.map((t=>(0,j.Kn)(e)?void 0!==e[t.geoChannel||t.channel]?e[t.geoChannel||t.channel]:e[t.field]:e))))),ce(a)||(r.timeUnit=new fc(null,a))},signals:(e,t,n)=>{const i=t.name+yc;return n.filter((e=>e.name===i)).length>0||t.project.hasSelectionId?n:n.concat({name:i,value:t.project.items.map(tc)})}},xc=bc,_c={defined:e=>"interval"===e.type&&"global"===e.resolve&&e.bind&&"scales"===e.bind,parse:(e,t)=>{const n=t.scales=[];for(const i of t.project.items){const r=i.channel;if(!Tn(r))continue;const o=e.getScaleComponent(r),a=o?o.get("type"):void 0;o&&ao(a)?(o.set("selectionExtent",{param:t.name,field:i.field},!0),n.push(i)):or("Scale bindings are currently only supported for scales with unbinned, continuous domains.")}},topLevelSignals:(e,t,n)=>{const i=t.scales.filter((e=>0===n.filter((t=>t.name===e.signals.data)).length));if(!e.parent||Ec(e)||0===i.length)return n;const r=n.filter((e=>e.name===t.name))[0];let o=r.update;if(o.indexOf(Ff)>=0)r.update=`{${i.map((e=>`${(0,j.m8)(we(e.field))}: ${e.signals.data}`)).join(", ")}}`;else{for(const e of i){const t=`${(0,j.m8)(we(e.field))}: ${e.signals.data}`;o.includes(t)||(o=`${o.substring(0,o.length-1)}, ${t}}`)}r.update=o}return n.concat(i.map((e=>({name:e.signals.data}))))},signals:(e,t,n)=>{if(e.parent&&!Ec(e))for(const i of t.scales){const e=n.filter((e=>e.name===i.signals.data))[0];e.push="outer",delete e.value,delete e.update}return n}},wc=_c;function kc(e,t){return`domain(${(0,j.m8)(e.scaleName(t))})`}function Ec(e){return e.parent&&wp(e.parent)&&(!e.parent.parent??Ec(e.parent.parent))}const Dc="_brush",$c="_scale_trigger",Ac="geo_interval_init_tick",Sc="_init",Mc={defined:e=>"interval"===e.type,parse:(e,t,n)=>{var i;if(e.hasProjection){const e={...(0,U.isObject)(n.select)?n.select:{}};e.fields=[sl],e.encodings||(e.encodings=n.value?fe(n.value):[Ke,Ye]),n.select={type:"interval",...e}}if(t.translate&&!wc.defined(t)){const e=`!event.item || event.item.mark.name !== ${(0,j.m8)(t.name+Dc)}`;for(const n of t.events){if(!n.between){or(`${n} is not an ordered event stream for interval selections.`);continue}const t=(0,j.IX)((i=n.between[0]).filter??(i.filter=[]));t.indexOf(e)<0&&t.push(e)}}},signals:(e,t,n)=>{const i=t.name,r=i+Mf,o=de(t.project.hasChannel).filter((e=>e.channel===Be||e.channel===je)),a=t.init?t.init[0]:null;if(n.push(...o.reduce(((n,i)=>n.concat(function(e,t,n,i){const r=!e.hasProjection,o=n.channel,a=n.signals.visual,s=(0,j.m8)(r?e.scaleName(o):e.projectionName()),l=e=>`scale(${s}, ${e})`,u=e.getSizeSignalRef(o===Be?"width":"height").signal,c=`${o}(unit)`,f=t.events.reduce(((e,t)=>[...e,{events:t.between[0],update:`[${c}, ${c}]`},{events:t,update:`[${a}[0], clamp(${c}, 0, ${u})]`}]),[]);if(r){const r=n.signals.data,u=wc.defined(t),c=e.getScaleComponent(o),d=c?c.get("type"):void 0,h=i?{init:nc(i,!0,l)}:{value:[]};return f.push({events:{signal:t.name+$c},update:ao(d)?`[${l(`${r}[0]`)}, ${l(`${r}[1]`)}]`:"[0, 0]"}),u?[{name:r,on:[]}]:[{name:a,...h,on:f},{name:r,...i?{init:nc(i)}:{},on:[{events:{signal:a},update:`${a}[0] === ${a}[1] ? null : invert(${s}, ${a})`}]}]}{const e=o===Be?0:1,n=t.name+Sc;return[{name:a,...i?{init:`[${n}[0][${e}], ${n}[1][${e}]]`}:{value:[]},on:f}]}}(e,t,i,a&&a[i.index]))),[])),e.hasProjection){const s=(0,j.m8)(e.projectionName()),l=e.projectionName()+"_center",{x:u,y:c}=t.project.hasChannel,f=u&&u.signals.visual,d=c&&c.signals.visual,h=u?a&&a[u.index]:`${l}[0]`,p=c?a&&a[c.index]:`${l}[1]`,m=t=>e.getSizeSignalRef(t).signal,g=`[[${f?f+"[0]":"0"}, ${d?d+"[0]":"0"}],[${f?f+"[1]":m("width")}, ${d?d+"[1]":m("height")}]]`;if(a&&(n.unshift({name:i+Sc,init:`[scale(${s}, [${u?h[0]:h}, ${c?p[0]:p}]), scale(${s}, [${u?h[1]:h}, ${c?p[1]:p}])]`}),!u||!c)){n.find((e=>e.name===l))||n.unshift({name:l,update:`invert(${s}, [${m("width")}/2, ${m("height")}/2])`})}const y=`vlSelectionTuples(${`intersect(${g}, {markname: ${(0,j.m8)(e.getName("marks"))}}, unit.mark)`}, ${`{unit: ${Tf(e)}}`})`,v=o.map((e=>e.signals.visual));return n.concat({name:r,on:[{events:[...v.length?[{signal:v.join(" || ")}]:[],...a?[{signal:Ac}]:[]],update:y}]})}{if(!wc.defined(t)){const t=i+$c,r=o.map((t=>{const n=t.channel,{data:i,visual:r}=t.signals,o=(0,j.m8)(e.scaleName(n)),a=ao(e.getScaleComponent(n).get("type"))?"+":"";return`(!isArray(${i}) || (${a}invert(${o}, ${r})[0] === ${a}${i}[0] && ${a}invert(${o}, ${r})[1] === ${a}${i}[1]))`}));r.length&&n.push({name:t,value:{},on:[{events:o.map((t=>({scale:e.scaleName(t.channel)}))),update:r.join(" && ")+` ? ${t} : {}`}]})}const s=o.map((e=>e.signals.data)),l=`unit: ${Tf(e)}, fields: ${i+yc}, values`;return n.concat({name:r,...a?{init:`{${l}: ${nc(a)}}`}:{},...s.length?{on:[{events:[{signal:s.join(" || ")}],update:`${s.join(" && ")} ? {${l}: [${s}]} : null`}]}:{}})}},topLevelSignals:(e,t,n)=>{if(bp(e)&&e.hasProjection&&t.init){n.filter((e=>e.name===Ac)).length||n.unshift({name:Ac,value:null,on:[{events:"timer{1}",update:`${Ac} === null ? {} : ${Ac}`}]})}return n},marks:(e,t,n)=>{const i=t.name,{x:r,y:o}=t.project.hasChannel,a=r?.signals.visual,s=o?.signals.visual,l=`data(${(0,j.m8)(t.name+Sf)})`;if(wc.defined(t)||!r&&!o)return n;const u={x:void 0!==r?{signal:`${a}[0]`}:{value:0},y:void 0!==o?{signal:`${s}[0]`}:{value:0},x2:void 0!==r?{signal:`${a}[1]`}:{field:{group:"width"}},y2:void 0!==o?{signal:`${s}[1]`}:{field:{group:"height"}}};if("global"===t.resolve)for(const m of fe(u))u[m]=[{test:`${l}.length && ${l}[0].unit === ${Tf(e)}`,...u[m]},{value:0}];const{fill:c,fillOpacity:f,cursor:d,...h}=t.mark,p=fe(h).reduce(((e,t)=>(e[t]=[{test:[void 0!==r&&`${a}[0] !== ${a}[1]`,void 0!==o&&`${s}[0] !== ${s}[1]`].filter((e=>e)).join(" && "),value:h[t]},{value:null}],e)),{});return[{name:`${i+Dc}_bg`,type:"rect",clip:!0,encode:{enter:{fill:{value:c},fillOpacity:{value:f}},update:u}},...n,{name:i+Dc,type:"rect",clip:!0,encode:{enter:{...d?{cursor:{value:d}}:{},fill:{value:"transparent"}},update:{...u,...p}}}]}},Cc=Mc;const Fc={defined:e=>"point"===e.type,signals:(e,t,n)=>{const i=t.name,r=i+yc,o=t.project,a="(item().isVoronoi ? datum.datum : datum)",s=de(e.component.selection??{}).reduce(((e,t)=>"interval"===t.type?e.concat(t.name+Dc):e),[]).map((e=>`indexof(item().mark.name, '${e}') < 0`)).join(" && "),l="datum && item().mark.marktype !== 'group' && indexof(item().mark.role, 'legend') < 0"+(s?` && ${s}`:"");let u=`unit: ${Tf(e)}, `;if(t.project.hasSelectionId)u+=`${sl}: ${a}[${(0,j.m8)(sl)}]`;else{u+=`fields: ${r}, values: [${o.items.map((t=>{const n=e.fieldDef(t.channel);return n?.bin?`[${a}[${(0,j.m8)(e.vgField(t.channel,{}))}], ${a}[${(0,j.m8)(e.vgField(t.channel,{binSuffix:"end"}))}]]`:`${a}[${(0,j.m8)(t.field)}]`})).join(", ")}]`}const c=t.events;return n.concat([{name:i+Mf,on:c?[{events:c,update:`${l} ? {${u}} : null`,force:!0}]:[]}])}},Oc=Fc;function Tc(e,t,n,i){const r=Sa(t)&&t.condition,o=i(t);if(r){return{[n]:[...(0,j.IX)(r).map((t=>{const n=i(t);if(function(e){return e.param}(t)){const{param:i,empty:r}=t;return{test:jf(e,{param:i,empty:r}),...n}}return{test:qf(e,t.test),...n}})),...void 0!==o?[o]:[]]}}return void 0!==o?{[n]:o}:{}}function Nc(e,t="text"){const n=e.encoding[t];return Tc(e,n,t,(t=>zc(t,e.config)))}function zc(e,t,n="datum"){if(e){if(Ua(e))return hi(e.value);if(Pa(e)){const{format:i,formatType:r}=Qa(e);return ra({fieldOrDatumDef:e,format:i,formatType:r,expr:n,config:t})}}}function Rc(e,t={}){const{encoding:n,markDef:i,config:r,stack:o}=e,a=n.tooltip;if((0,j.kJ)(a))return{tooltip:Lc({tooltip:a},o,r,t)};{const s=t.reactiveGeom?"datum.datum":"datum";return Tc(e,a,"tooltip",(e=>{const a=zc(e,r,s);if(a)return a;if(null===e)return;let l=vi("tooltip",i,r);return!0===l&&(l={content:"encoding"}),(0,j.HD)(l)?{value:l}:(0,j.Kn)(l)?ri(l)?l:"encoding"===l.content?Lc(n,o,r,t):{signal:s}:void 0}))}}function Pc(e,t,n,{reactiveGeom:i}={}){const r={...n,...n.tooltipFormat},o={},a=i?"datum.datum":"datum",s=[];function l(n,i){const l=It(i),u=La(n)?n:{...n,type:e[l].type},c=u.title||Za(u,r),f=(0,j.IX)(c).join(", ").replaceAll(/"/g,'\\"');let d;if(mn(i)){const t="x"===i?"x2":"y2",n=es(e[t]);if(Yn(u.bin)&&n){const e=Ha(u,{expr:a}),i=Ha(n,{expr:a}),{format:s,formatType:l}=Qa(u);d=da(e,i,s,l,r),o[t]=!0}}if((mn(i)||i===Ge||i===Xe)&&t&&t.fieldChannel===i&&"normalize"===t.offset){const{format:e,formatType:t}=Qa(u);d=ra({fieldOrDatumDef:u,format:e,formatType:t,expr:a,config:r,normalizeStack:!0}).signal}d??(d=zc(u,r,a).signal),s.push({channel:i,key:f,value:d})}Ss(e,((e,t)=>{Fa(e)?l(e,t):Ma(e)&&l(e.condition,t)}));const u={};for(const{channel:c,key:f,value:d}of s)o[c]||u[f]||(u[f]=d);return u}function Lc(e,t,n,{reactiveGeom:i}={}){const r=Pc(e,t,n,{reactiveGeom:i}),o=he(r).map((([e,t])=>`"${e}": ${t}`));return o.length>0?{signal:`{${o.join(", ")}}`}:void 0}function Uc(e){const{markDef:t,config:n}=e,i=vi("aria",t,n);return!1===i?{}:{...i?{aria:i}:{},...Bc(e),...jc(e)}}function Bc(e){const{mark:t,markDef:n,config:i}=e;if(!1===i.aria)return{};const r=vi("ariaRoleDescription",n,i);return null!=r?{ariaRoleDescription:{value:r}}:t in li?{}:{ariaRoleDescription:{value:t}}}function jc(e){const{encoding:t,markDef:n,config:i,stack:r}=e,o=t.description;if(o)return Tc(e,o,"description",(t=>zc(t,e.config)));const a=vi("description",n,i);if(null!=a)return{description:hi(a)};if(!1===i.aria)return{};const s=Pc(t,r,i);return ce(s)?void 0:{description:{signal:he(s).map((([e,t],n)=>`"${n>0?"; ":""}${e}: " + (${t})`)).join(" + ")}}}function Ic(e,t,n={}){const{markDef:i,encoding:r,config:o}=t,{vgChannel:a}=n;let{defaultRef:s,defaultValue:l}=n;void 0===s&&(l??(l=vi(e,i,o,{vgChannel:a,ignoreVgConfig:!0})),void 0!==l&&(s=hi(l)));const u=r[e];return Tc(t,u,a??e,(n=>Qo({channel:e,channelDef:n,markDef:i,config:o,scaleName:t.scaleName(e),scale:t.getScaleComponent(e),stack:null,defaultRef:s})))}function qc(e,t={filled:void 0}){const{markDef:n,encoding:i,config:r}=e,{type:o}=n,a=t.filled??vi("filled",n,r),s=Q(["bar","point","circle","square","geoshape"],o)?"transparent":void 0,l=vi(!0===a?"color":void 0,n,r,{vgChannel:"fill"})??r.mark[!0===a&&"color"]??s,u=vi(!1===a?"color":void 0,n,r,{vgChannel:"stroke"})??r.mark[!1===a&&"color"],c=a?"fill":"stroke",f={...l?{fill:hi(l)}:{},...u?{stroke:hi(u)}:{}};return n.color&&(a?n.fill:n.stroke)&&or(ji("property",{fill:"fill"in n,stroke:"stroke"in n})),{...f,...Ic("color",e,{vgChannel:c,defaultValue:a?l:u}),...Ic("fill",e,{defaultValue:i.fill?l:void 0}),...Ic("stroke",e,{defaultValue:i.stroke?u:void 0})}}function Wc(e){const{encoding:t,mark:n}=e,i=t.order;return!Po(n)&&Ua(i)?Tc(e,i,"zindex",(e=>hi(e.value))):{}}function Hc({channel:e,markDef:t,encoding:n={},model:i,bandPosition:r}){const o=`${e}Offset`,a=t[o],s=n[o];if(("xOffset"===o||"yOffset"===o)&&s){return{offsetType:"encoding",offset:Qo({channel:o,channelDef:s,markDef:t,config:i?.config,scaleName:i.scaleName(o),scale:i.getScaleComponent(o),stack:null,defaultRef:hi(a),bandPosition:r})}}const l=t[o];return l?{offsetType:"visual",offset:l}:{}}function Xc(e,t,{defaultPos:n,vgChannel:i}){const{encoding:r,markDef:o,config:a,stack:s}=t,l=r[e],u=r[Wt(e)],c=t.scaleName(e),f=t.getScaleComponent(e),{offset:d,offsetType:h}=Hc({channel:e,markDef:o,encoding:r,model:t,bandPosition:.5}),p=Jc({model:t,defaultPos:n,channel:e,scaleName:c,scale:f}),m=!l&&mn(e)&&(r.latitude||r.longitude)?{field:t.getName(e)}:function(e){const{channel:t,channelDef:n,scaleName:i,stack:r,offset:o,markDef:a}=e;if(Pa(n)&&r&&t===r.fieldChannel){if(Fa(n)){let e=n.bandPosition;if(void 0!==e||"text"!==a.type||"radius"!==t&&"theta"!==t||(e=.5),void 0!==e)return Zo({scaleName:i,fieldOrDatumDef:n,startSuffix:"start",bandPosition:e,offset:o})}return Ko(n,i,{suffix:"end"},{offset:o})}return Go(e)}({channel:e,channelDef:l,channel2Def:u,markDef:o,config:a,scaleName:c,scale:f,stack:s,offset:d,defaultRef:p,bandPosition:"encoding"===h?0:void 0});return m?{[i||e]:m}:void 0}function Jc({model:e,defaultPos:t,channel:n,scaleName:i,scale:r}){const{markDef:o,config:a}=e;return()=>{const s=It(n),l=qt(n),u=vi(n,o,a,{vgChannel:l});if(void 0!==u)return ea(n,u);switch(t){case"zeroOrMin":case"zeroOrMax":if(i){const e=r.get("type");if(Q([Gr.LOG,Gr.TIME,Gr.UTC],e));else if(r.domainDefinitelyIncludesZero())return{scale:i,value:0}}if("zeroOrMin"===t)return"y"===s?{field:{group:"height"}}:{value:0};switch(s){case"radius":return{signal:`min(${e.width.signal},${e.height.signal})/2`};case"theta":return{signal:"2*PI"};case"x":return{field:{group:"width"}};case"y":return{value:0}}break;case"mid":return{...e[Ht(n)],mult:.5}}}}const Gc={left:"x",center:"xc",right:"x2"},Vc={top:"y",middle:"yc",bottom:"y2"};function Yc(e,t,n,i="middle"){if("radius"===e||"theta"===e)return qt(e);const r="x"===e?"align":"baseline",o=vi(r,t,n);let a;return ri(o)?(or(function(e){return`The ${e} for range marks cannot be an expression`}(r)),a=void 0):a=o,"x"===e?Gc[a||("top"===i?"left":"center")]:Vc[a||i]}function Kc(e,t,{defaultPos:n,defaultPos2:i,range:r}){return r?Zc(e,t,{defaultPos:n,defaultPos2:i}):Xc(e,t,{defaultPos:n})}function Zc(e,t,{defaultPos:n,defaultPos2:i}){const{markDef:r,config:o}=t,a=Wt(e),s=Ht(e),l=function(e,t,n){const{encoding:i,mark:r,markDef:o,stack:a,config:s}=e,l=It(n),u=Ht(n),c=qt(n),f=i[l],d=e.scaleName(l),h=e.getScaleComponent(l),{offset:p}=Hc(n in i||n in o?{channel:n,markDef:o,encoding:i,model:e}:{channel:l,markDef:o,encoding:i,model:e});if(!f&&("x2"===n||"y2"===n)&&(i.latitude||i.longitude)){const t=Ht(n),i=e.markDef[t];return null!=i?{[t]:{value:i}}:{[c]:{field:e.getName(n)}}}const m=function({channel:e,channelDef:t,channel2Def:n,markDef:i,config:r,scaleName:o,scale:a,stack:s,offset:l,defaultRef:u}){if(Pa(t)&&s&&e.charAt(0)===s.fieldChannel.charAt(0))return Ko(t,o,{suffix:"start"},{offset:l});return Go({channel:e,channelDef:n,scaleName:o,scale:a,stack:s,markDef:i,config:r,offset:l,defaultRef:u})}({channel:n,channelDef:f,channel2Def:i[n],markDef:o,config:s,scaleName:d,scale:h,stack:a,offset:p,defaultRef:void 0});if(void 0!==m)return{[c]:m};return Qc(n,o)||Qc(n,{[n]:xi(n,o,s.style),[u]:xi(u,o,s.style)})||Qc(n,s[r])||Qc(n,s.mark)||{[c]:Jc({model:e,defaultPos:t,channel:n,scaleName:d,scale:h})()}}(t,i,a);return{...Xc(e,t,{defaultPos:n,vgChannel:l[s]?Yc(e,r,o):qt(e)}),...l}}function Qc(e,t){const n=Ht(e),i=qt(e);if(void 0!==t[i])return{[i]:ea(e,t[i])};if(void 0!==t[e])return{[i]:ea(e,t[e])};if(t[n]){const i=t[n];if(!Wo(i))return{[n]:ea(e,i)};or(function(e){return`Position range does not support relative band size for ${e}.`}(n))}}function ef(e,t){const{config:n,encoding:i,markDef:r}=e,o=r.type,a=Wt(t),s=Ht(t),l=i[t],u=i[a],c=e.getScaleComponent(t),f=c?c.get("type"):void 0,d=r.orient,h=i[s]??i.size??vi("size",r,n,{vgChannel:s}),p=Xt(t),m="bar"===o&&("x"===t?"vertical"===d:"horizontal"===d);return!Fa(l)||!(Vn(l.bin)||Yn(l.bin)||l.timeUnit&&!u)||h&&!Wo(h)||i[p]||oo(f)?(Pa(l)&&oo(f)||m)&&!u?function(e,t,n){const{markDef:i,encoding:r,config:o,stack:a}=n,s=i.orient,l=n.scaleName(t),u=n.getScaleComponent(t),c=Ht(t),f=Wt(t),d=Xt(t),h=n.scaleName(d),p=n.getScaleComponent(Jt(t)),m="horizontal"===s&&"y"===t||"vertical"===s&&"x"===t;let g;(r.size||i.size)&&(m?g=Ic("size",n,{vgChannel:c,defaultRef:hi(i.size)}):or(function(e){return`Cannot apply size to non-oriented mark "${e}".`}(i.type)));const y=!!g,v=Da({channel:t,fieldDef:e,markDef:i,config:o,scaleType:(u||p)?.get("type"),useVlSizeChannel:m});g=g||{[c]:tf(c,h||l,p||u,o,v,!!e,i.type)};const b="band"===(u||p)?.get("type")&&Wo(v)&&!y?"top":"middle",x=Yc(t,i,o,b),_="xc"===x||"yc"===x,{offset:w,offsetType:k}=Hc({channel:t,markDef:i,encoding:r,model:n,bandPosition:_?.5:0}),E=Go({channel:t,channelDef:e,markDef:i,config:o,scaleName:l,scale:u,stack:a,offset:w,defaultRef:Jc({model:n,defaultPos:"mid",channel:t,scaleName:l,scale:u}),bandPosition:_?"encoding"===k?0:.5:ri(v)?{signal:`(1-${v})/2`}:Wo(v)?(1-v.band)/2:0});if(c)return{[x]:E,...g};{const e=qt(f),t=g[c],n=w?{...t,offset:w}:t;return{[x]:E,[e]:(0,j.kJ)(E)?[E[0],{...E[1],offset:n}]:{...E,offset:n}}}}(l,t,e):Zc(t,e,{defaultPos:"zeroOrMax",defaultPos2:"zeroOrMin"}):function({fieldDef:e,fieldDef2:t,channel:n,model:i}){const{config:r,markDef:o,encoding:a}=i,s=i.getScaleComponent(n),l=i.scaleName(n),u=s?s.get("type"):void 0,c=s.get("reverse"),f=Da({channel:n,fieldDef:e,markDef:o,config:r,scaleType:u}),d=i.component.axes[n]?.[0],h=d?.get("translate")??.5,p=mn(n)?vi("binSpacing",o,r)??0:0,m=Wt(n),g=qt(n),y=qt(m),v=bi("minBandSize",o,r),{offset:b}=Hc({channel:n,markDef:o,encoding:a,model:i,bandPosition:0}),{offset:x}=Hc({channel:m,markDef:o,encoding:a,model:i,bandPosition:0}),_=function({scaleName:e,fieldDef:t}){const n=Ha(t,{expr:"datum"});return`abs(scale("${e}", ${Ha(t,{expr:"datum",suffix:"end"})}) - scale("${e}", ${n}))`}({fieldDef:e,scaleName:l}),w=nf(n,p,c,h,b,v,_),k=nf(m,p,c,h,x??b,v,_),E=ri(f)?{signal:`(1-${f.signal})/2`}:Wo(f)?(1-f.band)/2:.5,D=Ea({fieldDef:e,fieldDef2:t,markDef:o,config:r});if(Vn(e.bin)||e.timeUnit){const t=e.timeUnit&&.5!==D;return{[y]:rf({fieldDef:e,scaleName:l,bandPosition:E,offset:k,useRectOffsetField:t}),[g]:rf({fieldDef:e,scaleName:l,bandPosition:ri(E)?{signal:`1-${E.signal}`}:1-E,offset:w,useRectOffsetField:t})}}if(Yn(e.bin)){const n=Ko(e,l,{},{offset:k});if(Fa(t))return{[y]:n,[g]:Ko(t,l,{},{offset:w})};if(Kn(e.bin)&&e.bin.step)return{[y]:n,[g]:{signal:`scale("${l}", ${Ha(e,{expr:"datum"})} + ${e.bin.step})`,offset:w}}}return void or(tr(m))}({fieldDef:l,fieldDef2:u,channel:t,model:e})}function tf(e,t,n,i,r,o,a){if(Wo(r)){if(!n)return{mult:r.band,field:{group:e}};{const e=n.get("type");if("band"===e){let e=`bandwidth('${t}')`;1!==r.band&&(e=`${r.band} * ${e}`);const n=bi("minBandSize",{type:a},i);return{signal:n?`max(${mi(n)}, ${e})`:e}}1!==r.band&&(or(function(e){return`Cannot use the relative band size with ${e} scale.`}(e)),r=void 0)}}else{if(ri(r))return r;if(r)return{value:r}}if(n){const e=n.get("range");if(oi(e)&&(0,j.hj)(e.step))return{value:e.step-2}}if(!o){const{bandPaddingInner:t,barBandPaddingInner:n,rectBandPaddingInner:r}=i.scale,o=$e(t,"bar"===a?n:r);if(ri(o))return{signal:`(1 - (${o.signal})) * ${e}`};if((0,j.hj)(o))return{signal:`${1-o} * ${e}`}}return{value:_l(i.view,e)-2}}function nf(e,t,n,i,r,o,a){if(xt(e))return 0;const s="x"===e||"y2"===e,l=s?-t/2:t/2;if(ri(n)||ri(r)||ri(i)||o){const e=mi(n),t=mi(r),u=mi(i),c=mi(o),f=o?`(${a} < ${c} ? ${s?"":"-"}0.5 * (${c} - (${a})) : ${l})`:l;return{signal:(u?`${u} + `:"")+(e?`(${e} ? -1 : 1) * `:"")+(t?`(${t} + ${f})`:f)}}return r=r||0,i+(n?-r-l:+r+l)}function rf({fieldDef:e,scaleName:t,bandPosition:n,offset:i,useRectOffsetField:r}){return Zo({scaleName:t,fieldOrDatumDef:e,bandPosition:n,offset:i,...r?{startSuffix:dc,endSuffix:hc}:{}})}const of=new Set(["aria","width","height"]);function af(e,t){const{fill:n,stroke:i}="include"===t.color?qc(e):{};return{...lf(e.markDef,t),...sf(e,"fill",n),...sf(e,"stroke",i),...Ic("opacity",e),...Ic("fillOpacity",e),...Ic("strokeOpacity",e),...Ic("strokeWidth",e),...Ic("strokeDash",e),...Wc(e),...Rc(e),...Nc(e,"href"),...Uc(e)}}function sf(e,t,n){const{config:i,mark:r,markDef:o}=e;if("hide"===vi("invalid",o,i)&&n&&!Po(r)){const i=function(e,{invalid:t=!1,channels:n}){const i=n.reduce(((t,n)=>{const i=e.getScaleComponent(n);if(i){const r=i.get("type"),o=e.vgField(n,{expr:"datum"});o&&ao(r)&&(t[o]=!0)}return t}),{}),r=fe(i);if(r.length>0){const e=t?"||":"&&";return r.map((e=>Yo(e,t))).join(` ${e} `)}return}(e,{invalid:!0,channels:On});if(i)return{[t]:[{test:i,value:null},...(0,j.IX)(n)]}}return n?{[t]:n}:{}}function lf(e,t){return si.reduce(((n,i)=>(of.has(i)||void 0===e[i]||"ignore"===t[i]||(n[i]=hi(e[i])),n)),{})}function uf(e){const{config:t,markDef:n}=e;if(vi("invalid",n,t)){const t=function(e,{invalid:t=!1,channels:n}){const i=n.reduce(((t,n)=>{const i=e.getScaleComponent(n);if(i){const r=i.get("type"),o=e.vgField(n,{expr:"datum",binSuffix:e.stack?.impute?"mid":void 0});o&&ao(r)&&(t[o]=!0)}return t}),{}),r=fe(i);if(r.length>0){const e=t?"||":"&&";return r.map((e=>Yo(e,t))).join(` ${e} `)}return}(e,{channels:pn});if(t)return{defined:{signal:t}}}return{}}function cf(e,t){if(void 0!==t)return{[e]:hi(t)}}const ff="voronoi",df={defined:e=>"point"===e.type&&e.nearest,parse:(e,t)=>{if(t.events)for(const n of t.events)n.markname=e.getName(ff)},marks:(e,t,n)=>{const{x:i,y:r}=t.project.hasChannel,o=e.mark;if(Po(o))return or(`The "nearest" transform is not supported for ${o} marks.`),n;const a={name:e.getName(ff),type:"path",interactive:!0,from:{data:e.getName("marks")},encode:{update:{fill:{value:"transparent"},strokeWidth:{value:.35},stroke:{value:"transparent"},isVoronoi:{value:!0},...Rc(e,{reactiveGeom:!0})}},transform:[{type:"voronoi",x:{expr:i||!r?"datum.datum.x || 0":"0"},y:{expr:r||!i?"datum.datum.y || 0":"0"},size:[e.getSizeSignalRef("width"),e.getSizeSignalRef("height")]}]};let s=0,l=!1;return n.forEach(((t,n)=>{const i=t.name??"";i===e.component.mark[0].name?s=n:i.indexOf(ff)>=0&&(l=!0)})),l||n.splice(s+1,0,a),n}},hf=df,pf={defined:e=>"point"===e.type&&"global"===e.resolve&&e.bind&&"scales"!==e.bind&&!ul(e.bind),parse:(e,t,n)=>zf(t,n),topLevelSignals:(e,t,n)=>{const i=t.name,r=t.project,o=t.bind,a=t.init&&t.init[0],s=hf.defined(t)?"(item().isVoronoi ? datum.datum : datum)":"datum";return r.items.forEach(((e,r)=>{const l=me(`${i}_${e.field}`);n.filter((e=>e.name===l)).length||n.unshift({name:l,...a?{init:nc(a[r])}:{value:null},on:t.events?[{events:t.events,update:`datum && item().mark.marktype !== 'group' ? ${s}[${(0,j.m8)(e.field)}] : null`}]:[],bind:o[e.field]??o[e.channel]??o})})),n},signals:(e,t,n)=>{const i=t.name,r=t.project,o=n.filter((e=>e.name===i+Mf))[0],a=i+yc,s=r.items.map((e=>me(`${i}_${e.field}`))),l=s.map((e=>`${e} !== null`)).join(" && ");return s.length&&(o.update=`${l} ? {fields: ${a}, values: [${s.join(", ")}]} : null`),delete o.value,delete o.on,n}},mf=pf,gf="_toggle",yf={defined:e=>"point"===e.type&&!!e.toggle,signals:(e,t,n)=>n.concat({name:t.name+gf,value:!1,on:[{events:t.events,update:t.toggle}]}),modifyExpr:(e,t)=>{const n=t.name+Mf,i=t.name+gf;return`${i} ? null : ${n}, `+("global"===t.resolve?`${i} ? null : true, `:`${i} ? null : {unit: ${Tf(e)}}, `)+`${i} ? ${n} : null`}},vf={defined:e=>void 0!==e.clear&&!1!==e.clear,parse:(e,t)=>{t.clear&&(t.clear=(0,j.HD)(t.clear)?(0,ec.r)(t.clear,"view"):t.clear)},topLevelSignals:(e,t,n)=>{if(mf.defined(t))for(const i of t.project.items){const e=n.findIndex((e=>e.name===me(`${t.name}_${i.field}`)));-1!==e&&n[e].on.push({events:t.clear,update:"null"})}return n},signals:(e,t,n)=>{function i(e,i){-1!==e&&n[e].on&&n[e].on.push({events:t.clear,update:i})}if("interval"===t.type)for(const r of t.project.items){const e=n.findIndex((e=>e.name===r.signals.visual));if(i(e,"[0, 0]"),-1===e){i(n.findIndex((e=>e.name===r.signals.data)),"null")}}else{let e=n.findIndex((e=>e.name===t.name+Mf));i(e,"null"),yf.defined(t)&&(e=n.findIndex((e=>e.name===t.name+gf)),i(e,"false"))}return n}},bf={defined:e=>{const t="global"===e.resolve&&e.bind&&ul(e.bind),n=1===e.project.items.length&&e.project.items[0].field!==sl;return t&&!n&&or("Legend bindings are only supported for selections over an individual field or encoding channel."),t&&n},parse:(e,t,n)=>{const i=J(n);if(i.select=(0,j.HD)(i.select)?{type:i.select,toggle:t.toggle}:{...i.select,toggle:t.toggle},zf(t,i),(0,U.isObject)(n.select)&&(n.select.on||n.select.clear)){const e='event.item && indexof(event.item.mark.role, "legend") < 0';for(const n of t.events)n.filter=(0,j.IX)(n.filter??[]),n.filter.includes(e)||n.filter.push(e)}const r=cl(t.bind)?t.bind.legend:"click",o=(0,j.HD)(r)?(0,ec.r)(r,"view"):(0,j.IX)(r);t.bind={legend:{merge:o}}},topLevelSignals:(e,t,n)=>{const i=t.name,r=cl(t.bind)&&t.bind.legend,o=e=>t=>{const n=J(t);return n.markname=e,n};for(const a of t.project.items){if(!a.hasLegend)continue;const e=`${me(a.field)}_legend`,s=`${i}_${e}`;if(0===n.filter((e=>e.name===s)).length){const i=r.merge.map(o(`${e}_symbols`)).concat(r.merge.map(o(`${e}_labels`))).concat(r.merge.map(o(`${e}_entries`)));n.unshift({name:s,...t.init?{}:{value:null},on:[{events:i,update:"isDefined(datum.value) ? datum.value : item().items[0].items[0].datum.value",force:!0},{events:r.merge,update:`!event.item || !datum ? null : ${s}`,force:!0}]})}}return n},signals:(e,t,n)=>{const i=t.name,r=t.project,o=n.find((e=>e.name===i+Mf)),a=i+yc,s=r.items.filter((e=>e.hasLegend)).map((e=>me(`${i}_${me(e.field)}_legend`))),l=`${s.map((e=>`${e} !== null`)).join(" && ")} ? {fields: ${a}, values: [${s.join(", ")}]} : null`;t.events&&s.length>0?o.on.push({events:s.map((e=>({signal:e}))),update:l}):s.length>0&&(o.update=l,delete o.value,delete o.on);const u=n.find((e=>e.name===i+gf)),c=cl(t.bind)&&t.bind.legend;return u&&(t.events?u.on.push({...u.on[0],events:c}):u.on[0].events=c),n}};const xf="_translate_anchor",_f="_translate_delta",wf={defined:e=>"interval"===e.type&&e.translate,signals:(e,t,n)=>{const i=t.name,r=wc.defined(t),o=i+xf,{x:a,y:s}=t.project.hasChannel;let l=(0,ec.r)(t.translate,"scope");return r||(l=l.map((e=>(e.between[0].markname=i+Dc,e)))),n.push({name:o,value:{},on:[{events:l.map((e=>e.between[0])),update:"{x: x(unit), y: y(unit)"+(void 0!==a?`, extent_x: ${r?kc(e,Be):`slice(${a.signals.visual})`}`:"")+(void 0!==s?`, extent_y: ${r?kc(e,je):`slice(${s.signals.visual})`}`:"")+"}"}]},{name:i+_f,value:{},on:[{events:l,update:`{x: ${o}.x - x(unit), y: ${o}.y - y(unit)}`}]}),void 0!==a&&kf(e,t,a,"width",n),void 0!==s&&kf(e,t,s,"height",n),n}};function kf(e,t,n,i,r){const o=t.name,a=o+xf,s=o+_f,l=n.channel,u=wc.defined(t),c=r.filter((e=>e.name===n.signals[u?"data":"visual"]))[0],f=e.getSizeSignalRef(i).signal,d=e.getScaleComponent(l),h=d&&d.get("type"),p=d&&d.get("reverse"),m=`${a}.extent_${l}`,g=`${u&&d?"log"===h?"panLog":"symlog"===h?"panSymlog":"pow"===h?"panPow":"panLinear":"panLinear"}(${m}, ${`${u?l===Be?p?"":"-":p?"-":"":""}${s}.${l} / ${u?`${f}`:`span(${m})`}`}${u?"pow"===h?`, ${d.get("exponent")??1}`:"symlog"===h?`, ${d.get("constant")??1}`:"":""})`;c.on.push({events:{signal:s},update:u?g:`clampRange(${g}, 0, ${f})`})}const Ef="_zoom_anchor",Df="_zoom_delta",$f={defined:e=>"interval"===e.type&&e.zoom,signals:(e,t,n)=>{const i=t.name,r=wc.defined(t),o=i+Df,{x:a,y:s}=t.project.hasChannel,l=(0,j.m8)(e.scaleName(Be)),u=(0,j.m8)(e.scaleName(je));let c=(0,ec.r)(t.zoom,"scope");return r||(c=c.map((e=>(e.markname=i+Dc,e)))),n.push({name:i+Ef,on:[{events:c,update:r?"{"+[l?`x: invert(${l}, x(unit))`:"",u?`y: invert(${u}, y(unit))`:""].filter((e=>e)).join(", ")+"}":"{x: x(unit), y: y(unit)}"}]},{name:o,on:[{events:c,force:!0,update:"pow(1.001, event.deltaY * pow(16, event.deltaMode))"}]}),void 0!==a&&Af(e,t,a,"width",n),void 0!==s&&Af(e,t,s,"height",n),n}};function Af(e,t,n,i,r){const o=t.name,a=n.channel,s=wc.defined(t),l=r.filter((e=>e.name===n.signals[s?"data":"visual"]))[0],u=e.getSizeSignalRef(i).signal,c=e.getScaleComponent(a),f=c&&c.get("type"),d=s?kc(e,a):l.name,h=o+Df,p=`${s&&c?"log"===f?"zoomLog":"symlog"===f?"zoomSymlog":"pow"===f?"zoomPow":"zoomLinear":"zoomLinear"}(${d}, ${`${o}${Ef}.${a}`}, ${h}${s?"pow"===f?`, ${c.get("exponent")??1}`:"symlog"===f?`, ${c.get("constant")??1}`:"":""})`;l.on.push({events:{signal:h},update:s?p:`clampRange(${p}, 0, ${u})`})}const Sf="_store",Mf="_tuple",Cf="_modify",Ff="vlSelectionResolve",Of=[Oc,Cc,xc,yf,mf,wc,bf,vf,wf,$f,hf];function Tf(e,{escape:t}={escape:!0}){let n=t?(0,j.m8)(e.name):e.name;const i=function(e){let t=e.parent;for(;t&&!xp(t);)t=t.parent;return t}(e);if(i){const{facet:e}=i;for(const t of St)e[t]&&(n+=` + '__facet_${t}_' + (facet[${(0,j.m8)(i.vgField(t))}])`)}return n}function Nf(e){return de(e.component.selection??{}).reduce(((e,t)=>e||t.project.hasSelectionId),!1)}function zf(e,t){!(0,U.isString)(t.select)&&t.select.on||delete e.events,!(0,U.isString)(t.select)&&t.select.clear||delete e.clear,!(0,U.isString)(t.select)&&t.select.toggle||delete e.toggle}var Rf=n(82806);function Pf(e){const t=[];return"Identifier"===e.type?[e.name]:"Literal"===e.type?[e.value]:("MemberExpression"===e.type&&(t.push(...Pf(e.object)),t.push(...Pf(e.property))),t)}function Lf(e){return"MemberExpression"===e.object.type?Lf(e.object):"datum"===e.object.name}function Uf(e){const t=(0,Rf.BJ)(e),n=new Set;return t.visit((e=>{"MemberExpression"===e.type&&Lf(e)&&n.add(Pf(e).slice(1).join("."))})),n}class Bf extends sc{clone(){return new Bf(null,this.model,J(this.filter))}constructor(e,t,n){super(e),this.model=t,this.filter=n,this.expr=qf(this.model,this.filter,this),this._dependentFields=Uf(this.expr)}dependentFields(){return this._dependentFields}producedFields(){return new Set}assemble(){return{type:"filter",expr:this.expr}}hash(){return`Filter ${this.expr}`}}function jf(e,t,n,i="datum"){const r=(0,j.HD)(t)?t:t.param,o=me(r),a=(0,j.m8)(o+Sf);let s;try{s=e.getSelectionComponent(o,r)}catch(c){return`!!${o}`}if(s.project.timeUnit){const t=n??e.component.data.raw,i=s.project.timeUnit.clone();t.parent?i.insertAsParentOf(t):t.parent=i}const l=`${s.project.hasSelectionId?"vlSelectionIdTest(":"vlSelectionTest("}${a}, ${i}${"global"===s.resolve?")":`, ${(0,j.m8)(s.resolve)})`}`,u=`length(data(${a}))`;return!1===t.empty?`${u} && ${l}`:`!${u} || ${l}`}function If(e,t,n){const i=me(t),r=n.encoding;let o,a=n.field;try{o=e.getSelectionComponent(i,t)}catch(s){return i}if(r||a){if(r&&!a){const e=o.project.items.filter((e=>e.channel===r));!e.length||e.length>1?(a=o.project.items[0].field,or((e.length?"Multiple ":"No ")+`matching ${(0,j.m8)(r)} encoding found for selection ${(0,j.m8)(n.param)}. `+`Using "field": ${(0,j.m8)(a)}.`)):a=e[0].field}}else a=o.project.items[0].field,o.project.items.length>1&&or(`A "field" or "encoding" must be specified when using a selection as a scale domain. Using "field": ${(0,j.m8)(a)}.`);return`${o.name}[${(0,j.m8)(we(a))}]`}function qf(e,t,n){return ge(t,(t=>(0,j.HD)(t)?t:function(e){return e?.param}(t)?jf(e,t,n):Pr(t)))}function Wf(e,t,n,i){var r,o;e.encode??(e.encode={}),(r=e.encode)[t]??(r[t]={}),(o=e.encode[t]).update??(o.update={}),e.encode[t].update[n]=i}function Hf(e,t,n,i={header:!1}){const{disable:r,orient:o,scale:a,labelExpr:s,title:l,zindex:u,...c}=e.combine();if(!r){for(const e in c){const n=ps[e],i=c[e];if(n&&n!==t&&"both"!==n)delete c[e];else if(ds(i)){const{condition:t,...n}=i,r=(0,j.IX)(t),o=fs[e];if(o){const{vgProp:t,part:i}=o;Wf(c,i,t,[...r.map((e=>{const{test:t,...n}=e;return{test:qf(null,t),...n}})),n]),delete c[e]}else if(null===o){const t={signal:r.map((e=>{const{test:t,...n}=e;return`${qf(null,t)} ? ${pi(n)} : `})).join("")+pi(n)};c[e]=t}}else if(ri(i)){const t=fs[e];if(t){const{vgProp:n,part:r}=t;Wf(c,r,n,i),delete c[e]}}Q(["labelAlign","labelBaseline"],e)&&null===c[e]&&delete c[e]}if("grid"===t){if(!c.grid)return;if(c.encode){const{grid:e}=c.encode;c.encode={...e?{grid:e}:{}},ce(c.encode)&&delete c.encode}return{scale:a,orient:o,...c,domain:!1,labels:!1,aria:!1,maxExtent:0,minExtent:0,ticks:!1,zindex:$e(u,0)}}{if(!i.header&&e.mainExtracted)return;if(void 0!==s){let e=s;c.encode?.labels?.update&&ri(c.encode.labels.update.text)&&(e=ke(s,"datum.label",c.encode.labels.update.text.signal)),Wf(c,"labels","text",{signal:e})}if(null===c.labelAlign&&delete c.labelAlign,c.encode){for(const t of hs)e.hasAxisPart(t)||delete c.encode[t];ce(c.encode)&&delete c.encode}const t=function(e,t){if(e)return(0,j.kJ)(e)&&!ii(e)?e.map((e=>Za(e,t))).join(", "):e}(l,n);return{scale:a,orient:o,grid:!1,...t?{title:t}:{},...c,...!1===n.aria?{aria:!1}:{},zindex:$e(u,0)}}}}function Xf(e){const{axes:t}=e.component,n=[];for(const i of pn)if(t[i])for(const r of t[i])if(!r.get("disable")&&!r.get("gridScale")){const t="x"===i?"height":"width",r=e.getSizeSignalRef(t).signal;t!==r&&n.push({name:t,update:r})}return n}function Jf(e,t,n,i){return Object.assign.apply(null,[{},...e.map((e=>{if("axisOrient"===e){const e="x"===n?"bottom":"left",r=t["x"===n?"axisBottom":"axisLeft"]||{},o=t["x"===n?"axisTop":"axisRight"]||{},a=new Set([...fe(r),...fe(o)]),s={};for(const t of a.values())s[t]={signal:`${i.signal} === "${e}" ? ${mi(r[t])} : ${mi(o[t])}`};return s}return t[e]}))])}function Gf(e,t){const n=[{}];for(const i of e){let e=t[i]?.style;if(e){e=(0,j.IX)(e);for(const i of e)n.push(t.style[i])}}return Object.assign.apply(null,n)}function Vf(e,t,n,i={}){const r=_i(e,n,t);if(void 0!==r)return{configFrom:"style",configValue:r};for(const o of["vlOnlyAxisConfig","vgAxisConfig","axisConfigStyle"])if(void 0!==i[o]?.[e])return{configFrom:o,configValue:i[o][e]};return{}}const Yf={scale:({model:e,channel:t})=>e.scaleName(t),format:({format:e})=>e,formatType:({formatType:e})=>e,grid:({fieldOrDatumDef:e,axis:t,scaleType:n})=>t.grid??function(e,t){return!oo(e)&&Fa(t)&&!Vn(t?.bin)&&!Yn(t?.bin)}(n,e),gridScale:({model:e,channel:t})=>function(e,t){const n="x"===t?"y":"x";if(e.getScaleComponent(n))return e.scaleName(n);return}(e,t),labelAlign:({axis:e,labelAngle:t,orient:n,channel:i})=>e.labelAlign||Qf(t,n,i),labelAngle:({labelAngle:e})=>e,labelBaseline:({axis:e,labelAngle:t,orient:n,channel:i})=>e.labelBaseline||Zf(t,n,i),labelFlush:({axis:e,fieldOrDatumDef:t,channel:n})=>e.labelFlush??function(e,t){if("x"===t&&Q(["quantitative","temporal"],e))return!0;return}(t.type,n),labelOverlap:({axis:e,fieldOrDatumDef:t,scaleType:n})=>e.labelOverlap??function(e,t,n,i){if(n&&!(0,j.Kn)(i)||"nominal"!==e&&"ordinal"!==e)return"log"!==t&&"symlog"!==t||"greedy";return}(t.type,n,Fa(t)&&!!t.timeUnit,Fa(t)?t.sort:void 0),orient:({orient:e})=>e,tickCount:({channel:e,model:t,axis:n,fieldOrDatumDef:i,scaleType:r})=>{const o="x"===e?"width":"y"===e?"height":void 0,a=o?t.getSizeSignalRef(o):void 0;return n.tickCount??function({fieldOrDatumDef:e,scaleType:t,size:n,values:i}){if(!i&&!oo(t)&&"log"!==t){if(Fa(e)){if(Vn(e.bin))return{signal:`ceil(${n.signal}/10)`};if(e.timeUnit&&Q(["month","hours","day","quarter"],Er(e.timeUnit)?.unit))return}return{signal:`ceil(${n.signal}/40)`}}return}({fieldOrDatumDef:i,scaleType:r,size:a,values:n.values})},tickMinStep:function({format:e,fieldOrDatumDef:t}){if("d"===e)return 1;if(Fa(t)){const{timeUnit:e}=t;if(e){const t=Dr(e);if(t)return{signal:t}}}return},title:({axis:e,model:t,channel:n})=>{if(void 0!==e.title)return e.title;const i=ed(t,n);if(void 0!==i)return i;const r=t.typedFieldDef(n),o="x"===n?"x2":"y2",a=t.fieldDef(o);return ki(r?[wa(r)]:[],Fa(a)?[wa(a)]:[])},values:({axis:e,fieldOrDatumDef:t})=>function(e,t){const n=e.values;if((0,j.kJ)(n))return us(t,n);if(ri(n))return n;return}(e,t),zindex:({axis:e,fieldOrDatumDef:t,mark:n})=>e.zindex??function(e,t){if("rect"===e&&Xa(t))return 1;return 0}(n,t)};function Kf(e){return`(((${e.signal} % 360) + 360) % 360)`}function Zf(e,t,n,i){if(void 0!==e){if("x"===n){if(ri(e)){const n=Kf(e);return{signal:`(45 < ${n} && ${n} < 135) || (225 < ${n} && ${n} < 315) ? "middle" :(${n} <= 45 || 315 <= ${n}) === ${ri(t)?`(${t.signal} === "top")`:"top"===t} ? "bottom" : "top"`}}if(45<e&&e<135||225<e&&e<315)return"middle";if(ri(t)){const n=e<=45||315<=e?"===":"!==";return{signal:`${t.signal} ${n} "top" ? "bottom" : "top"`}}return(e<=45||315<=e)===("top"===t)?"bottom":"top"}if(ri(e)){const n=Kf(e);return{signal:`${n} <= 45 || 315 <= ${n} || (135 <= ${n} && ${n} <= 225) ? ${i?'"middle"':"null"} : (45 <= ${n} && ${n} <= 135) === ${ri(t)?`(${t.signal} === "left")`:"left"===t} ? "top" : "bottom"`}}if(e<=45||315<=e||135<=e&&e<=225)return i?"middle":null;if(ri(t)){const n=45<=e&&e<=135?"===":"!==";return{signal:`${t.signal} ${n} "left" ? "top" : "bottom"`}}return(45<=e&&e<=135)===("left"===t)?"top":"bottom"}}function Qf(e,t,n){if(void 0===e)return;const i="x"===n,r=i?0:90,o=i?"bottom":"left";if(ri(e)){const n=Kf(e);return{signal:`(${r?`(${n} + 90)`:n} % 180 === 0) ? ${i?null:'"center"'} :(${r} < ${n} && ${n} < ${180+r}) === ${ri(t)?`(${t.signal} === "${o}")`:t===o} ? "left" : "right"`}}if((e+r)%180===0)return i?null:"center";if(ri(t)){const n=r<e&&e<180+r?"===":"!==";return{signal:`${`${t.signal} ${n} "${o}"`} ? "left" : "right"`}}return(r<e&&e<180+r)===(t===o)?"left":"right"}function ed(e,t){const n="x"===t?"x2":"y2",i=e.fieldDef(t),r=e.fieldDef(n),o=i?i.title:void 0,a=r?r.title:void 0;return o&&a?Ei(o,a):o||(a||(void 0!==o?o:void 0!==a?a:void 0))}class td extends sc{clone(){return new td(null,J(this.transform))}constructor(e,t){super(e),this.transform=t,this._dependentFields=Uf(this.transform.calculate)}static parseAllForSortIndex(e,t){return t.forEachFieldDef(((t,n)=>{if(Ba(t)&&va(t.sort)){const{field:i,timeUnit:r}=t,o=t.sort,a=o.map(((e,t)=>`${Pr({field:i,timeUnit:r,equal:e})} ? ${t} : `)).join("")+o.length;e=new td(e,{calculate:a,as:nd(t,n,{forAs:!0})})}})),e}producedFields(){return new Set([this.transform.as])}dependentFields(){return this._dependentFields}assemble(){return{type:"formula",expr:this.transform.calculate,as:this.transform.as}}hash(){return`Calculate ${K(this.transform)}`}}function nd(e,t,n){return Ha(e,{prefix:t,suffix:"sort_index",...n??{}})}function id(e,t){return Q(["top","bottom"],t)?"column":Q(["left","right"],t)||"row"===e?"row":"column"}function rd(e,t,n,i){const r="row"===i?n.headerRow:"column"===i?n.headerColumn:n.headerFacet;return $e((t||{})[e],r[e],n.header[e])}function od(e,t,n,i){const r={};for(const o of e){const e=rd(o,t||{},n,i);void 0!==e&&(r[o]=e)}return r}const ad=["row","column"],sd=["header","footer"];function ld(e,t){const n=e.component.layoutHeaders[t].title,i=e.config?e.config:void 0,r=e.component.layoutHeaders[t].facetFieldDef?e.component.layoutHeaders[t].facetFieldDef:void 0,{titleAnchor:o,titleAngle:a,titleOrient:s}=od(["titleAnchor","titleAngle","titleOrient"],r.header,i,t),l=id(t,s),u=Oe(a);return{name:`${t}-title`,type:"group",role:`${l}-title`,title:{text:n,..."row"===t?{orient:"left"}:{},style:"guide-title",...cd(u,l),...ud(l,u,o),...yd(i,r,t,nl,el)}}}function ud(e,t,n="middle"){switch(n){case"start":return{align:"left"};case"end":return{align:"right"}}const i=Qf(t,"row"===e?"left":"top","row"===e?"y":"x");return i?{align:i}:{}}function cd(e,t){const n=Zf(e,"row"===t?"left":"top","row"===t?"y":"x",!0);return n?{baseline:n}:{}}function fd(e,t){const n=e.component.layoutHeaders[t],i=[];for(const r of sd)if(n[r])for(const o of n[r]){const a=pd(e,t,r,n,o);null!=a&&i.push(a)}return i}function dd(e,t){const{sort:n}=e;return ya(n)?{field:Ha(n,{expr:"datum"}),order:n.order??"ascending"}:(0,j.kJ)(n)?{field:nd(e,t,{expr:"datum"}),order:"ascending"}:{field:Ha(e,{expr:"datum"}),order:n??"ascending"}}function hd(e,t,n){const{format:i,formatType:r,labelAngle:o,labelAnchor:a,labelOrient:s,labelExpr:l}=od(["format","formatType","labelAngle","labelAnchor","labelOrient","labelExpr"],e.header,n,t),u=ra({fieldOrDatumDef:e,format:i,formatType:r,expr:"parent",config:n}).signal,c=id(t,s);return{text:{signal:l?ke(ke(l,"datum.label",u),"datum.value",Ha(e,{expr:"parent"})):u},..."row"===t?{orient:"left"}:{},style:"guide-label",frame:"group",...cd(o,c),...ud(c,o,a),...yd(n,e,t,il,tl)}}function pd(e,t,n,i,r){if(r){let o=null;const{facetFieldDef:a}=i,s=e.config?e.config:void 0;if(a&&r.labels){const{labelOrient:e}=od(["labelOrient"],a.header,s,t);("row"===t&&!Q(["top","bottom"],e)||"column"===t&&!Q(["left","right"],e))&&(o=hd(a,t,s))}const l=xp(e)&&!ba(e.facet),u=r.axes,c=u?.length>0;if(o||c){const s="row"===t?"height":"width";return{name:e.getName(`${t}_${n}`),type:"group",role:`${t}-${n}`,...i.facetFieldDef?{from:{data:e.getName(`${t}_domain`)},sort:dd(a,t)}:{},...c&&l?{from:{data:e.getName(`facet_domain_${t}`)}}:{},...o?{title:o}:{},...r.sizeSignal?{encode:{update:{[s]:r.sizeSignal}}}:{},...c?{axes:u}:{}}}}return null}const md={column:{start:0,end:1},row:{start:1,end:0}};function gd(e,t){return md[t][e]}function yd(e,t,n,i,r){const o={};for(const a of i){if(!r[a])continue;const i=rd(a,t?.header,e,n);void 0!==i&&(o[r[a]]=i)}return o}function vd(e){return[...bd(e,"width"),...bd(e,"height"),...bd(e,"childWidth"),...bd(e,"childHeight")]}function bd(e,t){const n="width"===t?"x":"y",i=e.component.layoutSize.get(t);if(!i||"merged"===i)return[];const r=e.getSizeSignalRef(t).signal;if("step"===i){const t=e.getScaleComponent(n);if(t){const i=t.get("type"),o=t.get("range");if(oo(i)&&oi(o)){const i=e.scaleName(n);if(xp(e.parent)){if("independent"===e.parent.component.resolve.scale[n])return[xd(i,o)]}return[xd(i,o),{name:r,update:_d(i,t,`domain('${i}').length`)}]}}throw new Error("layout size is step although width/height is not step.")}if("container"==i){const t=r.endsWith("width"),n=t?"containerSize()[0]":"containerSize()[1]",i=`isFinite(${n}) ? ${n} : ${xl(e.config.view,t?"width":"height")}`;return[{name:r,init:i,on:[{update:i,events:"window:resize"}]}]}return[{name:r,value:i}]}function xd(e,t){const n=`${e}_step`;return ri(t.step)?{name:n,update:t.step.signal}:{name:n,value:t.step}}function _d(e,t,n){const i=t.get("type"),r=t.get("padding"),o=$e(t.get("paddingOuter"),r);let a=t.get("paddingInner");return a="band"===i?void 0!==a?a:r:1,`bandspace(${n}, ${mi(a)}, ${mi(o)}) * ${e}_step`}function wd(e){return"childWidth"===e?"width":"childHeight"===e?"height":e}function kd(e,t){return fe(e).reduce(((n,i)=>{const r=e[i];return{...n,...Tc(t,r,i,(e=>hi(e.value)))}}),{})}function Ed(e,t){if(xp(t))return"theta"===e?"independent":"shared";if(wp(t))return"shared";if(_p(t))return mn(e)||"theta"===e||"radius"===e?"independent":"shared";throw new Error("invalid model type for resolve")}function Dd(e,t){const n=e.scale[t],i=mn(t)?"axis":"legend";return"independent"===n?("shared"===e[i][t]&&or(function(e){return`Setting the scale to be independent for "${e}" means we also have to set the guide (axis or legend) to be independent.`}(t)),"independent"):e[i][t]||"shared"}const $d={...al,disable:1,labelExpr:1,selections:1,opacity:1,shape:1,stroke:1,fill:1,size:1,strokeWidth:1,strokeDash:1,encode:1},Ad=fe($d);class Sd extends Uu{}const Md={symbols:function(e,{fieldOrDatumDef:t,model:n,channel:i,legendCmpt:r,legendType:o}){if("symbol"!==o)return;const{markDef:a,encoding:s,config:l,mark:u}=n,c=a.filled&&"trail"!==u;let f={...gi({},n,jo),...qc(n,{filled:c})};const d=r.get("symbolOpacity")??l.legend.symbolOpacity,h=r.get("symbolFillColor")??l.legend.symbolFillColor,p=r.get("symbolStrokeColor")??l.legend.symbolStrokeColor,m=void 0===d?Cd(s.opacity)??a.opacity:void 0;if(f.fill)if("fill"===i||c&&i===et)delete f.fill;else if(f.fill.field)h?delete f.fill:(f.fill=hi(l.legend.symbolBaseFillColor??"black"),f.fillOpacity=hi(m??1));else if((0,j.kJ)(f.fill)){const e=Fd(s.fill??s.color)??a.fill??(c&&a.color);e&&(f.fill=hi(e))}if(f.stroke)if("stroke"===i||!c&&i===et)delete f.stroke;else if(f.stroke.field||p)delete f.stroke;else if((0,j.kJ)(f.stroke)){const e=$e(Fd(s.stroke||s.color),a.stroke,c?a.color:void 0);e&&(f.stroke={value:e})}if(i!==at){const e=Fa(t)&&Td(n,r,t);e?f.opacity=[{test:e,...hi(m??1)},hi(l.legend.unselectedOpacity)]:m&&(f.opacity=hi(m))}return f={...f,...e},ce(f)?void 0:f},gradient:function(e,{model:t,legendType:n,legendCmpt:i}){if("gradient"!==n)return;const{config:r,markDef:o,encoding:a}=t;let s={};const l=void 0===(i.get("gradientOpacity")??r.legend.gradientOpacity)?Cd(a.opacity)||o.opacity:void 0;l&&(s.opacity=hi(l));return s={...s,...e},ce(s)?void 0:s},labels:function(e,{fieldOrDatumDef:t,model:n,channel:i,legendCmpt:r}){const o=n.legend(i)||{},a=n.config,s=Fa(t)?Td(n,r,t):void 0,l=s?[{test:s,value:1},{value:a.legend.unselectedOpacity}]:void 0,{format:u,formatType:c}=o;let f;ta(c)?f=aa({fieldOrDatumDef:t,field:"datum.value",format:u,formatType:c,config:a}):void 0===u&&void 0===c&&a.customFormatTypes&&("quantitative"===t.type&&a.numberFormatType?f=aa({fieldOrDatumDef:t,field:"datum.value",format:a.numberFormat,formatType:a.numberFormatType,config:a}):"temporal"===t.type&&a.timeFormatType&&Fa(t)&&void 0===t.timeUnit&&(f=aa({fieldOrDatumDef:t,field:"datum.value",format:a.timeFormat,formatType:a.timeFormatType,config:a})));const d={...l?{opacity:l}:{},...f?{text:f}:{},...e};return ce(d)?void 0:d},entries:function(e,{legendCmpt:t}){const n=t.get("selections");return n?.length?{...e,fill:{value:"transparent"}}:e}};function Cd(e){return Od(e,((e,t)=>Math.max(e,t.value)))}function Fd(e){return Od(e,((e,t)=>$e(e,t.value)))}function Od(e,t){return function(e){const t=e?.condition;return!!t&&((0,j.kJ)(t)||Ua(t))}(e)?(0,j.IX)(e.condition).reduce(t,e.value):Ua(e)?e.value:void 0}function Td(e,t,n){const i=t.get("selections");if(!i?.length)return;const r=(0,j.m8)(n.field);return i.map((e=>`(!length(data(${(0,j.m8)(me(e)+Sf)})) || (${e}[${r}] && indexof(${e}[${r}], datum.value) >= 0))`)).join(" || ")}const Nd={direction:({direction:e})=>e,format:({fieldOrDatumDef:e,legend:t,config:n})=>{const{format:i,formatType:r}=t;return sa(e,e.type,i,r,n,!1)},formatType:({legend:e,fieldOrDatumDef:t,scaleType:n})=>{const{formatType:i}=e;return la(i,t,n)},gradientLength:e=>{const{legend:t,legendConfig:n}=e;return t.gradientLength??n.gradientLength??function({legendConfig:e,model:t,direction:n,orient:i,scaleType:r}){const{gradientHorizontalMaxLength:o,gradientHorizontalMinLength:a,gradientVerticalMaxLength:s,gradientVerticalMinLength:l}=e;if(so(r))return"horizontal"===n?"top"===i||"bottom"===i?Pd(t,"width",a,o):a:Pd(t,"height",l,s);return}(e)},labelOverlap:({legend:e,legendConfig:t,scaleType:n})=>e.labelOverlap??t.labelOverlap??function(e){if(Q(["quantile","threshold","log","symlog"],e))return"greedy";return}(n),symbolType:({legend:e,markDef:t,channel:n,encoding:i})=>e.symbolType??function(e,t,n,i){if("shape"!==t){const e=Fd(n)??i;if(e)return e}switch(e){case"bar":case"rect":case"image":case"square":return"square";case"line":case"trail":case"rule":return"stroke";case"arc":case"point":case"circle":case"tick":case"geoshape":case"area":case"text":return"circle"}}(t.type,n,i.shape,t.shape),title:({fieldOrDatumDef:e,config:t})=>Ya(e,t,{allowDisabling:!0}),type:({legendType:e,scaleType:t,channel:n})=>{if($t(n)&&so(t)){if("gradient"===e)return}else if("symbol"===e)return;return e},values:({fieldOrDatumDef:e,legend:t})=>function(e,t){const n=e.values;if((0,j.kJ)(n))return us(t,n);if(ri(n))return n;return}(t,e)};function zd(e){const{legend:t}=e;return $e(t.type,function({channel:e,timeUnit:t,scaleType:n}){if($t(e)){if(Q(["quarter","month","day"],t))return"symbol";if(so(n))return"gradient"}return"symbol"}(e))}function Rd({legendConfig:e,legendType:t,orient:n,legend:i}){return i.direction??e[t?"gradientDirection":"symbolDirection"]??function(e,t){switch(e){case"top":case"bottom":return"horizontal";case"left":case"right":case"none":case void 0:return;default:return"gradient"===t?"horizontal":void 0}}(n,t)}function Pd(e,t,n,i){return{signal:`clamp(${e.getSizeSignalRef(t).signal}, ${n}, ${i})`}}function Ld(e){const t=bp(e)?function(e){const{encoding:t}=e,n={};for(const i of[et,...ol]){const r=ts(t[i]);r&&e.getScaleComponent(i)&&(i===it&&Fa(r)&&r.type===Jr||(n[i]=Bd(e,i)))}return n}(e):function(e){const{legends:t,resolve:n}=e.component;for(const i of e.children){Ld(i);for(const r of fe(i.component.legends))n.legend[r]=Dd(e.component.resolve,r),"shared"===n.legend[r]&&(t[r]=jd(t[r],i.component.legends[r]),t[r]||(n.legend[r]="independent",delete t[r]))}for(const i of fe(t))for(const t of e.children)t.component.legends[i]&&"shared"===n.legend[i]&&delete t.component.legends[i];return t}(e);return e.component.legends=t,t}function Ud(e,t,n,i){switch(t){case"disable":return void 0!==n;case"values":return!!n?.values;case"title":if("title"===t&&e===i?.title)return!0}return e===(n||{})[t]}function Bd(e,t){let n=e.legend(t);const{markDef:i,encoding:r,config:o}=e,a=o.legend,s=new Sd({},function(e,t){const n=e.scaleName(t);if("trail"===e.mark){if("color"===t)return{stroke:n};if("size"===t)return{strokeWidth:n}}return"color"===t?e.markDef.filled?{fill:n}:{stroke:n}:{[t]:n}}(e,t));!function(e,t,n){const i=e.fieldDef(t)?.field;for(const r of de(e.component.selection??{})){const e=r.project.hasField[i]??r.project.hasChannel[t];if(e&&bf.defined(r)){const t=n.get("selections")??[];t.push(r.name),n.set("selections",t,!1),e.hasLegend=!0}}}(e,t,s);const l=void 0!==n?!n:a.disable;if(s.set("disable",l,void 0!==n),l)return s;n=n||{};const u=e.getScaleComponent(t).get("type"),c=ts(r[t]),f=Fa(c)?Er(c.timeUnit)?.unit:void 0,d=n.orient||o.legend.orient||"right",h=zd({legend:n,channel:t,timeUnit:f,scaleType:u}),p={legend:n,channel:t,model:e,markDef:i,encoding:r,fieldOrDatumDef:c,legendConfig:a,config:o,scaleType:u,orient:d,legendType:h,direction:Rd({legend:n,legendType:h,orient:d,legendConfig:a})};for(const b of Ad){if("gradient"===h&&b.startsWith("symbol")||"symbol"===h&&b.startsWith("gradient"))continue;const i=b in Nd?Nd[b](p):n[b];if(void 0!==i){const r=Ud(i,b,n,e.fieldDef(t));(r||void 0===o.legend[b])&&s.set(b,i,r)}}const m=n?.encoding??{},g=s.get("selections"),y={},v={fieldOrDatumDef:c,model:e,channel:t,legendCmpt:s,legendType:h};for(const b of["labels","legend","title","symbols","gradient","entries"]){const t=kd(m[b]??{},e),n=b in Md?Md[b](t,v):t;void 0===n||ce(n)||(y[b]={...g?.length&&Fa(c)?{name:`${me(c.field)}_legend_${b}`}:{},...g?.length?{interactive:!!g}:{},update:n})}return ce(y)||s.set("encode",y,!!n?.encoding),s}function jd(e,t){if(!e)return t.clone();const n=e.getWithExplicit("orient"),i=t.getWithExplicit("orient");if(n.explicit&&i.explicit&&n.value!==i.value)return;let r=!1;for(const o of Ad){const n=Wu(e.getWithExplicit(o),t.getWithExplicit(o),o,"legend",((e,t)=>{switch(o){case"symbolType":return Id(e,t);case"title":return Di(e,t);case"type":return r=!0,ju("symbol")}return qu(e,t,o,"legend")}));e.setWithExplicit(o,n)}return r&&(e.implicit?.encode?.gradient&&ye(e.implicit,["encode","gradient"]),e.explicit?.encode?.gradient&&ye(e.explicit,["encode","gradient"])),e}function Id(e,t){return"circle"===t.value?t:e}function qd(e){const t=e.component.legends,n={};for(const i of fe(t)){const r=Re(e.getScaleComponent(i).get("domains"));if(n[r])for(const e of n[r]){jd(e,t[i])||n[r].push(t[i])}else n[r]=[t[i].clone()]}return de(n).flat().map((t=>function(e,t){const{disable:n,labelExpr:i,selections:r,...o}=e.combine();if(n)return;!1===t.aria&&void 0==o.aria&&(o.aria=!1);if(o.encode?.symbols){const e=o.encode.symbols.update;!e.fill||"transparent"===e.fill.value||e.stroke||o.stroke||(e.stroke={value:"transparent"});for(const t of ol)o[t]&&delete e[t]}o.title||delete o.title;if(void 0!==i){let e=i;o.encode?.labels?.update&&ri(o.encode.labels.update.text)&&(e=ke(i,"datum.label",o.encode.labels.update.text.signal)),function(e,t,n,i){var r,o;e.encode??(e.encode={}),(r=e.encode)[t]??(r[t]={}),(o=e.encode[t]).update??(o.update={}),e.encode[t].update[n]=i}(o,"labels","text",{signal:e})}return o}(t,e.config))).filter((e=>void 0!==e))}function Wd(e){return wp(e)||_p(e)?function(e){return e.children.reduce(((e,t)=>e.concat(t.assembleProjections())),Hd(e))}(e):Hd(e)}function Hd(e){const t=e.component.projection;if(!t||t.merged)return[];const n=t.combine(),{name:i}=n;if(t.data){const r={signal:`[${t.size.map((e=>e.signal)).join(", ")}]`},o=t.data.reduce(((t,n)=>{const i=ri(n)?n.signal:`data('${e.lookupDataSource(n)}')`;return Q(t,i)||t.push(i),t}),[]);if(o.length<=0)throw new Error("Projection's fit didn't find any data sources");return[{name:i,size:r,fit:{signal:o.length>1?`[${o.join(", ")}]`:o[0]},...n}]}return[{name:i,translate:{signal:"[width / 2, height / 2]"},...n}]}const Xd=["type","clipAngle","clipExtent","center","rotate","precision","reflectX","reflectY","coefficient","distance","fraction","lobes","parallel","radius","ratio","spacing","tilt"];class Jd extends Uu{constructor(e,t,n,i){super({...t},{name:e}),this.specifiedProjection=t,this.size=n,this.data=i,this.merged=!1}get isFit(){return!!this.data}}function Gd(e){e.component.projection=bp(e)?function(e){if(e.hasProjection){const t=ti(e.specifiedProjection),n=!(t&&(null!=t.scale||null!=t.translate)),i=n?[e.getSizeSignalRef("width"),e.getSizeSignalRef("height")]:void 0,r=n?function(e){const t=[],{encoding:n}=e;for(const i of[[Ke,Ye],[Qe,Ze]])(ts(n[i[0]])||ts(n[i[1]]))&&t.push({signal:e.getName(`geojson_${t.length}`)});e.channelHasField(it)&&e.typedFieldDef(it).type===Jr&&t.push({signal:e.getName(`geojson_${t.length}`)});0===t.length&&t.push(e.requestDataName(Qu.Main));return t}(e):void 0,o=new Jd(e.projectionName(!0),{...ti(e.config.projection)??{},...t??{}},i,r);return o.get("type")||o.set("type","equalEarth",!1),o}return}(e):function(e){if(0===e.children.length)return;let t;for(const i of e.children)Gd(i);const n=te(e.children,(e=>{const n=e.component.projection;if(n){if(t){const e=function(e,t){const n=te(Xd,(n=>!(0,j.nr)(e.explicit,n)&&!(0,j.nr)(t.explicit,n)||!!((0,j.nr)(e.explicit,n)&&(0,j.nr)(t.explicit,n)&&ze(e.get(n),t.get(n)))));if(ze(e.size,t.size)){if(n)return e;if(ze(e.explicit,{}))return t;if(ze(t.explicit,{}))return e}return null}(t,n);return e&&(t=e),!!e}return t=n,!0}return!0}));if(t&&n){const n=e.projectionName(!0),i=new Jd(n,t.specifiedProjection,t.size,J(t.data));for(const t of e.children){const e=t.component.projection;e&&(e.isFit&&i.data.push(...t.component.projection.data),t.renameProjection(e.get("name"),n),e.merged=!0)}return i}return}(e)}function Vd(e,t,n,i){if(cs(t,n)){const r=bp(e)?e.axis(n)??e.legend(n)??{}:{},o=Ha(t,{expr:"datum"}),a=Ha(t,{expr:"datum",binSuffix:"end"});return{formulaAs:Ha(t,{binSuffix:"range",forAs:!0}),formula:da(o,a,r.format,r.formatType,i)}}return{}}function Yd(e,t){return`${Gn(e)}_${t}`}function Kd(e,t,n){const i=Yd(os(n,void 0)??{},t);return e.getName(`${i}_bins`)}function Zd(e,t,n){let i,r;i=function(e){return"as"in e}(e)?(0,j.HD)(e.as)?[e.as,`${e.as}_end`]:[e.as[0],e.as[1]]:[Ha(e,{forAs:!0}),Ha(e,{binSuffix:"end",forAs:!0})];const o={...os(t,void 0)},a=Yd(o,e.field),{signal:s,extentSignal:l}=function(e,t){return{signal:e.getName(`${t}_bins`),extentSignal:e.getName(`${t}_extent`)}}(n,a);if(Zn(o.extent)){const e=o.extent;r=If(n,e.param,e),delete o.extent}return{key:a,binComponent:{bin:o,field:e.field,as:[i],...s?{signal:s}:{},...l?{extentSignal:l}:{},...r?{span:r}:{}}}}class Qd extends sc{clone(){return new Qd(null,J(this.bins))}constructor(e,t){super(e),this.bins=t}static makeFromEncoding(e,t){const n=t.reduceFieldDef(((e,n,i)=>{if(La(n)&&Vn(n.bin)){const{key:r,binComponent:o}=Zd(n,n.bin,t);e[r]={...o,...e[r],...Vd(t,n,i,t.config)}}return e}),{});return ce(n)?null:new Qd(e,n)}static makeFromTransform(e,t,n){const{key:i,binComponent:r}=Zd(t,t.bin,n);return new Qd(e,{[i]:r})}merge(e,t){for(const n of fe(e.bins))n in this.bins?(t(e.bins[n].signal,this.bins[n].signal),this.bins[n].as=re([...this.bins[n].as,...e.bins[n].as],K)):this.bins[n]=e.bins[n];for(const n of e.children)e.removeChild(n),n.parent=this;e.remove()}producedFields(){return new Set(de(this.bins).map((e=>e.as)).flat(2))}dependentFields(){return new Set(de(this.bins).map((e=>e.field)))}hash(){return`Bin ${K(this.bins)}`}assemble(){return de(this.bins).flatMap((e=>{const t=[],[n,...i]=e.as,{extent:r,...o}=e.bin,a={type:"bin",field:we(e.field),as:n,signal:e.signal,...Zn(r)?{extent:null}:{extent:r},...e.span?{span:{signal:`span(${e.span})`}}:{},...o};!r&&e.extentSignal&&(t.push({type:"extent",field:we(e.field),signal:e.extentSignal}),a.extent={signal:e.extentSignal}),t.push(a);for(const s of i)for(let e=0;e<2;e++)t.push({type:"formula",expr:Ha({field:n[e]},{expr:"datum"}),as:s[e]});return e.formula&&t.push({type:"formula",expr:e.formula,as:e.formulaAs}),t}))}}function eh(e,t,n,i){const r=bp(i)?i.encoding[Wt(t)]:void 0;if(La(n)&&bp(i)&&$a(n,r,i.markDef,i.config)){e.add(Ha(n,{})),e.add(Ha(n,{suffix:"end"}));const{mark:r,markDef:o,config:a}=i,s=Ea({fieldDef:n,markDef:o,config:a});Lo(r)&&.5!==s&&mn(t)&&(e.add(Ha(n,{suffix:dc})),e.add(Ha(n,{suffix:hc}))),n.bin&&cs(n,t)&&e.add(Ha(n,{binSuffix:"range"}))}else if(kt(t)){const n=wt(t);e.add(i.getName(n))}else e.add(Ha(n));return Ba(n)&&function(e){return(0,U.isObject)(e)&&"field"in e}(n.scale?.range)&&e.add(n.scale.range.field),e}class th extends sc{clone(){return new th(null,new Set(this.dimensions),J(this.measures))}constructor(e,t,n){super(e),this.dimensions=t,this.measures=n}get groupBy(){return this.dimensions}static makeFromEncoding(e,t){let n=!1;t.forEachFieldDef((e=>{e.aggregate&&(n=!0)}));const i={},r=new Set;return n?(t.forEachFieldDef(((e,n)=>{const{aggregate:o,field:a}=e;if(o)if("count"===o)i["*"]??(i["*"]={}),i["*"].count=new Set([Ha(e,{forAs:!0})]);else{if(jn(o)||In(o)){const e=jn(o)?"argmin":"argmax",t=o[e];i[t]??(i[t]={}),i[t][e]=new Set([Ha({op:e,field:t},{forAs:!0})])}else i[a]??(i[a]={}),i[a][o]=new Set([Ha(e,{forAs:!0})]);Tn(n)&&"unaggregated"===t.scaleDomain(n)&&(i[a]??(i[a]={}),i[a].min=new Set([Ha({field:a,aggregate:"min"},{forAs:!0})]),i[a].max=new Set([Ha({field:a,aggregate:"max"},{forAs:!0})]))}else eh(r,n,e,t)})),r.size+fe(i).length===0?null:new th(e,r,i)):null}static makeFromTransform(e,t){const n=new Set,i={};for(const r of t.aggregate){const{op:e,field:t,as:n}=r;e&&("count"===e?(i["*"]??(i["*"]={}),i["*"].count=new Set([n||Ha(r,{forAs:!0})])):(i[t]??(i[t]={}),i[t][e]=new Set([n||Ha(r,{forAs:!0})])))}for(const r of t.groupby??[])n.add(r);return n.size+fe(i).length===0?null:new th(e,n,i)}merge(e){return ae(this.dimensions,e.dimensions)?(function(e,t){for(const n of fe(t)){const i=t[n];for(const t of fe(i))n in e?e[n][t]=new Set([...e[n][t]??[],...i[t]]):e[n]={[t]:i[t]}}}(this.measures,e.measures),!0):(function(...e){ir.debug(...e)}("different dimensions, cannot merge"),!1)}addDimensions(e){e.forEach(this.dimensions.add,this.dimensions)}dependentFields(){return new Set([...this.dimensions,...fe(this.measures)])}producedFields(){const e=new Set;for(const t of fe(this.measures))for(const n of fe(this.measures[t])){const i=this.measures[t][n];0===i.size?e.add(`${n}_${t}`):i.forEach(e.add,e)}return e}hash(){return`Aggregate ${K({dimensions:this.dimensions,measures:this.measures})}`}assemble(){const e=[],t=[],n=[];for(const i of fe(this.measures))for(const r of fe(this.measures[i]))for(const o of this.measures[i][r])n.push(o),e.push(r),t.push("*"===i?null:we(i));return{type:"aggregate",groupby:[...this.dimensions].map(we),ops:e,fields:t,as:n}}}class nh extends sc{constructor(e,t,n,i){super(e),this.model=t,this.name=n,this.data=i;for(const r of St){const e=t.facet[r];if(e){const{bin:n,sort:i}=e;this[r]={name:t.getName(`${r}_domain`),fields:[Ha(e),...Vn(n)?[Ha(e,{binSuffix:"end"})]:[]],...ya(i)?{sortField:i}:(0,j.kJ)(i)?{sortIndexField:nd(e,r)}:{}}}}this.childModel=t.child}hash(){let e="Facet";for(const t of St)this[t]&&(e+=` ${t.charAt(0)}:${K(this[t])}`);return e}get fields(){const e=[];for(const t of St)this[t]?.fields&&e.push(...this[t].fields);return e}dependentFields(){const e=new Set(this.fields);for(const t of St)this[t]&&(this[t].sortField&&e.add(this[t].sortField.field),this[t].sortIndexField&&e.add(this[t].sortIndexField));return e}producedFields(){return new Set}getSource(){return this.name}getChildIndependentFieldsWithStep(){const e={};for(const t of pn){const n=this.childModel.component.scales[t];if(n&&!n.merged){const i=n.get("type"),r=n.get("range");if(oo(i)&&oi(r)){const n=Vh(Yh(this.childModel,t));n?e[t]=n:or(Fi(t))}}}return e}assembleRowColumnHeaderData(e,t,n){const i={row:"y",column:"x",facet:void 0}[e],r=[],o=[],a=[];i&&n&&n[i]&&(t?(r.push(`distinct_${n[i]}`),o.push("max")):(r.push(n[i]),o.push("distinct")),a.push(`distinct_${n[i]}`));const{sortField:s,sortIndexField:l}=this[e];if(s){const{op:e=ha,field:t}=s;r.push(t),o.push(e),a.push(Ha(s,{forAs:!0}))}else l&&(r.push(l),o.push("max"),a.push(l));return{name:this[e].name,source:t??this.data,transform:[{type:"aggregate",groupby:this[e].fields,...r.length?{fields:r,ops:o,as:a}:{}}]}}assembleFacetHeaderData(e){const{columns:t}=this.model.layout,{layoutHeaders:n}=this.model.component,i=[],r={};for(const s of ad){for(const e of sd){const t=(n[s]&&n[s][e])??[];for(const e of t)if(e.axes?.length>0){r[s]=!0;break}}if(r[s]){const e=`length(data("${this.facet.name}"))`,n="row"===s?t?{signal:`ceil(${e} / ${t})`}:1:t?{signal:`min(${e}, ${t})`}:{signal:e};i.push({name:`${this.facet.name}_${s}`,transform:[{type:"sequence",start:0,stop:n}]})}}const{row:o,column:a}=r;return(o||a)&&i.unshift(this.assembleRowColumnHeaderData("facet",null,e)),i}assemble(){const e=[];let t=null;const n=this.getChildIndependentFieldsWithStep(),{column:i,row:r,facet:o}=this;if(i&&r&&(n.x||n.y)){t=`cross_${this.column.name}_${this.row.name}`;const i=[].concat(n.x??[],n.y??[]),r=i.map((()=>"distinct"));e.push({name:t,source:this.data,transform:[{type:"aggregate",groupby:this.fields,fields:i,ops:r}]})}for(const a of[Le,Pe])this[a]&&e.push(this.assembleRowColumnHeaderData(a,t,n));if(o){const t=this.assembleFacetHeaderData(n);t&&e.push(...t)}return e}}function ih(e){return e.startsWith("'")&&e.endsWith("'")||e.startsWith('"')&&e.endsWith('"')?e.slice(1,-1):e}function rh(e){const t={};return H(e.filter,(e=>{if(zr(e)){let n=null;Sr(e)?n=fi(e.equal):Cr(e)?n=fi(e.lte):Mr(e)?n=fi(e.lt):Fr(e)?n=fi(e.gt):Or(e)?n=fi(e.gte):Tr(e)?n=e.range[0]:Nr(e)&&(n=(e.oneOf??e.in)[0]),n&&(ar(n)?t[e.field]="date":(0,j.hj)(n)?t[e.field]="number":(0,j.HD)(n)&&(t[e.field]="string")),e.timeUnit&&(t[e.field]="date")}})),t}function oh(e){const t={};function n(e){var n;ss(e)?t[e.field]="date":"quantitative"===e.type&&(n=e.aggregate,(0,j.HD)(n)&&Q(["min","max"],n))?t[e.field]="number":De(e.field)>1?e.field in t||(t[e.field]="flatten"):Ba(e)&&ya(e.sort)&&De(e.sort.field)>1&&(e.sort.field in t||(t[e.sort.field]="flatten"))}if((bp(e)||xp(e))&&e.forEachFieldDef(((t,i)=>{if(La(t))n(t);else{const r=It(i),o=e.fieldDef(r);n({...t,type:o.type})}})),bp(e)){const{mark:n,markDef:i,encoding:r}=e;if(Po(n)&&!e.encoding.order){const e=r["horizontal"===i.orient?"y":"x"];Fa(e)&&"quantitative"===e.type&&!(e.field in t)&&(t[e.field]="number")}}return t}class ah extends sc{clone(){return new ah(null,J(this._parse))}constructor(e,t){super(e),this._parse=t}hash(){return`Parse ${K(this._parse)}`}static makeExplicit(e,t,n){let i={};const r=t.data;return!Vu(r)&&r?.format?.parse&&(i=r.format.parse),this.makeWithAncestors(e,i,{},n)}static makeWithAncestors(e,t,n,i){for(const a of fe(n)){const e=i.getWithExplicit(a);void 0!==e.value&&(e.explicit||e.value===n[a]||"derived"===e.value||"flatten"===n[a]?delete n[a]:or(Pi(a,n[a],e.value)))}for(const a of fe(t)){const e=i.get(a);void 0!==e&&(e===t[a]?delete t[a]:or(Pi(a,t[a],e)))}const r=new Uu(t,n);i.copyAll(r);const o={};for(const a of fe(r.combine())){const e=r.get(a);null!==e&&(o[a]=e)}return 0===fe(o).length||i.parseNothing?null:new ah(e,o)}get parse(){return this._parse}merge(e){this._parse={...this._parse,...e.parse},e.remove()}assembleFormatParse(){const e={};for(const t of fe(this._parse)){const n=this._parse[t];1===De(t)&&(e[t]=n)}return e}producedFields(){return new Set(fe(this._parse))}dependentFields(){return new Set(fe(this._parse))}assembleTransforms(e=!1){return fe(this._parse).filter((t=>!e||De(t)>1)).map((e=>{const t=function(e,t){const n=be(e);if("number"===t)return`toNumber(${n})`;if("boolean"===t)return`toBoolean(${n})`;if("string"===t)return`toString(${n})`;if("date"===t)return`toDate(${n})`;if("flatten"===t)return n;if(t.startsWith("date:"))return`timeParse(${n},'${ih(t.slice(5,t.length))}')`;if(t.startsWith("utc:"))return`utcParse(${n},'${ih(t.slice(4,t.length))}')`;return or(`Unrecognized parse "${t}".`),null}(e,this._parse[e]);if(!t)return null;return{type:"formula",expr:t,as:Ee(e)}})).filter((e=>null!==e))}}class sh extends sc{clone(){return new sh(null)}constructor(e){super(e)}dependentFields(){return new Set}producedFields(){return new Set([sl])}hash(){return"Identifier"}assemble(){return{type:"identifier",as:sl}}}class lh extends sc{clone(){return new lh(null,this.params)}constructor(e,t){super(e),this.params=t}dependentFields(){return new Set}producedFields(){}hash(){return`Graticule ${K(this.params)}`}assemble(){return{type:"graticule",...!0===this.params?{}:this.params}}}class uh extends sc{clone(){return new uh(null,this.params)}constructor(e,t){super(e),this.params=t}dependentFields(){return new Set}producedFields(){return new Set([this.params.as??"data"])}hash(){return`Hash ${K(this.params)}`}assemble(){return{type:"sequence",...this.params}}}class ch extends sc{constructor(e){let t;if(super(null),e??(e={name:"source"}),Vu(e)||(t=e.format?{...Y(e.format,["parse"])}:{}),Ju(e))this._data={values:e.values};else if(Xu(e)){if(this._data={url:e.url},!t.type){let n=/(?:\.([^.]+))?$/.exec(e.url)[1];Q(["json","csv","tsv","dsv","topojson"],n)||(n="json"),t.type=n}}else Ku(e)?this._data={values:[{type:"Sphere"}]}:(Gu(e)||Vu(e))&&(this._data={});this._generator=Vu(e),e.name&&(this._name=e.name),t&&!ce(t)&&(this._data.format=t)}dependentFields(){return new Set}producedFields(){}get data(){return this._data}hasName(){return!!this._name}get isGenerator(){return this._generator}get dataName(){return this._name}set dataName(e){this._name=e}set parent(e){throw new Error("Source nodes have to be roots.")}remove(){throw new Error("Source nodes are roots and cannot be removed.")}hash(){throw new Error("Cannot hash sources")}assemble(){return{name:this._name,...this._data,transform:[]}}}var fh,dh=function(e,t,n,i,r){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!r)throw new TypeError("Private accessor was defined without a setter");if("function"===typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?r.call(e,n):r?r.value=n:t.set(e,n),n},hh=function(e,t,n,i){if("a"===n&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"===typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?i:"a"===n?i.call(e):i?i.value:t.get(e)};function ph(e){return e instanceof ch||e instanceof lh||e instanceof uh}class mh{constructor(){fh.set(this,void 0),dh(this,fh,!1,"f")}setModified(){dh(this,fh,!0,"f")}get modifiedFlag(){return hh(this,fh,"f")}}fh=new WeakMap;class gh extends mh{getNodeDepths(e,t,n){n.set(e,t);for(const i of e.children)this.getNodeDepths(i,t+1,n);return n}optimize(e){const t=[...this.getNodeDepths(e,0,new Map).entries()].sort(((e,t)=>t[1]-e[1]));for(const n of t)this.run(n[0]);return this.modifiedFlag}}class yh extends mh{optimize(e){this.run(e);for(const t of e.children)this.optimize(t);return this.modifiedFlag}}class vh extends yh{mergeNodes(e,t){const n=t.shift();for(const i of t)e.removeChild(i),i.parent=n,i.remove()}run(e){const t=e.children.map((e=>e.hash())),n={};for(let i=0;i<t.length;i++)void 0===n[t[i]]?n[t[i]]=[e.children[i]]:n[t[i]].push(e.children[i]);for(const i of fe(n))n[i].length>1&&(this.setModified(),this.mergeNodes(e,n[i]))}}class bh extends yh{constructor(e){super(),this.requiresSelectionId=e&&Nf(e)}run(e){e instanceof sh&&(this.requiresSelectionId&&(ph(e.parent)||e.parent instanceof th||e.parent instanceof ah)||(this.setModified(),e.remove()))}}class xh extends mh{optimize(e){return this.run(e,new Set),this.modifiedFlag}run(e,t){let n=new Set;e instanceof fc&&(n=e.producedFields(),se(n,t)&&(this.setModified(),e.removeFormulas(t),0===e.producedFields.length&&e.remove()));for(const i of e.children)this.run(i,new Set([...t,...n]))}}class _h extends yh{constructor(){super()}run(e){e instanceof lc&&!e.isRequired()&&(this.setModified(),e.remove())}}class wh extends gh{run(e){if(!ph(e)&&!(e.numChildren()>1))for(const t of e.children)if(t instanceof ah)if(e instanceof ah)this.setModified(),e.merge(t);else{if(ue(e.producedFields(),t.dependentFields()))continue;this.setModified(),t.swapWithParent()}}}class kh extends gh{run(e){const t=[...e.children],n=e.children.filter((e=>e instanceof ah));if(e.numChildren()>1&&n.length>=1){const i={},r=new Set;for(const e of n){const t=e.parse;for(const e of fe(t))e in i?i[e]!==t[e]&&r.add(e):i[e]=t[e]}for(const e of r)delete i[e];if(!ce(i)){this.setModified();const n=new ah(e,i);for(const r of t){if(r instanceof ah)for(const e of fe(i))delete r.parse[e];e.removeChild(r),r.parent=n,r instanceof ah&&0===fe(r.parse).length&&r.remove()}}}}}class Eh extends gh{run(e){e instanceof lc||e.numChildren()>0||e instanceof nh||e instanceof ch||(this.setModified(),e.remove())}}class Dh extends gh{run(e){const t=e.children.filter((e=>e instanceof fc)),n=t.pop();for(const i of t)this.setModified(),n.merge(i)}}class $h extends gh{run(e){const t=e.children.filter((e=>e instanceof th)),n={};for(const i of t){const e=K(i.groupBy);e in n||(n[e]=[]),n[e].push(i)}for(const i of fe(n)){const t=n[i];if(t.length>1){const n=t.pop();for(const i of t)n.merge(i)&&(e.removeChild(i),i.parent=n,i.remove(),this.setModified())}}}}class Ah extends gh{constructor(e){super(),this.model=e}run(e){const t=!(ph(e)||e instanceof Bf||e instanceof ah||e instanceof sh),n=[],i=[];for(const r of e.children)r instanceof Qd&&(t&&!ue(e.producedFields(),r.dependentFields())?n.push(r):i.push(r));if(n.length>0){const t=n.pop();for(const e of n)t.merge(e,this.model.renameSignal.bind(this.model));this.setModified(),e instanceof Qd?e.merge(t,this.model.renameSignal.bind(this.model)):t.swapWithParent()}if(i.length>1){const e=i.pop();for(const t of i)e.merge(t,this.model.renameSignal.bind(this.model));this.setModified()}}}class Sh extends gh{run(e){const t=[...e.children];if(!ee(t,(e=>e instanceof lc))||e.numChildren()<=1)return;const n=[];let i;for(const r of t)if(r instanceof lc){let t=r;for(;1===t.numChildren();){const[e]=t.children;if(!(e instanceof lc))break;t=e}n.push(...t.children),i?(e.removeChild(r),r.parent=i.parent,i.parent.removeChild(i),i.parent=t,this.setModified()):i=t}else n.push(r);if(n.length){this.setModified();for(const e of n)e.parent.removeChild(e),e.parent=i}}}class Mh extends sc{clone(){return new Mh(null,J(this.transform))}constructor(e,t){super(e),this.transform=t}addDimensions(e){this.transform.groupby=re(this.transform.groupby.concat(e),(e=>e))}dependentFields(){const e=new Set;return this.transform.groupby&&this.transform.groupby.forEach(e.add,e),this.transform.joinaggregate.map((e=>e.field)).filter((e=>void 0!==e)).forEach(e.add,e),e}producedFields(){return new Set(this.transform.joinaggregate.map(this.getDefaultName))}getDefaultName(e){return e.as??Ha(e)}hash(){return`JoinAggregateTransform ${K(this.transform)}`}assemble(){const e=[],t=[],n=[];for(const r of this.transform.joinaggregate)t.push(r.op),n.push(this.getDefaultName(r)),e.push(void 0===r.field?null:r.field);const i=this.transform.groupby;return{type:"joinaggregate",as:n,ops:t,fields:e,...void 0!==i?{groupby:i}:{}}}}class Ch extends sc{clone(){return new Ch(null,J(this._stack))}constructor(e,t){super(e),this._stack=t}static makeFromTransform(e,t){const{stack:n,groupby:i,as:r,offset:o="zero"}=t,a=[],s=[];if(void 0!==t.sort)for(const c of t.sort)a.push(c.field),s.push($e(c.order,"ascending"));const l={field:a,order:s};let u;return u=function(e){return(0,j.kJ)(e)&&e.every((e=>(0,j.HD)(e)))&&e.length>1}(r)?r:(0,j.HD)(r)?[r,`${r}_end`]:[`${t.stack}_start`,`${t.stack}_end`],new Ch(e,{dimensionFieldDefs:[],stackField:n,groupby:i,offset:o,sort:l,facetby:[],as:u})}static makeFromEncoding(e,t){const n=t.stack,{encoding:i}=t;if(!n)return null;const{groupbyChannels:r,fieldChannel:o,offset:a,impute:s}=n,l=r.map((e=>es(i[e]))).filter((e=>!!e)),u=function(e){return e.stack.stackBy.reduce(((e,t)=>{const n=Ha(t.fieldDef);return n&&e.push(n),e}),[])}(t),c=t.encoding.order;let f;if((0,j.kJ)(c)||Fa(c))f=wi(c);else{const e=Aa(c)?c.sort:"y"===o?"descending":"ascending";f=u.reduce(((t,n)=>(t.field.push(n),t.order.push(e),t)),{field:[],order:[]})}return new Ch(e,{dimensionFieldDefs:l,stackField:t.vgField(o),facetby:[],stackby:u,sort:f,offset:a,impute:s,as:[t.vgField(o,{suffix:"start",forAs:!0}),t.vgField(o,{suffix:"end",forAs:!0})]})}get stack(){return this._stack}addDimensions(e){this._stack.facetby.push(...e)}dependentFields(){const e=new Set;return e.add(this._stack.stackField),this.getGroupbyFields().forEach(e.add,e),this._stack.facetby.forEach(e.add,e),this._stack.sort.field.forEach(e.add,e),e}producedFields(){return new Set(this._stack.as)}hash(){return`Stack ${K(this._stack)}`}getGroupbyFields(){const{dimensionFieldDefs:e,impute:t,groupby:n}=this._stack;return e.length>0?e.map((e=>e.bin?t?[Ha(e,{binSuffix:"mid"})]:[Ha(e,{}),Ha(e,{binSuffix:"end"})]:[Ha(e)])).flat():n??[]}assemble(){const e=[],{facetby:t,dimensionFieldDefs:n,stackField:i,stackby:r,sort:o,offset:a,impute:s,as:l}=this._stack;if(s)for(const u of n){const{bandPosition:n=.5,bin:o}=u;if(o){const t=Ha(u,{expr:"datum"}),i=Ha(u,{expr:"datum",binSuffix:"end"});e.push({type:"formula",expr:`${n}*${t}+${1-n}*${i}`,as:Ha(u,{binSuffix:"mid",forAs:!0})})}e.push({type:"impute",field:i,groupby:[...r,...t],key:Ha(u,{binSuffix:"mid"}),method:"value",value:0})}return e.push({type:"stack",groupby:[...this.getGroupbyFields(),...t],field:i,sort:o,as:l,offset:a}),e}}class Fh extends sc{clone(){return new Fh(null,J(this.transform))}constructor(e,t){super(e),this.transform=t}addDimensions(e){this.transform.groupby=re(this.transform.groupby.concat(e),(e=>e))}dependentFields(){const e=new Set;return(this.transform.groupby??[]).forEach(e.add,e),(this.transform.sort??[]).forEach((t=>e.add(t.field))),this.transform.window.map((e=>e.field)).filter((e=>void 0!==e)).forEach(e.add,e),e}producedFields(){return new Set(this.transform.window.map(this.getDefaultName))}getDefaultName(e){return e.as??Ha(e)}hash(){return`WindowTransform ${K(this.transform)}`}assemble(){const e=[],t=[],n=[],i=[];for(const c of this.transform.window)t.push(c.op),n.push(this.getDefaultName(c)),i.push(void 0===c.param?null:c.param),e.push(void 0===c.field?null:c.field);const r=this.transform.frame,o=this.transform.groupby;if(r&&null===r[0]&&null===r[1]&&t.every((e=>qn(e))))return{type:"joinaggregate",as:n,ops:t,fields:e,...void 0!==o?{groupby:o}:{}};const a=[],s=[];if(void 0!==this.transform.sort)for(const c of this.transform.sort)a.push(c.field),s.push(c.order??"ascending");const l={field:a,order:s},u=this.transform.ignorePeers;return{type:"window",params:i,as:n,ops:t,fields:e,sort:l,...void 0!==u?{ignorePeers:u}:{},...void 0!==o?{groupby:o}:{},...void 0!==r?{frame:r}:{}}}}function Oh(e){if(e instanceof nh)if(1!==e.numChildren()||e.children[0]instanceof lc){const n=e.model.component.data.main;Th(n);const i=(t=e,function e(n){if(!(n instanceof nh)){const i=n.clone();if(i instanceof lc){const e=Nh+i.getSource();i.setSource(e),t.model.component.data.outputNodes[e]=i}else(i instanceof th||i instanceof Ch||i instanceof Fh||i instanceof Mh)&&i.addDimensions(t.fields);for(const t of n.children.flatMap(e))t.parent=i;return[i]}return n.children.flatMap(e)}),r=e.children.map(i).flat();for(const e of r)e.parent=n}else{const t=e.children[0];(t instanceof th||t instanceof Ch||t instanceof Fh||t instanceof Mh)&&t.addDimensions(e.fields),t.swapWithParent(),Oh(e)}else e.children.map(Oh);var t}function Th(e){if(e instanceof lc&&e.type===Qu.Main&&1===e.numChildren()){const t=e.children[0];t instanceof nh||(t.swapWithParent(),Th(e))}}const Nh="scale_",zh=5;function Rh(e){for(const t of e){for(const e of t.children)if(e.parent!==t)return!1;if(!Rh(t.children))return!1}return!0}function Ph(e,t){let n=!1;for(const i of t)n=e.optimize(i)||n;return n}function Lh(e,t,n){let i=e.sources,r=!1;return r=Ph(new _h,i)||r,r=Ph(new bh(t),i)||r,i=i.filter((e=>e.numChildren()>0)),r=Ph(new Eh,i)||r,i=i.filter((e=>e.numChildren()>0)),n||(r=Ph(new wh,i)||r,r=Ph(new Ah(t),i)||r,r=Ph(new xh,i)||r,r=Ph(new kh,i)||r,r=Ph(new $h,i)||r,r=Ph(new Dh,i)||r,r=Ph(new vh,i)||r,r=Ph(new Sh,i)||r),e.sources=i,r}class Uh{constructor(e){Object.defineProperty(this,"signal",{enumerable:!0,get:e})}static fromName(e,t){return new Uh((()=>e(t)))}}function Bh(e){bp(e)?function(e){const t=e.component.scales;for(const n of fe(t)){const i=jh(e,n);if(t[n].setWithExplicit("domains",i),Hh(e,n),e.component.data.isFaceted){let t=e;for(;!xp(t)&&t.parent;)t=t.parent;if("shared"===t.component.resolve.scale[n])for(const e of i.value)ai(e)&&(e.data=Nh+e.data.replace(Nh,""))}}}(e):function(e){for(const n of e.children)Bh(n);const t=e.component.scales;for(const n of fe(t)){let i,r=null;for(const t of e.children){const e=t.component.scales[n];if(e){i=void 0===i?e.getWithExplicit("domains"):Wu(i,e.getWithExplicit("domains"),"domains","scale",Jh);const t=e.get("selectionExtent");r&&t&&r.param!==t.param&&or(zi),r=t}}t[n].setWithExplicit("domains",i),r&&t[n].set("selectionExtent",r,!0)}}(e)}function jh(e,t){const n=e.getScaleComponent(t).get("type"),{encoding:i}=e,r=function(e,t,n,i){if("unaggregated"===e){const{valid:e,reason:i}=Xh(t,n);if(!e)return void or(i)}else if(void 0===e&&i.useUnaggregatedDomain){const{valid:e}=Xh(t,n);if(e)return"unaggregated"}return e}(e.scaleDomain(t),e.typedFieldDef(t),n,e.config.scale);return r!==e.scaleDomain(t)&&(e.specifiedScales[t]={...e.specifiedScales[t],domain:r}),"x"===t&&ts(i.x2)?ts(i.x)?Wu(qh(n,r,e,"x"),qh(n,r,e,"x2"),"domain","scale",Jh):qh(n,r,e,"x2"):"y"===t&&ts(i.y2)?ts(i.y)?Wu(qh(n,r,e,"y"),qh(n,r,e,"y2"),"domain","scale",Jh):qh(n,r,e,"y2"):qh(n,r,e,t)}function Ih(e,t,n){const i=Er(n)?.unit;return"temporal"===t||i?function(e,t,n){return e.map((e=>({signal:`{data: ${ls(e,{timeUnit:n,type:t})}}`})))}(e,t,i):[e]}function qh(e,t,n,i){const{encoding:r,markDef:o,mark:a,config:s,stack:l}=n,u=ts(r[i]),{type:c}=u,f=u.timeUnit;if(function(e){return e?.unionWith}(t)){const r=qh(e,void 0,n,i);return Bu([...Ih(t.unionWith,c,f),...r.value])}if(ri(t))return Bu([t]);if(t&&"unaggregated"!==t&&!uo(t))return Bu(Ih(t,c,f));if(l&&i===l.fieldChannel){if("normalize"===l.offset)return ju([[0,1]]);const e=n.requestDataName(Qu.Main);return ju([{data:e,field:n.vgField(i,{suffix:"start"})},{data:e,field:n.vgField(i,{suffix:"end"})}])}const d=Tn(i)&&Fa(u)?function(e,t,n){if(!oo(n))return;const i=e.fieldDef(t),r=i.sort;if(va(r))return{op:"min",field:nd(i,t),order:"ascending"};const{stack:o}=e,a=o?new Set([...o.groupbyFields,...o.stackBy.map((e=>e.fieldDef.field))]):void 0;if(ya(r)){return Wh(r,o&&!a.has(r.field))}if(ga(r)){const{encoding:t,order:n}=r,i=e.fieldDef(t),{aggregate:s,field:l}=i,u=o&&!a.has(l);if(jn(s)||In(s))return Wh({field:Ha(i),order:n},u);if(qn(s)||!s)return Wh({op:s,field:l,order:n},u)}else{if("descending"===r)return{op:"min",field:e.vgField(t),order:"descending"};if(Q(["ascending",void 0],r))return!0}return}(n,i,e):void 0;if(Ta(u)){return ju(Ih([u.datum],c,f))}const h=u;if("unaggregated"===t){const e=n.requestDataName(Qu.Main),{field:t}=u;return ju([{data:e,field:Ha({field:t,aggregate:"min"})},{data:e,field:Ha({field:t,aggregate:"max"})}])}if(Vn(h.bin)){if(oo(e))return ju("bin-ordinal"===e?[]:[{data:pe(d)?n.requestDataName(Qu.Main):n.requestDataName(Qu.Raw),field:n.vgField(i,cs(h,i)?{binSuffix:"range"}:{}),sort:!0!==d&&(0,j.Kn)(d)?d:{field:n.vgField(i,{}),op:"min"}}]);{const{bin:e}=h;if(Vn(e)){const t=Kd(n,h.field,e);return ju([new Uh((()=>{const e=n.getSignalName(t);return`[${e}.start, ${e}.stop]`}))])}return ju([{data:n.requestDataName(Qu.Main),field:n.vgField(i,{})}])}}if(h.timeUnit&&Q(["time","utc"],e)){const e=r[Wt(i)];if($a(h,e,o,s)){const t=n.requestDataName(Qu.Main),r=Ea({fieldDef:h,fieldDef2:e,markDef:o,config:s}),l=Lo(a)&&.5!==r&&mn(i);return ju([{data:t,field:n.vgField(i,l?{suffix:dc}:{})},{data:t,field:n.vgField(i,{suffix:l?hc:"end"})}])}}return ju(d?[{data:pe(d)?n.requestDataName(Qu.Main):n.requestDataName(Qu.Raw),field:n.vgField(i),sort:d}]:[{data:n.requestDataName(Qu.Main),field:n.vgField(i)}])}function Wh(e,t){const{op:n,field:i,order:r}=e;return{op:n??(t?"sum":ha),...i?{field:we(i)}:{},...r?{order:r}:{}}}function Hh(e,t){const n=e.component.scales[t],i=e.specifiedScales[t].domain,r=e.fieldDef(t)?.bin,o=uo(i)&&i,a=Kn(r)&&Zn(r.extent)&&r.extent;(o||a)&&n.set("selectionExtent",o??a,!0)}function Xh(e,t){const{aggregate:n,type:i}=e;return n?(0,j.HD)(n)&&!Jn.has(n)?{valid:!1,reason:Gi(n)}:"quantitative"===i&&"log"===t?{valid:!1,reason:Vi(e)}:{valid:!0}:{valid:!1,reason:Ji(e)}}function Jh(e,t,n,i){return e.explicit&&t.explicit&&or(function(e,t,n,i){return`Conflicting ${t.toString()} property "${e.toString()}" (${Re(n)} and ${Re(i)}). Using the union of the two domains.`}(n,i,e.value,t.value)),{explicit:e.explicit,value:[...e.value,...t.value]}}function Gh(e){const t=re(e.map((e=>{if(ai(e)){const{sort:t,...n}=e;return n}return e})),K),n=re(e.map((e=>{if(ai(e)){const t=e.sort;return void 0===t||pe(t)||("op"in t&&"count"===t.op&&delete t.field,"ascending"===t.order&&delete t.order),t}})).filter((e=>void 0!==e)),K);if(0===t.length)return;if(1===t.length){const t=e[0];if(ai(t)&&n.length>0){let e=n[0];if(n.length>1){or(Zi);const t=n.filter((e=>(0,j.Kn)(e)&&"op"in e&&"min"!==e.op));e=!n.every((e=>(0,j.Kn)(e)&&"op"in e))||1!==t.length||t[0]}else if((0,j.Kn)(e)&&"field"in e){const n=e.field;t.field===n&&(e=!e.order||{order:e.order})}return{...t,sort:e}}return t}const i=re(n.map((e=>pe(e)||!("op"in e)||(0,j.HD)(e.op)&&e.op in Bn?e:(or(function(e){return`Dropping sort property ${Re(e)} as unioned domains only support boolean or op "count", "min", and "max".`}(e)),!0))),K);let r;1===i.length?r=i[0]:i.length>1&&(or(Zi),r=!0);const o=re(e.map((e=>ai(e)?e.data:null)),(e=>e));if(1===o.length&&null!==o[0]){return{data:o[0],fields:t.map((e=>e.field)),...r?{sort:r}:{}}}return{fields:t,...r?{sort:r}:{}}}function Vh(e){if(ai(e)&&(0,j.HD)(e.field))return e.field;if(function(e){return!(0,j.kJ)(e)&&"fields"in e&&!("data"in e)}(e)){let t;for(const n of e.fields)if(ai(n)&&(0,j.HD)(n.field))if(t){if(t!==n.field)return or("Detected faceted independent scales that union domain of multiple fields from different data sources. We will use the first field. The result view size may be incorrect."),t}else t=n.field;return or("Detected faceted independent scales that union domain of the same fields from different source. We will assume that this is the same field from a different fork of the same data source. However, if this is not the case, the result view size may be incorrect."),t}if(function(e){return!(0,j.kJ)(e)&&"fields"in e&&"data"in e}(e)){or("Detected faceted independent scales that union domain of multiple fields from the same data source. We will use the first field. The result view size may be incorrect.");const t=e.fields[0];return(0,j.HD)(t)?t:void 0}}function Yh(e,t){const n=e.component.scales[t].get("domains").map((t=>(ai(t)&&(t.data=e.lookupDataSource(t.data)),t)));return Gh(n)}function Kh(e){return wp(e)||_p(e)?e.children.reduce(((e,t)=>e.concat(Kh(t))),Zh(e)):Zh(e)}function Zh(e){return fe(e.component.scales).reduce(((t,n)=>{const i=e.component.scales[n];if(i.merged)return t;const r=i.combine(),{name:o,type:a,selectionExtent:s,domains:l,range:u,reverse:c,...f}=r,d=function(e,t,n,i){if(mn(n)){if(oi(e))return{step:{signal:`${t}_step`}}}else if((0,j.Kn)(e)&&ai(e))return{...e,data:i.lookupDataSource(e.data)};return e}(r.range,o,n,e),h=Yh(e,n),p=s?function(e,t,n,i){const r=If(e,t.param,t);return{signal:ao(n.get("type"))&&(0,j.kJ)(i)&&i[0]>i[1]?`isValid(${r}) && reverse(${r})`:r}}(e,s,i,h):null;return t.push({name:o,type:a,...h?{domain:h}:{},...p?{domainRaw:p}:{},range:d,...void 0!==c?{reverse:c}:{},...f}),t}),[])}class Qh extends Uu{constructor(e,t){super({},{name:e}),this.merged=!1,this.setWithExplicit("type",t)}domainDefinitelyIncludesZero(){return!1!==this.get("zero")||ee(this.get("domains"),(e=>(0,j.kJ)(e)&&2===e.length&&(0,j.hj)(e[0])&&e[0]<=0&&(0,j.hj)(e[1])&&e[1]>=0))}}const ep=["range","scheme"];function tp(e,t){const n=e.fieldDef(t);if(n?.bin){const{bin:i,field:r}=n,o=Ht(t),a=e.getName(o);if((0,j.Kn)(i)&&i.binned&&void 0!==i.step)return new Uh((()=>{const n=e.scaleName(t),r=`(domain("${n}")[1] - domain("${n}")[0]) / ${i.step}`;return`${e.getSignalName(a)} / (${r})`}));if(Vn(i)){const t=Kd(e,r,i);return new Uh((()=>{const n=e.getSignalName(t),i=`(${n}.stop - ${n}.start) / ${n}.step`;return`${e.getSignalName(a)} / (${i})`}))}}}function np(e,t){const n=t.specifiedScales[e],{size:i}=t,r=t.getScaleComponent(e).get("type");for(const c of ep)if(void 0!==n[c]){const i=xo(r,c),o=_o(e,c);if(i)if(o)or(o);else switch(c){case"range":{const i=n.range;if((0,j.kJ)(i)){if(mn(e))return Bu(i.map((e=>{if("width"===e||"height"===e){const n=t.getName(e),i=t.getSignalName.bind(t);return Uh.fromName(i,n)}return e})))}else if((0,j.Kn)(i))return Bu({data:t.requestDataName(Qu.Main),field:i.field,sort:{op:"min",field:t.vgField(e)}});return Bu(i)}case"scheme":return Bu(ip(n[c]))}else or(Yi(r,c,e))}const o=e===Be||"xOffset"===e?"width":"height",a=i[o];if(yl(a))if(mn(e))if(oo(r)){const n=op(a,t,e);if(n)return Bu({step:n})}else or(Ki(o));else if(xn(e)){const n=e===We?"x":"y";if("band"===t.getScaleComponent(n).get("type")){const e=ap(a,r);if(e)return Bu(e)}}const{rangeMin:s,rangeMax:l}=n,u=function(e,t){const{size:n,config:i,mark:r,encoding:o}=t,{type:a}=ts(o[e]),s=t.getScaleComponent(e),l=s.get("type"),{domain:u,domainMid:c}=t.specifiedScales[e];switch(e){case Be:case je:if(Q(["point","band"],l)){const r=sp(e,n,i.view);if(yl(r)){return{step:op(r,t,e)}}}return rp(e,t,l);case We:case He:return function(e,t,n){const i=e===We?"x":"y",r=t.getScaleComponent(i);if(!r)return rp(i,t,n,{center:!0});const o=r.get("type"),a=t.scaleName(i),{markDef:s,config:l}=t;if("band"===o){const e=sp(i,t.size,t.config.view);if(yl(e)){const t=ap(e,n);if(t)return t}return[0,{signal:`bandwidth('${a}')`}]}{const n=t.encoding[i];if(Fa(n)&&n.timeUnit){const e=Dr(n.timeUnit,(e=>`scale('${a}', ${e})`)),i=t.config.scale.bandWithNestedOffsetPaddingInner,r=Ea({fieldDef:n,markDef:s,config:l})-.5,o=0!==r?` + ${r}`:"";if(i){return[{signal:`${ri(i)?`${i.signal}/2`+o:`${i/2+r}`} * (${e})`},{signal:`${ri(i)?`(1 - ${i.signal}/2)`+o:`${1-i/2+r}`} * (${e})`}]}return[0,{signal:e}]}return G(`Cannot use ${e} scale if ${i} scale is not discrete.`)}}(e,t,l);case rt:{const o=lp(r,t.component.scales[e].get("zero"),i),a=function(e,t,n,i){const r={x:tp(n,"x"),y:tp(n,"y")};switch(e){case"bar":case"tick":{if(void 0!==i.scale.maxBandSize)return i.scale.maxBandSize;const e=cp(t,r,i.view);return(0,j.hj)(e)?e-1:new Uh((()=>`${e.signal} - 1`))}case"line":case"trail":case"rule":return i.scale.maxStrokeWidth;case"text":return i.scale.maxFontSize;case"point":case"square":case"circle":{if(i.scale.maxSize)return i.scale.maxSize;const e=cp(t,r,i.view);return(0,j.hj)(e)?Math.pow(up*e,2):new Uh((()=>`pow(${up} * ${e.signal}, 2)`))}}throw new Error(qi("size",e))}(r,n,t,i);return lo(l)?function(e,t,n){const i=()=>{const i=mi(t),r=mi(e),o=`(${i} - ${r}) / (${n} - 1)`;return`sequence(${r}, ${i} + ${o}, ${o})`};return ri(t)?new Uh(i):{signal:i()}}(o,a,function(e,t,n,i){switch(e){case"quantile":return t.scale.quantileCount;case"quantize":return t.scale.quantizeCount;case"threshold":return void 0!==n&&(0,j.kJ)(n)?n.length+1:(or(function(e){return`Domain for ${e} is required for threshold scale.`}(i)),3)}}(l,i,u,e)):[o,a]}case Ge:return[0,2*Math.PI];case ot:return[0,360];case Xe:return[0,new Uh((()=>`min(${t.getSignalName("width")},${t.getSignalName("height")})/2`))];case ut:return[i.scale.minStrokeWidth,i.scale.maxStrokeWidth];case ct:return[[1,0],[4,2],[2,1],[1,1],[1,2,4,2]];case it:return"symbol";case et:case tt:case nt:return"ordinal"===l?"nominal"===a?"category":"ordinal":void 0!==c?"diverging":"rect"===r||"geoshape"===r?"heatmap":"ramp";case at:case st:case lt:return[i.scale.minOpacity,i.scale.maxOpacity]}}(e,t);return(void 0!==s||void 0!==l)&&xo(r,"rangeMin")&&(0,j.kJ)(u)&&2===u.length?Bu([s??u[0],l??u[1]]):ju(u)}function ip(e){return function(e){return!(0,j.HD)(e)&&!!e.name}(e)?{scheme:e.name,...Y(e,["name"])}:{scheme:e}}function rp(e,t,n,{center:i}={}){const r=Ht(e),o=t.getName(r),a=t.getSignalName.bind(t);return e===je&&ao(n)?i?[Uh.fromName((e=>`${a(e)}/2`),o),Uh.fromName((e=>`-${a(e)}/2`),o)]:[Uh.fromName(a,o),0]:i?[Uh.fromName((e=>`-${a(e)}/2`),o),Uh.fromName((e=>`${a(e)}/2`),o)]:[0,Uh.fromName(a,o)]}function op(e,t,n){const{encoding:i}=t,r=t.getScaleComponent(n),o=Jt(n),a=i[o];if("offset"===gl({step:e,offsetIsDiscrete:Pa(a)&&Ir(a.type)})&&ws(i,o)){const n=t.getScaleComponent(o);let i=`domain('${t.scaleName(o)}').length`;if("band"===n.get("type")){i=`bandspace(${i}, ${n.get("paddingInner")??n.get("padding")??0}, ${n.get("paddingOuter")??n.get("padding")??0})`}const a=r.get("paddingInner")??r.get("padding");return{signal:`${e.step} * ${i} / (1-${s=a,ri(s)?s.signal:(0,j.m8)(s)})`}}return e.step;var s}function ap(e,t){if("offset"===gl({step:e,offsetIsDiscrete:oo(t)}))return{step:e.step}}function sp(e,t,n){const i=e===Be?"width":"height",r=t[i];return r||wl(n,i)}function lp(e,t,n){if(t)return ri(t)?{signal:`${t.signal} ? 0 : ${lp(e,!1,n)}`}:0;switch(e){case"bar":case"tick":return n.scale.minBandSize;case"line":case"trail":case"rule":return n.scale.minStrokeWidth;case"text":return n.scale.minFontSize;case"point":case"square":case"circle":return n.scale.minSize}throw new Error(qi("size",e))}const up=.95;function cp(e,t,n){const i=yl(e.width)?e.width.step:_l(n,"width"),r=yl(e.height)?e.height.step:_l(n,"height");return t.x||t.y?new Uh((()=>`min(${[t.x?t.x.signal:i,t.y?t.y.signal:r].join(", ")})`)):Math.min(i,r)}function fp(e,t){bp(e)?function(e,t){const n=e.component.scales,{config:i,encoding:r,markDef:o,specifiedScales:a}=e;for(const s of fe(n)){const l=a[s],u=n[s],c=e.getScaleComponent(s),f=ts(r[s]),d=l[t],h=c.get("type"),p=c.get("padding"),m=c.get("paddingInner"),g=xo(h,t),y=_o(s,t);if(void 0!==d&&(g?y&&or(y):or(Yi(h,t,s))),g&&void 0===y)if(void 0!==d){const e=f.timeUnit,n=f.type;switch(t){case"domainMax":case"domainMin":ar(l[t])||"temporal"===n||e?u.set(t,{signal:ls(l[t],{type:n,timeUnit:e})},!0):u.set(t,l[t],!0);break;default:u.copyKeyFromObject(t,l)}}else{const n=t in dp?dp[t]({model:e,channel:s,fieldOrDatumDef:f,scaleType:h,scalePadding:p,scalePaddingInner:m,domain:l.domain,domainMin:l.domainMin,domainMax:l.domainMax,markDef:o,config:i,hasNestedOffsetScale:ks(r,s),hasSecondaryRangeChannel:!!r[Wt(s)]}):i.scale[t];void 0!==n&&u.set(t,n,!1)}}}(e,t):pp(e,t)}const dp={bins:({model:e,fieldOrDatumDef:t})=>Fa(t)?function(e,t){const n=t.bin;if(Vn(n)){const i=Kd(e,t.field,n);return new Uh((()=>e.getSignalName(i)))}if(Yn(n)&&Kn(n)&&void 0!==n.step)return{step:n.step};return}(e,t):void 0,interpolate:({channel:e,fieldOrDatumDef:t})=>function(e,t){if(Q([et,tt,nt],e)&&"nominal"!==t)return"hcl";return}(e,t.type),nice:({scaleType:e,channel:t,domain:n,domainMin:i,domainMax:r,fieldOrDatumDef:o})=>function(e,t,n,i,r,o){if(es(o)?.bin||(0,j.kJ)(n)||null!=r||null!=i||Q([Gr.TIME,Gr.UTC],e))return;return!!mn(t)||void 0}(e,t,n,i,r,o),padding:({channel:e,scaleType:t,fieldOrDatumDef:n,markDef:i,config:r})=>function(e,t,n,i,r,o){if(mn(e)){if(so(t)){if(void 0!==n.continuousPadding)return n.continuousPadding;const{type:t,orient:a}=r;if("bar"===t&&(!Fa(i)||!i.bin&&!i.timeUnit)&&("vertical"===a&&"x"===e||"horizontal"===a&&"y"===e))return o.continuousBandSize}if(t===Gr.POINT)return n.pointPadding}return}(e,t,r.scale,n,i,r.bar),paddingInner:({scalePadding:e,channel:t,markDef:n,scaleType:i,config:r,hasNestedOffsetScale:o})=>function(e,t,n,i,r,o=!1){if(void 0!==e)return;if(mn(t)){const{bandPaddingInner:e,barBandPaddingInner:t,rectBandPaddingInner:i,bandWithNestedOffsetPaddingInner:a}=r;return o?a:$e(e,"bar"===n?t:i)}if(xn(t)&&i===Gr.BAND)return r.offsetBandPaddingInner;return}(e,t,n.type,i,r.scale,o),paddingOuter:({scalePadding:e,channel:t,scaleType:n,scalePaddingInner:i,config:r,hasNestedOffsetScale:o})=>function(e,t,n,i,r,o=!1){if(void 0!==e)return;if(mn(t)){const{bandPaddingOuter:e,bandWithNestedOffsetPaddingOuter:t}=r;if(o)return t;if(n===Gr.BAND)return $e(e,ri(i)?{signal:`${i.signal}/2`}:i/2)}else if(xn(t)){if(n===Gr.POINT)return.5;if(n===Gr.BAND)return r.offsetBandPaddingOuter}return}(e,t,n,i,r.scale,o),reverse:({fieldOrDatumDef:e,scaleType:t,channel:n,config:i})=>function(e,t,n,i){if("x"===n&&void 0!==i.xReverse)return ao(e)&&"descending"===t?ri(i.xReverse)?{signal:`!${i.xReverse.signal}`}:!i.xReverse:i.xReverse;if(ao(e)&&"descending"===t)return!0;return}(t,Fa(e)?e.sort:void 0,n,i.scale),zero:({channel:e,fieldOrDatumDef:t,domain:n,markDef:i,scaleType:r,config:o,hasSecondaryRangeChannel:a})=>function(e,t,n,i,r,o,a){if(n&&"unaggregated"!==n&&ao(r)){if((0,j.kJ)(n)){const e=n[0],t=n[n.length-1];if((0,j.hj)(e)&&e<=0&&(0,j.hj)(t)&&t>=0)return!0}return!1}if("size"===e&&"quantitative"===t.type&&!lo(r))return!0;if((!Fa(t)||!t.bin)&&Q([...pn,...yn],e)){const{orient:t,type:n}=i;return(!Q(["bar","area","line","trail"],n)||!("horizontal"===t&&"y"===e||"vertical"===t&&"x"===e))&&(!(!Q(["bar","area"],n)||a)||o?.zero)}return!1}(e,t,n,i,r,o.scale,a)};function hp(e){bp(e)?function(e){const t=e.component.scales;for(const n of On){const i=t[n];if(!i)continue;const r=np(n,e);i.setWithExplicit("range",r)}}(e):pp(e,"range")}function pp(e,t){const n=e.component.scales;for(const i of e.children)"range"===t?hp(i):fp(i,t);for(const i of fe(n)){let r;for(const n of e.children){const e=n.component.scales[i];if(e){r=Wu(r,e.getWithExplicit(t),t,"scale",Iu(((e,n)=>"range"===t&&e.step&&n.step?e.step-n.step:0)))}}n[i].setWithExplicit(t,r)}}function mp(e,t,n,i,r=!1){const o=function(e,t,n,i){switch(t.type){case"nominal":case"ordinal":if($t(e)||"discrete"===Ln(e))return"shape"===e&&"ordinal"===t.type&&or(Xi(e,"ordinal")),"ordinal";if(mn(e)||xn(e)){if(Q(["rect","bar","image","rule"],n.type))return"band";if(i)return"band"}else if("arc"===n.type&&e in gn)return"band";return Wo(n[Ht(e)])||ja(t)&&t.axis?.tickBand?"band":"point";case"temporal":return $t(e)?"time":"discrete"===Ln(e)?(or(Xi(e,"temporal")),"ordinal"):Fa(t)&&t.timeUnit&&Er(t.timeUnit).utc?"utc":"time";case"quantitative":return $t(e)?Fa(t)&&Vn(t.bin)?"bin-ordinal":"linear":"discrete"===Ln(e)?(or(Xi(e,"quantitative")),"ordinal"):"linear";case"geojson":return}throw new Error(Bi(t.type))}(t,n,i,r),{type:a}=e;return Tn(t)?void 0!==a?function(e,t,n=!1){if(!Tn(e))return!1;switch(e){case Be:case je:case We:case He:case Ge:case Xe:return!!so(t)||"band"===t||"point"===t&&!n;case rt:case ut:case at:case st:case lt:case ot:return so(t)||lo(t)||Q(["band","point","ordinal"],t);case et:case tt:case nt:return"band"!==t;case ct:case it:return"ordinal"===t||lo(t)}}(t,a)?Fa(n)&&(s=a,l=n.type,!(Q([Wr,Xr],l)?void 0===s||oo(s):l===Hr?Q([Gr.TIME,Gr.UTC,void 0],s):l!==qr||to(s)||lo(s)||void 0===s))?(or(function(e,t){return`FieldDef does not work with "${e}" scale. We are using "${t}" scale instead.`}(a,o)),o):a:(or(function(e,t,n){return`Channel "${e}" does not work with "${t}" scale. We are using "${n}" scale instead.`}(t,a,o)),o):o:null;var s,l}function gp(e){bp(e)?e.component.scales=function(e){const{encoding:t,mark:n,markDef:i}=e,r={};for(const o of On){const a=ts(t[o]);if(a&&n===Ro&&o===it&&a.type===Jr)continue;let s=a&&a.scale;if(a&&null!==s&&!1!==s){s??(s={});const n=mp(s,o,a,i,ks(t,o));r[o]=new Qh(e.scaleName(`${o}`,!0),{value:n,explicit:s.type===n})}}return r}(e):e.component.scales=function(e){var t;const n=e.component.scales={},i={},r=e.component.resolve;for(const o of e.children){gp(o);for(const n of fe(o.component.scales))if((t=r.scale)[n]??(t[n]=Ed(n,e)),"shared"===r.scale[n]){const e=i[n],t=o.component.scales[n].getWithExplicit("type");e?Yr(e.value,t.value)?i[n]=Wu(e,t,"type","scale",yp):(r.scale[n]="independent",delete i[n]):i[n]=t}}for(const o of fe(i)){const t=e.scaleName(o,!0),r=i[o];n[o]=new Qh(t,r);for(const n of e.children){const e=n.component.scales[o];e&&(n.renameScale(e.get("name"),t),e.merged=!0)}}return n}(e)}const yp=Iu(((e,t)=>Zr(e)-Zr(t)));class vp{constructor(){this.nameMap={}}rename(e,t){this.nameMap[e]=t}has(e){return void 0!==this.nameMap[e]}get(e){for(;this.nameMap[e]&&e!==this.nameMap[e];)e=this.nameMap[e];return e}}function bp(e){return"unit"===e?.type}function xp(e){return"facet"===e?.type}function _p(e){return"concat"===e?.type}function wp(e){return"layer"===e?.type}class kp{constructor(e,t,n,i,r,o,a){this.type=t,this.parent=n,this.config=r,this.correctDataNames=e=>(e.from?.data&&(e.from.data=this.lookupDataSource(e.from.data)),e.from?.facet?.data&&(e.from.facet.data=this.lookupDataSource(e.from.facet.data)),e),this.parent=n,this.config=r,this.view=ti(a),this.name=e.name??i,this.title=ii(e.title)?{text:e.title}:e.title?ti(e.title):void 0,this.scaleNameMap=n?n.scaleNameMap:new vp,this.projectionNameMap=n?n.projectionNameMap:new vp,this.signalNameMap=n?n.signalNameMap:new vp,this.data=e.data,this.description=e.description,this.transforms=(e.transform??[]).map((e=>au(e)?{filter:X(e.filter,Ur)}:e)),this.layout="layer"===t||"unit"===t?{}:function(e,t,n){const i=n[t],r={},{spacing:o,columns:a}=i;void 0!==o&&(r.spacing=o),void 0!==a&&(_a(e)&&!ba(e.facet)||hl(e))&&(r.columns=a),pl(e)&&(r.columns=1);for(const s of bl)if(void 0!==e[s])if("spacing"===s){const t=e[s];r[s]=(0,j.hj)(t)?t:{row:t.row??o,column:t.column??o}}else r[s]=e[s];return r}(e,t,r),this.component={data:{sources:n?n.component.data.sources:[],outputNodes:n?n.component.data.outputNodes:{},outputNodeRefCounts:n?n.component.data.outputNodeRefCounts:{},isFaceted:_a(e)||n?.component.data.isFaceted&&void 0===e.data},layoutSize:new Uu,layoutHeaders:{row:{},column:{},facet:{}},mark:null,resolve:{scale:{},axis:{},legend:{},...o?J(o):{}},selection:null,scales:null,projection:null,axes:{},legends:{}}}get width(){return this.getSizeSignalRef("width")}get height(){return this.getSizeSignalRef("height")}parse(){this.parseScale(),this.parseLayoutSize(),this.renameTopLevelLayoutSizeSignal(),this.parseSelections(),this.parseProjection(),this.parseData(),this.parseAxesAndHeaders(),this.parseLegends(),this.parseMarkGroup()}parseScale(){!function(e,{ignoreRange:t}={}){gp(e),Bh(e);for(const n of bo)fp(e,n);t||hp(e)}(this)}parseProjection(){Gd(this)}renameTopLevelLayoutSizeSignal(){"width"!==this.getName("width")&&this.renameSignal(this.getName("width"),"width"),"height"!==this.getName("height")&&this.renameSignal(this.getName("height"),"height")}parseLegends(){Ld(this)}assembleEncodeFromView(e){const{style:t,...n}=e,i={};for(const r of fe(n)){const e=n[r];void 0!==e&&(i[r]=hi(e))}return i}assembleGroupEncodeEntry(e){let t={};return this.view&&(t=this.assembleEncodeFromView(this.view)),e||(this.description&&(t.description=hi(this.description)),"unit"!==this.type&&"layer"!==this.type)?ce(t)?void 0:t:{width:this.getSizeSignalRef("width"),height:this.getSizeSignalRef("height"),...t??{}}}assembleLayout(){if(!this.layout)return;const{spacing:e,...t}=this.layout,{component:n,config:i}=this,r=function(e,t){const n={};for(const i of St){const r=e[i];if(r?.facetFieldDef){const{titleAnchor:e,titleOrient:o}=od(["titleAnchor","titleOrient"],r.facetFieldDef.header,t,i),a=id(i,o),s=gd(e,a);void 0!==s&&(n[a]=s)}}return ce(n)?void 0:n}(n.layoutHeaders,i);return{padding:e,...this.assembleDefaultLayout(),...t,...r?{titleBand:r}:{}}}assembleDefaultLayout(){return{}}assembleHeaderMarks(){const{layoutHeaders:e}=this.component;let t=[];for(const n of St)e[n].title&&t.push(ld(this,n));for(const n of ad)t=t.concat(fd(this,n));return t}assembleAxes(){return function(e,t){const{x:n=[],y:i=[]}=e;return[...n.map((e=>Hf(e,"grid",t))),...i.map((e=>Hf(e,"grid",t))),...n.map((e=>Hf(e,"main",t))),...i.map((e=>Hf(e,"main",t)))].filter((e=>e))}(this.component.axes,this.config)}assembleLegends(){return qd(this)}assembleProjections(){return Wd(this)}assembleTitle(){const{encoding:e,...t}=this.title??{},n={...ni(this.config.title).nonMarkTitleProperties,...t,...e?{encode:{update:e}}:{}};if(n.text)return Q(["unit","layer"],this.type)?Q(["middle",void 0],n.anchor)&&(n.frame??(n.frame="group")):n.anchor??(n.anchor="start"),ce(n)?void 0:n}assembleGroup(e=[]){const t={};(e=e.concat(this.assembleSignals())).length>0&&(t.signals=e);const n=this.assembleLayout();n&&(t.layout=n),t.marks=[].concat(this.assembleHeaderMarks(),this.assembleMarks());const i=!this.parent||xp(this.parent)?Kh(this):[];i.length>0&&(t.scales=i);const r=this.assembleAxes();r.length>0&&(t.axes=r);const o=this.assembleLegends();return o.length>0&&(t.legends=o),t}getName(e){return me((this.name?`${this.name}_`:"")+e)}getDataName(e){return this.getName(Qu[e].toLowerCase())}requestDataName(e){const t=this.getDataName(e),n=this.component.data.outputNodeRefCounts;return n[t]=(n[t]||0)+1,t}getSizeSignalRef(e){if(xp(this.parent)){const t=vn(wd(e)),n=this.component.scales[t];if(n&&!n.merged){const e=n.get("type"),i=n.get("range");if(oo(e)&&oi(i)){const e=n.get("name"),i=Vh(Yh(this,t));if(i){return{signal:_d(e,n,Ha({aggregate:"distinct",field:i},{expr:"datum"}))}}return or(Fi(t)),null}}}return{signal:this.signalNameMap.get(this.getName(e))}}lookupDataSource(e){const t=this.component.data.outputNodes[e];return t?t.getSource():e}getSignalName(e){return this.signalNameMap.get(e)}renameSignal(e,t){this.signalNameMap.rename(e,t)}renameScale(e,t){this.scaleNameMap.rename(e,t)}renameProjection(e,t){this.projectionNameMap.rename(e,t)}scaleName(e,t){return t?this.getName(e):Ut(e)&&Tn(e)&&this.component.scales[e]||this.scaleNameMap.has(this.getName(e))?this.scaleNameMap.get(this.getName(e)):void 0}projectionName(e){return e?this.getName("projection"):this.component.projection&&!this.component.projection.merged||this.projectionNameMap.has(this.getName("projection"))?this.projectionNameMap.get(this.getName("projection")):void 0}getScaleComponent(e){if(!this.component.scales)throw new Error("getScaleComponent cannot be called before parseScale(). Make sure you have called parseScale or use parseUnitModelWithScale().");const t=this.component.scales[e];return t&&!t.merged?t:this.parent?this.parent.getScaleComponent(e):void 0}getSelectionComponent(e,t){let n=this.component.selection[e];if(!n&&this.parent&&(n=this.parent.getSelectionComponent(e,t)),!n)throw new Error(`Cannot find a selection named "${t}".`);return n}hasAxisOrientSignalRef(){return this.component.axes.x?.some((e=>e.hasOrientSignalRef()))||this.component.axes.y?.some((e=>e.hasOrientSignalRef()))}}class Ep extends kp{vgField(e,t={}){const n=this.fieldDef(e);if(n)return Ha(n,t)}reduceFieldDef(e,t){return function(e,t,n,i){return e?fe(e).reduce(((n,r)=>{const o=e[r];return(0,j.kJ)(o)?o.reduce(((e,n)=>t.call(i,e,n,r)),n):t.call(i,n,o,r)}),n):n}(this.getMapping(),((t,n,i)=>{const r=es(n);return r?e(t,r,i):t}),t)}forEachFieldDef(e,t){Ss(this.getMapping(),((t,n)=>{const i=es(t);i&&e(i,n)}),t)}}class Dp extends sc{clone(){return new Dp(null,J(this.transform))}constructor(e,t){super(e),this.transform=t,this.transform=J(t);const n=this.transform.as??[void 0,void 0];this.transform.as=[n[0]??"value",n[1]??"density"]}dependentFields(){return new Set([this.transform.density,...this.transform.groupby??[]])}producedFields(){return new Set(this.transform.as)}hash(){return`DensityTransform ${K(this.transform)}`}assemble(){const{density:e,...t}=this.transform,n={type:"kde",field:e,...t};return this.transform.groupby&&(n.resolve="shared"),n}}class $p extends sc{clone(){return new $p(null,J(this.transform))}constructor(e,t){super(e),this.transform=t,this.transform=J(t)}dependentFields(){return new Set([this.transform.extent])}producedFields(){return new Set([])}hash(){return`ExtentTransform ${K(this.transform)}`}assemble(){const{extent:e,param:t}=this.transform;return{type:"extent",field:e,signal:t}}}class Ap extends sc{clone(){return new Ap(null,{...this.filter})}constructor(e,t){super(e),this.filter=t}static make(e,t){const{config:n,mark:i,markDef:r}=t;if("filter"!==vi("invalid",r,n))return null;const o=t.reduceFieldDef(((e,n,r)=>{const o=Tn(r)&&t.getScaleComponent(r);if(o){ao(o.get("type"))&&"count"!==n.aggregate&&!Po(i)&&(e[n.field]=n)}return e}),{});return fe(o).length?new Ap(e,o):null}dependentFields(){return new Set(fe(this.filter))}producedFields(){return new Set}hash(){return`FilterInvalid ${K(this.filter)}`}assemble(){const e=fe(this.filter).reduce(((e,t)=>{const n=this.filter[t],i=Ha(n,{expr:"datum"});return null!==n&&("temporal"===n.type?e.push(`(isDate(${i}) || (isValid(${i}) && isFinite(+${i})))`):"quantitative"===n.type&&(e.push(`isValid(${i})`),e.push(`isFinite(+${i})`))),e}),[]);return e.length>0?{type:"filter",expr:e.join(" && ")}:null}}class Sp extends sc{clone(){return new Sp(this.parent,J(this.transform))}constructor(e,t){super(e),this.transform=t,this.transform=J(t);const{flatten:n,as:i=[]}=this.transform;this.transform.as=n.map(((e,t)=>i[t]??e))}dependentFields(){return new Set(this.transform.flatten)}producedFields(){return new Set(this.transform.as)}hash(){return`FlattenTransform ${K(this.transform)}`}assemble(){const{flatten:e,as:t}=this.transform;return{type:"flatten",fields:e,as:t}}}class Mp extends sc{clone(){return new Mp(null,J(this.transform))}constructor(e,t){super(e),this.transform=t,this.transform=J(t);const n=this.transform.as??[void 0,void 0];this.transform.as=[n[0]??"key",n[1]??"value"]}dependentFields(){return new Set(this.transform.fold)}producedFields(){return new Set(this.transform.as)}hash(){return`FoldTransform ${K(this.transform)}`}assemble(){const{fold:e,as:t}=this.transform;return{type:"fold",fields:e,as:t}}}class Cp extends sc{clone(){return new Cp(null,J(this.fields),this.geojson,this.signal)}static parseAll(e,t){if(t.component.projection&&!t.component.projection.isFit)return e;let n=0;for(const i of[[Ke,Ye],[Qe,Ze]]){const r=i.map((e=>{const n=ts(t.encoding[e]);return Fa(n)?n.field:Ta(n)?{expr:`${n.datum}`}:Ua(n)?{expr:`${n.value}`}:void 0}));(r[0]||r[1])&&(e=new Cp(e,r,null,t.getName("geojson_"+n++)))}if(t.channelHasField(it)){const i=t.typedFieldDef(it);i.type===Jr&&(e=new Cp(e,null,i.field,t.getName("geojson_"+n++)))}return e}constructor(e,t,n,i){super(e),this.fields=t,this.geojson=n,this.signal=i}dependentFields(){const e=(this.fields??[]).filter(j.HD);return new Set([...this.geojson?[this.geojson]:[],...e])}producedFields(){return new Set}hash(){return`GeoJSON ${this.geojson} ${this.signal} ${K(this.fields)}`}assemble(){return[...this.geojson?[{type:"filter",expr:`isValid(datum["${this.geojson}"])`}]:[],{type:"geojson",...this.fields?{fields:this.fields}:{},...this.geojson?{geojson:this.geojson}:{},signal:this.signal}]}}class Fp extends sc{clone(){return new Fp(null,this.projection,J(this.fields),J(this.as))}constructor(e,t,n,i){super(e),this.projection=t,this.fields=n,this.as=i}static parseAll(e,t){if(!t.projectionName())return e;for(const n of[[Ke,Ye],[Qe,Ze]]){const i=n.map((e=>{const n=ts(t.encoding[e]);return Fa(n)?n.field:Ta(n)?{expr:`${n.datum}`}:Ua(n)?{expr:`${n.value}`}:void 0})),r=n[0]===Qe?"2":"";(i[0]||i[1])&&(e=new Fp(e,t.projectionName(),i,[t.getName(`x${r}`),t.getName(`y${r}`)]))}return e}dependentFields(){return new Set(this.fields.filter(j.HD))}producedFields(){return new Set(this.as)}hash(){return`Geopoint ${this.projection} ${K(this.fields)} ${K(this.as)}`}assemble(){return{type:"geopoint",projection:this.projection,fields:this.fields,as:this.as}}}class Op extends sc{clone(){return new Op(null,J(this.transform))}constructor(e,t){super(e),this.transform=t}dependentFields(){return new Set([this.transform.impute,this.transform.key,...this.transform.groupby??[]])}producedFields(){return new Set([this.transform.impute])}processSequence(e){const{start:t=0,stop:n,step:i}=e;return{signal:`sequence(${[t,n,...i?[i]:[]].join(",")})`}}static makeFromTransform(e,t){return new Op(e,t)}static makeFromEncoding(e,t){const n=t.encoding,i=n.x,r=n.y;if(Fa(i)&&Fa(r)){const o=i.impute?i:r.impute?r:void 0;if(void 0===o)return;const a=i.impute?r:r.impute?i:void 0,{method:s,value:l,frame:u,keyvals:c}=o.impute,f=Ms(t.mark,n);return new Op(e,{impute:o.field,key:a.field,...s?{method:s}:{},...void 0!==l?{value:l}:{},...u?{frame:u}:{},...void 0!==c?{keyvals:c}:{},...f.length?{groupby:f}:{}})}return null}hash(){return`Impute ${K(this.transform)}`}assemble(){const{impute:e,key:t,keyvals:n,method:i,groupby:r,value:o,frame:a=[null,null]}=this.transform,s={type:"impute",field:e,key:t,...n?{keyvals:su(n)?this.processSequence(n):n}:{},method:"value",...r?{groupby:r}:{},value:i&&"value"!==i?null:o};if(i&&"value"!==i){return[s,{type:"window",as:[`imputed_${e}_value`],ops:[i],fields:[e],frame:a,ignorePeers:!1,...r?{groupby:r}:{}},{type:"formula",expr:`datum.${e} === null ? datum.imputed_${e}_value : datum.${e}`,as:e}]}return[s]}}class Tp extends sc{clone(){return new Tp(null,J(this.transform))}constructor(e,t){super(e),this.transform=t,this.transform=J(t);const n=this.transform.as??[void 0,void 0];this.transform.as=[n[0]??t.on,n[1]??t.loess]}dependentFields(){return new Set([this.transform.loess,this.transform.on,...this.transform.groupby??[]])}producedFields(){return new Set(this.transform.as)}hash(){return`LoessTransform ${K(this.transform)}`}assemble(){const{loess:e,on:t,...n}=this.transform;return{type:"loess",x:t,y:e,...n}}}class Np extends sc{clone(){return new Np(null,J(this.transform),this.secondary)}constructor(e,t,n){super(e),this.transform=t,this.secondary=n}static make(e,t,n,i){const r=t.component.data.sources,{from:o}=n;let a=null;if(function(e){return"data"in e}(o)){let e=Vp(o.data,r);e||(e=new ch(o.data),r.push(e));const n=t.getName(`lookup_${i}`);a=new lc(e,n,Qu.Lookup,t.component.data.outputNodeRefCounts),t.component.data.outputNodes[n]=a}else if(function(e){return"param"in e}(o)){const e=o.param;let i;n={as:e,...n};try{i=t.getSelectionComponent(me(e),e)}catch(s){throw new Error(`Lookups can only be performed on selection parameters. "${e}" is a variable parameter.`)}if(a=i.materialized,!a)throw new Error(function(e){return`Cannot define and lookup the "${e}" selection in the same view. Try moving the lookup into a second, layered view?`}(e))}return new Np(e,n,a.getSource())}dependentFields(){return new Set([this.transform.lookup])}producedFields(){return new Set(this.transform.as?(0,j.IX)(this.transform.as):this.transform.from.fields)}hash(){return`Lookup ${K({transform:this.transform,secondary:this.secondary})}`}assemble(){let e;if(this.transform.from.fields)e={values:this.transform.from.fields,...this.transform.as?{as:(0,j.IX)(this.transform.as)}:{}};else{let t=this.transform.as;(0,j.HD)(t)||(or('If "from.fields" is not specified, "as" has to be a string that specifies the key to be used for the data from the secondary source.'),t="_lookup"),e={as:[t]}}return{type:"lookup",from:this.secondary,key:this.transform.from.key,fields:[this.transform.lookup],...e,...this.transform.default?{default:this.transform.default}:{}}}}class zp extends sc{clone(){return new zp(null,J(this.transform))}constructor(e,t){super(e),this.transform=t,this.transform=J(t);const n=this.transform.as??[void 0,void 0];this.transform.as=[n[0]??"prob",n[1]??"value"]}dependentFields(){return new Set([this.transform.quantile,...this.transform.groupby??[]])}producedFields(){return new Set(this.transform.as)}hash(){return`QuantileTransform ${K(this.transform)}`}assemble(){const{quantile:e,...t}=this.transform;return{type:"quantile",field:e,...t}}}class Rp extends sc{clone(){return new Rp(null,J(this.transform))}constructor(e,t){super(e),this.transform=t,this.transform=J(t);const n=this.transform.as??[void 0,void 0];this.transform.as=[n[0]??t.on,n[1]??t.regression]}dependentFields(){return new Set([this.transform.regression,this.transform.on,...this.transform.groupby??[]])}producedFields(){return new Set(this.transform.as)}hash(){return`RegressionTransform ${K(this.transform)}`}assemble(){const{regression:e,on:t,...n}=this.transform;return{type:"regression",x:t,y:e,...n}}}class Pp extends sc{clone(){return new Pp(null,J(this.transform))}constructor(e,t){super(e),this.transform=t}addDimensions(e){this.transform.groupby=re((this.transform.groupby??[]).concat(e),(e=>e))}producedFields(){}dependentFields(){return new Set([this.transform.pivot,this.transform.value,...this.transform.groupby??[]])}hash(){return`PivotTransform ${K(this.transform)}`}assemble(){const{pivot:e,value:t,groupby:n,limit:i,op:r}=this.transform;return{type:"pivot",field:e,value:t,...void 0!==i?{limit:i}:{},...void 0!==r?{op:r}:{},...void 0!==n?{groupby:n}:{}}}}class Lp extends sc{clone(){return new Lp(null,J(this.transform))}constructor(e,t){super(e),this.transform=t}dependentFields(){return new Set}producedFields(){return new Set}hash(){return`SampleTransform ${K(this.transform)}`}assemble(){return{type:"sample",size:this.transform.sample}}}function Up(e){let t=0;return function n(i,r){if(i instanceof ch&&!i.isGenerator&&!Xu(i.data)){e.push(r);r={name:null,source:r.name,transform:[]}}if(i instanceof ah&&(i.parent instanceof ch&&!r.source?(r.format={...r.format??{},parse:i.assembleFormatParse()},r.transform.push(...i.assembleTransforms(!0))):r.transform.push(...i.assembleTransforms())),i instanceof nh)return r.name||(r.name="data_"+t++),!r.source||r.transform.length>0?(e.push(r),i.data=r.name):i.data=r.source,void e.push(...i.assemble());if((i instanceof lh||i instanceof uh||i instanceof Ap||i instanceof Bf||i instanceof td||i instanceof Fp||i instanceof th||i instanceof Np||i instanceof Fh||i instanceof Mh||i instanceof Mp||i instanceof Sp||i instanceof Dp||i instanceof Tp||i instanceof zp||i instanceof Rp||i instanceof sh||i instanceof Lp||i instanceof Pp||i instanceof $p)&&r.transform.push(i.assemble()),(i instanceof Qd||i instanceof fc||i instanceof Op||i instanceof Ch||i instanceof Cp)&&r.transform.push(...i.assemble()),i instanceof lc)if(r.source&&0===r.transform.length)i.setSource(r.source);else if(i.parent instanceof lc)i.setSource(r.name);else if(r.name||(r.name="data_"+t++),i.setSource(r.name),1===i.numChildren()){e.push(r);r={name:null,source:r.name,transform:[]}}switch(i.numChildren()){case 0:i instanceof lc&&(!r.source||r.transform.length>0)&&e.push(r);break;case 1:n(i.children[0],r);break;default:{r.name||(r.name="data_"+t++);let o=r.name;!r.source||r.transform.length>0?e.push(r):o=r.source;for(const e of i.children){n(e,{name:null,source:o,transform:[]})}break}}}}function Bp(e){return"top"===e||"left"===e||ri(e)?"header":"footer"}function jp(e,t){const{facet:n,config:i,child:r,component:o}=e;if(e.channelHasField(t)){const a=n[t],s=rd("title",null,i,t);let l=Ya(a,i,{allowDisabling:!0,includeDefault:void 0===s||!!s});r.component.layoutHeaders[t].title&&(l=(0,j.kJ)(l)?l.join(", "):l,l+=` / ${r.component.layoutHeaders[t].title}`,r.component.layoutHeaders[t].title=null);const u=rd("labelOrient",a.header,i,t),c=null!==a.header&&$e(a.header?.labels,i.header.labels,!0),f=Q(["bottom","right"],u)?"footer":"header";o.layoutHeaders[t]={title:null!==a.header?l:null,facetFieldDef:a,[f]:"facet"===t?[]:[Ip(e,t,c)]}}}function Ip(e,t,n){const i="row"===t?"height":"width";return{labels:n,sizeSignal:e.child.component.layoutSize.get(i)?e.child.getSizeSignalRef(i):void 0,axes:[]}}function qp(e,t){const{child:n}=e;if(n.component.axes[t]){const{layoutHeaders:i,resolve:r}=e.component;if(r.axis[t]=Dd(r,t),"shared"===r.axis[t]){const r="x"===t?"column":"row",o=i[r];for(const i of n.component.axes[t]){const t=Bp(i.get("orient"));o[t]??(o[t]=[Ip(e,r,!1)]);const n=Hf(i,"main",e.config,{header:!0});n&&o[t][0].axes.push(n),i.mainExtracted=!0}}}}function Wp(e){for(const t of e.children)t.parseLayoutSize()}function Hp(e,t){const n=wd(t),i=vn(n),r=e.component.resolve,o=e.component.layoutSize;let a;for(const s of e.children){const t=s.component.layoutSize.getWithExplicit(n),o=r.scale[i]??Ed(i,e);if("independent"===o&&"step"===t.value){a=void 0;break}if(a){if("independent"===o&&a.value!==t.value){a=void 0;break}a=Wu(a,t,n,"")}else a=t}if(a){for(const i of e.children)e.renameSignal(i.getName(n),e.getName(t)),i.component.layoutSize.set(n,"merged",!1);o.setWithExplicit(t,a)}else o.setWithExplicit(t,{explicit:!1,value:void 0})}function Xp(e,t){const n="width"===t?"x":"y",i=e.config,r=e.getScaleComponent(n);if(r){const e=r.get("type"),n=r.get("range");if(oo(e)){const e=wl(i.view,t);return oi(n)||yl(e)?"step":e}return xl(i.view,t)}if(e.hasProjection||"arc"===e.mark)return xl(i.view,t);{const e=wl(i.view,t);return yl(e)?e.step:e}}function Jp(e,t,n){return Ha(t,{suffix:`by_${Ha(e)}`,...n??{}})}class Gp extends Ep{constructor(e,t,n,i){super(e,"facet",t,n,i,e.resolve),this.child=_m(e.spec,this,this.getName("child"),void 0,i),this.children=[this.child],this.facet=this.initFacet(e.facet)}initFacet(e){if(!ba(e))return{facet:this.initFacetFieldDef(e,"facet")};const t=fe(e),n={};for(const i of t){if(![Pe,Le].includes(i)){or(qi(i,"facet"));break}const t=e[i];if(void 0===t.field){or(Ii(t,i));break}n[i]=this.initFacetFieldDef(t,i)}return n}initFacetFieldDef(e,t){const n=rs(e,t);return n.header?n.header=ti(n.header):null===n.header&&(n.header=null),n}channelHasField(e){return!!this.facet[e]}fieldDef(e){return this.facet[e]}parseData(){this.component.data=Yp(this),this.child.parseData()}parseLayoutSize(){Wp(this)}parseSelections(){this.child.parseSelections(),this.component.selection=this.child.component.selection}parseMarkGroup(){this.child.parseMarkGroup()}parseAxesAndHeaders(){this.child.parseAxesAndHeaders(),function(e){for(const t of St)jp(e,t);qp(e,"x"),qp(e,"y")}(this)}assembleSelectionTopLevelSignals(e){return this.child.assembleSelectionTopLevelSignals(e)}assembleSignals(){return this.child.assembleSignals(),[]}assembleSelectionData(e){return this.child.assembleSelectionData(e)}getHeaderLayoutMixins(){const e={};for(const t of St)for(const n of sd){const i=this.component.layoutHeaders[t],r=i[n],{facetFieldDef:o}=i;if(o){const n=rd("titleOrient",o.header,this.config,t);if(["right","bottom"].includes(n)){const i=id(t,n);e.titleAnchor??(e.titleAnchor={}),e.titleAnchor[i]="end"}}if(r?.[0]){const r="row"===t?"height":"width",o="header"===n?"headerBand":"footerBand";"facet"===t||this.child.component.layoutSize.get(r)||(e[o]??(e[o]={}),e[o][t]=.5),i.title&&(e.offset??(e.offset={}),e.offset["row"===t?"rowTitle":"columnTitle"]=10)}}return e}assembleDefaultLayout(){const{column:e,row:t}=this.facet,n=e?this.columnDistinctSignal():t?1:void 0;let i="all";return(t||"independent"!==this.component.resolve.scale.x)&&(e||"independent"!==this.component.resolve.scale.y)||(i="none"),{...this.getHeaderLayoutMixins(),...n?{columns:n}:{},bounds:"full",align:i}}assembleLayoutSignals(){return this.child.assembleLayoutSignals()}columnDistinctSignal(){if(!(this.parent&&this.parent instanceof Gp)){return{signal:`length(data('${this.getName("column_domain")}'))`}}}assembleGroupStyle(){}assembleGroup(e){return this.parent&&this.parent instanceof Gp?{...this.channelHasField("column")?{encode:{update:{columns:{field:Ha(this.facet.column,{prefix:"distinct"})}}}}:{},...super.assembleGroup(e)}:super.assembleGroup(e)}getCardinalityAggregateForChild(){const e=[],t=[],n=[];if(this.child instanceof Gp){if(this.child.channelHasField("column")){const i=Ha(this.child.facet.column);e.push(i),t.push("distinct"),n.push(`distinct_${i}`)}}else for(const i of pn){const r=this.child.component.scales[i];if(r&&!r.merged){const o=r.get("type"),a=r.get("range");if(oo(o)&&oi(a)){const r=Vh(Yh(this.child,i));r?(e.push(r),t.push("distinct"),n.push(`distinct_${r}`)):or(Fi(i))}}}return{fields:e,ops:t,as:n}}assembleFacet(){const{name:e,data:t}=this.component.data.facetRoot,{row:n,column:i}=this.facet,{fields:r,ops:o,as:a}=this.getCardinalityAggregateForChild(),s=[];for(const u of St){const e=this.facet[u];if(e){s.push(Ha(e));const{bin:t,sort:l}=e;if(Vn(t)&&s.push(Ha(e,{binSuffix:"end"})),ya(l)){const{field:t,op:s=ha}=l,u=Jp(e,l);n&&i?(r.push(u),o.push("max"),a.push(u)):(r.push(t),o.push(s),a.push(u))}else if((0,j.kJ)(l)){const t=nd(e,u);r.push(t),o.push("max"),a.push(t)}}}const l=!!n&&!!i;return{name:e,data:t,groupby:s,...l||r.length>0?{aggregate:{...l?{cross:l}:{},...r.length?{fields:r,ops:o,as:a}:{}}}:{}}}facetSortFields(e){const{facet:t}=this,n=t[e];return n?ya(n.sort)?[Jp(n,n.sort,{expr:"datum"})]:(0,j.kJ)(n.sort)?[nd(n,e,{expr:"datum"})]:[Ha(n,{expr:"datum"})]:[]}facetSortOrder(e){const{facet:t}=this,n=t[e];if(n){const{sort:e}=n;return[(ya(e)?e.order:!(0,j.kJ)(e)&&e)||"ascending"]}return[]}assembleLabelTitle(){const{facet:e,config:t}=this;if(e.facet)return hd(e.facet,"facet",t);const n={row:["top","bottom"],column:["left","right"]};for(const i of ad)if(e[i]){const r=rd("labelOrient",e[i]?.header,t,i);if(n[i].includes(r))return hd(e[i],i,t)}}assembleMarks(){const{child:e}=this,t=function(e){const t=[],n=Up(t);for(const i of e.children)n(i,{source:e.name,name:null,transform:[]});return t}(this.component.data.facetRoot),n=e.assembleGroupEncodeEntry(!1),i=this.assembleLabelTitle()||e.assembleTitle(),r=e.assembleGroupStyle();return[{name:this.getName("cell"),type:"group",...i?{title:i}:{},...r?{style:r}:{},from:{facet:this.assembleFacet()},sort:{field:St.map((e=>this.facetSortFields(e))).flat(),order:St.map((e=>this.facetSortOrder(e))).flat()},...t.length>0?{data:t}:{},...n?{encode:{update:n}}:{},...e.assembleGroup(rc(this,[]))}]}getMapping(){return this.facet}}function Vp(e,t){for(const n of t){const t=n.data;if(e.name&&n.hasName()&&e.name!==n.dataName)continue;const i=e.format?.mesh,r=t.format?.feature;if(i&&r)continue;const o=e.format?.feature;if((o||r)&&o!==r)continue;const a=t.format?.mesh;if(!i&&!a||i===a)if(Ju(e)&&Ju(t)){if(ze(e.values,t.values))return n}else if(Xu(e)&&Xu(t)){if(e.url===t.url)return n}else if(Gu(e)&&e.name===n.dataName)return n}return null}function Yp(e){let t=function(e,t){if(e.data||!e.parent){if(null===e.data){const e=new ch({values:[]});return t.push(e),e}const n=Vp(e.data,t);if(n)return Vu(e.data)||(n.data.format=ne({},e.data.format,n.data.format)),!n.hasName()&&e.data.name&&(n.dataName=e.data.name),n;{const n=new ch(e.data);return t.push(n),n}}return e.parent.component.data.facetRoot?e.parent.component.data.facetRoot:e.parent.component.data.main}(e,e.component.data.sources);const{outputNodes:n,outputNodeRefCounts:i}=e.component.data,r=e.data,o=!(r&&(Vu(r)||Xu(r)||Ju(r)))&&e.parent?e.parent.component.data.ancestorParse.clone():new Hu;Vu(r)?(Yu(r)?t=new uh(t,r.sequence):Zu(r)&&(t=new lh(t,r.graticule)),o.parseNothing=!0):null===r?.format?.parse&&(o.parseNothing=!0),t=ah.makeExplicit(t,e,o)??t,t=new sh(t);const a=e.parent&&wp(e.parent);(bp(e)||xp(e))&&a&&(t=Qd.makeFromEncoding(t,e)??t),e.transforms.length>0&&(t=function(e,t,n){let i=0;for(const r of t.transforms){let o,a;if(vu(r))a=e=new td(e,r),o="derived";else if(au(r)){const i=rh(r);a=e=ah.makeWithAncestors(e,{},i,n)??e,e=new Bf(e,t,r.filter)}else if(bu(r))a=e=Qd.makeFromTransform(e,r,t),o="number";else if(_u(r))o="date",void 0===n.getWithExplicit(r.field).value&&(e=new ah(e,{[r.field]:o}),n.set(r.field,o,!1)),a=e=fc.makeFromTransform(e,r);else if(wu(r))a=e=th.makeFromTransform(e,r),o="number",Nf(t)&&(e=new sh(e));else if(lu(r))a=e=Np.make(e,t,r,i++),o="derived";else if(mu(r))a=e=new Fh(e,r),o="number";else if(gu(r))a=e=new Mh(e,r),o="number";else if(ku(r))a=e=Ch.makeFromTransform(e,r),o="derived";else if(Eu(r))a=e=new Mp(e,r),o="derived";else if(Du(r))a=e=new $p(e,r),o="derived";else if(yu(r))a=e=new Sp(e,r),o="derived";else if(uu(r))a=e=new Pp(e,r),o="derived";else if(pu(r))e=new Lp(e,r);else if(xu(r))a=e=Op.makeFromTransform(e,r),o="derived";else if(cu(r))a=e=new Dp(e,r),o="derived";else if(fu(r))a=e=new zp(e,r),o="derived";else if(du(r))a=e=new Rp(e,r),o="derived";else{if(!hu(r)){or(`Ignoring an invalid transform: ${Re(r)}.`);continue}a=e=new Tp(e,r),o="derived"}if(a&&void 0!==o)for(const e of a.producedFields()??[])n.set(e,o,!1)}return e}(t,e,o));const s=function(e){const t={};if(bp(e)&&e.component.selection)for(const n of fe(e.component.selection)){const i=e.component.selection[n];for(const e of i.project.items)!e.channel&&De(e.field)>1&&(t[e.field]="flatten")}return t}(e),l=oh(e);t=ah.makeWithAncestors(t,{},{...s,...l},o)??t,bp(e)&&(t=Cp.parseAll(t,e),t=Fp.parseAll(t,e)),(bp(e)||xp(e))&&(a||(t=Qd.makeFromEncoding(t,e)??t),t=fc.makeFromEncoding(t,e)??t,t=td.parseAllForSortIndex(t,e));const u=e.getDataName(Qu.Raw),c=new lc(t,u,Qu.Raw,i);if(n[u]=c,t=c,bp(e)){const n=th.makeFromEncoding(t,e);n&&(t=n,Nf(e)&&(t=new sh(t))),t=Op.makeFromEncoding(t,e)??t,t=Ch.makeFromEncoding(t,e)??t}bp(e)&&(t=Ap.make(t,e)??t);const f=e.getDataName(Qu.Main),d=new lc(t,f,Qu.Main,i);n[f]=d,t=d,bp(e)&&function(e,t){for(const[n,i]of he(e.component.selection??{})){const r=e.getName(`lookup_${n}`);e.component.data.outputNodes[r]=i.materialized=new lc(new Bf(t,e,{param:n}),r,Qu.Lookup,e.component.data.outputNodeRefCounts)}}(e,d);let h=null;if(xp(e)){const i=e.getName("facet");t=function(e,t){const{row:n,column:i}=t;if(n&&i){let t=null;for(const r of[n,i])if(ya(r.sort)){const{field:n,op:i=ha}=r.sort;e=t=new Mh(e,{joinaggregate:[{op:i,field:n,as:Jp(r,r.sort,{forAs:!0})}],groupby:[Ha(r)]})}return t}return null}(t,e.facet)??t,h=new nh(t,e,i,d.getSource()),n[i]=h}return{...e.component.data,outputNodes:n,outputNodeRefCounts:i,raw:c,main:d,facetRoot:h,ancestorParse:o}}class Kp extends kp{constructor(e,t,n,i){super(e,"concat",t,n,i,e.resolve),"shared"!==e.resolve?.axis?.x&&"shared"!==e.resolve?.axis?.y||or("Axes cannot be shared in concatenated or repeated views yet (https://github.com/vega/vega-lite/issues/2415)."),this.children=this.getChildren(e).map(((e,t)=>_m(e,this,this.getName(`concat_${t}`),void 0,i)))}parseData(){this.component.data=Yp(this);for(const e of this.children)e.parseData()}parseSelections(){this.component.selection={};for(const e of this.children){e.parseSelections();for(const t of fe(e.component.selection))this.component.selection[t]=e.component.selection[t]}}parseMarkGroup(){for(const e of this.children)e.parseMarkGroup()}parseAxesAndHeaders(){for(const e of this.children)e.parseAxesAndHeaders()}getChildren(e){return pl(e)?e.vconcat:ml(e)?e.hconcat:e.concat}parseLayoutSize(){!function(e){Wp(e);const t=1===e.layout.columns?"width":"childWidth",n=void 0===e.layout.columns?"height":"childHeight";Hp(e,t),Hp(e,n)}(this)}parseAxisGroup(){return null}assembleSelectionTopLevelSignals(e){return this.children.reduce(((e,t)=>t.assembleSelectionTopLevelSignals(e)),e)}assembleSignals(){return this.children.forEach((e=>e.assembleSignals())),[]}assembleLayoutSignals(){const e=vd(this);for(const t of this.children)e.push(...t.assembleLayoutSignals());return e}assembleSelectionData(e){return this.children.reduce(((e,t)=>t.assembleSelectionData(e)),e)}assembleMarks(){return this.children.map((e=>{const t=e.assembleTitle(),n=e.assembleGroupStyle(),i=e.assembleGroupEncodeEntry(!1);return{type:"group",name:e.getName("group"),...t?{title:t}:{},...n?{style:n}:{},...i?{encode:{update:i}}:{},...e.assembleGroup()}}))}assembleGroupStyle(){}assembleDefaultLayout(){const e=this.layout.columns;return{...null!=e?{columns:e}:{},bounds:"full",align:"each"}}}const Zp={disable:1,gridScale:1,scale:1,...ms,labelExpr:1,encode:1},Qp=fe(Zp);class em extends Uu{constructor(e={},t={},n=!1){super(),this.explicit=e,this.implicit=t,this.mainExtracted=n}clone(){return new em(J(this.explicit),J(this.implicit),this.mainExtracted)}hasAxisPart(e){return"axis"===e||("grid"===e||"title"===e?!!this.get(e):!(!1===(t=this.get(e))||null===t));var t}hasOrientSignalRef(){return ri(this.explicit.orient)}}const tm={bottom:"top",top:"bottom",left:"right",right:"left"};function nm(e,t){if(!e)return t.map((e=>e.clone()));{if(e.length!==t.length)return;const n=e.length;for(let i=0;i<n;i++){const n=e[i],r=t[i];if(!!n!==!!r)return;if(n&&r){const t=n.getWithExplicit("orient"),o=r.getWithExplicit("orient");if(t.explicit&&o.explicit&&t.value!==o.value)return;e[i]=im(n,r)}}}return e}function im(e,t){for(const n of Qp){const i=Wu(e.getWithExplicit(n),t.getWithExplicit(n),n,"axis",((e,t)=>{switch(n){case"title":return Di(e,t);case"gridScale":return{explicit:e.explicit,value:$e(e.value,t.value)}}return qu(e,t,n,"axis")}));e.setWithExplicit(n,i)}return e}function rm(e,t,n,i,r){if("disable"===t)return void 0!==n;switch(n=n||{},t){case"titleAngle":case"labelAngle":return e===(ri(n.labelAngle)?n.labelAngle:Oe(n.labelAngle));case"values":return!!n.values;case"encode":return!!n.encoding||!!n.labelAngle;case"title":if(e===ed(i,r))return!0}return e===n[t]}const om=new Set(["grid","translate","format","formatType","orient","labelExpr","tickCount","position","tickMinStep"]);function am(e,t){let n=t.axis(e);const i=new em,r=ts(t.encoding[e]),{mark:o,config:a}=t,s=n?.orient||a["x"===e?"axisX":"axisY"]?.orient||a.axis?.orient||function(e){return"x"===e?"bottom":"left"}(e),l=t.getScaleComponent(e).get("type"),u=function(e,t,n,i){const r="band"===t?["axisDiscrete","axisBand"]:"point"===t?["axisDiscrete","axisPoint"]:to(t)?["axisQuantitative"]:"time"===t||"utc"===t?["axisTemporal"]:[],o="x"===e?"axisX":"axisY",a=ri(n)?"axisOrient":`axis${ve(n)}`,s=[...r,...r.map((e=>o+e.substr(4)))],l=["axis",a,o];return{vlOnlyAxisConfig:Jf(s,i,e,n),vgAxisConfig:Jf(l,i,e,n),axisConfigStyle:Gf([...l,...s],i)}}(e,l,s,t.config),c=void 0!==n?!n:Vf("disable",a.style,n?.style,u).configValue;if(i.set("disable",c,void 0!==n),c)return i;n=n||{};const f=function(e,t,n,i,r){const o=t?.labelAngle;if(void 0!==o)return ri(o)?o:Oe(o);{const{configValue:o}=Vf("labelAngle",i,t?.style,r);return void 0!==o?Oe(o):n!==Be||!Q([Xr,Wr],e.type)||Fa(e)&&e.timeUnit?void 0:270}}(r,n,e,a.style,u),d=la(n.formatType,r,l),h=sa(r,r.type,n.format,n.formatType,a,!0),p={fieldOrDatumDef:r,axis:n,channel:e,model:t,scaleType:l,orient:s,labelAngle:f,format:h,formatType:d,mark:o,config:a};for(const y of Qp){const r=y in Yf?Yf[y](p):ys(y)?n[y]:void 0,o=void 0!==r,s=rm(r,y,n,t,e);if(o&&s)i.set(y,r,s);else{const{configValue:e,configFrom:t}=ys(y)&&"values"!==y?Vf(y,a.style,n.style,u):{},l=void 0!==e;o&&!l?i.set(y,r,s):("vgAxisConfig"!==t||om.has(y)&&l||ds(e)||ri(e))&&i.set(y,e,!1)}}const m=n.encoding??{},g=hs.reduce(((n,r)=>{if(!i.hasAxisPart(r))return n;const o=kd(m[r]??{},t),a="labels"===r?function(e,t,n){const{encoding:i,config:r}=e,o=ts(i[t])??ts(i[Wt(t)]),a=e.axis(t)||{},{format:s,formatType:l}=a;if(ta(l))return{text:aa({fieldOrDatumDef:o,field:"datum.value",format:s,formatType:l,config:r}),...n};if(void 0===s&&void 0===l&&r.customFormatTypes){if("quantitative"===Oa(o)){if(ja(o)&&"normalize"===o.stack&&r.normalizedNumberFormatType)return{text:aa({fieldOrDatumDef:o,field:"datum.value",format:r.normalizedNumberFormat,formatType:r.normalizedNumberFormatType,config:r}),...n};if(r.numberFormatType)return{text:aa({fieldOrDatumDef:o,field:"datum.value",format:r.numberFormat,formatType:r.numberFormatType,config:r}),...n}}if("temporal"===Oa(o)&&r.timeFormatType&&Fa(o)&&!o.timeUnit)return{text:aa({fieldOrDatumDef:o,field:"datum.value",format:r.timeFormat,formatType:r.timeFormatType,config:r}),...n}}return n}(t,e,o):o;return void 0===a||ce(a)||(n[r]={update:a}),n}),{});return ce(g)||i.set("encode",g,!!n.encoding||void 0!==n.labelAngle),i}function sm(e,t){const{config:n}=e;return{...af(e,{align:"ignore",baseline:"ignore",color:"include",size:"include",orient:"ignore",theta:"ignore"}),...Xc("x",e,{defaultPos:"mid"}),...Xc("y",e,{defaultPos:"mid"}),...Ic("size",e),...Ic("angle",e),...lm(e,n,t)}}function lm(e,t,n){return n?{shape:{value:n}}:Ic("shape",e)}const um={vgMark:"rule",encodeEntry:e=>{const{markDef:t}=e,n=t.orient;return e.encoding.x||e.encoding.y||e.encoding.latitude||e.encoding.longitude?{...af(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...Kc("x",e,{defaultPos:"horizontal"===n?"zeroOrMax":"mid",defaultPos2:"zeroOrMin",range:"vertical"!==n}),...Kc("y",e,{defaultPos:"vertical"===n?"zeroOrMax":"mid",defaultPos2:"zeroOrMin",range:"horizontal"!==n}),...Ic("size",e,{vgChannel:"strokeWidth"})}:{}}};function cm(e,t,n){if(void 0===vi("align",e,n))return"center"}function fm(e,t,n){if(void 0===vi("baseline",e,n))return"middle"}const dm={vgMark:"rect",encodeEntry:e=>{const{config:t,markDef:n}=e,i=n.orient,r="horizontal"===i?"width":"height",o="horizontal"===i?"height":"width";return{...af(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...Xc("x",e,{defaultPos:"mid",vgChannel:"xc"}),...Xc("y",e,{defaultPos:"mid",vgChannel:"yc"}),...Ic("size",e,{defaultValue:hm(e),vgChannel:r}),[o]:hi(vi("thickness",n,t))}}};function hm(e){const{config:t,markDef:n}=e,{orient:i}=n,r="horizontal"===i?"width":"height",o=e.getScaleComponent("horizontal"===i?"x":"y"),a=vi("size",n,t,{vgChannel:r})??t.tick.bandSize;if(void 0!==a)return a;{const e=o?o.get("range"):void 0;if(e&&oi(e)&&(0,j.hj)(e.step))return 3*e.step/4;return 3*_l(t.view,r)/4}}const pm={arc:{vgMark:"arc",encodeEntry:e=>({...af(e,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore",theta:"ignore"}),...Xc("x",e,{defaultPos:"mid"}),...Xc("y",e,{defaultPos:"mid"}),...ef(e,"radius"),...ef(e,"theta")})},area:{vgMark:"area",encodeEntry:e=>({...af(e,{align:"ignore",baseline:"ignore",color:"include",orient:"include",size:"ignore",theta:"ignore"}),...Kc("x",e,{defaultPos:"zeroOrMin",defaultPos2:"zeroOrMin",range:"horizontal"===e.markDef.orient}),...Kc("y",e,{defaultPos:"zeroOrMin",defaultPos2:"zeroOrMin",range:"vertical"===e.markDef.orient}),...uf(e)})},bar:{vgMark:"rect",encodeEntry:e=>({...af(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...ef(e,"x"),...ef(e,"y")})},circle:{vgMark:"symbol",encodeEntry:e=>sm(e,"circle")},geoshape:{vgMark:"shape",encodeEntry:e=>({...af(e,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore",theta:"ignore"})}),postEncodingTransform:e=>{const{encoding:t}=e,n=t.shape;return[{type:"geoshape",projection:e.projectionName(),...n&&Fa(n)&&n.type===Jr?{field:Ha(n,{expr:"datum"})}:{}}]}},image:{vgMark:"image",encodeEntry:e=>({...af(e,{align:"ignore",baseline:"ignore",color:"ignore",orient:"ignore",size:"ignore",theta:"ignore"}),...ef(e,"x"),...ef(e,"y"),...Nc(e,"url")})},line:{vgMark:"line",encodeEntry:e=>({...af(e,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore",theta:"ignore"}),...Xc("x",e,{defaultPos:"mid"}),...Xc("y",e,{defaultPos:"mid"}),...Ic("size",e,{vgChannel:"strokeWidth"}),...uf(e)})},point:{vgMark:"symbol",encodeEntry:e=>sm(e)},rect:{vgMark:"rect",encodeEntry:e=>({...af(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...ef(e,"x"),...ef(e,"y")})},rule:um,square:{vgMark:"symbol",encodeEntry:e=>sm(e,"square")},text:{vgMark:"text",encodeEntry:e=>{const{config:t,encoding:n}=e;return{...af(e,{align:"include",baseline:"include",color:"include",size:"ignore",orient:"ignore",theta:"include"}),...Xc("x",e,{defaultPos:"mid"}),...Xc("y",e,{defaultPos:"mid"}),...Nc(e),...Ic("size",e,{vgChannel:"fontSize"}),...Ic("angle",e),...cf("align",cm(e.markDef,n,t)),...cf("baseline",fm(e.markDef,n,t)),...Xc("radius",e,{defaultPos:null}),...Xc("theta",e,{defaultPos:null})}}},tick:dm,trail:{vgMark:"trail",encodeEntry:e=>({...af(e,{align:"ignore",baseline:"ignore",color:"include",size:"include",orient:"ignore",theta:"ignore"}),...Xc("x",e,{defaultPos:"mid"}),...Xc("y",e,{defaultPos:"mid"}),...Ic("size",e),...uf(e)})}};function mm(e){if(Q([Ao,Eo,To],e.mark)){const t=Ms(e.mark,e.encoding);if(t.length>0)return function(e,t){return[{name:e.getName("pathgroup"),type:"group",from:{facet:{name:gm+e.requestDataName(Qu.Main),data:e.requestDataName(Qu.Main),groupby:t}},encode:{update:{width:{field:{group:"width"}},height:{field:{group:"height"}}}},marks:vm(e,{fromPrefix:gm})}]}(e,t)}else if(e.mark===Do){const t=ui.some((t=>vi(t,e.markDef,e.config)));if(e.stack&&!e.fieldDef("size")&&t)return function(e){const[t]=vm(e,{fromPrefix:ym}),n=e.scaleName(e.stack.fieldChannel),i=(t={})=>e.vgField(e.stack.fieldChannel,t),r=(e,t)=>`${e}(${[i({prefix:"min",suffix:"start",expr:t}),i({prefix:"max",suffix:"start",expr:t}),i({prefix:"min",suffix:"end",expr:t}),i({prefix:"max",suffix:"end",expr:t})].map((e=>`scale('${n}',${e})`)).join(",")})`;let o,a;"x"===e.stack.fieldChannel?(o={...V(t.encode.update,["y","yc","y2","height",...ui]),x:{signal:r("min","datum")},x2:{signal:r("max","datum")},clip:{value:!0}},a={x:{field:{group:"x"},mult:-1},height:{field:{group:"height"}}},t.encode.update={...Y(t.encode.update,["y","yc","y2"]),height:{field:{group:"height"}}}):(o={...V(t.encode.update,["x","xc","x2","width"]),y:{signal:r("min","datum")},y2:{signal:r("max","datum")},clip:{value:!0}},a={y:{field:{group:"y"},mult:-1},width:{field:{group:"width"}}},t.encode.update={...Y(t.encode.update,["x","xc","x2"]),width:{field:{group:"width"}}});for(const l of ui){const n=bi(l,e.markDef,e.config);t.encode.update[l]?(o[l]=t.encode.update[l],delete t.encode.update[l]):n&&(o[l]=hi(n)),n&&(t.encode.update[l]={value:0})}const s=[];if(e.stack.groupbyChannels?.length>0)for(const l of e.stack.groupbyChannels){const t=e.fieldDef(l),n=Ha(t);n&&s.push(n),(t?.bin||t?.timeUnit)&&s.push(Ha(t,{binSuffix:"end"}))}o=["stroke","strokeWidth","strokeJoin","strokeCap","strokeDash","strokeDashOffset","strokeMiterLimit","strokeOpacity"].reduce(((n,i)=>{if(t.encode.update[i])return{...n,[i]:t.encode.update[i]};{const t=bi(i,e.markDef,e.config);return void 0!==t?{...n,[i]:hi(t)}:n}}),o),o.stroke&&(o.strokeForeground={value:!0},o.strokeOffset={value:0});return[{type:"group",from:{facet:{data:e.requestDataName(Qu.Main),name:ym+e.requestDataName(Qu.Main),groupby:s,aggregate:{fields:[i({suffix:"start"}),i({suffix:"start"}),i({suffix:"end"}),i({suffix:"end"})],ops:["min","max","min","max"]}}},encode:{update:o},marks:[{type:"group",encode:{update:a},marks:[t]}]}]}(e)}return vm(e)}const gm="faceted_path_";const ym="stack_group_";function vm(e,t={fromPrefix:""}){const{mark:n,markDef:i,encoding:r,config:o}=e,a=$e(i.clip,function(e){const t=e.getScaleComponent("x"),n=e.getScaleComponent("y");return!(!t?.get("selectionExtent")&&!n?.get("selectionExtent"))||void 0}(e),function(e){const t=e.component.projection;return!(!t||t.isFit)||void 0}(e)),s=yi(i),l=r.key,u=function(e){const{encoding:t,stack:n,mark:i,markDef:r,config:o}=e,a=t.order;if(!(!(0,j.kJ)(a)&&Ua(a)&&Z(a.value)||!a&&Z(vi("order",r,o)))){if(((0,j.kJ)(a)||Fa(a))&&!n)return wi(a,{expr:"datum"});if(Po(i)){const n="horizontal"===r.orient?"y":"x",i=t[n];if(Fa(i)){const t=i.sort;return(0,j.kJ)(t)?{field:Ha(i,{prefix:n,suffix:"sort_index",expr:"datum"})}:ya(t)?{field:Ha({aggregate:Es(e.encoding)?t.op:void 0,field:t.field},{expr:"datum"})}:ga(t)?{field:Ha(e.fieldDef(t.encoding),{expr:"datum"}),order:t.order}:null===t?void 0:{field:Ha(i,{binSuffix:e.stack?.impute?"mid":void 0,expr:"datum"})}}}}}(e),c=function(e){if(!e.component.selection)return null;const t=fe(e.component.selection).length;let n=t,i=e.parent;for(;i&&0===n;)n=fe(i.component.selection).length,i=i.parent;return n?{interactive:t>0||"geoshape"===e.mark||!!e.encoding.tooltip}:null}(e),f=vi("aria",i,o),d=pm[n].postEncodingTransform?pm[n].postEncodingTransform(e):null;return[{name:e.getName("marks"),type:pm[n].vgMark,...a?{clip:!0}:{},...s?{style:s}:{},...l?{key:l.field}:{},...u?{sort:u}:{},...c||{},...!1===f?{aria:f}:{},from:{data:t.fromPrefix+e.requestDataName(Qu.Main)},encode:{update:pm[n].encodeEntry(e)},...d?{transform:d}:{}}]}class bm extends Ep{constructor(e,t,n,i={},r){super(e,"unit",t,n,r,void 0,vl(e)?e.view:void 0),this.specifiedScales={},this.specifiedAxes={},this.specifiedLegends={},this.specifiedProjection={},this.selection=[],this.children=[];const o=Bo(e.mark)?{...e.mark}:{type:e.mark},a=o.type;void 0===o.filled&&(o.filled=function(e,t,{graticule:n}){if(n)return!1;const i=bi("filled",e,t),r=e.type;return $e(i,r!==So&&r!==Ao&&r!==Co)}(o,r,{graticule:e.data&&Zu(e.data)}));const s=this.encoding=function(e,t,n,i){const r={};for(const a of fe(e))Ut(a)||or(`${o=a}-encoding is dropped as ${o} is not a valid encoding channel.`);var o;for(let a of Vt){if(!e[a])continue;const o=e[a];if(xn(a)){const e=Gt(a),t=r[e];if(Fa(t)&&jr(t.type)&&Fa(o)&&!t.timeUnit){or(Ui(e));continue}}if("angle"!==a||"arc"!==t||e.theta||(or("Arc marks uses theta channel rather than angle, replacing angle with theta."),a=Ge),$s(e,a,t)){if(a===rt&&"line"===t){const t=es(e[a]);if(t?.aggregate){or("Line marks cannot encode size with a non-groupby field. You may want to use trail marks instead.");continue}}if(a===et&&(n?"fill"in e:"stroke"in e))or(ji("encoding",{fill:"fill"in e,stroke:"stroke"in e}));else if(a===ht||a===dt&&!(0,j.kJ)(o)&&!Ua(o)||a===mt&&(0,j.kJ)(o)){if(o){if(a===dt){const t=e[a];if(Aa(t)){r[a]=t;continue}}r[a]=(0,j.IX)(o).reduce(((e,t)=>(Fa(t)?e.push(rs(t,a)):or(Ii(t,a)),e)),[])}}else{if(a===mt&&null===o)r[a]=null;else if(!Fa(o)&&!Ta(o)&&!Ua(o)&&!Sa(o)&&!ri(o)){or(Ii(o,a));continue}r[a]=ns(o,a,i)}}else or(qi(a,t))}return r}(e.encoding||{},a,o.filled,r);this.markDef=Wl(o,s,r),this.size=function({encoding:e,size:t}){for(const n of pn){const i=Ht(n);yl(t[i])&&Na(e[n])&&(delete t[i],or(Ki(i)))}return t}({encoding:s,size:vl(e)?{...i,...e.width?{width:e.width}:{},...e.height?{height:e.height}:{}}:i}),this.stack=ql(this.markDef,s),this.specifiedScales=this.initScales(a,s),this.specifiedAxes=this.initAxes(s),this.specifiedLegends=this.initLegends(s),this.specifiedProjection=e.projection,this.selection=(e.params??[]).filter((e=>fl(e)))}get hasProjection(){const{encoding:e}=this,t=this.mark===Ro,n=e&&Et.some((t=>Pa(e[t])));return t||n}scaleDomain(e){const t=this.specifiedScales[e];return t?t.domain:void 0}axis(e){return this.specifiedAxes[e]}legend(e){return this.specifiedLegends[e]}initScales(e,t){return On.reduce(((e,n)=>{const i=ts(t[n]);return i&&(e[n]=this.initScale(i.scale??{})),e}),{})}initScale(e){const{domain:t,range:n}=e,i=ti(e);return(0,j.kJ)(t)&&(i.domain=t.map(fi)),(0,j.kJ)(n)&&(i.range=n.map(fi)),i}initAxes(e){return pn.reduce(((t,n)=>{const i=e[n];if(Pa(i)||n===Be&&Pa(e.x2)||n===je&&Pa(e.y2)){const e=Pa(i)?i.axis:void 0;t[n]=e?this.initAxis({...e}):e}return t}),{})}initAxis(e){const t=fe(e),n={};for(const i of t){const t=e[i];n[i]=ds(t)?ci(t):fi(t)}return n}initLegends(e){return Cn.reduce(((t,n)=>{const i=ts(e[n]);if(i&&function(e){switch(e){case et:case tt:case nt:case rt:case it:case at:case ut:case ct:return!0;case st:case lt:case ot:return!1}}(n)){const e=i.legend;t[n]=e?ti(e):e}return t}),{})}parseData(){this.component.data=Yp(this)}parseLayoutSize(){!function(e){const{size:t,component:n}=e;for(const i of pn){const r=Ht(i);if(t[r]){const e=t[r];n.layoutSize.set(r,yl(e)?"step":e,!0)}else{const t=Xp(e,r);n.layoutSize.set(r,t,!1)}}}(this)}parseSelections(){this.component.selection=function(e,t){const n={},i=e.config.selection;if(!t||!t.length)return n;for(const r of t){const t=me(r.name),o=r.select,a=(0,j.HD)(o)?o:o.type,s=(0,j.Kn)(o)?J(o):{type:a},l=i[a];for(const e in l)"fields"!==e&&"encodings"!==e&&("mark"===e&&(s[e]={...l[e],...s[e]}),void 0!==s[e]&&!0!==s[e]||(s[e]=J(l[e]??s[e])));const u=n[t]={...s,name:t,type:a,init:r.value,bind:r.bind,events:(0,j.HD)(s.on)?(0,ec.r)(s.on,"scope"):(0,j.IX)(J(s.on))},c=J(r);for(const n of Of)n.defined(u)&&n.parse&&n.parse(e,u,c)}return n}(this,this.selection)}parseMarkGroup(){this.component.mark=mm(this)}parseAxesAndHeaders(){var e;this.component.axes=(e=this,pn.reduce(((t,n)=>(e.component.scales[n]&&(t[n]=[am(n,e)]),t)),{}))}assembleSelectionTopLevelSignals(e){return function(e,t){let n=!1;for(const i of de(e.component.selection??{})){const r=i.name,o=(0,j.m8)(r+Sf);if(0===t.filter((e=>e.name===r)).length){const e="global"===i.resolve?"union":i.resolve,n="point"===i.type?", true, true)":")";t.push({name:i.name,update:`${Ff}(${o}, ${(0,j.m8)(e)}${n}`})}n=!0;for(const n of Of)n.defined(i)&&n.topLevelSignals&&(t=n.topLevelSignals(e,i,t))}n&&0===t.filter((e=>"unit"===e.name)).length&&t.unshift({name:"unit",value:{},on:[{events:"pointermove",update:"isTuple(group()) ? group() : unit"}]});return ac(t)}(this,e)}assembleSignals(){return[...Xf(this),...ic(this,[])]}assembleSelectionData(e){return function(e,t){const n=[...t],i=Tf(e,{escape:!1});for(const r of de(e.component.selection??{})){const e={name:r.name+Sf};if(r.project.hasSelectionId&&(e.transform=[{type:"collect",sort:{field:sl}}]),r.init){const t=r.project.items.map(tc);e.values=r.project.hasSelectionId?r.init.map((e=>({unit:i,[sl]:nc(e,!1)[0]}))):r.init.map((e=>({unit:i,fields:t,values:nc(e,!1)})))}n.filter((e=>e.name===r.name+Sf)).length||n.push(e)}return n}(this,e)}assembleLayout(){return null}assembleLayoutSignals(){return vd(this)}assembleMarks(){let e=this.component.mark??[];return this.parent&&wp(this.parent)||(e=oc(this,e)),e.map(this.correctDataNames)}assembleGroupStyle(){const{style:e}=this.view||{};return void 0!==e?e:this.encoding.x||this.encoding.y?"cell":"view"}getMapping(){return this.encoding}get mark(){return this.markDef.type}channelHasField(e){return _s(this.encoding,e)}fieldDef(e){return es(this.encoding[e])}typedFieldDef(e){const t=this.fieldDef(e);return La(t)?t:null}}class xm extends kp{constructor(e,t,n,i,r){super(e,"layer",t,n,r,e.resolve,e.view);const o={...i,...e.width?{width:e.width}:{},...e.height?{height:e.height}:{}};this.children=e.layer.map(((e,t)=>{if(Rl(e))return new xm(e,this,this.getName(`layer_${t}`),o,r);if(bs(e))return new bm(e,this,this.getName(`layer_${t}`),o,r);throw new Error($i(e))}))}parseData(){this.component.data=Yp(this);for(const e of this.children)e.parseData()}parseLayoutSize(){var e;Wp(e=this),Hp(e,"width"),Hp(e,"height")}parseSelections(){this.component.selection={};for(const e of this.children){e.parseSelections();for(const t of fe(e.component.selection))this.component.selection[t]=e.component.selection[t]}}parseMarkGroup(){for(const e of this.children)e.parseMarkGroup()}parseAxesAndHeaders(){!function(e){const{axes:t,resolve:n}=e.component,i={top:0,bottom:0,right:0,left:0};for(const r of e.children){r.parseAxesAndHeaders();for(const i of fe(r.component.axes))n.axis[i]=Dd(e.component.resolve,i),"shared"===n.axis[i]&&(t[i]=nm(t[i],r.component.axes[i]),t[i]||(n.axis[i]="independent",delete t[i]))}for(const r of pn){for(const o of e.children)if(o.component.axes[r]){if("independent"===n.axis[r]){t[r]=(t[r]??[]).concat(o.component.axes[r]);for(const e of o.component.axes[r]){const{value:t,explicit:n}=e.getWithExplicit("orient");if(!ri(t)){if(i[t]>0&&!n){const n=tm[t];i[t]>i[n]&&e.set("orient",n,!1)}i[t]++}}}delete o.component.axes[r]}if("independent"===n.axis[r]&&t[r]&&t[r].length>1)for(const[e,n]of(t[r]||[]).entries())e>0&&n.get("grid")&&!n.explicit.grid&&(n.implicit.grid=!1)}}(this)}assembleSelectionTopLevelSignals(e){return this.children.reduce(((e,t)=>t.assembleSelectionTopLevelSignals(e)),e)}assembleSignals(){return this.children.reduce(((e,t)=>e.concat(t.assembleSignals())),Xf(this))}assembleLayoutSignals(){return this.children.reduce(((e,t)=>e.concat(t.assembleLayoutSignals())),vd(this))}assembleSelectionData(e){return this.children.reduce(((e,t)=>t.assembleSelectionData(e)),e)}assembleGroupStyle(){const e=new Set;for(const n of this.children)for(const t of(0,j.IX)(n.assembleGroupStyle()))e.add(t);const t=Array.from(e);return t.length>1?t:1===t.length?t[0]:void 0}assembleTitle(){let e=super.assembleTitle();if(e)return e;for(const t of this.children)if(e=t.assembleTitle(),e)return e}assembleLayout(){return null}assembleMarks(){return function(e,t){for(const n of e.children)bp(n)&&(t=oc(n,t));return t}(this,this.children.flatMap((e=>e.assembleMarks())))}assembleLegends(){return this.children.reduce(((e,t)=>e.concat(t.assembleLegends())),qd(this))}}function _m(e,t,n,i,r){if(_a(e))return new Gp(e,t,n,r);if(Rl(e))return new xm(e,t,n,i,r);if(bs(e))return new bm(e,t,n,i,r);if(function(e){return pl(e)||ml(e)||hl(e)}(e))return new Kp(e,t,n,r);throw new Error($i(e))}function wm(e,t={}){var n;t.logger&&(n=t.logger,ir=n),t.fieldTitle&&Va(t.fieldTitle);try{const n=Cl((0,j.fE)(t.config,e.config)),i=Ou(e,n),r=_m(i,null,"",void 0,n);r.parse(),function(e,t){Rh(e.sources);let n=0,i=0;for(let r=0;r<zh&&Lh(e,t,!0);r++)n++;e.sources.map(Oh);for(let r=0;r<zh&&Lh(e,t,!1);r++)i++;Rh(e.sources),Math.max(n,i)===zh&&or(`Maximum optimization runs(${zh}) reached.`)}(r.component.data,r);const o=function(e,t,n={},i){const r=e.config?Nl(e.config):void 0,o=[].concat(e.assembleSelectionData([]),function(e,t){const n=[],i=Up(n);let r=0;for(const a of e.sources){a.hasName()||(a.dataName="source_"+r++);const e=a.assemble();i(a,e)}for(const a of n)0===a.transform.length&&delete a.transform;let o=0;for(const[a,s]of n.entries())0!==(s.transform??[]).length||s.source||n.splice(o++,0,n.splice(a,1)[0]);for(const a of n)for(const t of a.transform??[])"lookup"===t.type&&(t.from=e.outputNodes[t.from].getSource());for(const a of n)a.name in t&&(a.values=t[a.name]);return n}(e.component.data,n)),a=e.assembleProjections(),s=e.assembleTitle(),l=e.assembleGroupStyle(),u=e.assembleGroupEncodeEntry(!0);let c=e.assembleLayoutSignals();c=c.filter((e=>"width"!==e.name&&"height"!==e.name||void 0===e.value||(t[e.name]=+e.value,!1)));const{params:f,...d}=t;return{$schema:"https://vega.github.io/schema/vega/v5.json",...e.description?{description:e.description}:{},...d,...s?{title:s}:{},...l?{style:l}:{},...u?{encode:{update:u}}:{},data:o,...a.length>0?{projections:a}:{},...e.assembleGroup([...c,...e.assembleSelectionTopLevelSignals([]),...dl(f)]),...r?{config:r}:{},...i?{usermeta:i}:{}}}(r,function(e,t,n,i){const r=i.component.layoutSize.get("width"),o=i.component.layoutSize.get("height");void 0===t?(t={type:"pad"},i.hasAxisOrientSignalRef()&&(t.resize=!0)):(0,j.HD)(t)&&(t={type:t});if(r&&o&&(a=t.type,"fit"===a||"fit-x"===a||"fit-y"===a))if("step"===r&&"step"===o)or(Ci()),t.type="pad";else if("step"===r||"step"===o){const e="step"===r?"width":"height";or(Ci(vn(e)));const n="width"===e?"height":"width";t.type=function(e){return e?`fit-${vn(e)}`:"fit"}(n)}var a;return{...1===fe(t).length&&t.type?"pad"===t.type?{}:{autosize:t.type}:{autosize:t},...Lu(n,!1),...Lu(e,!0)}}(e,i.autosize,n,r),e.datasets,e.usermeta);return{spec:o,normalized:i}}finally{t.logger&&rr(),t.fieldTitle&&Va(Ja)}}const km="5.16.3";const Em=function(e){const[t,n]=/schema\/([\w-]+)\/([\w\.\-]+)\.json$/g.exec(e).slice(1,3);return{library:t,version:n}};var Dm="2.14.0";const $m="#fff",Am="#888",Sm={background:"#333",view:{stroke:Am},title:{color:$m,subtitleColor:$m},style:{"guide-label":{fill:$m},"guide-title":{fill:$m}},axis:{domainColor:$m,gridColor:Am,tickColor:$m}},Mm="#4572a7",Cm={background:"#fff",arc:{fill:Mm},area:{fill:Mm},line:{stroke:Mm,strokeWidth:2},path:{stroke:Mm},rect:{fill:Mm},shape:{stroke:Mm},symbol:{fill:Mm,strokeWidth:1.5,size:50},axis:{bandPosition:.5,grid:!0,gridColor:"#000000",gridOpacity:1,gridWidth:.5,labelPadding:10,tickSize:5,tickWidth:.5},axisBand:{grid:!1,tickExtra:!0},legend:{labelBaseline:"middle",labelFontSize:11,symbolSize:50,symbolType:"square"},range:{category:["#4572a7","#aa4643","#8aa453","#71598e","#4598ae","#d98445","#94aace","#d09393","#b9cc98","#a99cbc"]}},Fm="#30a2da",Om="#cbcbcb",Tm="#f0f0f0",Nm="#333",zm={arc:{fill:Fm},area:{fill:Fm},axis:{domainColor:Om,grid:!0,gridColor:Om,gridWidth:1,labelColor:"#999",labelFontSize:10,titleColor:"#333",tickColor:Om,tickSize:10,titleFontSize:14,titlePadding:10,labelPadding:4},axisBand:{grid:!1},background:Tm,group:{fill:Tm},legend:{labelColor:Nm,labelFontSize:11,padding:1,symbolSize:30,symbolType:"square",titleColor:Nm,titleFontSize:14,titlePadding:10},line:{stroke:Fm,strokeWidth:2},path:{stroke:Fm,strokeWidth:.5},rect:{fill:Fm},range:{category:["#30a2da","#fc4f30","#e5ae38","#6d904f","#8b8b8b","#b96db8","#ff9e27","#56cc60","#52d2ca","#52689e","#545454","#9fe4f8"],diverging:["#cc0020","#e77866","#f6e7e1","#d6e8ed","#91bfd9","#1d78b5"],heatmap:["#d6e8ed","#cee0e5","#91bfd9","#549cc6","#1d78b5"]},point:{filled:!0,shape:"circle"},shape:{stroke:Fm},bar:{binSpacing:2,fill:Fm,stroke:null},title:{anchor:"start",fontSize:24,fontWeight:600,offset:20}},Rm="#000",Pm={group:{fill:"#e5e5e5"},arc:{fill:Rm},area:{fill:Rm},line:{stroke:Rm},path:{stroke:Rm},rect:{fill:Rm},shape:{stroke:Rm},symbol:{fill:Rm,size:40},axis:{domain:!1,grid:!0,gridColor:"#FFFFFF",gridOpacity:1,labelColor:"#7F7F7F",labelPadding:4,tickColor:"#7F7F7F",tickSize:5.67,titleFontSize:16,titleFontWeight:"normal"},legend:{labelBaseline:"middle",labelFontSize:11,symbolSize:40},range:{category:["#000000","#7F7F7F","#1A1A1A","#999999","#333333","#B0B0B0","#4D4D4D","#C9C9C9","#666666","#DCDCDC"]}},Lm="Benton Gothic, sans-serif",Um="#82c6df",Bm="Benton Gothic Bold, sans-serif",jm="normal",Im={"category-6":["#ec8431","#829eb1","#c89d29","#3580b1","#adc839","#ab7fb4"],"fire-7":["#fbf2c7","#f9e39c","#f8d36e","#f4bb6a","#e68a4f","#d15a40","#ab4232"],"fireandice-6":["#e68a4f","#f4bb6a","#f9e39c","#dadfe2","#a6b7c6","#849eae"],"ice-7":["#edefee","#dadfe2","#c4ccd2","#a6b7c6","#849eae","#607785","#47525d"]},qm={background:"#ffffff",title:{anchor:"start",color:"#000000",font:Bm,fontSize:22,fontWeight:"normal"},arc:{fill:Um},area:{fill:Um},line:{stroke:Um,strokeWidth:2},path:{stroke:Um},rect:{fill:Um},shape:{stroke:Um},symbol:{fill:Um,size:30},axis:{labelFont:Lm,labelFontSize:11.5,labelFontWeight:"normal",titleFont:Bm,titleFontSize:13,titleFontWeight:jm},axisX:{labelAngle:0,labelPadding:4,tickSize:3},axisY:{labelBaseline:"middle",maxExtent:45,minExtent:45,tickSize:2,titleAlign:"left",titleAngle:0,titleX:-45,titleY:-11},legend:{labelFont:Lm,labelFontSize:11.5,symbolType:"square",titleFont:Bm,titleFontSize:13,titleFontWeight:jm},range:{category:Im["category-6"],diverging:Im["fireandice-6"],heatmap:Im["fire-7"],ordinal:Im["fire-7"],ramp:Im["fire-7"]}},Wm="#ab5787",Hm="#979797",Xm={background:"#f9f9f9",arc:{fill:Wm},area:{fill:Wm},line:{stroke:Wm},path:{stroke:Wm},rect:{fill:Wm},shape:{stroke:Wm},symbol:{fill:Wm,size:30},axis:{domainColor:Hm,domainWidth:.5,gridWidth:.2,labelColor:Hm,tickColor:Hm,tickWidth:.2,titleColor:Hm},axisBand:{grid:!1},axisX:{grid:!0,tickSize:10},axisY:{domain:!1,grid:!0,tickSize:0},legend:{labelFontSize:11,padding:1,symbolSize:30,symbolType:"square"},range:{category:["#ab5787","#51b2e5","#703c5c","#168dd9","#d190b6","#00609f","#d365ba","#154866","#666666","#c4c4c4"]}},Jm="#3e5c69",Gm={background:"#fff",arc:{fill:Jm},area:{fill:Jm},line:{stroke:Jm},path:{stroke:Jm},rect:{fill:Jm},shape:{stroke:Jm},symbol:{fill:Jm},axis:{domainWidth:.5,grid:!0,labelPadding:2,tickSize:5,tickWidth:.5,titleFontWeight:"normal"},axisBand:{grid:!1},axisX:{gridWidth:.2},axisY:{gridDash:[3],gridWidth:.4},legend:{labelFontSize:11,padding:1,symbolType:"square"},range:{category:["#3e5c69","#6793a6","#182429","#0570b0","#3690c0","#74a9cf","#a6bddb","#e2ddf2"]}},Vm="#1696d2",Ym="#000000",Km="Lato",Zm="Lato",Qm={"main-colors":["#1696d2","#d2d2d2","#000000","#fdbf11","#ec008b","#55b748","#5c5859","#db2b27"],"shades-blue":["#CFE8F3","#A2D4EC","#73BFE2","#46ABDB","#1696D2","#12719E","#0A4C6A","#062635"],"shades-gray":["#F5F5F5","#ECECEC","#E3E3E3","#DCDBDB","#D2D2D2","#9D9D9D","#696969","#353535"],"shades-yellow":["#FFF2CF","#FCE39E","#FDD870","#FCCB41","#FDBF11","#E88E2D","#CA5800","#843215"],"shades-magenta":["#F5CBDF","#EB99C2","#E46AA7","#E54096","#EC008B","#AF1F6B","#761548","#351123"],"shades-green":["#DCEDD9","#BCDEB4","#98CF90","#78C26D","#55B748","#408941","#2C5C2D","#1A2E19"],"shades-black":["#D5D5D4","#ADABAC","#848081","#5C5859","#332D2F","#262223","#1A1717","#0E0C0D"],"shades-red":["#F8D5D4","#F1AAA9","#E9807D","#E25552","#DB2B27","#A4201D","#6E1614","#370B0A"],"one-group":["#1696d2","#000000"],"two-groups-cat-1":["#1696d2","#000000"],"two-groups-cat-2":["#1696d2","#fdbf11"],"two-groups-cat-3":["#1696d2","#db2b27"],"two-groups-seq":["#a2d4ec","#1696d2"],"three-groups-cat":["#1696d2","#fdbf11","#000000"],"three-groups-seq":["#a2d4ec","#1696d2","#0a4c6a"],"four-groups-cat-1":["#000000","#d2d2d2","#fdbf11","#1696d2"],"four-groups-cat-2":["#1696d2","#ec0008b","#fdbf11","#5c5859"],"four-groups-seq":["#cfe8f3","#73bf42","#1696d2","#0a4c6a"],"five-groups-cat-1":["#1696d2","#fdbf11","#d2d2d2","#ec008b","#000000"],"five-groups-cat-2":["#1696d2","#0a4c6a","#d2d2d2","#fdbf11","#332d2f"],"five-groups-seq":["#cfe8f3","#73bf42","#1696d2","#0a4c6a","#000000"],"six-groups-cat-1":["#1696d2","#ec008b","#fdbf11","#000000","#d2d2d2","#55b748"],"six-groups-cat-2":["#1696d2","#d2d2d2","#ec008b","#fdbf11","#332d2f","#0a4c6a"],"six-groups-seq":["#cfe8f3","#a2d4ec","#73bfe2","#46abdb","#1696d2","#12719e"],"diverging-colors":["#ca5800","#fdbf11","#fdd870","#fff2cf","#cfe8f3","#73bfe2","#1696d2","#0a4c6a"]},eg={background:"#FFFFFF",title:{anchor:"start",fontSize:18,font:Km},axisX:{domain:!0,domainColor:Ym,domainWidth:1,grid:!1,labelFontSize:12,labelFont:Zm,labelAngle:0,tickColor:Ym,tickSize:5,titleFontSize:12,titlePadding:10,titleFont:Km},axisY:{domain:!1,domainWidth:1,grid:!0,gridColor:"#DEDDDD",gridWidth:1,labelFontSize:12,labelFont:Zm,labelPadding:8,ticks:!1,titleFontSize:12,titlePadding:10,titleFont:Km,titleAngle:0,titleY:-10,titleX:18},legend:{labelFontSize:12,labelFont:Zm,symbolSize:100,titleFontSize:12,titlePadding:10,titleFont:Km,orient:"right",offset:10},view:{stroke:"transparent"},range:{category:Qm["six-groups-cat-1"],diverging:Qm["diverging-colors"],heatmap:Qm["diverging-colors"],ordinal:Qm["six-groups-seq"],ramp:Qm["shades-blue"]},area:{fill:Vm},rect:{fill:Vm},line:{color:Vm,stroke:Vm,strokeWidth:5},trail:{color:Vm,stroke:Vm,strokeWidth:0,size:1},path:{stroke:Vm,strokeWidth:.5},point:{filled:!0},text:{font:"Lato",color:Vm,fontSize:11,align:"center",fontWeight:400,size:11},style:{bar:{fill:Vm,stroke:null}},arc:{fill:Vm},shape:{stroke:Vm},symbol:{fill:Vm,size:30}},tg="#3366CC",ng="#ccc",ig="Arial, sans-serif",rg={arc:{fill:tg},area:{fill:tg},path:{stroke:tg},rect:{fill:tg},shape:{stroke:tg},symbol:{stroke:tg},circle:{fill:tg},background:"#fff",padding:{top:10,right:10,bottom:10,left:10},style:{"guide-label":{font:ig,fontSize:12},"guide-title":{font:ig,fontSize:12},"group-title":{font:ig,fontSize:12}},title:{font:ig,fontSize:14,fontWeight:"bold",dy:-3,anchor:"start"},axis:{gridColor:ng,tickColor:ng,domain:!1,grid:!0},range:{category:["#4285F4","#DB4437","#F4B400","#0F9D58","#AB47BC","#00ACC1","#FF7043","#9E9D24","#5C6BC0","#F06292","#00796B","#C2185B"],heatmap:["#c6dafc","#5e97f6","#2a56c6"]}},og=e=>e*(1/3+1),ag=og(9),sg=og(10),lg=og(12),ug="Segoe UI",cg="wf_standard-font, helvetica, arial, sans-serif",fg="#252423",dg="#605E5C",hg="transparent",pg="#118DFF",mg="#DEEFFF",gg=[mg,pg],yg={view:{stroke:hg},background:hg,font:ug,header:{titleFont:cg,titleFontSize:lg,titleColor:fg,labelFont:ug,labelFontSize:sg,labelColor:dg},axis:{ticks:!1,grid:!1,domain:!1,labelColor:dg,labelFontSize:ag,titleFont:cg,titleColor:fg,titleFontSize:lg,titleFontWeight:"normal"},axisQuantitative:{tickCount:3,grid:!0,gridColor:"#C8C6C4",gridDash:[1,5],labelFlush:!1},axisBand:{tickExtra:!0},axisX:{labelPadding:5},axisY:{labelPadding:10},bar:{fill:pg},line:{stroke:pg,strokeWidth:3,strokeCap:"round",strokeJoin:"round"},text:{font:ug,fontSize:ag,fill:dg},arc:{fill:pg},area:{fill:pg,line:!0,opacity:.6},path:{stroke:pg},rect:{fill:pg},point:{fill:pg,filled:!0,size:75},shape:{stroke:pg},symbol:{fill:pg,strokeWidth:1.5,size:50},legend:{titleFont:ug,titleFontWeight:"bold",titleColor:dg,labelFont:ug,labelFontSize:sg,labelColor:dg,symbolType:"circle",symbolSize:75},range:{category:[pg,"#12239E","#E66C37","#6B007B","#E044A7","#744EC2","#D9B300","#D64550"],diverging:gg,heatmap:gg,ordinal:[mg,"#c7e4ff","#b0d9ff","#9aceff","#83c3ff","#6cb9ff","#55aeff","#3fa3ff","#2898ff",pg]}},vg='IBM Plex Sans,system-ui,-apple-system,BlinkMacSystemFont,".sfnstext-regular",sans-serif',bg=["#8a3ffc","#33b1ff","#007d79","#ff7eb6","#fa4d56","#fff1f1","#6fdc8c","#4589ff","#d12771","#d2a106","#08bdba","#bae6ff","#ba4e00","#d4bbff"],xg=["#6929c4","#1192e8","#005d5d","#9f1853","#fa4d56","#570408","#198038","#002d9c","#ee538b","#b28600","#009d9a","#012749","#8a3800","#a56eff"];function _g({type:e,background:t}){const n="dark"===e?"#161616":"#ffffff",i="dark"===e?"#f4f4f4":"#161616",r="dark"===e?"#d4bbff":"#6929c4";return{background:t,arc:{fill:r},area:{fill:r},path:{stroke:r},rect:{fill:r},shape:{stroke:r},symbol:{stroke:r},circle:{fill:r},view:{fill:n,stroke:n},group:{fill:n},title:{color:i,anchor:"start",dy:-15,fontSize:16,font:vg,fontWeight:600},axis:{labelColor:i,labelFontSize:12,grid:!0,gridColor:"#525252",titleColor:i,labelAngle:0},style:{"guide-label":{font:vg,fill:i,fontWeight:400},"guide-title":{font:vg,fill:i,fontWeight:400}},range:{category:"dark"===e?bg:xg,diverging:["#750e13","#a2191f","#da1e28","#fa4d56","#ff8389","#ffb3b8","#ffd7d9","#fff1f1","#e5f6ff","#bae6ff","#82cfff","#33b1ff","#1192e8","#0072c3","#00539a","#003a6d"],heatmap:["#f6f2ff","#e8daff","#d4bbff","#be95ff","#a56eff","#8a3ffc","#6929c4","#491d8b","#31135e","#1c0f30"]}}}const wg=_g({type:"light",background:"#ffffff"}),kg=_g({type:"light",background:"#f4f4f4"}),Eg=_g({type:"dark",background:"#262626"}),Dg=_g({type:"dark",background:"#161616"}),$g=Dm;function Ag(e,t){return JSON.stringify(e,function(e){const t=[];return function(n,i){if("object"!==typeof i||null===i)return i;const r=t.indexOf(this)+1;return t.length=r,t.length>e?"[Object]":t.indexOf(i)>=0?"[Circular]":(t.push(i),i)}}(t))}var Sg="#vg-tooltip-element {\n visibility: hidden;\n padding: 8px;\n position: fixed;\n z-index: 1000;\n font-family: sans-serif;\n font-size: 11px;\n border-radius: 3px;\n box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);\n /* The default theme is the light theme. */\n background-color: rgba(255, 255, 255, 0.95);\n border: 1px solid #d9d9d9;\n color: black;\n}\n#vg-tooltip-element.visible {\n visibility: visible;\n}\n#vg-tooltip-element h2 {\n margin-top: 0;\n margin-bottom: 10px;\n font-size: 13px;\n}\n#vg-tooltip-element table {\n border-spacing: 0;\n}\n#vg-tooltip-element table tr {\n border: none;\n}\n#vg-tooltip-element table tr td {\n overflow: hidden;\n text-overflow: ellipsis;\n padding-top: 2px;\n padding-bottom: 2px;\n}\n#vg-tooltip-element table tr td.key {\n color: #808080;\n max-width: 150px;\n text-align: right;\n padding-right: 4px;\n}\n#vg-tooltip-element table tr td.value {\n display: block;\n max-width: 300px;\n max-height: 7em;\n text-align: left;\n}\n#vg-tooltip-element.dark-theme {\n background-color: rgba(32, 32, 32, 0.9);\n border: 1px solid #f5f5f5;\n color: white;\n}\n#vg-tooltip-element.dark-theme td.key {\n color: #bfbfbf;\n}\n";const Mg="vg-tooltip-element",Cg={offsetX:10,offsetY:10,id:Mg,styleId:"vega-tooltip-style",theme:"light",disableDefaultStyle:!1,sanitize:function(e){return String(e).replace(/&/g,"&amp;").replace(/</g,"&lt;")},maxDepth:2,formatTooltip:function(e,t,n,i){if((0,j.kJ)(e))return`[${e.map((e=>t((0,j.HD)(e)?e:Ag(e,n)))).join(", ")}]`;if((0,j.Kn)(e)){let r="";const{title:o,image:a,...s}=e;o&&(r+=`<h2>${t(o)}</h2>`),a&&(r+=`<img src="${new URL(t(a),i||location.href).href}">`);const l=Object.keys(s);if(l.length>0){r+="<table>";for(const e of l){let i=s[e];void 0!==i&&((0,j.Kn)(i)&&(i=Ag(i,n)),r+=`<tr><td class="key">${t(e)}</td><td class="value">${t(i)}</td></tr>`)}r+="</table>"}return r||"{}"}return t(e)},baseURL:""};class Fg{constructor(e){this.options={...Cg,...e};const t=this.options.id;if(this.el=null,this.call=this.tooltipHandler.bind(this),!this.options.disableDefaultStyle&&!document.getElementById(this.options.styleId)){const e=document.createElement("style");e.setAttribute("id",this.options.styleId),e.innerHTML=function(e){if(!/^[A-Za-z]+[-:.\w]*$/.test(e))throw new Error("Invalid HTML ID");return Sg.toString().replace(Mg,e)}(t);const n=document.head;n.childNodes.length>0?n.insertBefore(e,n.childNodes[0]):n.appendChild(e)}}tooltipHandler(e,t,n,i){if(this.el=document.getElementById(this.options.id),!this.el){this.el=document.createElement("div"),this.el.setAttribute("id",this.options.id),this.el.classList.add("vg-tooltip");(document.fullscreenElement??document.body).appendChild(this.el)}if(null==i||""===i)return void this.el.classList.remove("visible",`${this.options.theme}-theme`);this.el.innerHTML=this.options.formatTooltip(i,this.options.sanitize,this.options.maxDepth,this.options.baseURL),this.el.classList.add("visible",`${this.options.theme}-theme`);const{x:r,y:o}=function(e,t,n,i){let r=e.clientX+n;r+t.width>window.innerWidth&&(r=+e.clientX-n-t.width);let o=e.clientY+i;return o+t.height>window.innerHeight&&(o=+e.clientY-i-t.height),{x:r,y:o}}(t,this.el.getBoundingClientRect(),this.options.offsetX,this.options.offsetY);this.el.style.top=`${o}px`,this.el.style.left=`${r}px`}}function Og(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Tg,Ng;var zg=Rg;function Rg(e){var t=this;if(t instanceof Rg||(t=new Rg),t.tail=null,t.head=null,t.length=0,e&&"function"===typeof e.forEach)e.forEach((function(e){t.push(e)}));else if(arguments.length>0)for(var n=0,i=arguments.length;n<i;n++)t.push(arguments[n]);return t}function Pg(e,t,n){var i=t===e.head?new Bg(n,null,t,e):new Bg(n,t,t.next,e);return null===i.next&&(e.tail=i),null===i.prev&&(e.head=i),e.length++,i}function Lg(e,t){e.tail=new Bg(t,e.tail,null,e),e.head||(e.head=e.tail),e.length++}function Ug(e,t){e.head=new Bg(t,null,e.head,e),e.tail||(e.tail=e.head),e.length++}function Bg(e,t,n,i){if(!(this instanceof Bg))return new Bg(e,t,n,i);this.list=i,this.value=e,t?(t.next=this,this.prev=t):this.prev=null,n?(n.prev=this,this.next=n):this.next=null}Rg.Node=Bg,Rg.create=Rg,Rg.prototype.removeNode=function(e){if(e.list!==this)throw new Error("removing node which does not belong to this list");var t=e.next,n=e.prev;return t&&(t.prev=n),n&&(n.next=t),e===this.head&&(this.head=t),e===this.tail&&(this.tail=n),e.list.length--,e.next=null,e.prev=null,e.list=null,t},Rg.prototype.unshiftNode=function(e){if(e!==this.head){e.list&&e.list.removeNode(e);var t=this.head;e.list=this,e.next=t,t&&(t.prev=e),this.head=e,this.tail||(this.tail=e),this.length++}},Rg.prototype.pushNode=function(e){if(e!==this.tail){e.list&&e.list.removeNode(e);var t=this.tail;e.list=this,e.prev=t,t&&(t.next=e),this.tail=e,this.head||(this.head=e),this.length++}},Rg.prototype.push=function(){for(var e=0,t=arguments.length;e<t;e++)Lg(this,arguments[e]);return this.length},Rg.prototype.unshift=function(){for(var e=0,t=arguments.length;e<t;e++)Ug(this,arguments[e]);return this.length},Rg.prototype.pop=function(){if(this.tail){var e=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,e}},Rg.prototype.shift=function(){if(this.head){var e=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,e}},Rg.prototype.forEach=function(e,t){t=t||this;for(var n=this.head,i=0;null!==n;i++)e.call(t,n.value,i,this),n=n.next},Rg.prototype.forEachReverse=function(e,t){t=t||this;for(var n=this.tail,i=this.length-1;null!==n;i--)e.call(t,n.value,i,this),n=n.prev},Rg.prototype.get=function(e){for(var t=0,n=this.head;null!==n&&t<e;t++)n=n.next;if(t===e&&null!==n)return n.value},Rg.prototype.getReverse=function(e){for(var t=0,n=this.tail;null!==n&&t<e;t++)n=n.prev;if(t===e&&null!==n)return n.value},Rg.prototype.map=function(e,t){t=t||this;for(var n=new Rg,i=this.head;null!==i;)n.push(e.call(t,i.value,this)),i=i.next;return n},Rg.prototype.mapReverse=function(e,t){t=t||this;for(var n=new Rg,i=this.tail;null!==i;)n.push(e.call(t,i.value,this)),i=i.prev;return n},Rg.prototype.reduce=function(e,t){var n,i=this.head;if(arguments.length>1)n=t;else{if(!this.head)throw new TypeError("Reduce of empty list with no initial value");i=this.head.next,n=this.head.value}for(var r=0;null!==i;r++)n=e(n,i.value,r),i=i.next;return n},Rg.prototype.reduceReverse=function(e,t){var n,i=this.tail;if(arguments.length>1)n=t;else{if(!this.tail)throw new TypeError("Reduce of empty list with no initial value");i=this.tail.prev,n=this.tail.value}for(var r=this.length-1;null!==i;r--)n=e(n,i.value,r),i=i.prev;return n},Rg.prototype.toArray=function(){for(var e=new Array(this.length),t=0,n=this.head;null!==n;t++)e[t]=n.value,n=n.next;return e},Rg.prototype.toArrayReverse=function(){for(var e=new Array(this.length),t=0,n=this.tail;null!==n;t++)e[t]=n.value,n=n.prev;return e},Rg.prototype.slice=function(e,t){(t=t||this.length)<0&&(t+=this.length),(e=e||0)<0&&(e+=this.length);var n=new Rg;if(t<e||t<0)return n;e<0&&(e=0),t>this.length&&(t=this.length);for(var i=0,r=this.head;null!==r&&i<e;i++)r=r.next;for(;null!==r&&i<t;i++,r=r.next)n.push(r.value);return n},Rg.prototype.sliceReverse=function(e,t){(t=t||this.length)<0&&(t+=this.length),(e=e||0)<0&&(e+=this.length);var n=new Rg;if(t<e||t<0)return n;e<0&&(e=0),t>this.length&&(t=this.length);for(var i=this.length,r=this.tail;null!==r&&i>t;i--)r=r.prev;for(;null!==r&&i>e;i--,r=r.prev)n.push(r.value);return n},Rg.prototype.splice=function(e,t,...n){e>this.length&&(e=this.length-1),e<0&&(e=this.length+e);for(var i=0,r=this.head;null!==r&&i<e;i++)r=r.next;var o=[];for(i=0;r&&i<t;i++)o.push(r.value),r=this.removeNode(r);null===r&&(r=this.tail),r!==this.head&&r!==this.tail&&(r=r.prev);for(i=0;i<n.length;i++)r=Pg(this,r,n[i]);return o},Rg.prototype.reverse=function(){for(var e=this.head,t=this.tail,n=e;null!==n;n=n.prev){var i=n.prev;n.prev=n.next,n.next=i}return this.head=t,this.tail=e,this};try{(Ng||(Ng=1,Tg=function(e){e.prototype[Symbol.iterator]=function*(){for(let e=this.head;e;e=e.next)yield e.value}}),Tg)(Rg)}catch(fv){}const jg=zg,Ig=Symbol("max"),qg=Symbol("length"),Wg=Symbol("lengthCalculator"),Hg=Symbol("allowStale"),Xg=Symbol("maxAge"),Jg=Symbol("dispose"),Gg=Symbol("noDisposeOnSet"),Vg=Symbol("lruList"),Yg=Symbol("cache"),Kg=Symbol("updateAgeOnGet"),Zg=()=>1;const Qg=(e,t,n)=>{const i=e[Yg].get(t);if(i){const t=i.value;if(ey(e,t)){if(ny(e,i),!e[Hg])return}else n&&(e[Kg]&&(i.value.now=Date.now()),e[Vg].unshiftNode(i));return t.value}},ey=(e,t)=>{if(!t||!t.maxAge&&!e[Xg])return!1;const n=Date.now()-t.now;return t.maxAge?n>t.maxAge:e[Xg]&&n>e[Xg]},ty=e=>{if(e[qg]>e[Ig])for(let t=e[Vg].tail;e[qg]>e[Ig]&&null!==t;){const n=t.prev;ny(e,t),t=n}},ny=(e,t)=>{if(t){const n=t.value;e[Jg]&&e[Jg](n.key,n.value),e[qg]-=n.length,e[Yg].delete(n.key),e[Vg].removeNode(t)}};class iy{constructor(e,t,n,i,r){this.key=e,this.value=t,this.length=n,this.now=i,this.maxAge=r||0}}const ry=(e,t,n,i)=>{let r=n.value;ey(e,r)&&(ny(e,n),e[Hg]||(r=void 0)),r&&t.call(i,r.value,r.key,e)};var oy=class{constructor(e){if("number"===typeof e&&(e={max:e}),e||(e={}),e.max&&("number"!==typeof e.max||e.max<0))throw new TypeError("max must be a non-negative number");this[Ig]=e.max||1/0;const t=e.length||Zg;if(this[Wg]="function"!==typeof t?Zg:t,this[Hg]=e.stale||!1,e.maxAge&&"number"!==typeof e.maxAge)throw new TypeError("maxAge must be a number");this[Xg]=e.maxAge||0,this[Jg]=e.dispose,this[Gg]=e.noDisposeOnSet||!1,this[Kg]=e.updateAgeOnGet||!1,this.reset()}set max(e){if("number"!==typeof e||e<0)throw new TypeError("max must be a non-negative number");this[Ig]=e||1/0,ty(this)}get max(){return this[Ig]}set allowStale(e){this[Hg]=!!e}get allowStale(){return this[Hg]}set maxAge(e){if("number"!==typeof e)throw new TypeError("maxAge must be a non-negative number");this[Xg]=e,ty(this)}get maxAge(){return this[Xg]}set lengthCalculator(e){"function"!==typeof e&&(e=Zg),e!==this[Wg]&&(this[Wg]=e,this[qg]=0,this[Vg].forEach((e=>{e.length=this[Wg](e.value,e.key),this[qg]+=e.length}))),ty(this)}get lengthCalculator(){return this[Wg]}get length(){return this[qg]}get itemCount(){return this[Vg].length}rforEach(e,t){t=t||this;for(let n=this[Vg].tail;null!==n;){const i=n.prev;ry(this,e,n,t),n=i}}forEach(e,t){t=t||this;for(let n=this[Vg].head;null!==n;){const i=n.next;ry(this,e,n,t),n=i}}keys(){return this[Vg].toArray().map((e=>e.key))}values(){return this[Vg].toArray().map((e=>e.value))}reset(){this[Jg]&&this[Vg]&&this[Vg].length&&this[Vg].forEach((e=>this[Jg](e.key,e.value))),this[Yg]=new Map,this[Vg]=new jg,this[qg]=0}dump(){return this[Vg].map((e=>!ey(this,e)&&{k:e.key,v:e.value,e:e.now+(e.maxAge||0)})).toArray().filter((e=>e))}dumpLru(){return this[Vg]}set(e,t,n){if((n=n||this[Xg])&&"number"!==typeof n)throw new TypeError("maxAge must be a number");const i=n?Date.now():0,r=this[Wg](t,e);if(this[Yg].has(e)){if(r>this[Ig])return ny(this,this[Yg].get(e)),!1;const o=this[Yg].get(e).value;return this[Jg]&&(this[Gg]||this[Jg](e,o.value)),o.now=i,o.maxAge=n,o.value=t,this[qg]+=r-o.length,o.length=r,this.get(e),ty(this),!0}const o=new iy(e,t,r,i,n);return o.length>this[Ig]?(this[Jg]&&this[Jg](e,t),!1):(this[qg]+=o.length,this[Vg].unshift(o),this[Yg].set(e,this[Vg].head),ty(this),!0)}has(e){if(!this[Yg].has(e))return!1;const t=this[Yg].get(e).value;return!ey(this,t)}get(e){return Qg(this,e,!0)}peek(e){return Qg(this,e,!1)}pop(){const e=this[Vg].tail;return e?(ny(this,e),e.value):null}del(e){ny(this,this[Yg].get(e))}load(e){this.reset();const t=Date.now();for(let n=e.length-1;n>=0;n--){const i=e[n],r=i.e||0;if(0===r)this.set(i.k,i.v);else{const e=r-t;e>0&&this.set(i.k,i.v,e)}}}prune(){this[Yg].forEach(((e,t)=>Qg(this,t,!1)))}};const ay=Object.freeze({loose:!0}),sy=Object.freeze({});var ly=e=>e?"object"!==typeof e?ay:e:sy,uy={exports:{}};var cy={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER||9007199254740991,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2};var fy="object"===typeof process&&{NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0}.NODE_DEBUG&&/\bsemver\b/i.test({NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0}.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};!function(e,t){const{MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:i,MAX_LENGTH:r}=cy,o=fy,a=(t=e.exports={}).re=[],s=t.safeRe=[],l=t.src=[],u=t.t={};let c=0;const f="[a-zA-Z0-9-]",d=[["\\s",1],["\\d",r],[f,i]],h=(e,t,n)=>{const i=(e=>{for(const[t,n]of d)e=e.split(`${t}*`).join(`${t}{0,${n}}`).split(`${t}+`).join(`${t}{1,${n}}`);return e})(t),r=c++;o(e,r,t),u[e]=r,l[r]=t,a[r]=new RegExp(t,n?"g":void 0),s[r]=new RegExp(i,n?"g":void 0)};h("NUMERICIDENTIFIER","0|[1-9]\\d*"),h("NUMERICIDENTIFIERLOOSE","\\d+"),h("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${f}*`),h("MAINVERSION",`(${l[u.NUMERICIDENTIFIER]})\\.(${l[u.NUMERICIDENTIFIER]})\\.(${l[u.NUMERICIDENTIFIER]})`),h("MAINVERSIONLOOSE",`(${l[u.NUMERICIDENTIFIERLOOSE]})\\.(${l[u.NUMERICIDENTIFIERLOOSE]})\\.(${l[u.NUMERICIDENTIFIERLOOSE]})`),h("PRERELEASEIDENTIFIER",`(?:${l[u.NUMERICIDENTIFIER]}|${l[u.NONNUMERICIDENTIFIER]})`),h("PRERELEASEIDENTIFIERLOOSE",`(?:${l[u.NUMERICIDENTIFIERLOOSE]}|${l[u.NONNUMERICIDENTIFIER]})`),h("PRERELEASE",`(?:-(${l[u.PRERELEASEIDENTIFIER]}(?:\\.${l[u.PRERELEASEIDENTIFIER]})*))`),h("PRERELEASELOOSE",`(?:-?(${l[u.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${l[u.PRERELEASEIDENTIFIERLOOSE]})*))`),h("BUILDIDENTIFIER",`${f}+`),h("BUILD",`(?:\\+(${l[u.BUILDIDENTIFIER]}(?:\\.${l[u.BUILDIDENTIFIER]})*))`),h("FULLPLAIN",`v?${l[u.MAINVERSION]}${l[u.PRERELEASE]}?${l[u.BUILD]}?`),h("FULL",`^${l[u.FULLPLAIN]}$`),h("LOOSEPLAIN",`[v=\\s]*${l[u.MAINVERSIONLOOSE]}${l[u.PRERELEASELOOSE]}?${l[u.BUILD]}?`),h("LOOSE",`^${l[u.LOOSEPLAIN]}$`),h("GTLT","((?:<|>)?=?)"),h("XRANGEIDENTIFIERLOOSE",`${l[u.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),h("XRANGEIDENTIFIER",`${l[u.NUMERICIDENTIFIER]}|x|X|\\*`),h("XRANGEPLAIN",`[v=\\s]*(${l[u.XRANGEIDENTIFIER]})(?:\\.(${l[u.XRANGEIDENTIFIER]})(?:\\.(${l[u.XRANGEIDENTIFIER]})(?:${l[u.PRERELEASE]})?${l[u.BUILD]}?)?)?`),h("XRANGEPLAINLOOSE",`[v=\\s]*(${l[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${l[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${l[u.XRANGEIDENTIFIERLOOSE]})(?:${l[u.PRERELEASELOOSE]})?${l[u.BUILD]}?)?)?`),h("XRANGE",`^${l[u.GTLT]}\\s*${l[u.XRANGEPLAIN]}$`),h("XRANGELOOSE",`^${l[u.GTLT]}\\s*${l[u.XRANGEPLAINLOOSE]}$`),h("COERCE",`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?(?:$|[^\\d])`),h("COERCERTL",l[u.COERCE],!0),h("LONETILDE","(?:~>?)"),h("TILDETRIM",`(\\s*)${l[u.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",h("TILDE",`^${l[u.LONETILDE]}${l[u.XRANGEPLAIN]}$`),h("TILDELOOSE",`^${l[u.LONETILDE]}${l[u.XRANGEPLAINLOOSE]}$`),h("LONECARET","(?:\\^)"),h("CARETTRIM",`(\\s*)${l[u.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",h("CARET",`^${l[u.LONECARET]}${l[u.XRANGEPLAIN]}$`),h("CARETLOOSE",`^${l[u.LONECARET]}${l[u.XRANGEPLAINLOOSE]}$`),h("COMPARATORLOOSE",`^${l[u.GTLT]}\\s*(${l[u.LOOSEPLAIN]})$|^$`),h("COMPARATOR",`^${l[u.GTLT]}\\s*(${l[u.FULLPLAIN]})$|^$`),h("COMPARATORTRIM",`(\\s*)${l[u.GTLT]}\\s*(${l[u.LOOSEPLAIN]}|${l[u.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",h("HYPHENRANGE",`^\\s*(${l[u.XRANGEPLAIN]})\\s+-\\s+(${l[u.XRANGEPLAIN]})\\s*$`),h("HYPHENRANGELOOSE",`^\\s*(${l[u.XRANGEPLAINLOOSE]})\\s+-\\s+(${l[u.XRANGEPLAINLOOSE]})\\s*$`),h("STAR","(<|>)?=?\\s*\\*"),h("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),h("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")}(uy,uy.exports);var dy=uy.exports;const hy=/^[0-9]+$/,py=(e,t)=>{const n=hy.test(e),i=hy.test(t);return n&&i&&(e=+e,t=+t),e===t?0:n&&!i?-1:i&&!n?1:e<t?-1:1};var my={compareIdentifiers:py,rcompareIdentifiers:(e,t)=>py(t,e)};const gy=fy,{MAX_LENGTH:yy,MAX_SAFE_INTEGER:vy}=cy,{safeRe:by,t:xy}=dy,_y=ly,{compareIdentifiers:wy}=my;var ky=class e{constructor(t,n){if(n=_y(n),t instanceof e){if(t.loose===!!n.loose&&t.includePrerelease===!!n.includePrerelease)return t;t=t.version}else if("string"!==typeof t)throw new TypeError(`Invalid version. Must be a string. Got type "${typeof t}".`);if(t.length>yy)throw new TypeError(`version is longer than ${yy} characters`);gy("SemVer",t,n),this.options=n,this.loose=!!n.loose,this.includePrerelease=!!n.includePrerelease;const i=t.trim().match(n.loose?by[xy.LOOSE]:by[xy.FULL]);if(!i)throw new TypeError(`Invalid Version: ${t}`);if(this.raw=t,this.major=+i[1],this.minor=+i[2],this.patch=+i[3],this.major>vy||this.major<0)throw new TypeError("Invalid major version");if(this.minor>vy||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>vy||this.patch<0)throw new TypeError("Invalid patch version");i[4]?this.prerelease=i[4].split(".").map((e=>{if(/^[0-9]+$/.test(e)){const t=+e;if(t>=0&&t<vy)return t}return e})):this.prerelease=[],this.build=i[5]?i[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(t){if(gy("SemVer.compare",this.version,this.options,t),!(t instanceof e)){if("string"===typeof t&&t===this.version)return 0;t=new e(t,this.options)}return t.version===this.version?0:this.compareMain(t)||this.comparePre(t)}compareMain(t){return t instanceof e||(t=new e(t,this.options)),wy(this.major,t.major)||wy(this.minor,t.minor)||wy(this.patch,t.patch)}comparePre(t){if(t instanceof e||(t=new e(t,this.options)),this.prerelease.length&&!t.prerelease.length)return-1;if(!this.prerelease.length&&t.prerelease.length)return 1;if(!this.prerelease.length&&!t.prerelease.length)return 0;let n=0;do{const e=this.prerelease[n],i=t.prerelease[n];if(gy("prerelease compare",n,e,i),void 0===e&&void 0===i)return 0;if(void 0===i)return 1;if(void 0===e)return-1;if(e!==i)return wy(e,i)}while(++n)}compareBuild(t){t instanceof e||(t=new e(t,this.options));let n=0;do{const e=this.build[n],i=t.build[n];if(gy("prerelease compare",n,e,i),void 0===e&&void 0===i)return 0;if(void 0===i)return 1;if(void 0===e)return-1;if(e!==i)return wy(e,i)}while(++n)}inc(e,t,n){switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t,n);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t,n);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t,n),this.inc("pre",t,n);break;case"prerelease":0===this.prerelease.length&&this.inc("patch",t,n),this.inc("pre",t,n);break;case"major":0===this.minor&&0===this.patch&&0!==this.prerelease.length||this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":0===this.patch&&0!==this.prerelease.length||this.minor++,this.patch=0,this.prerelease=[];break;case"patch":0===this.prerelease.length&&this.patch++,this.prerelease=[];break;case"pre":{const e=Number(n)?1:0;if(!t&&!1===n)throw new Error("invalid increment argument: identifier is empty");if(0===this.prerelease.length)this.prerelease=[e];else{let i=this.prerelease.length;for(;--i>=0;)"number"===typeof this.prerelease[i]&&(this.prerelease[i]++,i=-2);if(-1===i){if(t===this.prerelease.join(".")&&!1===n)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(e)}}if(t){let i=[t,e];!1===n&&(i=[t]),0===wy(this.prerelease[0],t)?isNaN(this.prerelease[1])&&(this.prerelease=i):this.prerelease=i}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};const Ey=ky;var Dy=(e,t,n)=>new Ey(e,n).compare(new Ey(t,n));const $y=Dy;const Ay=Dy;const Sy=Dy;const My=Dy;const Cy=Dy;const Fy=Dy;const Oy=(e,t,n)=>0===$y(e,t,n),Ty=(e,t,n)=>0!==Ay(e,t,n),Ny=(e,t,n)=>Sy(e,t,n)>0,zy=(e,t,n)=>My(e,t,n)>=0,Ry=(e,t,n)=>Cy(e,t,n)<0,Py=(e,t,n)=>Fy(e,t,n)<=0;var Ly,Uy,By,jy,Iy=(e,t,n,i)=>{switch(t){case"===":return"object"===typeof e&&(e=e.version),"object"===typeof n&&(n=n.version),e===n;case"!==":return"object"===typeof e&&(e=e.version),"object"===typeof n&&(n=n.version),e!==n;case"":case"=":case"==":return Oy(e,n,i);case"!=":return Ty(e,n,i);case">":return Ny(e,n,i);case">=":return zy(e,n,i);case"<":return Ry(e,n,i);case"<=":return Py(e,n,i);default:throw new TypeError(`Invalid operator: ${t}`)}};function qy(){if(jy)return By;jy=1;class e{constructor(t,r){if(r=n(r),t instanceof e)return t.loose===!!r.loose&&t.includePrerelease===!!r.includePrerelease?t:new e(t.raw,r);if(t instanceof i)return this.raw=t.value,this.set=[[t]],this.format(),this;if(this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease,this.raw=t.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map((e=>this.parseRange(e.trim()))).filter((e=>e.length)),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const e=this.set[0];if(this.set=this.set.filter((e=>!h(e[0]))),0===this.set.length)this.set=[e];else if(this.set.length>1)for(const t of this.set)if(1===t.length&&p(t[0])){this.set=[t];break}}this.format()}format(){return this.range=this.set.map((e=>e.join(" ").trim())).join("||").trim(),this.range}toString(){return this.range}parseRange(e){const n=((this.options.includePrerelease&&f)|(this.options.loose&&d))+":"+e,o=t.get(n);if(o)return o;const p=this.options.loose,m=p?a[s.HYPHENRANGELOOSE]:a[s.HYPHENRANGE];e=e.replace(m,$(this.options.includePrerelease)),r("hyphen replace",e),e=e.replace(a[s.COMPARATORTRIM],l),r("comparator trim",e),e=e.replace(a[s.TILDETRIM],u),r("tilde trim",e),e=e.replace(a[s.CARETTRIM],c),r("caret trim",e);let y=e.split(" ").map((e=>g(e,this.options))).join(" ").split(/\s+/).map((e=>D(e,this.options)));p&&(y=y.filter((e=>(r("loose invalid filter",e,this.options),!!e.match(a[s.COMPARATORLOOSE]))))),r("range list",y);const v=new Map,b=y.map((e=>new i(e,this.options)));for(const t of b){if(h(t))return[t];v.set(t.value,t)}v.size>1&&v.has("")&&v.delete("");const x=[...v.values()];return t.set(n,x),x}intersects(t,n){if(!(t instanceof e))throw new TypeError("a Range is required");return this.set.some((e=>m(e,n)&&t.set.some((t=>m(t,n)&&e.every((e=>t.every((t=>e.intersects(t,n)))))))))}test(e){if(!e)return!1;if("string"===typeof e)try{e=new o(e,this.options)}catch(fv){return!1}for(let t=0;t<this.set.length;t++)if(A(this.set[t],e,this.options))return!0;return!1}}By=e;const t=new oy({max:1e3}),n=ly,i=function(){if(Uy)return Ly;Uy=1;const e=Symbol("SemVer ANY");class t{static get ANY(){return e}constructor(i,r){if(r=n(r),i instanceof t){if(i.loose===!!r.loose)return i;i=i.value}i=i.trim().split(/\s+/).join(" "),a("comparator",i,r),this.options=r,this.loose=!!r.loose,this.parse(i),this.semver===e?this.value="":this.value=this.operator+this.semver.version,a("comp",this)}parse(t){const n=this.options.loose?i[r.COMPARATORLOOSE]:i[r.COMPARATOR],o=t.match(n);if(!o)throw new TypeError(`Invalid comparator: ${t}`);this.operator=void 0!==o[1]?o[1]:"","="===this.operator&&(this.operator=""),o[2]?this.semver=new s(o[2],this.options.loose):this.semver=e}toString(){return this.value}test(t){if(a("Comparator.test",t,this.options.loose),this.semver===e||t===e)return!0;if("string"===typeof t)try{t=new s(t,this.options)}catch(fv){return!1}return o(t,this.operator,this.semver,this.options)}intersects(e,i){if(!(e instanceof t))throw new TypeError("a Comparator is required");return""===this.operator?""===this.value||new l(e.value,i).test(this.value):""===e.operator?""===e.value||new l(this.value,i).test(e.semver):(!(i=n(i)).includePrerelease||"<0.0.0-0"!==this.value&&"<0.0.0-0"!==e.value)&&!(!i.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0")))&&(!(!this.operator.startsWith(">")||!e.operator.startsWith(">"))||!(!this.operator.startsWith("<")||!e.operator.startsWith("<"))||!(this.semver.version!==e.semver.version||!this.operator.includes("=")||!e.operator.includes("="))||!!(o(this.semver,"<",e.semver,i)&&this.operator.startsWith(">")&&e.operator.startsWith("<"))||!!(o(this.semver,">",e.semver,i)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}}Ly=t;const n=ly,{safeRe:i,t:r}=dy,o=Iy,a=fy,s=ky,l=qy();return Ly}(),r=fy,o=ky,{safeRe:a,t:s,comparatorTrimReplace:l,tildeTrimReplace:u,caretTrimReplace:c}=dy,{FLAG_INCLUDE_PRERELEASE:f,FLAG_LOOSE:d}=cy,h=e=>"<0.0.0-0"===e.value,p=e=>""===e.value,m=(e,t)=>{let n=!0;const i=e.slice();let r=i.pop();for(;n&&i.length;)n=i.every((e=>r.intersects(e,t))),r=i.pop();return n},g=(e,t)=>(r("comp",e,t),e=x(e,t),r("caret",e),e=v(e,t),r("tildes",e),e=w(e,t),r("xrange",e),e=E(e,t),r("stars",e),e),y=e=>!e||"x"===e.toLowerCase()||"*"===e,v=(e,t)=>e.trim().split(/\s+/).map((e=>b(e,t))).join(" "),b=(e,t)=>{const n=t.loose?a[s.TILDELOOSE]:a[s.TILDE];return e.replace(n,((t,n,i,o,a)=>{let s;return r("tilde",e,t,n,i,o,a),y(n)?s="":y(i)?s=`>=${n}.0.0 <${+n+1}.0.0-0`:y(o)?s=`>=${n}.${i}.0 <${n}.${+i+1}.0-0`:a?(r("replaceTilde pr",a),s=`>=${n}.${i}.${o}-${a} <${n}.${+i+1}.0-0`):s=`>=${n}.${i}.${o} <${n}.${+i+1}.0-0`,r("tilde return",s),s}))},x=(e,t)=>e.trim().split(/\s+/).map((e=>_(e,t))).join(" "),_=(e,t)=>{r("caret",e,t);const n=t.loose?a[s.CARETLOOSE]:a[s.CARET],i=t.includePrerelease?"-0":"";return e.replace(n,((t,n,o,a,s)=>{let l;return r("caret",e,t,n,o,a,s),y(n)?l="":y(o)?l=`>=${n}.0.0${i} <${+n+1}.0.0-0`:y(a)?l="0"===n?`>=${n}.${o}.0${i} <${n}.${+o+1}.0-0`:`>=${n}.${o}.0${i} <${+n+1}.0.0-0`:s?(r("replaceCaret pr",s),l="0"===n?"0"===o?`>=${n}.${o}.${a}-${s} <${n}.${o}.${+a+1}-0`:`>=${n}.${o}.${a}-${s} <${n}.${+o+1}.0-0`:`>=${n}.${o}.${a}-${s} <${+n+1}.0.0-0`):(r("no pr"),l="0"===n?"0"===o?`>=${n}.${o}.${a}${i} <${n}.${o}.${+a+1}-0`:`>=${n}.${o}.${a}${i} <${n}.${+o+1}.0-0`:`>=${n}.${o}.${a} <${+n+1}.0.0-0`),r("caret return",l),l}))},w=(e,t)=>(r("replaceXRanges",e,t),e.split(/\s+/).map((e=>k(e,t))).join(" ")),k=(e,t)=>{e=e.trim();const n=t.loose?a[s.XRANGELOOSE]:a[s.XRANGE];return e.replace(n,((n,i,o,a,s,l)=>{r("xRange",e,n,i,o,a,s,l);const u=y(o),c=u||y(a),f=c||y(s),d=f;return"="===i&&d&&(i=""),l=t.includePrerelease?"-0":"",u?n=">"===i||"<"===i?"<0.0.0-0":"*":i&&d?(c&&(a=0),s=0,">"===i?(i=">=",c?(o=+o+1,a=0,s=0):(a=+a+1,s=0)):"<="===i&&(i="<",c?o=+o+1:a=+a+1),"<"===i&&(l="-0"),n=`${i+o}.${a}.${s}${l}`):c?n=`>=${o}.0.0${l} <${+o+1}.0.0-0`:f&&(n=`>=${o}.${a}.0${l} <${o}.${+a+1}.0-0`),r("xRange return",n),n}))},E=(e,t)=>(r("replaceStars",e,t),e.trim().replace(a[s.STAR],"")),D=(e,t)=>(r("replaceGTE0",e,t),e.trim().replace(a[t.includePrerelease?s.GTE0PRE:s.GTE0],"")),$=e=>(t,n,i,r,o,a,s,l,u,c,f,d,h)=>`${n=y(i)?"":y(r)?`>=${i}.0.0${e?"-0":""}`:y(o)?`>=${i}.${r}.0${e?"-0":""}`:a?`>=${n}`:`>=${n}${e?"-0":""}`} ${l=y(u)?"":y(c)?`<${+u+1}.0.0-0`:y(f)?`<${u}.${+c+1}.0-0`:d?`<=${u}.${c}.${f}-${d}`:e?`<${u}.${c}.${+f+1}-0`:`<=${l}`}`.trim(),A=(e,t,n)=>{for(let i=0;i<e.length;i++)if(!e[i].test(t))return!1;if(t.prerelease.length&&!n.includePrerelease){for(let n=0;n<e.length;n++)if(r(e[n].semver),e[n].semver!==i.ANY&&e[n].semver.prerelease.length>0){const i=e[n].semver;if(i.major===t.major&&i.minor===t.minor&&i.patch===t.patch)return!0}return!1}return!0};return By}const Wy=qy();var Hy=(e,t,n)=>{try{t=new Wy(t,n)}catch(fv){return!1}return t.test(e)},Xy=Og(Hy);var Jy='.vega-embed {\n position: relative;\n display: inline-block;\n box-sizing: border-box;\n}\n.vega-embed.has-actions {\n padding-right: 38px;\n}\n.vega-embed details:not([open]) > :not(summary) {\n display: none !important;\n}\n.vega-embed summary {\n list-style: none;\n position: absolute;\n top: 0;\n right: 0;\n padding: 6px;\n z-index: 1000;\n background: white;\n box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.1);\n color: #1b1e23;\n border: 1px solid #aaa;\n border-radius: 999px;\n opacity: 0.2;\n transition: opacity 0.4s ease-in;\n cursor: pointer;\n line-height: 0px;\n}\n.vega-embed summary::-webkit-details-marker {\n display: none;\n}\n.vega-embed summary:active {\n box-shadow: #aaa 0px 0px 0px 1px inset;\n}\n.vega-embed summary svg {\n width: 14px;\n height: 14px;\n}\n.vega-embed details[open] summary {\n opacity: 0.7;\n}\n.vega-embed:hover summary, .vega-embed:focus-within summary {\n opacity: 1 !important;\n transition: opacity 0.2s ease;\n}\n.vega-embed .vega-actions {\n position: absolute;\n z-index: 1001;\n top: 35px;\n right: -9px;\n display: flex;\n flex-direction: column;\n padding-bottom: 8px;\n padding-top: 8px;\n border-radius: 4px;\n box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.2);\n border: 1px solid #d9d9d9;\n background: white;\n animation-duration: 0.15s;\n animation-name: scale-in;\n animation-timing-function: cubic-bezier(0.2, 0, 0.13, 1.5);\n text-align: left;\n}\n.vega-embed .vega-actions a {\n padding: 8px 16px;\n font-family: sans-serif;\n font-size: 14px;\n font-weight: 600;\n white-space: nowrap;\n color: #434a56;\n text-decoration: none;\n}\n.vega-embed .vega-actions a:hover, .vega-embed .vega-actions a:focus {\n background-color: #f7f7f9;\n color: black;\n}\n.vega-embed .vega-actions::before, .vega-embed .vega-actions::after {\n content: "";\n display: inline-block;\n position: absolute;\n}\n.vega-embed .vega-actions::before {\n left: auto;\n right: 14px;\n top: -16px;\n border: 8px solid rgba(0, 0, 0, 0);\n border-bottom-color: #d9d9d9;\n}\n.vega-embed .vega-actions::after {\n left: auto;\n right: 15px;\n top: -14px;\n border: 7px solid rgba(0, 0, 0, 0);\n border-bottom-color: #fff;\n}\n.vega-embed .chart-wrapper.fit-x {\n width: 100%;\n}\n.vega-embed .chart-wrapper.fit-y {\n height: 100%;\n}\n\n.vega-embed-wrapper {\n max-width: 100%;\n overflow: auto;\n padding-right: 14px;\n}\n\n@keyframes scale-in {\n from {\n opacity: 0;\n transform: scale(0.6);\n }\n to {\n opacity: 1;\n transform: scale(1);\n }\n}\n';function Gy(e,...t){for(const n of t)Vy(e,n);return e}function Vy(e,t){for(const n of Object.keys(t))(0,U.writeConfig)(e,n,t[n],!0)}const Yy=U;let Ky=o;const Zy="undefined"!==typeof window?window:void 0;void 0===Ky&&Zy?.vl?.compile&&(Ky=Zy.vl);const Qy={export:{svg:!0,png:!0},source:!0,compiled:!0,editor:!0},ev={CLICK_TO_VIEW_ACTIONS:"Click to view actions",COMPILED_ACTION:"View Compiled Vega",EDITOR_ACTION:"Open in Vega Editor",PNG_ACTION:"Save as PNG",SOURCE_ACTION:"View Source",SVG_ACTION:"Save as SVG"},tv={vega:"Vega","vega-lite":"Vega-Lite"},nv={vega:Yy.version,"vega-lite":Ky?Ky.version:"not available"},iv={vega:e=>e,"vega-lite":(e,t)=>Ky.compile(e,{config:t}).spec},rv='\n<svg viewBox="0 0 16 16" fill="currentColor" stroke="none" stroke-width="1" stroke-linecap="round" stroke-linejoin="round">\n <circle r="2" cy="8" cx="2"></circle>\n <circle r="2" cy="8" cx="8"></circle>\n <circle r="2" cy="8" cx="14"></circle>\n</svg>',ov="chart-wrapper";function av(e,t,n,i){const r=`<html><head>${t}</head><body><pre><code class="json">`,o=`</code></pre>${n}</body></html>`,a=window.open("");a.document.write(r+e+o),a.document.title=`${tv[i]} JSON Source`}function sv(e){return!(!e||!("load"in e))}function lv(e){return sv(e)?e:Yy.loader(e)}async function uv(e,t,n={}){let i,r;(0,U.isString)(t)?(r=lv(n.loader),i=JSON.parse(await r.load(t))):i=t;const o=function(e){const t=e.usermeta?.embedOptions??{};return(0,U.isString)(t.defaultStyle)&&(t.defaultStyle=!1),t}(i),s=o.loader;r&&!s||(r=lv(n.loader??s));const l=await cv(o,r),u=await cv(n,r),c={...Gy(u,l),config:(0,U.mergeConfig)(u.config??{},l.config??{})};return await async function(e,t,n={},i){const r=n.theme?(0,U.mergeConfig)(a[n.theme],n.config??{}):n.config,o=(0,U.isBoolean)(n.actions)?n.actions:Gy({},Qy,n.actions??{}),s={...ev,...n.i18n},l=n.renderer??"canvas",u=n.logLevel??Yy.Warn,c=n.downloadFileName??"visualization",f="string"===typeof e?document.querySelector(e):e;if(!f)throw new Error(`${e} does not exist`);if(!1!==n.defaultStyle){const e="vega-embed-style",{root:t,rootContainer:i}=function(e){const t=e.getRootNode?e.getRootNode():document;return t instanceof ShadowRoot?{root:t,rootContainer:t}:{root:document,rootContainer:document.head??document.body}}(f);if(!t.getElementById(e)){const t=document.createElement("style");t.id=e,t.innerHTML=void 0===n.defaultStyle||!0===n.defaultStyle?Jy.toString():n.defaultStyle,i.appendChild(t)}}const d=function(e,t){if(e.$schema){const n=Em(e.$schema);t&&t!==n.library&&console.warn(`The given visualization spec is written in ${tv[n.library]}, but mode argument sets ${tv[t]??t}.`);const i=n.library;return Xy(nv[i],`^${n.version.slice(1)}`)||console.warn(`The input spec uses ${tv[i]} ${n.version}, but the current version of ${tv[i]} is v${nv[i]}.`),i}return"mark"in e||"encoding"in e||"layer"in e||"hconcat"in e||"vconcat"in e||"facet"in e||"repeat"in e?"vega-lite":"marks"in e||"signals"in e||"scales"in e||"axes"in e?"vega":t??"vega"}(t,n.mode);let h=iv[d](t,r);if("vega-lite"===d&&h.$schema){const e=Em(h.$schema);Xy(nv.vega,`^${e.version.slice(1)}`)||console.warn(`The compiled spec uses Vega ${e.version}, but current version is v${nv.vega}.`)}f.classList.add("vega-embed"),o&&f.classList.add("has-actions");f.innerHTML="";let p=f;if(o){const e=document.createElement("div");e.classList.add(ov),f.appendChild(e),p=e}const m=n.patch;m&&(h=m instanceof Function?m(h):E(h,m,!0,!1).newDocument);n.formatLocale&&Yy.formatLocale(n.formatLocale);n.timeFormatLocale&&Yy.timeFormatLocale(n.timeFormatLocale);if(n.expressionFunctions)for(const a in n.expressionFunctions){const e=n.expressionFunctions[a];"fn"in e?Yy.expressionFunction(a,e.fn,e.visitor):e instanceof Function&&Yy.expressionFunction(a,e)}const{ast:g}=n,y=Yy.parse(h,"vega-lite"===d?{}:r,{ast:g}),v=new(n.viewClass||Yy.View)(y,{loader:i,logLevel:u,renderer:l,...g?{expr:Yy.expressionInterpreter??n.expr??B.N}:{}});if(v.addSignalListener("autosize",((e,t)=>{const{type:n}=t;"fit-x"==n?(p.classList.add("fit-x"),p.classList.remove("fit-y")):"fit-y"==n?(p.classList.remove("fit-x"),p.classList.add("fit-y")):"fit"==n?p.classList.add("fit-x","fit-y"):p.classList.remove("fit-x","fit-y")})),!1!==n.tooltip){const{loader:e,tooltip:t}=n,i=e&&!sv(e)?e?.baseURL:void 0,r="function"===typeof t?t:new Fg({baseURL:i,...!0===t?{}:t}).call;v.tooltip(r)}let b,{hover:x}=n;void 0===x&&(x="vega"===d);if(x){const{hoverSet:e,updateSet:t}="boolean"===typeof x?{}:x;v.hover(e,t)}n&&(null!=n.width&&v.width(n.width),null!=n.height&&v.height(n.height),null!=n.padding&&v.padding(n.padding));if(await v.initialize(p,n.bind).runAsync(),!1!==o){let e=f;if(!1!==n.defaultStyle||n.forceActionsMenu){const t=document.createElement("details");t.title=s.CLICK_TO_VIEW_ACTIONS,f.append(t),e=t;const n=document.createElement("summary");n.innerHTML=rv,t.append(n),b=e=>{t.contains(e.target)||t.removeAttribute("open")},document.addEventListener("click",b)}const i=document.createElement("div");if(e.append(i),i.classList.add("vega-actions"),!0===o||!1!==o.export)for(const t of["svg","png"])if(!0===o||!0===o.export||o.export[t]){const e=s[`${t.toUpperCase()}_ACTION`],r=document.createElement("a"),o=(0,U.isObject)(n.scaleFactor)?n.scaleFactor[t]:n.scaleFactor;r.text=e,r.href="#",r.target="_blank",r.download=`${c}.${t}`,r.addEventListener("mousedown",(async function(e){e.preventDefault();const n=await v.toImageURL(t,o);this.href=n})),i.append(r)}if(!0===o||!1!==o.source){const e=document.createElement("a");e.text=s.SOURCE_ACTION,e.href="#",e.addEventListener("click",(function(e){av(L()(t),n.sourceHeader??"",n.sourceFooter??"",d),e.preventDefault()})),i.append(e)}if("vega-lite"===d&&(!0===o||!1!==o.compiled)){const e=document.createElement("a");e.text=s.COMPILED_ACTION,e.href="#",e.addEventListener("click",(function(e){av(L()(h),n.sourceHeader??"",n.sourceFooter??"","vega"),e.preventDefault()})),i.append(e)}if(!0===o||!1!==o.editor){const e=n.editorUrl??"https://vega.github.io/editor/",o=document.createElement("a");o.text=s.EDITOR_ACTION,o.href="#",o.addEventListener("click",(function(n){!function(e,t,n){const i=e.open(t),{origin:r}=new URL(t);let o=40;e.addEventListener("message",(function t(n){n.source===i&&(o=0,e.removeEventListener("message",t,!1))}),!1),setTimeout((function e(){o<=0||(i.postMessage(n,r),setTimeout(e,250),o-=1)}),250)}(window,e,{config:r,mode:d,renderer:l,spec:L()(t)}),n.preventDefault()})),i.append(o)}}function _(){b&&document.removeEventListener("click",b),v.finalize()}return{view:v,spec:t,vgSpec:h,finalize:_,embedOptions:n}}(e,i,c,r)}async function cv(e,t){const n=(0,U.isString)(e.config)?JSON.parse(await t.load(e.config)):e.config??{},i=(0,U.isString)(e.patch)?JSON.parse(await t.load(e.patch)):e.patch;return{...e,...i?{patch:i}:{},...n?{config:n}:{}}}},52847:(e,t,n)=>{"use strict";n.d(t,{r:()=>g});const i="view",r="[",o="]",a="{",s="}",l=":",u=",",c="@",f=">",d=/[[\]{}]/,h={"*":1,arc:1,area:1,group:1,image:1,line:1,path:1,rect:1,rule:1,shape:1,symbol:1,text:1,trail:1};let p,m;function g(e,t,n){return p=t||i,m=n||h,v(e.trim()).map(b)}function y(e,t,n,i,r){const o=e.length;let a,s=0;for(;t<o;++t){if(a=e[t],!s&&a===n)return t;r&&r.indexOf(a)>=0?--s:i&&i.indexOf(a)>=0&&++s}return t}function v(e){const t=[],n=e.length;let i=0,l=0;for(;l<n;)l=y(e,l,u,r+a,o+s),t.push(e.substring(i,l).trim()),i=++l;if(0===t.length)throw"Empty event selector: "+e;return t}function b(e){return"["===e[0]?function(e){const t=e.length;let n,i=1;if(i=y(e,i,o,r,o),i===t)throw"Empty between selector: "+e;if(n=v(e.substring(1,i)),2!==n.length)throw"Between selector must have two elements: "+e;if(e=e.slice(i+1).trim(),e[0]!==f)throw"Expected '>' after between selector: "+e;n=n.map(b);const a=b(e.slice(1).trim());if(a.between)return{between:n,stream:a};a.between=n;return a}(e):function(e){const t={source:p},n=[];let i,f,h=[0,0],g=0,v=0,b=e.length,x=0;if(e[b-1]===s){if(x=e.lastIndexOf(a),!(x>=0))throw"Unmatched right brace: "+e;try{h=function(e){const t=e.split(u);if(!e.length||t.length>2)throw e;return t.map((t=>{const n=+t;if(n!==n)throw e;return n}))}(e.substring(x+1,b-1))}catch(w){throw"Invalid throttle specification: "+e}b=(e=e.slice(0,x).trim()).length,x=0}if(!b)throw e;e[0]===c&&(g=++x);i=y(e,x,l),i<b&&(n.push(e.substring(v,i).trim()),v=x=++i);if(x=y(e,x,r),x===b)n.push(e.substring(v,b).trim());else if(n.push(e.substring(v,x).trim()),f=[],v=++x,v===b)throw"Unmatched left bracket: "+e;for(;x<b;){if(x=y(e,x,o),x===b)throw"Unmatched left bracket: "+e;if(f.push(e.substring(v,x).trim()),x<b-1&&e[++x]!==r)throw"Expected left bracket: "+e;v=++x}if(!(b=n.length)||d.test(n[b-1]))throw"Invalid event selector: "+e;b>1?(t.type=n[1],g?t.markname=n[0].slice(1):(_=n[0],m[_]?t.marktype=n[0]:t.source=n[0])):t.type=n[0];var _;"!"===t.type.slice(-1)&&(t.consume=!0,t.type=t.type.slice(0,-1));null!=f&&(t.filter=f);h[0]&&(t.throttle=h[0]);h[1]&&(t.debounce=h[1]);return t}(e)}},82806:(e,t,n)=>{"use strict";n.d(t,{BJ:()=>We,Lt:()=>l,YP:()=>Je,_G:()=>He,t$:()=>r,wk:()=>Xe});var i=n(45528);const r="Literal",o="Property",a="ArrayExpression",s="BinaryExpression",l="CallExpression",u="ConditionalExpression",c="LogicalExpression",f="MemberExpression",d="ObjectExpression",h="UnaryExpression";function p(e){this.type=e}var m,g,y,v,b;p.prototype.visit=function(e){let t,n,i;if(e(this))return 1;for(t=function(e){switch(e.type){case a:return e.elements;case s:case c:return[e.left,e.right];case l:return[e.callee].concat(e.arguments);case u:return[e.test,e.consequent,e.alternate];case f:return[e.object,e.property];case d:return e.properties;case o:return[e.key,e.value];case h:return[e.argument];default:return[]}}(this),n=0,i=t.length;n<i;++n)if(t[n].visit(e))return 1};var x=1,_=2,w=3,k=4,E=5,D=6,$=7,A=8;(m={})[x]="Boolean",m[_]="<end>",m[w]="Identifier",m[k]="Keyword",m[E]="Null",m[D]="Numeric",m[$]="Punctuator",m[A]="String",m[9]="RegularExpression";var S="ArrayExpression",M="BinaryExpression",C="CallExpression",F="ConditionalExpression",O="Identifier",T="Literal",N="LogicalExpression",z="MemberExpression",R="ObjectExpression",P="Property",L="UnaryExpression",U="Unexpected token %0",B="Unexpected number",j="Unexpected string",I="Unexpected identifier",q="Unexpected reserved word",W="Unexpected end of input",H="Invalid regular expression",X="Invalid regular expression: missing /",J="Octal literals are not allowed in strict mode.",G="Duplicate data property in object literal not allowed in strict mode",V="ILLEGAL",Y="Disabled.",K=new RegExp("[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0620-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u08A0-\\u08B2\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0\\u0AE1\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C\\u0B5D\\u0B5F-\\u0B61\\u0B71\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D\\u0C58\\u0C59\\u0C60\\u0C61\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDE\\u0CE0\\u0CE1\\u0CF1\\u0CF2\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D\\u0D4E\\u0D60\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0E01-\\u0E30\\u0E32\\u0E33\\u0E40-\\u0E46\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC-\\u0EDF\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1877\\u1880-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19C1-\\u19C7\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4B\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1CE9-\\u1CEC\\u1CEE-\\u1CF1\\u1CF5\\u1CF6\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA66E\\uA67F-\\uA69D\\uA6A0-\\uA6EF\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA7AD\\uA7B0\\uA7B1\\uA7F7-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uA9E0-\\uA9E4\\uA9E6-\\uA9EF\\uA9FA-\\uA9FE\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAA60-\\uAA76\\uAA7A\\uAA7E-\\uAAAF\\uAAB1\\uAAB5\\uAAB6\\uAAB9-\\uAABD\\uAAC0\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEA\\uAAF2-\\uAAF4\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB5F\\uAB64\\uAB65\\uABC0-\\uABE2\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]"),Z=new RegExp("[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0300-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u0483-\\u0487\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u0591-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u05C5\\u05C7\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0610-\\u061A\\u0620-\\u0669\\u066E-\\u06D3\\u06D5-\\u06DC\\u06DF-\\u06E8\\u06EA-\\u06FC\\u06FF\\u0710-\\u074A\\u074D-\\u07B1\\u07C0-\\u07F5\\u07FA\\u0800-\\u082D\\u0840-\\u085B\\u08A0-\\u08B2\\u08E4-\\u0963\\u0966-\\u096F\\u0971-\\u0983\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BC-\\u09C4\\u09C7\\u09C8\\u09CB-\\u09CE\\u09D7\\u09DC\\u09DD\\u09DF-\\u09E3\\u09E6-\\u09F1\\u0A01-\\u0A03\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A3C\\u0A3E-\\u0A42\\u0A47\\u0A48\\u0A4B-\\u0A4D\\u0A51\\u0A59-\\u0A5C\\u0A5E\\u0A66-\\u0A75\\u0A81-\\u0A83\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABC-\\u0AC5\\u0AC7-\\u0AC9\\u0ACB-\\u0ACD\\u0AD0\\u0AE0-\\u0AE3\\u0AE6-\\u0AEF\\u0B01-\\u0B03\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3C-\\u0B44\\u0B47\\u0B48\\u0B4B-\\u0B4D\\u0B56\\u0B57\\u0B5C\\u0B5D\\u0B5F-\\u0B63\\u0B66-\\u0B6F\\u0B71\\u0B82\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BBE-\\u0BC2\\u0BC6-\\u0BC8\\u0BCA-\\u0BCD\\u0BD0\\u0BD7\\u0BE6-\\u0BEF\\u0C00-\\u0C03\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D-\\u0C44\\u0C46-\\u0C48\\u0C4A-\\u0C4D\\u0C55\\u0C56\\u0C58\\u0C59\\u0C60-\\u0C63\\u0C66-\\u0C6F\\u0C81-\\u0C83\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBC-\\u0CC4\\u0CC6-\\u0CC8\\u0CCA-\\u0CCD\\u0CD5\\u0CD6\\u0CDE\\u0CE0-\\u0CE3\\u0CE6-\\u0CEF\\u0CF1\\u0CF2\\u0D01-\\u0D03\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D-\\u0D44\\u0D46-\\u0D48\\u0D4A-\\u0D4E\\u0D57\\u0D60-\\u0D63\\u0D66-\\u0D6F\\u0D7A-\\u0D7F\\u0D82\\u0D83\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0DCA\\u0DCF-\\u0DD4\\u0DD6\\u0DD8-\\u0DDF\\u0DE6-\\u0DEF\\u0DF2\\u0DF3\\u0E01-\\u0E3A\\u0E40-\\u0E4E\\u0E50-\\u0E59\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB9\\u0EBB-\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EC8-\\u0ECD\\u0ED0-\\u0ED9\\u0EDC-\\u0EDF\\u0F00\\u0F18\\u0F19\\u0F20-\\u0F29\\u0F35\\u0F37\\u0F39\\u0F3E-\\u0F47\\u0F49-\\u0F6C\\u0F71-\\u0F84\\u0F86-\\u0F97\\u0F99-\\u0FBC\\u0FC6\\u1000-\\u1049\\u1050-\\u109D\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u135D-\\u135F\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1714\\u1720-\\u1734\\u1740-\\u1753\\u1760-\\u176C\\u176E-\\u1770\\u1772\\u1773\\u1780-\\u17D3\\u17D7\\u17DC\\u17DD\\u17E0-\\u17E9\\u180B-\\u180D\\u1810-\\u1819\\u1820-\\u1877\\u1880-\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1920-\\u192B\\u1930-\\u193B\\u1946-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u19D0-\\u19D9\\u1A00-\\u1A1B\\u1A20-\\u1A5E\\u1A60-\\u1A7C\\u1A7F-\\u1A89\\u1A90-\\u1A99\\u1AA7\\u1AB0-\\u1ABD\\u1B00-\\u1B4B\\u1B50-\\u1B59\\u1B6B-\\u1B73\\u1B80-\\u1BF3\\u1C00-\\u1C37\\u1C40-\\u1C49\\u1C4D-\\u1C7D\\u1CD0-\\u1CD2\\u1CD4-\\u1CF6\\u1CF8\\u1CF9\\u1D00-\\u1DF5\\u1DFC-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u200C\\u200D\\u203F\\u2040\\u2054\\u2071\\u207F\\u2090-\\u209C\\u20D0-\\u20DC\\u20E1\\u20E5-\\u20F0\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D7F-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2DE0-\\u2DFF\\u2E2F\\u3005-\\u3007\\u3021-\\u302F\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u3099\\u309A\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA62B\\uA640-\\uA66F\\uA674-\\uA67D\\uA67F-\\uA69D\\uA69F-\\uA6F1\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA7AD\\uA7B0\\uA7B1\\uA7F7-\\uA827\\uA840-\\uA873\\uA880-\\uA8C4\\uA8D0-\\uA8D9\\uA8E0-\\uA8F7\\uA8FB\\uA900-\\uA92D\\uA930-\\uA953\\uA960-\\uA97C\\uA980-\\uA9C0\\uA9CF-\\uA9D9\\uA9E0-\\uA9FE\\uAA00-\\uAA36\\uAA40-\\uAA4D\\uAA50-\\uAA59\\uAA60-\\uAA76\\uAA7A-\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEF\\uAAF2-\\uAAF6\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB5F\\uAB64\\uAB65\\uABC0-\\uABEA\\uABEC\\uABED\\uABF0-\\uABF9\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE00-\\uFE0F\\uFE20-\\uFE2D\\uFE33\\uFE34\\uFE4D-\\uFE4F\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF10-\\uFF19\\uFF21-\\uFF3A\\uFF3F\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]");function Q(e,t){if(!e)throw new Error("ASSERT: "+t)}function ee(e){return e>=48&&e<=57}function te(e){return"0123456789abcdefABCDEF".indexOf(e)>=0}function ne(e){return"01234567".indexOf(e)>=0}function ie(e){return 32===e||9===e||11===e||12===e||160===e||e>=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].indexOf(e)>=0}function re(e){return 10===e||13===e||8232===e||8233===e}function oe(e){return 36===e||95===e||e>=65&&e<=90||e>=97&&e<=122||92===e||e>=128&&K.test(String.fromCharCode(e))}function ae(e){return 36===e||95===e||e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||92===e||e>=128&&Z.test(String.fromCharCode(e))}const se={if:1,in:1,do:1,var:1,for:1,new:1,try:1,let:1,this:1,else:1,case:1,void:1,with:1,enum:1,while:1,break:1,catch:1,throw:1,const:1,yield:1,class:1,super:1,return:1,typeof:1,delete:1,switch:1,export:1,import:1,public:1,static:1,default:1,finally:1,extends:1,package:1,private:1,function:1,continue:1,debugger:1,interface:1,protected:1,instanceof:1,implements:1};function le(){for(;y<v;){const e=g.charCodeAt(y);if(!ie(e)&&!re(e))break;++y}}function ue(e){var t,n,i,r=0;for(n="u"===e?4:2,t=0;t<n;++t)y<v&&te(g[y])?(i=g[y++],r=16*r+"0123456789abcdef".indexOf(i.toLowerCase())):De({},U,V);return String.fromCharCode(r)}function ce(){var e,t,n,i;for(t=0,"}"===(e=g[y])&&De({},U,V);y<v&&te(e=g[y++]);)t=16*t+"0123456789abcdef".indexOf(e.toLowerCase());return(t>1114111||"}"!==e)&&De({},U,V),t<=65535?String.fromCharCode(t):(n=55296+(t-65536>>10),i=56320+(t-65536&1023),String.fromCharCode(n,i))}function fe(){var e,t;for(e=g.charCodeAt(y++),t=String.fromCharCode(e),92===e&&(117!==g.charCodeAt(y)&&De({},U,V),++y,(e=ue("u"))&&"\\"!==e&&oe(e.charCodeAt(0))||De({},U,V),t=e);y<v&&ae(e=g.charCodeAt(y));)++y,t+=String.fromCharCode(e),92===e&&(t=t.substr(0,t.length-1),117!==g.charCodeAt(y)&&De({},U,V),++y,(e=ue("u"))&&"\\"!==e&&ae(e.charCodeAt(0))||De({},U,V),t+=e);return t}function de(){var e,t;return e=y,t=92===g.charCodeAt(y)?fe():function(){var e,t;for(e=y++;y<v;){if(92===(t=g.charCodeAt(y)))return y=e,fe();if(!ae(t))break;++y}return g.slice(e,y)}(),{type:1===t.length?w:se.hasOwnProperty(t)?k:"null"===t?E:"true"===t||"false"===t?x:w,value:t,start:e,end:y}}function he(){var e,t,n,i,r=y,o=g.charCodeAt(y),a=g[y];switch(o){case 46:case 40:case 41:case 59:case 44:case 123:case 125:case 91:case 93:case 58:case 63:case 126:return++y,{type:$,value:String.fromCharCode(o),start:r,end:y};default:if(61===(e=g.charCodeAt(y+1)))switch(o){case 43:case 45:case 47:case 60:case 62:case 94:case 124:case 37:case 38:case 42:return y+=2,{type:$,value:String.fromCharCode(o)+String.fromCharCode(e),start:r,end:y};case 33:case 61:return y+=2,61===g.charCodeAt(y)&&++y,{type:$,value:g.slice(r,y),start:r,end:y}}}return">>>="===(i=g.substr(y,4))?{type:$,value:i,start:r,end:y+=4}:">>>"===(n=i.substr(0,3))||"<<="===n||">>="===n?{type:$,value:n,start:r,end:y+=3}:a===(t=n.substr(0,2))[1]&&"+-<>&|".indexOf(a)>=0||"=>"===t?{type:$,value:t,start:r,end:y+=2}:("//"===t&&De({},U,V),"<>=!+-*%&|^/".indexOf(a)>=0?(++y,{type:$,value:a,start:r,end:y}):void De({},U,V))}function pe(){var e,t,n;if(Q(ee((n=g[y]).charCodeAt(0))||"."===n,"Numeric literal must start with a decimal digit or a decimal point"),t=y,e="","."!==n){if(e=g[y++],n=g[y],"0"===e){if("x"===n||"X"===n)return++y,function(e){let t="";for(;y<v&&te(g[y]);)t+=g[y++];return 0===t.length&&De({},U,V),oe(g.charCodeAt(y))&&De({},U,V),{type:D,value:parseInt("0x"+t,16),start:e,end:y}}(t);if(ne(n))return function(e){let t="0"+g[y++];for(;y<v&&ne(g[y]);)t+=g[y++];return(oe(g.charCodeAt(y))||ee(g.charCodeAt(y)))&&De({},U,V),{type:D,value:parseInt(t,8),octal:!0,start:e,end:y}}(t);n&&ee(n.charCodeAt(0))&&De({},U,V)}for(;ee(g.charCodeAt(y));)e+=g[y++];n=g[y]}if("."===n){for(e+=g[y++];ee(g.charCodeAt(y));)e+=g[y++];n=g[y]}if("e"===n||"E"===n)if(e+=g[y++],"+"!==(n=g[y])&&"-"!==n||(e+=g[y++]),ee(g.charCodeAt(y)))for(;ee(g.charCodeAt(y));)e+=g[y++];else De({},U,V);return oe(g.charCodeAt(y))&&De({},U,V),{type:D,value:parseFloat(e),start:t,end:y}}function me(){var e,t,n,i;return b=null,le(),e=y,t=function(){var e,t,n,i;for(Q("/"===(e=g[y]),"Regular expression literal must start with a slash"),t=g[y++],n=!1,i=!1;y<v;)if(t+=e=g[y++],"\\"===e)re((e=g[y++]).charCodeAt(0))&&De({},X),t+=e;else if(re(e.charCodeAt(0)))De({},X);else if(n)"]"===e&&(n=!1);else{if("/"===e){i=!0;break}"["===e&&(n=!0)}return i||De({},X),{value:t.substr(1,t.length-2),literal:t}}(),n=function(){var e,t,n;for(t="",n="";y<v&&ae((e=g[y]).charCodeAt(0));)++y,"\\"===e&&y<v?De({},U,V):(n+=e,t+=e);return n.search(/[^gimuy]/g)>=0&&De({},H,n),{value:n,literal:t}}(),i=function(e,t){let n=e;t.indexOf("u")>=0&&(n=n.replace(/\\u\{([0-9a-fA-F]+)\}/g,((e,t)=>{if(parseInt(t,16)<=1114111)return"x";De({},H)})).replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"x"));try{new RegExp(n)}catch(i){De({},H)}try{return new RegExp(e,t)}catch(r){return null}}(t.value,n.value),{literal:t.literal+n.literal,value:i,regex:{pattern:t.value,flags:n.value},start:e,end:y}}function ge(){if(le(),y>=v)return{type:_,start:y,end:y};const e=g.charCodeAt(y);return oe(e)?de():40===e||41===e||59===e?he():39===e||34===e?function(){var e,t,n,i,r="",o=!1;for(Q("'"===(e=g[y])||'"'===e,"String literal must starts with a quote"),t=y,++y;y<v;){if((n=g[y++])===e){e="";break}if("\\"===n)if((n=g[y++])&&re(n.charCodeAt(0)))"\r"===n&&"\n"===g[y]&&++y;else switch(n){case"u":case"x":"{"===g[y]?(++y,r+=ce()):r+=ue(n);break;case"n":r+="\n";break;case"r":r+="\r";break;case"t":r+="\t";break;case"b":r+="\b";break;case"f":r+="\f";break;case"v":r+="\v";break;default:ne(n)?(0!==(i="01234567".indexOf(n))&&(o=!0),y<v&&ne(g[y])&&(o=!0,i=8*i+"01234567".indexOf(g[y++]),"0123".indexOf(n)>=0&&y<v&&ne(g[y])&&(i=8*i+"01234567".indexOf(g[y++]))),r+=String.fromCharCode(i)):r+=n}else{if(re(n.charCodeAt(0)))break;r+=n}}return""!==e&&De({},U,V),{type:A,value:r,octal:o,start:t,end:y}}():46===e?ee(g.charCodeAt(y+1))?pe():he():ee(e)?pe():he()}function ye(){const e=b;return y=e.end,b=ge(),y=e.end,e}function ve(){const e=y;b=ge(),y=e}function be(e,t,n){const i=new p("||"===e||"&&"===e?N:M);return i.operator=e,i.left=t,i.right=n,i}function xe(e,t){const n=new p(C);return n.callee=e,n.arguments=t,n}function _e(e){const t=new p(O);return t.name=e,t}function we(e){const t=new p(T);return t.value=e.value,t.raw=g.slice(e.start,e.end),e.regex&&("//"===t.raw&&(t.raw="/(?:)/"),t.regex=e.regex),t}function ke(e,t,n){const i=new p(z);return i.computed="["===e,i.object=t,i.property=n,i.computed||(n.member=!0),i}function Ee(e,t,n){const i=new p(P);return i.key=t,i.value=n,i.kind=e,i}function De(e,t){var n,i=Array.prototype.slice.call(arguments,2),r=t.replace(/%(\d)/g,((e,t)=>(Q(t<i.length,"Message reference must be in range"),i[t])));throw(n=new Error(r)).index=y,n.description=r,n}function $e(e){e.type===_&&De(e,W),e.type===D&&De(e,B),e.type===A&&De(e,j),e.type===w&&De(e,I),e.type===k&&De(e,q),De(e,U,e.value)}function Ae(e){const t=ye();t.type===$&&t.value===e||$e(t)}function Se(e){return b.type===$&&b.value===e}function Me(e){return b.type===k&&b.value===e}function Ce(){const e=[];for(y=b.start,Ae("[");!Se("]");)Se(",")?(ye(),e.push(null)):(e.push(Ie()),Se("]")||Ae(","));return ye(),function(e){const t=new p(S);return t.elements=e,t}(e)}function Fe(){y=b.start;const e=ye();return e.type===A||e.type===D?(e.octal&&De(e,J),we(e)):_e(e.value)}function Oe(){var e,t,n;return y=b.start,(e=b).type===w?(n=Fe(),Ae(":"),Ee("init",n,Ie())):e.type!==_&&e.type!==$?(t=Fe(),Ae(":"),Ee("init",t,Ie())):void $e(e)}function Te(){var e,t,n=[],i={},r=String;for(y=b.start,Ae("{");!Se("}");)t="$"+((e=Oe()).key.type===O?e.key.name:r(e.key.value)),Object.prototype.hasOwnProperty.call(i,t)?De({},G):i[t]=!0,n.push(e),Se("}")||Ae(",");return Ae("}"),function(e){const t=new p(R);return t.properties=e,t}(n)}const Ne={if:1};function ze(){var e,t,n;if(Se("("))return function(){Ae("(");const e=qe();return Ae(")"),e}();if(Se("["))return Ce();if(Se("{"))return Te();if(e=b.type,y=b.start,e===w||Ne[b.value])n=_e(ye().value);else if(e===A||e===D)b.octal&&De(b,J),n=we(ye());else{if(e===k)throw new Error(Y);e===x?((t=ye()).value="true"===t.value,n=we(t)):e===E?((t=ye()).value=null,n=we(t)):Se("/")||Se("/=")?(n=we(me()),ve()):$e(ye())}return n}function Re(){const e=[];if(Ae("("),!Se(")"))for(;y<v&&(e.push(Ie()),!Se(")"));)Ae(",");return Ae(")"),e}function Pe(){y=b.start;const e=ye();return function(e){return e.type===w||e.type===k||e.type===x||e.type===E}(e)||$e(e),_e(e.value)}function Le(){Ae("[");const e=qe();return Ae("]"),e}function Ue(){const e=function(){var e;for(e=ze();;)if(Se("."))Ae("."),e=ke(".",e,Pe());else if(Se("("))e=xe(e,Re());else{if(!Se("["))break;e=ke("[",e,Le())}return e}();if(b.type===$&&(Se("++")||Se("--")))throw new Error(Y);return e}function Be(){var e,t;if(b.type!==$&&b.type!==k)t=Ue();else{if(Se("++")||Se("--"))throw new Error(Y);if(Se("+")||Se("-")||Se("~")||Se("!"))e=ye(),t=Be(),t=function(e,t){const n=new p(L);return n.operator=e,n.argument=t,n.prefix=!0,n}(e.value,t);else{if(Me("delete")||Me("void")||Me("typeof"))throw new Error(Y);t=Ue()}}return t}function je(e){let t=0;if(e.type!==$&&e.type!==k)return 0;switch(e.value){case"||":t=1;break;case"&&":t=2;break;case"|":t=3;break;case"^":t=4;break;case"&":t=5;break;case"==":case"!=":case"===":case"!==":t=6;break;case"<":case">":case"<=":case">=":case"instanceof":case"in":t=7;break;case"<<":case">>":case">>>":t=8;break;case"+":case"-":t=9;break;case"*":case"/":case"%":t=11}return t}function Ie(){var e,t;return e=function(){var e,t,n,i,r,o,a,s,l,u;if(e=b,l=Be(),0===(r=je(i=b)))return l;for(i.prec=r,ye(),t=[e,b],o=[l,i,a=Be()];(r=je(b))>0;){for(;o.length>2&&r<=o[o.length-2].prec;)a=o.pop(),s=o.pop().value,l=o.pop(),t.pop(),n=be(s,l,a),o.push(n);(i=ye()).prec=r,o.push(i),t.push(b),n=Be(),o.push(n)}for(n=o[u=o.length-1],t.pop();u>1;)t.pop(),n=be(o[u-1].value,o[u-2],n),u-=2;return n}(),Se("?")&&(ye(),t=Ie(),Ae(":"),e=function(e,t,n){const i=new p(F);return i.test=e,i.consequent=t,i.alternate=n,i}(e,t,Ie())),e}function qe(){const e=Ie();if(Se(","))throw new Error(Y);return e}function We(e){y=0,v=(g=e).length,b=null,ve();const t=qe();if(b.type!==_)throw new Error("Unexpect token after expression.");return t}var He={NaN:"NaN",E:"Math.E",LN2:"Math.LN2",LN10:"Math.LN10",LOG2E:"Math.LOG2E",LOG10E:"Math.LOG10E",PI:"Math.PI",SQRT1_2:"Math.SQRT1_2",SQRT2:"Math.SQRT2",MIN_VALUE:"Number.MIN_VALUE",MAX_VALUE:"Number.MAX_VALUE"};function Xe(e){function t(t,n,i){return r=>function(t,n,i,r){let o=e(n[0]);return i&&(o=i+"("+o+")",0===i.lastIndexOf("new ",0)&&(o="("+o+")")),o+"."+t+(r<0?"":0===r?"()":"("+n.slice(1).map(e).join(",")+")")}(t,r,n,i)}const n="new Date",r="String",o="RegExp";return{isNaN:"Number.isNaN",isFinite:"Number.isFinite",abs:"Math.abs",acos:"Math.acos",asin:"Math.asin",atan:"Math.atan",atan2:"Math.atan2",ceil:"Math.ceil",cos:"Math.cos",exp:"Math.exp",floor:"Math.floor",hypot:"Math.hypot",log:"Math.log",max:"Math.max",min:"Math.min",pow:"Math.pow",random:"Math.random",round:"Math.round",sin:"Math.sin",sqrt:"Math.sqrt",tan:"Math.tan",clamp:function(t){t.length<3&&(0,i.vU)("Missing arguments to clamp function."),t.length>3&&(0,i.vU)("Too many arguments to clamp function.");const n=t.map(e);return"Math.max("+n[1]+", Math.min("+n[2]+","+n[0]+"))"},now:"Date.now",utc:"Date.UTC",datetime:n,date:t("getDate",n,0),day:t("getDay",n,0),year:t("getFullYear",n,0),month:t("getMonth",n,0),hours:t("getHours",n,0),minutes:t("getMinutes",n,0),seconds:t("getSeconds",n,0),milliseconds:t("getMilliseconds",n,0),time:t("getTime",n,0),timezoneoffset:t("getTimezoneOffset",n,0),utcdate:t("getUTCDate",n,0),utcday:t("getUTCDay",n,0),utcyear:t("getUTCFullYear",n,0),utcmonth:t("getUTCMonth",n,0),utchours:t("getUTCHours",n,0),utcminutes:t("getUTCMinutes",n,0),utcseconds:t("getUTCSeconds",n,0),utcmilliseconds:t("getUTCMilliseconds",n,0),length:t("length",null,-1),parseFloat:"parseFloat",parseInt:"parseInt",upper:t("toUpperCase",r,0),lower:t("toLowerCase",r,0),substring:t("substring",r),split:t("split",r),trim:t("trim",r,0),regexp:o,test:t("test",o),if:function(t){t.length<3&&(0,i.vU)("Missing arguments to if function."),t.length>3&&(0,i.vU)("Too many arguments to if function.");const n=t.map(e);return"("+n[0]+"?"+n[1]+":"+n[2]+")"}}}function Je(e){const t=(e=e||{}).allowed?(0,i.Rg)(e.allowed):{},n=e.forbidden?(0,i.Rg)(e.forbidden):{},r=e.constants||He,o=(e.functions||Xe)(d),a=e.globalvar,s=e.fieldvar,l=(0,i.mf)(a)?a:e=>`${a}["${e}"]`;let u={},c={},f=0;function d(e){if((0,i.HD)(e))return e;const t=h[e.type];return null==t&&(0,i.vU)("Unsupported type: "+e.type),t(e)}const h={Literal:e=>e.raw,Identifier:e=>{const o=e.name;return f>0?o:(0,i.nr)(n,o)?(0,i.vU)("Illegal identifier: "+o):(0,i.nr)(r,o)?r[o]:(0,i.nr)(t,o)?o:(u[o]=1,l(o))},MemberExpression:e=>{const t=!e.computed,n=d(e.object);t&&(f+=1);const i=d(e.property);return n===s&&(c[function(e){const t=e&&e.length-1;return t&&('"'===e[0]&&'"'===e[t]||"'"===e[0]&&"'"===e[t])?e.slice(1,-1):e}(i)]=1),t&&(f-=1),n+(t?"."+i:"["+i+"]")},CallExpression:e=>{"Identifier"!==e.callee.type&&(0,i.vU)("Illegal callee type: "+e.callee.type);const t=e.callee.name,n=e.arguments,r=(0,i.nr)(o,t)&&o[t];return r||(0,i.vU)("Unrecognized function: "+t),(0,i.mf)(r)?r(n):r+"("+n.map(d).join(",")+")"},ArrayExpression:e=>"["+e.elements.map(d).join(",")+"]",BinaryExpression:e=>"("+d(e.left)+" "+e.operator+" "+d(e.right)+")",UnaryExpression:e=>"("+e.operator+d(e.argument)+")",ConditionalExpression:e=>"("+d(e.test)+"?"+d(e.consequent)+":"+d(e.alternate)+")",LogicalExpression:e=>"("+d(e.left)+e.operator+d(e.right)+")",ObjectExpression:e=>"{"+e.properties.map(d).join(",")+"}",Property:e=>{f+=1;const t=d(e.key);return f-=1,t+":"+d(e.value)}};function p(e){const t={code:d(e),globals:Object.keys(u),fields:Object.keys(c)};return u={},c={},t}return p.functions=o,p.constants=r,p}},79220:(e,t,n)=>{"use strict";n.d(t,{N:()=>h});var i={NaN:NaN,E:Math.E,LN2:Math.LN2,LN10:Math.LN10,LOG2E:Math.LOG2E,LOG10E:Math.LOG10E,PI:Math.PI,SQRT1_2:Math.SQRT1_2,SQRT2:Math.SQRT2,MIN_VALUE:Number.MIN_VALUE,MAX_VALUE:Number.MAX_VALUE},r={"*":(e,t)=>e*t,"+":(e,t)=>e+t,"-":(e,t)=>e-t,"/":(e,t)=>e/t,"%":(e,t)=>e%t,">":(e,t)=>e>t,"<":(e,t)=>e<t,"<=":(e,t)=>e<=t,">=":(e,t)=>e>=t,"==":(e,t)=>e==t,"!=":(e,t)=>e!=t,"===":(e,t)=>e===t,"!==":(e,t)=>e!==t,"&":(e,t)=>e&t,"|":(e,t)=>e|t,"^":(e,t)=>e^t,"<<":(e,t)=>e<<t,">>":(e,t)=>e>>t,">>>":(e,t)=>e>>>t},o={"+":e=>+e,"-":e=>-e,"~":e=>~e,"!":e=>!e};const a=Array.prototype.slice,s=(e,t,n)=>{const i=n?n(t[0]):t[0];return i[e].apply(i,a.call(t,1))};var l={isNaN:Number.isNaN,isFinite:Number.isFinite,abs:Math.abs,acos:Math.acos,asin:Math.asin,atan:Math.atan,atan2:Math.atan2,ceil:Math.ceil,cos:Math.cos,exp:Math.exp,floor:Math.floor,log:Math.log,max:Math.max,min:Math.min,pow:Math.pow,random:Math.random,round:Math.round,sin:Math.sin,sqrt:Math.sqrt,tan:Math.tan,clamp:(e,t,n)=>Math.max(t,Math.min(n,e)),now:Date.now,utc:Date.UTC,datetime:(e,t,n,i,r,o,a)=>new Date(e,t||0,null!=n?n:1,i||0,r||0,o||0,a||0),date:e=>new Date(e).getDate(),day:e=>new Date(e).getDay(),year:e=>new Date(e).getFullYear(),month:e=>new Date(e).getMonth(),hours:e=>new Date(e).getHours(),minutes:e=>new Date(e).getMinutes(),seconds:e=>new Date(e).getSeconds(),milliseconds:e=>new Date(e).getMilliseconds(),time:e=>new Date(e).getTime(),timezoneoffset:e=>new Date(e).getTimezoneOffset(),utcdate:e=>new Date(e).getUTCDate(),utcday:e=>new Date(e).getUTCDay(),utcyear:e=>new Date(e).getUTCFullYear(),utcmonth:e=>new Date(e).getUTCMonth(),utchours:e=>new Date(e).getUTCHours(),utcminutes:e=>new Date(e).getUTCMinutes(),utcseconds:e=>new Date(e).getUTCSeconds(),utcmilliseconds:e=>new Date(e).getUTCMilliseconds(),length:e=>e.length,join:function(){return s("join",arguments)},indexof:function(){return s("indexOf",arguments)},lastindexof:function(){return s("lastIndexOf",arguments)},slice:function(){return s("slice",arguments)},reverse:e=>e.slice().reverse(),parseFloat:parseFloat,parseInt:parseInt,upper:e=>String(e).toUpperCase(),lower:e=>String(e).toLowerCase(),substring:function(){return s("substring",arguments,String)},split:function(){return s("split",arguments,String)},replace:function(){return s("replace",arguments,String)},trim:e=>String(e).trim(),regexp:RegExp,test:(e,t)=>RegExp(e).test(t)};const u=["view","item","group","xy","x","y"],c=new Set([Function,eval,setTimeout,setInterval]);"function"===typeof setImmediate&&c.add(setImmediate);const f={Literal:(e,t)=>t.value,Identifier:(e,t)=>{const n=t.name;return e.memberDepth>0?n:"datum"===n?e.datum:"event"===n?e.event:"item"===n?e.item:i[n]||e.params["$"+n]},MemberExpression:(e,t)=>{const n=!t.computed,i=e(t.object);n&&(e.memberDepth+=1);const r=e(t.property);if(n&&(e.memberDepth-=1),!c.has(i[r]))return i[r];console.error(`Prevented interpretation of member "${r}" which could lead to insecure code execution`)},CallExpression:(e,t)=>{const n=t.arguments;let i=t.callee.name;return i.startsWith("_")&&(i=i.slice(1)),"if"===i?e(n[0])?e(n[1]):e(n[2]):(e.fn[i]||l[i]).apply(e.fn,n.map(e))},ArrayExpression:(e,t)=>t.elements.map(e),BinaryExpression:(e,t)=>r[t.operator](e(t.left),e(t.right)),UnaryExpression:(e,t)=>o[t.operator](e(t.argument)),ConditionalExpression:(e,t)=>e(t.test)?e(t.consequent):e(t.alternate),LogicalExpression:(e,t)=>"&&"===t.operator?e(t.left)&&e(t.right):e(t.left)||e(t.right),ObjectExpression:(e,t)=>t.properties.reduce(((t,n)=>{e.memberDepth+=1;const i=e(n.key);return e.memberDepth-=1,c.has(e(n.value))?console.error(`Prevented interpretation of property "${i}" which could lead to insecure code execution`):t[i]=e(n.value),t}),{})};function d(e,t,n,i,r,o){const a=e=>f[e.type](a,e);return a.memberDepth=0,a.fn=Object.create(t),a.params=n,a.datum=i,a.event=r,a.item=o,u.forEach((e=>a.fn[e]=function(){return r.vega[e](...arguments)})),a(e)}var h={operator(e,t){const n=t.ast,i=e.functions;return e=>d(n,i,e)},parameter(e,t){const n=t.ast,i=e.functions;return(e,t)=>d(n,i,t,e)},event(e,t){const n=t.ast,i=e.functions;return e=>d(n,i,void 0,void 0,e)},handler(e,t){const n=t.ast,i=e.functions;return(e,t)=>{const r=t.item&&t.item.datum;return d(n,i,e,r,t)}},encode(e,t){const{marktype:n,channels:i}=t,r=e.functions,o="group"===n||"image"===n||"rect"===n;return(e,t)=>{const a=e.datum;let s,l=0;for(const n in i)s=d(i[n].ast,r,t,a,void 0,e),e[n]!==s&&(e[n]=s,l=1);return"rule"!==n&&function(e,t,n){let i;t.x2&&(t.x?(n&&e.x>e.x2&&(i=e.x,e.x=e.x2,e.x2=i),e.width=e.x2-e.x):e.x=e.x2-(e.width||0)),t.xc&&(e.x=e.xc-(e.width||0)/2),t.y2&&(t.y?(n&&e.y>e.y2&&(i=e.y,e.y=e.y2,e.y2=i),e.height=e.y2-e.y):e.y=e.y2-(e.height||0)),t.yc&&(e.y=e.yc-(e.height||0)/2)}(e,i,o),l}}}},45528:(e,t,n)=>{"use strict";function i(e,t,n){return e.fields=t||[],e.fname=n,e}function r(e){return null==e?null:e.fname}function o(e){return null==e?null:e.fields}function a(e){return 1===e.length?s(e[0]):l(e)}n.d(t,{$G:()=>Pe,$m:()=>$e,BB:()=>ze,Ds:()=>ae,Dw:()=>U,EP:()=>f,FP:()=>Le,HD:()=>we,He:()=>O,Hq:()=>b,IX:()=>Y,J_:()=>ve,Jy:()=>ke,Kj:()=>_e,Kn:()=>$,N3:()=>V,Oj:()=>o,QA:()=>j,Rg:()=>Re,TS:()=>Ae,TW:()=>be,We:()=>le,XW:()=>me,Xr:()=>he,ZE:()=>i,ZU:()=>Ne,Zw:()=>I,_k:()=>c,a9:()=>oe,ay:()=>W,bM:()=>p,bV:()=>J,cG:()=>k,dH:()=>H,dI:()=>ue,el:()=>r,fE:()=>S,fj:()=>F,hj:()=>xe,iL:()=>M,id:()=>d,j2:()=>te,jj:()=>x,jn:()=>ye,k:()=>y,kI:()=>w,kJ:()=>D,kX:()=>m,kg:()=>E,l$:()=>K,l7:()=>se,m8:()=>Fe,mJ:()=>B,mK:()=>X,mS:()=>G,mf:()=>Z,nr:()=>fe,qu:()=>ee,rx:()=>Se,sw:()=>Oe,t7:()=>Ee,u5:()=>ge,uU:()=>_,vU:()=>u,vk:()=>Me,yP:()=>Ce,yR:()=>h,yb:()=>g,yl:()=>pe});const s=e=>function(t){return t[e]},l=e=>{const t=e.length;return function(n){for(let i=0;i<t;++i)n=n[e[i]];return n}};function u(e){throw Error(e)}function c(e){const t=[],n=e.length;let i,r,o,a=null,s=0,l="";function c(){t.push(l+e.substring(i,r)),l="",i=r+1}for(e+="",i=r=0;r<n;++r)if(o=e[r],"\\"===o)l+=e.substring(i,r++),i=r;else if(o===a)c(),a=null,s=-1;else{if(a)continue;i===s&&'"'===o||i===s&&"'"===o?(i=r+1,a=o):"."!==o||s?"["===o?(r>i&&c(),s=i=r+1):"]"===o&&(s||u("Access path missing open bracket: "+e),s>0&&c(),s=0,i=r+1):r>i?c():i=r+1}return s&&u("Access path missing closing bracket: "+e),a&&u("Access path missing closing quote: "+e),r>i&&(r++,c()),t}function f(e,t,n){const r=c(e);return e=1===r.length?r[0]:e,i((n&&n.get||a)(r),[e],t||e)}const d=f("id"),h=i((e=>e),[],"identity"),p=i((()=>0),[],"zero"),m=i((()=>1),[],"one"),g=i((()=>!0),[],"true"),y=i((()=>!1),[],"false");function v(e,t,n){const i=[t].concat([].slice.call(n));console[e].apply(console,i)}const b=0,x=1,_=2,w=3,k=4;function E(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:v,i=e||b;return{level(e){return arguments.length?(i=+e,this):i},error(){return i>=x&&n(t||"error","ERROR",arguments),this},warn(){return i>=_&&n(t||"warn","WARN",arguments),this},info(){return i>=w&&n(t||"log","INFO",arguments),this},debug(){return i>=k&&n(t||"log","DEBUG",arguments),this}}}var D=Array.isArray;function $(e){return e===Object(e)}const A=e=>"__proto__"!==e;function S(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.reduce(((e,t)=>{for(const n in t)if("signals"===n)e.signals=C(e.signals,t.signals);else{const i="legend"===n?{layout:1}:"style"===n||null;M(e,n,t[n],i)}return e}),{})}function M(e,t,n,i){if(!A(t))return;let r,o;if($(n)&&!D(n))for(r in o=$(e[t])?e[t]:e[t]={},n)i&&(!0===i||i[r])?M(o,r,n[r]):A(r)&&(o[r]=n[r]);else e[t]=n}function C(e,t){if(null==e)return t;const n={},i=[];function r(e){n[e.name]||(n[e.name]=1,i.push(e))}return t.forEach(r),e.forEach(r),i}function F(e){return e[e.length-1]}function O(e){return null==e||""===e?null:+e}const T=e=>t=>e*Math.exp(t),N=e=>t=>Math.log(e*t),z=e=>t=>Math.sign(t)*Math.log1p(Math.abs(t/e)),R=e=>t=>Math.sign(t)*Math.expm1(Math.abs(t))*e,P=e=>t=>t<0?-Math.pow(-t,e):Math.pow(t,e);function L(e,t,n,i){const r=n(e[0]),o=n(F(e)),a=(o-r)*t;return[i(r-a),i(o-a)]}function U(e,t){return L(e,t,O,h)}function B(e,t){var n=Math.sign(e[0]);return L(e,t,N(n),T(n))}function j(e,t,n){return L(e,t,P(n),P(1/n))}function I(e,t,n){return L(e,t,z(n),R(n))}function q(e,t,n,i,r){const o=i(e[0]),a=i(F(e)),s=null!=t?i(t):(o+a)/2;return[r(s+(o-s)*n),r(s+(a-s)*n)]}function W(e,t,n){return q(e,t,n,O,h)}function H(e,t,n){const i=Math.sign(e[0]);return q(e,t,n,N(i),T(i))}function X(e,t,n,i){return q(e,t,n,P(i),P(1/i))}function J(e,t,n,i){return q(e,t,n,z(i),R(i))}function G(e){return 1+~~(new Date(e).getMonth()/3)}function V(e){return 1+~~(new Date(e).getUTCMonth()/3)}function Y(e){return null!=e?D(e)?e:[e]:[]}function K(e,t,n){let i,r=e[0],o=e[1];return o<r&&(i=o,o=r,r=i),i=o-r,i>=n-t?[t,n]:[r=Math.min(Math.max(r,t),n-i),r+i]}function Z(e){return"function"===typeof e}const Q="descending";function ee(e,t,n){n=n||{},t=Y(t)||[];const r=[],a=[],s={},l=n.comparator||ne;return Y(e).forEach(((e,i)=>{null!=e&&(r.push(t[i]===Q?-1:1),a.push(e=Z(e)?e:f(e,null,n)),(o(e)||[]).forEach((e=>s[e]=1)))})),0===a.length?null:i(l(a,r),Object.keys(s))}const te=(e,t)=>(e<t||null==e)&&null!=t?-1:(e>t||null==t)&&null!=e?1:(t=t instanceof Date?+t:t,(e=e instanceof Date?+e:e)!==e&&t===t?-1:t!==t&&e===e?1:0),ne=(e,t)=>1===e.length?ie(e[0],t[0]):re(e,t,e.length),ie=(e,t)=>function(n,i){return te(e(n),e(i))*t},re=(e,t,n)=>(t.push(0),function(i,r){let o,a=0,s=-1;for(;0===a&&++s<n;)o=e[s],a=te(o(i),o(r));return a*t[s]});function oe(e){return Z(e)?e:()=>e}function ae(e,t){let n;return i=>{n&&clearTimeout(n),n=setTimeout((()=>(t(i),n=null)),e)}}function se(e){for(let t,n,i=1,r=arguments.length;i<r;++i)for(n in t=arguments[i],t)e[n]=t[n];return e}function le(e,t){let n,i,r,o,a=0;if(e&&(n=e.length))if(null==t){for(i=e[a];a<n&&(null==i||i!==i);i=e[++a]);for(r=o=i;a<n;++a)i=e[a],null!=i&&(i<r&&(r=i),i>o&&(o=i))}else{for(i=t(e[a]);a<n&&(null==i||i!==i);i=t(e[++a]));for(r=o=i;a<n;++a)i=t(e[a]),null!=i&&(i<r&&(r=i),i>o&&(o=i))}return[r,o]}function ue(e,t){const n=e.length;let i,r,o,a,s,l=-1;if(null==t){for(;++l<n;)if(r=e[l],null!=r&&r>=r){i=o=r;break}if(l===n)return[-1,-1];for(a=s=l;++l<n;)r=e[l],null!=r&&(i>r&&(i=r,a=l),o<r&&(o=r,s=l))}else{for(;++l<n;)if(r=t(e[l],l,e),null!=r&&r>=r){i=o=r;break}if(l===n)return[-1,-1];for(a=s=l;++l<n;)r=t(e[l],l,e),null!=r&&(i>r&&(i=r,a=l),o<r&&(o=r,s=l))}return[a,s]}const ce=Object.prototype.hasOwnProperty;function fe(e,t){return ce.call(e,t)}const de={};function he(e){let t,n={};function i(e){return fe(n,e)&&n[e]!==de}const r={size:0,empty:0,object:n,has:i,get:e=>i(e)?n[e]:void 0,set(e,t){return i(e)||(++r.size,n[e]===de&&--r.empty),n[e]=t,this},delete(e){return i(e)&&(--r.size,++r.empty,n[e]=de),this},clear(){r.size=r.empty=0,r.object=n={}},test(e){return arguments.length?(t=e,r):t},clean(){const e={};let i=0;for(const r in n){const o=n[r];o===de||t&&t(o)||(e[r]=o,++i)}r.size=i,r.empty=0,r.object=n=e}};return e&&Object.keys(e).forEach((t=>{r.set(t,e[t])})),r}function pe(e,t,n,i,r,o){if(!n&&0!==n)return o;const a=+n;let s,l=e[0],u=F(e);u<l&&(s=l,l=u,u=s),s=Math.abs(t-l);const c=Math.abs(u-t);return s<c&&s<=a?i:c<=a?r:o}function me(e,t,n){const i=e.prototype=Object.create(t.prototype);return Object.defineProperty(i,"constructor",{value:e,writable:!0,enumerable:!0,configurable:!0}),se(i,n)}function ge(e,t,n,i){let r,o=t[0],a=t[t.length-1];return o>a&&(r=o,o=a,a=r),i=void 0===i||i,((n=void 0===n||n)?o<=e:o<e)&&(i?e<=a:e<a)}function ye(e){return"boolean"===typeof e}function ve(e){return"[object Date]"===Object.prototype.toString.call(e)}function be(e){return e&&Z(e[Symbol.iterator])}function xe(e){return"number"===typeof e}function _e(e){return"[object RegExp]"===Object.prototype.toString.call(e)}function we(e){return"string"===typeof e}function ke(e,t,n){e&&(e=t?Y(e).map((e=>e.replace(/\\(.)/g,"$1"))):Y(e));const r=e&&e.length,o=n&&n.get||a,s=e=>o(t?[e]:c(e));let l;if(r)if(1===r){const t=s(e[0]);l=function(e){return""+t(e)}}else{const t=e.map(s);l=function(e){let n=""+t[0](e),i=0;for(;++i<r;)n+="|"+t[i](e);return n}}else l=function(){return""};return i(l,e,"key")}function Ee(e,t){const n=e[0],i=F(e),r=+t;return r?1===r?i:n+r*(i-n):n}const De=1e4;function $e(e){let t,n,i;e=+e||De;const r=()=>{t={},n={},i=0},o=(r,o)=>(++i>e&&(n=t,t={},i=1),t[r]=o);return r(),{clear:r,has:e=>fe(t,e)||fe(n,e),get:e=>fe(t,e)?t[e]:fe(n,e)?o(e,n[e]):void 0,set:(e,n)=>fe(t,e)?t[e]=n:o(e,n)}}function Ae(e,t,n,i){const r=t.length,o=n.length;if(!o)return t;if(!r)return n;const a=i||new t.constructor(r+o);let s=0,l=0,u=0;for(;s<r&&l<o;++u)a[u]=e(t[s],n[l])>0?n[l++]:t[s++];for(;s<r;++s,++u)a[u]=t[s];for(;l<o;++l,++u)a[u]=n[l];return a}function Se(e,t){let n="";for(;--t>=0;)n+=e;return n}function Me(e,t,n,i){const r=n||" ",o=e+"",a=t-o.length;return a<=0?o:"left"===i?Se(r,a)+o:"center"===i?Se(r,~~(a/2))+o+Se(r,Math.ceil(a/2)):o+Se(r,a)}function Ce(e){return e&&F(e)-e[0]||0}function Fe(e){return D(e)?"["+e.map(Fe)+"]":$(e)||we(e)?JSON.stringify(e).replace("\u2028","\\u2028").replace("\u2029","\\u2029"):e}function Oe(e){return null==e||""===e?null:!(!e||"false"===e||"0"===e)&&!!e}const Te=e=>xe(e)||ve(e)?e:Date.parse(e);function Ne(e,t){return t=t||Te,null==e||""===e?null:t(e)}function ze(e){return null==e||""===e?null:e+""}function Re(e){const t={},n=e.length;for(let i=0;i<n;++i)t[e[i]]=!0;return t}function Pe(e,t,n,i){const r=null!=i?i:"\u2026",o=e+"",a=o.length,s=Math.max(0,t-r.length);return a<=t?o:"left"===n?r+o.slice(a-s):"center"===n?o.slice(0,Math.ceil(s/2))+r+o.slice(a-~~(s/2)):o.slice(0,s)+r}function Le(e,t,n){if(e)if(t){const i=e.length;for(let r=0;r<i;++r){const i=t(e[r]);i&&n(i,r,e)}}else e.forEach(n)}},1110:(e,t,n)=>{"use strict";n.r(t),n.d(t,{Bounds:()=>Oh,CanvasHandler:()=>pg,CanvasRenderer:()=>xg,DATE:()=>Ke,DAY:()=>Ze,DAYOFYEAR:()=>Qe,Dataflow:()=>eo,Debug:()=>m.cG,Error:()=>m.jj,EventStream:()=>Ur,Gradient:()=>Rd,GroupItem:()=>Nh,HOURS:()=>et,Handler:()=>Hm,HybridHandler:()=>hy,HybridRenderer:()=>fy,Info:()=>m.kI,Item:()=>Th,MILLISECONDS:()=>it,MINUTES:()=>tt,MONTH:()=>Ve,Marks:()=>Mm,MultiPulse:()=>Vr,None:()=>m.Hq,Operator:()=>Rr,Parameters:()=>Tr,Pulse:()=>Hr,QUARTER:()=>Ge,RenderType:()=>yy,Renderer:()=>Jm,ResourceLoader:()=>zh,SECONDS:()=>nt,SVGHandler:()=>wg,SVGRenderer:()=>Gg,SVGStringRenderer:()=>ly,Scenegraph:()=>Pm,TIME_UNITS:()=>rt,Transform:()=>no,View:()=>pC,WEEK:()=>Ye,Warn:()=>m.uU,YEAR:()=>Je,accessor:()=>m.ZE,accessorFields:()=>m.Oj,accessorName:()=>m.el,array:()=>m.IX,ascending:()=>m.j2,bandwidthNRD:()=>xo,bin:()=>_o,bootstrapCI:()=>Eo,boundClip:()=>Dy,boundContext:()=>np,boundItem:()=>Cm,boundMark:()=>Om,boundStroke:()=>Lh,changeset:()=>Fr,clampRange:()=>m.l$,codegenExpression:()=>pA.YP,compare:()=>m.qu,constant:()=>m.a9,cumulativeLogNormal:()=>Uo,cumulativeNormal:()=>To,cumulativeUniform:()=>Ho,dayofyear:()=>ft,debounce:()=>m.Ds,defaultLocale:()=>qi,definition:()=>ro,densityLogNormal:()=>Lo,densityNormal:()=>Oo,densityUniform:()=>Wo,domChild:()=>jm,domClear:()=>Im,domCreate:()=>Um,domFind:()=>Bm,dotbin:()=>Do,error:()=>m.vU,expressionFunction:()=>cM,extend:()=>m.l7,extent:()=>m.We,extentIndex:()=>m.dI,falsy:()=>m.k,fastmap:()=>m.Xr,field:()=>m.EP,flush:()=>m.yl,font:()=>_m,fontFamily:()=>xm,fontSize:()=>mm,format:()=>hr,formatLocale:()=>zi,formats:()=>pr,hasOwnProperty:()=>m.nr,id:()=>m.id,identity:()=>m.yR,inferType:()=>ar,inferTypes:()=>sr,ingest:()=>Dr,inherits:()=>m.XW,inrange:()=>m.u5,interpolate:()=>rd,interpolateColors:()=>td,interpolateRange:()=>ed,intersect:()=>xy,intersectBoxLine:()=>hp,intersectPath:()=>up,intersectPoint:()=>cp,intersectRule:()=>dp,isArray:()=>m.kJ,isBoolean:()=>m.jn,isDate:()=>m.J_,isFunction:()=>m.mf,isIterable:()=>m.TW,isNumber:()=>m.hj,isObject:()=>m.Kn,isRegExp:()=>m.Kj,isString:()=>m.HD,isTuple:()=>wr,key:()=>m.Jy,lerp:()=>m.t7,lineHeight:()=>gm,loader:()=>yr,locale:()=>Ii,logger:()=>m.kg,lruCache:()=>m.$m,markup:()=>Bg,merge:()=>m.TS,mergeConfig:()=>m.fE,multiLineOffset:()=>vm,one:()=>m.kX,pad:()=>m.vk,panLinear:()=>m.Dw,panLog:()=>m.mJ,panPow:()=>m.QA,panSymlog:()=>m.Zw,parse:()=>zN,parseExpression:()=>pA.BJ,parseSelector:()=>bC.r,path:()=>Bl,pathCurves:()=>Ld,pathEqual:()=>Sy,pathParse:()=>Wd,pathRectangle:()=>ph,pathRender:()=>th,pathSymbols:()=>oh,pathTrail:()=>mh,peek:()=>m.fj,point:()=>Wm,projection:()=>Pw,quantileLogNormal:()=>Bo,quantileNormal:()=>No,quantileUniform:()=>Xo,quantiles:()=>vo,quantizeInterpolator:()=>nd,quarter:()=>m.mS,quartiles:()=>bo,random:()=>wo,randomInteger:()=>Ao,randomKDE:()=>Ro,randomLCG:()=>$o,randomLogNormal:()=>jo,randomMixture:()=>Io,randomNormal:()=>zo,randomUniform:()=>Jo,read:()=>gr,regressionConstant:()=>Go,regressionExp:()=>ta,regressionLinear:()=>Qo,regressionLoess:()=>la,regressionLog:()=>ea,regressionPoly:()=>ra,regressionPow:()=>na,regressionQuad:()=>ia,renderModule:()=>by,repeat:()=>m.rx,resetDefaultLocale:()=>Wi,resetSVGClipId:()=>Ch,resetSVGDefIds:()=>My,responseType:()=>mr,runtimeContext:()=>xM,sampleCurve:()=>da,sampleLogNormal:()=>Po,sampleNormal:()=>Fo,sampleUniform:()=>qo,scale:()=>Wf,sceneEqual:()=>Ay,sceneFromJSON:()=>zm,scenePickVisit:()=>Ep,sceneToJSON:()=>Nm,sceneVisit:()=>kp,sceneZOrder:()=>wp,scheme:()=>ld,serializeXML:()=>jg,setHybridRendererOptions:()=>cy,setRandom:()=>ko,span:()=>m.yP,splitAccessPath:()=>m._k,stringValue:()=>m.m8,textMetrics:()=>um,timeBin:()=>tn,timeFloor:()=>At,timeFormatLocale:()=>Bi,timeInterval:()=>Tt,timeOffset:()=>Rt,timeSequence:()=>Ut,timeUnitSpecifier:()=>lt,timeUnits:()=>at,toBoolean:()=>m.sw,toDate:()=>m.ZU,toNumber:()=>m.He,toSet:()=>m.Rg,toString:()=>m.BB,transform:()=>oo,transforms:()=>io,truncate:()=>m.$G,truthy:()=>m.yb,tupleid:()=>kr,typeParsers:()=>ir,utcFloor:()=>Ct,utcInterval:()=>Nt,utcOffset:()=>Pt,utcSequence:()=>Bt,utcdayofyear:()=>yt,utcquarter:()=>m.N3,utcweek:()=>vt,version:()=>RN,visitArray:()=>m.FP,week:()=>dt,writeConfig:()=>m.iL,zero:()=>m.bM,zoomLinear:()=>m.ay,zoomLog:()=>m.dH,zoomPow:()=>m.mK,zoomSymlog:()=>m.bV});var i={};n.r(i),n.d(i,{aggregate:()=>Ca,bin:()=>Fa,collect:()=>Ta,compare:()=>Na,countpattern:()=>Ra,cross:()=>Pa,density:()=>ja,dotbin:()=>Xa,expression:()=>Ja,extent:()=>Va,facet:()=>Ka,field:()=>Za,filter:()=>es,flatten:()=>ts,fold:()=>ns,formula:()=>is,generate:()=>rs,impute:()=>ss,joinaggregate:()=>ls,kde:()=>us,key:()=>cs,load:()=>ds,lookup:()=>ps,multiextent:()=>ms,multivalues:()=>ys,params:()=>bs,pivot:()=>xs,prefacet:()=>_s,project:()=>ws,proxy:()=>ks,quantile:()=>Es,relay:()=>Ds,sample:()=>$s,sequence:()=>As,sieve:()=>Ss,subflow:()=>Ya,timeunit:()=>Ms,tupleindex:()=>Fs,values:()=>Os,window:()=>Ps});var r={};n.r(r),n.d(r,{interpolate:()=>vu,interpolateArray:()=>fu,interpolateBasis:()=>vc.Z,interpolateBasisClosed:()=>bc.Z,interpolateCubehelix:()=>df,interpolateCubehelixLong:()=>hf,interpolateDate:()=>hu,interpolateDiscrete:()=>xc,interpolateHcl:()=>Zc,interpolateHclLong:()=>Qc,interpolateHsl:()=>Ac,interpolateHslLong:()=>Sc,interpolateHue:()=>wc,interpolateLab:()=>Yc,interpolateNumber:()=>pu.Z,interpolateNumberArray:()=>uu,interpolateObject:()=>mu,interpolateRgb:()=>lu.ZP,interpolateRgbBasis:()=>lu.hD,interpolateRgbBasisClosed:()=>lu.YD,interpolateRound:()=>bu,interpolateString:()=>gu.Z,interpolateTransformCss:()=>kc.Y,interpolateTransformSvg:()=>kc.w,interpolateZoom:()=>Dc,piecewise:()=>sc,quantize:()=>pf});var o={};n.r(o),n.d(o,{bound:()=>hv,identifier:()=>gv,mark:()=>yv,overlap:()=>vv,render:()=>Dv,viewlayout:()=>Jv});var a={};n.r(a),n.d(a,{axisticks:()=>Vv,datajoin:()=>Yv,encode:()=>Zv,legendentries:()=>Qv,linkpath:()=>rb,pie:()=>ub,scale:()=>hb,sortitems:()=>yb,stack:()=>wb});var s={};n.r(s),n.d(s,{contour:()=>ak,geojson:()=>uk,geopath:()=>ck,geopoint:()=>fk,geoshape:()=>dk,graticule:()=>hk,heatmap:()=>pk,isocontour:()=>Yw,kde2d:()=>ik,projection:()=>gk});var l={};n.r(l),n.d(l,{force:()=>Zk});var u={};n.r(u),n.d(u,{nest:()=>oD,pack:()=>fD,partition:()=>hD,stratify:()=>pD,tree:()=>yD,treelinks:()=>vD,treemap:()=>_D});var c={};n.r(c),n.d(c,{label:()=>WD});var f={};n.r(f),n.d(f,{loess:()=>XD,regression:()=>GD});var d={};n.r(d),n.d(d,{voronoi:()=>A$});var h={};n.r(h),n.d(h,{wordcloud:()=>q$});var p={};n.r(p),n.d(p,{crossfilter:()=>Y$,resolvefilter:()=>K$});var m=n(45528),g={},y={},v=34,b=10,x=13;function _(e){return new Function("d","return {"+e.map((function(e,t){return JSON.stringify(e)+": d["+t+'] || ""'})).join(",")+"}")}function w(e){var t=Object.create(null),n=[];return e.forEach((function(e){for(var i in e)i in t||n.push(t[i]=i)})),n}function k(e,t){var n=e+"",i=n.length;return i<t?new Array(t-i+1).join(0)+n:n}function E(e){var t,n=e.getUTCHours(),i=e.getUTCMinutes(),r=e.getUTCSeconds(),o=e.getUTCMilliseconds();return isNaN(e)?"Invalid Date":((t=e.getUTCFullYear())<0?"-"+k(-t,6):t>9999?"+"+k(t,6):k(t,4))+"-"+k(e.getUTCMonth()+1,2)+"-"+k(e.getUTCDate(),2)+(o?"T"+k(n,2)+":"+k(i,2)+":"+k(r,2)+"."+k(o,3)+"Z":r?"T"+k(n,2)+":"+k(i,2)+":"+k(r,2)+"Z":i||n?"T"+k(n,2)+":"+k(i,2)+"Z":"")}function D(e){var t=new RegExp('["'+e+"\n\r]"),n=e.charCodeAt(0);function i(e,t){var i,r=[],o=e.length,a=0,s=0,l=o<=0,u=!1;function c(){if(l)return y;if(u)return u=!1,g;var t,i,r=a;if(e.charCodeAt(r)===v){for(;a++<o&&e.charCodeAt(a)!==v||e.charCodeAt(++a)===v;);return(t=a)>=o?l=!0:(i=e.charCodeAt(a++))===b?u=!0:i===x&&(u=!0,e.charCodeAt(a)===b&&++a),e.slice(r+1,t-1).replace(/""/g,'"')}for(;a<o;){if((i=e.charCodeAt(t=a++))===b)u=!0;else if(i===x)u=!0,e.charCodeAt(a)===b&&++a;else if(i!==n)continue;return e.slice(r,t)}return l=!0,e.slice(r,o)}for(e.charCodeAt(o-1)===b&&--o,e.charCodeAt(o-1)===x&&--o;(i=c())!==y;){for(var f=[];i!==g&&i!==y;)f.push(i),i=c();t&&null==(f=t(f,s++))||r.push(f)}return r}function r(t,n){return t.map((function(t){return n.map((function(e){return a(t[e])})).join(e)}))}function o(t){return t.map(a).join(e)}function a(e){return null==e?"":e instanceof Date?E(e):t.test(e+="")?'"'+e.replace(/"/g,'""')+'"':e}return{parse:function(e,t){var n,r,o=i(e,(function(e,i){if(n)return n(e,i-1);r=e,n=t?function(e,t){var n=_(e);return function(i,r){return t(n(i),r,e)}}(e,t):_(e)}));return o.columns=r||[],o},parseRows:i,format:function(t,n){return null==n&&(n=w(t)),[n.map(a).join(e)].concat(r(t,n)).join("\n")},formatBody:function(e,t){return null==t&&(t=w(e)),r(e,t).join("\n")},formatRows:function(e){return e.map(o).join("\n")},formatRow:o,formatValue:a}}function $(e){return e}function A(e,t){return"string"===typeof t&&(t=e.objects[t]),"GeometryCollection"===t.type?{type:"FeatureCollection",features:t.geometries.map((function(t){return S(e,t)}))}:S(e,t)}function S(e,t){var n=t.id,i=t.bbox,r=null==t.properties?{}:t.properties,o=M(e,t);return null==n&&null==i?{type:"Feature",properties:r,geometry:o}:null==i?{type:"Feature",id:n,properties:r,geometry:o}:{type:"Feature",id:n,bbox:i,properties:r,geometry:o}}function M(e,t){var n=function(e){if(null==e)return $;var t,n,i=e.scale[0],r=e.scale[1],o=e.translate[0],a=e.translate[1];return function(e,s){s||(t=n=0);var l=2,u=e.length,c=new Array(u);for(c[0]=(t+=e[0])*i+o,c[1]=(n+=e[1])*r+a;l<u;)c[l]=e[l],++l;return c}}(e.transform),i=e.arcs;function r(e,t){t.length&&t.pop();for(var r=i[e<0?~e:e],o=0,a=r.length;o<a;++o)t.push(n(r[o],o));e<0&&function(e,t){for(var n,i=e.length,r=i-t;r<--i;)n=e[r],e[r++]=e[i],e[i]=n}(t,a)}function o(e){return n(e)}function a(e){for(var t=[],n=0,i=e.length;n<i;++n)r(e[n],t);return t.length<2&&t.push(t[0]),t}function s(e){for(var t=a(e);t.length<4;)t.push(t[0]);return t}function l(e){return e.map(s)}return function e(t){var n,i=t.type;switch(i){case"GeometryCollection":return{type:i,geometries:t.geometries.map(e)};case"Point":n=o(t.coordinates);break;case"MultiPoint":n=t.coordinates.map(o);break;case"LineString":n=a(t.arcs);break;case"MultiLineString":n=t.arcs.map(a);break;case"Polygon":n=l(t.arcs);break;case"MultiPolygon":n=t.arcs.map(l);break;default:return null}return{type:i,coordinates:n}}(t)}function C(e,t){var n={},i={},r={},o=[],a=-1;function s(e,t){for(var i in e){var r=e[i];delete t[r.start],delete r.start,delete r.end,r.forEach((function(e){n[e<0?~e:e]=1})),o.push(r)}}return t.forEach((function(n,i){var r,o=e.arcs[n<0?~n:n];o.length<3&&!o[1][0]&&!o[1][1]&&(r=t[++a],t[a]=n,t[i]=r)})),t.forEach((function(t){var n,o,a=function(t){var n,i=e.arcs[t<0?~t:t],r=i[0];e.transform?(n=[0,0],i.forEach((function(e){n[0]+=e[0],n[1]+=e[1]}))):n=i[i.length-1];return t<0?[n,r]:[r,n]}(t),s=a[0],l=a[1];if(n=r[s])if(delete r[n.end],n.push(t),n.end=l,o=i[l]){delete i[o.start];var u=o===n?n:n.concat(o);i[u.start=n.start]=r[u.end=o.end]=u}else i[n.start]=r[n.end]=n;else if(n=i[l])if(delete i[n.start],n.unshift(t),n.start=s,o=r[s]){delete r[o.end];var c=o===n?n:o.concat(n);i[c.start=o.start]=r[c.end=n.end]=c}else i[n.start]=r[n.end]=n;else i[(n=[t]).start=s]=r[n.end=l]=n})),s(r,i),s(i,r),t.forEach((function(e){n[e<0?~e:e]||o.push([e])})),o}function F(e){return M(e,O.apply(this,arguments))}function O(e,t,n){var i,r,o;if(arguments.length>1)i=function(e,t,n){var i,r=[],o=[];function a(e){var t=e<0?~e:e;(o[t]||(o[t]=[])).push({i:e,g:i})}function s(e){e.forEach(a)}function l(e){e.forEach(s)}function u(e){e.forEach(l)}function c(e){switch(i=e,e.type){case"GeometryCollection":e.geometries.forEach(c);break;case"LineString":s(e.arcs);break;case"MultiLineString":case"Polygon":l(e.arcs);break;case"MultiPolygon":u(e.arcs)}}return c(t),o.forEach(null==n?function(e){r.push(e[0].i)}:function(e){n(e[0].g,e[e.length-1].g)&&r.push(e[0].i)}),r}(0,t,n);else for(r=0,i=new Array(o=e.arcs.length);r<o;++r)i[r]=r;return{type:"MultiLineString",arcs:C(e,i)}}const T=Math.sqrt(50),N=Math.sqrt(10),z=Math.sqrt(2);function R(e,t,n){const i=(t-e)/Math.max(0,n),r=Math.floor(Math.log10(i)),o=i/Math.pow(10,r),a=o>=T?10:o>=N?5:o>=z?2:1;let s,l,u;return r<0?(u=Math.pow(10,-r)/a,s=Math.round(e*u),l=Math.round(t*u),s/u<e&&++s,l/u>t&&--l,u=-u):(u=Math.pow(10,r)*a,s=Math.round(e/u),l=Math.round(t/u),s*u<e&&++s,l*u>t&&--l),l<s&&.5<=n&&n<2?R(e,t,2*n):[s,l,u]}function P(e,t,n){if(!((n=+n)>0))return[];if((e=+e)===(t=+t))return[e];const i=t<e,[r,o,a]=i?R(t,e,n):R(e,t,n);if(!(o>=r))return[];const s=o-r+1,l=new Array(s);if(i)if(a<0)for(let u=0;u<s;++u)l[u]=(o-u)/-a;else for(let u=0;u<s;++u)l[u]=(o-u)*a;else if(a<0)for(let u=0;u<s;++u)l[u]=(r+u)/-a;else for(let u=0;u<s;++u)l[u]=(r+u)*a;return l}function L(e,t,n){return R(e=+e,t=+t,n=+n)[2]}function U(e,t,n){n=+n;const i=(t=+t)<(e=+e),r=i?L(t,e,n):L(e,t,n);return(i?-1:1)*(r<0?1/-r:r)}var B,j=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function I(e){if(!(t=j.exec(e)))throw new Error("invalid format: "+e);var t;return new q({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]})}function q(e){this.fill=void 0===e.fill?" ":e.fill+"",this.align=void 0===e.align?">":e.align+"",this.sign=void 0===e.sign?"-":e.sign+"",this.symbol=void 0===e.symbol?"":e.symbol+"",this.zero=!!e.zero,this.width=void 0===e.width?void 0:+e.width,this.comma=!!e.comma,this.precision=void 0===e.precision?void 0:+e.precision,this.trim=!!e.trim,this.type=void 0===e.type?"":e.type+""}function W(e,t){if((n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var n,i=e.slice(0,n);return[i.length>1?i[0]+i.slice(2):i,+e.slice(n+1)]}function H(e){return(e=W(Math.abs(e)))?e[1]:NaN}function X(e,t){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(H(t)/3)))-H(Math.abs(e)))}function J(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,H(t)-H(e))+1}function G(e){return Math.max(0,-H(Math.abs(e)))}function V(e,t){var n=W(e,t);if(!n)return e+"";var i=n[0],r=n[1];return r<0?"0."+new Array(-r).join("0")+i:i.length>r+1?i.slice(0,r+1)+"."+i.slice(r+1):i+new Array(r-i.length+2).join("0")}I.prototype=q.prototype,q.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};const Y={"%":(e,t)=>(100*e).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:function(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)},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)=>V(100*e,t),r:V,s:function(e,t){var n=W(e,t);if(!n)return e+"";var i=n[0],r=n[1],o=r-(B=3*Math.max(-8,Math.min(8,Math.floor(r/3))))+1,a=i.length;return o===a?i:o>a?i+new Array(o-a+1).join("0"):o>0?i.slice(0,o)+"."+i.slice(o):"0."+new Array(1-o).join("0")+W(e,Math.max(0,t+o-1))[0]},X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function K(e){return e}var Z,Q,ee,te=Array.prototype.map,ne=["y","z","a","f","p","n","\xb5","m","","k","M","G","T","P","E","Z","Y"];function ie(e){var t,n,i=void 0===e.grouping||void 0===e.thousands?K:(t=te.call(e.grouping,Number),n=e.thousands+"",function(e,i){for(var r=e.length,o=[],a=0,s=t[0],l=0;r>0&&s>0&&(l+s+1>i&&(s=Math.max(1,i-l)),o.push(e.substring(r-=s,r+s)),!((l+=s+1)>i));)s=t[a=(a+1)%t.length];return o.reverse().join(n)}),r=void 0===e.currency?"":e.currency[0]+"",o=void 0===e.currency?"":e.currency[1]+"",a=void 0===e.decimal?".":e.decimal+"",s=void 0===e.numerals?K:function(e){return function(t){return t.replace(/[0-9]/g,(function(t){return e[+t]}))}}(te.call(e.numerals,String)),l=void 0===e.percent?"%":e.percent+"",u=void 0===e.minus?"\u2212":e.minus+"",c=void 0===e.nan?"NaN":e.nan+"";function f(e){var t=(e=I(e)).fill,n=e.align,f=e.sign,d=e.symbol,h=e.zero,p=e.width,m=e.comma,g=e.precision,y=e.trim,v=e.type;"n"===v?(m=!0,v="g"):Y[v]||(void 0===g&&(g=12),y=!0,v="g"),(h||"0"===t&&"="===n)&&(h=!0,t="0",n="=");var b="$"===d?r:"#"===d&&/[boxX]/.test(v)?"0"+v.toLowerCase():"",x="$"===d?o:/[%p]/.test(v)?l:"",_=Y[v],w=/[defgprs%]/.test(v);function k(e){var r,o,l,d=b,k=x;if("c"===v)k=_(e)+k,e="";else{var E=(e=+e)<0||1/e<0;if(e=isNaN(e)?c:_(Math.abs(e),g),y&&(e=function(e){e:for(var t,n=e.length,i=1,r=-1;i<n;++i)switch(e[i]){case".":r=t=i;break;case"0":0===r&&(r=i),t=i;break;default:if(!+e[i])break e;r>0&&(r=0)}return r>0?e.slice(0,r)+e.slice(t+1):e}(e)),E&&0===+e&&"+"!==f&&(E=!1),d=(E?"("===f?f:u:"-"===f||"("===f?"":f)+d,k=("s"===v?ne[8+B/3]:"")+k+(E&&"("===f?")":""),w)for(r=-1,o=e.length;++r<o;)if(48>(l=e.charCodeAt(r))||l>57){k=(46===l?a+e.slice(r+1):e.slice(r))+k,e=e.slice(0,r);break}}m&&!h&&(e=i(e,1/0));var D=d.length+e.length+k.length,$=D<p?new Array(p-D+1).join(t):"";switch(m&&h&&(e=i($+e,$.length?p-k.length:1/0),$=""),n){case"<":e=d+e+k+$;break;case"=":e=d+$+e+k;break;case"^":e=$.slice(0,D=$.length>>1)+d+e+k+$.slice(D);break;default:e=$+d+e+k}return s(e)}return g=void 0===g?6:/[gprs]/.test(v)?Math.max(1,Math.min(21,g)):Math.max(0,Math.min(20,g)),k.toString=function(){return e+""},k}return{format:f,formatPrefix:function(e,t){var n=f(((e=I(e)).type="f",e)),i=3*Math.max(-8,Math.min(8,Math.floor(H(t)/3))),r=Math.pow(10,-i),o=ne[8+i/3];return function(e){return n(r*e)+o}}}}!function(e){Z=ie(e),Q=Z.format,ee=Z.formatPrefix}({thousands:",",grouping:[3],currency:["$",""]});const re=new Date,oe=new Date;function ae(e,t,n,i){function r(t){return e(t=0===arguments.length?new Date:new Date(+t)),t}return r.floor=t=>(e(t=new Date(+t)),t),r.ceil=n=>(e(n=new Date(n-1)),t(n,1),e(n),n),r.round=e=>{const t=r(e),n=r.ceil(e);return e-t<n-e?t:n},r.offset=(e,n)=>(t(e=new Date(+e),null==n?1:Math.floor(n)),e),r.range=(n,i,o)=>{const a=[];if(n=r.ceil(n),o=null==o?1:Math.floor(o),!(n<i)||!(o>0))return a;let s;do{a.push(s=new Date(+n)),t(n,o),e(n)}while(s<n&&n<i);return a},r.filter=n=>ae((t=>{if(t>=t)for(;e(t),!n(t);)t.setTime(t-1)}),((e,i)=>{if(e>=e)if(i<0)for(;++i<=0;)for(;t(e,-1),!n(e););else for(;--i>=0;)for(;t(e,1),!n(e););})),n&&(r.count=(t,i)=>(re.setTime(+t),oe.setTime(+i),e(re),e(oe),Math.floor(n(re,oe))),r.every=e=>(e=Math.floor(e),isFinite(e)&&e>0?e>1?r.filter(i?t=>i(t)%e===0:t=>r.count(0,t)%e===0):r:null)),r}const se=1e3,le=6e4,ue=36e5,ce=864e5,fe=6048e5,de=2592e6,he=31536e6,pe=ae((e=>e.setHours(0,0,0,0)),((e,t)=>e.setDate(e.getDate()+t)),((e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*le)/ce),(e=>e.getDate()-1)),me=(pe.range,ae((e=>{e.setUTCHours(0,0,0,0)}),((e,t)=>{e.setUTCDate(e.getUTCDate()+t)}),((e,t)=>(t-e)/ce),(e=>e.getUTCDate()-1))),ge=(me.range,ae((e=>{e.setUTCHours(0,0,0,0)}),((e,t)=>{e.setUTCDate(e.getUTCDate()+t)}),((e,t)=>(t-e)/ce),(e=>Math.floor(e/ce))));ge.range;function ye(e){return ae((t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)}),((e,t)=>{e.setDate(e.getDate()+7*t)}),((e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*le)/fe))}const ve=ye(0),be=ye(1),xe=ye(2),_e=ye(3),we=ye(4),ke=ye(5),Ee=ye(6);ve.range,be.range,xe.range,_e.range,we.range,ke.range,Ee.range;function De(e){return ae((t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)}),((e,t)=>{e.setUTCDate(e.getUTCDate()+7*t)}),((e,t)=>(t-e)/fe))}const $e=De(0),Ae=De(1),Se=De(2),Me=De(3),Ce=De(4),Fe=De(5),Oe=De(6),Te=($e.range,Ae.range,Se.range,Me.range,Ce.range,Fe.range,Oe.range,ae((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())));Te.every=e=>isFinite(e=Math.floor(e))&&e>0?ae((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)})):null;Te.range;const Ne=ae((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()));Ne.every=e=>isFinite(e=Math.floor(e))&&e>0?ae((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)})):null;Ne.range;const ze=ae((e=>{e.setDate(1),e.setHours(0,0,0,0)}),((e,t)=>{e.setMonth(e.getMonth()+t)}),((e,t)=>t.getMonth()-e.getMonth()+12*(t.getFullYear()-e.getFullYear())),(e=>e.getMonth())),Re=(ze.range,ae((e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)}),((e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)}),((e,t)=>t.getUTCMonth()-e.getUTCMonth()+12*(t.getUTCFullYear()-e.getUTCFullYear())),(e=>e.getUTCMonth()))),Pe=(Re.range,ae((e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*se-e.getMinutes()*le)}),((e,t)=>{e.setTime(+e+t*ue)}),((e,t)=>(t-e)/ue),(e=>e.getHours()))),Le=(Pe.range,ae((e=>{e.setUTCMinutes(0,0,0)}),((e,t)=>{e.setTime(+e+t*ue)}),((e,t)=>(t-e)/ue),(e=>e.getUTCHours()))),Ue=(Le.range,ae((e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*se)}),((e,t)=>{e.setTime(+e+t*le)}),((e,t)=>(t-e)/le),(e=>e.getMinutes()))),Be=(Ue.range,ae((e=>{e.setUTCSeconds(0,0)}),((e,t)=>{e.setTime(+e+t*le)}),((e,t)=>(t-e)/le),(e=>e.getUTCMinutes()))),je=(Be.range,ae((e=>{e.setTime(e-e.getMilliseconds())}),((e,t)=>{e.setTime(+e+t*se)}),((e,t)=>(t-e)/se),(e=>e.getUTCSeconds()))),Ie=(je.range,ae((()=>{}),((e,t)=>{e.setTime(+e+t)}),((e,t)=>t-e)));Ie.every=e=>(e=Math.floor(e),isFinite(e)&&e>0?e>1?ae((t=>{t.setTime(Math.floor(t/e)*e)}),((t,n)=>{t.setTime(+t+n*e)}),((t,n)=>(n-t)/e)):Ie:null);Ie.range;function qe(e,t){return null==e||null==t?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function We(e,t){return null==e||null==t?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function He(e){let t,n,i;function r(e,i,r=0,o=e.length){if(r<o){if(0!==t(i,i))return o;do{const t=r+o>>>1;n(e[t],i)<0?r=t+1:o=t}while(r<o)}return r}return 2!==e.length?(t=qe,n=(t,n)=>qe(e(t),n),i=(t,n)=>e(t)-n):(t=e===qe||e===We?e:Xe,n=e,i=e),{left:r,center:function(e,t,n=0,o=e.length){const a=r(e,t,n,o-1);return a>n&&i(e[a-1],t)>-i(e[a],t)?a-1:a},right:function(e,i,r=0,o=e.length){if(r<o){if(0!==t(i,i))return o;do{const t=r+o>>>1;n(e[t],i)<=0?r=t+1:o=t}while(r<o)}return r}}}function Xe(){return 0}const Je="year",Ge="quarter",Ve="month",Ye="week",Ke="date",Ze="day",Qe="dayofyear",et="hours",tt="minutes",nt="seconds",it="milliseconds",rt=[Je,Ge,Ve,Ye,Ke,Ze,Qe,et,tt,nt,it],ot=rt.reduce(((e,t,n)=>(e[t]=1+n,e)),{});function at(e){const t=(0,m.IX)(e).slice(),n={};t.length||(0,m.vU)("Missing time unit."),t.forEach((e=>{(0,m.nr)(ot,e)?n[e]=1:(0,m.vU)(`Invalid time unit: ${e}.`)}));return(n[Ye]||n[Ze]?1:0)+(n[Ge]||n[Ve]||n[Ke]?1:0)+(n[Qe]?1:0)>1&&(0,m.vU)(`Incompatible time units: ${e}`),t.sort(((e,t)=>ot[e]-ot[t])),t}const st={[Je]:"%Y ",[Ge]:"Q%q ",[Ve]:"%b ",[Ke]:"%d ",[Ye]:"W%U ",[Ze]:"%a ",[Qe]:"%j ",[et]:"%H:00",[tt]:"00:%M",[nt]:":%S",[it]:".%L",[`${Je}-${Ve}`]:"%Y-%m ",[`${Je}-${Ve}-${Ke}`]:"%Y-%m-%d ",[`${et}-${tt}`]:"%H:%M"};function lt(e,t){const n=(0,m.l7)({},st,t),i=at(e),r=i.length;let o,a,s="",l=0;for(l=0;l<r;)for(o=i.length;o>l;--o)if(a=i.slice(l,o).join("-"),null!=n[a]){s+=n[a],l=o;break}return s.trim()}const ut=new Date;function ct(e){return ut.setFullYear(e),ut.setMonth(0),ut.setDate(1),ut.setHours(0,0,0,0),ut}function ft(e){return ht(new Date(e))}function dt(e){return pt(new Date(e))}function ht(e){return pe.count(ct(e.getFullYear())-1,e)}function pt(e){return ve.count(ct(e.getFullYear())-1,e)}function mt(e){return ct(e).getDay()}function gt(e,t,n,i,r,o,a){if(0<=e&&e<100){const s=new Date(-1,t,n,i,r,o,a);return s.setFullYear(e),s}return new Date(e,t,n,i,r,o,a)}function yt(e){return bt(new Date(e))}function vt(e){return xt(new Date(e))}function bt(e){const t=Date.UTC(e.getUTCFullYear(),0,1);return me.count(t-1,e)}function xt(e){const t=Date.UTC(e.getUTCFullYear(),0,1);return $e.count(t-1,e)}function _t(e){return ut.setTime(Date.UTC(e,0,1)),ut.getUTCDay()}function wt(e,t,n,i,r,o,a){if(0<=e&&e<100){const e=new Date(Date.UTC(-1,t,n,i,r,o,a));return e.setUTCFullYear(n.y),e}return new Date(Date.UTC(e,t,n,i,r,o,a))}function kt(e,t,n,i,r){const o=t||1,a=(0,m.fj)(e),s=(e,t,r)=>function(e,t,n,i){const r=n<=1?e:i?(t,r)=>i+n*Math.floor((e(t,r)-i)/n):(t,i)=>n*Math.floor(e(t,i)/n);return t?(e,n)=>t(r(e,n),n):r}(n[r=r||e],i[r],e===a&&o,t),l=new Date,u=(0,m.Rg)(e),c=u[Je]?s(Je):(0,m.a9)(2012),f=u[Ve]?s(Ve):u[Ge]?s(Ge):m.bM,d=u[Ye]&&u[Ze]?s(Ze,1,Ye+Ze):u[Ye]?s(Ye,1):u[Ze]?s(Ze,1):u[Ke]?s(Ke,1):u[Qe]?s(Qe,1):m.kX,h=u[et]?s(et):m.bM,p=u[tt]?s(tt):m.bM,g=u[nt]?s(nt):m.bM,y=u[it]?s(it):m.bM;return function(e){l.setTime(+e);const t=c(l);return r(t,f(l),d(l,t),h(l),p(l),g(l),y(l))}}function Et(e,t,n){return t+7*e-(n+6)%7}const Dt={[Je]:e=>e.getFullYear(),[Ge]:e=>Math.floor(e.getMonth()/3),[Ve]:e=>e.getMonth(),[Ke]:e=>e.getDate(),[et]:e=>e.getHours(),[tt]:e=>e.getMinutes(),[nt]:e=>e.getSeconds(),[it]:e=>e.getMilliseconds(),[Qe]:e=>ht(e),[Ye]:e=>pt(e),[Ye+Ze]:(e,t)=>Et(pt(e),e.getDay(),mt(t)),[Ze]:(e,t)=>Et(1,e.getDay(),mt(t))},$t={[Ge]:e=>3*e,[Ye]:(e,t)=>Et(e,0,mt(t))};function At(e,t){return kt(e,t||1,Dt,$t,gt)}const St={[Je]:e=>e.getUTCFullYear(),[Ge]:e=>Math.floor(e.getUTCMonth()/3),[Ve]:e=>e.getUTCMonth(),[Ke]:e=>e.getUTCDate(),[et]:e=>e.getUTCHours(),[tt]:e=>e.getUTCMinutes(),[nt]:e=>e.getUTCSeconds(),[it]:e=>e.getUTCMilliseconds(),[Qe]:e=>bt(e),[Ye]:e=>xt(e),[Ze]:(e,t)=>Et(1,e.getUTCDay(),_t(t)),[Ye+Ze]:(e,t)=>Et(xt(e),e.getUTCDay(),_t(t))},Mt={[Ge]:e=>3*e,[Ye]:(e,t)=>Et(e,0,_t(t))};function Ct(e,t){return kt(e,t||1,St,Mt,wt)}const Ft={[Je]:Te,[Ge]:ze.every(3),[Ve]:ze,[Ye]:ve,[Ke]:pe,[Ze]:pe,[Qe]:pe,[et]:Pe,[tt]:Ue,[nt]:je,[it]:Ie},Ot={[Je]:Ne,[Ge]:Re.every(3),[Ve]:Re,[Ye]:$e,[Ke]:me,[Ze]:me,[Qe]:me,[et]:Le,[tt]:Be,[nt]:je,[it]:Ie};function Tt(e){return Ft[e]}function Nt(e){return Ot[e]}function zt(e,t,n){return e?e.offset(t,n):void 0}function Rt(e,t,n){return zt(Tt(e),t,n)}function Pt(e,t,n){return zt(Nt(e),t,n)}function Lt(e,t,n,i){return e?e.range(t,n,i):void 0}function Ut(e,t,n,i){return Lt(Tt(e),t,n,i)}function Bt(e,t,n,i){return Lt(Nt(e),t,n,i)}const jt=1e3,It=6e4,qt=36e5,Wt=864e5,Ht=2592e6,Xt=31536e6,Jt=[Je,Ve,Ke,et,tt,nt,it],Gt=Jt.slice(0,-1),Vt=Gt.slice(0,-1),Yt=Vt.slice(0,-1),Kt=Yt.slice(0,-1),Zt=[Je,Ve],Qt=[Je],en=[[Gt,1,jt],[Gt,5,5e3],[Gt,15,15e3],[Gt,30,3e4],[Vt,1,It],[Vt,5,3e5],[Vt,15,9e5],[Vt,30,18e5],[Yt,1,qt],[Yt,3,108e5],[Yt,6,216e5],[Yt,12,432e5],[Kt,1,Wt],[[Je,Ye],1,6048e5],[Zt,1,Ht],[Zt,3,7776e6],[Qt,1,Xt]];function tn(e){const t=e.extent,n=e.maxbins||40,i=Math.abs((0,m.yP)(t))/n;let r,o,a=He((e=>e[2])).right(en,i);return a===en.length?(r=Qt,o=U(t[0]/Xt,t[1]/Xt,n)):a?(a=en[i/en[a-1][2]<en[a][2]/i?a-1:a],r=a[0],o=a[1]):(r=Jt,o=Math.max(U(t[0],t[1],n),1)),{units:r,step:o}}function nn(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 rn(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 on(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function an(e){var t=e.dateTime,n=e.date,i=e.time,r=e.periods,o=e.days,a=e.shortDays,s=e.months,l=e.shortMonths,u=vn(r),c=bn(r),f=vn(o),d=bn(o),h=vn(a),p=bn(a),m=vn(s),g=bn(s),y=vn(l),v=bn(l),b={a:function(e){return a[e.getDay()]},A:function(e){return o[e.getDay()]},b:function(e){return l[e.getMonth()]},B:function(e){return s[e.getMonth()]},c:null,d:Bn,e:Bn,f:Hn,g:ni,G:ri,H:jn,I:In,j:qn,L:Wn,m:Xn,M:Jn,p:function(e){return r[+(e.getHours()>=12)]},q:function(e){return 1+~~(e.getMonth()/3)},Q:Ai,s:Si,S:Gn,u:Vn,U:Yn,V:Zn,w:Qn,W:ei,x:null,X:null,y:ti,Y:ii,Z:oi,"%":$i},x={a:function(e){return a[e.getUTCDay()]},A:function(e){return o[e.getUTCDay()]},b:function(e){return l[e.getUTCMonth()]},B:function(e){return s[e.getUTCMonth()]},c:null,d:ai,e:ai,f:fi,g:wi,G:Ei,H:si,I:li,j:ui,L:ci,m:di,M:hi,p:function(e){return r[+(e.getUTCHours()>=12)]},q:function(e){return 1+~~(e.getUTCMonth()/3)},Q:Ai,s:Si,S:pi,u:mi,U:gi,V:vi,w:bi,W:xi,x:null,X:null,y:_i,Y:ki,Z:Di,"%":$i},_={a:function(e,t,n){var i=h.exec(t.slice(n));return i?(e.w=p.get(i[0].toLowerCase()),n+i[0].length):-1},A:function(e,t,n){var i=f.exec(t.slice(n));return i?(e.w=d.get(i[0].toLowerCase()),n+i[0].length):-1},b:function(e,t,n){var i=y.exec(t.slice(n));return i?(e.m=v.get(i[0].toLowerCase()),n+i[0].length):-1},B:function(e,t,n){var i=m.exec(t.slice(n));return i?(e.m=g.get(i[0].toLowerCase()),n+i[0].length):-1},c:function(e,n,i){return E(e,t,n,i)},d:Cn,e:Cn,f:Rn,g:$n,G:Dn,H:On,I:On,j:Fn,L:zn,m:Mn,M:Tn,p:function(e,t,n){var i=u.exec(t.slice(n));return i?(e.p=c.get(i[0].toLowerCase()),n+i[0].length):-1},q:Sn,Q:Ln,s:Un,S:Nn,u:_n,U:wn,V:kn,w:xn,W:En,x:function(e,t,i){return E(e,n,t,i)},X:function(e,t,n){return E(e,i,t,n)},y:$n,Y:Dn,Z:An,"%":Pn};function w(e,t){return function(n){var i,r,o,a=[],s=-1,l=0,u=e.length;for(n instanceof Date||(n=new Date(+n));++s<u;)37===e.charCodeAt(s)&&(a.push(e.slice(l,s)),null!=(r=dn[i=e.charAt(++s)])?i=e.charAt(++s):r="e"===i?" ":"0",(o=t[i])&&(i=o(n,r)),a.push(i),l=s+1);return a.push(e.slice(l,s)),a.join("")}}function k(e,t){return function(n){var i,r,o=on(1900,void 0,1);if(E(o,e,n+="",0)!=n.length)return null;if("Q"in o)return new Date(o.Q);if("s"in o)return new Date(1e3*o.s+("L"in o?o.L:0));if(t&&!("Z"in o)&&(o.Z=0),"p"in o&&(o.H=o.H%12+12*o.p),void 0===o.m&&(o.m="q"in o?o.q:0),"V"in o){if(o.V<1||o.V>53)return null;"w"in o||(o.w=1),"Z"in o?(r=(i=rn(on(o.y,0,1))).getUTCDay(),i=r>4||0===r?Ae.ceil(i):Ae(i),i=me.offset(i,7*(o.V-1)),o.y=i.getUTCFullYear(),o.m=i.getUTCMonth(),o.d=i.getUTCDate()+(o.w+6)%7):(r=(i=nn(on(o.y,0,1))).getDay(),i=r>4||0===r?be.ceil(i):be(i),i=pe.offset(i,7*(o.V-1)),o.y=i.getFullYear(),o.m=i.getMonth(),o.d=i.getDate()+(o.w+6)%7)}else("W"in o||"U"in o)&&("w"in o||(o.w="u"in o?o.u%7:"W"in o?1:0),r="Z"in o?rn(on(o.y,0,1)).getUTCDay():nn(on(o.y,0,1)).getDay(),o.m=0,o.d="W"in o?(o.w+6)%7+7*o.W-(r+5)%7:o.w+7*o.U-(r+6)%7);return"Z"in o?(o.H+=o.Z/100|0,o.M+=o.Z%100,rn(o)):nn(o)}}function E(e,t,n,i){for(var r,o,a=0,s=t.length,l=n.length;a<s;){if(i>=l)return-1;if(37===(r=t.charCodeAt(a++))){if(r=t.charAt(a++),!(o=_[r in dn?t.charAt(a++):r])||(i=o(e,n,i))<0)return-1}else if(r!=n.charCodeAt(i++))return-1}return i}return b.x=w(n,b),b.X=w(i,b),b.c=w(t,b),x.x=w(n,x),x.X=w(i,x),x.c=w(t,x),{format:function(e){var t=w(e+="",b);return t.toString=function(){return e},t},parse:function(e){var t=k(e+="",!1);return t.toString=function(){return e},t},utcFormat:function(e){var t=w(e+="",x);return t.toString=function(){return e},t},utcParse:function(e){var t=k(e+="",!0);return t.toString=function(){return e},t}}}var sn,ln,un,cn,fn,dn={"-":"",_:" ",0:"0"},hn=/^\s*\d+/,pn=/^%/,mn=/[\\^$*+?|[\]().{}]/g;function gn(e,t,n){var i=e<0?"-":"",r=(i?-e:e)+"",o=r.length;return i+(o<n?new Array(n-o+1).join(t)+r:r)}function yn(e){return e.replace(mn,"\\$&")}function vn(e){return new RegExp("^(?:"+e.map(yn).join("|")+")","i")}function bn(e){return new Map(e.map(((e,t)=>[e.toLowerCase(),t])))}function xn(e,t,n){var i=hn.exec(t.slice(n,n+1));return i?(e.w=+i[0],n+i[0].length):-1}function _n(e,t,n){var i=hn.exec(t.slice(n,n+1));return i?(e.u=+i[0],n+i[0].length):-1}function wn(e,t,n){var i=hn.exec(t.slice(n,n+2));return i?(e.U=+i[0],n+i[0].length):-1}function kn(e,t,n){var i=hn.exec(t.slice(n,n+2));return i?(e.V=+i[0],n+i[0].length):-1}function En(e,t,n){var i=hn.exec(t.slice(n,n+2));return i?(e.W=+i[0],n+i[0].length):-1}function Dn(e,t,n){var i=hn.exec(t.slice(n,n+4));return i?(e.y=+i[0],n+i[0].length):-1}function $n(e,t,n){var i=hn.exec(t.slice(n,n+2));return i?(e.y=+i[0]+(+i[0]>68?1900:2e3),n+i[0].length):-1}function An(e,t,n){var i=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return i?(e.Z=i[1]?0:-(i[2]+(i[3]||"00")),n+i[0].length):-1}function Sn(e,t,n){var i=hn.exec(t.slice(n,n+1));return i?(e.q=3*i[0]-3,n+i[0].length):-1}function Mn(e,t,n){var i=hn.exec(t.slice(n,n+2));return i?(e.m=i[0]-1,n+i[0].length):-1}function Cn(e,t,n){var i=hn.exec(t.slice(n,n+2));return i?(e.d=+i[0],n+i[0].length):-1}function Fn(e,t,n){var i=hn.exec(t.slice(n,n+3));return i?(e.m=0,e.d=+i[0],n+i[0].length):-1}function On(e,t,n){var i=hn.exec(t.slice(n,n+2));return i?(e.H=+i[0],n+i[0].length):-1}function Tn(e,t,n){var i=hn.exec(t.slice(n,n+2));return i?(e.M=+i[0],n+i[0].length):-1}function Nn(e,t,n){var i=hn.exec(t.slice(n,n+2));return i?(e.S=+i[0],n+i[0].length):-1}function zn(e,t,n){var i=hn.exec(t.slice(n,n+3));return i?(e.L=+i[0],n+i[0].length):-1}function Rn(e,t,n){var i=hn.exec(t.slice(n,n+6));return i?(e.L=Math.floor(i[0]/1e3),n+i[0].length):-1}function Pn(e,t,n){var i=pn.exec(t.slice(n,n+1));return i?n+i[0].length:-1}function Ln(e,t,n){var i=hn.exec(t.slice(n));return i?(e.Q=+i[0],n+i[0].length):-1}function Un(e,t,n){var i=hn.exec(t.slice(n));return i?(e.s=+i[0],n+i[0].length):-1}function Bn(e,t){return gn(e.getDate(),t,2)}function jn(e,t){return gn(e.getHours(),t,2)}function In(e,t){return gn(e.getHours()%12||12,t,2)}function qn(e,t){return gn(1+pe.count(Te(e),e),t,3)}function Wn(e,t){return gn(e.getMilliseconds(),t,3)}function Hn(e,t){return Wn(e,t)+"000"}function Xn(e,t){return gn(e.getMonth()+1,t,2)}function Jn(e,t){return gn(e.getMinutes(),t,2)}function Gn(e,t){return gn(e.getSeconds(),t,2)}function Vn(e){var t=e.getDay();return 0===t?7:t}function Yn(e,t){return gn(ve.count(Te(e)-1,e),t,2)}function Kn(e){var t=e.getDay();return t>=4||0===t?we(e):we.ceil(e)}function Zn(e,t){return e=Kn(e),gn(we.count(Te(e),e)+(4===Te(e).getDay()),t,2)}function Qn(e){return e.getDay()}function ei(e,t){return gn(be.count(Te(e)-1,e),t,2)}function ti(e,t){return gn(e.getFullYear()%100,t,2)}function ni(e,t){return gn((e=Kn(e)).getFullYear()%100,t,2)}function ii(e,t){return gn(e.getFullYear()%1e4,t,4)}function ri(e,t){var n=e.getDay();return gn((e=n>=4||0===n?we(e):we.ceil(e)).getFullYear()%1e4,t,4)}function oi(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+gn(t/60|0,"0",2)+gn(t%60,"0",2)}function ai(e,t){return gn(e.getUTCDate(),t,2)}function si(e,t){return gn(e.getUTCHours(),t,2)}function li(e,t){return gn(e.getUTCHours()%12||12,t,2)}function ui(e,t){return gn(1+me.count(Ne(e),e),t,3)}function ci(e,t){return gn(e.getUTCMilliseconds(),t,3)}function fi(e,t){return ci(e,t)+"000"}function di(e,t){return gn(e.getUTCMonth()+1,t,2)}function hi(e,t){return gn(e.getUTCMinutes(),t,2)}function pi(e,t){return gn(e.getUTCSeconds(),t,2)}function mi(e){var t=e.getUTCDay();return 0===t?7:t}function gi(e,t){return gn($e.count(Ne(e)-1,e),t,2)}function yi(e){var t=e.getUTCDay();return t>=4||0===t?Ce(e):Ce.ceil(e)}function vi(e,t){return e=yi(e),gn(Ce.count(Ne(e),e)+(4===Ne(e).getUTCDay()),t,2)}function bi(e){return e.getUTCDay()}function xi(e,t){return gn(Ae.count(Ne(e)-1,e),t,2)}function _i(e,t){return gn(e.getUTCFullYear()%100,t,2)}function wi(e,t){return gn((e=yi(e)).getUTCFullYear()%100,t,2)}function ki(e,t){return gn(e.getUTCFullYear()%1e4,t,4)}function Ei(e,t){var n=e.getUTCDay();return gn((e=n>=4||0===n?Ce(e):Ce.ceil(e)).getUTCFullYear()%1e4,t,4)}function Di(){return"+0000"}function $i(){return"%"}function Ai(e){return+e}function Si(e){return Math.floor(+e/1e3)}function Mi(e){const t={};return n=>t[n]||(t[n]=e(n))}function Ci(e){const t=Mi(e.format),n=e.formatPrefix;return{format:t,formatPrefix:n,formatFloat(e){const n=I(e||",");if(null==n.precision){switch(n.precision=12,n.type){case"%":n.precision-=2;break;case"e":n.precision-=1}return i=t(n),r=t(".1f")(1)[1],e=>{const t=i(e),n=t.indexOf(r);if(n<0)return t;let o=function(e,t){let n,i=e.lastIndexOf("e");if(i>0)return i;for(i=e.length;--i>t;)if(n=e.charCodeAt(i),n>=48&&n<=57)return i+1}(t,n);const a=o<t.length?t.slice(o):"";for(;--o>n;)if("0"!==t[o]){++o;break}return t.slice(0,o)+a}}return t(n);var i,r},formatSpan(e,i,r,o){o=I(null==o?",f":o);const a=U(e,i,r),s=Math.max(Math.abs(e),Math.abs(i));let l;if(null==o.precision)switch(o.type){case"s":return isNaN(l=X(a,s))||(o.precision=l),n(o,s);case"":case"e":case"g":case"p":case"r":isNaN(l=J(a,s))||(o.precision=l-("e"===o.type));break;case"f":case"%":isNaN(l=G(a))||(o.precision=l-2*("%"===o.type))}return t(o)}}}let Fi,Oi;function Ti(){return Fi=Ci({format:Q,formatPrefix:ee})}function Ni(e){return Ci(ie(e))}function zi(e){return arguments.length?Fi=Ni(e):Fi}function Ri(e,t,n){n=n||{},(0,m.Kn)(n)||(0,m.vU)(`Invalid time multi-format specifier: ${n}`);const i=t(nt),r=t(tt),o=t(et),a=t(Ke),s=t(Ye),l=t(Ve),u=t(Ge),c=t(Je),f=e(n[it]||".%L"),d=e(n[nt]||":%S"),h=e(n[tt]||"%I:%M"),p=e(n[et]||"%I %p"),g=e(n[Ke]||n[Ze]||"%a %d"),y=e(n[Ye]||"%b %d"),v=e(n[Ve]||"%B"),b=e(n[Ge]||"%B"),x=e(n[Je]||"%Y");return e=>(i(e)<e?f:r(e)<e?d:o(e)<e?h:a(e)<e?p:l(e)<e?s(e)<e?g:y:c(e)<e?u(e)<e?v:b:x)(e)}function Pi(e){const t=Mi(e.format),n=Mi(e.utcFormat);return{timeFormat:e=>(0,m.HD)(e)?t(e):Ri(t,Tt,e),utcFormat:e=>(0,m.HD)(e)?n(e):Ri(n,Nt,e),timeParse:Mi(e.parse),utcParse:Mi(e.utcParse)}}function Li(){return Oi=Pi({format:ln,parse:un,utcFormat:cn,utcParse:fn})}function Ui(e){return Pi(an(e))}function Bi(e){return arguments.length?Oi=Ui(e):Oi}!function(e){sn=an(e),ln=sn.format,un=sn.parse,cn=sn.utcFormat,fn=sn.utcParse}({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"]}),Ti(),Li();const ji=(e,t)=>(0,m.l7)({},e,t);function Ii(e,t){const n=e?Ni(e):zi(),i=t?Ui(t):Bi();return ji(n,i)}function qi(e,t){const n=arguments.length;return n&&2!==n&&(0,m.vU)("defaultLocale expects either zero or two arguments."),n?ji(zi(e),Bi(t)):ji(zi(),Bi())}function Wi(){return Ti(),Li(),qi()}const Hi=/^(data:|([A-Za-z]+:)?\/\/)/,Xi=/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp|file|data):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i,Ji=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205f\u3000]/g,Gi="file://";async function Vi(e,t){const n=await this.sanitize(e,t),i=n.href;return n.localFile?this.file(i):this.http(i,t)}async function Yi(e,t){t=(0,m.l7)({},this.options,t);const n=this.fileAccess,i={href:null};let r,o,a;const s=Xi.test(e.replace(Ji,""));null!=e&&"string"===typeof e&&s||(0,m.vU)("Sanitize failure, invalid URI: "+(0,m.m8)(e));const l=Hi.test(e);return(a=t.baseURL)&&!l&&(e.startsWith("/")||a.endsWith("/")||(e="/"+e),e=a+e),o=(r=e.startsWith(Gi))||"file"===t.mode||"http"!==t.mode&&!l&&n,r?e=e.slice(Gi.length):e.startsWith("//")&&("file"===t.defaultProtocol?(e=e.slice(2),o=!0):e=(t.defaultProtocol||"http")+":"+e),Object.defineProperty(i,"localFile",{value:!!o}),i.href=e,t.target&&(i.target=t.target+""),t.rel&&(i.rel=t.rel+""),"image"===t.context&&t.crossOrigin&&(i.crossOrigin=t.crossOrigin+""),i}function Ki(e){return e?t=>new Promise(((n,i)=>{e.readFile(t,((e,t)=>{e?i(e):n(t)}))})):Zi}async function Zi(){(0,m.vU)("No file system access.")}function Qi(e){return e?async function(t,n){const i=(0,m.l7)({},this.options.http,n),r=n&&n.response,o=await e(t,i);return o.ok?(0,m.mf)(o[r])?o[r]():o.text():(0,m.vU)(o.status+""+o.statusText)}:er}async function er(){(0,m.vU)("No HTTP fetch method available.")}const tr=e=>null!=e&&e===e,nr=e=>!Number.isNaN(+e)&&!(e instanceof Date),ir={boolean:m.sw,integer:m.He,number:m.He,date:m.ZU,string:m.BB,unknown:m.yR},rr=[e=>"true"===e||"false"===e||!0===e||!1===e,e=>nr(e)&&Number.isInteger(+e),nr,e=>!Number.isNaN(Date.parse(e))],or=["boolean","integer","number","date"];function ar(e,t){if(!e||!e.length)return"unknown";const n=e.length,i=rr.length,r=rr.map(((e,t)=>t+1));for(let o,a,s=0,l=0;s<n;++s)for(a=t?e[s][t]:e[s],o=0;o<i;++o)if(r[o]&&tr(a)&&!rr[o](a)&&(r[o]=0,++l,l===rr.length))return"string";return or[r.reduce(((e,t)=>0===e?t:e),0)-1]}function sr(e,t){return t.reduce(((t,n)=>(t[n]=ar(e,n),t)),{})}function lr(e){const t=function(t,n){const i={delimiter:e};return ur(t,n?(0,m.l7)(n,i):i)};return t.responseType="text",t}function ur(e,t){return t.header&&(e=t.header.map(m.m8).join(t.delimiter)+"\n"+e),D(t.delimiter).parse(e+"")}function cr(e,t){const n=t&&t.property?(0,m.EP)(t.property):m.yR;return!(0,m.Kn)(e)||(i=e,"function"===typeof Buffer&&(0,m.mf)(Buffer.isBuffer)&&Buffer.isBuffer(i))?n(JSON.parse(e)):function(e,t){!(0,m.kJ)(e)&&(0,m.TW)(e)&&(e=[...e]);return t&&t.copy?JSON.parse(JSON.stringify(e)):e}(n(e),t);var i}ur.responseType="text",cr.responseType="json";const fr={interior:(e,t)=>e!==t,exterior:(e,t)=>e===t};function dr(e,t){let n,i,r,o;return e=cr(e,t),t&&t.feature?(n=A,r=t.feature):t&&t.mesh?(n=F,r=t.mesh,o=fr[t.filter]):(0,m.vU)("Missing TopoJSON feature or mesh parameter."),i=(i=e.objects[r])?n(e,i,o):(0,m.vU)("Invalid TopoJSON object: "+r),i&&i.features||[i]}dr.responseType="json";const hr={dsv:ur,csv:lr(","),tsv:lr("\t"),json:cr,topojson:dr};function pr(e,t){return arguments.length>1?(hr[e]=t,this):(0,m.nr)(hr,e)?hr[e]:null}function mr(e){const t=pr(e);return t&&t.responseType||"text"}function gr(e,t,n,i){const r=pr((t=t||{}).type||"json");return r||(0,m.vU)("Unknown data format type: "+t.type),e=r(e,t),t.parse&&function(e,t,n,i){if(!e.length)return;const r=Bi();n=n||r.timeParse,i=i||r.utcParse;let o,a,s,l,u,c,f=e.columns||Object.keys(e[0]);"auto"===t&&(t=sr(e,f));f=Object.keys(t);const d=f.map((e=>{const r=t[e];let o,a;if(r&&(r.startsWith("date:")||r.startsWith("utc:"))){o=r.split(/:(.+)?/,2),a=o[1],("'"===a[0]&&"'"===a[a.length-1]||'"'===a[0]&&'"'===a[a.length-1])&&(a=a.slice(1,-1));return("utc"===o[0]?i:n)(a)}if(!ir[r])throw Error("Illegal format pattern: "+e+":"+r);return ir[r]}));for(s=0,u=e.length,c=f.length;s<u;++s)for(o=e[s],l=0;l<c;++l)a=f[l],o[a]=d[l](o[a])}(e,t.parse,n,i),(0,m.nr)(e,"columns")&&delete e.columns,e}const yr=function(e,t){return n=>({options:n||{},sanitize:Yi,load:Vi,fileAccess:!!t,file:Ki(t),http:Qi(e)})}("undefined"!==typeof fetch&&fetch,null);function vr(e){const t=e||m.yR,n=[],i={};return n.add=e=>{const r=t(e);return i[r]||(i[r]=1,n.push(e)),n},n.remove=e=>{const r=t(e);if(i[r]){i[r]=0;const t=n.indexOf(e);t>=0&&n.splice(t,1)}return n},n}async function br(e,t){try{await t(e)}catch(n){e.error(n)}}const xr=Symbol("vega_id");let _r=1;function wr(e){return!(!e||!kr(e))}function kr(e){return e[xr]}function Er(e,t){return e[xr]=t,e}function Dr(e){const t=e===Object(e)?e:{data:e};return kr(t)?t:Er(t,_r++)}function $r(e){return Ar(e,Dr({}))}function Ar(e,t){for(const n in e)t[n]=e[n];return t}function Sr(e,t){return Er(t,kr(e))}function Mr(e,t){return e?t?(n,i)=>e(n,i)||kr(t(n))-kr(t(i)):(t,n)=>e(t,n)||kr(t)-kr(n):null}function Cr(e){return e&&e.constructor===Fr}function Fr(){const e=[],t=[],n=[],i=[],r=[];let o=null,a=!1;return{constructor:Fr,insert(t){const n=(0,m.IX)(t),i=n.length;for(let r=0;r<i;++r)e.push(n[r]);return this},remove(e){const n=(0,m.mf)(e)?i:t,r=(0,m.IX)(e),o=r.length;for(let t=0;t<o;++t)n.push(r[t]);return this},modify(e,t,i){const o={field:t,value:(0,m.a9)(i)};return(0,m.mf)(e)?(o.filter=e,r.push(o)):(o.tuple=e,n.push(o)),this},encode(e,t){return(0,m.mf)(e)?r.push({filter:e,field:t}):n.push({tuple:e,field:t}),this},clean(e){return o=e,this},reflow(){return a=!0,this},pulse(s,l){const u={},c={};let f,d,h,p,m,g;for(f=0,d=l.length;f<d;++f)u[kr(l[f])]=1;for(f=0,d=t.length;f<d;++f)m=t[f],u[kr(m)]=-1;for(f=0,d=i.length;f<d;++f)p=i[f],l.forEach((e=>{p(e)&&(u[kr(e)]=-1)}));for(f=0,d=e.length;f<d;++f)m=e[f],g=kr(m),u[g]?u[g]=1:s.add.push(Dr(e[f]));for(f=0,d=l.length;f<d;++f)m=l[f],u[kr(m)]<0&&s.rem.push(m);function y(e,t,n){n?e[t]=n(e):s.encode=t,a||(c[kr(e)]=e)}for(f=0,d=n.length;f<d;++f)h=n[f],m=h.tuple,p=h.field,g=u[kr(m)],g>0&&(y(m,p,h.value),s.modifies(p));for(f=0,d=r.length;f<d;++f)h=r[f],p=h.filter,l.forEach((e=>{p(e)&&u[kr(e)]>0&&y(e,h.field,h.value)})),s.modifies(h.field);if(a)s.mod=t.length||i.length?l.filter((e=>u[kr(e)]>0)):l.slice();else for(g in c)s.mod.push(c[g]);return(o||null==o&&(t.length||i.length))&&s.clean(!0),s}}}const Or="_:mod:_";function Tr(){Object.defineProperty(this,Or,{writable:!0,value:{}})}Tr.prototype={set(e,t,n,i){const r=this,o=r[e],a=r[Or];return null!=t&&t>=0?(o[t]!==n||i)&&(o[t]=n,a[t+":"+e]=-1,a[e]=-1):(o!==n||i)&&(r[e]=n,a[e]=(0,m.kJ)(n)?1+n.length:-1),r},modified(e,t){const n=this[Or];if(!arguments.length){for(const e in n)if(n[e])return!0;return!1}if((0,m.kJ)(e)){for(let t=0;t<e.length;++t)if(n[e[t]])return!0;return!1}return null!=t&&t>=0?t+1<n[e]||!!n[t+":"+e]:!!n[e]},clear(){return this[Or]={},this}};let Nr=0;const zr=new Tr;function Rr(e,t,n,i){this.id=++Nr,this.value=e,this.stamp=-1,this.rank=-1,this.qrank=-1,this.flags=0,t&&(this._update=t),n&&this.parameters(n,i)}function Pr(e){return function(t){const n=this.flags;return 0===arguments.length?!!(n&e):(this.flags=t?n|e:n&~e,this)}}Rr.prototype={targets(){return this._targets||(this._targets=vr(m.id))},set(e){return this.value!==e?(this.value=e,1):0},skip:Pr(1),modified:Pr(2),parameters(e,t,n){t=!1!==t;const i=this._argval=this._argval||new Tr,r=this._argops=this._argops||[],o=[];let a,s,l,u;const c=(e,n,a)=>{a instanceof Rr?(a!==this&&(t&&a.targets().add(this),o.push(a)),r.push({op:a,name:e,index:n})):i.set(e,n,a)};for(a in e)if(s=e[a],"pulse"===a)(0,m.IX)(s).forEach((e=>{e instanceof Rr?e!==this&&(e.targets().add(this),o.push(e)):(0,m.vU)("Pulse parameters must be operator instances.")})),this.source=s;else if((0,m.kJ)(s))for(i.set(a,-1,Array(l=s.length)),u=0;u<l;++u)c(a,u,s[u]);else c(a,-1,s);return this.marshall().clear(),n&&(r.initonly=!0),o},marshall(e){const t=this._argval||zr,n=this._argops;let i,r,o,a;if(n){const s=n.length;for(r=0;r<s;++r)i=n[r],o=i.op,a=o.modified()&&o.stamp===e,t.set(i.name,i.index,o.value,a);if(n.initonly){for(r=0;r<s;++r)i=n[r],i.op.targets().remove(this);this._argops=null,this._update=null}}return t},detach(){const e=this._argops;let t,n,i,r;if(e)for(t=0,n=e.length;t<n;++t)i=e[t],r=i.op,r._targets&&r._targets.remove(this);this.pulse=null,this.source=null},evaluate(e){const t=this._update;if(t){const n=this.marshall(e.stamp),i=t.call(this,n,e);if(n.clear(),i!==this.value)this.value=i;else if(!this.modified())return e.StopPropagation}},run(e){if(e.stamp<this.stamp)return e.StopPropagation;let t;return this.skip()?(this.skip(!1),t=0):t=this.evaluate(e),this.pulse=t||e}};let Lr=0;function Ur(e,t,n){this.id=++Lr,this.value=null,n&&(this.receive=n),e&&(this._filter=e),t&&(this._apply=t)}function Br(e,t,n){return new Ur(e,t,n)}Ur.prototype={_filter:m.yb,_apply:m.yR,targets(){return this._targets||(this._targets=vr(m.id))},consume(e){return arguments.length?(this._consume=!!e,this):!!this._consume},receive(e){if(this._filter(e)){const t=this.value=this._apply(e),n=this._targets,i=n?n.length:0;for(let e=0;e<i;++e)n[e].receive(t);this._consume&&(e.preventDefault(),e.stopPropagation())}},filter(e){const t=Br(e);return this.targets().add(t),t},apply(e){const t=Br(null,e);return this.targets().add(t),t},merge(){const e=Br();this.targets().add(e);for(let t=0,n=arguments.length;t<n;++t)arguments[t].targets().add(e);return e},throttle(e){let t=-1;return this.filter((()=>{const n=Date.now();return n-t>e?(t=n,1):0}))},debounce(e){const t=Br();return this.targets().add(Br(null,null,(0,m.Ds)(e,(e=>{const n=e.dataflow;t.receive(e),n&&n.run&&n.run()})))),t},between(e,t){let n=!1;return e.targets().add(Br(null,null,(()=>n=!0))),t.targets().add(Br(null,null,(()=>n=!1))),this.filter((()=>n))},detach(){this._filter=m.yb,this._targets=null}};const jr={skip:!0};function Ir(e,t,n,i,r,o){const a=(0,m.l7)({},o,jr);let s,l;(0,m.mf)(n)||(n=(0,m.a9)(n)),void 0===i?s=t=>e.touch(n(t)):(0,m.mf)(i)?(l=new Rr(null,i,r,!1),s=t=>{l.evaluate(t);const i=n(t),r=l.value;Cr(r)?e.pulse(i,r,o):e.update(i,r,a)}):s=t=>e.update(n(t),i,a),t.apply(s)}function qr(e,t,n,i,r,o){if(void 0===i)t.targets().add(n);else{const a=o||{},s=new Rr(null,function(e,t){return t=(0,m.mf)(t)?t:(0,m.a9)(t),e?function(n,i){const r=t(n,i);return e.skip()||(e.skip(r!==this.value).value=r),r}:t}(n,i),r,!1);s.modified(a.force),s.rank=t.rank,t.targets().add(s),n&&(s.skip(!0),s.value=n.value,s.targets().add(n),e.connect(n,[s]))}}const Wr={};function Hr(e,t,n){this.dataflow=e,this.stamp=null==t?-1:t,this.add=[],this.rem=[],this.mod=[],this.fields=null,this.encode=n||null}function Xr(e,t){const n=[];return(0,m.FP)(e,t,(e=>n.push(e))),n}function Jr(e,t){const n={};return e.visit(t,(e=>{n[kr(e)]=1})),e=>n[kr(e)]?null:e}function Gr(e,t){return e?(n,i)=>e(n,i)&&t(n,i):t}function Vr(e,t,n,i){const r=this;let o=0;this.dataflow=e,this.stamp=t,this.fields=null,this.encode=i||null,this.pulses=n;for(const a of n)if(a.stamp===t){if(a.fields){const e=r.fields||(r.fields={});for(const t in a.fields)e[t]=1}a.changed(r.ADD)&&(o|=r.ADD),a.changed(r.REM)&&(o|=r.REM),a.changed(r.MOD)&&(o|=r.MOD)}this.changes=o}function Yr(e){return e.error("Dataflow already running. Use runAsync() to chain invocations."),e}Hr.prototype={StopPropagation:Wr,ADD:1,REM:2,MOD:4,ADD_REM:3,ADD_MOD:5,ALL:7,REFLOW:8,SOURCE:16,NO_SOURCE:32,NO_FIELDS:64,fork(e){return new Hr(this.dataflow).init(this,e)},clone(){const e=this.fork(7);return e.add=e.add.slice(),e.rem=e.rem.slice(),e.mod=e.mod.slice(),e.source&&(e.source=e.source.slice()),e.materialize(23)},addAll(){let e=this;return!e.source||e.add===e.rem||!e.rem.length&&e.source.length===e.add.length||(e=new Hr(this.dataflow).init(this),e.add=e.source,e.rem=[]),e},init(e,t){const n=this;return n.stamp=e.stamp,n.encode=e.encode,!e.fields||64&t||(n.fields=e.fields),1&t?(n.addF=e.addF,n.add=e.add):(n.addF=null,n.add=[]),2&t?(n.remF=e.remF,n.rem=e.rem):(n.remF=null,n.rem=[]),4&t?(n.modF=e.modF,n.mod=e.mod):(n.modF=null,n.mod=[]),32&t?(n.srcF=null,n.source=null):(n.srcF=e.srcF,n.source=e.source,e.cleans&&(n.cleans=e.cleans)),n},runAfter(e){this.dataflow.runAfter(e)},changed(e){const t=e||7;return 1&t&&this.add.length||2&t&&this.rem.length||4&t&&this.mod.length},reflow(e){if(e)return this.fork(7).reflow();const t=this.add.length,n=this.source&&this.source.length;return n&&n!==t&&(this.mod=this.source,t&&this.filter(4,Jr(this,1))),this},clean(e){return arguments.length?(this.cleans=!!e,this):this.cleans},modifies(e){const t=this.fields||(this.fields={});return(0,m.kJ)(e)?e.forEach((e=>t[e]=!0)):t[e]=!0,this},modified(e,t){const n=this.fields;return!(!t&&!this.mod.length||!n)&&(arguments.length?(0,m.kJ)(e)?e.some((e=>n[e])):n[e]:!!n)},filter(e,t){const n=this;return 1&e&&(n.addF=Gr(n.addF,t)),2&e&&(n.remF=Gr(n.remF,t)),4&e&&(n.modF=Gr(n.modF,t)),16&e&&(n.srcF=Gr(n.srcF,t)),n},materialize(e){const t=this;return 1&(e=e||7)&&t.addF&&(t.add=Xr(t.add,t.addF),t.addF=null),2&e&&t.remF&&(t.rem=Xr(t.rem,t.remF),t.remF=null),4&e&&t.modF&&(t.mod=Xr(t.mod,t.modF),t.modF=null),16&e&&t.srcF&&(t.source=t.source.filter(t.srcF),t.srcF=null),t},visit(e,t){const n=this,i=t;if(16&e)return(0,m.FP)(n.source,n.srcF,i),n;1&e&&(0,m.FP)(n.add,n.addF,i),2&e&&(0,m.FP)(n.rem,n.remF,i),4&e&&(0,m.FP)(n.mod,n.modF,i);const r=n.source;if(8&e&&r){const e=n.add.length+n.mod.length;e===r.length||(e?(0,m.FP)(r,Jr(n,5),i):(0,m.FP)(r,n.srcF,i))}return n}},(0,m.XW)(Vr,Hr,{fork(e){const t=new Hr(this.dataflow).init(this,e&this.NO_FIELDS);return void 0!==e&&(e&t.ADD&&this.visit(t.ADD,(e=>t.add.push(e))),e&t.REM&&this.visit(t.REM,(e=>t.rem.push(e))),e&t.MOD&&this.visit(t.MOD,(e=>t.mod.push(e)))),t},changed(e){return this.changes&e},modified(e){const t=this,n=t.fields;return n&&t.changes&t.MOD?(0,m.kJ)(e)?e.some((e=>n[e])):n[e]:0},filter(){(0,m.vU)("MultiPulse does not support filtering.")},materialize(){(0,m.vU)("MultiPulse does not support materialization.")},visit(e,t){const n=this,i=n.pulses,r=i.length;let o=0;if(e&n.SOURCE)for(;o<r;++o)i[o].visit(e,t);else for(;o<r;++o)i[o].stamp===n.stamp&&i[o].visit(e,t);return n}});const Kr={skip:!1,force:!1};function Zr(e){let t=[];return{clear:()=>t=[],size:()=>t.length,peek:()=>t[0],push:n=>(t.push(n),Qr(t,0,t.length-1,e)),pop:()=>{const n=t.pop();let i;return t.length?(i=t[0],t[0]=n,function(e,t,n){const i=t,r=e.length,o=e[t];let a,s=1+(t<<1);for(;s<r;)a=s+1,a<r&&n(e[s],e[a])>=0&&(s=a),e[t]=e[s],s=1+((t=s)<<1);e[t]=o,Qr(e,i,t,n)}(t,0,e)):i=n,i}}}function Qr(e,t,n,i){let r,o;const a=e[n];for(;n>t&&(o=n-1>>1,r=e[o],i(a,r)<0);)e[n]=r,n=o;return e[n]=a}function eo(){this.logger((0,m.kg)()),this.logLevel(m.jj),this._clock=0,this._rank=0,this._locale=qi();try{this._loader=yr()}catch(e){}this._touched=vr(m.id),this._input={},this._pulse=null,this._heap=Zr(((e,t)=>e.qrank-t.qrank)),this._postrun=[]}function to(e){return function(){return this._log[e].apply(this,arguments)}}function no(e,t){Rr.call(this,e,null,t)}eo.prototype={stamp(){return this._clock},loader(e){return arguments.length?(this._loader=e,this):this._loader},locale(e){return arguments.length?(this._locale=e,this):this._locale},logger(e){return arguments.length?(this._log=e,this):this._log},error:to("error"),warn:to("warn"),info:to("info"),debug:to("debug"),logLevel:to("level"),cleanThreshold:1e4,add:function(e,t,n,i){let r,o=1;return e instanceof Rr?r=e:e&&e.prototype instanceof Rr?r=new e:(0,m.mf)(e)?r=new Rr(null,e):(o=0,r=new Rr(e,t)),this.rank(r),o&&(i=n,n=t),n&&this.connect(r,r.parameters(n,i)),this.touch(r),r},connect:function(e,t){const n=e.rank,i=t.length;for(let r=0;r<i;++r)if(n<t[r].rank)return void this.rerank(e)},rank:function(e){e.rank=++this._rank},rerank:function(e){const t=[e];let n,i,r;for(;t.length;)if(this.rank(n=t.pop()),i=n._targets)for(r=i.length;--r>=0;)t.push(n=i[r]),n===e&&(0,m.vU)("Cycle detected in dataflow graph.")},pulse:function(e,t,n){this.touch(e,n||Kr);const i=new Hr(this,this._clock+(this._pulse?0:1)),r=e.pulse&&e.pulse.source||[];return i.target=e,this._input[e.id]=t.pulse(i,r),this},touch:function(e,t){const n=t||Kr;return this._pulse?this._enqueue(e):this._touched.add(e),n.skip&&e.skip(!0),this},update:function(e,t,n){const i=n||Kr;return(e.set(t)||i.force)&&this.touch(e,i),this},changeset:Fr,ingest:function(e,t,n){return t=this.parse(t,n),this.pulse(e,this.changeset().insert(t))},parse:function(e,t){const n=this.locale();return gr(e,t,n.timeParse,n.utcParse)},preload:async function(e,t,n){const i=this,r=i._pending||function(e){let t;const n=new Promise((e=>t=e));return n.requests=0,n.done=()=>{0===--n.requests&&(e._pending=null,t(e))},e._pending=n}(i);r.requests+=1;const o=await i.request(t,n);return i.pulse(e,i.changeset().remove(m.yb).insert(o.data||[])),r.done(),o},request:async function(e,t){const n=this;let i,r=0;try{i=await n.loader().load(e,{context:"dataflow",response:mr(t&&t.type)});try{i=n.parse(i,t)}catch(o){r=-2,n.warn("Data ingestion failed",e,o)}}catch(o){r=-1,n.warn("Loading failed",e,o)}return{data:i,status:r}},events:function(e,t,n,i){const r=this,o=Br(n,i),a=function(e){e.dataflow=r;try{o.receive(e)}catch(t){r.error(t)}finally{r.run()}};let s;s="string"===typeof e&&"undefined"!==typeof document?document.querySelectorAll(e):(0,m.IX)(e);const l=s.length;for(let u=0;u<l;++u)s[u].addEventListener(t,a);return o},on:function(e,t,n,i,r){return(e instanceof Rr?qr:Ir)(this,e,t,n,i,r),this},evaluate:async function(e,t,n){const i=this,r=[];if(i._pulse)return Yr(i);if(i._pending&&await i._pending,t&&await br(i,t),!i._touched.length)return i.debug("Dataflow invoked, but nothing to do."),i;const o=++i._clock;i._pulse=new Hr(i,o,e),i._touched.forEach((e=>i._enqueue(e,!0))),i._touched=vr(m.id);let a,s,l,u=0;try{for(;i._heap.size()>0;)a=i._heap.pop(),a.rank===a.qrank?(s=a.run(i._getPulse(a,e)),s.then?s=await s:s.async&&(r.push(s.async),s=Wr),s!==Wr&&a._targets&&a._targets.forEach((e=>i._enqueue(e))),++u):i._enqueue(a,!0)}catch(c){i._heap.clear(),l=c}if(i._input={},i._pulse=null,i.debug(`Pulse ${o}: ${u} operators`),l&&(i._postrun=[],i.error(l)),i._postrun.length){const e=i._postrun.sort(((e,t)=>t.priority-e.priority));i._postrun=[];for(let t=0;t<e.length;++t)await br(i,e[t].callback)}return n&&await br(i,n),r.length&&Promise.all(r).then((e=>i.runAsync(null,(()=>{e.forEach((e=>{try{e(i)}catch(c){i.error(c)}}))})))),i},run:function(e,t,n){return this._pulse?Yr(this):(this.evaluate(e,t,n),this)},runAsync:async function(e,t,n){for(;this._running;)await this._running;const i=()=>this._running=null;return(this._running=this.evaluate(e,t,n)).then(i,i),this._running},runAfter:function(e,t,n){if(this._pulse||t)this._postrun.push({priority:n||0,callback:e});else try{e(this)}catch(i){this.error(i)}},_enqueue:function(e,t){const n=e.stamp<this._clock;n&&(e.stamp=this._clock),(n||t)&&(e.qrank=e.rank,this._heap.push(e))},_getPulse:function(e,t){const n=e.source,i=this._clock;return n&&(0,m.kJ)(n)?new Vr(this,i,n.map((e=>e.pulse)),t):this._input[e.id]||function(e,t){if(t&&t.stamp===e.stamp)return t;e=e.fork(),t&&t!==Wr&&(e.source=t.source);return e}(this._pulse,n&&n.pulse)}},(0,m.XW)(no,Rr,{run(e){if(e.stamp<this.stamp)return e.StopPropagation;let t;return this.skip()?this.skip(!1):t=this.evaluate(e),t=t||e,t.then?t=t.then((e=>this.pulse=e)):t!==e.StopPropagation&&(this.pulse=t),t},evaluate(e){const t=this.marshall(e.stamp),n=this.transform(t,e);return t.clear(),n},transform(){}});const io={};function ro(e){const t=oo(e);return t&&t.Definition||null}function oo(e){return e=e&&e.toLowerCase(),(0,m.nr)(io,e)?io[e]:null}function ao(e,t){let n;if(void 0===t)for(const i of e)null!=i&&(n<i||void 0===n&&i>=i)&&(n=i);else{let i=-1;for(let r of e)null!=(r=t(r,++i,e))&&(n<r||void 0===n&&r>=r)&&(n=r)}return n}function so(e,t){let n;if(void 0===t)for(const i of e)null!=i&&(n>i||void 0===n&&i>=i)&&(n=i);else{let i=-1;for(let r of e)null!=(r=t(r,++i,e))&&(n>r||void 0===n&&r>=r)&&(n=r)}return n}function lo(e=qe){if(e===qe)return uo;if("function"!==typeof e)throw new TypeError("compare is not a function");return(t,n)=>{const i=e(t,n);return i||0===i?i:(0===e(n,n))-(0===e(t,t))}}function uo(e,t){return(null==e||!(e>=e))-(null==t||!(t>=t))||(e<t?-1:e>t?1:0)}function co(e,t,n=0,i=1/0,r){if(t=Math.floor(t),n=Math.floor(Math.max(0,n)),i=Math.floor(Math.min(e.length-1,i)),!(n<=t&&t<=i))return e;for(r=void 0===r?uo:lo(r);i>n;){if(i-n>600){const o=i-n+1,a=t-n+1,s=Math.log(o),l=.5*Math.exp(2*s/3),u=.5*Math.sqrt(s*l*(o-l)/o)*(a-o/2<0?-1:1);co(e,t,Math.max(n,Math.floor(t-a*l/o+u)),Math.min(i,Math.floor(t+(o-a)*l/o+u)),r)}const o=e[t];let a=n,s=i;for(fo(e,n,t),r(e[i],o)>0&&fo(e,n,i);a<s;){for(fo(e,a,s),++a,--s;r(e[a],o)<0;)++a;for(;r(e[s],o)>0;)--s}0===r(e[n],o)?fo(e,n,s):(++s,fo(e,s,i)),s<=t&&(n=s+1),t<=s&&(i=s-1)}return e}function fo(e,t,n){const i=e[t];e[t]=e[n],e[n]=i}function ho(e){return null===e?NaN:+e}function po(e,t,n){if(e=Float64Array.from(function*(e,t){if(void 0===t)for(let n of e)null!=n&&(n=+n)>=n&&(yield n);else{let n=-1;for(let i of e)null!=(i=t(i,++n,e))&&(i=+i)>=i&&(yield i)}}(e,n)),(i=e.length)&&!isNaN(t=+t)){if(t<=0||i<2)return so(e);if(t>=1)return ao(e);var i,r=(i-1)*t,o=Math.floor(r),a=ao(co(e,o).subarray(0,o+1));return a+(so(e.subarray(o+1))-a)*(r-o)}}function mo(e,t,n=ho){if((i=e.length)&&!isNaN(t=+t)){if(t<=0||i<2)return+n(e[0],0,e);if(t>=1)return+n(e[i-1],i-1,e);var i,r=(i-1)*t,o=Math.floor(r),a=+n(e[o],o,e);return a+(+n(e[o+1],o+1,e)-a)*(r-o)}}function go(e,t){return po(e,.5,t)}function*yo(e,t){if(null==t)for(let n of e)null!=n&&""!==n&&(n=+n)>=n&&(yield n);else{let n=-1;for(let i of e)i=t(i,++n,e),null!=i&&""!==i&&(i=+i)>=i&&(yield i)}}function vo(e,t,n){const i=Float64Array.from(yo(e,n));return i.sort(qe),t.map((e=>mo(i,e)))}function bo(e,t){return vo(e,[.25,.5,.75],t)}function xo(e,t){const n=e.length,i=function(e,t){const n=function(e,t){let n,i=0,r=0,o=0;if(void 0===t)for(let a of e)null!=a&&(a=+a)>=a&&(n=a-r,r+=n/++i,o+=n*(a-r));else{let a=-1;for(let s of e)null!=(s=t(s,++a,e))&&(s=+s)>=s&&(n=s-r,r+=n/++i,o+=n*(s-r))}if(i>1)return o/(i-1)}(e,t);return n?Math.sqrt(n):n}(e,t),r=bo(e,t),o=(r[2]-r[0])/1.34;return 1.06*(Math.min(i,o)||i||Math.abs(r[0])||1)*Math.pow(n,-.2)}function _o(e){const t=e.maxbins||20,n=e.base||10,i=Math.log(n),r=e.divide||[5,2];let o,a,s,l,u,c,f=e.extent[0],d=e.extent[1];const h=e.span||d-f||Math.abs(f)||1;if(e.step)o=e.step;else if(e.steps){for(l=h/t,u=0,c=e.steps.length;u<c&&e.steps[u]<l;++u);o=e.steps[Math.max(0,u-1)]}else{for(a=Math.ceil(Math.log(t)/i),s=e.minstep||0,o=Math.max(s,Math.pow(n,Math.round(Math.log(h)/i)-a));Math.ceil(h/o)>t;)o*=n;for(u=0,c=r.length;u<c;++u)l=o/r[u],l>=s&&h/l<=t&&(o=l)}l=Math.log(o);const p=l>=0?0:1+~~(-l/i),m=Math.pow(n,-p-1);return(e.nice||void 0===e.nice)&&(l=Math.floor(f/o+m)*o,f=f<l?l-o:l,d=Math.ceil(d/o)*o),{start:f,stop:d===f?f+o:d,step:o}}var wo=Math.random;function ko(e){wo=e}function Eo(e,t,n,i){if(!e.length)return[void 0,void 0];const r=Float64Array.from(yo(e,i)),o=r.length,a=t;let s,l,u,c;for(u=0,c=Array(a);u<a;++u){for(s=0,l=0;l<o;++l)s+=r[~~(wo()*o)];c[u]=s/o}return c.sort(qe),[po(c,n/2),po(c,1-n/2)]}function Do(e,t,n,i){i=i||(e=>e);const r=e.length,o=new Float64Array(r);let a,s=0,l=1,u=i(e[0]),c=u,f=u+t;for(;l<r;++l){if(a=i(e[l]),a>=f){for(c=(u+c)/2;s<l;++s)o[s]=c;f=a+t,u=a}c=a}for(c=(u+c)/2;s<l;++s)o[s]=c;return n?function(e,t){const n=e.length;let i,r,o=0,a=1;for(;e[o]===e[a];)++a;for(;a<n;){for(i=a+1;e[a]===e[i];)++i;if(e[a]-e[a-1]<t){for(r=a+(o+i-a-a>>1);r<a;)e[r++]=e[a];for(;r>a;)e[r--]=e[o]}o=a,a=i}return e}(o,t+t/4):o}function $o(e){return function(){return(e=(1103515245*e+12345)%2147483647)/2147483647}}function Ao(e,t){let n,i,r;null==t&&(t=e,e=0);const o={min(e){return arguments.length?(n=e||0,r=i-n,o):n},max(e){return arguments.length?(i=e||0,r=i-n,o):i},sample:()=>n+Math.floor(r*wo()),pdf:e=>e===Math.floor(e)&&e>=n&&e<i?1/r:0,cdf(e){const t=Math.floor(e);return t<n?0:t>=i?1:(t-n+1)/r},icdf:e=>e>=0&&e<=1?n-1+Math.floor(e*r):NaN};return o.min(e).max(t)}const So=Math.sqrt(2*Math.PI),Mo=Math.SQRT2;let Co=NaN;function Fo(e,t){e=e||0,t=null==t?1:t;let n,i,r=0,o=0;if(Co===Co)r=Co,Co=NaN;else{do{r=2*wo()-1,o=2*wo()-1,n=r*r+o*o}while(0===n||n>1);i=Math.sqrt(-2*Math.log(n)/n),r*=i,Co=o*i}return e+r*t}function Oo(e,t,n){const i=(e-(t||0))/(n=null==n?1:n);return Math.exp(-.5*i*i)/(n*So)}function To(e,t,n){const i=(e-(t=t||0))/(n=null==n?1:n),r=Math.abs(i);let o;if(r>37)o=0;else{const e=Math.exp(-r*r/2);let t;r<7.07106781186547?(t=.0352624965998911*r+.700383064443688,t=t*r+6.37396220353165,t=t*r+33.912866078383,t=t*r+112.079291497871,t=t*r+221.213596169931,t=t*r+220.206867912376,o=e*t,t=.0883883476483184*r+1.75566716318264,t=t*r+16.064177579207,t=t*r+86.7807322029461,t=t*r+296.564248779674,t=t*r+637.333633378831,t=t*r+793.826512519948,t=t*r+440.413735824752,o/=t):(t=r+.65,t=r+4/t,t=r+3/t,t=r+2/t,t=r+1/t,o=e/t/2.506628274631)}return i>0?1-o:o}function No(e,t,n){return e<0||e>1?NaN:(t||0)+(null==n?1:n)*Mo*function(e){let t,n=-Math.log((1-e)*(1+e));n<6.25?(n-=3.125,t=-364441206401782e-35,t=t*n-16850591381820166e-35,t=128584807152564e-32+t*n,t=11157877678025181e-33+t*n,t=t*n-1333171662854621e-31,t=20972767875968562e-33+t*n,t=6637638134358324e-30+t*n,t=t*n-4054566272975207e-29,t=t*n-8151934197605472e-29,t=26335093153082323e-28+t*n,t=t*n-12975133253453532e-27,t=t*n-5415412054294628e-26,t=1.0512122733215323e-9+t*n,t=t*n-4.112633980346984e-9,t=t*n-2.9070369957882005e-8,t=4.2347877827932404e-7+t*n,t=t*n-13654692000834679e-22,t=t*n-13882523362786469e-21,t=.00018673420803405714+t*n,t=t*n-.000740702534166267,t=t*n-.006033670871430149,t=.24015818242558962+t*n,t=1.6536545626831027+t*n):n<16?(n=Math.sqrt(n)-3.25,t=2.2137376921775787e-9,t=9.075656193888539e-8+t*n,t=t*n-2.7517406297064545e-7,t=1.8239629214389228e-8+t*n,t=15027403968909828e-22+t*n,t=t*n-4013867526981546e-21,t=29234449089955446e-22+t*n,t=12475304481671779e-21+t*n,t=t*n-47318229009055734e-21,t=6828485145957318e-20+t*n,t=24031110387097894e-21+t*n,t=t*n-.0003550375203628475,t=.0009532893797373805+t*n,t=t*n-.0016882755560235047,t=.002491442096107851+t*n,t=t*n-.003751208507569241,t=.005370914553590064+t*n,t=1.0052589676941592+t*n,t=3.0838856104922208+t*n):Number.isFinite(n)?(n=Math.sqrt(n)-5,t=-27109920616438573e-27,t=t*n-2.555641816996525e-10,t=1.5076572693500548e-9+t*n,t=t*n-3.789465440126737e-9,t=7.61570120807834e-9+t*n,t=t*n-1.496002662714924e-8,t=2.914795345090108e-8+t*n,t=t*n-6.771199775845234e-8,t=2.2900482228026655e-7+t*n,t=t*n-9.9298272942317e-7,t=4526062597223154e-21+t*n,t=t*n-1968177810553167e-20,t=7599527703001776e-20+t*n,t=t*n-.00021503011930044477,t=t*n-.00013871931833623122,t=1.0103004648645344+t*n,t=4.849906401408584+t*n):t=1/0;return t*e}(2*e-1)}function zo(e,t){let n,i;const r={mean(e){return arguments.length?(n=e||0,r):n},stdev(e){return arguments.length?(i=null==e?1:e,r):i},sample:()=>Fo(n,i),pdf:e=>Oo(e,n,i),cdf:e=>To(e,n,i),icdf:e=>No(e,n,i)};return r.mean(e).stdev(t)}function Ro(e,t){const n=zo();let i=0;const r={data(n){return arguments.length?(e=n,i=n?n.length:0,r.bandwidth(t)):e},bandwidth(n){return arguments.length?(!(t=n)&&e&&(t=xo(e)),r):t},sample:()=>e[~~(wo()*i)]+t*n.sample(),pdf(r){let o=0,a=0;for(;a<i;++a)o+=n.pdf((r-e[a])/t);return o/t/i},cdf(r){let o=0,a=0;for(;a<i;++a)o+=n.cdf((r-e[a])/t);return o/i},icdf(){throw Error("KDE icdf not supported.")}};return r.data(e)}function Po(e,t){return e=e||0,t=null==t?1:t,Math.exp(e+Fo()*t)}function Lo(e,t,n){if(e<=0)return 0;t=t||0,n=null==n?1:n;const i=(Math.log(e)-t)/n;return Math.exp(-.5*i*i)/(n*So*e)}function Uo(e,t,n){return To(Math.log(e),t,n)}function Bo(e,t,n){return Math.exp(No(e,t,n))}function jo(e,t){let n,i;const r={mean(e){return arguments.length?(n=e||0,r):n},stdev(e){return arguments.length?(i=null==e?1:e,r):i},sample:()=>Po(n,i),pdf:e=>Lo(e,n,i),cdf:e=>Uo(e,n,i),icdf:e=>Bo(e,n,i)};return r.mean(e).stdev(t)}function Io(e,t){let n,i=0;const r={weights(e){return arguments.length?(n=function(e){const t=[];let n,r=0;for(n=0;n<i;++n)r+=t[n]=null==e[n]?1:+e[n];for(n=0;n<i;++n)t[n]/=r;return t}(t=e||[]),r):t},distributions(n){return arguments.length?(n?(i=n.length,e=n):(i=0,e=[]),r.weights(t)):e},sample(){const t=wo();let r=e[i-1],o=n[0],a=0;for(;a<i-1;o+=n[++a])if(t<o){r=e[a];break}return r.sample()},pdf(t){let r=0,o=0;for(;o<i;++o)r+=n[o]*e[o].pdf(t);return r},cdf(t){let r=0,o=0;for(;o<i;++o)r+=n[o]*e[o].cdf(t);return r},icdf(){throw Error("Mixture icdf not supported.")}};return r.distributions(e).weights(t)}function qo(e,t){return null==t&&(t=null==e?1:e,e=0),e+(t-e)*wo()}function Wo(e,t,n){return null==n&&(n=null==t?1:t,t=0),e>=t&&e<=n?1/(n-t):0}function Ho(e,t,n){return null==n&&(n=null==t?1:t,t=0),e<t?0:e>n?1:(e-t)/(n-t)}function Xo(e,t,n){return null==n&&(n=null==t?1:t,t=0),e>=0&&e<=1?t+e*(n-t):NaN}function Jo(e,t){let n,i;const r={min(e){return arguments.length?(n=e||0,r):n},max(e){return arguments.length?(i=null==e?1:e,r):i},sample:()=>qo(n,i),pdf:e=>Wo(e,n,i),cdf:e=>Ho(e,n,i),icdf:e=>Xo(e,n,i)};return null==t&&(t=null==e?1:e,e=0),r.min(e).max(t)}function Go(e,t,n){let i=0,r=0;for(const o of e){const e=n(o);null==t(o)||null==e||isNaN(e)||(i+=(e-i)/++r)}return{coef:[i],predict:()=>i,rSquared:0}}function Vo(e,t,n,i){const r=i-e*e,o=Math.abs(r)<1e-24?0:(n-e*t)/r;return[t-o*e,o]}function Yo(e,t,n,i){e=e.filter((e=>{let i=t(e),r=n(e);return null!=i&&(i=+i)>=i&&null!=r&&(r=+r)>=r})),i&&e.sort(((e,n)=>t(e)-t(n)));const r=e.length,o=new Float64Array(r),a=new Float64Array(r);let s,l,u,c=0,f=0,d=0;for(u of e)o[c]=s=+t(u),a[c]=l=+n(u),++c,f+=(s-f)/c,d+=(l-d)/c;for(c=0;c<r;++c)o[c]-=f,a[c]-=d;return[o,a,f,d]}function Ko(e,t,n,i){let r,o,a=-1;for(const s of e)r=t(s),o=n(s),null!=r&&(r=+r)>=r&&null!=o&&(o=+o)>=o&&i(r,o,++a)}function Zo(e,t,n,i,r){let o=0,a=0;return Ko(e,t,n,((e,t)=>{const n=t-r(e),s=t-i;o+=n*n,a+=s*s})),1-o/a}function Qo(e,t,n){let i=0,r=0,o=0,a=0,s=0;Ko(e,t,n,((e,t)=>{++s,i+=(e-i)/s,r+=(t-r)/s,o+=(e*t-o)/s,a+=(e*e-a)/s}));const l=Vo(i,r,o,a),u=e=>l[0]+l[1]*e;return{coef:l,predict:u,rSquared:Zo(e,t,n,r,u)}}function ea(e,t,n){let i=0,r=0,o=0,a=0,s=0;Ko(e,t,n,((e,t)=>{++s,e=Math.log(e),i+=(e-i)/s,r+=(t-r)/s,o+=(e*t-o)/s,a+=(e*e-a)/s}));const l=Vo(i,r,o,a),u=e=>l[0]+l[1]*Math.log(e);return{coef:l,predict:u,rSquared:Zo(e,t,n,r,u)}}function ta(e,t,n){const[i,r,o,a]=Yo(e,t,n);let s,l,u,c=0,f=0,d=0,h=0,p=0;Ko(e,t,n,((e,t)=>{s=i[p++],l=Math.log(t),u=s*t,c+=(t*l-c)/p,f+=(u-f)/p,d+=(u*l-d)/p,h+=(s*u-h)/p}));const[m,g]=Vo(f/a,c/a,d/a,h/a),y=e=>Math.exp(m+g*(e-o));return{coef:[Math.exp(m-g*o),g],predict:y,rSquared:Zo(e,t,n,a,y)}}function na(e,t,n){let i=0,r=0,o=0,a=0,s=0,l=0;Ko(e,t,n,((e,t)=>{const n=Math.log(e),u=Math.log(t);++l,i+=(n-i)/l,r+=(u-r)/l,o+=(n*u-o)/l,a+=(n*n-a)/l,s+=(t-s)/l}));const u=Vo(i,r,o,a),c=e=>u[0]*Math.pow(e,u[1]);return u[0]=Math.exp(u[0]),{coef:u,predict:c,rSquared:Zo(e,t,n,s,c)}}function ia(e,t,n){const[i,r,o,a]=Yo(e,t,n),s=i.length;let l,u,c,f,d=0,h=0,p=0,m=0,g=0;for(l=0;l<s;)u=i[l],c=r[l++],f=u*u,d+=(f-d)/l,h+=(f*u-h)/l,p+=(f*f-p)/l,m+=(u*c-m)/l,g+=(f*c-g)/l;const y=p-d*d,v=d*y-h*h,b=(g*d-m*h)/v,x=(m*y-g*h)/v,_=-b*d,w=e=>b*(e-=o)*e+x*e+_+a;return{coef:[_-x*o+b*o*o+a,x-2*b*o,b],predict:w,rSquared:Zo(e,t,n,a,w)}}function ra(e,t,n,i){if(0===i)return Go(e,t,n);if(1===i)return Qo(e,t,n);if(2===i)return ia(e,t,n);const[r,o,a,s]=Yo(e,t,n),l=r.length,u=[],c=[],f=i+1;let d,h,p,m,g;for(d=0;d<f;++d){for(p=0,m=0;p<l;++p)m+=Math.pow(r[p],d)*o[p];for(u.push(m),g=new Float64Array(f),h=0;h<f;++h){for(p=0,m=0;p<l;++p)m+=Math.pow(r[p],d+h);g[h]=m}c.push(g)}c.push(u);const y=function(e){const t=e.length-1,n=[];let i,r,o,a,s;for(i=0;i<t;++i){for(a=i,r=i+1;r<t;++r)Math.abs(e[i][r])>Math.abs(e[i][a])&&(a=r);for(o=i;o<t+1;++o)s=e[o][i],e[o][i]=e[o][a],e[o][a]=s;for(r=i+1;r<t;++r)for(o=t;o>=i;o--)e[o][r]-=e[o][i]*e[i][r]/e[i][i]}for(r=t-1;r>=0;--r){for(s=0,o=r+1;o<t;++o)s+=e[o][r]*n[o];n[r]=(e[t][r]-s)/e[r][r]}return n}(c),v=e=>{e-=a;let t=s+y[0]+y[1]*e+y[2]*e*e;for(d=3;d<f;++d)t+=y[d]*Math.pow(e,d);return t};return{coef:oa(f,y,-a,s),predict:v,rSquared:Zo(e,t,n,s,v)}}function oa(e,t,n,i){const r=Array(e);let o,a,s,l;for(o=0;o<e;++o)r[o]=0;for(o=e-1;o>=0;--o)for(s=t[o],l=1,r[o]+=s,a=1;a<=o;++a)l*=(o+1-a)/a,r[o-a]+=s*Math.pow(n,a)*l;return r[0]+=i,r}const aa=2,sa=1e-12;function la(e,t,n,i){const[r,o,a,s]=Yo(e,t,n,!0),l=r.length,u=Math.max(2,~~(i*l)),c=new Float64Array(l),f=new Float64Array(l),d=new Float64Array(l).fill(1);for(let h=-1;++h<=aa;){const e=[0,u-1];for(let n=0;n<l;++n){const t=r[n],i=e[0],a=e[1],s=t-r[i]>r[a]-t?i:a;let l=0,u=0,h=0,p=0,m=0;const g=1/Math.abs(r[s]-t||1);for(let e=i;e<=a;++e){const n=r[e],i=o[e],a=ua(Math.abs(t-n)*g)*d[e],s=n*a;l+=a,u+=s,h+=i*a,p+=i*s,m+=n*s}const[y,v]=Vo(u/l,h/l,p/l,m/l);c[n]=y+v*t,f[n]=Math.abs(o[n]-c[n]),ca(r,n+1,e)}if(h===aa)break;const t=go(f);if(Math.abs(t)<sa)break;for(let n,i,r=0;r<l;++r)n=f[r]/(6*t),d[r]=n>=1?sa:(i=1-n*n)*i}return function(e,t,n,i){const r=e.length,o=[];let a,s=0,l=0,u=[];for(;s<r;++s)a=e[s]+n,u[0]===a?u[1]+=(t[s]-u[1])/++l:(l=0,u[1]+=i,u=[a,t[s]],o.push(u));return u[1]+=i,o}(r,c,a,s)}function ua(e){return(e=1-e*e*e)*e*e}function ca(e,t,n){const i=e[t];let r=n[0],o=n[1]+1;if(!(o>=e.length))for(;t>r&&e[o]-i<=i-e[r];)n[0]=++r,n[1]=o,++o}const fa=.5*Math.PI/180;function da(e,t,n,i){n=n||25,i=Math.max(n,i||200);const r=t=>[t,e(t)],o=t[0],a=t[1],s=a-o,l=s/i,u=[r(o)],c=[];if(n===i){for(let e=1;e<i;++e)u.push(r(o+e/n*s));return u.push(r(a)),u}c.push(r(a));for(let m=n;--m>0;)c.push(r(o+m/n*s));let f=u[0],d=c[c.length-1];const h=1/s,p=function(e,t){let n=e,i=e;const r=t.length;for(let o=0;o<r;++o){const e=t[o][1];e<n&&(n=e),e>i&&(i=e)}return 1/(i-n)}(f[1],c);for(;d;){const e=r((f[0]+d[0])/2);e[0]-f[0]>=l&&ha(f,e,d,h,p)>fa?c.push(e):(f=d,u.push(d),c.pop()),d=c[c.length-1]}return u}function ha(e,t,n,i,r){const o=Math.atan2(r*(n[1]-e[1]),i*(n[0]-e[0])),a=Math.atan2(r*(t[1]-e[1]),i*(t[0]-e[0]));return Math.abs(o-a)}function pa(e,t,n){e=+e,t=+t,n=(r=arguments.length)<2?(t=e,e=0,1):r<3?1:+n;for(var i=-1,r=0|Math.max(0,Math.ceil((t-e)/n)),o=new Array(r);++i<r;)o[i]=e+i*n;return o}function ma(e){return e&&e.length?1===e.length?e[0]:(t=e,e=>{const n=t.length;let i=1,r=String(t[0](e));for(;i<n;++i)r+="|"+t[i](e);return r}):function(){return""};var t}function ga(e,t,n){return n||e+(t?"_"+t:"")}const ya=()=>{},va={init:ya,add:ya,rem:ya,idx:0},ba={values:{init:e=>e.cell.store=!0,value:e=>e.cell.data.values(),idx:-1},count:{value:e=>e.cell.num},__count__:{value:e=>e.missing+e.valid},missing:{value:e=>e.missing},valid:{value:e=>e.valid},sum:{init:e=>e.sum=0,value:e=>e.valid?e.sum:void 0,add:(e,t)=>e.sum+=+t,rem:(e,t)=>e.sum-=t},product:{init:e=>e.product=1,value:e=>e.valid?e.product:void 0,add:(e,t)=>e.product*=t,rem:(e,t)=>e.product/=t},mean:{init:e=>e.mean=0,value:e=>e.valid?e.mean:void 0,add:(e,t)=>(e.mean_d=t-e.mean,e.mean+=e.mean_d/e.valid),rem:(e,t)=>(e.mean_d=t-e.mean,e.mean-=e.valid?e.mean_d/e.valid:e.mean)},average:{value:e=>e.valid?e.mean:void 0,req:["mean"],idx:1},variance:{init:e=>e.dev=0,value:e=>e.valid>1?e.dev/(e.valid-1):void 0,add:(e,t)=>e.dev+=e.mean_d*(t-e.mean),rem:(e,t)=>e.dev-=e.mean_d*(t-e.mean),req:["mean"],idx:1},variancep:{value:e=>e.valid>1?e.dev/e.valid:void 0,req:["variance"],idx:2},stdev:{value:e=>e.valid>1?Math.sqrt(e.dev/(e.valid-1)):void 0,req:["variance"],idx:2},stdevp:{value:e=>e.valid>1?Math.sqrt(e.dev/e.valid):void 0,req:["variance"],idx:2},stderr:{value:e=>e.valid>1?Math.sqrt(e.dev/(e.valid*(e.valid-1))):void 0,req:["variance"],idx:2},distinct:{value:e=>e.cell.data.distinct(e.get),req:["values"],idx:3},ci0:{value:e=>e.cell.data.ci0(e.get),req:["values"],idx:3},ci1:{value:e=>e.cell.data.ci1(e.get),req:["values"],idx:3},median:{value:e=>e.cell.data.q2(e.get),req:["values"],idx:3},q1:{value:e=>e.cell.data.q1(e.get),req:["values"],idx:3},q3:{value:e=>e.cell.data.q3(e.get),req:["values"],idx:3},min:{init:e=>e.min=void 0,value:e=>e.min=Number.isNaN(e.min)?e.cell.data.min(e.get):e.min,add:(e,t)=>{(t<e.min||void 0===e.min)&&(e.min=t)},rem:(e,t)=>{t<=e.min&&(e.min=NaN)},req:["values"],idx:4},max:{init:e=>e.max=void 0,value:e=>e.max=Number.isNaN(e.max)?e.cell.data.max(e.get):e.max,add:(e,t)=>{(t>e.max||void 0===e.max)&&(e.max=t)},rem:(e,t)=>{t>=e.max&&(e.max=NaN)},req:["values"],idx:4},argmin:{init:e=>e.argmin=void 0,value:e=>e.argmin||e.cell.data.argmin(e.get),add:(e,t,n)=>{t<e.min&&(e.argmin=n)},rem:(e,t)=>{t<=e.min&&(e.argmin=void 0)},req:["min","values"],idx:3},argmax:{init:e=>e.argmax=void 0,value:e=>e.argmax||e.cell.data.argmax(e.get),add:(e,t,n)=>{t>e.max&&(e.argmax=n)},rem:(e,t)=>{t>=e.max&&(e.argmax=void 0)},req:["max","values"],idx:3},exponential:{init:(e,t)=>{e.exp=0,e.exp_r=t},value:e=>e.valid?e.exp*(1-e.exp_r)/(1-e.exp_r**e.valid):void 0,add:(e,t)=>e.exp=e.exp_r*e.exp+t,rem:(e,t)=>e.exp=(e.exp-t/e.exp_r**(e.valid-1))/e.exp_r},exponentialb:{value:e=>e.valid?e.exp*(1-e.exp_r):void 0,req:["exponential"],idx:1}},xa=Object.keys(ba).filter((e=>"__count__"!==e));function _a(e,t,n){return ba[e](n,t)}function wa(e,t){return e.idx-t.idx}function ka(){this.valid=0,this.missing=0,this._ops.forEach((e=>null==e.aggregate_param?e.init(this):e.init(this,e.aggregate_param)))}function Ea(e,t){null!=e&&""!==e?e===e&&(++this.valid,this._ops.forEach((n=>n.add(this,e,t)))):++this.missing}function Da(e,t){null!=e&&""!==e?e===e&&(--this.valid,this._ops.forEach((n=>n.rem(this,e,t)))):--this.missing}function $a(e){return this._out.forEach((t=>e[t.out]=t.value(this))),e}function Aa(e,t){const n=t||m.yR,i=function(e){const t={};e.forEach((e=>t[e.name]=e));const n=e=>{e.req&&e.req.forEach((e=>{t[e]||n(t[e]=ba[e]())}))};return e.forEach(n),Object.values(t).sort(wa)}(e),r=e.slice().sort(wa);function o(e){this._ops=i,this._out=r,this.cell=e,this.init()}return o.prototype.init=ka,o.prototype.add=Ea,o.prototype.rem=Da,o.prototype.set=$a,o.prototype.get=n,o.fields=e.map((e=>e.out)),o}function Sa(e){this._key=e?(0,m.EP)(e):kr,this.reset()}[...xa,"__count__"].forEach((e=>{ba[e]=function(e,t){return(n,i)=>(0,m.l7)({name:e,aggregate_param:i,out:n||e},va,t)}(e,ba[e])}));const Ma=Sa.prototype;function Ca(e){no.call(this,null,e),this._adds=[],this._mods=[],this._alen=0,this._mlen=0,this._drop=!0,this._cross=!1,this._dims=[],this._dnames=[],this._measures=[],this._countOnly=!1,this._counts=null,this._prev=null,this._inputs=null,this._outputs=null}Ma.reset=function(){this._add=[],this._rem=[],this._ext=null,this._get=null,this._q=null},Ma.add=function(e){this._add.push(e)},Ma.rem=function(e){this._rem.push(e)},Ma.values=function(){if(this._get=null,0===this._rem.length)return this._add;const e=this._add,t=this._rem,n=this._key,i=e.length,r=t.length,o=Array(i-r),a={};let s,l,u;for(s=0;s<r;++s)a[n(t[s])]=1;for(s=0,l=0;s<i;++s)a[n(u=e[s])]?a[n(u)]=0:o[l++]=u;return this._rem=[],this._add=o},Ma.distinct=function(e){const t=this.values(),n={};let i,r=t.length,o=0;for(;--r>=0;)i=e(t[r])+"",(0,m.nr)(n,i)||(n[i]=1,++o);return o},Ma.extent=function(e){if(this._get!==e||!this._ext){const t=this.values(),n=(0,m.dI)(t,e);this._ext=[t[n[0]],t[n[1]]],this._get=e}return this._ext},Ma.argmin=function(e){return this.extent(e)[0]||{}},Ma.argmax=function(e){return this.extent(e)[1]||{}},Ma.min=function(e){const t=this.extent(e)[0];return null!=t?e(t):void 0},Ma.max=function(e){const t=this.extent(e)[1];return null!=t?e(t):void 0},Ma.quartile=function(e){return this._get===e&&this._q||(this._q=bo(this.values(),e),this._get=e),this._q},Ma.q1=function(e){return this.quartile(e)[0]},Ma.q2=function(e){return this.quartile(e)[1]},Ma.q3=function(e){return this.quartile(e)[2]},Ma.ci=function(e){return this._get===e&&this._ci||(this._ci=Eo(this.values(),1e3,.05,e),this._get=e),this._ci},Ma.ci0=function(e){return this.ci(e)[0]},Ma.ci1=function(e){return this.ci(e)[1]},Ca.Definition={type:"Aggregate",metadata:{generates:!0,changes:!0},params:[{name:"groupby",type:"field",array:!0},{name:"ops",type:"enum",array:!0,values:xa},{name:"aggregate_params",type:"number",null:!0,array:!0},{name:"fields",type:"field",null:!0,array:!0},{name:"as",type:"string",null:!0,array:!0},{name:"drop",type:"boolean",default:!0},{name:"cross",type:"boolean",default:!1},{name:"key",type:"field"}]},(0,m.XW)(Ca,no,{transform(e,t){const n=this,i=t.fork(t.NO_SOURCE|t.NO_FIELDS),r=e.modified();return n.stamp=i.stamp,n.value&&(r||t.modified(n._inputs,!0))?(n._prev=n.value,n.value=r?n.init(e):Object.create(null),t.visit(t.SOURCE,(e=>n.add(e)))):(n.value=n.value||n.init(e),t.visit(t.REM,(e=>n.rem(e))),t.visit(t.ADD,(e=>n.add(e)))),i.modifies(n._outputs),n._drop=!1!==e.drop,e.cross&&n._dims.length>1&&(n._drop=!1,n.cross()),t.clean()&&n._drop&&i.clean(!0).runAfter((()=>this.clean())),n.changes(i)},cross(){const e=this,t=e.value,n=e._dnames,i=n.map((()=>({}))),r=n.length;function o(e){let t,o,a,s;for(t in e)for(a=e[t].tuple,o=0;o<r;++o)i[o][s=a[n[o]]]=s}o(e._prev),o(t),function o(a,s,l){const u=n[l],c=i[l++];for(const n in c){const i=a?a+"|"+n:n;s[u]=c[n],l<r?o(i,s,l):t[i]||e.cell(i,s)}}("",{},0)},init(e){const t=this._inputs=[],n=this._outputs=[],i={};function r(e){const n=(0,m.IX)((0,m.Oj)(e)),r=n.length;let o,a=0;for(;a<r;++a)i[o=n[a]]||(i[o]=1,t.push(o))}this._dims=(0,m.IX)(e.groupby),this._dnames=this._dims.map((e=>{const t=(0,m.el)(e);return r(e),n.push(t),t})),this.cellkey=e.key?e.key:ma(this._dims),this._countOnly=!0,this._counts=[],this._measures=[];const o=e.fields||[null],a=e.ops||["count"],s=e.aggregate_params||[null],l=e.as||[],u=o.length,c={};let f,d,h,p,g,y,v;for(u!==a.length&&(0,m.vU)("Unmatched number of fields and aggregate ops."),v=0;v<u;++v)f=o[v],d=a[v],h=s[v]||null,null==f&&"count"!==d&&(0,m.vU)("Null aggregate field specified."),g=(0,m.el)(f),y=ga(d,g,l[v]),n.push(y),"count"!==d?(p=c[g],p||(r(f),p=c[g]=[],p.field=f,this._measures.push(p)),"count"!==d&&(this._countOnly=!1),p.push(_a(d,h,y))):this._counts.push(y);return this._measures=this._measures.map((e=>Aa(e,e.field))),Object.create(null)},cellkey:ma(),cell(e,t){let n=this.value[e];return n?0===n.num&&this._drop&&n.stamp<this.stamp?(n.stamp=this.stamp,this._adds[this._alen++]=n):n.stamp<this.stamp&&(n.stamp=this.stamp,this._mods[this._mlen++]=n):(n=this.value[e]=this.newcell(e,t),this._adds[this._alen++]=n),n},newcell(e,t){const n={key:e,num:0,agg:null,tuple:this.newtuple(t,this._prev&&this._prev[e]),stamp:this.stamp,store:!1};if(!this._countOnly){const e=this._measures,t=e.length;n.agg=Array(t);for(let i=0;i<t;++i)n.agg[i]=new e[i](n)}return n.store&&(n.data=new Sa),n},newtuple(e,t){const n=this._dnames,i=this._dims,r=i.length,o={};for(let a=0;a<r;++a)o[n[a]]=i[a](e);return t?Sr(t.tuple,o):Dr(o)},clean(){const e=this.value;for(const t in e)0===e[t].num&&delete e[t]},add(e){const t=this.cellkey(e),n=this.cell(t,e);if(n.num+=1,this._countOnly)return;n.store&&n.data.add(e);const i=n.agg;for(let r=0,o=i.length;r<o;++r)i[r].add(i[r].get(e),e)},rem(e){const t=this.cellkey(e),n=this.cell(t,e);if(n.num-=1,this._countOnly)return;n.store&&n.data.rem(e);const i=n.agg;for(let r=0,o=i.length;r<o;++r)i[r].rem(i[r].get(e),e)},celltuple(e){const t=e.tuple,n=this._counts;e.store&&e.data.values();for(let i=0,r=n.length;i<r;++i)t[n[i]]=e.num;if(!this._countOnly){const n=e.agg;for(let e=0,i=n.length;e<i;++e)n[e].set(t)}return t},changes(e){const t=this._adds,n=this._mods,i=this._prev,r=this._drop,o=e.add,a=e.rem,s=e.mod;let l,u,c,f;if(i)for(u in i)l=i[u],r&&!l.num||a.push(l.tuple);for(c=0,f=this._alen;c<f;++c)o.push(this.celltuple(t[c])),t[c]=null;for(c=0,f=this._mlen;c<f;++c)l=n[c],(0===l.num&&r?a:s).push(this.celltuple(l)),n[c]=null;return this._alen=this._mlen=0,this._prev=null,e}});function Fa(e){no.call(this,null,e)}function Oa(e,t,n){const i=e;let r=t||[],o=n||[],a={},s=0;return{add:e=>o.push(e),remove:e=>a[i(e)]=++s,size:()=>r.length,data:(e,t)=>(s&&(r=r.filter((e=>!a[i(e)])),a={},s=0),t&&e&&r.sort(e),o.length&&(r=e?(0,m.TS)(e,r,o.sort(e)):r.concat(o),o=[]),r)}}function Ta(e){no.call(this,[],e)}function Na(e){Rr.call(this,null,za,e)}function za(e){return this.value&&!e.modified()?this.value:(0,m.qu)(e.fields,e.orders)}function Ra(e){no.call(this,null,e)}function Pa(e){no.call(this,null,e)}Fa.Definition={type:"Bin",metadata:{modifies:!0},params:[{name:"field",type:"field",required:!0},{name:"interval",type:"boolean",default:!0},{name:"anchor",type:"number"},{name:"maxbins",type:"number",default:20},{name:"base",type:"number",default:10},{name:"divide",type:"number",array:!0,default:[5,2]},{name:"extent",type:"number",array:!0,length:2,required:!0},{name:"span",type:"number"},{name:"step",type:"number"},{name:"steps",type:"number",array:!0},{name:"minstep",type:"number",default:0},{name:"nice",type:"boolean",default:!0},{name:"name",type:"string"},{name:"as",type:"string",array:!0,length:2,default:["bin0","bin1"]}]},(0,m.XW)(Fa,no,{transform(e,t){const n=!1!==e.interval,i=this._bins(e),r=i.start,o=i.step,a=e.as||["bin0","bin1"],s=a[0],l=a[1];let u;return u=e.modified()?(t=t.reflow(!0)).SOURCE:t.modified((0,m.Oj)(e.field))?t.ADD_MOD:t.ADD,t.visit(u,n?e=>{const t=i(e);e[s]=t,e[l]=null==t?null:r+o*(1+(t-r)/o)}:e=>e[s]=i(e)),t.modifies(n?a:s)},_bins(e){if(this.value&&!e.modified())return this.value;const t=e.field,n=_o(e),i=n.step;let r,o,a=n.start,s=a+Math.ceil((n.stop-a)/i)*i;null!=(r=e.anchor)&&(o=r-(a+i*Math.floor((r-a)/i)),a+=o,s+=o);const l=function(e){let n=(0,m.He)(t(e));return null==n?null:n<a?-1/0:n>s?1/0:(n=Math.max(a,Math.min(n,s-i)),a+i*Math.floor(1e-14+(n-a)/i))};return l.start=a,l.stop=n.stop,l.step=i,this.value=(0,m.ZE)(l,(0,m.Oj)(t),e.name||"bin_"+(0,m.el)(t))}}),Ta.Definition={type:"Collect",metadata:{source:!0},params:[{name:"sort",type:"compare"}]},(0,m.XW)(Ta,no,{transform(e,t){const n=t.fork(t.ALL),i=Oa(kr,this.value,n.materialize(n.ADD).add),r=e.sort,o=t.changed()||r&&(e.modified("sort")||t.modified(r.fields));return n.visit(n.REM,i.remove),this.modified(o),this.value=n.source=i.data(Mr(r),o),t.source&&t.source.root&&(this.value.root=t.source.root),n}}),(0,m.XW)(Na,Rr),Ra.Definition={type:"CountPattern",metadata:{generates:!0,changes:!0},params:[{name:"field",type:"field",required:!0},{name:"case",type:"enum",values:["upper","lower","mixed"],default:"mixed"},{name:"pattern",type:"string",default:'[\\w"]+'},{name:"stopwords",type:"string",default:""},{name:"as",type:"string",array:!0,length:2,default:["text","count"]}]},(0,m.XW)(Ra,no,{transform(e,t){const n=t=>n=>{for(var i,r=function(e,t,n){switch(t){case"upper":e=e.toUpperCase();break;case"lower":e=e.toLowerCase()}return e.match(n)}(s(n),e.case,o)||[],l=0,u=r.length;l<u;++l)a.test(i=r[l])||t(i)},i=this._parameterCheck(e,t),r=this._counts,o=this._match,a=this._stop,s=e.field,l=e.as||["text","count"],u=n((e=>r[e]=1+(r[e]||0))),c=n((e=>r[e]-=1));return i?t.visit(t.SOURCE,u):(t.visit(t.ADD,u),t.visit(t.REM,c)),this._finish(t,l)},_parameterCheck(e,t){let n=!1;return!e.modified("stopwords")&&this._stop||(this._stop=new RegExp("^"+(e.stopwords||"")+"$","i"),n=!0),!e.modified("pattern")&&this._match||(this._match=new RegExp(e.pattern||"[\\w']+","g"),n=!0),(e.modified("field")||t.modified(e.field.fields))&&(n=!0),n&&(this._counts={}),n},_finish(e,t){const n=this._counts,i=this._tuples||(this._tuples={}),r=t[0],o=t[1],a=e.fork(e.NO_SOURCE|e.NO_FIELDS);let s,l,u;for(s in n)l=i[s],u=n[s]||0,!l&&u?(i[s]=l=Dr({}),l[r]=s,l[o]=u,a.add.push(l)):0===u?(l&&a.rem.push(l),n[s]=null,i[s]=null):l[o]!==u&&(l[o]=u,a.mod.push(l));return a.modifies(t)}}),Pa.Definition={type:"Cross",metadata:{generates:!0},params:[{name:"filter",type:"expr"},{name:"as",type:"string",array:!0,length:2,default:["a","b"]}]},(0,m.XW)(Pa,no,{transform(e,t){const n=t.fork(t.NO_SOURCE),i=e.as||["a","b"],r=i[0],o=i[1],a=!this.value||t.changed(t.ADD_REM)||e.modified("as")||e.modified("filter");let s=this.value;return a?(s&&(n.rem=s),s=t.materialize(t.SOURCE).source,n.add=this.value=function(e,t,n,i){for(var r,o,a=[],s={},l=e.length,u=0;u<l;++u)for(s[t]=o=e[u],r=0;r<l;++r)s[n]=e[r],i(s)&&(a.push(Dr(s)),(s={})[t]=o);return a}(s,r,o,e.filter||m.yb)):n.mod=s,n.source=this.value,n.modifies(i)}});const La={kde:Ro,mixture:Io,normal:zo,lognormal:jo,uniform:Jo},Ua="function";function Ba(e,t){const n=e[Ua];(0,m.nr)(La,n)||(0,m.vU)("Unknown distribution function: "+n);const i=La[n]();for(const r in e)"field"===r?i.data((e.from||t()).map(e[r])):"distributions"===r?i[r](e[r].map((e=>Ba(e,t)))):typeof i[r]===Ua&&i[r](e[r]);return i}function ja(e){no.call(this,null,e)}const Ia=[{key:{function:"normal"},params:[{name:"mean",type:"number",default:0},{name:"stdev",type:"number",default:1}]},{key:{function:"lognormal"},params:[{name:"mean",type:"number",default:0},{name:"stdev",type:"number",default:1}]},{key:{function:"uniform"},params:[{name:"min",type:"number",default:0},{name:"max",type:"number",default:1}]},{key:{function:"kde"},params:[{name:"field",type:"field",required:!0},{name:"from",type:"data"},{name:"bandwidth",type:"number",default:0}]}],qa={key:{function:"mixture"},params:[{name:"distributions",type:"param",array:!0,params:Ia},{name:"weights",type:"number",array:!0}]};function Wa(e,t){return e?e.map(((e,n)=>t[n]||(0,m.el)(e))):null}function Ha(e,t,n){const i=[],r=e=>e(l);let o,a,s,l,u,c;if(null==t)i.push(e.map(n));else for(o={},a=0,s=e.length;a<s;++a)l=e[a],u=t.map(r),c=o[u],c||(o[u]=c=[],c.dims=u,i.push(c)),c.push(n(l));return i}ja.Definition={type:"Density",metadata:{generates:!0},params:[{name:"extent",type:"number",array:!0,length:2},{name:"steps",type:"number"},{name:"minsteps",type:"number",default:25},{name:"maxsteps",type:"number",default:200},{name:"method",type:"string",default:"pdf",values:["pdf","cdf"]},{name:"distribution",type:"param",params:Ia.concat(qa)},{name:"as",type:"string",array:!0,default:["value","density"]}]},(0,m.XW)(ja,no,{transform(e,t){const n=t.fork(t.NO_SOURCE|t.NO_FIELDS);if(!this.value||t.changed()||e.modified()){const i=Ba(e.distribution,function(e){return()=>e.materialize(e.SOURCE).source}(t)),r=e.steps||e.minsteps||25,o=e.steps||e.maxsteps||200;let a=e.method||"pdf";"pdf"!==a&&"cdf"!==a&&(0,m.vU)("Invalid density method: "+a),e.extent||i.data||(0,m.vU)("Missing density extent parameter."),a=i[a];const s=e.as||["value","density"],l=da(a,e.extent||(0,m.We)(i.data()),r,o).map((e=>{const t={};return t[s[0]]=e[0],t[s[1]]=e[1],Dr(t)}));this.value&&(n.rem=this.value),this.value=n.add=n.source=l}return n}});function Xa(e){no.call(this,null,e)}Xa.Definition={type:"DotBin",metadata:{modifies:!0},params:[{name:"field",type:"field",required:!0},{name:"groupby",type:"field",array:!0},{name:"step",type:"number"},{name:"smooth",type:"boolean",default:!1},{name:"as",type:"string",default:"bin"}]};function Ja(e){Rr.call(this,null,Ga,e),this.modified(!0)}function Ga(e){const t=e.expr;return this.value&&!e.modified("expr")?this.value:(0,m.ZE)((n=>t(n,e)),(0,m.Oj)(t),(0,m.el)(t))}function Va(e){no.call(this,[void 0,void 0],e)}function Ya(e,t){Rr.call(this,e),this.parent=t,this.count=0}function Ka(e){no.call(this,{},e),this._keys=(0,m.Xr)();const t=this._targets=[];t.active=0,t.forEach=e=>{for(let n=0,i=t.active;n<i;++n)e(t[n],n,t)}}function Za(e){Rr.call(this,null,Qa,e)}function Qa(e){return this.value&&!e.modified()?this.value:(0,m.kJ)(e.name)?(0,m.IX)(e.name).map((e=>(0,m.EP)(e))):(0,m.EP)(e.name,e.as)}function es(e){no.call(this,(0,m.Xr)(),e)}function ts(e){no.call(this,[],e)}function ns(e){no.call(this,[],e)}function is(e){no.call(this,null,e)}function rs(e){no.call(this,[],e)}(0,m.XW)(Xa,no,{transform(e,t){if(this.value&&!e.modified()&&!t.changed())return t;const n=t.materialize(t.SOURCE).source,i=Ha(t.source,e.groupby,m.yR),r=e.smooth||!1,o=e.field,a=e.step||((e,t)=>(0,m.yP)((0,m.We)(e,t))/30)(n,o),s=Mr(((e,t)=>o(e)-o(t))),l=e.as||"bin",u=i.length;let c,f=1/0,d=-1/0,h=0;for(;h<u;++h){const e=i[h].sort(s);c=-1;for(const t of Do(e,a,r,o))t<f&&(f=t),t>d&&(d=t),e[++c][l]=t}return this.value={start:f,stop:d,step:a},t.reflow(!0).modifies(l)}}),(0,m.XW)(Ja,Rr),Va.Definition={type:"Extent",metadata:{},params:[{name:"field",type:"field",required:!0}]},(0,m.XW)(Va,no,{transform(e,t){const n=this.value,i=e.field,r=t.changed()||t.modified(i.fields)||e.modified("field");let o=n[0],a=n[1];if((r||null==o)&&(o=1/0,a=-1/0),t.visit(r?t.SOURCE:t.ADD,(e=>{const t=(0,m.He)(i(e));null!=t&&(t<o&&(o=t),t>a&&(a=t))})),!Number.isFinite(o)||!Number.isFinite(a)){let e=(0,m.el)(i);e&&(e=` for field "${e}"`),t.dataflow.warn(`Infinite extent${e}: [${o}, ${a}]`),o=a=void 0}this.value=[o,a]}}),(0,m.XW)(Ya,Rr,{connect(e){return this.detachSubflow=e.detachSubflow,this.targets().add(e),e.source=this},add(e){this.count+=1,this.value.add.push(e)},rem(e){this.count-=1,this.value.rem.push(e)},mod(e){this.value.mod.push(e)},init(e){this.value.init(e,e.NO_SOURCE)},evaluate(){return this.value}}),(0,m.XW)(Ka,no,{activate(e){this._targets[this._targets.active++]=e},subflow(e,t,n,i){const r=this.value;let o,a,s=(0,m.nr)(r,e)&&r[e];return s?s.value.stamp<n.stamp&&(s.init(n),this.activate(s)):(a=i||(a=this._group[e])&&a.tuple,o=n.dataflow,s=new Ya(n.fork(n.NO_SOURCE),this),o.add(s).connect(t(o,e,a)),r[e]=s,this.activate(s)),s},clean(){const e=this.value;let t=0;for(const n in e)if(0===e[n].count){const i=e[n].detachSubflow;i&&i(),delete e[n],++t}if(t){const e=this._targets.filter((e=>e&&e.count>0));this.initTargets(e)}},initTargets(e){const t=this._targets,n=t.length,i=e?e.length:0;let r=0;for(;r<i;++r)t[r]=e[r];for(;r<n&&null!=t[r];++r)t[r]=null;t.active=i},transform(e,t){const n=t.dataflow,i=e.key,r=e.subflow,o=this._keys,a=e.modified("key"),s=e=>this.subflow(e,r,t);return this._group=e.group||{},this.initTargets(),t.visit(t.REM,(e=>{const t=kr(e),n=o.get(t);void 0!==n&&(o.delete(t),s(n).rem(e))})),t.visit(t.ADD,(e=>{const t=i(e);o.set(kr(e),t),s(t).add(e)})),a||t.modified(i.fields)?t.visit(t.MOD,(e=>{const t=kr(e),n=o.get(t),r=i(e);n===r?s(r).mod(e):(o.set(t,r),s(n).rem(e),s(r).add(e))})):t.changed(t.MOD)&&t.visit(t.MOD,(e=>{s(o.get(kr(e))).mod(e)})),a&&t.visit(t.REFLOW,(e=>{const t=kr(e),n=o.get(t),r=i(e);n!==r&&(o.set(t,r),s(n).rem(e),s(r).add(e))})),t.clean()?n.runAfter((()=>{this.clean(),o.clean()})):o.empty>n.cleanThreshold&&n.runAfter(o.clean),t}}),(0,m.XW)(Za,Rr),es.Definition={type:"Filter",metadata:{changes:!0},params:[{name:"expr",type:"expr",required:!0}]},(0,m.XW)(es,no,{transform(e,t){const n=t.dataflow,i=this.value,r=t.fork(),o=r.add,a=r.rem,s=r.mod,l=e.expr;let u=!0;function c(t){const n=kr(t),r=l(t,e),c=i.get(n);r&&c?(i.delete(n),o.push(t)):r||c?u&&r&&!c&&s.push(t):(i.set(n,1),a.push(t))}return t.visit(t.REM,(e=>{const t=kr(e);i.has(t)?i.delete(t):a.push(e)})),t.visit(t.ADD,(t=>{l(t,e)?o.push(t):i.set(kr(t),1)})),t.visit(t.MOD,c),e.modified()&&(u=!1,t.visit(t.REFLOW,c)),i.empty>n.cleanThreshold&&n.runAfter(i.clean),r}}),ts.Definition={type:"Flatten",metadata:{generates:!0},params:[{name:"fields",type:"field",array:!0,required:!0},{name:"index",type:"string"},{name:"as",type:"string",array:!0}]},(0,m.XW)(ts,no,{transform(e,t){const n=t.fork(t.NO_SOURCE),i=e.fields,r=Wa(i,e.as||[]),o=e.index||null,a=r.length;return n.rem=this.value,t.visit(t.SOURCE,(e=>{const t=i.map((t=>t(e))),s=t.reduce(((e,t)=>Math.max(e,t.length)),0);let l,u,c,f=0;for(;f<s;++f){for(u=$r(e),l=0;l<a;++l)u[r[l]]=null==(c=t[l][f])?null:c;o&&(u[o]=f),n.add.push(u)}})),this.value=n.source=n.add,o&&n.modifies(o),n.modifies(r)}}),ns.Definition={type:"Fold",metadata:{generates:!0},params:[{name:"fields",type:"field",array:!0,required:!0},{name:"as",type:"string",array:!0,length:2,default:["key","value"]}]},(0,m.XW)(ns,no,{transform(e,t){const n=t.fork(t.NO_SOURCE),i=e.fields,r=i.map(m.el),o=e.as||["key","value"],a=o[0],s=o[1],l=i.length;return n.rem=this.value,t.visit(t.SOURCE,(e=>{for(let t,o=0;o<l;++o)t=$r(e),t[a]=r[o],t[s]=i[o](e),n.add.push(t)})),this.value=n.source=n.add,n.modifies(o)}}),is.Definition={type:"Formula",metadata:{modifies:!0},params:[{name:"expr",type:"expr",required:!0},{name:"as",type:"string",required:!0},{name:"initonly",type:"boolean"}]},(0,m.XW)(is,no,{transform(e,t){const n=e.expr,i=e.as,r=e.modified(),o=e.initonly?t.ADD:r?t.SOURCE:t.modified(n.fields)||t.modified(i)?t.ADD_MOD:t.ADD;return r&&(t=t.materialize().reflow(!0)),e.initonly||t.modifies(i),t.visit(o,(t=>t[i]=n(t,e)))}}),(0,m.XW)(rs,no,{transform(e,t){const n=t.fork(t.ALL),i=e.generator;let r,o,a,s=this.value,l=e.size-s.length;if(l>0){for(r=[];--l>=0;)r.push(a=Dr(i(e))),s.push(a);n.add=n.add.length?n.materialize(n.ADD).add.concat(r):r}else o=s.slice(0,-l),n.rem=n.rem.length?n.materialize(n.REM).rem.concat(o):o,s=s.slice(-l);return n.source=this.value=s,n}});const os={value:"value",median:go,mean:function(e,t){let n=0,i=0;if(void 0===t)for(let r of e)null!=r&&(r=+r)>=r&&(++n,i+=r);else{let r=-1;for(let o of e)null!=(o=t(o,++r,e))&&(o=+o)>=o&&(++n,i+=o)}if(n)return i/n},min:so,max:ao},as=[];function ss(e){no.call(this,[],e)}function ls(e){Ca.call(this,e)}function us(e){no.call(this,null,e)}function cs(e){Rr.call(this,null,fs,e)}function fs(e){return this.value&&!e.modified()?this.value:(0,m.Jy)(e.fields,e.flat)}function ds(e){no.call(this,[],e),this._pending=null}function hs(e,t,n){n.forEach(Dr);const i=t.fork(t.NO_FIELDS&t.NO_SOURCE);return i.rem=e.value,e.value=i.source=i.add=n,e._pending=null,i.rem.length&&i.clean(!0),i}function ps(e){no.call(this,{},e)}function ms(e){Rr.call(this,null,gs,e)}function gs(e){if(this.value&&!e.modified())return this.value;const t=e.extents,n=t.length;let i,r,o=1/0,a=-1/0;for(i=0;i<n;++i)r=t[i],r[0]<o&&(o=r[0]),r[1]>a&&(a=r[1]);return[o,a]}function ys(e){Rr.call(this,null,vs,e)}function vs(e){return this.value&&!e.modified()?this.value:e.values.reduce(((e,t)=>e.concat(t)),[])}function bs(e){no.call(this,null,e)}function xs(e){Ca.call(this,e)}function _s(e){Ka.call(this,e)}function ws(e){no.call(this,null,e)}function ks(e){no.call(this,null,e)}function Es(e){no.call(this,null,e)}ss.Definition={type:"Impute",metadata:{changes:!0},params:[{name:"field",type:"field",required:!0},{name:"key",type:"field",required:!0},{name:"keyvals",array:!0},{name:"groupby",type:"field",array:!0},{name:"method",type:"enum",default:"value",values:["value","mean","median","max","min"]},{name:"value",default:0}]},(0,m.XW)(ss,no,{transform(e,t){var n,i,r,o,a,s,l,u,c,f,d=t.fork(t.ALL),h=function(e){var t,n=e.method||os.value;if(null!=os[n])return n===os.value?(t=void 0!==e.value?e.value:0,()=>t):os[n];(0,m.vU)("Unrecognized imputation method: "+n)}(e),p=function(e){const t=e.field;return e=>e?t(e):NaN}(e),g=(0,m.el)(e.field),y=(0,m.el)(e.key),v=(e.groupby||[]).map(m.el),b=function(e,t,n,i){var r,o,a,s,l,u,c,f,d=e=>e(f),h=[],p=i?i.slice():[],m={},g={};for(p.forEach(((e,t)=>m[e]=t+1)),s=0,c=e.length;s<c;++s)u=n(f=e[s]),l=m[u]||(m[u]=p.push(u)),(a=g[o=(r=t?t.map(d):as)+""])||(a=g[o]=[],h.push(a),a.values=r),a[l-1]=f;return h.domain=p,h}(t.source,e.groupby,e.key,e.keyvals),x=[],_=this.value,w=b.domain.length;for(a=0,u=b.length;a<u;++a)for(r=(n=b[a]).values,i=NaN,l=0;l<w;++l)if(null==n[l]){for(o=b.domain[l],f={_impute:!0},s=0,c=r.length;s<c;++s)f[v[s]]=r[s];f[y]=o,f[g]=Number.isNaN(i)?i=h(n,p):i,x.push(Dr(f))}return x.length&&(d.add=d.materialize(d.ADD).add.concat(x)),_.length&&(d.rem=d.materialize(d.REM).rem.concat(_)),this.value=x,d}}),ls.Definition={type:"JoinAggregate",metadata:{modifies:!0},params:[{name:"groupby",type:"field",array:!0},{name:"fields",type:"field",null:!0,array:!0},{name:"ops",type:"enum",array:!0,values:xa},{name:"as",type:"string",null:!0,array:!0},{name:"key",type:"field"}]},(0,m.XW)(ls,Ca,{transform(e,t){const n=this,i=e.modified();let r;return n.value&&(i||t.modified(n._inputs,!0))?(r=n.value=i?n.init(e):{},t.visit(t.SOURCE,(e=>n.add(e)))):(r=n.value=n.value||this.init(e),t.visit(t.REM,(e=>n.rem(e))),t.visit(t.ADD,(e=>n.add(e)))),n.changes(),t.visit(t.SOURCE,(e=>{(0,m.l7)(e,r[n.cellkey(e)].tuple)})),t.reflow(i).modifies(this._outputs)},changes(){const e=this._adds,t=this._mods;let n,i;for(n=0,i=this._alen;n<i;++n)this.celltuple(e[n]),e[n]=null;for(n=0,i=this._mlen;n<i;++n)this.celltuple(t[n]),t[n]=null;this._alen=this._mlen=0}}),us.Definition={type:"KDE",metadata:{generates:!0},params:[{name:"groupby",type:"field",array:!0},{name:"field",type:"field",required:!0},{name:"cumulative",type:"boolean",default:!1},{name:"counts",type:"boolean",default:!1},{name:"bandwidth",type:"number",default:0},{name:"extent",type:"number",array:!0,length:2},{name:"resolve",type:"enum",values:["shared","independent"],default:"independent"},{name:"steps",type:"number"},{name:"minsteps",type:"number",default:25},{name:"maxsteps",type:"number",default:200},{name:"as",type:"string",array:!0,default:["value","density"]}]},(0,m.XW)(us,no,{transform(e,t){const n=t.fork(t.NO_SOURCE|t.NO_FIELDS);if(!this.value||t.changed()||e.modified()){const i=t.materialize(t.SOURCE).source,r=Ha(i,e.groupby,e.field),o=(e.groupby||[]).map(m.el),a=e.bandwidth,s=e.cumulative?"cdf":"pdf",l=e.as||["value","density"],u=[];let c=e.extent,f=e.steps||e.minsteps||25,d=e.steps||e.maxsteps||200;"pdf"!==s&&"cdf"!==s&&(0,m.vU)("Invalid density method: "+s),"shared"===e.resolve&&(c||(c=(0,m.We)(i,e.field)),f=d=e.steps||d),r.forEach((t=>{const n=Ro(t,a)[s],i=e.counts?t.length:1;da(n,c||(0,m.We)(t),f,d).forEach((e=>{const n={};for(let i=0;i<o.length;++i)n[o[i]]=t.dims[i];n[l[0]]=e[0],n[l[1]]=e[1]*i,u.push(Dr(n))}))})),this.value&&(n.rem=this.value),this.value=n.add=n.source=u}return n}}),(0,m.XW)(cs,Rr),(0,m.XW)(ds,no,{transform(e,t){const n=t.dataflow;if(this._pending)return hs(this,t,this._pending);if(function(e){return e.modified("async")&&!(e.modified("values")||e.modified("url")||e.modified("format"))}(e))return t.StopPropagation;if(e.values)return hs(this,t,n.parse(e.values,e.format));if(e.async){const t=n.request(e.url,e.format).then((e=>(this._pending=(0,m.IX)(e.data),e=>e.touch(this))));return{async:t}}return n.request(e.url,e.format).then((e=>hs(this,t,(0,m.IX)(e.data))))}}),ps.Definition={type:"Lookup",metadata:{modifies:!0},params:[{name:"index",type:"index",params:[{name:"from",type:"data",required:!0},{name:"key",type:"field",required:!0}]},{name:"values",type:"field",array:!0},{name:"fields",type:"field",array:!0,required:!0},{name:"as",type:"string",array:!0},{name:"default",default:null}]},(0,m.XW)(ps,no,{transform(e,t){const n=e.fields,i=e.index,r=e.values,o=null==e.default?null:e.default,a=e.modified(),s=n.length;let l,u,c,f=a?t.SOURCE:t.ADD,d=t,h=e.as;return r?(u=r.length,s>1&&!h&&(0,m.vU)('Multi-field lookup requires explicit "as" parameter.'),h&&h.length!==s*u&&(0,m.vU)('The "as" parameter has too few output field names.'),h=h||r.map(m.el),l=function(e){for(var t,a,l=0,c=0;l<s;++l)if(null==(a=i.get(n[l](e))))for(t=0;t<u;++t,++c)e[h[c]]=o;else for(t=0;t<u;++t,++c)e[h[c]]=r[t](a)}):(h||(0,m.vU)("Missing output field names."),l=function(e){for(var t,r=0;r<s;++r)t=i.get(n[r](e)),e[h[r]]=null==t?o:t}),a?d=t.reflow(!0):(c=n.some((e=>t.modified(e.fields))),f|=c?t.MOD:0),t.visit(f,l),d.modifies(h)}}),(0,m.XW)(ms,Rr),(0,m.XW)(ys,Rr),(0,m.XW)(bs,no,{transform(e,t){return this.modified(e.modified()),this.value=e,t.fork(t.NO_SOURCE|t.NO_FIELDS)}}),xs.Definition={type:"Pivot",metadata:{generates:!0,changes:!0},params:[{name:"groupby",type:"field",array:!0},{name:"field",type:"field",required:!0},{name:"value",type:"field",required:!0},{name:"op",type:"enum",values:xa,default:"sum"},{name:"limit",type:"number",default:0},{name:"key",type:"field"}]},(0,m.XW)(xs,Ca,{_transform:Ca.prototype.transform,transform(e,t){return this._transform(function(e,t){const n=e.field,i=e.value,r=("count"===e.op?"__count__":e.op)||"sum",o=(0,m.Oj)(n).concat((0,m.Oj)(i)),a=function(e,t,n){const i={},r=[];return n.visit(n.SOURCE,(t=>{const n=e(t);i[n]||(i[n]=1,r.push(n))})),r.sort(m.j2),t?r.slice(0,t):r}(n,e.limit||0,t);t.changed()&&e.set("__pivot__",null,null,!0);return{key:e.key,groupby:e.groupby,ops:a.map((()=>r)),fields:a.map((e=>function(e,t,n,i){return(0,m.ZE)((i=>t(i)===e?n(i):NaN),i,e+"")}(e,n,i,o))),as:a.map((e=>e+"")),modified:e.modified.bind(e)}}(e,t),t)}}),(0,m.XW)(_s,Ka,{transform(e,t){const n=e.subflow,i=e.field,r=e=>this.subflow(kr(e),n,t,e);return(e.modified("field")||i&&t.modified((0,m.Oj)(i)))&&(0,m.vU)("PreFacet does not support field modification."),this.initTargets(),i?(t.visit(t.MOD,(e=>{const t=r(e);i(e).forEach((e=>t.mod(e)))})),t.visit(t.ADD,(e=>{const t=r(e);i(e).forEach((e=>t.add(Dr(e))))})),t.visit(t.REM,(e=>{const t=r(e);i(e).forEach((e=>t.rem(e)))}))):(t.visit(t.MOD,(e=>r(e).mod(e))),t.visit(t.ADD,(e=>r(e).add(e))),t.visit(t.REM,(e=>r(e).rem(e)))),t.clean()&&t.runAfter((()=>this.clean())),t}}),ws.Definition={type:"Project",metadata:{generates:!0,changes:!0},params:[{name:"fields",type:"field",array:!0},{name:"as",type:"string",null:!0,array:!0}]},(0,m.XW)(ws,no,{transform(e,t){const n=t.fork(t.NO_SOURCE),i=e.fields,r=Wa(e.fields,e.as||[]),o=i?(e,t)=>function(e,t,n,i){for(let r=0,o=n.length;r<o;++r)t[i[r]]=n[r](e);return t}(e,t,i,r):Ar;let a;return this.value?a=this.value:(t=t.addAll(),a=this.value={}),t.visit(t.REM,(e=>{const t=kr(e);n.rem.push(a[t]),a[t]=null})),t.visit(t.ADD,(e=>{const t=o(e,Dr({}));a[kr(e)]=t,n.add.push(t)})),t.visit(t.MOD,(e=>{n.mod.push(o(e,a[kr(e)]))})),n}}),(0,m.XW)(ks,no,{transform(e,t){return this.value=e.value,e.modified("value")?t.fork(t.NO_SOURCE|t.NO_FIELDS):t.StopPropagation}}),Es.Definition={type:"Quantile",metadata:{generates:!0,changes:!0},params:[{name:"groupby",type:"field",array:!0},{name:"field",type:"field",required:!0},{name:"probs",type:"number",array:!0},{name:"step",type:"number",default:.01},{name:"as",type:"string",array:!0,default:["prob","value"]}]};function Ds(e){no.call(this,null,e)}function $s(e){no.call(this,[],e),this.count=0}function As(e){no.call(this,null,e)}function Ss(e){no.call(this,null,e),this.modified(!0)}function Ms(e){no.call(this,null,e)}(0,m.XW)(Es,no,{transform(e,t){const n=t.fork(t.NO_SOURCE|t.NO_FIELDS),i=e.as||["prob","value"];if(this.value&&!e.modified()&&!t.changed())return n.source=this.value,n;const r=Ha(t.materialize(t.SOURCE).source,e.groupby,e.field),o=(e.groupby||[]).map(m.el),a=[],s=e.step||.01,l=e.probs||pa(s/2,1-1e-14,s),u=l.length;return r.forEach((e=>{const t=vo(e,l);for(let n=0;n<u;++n){const r={};for(let t=0;t<o.length;++t)r[o[t]]=e.dims[t];r[i[0]]=l[n],r[i[1]]=t[n],a.push(Dr(r))}})),this.value&&(n.rem=this.value),this.value=n.add=n.source=a,n}}),(0,m.XW)(Ds,no,{transform(e,t){let n,i;return this.value?i=this.value:(n=t=t.addAll(),i=this.value={}),e.derive&&(n=t.fork(t.NO_SOURCE),t.visit(t.REM,(e=>{const t=kr(e);n.rem.push(i[t]),i[t]=null})),t.visit(t.ADD,(e=>{const t=$r(e);i[kr(e)]=t,n.add.push(t)})),t.visit(t.MOD,(e=>{const t=i[kr(e)];for(const i in e)t[i]=e[i],n.modifies(i);n.mod.push(t)}))),n}}),$s.Definition={type:"Sample",metadata:{},params:[{name:"size",type:"number",default:1e3}]},(0,m.XW)($s,no,{transform(e,t){const n=t.fork(t.NO_SOURCE),i=e.modified("size"),r=e.size,o=this.value.reduce(((e,t)=>(e[kr(t)]=1,e)),{});let a=this.value,s=this.count,l=0;function u(e){let t,i;a.length<r?a.push(e):(i=~~((s+1)*wo()),i<a.length&&i>=l&&(t=a[i],o[kr(t)]&&n.rem.push(t),a[i]=e)),++s}if(t.rem.length&&(t.visit(t.REM,(e=>{const t=kr(e);o[t]&&(o[t]=-1,n.rem.push(e)),--s})),a=a.filter((e=>-1!==o[kr(e)]))),(t.rem.length||i)&&a.length<r&&t.source&&(l=s=a.length,t.visit(t.SOURCE,(e=>{o[kr(e)]||u(e)})),l=-1),i&&a.length>r){const e=a.length-r;for(let t=0;t<e;++t)o[kr(a[t])]=-1,n.rem.push(a[t]);a=a.slice(e)}return t.mod.length&&t.visit(t.MOD,(e=>{o[kr(e)]&&n.mod.push(e)})),t.add.length&&t.visit(t.ADD,u),(t.add.length||l<0)&&(n.add=a.filter((e=>!o[kr(e)]))),this.count=s,this.value=n.source=a,n}}),As.Definition={type:"Sequence",metadata:{generates:!0,changes:!0},params:[{name:"start",type:"number",required:!0},{name:"stop",type:"number",required:!0},{name:"step",type:"number",default:1},{name:"as",type:"string",default:"data"}]},(0,m.XW)(As,no,{transform(e,t){if(this.value&&!e.modified())return;const n=t.materialize().fork(t.MOD),i=e.as||"data";return n.rem=this.value?t.rem.concat(this.value):t.rem,this.value=pa(e.start,e.stop,e.step||1).map((e=>{const t={};return t[i]=e,Dr(t)})),n.add=t.add.concat(this.value),n}}),(0,m.XW)(Ss,no,{transform(e,t){return this.value=t.source,t.changed()?t.fork(t.NO_SOURCE|t.NO_FIELDS):t.StopPropagation}});const Cs=["unit0","unit1"];function Fs(e){no.call(this,(0,m.Xr)(),e)}function Os(e){no.call(this,null,e)}Ms.Definition={type:"TimeUnit",metadata:{modifies:!0},params:[{name:"field",type:"field",required:!0},{name:"interval",type:"boolean",default:!0},{name:"units",type:"enum",values:rt,array:!0},{name:"step",type:"number",default:1},{name:"maxbins",type:"number",default:40},{name:"extent",type:"date",array:!0},{name:"timezone",type:"enum",default:"local",values:["local","utc"]},{name:"as",type:"string",array:!0,length:2,default:Cs}]},(0,m.XW)(Ms,no,{transform(e,t){const n=e.field,i=!1!==e.interval,r="utc"===e.timezone,o=this._floor(e,t),a=(r?Nt:Tt)(o.unit).offset,s=e.as||Cs,l=s[0],u=s[1],c=o.step;let f=o.start||1/0,d=o.stop||-1/0,h=t.ADD;return(e.modified()||t.changed(t.REM)||t.modified((0,m.Oj)(n)))&&(h=(t=t.reflow(!0)).SOURCE,f=1/0,d=-1/0),t.visit(h,(e=>{const t=n(e);let r,s;null==t?(e[l]=null,i&&(e[u]=null)):(e[l]=r=s=o(t),i&&(e[u]=s=a(r,c)),r<f&&(f=r),s>d&&(d=s))})),o.start=f,o.stop=d,t.modifies(i?s:l)},_floor(e,t){const n="utc"===e.timezone,{units:i,step:r}=e.units?{units:e.units,step:e.step||1}:tn({extent:e.extent||(0,m.We)(t.materialize(t.SOURCE).source,e.field),maxbins:e.maxbins}),o=at(i),a=this.value||{},s=(n?Ct:At)(o,r);return s.unit=(0,m.fj)(o),s.units=o,s.step=r,s.start=a.start,s.stop=a.stop,this.value=s}}),(0,m.XW)(Fs,no,{transform(e,t){const n=t.dataflow,i=e.field,r=this.value,o=e=>r.set(i(e),e);let a=!0;return e.modified("field")||t.modified(i.fields)?(r.clear(),t.visit(t.SOURCE,o)):t.changed()?(t.visit(t.REM,(e=>r.delete(i(e)))),t.visit(t.ADD,o)):a=!1,this.modified(a),r.empty>n.cleanThreshold&&n.runAfter(r.clean),t.fork()}}),(0,m.XW)(Os,no,{transform(e,t){(!this.value||e.modified("field")||e.modified("sort")||t.changed()||e.sort&&t.modified(e.sort.fields))&&(this.value=(e.sort?t.source.slice().sort(Mr(e.sort)):t.source).map(e.field))}});const Ts={row_number:function(){return{next:e=>e.index+1}},rank:function(){let e;return{init:()=>e=1,next:t=>{const n=t.index,i=t.data;return n&&t.compare(i[n-1],i[n])?e=n+1:e}}},dense_rank:function(){let e;return{init:()=>e=1,next:t=>{const n=t.index,i=t.data;return n&&t.compare(i[n-1],i[n])?++e:e}}},percent_rank:function(){const e=Ts.rank(),t=e.next;return{init:e.init,next:e=>(t(e)-1)/(e.data.length-1)}},cume_dist:function(){let e;return{init:()=>e=0,next:t=>{const n=t.data,i=t.compare;let r=t.index;if(e<r){for(;r+1<n.length&&!i(n[r],n[r+1]);)++r;e=r}return(1+e)/n.length}}},ntile:function(e,t){(t=+t)>0||(0,m.vU)("ntile num must be greater than zero.");const n=Ts.cume_dist(),i=n.next;return{init:n.init,next:e=>Math.ceil(t*i(e))}},lag:function(e,t){return t=+t||1,{next:n=>{const i=n.index-t;return i>=0?e(n.data[i]):null}}},lead:function(e,t){return t=+t||1,{next:n=>{const i=n.index+t,r=n.data;return i<r.length?e(r[i]):null}}},first_value:function(e){return{next:t=>e(t.data[t.i0])}},last_value:function(e){return{next:t=>e(t.data[t.i1-1])}},nth_value:function(e,t){return(t=+t)>0||(0,m.vU)("nth_value nth must be greater than zero."),{next:n=>{const i=n.i0+(t-1);return i<n.i1?e(n.data[i]):null}}},prev_value:function(e){let t;return{init:()=>t=null,next:n=>{const i=e(n.data[n.index]);return null!=i?t=i:t}}},next_value:function(e){let t,n;return{init:()=>(t=null,n=-1),next:i=>{const r=i.data;return i.index<=n?t:(n=function(e,t,n){for(let i=t.length;n<i;++n){if(null!=e(t[n]))return n}return-1}(e,r,i.index))<0?(n=r.length,t=null):t=e(r[n])}}}};const Ns=Object.keys(Ts);function zs(e){const t=(0,m.IX)(e.ops),n=(0,m.IX)(e.fields),i=(0,m.IX)(e.params),r=(0,m.IX)(e.aggregate_params),o=(0,m.IX)(e.as),a=this.outputs=[],s=this.windows=[],l={},u={},c=[],f=[];let d=!0;function h(e){(0,m.IX)((0,m.Oj)(e)).forEach((e=>l[e]=1))}h(e.sort),t.forEach(((e,t)=>{const l=n[t],p=i[t],g=r[t]||null,y=(0,m.el)(l),v=ga(e,y,o[t]);if(h(l),a.push(v),(0,m.nr)(Ts,e))s.push(function(e,t,n,i){const r=Ts[e](t,n);return{init:r.init||m.bM,update:function(e,t){t[i]=r.next(e)}}}(e,l,p,v));else{if(null==l&&"count"!==e&&(0,m.vU)("Null aggregate field specified."),"count"===e)return void c.push(v);d=!1;let t=u[y];t||(t=u[y]=[],t.field=l,f.push(t)),t.push(_a(e,g,v))}})),(c.length||f.length)&&(this.cell=function(e,t,n){e=e.map((e=>Aa(e,e.field)));const i={num:0,agg:null,store:!1,count:t};if(!n)for(var r=e.length,o=i.agg=Array(r),a=0;a<r;++a)o[a]=new e[a](i);if(i.store)var s=i.data=new Sa;return i.add=function(e){if(i.num+=1,!n){s&&s.add(e);for(let t=0;t<r;++t)o[t].add(o[t].get(e),e)}},i.rem=function(e){if(i.num-=1,!n){s&&s.rem(e);for(let t=0;t<r;++t)o[t].rem(o[t].get(e),e)}},i.set=function(e){let r,a;for(s&&s.values(),r=0,a=t.length;r<a;++r)e[t[r]]=i.num;if(!n)for(r=0,a=o.length;r<a;++r)o[r].set(e)},i.init=function(){i.num=0,s&&s.reset();for(let e=0;e<r;++e)o[e].init()},i}(f,c,d)),this.inputs=Object.keys(l)}const Rs=zs.prototype;function Ps(e){no.call(this,{},e),this._mlen=0,this._mods=[]}function Ls(e,t,n,i){const r=i.sort,o=r&&!i.ignorePeers,a=i.frame||[null,0],s=e.data(n),l=s.length,u=o?He(r):null,c={i0:0,i1:0,p0:0,p1:0,index:0,data:s,compare:r||(0,m.a9)(-1)};t.init();for(let f=0;f<l;++f)Us(c,a,f,l),o&&Bs(c,u),t.update(c,s[f])}function Us(e,t,n,i){e.p0=e.i0,e.p1=e.i1,e.i0=null==t[0]?0:Math.max(0,n-Math.abs(t[0])),e.i1=null==t[1]?i:Math.min(i,n+Math.abs(t[1])+1),e.index=n}function Bs(e,t){const n=e.i0,i=e.i1-1,r=e.compare,o=e.data,a=o.length-1;n>0&&!r(o[n],o[n-1])&&(e.i0=t.left(o,o[n])),i<a&&!r(o[i],o[i+1])&&(e.i1=t.right(o,o[i]))}function js(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 Is(e){this._context=e}function qs(){}function Ws(e){this._context=e}function Hs(e){this._context=e}function Xs(e,t){this._basis=new Is(e),this._beta=t}Rs.init=function(){this.windows.forEach((e=>e.init())),this.cell&&this.cell.init()},Rs.update=function(e,t){const n=this.cell,i=this.windows,r=e.data,o=i&&i.length;let a;if(n){for(a=e.p0;a<e.i0;++a)n.rem(r[a]);for(a=e.p1;a<e.i1;++a)n.add(r[a]);n.set(t)}for(a=0;a<o;++a)i[a].update(e,t)},Ps.Definition={type:"Window",metadata:{modifies:!0},params:[{name:"sort",type:"compare"},{name:"groupby",type:"field",array:!0},{name:"ops",type:"enum",array:!0,values:Ns.concat(xa)},{name:"params",type:"number",null:!0,array:!0},{name:"aggregate_params",type:"number",null:!0,array:!0},{name:"fields",type:"field",null:!0,array:!0},{name:"as",type:"string",null:!0,array:!0},{name:"frame",type:"number",null:!0,array:!0,length:2,default:[null,0]},{name:"ignorePeers",type:"boolean",default:!1}]},(0,m.XW)(Ps,no,{transform(e,t){this.stamp=t.stamp;const n=e.modified(),i=Mr(e.sort),r=ma(e.groupby),o=e=>this.group(r(e));let a=this.state;a&&!n||(a=this.state=new zs(e)),n||t.modified(a.inputs)?(this.value={},t.visit(t.SOURCE,(e=>o(e).add(e)))):(t.visit(t.REM,(e=>o(e).remove(e))),t.visit(t.ADD,(e=>o(e).add(e))));for(let s=0,l=this._mlen;s<l;++s)Ls(this._mods[s],a,i,e);return this._mlen=0,this._mods=[],t.reflow(n).modifies(a.outputs)},group(e){let t=this.value[e];return t||(t=this.value[e]=Oa(kr),t.stamp=-1),t.stamp<this.stamp&&(t.stamp=this.stamp,this._mods[this._mlen++]=t),t}}),Is.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:js(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&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:js(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}},Ws.prototype={areaStart:qs,areaEnd:qs,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:js(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}},Hs.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||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+e)/6,i=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,i):this._context.moveTo(n,i);break;case 3:this._point=4;default:js(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}},Xs.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var e=this._x,t=this._y,n=e.length-1;if(n>0)for(var i,r=e[0],o=t[0],a=e[n]-r,s=t[n]-o,l=-1;++l<=n;)i=l/n,this._basis.point(this._beta*e[l]+(1-this._beta)*(r+i*a),this._beta*t[l]+(1-this._beta)*(o+i*s));this._x=this._y=null,this._basis.lineEnd()},point:function(e,t){this._x.push(+e),this._y.push(+t)}};const Js=function e(t){function n(e){return 1===t?new Is(e):new Xs(e,t)}return n.beta=function(t){return e(+t)},n}(.85);function Gs(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 Vs(e,t){this._context=e,this._k=(1-t)/6}Vs.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:Gs(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&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:Gs(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}};const Ys=function e(t){function n(e){return new Vs(e,t)}return n.tension=function(t){return e(+t)},n}(0);function Ks(e,t){this._context=e,this._k=(1-t)/6}Ks.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||0!==this._line&&3===this._point)&&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:Gs(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}};const Zs=function e(t){function n(e){return new Ks(e,t)}return n.tension=function(t){return e(+t)},n}(0);function Qs(e,t){this._context=e,this._k=(1-t)/6}Qs.prototype={areaStart:qs,areaEnd:qs,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:Gs(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}};const el=function e(t){function n(e){return new Qs(e,t)}return n.tension=function(t){return e(+t)},n}(0),tl=Math.abs,nl=Math.atan2,il=Math.cos,rl=Math.max,ol=Math.min,al=Math.sin,sl=Math.sqrt,ll=1e-12,ul=Math.PI,cl=ul/2,fl=2*ul;function dl(e){return e>=1?cl:e<=-1?-cl:Math.asin(e)}function hl(e,t,n){var i=e._x1,r=e._y1,o=e._x2,a=e._y2;if(e._l01_a>ll){var s=2*e._l01_2a+3*e._l01_a*e._l12_a+e._l12_2a,l=3*e._l01_a*(e._l01_a+e._l12_a);i=(i*s-e._x0*e._l12_2a+e._x2*e._l01_2a)/l,r=(r*s-e._y0*e._l12_2a+e._y2*e._l01_2a)/l}if(e._l23_a>ll){var u=2*e._l23_2a+3*e._l23_a*e._l12_a+e._l12_2a,c=3*e._l23_a*(e._l23_a+e._l12_a);o=(o*u+e._x1*e._l23_2a-t*e._l12_2a)/c,a=(a*u+e._y1*e._l23_2a-n*e._l12_2a)/c}e._context.bezierCurveTo(i,r,o,a,e._x2,e._y2)}function pl(e,t){this._context=e,this._alpha=t}pl.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||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,i=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+i*i,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3;default:hl(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}};const ml=function e(t){function n(e){return t?new pl(e,t):new Vs(e,0)}return n.alpha=function(t){return e(+t)},n}(.5);function gl(e,t){this._context=e,this._alpha=t}gl.prototype={areaStart:qs,areaEnd:qs,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,i=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+i*i,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:hl(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}};const yl=function e(t){function n(e){return t?new gl(e,t):new Qs(e,0)}return n.alpha=function(t){return e(+t)},n}(.5);function vl(e,t){this._context=e,this._alpha=t}vl.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||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,i=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+i*i,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:hl(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}};const bl=function e(t){function n(e){return t?new vl(e,t):new Ks(e,0)}return n.alpha=function(t){return e(+t)},n}(.5);function xl(e){this._context=e}function _l(e){return new xl(e)}function wl(e){this._context=e}function kl(e){return e<0?-1:1}function El(e,t,n){var i=e._x1-e._x0,r=t-e._x1,o=(e._y1-e._y0)/(i||r<0&&-0),a=(n-e._y1)/(r||i<0&&-0),s=(o*r+a*i)/(i+r);return(kl(o)+kl(a))*Math.min(Math.abs(o),Math.abs(a),.5*Math.abs(s))||0}function Dl(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function $l(e,t,n){var i=e._x0,r=e._y0,o=e._x1,a=e._y1,s=(o-i)/3;e._context.bezierCurveTo(i+s,r+s*t,o-s,a-s*n,o,a)}function Al(e){this._context=e}function Sl(e){this._context=new Ml(e)}function Ml(e){this._context=e}function Cl(e){this._context=e}function Fl(e){var t,n,i=e.length-1,r=new Array(i),o=new Array(i),a=new Array(i);for(r[0]=0,o[0]=2,a[0]=e[0]+2*e[1],t=1;t<i-1;++t)r[t]=1,o[t]=4,a[t]=4*e[t]+2*e[t+1];for(r[i-1]=2,o[i-1]=7,a[i-1]=8*e[i-1]+e[i],t=1;t<i;++t)n=r[t]/o[t-1],o[t]-=n,a[t]-=n*a[t-1];for(r[i-1]=a[i-1]/o[i-1],t=i-2;t>=0;--t)r[t]=(a[t]-r[t+1])/o[t];for(o[i-1]=(e[i]+r[i-1])/2,t=0;t<i-1;++t)o[t]=2*e[t+1]-r[t+1];return[r,o]}function Ol(e,t){this._context=e,this._t=t}function Tl(e){return function(){return e}}xl.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&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)}}},wl.prototype={areaStart:qs,areaEnd:qs,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))}},Al.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:$l(this,this._t0,Dl(this,this._t0))}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(t=+t,(e=+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,$l(this,Dl(this,n=El(this,e,t)),n);break;default:$l(this,this._t0,n=El(this,e,t))}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}},(Sl.prototype=Object.create(Al.prototype)).point=function(e,t){Al.prototype.point.call(this,t,e)},Ml.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,i,r,o){this._context.bezierCurveTo(t,e,i,n,o,r)}},Cl.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]),2===n)this._context.lineTo(e[1],t[1]);else for(var i=Fl(e),r=Fl(t),o=0,a=1;a<n;++o,++a)this._context.bezierCurveTo(i[0][o],r[0][o],i[1][o],r[1][o],e[a],t[a]);(this._line||0!==this._line&&1===n)&&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)}},Ol.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&&2===this._point&&this._context.lineTo(this._x,this._y),(this._line||0!==this._line&&1===this._point)&&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}};const Nl=Math.PI,zl=2*Nl,Rl=1e-6,Pl=zl-Rl;function Ll(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}class Ul{constructor(e){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=null==e?Ll:function(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return Ll;const n=10**t;return function(e){this._+=e[0];for(let t=1,i=e.length;t<i;++t)this._+=Math.round(arguments[t]*n)/n+e[t]}}(e)}moveTo(e,t){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}`}closePath(){null!==this._x1&&(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,i){this._append`Q${+e},${+t},${this._x1=+n},${this._y1=+i}`}bezierCurveTo(e,t,n,i,r,o){this._append`C${+e},${+t},${+n},${+i},${this._x1=+r},${this._y1=+o}`}arcTo(e,t,n,i,r){if(e=+e,t=+t,n=+n,i=+i,(r=+r)<0)throw new Error(`negative radius: ${r}`);let o=this._x1,a=this._y1,s=n-e,l=i-t,u=o-e,c=a-t,f=u*u+c*c;if(null===this._x1)this._append`M${this._x1=e},${this._y1=t}`;else if(f>Rl)if(Math.abs(c*s-l*u)>Rl&&r){let d=n-o,h=i-a,p=s*s+l*l,m=d*d+h*h,g=Math.sqrt(p),y=Math.sqrt(f),v=r*Math.tan((Nl-Math.acos((p+f-m)/(2*g*y)))/2),b=v/y,x=v/g;Math.abs(b-1)>Rl&&this._append`L${e+b*u},${t+b*c}`,this._append`A${r},${r},0,0,${+(c*d>u*h)},${this._x1=e+x*s},${this._y1=t+x*l}`}else this._append`L${this._x1=e},${this._y1=t}`;else;}arc(e,t,n,i,r,o){if(e=+e,t=+t,o=!!o,(n=+n)<0)throw new Error(`negative radius: ${n}`);let a=n*Math.cos(i),s=n*Math.sin(i),l=e+a,u=t+s,c=1^o,f=o?i-r:r-i;null===this._x1?this._append`M${l},${u}`:(Math.abs(this._x1-l)>Rl||Math.abs(this._y1-u)>Rl)&&this._append`L${l},${u}`,n&&(f<0&&(f=f%zl+zl),f>Pl?this._append`A${n},${n},0,1,${c},${e-a},${t-s}A${n},${n},0,1,${c},${this._x1=l},${this._y1=u}`:f>Rl&&this._append`A${n},${n},0,${+(f>=Nl)},${c},${this._x1=e+n*Math.cos(r)},${this._y1=t+n*Math.sin(r)}`)}rect(e,t,n,i){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}h${n=+n}v${+i}h${-n}Z`}toString(){return this._}}function Bl(){return new Ul}function jl(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(null==n)t=null;else{const e=Math.floor(n);if(!(e>=0))throw new RangeError(`invalid digits: ${n}`);t=e}return e},()=>new Ul(t)}function Il(e){return e.innerRadius}function ql(e){return e.outerRadius}function Wl(e){return e.startAngle}function Hl(e){return e.endAngle}function Xl(e){return e&&e.padAngle}function Jl(e,t,n,i,r,o,a){var s=e-n,l=t-i,u=(a?o:-o)/sl(s*s+l*l),c=u*l,f=-u*s,d=e+c,h=t+f,p=n+c,m=i+f,g=(d+p)/2,y=(h+m)/2,v=p-d,b=m-h,x=v*v+b*b,_=r-o,w=d*m-p*h,k=(b<0?-1:1)*sl(rl(0,_*_*x-w*w)),E=(w*b-v*k)/x,D=(-w*v-b*k)/x,$=(w*b+v*k)/x,A=(-w*v+b*k)/x,S=E-g,M=D-y,C=$-g,F=A-y;return S*S+M*M>C*C+F*F&&(E=$,D=A),{cx:E,cy:D,x01:-c,y01:-f,x11:E*(r/_-1),y11:D*(r/_-1)}}Bl.prototype=Ul.prototype;Array.prototype.slice;function Gl(e){return"object"===typeof e&&"length"in e?e:Array.from(e)}function Vl(e){return e[0]}function Yl(e){return e[1]}function Kl(e,t){var n=Tl(!0),i=null,r=_l,o=null,a=jl(s);function s(s){var l,u,c,f=(s=Gl(s)).length,d=!1;for(null==i&&(o=r(c=a())),l=0;l<=f;++l)!(l<f&&n(u=s[l],l,s))===d&&((d=!d)?o.lineStart():o.lineEnd()),d&&o.point(+e(u,l,s),+t(u,l,s));if(c)return o=null,c+""||null}return e="function"===typeof e?e:void 0===e?Vl:Tl(e),t="function"===typeof t?t:void 0===t?Yl:Tl(t),s.x=function(t){return arguments.length?(e="function"===typeof t?t:Tl(+t),s):e},s.y=function(e){return arguments.length?(t="function"===typeof e?e:Tl(+e),s):t},s.defined=function(e){return arguments.length?(n="function"===typeof e?e:Tl(!!e),s):n},s.curve=function(e){return arguments.length?(r=e,null!=i&&(o=r(i)),s):r},s.context=function(e){return arguments.length?(null==e?i=o=null:o=r(i=e),s):i},s}function Zl(e,t,n){var i=null,r=Tl(!0),o=null,a=_l,s=null,l=jl(u);function u(u){var c,f,d,h,p,m=(u=Gl(u)).length,g=!1,y=new Array(m),v=new Array(m);for(null==o&&(s=a(p=l())),c=0;c<=m;++c){if(!(c<m&&r(h=u[c],c,u))===g)if(g=!g)f=c,s.areaStart(),s.lineStart();else{for(s.lineEnd(),s.lineStart(),d=c-1;d>=f;--d)s.point(y[d],v[d]);s.lineEnd(),s.areaEnd()}g&&(y[c]=+e(h,c,u),v[c]=+t(h,c,u),s.point(i?+i(h,c,u):y[c],n?+n(h,c,u):v[c]))}if(p)return s=null,p+""||null}function c(){return Kl().defined(r).curve(a).context(o)}return e="function"===typeof e?e:void 0===e?Vl:Tl(+e),t="function"===typeof t?t:Tl(void 0===t?0:+t),n="function"===typeof n?n:void 0===n?Yl:Tl(+n),u.x=function(t){return arguments.length?(e="function"===typeof t?t:Tl(+t),i=null,u):e},u.x0=function(t){return arguments.length?(e="function"===typeof t?t:Tl(+t),u):e},u.x1=function(e){return arguments.length?(i=null==e?null:"function"===typeof e?e:Tl(+e),u):i},u.y=function(e){return arguments.length?(t="function"===typeof e?e:Tl(+e),n=null,u):t},u.y0=function(e){return arguments.length?(t="function"===typeof e?e:Tl(+e),u):t},u.y1=function(e){return arguments.length?(n=null==e?null:"function"===typeof e?e:Tl(+e),u):n},u.lineX0=u.lineY0=function(){return c().x(e).y(t)},u.lineY1=function(){return c().x(e).y(n)},u.lineX1=function(){return c().x(i).y(t)},u.defined=function(e){return arguments.length?(r="function"===typeof e?e:Tl(!!e),u):r},u.curve=function(e){return arguments.length?(a=e,null!=o&&(s=a(o)),u):a},u.context=function(e){return arguments.length?(null==e?o=s=null:s=a(o=e),u):o},u}sl(3);const Ql={draw(e,t){const n=sl(t/ul);e.moveTo(n,0),e.arc(0,0,n,0,fl)}},eu=(sl(1/3),al(ul/10)/al(7*ul/10));al(fl/10),il(fl/10),sl(3),sl(3),sl(3),sl(12);function tu(e,t){if("undefined"!==typeof document&&document.createElement){const n=document.createElement("canvas");if(n&&n.getContext)return n.width=e,n.height=t,n}return null}const nu=()=>"undefined"!==typeof Image?Image:null,iu=He(qe),ru=iu.right,ou=iu.left,au=(He(ho).center,ru);var su=n(23244),lu=n(58355);function uu(e,t){t||(t=[]);var n,i=e?Math.min(t.length,e.length):0,r=t.slice();return function(o){for(n=0;n<i;++n)r[n]=e[n]*(1-o)+t[n]*o;return r}}function cu(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function fu(e,t){return(cu(t)?uu:du)(e,t)}function du(e,t){var n,i=t?t.length:0,r=e?Math.min(i,e.length):0,o=new Array(r),a=new Array(i);for(n=0;n<r;++n)o[n]=vu(e[n],t[n]);for(;n<i;++n)a[n]=t[n];return function(e){for(n=0;n<r;++n)a[n]=o[n](e);return a}}function hu(e,t){var n=new Date;return e=+e,t=+t,function(i){return n.setTime(e*(1-i)+t*i),n}}var pu=n(96539);function mu(e,t){var n,i={},r={};for(n in null!==e&&"object"===typeof e||(e={}),null!==t&&"object"===typeof t||(t={}),t)n in e?i[n]=vu(e[n],t[n]):r[n]=t[n];return function(e){for(n in i)r[n]=i[n](e);return r}}var gu=n(47135),yu=n(76025);function vu(e,t){var n,i=typeof t;return null==t||"boolean"===i?(0,yu.Z)(t):("number"===i?pu.Z:"string"===i?(n=(0,su.ZP)(t))?(t=n,lu.ZP):gu.Z:t instanceof su.ZP?lu.ZP:t instanceof Date?hu:cu(t)?uu:Array.isArray(t)?du:"function"!==typeof t.valueOf&&"function"!==typeof t.toString||isNaN(t)?mu:pu.Z)(e,t)}function bu(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function xu(e){return+e}var _u=[0,1];function wu(e){return e}function ku(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:function(e){return function(){return e}}(isNaN(t)?NaN:.5)}function Eu(e,t,n){var i=e[0],r=e[1],o=t[0],a=t[1];return r<i?(i=ku(r,i),o=n(a,o)):(i=ku(i,r),o=n(o,a)),function(e){return o(i(e))}}function Du(e,t,n){var i=Math.min(e.length,t.length)-1,r=new Array(i),o=new Array(i),a=-1;for(e[i]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++a<i;)r[a]=ku(e[a],e[a+1]),o[a]=n(t[a],t[a+1]);return function(t){var n=au(e,t,1,i)-1;return o[n](r[n](t))}}function $u(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function Au(){var e,t,n,i,r,o,a=_u,s=_u,l=vu,u=wu;function c(){var e=Math.min(a.length,s.length);return u!==wu&&(u=function(e,t){var n;return e>t&&(n=e,e=t,t=n),function(n){return Math.max(e,Math.min(t,n))}}(a[0],a[e-1])),i=e>2?Du:Eu,r=o=null,f}function f(t){return null==t||isNaN(t=+t)?n:(r||(r=i(a.map(e),s,l)))(e(u(t)))}return f.invert=function(n){return u(t((o||(o=i(s,a.map(e),pu.Z)))(n)))},f.domain=function(e){return arguments.length?(a=Array.from(e,xu),c()):a.slice()},f.range=function(e){return arguments.length?(s=Array.from(e),c()):s.slice()},f.rangeRound=function(e){return s=Array.from(e),l=bu,c()},f.clamp=function(e){return arguments.length?(u=!!e||wu,c()):u!==wu},f.interpolate=function(e){return arguments.length?(l=e,c()):l},f.unknown=function(e){return arguments.length?(n=e,f):n},function(n,i){return e=n,t=i,c()}}function Su(){return Au()(wu,wu)}function Mu(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e)}return this}function Cu(e,t){switch(arguments.length){case 0:break;case 1:"function"===typeof e?this.interpolator(e):this.range(e);break;default:this.domain(e),"function"===typeof t?this.interpolator(t):this.range(t)}return this}function Fu(e,t,n,i){var r,o=U(e,t,n);switch((i=I(null==i?",f":i)).type){case"s":var a=Math.max(Math.abs(e),Math.abs(t));return null!=i.precision||isNaN(r=X(o,a))||(i.precision=r),ee(i,a);case"":case"e":case"g":case"p":case"r":null!=i.precision||isNaN(r=J(o,Math.max(Math.abs(e),Math.abs(t))))||(i.precision=r-("e"===i.type));break;case"f":case"%":null!=i.precision||isNaN(r=G(o))||(i.precision=r-2*("%"===i.type))}return Q(i)}function Ou(e){var t=e.domain;return e.ticks=function(e){var n=t();return P(n[0],n[n.length-1],null==e?10:e)},e.tickFormat=function(e,n){var i=t();return Fu(i[0],i[i.length-1],null==e?10:e,n)},e.nice=function(n){null==n&&(n=10);var i,r,o=t(),a=0,s=o.length-1,l=o[a],u=o[s],c=10;for(u<l&&(r=l,l=u,u=r,r=a,a=s,s=r);c-- >0;){if((r=L(l,u,n))===i)return o[a]=l,o[s]=u,t(o);if(r>0)l=Math.floor(l/r)*r,u=Math.ceil(u/r)*r;else{if(!(r<0))break;l=Math.ceil(l*r)/r,u=Math.floor(u*r)/r}i=r}return e},e}function Tu(e,t){var n,i=0,r=(e=e.slice()).length-1,o=e[i],a=e[r];return a<o&&(n=i,i=r,r=n,n=o,o=a,a=n),e[i]=t.floor(o),e[r]=t.ceil(a),e}function Nu(e){return Math.log(e)}function zu(e){return Math.exp(e)}function Ru(e){return-Math.log(-e)}function Pu(e){return-Math.exp(-e)}function Lu(e){return isFinite(e)?+("1e"+e):e<0?0:e}function Uu(e){return(t,n)=>-e(-t,n)}function Bu(e){const t=e(Nu,zu),n=t.domain;let i,r,o=10;function a(){return i=function(e){return e===Math.E?Math.log:10===e&&Math.log10||2===e&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}(o),r=function(e){return 10===e?Lu:e===Math.E?Math.exp:t=>Math.pow(e,t)}(o),n()[0]<0?(i=Uu(i),r=Uu(r),e(Ru,Pu)):e(Nu,zu),t}return t.base=function(e){return arguments.length?(o=+e,a()):o},t.domain=function(e){return arguments.length?(n(e),a()):n()},t.ticks=e=>{const t=n();let a=t[0],s=t[t.length-1];const l=s<a;l&&([a,s]=[s,a]);let u,c,f=i(a),d=i(s);const h=null==e?10:+e;let p=[];if(!(o%1)&&d-f<h){if(f=Math.floor(f),d=Math.ceil(d),a>0){for(;f<=d;++f)for(u=1;u<o;++u)if(c=f<0?u/r(-f):u*r(f),!(c<a)){if(c>s)break;p.push(c)}}else for(;f<=d;++f)for(u=o-1;u>=1;--u)if(c=f>0?u/r(-f):u*r(f),!(c<a)){if(c>s)break;p.push(c)}2*p.length<h&&(p=P(a,s,h))}else p=P(f,d,Math.min(d-f,h)).map(r);return l?p.reverse():p},t.tickFormat=(e,n)=>{if(null==e&&(e=10),null==n&&(n=10===o?"s":","),"function"!==typeof n&&(o%1||null!=(n=I(n)).precision||(n.trim=!0),n=Q(n)),e===1/0)return n;const a=Math.max(1,o*e/t.ticks().length);return e=>{let t=e/r(Math.round(i(e)));return t*o<o-.5&&(t*=o),t<=a?n(e):""}},t.nice=()=>n(Tu(n(),{floor:e=>r(Math.floor(i(e))),ceil:e=>r(Math.ceil(i(e)))})),t}function ju(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function Iu(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function qu(e){return e<0?-e*e:e*e}function Wu(e){var t=e(wu,wu),n=1;return t.exponent=function(t){return arguments.length?1===(n=+t)?e(wu,wu):.5===n?e(Iu,qu):e(ju(n),ju(1/n)):n},Ou(t)}function Hu(){var e=Wu(Au());return e.copy=function(){return $u(e,Hu()).exponent(e.exponent())},Mu.apply(e,arguments),e}function Xu(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function Ju(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function Gu(e){var t=1,n=e(Xu(t),Ju(t));return n.constant=function(n){return arguments.length?e(Xu(t=+n),Ju(t)):t},Ou(n)}function Vu(e,t,n,i,r,o){const a=[[je,1,se],[je,5,5e3],[je,15,15e3],[je,30,3e4],[o,1,le],[o,5,3e5],[o,15,9e5],[o,30,18e5],[r,1,ue],[r,3,108e5],[r,6,216e5],[r,12,432e5],[i,1,ce],[i,2,1728e5],[n,1,fe],[t,1,de],[t,3,7776e6],[e,1,he]];function s(t,n,i){const r=Math.abs(n-t)/i,o=He((([,,e])=>e)).right(a,r);if(o===a.length)return e.every(U(t/he,n/he,i));if(0===o)return Ie.every(Math.max(U(t,n,i),1));const[s,l]=a[r/a[o-1][2]<a[o][2]/r?o-1:o];return s.every(l)}return[function(e,t,n){const i=t<e;i&&([e,t]=[t,e]);const r=n&&"function"===typeof n.range?n:s(e,t,n),o=r?r.range(e,+t+1):[];return i?o.reverse():o},s]}const[Yu,Ku]=Vu(Ne,Re,$e,ge,Le,Be),[Zu,Qu]=Vu(Te,ze,ve,pe,Pe,Ue);function ec(e){return new Date(e)}function tc(e){return e instanceof Date?+e:+new Date(+e)}function nc(e,t,n,i,r,o,a,s,l,u){var c=Su(),f=c.invert,d=c.domain,h=u(".%L"),p=u(":%S"),m=u("%I:%M"),g=u("%I %p"),y=u("%a %d"),v=u("%b %d"),b=u("%B"),x=u("%Y");function _(e){return(l(e)<e?h:s(e)<e?p:a(e)<e?m:o(e)<e?g:i(e)<e?r(e)<e?y:v:n(e)<e?b:x)(e)}return c.invert=function(e){return new Date(f(e))},c.domain=function(e){return arguments.length?d(Array.from(e,tc)):d().map(ec)},c.ticks=function(t){var n=d();return e(n[0],n[n.length-1],null==t?10:t)},c.tickFormat=function(e,t){return null==t?_:u(t)},c.nice=function(e){var n=d();return e&&"function"===typeof e.range||(e=t(n[0],n[n.length-1],null==e?10:e)),e?d(Tu(n,e)):c},c.copy=function(){return $u(c,nc(e,t,n,i,r,o,a,s,l,u))},c}function ic(){var e,t,n,i,r,o=0,a=1,s=wu,l=!1;function u(t){return null==t||isNaN(t=+t)?r:s(0===n?.5:(t=(i(t)-e)*n,l?Math.max(0,Math.min(1,t)):t))}function c(e){return function(t){var n,i;return arguments.length?([n,i]=t,s=e(n,i),u):[s(0),s(1)]}}return u.domain=function(r){return arguments.length?([o,a]=r,e=i(o=+o),t=i(a=+a),n=e===t?0:1/(t-e),u):[o,a]},u.clamp=function(e){return arguments.length?(l=!!e,u):l},u.interpolator=function(e){return arguments.length?(s=e,u):s},u.range=c(vu),u.rangeRound=c(bu),u.unknown=function(e){return arguments.length?(r=e,u):r},function(r){return i=r,e=r(o),t=r(a),n=e===t?0:1/(t-e),u}}function rc(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function oc(){var e=Ou(ic()(wu));return e.copy=function(){return rc(e,oc())},Cu.apply(e,arguments)}function ac(){var e=Wu(ic());return e.copy=function(){return rc(e,ac()).exponent(e.exponent())},Cu.apply(e,arguments)}function sc(e,t){void 0===t&&(t=e,e=vu);for(var n=0,i=t.length-1,r=t[0],o=new Array(i<0?0:i);n<i;)o[n]=e(r,r=t[++n]);return function(e){var t=Math.max(0,Math.min(i-1,Math.floor(e*=i)));return o[t](e-t)}}function lc(){var e,t,n,i,r,o,a,s=0,l=.5,u=1,c=1,f=wu,d=!1;function h(e){return isNaN(e=+e)?a:(e=.5+((e=+o(e))-t)*(c*e<c*t?i:r),f(d?Math.max(0,Math.min(1,e)):e))}function p(e){return function(t){var n,i,r;return arguments.length?([n,i,r]=t,f=sc(e,[n,i,r]),h):[f(0),f(.5),f(1)]}}return h.domain=function(a){return arguments.length?([s,l,u]=a,e=o(s=+s),t=o(l=+l),n=o(u=+u),i=e===t?0:.5/(t-e),r=t===n?0:.5/(n-t),c=t<e?-1:1,h):[s,l,u]},h.clamp=function(e){return arguments.length?(d=!!e,h):d},h.interpolator=function(e){return arguments.length?(f=e,h):f},h.range=p(vu),h.rangeRound=p(bu),h.unknown=function(e){return arguments.length?(a=e,h):a},function(a){return o=a,e=a(s),t=a(l),n=a(u),i=e===t?0:.5/(t-e),r=t===n?0:.5/(n-t),c=t<e?-1:1,h}}function uc(){var e=Wu(lc());return e.copy=function(){return rc(e,uc()).exponent(e.exponent())},Cu.apply(e,arguments)}class cc extends Map{constructor(e,t=mc){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:t}}),null!=e)for(const[n,i]of e)this.set(n,i)}get(e){return super.get(dc(this,e))}has(e){return super.has(dc(this,e))}set(e,t){return super.set(hc(this,e),t)}delete(e){return super.delete(pc(this,e))}}class fc extends Set{constructor(e,t=mc){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:t}}),null!=e)for(const n of e)this.add(n)}has(e){return super.has(dc(this,e))}add(e){return super.add(hc(this,e))}delete(e){return super.delete(pc(this,e))}}function dc({_intern:e,_key:t},n){const i=t(n);return e.has(i)?e.get(i):n}function hc({_intern:e,_key:t},n){const i=t(n);return e.has(i)?e.get(i):(e.set(i,n),n)}function pc({_intern:e,_key:t},n){const i=t(n);return e.has(i)&&(n=e.get(i),e.delete(i)),n}function mc(e){return null!==e&&"object"===typeof e?e.valueOf():e}const gc=Symbol("implicit");function yc(){var e=new cc,t=[],n=[],i=gc;function r(r){let o=e.get(r);if(void 0===o){if(i!==gc)return i;e.set(r,o=t.push(r)-1)}return n[o%n.length]}return r.domain=function(n){if(!arguments.length)return t.slice();t=[],e=new cc;for(const i of n)e.has(i)||e.set(i,t.push(i)-1);return r},r.range=function(e){return arguments.length?(n=Array.from(e),r):n.slice()},r.unknown=function(e){return arguments.length?(i=e,r):i},r.copy=function(){return yc(t,n).unknown(i)},Mu.apply(r,arguments),r}var vc=n(77256),bc=n(5963);function xc(e){var t=e.length;return function(n){return e[Math.max(0,Math.min(t-1,Math.floor(n*t)))]}}var _c=n(38337);function wc(e,t){var n=(0,_c.wx)(+e,+t);return function(e){var t=n(e);return t-360*Math.floor(t/360)}}var kc=n(64826);function Ec(e){return((e=Math.exp(e))+1/e)/2}const Dc=function e(t,n,i){function r(e,r){var o,a,s=e[0],l=e[1],u=e[2],c=r[0],f=r[1],d=r[2],h=c-s,p=f-l,m=h*h+p*p;if(m<1e-12)a=Math.log(d/u)/t,o=function(e){return[s+e*h,l+e*p,u*Math.exp(t*e*a)]};else{var g=Math.sqrt(m),y=(d*d-u*u+i*m)/(2*u*n*g),v=(d*d-u*u-i*m)/(2*d*n*g),b=Math.log(Math.sqrt(y*y+1)-y),x=Math.log(Math.sqrt(v*v+1)-v);a=(x-b)/t,o=function(e){var i=e*a,r=Ec(b),o=u/(n*g)*(r*function(e){return((e=Math.exp(2*e))-1)/(e+1)}(t*i+b)-function(e){return((e=Math.exp(e))-1/e)/2}(b));return[s+o*h,l+o*p,u*r/Ec(t*i+b)]}}return o.duration=1e3*a*t/Math.SQRT2,o}return r.rho=function(t){var n=Math.max(.001,+t),i=n*n;return e(n,i,i*i)},r}(Math.SQRT2,2,4);function $c(e){return function(t,n){var i=e((t=(0,su.Ym)(t)).h,(n=(0,su.Ym)(n)).h),r=(0,_c.ZP)(t.s,n.s),o=(0,_c.ZP)(t.l,n.l),a=(0,_c.ZP)(t.opacity,n.opacity);return function(e){return t.h=i(e),t.s=r(e),t.l=o(e),t.opacity=a(e),t+""}}}const Ac=$c(_c.wx);var Sc=$c(_c.ZP),Mc=n(28608);const Cc=Math.PI/180,Fc=180/Math.PI,Oc=.96422,Tc=1,Nc=.82521,zc=4/29,Rc=6/29,Pc=3*Rc*Rc,Lc=.008856451679035631;function Uc(e){if(e instanceof jc)return new jc(e.l,e.a,e.b,e.opacity);if(e instanceof Gc)return Vc(e);e instanceof su.Ss||(e=(0,su.SU)(e));var t,n,i=Hc(e.r),r=Hc(e.g),o=Hc(e.b),a=Ic((.2225045*i+.7168786*r+.0606169*o)/Tc);return i===r&&r===o?t=n=a:(t=Ic((.4360747*i+.3850649*r+.1430804*o)/Oc),n=Ic((.0139322*i+.0971045*r+.7141733*o)/Nc)),new jc(116*a-16,500*(t-a),200*(a-n),e.opacity)}function Bc(e,t,n,i){return 1===arguments.length?Uc(e):new jc(e,t,n,null==i?1:i)}function jc(e,t,n,i){this.l=+e,this.a=+t,this.b=+n,this.opacity=+i}function Ic(e){return e>Lc?Math.pow(e,1/3):e/Pc+zc}function qc(e){return e>Rc?e*e*e:Pc*(e-zc)}function Wc(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function Hc(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function Xc(e){if(e instanceof Gc)return new Gc(e.h,e.c,e.l,e.opacity);if(e instanceof jc||(e=Uc(e)),0===e.a&&0===e.b)return new Gc(NaN,0<e.l&&e.l<100?0:NaN,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*Fc;return new Gc(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}function Jc(e,t,n,i){return 1===arguments.length?Xc(e):new Gc(e,t,n,null==i?1:i)}function Gc(e,t,n,i){this.h=+e,this.c=+t,this.l=+n,this.opacity=+i}function Vc(e){if(isNaN(e.h))return new jc(e.l,0,0,e.opacity);var t=e.h*Cc;return new jc(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}function Yc(e,t){var n=(0,_c.ZP)((e=Bc(e)).l,(t=Bc(t)).l),i=(0,_c.ZP)(e.a,t.a),r=(0,_c.ZP)(e.b,t.b),o=(0,_c.ZP)(e.opacity,t.opacity);return function(t){return e.l=n(t),e.a=i(t),e.b=r(t),e.opacity=o(t),e+""}}function Kc(e){return function(t,n){var i=e((t=Jc(t)).h,(n=Jc(n)).h),r=(0,_c.ZP)(t.c,n.c),o=(0,_c.ZP)(t.l,n.l),a=(0,_c.ZP)(t.opacity,n.opacity);return function(e){return t.h=i(e),t.c=r(e),t.l=o(e),t.opacity=a(e),t+""}}}(0,Mc.Z)(jc,Bc,(0,Mc.l)(su.Il,{brighter(e){return new jc(this.l+18*(null==e?1:e),this.a,this.b,this.opacity)},darker(e){return new jc(this.l-18*(null==e?1:e),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=Oc*qc(t),e=Tc*qc(e),n=Nc*qc(n),new su.Ss(Wc(3.1338561*t-1.6168667*e-.4906146*n),Wc(-.9787684*t+1.9161415*e+.033454*n),Wc(.0719453*t-.2289914*e+1.4052427*n),this.opacity)}})),(0,Mc.Z)(Gc,Jc,(0,Mc.l)(su.Il,{brighter(e){return new Gc(this.h,this.c,this.l+18*(null==e?1:e),this.opacity)},darker(e){return new Gc(this.h,this.c,this.l-18*(null==e?1:e),this.opacity)},rgb(){return Vc(this).rgb()}}));const Zc=Kc(_c.wx);var Qc=Kc(_c.ZP),ef=-.14861,tf=1.78277,nf=-.29227,rf=-.90649,of=1.97294,af=of*rf,sf=of*tf,lf=tf*nf-rf*ef;function uf(e,t,n,i){return 1===arguments.length?function(e){if(e instanceof cf)return new cf(e.h,e.s,e.l,e.opacity);e instanceof su.Ss||(e=(0,su.SU)(e));var t=e.r/255,n=e.g/255,i=e.b/255,r=(lf*i+af*t-sf*n)/(lf+af-sf),o=i-r,a=(of*(n-r)-nf*o)/rf,s=Math.sqrt(a*a+o*o)/(of*r*(1-r)),l=s?Math.atan2(a,o)*Fc-120:NaN;return new cf(l<0?l+360:l,s,r,e.opacity)}(e):new cf(e,t,n,null==i?1:i)}function cf(e,t,n,i){this.h=+e,this.s=+t,this.l=+n,this.opacity=+i}function ff(e){return function t(n){function i(t,i){var r=e((t=uf(t)).h,(i=uf(i)).h),o=(0,_c.ZP)(t.s,i.s),a=(0,_c.ZP)(t.l,i.l),s=(0,_c.ZP)(t.opacity,i.opacity);return function(e){return t.h=r(e),t.s=o(e),t.l=a(Math.pow(e,n)),t.opacity=s(e),t+""}}return n=+n,i.gamma=t,i}(1)}(0,Mc.Z)(cf,uf,(0,Mc.l)(su.Il,{brighter(e){return e=null==e?su.J5:Math.pow(su.J5,e),new cf(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?su.xV:Math.pow(su.xV,e),new cf(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=isNaN(this.h)?0:(this.h+120)*Cc,t=+this.l,n=isNaN(this.s)?0:this.s*t*(1-t),i=Math.cos(e),r=Math.sin(e);return new su.Ss(255*(t+n*(ef*i+tf*r)),255*(t+n*(nf*i+rf*r)),255*(t+n*(of*i)),this.opacity)}}));const df=ff(_c.wx);var hf=ff(_c.ZP);function pf(e,t){for(var n=new Array(t),i=0;i<t;++i)n[i]=e(i/(t-1));return n}function mf(e,t,n){const i=e-t+2*n;return e?i>0?i:1:0}const gf="linear",yf="log",vf="pow",bf="sqrt",xf="symlog",_f="time",wf="utc",kf="sequential",Ef="diverging",Df="quantile",$f="quantize",Af="threshold",Sf="ordinal",Mf="point",Cf="band",Ff="bin-ordinal",Of="continuous",Tf="discrete",Nf="discretizing",zf="interpolating",Rf="temporal";function Pf(){const e=yc().unknown(void 0),t=e.domain,n=e.range;let i,r,o=[0,1],a=!1,s=0,l=0,u=.5;function c(){const e=t().length,c=o[1]<o[0],f=o[1-c],d=mf(e,s,l);let h=o[c-0];i=(f-h)/(d||1),a&&(i=Math.floor(i)),h+=(f-h-i*(e-s))*u,r=i*(1-s),a&&(h=Math.round(h),r=Math.round(r));const p=pa(e).map((e=>h+i*e));return n(c?p.reverse():p)}return delete e.unknown,e.domain=function(e){return arguments.length?(t(e),c()):t()},e.range=function(e){return arguments.length?(o=[+e[0],+e[1]],c()):o.slice()},e.rangeRound=function(e){return o=[+e[0],+e[1]],a=!0,c()},e.bandwidth=function(){return r},e.step=function(){return i},e.round=function(e){return arguments.length?(a=!!e,c()):a},e.padding=function(e){return arguments.length?(l=Math.max(0,Math.min(1,e)),s=l,c()):s},e.paddingInner=function(e){return arguments.length?(s=Math.max(0,Math.min(1,e)),c()):s},e.paddingOuter=function(e){return arguments.length?(l=Math.max(0,Math.min(1,e)),c()):l},e.align=function(e){return arguments.length?(u=Math.max(0,Math.min(1,e)),c()):u},e.invertRange=function(e){if(null==e[0]||null==e[1])return;const i=o[1]<o[0],a=i?n().reverse():n(),s=a.length-1;let l,u,c,f=+e[0],d=+e[1];return f!==f||d!==d||(d<f&&(c=f,f=d,d=c),d<a[0]||f>o[1-i])?void 0:(l=Math.max(0,ru(a,f)-1),u=f===d?l:ru(a,d)-1,f-a[l]>r+1e-10&&++l,i&&(c=l,l=s-u,u=s-c),l>u?void 0:t().slice(l,u+1))},e.invert=function(t){const n=e.invertRange([t,t]);return n?n[0]:n},e.copy=function(){return Pf().domain(t()).range(o).round(a).paddingInner(s).paddingOuter(l).align(u)},c()}function Lf(e){const t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,e.copy=function(){return Lf(t())},e}var Uf=Array.prototype.map;const Bf=Array.prototype.slice;const jf=new Map,If=Symbol("vega_scale");function qf(e){return e[If]=!0,e}function Wf(e,t,n){return arguments.length>1?(jf.set(e,function(e,t,n){const i=function(){const n=t();return n.invertRange||(n.invertRange=n.invert?function(e){return function(t){let n,i=t[0],r=t[1];return r<i&&(n=i,i=r,r=n),[e.invert(i),e.invert(r)]}}(n):n.invertExtent?function(e){return function(t){const n=e.range();let i,r,o,a,s=t[0],l=t[1],u=-1;for(l<s&&(r=s,s=l,l=r),o=0,a=n.length;o<a;++o)n[o]>=s&&n[o]<=l&&(u<0&&(u=o),i=o);if(!(u<0))return s=e.invertExtent(n[u]),l=e.invertExtent(n[i]),[void 0===s[0]?s[1]:s[0],void 0===l[1]?l[0]:l[1]]}}(n):void 0),n.type=e,qf(n)};return i.metadata=(0,m.Rg)((0,m.IX)(n)),i}(e,t,n)),this):Hf(e)?jf.get(e):void 0}function Hf(e){return jf.has(e)}function Xf(e,t){const n=jf.get(e);return n&&n.metadata[t]}function Jf(e){return Xf(e,Of)}function Gf(e){return Xf(e,Tf)}function Vf(e){return Xf(e,Nf)}function Yf(e){return Xf(e,yf)}function Kf(e){return Xf(e,zf)}function Zf(e){return Xf(e,Df)}Wf("identity",(function e(t){var n;function i(e){return null==e||isNaN(e=+e)?n:e}return i.invert=i,i.domain=i.range=function(e){return arguments.length?(t=Array.from(e,xu),i):t.slice()},i.unknown=function(e){return arguments.length?(n=e,i):n},i.copy=function(){return e(t).unknown(n)},t=arguments.length?Array.from(t,xu):[0,1],Ou(i)})),Wf(gf,(function e(){var t=Su();return t.copy=function(){return $u(t,e())},Mu.apply(t,arguments),Ou(t)}),Of),Wf(yf,(function e(){const t=Bu(Au()).domain([1,10]);return t.copy=()=>$u(t,e()).base(t.base()),Mu.apply(t,arguments),t}),[Of,yf]),Wf(vf,Hu,Of),Wf(bf,(function(){return Hu.apply(null,arguments).exponent(.5)}),Of),Wf(xf,(function e(){var t=Gu(Au());return t.copy=function(){return $u(t,e()).constant(t.constant())},Mu.apply(t,arguments)}),Of),Wf(_f,(function(){return Mu.apply(nc(Zu,Qu,Te,ze,ve,pe,Pe,Ue,je,ln).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}),[Of,Rf]),Wf(wf,(function(){return Mu.apply(nc(Yu,Ku,Ne,Re,$e,me,Le,Be,je,cn).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}),[Of,Rf]),Wf(kf,oc,[Of,zf]),Wf(`${kf}-${gf}`,oc,[Of,zf]),Wf(`${kf}-${yf}`,(function e(){var t=Bu(ic()).domain([1,10]);return t.copy=function(){return rc(t,e()).base(t.base())},Cu.apply(t,arguments)}),[Of,zf,yf]),Wf(`${kf}-${vf}`,ac,[Of,zf]),Wf(`${kf}-${bf}`,(function(){return ac.apply(null,arguments).exponent(.5)}),[Of,zf]),Wf(`${kf}-${xf}`,(function e(){var t=Gu(ic());return t.copy=function(){return rc(t,e()).constant(t.constant())},Cu.apply(t,arguments)}),[Of,zf]),Wf(`${Ef}-${gf}`,(function e(){var t=Ou(lc()(wu));return t.copy=function(){return rc(t,e())},Cu.apply(t,arguments)}),[Of,zf]),Wf(`${Ef}-${yf}`,(function e(){var t=Bu(lc()).domain([.1,1,10]);return t.copy=function(){return rc(t,e()).base(t.base())},Cu.apply(t,arguments)}),[Of,zf,yf]),Wf(`${Ef}-${vf}`,uc,[Of,zf]),Wf(`${Ef}-${bf}`,(function(){return uc.apply(null,arguments).exponent(.5)}),[Of,zf]),Wf(`${Ef}-${xf}`,(function e(){var t=Gu(lc());return t.copy=function(){return rc(t,e()).constant(t.constant())},Cu.apply(t,arguments)}),[Of,zf]),Wf(Df,(function e(){var t,n=[],i=[],r=[];function o(){var e=0,t=Math.max(1,i.length);for(r=new Array(t-1);++e<t;)r[e-1]=mo(n,e/t);return a}function a(e){return null==e||isNaN(e=+e)?t:i[au(r,e)]}return a.invertExtent=function(e){var t=i.indexOf(e);return t<0?[NaN,NaN]:[t>0?r[t-1]:n[0],t<r.length?r[t]:n[n.length-1]]},a.domain=function(e){if(!arguments.length)return n.slice();n=[];for(let t of e)null==t||isNaN(t=+t)||n.push(t);return n.sort(qe),o()},a.range=function(e){return arguments.length?(i=Array.from(e),o()):i.slice()},a.unknown=function(e){return arguments.length?(t=e,a):t},a.quantiles=function(){return r.slice()},a.copy=function(){return e().domain(n).range(i).unknown(t)},Mu.apply(a,arguments)}),[Nf,Df]),Wf($f,(function e(){var t,n=0,i=1,r=1,o=[.5],a=[0,1];function s(e){return null!=e&&e<=e?a[au(o,e,0,r)]:t}function l(){var e=-1;for(o=new Array(r);++e<r;)o[e]=((e+1)*i-(e-r)*n)/(r+1);return s}return s.domain=function(e){return arguments.length?([n,i]=e,n=+n,i=+i,l()):[n,i]},s.range=function(e){return arguments.length?(r=(a=Array.from(e)).length-1,l()):a.slice()},s.invertExtent=function(e){var t=a.indexOf(e);return t<0?[NaN,NaN]:t<1?[n,o[0]]:t>=r?[o[r-1],i]:[o[t-1],o[t]]},s.unknown=function(e){return arguments.length?(t=e,s):s},s.thresholds=function(){return o.slice()},s.copy=function(){return e().domain([n,i]).range(a).unknown(t)},Mu.apply(Ou(s),arguments)}),Nf),Wf(Af,(function e(){var t,n=[.5],i=[0,1],r=1;function o(e){return null!=e&&e<=e?i[au(n,e,0,r)]:t}return o.domain=function(e){return arguments.length?(n=Array.from(e),r=Math.min(n.length,i.length-1),o):n.slice()},o.range=function(e){return arguments.length?(i=Array.from(e),r=Math.min(n.length,i.length-1),o):i.slice()},o.invertExtent=function(e){var t=i.indexOf(e);return[n[t-1],n[t]]},o.unknown=function(e){return arguments.length?(t=e,o):t},o.copy=function(){return e().domain(n).range(i).unknown(t)},Mu.apply(o,arguments)}),Nf),Wf(Ff,(function e(){let t=[],n=[];function i(e){return null==e||e!==e?void 0:n[(au(t,e)-1)%n.length]}return i.domain=function(e){return arguments.length?(t=function(e){return Uf.call(e,m.He)}(e),i):t.slice()},i.range=function(e){return arguments.length?(n=Bf.call(e),i):n.slice()},i.tickFormat=function(e,n){return Fu(t[0],(0,m.fj)(t),null==e?10:e,n)},i.copy=function(){return e().domain(i.domain()).range(i.range())},i}),[Tf,Nf]),Wf(Sf,yc,Tf),Wf(Cf,Pf,Tf),Wf(Mf,(function(){return Lf(Pf().paddingInner(1))}),Tf);const Qf=["clamp","base","constant","exponent"];function ed(e,t){const n=t[0],i=(0,m.fj)(t)-n;return function(t){return e(n+t*i)}}function td(e,t,n){return sc(rd(t||"rgb",n),e)}function nd(e,t){const n=new Array(t),i=t+1;for(let r=0;r<t;)n[r]=e(++r/i);return n}function id(e,t,n){const i=n-t;let r,o,a;return i&&Number.isFinite(i)?(r=(o=e.type).indexOf("-"),o=r<0?o:o.slice(r+1),a=Wf(o)().domain([t,n]).range([0,1]),Qf.forEach((t=>e[t]?a[t](e[t]()):0)),a):(0,m.a9)(.5)}function rd(e,t){const n=r[function(e){return"interpolate"+e.toLowerCase().split("-").map((e=>e[0].toUpperCase()+e.slice(1))).join("")}(e)];return null!=t&&n&&n.gamma?n.gamma(t):n}function od(e){const t=e.length/6|0,n=new Array(t);for(let i=0;i<t;)n[i]="#"+e.slice(6*i,6*++i);return n}function ad(e,t){for(const n in e)ld(n,t(e[n]))}const sd={};function ld(e,t){return e=e&&e.toLowerCase(),arguments.length>1?(sd[e]=t,this):sd[e]}ad({category10:"1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf",category20:"1f77b4aec7e8ff7f0effbb782ca02c98df8ad62728ff98969467bdc5b0d58c564bc49c94e377c2f7b6d27f7f7fc7c7c7bcbd22dbdb8d17becf9edae5",category20b:"393b795254a36b6ecf9c9ede6379398ca252b5cf6bcedb9c8c6d31bd9e39e7ba52e7cb94843c39ad494ad6616be7969c7b4173a55194ce6dbdde9ed6",category20c:"3182bd6baed69ecae1c6dbefe6550dfd8d3cfdae6bfdd0a231a35474c476a1d99bc7e9c0756bb19e9ac8bcbddcdadaeb636363969696bdbdbdd9d9d9",tableau10:"4c78a8f58518e4575672b7b254a24beeca3bb279a2ff9da69d755dbab0ac",tableau20:"4c78a89ecae9f58518ffbf7954a24b88d27ab79a20f2cf5b43989483bcb6e45756ff9d9879706ebab0acd67195fcbfd2b279a2d6a5c99e765fd8b5a5",accent:"7fc97fbeaed4fdc086ffff99386cb0f0027fbf5b17666666",dark2:"1b9e77d95f027570b3e7298a66a61ee6ab02a6761d666666",paired:"a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928",pastel1:"fbb4aeb3cde3ccebc5decbe4fed9a6ffffcce5d8bdfddaecf2f2f2",pastel2:"b3e2cdfdcdaccbd5e8f4cae4e6f5c9fff2aef1e2cccccccc",set1:"e41a1c377eb84daf4a984ea3ff7f00ffff33a65628f781bf999999",set2:"66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3",set3:"8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f"},od),ad({blues:"cfe1f2bed8eca8cee58fc1de74b2d75ba3cf4592c63181bd206fb2125ca40a4a90",greens:"d3eecdc0e6baabdda594d3917bc77d60ba6c46ab5e329a512089430e7735036429",greys:"e2e2e2d4d4d4c4c4c4b1b1b19d9d9d8888887575756262624d4d4d3535351e1e1e",oranges:"fdd8b3fdc998fdb87bfda55efc9244f87f2cf06b18e4580bd14904b93d029f3303",purples:"e2e1efd4d4e8c4c5e0b4b3d6a3a0cc928ec3827cb97566ae684ea25c3696501f8c",reds:"fdc9b4fcb49afc9e80fc8767fa7051f6573fec3f2fdc2a25c81b1db21218970b13",blueGreen:"d5efedc1e8e0a7ddd18bd2be70c6a958ba9144ad77319c5d2089460e7736036429",bluePurple:"ccddecbad0e4a8c2dd9ab0d4919cc98d85be8b6db28a55a6873c99822287730f71",greenBlue:"d3eecec5e8c3b1e1bb9bd8bb82cec269c2ca51b2cd3c9fc7288abd1675b10b60a1",orangeRed:"fddcaffdcf9bfdc18afdad77fb9562f67d53ee6545e24932d32d1ebf130da70403",purpleBlue:"dbdaebc8cee4b1c3de97b7d87bacd15b9fc93a90c01e7fb70b70ab056199045281",purpleBlueGreen:"dbd8eac8cee4b0c3de93b7d872acd1549fc83892bb1c88a3097f8702736b016353",purpleRed:"dcc9e2d3b3d7ce9eccd186c0da6bb2e14da0e23189d91e6fc61159ab07498f023a",redPurple:"fccfccfcbec0faa9b8f98faff571a5ec539ddb3695c41b8aa908808d0179700174",yellowGreen:"e4f4acd1eca0b9e2949ed68880c97c62bb6e47aa5e3297502083440e723b036034",yellowOrangeBrown:"feeaa1fedd84fecc63feb746fca031f68921eb7215db5e0bc54c05ab3d038f3204",yellowOrangeRed:"fee087fed16ffebd59fea849fd903efc7335f9522bee3423de1b20ca0b22af0225",blueOrange:"134b852f78b35da2cb9dcae1d2e5eff2f0ebfce0bafbbf74e8932fc5690d994a07",brownBlueGreen:"704108a0651ac79548e3c78af3e6c6eef1eac9e9e48ed1c74da79e187a72025147",purpleGreen:"5b1667834792a67fb6c9aed3e6d6e8eff0efd9efd5aedda971bb75368e490e5e29",purpleOrange:"4114696647968f83b7b9b4d6dadbebf3eeeafce0bafbbf74e8932fc5690d994a07",redBlue:"8c0d25bf363adf745ef4ae91fbdbc9f2efeed2e5ef9dcae15da2cb2f78b3134b85",redGrey:"8c0d25bf363adf745ef4ae91fcdccbfaf4f1e2e2e2c0c0c0969696646464343434",yellowGreenBlue:"eff9bddbf1b4bde5b594d5b969c5be45b4c22c9ec02182b82163aa23479c1c3185",redYellowBlue:"a50026d4322cf16e43fcac64fedd90faf8c1dcf1ecabd6e875abd04a74b4313695",redYellowGreen:"a50026d4322cf16e43fcac63fedd8df9f7aed7ee8ea4d86e64bc6122964f006837",pinkYellowGreen:"8e0152c0267edd72adf0b3d6faddedf5f3efe1f2cab6de8780bb474f9125276419",spectral:"9e0142d13c4bf0704afcac63fedd8dfbf8b0e0f3a1a9dda269bda94288b55e4fa2",viridis:"440154470e61481a6c482575472f7d443a834144873d4e8a39568c35608d31688e2d708e2a788e27818e23888e21918d1f988b1fa08822a8842ab07f35b77943bf7154c56866cc5d7ad1518fd744a5db36bcdf27d2e21be9e51afde725",magma:"0000040404130b0924150e3720114b2c11603b0f704a107957157e651a80721f817f24828c29819a2e80a8327db6377ac43c75d1426fde4968e95462f1605df76f5cfa7f5efc8f65fe9f6dfeaf78febf84fece91fddea0fcedaffcfdbf",inferno:"0000040403130c0826170c3b240c4f330a5f420a68500d6c5d126e6b176e781c6d86216b932667a12b62ae305cbb3755c73e4cd24644dd513ae65c30ed6925f3771af8850ffb9506fca50afcb519fac62df6d645f2e661f3f484fcffa4",plasma:"0d088723069033059742039d5002a25d01a66a00a87801a88405a7900da49c179ea72198b12a90ba3488c33d80cb4779d35171da5a69e16462e76e5bed7953f2834cf68f44fa9a3dfca636fdb32ffec029fcce25f9dc24f5ea27f0f921",cividis:"00205100235800265d002961012b65042e670831690d346b11366c16396d1c3c6e213f6e26426e2c456e31476e374a6e3c4d6e42506e47536d4c566d51586e555b6e5a5e6e5e616e62646f66676f6a6a706e6d717270717573727976737c79747f7c75827f758682768985778c8877908b78938e789691789a94789e9778a19b78a59e77a9a177aea575b2a874b6ab73bbaf71c0b26fc5b66dc9b96acebd68d3c065d8c462ddc85fe2cb5ce7cf58ebd355f0d652f3da4ff7de4cfae249fce647",rainbow:"6e40aa883eb1a43db3bf3cafd83fa4ee4395fe4b83ff576eff6659ff7847ff8c38f3a130e2b72fcfcc36bee044aff05b8ff4576ff65b52f6673af27828ea8d1ddfa319d0b81cbecb23abd82f96e03d82e14c6edb5a5dd0664dbf6e40aa",sinebow:"ff4040fc582af47218e78d0bd5a703bfbf00a7d5038de70b72f41858fc2a40ff402afc5818f4720be78d03d5a700bfbf03a7d50b8de71872f42a58fc4040ff582afc7218f48d0be7a703d5bf00bfd503a7e70b8df41872fc2a58ff4040",turbo:"23171b32204a3e2a71453493493eae4b49c54a53d7485ee44569ee4074f53c7ff8378af93295f72e9ff42ba9ef28b3e926bce125c5d925cdcf27d5c629dcbc2de3b232e9a738ee9d3ff39347f68950f9805afc7765fd6e70fe667cfd5e88fc5795fb51a1f84badf545b9f140c5ec3cd0e637dae034e4d931ecd12ef4c92bfac029ffb626ffad24ffa223ff9821ff8d1fff821dff771cfd6c1af76118f05616e84b14df4111d5380fcb2f0dc0260ab61f07ac1805a313029b0f00950c00910b00",browns:"eedbbdecca96e9b97ae4a865dc9856d18954c7784cc0673fb85536ad44339f3632",tealBlues:"bce4d89dd3d181c3cb65b3c245a2b9368fae347da0306a932c5985",teals:"bbdfdfa2d4d58ac9c975bcbb61b0af4da5a43799982b8b8c1e7f7f127273006667",warmGreys:"dcd4d0cec5c1c0b8b4b3aaa7a59c9998908c8b827f7e7673726866665c5a59504e",goldGreen:"f4d166d5ca60b6c35c98bb597cb25760a6564b9c533f8f4f33834a257740146c36",goldOrange:"f4d166f8be5cf8aa4cf5983bf3852aef701be2621fd65322c54923b142239e3a26",goldRed:"f4d166f6be59f9aa51fc964ef6834bee734ae56249db5247cf4244c43141b71d3e",lightGreyRed:"efe9e6e1dad7d5cbc8c8bdb9bbaea9cd967ddc7b43e15f19df4011dc000b",lightGreyTeal:"e4eaead6dcddc8ced2b7c2c7a6b4bc64b0bf22a6c32295c11f85be1876bc",lightMulti:"e0f1f2c4e9d0b0de9fd0e181f6e072f6c053f3993ef77440ef4a3c",lightOrange:"f2e7daf7d5baf9c499fab184fa9c73f68967ef7860e8645bde515bd43d5b",lightTealBlue:"e3e9e0c0dccf9aceca7abfc859afc0389fb9328dad2f7ca0276b95255988",darkBlue:"3232322d46681a5c930074af008cbf05a7ce25c0dd38daed50f3faffffff",darkGold:"3c3c3c584b37725e348c7631ae8b2bcfa424ecc31ef9de30fff184ffffff",darkGreen:"3a3a3a215748006f4d048942489e4276b340a6c63dd2d836ffeb2cffffaa",darkMulti:"3737371f5287197d8c29a86995ce3fffe800ffffff",darkRed:"3434347036339e3c38cc4037e75d1eec8620eeab29f0ce32ffeb2c"},(e=>td(od(e))));const ud="symbol",cd="discrete",fd=e=>(0,m.kJ)(e)?e.map((e=>String(e))):String(e),dd=(e,t)=>e[1]-t[1],hd=(e,t)=>t[1]-e[1];function pd(e,t,n){let i;return(0,m.hj)(t)&&(e.bins&&(t=Math.max(t,e.bins.length)),null!=n&&(t=Math.min(t,Math.floor((0,m.yP)(e.domain())/n||1)+1))),(0,m.Kn)(t)&&(i=t.step,t=t.interval),(0,m.HD)(t)&&(t=e.type===_f?Tt(t):e.type==wf?Nt(t):(0,m.vU)("Only time and utc scales accept interval strings."),i&&(t=t.every(i))),t}function md(e,t,n){let i=e.range(),r=i[0],o=(0,m.fj)(i),a=dd;if(r>o&&(i=o,o=r,r=i,a=hd),r=Math.floor(r),o=Math.ceil(o),t=t.map((t=>[t,e(t)])).filter((e=>r<=e[1]&&e[1]<=o)).sort(a).map((e=>e[0])),n>0&&t.length>1){const e=[t[0],(0,m.fj)(t)];for(;t.length>n&&t.length>=3;)t=t.filter(((e,t)=>!(t%2)));t.length<3&&(t=e)}return t}function gd(e,t){return e.bins?md(e,e.bins):e.ticks?e.ticks(t):e.domain()}function yd(e,t,n,i,r,o){const a=t.type;let s=fd;if(a===_f||r===_f)s=e.timeFormat(i);else if(a===wf||r===wf)s=e.utcFormat(i);else if(Yf(a)){const r=e.formatFloat(i);if(o||t.bins)s=r;else{const e=vd(t,n,!1);s=t=>e(t)?r(t):""}}else if(t.tickFormat){const r=t.domain();s=e.formatSpan(r[0],r[r.length-1],n,i)}else i&&(s=e.format(i));return s}function vd(e,t,n){const i=gd(e,t),r=e.base(),o=Math.log(r),a=Math.max(1,r*t/i.length),s=e=>{let t=e/Math.pow(r,Math.round(Math.log(e)/o));return t*r<r-.5&&(t*=r),t<=a};return n?i.filter(s):s}const bd={[Df]:"quantiles",[$f]:"thresholds",[Af]:"domain"},xd={[Df]:"quantiles",[$f]:"domain"};function _d(e,t){return e.bins?function(e){const t=e.slice(0,-1);return t.max=(0,m.fj)(e),t}(e.bins):e.type===yf?vd(e,t,!0):bd[e.type]?function(e){const t=[-1/0].concat(e);return t.max=1/0,t}(e[bd[e.type]]()):gd(e,t)}const wd=e=>bd[e.type]||e.bins;function kd(e,t,n,i,r,o,a){const s=xd[t.type]&&o!==_f&&o!==wf?function(e,t,n){const i=t[xd[t.type]](),r=i.length;let o,a=r>1?i[1]-i[0]:i[0];for(o=1;o<r;++o)a=Math.min(a,i[o]-i[o-1]);return e.formatSpan(0,a,30,n)}(e,t,r):yd(e,t,n,r,o,a);return i===ud&&wd(t)?Ed(s):i===cd?$d(s):Ad(s)}const Ed=e=>(t,n,i)=>{const r=Dd(i[n+1],Dd(i.max,1/0)),o=Sd(t,e),a=Sd(r,e);return o&&a?o+" \u2013 "+a:a?"< "+a:"\u2265 "+o},Dd=(e,t)=>null!=e?e:t,$d=e=>(t,n)=>n?e(t):null,Ad=e=>t=>e(t),Sd=(e,t)=>Number.isFinite(e)?t(e):null;function Md(e,t,n,i){const r=i||t.type;return(0,m.HD)(n)&&Xf(r,Rf)&&(n=n.replace(/%a/g,"%A").replace(/%b/g,"%B")),n||r!==_f?n||r!==wf?kd(e,t,5,null,n,i,!0):e.utcFormat("%A, %d %B %Y, %X UTC"):e.timeFormat("%A, %d %B %Y, %X")}function Cd(e,t,n){n=n||{};const i=Math.max(3,n.maxlen||7),r=Md(e,t,n.format,n.formatType);if(Vf(t.type)){const e=_d(t).slice(1).map(r),n=e.length;return`${n} boundar${1===n?"y":"ies"}: ${e.join(", ")}`}if(Gf(t.type)){const e=t.domain(),n=e.length;return`${n} value${1===n?"":"s"}: ${n>i?e.slice(0,i-2).map(r).join(", ")+", ending with "+e.slice(-1).map(r):e.map(r).join(", ")}`}{const e=t.domain();return`values from ${r(e[0])} to ${r((0,m.fj)(e))}`}}let Fd=0;const Od="p_";function Td(e){return e&&e.gradient}function Nd(e,t,n){const i=e.gradient;let r=e.id,o="radial"===i?Od:"";return r||(r=e.id="gradient_"+Fd++,"radial"===i?(e.x1=zd(e.x1,.5),e.y1=zd(e.y1,.5),e.r1=zd(e.r1,0),e.x2=zd(e.x2,.5),e.y2=zd(e.y2,.5),e.r2=zd(e.r2,.5),o=Od):(e.x1=zd(e.x1,0),e.y1=zd(e.y1,0),e.x2=zd(e.x2,1),e.y2=zd(e.y2,0))),t[r]=e,"url("+(n||"")+"#"+o+r+")"}function zd(e,t){return null!=e?e:t}function Rd(e,t){var n,i=[];return n={gradient:"linear",x1:e?e[0]:0,y1:e?e[1]:0,x2:t?t[0]:1,y2:t?t[1]:0,stops:i,stop:function(e,t){return i.push({offset:e,color:t}),n}}}const Pd={basis:{curve:function(e){return new Is(e)}},"basis-closed":{curve:function(e){return new Ws(e)}},"basis-open":{curve:function(e){return new Hs(e)}},bundle:{curve:Js,tension:"beta",value:.85},cardinal:{curve:Ys,tension:"tension",value:0},"cardinal-open":{curve:Zs,tension:"tension",value:0},"cardinal-closed":{curve:el,tension:"tension",value:0},"catmull-rom":{curve:ml,tension:"alpha",value:.5},"catmull-rom-closed":{curve:yl,tension:"alpha",value:.5},"catmull-rom-open":{curve:bl,tension:"alpha",value:.5},linear:{curve:_l},"linear-closed":{curve:function(e){return new wl(e)}},monotone:{horizontal:function(e){return new Sl(e)},vertical:function(e){return new Al(e)}},natural:{curve:function(e){return new Cl(e)}},step:{curve:function(e){return new Ol(e,.5)}},"step-after":{curve:function(e){return new Ol(e,1)}},"step-before":{curve:function(e){return new Ol(e,0)}}};function Ld(e,t,n){var i=(0,m.nr)(Pd,e)&&Pd[e],r=null;return i&&(r=i.curve||i[t||"vertical"],i.tension&&null!=n&&(r=r[i.tension](n))),r}const Ud={m:2,l:2,h:1,v:1,z:0,c:6,s:4,q:4,t:2,a:7},Bd=/[mlhvzcsqta]([^mlhvzcsqta]+|$)/gi,jd=/^[+-]?(([0-9]*\.[0-9]+)|([0-9]+\.)|([0-9]+))([eE][+-]?[0-9]+)?/,Id=/^((\s+,?\s*)|(,\s*))/,qd=/^[01]/;function Wd(e){const t=[];return(e.match(Bd)||[]).forEach((e=>{let n=e[0];const i=n.toLowerCase(),r=Ud[i],o=function(e,t,n){const i=[];for(let r=0;t&&r<n.length;)for(let o=0;o<t;++o){const t="a"!==e||3!==o&&4!==o?jd:qd,a=n.slice(r).match(t);if(null===a)throw Error("Invalid SVG path, incorrect parameter type");r+=a[0].length,i.push(+a[0]);const s=n.slice(r).match(Id);null!==s&&(r+=s[0].length)}return i}(i,r,e.slice(1).trim()),a=o.length;if(a<r||a&&a%r!==0)throw Error("Invalid SVG path, incorrect parameter count");if(t.push([n,...o.slice(0,r)]),a!==r){"m"===i&&(n="M"===n?"L":"l");for(let e=r;e<a;e+=r)t.push([n,...o.slice(e,e+r)])}})),t}const Hd=Math.PI/180,Xd=Math.PI/2,Jd=2*Math.PI,Gd=Math.sqrt(3)/2;var Vd={},Yd={},Kd=[].join;function Zd(e){const t=Kd.call(e);if(Yd[t])return Yd[t];var n=e[0],i=e[1],r=e[2],o=e[3],a=e[4],s=e[5],l=e[6],u=e[7];const c=u*a,f=-l*s,d=l*a,h=u*s,p=Math.cos(r),m=Math.sin(r),g=Math.cos(o),y=Math.sin(o),v=.5*(o-r),b=Math.sin(.5*v),x=8/3*b*b/Math.sin(v),_=n+p-x*m,w=i+m+x*p,k=n+g,E=i+y,D=k+x*y,$=E-x*g;return Yd[t]=[c*_+f*w,d*_+h*w,c*D+f*$,d*D+h*$,c*k+f*E,d*k+h*E]}const Qd=["l",0,0,0,0,0,0,0];function eh(e,t,n){const i=Qd[0]=e[0];if("a"===i||"A"===i)Qd[1]=t*e[1],Qd[2]=n*e[2],Qd[3]=e[3],Qd[4]=e[4],Qd[5]=e[5],Qd[6]=t*e[6],Qd[7]=n*e[7];else if("h"===i||"H"===i)Qd[1]=t*e[1];else if("v"===i||"V"===i)Qd[1]=n*e[1];else for(var r=1,o=e.length;r<o;++r)Qd[r]=(r%2==1?t:n)*e[r];return Qd}function th(e,t,n,i,r,o){var a,s,l,u,c,f=null,d=0,h=0,p=0,m=0,g=0,y=0;null==n&&(n=0),null==i&&(i=0),null==r&&(r=1),null==o&&(o=r),e.beginPath&&e.beginPath();for(var v=0,b=t.length;v<b;++v){switch(a=t[v],1===r&&1===o||(a=eh(a,r,o)),a[0]){case"l":d+=a[1],h+=a[2],e.lineTo(d+n,h+i);break;case"L":d=a[1],h=a[2],e.lineTo(d+n,h+i);break;case"h":d+=a[1],e.lineTo(d+n,h+i);break;case"H":d=a[1],e.lineTo(d+n,h+i);break;case"v":h+=a[1],e.lineTo(d+n,h+i);break;case"V":h=a[1],e.lineTo(d+n,h+i);break;case"m":g=d+=a[1],y=h+=a[2],e.moveTo(d+n,h+i);break;case"M":g=d=a[1],y=h=a[2],e.moveTo(d+n,h+i);break;case"c":s=d+a[5],l=h+a[6],p=d+a[3],m=h+a[4],e.bezierCurveTo(d+a[1]+n,h+a[2]+i,p+n,m+i,s+n,l+i),d=s,h=l;break;case"C":d=a[5],h=a[6],p=a[3],m=a[4],e.bezierCurveTo(a[1]+n,a[2]+i,p+n,m+i,d+n,h+i);break;case"s":s=d+a[3],l=h+a[4],p=2*d-p,m=2*h-m,e.bezierCurveTo(p+n,m+i,d+a[1]+n,h+a[2]+i,s+n,l+i),p=d+a[1],m=h+a[2],d=s,h=l;break;case"S":s=a[3],l=a[4],p=2*d-p,m=2*h-m,e.bezierCurveTo(p+n,m+i,a[1]+n,a[2]+i,s+n,l+i),d=s,h=l,p=a[1],m=a[2];break;case"q":s=d+a[3],l=h+a[4],p=d+a[1],m=h+a[2],e.quadraticCurveTo(p+n,m+i,s+n,l+i),d=s,h=l;break;case"Q":s=a[3],l=a[4],e.quadraticCurveTo(a[1]+n,a[2]+i,s+n,l+i),d=s,h=l,p=a[1],m=a[2];break;case"t":s=d+a[1],l=h+a[2],null===f[0].match(/[QqTt]/)?(p=d,m=h):"t"===f[0]?(p=2*d-u,m=2*h-c):"q"===f[0]&&(p=2*d-p,m=2*h-m),u=p,c=m,e.quadraticCurveTo(p+n,m+i,s+n,l+i),h=l,p=(d=s)+a[1],m=h+a[2];break;case"T":s=a[1],l=a[2],p=2*d-p,m=2*h-m,e.quadraticCurveTo(p+n,m+i,s+n,l+i),d=s,h=l;break;case"a":nh(e,d+n,h+i,[a[1],a[2],a[3],a[4],a[5],a[6]+d+n,a[7]+h+i]),d+=a[6],h+=a[7];break;case"A":nh(e,d+n,h+i,[a[1],a[2],a[3],a[4],a[5],a[6]+n,a[7]+i]),d=a[6],h=a[7];break;case"z":case"Z":d=g,h=y,e.closePath()}f=a}}function nh(e,t,n,i){const r=function(e,t,n,i,r,o,a,s,l){const u=Kd.call(arguments);if(Vd[u])return Vd[u];const c=a*Hd,f=Math.sin(c),d=Math.cos(c),h=d*(s-e)*.5+f*(l-t)*.5,p=d*(l-t)*.5-f*(s-e)*.5;let m=h*h/((n=Math.abs(n))*n)+p*p/((i=Math.abs(i))*i);m>1&&(m=Math.sqrt(m),n*=m,i*=m);const g=d/n,y=f/n,v=-f/i,b=d/i,x=g*s+y*l,_=v*s+b*l,w=g*e+y*t,k=v*e+b*t;let E=1/((w-x)*(w-x)+(k-_)*(k-_))-.25;E<0&&(E=0);let D=Math.sqrt(E);o==r&&(D=-D);const $=.5*(x+w)-D*(k-_),A=.5*(_+k)+D*(w-x),S=Math.atan2(_-A,x-$);let M=Math.atan2(k-A,w-$)-S;M<0&&1===o?M+=Jd:M>0&&0===o&&(M-=Jd);const C=Math.ceil(Math.abs(M/(Xd+.001))),F=[];for(let O=0;O<C;++O){const e=S+O*M/C,t=S+(O+1)*M/C;F[O]=[$,A,e,t,n,i,f,d]}return Vd[u]=F}(i[5],i[6],i[0],i[1],i[3],i[4],i[2],t,n);for(let o=0;o<r.length;++o){const t=Zd(r[o]);e.bezierCurveTo(t[0],t[1],t[2],t[3],t[4],t[5])}}const ih=.5773502691896257,rh={circle:{draw:function(e,t){const n=Math.sqrt(t)/2;e.moveTo(n,0),e.arc(0,0,n,0,Jd)}},cross:{draw:function(e,t){var n=Math.sqrt(t)/2,i=n/2.5;e.moveTo(-n,-i),e.lineTo(-n,i),e.lineTo(-i,i),e.lineTo(-i,n),e.lineTo(i,n),e.lineTo(i,i),e.lineTo(n,i),e.lineTo(n,-i),e.lineTo(i,-i),e.lineTo(i,-n),e.lineTo(-i,-n),e.lineTo(-i,-i),e.closePath()}},diamond:{draw:function(e,t){const n=Math.sqrt(t)/2;e.moveTo(-n,0),e.lineTo(0,-n),e.lineTo(n,0),e.lineTo(0,n),e.closePath()}},square:{draw:function(e,t){var n=Math.sqrt(t),i=-n/2;e.rect(i,i,n,n)}},arrow:{draw:function(e,t){var n=Math.sqrt(t)/2,i=n/7,r=n/2.5,o=n/8;e.moveTo(-i,n),e.lineTo(i,n),e.lineTo(i,-o),e.lineTo(r,-o),e.lineTo(0,-n),e.lineTo(-r,-o),e.lineTo(-i,-o),e.closePath()}},wedge:{draw:function(e,t){var n=Math.sqrt(t)/2,i=Gd*n,r=i-n*ih,o=n/4;e.moveTo(0,-i-r),e.lineTo(-o,i-r),e.lineTo(o,i-r),e.closePath()}},triangle:{draw:function(e,t){var n=Math.sqrt(t)/2,i=Gd*n,r=i-n*ih;e.moveTo(0,-i-r),e.lineTo(-n,i-r),e.lineTo(n,i-r),e.closePath()}},"triangle-up":{draw:function(e,t){var n=Math.sqrt(t)/2,i=Gd*n;e.moveTo(0,-i),e.lineTo(-n,i),e.lineTo(n,i),e.closePath()}},"triangle-down":{draw:function(e,t){var n=Math.sqrt(t)/2,i=Gd*n;e.moveTo(0,i),e.lineTo(-n,-i),e.lineTo(n,-i),e.closePath()}},"triangle-right":{draw:function(e,t){var n=Math.sqrt(t)/2,i=Gd*n;e.moveTo(i,0),e.lineTo(-i,-n),e.lineTo(-i,n),e.closePath()}},"triangle-left":{draw:function(e,t){var n=Math.sqrt(t)/2,i=Gd*n;e.moveTo(-i,0),e.lineTo(i,-n),e.lineTo(i,n),e.closePath()}},stroke:{draw:function(e,t){const n=Math.sqrt(t)/2;e.moveTo(-n,0),e.lineTo(n,0)}}};function oh(e){return(0,m.nr)(rh,e)?rh[e]:function(e){if(!(0,m.nr)(ah,e)){const t=Wd(e);ah[e]={draw:function(e,n){th(e,t,0,0,Math.sqrt(n)/2)}}}return ah[e]}(e)}var ah={};const sh=.448084975506;function lh(e){return e.x}function uh(e){return e.y}function ch(e){return e.width}function fh(e){return e.height}function dh(e){return"function"===typeof e?e:()=>+e}function hh(e,t,n){return Math.max(t,Math.min(e,n))}function ph(){var e=lh,t=uh,n=ch,i=fh,r=dh(0),o=r,a=r,s=r,l=null;function u(u,c,f){var d,h=null!=c?c:+e.call(this,u),p=null!=f?f:+t.call(this,u),m=+n.call(this,u),g=+i.call(this,u),y=Math.min(m,g)/2,v=hh(+r.call(this,u),0,y),b=hh(+o.call(this,u),0,y),x=hh(+a.call(this,u),0,y),_=hh(+s.call(this,u),0,y);if(l||(l=d=Bl()),v<=0&&b<=0&&x<=0&&_<=0)l.rect(h,p,m,g);else{var w=h+m,k=p+g;l.moveTo(h+v,p),l.lineTo(w-b,p),l.bezierCurveTo(w-sh*b,p,w,p+sh*b,w,p+b),l.lineTo(w,k-_),l.bezierCurveTo(w,k-sh*_,w-sh*_,k,w-_,k),l.lineTo(h+x,k),l.bezierCurveTo(h+sh*x,k,h,k-sh*x,h,k-x),l.lineTo(h,p+v),l.bezierCurveTo(h,p+sh*v,h+sh*v,p,h+v,p),l.closePath()}if(d)return l=null,d+""||null}return u.x=function(t){return arguments.length?(e=dh(t),u):e},u.y=function(e){return arguments.length?(t=dh(e),u):t},u.width=function(e){return arguments.length?(n=dh(e),u):n},u.height=function(e){return arguments.length?(i=dh(e),u):i},u.cornerRadius=function(e,t,n,i){return arguments.length?(r=dh(e),o=null!=t?dh(t):r,s=null!=n?dh(n):r,a=null!=i?dh(i):o,u):r},u.context=function(e){return arguments.length?(l=null==e?null:e,u):l},u}function mh(){var e,t,n,i,r,o,a,s,l=null;function u(e,t,n){const i=n/2;if(r){var u=a-t,c=e-o;if(u||c){var f=Math.hypot(u,c),d=(u/=f)*s,h=(c/=f)*s,p=Math.atan2(c,u);l.moveTo(o-d,a-h),l.lineTo(e-u*i,t-c*i),l.arc(e,t,i,p-Math.PI,p),l.lineTo(o+d,a+h),l.arc(o,a,s,p,p+Math.PI)}else l.arc(e,t,i,0,Jd);l.closePath()}else r=1;o=e,a=t,s=i}function c(o){var a,s,c,f=o.length,d=!1;for(null==l&&(l=c=Bl()),a=0;a<=f;++a)!(a<f&&i(s=o[a],a,o))===d&&(d=!d)&&(r=0),d&&u(+e(s,a,o),+t(s,a,o),+n(s,a,o));if(c)return l=null,c+""||null}return c.x=function(t){return arguments.length?(e=t,c):e},c.y=function(e){return arguments.length?(t=e,c):t},c.size=function(e){return arguments.length?(n=e,c):n},c.defined=function(e){return arguments.length?(i=e,c):i},c.context=function(e){return arguments.length?(l=null==e?null:e,c):l},c}function gh(e,t){return null!=e?e:t}const yh=e=>e.x||0,vh=e=>e.y||0,bh=e=>!(!1===e.defined),xh=function(){var e=Il,t=ql,n=Tl(0),i=null,r=Wl,o=Hl,a=Xl,s=null,l=jl(u);function u(){var u,c,f=+e.apply(this,arguments),d=+t.apply(this,arguments),h=r.apply(this,arguments)-cl,p=o.apply(this,arguments)-cl,m=tl(p-h),g=p>h;if(s||(s=u=l()),d<f&&(c=d,d=f,f=c),d>ll)if(m>fl-ll)s.moveTo(d*il(h),d*al(h)),s.arc(0,0,d,h,p,!g),f>ll&&(s.moveTo(f*il(p),f*al(p)),s.arc(0,0,f,p,h,g));else{var y,v,b=h,x=p,_=h,w=p,k=m,E=m,D=a.apply(this,arguments)/2,$=D>ll&&(i?+i.apply(this,arguments):sl(f*f+d*d)),A=ol(tl(d-f)/2,+n.apply(this,arguments)),S=A,M=A;if($>ll){var C=dl($/f*al(D)),F=dl($/d*al(D));(k-=2*C)>ll?(_+=C*=g?1:-1,w-=C):(k=0,_=w=(h+p)/2),(E-=2*F)>ll?(b+=F*=g?1:-1,x-=F):(E=0,b=x=(h+p)/2)}var O=d*il(b),T=d*al(b),N=f*il(w),z=f*al(w);if(A>ll){var R,P=d*il(x),L=d*al(x),U=f*il(_),B=f*al(_);if(m<ul)if(R=function(e,t,n,i,r,o,a,s){var l=n-e,u=i-t,c=a-r,f=s-o,d=f*l-c*u;if(!(d*d<ll))return[e+(d=(c*(t-o)-f*(e-r))/d)*l,t+d*u]}(O,T,U,B,P,L,N,z)){var j=O-R[0],I=T-R[1],q=P-R[0],W=L-R[1],H=1/al(function(e){return e>1?0:e<-1?ul:Math.acos(e)}((j*q+I*W)/(sl(j*j+I*I)*sl(q*q+W*W)))/2),X=sl(R[0]*R[0]+R[1]*R[1]);S=ol(A,(f-X)/(H-1)),M=ol(A,(d-X)/(H+1))}else S=M=0}E>ll?M>ll?(y=Jl(U,B,O,T,d,M,g),v=Jl(P,L,N,z,d,M,g),s.moveTo(y.cx+y.x01,y.cy+y.y01),M<A?s.arc(y.cx,y.cy,M,nl(y.y01,y.x01),nl(v.y01,v.x01),!g):(s.arc(y.cx,y.cy,M,nl(y.y01,y.x01),nl(y.y11,y.x11),!g),s.arc(0,0,d,nl(y.cy+y.y11,y.cx+y.x11),nl(v.cy+v.y11,v.cx+v.x11),!g),s.arc(v.cx,v.cy,M,nl(v.y11,v.x11),nl(v.y01,v.x01),!g))):(s.moveTo(O,T),s.arc(0,0,d,b,x,!g)):s.moveTo(O,T),f>ll&&k>ll?S>ll?(y=Jl(N,z,P,L,f,-S,g),v=Jl(O,T,U,B,f,-S,g),s.lineTo(y.cx+y.x01,y.cy+y.y01),S<A?s.arc(y.cx,y.cy,S,nl(y.y01,y.x01),nl(v.y01,v.x01),!g):(s.arc(y.cx,y.cy,S,nl(y.y01,y.x01),nl(y.y11,y.x11),!g),s.arc(0,0,f,nl(y.cy+y.y11,y.cx+y.x11),nl(v.cy+v.y11,v.cx+v.x11),g),s.arc(v.cx,v.cy,S,nl(v.y11,v.x11),nl(v.y01,v.x01),!g))):s.arc(0,0,f,w,_,g):s.lineTo(N,z)}else s.moveTo(0,0);if(s.closePath(),u)return s=null,u+""||null}return u.centroid=function(){var n=(+e.apply(this,arguments)+ +t.apply(this,arguments))/2,i=(+r.apply(this,arguments)+ +o.apply(this,arguments))/2-ul/2;return[il(i)*n,al(i)*n]},u.innerRadius=function(t){return arguments.length?(e="function"===typeof t?t:Tl(+t),u):e},u.outerRadius=function(e){return arguments.length?(t="function"===typeof e?e:Tl(+e),u):t},u.cornerRadius=function(e){return arguments.length?(n="function"===typeof e?e:Tl(+e),u):n},u.padRadius=function(e){return arguments.length?(i=null==e?null:"function"===typeof e?e:Tl(+e),u):i},u.startAngle=function(e){return arguments.length?(r="function"===typeof e?e:Tl(+e),u):r},u.endAngle=function(e){return arguments.length?(o="function"===typeof e?e:Tl(+e),u):o},u.padAngle=function(e){return arguments.length?(a="function"===typeof e?e:Tl(+e),u):a},u.context=function(e){return arguments.length?(s=null==e?null:e,u):s},u}().startAngle((e=>e.startAngle||0)).endAngle((e=>e.endAngle||0)).padAngle((e=>e.padAngle||0)).innerRadius((e=>e.innerRadius||0)).outerRadius((e=>e.outerRadius||0)).cornerRadius((e=>e.cornerRadius||0)),_h=Zl().x(yh).y1(vh).y0((e=>(e.y||0)+(e.height||0))).defined(bh),wh=Zl().y(vh).x1(yh).x0((e=>(e.x||0)+(e.width||0))).defined(bh),kh=Kl().x(yh).y(vh).defined(bh),Eh=ph().x(yh).y(vh).width((e=>e.width||0)).height((e=>e.height||0)).cornerRadius((e=>gh(e.cornerRadiusTopLeft,e.cornerRadius)||0),(e=>gh(e.cornerRadiusTopRight,e.cornerRadius)||0),(e=>gh(e.cornerRadiusBottomRight,e.cornerRadius)||0),(e=>gh(e.cornerRadiusBottomLeft,e.cornerRadius)||0)),Dh=function(e,t){let n=null,i=jl(r);function r(){let r;if(n||(n=r=i()),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),r)return n=null,r+""||null}return e="function"===typeof e?e:Tl(e||Ql),t="function"===typeof t?t:Tl(void 0===t?64:+t),r.type=function(t){return arguments.length?(e="function"===typeof t?t:Tl(t),r):e},r.size=function(e){return arguments.length?(t="function"===typeof e?e:Tl(+e),r):t},r.context=function(e){return arguments.length?(n=null==e?null:e,r):n},r}().type((e=>oh(e.shape||"circle"))).size((e=>gh(e.size,64))),$h=mh().x(yh).y(vh).defined(bh).size((e=>e.size||1));function Ah(e){return e.cornerRadius||e.cornerRadiusTopLeft||e.cornerRadiusTopRight||e.cornerRadiusBottomRight||e.cornerRadiusBottomLeft}function Sh(e,t,n,i){return Eh.context(e)(t,n,i)}var Mh=1;function Ch(){Mh=1}function Fh(e,t,n){var i=t.clip,r=e._defs,o=t.clip_id||(t.clip_id="clip"+Mh++),a=r.clipping[o]||(r.clipping[o]={id:o});return(0,m.mf)(i)?a.path=i(null):Ah(n)?a.path=Sh(null,n,0,0):(a.width=n.width||0,a.height=n.height||0),"url(#"+o+")"}function Oh(e){this.clear(),e&&this.union(e)}function Th(e){this.mark=e,this.bounds=this.bounds||new Oh}function Nh(e){Th.call(this,e),this.items=this.items||[]}function zh(e){this._pending=0,this._loader=e||yr()}function Rh(e){e._pending+=1}function Ph(e){e._pending-=1}function Lh(e,t,n){if(t.stroke&&0!==t.opacity&&0!==t.strokeOpacity){const i=null!=t.strokeWidth?+t.strokeWidth:1;e.expand(i+(n?function(e,t){return e.strokeJoin&&"miter"!==e.strokeJoin?0:t}(t,i):0))}return e}Oh.prototype={clone(){return new Oh(this)},clear(){return this.x1=+Number.MAX_VALUE,this.y1=+Number.MAX_VALUE,this.x2=-Number.MAX_VALUE,this.y2=-Number.MAX_VALUE,this},empty(){return this.x1===+Number.MAX_VALUE&&this.y1===+Number.MAX_VALUE&&this.x2===-Number.MAX_VALUE&&this.y2===-Number.MAX_VALUE},equals(e){return this.x1===e.x1&&this.y1===e.y1&&this.x2===e.x2&&this.y2===e.y2},set(e,t,n,i){return n<e?(this.x2=e,this.x1=n):(this.x1=e,this.x2=n),i<t?(this.y2=t,this.y1=i):(this.y1=t,this.y2=i),this},add(e,t){return e<this.x1&&(this.x1=e),t<this.y1&&(this.y1=t),e>this.x2&&(this.x2=e),t>this.y2&&(this.y2=t),this},expand(e){return this.x1-=e,this.y1-=e,this.x2+=e,this.y2+=e,this},round(){return this.x1=Math.floor(this.x1),this.y1=Math.floor(this.y1),this.x2=Math.ceil(this.x2),this.y2=Math.ceil(this.y2),this},scale(e){return this.x1*=e,this.y1*=e,this.x2*=e,this.y2*=e,this},translate(e,t){return this.x1+=e,this.x2+=e,this.y1+=t,this.y2+=t,this},rotate(e,t,n){const i=this.rotatedPoints(e,t,n);return this.clear().add(i[0],i[1]).add(i[2],i[3]).add(i[4],i[5]).add(i[6],i[7])},rotatedPoints(e,t,n){var{x1:i,y1:r,x2:o,y2:a}=this,s=Math.cos(e),l=Math.sin(e),u=t-t*s+n*l,c=n-t*l-n*s;return[s*i-l*r+u,l*i+s*r+c,s*i-l*a+u,l*i+s*a+c,s*o-l*r+u,l*o+s*r+c,s*o-l*a+u,l*o+s*a+c]},union(e){return e.x1<this.x1&&(this.x1=e.x1),e.y1<this.y1&&(this.y1=e.y1),e.x2>this.x2&&(this.x2=e.x2),e.y2>this.y2&&(this.y2=e.y2),this},intersect(e){return e.x1>this.x1&&(this.x1=e.x1),e.y1>this.y1&&(this.y1=e.y1),e.x2<this.x2&&(this.x2=e.x2),e.y2<this.y2&&(this.y2=e.y2),this},encloses(e){return e&&this.x1<=e.x1&&this.x2>=e.x2&&this.y1<=e.y1&&this.y2>=e.y2},alignsWith(e){return e&&(this.x1==e.x1||this.x2==e.x2||this.y1==e.y1||this.y2==e.y2)},intersects(e){return e&&!(this.x2<e.x1||this.x1>e.x2||this.y2<e.y1||this.y1>e.y2)},contains(e,t){return!(e<this.x1||e>this.x2||t<this.y1||t>this.y2)},width(){return this.x2-this.x1},height(){return this.y2-this.y1}},(0,m.XW)(Nh,Th),zh.prototype={pending(){return this._pending},sanitizeURL(e){const t=this;return Rh(t),t._loader.sanitize(e,{context:"href"}).then((e=>(Ph(t),e))).catch((()=>(Ph(t),null)))},loadImage(e){const t=this,n=nu();return Rh(t),t._loader.sanitize(e,{context:"image"}).then((e=>{const i=e.href;if(!i||!n)throw{url:i};const r=new n,o=(0,m.nr)(e,"crossOrigin")?e.crossOrigin:"anonymous";return null!=o&&(r.crossOrigin=o),r.onload=()=>Ph(t),r.onerror=()=>Ph(t),r.src=i,r})).catch((e=>(Ph(t),{complete:!1,width:0,height:0,src:e&&e.url||""})))},ready(){const e=this;return new Promise((t=>{!function n(i){e.pending()?setTimeout((()=>{n(!0)}),10):t(i)}(!1)}))}};const Uh=Jd-1e-8;let Bh,jh,Ih,qh,Wh,Hh,Xh,Jh;const Gh=(e,t)=>Bh.add(e,t),Vh=(e,t)=>Gh(jh=e,Ih=t),Yh=e=>Gh(e,Bh.y1),Kh=e=>Gh(Bh.x1,e),Zh=(e,t)=>Wh*e+Xh*t,Qh=(e,t)=>Hh*e+Jh*t,ep=(e,t)=>Gh(Zh(e,t),Qh(e,t)),tp=(e,t)=>Vh(Zh(e,t),Qh(e,t));function np(e,t){return Bh=e,t?(qh=t*Hd,Wh=Jh=Math.cos(qh),Hh=Math.sin(qh),Xh=-Hh):(Wh=Jh=1,qh=Hh=Xh=0),ip}const ip={beginPath(){},closePath(){},moveTo:tp,lineTo:tp,rect(e,t,n,i){qh?(ep(e+n,t),ep(e+n,t+i),ep(e,t+i),tp(e,t)):(Gh(e+n,t+i),Vh(e,t))},quadraticCurveTo(e,t,n,i){const r=Zh(e,t),o=Qh(e,t),a=Zh(n,i),s=Qh(n,i);rp(jh,r,a,Yh),rp(Ih,o,s,Kh),Vh(a,s)},bezierCurveTo(e,t,n,i,r,o){const a=Zh(e,t),s=Qh(e,t),l=Zh(n,i),u=Qh(n,i),c=Zh(r,o),f=Qh(r,o);op(jh,a,l,c,Yh),op(Ih,s,u,f,Kh),Vh(c,f)},arc(e,t,n,i,r,o){if(i+=qh,r+=qh,jh=n*Math.cos(r)+e,Ih=n*Math.sin(r)+t,Math.abs(r-i)>Uh)Gh(e-n,t-n),Gh(e+n,t+n);else{const a=i=>Gh(n*Math.cos(i)+e,n*Math.sin(i)+t);let s,l;if(a(i),a(r),r!==i)if((i%=Jd)<0&&(i+=Jd),(r%=Jd)<0&&(r+=Jd),r<i&&(o=!o,s=i,i=r,r=s),o)for(r-=Jd,s=i-i%Xd,l=0;l<4&&s>r;++l,s-=Xd)a(s);else for(s=i-i%Xd+Xd,l=0;l<4&&s<r;++l,s+=Xd)a(s)}}};function rp(e,t,n,i){const r=(e-t)/(e+n-2*t);0<r&&r<1&&i(e+(t-e)*r)}function op(e,t,n,i,r){const o=i-e+3*t-3*n,a=e+n-2*t,s=e-t;let l,u=0,c=0;Math.abs(o)>1e-14?(l=a*a+s*o,l>=0&&(l=Math.sqrt(l),u=(-a+l)/o,c=(-a-l)/o)):u=.5*s/a,0<u&&u<1&&r(ap(u,e,t,n,i)),0<c&&c<1&&r(ap(c,e,t,n,i))}function ap(e,t,n,i,r){const o=1-e,a=o*o,s=e*e;return a*o*t+3*a*e*n+3*o*s*i+s*e*r}var sp=(sp=tu(1,1))?sp.getContext("2d"):null;const lp=new Oh;function up(e){return function(t,n){if(!sp)return!0;e(sp,t),lp.clear().union(t.bounds).intersect(n).round();const{x1:i,y1:r,x2:o,y2:a}=lp;for(let e=r;e<=a;++e)for(let t=i;t<=o;++t)if(sp.isPointInPath(t,e))return!0;return!1}}function cp(e,t){return t.contains(e.x||0,e.y||0)}function fp(e,t){const n=e.x||0,i=e.y||0,r=e.width||0,o=e.height||0;return t.intersects(lp.set(n,i,n+r,i+o))}function dp(e,t){const n=e.x||0,i=e.y||0;return hp(t,n,i,null!=e.x2?e.x2:n,null!=e.y2?e.y2:i)}function hp(e,t,n,i,r){const{x1:o,y1:a,x2:s,y2:l}=e,u=i-t,c=r-n;let f,d,h,p,m=0,g=1;for(p=0;p<4;++p){if(0===p&&(f=-u,d=-(o-t)),1===p&&(f=u,d=s-t),2===p&&(f=-c,d=-(a-n)),3===p&&(f=c,d=l-n),Math.abs(f)<1e-10&&d<0)return!1;if(h=d/f,f<0){if(h>g)return!1;h>m&&(m=h)}else if(f>0){if(h<m)return!1;h<g&&(g=h)}}return!0}function pp(e,t){e.globalCompositeOperation=t.blend||"source-over"}function mp(e,t){return null==e?t:e}function gp(e,t){const n=t.length;for(let i=0;i<n;++i)e.addColorStop(t[i].offset,t[i].color);return e}function yp(e,t,n){return Td(n)?function(e,t,n){const i=n.width(),r=n.height();let o;if("radial"===t.gradient)o=e.createRadialGradient(n.x1+mp(t.x1,.5)*i,n.y1+mp(t.y1,.5)*r,Math.max(i,r)*mp(t.r1,0),n.x1+mp(t.x2,.5)*i,n.y1+mp(t.y2,.5)*r,Math.max(i,r)*mp(t.r2,.5));else{const a=mp(t.x1,0),s=mp(t.y1,0),l=mp(t.x2,1),u=mp(t.y2,0);if(a!==l&&s!==u&&i!==r){const n=tu(Math.ceil(i),Math.ceil(r)),o=n.getContext("2d");return o.scale(i,r),o.fillStyle=gp(o.createLinearGradient(a,s,l,u),t.stops),o.fillRect(0,0,i,r),e.createPattern(n,"no-repeat")}o=e.createLinearGradient(n.x1+a*i,n.y1+s*r,n.x1+l*i,n.y1+u*r)}return gp(o,t.stops)}(e,n,t.bounds):n}function vp(e,t,n){return(n*=null==t.fillOpacity?1:t.fillOpacity)>0&&(e.globalAlpha=n,e.fillStyle=yp(e,t,t.fill),!0)}var bp=[];function xp(e,t,n){var i=null!=(i=t.strokeWidth)?i:1;return!(i<=0)&&((n*=null==t.strokeOpacity?1:t.strokeOpacity)>0&&(e.globalAlpha=n,e.strokeStyle=yp(e,t,t.stroke),e.lineWidth=i,e.lineCap=t.strokeCap||"butt",e.lineJoin=t.strokeJoin||"miter",e.miterLimit=t.strokeMiterLimit||10,e.setLineDash&&(e.setLineDash(t.strokeDash||bp),e.lineDashOffset=t.strokeDashOffset||0),!0))}function _p(e,t){return e.zindex-t.zindex||e.index-t.index}function wp(e){if(!e.zdirty)return e.zitems;var t,n,i,r=e.items,o=[];for(n=0,i=r.length;n<i;++n)(t=r[n]).index=n,t.zindex&&o.push(t);return e.zdirty=!1,e.zitems=o.sort(_p)}function kp(e,t){var n,i,r=e.items;if(!r||!r.length)return;const o=wp(e);if(o&&o.length){for(n=0,i=r.length;n<i;++n)r[n].zindex||t(r[n]);r=o}for(n=0,i=r.length;n<i;++n)t(r[n])}function Ep(e,t){var n,i,r=e.items;if(!r||!r.length)return null;const o=wp(e);for(o&&o.length&&(r=o),i=r.length;--i>=0;)if(n=t(r[i]))return n;if(r===o)for(i=(r=e.items).length;--i>=0;)if(!r[i].zindex&&(n=t(r[i])))return n;return null}function Dp(e){return function(t,n,i){kp(n,(n=>{i&&!i.intersects(n.bounds)||Ap(e,t,n,n)}))}}function $p(e){return function(t,n,i){!n.items.length||i&&!i.intersects(n.bounds)||Ap(e,t,n.items[0],n.items)}}function Ap(e,t,n,i){var r=null==n.opacity?1:n.opacity;0!==r&&(e(t,i)||(pp(t,n),n.fill&&vp(t,n,r)&&t.fill(),n.stroke&&xp(t,n,r)&&t.stroke()))}function Sp(e){return e=e||m.yb,function(t,n,i,r,o,a){return i*=t.pixelRatio,r*=t.pixelRatio,Ep(n,(n=>{const s=n.bounds;if((!s||s.contains(o,a))&&s)return e(t,n,i,r,o,a)?n:void 0}))}}function Mp(e,t){return function(n,i,r,o){var a,s,l=Array.isArray(i)?i[0]:i,u=null==t?l.fill:t,c=l.stroke&&n.isPointInStroke;return c&&(a=l.strokeWidth,s=l.strokeCap,n.lineWidth=null!=a?a:1,n.lineCap=null!=s?s:"butt"),!e(n,i)&&(u&&n.isPointInPath(r,o)||c&&n.isPointInStroke(r,o))}}function Cp(e){return Sp(Mp(e))}function Fp(e,t){return"translate("+e+","+t+")"}function Op(e){return"rotate("+e+")"}function Tp(e){return Fp(e.x||0,e.y||0)}function Np(e,t,n){function i(e,n){var i=n.x||0,r=n.y||0,o=n.angle||0;e.translate(i,r),o&&e.rotate(o*=Hd),e.beginPath(),t(e,n),o&&e.rotate(-o),e.translate(-i,-r)}return{type:e,tag:"path",nested:!1,attr:function(e,n){e("transform",function(e){return Fp(e.x||0,e.y||0)+(e.angle?" "+Op(e.angle):"")}(n)),e("d",t(null,n))},bound:function(e,n){return t(np(e,n.angle),n),Lh(e,n).translate(n.x||0,n.y||0)},draw:Dp(i),pick:Cp(i),isect:n||up(i)}}var zp=Np("arc",(function(e,t){return xh.context(e)(t)}));function Rp(e,t,n){function i(e,n){e.beginPath(),t(e,n)}const r=Mp(i);return{type:e,tag:"path",nested:!0,attr:function(e,n){var i=n.mark.items;i.length&&e("d",t(null,i))},bound:function(e,n){var i=n.items;return 0===i.length?e:(t(np(e),i),Lh(e,i[0]))},draw:$p(i),pick:function(e,t,n,i,o,a){var s=t.items,l=t.bounds;return!s||!s.length||l&&!l.contains(o,a)?null:(n*=e.pixelRatio,i*=e.pixelRatio,r(e,s,n,i)?s[0]:null)},isect:cp,tip:n}}var Pp=Rp("area",(function(e,t){const n=t[0],i=n.interpolate||"linear";return("horizontal"===n.orient?wh:_h).curve(Ld(i,n.orient,n.tension)).context(e)(t)}),(function(e,t){for(var n,i,r="horizontal"===e[0].orient?t[1]:t[0],o="horizontal"===e[0].orient?"y":"x",a=e.length,s=1/0;--a>=0;)!1!==e[a].defined&&(i=Math.abs(e[a][o]-r))<s&&(s=i,n=e[a]);return n}));function Lp(e,t){e.beginPath(),Ah(t)?Sh(e,t,0,0):e.rect(0,0,t.width||0,t.height||0),e.clip()}function Up(e){const t=mp(e.strokeWidth,1);return null!=e.strokeOffset?e.strokeOffset:e.stroke&&t>.5&&t<1.5?.5-Math.abs(t-1):0}function Bp(e,t){const n=Up(t);e("d",Sh(null,t,n,n))}function jp(e,t,n,i){const r=Up(t);e.beginPath(),Sh(e,t,(n||0)+r,(i||0)+r)}const Ip=Mp(jp),qp=Mp(jp,!1),Wp=Mp(jp,!0);var Hp={type:"group",tag:"g",nested:!1,attr:function(e,t){e("transform",Tp(t))},bound:function(e,t){if(!t.clip&&t.items){const n=t.items,i=n.length;for(let t=0;t<i;++t)e.union(n[t].bounds)}return(t.clip||t.width||t.height)&&!t.noBound&&e.add(0,0).add(t.width||0,t.height||0),Lh(e,t),e.translate(t.x||0,t.y||0)},draw:function(e,t,n,i){kp(t,(t=>{const r=t.x||0,o=t.y||0,a=t.strokeForeground,s=null==t.opacity?1:t.opacity;(t.stroke||t.fill)&&s&&(jp(e,t,r,o),pp(e,t),t.fill&&vp(e,t,s)&&e.fill(),t.stroke&&!a&&xp(e,t,s)&&e.stroke()),e.save(),e.translate(r,o),t.clip&&Lp(e,t),n&&n.translate(-r,-o),kp(t,(t=>{("group"===t.marktype||null==i||i.includes(t.marktype))&&this.draw(e,t,n,i)})),n&&n.translate(r,o),e.restore(),a&&t.stroke&&s&&(jp(e,t,r,o),pp(e,t),xp(e,t,s)&&e.stroke())}))},pick:function(e,t,n,i,r,o){if(t.bounds&&!t.bounds.contains(r,o)||!t.items)return null;const a=n*e.pixelRatio,s=i*e.pixelRatio;return Ep(t,(l=>{let u,c,f;const d=l.bounds;if(d&&!d.contains(r,o))return;c=l.x||0,f=l.y||0;const h=c+(l.width||0),p=f+(l.height||0),m=l.clip;if(m&&(r<c||r>h||o<f||o>p))return;if(e.save(),e.translate(c,f),c=r-c,f=o-f,m&&Ah(l)&&!Wp(e,l,a,s))return e.restore(),null;const g=l.strokeForeground,y=!1!==t.interactive;return y&&g&&l.stroke&&qp(e,l,a,s)?(e.restore(),l):(u=Ep(l,(e=>function(e,t,n){return(!1!==e.interactive||"group"===e.marktype)&&e.bounds&&e.bounds.contains(t,n)}(e,c,f)?this.pick(e,n,i,c,f):null)),!u&&y&&(l.fill||!g&&l.stroke)&&Ip(e,l,a,s)&&(u=l),e.restore(),u||null)}))},isect:fp,content:function(e,t,n){e("clip-path",t.clip?Fh(n,t,t):null)},background:function(e,t){e("class","background"),e("aria-hidden",!0),Bp(e,t)},foreground:function(e,t){e("class","foreground"),e("aria-hidden",!0),t.strokeForeground?Bp(e,t):e("d","")}},Xp={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",version:"1.1"};function Jp(e,t){var n=e.image;return(!n||e.url&&e.url!==n.url)&&(n={complete:!1,width:0,height:0},t.loadImage(e.url).then((t=>{e.image=t,e.image.url=e.url}))),n}function Gp(e,t){return null!=e.width?e.width:t&&t.width?!1!==e.aspect&&e.height?e.height*t.width/t.height:t.width:0}function Vp(e,t){return null!=e.height?e.height:t&&t.height?!1!==e.aspect&&e.width?e.width*t.height/t.width:t.height:0}function Yp(e,t){return"center"===e?t/2:"right"===e?t:0}function Kp(e,t){return"middle"===e?t/2:"bottom"===e?t:0}var Zp={type:"image",tag:"image",nested:!1,attr:function(e,t,n){const i=Jp(t,n),r=Gp(t,i),o=Vp(t,i),a=(t.x||0)-Yp(t.align,r),s=(t.y||0)-Kp(t.baseline,o);e("href",!i.src&&i.toDataURL?i.toDataURL():i.src||"",Xp["xmlns:xlink"],"xlink:href"),e("transform",Fp(a,s)),e("width",r),e("height",o),e("preserveAspectRatio",!1===t.aspect?"none":"xMidYMid")},bound:function(e,t){const n=t.image,i=Gp(t,n),r=Vp(t,n),o=(t.x||0)-Yp(t.align,i),a=(t.y||0)-Kp(t.baseline,r);return e.set(o,a,o+i,a+r)},draw:function(e,t,n){kp(t,(t=>{if(n&&!n.intersects(t.bounds))return;const i=Jp(t,this);let r=Gp(t,i),o=Vp(t,i);if(0===r||0===o)return;let a,s,l,u,c=(t.x||0)-Yp(t.align,r),f=(t.y||0)-Kp(t.baseline,o);!1!==t.aspect&&(s=i.width/i.height,l=t.width/t.height,s===s&&l===l&&s!==l&&(l<s?(u=r/s,f+=(o-u)/2,o=u):(u=o*s,c+=(r-u)/2,r=u))),(i.complete||i.toDataURL)&&(pp(e,t),e.globalAlpha=null!=(a=t.opacity)?a:1,e.imageSmoothingEnabled=!1!==t.smooth,e.drawImage(i,c,f,r,o))}))},pick:Sp(),isect:m.yb,get:Jp,xOffset:Yp,yOffset:Kp},Qp=Rp("line",(function(e,t){const n=t[0],i=n.interpolate||"linear";return kh.curve(Ld(i,n.orient,n.tension)).context(e)(t)}),(function(e,t){for(var n,i,r=Math.pow(e[0].strokeWidth||1,2),o=e.length;--o>=0;)if(!1!==e[o].defined&&(n=e[o].x-t[0])*n+(i=e[o].y-t[1])*i<r)return e[o];return null}));function em(e,t){var n=t.path;if(null==n)return!0;var i=t.x||0,r=t.y||0,o=t.scaleX||1,a=t.scaleY||1,s=(t.angle||0)*Hd,l=t.pathCache;l&&l.path===n||((t.pathCache=l=Wd(n)).path=n),s&&e.rotate&&e.translate?(e.translate(i,r),e.rotate(s),th(e,l,0,0,o,a),e.rotate(-s),e.translate(-i,-r)):th(e,l,i,r,o,a)}var tm={type:"path",tag:"path",nested:!1,attr:function(e,t){var n=t.scaleX||1,i=t.scaleY||1;1===n&&1===i||e("vector-effect","non-scaling-stroke"),e("transform",function(e){return Fp(e.x||0,e.y||0)+(e.angle?" "+Op(e.angle):"")+(e.scaleX||e.scaleY?" "+function(e,t){return"scale("+e+","+t+")"}(e.scaleX||1,e.scaleY||1):"")}(t)),e("d",t.path)},bound:function(e,t){return em(np(e,t.angle),t)?e.set(0,0,0,0):Lh(e,t,!0)},draw:Dp(em),pick:Cp(em),isect:up(em)};function nm(e,t){e.beginPath(),Sh(e,t)}var im={type:"rect",tag:"path",nested:!1,attr:function(e,t){e("d",Sh(null,t))},bound:function(e,t){var n,i;return Lh(e.set(n=t.x||0,i=t.y||0,n+t.width||0,i+t.height||0),t)},draw:Dp(nm),pick:Cp(nm),isect:fp};function rm(e,t,n){var i,r,o,a;return!(!t.stroke||!xp(e,t,n))&&(i=t.x||0,r=t.y||0,o=null!=t.x2?t.x2:i,a=null!=t.y2?t.y2:r,e.beginPath(),e.moveTo(i,r),e.lineTo(o,a),!0)}var om={type:"rule",tag:"line",nested:!1,attr:function(e,t){e("transform",Tp(t)),e("x2",null!=t.x2?t.x2-(t.x||0):0),e("y2",null!=t.y2?t.y2-(t.y||0):0)},bound:function(e,t){var n,i;return Lh(e.set(n=t.x||0,i=t.y||0,null!=t.x2?t.x2:n,null!=t.y2?t.y2:i),t)},draw:function(e,t,n){kp(t,(t=>{if(!n||n.intersects(t.bounds)){var i=null==t.opacity?1:t.opacity;i&&rm(e,t,i)&&(pp(e,t),e.stroke())}}))},pick:Sp((function(e,t,n,i){return!!e.isPointInStroke&&(rm(e,t,1)&&e.isPointInStroke(n,i))})),isect:dp},am=Np("shape",(function(e,t){return(t.mark.shape||t.shape).context(e)(t)})),sm=Np("symbol",(function(e,t){return Dh.context(e)(t)}),cp);const lm=(0,m.$m)();var um={height:mm,measureWidth:hm,estimateWidth:fm,width:fm,canvas:cm};function cm(e){um.width=e&&sp?hm:fm}function fm(e,t){return dm(bm(e,t),mm(e))}function dm(e,t){return~~(.8*e.length*t)}function hm(e,t){return mm(e)<=0||!(t=bm(e,t))?0:pm(t,_m(e))}function pm(e,t){const n=`(${t}) ${e}`;let i=lm.get(n);return void 0===i&&(sp.font=t,i=sp.measureText(e).width,lm.set(n,i)),i}function mm(e){return null!=e.fontSize?+e.fontSize||0:11}function gm(e){return null!=e.lineHeight?e.lineHeight:mm(e)+2}function ym(e){return t=e.lineBreak&&e.text&&!(0,m.kJ)(e.text)?e.text.split(e.lineBreak):e.text,(0,m.kJ)(t)?t.length>1?t:t[0]:t;var t}function vm(e){const t=ym(e);return((0,m.kJ)(t)?t.length-1:0)*gm(e)}function bm(e,t){const n=null==t?"":(t+"").trim();return e.limit>0&&n.length?function(e,t){var n=+e.limit,i=function(e){if(um.width===hm){const t=_m(e);return e=>pm(e,t)}if(um.width===fm){const t=mm(e);return e=>dm(e,t)}return t=>um.width(e,t)}(e);if(i(t)<n)return t;var r,o=e.ellipsis||"\u2026",a="rtl"===e.dir,s=0,l=t.length;if(n-=i(o),a){for(;s<l;)r=s+l>>>1,i(t.slice(r))>n?s=r+1:l=r;return o+t.slice(s)}for(;s<l;)r=1+(s+l>>>1),i(t.slice(0,r))<n?s=r:l=r-1;return t.slice(0,s)+o}(e,n):n}function xm(e,t){var n=e.font;return(t&&n?String(n).replace(/"/g,"'"):n)||"sans-serif"}function _m(e,t){return(e.fontStyle?e.fontStyle+" ":"")+(e.fontVariant?e.fontVariant+" ":"")+(e.fontWeight?e.fontWeight+" ":"")+mm(e)+"px "+xm(e,t)}function wm(e){var t=e.baseline,n=mm(e);return Math.round("top"===t?.79*n:"middle"===t?.3*n:"bottom"===t?-.21*n:"line-top"===t?.29*n+.5*gm(e):"line-bottom"===t?.29*n-.5*gm(e):0)}cm(!0);const km={left:"start",center:"middle",right:"end"},Em=new Oh;function Dm(e){var t,n=e.x||0,i=e.y||0,r=e.radius||0;return r&&(t=(e.theta||0)-Xd,n+=r*Math.cos(t),i+=r*Math.sin(t)),Em.x1=n,Em.y1=i,Em}function $m(e,t,n){var i,r=um.height(t),o=t.align,a=Dm(t),s=a.x1,l=a.y1,u=t.dx||0,c=(t.dy||0)+wm(t)-Math.round(.8*r),f=ym(t);if((0,m.kJ)(f)?(r+=gm(t)*(f.length-1),i=f.reduce(((e,n)=>Math.max(e,um.width(t,n))),0)):i=um.width(t,f),"center"===o?u-=i/2:"right"===o&&(u-=i),e.set(u+=s,c+=l,u+i,c+r),t.angle&&!n)e.rotate(t.angle*Hd,s,l);else if(2===n)return e.rotatedPoints(t.angle*Hd,s,l);return e}var Am={type:"text",tag:"text",nested:!1,attr:function(e,t){var n,i=t.dx||0,r=(t.dy||0)+wm(t),o=Dm(t),a=o.x1,s=o.y1,l=t.angle||0;e("text-anchor",km[t.align]||"start"),l?(n=Fp(a,s)+" "+Op(l),(i||r)&&(n+=" "+Fp(i,r))):n=Fp(a+i,s+r),e("transform",n)},bound:$m,draw:function(e,t,n){kp(t,(t=>{var i,r,o,a,s,l,u,c=null==t.opacity?1:t.opacity;if(!(n&&!n.intersects(t.bounds)||0===c||t.fontSize<=0||null==t.text||0===t.text.length)){if(e.font=_m(t),e.textAlign=t.align||"left",r=(i=Dm(t)).x1,o=i.y1,t.angle&&(e.save(),e.translate(r,o),e.rotate(t.angle*Hd),r=o=0),r+=t.dx||0,o+=(t.dy||0)+wm(t),l=ym(t),pp(e,t),(0,m.kJ)(l))for(s=gm(t),a=0;a<l.length;++a)u=bm(t,l[a]),t.fill&&vp(e,t,c)&&e.fillText(u,r,o),t.stroke&&xp(e,t,c)&&e.strokeText(u,r,o),o+=s;else u=bm(t,l),t.fill&&vp(e,t,c)&&e.fillText(u,r,o),t.stroke&&xp(e,t,c)&&e.strokeText(u,r,o);t.angle&&e.restore()}}))},pick:Sp((function(e,t,n,i,r,o){if(t.fontSize<=0)return!1;if(!t.angle)return!0;var a=Dm(t),s=a.x1,l=a.y1,u=$m(Em,t,1),c=-t.angle*Hd,f=Math.cos(c),d=Math.sin(c),h=f*r-d*o+(s-f*s+d*l),p=d*r+f*o+(l-d*s-f*l);return u.contains(h,p)})),isect:function(e,t){const n=$m(Em,e,2);return hp(t,n[0],n[1],n[2],n[3])||hp(t,n[0],n[1],n[4],n[5])||hp(t,n[4],n[5],n[6],n[7])||hp(t,n[2],n[3],n[6],n[7])}},Sm=Rp("trail",(function(e,t){return $h.context(e)(t)}),(function(e,t){for(var n,i,r=e.length;--r>=0;)if(!1!==e[r].defined&&(n=e[r].x-t[0])*n+(i=e[r].y-t[1])*i<(n=e[r].size||1)*n)return e[r];return null})),Mm={arc:zp,area:Pp,group:Hp,image:Zp,line:Qp,path:tm,rect:im,rule:om,shape:am,symbol:sm,text:Am,trail:Sm};function Cm(e,t,n){var i=Mm[e.mark.marktype],r=t||i.bound;return i.nested&&(e=e.mark),r(e.bounds||(e.bounds=new Oh),e,n)}var Fm={mark:null};function Om(e,t,n){var i,r,o,a,s=Mm[e.marktype],l=s.bound,u=e.items,c=u&&u.length;if(s.nested)return c?o=u[0]:(Fm.mark=e,o=Fm),a=Cm(o,l,n),t=t&&t.union(a)||a;if(t=t||e.bounds&&e.bounds.clear()||new Oh,c)for(i=0,r=u.length;i<r;++i)t.union(Cm(u[i],l,n));return e.bounds=t}const Tm=["marktype","name","role","interactive","clip","items","zindex","x","y","width","height","align","baseline","fill","fillOpacity","opacity","blend","stroke","strokeOpacity","strokeWidth","strokeCap","strokeDash","strokeDashOffset","strokeForeground","strokeOffset","startAngle","endAngle","innerRadius","outerRadius","cornerRadius","padAngle","cornerRadiusTopLeft","cornerRadiusTopRight","cornerRadiusBottomLeft","cornerRadiusBottomRight","interpolate","tension","orient","defined","url","aspect","smooth","path","scaleX","scaleY","x2","y2","size","shape","text","angle","theta","radius","dir","dx","dy","ellipsis","limit","lineBreak","lineHeight","font","fontSize","fontWeight","fontStyle","fontVariant","description","aria","ariaRole","ariaRoleDescription"];function Nm(e,t){return JSON.stringify(e,Tm,t)}function zm(e){return Rm("string"===typeof e?JSON.parse(e):e)}function Rm(e){var t,n,i,r=e.marktype,o=e.items;if(o)for(n=0,i=o.length;n<i;++n)t=r?"mark":"group",o[n][t]=e,o[n].zindex&&(o[n][t].zdirty=!0),"group"===(r||t)&&Rm(o[n]);return r&&Om(e),e}function Pm(e){arguments.length?this.root=zm(e):(this.root=Lm({marktype:"group",name:"root",role:"frame"}),this.root.items=[new Nh(this.root)])}function Lm(e,t){const n={bounds:new Oh,clip:!!e.clip,group:t,interactive:!1!==e.interactive,items:[],marktype:e.marktype,name:e.name||void 0,role:e.role||void 0,zindex:e.zindex||0};return null!=e.aria&&(n.aria=e.aria),e.description&&(n.description=e.description),n}function Um(e,t,n){return!e&&"undefined"!==typeof document&&document.createElement&&(e=document),e?n?e.createElementNS(n,t):e.createElement(t):null}function Bm(e,t){t=t.toLowerCase();for(var n=e.childNodes,i=0,r=n.length;i<r;++i)if(n[i].tagName.toLowerCase()===t)return n[i]}function jm(e,t,n,i){var r,o=e.childNodes[t];return o&&o.tagName.toLowerCase()===n.toLowerCase()||(r=o||null,o=Um(e.ownerDocument,n,i),e.insertBefore(o,r)),o}function Im(e,t){for(var n=e.childNodes,i=n.length;i>t;)e.removeChild(n[--i]);return e}function qm(e){return"mark-"+e.marktype+(e.role?" role-"+e.role:"")+(e.name?" "+e.name:"")}function Wm(e,t){const n=t.getBoundingClientRect();return[e.clientX-n.left-(t.clientLeft||0),e.clientY-n.top-(t.clientTop||0)]}function Hm(e,t){this._active=null,this._handlers={},this._loader=e||yr(),this._tooltip=t||Xm}function Xm(e,t,n,i){e.element().setAttribute("title",i||"")}function Jm(e){this._el=null,this._bgcolor=null,this._loader=new zh(e)}Pm.prototype={toJSON(e){return Nm(this.root,e||0)},mark(e,t,n){const i=Lm(e,t=t||this.root.items[0]);return t.items[n]=i,i.zindex&&(i.group.zdirty=!0),i}},Hm.prototype={initialize(e,t,n){return this._el=e,this._obj=n||null,this.origin(t)},element(){return this._el},canvas(){return this._el&&this._el.firstChild},origin(e){return arguments.length?(this._origin=e||[0,0],this):this._origin.slice()},scene(e){return arguments.length?(this._scene=e,this):this._scene},on(){},off(){},_handlerIndex(e,t,n){for(let i=e?e.length:0;--i>=0;)if(e[i].type===t&&(!n||e[i].handler===n))return i;return-1},handlers(e){const t=this._handlers,n=[];if(e)n.push(...t[this.eventName(e)]);else for(const i in t)n.push(...t[i]);return n},eventName(e){const t=e.indexOf(".");return t<0?e:e.slice(0,t)},handleHref(e,t,n){this._loader.sanitize(n,{context:"href"}).then((t=>{const n=new MouseEvent(e.type,e),i=Um(null,"a");for(const e in t)i.setAttribute(e,t[e]);i.dispatchEvent(n)})).catch((()=>{}))},handleTooltip(e,t,n){if(t&&null!=t.tooltip){t=function(e,t,n,i){var r,o,a=e&&e.mark;if(a&&(r=Mm[a.marktype]).tip){for((o=Wm(t,n))[0]-=i[0],o[1]-=i[1];e=e.mark.group;)o[0]-=e.x||0,o[1]-=e.y||0;e=r.tip(a.items,o)}return e}(t,e,this.canvas(),this._origin);const i=n&&t&&t.tooltip||null;this._tooltip.call(this._obj,this,e,t,i)}},getItemBoundingClientRect(e){const t=this.canvas();if(!t)return;const n=t.getBoundingClientRect(),i=this._origin,r=e.bounds,o=r.width(),a=r.height();let s=r.x1+i[0]+n.left,l=r.y1+i[1]+n.top;for(;e.mark&&(e=e.mark.group);)s+=e.x||0,l+=e.y||0;return{x:s,y:l,width:o,height:a,left:s,top:l,right:s+o,bottom:l+a}}},Jm.prototype={initialize(e,t,n,i,r){return this._el=e,this.resize(t,n,i,r)},element(){return this._el},canvas(){return this._el&&this._el.firstChild},background(e){return 0===arguments.length?this._bgcolor:(this._bgcolor=e,this)},resize(e,t,n,i){return this._width=e,this._height=t,this._origin=n||[0,0],this._scale=i||1,this},dirty(){},render(e,t){const n=this;return n._call=function(){n._render(e,t)},n._call(),n._call=null,n},_render(){},renderAsync(e,t){const n=this.render(e,t);return this._ready?this._ready.then((()=>n)):Promise.resolve(n)},_load(e,t){var n=this,i=n._loader[e](t);if(!n._ready){const e=n._call;n._ready=n._loader.ready().then((t=>{t&&e(),n._ready=null}))}return i},sanitizeURL(e){return this._load("sanitizeURL",e)},loadImage(e){return this._load("loadImage",e)}};const Gm="dragenter",Vm="dragleave",Ym="dragover",Km="pointerdown",Zm="pointermove",Qm="pointerout",eg="pointerover",tg="mousedown",ng="mousemove",ig="mouseout",rg="mouseover",og="click",ag="mousewheel",sg="touchstart",lg="touchmove",ug="touchend",cg=["keydown","keypress","keyup",Gm,Vm,Ym,Km,"pointerup",Zm,Qm,eg,tg,"mouseup",ng,ig,rg,og,"dblclick","wheel",ag,sg,lg,ug],fg=Zm,dg=Qm,hg=og;function pg(e,t){Hm.call(this,e,t),this._down=null,this._touch=null,this._first=!0,this._events={}}function mg(e,t){(e=>e===sg||e===lg||e===ug?[sg,lg,ug]:[e])(t).forEach((t=>function(e,t){const n=e.canvas();n&&!e._events[t]&&(e._events[t]=1,n.addEventListener(t,e[t]?n=>e[t](n):n=>e.fire(t,n)))}(e,t)))}function gg(e,t,n){t.forEach((t=>e.fire(t,n)))}function yg(e,t,n){return function(i){const r=this._active,o=this.pickEvent(i);o===r||(r&&r.exit||gg(this,n,i),this._active=o,gg(this,t,i)),gg(this,e,i)}}function vg(e){return function(t){gg(this,e,t),this._active=null}}function bg(e,t,n,i,r,o){const a="undefined"!==typeof HTMLElement&&e instanceof HTMLElement&&null!=e.parentNode,s=e.getContext("2d"),l=a?"undefined"!==typeof window&&window.devicePixelRatio||1:r;e.width=t*l,e.height=n*l;for(const u in o)s[u]=o[u];return a&&1!==l&&(e.style.width=t+"px",e.style.height=n+"px"),s.pixelRatio=l,s.setTransform(l,0,0,l,l*i[0],l*i[1]),e}function xg(e){Jm.call(this,e),this._options={},this._redraw=!1,this._dirty=new Oh,this._tempb=new Oh}(0,m.XW)(pg,Hm,{initialize(e,t,n){return this._canvas=e&&Bm(e,"canvas"),[og,tg,Km,Zm,Qm,Vm].forEach((e=>mg(this,e))),Hm.prototype.initialize.call(this,e,t,n)},canvas(){return this._canvas},context(){return this._canvas.getContext("2d")},events:cg,DOMMouseScroll(e){this.fire(ag,e)},pointermove:yg([Zm,ng],[eg,rg],[Qm,ig]),dragover:yg([Ym],[Gm],[Vm]),pointerout:vg([Qm,ig]),dragleave:vg([Vm]),pointerdown(e){this._down=this._active,this.fire(Km,e)},mousedown(e){this._down=this._active,this.fire(tg,e)},click(e){this._down===this._active&&(this.fire(og,e),this._down=null)},touchstart(e){this._touch=this.pickEvent(e.changedTouches[0]),this._first&&(this._active=this._touch,this._first=!1),this.fire(sg,e,!0)},touchmove(e){this.fire(lg,e,!0)},touchend(e){this.fire(ug,e,!0),this._touch=null},fire(e,t,n){const i=n?this._touch:this._active,r=this._handlers[e];if(t.vegaType=e,e===hg&&i&&i.href?this.handleHref(t,i,i.href):e!==fg&&e!==dg||this.handleTooltip(t,i,e!==dg),r)for(let o=0,a=r.length;o<a;++o)r[o].handler.call(this._obj,t,i)},on(e,t){const n=this.eventName(e),i=this._handlers;return this._handlerIndex(i[n],e,t)<0&&(mg(this,e),(i[n]||(i[n]=[])).push({type:e,handler:t})),this},off(e,t){const n=this.eventName(e),i=this._handlers[n],r=this._handlerIndex(i,e,t);return r>=0&&i.splice(r,1),this},pickEvent(e){const t=Wm(e,this._canvas),n=this._origin;return this.pick(this._scene,t[0],t[1],t[0]-n[0],t[1]-n[1])},pick(e,t,n,i,r){const o=this.context();return Mm[e.marktype].pick.call(this,o,e,t,n,i,r)}});const _g=Jm.prototype;function wg(e,t){Hm.call(this,e,t);const n=this;n._hrefHandler=kg(n,((e,t)=>{t&&t.href&&n.handleHref(e,t,t.href)})),n._tooltipHandler=kg(n,((e,t)=>{n.handleTooltip(e,t,e.type!==dg)}))}(0,m.XW)(xg,Jm,{initialize(e,t,n,i,r,o){return this._options=o||{},this._canvas=this._options.externalContext?null:tu(1,1,this._options.type),e&&this._canvas&&(Im(e,0).appendChild(this._canvas),this._canvas.setAttribute("class","marks")),_g.initialize.call(this,e,t,n,i,r)},resize(e,t,n,i){if(_g.resize.call(this,e,t,n,i),this._canvas)bg(this._canvas,this._width,this._height,this._origin,this._scale,this._options.context);else{const e=this._options.externalContext;e||(0,m.vU)("CanvasRenderer is missing a valid canvas or context"),e.scale(this._scale,this._scale),e.translate(this._origin[0],this._origin[1])}return this._redraw=!0,this},canvas(){return this._canvas},context(){return this._options.externalContext||(this._canvas?this._canvas.getContext("2d"):null)},dirty(e){const t=this._tempb.clear().union(e.bounds);let n=e.mark.group;for(;n;)t.translate(n.x||0,n.y||0),n=n.mark.group;this._dirty.union(t)},_render(e,t){const n=this.context(),i=this._origin,r=this._width,o=this._height,a=this._dirty,s=((e,t,n)=>(new Oh).set(0,0,t,n).translate(-e[0],-e[1]))(i,r,o);n.save();const l=this._redraw||a.empty()?(this._redraw=!1,s.expand(1)):function(e,t,n){return t.expand(1).round(),e.pixelRatio%1&&t.scale(e.pixelRatio).round().scale(1/e.pixelRatio),t.translate(-n[0]%1,-n[1]%1),e.beginPath(),e.rect(t.x1,t.y1,t.width(),t.height()),e.clip(),t}(n,s.intersect(a),i);return this.clear(-i[0],-i[1],r,o),this.draw(n,e,l,t),n.restore(),a.clear(),this},draw(e,t,n,i){if("group"!==t.marktype&&null!=i&&!i.includes(t.marktype))return;const r=Mm[t.marktype];t.clip&&function(e,t){var n=t.clip;e.save(),(0,m.mf)(n)?(e.beginPath(),n(e),e.clip()):Lp(e,t.group)}(e,t),r.draw.call(this,e,t,n,i),t.clip&&e.restore()},clear(e,t,n,i){const r=this._options,o=this.context();"pdf"===r.type||r.externalContext||o.clearRect(e,t,n,i),null!=this._bgcolor&&(o.fillStyle=this._bgcolor,o.fillRect(e,t,n,i))}});const kg=(e,t)=>n=>{let i=n.target.__data__;i=Array.isArray(i)?i[0]:i,n.vegaType=n.type,t.call(e._obj,n,i)};(0,m.XW)(wg,Hm,{initialize(e,t,n){let i=this._svg;return i&&(i.removeEventListener(hg,this._hrefHandler),i.removeEventListener(fg,this._tooltipHandler),i.removeEventListener(dg,this._tooltipHandler)),this._svg=i=e&&Bm(e,"svg"),i&&(i.addEventListener(hg,this._hrefHandler),i.addEventListener(fg,this._tooltipHandler),i.addEventListener(dg,this._tooltipHandler)),Hm.prototype.initialize.call(this,e,t,n)},canvas(){return this._svg},on(e,t){const n=this.eventName(e),i=this._handlers;if(this._handlerIndex(i[n],e,t)<0){const r={type:e,handler:t,listener:kg(this,t)};(i[n]||(i[n]=[])).push(r),this._svg&&this._svg.addEventListener(n,r.listener)}return this},off(e,t){const n=this.eventName(e),i=this._handlers[n],r=this._handlerIndex(i,e,t);return r>=0&&(this._svg&&this._svg.removeEventListener(n,i[r].listener),i.splice(r,1)),this}});const Eg="aria-hidden",Dg="aria-label",$g="role",Ag="aria-roledescription",Sg="graphics-object",Mg="graphics-symbol",Cg=(e,t,n)=>({[$g]:e,[Ag]:t,[Dg]:n||void 0}),Fg=(0,m.Rg)(["axis-domain","axis-grid","axis-label","axis-tick","axis-title","legend-band","legend-entry","legend-gradient","legend-label","legend-title","legend-symbol","title"]),Og={axis:{desc:"axis",caption:function(e){const t=e.datum,n=e.orient,i=t.title?Pg(e):null,r=e.context,o=r.scales[t.scale].value,a=r.dataflow.locale(),s=o.type;return("left"===n||"right"===n?"Y":"X")+"-axis"+(i?` titled '${i}'`:"")+` for a ${Gf(s)?"discrete":s} scale`+` with ${Cd(a,o,e)}`}},legend:{desc:"legend",caption:function(e){const t=e.datum,n=t.title?Pg(e):null,i=`${t.type||""} legend`.trim(),r=t.scales,o=Object.keys(r),a=e.context,s=a.scales[r[o[0]]].value,l=a.dataflow.locale();return function(e){return e.length?e[0].toUpperCase()+e.slice(1):e}(i)+(n?` titled '${n}'`:"")+` for ${function(e){return e=e.map((e=>e+("fill"===e||"stroke"===e?" color":""))),e.length<2?e[0]:e.slice(0,-1).join(", ")+" and "+(0,m.fj)(e)}(o)}`+` with ${Cd(l,s,e)}`}},"title-text":{desc:"title",caption:e=>`Title text '${Rg(e)}'`},"title-subtitle":{desc:"subtitle",caption:e=>`Subtitle text '${Rg(e)}'`}},Tg={ariaRole:$g,ariaRoleDescription:Ag,description:Dg};function Ng(e,t){const n=!1===t.aria;if(e(Eg,n||void 0),n||null==t.description)for(const i in Tg)e(Tg[i],void 0);else{const n=t.mark.marktype;e(Dg,t.description),e($g,t.ariaRole||("group"===n?Sg:Mg)),e(Ag,t.ariaRoleDescription||`${n} mark`)}}function zg(e){return!1===e.aria?{[Eg]:!0}:Fg[e.role]?null:Og[e.role]?function(e,t){try{const n=e.items[0],i=t.caption||(()=>"");return Cg(t.role||Mg,t.desc,n.description||i(n))}catch(n){return null}}(e,Og[e.role]):function(e){const t=e.marktype,n="group"===t||"text"===t||e.items.some((e=>null!=e.description&&!1!==e.aria));return Cg(n?Sg:Mg,`${t} mark container`,e.description)}(e)}function Rg(e){return(0,m.IX)(e.text).join(" ")}function Pg(e){try{return(0,m.IX)((0,m.fj)(e.items).items[0].text).join(" ")}catch(t){return null}}const Lg=e=>(e+"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;"),Ug=e=>Lg(e).replace(/"/g,"&quot;").replace(/\t/g,"&#x9;").replace(/\n/g,"&#xA;").replace(/\r/g,"&#xD;");function Bg(){let e="",t="",n="";const i=[],r=()=>t=n="",o=(e,n)=>(null!=n&&(t+=` ${e}="${Ug(n)}"`),a),a={open(s){(o=>{t&&(e+=`${t}>${n}`,r()),i.push(o)})(s),t="<"+s;for(var l=arguments.length,u=new Array(l>1?l-1:0),c=1;c<l;c++)u[c-1]=arguments[c];for(const e of u)for(const t in e)o(t,e[t]);return a},close(){const o=i.pop();return e+=t?t+(n?`>${n}</${o}>`:"/>"):`</${o}>`,r(),a},attr:o,text:e=>(n+=Lg(e),a),toString:()=>e};return a}const jg=e=>Ig(Bg(),e)+"";function Ig(e,t){if(e.open(t.tagName),t.hasAttributes()){const n=t.attributes,i=n.length;for(let t=0;t<i;++t)e.attr(n[t].name,n[t].value)}if(t.hasChildNodes()){const n=t.childNodes;for(const t of n)3===t.nodeType?e.text(t.nodeValue):Ig(e,t)}return e.close()}const qg={fill:"fill",fillOpacity:"fill-opacity",stroke:"stroke",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",strokeCap:"stroke-linecap",strokeJoin:"stroke-linejoin",strokeDash:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeMiterLimit:"stroke-miterlimit",opacity:"opacity"},Wg={blend:"mix-blend-mode"},Hg={fill:"none","stroke-miterlimit":10},Xg="http://www.w3.org/2000/xmlns/",Jg=Xp.xmlns;function Gg(e){Jm.call(this,e),this._dirtyID=0,this._dirty=[],this._svg=null,this._root=null,this._defs=null}const Vg=Jm.prototype;function Yg(e,t){for(;e&&e.dirty!==t;e=e.mark.group){if(e.dirty=t,!e.mark||e.mark.dirty===t)return;e.mark.dirty=t}}function Kg(e,t,n){let i,r,o;if("radial"===t.gradient){let i=jm(e,n++,"pattern",Jg);oy(i,{id:Od+t.id,viewBox:"0,0,1,1",width:"100%",height:"100%",preserveAspectRatio:"xMidYMid slice"}),i=jm(i,0,"rect",Jg),oy(i,{width:1,height:1,fill:`url(${sy()}#${t.id})`}),oy(e=jm(e,n++,"radialGradient",Jg),{id:t.id,fx:t.x1,fy:t.y1,fr:t.r1,cx:t.x2,cy:t.y2,r:t.r2})}else oy(e=jm(e,n++,"linearGradient",Jg),{id:t.id,x1:t.x1,x2:t.x2,y1:t.y1,y2:t.y2});for(i=0,r=t.stops.length;i<r;++i)o=jm(e,i,"stop",Jg),o.setAttribute("offset",t.stops[i].offset),o.setAttribute("stop-color",t.stops[i].color);return Im(e,i),n}function Zg(e,t,n){let i;return(e=jm(e,n,"clipPath",Jg)).setAttribute("id",t.id),t.path?(i=jm(e,0,"path",Jg),i.setAttribute("d",t.path)):(i=jm(e,0,"rect",Jg),oy(i,{x:0,y:0,width:t.width,height:t.height})),Im(e,1),n+1}function Qg(e,t,n,i,r){let o,a=e._svg;if(!a&&(o=t.ownerDocument,a=Um(o,i,Jg),e._svg=a,e.mark&&(a.__data__=e,a.__values__={fill:"default"},"g"===i))){const t=Um(o,"path",Jg);a.appendChild(t),t.__data__=e;const n=Um(o,"g",Jg);a.appendChild(n),n.__data__=e;const i=Um(o,"path",Jg);a.appendChild(i),i.__data__=e,i.__values__={fill:"default"}}return(a.ownerSVGElement!==r||function(e,t){return e.parentNode&&e.parentNode.childNodes.length>1&&e.previousSibling!=t}(a,n))&&t.insertBefore(a,n?n.nextSibling:t.firstChild),a}(0,m.XW)(Gg,Jm,{initialize(e,t,n,i,r){return this._defs={},this._clearDefs(),e&&(this._svg=jm(e,0,"svg",Jg),this._svg.setAttributeNS(Xg,"xmlns",Jg),this._svg.setAttributeNS(Xg,"xmlns:xlink",Xp["xmlns:xlink"]),this._svg.setAttribute("version",Xp.version),this._svg.setAttribute("class","marks"),Im(e,1),this._root=jm(this._svg,0,"g",Jg),oy(this._root,Hg),Im(this._svg,1)),this.background(this._bgcolor),Vg.initialize.call(this,e,t,n,i,r)},background(e){return arguments.length&&this._svg&&this._svg.style.setProperty("background-color",e),Vg.background.apply(this,arguments)},resize(e,t,n,i){return Vg.resize.call(this,e,t,n,i),this._svg&&(oy(this._svg,{width:this._width*this._scale,height:this._height*this._scale,viewBox:`0 0 ${this._width} ${this._height}`}),this._root.setAttribute("transform",`translate(${this._origin})`)),this._dirty=[],this},canvas(){return this._svg},svg(){const e=this._svg,t=this._bgcolor;if(!e)return null;let n;t&&(e.removeAttribute("style"),n=jm(e,0,"rect",Jg),oy(n,{width:this._width,height:this._height,fill:t}));const i=jg(e);return t&&(e.removeChild(n),this._svg.style.setProperty("background-color",t)),i},_render(e,t){return this._dirtyCheck()&&(this._dirtyAll&&this._clearDefs(),this.mark(this._root,e,void 0,t),Im(this._root,1)),this.defs(),this._dirty=[],++this._dirtyID,this},dirty(e){e.dirty!==this._dirtyID&&(e.dirty=this._dirtyID,this._dirty.push(e))},isDirty(e){return this._dirtyAll||!e._svg||!e._svg.ownerSVGElement||e.dirty===this._dirtyID},_dirtyCheck(){this._dirtyAll=!0;const e=this._dirty;if(!e.length||!this._dirtyID)return!0;const t=++this._dirtyID;let n,i,r,o,a,s,l;for(a=0,s=e.length;a<s;++a)n=e[a],i=n.mark,i.marktype!==r&&(r=i.marktype,o=Mm[r]),i.zdirty&&i.dirty!==t&&(this._dirtyAll=!1,Yg(n,t),i.items.forEach((e=>{e.dirty=t}))),i.zdirty||(n.exit?(o.nested&&i.items.length?(l=i.items[0],l._svg&&this._update(o,l._svg,l)):n._svg&&(l=n._svg.parentNode,l&&l.removeChild(n._svg)),n._svg=null):(n=o.nested?i.items[0]:n,n._update!==t&&(n._svg&&n._svg.ownerSVGElement?this._update(o,n._svg,n):(this._dirtyAll=!1,Yg(n,t)),n._update=t)));return!this._dirtyAll},mark(e,t,n,i){if(!this.isDirty(t))return t._svg;const r=this._svg,o=t.marktype,a=Mm[o],s=!1===t.interactive?"none":null,l="g"===a.tag,u=Qg(t,e,n,"g",r);if("group"!==o&&null!=i&&!i.includes(o))return Im(u,0),t._svg;u.setAttribute("class",qm(t));const c=zg(t);for(const p in c)ay(u,p,c[p]);l||ay(u,"pointer-events",s),ay(u,"clip-path",t.clip?Fh(this,t,t.group):null);let f=null,d=0;const h=e=>{const t=this.isDirty(e),n=Qg(e,u,f,a.tag,r);t&&(this._update(a,n,e),l&&function(e,t,n,i){t=t.lastChild.previousSibling;let r,o=0;kp(n,(n=>{r=e.mark(t,n,r,i),++o})),Im(t,1+o)}(this,n,e,i)),f=n,++d};return a.nested?t.items.length&&h(t.items[0]):kp(t,h),Im(u,d),u},_update(e,t,n){ey=t,ty=t.__values__,Ng(iy,n),e.attr(iy,n,this);const i=ny[e.type];i&&i.call(this,e,t,n),ey&&this.style(ey,n)},style(e,t){if(null!=t){for(const n in qg){let i="font"===n?xm(t):t[n];if(i===ty[n])continue;const r=qg[n];null==i?e.removeAttribute(r):(Td(i)&&(i=Nd(i,this._defs.gradient,sy())),e.setAttribute(r,i+"")),ty[n]=i}for(const n in Wg)ry(e,Wg[n],t[n])}},defs(){const e=this._svg,t=this._defs;let n=t.el,i=0;for(const r in t.gradient)n||(t.el=n=jm(e,1,"defs",Jg)),i=Kg(n,t.gradient[r],i);for(const r in t.clipping)n||(t.el=n=jm(e,1,"defs",Jg)),i=Zg(n,t.clipping[r],i);n&&(0===i?(e.removeChild(n),t.el=null):Im(n,i))},_clearDefs(){const e=this._defs;e.gradient={},e.clipping={}}});let ey=null,ty=null;const ny={group(e,t,n){const i=ey=t.childNodes[2];ty=i.__values__,e.foreground(iy,n,this),ty=t.__values__,ey=t.childNodes[1],e.content(iy,n,this);const r=ey=t.childNodes[0];e.background(iy,n,this);const o=!1===n.mark.interactive?"none":null;if(o!==ty.events&&(ay(i,"pointer-events",o),ay(r,"pointer-events",o),ty.events=o),n.strokeForeground&&n.stroke){const e=n.fill;ay(i,"display",null),this.style(r,n),ay(r,"stroke",null),e&&(n.fill=null),ty=i.__values__,this.style(i,n),e&&(n.fill=e),ey=null}else ay(i,"display","none")},image(e,t,n){!1===n.smooth?(ry(t,"image-rendering","optimizeSpeed"),ry(t,"image-rendering","pixelated")):ry(t,"image-rendering",null)},text(e,t,n){const i=ym(n);let r,o,a,s;(0,m.kJ)(i)?(o=i.map((e=>bm(n,e))),r=o.join("\n"),r!==ty.text&&(Im(t,0),a=t.ownerDocument,s=gm(n),o.forEach(((e,i)=>{const r=Um(a,"tspan",Jg);r.__data__=n,r.textContent=e,i&&(r.setAttribute("x",0),r.setAttribute("dy",s)),t.appendChild(r)})),ty.text=r)):(o=bm(n,i),o!==ty.text&&(t.textContent=o,ty.text=o)),ay(t,"font-family",xm(n)),ay(t,"font-size",mm(n)+"px"),ay(t,"font-style",n.fontStyle),ay(t,"font-variant",n.fontVariant),ay(t,"font-weight",n.fontWeight)}};function iy(e,t,n){t!==ty[e]&&(n?function(e,t,n,i){null!=n?e.setAttributeNS(i,t,n):e.removeAttributeNS(i,t)}(ey,e,t,n):ay(ey,e,t),ty[e]=t)}function ry(e,t,n){n!==ty[t]&&(null==n?e.style.removeProperty(t):e.style.setProperty(t,n+""),ty[t]=n)}function oy(e,t){for(const n in t)ay(e,n,t[n])}function ay(e,t,n){null!=n?e.setAttribute(t,n):e.removeAttribute(t)}function sy(){let e;return"undefined"===typeof window?"":(e=window.location).hash?e.href.slice(0,-e.hash.length):e.href}function ly(e){Jm.call(this,e),this._text=null,this._defs={gradient:{},clipping:{}}}(0,m.XW)(ly,Jm,{svg(){return this._text},_render(e){const t=Bg();t.open("svg",(0,m.l7)({},Xp,{class:"marks",width:this._width*this._scale,height:this._height*this._scale,viewBox:`0 0 ${this._width} ${this._height}`}));const n=this._bgcolor;return n&&"transparent"!==n&&"none"!==n&&t.open("rect",{width:this._width,height:this._height,fill:n}).close(),t.open("g",Hg,{transform:"translate("+this._origin+")"}),this.mark(t,e),t.close(),this.defs(t),this._text=t.close()+"",this},mark(e,t){const n=Mm[t.marktype],i=n.tag,r=[Ng,n.attr];e.open("g",{class:qm(t),"clip-path":t.clip?Fh(this,t,t.group):null},zg(t),{"pointer-events":"g"!==i&&!1===t.interactive?"none":null});const o=o=>{const a=this.href(o);if(a&&e.open("a",a),e.open(i,this.attr(t,o,r,"g"!==i?i:null)),"text"===i){const t=ym(o);if((0,m.kJ)(t)){const n={x:0,dy:gm(o)};for(let i=0;i<t.length;++i)e.open("tspan",i?n:null).text(bm(o,t[i])).close()}else e.text(bm(o,t))}else if("g"===i){const i=o.strokeForeground,r=o.fill,a=o.stroke;i&&a&&(o.stroke=null),e.open("path",this.attr(t,o,n.background,"bgrect")).close(),e.open("g",this.attr(t,o,n.content)),kp(o,(t=>this.mark(e,t))),e.close(),i&&a?(r&&(o.fill=null),o.stroke=a,e.open("path",this.attr(t,o,n.foreground,"bgrect")).close(),r&&(o.fill=r)):e.open("path",this.attr(t,o,n.foreground,"bgfore")).close()}e.close(),a&&e.close()};return n.nested?t.items&&t.items.length&&o(t.items[0]):kp(t,o),e.close()},href(e){const t=e.href;let n;if(t){if(n=this._hrefs&&this._hrefs[t])return n;this.sanitizeURL(t).then((e=>{e["xlink:href"]=e.href,e.href=null,(this._hrefs||(this._hrefs={}))[t]=e}))}return null},attr(e,t,n,i){const r={},o=(e,t,n,i)=>{r[i||e]=t};return Array.isArray(n)?n.forEach((e=>e(o,t,this))):n(o,t,this),i&&function(e,t,n,i,r){let o;if(null==t)return e;"bgrect"===i&&!1===n.interactive&&(e["pointer-events"]="none");if("bgfore"===i&&(!1===n.interactive&&(e["pointer-events"]="none"),e.display="none",null!==t.fill))return e;"image"===i&&!1===t.smooth&&(o=["image-rendering: optimizeSpeed;","image-rendering: pixelated;"]);"text"===i&&(e["font-family"]=xm(t),e["font-size"]=mm(t)+"px",e["font-style"]=t.fontStyle,e["font-variant"]=t.fontVariant,e["font-weight"]=t.fontWeight);for(const a in qg){let n=t[a];const i=qg[a];("transparent"!==n||"fill"!==i&&"stroke"!==i)&&null!=n&&(Td(n)&&(n=Nd(n,r.gradient,"")),e[i]=n)}for(const a in Wg){const e=t[a];null!=e&&(o=o||[],o.push(`${Wg[a]}: ${e};`))}o&&(e.style=o.join(" "))}(r,t,e,i,this._defs),r},defs(e){const t=this._defs.gradient,n=this._defs.clipping;if(0!==Object.keys(t).length+Object.keys(n).length){e.open("defs");for(const n in t){const i=t[n],r=i.stops;"radial"===i.gradient?(e.open("pattern",{id:Od+n,viewBox:"0,0,1,1",width:"100%",height:"100%",preserveAspectRatio:"xMidYMid slice"}),e.open("rect",{width:"1",height:"1",fill:"url(#"+n+")"}).close(),e.close(),e.open("radialGradient",{id:n,fx:i.x1,fy:i.y1,fr:i.r1,cx:i.x2,cy:i.y2,r:i.r2})):e.open("linearGradient",{id:n,x1:i.x1,x2:i.x2,y1:i.y1,y2:i.y2});for(let t=0;t<r.length;++t)e.open("stop",{offset:r[t].offset,"stop-color":r[t].color}).close();e.close()}for(const t in n){const i=n[t];e.open("clipPath",{id:t}),i.path?e.open("path",{d:i.path}).close():e.open("rect",{x:0,y:0,width:i.width,height:i.height}).close(),e.close()}e.close()}}});const uy={svgMarkTypes:["text"],svgOnTop:!0,debug:!1};function cy(e){uy.svgMarkTypes=e.svgMarkTypes??["text"],uy.svgOnTop=e.svgOnTop??!0,uy.debug=e.debug??!1}function fy(e){Jm.call(this,e),this._svgRenderer=new Gg(e),this._canvasRenderer=new xg(e)}const dy=Jm.prototype;function hy(e,t){pg.call(this,e,t)}(0,m.XW)(fy,Jm,{initialize(e,t,n,i,r){this._root_el=jm(e,0,"div");const o=jm(this._root_el,0,"div"),a=jm(this._root_el,1,"div");return this._root_el.style.position="relative",uy.debug||(o.style.height="100%",a.style.position="absolute",a.style.top="0",a.style.left="0",a.style.height="100%",a.style.width="100%"),this._svgEl=uy.svgOnTop?a:o,this._canvasEl=uy.svgOnTop?o:a,this._svgEl.style.pointerEvents="none",this._canvasRenderer.initialize(this._canvasEl,t,n,i,r),this._svgRenderer.initialize(this._svgEl,t,n,i,r),dy.initialize.call(this,e,t,n,i,r)},dirty(e){return uy.svgMarkTypes.includes(e.mark.marktype)?this._svgRenderer.dirty(e):this._canvasRenderer.dirty(e),this},_render(e,t){const n=(t??["arc","area","image","line","path","rect","rule","shape","symbol","text","trail"]).filter((e=>!uy.svgMarkTypes.includes(e)));this._svgRenderer.render(e,uy.svgMarkTypes),this._canvasRenderer.render(e,n)},resize(e,t,n,i){return dy.resize.call(this,e,t,n,i),this._svgRenderer.resize(e,t,n,i),this._canvasRenderer.resize(e,t,n,i),this},background(e){return uy.svgOnTop?this._canvasRenderer.background(e):this._svgRenderer.background(e),this}}),(0,m.XW)(hy,pg,{initialize(e,t,n){const i=jm(jm(e,0,"div"),uy.svgOnTop?0:1,"div");return pg.prototype.initialize.call(this,i,t,n)}});const py="canvas",my="hybrid",gy="none",yy={Canvas:py,PNG:"png",SVG:"svg",Hybrid:my,None:gy},vy={};function by(e,t){return e=String(e||"").toLowerCase(),arguments.length>1?(vy[e]=t,this):vy[e]}function xy(e,t,n){const i=[],r=(new Oh).union(t),o=e.marktype;return o?_y(e,r,n,i):"group"===o?wy(e,r,n,i):(0,m.vU)("Intersect scene must be mark node or group item.")}function _y(e,t,n,i){if(function(e,t,n){return e.bounds&&t.intersects(e.bounds)&&("group"===e.marktype||!1!==e.interactive&&(!n||n(e)))}(e,t,n)){const r=e.items,o=e.marktype,a=r.length;let s=0;if("group"===o)for(;s<a;++s)wy(r[s],t,n,i);else for(const e=Mm[o].isect;s<a;++s){const n=r[s];ky(n,t,e)&&i.push(n)}}return i}function wy(e,t,n,i){n&&n(e.mark)&&ky(e,t,Mm.group.isect)&&i.push(e);const r=e.items,o=r&&r.length;if(o){const a=e.x||0,s=e.y||0;t.translate(-a,-s);for(let e=0;e<o;++e)_y(r[e],t,n,i);t.translate(a,s)}return i}function ky(e,t,n){const i=e.bounds;return t.encloses(i)||t.intersects(i)&&n(e,t)}vy[py]=vy.png={renderer:xg,headless:xg,handler:pg},vy.svg={renderer:Gg,headless:ly,handler:wg},vy[my]={renderer:fy,headless:fy,handler:hy},vy[gy]={};const Ey=new Oh;function Dy(e){const t=e.clip;if((0,m.mf)(t))t(np(Ey.clear()));else{if(!t)return;Ey.set(0,0,e.group.width,e.group.height)}e.bounds.intersect(Ey)}const $y=1e-9;function Ay(e,t,n){return e===t||("path"===n?Sy(e,t):e instanceof Date&&t instanceof Date?+e===+t:(0,m.hj)(e)&&(0,m.hj)(t)?Math.abs(e-t)<=$y:e&&t&&((0,m.Kn)(e)||(0,m.Kn)(t))?function(e,t){var n,i,r=Object.keys(e),o=Object.keys(t);if(r.length!==o.length)return!1;for(r.sort(),o.sort(),i=r.length-1;i>=0;i--)if(r[i]!=o[i])return!1;for(i=r.length-1;i>=0;i--)if(!Ay(e[n=r[i]],t[n],n))return!1;return typeof e===typeof t}(e,t):e==t)}function Sy(e,t){return Ay(Wd(e),Wd(t))}function My(){Ch(),Fd=0}const Cy="top",Fy="left",Oy="right",Ty="bottom",Ny="top-left",zy="top-right",Ry="bottom-left",Py="bottom-right",Ly="start",Uy="middle",By="end",jy="x",Iy="y",qy="group",Wy="axis",Hy="title",Xy="frame",Jy="scope",Gy="legend",Vy="row-header",Yy="row-footer",Ky="row-title",Zy="column-header",Qy="column-footer",ev="column-title",tv="padding",nv="symbol",iv="fit",rv="fit-x",ov="fit-y",av="pad",sv="none",lv="all",uv="each",cv="flush",fv="column",dv="row";function hv(e){no.call(this,null,e)}function pv(e,t,n){return t(e.bounds.clear(),e,n)}(0,m.XW)(hv,no,{transform(e,t){const n=t.dataflow,i=e.mark,r=i.marktype,o=Mm[r],a=o.bound;let s,l=i.bounds;if(o.nested)i.items.length&&n.dirty(i.items[0]),l=pv(i,a),i.items.forEach((e=>{e.bounds.clear().union(l)}));else if(r===qy||e.modified())switch(t.visit(t.MOD,(e=>n.dirty(e))),l.clear(),i.items.forEach((e=>l.union(pv(e,a)))),i.role){case Wy:case Gy:case Hy:t.reflow()}else s=t.changed(t.REM),t.visit(t.ADD,(e=>{l.union(pv(e,a))})),t.visit(t.MOD,(e=>{s=s||l.alignsWith(e.bounds),n.dirty(e),l.union(pv(e,a))})),s&&(l.clear(),i.items.forEach((e=>l.union(e.bounds))));return Dy(i),t.modifies("bounds")}});const mv=":vega_identifier:";function gv(e){no.call(this,0,e)}function yv(e){no.call(this,null,e)}function vv(e){no.call(this,null,e)}gv.Definition={type:"Identifier",metadata:{modifies:!0},params:[{name:"as",type:"string",required:!0}]},(0,m.XW)(gv,no,{transform(e,t){const n=(r=t.dataflow)._signals[mv]||(r._signals[mv]=r.add(0)),i=e.as;var r;let o=n.value;return t.visit(t.ADD,(e=>e[i]=e[i]||++o)),n.set(this.value=o),t}}),(0,m.XW)(yv,no,{transform(e,t){let n=this.value;n||(n=t.dataflow.scenegraph().mark(e.markdef,function(e){const t=e.groups,n=e.parent;return t&&1===t.size?t.get(Object.keys(t.object)[0]):t&&n?t.lookup(n):null}(e),e.index),n.group.context=e.context,e.context.group||(e.context.group=n.group),n.source=this.source,n.clip=e.clip,n.interactive=e.interactive,this.value=n);const i=n.marktype===qy?Nh:Th;return t.visit(t.ADD,(e=>i.call(e,n))),(e.modified("clip")||e.modified("interactive"))&&(n.clip=e.clip,n.interactive=!!e.interactive,n.zdirty=!0,t.reflow()),n.items=t.source,t}});const bv={parity:e=>e.filter(((e,t)=>t%2?e.opacity=0:1)),greedy:(e,t)=>{let n;return e.filter(((e,i)=>i&&xv(n.bounds,e.bounds,t)?e.opacity=0:(n=e,1)))}},xv=(e,t,n)=>n>Math.max(t.x1-e.x2,e.x1-t.x2,t.y1-e.y2,e.y1-t.y2),_v=(e,t)=>{for(var n,i=1,r=e.length,o=e[0].bounds;i<r;o=n,++i)if(xv(o,n=e[i].bounds,t))return!0},wv=e=>{const t=e.bounds;return t.width()>1&&t.height()>1},kv=e=>(e.forEach((e=>e.opacity=1)),e),Ev=(e,t)=>e.reflow(t.modified()).modifies("opacity");function Dv(e){no.call(this,null,e)}(0,m.XW)(vv,no,{transform(e,t){const n=bv[e.method]||bv.parity,i=e.separation||0;let r,o,a=t.materialize(t.SOURCE).source;if(!a||!a.length)return;if(!e.method)return e.modified("method")&&(kv(a),t=Ev(t,e)),t;if(a=a.filter(wv),!a.length)return;if(e.sort&&(a=a.slice().sort(e.sort)),r=kv(a),t=Ev(t,e),r.length>=3&&_v(r,i)){do{r=n(r,i)}while(r.length>=3&&_v(r,i));r.length<3&&!(0,m.fj)(a).opacity&&(r.length>1&&((0,m.fj)(r).opacity=0),(0,m.fj)(a).opacity=1)}e.boundScale&&e.boundTolerance>=0&&(o=((e,t,n)=>{var i=e.range(),r=new Oh;return t===Cy||t===Ty?r.set(i[0],-1/0,i[1],1/0):r.set(-1/0,i[0],1/0,i[1]),r.expand(n||1),e=>r.encloses(e.bounds)})(e.boundScale,e.boundOrient,+e.boundTolerance),a.forEach((e=>{o(e)||(e.opacity=0)})));const s=r[0].mark.bounds.clear();return a.forEach((e=>{e.opacity&&s.union(e.bounds)})),t}}),(0,m.XW)(Dv,no,{transform(e,t){const n=t.dataflow;if(t.visit(t.ALL,(e=>n.dirty(e))),t.fields&&t.fields.zindex){const e=t.source&&t.source[0];e&&(e.mark.zdirty=!0)}}});const $v=new Oh;function Av(e,t,n){return e[t]===n?0:(e[t]=n,1)}function Sv(e){var t=e.items[0].orient;return t===Fy||t===Oy}function Mv(e,t,n,i){var r,o,a=t.items[0],s=a.datum,l=null!=a.translate?a.translate:.5,u=a.orient,c=function(e){let t=+e.grid;return[e.ticks?t++:-1,e.labels?t++:-1,t+ +e.domain]}(s),f=a.range,d=a.offset,h=a.position,p=a.minExtent,m=a.maxExtent,g=s.title&&a.items[c[2]].items[0],y=a.titlePadding,v=a.bounds,b=g&&vm(g),x=0,_=0;switch($v.clear().union(v),v.clear(),(r=c[0])>-1&&v.union(a.items[r].bounds),(r=c[1])>-1&&v.union(a.items[r].bounds),u){case Cy:x=h||0,_=-d,o=Math.max(p,Math.min(m,-v.y1)),v.add(0,-o).add(f,0),g&&Cv(e,g,o,y,b,0,-1,v);break;case Fy:x=-d,_=h||0,o=Math.max(p,Math.min(m,-v.x1)),v.add(-o,0).add(0,f),g&&Cv(e,g,o,y,b,1,-1,v);break;case Oy:x=n+d,_=h||0,o=Math.max(p,Math.min(m,v.x2)),v.add(0,0).add(o,f),g&&Cv(e,g,o,y,b,1,1,v);break;case Ty:x=h||0,_=i+d,o=Math.max(p,Math.min(m,v.y2)),v.add(0,0).add(f,o),g&&Cv(e,g,o,y,0,0,1,v);break;default:x=a.x,_=a.y}return Lh(v.translate(x,_),a),Av(a,"x",x+l)|Av(a,"y",_+l)&&(a.bounds=$v,e.dirty(a),a.bounds=v,e.dirty(a)),a.mark.bounds.clear().union(v)}function Cv(e,t,n,i,r,o,a,s){const l=t.bounds;if(t.auto){const s=a*(n+r+i);let u=0,c=0;e.dirty(t),o?u=(t.x||0)-(t.x=s):c=(t.y||0)-(t.y=s),t.mark.bounds.clear().union(l.translate(-u,-c)),e.dirty(t)}s.union(l)}const Fv=(e,t)=>Math.floor(Math.min(e,t)),Ov=(e,t)=>Math.ceil(Math.max(e,t));function Tv(e){return(new Oh).set(0,0,e.width||0,e.height||0)}function Nv(e){const t=e.bounds.clone();return t.empty()?t.set(0,0,0,0):t.translate(-(e.x||0),-(e.y||0))}function zv(e,t,n){const i=(0,m.Kn)(e)?e[t]:e;return null!=i?i:void 0!==n?n:0}function Rv(e){return e<0?Math.ceil(-e):0}function Pv(e,t,n){var i,r,o,a,s,l,u,c,f,d,h,p=!n.nodirty,m=n.bounds===cv?Tv:Nv,g=$v.set(0,0,0,0),y=zv(n.align,fv),v=zv(n.align,dv),b=zv(n.padding,fv),x=zv(n.padding,dv),_=n.columns||t.length,w=_<=0?1:Math.ceil(t.length/_),k=t.length,E=Array(k),D=Array(_),$=0,A=Array(k),S=Array(w),M=0,C=Array(k),F=Array(k),O=Array(k);for(r=0;r<_;++r)D[r]=0;for(r=0;r<w;++r)S[r]=0;for(r=0;r<k;++r)l=t[r],s=O[r]=m(l),l.x=l.x||0,C[r]=0,l.y=l.y||0,F[r]=0,o=r%_,a=~~(r/_),$=Math.max($,u=Math.ceil(s.x2)),M=Math.max(M,c=Math.ceil(s.y2)),D[o]=Math.max(D[o],u),S[a]=Math.max(S[a],c),E[r]=b+Rv(s.x1),A[r]=x+Rv(s.y1),p&&e.dirty(t[r]);for(r=0;r<k;++r)r%_===0&&(E[r]=0),r<_&&(A[r]=0);if(y===uv)for(o=1;o<_;++o){for(h=0,r=o;r<k;r+=_)h<E[r]&&(h=E[r]);for(r=o;r<k;r+=_)E[r]=h+D[o-1]}else if(y===lv){for(h=0,r=0;r<k;++r)r%_&&h<E[r]&&(h=E[r]);for(r=0;r<k;++r)r%_&&(E[r]=h+$)}else for(y=!1,o=1;o<_;++o)for(r=o;r<k;r+=_)E[r]+=D[o-1];if(v===uv)for(a=1;a<w;++a){for(h=0,i=(r=a*_)+_;r<i;++r)h<A[r]&&(h=A[r]);for(r=a*_;r<i;++r)A[r]=h+S[a-1]}else if(v===lv){for(h=0,r=_;r<k;++r)h<A[r]&&(h=A[r]);for(r=_;r<k;++r)A[r]=h+M}else for(v=!1,a=1;a<w;++a)for(i=(r=a*_)+_;r<i;++r)A[r]+=S[a-1];for(f=0,r=0;r<k;++r)f=E[r]+(r%_?f:0),C[r]+=f-t[r].x;for(o=0;o<_;++o)for(d=0,r=o;r<k;r+=_)d+=A[r],F[r]+=d-t[r].y;if(y&&zv(n.center,fv)&&w>1)for(r=0;r<k;++r)(f=(s=y===lv?$:D[r%_])-O[r].x2-t[r].x-C[r])>0&&(C[r]+=f/2);if(v&&zv(n.center,dv)&&1!==_)for(r=0;r<k;++r)(d=(s=v===lv?M:S[~~(r/_)])-O[r].y2-t[r].y-F[r])>0&&(F[r]+=d/2);for(r=0;r<k;++r)g.union(O[r].translate(C[r],F[r]));switch(f=zv(n.anchor,jy),d=zv(n.anchor,Iy),zv(n.anchor,fv)){case By:f-=g.width();break;case Uy:f-=g.width()/2}switch(zv(n.anchor,dv)){case By:d-=g.height();break;case Uy:d-=g.height()/2}for(f=Math.round(f),d=Math.round(d),g.clear(),r=0;r<k;++r)t[r].mark.bounds.clear();for(r=0;r<k;++r)(l=t[r]).x+=C[r]+=f,l.y+=F[r]+=d,g.union(l.mark.bounds.union(l.bounds.translate(C[r],F[r]))),p&&e.dirty(l);return g}function Lv(e,t,n){var i,r,o,a,s,l,u,c=function(e){var t,n,i=e.items,r=i.length,o=0;const a={marks:[],rowheaders:[],rowfooters:[],colheaders:[],colfooters:[],rowtitle:null,coltitle:null};for(;o<r;++o)if(n=(t=i[o]).items,t.marktype===qy)switch(t.role){case Wy:case Gy:case Hy:break;case Vy:a.rowheaders.push(...n);break;case Yy:a.rowfooters.push(...n);break;case Zy:a.colheaders.push(...n);break;case Qy:a.colfooters.push(...n);break;case Ky:a.rowtitle=n[0];break;case ev:a.coltitle=n[0];break;default:a.marks.push(...n)}return a}(t),f=c.marks,d=n.bounds===cv?Uv:Bv,h=n.offset,p=n.columns||f.length,m=p<=0?1:Math.ceil(f.length/p),g=m*p;const y=Pv(e,f,n);y.empty()&&y.set(0,0,0,0),c.rowheaders&&(l=zv(n.headerBand,dv,null),i=jv(e,c.rowheaders,f,p,m,-zv(h,"rowHeader"),Fv,0,d,"x1",0,p,1,l)),c.colheaders&&(l=zv(n.headerBand,fv,null),r=jv(e,c.colheaders,f,p,p,-zv(h,"columnHeader"),Fv,1,d,"y1",0,1,p,l)),c.rowfooters&&(l=zv(n.footerBand,dv,null),o=jv(e,c.rowfooters,f,p,m,zv(h,"rowFooter"),Ov,0,d,"x2",p-1,p,1,l)),c.colfooters&&(l=zv(n.footerBand,fv,null),a=jv(e,c.colfooters,f,p,p,zv(h,"columnFooter"),Ov,1,d,"y2",g-p,1,p,l)),c.rowtitle&&(s=zv(n.titleAnchor,dv),u=zv(h,"rowTitle"),u=s===By?o+u:i-u,l=zv(n.titleBand,dv,.5),Iv(e,c.rowtitle,u,0,y,l)),c.coltitle&&(s=zv(n.titleAnchor,fv),u=zv(h,"columnTitle"),u=s===By?a+u:r-u,l=zv(n.titleBand,fv,.5),Iv(e,c.coltitle,u,1,y,l))}function Uv(e,t){return"x1"===t?e.x||0:"y1"===t?e.y||0:"x2"===t?(e.x||0)+(e.width||0):"y2"===t?(e.y||0)+(e.height||0):void 0}function Bv(e,t){return e.bounds[t]}function jv(e,t,n,i,r,o,a,s,l,u,c,f,d,h){var p,m,g,y,v,b,x,_,w,k=n.length,E=0,D=0;if(!k)return E;for(p=c;p<k;p+=f)n[p]&&(E=a(E,l(n[p],u)));if(!t.length)return E;for(t.length>r&&(e.warn("Grid headers exceed limit: "+r),t=t.slice(0,r)),E+=o,m=0,y=t.length;m<y;++m)e.dirty(t[m]),t[m].mark.bounds.clear();for(p=c,m=0,y=t.length;m<y;++m,p+=f){for(v=(b=t[m]).mark.bounds,g=p;g>=0&&null==(x=n[g]);g-=d);s?(_=null==h?x.x:Math.round(x.bounds.x1+h*x.bounds.width()),w=E):(_=E,w=null==h?x.y:Math.round(x.bounds.y1+h*x.bounds.height())),v.union(b.bounds.translate(_-(b.x||0),w-(b.y||0))),b.x=_,b.y=w,e.dirty(b),D=a(D,v[u])}return D}function Iv(e,t,n,i,r,o){if(t){e.dirty(t);var a=n,s=n;i?a=Math.round(r.x1+o*r.width()):s=Math.round(r.y1+o*r.height()),t.bounds.translate(a-(t.x||0),s-(t.y||0)),t.mark.bounds.clear().union(t.bounds),t.x=a,t.y=s,e.dirty(t)}}function qv(e,t,n,i,r,o,a){const s=function(e,t){const n=e[t]||{};return(t,i)=>null!=n[t]?n[t]:null!=e[t]?e[t]:i}(n,t),l=function(e,t){let n=-1/0;return e.forEach((e=>{null!=e.offset&&(n=Math.max(n,e.offset))})),n>-1/0?n:t}(e,s("offset",0)),u=s("anchor",Ly),c=u===By?1:u===Uy?.5:0,f={align:uv,bounds:s("bounds",cv),columns:"vertical"===s("direction")?1:e.length,padding:s("margin",8),center:s("center"),nodirty:!0};switch(t){case Fy:f.anchor={x:Math.floor(i.x1)-l,column:By,y:c*(a||i.height()+2*i.y1),row:u};break;case Oy:f.anchor={x:Math.ceil(i.x2)+l,y:c*(a||i.height()+2*i.y1),row:u};break;case Cy:f.anchor={y:Math.floor(r.y1)-l,row:By,x:c*(o||r.width()+2*r.x1),column:u};break;case Ty:f.anchor={y:Math.ceil(r.y2)+l,x:c*(o||r.width()+2*r.x1),column:u};break;case Ny:f.anchor={x:l,y:l};break;case zy:f.anchor={x:o-l,y:l,column:By};break;case Ry:f.anchor={x:l,y:a-l,row:By};break;case Py:f.anchor={x:o-l,y:a-l,column:By,row:By}}return f}function Wv(e,t){var n,i,r=t.items[0],o=r.datum,a=r.orient,s=r.bounds,l=r.x,u=r.y;return r._bounds?r._bounds.clear().union(s):r._bounds=s.clone(),s.clear(),function(e,t,n){var i=t.padding,r=i-n.x,o=i-n.y;if(t.datum.title){var a=t.items[1].items[0],s=a.anchor,l=t.titlePadding||0,u=i-a.x,c=i-a.y;switch(a.orient){case Fy:r+=Math.ceil(a.bounds.width())+l;break;case Oy:case Ty:break;default:o+=a.bounds.height()+l}switch((r||o)&&Xv(e,n,r,o),a.orient){case Fy:c+=Hv(t,n,a,s,1,1);break;case Oy:u+=Hv(t,n,a,By,0,0)+l,c+=Hv(t,n,a,s,1,1);break;case Ty:u+=Hv(t,n,a,s,0,0),c+=Hv(t,n,a,By,-1,0,1)+l;break;default:u+=Hv(t,n,a,s,0,0)}(u||c)&&Xv(e,a,u,c),(u=Math.round(a.bounds.x1-i))<0&&(Xv(e,n,-u,0),Xv(e,a,-u,0))}else(r||o)&&Xv(e,n,r,o)}(e,r,r.items[0].items[0]),s=function(e,t){return e.items.forEach((e=>t.union(e.bounds))),t.x1=e.padding,t.y1=e.padding,t}(r,s),n=2*r.padding,i=2*r.padding,s.empty()||(n=Math.ceil(s.width()+n),i=Math.ceil(s.height()+i)),o.type===nv&&function(e){const t=e.reduce(((e,t)=>(e[t.column]=Math.max(t.bounds.x2-t.x,e[t.column]||0),e)),{});e.forEach((e=>{e.width=t[e.column],e.height=e.bounds.y2-e.y}))}(r.items[0].items[0].items[0].items),a!==sv&&(r.x=l=0,r.y=u=0),r.width=n,r.height=i,Lh(s.set(l,u,l+n,u+i),r),r.mark.bounds.clear().union(s),r}function Hv(e,t,n,i,r,o,a){const s="symbol"!==e.datum.type,l=n.datum.vgrad,u=(!s||!o&&l||a?t:t.items[0]).bounds[r?"y2":"x2"]-e.padding,c=l&&o?u:0,f=l&&o?0:u,d=r<=0?0:vm(n);return Math.round(i===Ly?c:i===By?f-d:.5*(u-d))}function Xv(e,t,n,i){t.x+=n,t.y+=i,t.bounds.translate(n,i),t.mark.bounds.translate(n,i),e.dirty(t)}function Jv(e){no.call(this,null,e)}function Gv(e,t){let n=0;if(void 0===t)for(let i of e)(i=+i)&&(n+=i);else{let i=-1;for(let r of e)(r=+t(r,++i,e))&&(n+=r)}return n}function Vv(e){no.call(this,null,e)}function Yv(e){no.call(this,null,e)}function Kv(){return Dr({})}function Zv(e){no.call(this,null,e)}function Qv(e){no.call(this,[],e)}(0,m.XW)(Jv,no,{transform(e,t){const n=t.dataflow;return e.mark.items.forEach((t=>{e.layout&&Lv(n,t,e.layout),function(e,t,n){var i,r,o,a,s,l=t.items,u=Math.max(0,t.width||0),c=Math.max(0,t.height||0),f=(new Oh).set(0,0,u,c),d=f.clone(),h=f.clone(),p=[];for(a=0,s=l.length;a<s;++a)switch((r=l[a]).role){case Wy:(Sv(r)?d:h).union(Mv(e,r,u,c));break;case Hy:i=r;break;case Gy:p.push(Wv(e,r));break;case Xy:case Jy:case Vy:case Yy:case Ky:case Zy:case Qy:case ev:d.union(r.bounds),h.union(r.bounds);break;default:f.union(r.bounds)}if(p.length){const t={};p.forEach((e=>{(o=e.orient||Oy)!==sv&&(t[o]||(t[o]=[])).push(e)}));for(const i in t){const r=t[i];Pv(e,r,qv(r,i,n.legends,d,h,u,c))}p.forEach((t=>{const i=t.bounds;if(i.equals(t._bounds)||(t.bounds=t._bounds,e.dirty(t),t.bounds=i,e.dirty(t)),!n.autosize||n.autosize.type!==iv&&n.autosize.type!==rv&&n.autosize.type!==ov)f.union(i);else switch(t.orient){case Fy:case Oy:f.add(i.x1,0).add(i.x2,0);break;case Cy:case Ty:f.add(0,i.y1).add(0,i.y2)}}))}f.union(d).union(h),i&&f.union(function(e,t,n,i,r){var o,a=t.items[0],s=a.frame,l=a.orient,u=a.anchor,c=a.offset,f=a.padding,d=a.items[0].items[0],h=a.items[1]&&a.items[1].items[0],p=l===Fy||l===Oy?i:n,m=0,g=0,y=0,v=0,b=0;if(s!==qy?l===Fy?(m=r.y2,p=r.y1):l===Oy?(m=r.y1,p=r.y2):(m=r.x1,p=r.x2):l===Fy&&(m=i,p=0),o=u===Ly?m:u===By?p:(m+p)/2,h&&h.text){switch(l){case Cy:case Ty:b=d.bounds.height()+f;break;case Fy:v=d.bounds.width()+f;break;case Oy:v=-d.bounds.width()-f}$v.clear().union(h.bounds),$v.translate(v-(h.x||0),b-(h.y||0)),Av(h,"x",v)|Av(h,"y",b)&&(e.dirty(h),h.bounds.clear().union($v),h.mark.bounds.clear().union($v),e.dirty(h)),$v.clear().union(h.bounds)}else $v.clear();switch($v.union(d.bounds),l){case Cy:g=o,y=r.y1-$v.height()-c;break;case Fy:g=r.x1-$v.width()-c,y=o;break;case Oy:g=r.x2+$v.width()+c,y=o;break;case Ty:g=o,y=r.y2+c;break;default:g=a.x,y=a.y}return Av(a,"x",g)|Av(a,"y",y)&&($v.translate(g,y),e.dirty(a),a.bounds.clear().union($v),t.bounds.clear().union($v),e.dirty(a)),a.bounds}(e,i,u,c,f));t.clip&&f.set(0,0,t.width||0,t.height||0);!function(e,t,n,i){const r=i.autosize||{},o=r.type;if(e._autosize<1||!o)return;let a=e._width,s=e._height,l=Math.max(0,t.width||0),u=Math.max(0,Math.ceil(-n.x1)),c=Math.max(0,t.height||0),f=Math.max(0,Math.ceil(-n.y1));const d=Math.max(0,Math.ceil(n.x2-l)),h=Math.max(0,Math.ceil(n.y2-c));if(r.contains===tv){const t=e.padding();a-=t.left+t.right,s-=t.top+t.bottom}o===sv?(u=0,f=0,l=a,c=s):o===iv?(l=Math.max(0,a-u-d),c=Math.max(0,s-f-h)):o===rv?(l=Math.max(0,a-u-d),s=c+f+h):o===ov?(a=l+u+d,c=Math.max(0,s-f-h)):o===av&&(a=l+u+d,s=c+f+h);e._resizeView(a,s,l,c,[u,f],r.resize)}(e,t,f,n)}(n,t,e)})),function(e){return e&&"legend-entry"!==e.mark.role}(e.mark.group)?t.reflow():t}}),(0,m.XW)(Vv,no,{transform(e,t){if(this.value&&!e.modified())return t.StopPropagation;var n=t.dataflow.locale(),i=t.fork(t.NO_SOURCE|t.NO_FIELDS),r=this.value,o=e.scale,a=pd(o,null==e.count?e.values?e.values.length:10:e.count,e.minstep),s=e.format||yd(n,o,a,e.formatSpecifier,e.formatType,!!e.values),l=e.values?md(o,e.values,a):gd(o,a);return r&&(i.rem=r),r=l.map(((e,t)=>Dr({index:t/(l.length-1||1),value:e,label:s(e)}))),e.extra&&r.length&&r.push(Dr({index:-1,extra:{value:r[0].value},label:""})),i.source=r,i.add=r,this.value=r,i}}),(0,m.XW)(Yv,no,{transform(e,t){var n=t.dataflow,i=t.fork(t.NO_SOURCE|t.NO_FIELDS),r=e.item||Kv,o=e.key||kr,a=this.value;return(0,m.kJ)(i.encode)&&(i.encode=null),a&&(e.modified("key")||t.modified(o))&&(0,m.vU)("DataJoin does not support modified key function or fields."),a||(t=t.addAll(),this.value=a=function(e){const t=(0,m.Xr)().test((e=>e.exit));return t.lookup=n=>t.get(e(n)),t}(o)),t.visit(t.ADD,(e=>{const t=o(e);let n=a.get(t);n?n.exit?(a.empty--,i.add.push(n)):i.mod.push(n):(n=r(e),a.set(t,n),i.add.push(n)),n.datum=e,n.exit=!1})),t.visit(t.MOD,(e=>{const t=o(e),n=a.get(t);n&&(n.datum=e,i.mod.push(n))})),t.visit(t.REM,(e=>{const t=o(e),n=a.get(t);e!==n.datum||n.exit||(i.rem.push(n),n.exit=!0,++a.empty)})),t.changed(t.ADD_MOD)&&i.modifies("datum"),(t.clean()||e.clean&&a.empty>n.cleanThreshold)&&n.runAfter(a.clean),i}}),(0,m.XW)(Zv,no,{transform(e,t){var n=t.fork(t.ADD_REM),i=e.mod||!1,r=e.encoders,o=t.encode;if((0,m.kJ)(o)){if(!n.changed()&&!o.every((e=>r[e])))return t.StopPropagation;o=o[0],n.encode=null}var a="enter"===o,s=r.update||m.k,l=r.enter||m.k,u=r.exit||m.k,c=(o&&!a?r[o]:s)||m.k;if(t.changed(t.ADD)&&(t.visit(t.ADD,(t=>{l(t,e),s(t,e)})),n.modifies(l.output),n.modifies(s.output),c!==m.k&&c!==s&&(t.visit(t.ADD,(t=>{c(t,e)})),n.modifies(c.output))),t.changed(t.REM)&&u!==m.k&&(t.visit(t.REM,(t=>{u(t,e)})),n.modifies(u.output)),a||c!==m.k){const r=t.MOD|(e.modified()?t.REFLOW:0);a?(t.visit(r,(t=>{const r=l(t,e)||i;(c(t,e)||r)&&n.mod.push(t)})),n.mod.length&&n.modifies(l.output)):t.visit(r,(t=>{(c(t,e)||i)&&n.mod.push(t)})),n.mod.length&&n.modifies(c.output)}return n.changed()?n:t.StopPropagation}}),(0,m.XW)(Qv,no,{transform(e,t){if(null!=this.value&&!e.modified())return t.StopPropagation;var n,i,r,o,a,s=t.dataflow.locale(),l=t.fork(t.NO_SOURCE|t.NO_FIELDS),u=this.value,c=e.type||ud,f=e.scale,d=+e.limit,h=pd(f,null==e.count?5:e.count,e.minstep),p=!!e.values||c===ud,g=e.format||kd(s,f,h,c,e.formatSpecifier,e.formatType,p),y=e.values||_d(f,h);return u&&(l.rem=u),c===ud?(d&&y.length>d?(t.dataflow.warn("Symbol legend count exceeds limit, filtering items."),u=y.slice(0,d-1),a=!0):u=y,(0,m.mf)(r=e.size)?(e.values||0!==f(u[0])||(u=u.slice(1)),o=u.reduce(((t,n)=>Math.max(t,r(n,e))),0)):r=(0,m.a9)(o=r||8),u=u.map(((t,n)=>Dr({index:n,label:g(t,n,u),value:t,offset:o,size:r(t,e)}))),a&&(a=y[u.length],u.push(Dr({index:u.length,label:`\u2026${y.length-u.length} entries`,value:a,offset:o,size:r(a,e)})))):"gradient"===c?(n=f.domain(),i=id(f,n[0],(0,m.fj)(n)),y.length<3&&!e.values&&n[0]!==(0,m.fj)(n)&&(y=[n[0],(0,m.fj)(n)]),u=y.map(((e,t)=>Dr({index:t,label:g(e,t,y),value:e,perc:i(e)})))):(r=y.length-1,i=function(e){const t=e.domain(),n=t.length-1;let i=+t[0],r=+(0,m.fj)(t),o=r-i;if(e.type===Af){const e=n?o/n:.1;i-=e,r+=e,o=r-i}return e=>(e-i)/o}(f),u=y.map(((e,t)=>Dr({index:t,label:g(e,t,y),value:e,perc:t?i(e):0,perc2:t===r?1:i(y[t+1])})))),l.source=u,l.add=u,this.value=u,l}});const eb=e=>e.source.x,tb=e=>e.source.y,nb=e=>e.target.x,ib=e=>e.target.y;function rb(e){no.call(this,{},e)}rb.Definition={type:"LinkPath",metadata:{modifies:!0},params:[{name:"sourceX",type:"field",default:"source.x"},{name:"sourceY",type:"field",default:"source.y"},{name:"targetX",type:"field",default:"target.x"},{name:"targetY",type:"field",default:"target.y"},{name:"orient",type:"enum",default:"vertical",values:["horizontal","vertical","radial"]},{name:"shape",type:"enum",default:"line",values:["line","arc","curve","diagonal","orthogonal"]},{name:"require",type:"signal"},{name:"as",type:"string",default:"path"}]},(0,m.XW)(rb,no,{transform(e,t){var n=e.sourceX||eb,i=e.sourceY||tb,r=e.targetX||nb,o=e.targetY||ib,a=e.as||"path",s=e.orient||"vertical",l=e.shape||"line",u=lb.get(l+"-"+s)||lb.get(l);return u||(0,m.vU)("LinkPath unsupported type: "+e.shape+(e.orient?"-"+e.orient:"")),t.visit(t.SOURCE,(e=>{e[a]=u(n(e),i(e),r(e),o(e))})),t.reflow(e.modified()).modifies(a)}});const ob=(e,t,n,i)=>"M"+e+","+t+"L"+n+","+i,ab=(e,t,n,i)=>{var r=n-e,o=i-t,a=Math.hypot(r,o)/2;return"M"+e+","+t+"A"+a+","+a+" "+180*Math.atan2(o,r)/Math.PI+" 0 1 "+n+","+i},sb=(e,t,n,i)=>{const r=n-e,o=i-t,a=.2*(r+o),s=.2*(o-r);return"M"+e+","+t+"C"+(e+a)+","+(t+s)+" "+(n+s)+","+(i-a)+" "+n+","+i},lb=(0,m.Xr)({line:ob,"line-radial":(e,t,n,i)=>ob(t*Math.cos(e),t*Math.sin(e),i*Math.cos(n),i*Math.sin(n)),arc:ab,"arc-radial":(e,t,n,i)=>ab(t*Math.cos(e),t*Math.sin(e),i*Math.cos(n),i*Math.sin(n)),curve:sb,"curve-radial":(e,t,n,i)=>sb(t*Math.cos(e),t*Math.sin(e),i*Math.cos(n),i*Math.sin(n)),"orthogonal-horizontal":(e,t,n,i)=>"M"+e+","+t+"V"+i+"H"+n,"orthogonal-vertical":(e,t,n,i)=>"M"+e+","+t+"H"+n+"V"+i,"orthogonal-radial":(e,t,n,i)=>{const r=Math.cos(e),o=Math.sin(e),a=Math.cos(n),s=Math.sin(n);return"M"+t*r+","+t*o+"A"+t+","+t+" 0 0,"+((Math.abs(n-e)>Math.PI?n<=e:n>e)?1:0)+" "+t*a+","+t*s+"L"+i*a+","+i*s},"diagonal-horizontal":(e,t,n,i)=>{const r=(e+n)/2;return"M"+e+","+t+"C"+r+","+t+" "+r+","+i+" "+n+","+i},"diagonal-vertical":(e,t,n,i)=>{const r=(t+i)/2;return"M"+e+","+t+"C"+e+","+r+" "+n+","+r+" "+n+","+i},"diagonal-radial":(e,t,n,i)=>{const r=Math.cos(e),o=Math.sin(e),a=Math.cos(n),s=Math.sin(n),l=(t+i)/2;return"M"+t*r+","+t*o+"C"+l*r+","+l*o+" "+l*a+","+l*s+" "+i*a+","+i*s}});function ub(e){no.call(this,null,e)}ub.Definition={type:"Pie",metadata:{modifies:!0},params:[{name:"field",type:"field"},{name:"startAngle",type:"number",default:0},{name:"endAngle",type:"number",default:6.283185307179586},{name:"sort",type:"boolean",default:!1},{name:"as",type:"string",array:!0,length:2,default:["startAngle","endAngle"]}]},(0,m.XW)(ub,no,{transform(e,t){var n,i,r,o=e.as||["startAngle","endAngle"],a=o[0],s=o[1],l=e.field||m.kX,u=e.startAngle||0,c=null!=e.endAngle?e.endAngle:2*Math.PI,f=t.source,d=f.map(l),h=d.length,p=u,g=(c-u)/Gv(d),y=pa(h);for(e.sort&&y.sort(((e,t)=>d[e]-d[t])),n=0;n<h;++n)r=d[y[n]],(i=f[y[n]])[a]=p,i[s]=p+=r*g;return this.value=d,t.reflow(e.modified()).modifies(o)}});const cb=5;function fb(e){return Jf(e)&&e!==kf}const db=(0,m.Rg)(["set","modified","clear","type","scheme","schemeExtent","schemeCount","domain","domainMin","domainMid","domainMax","domainRaw","domainImplicit","nice","zero","bins","range","rangeStep","round","reverse","interpolate","interpolateGamma"]);function hb(e){no.call(this,null,e),this.modified(!0)}function pb(e,t,n){if(Yf(e)){var i=Math.abs(t.reduce(((e,t)=>e+(t<0?-1:t>0?1:0)),0));i!==t.length&&n.warn("Log scale domain includes zero: "+(0,m.m8)(t))}return t}function mb(e,t,n){return(0,m.mf)(e)&&(t||n)?ed(e,gb(t||[0,1],n)):e}function gb(e,t){return t?e.slice().reverse():e}function yb(e){no.call(this,null,e)}(0,m.XW)(hb,no,{transform(e,t){var n=t.dataflow,i=this.value,r=function(e){var t,n=e.type,i="";if(n===kf)return kf+"-"+gf;(function(e){const t=e.type;return Jf(t)&&t!==_f&&t!==wf&&(e.scheme||e.range&&e.range.length&&e.range.every(m.HD))})(e)&&(i=2===(t=e.rawDomain?e.rawDomain.length:e.domain?e.domain.length+ +(null!=e.domainMid):0)?kf+"-":3===t?Ef+"-":"");return(i+n||gf).toLowerCase()}(e);for(r in i&&r===i.type||(this.value=i=Wf(r)()),e)if(!db[r]){if("padding"===r&&fb(i.type))continue;(0,m.mf)(i[r])?i[r](e[r]):n.warn("Unsupported scale property: "+r)}return function(e,t,n){var i=e.type,r=t.round||!1,o=t.range;if(null!=t.rangeStep)o=function(e,t,n){e!==Cf&&e!==Mf&&(0,m.vU)("Only band and point scales support rangeStep.");var i=(null!=t.paddingOuter?t.paddingOuter:t.padding)||0,r=e===Mf?1:(null!=t.paddingInner?t.paddingInner:t.padding)||0;return[0,t.rangeStep*mf(n,r,i)]}(i,t,n);else if(t.scheme&&(o=function(e,t,n){var i,r=t.schemeExtent;(0,m.kJ)(t.scheme)?i=td(t.scheme,t.interpolate,t.interpolateGamma):(i=ld(t.scheme.toLowerCase()))||(0,m.vU)(`Unrecognized scheme name: ${t.scheme}`);return n=e===Af?n+1:e===Ff?n-1:e===Df||e===$f?+t.schemeCount||cb:n,Kf(e)?mb(i,r,t.reverse):(0,m.mf)(i)?nd(mb(i,r),n):e===Sf?i:i.slice(0,n)}(i,t,n),(0,m.mf)(o))){if(e.interpolator)return e.interpolator(o);(0,m.vU)(`Scale type ${i} does not support interpolating color schemes.`)}if(o&&Kf(i))return e.interpolator(td(gb(o,t.reverse),t.interpolate,t.interpolateGamma));o&&t.interpolate&&e.interpolate?e.interpolate(rd(t.interpolate,t.interpolateGamma)):(0,m.mf)(e.round)?e.round(r):(0,m.mf)(e.rangeRound)&&e.interpolate(r?bu:vu);o&&e.range(gb(o,t.reverse))}(i,e,function(e,t,n){let i=t.bins;if(i&&!(0,m.kJ)(i)){const t=e.domain(),n=t[0],r=(0,m.fj)(t),o=i.step;let a=null==i.start?n:i.start,s=null==i.stop?r:i.stop;o||(0,m.vU)("Scale bins parameter missing step property."),a<n&&(a=o*Math.ceil(n/o)),s>r&&(s=o*Math.floor(r/o)),i=pa(a,s+o/2,o)}i?e.bins=i:e.bins&&delete e.bins;e.type===Ff&&(i?t.domain||t.domainRaw||(e.domain(i),n=i.length):e.bins=e.domain());return n}(i,e,function(e,t,n){const i=function(e,t,n){return t?(e.domain(pb(e.type,t,n)),t.length):-1}(e,t.domainRaw,n);if(i>-1)return i;var r,o,a=t.domain,s=e.type,l=t.zero||void 0===t.zero&&function(e){const t=e.type;return!e.bins&&(t===gf||t===vf||t===bf)}(e);if(!a)return 0;fb(s)&&t.padding&&a[0]!==(0,m.fj)(a)&&(a=function(e,t,n,i,r,o){var a=Math.abs((0,m.fj)(n)-n[0]),s=a/(a-2*i),l=e===yf?(0,m.dH)(t,null,s):e===bf?(0,m.mK)(t,null,s,.5):e===vf?(0,m.mK)(t,null,s,r||1):e===xf?(0,m.bV)(t,null,s,o||1):(0,m.ay)(t,null,s);return t=t.slice(),t[0]=l[0],t[t.length-1]=l[1],t}(s,a,t.range,t.padding,t.exponent,t.constant));if((l||null!=t.domainMin||null!=t.domainMax||null!=t.domainMid)&&(r=(a=a.slice()).length-1||1,l&&(a[0]>0&&(a[0]=0),a[r]<0&&(a[r]=0)),null!=t.domainMin&&(a[0]=t.domainMin),null!=t.domainMax&&(a[r]=t.domainMax),null!=t.domainMid)){const e=(o=t.domainMid)>a[r]?r+1:o<a[0]?0:r;e!==r&&n.warn("Scale domainMid exceeds domain min or max.",o),a.splice(e,0,o)}e.domain(pb(s,a,n)),s===Sf&&e.unknown(t.domainImplicit?gc:void 0);t.nice&&e.nice&&e.nice(!0!==t.nice&&pd(e,t.nice)||null);return a.length}(i,e,n))),t.fork(t.NO_SOURCE|t.NO_FIELDS)}}),(0,m.XW)(yb,no,{transform(e,t){const n=e.modified("sort")||t.changed(t.ADD)||t.modified(e.sort.fields)||t.modified("datum");return n&&t.source.sort(Mr(e.sort)),this.modified(n),t}});const vb="zero",bb="center",xb="normalize",_b=["y0","y1"];function wb(e){no.call(this,null,e)}function kb(e,t,n,i,r){for(var o,a=(t-e.sum)/2,s=e.length,l=0;l<s;++l)(o=e[l])[i]=a,o[r]=a+=Math.abs(n(o))}function Eb(e,t,n,i,r){for(var o,a=1/e.sum,s=0,l=e.length,u=0,c=0;u<l;++u)(o=e[u])[i]=s,o[r]=s=a*(c+=Math.abs(n(o)))}function Db(e,t,n,i,r){for(var o,a,s=0,l=0,u=e.length,c=0;c<u;++c)(o=+n(a=e[c]))<0?(a[i]=l,a[r]=l+=o):(a[i]=s,a[r]=s+=o)}wb.Definition={type:"Stack",metadata:{modifies:!0},params:[{name:"field",type:"field"},{name:"groupby",type:"field",array:!0},{name:"sort",type:"compare"},{name:"offset",type:"enum",default:vb,values:[vb,bb,xb]},{name:"as",type:"string",array:!0,length:2,default:_b}]},(0,m.XW)(wb,no,{transform(e,t){var n,i,r,o,a=e.as||_b,s=a[0],l=a[1],u=Mr(e.sort),c=e.field||m.kX,f=e.offset===bb?kb:e.offset===xb?Eb:Db;for(n=function(e,t,n,i){var r,o,a,s,l,u,c,f,d,h=[],p=e=>e(l);if(null==t)h.push(e.slice());else for(r={},o=0,a=e.length;o<a;++o)l=e[o],(c=r[u=t.map(p)])||(r[u]=c=[],h.push(c)),c.push(l);for(u=0,d=0,s=h.length;u<s;++u){for(o=0,f=0,a=(c=h[u]).length;o<a;++o)f+=Math.abs(i(c[o]));c.sum=f,f>d&&(d=f),n&&c.sort(n)}return h.max=d,h}(t.source,e.groupby,u,c),i=0,r=n.length,o=n.max;i<r;++i)f(n[i],o,c,s,l);return t.reflow(e.modified()).modifies(a)}});const $b=e=>e;function Ab(e,t){e&&Mb.hasOwnProperty(e.type)&&Mb[e.type](e,t)}var Sb={Feature:function(e,t){Ab(e.geometry,t)},FeatureCollection:function(e,t){for(var n=e.features,i=-1,r=n.length;++i<r;)Ab(n[i].geometry,t)}},Mb={Sphere:function(e,t){t.sphere()},Point:function(e,t){e=e.coordinates,t.point(e[0],e[1],e[2])},MultiPoint:function(e,t){for(var n=e.coordinates,i=-1,r=n.length;++i<r;)e=n[i],t.point(e[0],e[1],e[2])},LineString:function(e,t){Cb(e.coordinates,t,0)},MultiLineString:function(e,t){for(var n=e.coordinates,i=-1,r=n.length;++i<r;)Cb(n[i],t,0)},Polygon:function(e,t){Fb(e.coordinates,t)},MultiPolygon:function(e,t){for(var n=e.coordinates,i=-1,r=n.length;++i<r;)Fb(n[i],t)},GeometryCollection:function(e,t){for(var n=e.geometries,i=-1,r=n.length;++i<r;)Ab(n[i],t)}};function Cb(e,t,n){var i,r=-1,o=e.length-n;for(t.lineStart();++r<o;)i=e[r],t.point(i[0],i[1],i[2]);t.lineEnd()}function Fb(e,t){var n=-1,i=e.length;for(t.polygonStart();++n<i;)Cb(e[n],t,1);t.polygonEnd()}function Ob(e,t){e&&Sb.hasOwnProperty(e.type)?Sb[e.type](e,t):Ab(e,t)}class Tb{constructor(){this._partials=new Float64Array(32),this._n=0}add(e){const t=this._partials;let n=0;for(let i=0;i<this._n&&i<32;i++){const r=t[i],o=e+r,a=Math.abs(e)<Math.abs(r)?e-(o-r):r-(o-e);a&&(t[n++]=a),e=o}return t[n]=e,this._n=n+1,this}valueOf(){const e=this._partials;let t,n,i,r=this._n,o=0;if(r>0){for(o=e[--r];r>0&&(t=o,n=e[--r],o=t+n,i=n-(o-t),!i););r>0&&(i<0&&e[r-1]<0||i>0&&e[r-1]>0)&&(n=2*i,t=o+n,n==t-o&&(o=t))}return o}}var Nb=1e-6,zb=1e-12,Rb=Math.PI,Pb=Rb/2,Lb=Rb/4,Ub=2*Rb,Bb=180/Rb,jb=Rb/180,Ib=Math.abs,qb=Math.atan,Wb=Math.atan2,Hb=Math.cos,Xb=Math.ceil,Jb=Math.exp,Gb=(Math.floor,Math.hypot),Vb=Math.log,Yb=Math.pow,Kb=Math.sin,Zb=Math.sign||function(e){return e>0?1:e<0?-1:0},Qb=Math.sqrt,ex=Math.tan;function tx(e){return e>1?0:e<-1?Rb:Math.acos(e)}function nx(e){return e>1?Pb:e<-1?-Pb:Math.asin(e)}function ix(){}var rx,ox,ax,sx,lx=new Tb,ux=new Tb,cx={point:ix,lineStart:ix,lineEnd:ix,polygonStart:function(){cx.lineStart=fx,cx.lineEnd=px},polygonEnd:function(){cx.lineStart=cx.lineEnd=cx.point=ix,lx.add(Ib(ux)),ux=new Tb},result:function(){var e=lx/2;return lx=new Tb,e}};function fx(){cx.point=dx}function dx(e,t){cx.point=hx,rx=ax=e,ox=sx=t}function hx(e,t){ux.add(sx*e-ax*t),ax=e,sx=t}function px(){hx(rx,ox)}const mx=cx;var gx=1/0,yx=gx,vx=-gx,bx=vx,xx={point:function(e,t){e<gx&&(gx=e);e>vx&&(vx=e);t<yx&&(yx=t);t>bx&&(bx=t)},lineStart:ix,lineEnd:ix,polygonStart:ix,polygonEnd:ix,result:function(){var e=[[gx,yx],[vx,bx]];return vx=bx=-(yx=gx=1/0),e}};const _x=xx;var wx,kx,Ex,Dx,$x=0,Ax=0,Sx=0,Mx=0,Cx=0,Fx=0,Ox=0,Tx=0,Nx=0,zx={point:Rx,lineStart:Px,lineEnd:Bx,polygonStart:function(){zx.lineStart=jx,zx.lineEnd=Ix},polygonEnd:function(){zx.point=Rx,zx.lineStart=Px,zx.lineEnd=Bx},result:function(){var e=Nx?[Ox/Nx,Tx/Nx]:Fx?[Mx/Fx,Cx/Fx]:Sx?[$x/Sx,Ax/Sx]:[NaN,NaN];return $x=Ax=Sx=Mx=Cx=Fx=Ox=Tx=Nx=0,e}};function Rx(e,t){$x+=e,Ax+=t,++Sx}function Px(){zx.point=Lx}function Lx(e,t){zx.point=Ux,Rx(Ex=e,Dx=t)}function Ux(e,t){var n=e-Ex,i=t-Dx,r=Qb(n*n+i*i);Mx+=r*(Ex+e)/2,Cx+=r*(Dx+t)/2,Fx+=r,Rx(Ex=e,Dx=t)}function Bx(){zx.point=Rx}function jx(){zx.point=qx}function Ix(){Wx(wx,kx)}function qx(e,t){zx.point=Wx,Rx(wx=Ex=e,kx=Dx=t)}function Wx(e,t){var n=e-Ex,i=t-Dx,r=Qb(n*n+i*i);Mx+=r*(Ex+e)/2,Cx+=r*(Dx+t)/2,Fx+=r,Ox+=(r=Dx*e-Ex*t)*(Ex+e),Tx+=r*(Dx+t),Nx+=3*r,Rx(Ex=e,Dx=t)}const Hx=zx;function Xx(e){this._context=e}Xx.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(){0===this._line&&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,Ub)}},result:ix};var Jx,Gx,Vx,Yx,Kx,Zx=new Tb,Qx={point:ix,lineStart:function(){Qx.point=e_},lineEnd:function(){Jx&&t_(Gx,Vx),Qx.point=ix},polygonStart:function(){Jx=!0},polygonEnd:function(){Jx=null},result:function(){var e=+Zx;return Zx=new Tb,e}};function e_(e,t){Qx.point=t_,Gx=Yx=e,Vx=Kx=t}function t_(e,t){Yx-=e,Kx-=t,Zx.add(Qb(Yx*Yx+Kx*Kx)),Yx=e,Kx=t}const n_=Qx;let i_,r_,o_,a_;class s_{constructor(e){this._append=null==e?l_:function(e){const t=Math.floor(e);if(!(t>=0))throw new RangeError(`invalid digits: ${e}`);if(t>15)return l_;if(t!==i_){const e=10**t;i_=t,r_=function(t){let n=1;this._+=t[0];for(const i=t.length;n<i;++n)this._+=Math.round(arguments[n]*e)/e+t[n]}}return r_}(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(){0===this._line&&(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!==o_||this._append!==r_){const 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`,o_=e,r_=this._append,a_=this._,this._=t}this._+=a_}}result(){const e=this._;return this._="",e.length?e:null}}function l_(e){let t=1;this._+=e[0];for(const n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function u_(e,t){let n,i,r=3,o=4.5;function a(e){return e&&("function"===typeof o&&i.pointRadius(+o.apply(this,arguments)),Ob(e,n(i))),i.result()}return a.area=function(e){return Ob(e,n(mx)),mx.result()},a.measure=function(e){return Ob(e,n(n_)),n_.result()},a.bounds=function(e){return Ob(e,n(_x)),_x.result()},a.centroid=function(e){return Ob(e,n(Hx)),Hx.result()},a.projection=function(t){return arguments.length?(n=null==t?(e=null,$b):(e=t).stream,a):e},a.context=function(e){return arguments.length?(i=null==e?(t=null,new s_(r)):new Xx(t=e),"function"!==typeof o&&i.pointRadius(o),a):t},a.pointRadius=function(e){return arguments.length?(o="function"===typeof e?e:(i.pointRadius(+e),+e),a):o},a.digits=function(e){if(!arguments.length)return r;if(null==e)r=null;else{const t=Math.floor(e);if(!(t>=0))throw new RangeError(`invalid digits: ${e}`);r=t}return null===t&&(i=new s_(r)),a},a.projection(e).digits(r).context(t)}function c_(){var e,t=[];return{point:function(t,n,i){e.push([t,n,i])},lineStart:function(){t.push(e=[])},lineEnd:ix,rejoin:function(){t.length>1&&t.push(t.pop().concat(t.shift()))},result:function(){var n=t;return t=[],e=null,n}}}function f_(e,t){return Ib(e[0]-t[0])<Nb&&Ib(e[1]-t[1])<Nb}function d_(e,t,n,i){this.x=e,this.z=t,this.o=n,this.e=i,this.v=!1,this.n=this.p=null}function h_(e,t,n,i,r){var o,a,s=[],l=[];if(e.forEach((function(e){if(!((t=e.length-1)<=0)){var t,n,i=e[0],a=e[t];if(f_(i,a)){if(!i[2]&&!a[2]){for(r.lineStart(),o=0;o<t;++o)r.point((i=e[o])[0],i[1]);return void r.lineEnd()}a[0]+=2*Nb}s.push(n=new d_(i,e,null,!0)),l.push(n.o=new d_(i,null,n,!1)),s.push(n=new d_(a,e,null,!1)),l.push(n.o=new d_(a,null,n,!0))}})),s.length){for(l.sort(t),p_(s),p_(l),o=0,a=l.length;o<a;++o)l[o].e=n=!n;for(var u,c,f=s[0];;){for(var d=f,h=!0;d.v;)if((d=d.n)===f)return;u=d.z,r.lineStart();do{if(d.v=d.o.v=!0,d.e){if(h)for(o=0,a=u.length;o<a;++o)r.point((c=u[o])[0],c[1]);else i(d.x,d.n.x,1,r);d=d.n}else{if(h)for(u=d.p.z,o=u.length-1;o>=0;--o)r.point((c=u[o])[0],c[1]);else i(d.x,d.p.x,-1,r);d=d.p}u=(d=d.o).z,h=!h}while(!d.v);r.lineEnd()}}}function p_(e){if(t=e.length){for(var t,n,i=0,r=e[0];++i<t;)r.n=n=e[i],n.p=r,r=n;r.n=n=e[0],n.p=r}}function m_(e){return[Wb(e[1],e[0]),nx(e[2])]}function g_(e){var t=e[0],n=e[1],i=Hb(n);return[i*Hb(t),i*Kb(t),Kb(n)]}function y_(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function v_(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 b_(e,t){e[0]+=t[0],e[1]+=t[1],e[2]+=t[2]}function x_(e,t){return[e[0]*t,e[1]*t,e[2]*t]}function __(e){var t=Qb(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]/=t,e[1]/=t,e[2]/=t}function w_(e){return Ib(e[0])<=Rb?e[0]:Zb(e[0])*((Ib(e[0])+Rb)%Ub-Rb)}function k_(e){return Array.from(function*(e){for(const t of e)yield*t}(e))}function E_(e,t,n,i){return function(r){var o,a,s,l=t(r),u=c_(),c=t(u),f=!1,d={point:h,lineStart:m,lineEnd:g,polygonStart:function(){d.point=y,d.lineStart=v,d.lineEnd=b,a=[],o=[]},polygonEnd:function(){d.point=h,d.lineStart=m,d.lineEnd=g,a=k_(a);var e=function(e,t){var n=w_(t),i=t[1],r=Kb(i),o=[Kb(n),-Hb(n),0],a=0,s=0,l=new Tb;1===r?i=Pb+Nb:-1===r&&(i=-Pb-Nb);for(var u=0,c=e.length;u<c;++u)if(d=(f=e[u]).length)for(var f,d,h=f[d-1],p=w_(h),m=h[1]/2+Lb,g=Kb(m),y=Hb(m),v=0;v<d;++v,p=x,g=w,y=k,h=b){var b=f[v],x=w_(b),_=b[1]/2+Lb,w=Kb(_),k=Hb(_),E=x-p,D=E>=0?1:-1,$=D*E,A=$>Rb,S=g*w;if(l.add(Wb(S*D*Kb($),y*k+S*Hb($))),a+=A?E+D*Ub:E,A^p>=n^x>=n){var M=v_(g_(h),g_(b));__(M);var C=v_(o,M);__(C);var F=(A^E>=0?-1:1)*nx(C[2]);(i>F||i===F&&(M[0]||M[1]))&&(s+=A^E>=0?1:-1)}}return(a<-Nb||a<Nb&&l<-zb)^1&s}(o,i);a.length?(f||(r.polygonStart(),f=!0),h_(a,$_,e,n,r)):e&&(f||(r.polygonStart(),f=!0),r.lineStart(),n(null,null,1,r),r.lineEnd()),f&&(r.polygonEnd(),f=!1),a=o=null},sphere:function(){r.polygonStart(),r.lineStart(),n(null,null,1,r),r.lineEnd(),r.polygonEnd()}};function h(t,n){e(t,n)&&r.point(t,n)}function p(e,t){l.point(e,t)}function m(){d.point=p,l.lineStart()}function g(){d.point=h,l.lineEnd()}function y(e,t){s.push([e,t]),c.point(e,t)}function v(){c.lineStart(),s=[]}function b(){y(s[0][0],s[0][1]),c.lineEnd();var e,t,n,i,l=c.clean(),d=u.result(),h=d.length;if(s.pop(),o.push(s),s=null,h)if(1&l){if((t=(n=d[0]).length-1)>0){for(f||(r.polygonStart(),f=!0),r.lineStart(),e=0;e<t;++e)r.point((i=n[e])[0],i[1]);r.lineEnd()}}else h>1&&2&l&&d.push(d.pop().concat(d.shift())),a.push(d.filter(D_))}return d}}function D_(e){return e.length>1}function $_(e,t){return((e=e.x)[0]<0?e[1]-Pb-Nb:Pb-e[1])-((t=t.x)[0]<0?t[1]-Pb-Nb:Pb-t[1])}const A_=E_((function(){return!0}),(function(e){var t,n=NaN,i=NaN,r=NaN;return{lineStart:function(){e.lineStart(),t=1},point:function(o,a){var s=o>0?Rb:-Rb,l=Ib(o-n);Ib(l-Rb)<Nb?(e.point(n,i=(i+a)/2>0?Pb:-Pb),e.point(r,i),e.lineEnd(),e.lineStart(),e.point(s,i),e.point(o,i),t=0):r!==s&&l>=Rb&&(Ib(n-r)<Nb&&(n-=r*Nb),Ib(o-s)<Nb&&(o-=s*Nb),i=function(e,t,n,i){var r,o,a=Kb(e-n);return Ib(a)>Nb?qb((Kb(t)*(o=Hb(i))*Kb(n)-Kb(i)*(r=Hb(t))*Kb(e))/(r*o*a)):(t+i)/2}(n,i,o,a),e.point(r,i),e.lineEnd(),e.lineStart(),e.point(s,i),t=0),e.point(n=o,i=a),r=s},lineEnd:function(){e.lineEnd(),n=i=NaN},clean:function(){return 2-t}}}),(function(e,t,n,i){var r;if(null==e)r=n*Pb,i.point(-Rb,r),i.point(0,r),i.point(Rb,r),i.point(Rb,0),i.point(Rb,-r),i.point(0,-r),i.point(-Rb,-r),i.point(-Rb,0),i.point(-Rb,r);else if(Ib(e[0]-t[0])>Nb){var o=e[0]<t[0]?Rb:-Rb;r=n*o/2,i.point(-o,r),i.point(0,r),i.point(o,r)}else i.point(t[0],t[1])}),[-Rb,-Pb]);function S_(e,t,n,i,r,o){if(n){var a=Hb(t),s=Kb(t),l=i*n;null==r?(r=t+i*Ub,o=t-l/2):(r=M_(a,r),o=M_(a,o),(i>0?r<o:r>o)&&(r+=i*Ub));for(var u,c=r;i>0?c>o:c<o;c-=l)u=m_([a,-s*Hb(c),-s*Kb(c)]),e.point(u[0],u[1])}}function M_(e,t){(t=g_(t))[0]-=e,__(t);var n=tx(-t[1]);return((-t[2]<0?-n:n)+Ub-Nb)%Ub}var C_=1e9,F_=-C_;function O_(e,t,n,i){function r(r,o){return e<=r&&r<=n&&t<=o&&o<=i}function o(r,o,s,u){var c=0,f=0;if(null==r||(c=a(r,s))!==(f=a(o,s))||l(r,o)<0^s>0)do{u.point(0===c||3===c?e:n,c>1?i:t)}while((c=(c+s+4)%4)!==f);else u.point(o[0],o[1])}function a(i,r){return Ib(i[0]-e)<Nb?r>0?0:3:Ib(i[0]-n)<Nb?r>0?2:1:Ib(i[1]-t)<Nb?r>0?1:0:r>0?3:2}function s(e,t){return l(e.x,t.x)}function l(e,t){var n=a(e,1),i=a(t,1);return n!==i?n-i:0===n?t[1]-e[1]:1===n?e[0]-t[0]:2===n?e[1]-t[1]:t[0]-e[0]}return function(a){var l,u,c,f,d,h,p,m,g,y,v,b=a,x=c_(),_={point:w,lineStart:function(){_.point=k,u&&u.push(c=[]);y=!0,g=!1,p=m=NaN},lineEnd:function(){l&&(k(f,d),h&&g&&x.rejoin(),l.push(x.result()));_.point=w,g&&b.lineEnd()},polygonStart:function(){b=x,l=[],u=[],v=!0},polygonEnd:function(){var t=function(){for(var t=0,n=0,r=u.length;n<r;++n)for(var o,a,s=u[n],l=1,c=s.length,f=s[0],d=f[0],h=f[1];l<c;++l)o=d,a=h,d=(f=s[l])[0],h=f[1],a<=i?h>i&&(d-o)*(i-a)>(h-a)*(e-o)&&++t:h<=i&&(d-o)*(i-a)<(h-a)*(e-o)&&--t;return t}(),n=v&&t,r=(l=k_(l)).length;(n||r)&&(a.polygonStart(),n&&(a.lineStart(),o(null,null,1,a),a.lineEnd()),r&&h_(l,s,t,o,a),a.polygonEnd());b=a,l=u=c=null}};function w(e,t){r(e,t)&&b.point(e,t)}function k(o,a){var s=r(o,a);if(u&&c.push([o,a]),y)f=o,d=a,h=s,y=!1,s&&(b.lineStart(),b.point(o,a));else if(s&&g)b.point(o,a);else{var l=[p=Math.max(F_,Math.min(C_,p)),m=Math.max(F_,Math.min(C_,m))],x=[o=Math.max(F_,Math.min(C_,o)),a=Math.max(F_,Math.min(C_,a))];!function(e,t,n,i,r,o){var a,s=e[0],l=e[1],u=0,c=1,f=t[0]-s,d=t[1]-l;if(a=n-s,f||!(a>0)){if(a/=f,f<0){if(a<u)return;a<c&&(c=a)}else if(f>0){if(a>c)return;a>u&&(u=a)}if(a=r-s,f||!(a<0)){if(a/=f,f<0){if(a>c)return;a>u&&(u=a)}else if(f>0){if(a<u)return;a<c&&(c=a)}if(a=i-l,d||!(a>0)){if(a/=d,d<0){if(a<u)return;a<c&&(c=a)}else if(d>0){if(a>c)return;a>u&&(u=a)}if(a=o-l,d||!(a<0)){if(a/=d,d<0){if(a>c)return;a>u&&(u=a)}else if(d>0){if(a<u)return;a<c&&(c=a)}return u>0&&(e[0]=s+u*f,e[1]=l+u*d),c<1&&(t[0]=s+c*f,t[1]=l+c*d),!0}}}}}(l,x,e,t,n,i)?s&&(b.lineStart(),b.point(o,a),v=!1):(g||(b.lineStart(),b.point(l[0],l[1])),b.point(x[0],x[1]),s||b.lineEnd(),v=!1)}p=o,m=a,g=s}return _}}function T_(e,t){function n(n,i){return n=e(n,i),t(n[0],n[1])}return e.invert&&t.invert&&(n.invert=function(n,i){return(n=t.invert(n,i))&&e.invert(n[0],n[1])}),n}function N_(e,t){return Ib(e)>Rb&&(e-=Math.round(e/Ub)*Ub),[e,t]}function z_(e,t,n){return(e%=Ub)?t||n?T_(P_(e),L_(t,n)):P_(e):t||n?L_(t,n):N_}function R_(e){return function(t,n){return Ib(t+=e)>Rb&&(t-=Math.round(t/Ub)*Ub),[t,n]}}function P_(e){var t=R_(e);return t.invert=R_(-e),t}function L_(e,t){var n=Hb(e),i=Kb(e),r=Hb(t),o=Kb(t);function a(e,t){var a=Hb(t),s=Hb(e)*a,l=Kb(e)*a,u=Kb(t),c=u*n+s*i;return[Wb(l*r-c*o,s*n-u*i),nx(c*r+l*o)]}return a.invert=function(e,t){var a=Hb(t),s=Hb(e)*a,l=Kb(e)*a,u=Kb(t),c=u*r-l*o;return[Wb(l*r+u*o,s*n+c*i),nx(c*n-s*i)]},a}function U_(e){return function(t){var n=new B_;for(var i in e)n[i]=e[i];return n.stream=t,n}}function B_(){}function j_(e,t,n){var i=e.clipExtent&&e.clipExtent();return e.scale(150).translate([0,0]),null!=i&&e.clipExtent(null),Ob(n,e.stream(_x)),t(_x.result()),null!=i&&e.clipExtent(i),e}function I_(e,t,n){return j_(e,(function(n){var i=t[1][0]-t[0][0],r=t[1][1]-t[0][1],o=Math.min(i/(n[1][0]-n[0][0]),r/(n[1][1]-n[0][1])),a=+t[0][0]+(i-o*(n[1][0]+n[0][0]))/2,s=+t[0][1]+(r-o*(n[1][1]+n[0][1]))/2;e.scale(150*o).translate([a,s])}),n)}function q_(e,t,n){return I_(e,[[0,0],t],n)}function W_(e,t,n){return j_(e,(function(n){var i=+t,r=i/(n[1][0]-n[0][0]),o=(i-r*(n[1][0]+n[0][0]))/2,a=-r*n[0][1];e.scale(150*r).translate([o,a])}),n)}function H_(e,t,n){return j_(e,(function(n){var i=+t,r=i/(n[1][1]-n[0][1]),o=-r*n[0][0],a=(i-r*(n[1][1]+n[0][1]))/2;e.scale(150*r).translate([o,a])}),n)}N_.invert=N_,B_.prototype={constructor:B_,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()}};var X_=16,J_=Hb(30*jb);function G_(e,t){return+t?function(e,t){function n(i,r,o,a,s,l,u,c,f,d,h,p,m,g){var y=u-i,v=c-r,b=y*y+v*v;if(b>4*t&&m--){var x=a+d,_=s+h,w=l+p,k=Qb(x*x+_*_+w*w),E=nx(w/=k),D=Ib(Ib(w)-1)<Nb||Ib(o-f)<Nb?(o+f)/2:Wb(_,x),$=e(D,E),A=$[0],S=$[1],M=A-i,C=S-r,F=v*M-y*C;(F*F/b>t||Ib((y*M+v*C)/b-.5)>.3||a*d+s*h+l*p<J_)&&(n(i,r,o,a,s,l,A,S,D,x/=k,_/=k,w,m,g),g.point(A,S),n(A,S,D,x,_,w,u,c,f,d,h,p,m,g))}}return function(t){var i,r,o,a,s,l,u,c,f,d,h,p,m={point:g,lineStart:y,lineEnd:b,polygonStart:function(){t.polygonStart(),m.lineStart=x},polygonEnd:function(){t.polygonEnd(),m.lineStart=y}};function g(n,i){n=e(n,i),t.point(n[0],n[1])}function y(){c=NaN,m.point=v,t.lineStart()}function v(i,r){var o=g_([i,r]),a=e(i,r);n(c,f,u,d,h,p,c=a[0],f=a[1],u=i,d=o[0],h=o[1],p=o[2],X_,t),t.point(c,f)}function b(){m.point=g,t.lineEnd()}function x(){y(),m.point=_,m.lineEnd=w}function _(e,t){v(i=e,t),r=c,o=f,a=d,s=h,l=p,m.point=v}function w(){n(c,f,u,d,h,p,r,o,i,a,s,l,X_,t),m.lineEnd=b,b()}return m}}(e,t):function(e){return U_({point:function(t,n){t=e(t,n),this.stream.point(t[0],t[1])}})}(e)}var V_=U_({point:function(e,t){this.stream.point(e*jb,t*jb)}});function Y_(e,t,n,i,r,o){if(!o)return function(e,t,n,i,r){function o(o,a){return[t+e*(o*=i),n-e*(a*=r)]}return o.invert=function(o,a){return[(o-t)/e*i,(n-a)/e*r]},o}(e,t,n,i,r);var a=Hb(o),s=Kb(o),l=a*e,u=s*e,c=a/e,f=s/e,d=(s*n-a*t)/e,h=(s*t+a*n)/e;function p(e,o){return[l*(e*=i)-u*(o*=r)+t,n-u*e-l*o]}return p.invert=function(e,t){return[i*(c*e-f*t+d),r*(h-f*e-c*t)]},p}function K_(e){return Z_((function(){return e}))()}function Z_(e){var t,n,i,r,o,a,s,l,u,c,f=150,d=480,h=250,p=0,m=0,g=0,y=0,v=0,b=0,x=1,_=1,w=null,k=A_,E=null,D=$b,$=.5;function A(e){return l(e[0]*jb,e[1]*jb)}function S(e){return(e=l.invert(e[0],e[1]))&&[e[0]*Bb,e[1]*Bb]}function M(){var e=Y_(f,0,0,x,_,b).apply(null,t(p,m)),i=Y_(f,d-e[0],h-e[1],x,_,b);return n=z_(g,y,v),s=T_(t,i),l=T_(n,s),a=G_(s,$),C()}function C(){return u=c=null,A}return A.stream=function(e){return u&&c===e?u:u=V_(function(e){return U_({point:function(t,n){var i=e(t,n);return this.stream.point(i[0],i[1])}})}(n)(k(a(D(c=e)))))},A.preclip=function(e){return arguments.length?(k=e,w=void 0,C()):k},A.postclip=function(e){return arguments.length?(D=e,E=i=r=o=null,C()):D},A.clipAngle=function(e){return arguments.length?(k=+e?function(e){var t=Hb(e),n=6*jb,i=t>0,r=Ib(t)>Nb;function o(e,n){return Hb(e)*Hb(n)>t}function a(e,n,i){var r=[1,0,0],o=v_(g_(e),g_(n)),a=y_(o,o),s=o[0],l=a-s*s;if(!l)return!i&&e;var u=t*a/l,c=-t*s/l,f=v_(r,o),d=x_(r,u);b_(d,x_(o,c));var h=f,p=y_(d,h),m=y_(h,h),g=p*p-m*(y_(d,d)-1);if(!(g<0)){var y=Qb(g),v=x_(h,(-p-y)/m);if(b_(v,d),v=m_(v),!i)return v;var b,x=e[0],_=n[0],w=e[1],k=n[1];_<x&&(b=x,x=_,_=b);var E=_-x,D=Ib(E-Rb)<Nb;if(!D&&k<w&&(b=w,w=k,k=b),D||E<Nb?D?w+k>0^v[1]<(Ib(v[0]-x)<Nb?w:k):w<=v[1]&&v[1]<=k:E>Rb^(x<=v[0]&&v[0]<=_)){var $=x_(h,(-p+y)/m);return b_($,d),[v,m_($)]}}}function s(t,n){var r=i?e:Rb-e,o=0;return t<-r?o|=1:t>r&&(o|=2),n<-r?o|=4:n>r&&(o|=8),o}return E_(o,(function(e){var t,n,l,u,c;return{lineStart:function(){u=l=!1,c=1},point:function(f,d){var h,p=[f,d],m=o(f,d),g=i?m?0:s(f,d):m?s(f+(f<0?Rb:-Rb),d):0;if(!t&&(u=l=m)&&e.lineStart(),m!==l&&(!(h=a(t,p))||f_(t,h)||f_(p,h))&&(p[2]=1),m!==l)c=0,m?(e.lineStart(),h=a(p,t),e.point(h[0],h[1])):(h=a(t,p),e.point(h[0],h[1],2),e.lineEnd()),t=h;else if(r&&t&&i^m){var y;g&n||!(y=a(p,t,!0))||(c=0,i?(e.lineStart(),e.point(y[0][0],y[0][1]),e.point(y[1][0],y[1][1]),e.lineEnd()):(e.point(y[1][0],y[1][1]),e.lineEnd(),e.lineStart(),e.point(y[0][0],y[0][1],3)))}!m||t&&f_(t,p)||e.point(p[0],p[1]),t=p,l=m,n=g},lineEnd:function(){l&&e.lineEnd(),t=null},clean:function(){return c|(u&&l)<<1}}}),(function(t,i,r,o){S_(o,e,n,r,t,i)}),i?[0,-e]:[-Rb,e-Rb])}(w=e*jb):(w=null,A_),C()):w*Bb},A.clipExtent=function(e){return arguments.length?(D=null==e?(E=i=r=o=null,$b):O_(E=+e[0][0],i=+e[0][1],r=+e[1][0],o=+e[1][1]),C()):null==E?null:[[E,i],[r,o]]},A.scale=function(e){return arguments.length?(f=+e,M()):f},A.translate=function(e){return arguments.length?(d=+e[0],h=+e[1],M()):[d,h]},A.center=function(e){return arguments.length?(p=e[0]%360*jb,m=e[1]%360*jb,M()):[p*Bb,m*Bb]},A.rotate=function(e){return arguments.length?(g=e[0]%360*jb,y=e[1]%360*jb,v=e.length>2?e[2]%360*jb:0,M()):[g*Bb,y*Bb,v*Bb]},A.angle=function(e){return arguments.length?(b=e%360*jb,M()):b*Bb},A.reflectX=function(e){return arguments.length?(x=e?-1:1,M()):x<0},A.reflectY=function(e){return arguments.length?(_=e?-1:1,M()):_<0},A.precision=function(e){return arguments.length?(a=G_(s,$=e*e),C()):Qb($)},A.fitExtent=function(e,t){return I_(A,e,t)},A.fitSize=function(e,t){return q_(A,e,t)},A.fitWidth=function(e,t){return W_(A,e,t)},A.fitHeight=function(e,t){return H_(A,e,t)},function(){return t=e.apply(this,arguments),A.invert=t.invert&&S,M()}}function Q_(e){var t=0,n=Rb/3,i=Z_(e),r=i(t,n);return r.parallels=function(e){return arguments.length?i(t=e[0]*jb,n=e[1]*jb):[t*Bb,n*Bb]},r}function ew(e,t){var n=Kb(e),i=(n+Kb(t))/2;if(Ib(i)<Nb)return function(e){var t=Hb(e);function n(e,n){return[e*t,Kb(n)/t]}return n.invert=function(e,n){return[e/t,nx(n*t)]},n}(e);var r=1+n*(2*i-n),o=Qb(r)/i;function a(e,t){var n=Qb(r-2*i*Kb(t))/i;return[n*Kb(e*=i),o-n*Hb(e)]}return a.invert=function(e,t){var n=o-t,a=Wb(e,Ib(n))*Zb(n);return n*i<0&&(a-=Rb*Zb(e)*Zb(n)),[a/i,nx((r-(e*e+n*n)*i*i)/(2*i))]},a}function tw(){return Q_(ew).scale(155.424).center([0,33.6442])}function nw(){return tw().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])}function iw(e){return function(t,n){var i=Hb(t),r=Hb(n),o=e(i*r);return o===1/0?[2,0]:[o*r*Kb(t),o*Kb(n)]}}function rw(e){return function(t,n){var i=Qb(t*t+n*n),r=e(i),o=Kb(r),a=Hb(r);return[Wb(t*o,i*a),nx(i&&n*o/i)]}}var ow=iw((function(e){return Qb(2/(1+e))}));ow.invert=rw((function(e){return 2*nx(e/2)}));var aw=iw((function(e){return(e=tx(e))&&e/Kb(e)}));function sw(e,t){return[e,Vb(ex((Pb+t)/2))]}function lw(e){var t,n,i,r=K_(e),o=r.center,a=r.scale,s=r.translate,l=r.clipExtent,u=null;function c(){var o=Rb*a(),s=r(function(e){function t(t){return(t=e(t[0]*jb,t[1]*jb))[0]*=Bb,t[1]*=Bb,t}return e=z_(e[0]*jb,e[1]*jb,e.length>2?e[2]*jb:0),t.invert=function(t){return(t=e.invert(t[0]*jb,t[1]*jb))[0]*=Bb,t[1]*=Bb,t},t}(r.rotate()).invert([0,0]));return l(null==u?[[s[0]-o,s[1]-o],[s[0]+o,s[1]+o]]:e===sw?[[Math.max(s[0]-o,u),t],[Math.min(s[0]+o,n),i]]:[[u,Math.max(s[1]-o,t)],[n,Math.min(s[1]+o,i)]])}return r.scale=function(e){return arguments.length?(a(e),c()):a()},r.translate=function(e){return arguments.length?(s(e),c()):s()},r.center=function(e){return arguments.length?(o(e),c()):o()},r.clipExtent=function(e){return arguments.length?(null==e?u=t=n=i=null:(u=+e[0][0],t=+e[0][1],n=+e[1][0],i=+e[1][1]),c()):null==u?null:[[u,t],[n,i]]},c()}function uw(e){return ex((Pb+e)/2)}function cw(e,t){var n=Hb(e),i=e===t?Kb(e):Vb(n/Hb(t))/Vb(uw(t)/uw(e)),r=n*Yb(uw(e),i)/i;if(!i)return sw;function o(e,t){r>0?t<-Pb+Nb&&(t=-Pb+Nb):t>Pb-Nb&&(t=Pb-Nb);var n=r/Yb(uw(t),i);return[n*Kb(i*e),r-n*Hb(i*e)]}return o.invert=function(e,t){var n=r-t,o=Zb(i)*Qb(e*e+n*n),a=Wb(e,Ib(n))*Zb(n);return n*i<0&&(a-=Rb*Zb(e)*Zb(n)),[a/i,2*qb(Yb(r/o,1/i))-Pb]},o}function fw(e,t){return[e,t]}function dw(e,t){var n=Hb(e),i=e===t?Kb(e):(n-Hb(t))/(t-e),r=n/i+e;if(Ib(i)<Nb)return fw;function o(e,t){var n=r-t,o=i*e;return[n*Kb(o),r-n*Hb(o)]}return o.invert=function(e,t){var n=r-t,o=Wb(e,Ib(n))*Zb(n);return n*i<0&&(o-=Rb*Zb(e)*Zb(n)),[o/i,r-Zb(i)*Qb(e*e+n*n)]},o}aw.invert=rw((function(e){return e})),sw.invert=function(e,t){return[e,2*qb(Jb(t))-Pb]},fw.invert=fw;var hw=1.340264,pw=-.081106,mw=893e-6,gw=.003796,yw=Qb(3)/2;function vw(e,t){var n=nx(yw*Kb(t)),i=n*n,r=i*i*i;return[e*Hb(n)/(yw*(hw+3*pw*i+r*(7*mw+9*gw*i))),n*(hw+pw*i+r*(mw+gw*i))]}function bw(e,t){var n=Hb(t),i=Hb(e)*n;return[n*Kb(e)/i,Kb(t)/i]}function xw(e,t){var n=t*t,i=n*n;return[e*(.8707-.131979*n+i*(i*(.003971*n-.001529*i)-.013791)),t*(1.007226+n*(.015085+i*(.028874*n-.044475-.005916*i)))]}function _w(e,t){return[Hb(t)*Kb(e),Kb(t)]}function ww(e,t){var n=Hb(t),i=1+Hb(e)*n;return[n*Kb(e)/i,Kb(t)/i]}function kw(e,t){return[Vb(ex((Pb+t)/2)),-e]}vw.invert=function(e,t){for(var n,i=t,r=i*i,o=r*r*r,a=0;a<12&&(o=(r=(i-=n=(i*(hw+pw*r+o*(mw+gw*r))-t)/(hw+3*pw*r+o*(7*mw+9*gw*r)))*i)*r*r,!(Ib(n)<zb));++a);return[yw*e*(hw+3*pw*r+o*(7*mw+9*gw*r))/Hb(i),nx(Kb(i)/yw)]},bw.invert=rw(qb),xw.invert=function(e,t){var n,i=t,r=25;do{var o=i*i,a=o*o;i-=n=(i*(1.007226+o*(.015085+a*(.028874*o-.044475-.005916*a)))-t)/(1.007226+o*(.045255+a*(.259866*o-.311325-.005916*11*a)))}while(Ib(n)>Nb&&--r>0);return[e/(.8707+(o=i*i)*(o*(o*o*o*(.003971-.001529*o)-.013791)-.131979)),i]},_w.invert=rw(nx),ww.invert=rw((function(e){return 2*qb(e)})),kw.invert=function(e,t){return[-t,2*qb(Jb(e))-Pb]};var Ew=Math.abs,Dw=(Math.atan,Math.atan2,Math.ceil,Math.cos),$w=(Math.exp,Math.floor,Math.log,Math.max,Math.min,Math.pow,Math.round,Math.sign,Math.sin),Aw=(Math.tan,1e-6),Sw=Math.PI,Mw=Sw/2,Cw=(Math.SQRT1_2,Ow(2));Ow(Sw);function Fw(e){return e>1?Mw:e<-1?-Mw:Math.asin(e)}function Ow(e){return e>0?Math.sqrt(e):0}function Tw(e,t){var n,i=e*$w(t),r=30;do{t-=n=(t+$w(t)-i)/(1+Dw(t))}while(Ew(n)>Aw&&--r>0);return t/2}var Nw=function(e,t,n){function i(i,r){return[e*i*Dw(r=Tw(n,r)),t*$w(r)]}return i.invert=function(i,r){return r=Fw(r/t),[i/(e*Dw(r)),Fw((2*r+$w(2*r))/n)]},i}(Cw/Mw,Cw,Sw);const zw=u_(),Rw=["clipAngle","clipExtent","scale","translate","center","rotate","parallels","precision","reflectX","reflectY","coefficient","distance","fraction","lobes","parallel","radius","ratio","spacing","tilt"];function Pw(e,t){if(!e||"string"!==typeof e)throw new Error("Projection type must be a name string.");return e=e.toLowerCase(),arguments.length>1?(Uw[e]=function(e,t){return function n(){const i=t();return i.type=e,i.path=u_().projection(i),i.copy=i.copy||function(){const e=n();return Rw.forEach((t=>{i[t]&&e[t](i[t]())})),e.path.pointRadius(i.path.pointRadius()),e},qf(i)}}(e,t),this):Uw[e]||null}function Lw(e){return e&&e.path||zw}const Uw={albers:nw,albersusa:function(){var e,t,n,i,r,o,a=nw(),s=tw().rotate([154,0]).center([-2,58.5]).parallels([55,65]),l=tw().rotate([157,0]).center([-3,19.9]).parallels([8,18]),u={point:function(e,t){o=[e,t]}};function c(e){var t=e[0],a=e[1];return o=null,n.point(t,a),o||(i.point(t,a),o)||(r.point(t,a),o)}function f(){return e=t=null,c}return c.invert=function(e){var t=a.scale(),n=a.translate(),i=(e[0]-n[0])/t,r=(e[1]-n[1])/t;return(r>=.12&&r<.234&&i>=-.425&&i<-.214?s:r>=.166&&r<.234&&i>=-.214&&i<-.115?l:a).invert(e)},c.stream=function(n){return e&&t===n?e:e=function(e){var t=e.length;return{point:function(n,i){for(var r=-1;++r<t;)e[r].point(n,i)},sphere:function(){for(var n=-1;++n<t;)e[n].sphere()},lineStart:function(){for(var n=-1;++n<t;)e[n].lineStart()},lineEnd:function(){for(var n=-1;++n<t;)e[n].lineEnd()},polygonStart:function(){for(var n=-1;++n<t;)e[n].polygonStart()},polygonEnd:function(){for(var n=-1;++n<t;)e[n].polygonEnd()}}}([a.stream(t=n),s.stream(n),l.stream(n)])},c.precision=function(e){return arguments.length?(a.precision(e),s.precision(e),l.precision(e),f()):a.precision()},c.scale=function(e){return arguments.length?(a.scale(e),s.scale(.35*e),l.scale(e),c.translate(a.translate())):a.scale()},c.translate=function(e){if(!arguments.length)return a.translate();var t=a.scale(),o=+e[0],c=+e[1];return n=a.translate(e).clipExtent([[o-.455*t,c-.238*t],[o+.455*t,c+.238*t]]).stream(u),i=s.translate([o-.307*t,c+.201*t]).clipExtent([[o-.425*t+Nb,c+.12*t+Nb],[o-.214*t-Nb,c+.234*t-Nb]]).stream(u),r=l.translate([o-.205*t,c+.212*t]).clipExtent([[o-.214*t+Nb,c+.166*t+Nb],[o-.115*t-Nb,c+.234*t-Nb]]).stream(u),f()},c.fitExtent=function(e,t){return I_(c,e,t)},c.fitSize=function(e,t){return q_(c,e,t)},c.fitWidth=function(e,t){return W_(c,e,t)},c.fitHeight=function(e,t){return H_(c,e,t)},c.scale(1070)},azimuthalequalarea:function(){return K_(ow).scale(124.75).clipAngle(179.999)},azimuthalequidistant:function(){return K_(aw).scale(79.4188).clipAngle(179.999)},conicconformal:function(){return Q_(cw).scale(109.5).parallels([30,30])},conicequalarea:tw,conicequidistant:function(){return Q_(dw).scale(131.154).center([0,13.9389])},equalEarth:function(){return K_(vw).scale(177.158)},equirectangular:function(){return K_(fw).scale(152.63)},gnomonic:function(){return K_(bw).scale(144.049).clipAngle(60)},identity:function(){var e,t,n,i,r,o,a,s=1,l=0,u=0,c=1,f=1,d=0,h=null,p=1,m=1,g=U_({point:function(e,t){var n=b([e,t]);this.stream.point(n[0],n[1])}}),y=$b;function v(){return p=s*c,m=s*f,o=a=null,b}function b(n){var i=n[0]*p,r=n[1]*m;if(d){var o=r*e-i*t;i=i*e+r*t,r=o}return[i+l,r+u]}return b.invert=function(n){var i=n[0]-l,r=n[1]-u;if(d){var o=r*e+i*t;i=i*e-r*t,r=o}return[i/p,r/m]},b.stream=function(e){return o&&a===e?o:o=g(y(a=e))},b.postclip=function(e){return arguments.length?(y=e,h=n=i=r=null,v()):y},b.clipExtent=function(e){return arguments.length?(y=null==e?(h=n=i=r=null,$b):O_(h=+e[0][0],n=+e[0][1],i=+e[1][0],r=+e[1][1]),v()):null==h?null:[[h,n],[i,r]]},b.scale=function(e){return arguments.length?(s=+e,v()):s},b.translate=function(e){return arguments.length?(l=+e[0],u=+e[1],v()):[l,u]},b.angle=function(n){return arguments.length?(t=Kb(d=n%360*jb),e=Hb(d),v()):d*Bb},b.reflectX=function(e){return arguments.length?(c=e?-1:1,v()):c<0},b.reflectY=function(e){return arguments.length?(f=e?-1:1,v()):f<0},b.fitExtent=function(e,t){return I_(b,e,t)},b.fitSize=function(e,t){return q_(b,e,t)},b.fitWidth=function(e,t){return W_(b,e,t)},b.fitHeight=function(e,t){return H_(b,e,t)},b},mercator:function(){return lw(sw).scale(961/Ub)},mollweide:function(){return K_(Nw).scale(169.529)},naturalEarth1:function(){return K_(xw).scale(175.295)},orthographic:function(){return K_(_w).scale(249.5).clipAngle(90+Nb)},stereographic:function(){return K_(ww).scale(250).clipAngle(142)},transversemercator:function(){var e=lw(kw),t=e.center,n=e.rotate;return e.center=function(e){return arguments.length?t([-e[1],e[0]]):[(e=t())[1],-e[0]]},e.rotate=function(e){return arguments.length?n([e[0],e[1],e.length>2?e[2]+90:90]):[(e=n())[0],e[1],e[2]-90]},n([0,0,90]).scale(159.155)}};for(const PN in Uw)Pw(PN,Uw[PN]);function Bw(e,t,n){var i=pa(e,t-Nb,n).concat(t);return function(e){return i.map((function(t){return[e,t]}))}}function jw(e,t,n){var i=pa(e,t-Nb,n).concat(t);return function(e){return i.map((function(t){return[t,e]}))}}function Iw(){var e,t,n,i,r,o,a,s,l,u,c,f,d=10,h=d,p=90,m=360,g=2.5;function y(){return{type:"MultiLineString",coordinates:v()}}function v(){return pa(Xb(i/p)*p,n,p).map(c).concat(pa(Xb(s/m)*m,a,m).map(f)).concat(pa(Xb(t/d)*d,e,d).filter((function(e){return Ib(e%p)>Nb})).map(l)).concat(pa(Xb(o/h)*h,r,h).filter((function(e){return Ib(e%m)>Nb})).map(u))}return y.lines=function(){return v().map((function(e){return{type:"LineString",coordinates:e}}))},y.outline=function(){return{type:"Polygon",coordinates:[c(i).concat(f(a).slice(1),c(n).reverse().slice(1),f(s).reverse().slice(1))]}},y.extent=function(e){return arguments.length?y.extentMajor(e).extentMinor(e):y.extentMinor()},y.extentMajor=function(e){return arguments.length?(i=+e[0][0],n=+e[1][0],s=+e[0][1],a=+e[1][1],i>n&&(e=i,i=n,n=e),s>a&&(e=s,s=a,a=e),y.precision(g)):[[i,s],[n,a]]},y.extentMinor=function(n){return arguments.length?(t=+n[0][0],e=+n[1][0],o=+n[0][1],r=+n[1][1],t>e&&(n=t,t=e,e=n),o>r&&(n=o,o=r,r=n),y.precision(g)):[[t,o],[e,r]]},y.step=function(e){return arguments.length?y.stepMajor(e).stepMinor(e):y.stepMinor()},y.stepMajor=function(e){return arguments.length?(p=+e[0],m=+e[1],y):[p,m]},y.stepMinor=function(e){return arguments.length?(d=+e[0],h=+e[1],y):[d,h]},y.precision=function(d){return arguments.length?(g=+d,l=Bw(o,r,90),u=jw(t,e,g),c=Bw(s,a,90),f=jw(i,n,g),y):g},y.extentMajor([[-180,-90+Nb],[180,90-Nb]]).extentMinor([[-180,-80-Nb],[180,80+Nb]])}function qw(){}const Ww=[[],[[[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 Hw(){var e=1,t=1,n=a;function i(e,t){return t.map((t=>r(e,t)))}function r(i,r){var a=[],s=[];return function(n,i,r){var a,s,l,u,c,f,d=new Array,h=new Array;a=s=-1,u=n[0]>=i,Ww[u<<1].forEach(p);for(;++a<e-1;)l=u,u=n[a+1]>=i,Ww[l|u<<1].forEach(p);Ww[u<<0].forEach(p);for(;++s<t-1;){for(a=-1,u=n[s*e+e]>=i,c=n[s*e]>=i,Ww[u<<1|c<<2].forEach(p);++a<e-1;)l=u,u=n[s*e+e+a+1]>=i,f=c,c=n[s*e+a+1]>=i,Ww[l|u<<1|c<<2|f<<3].forEach(p);Ww[u|c<<3].forEach(p)}a=-1,c=n[s*e]>=i,Ww[c<<2].forEach(p);for(;++a<e-1;)f=c,c=n[s*e+a+1]>=i,Ww[c<<2|f<<3].forEach(p);function p(e){var t,n,i=[e[0][0]+a,e[0][1]+s],l=[e[1][0]+a,e[1][1]+s],u=o(i),c=o(l);(t=h[u])?(n=d[c])?(delete h[t.end],delete d[n.start],t===n?(t.ring.push(l),r(t.ring)):d[t.start]=h[n.end]={start:t.start,end:n.end,ring:t.ring.concat(n.ring)}):(delete h[t.end],t.ring.push(l),h[t.end=c]=t):(t=d[c])?(n=h[u])?(delete d[t.start],delete h[n.end],t===n?(t.ring.push(l),r(t.ring)):d[n.start]=h[t.end]={start:n.start,end:t.end,ring:n.ring.concat(t.ring)}):(delete d[t.start],t.ring.unshift(i),d[t.start=u]=t):d[u]=h[c]={start:u,end:c,ring:[i,l]}}Ww[c<<3].forEach(p)}(i,r,(e=>{n(e,i,r),function(e){var t=0,n=e.length,i=e[n-1][1]*e[0][0]-e[n-1][0]*e[0][1];for(;++t<n;)i+=e[t-1][1]*e[t][0]-e[t-1][0]*e[t][1];return i}(e)>0?a.push([e]):s.push(e)})),s.forEach((e=>{for(var t,n=0,i=a.length;n<i;++n)if(-1!==Xw((t=a[n])[0],e))return void t.push(e)})),{type:"MultiPolygon",value:r,coordinates:a}}function o(t){return 2*t[0]+t[1]*(e+1)*4}function a(n,i,r){n.forEach((n=>{var o,a=n[0],s=n[1],l=0|a,u=0|s,c=i[u*e+l];a>0&&a<e&&l===a&&(o=i[u*e+l-1],n[0]=a+(r-o)/(c-o)-.5),s>0&&s<t&&u===s&&(o=i[(u-1)*e+l],n[1]=s+(r-o)/(c-o)-.5)}))}return i.contour=r,i.size=function(n){if(!arguments.length)return[e,t];var r=Math.floor(n[0]),o=Math.floor(n[1]);return r>=0&&o>=0||(0,m.vU)("invalid size"),e=r,t=o,i},i.smooth=function(e){return arguments.length?(n=e?a:qw,i):n===a},i}function Xw(e,t){for(var n,i=-1,r=t.length;++i<r;)if(n=Jw(e,t[i]))return n;return 0}function Jw(e,t){for(var n=t[0],i=t[1],r=-1,o=0,a=e.length,s=a-1;o<a;s=o++){var l=e[o],u=l[0],c=l[1],f=e[s],d=f[0],h=f[1];if(Gw(l,f,t))return 0;c>i!==h>i&&n<(d-u)*(i-c)/(h-c)+u&&(r=-r)}return r}function Gw(e,t,n){var i,r,o,a;return function(e,t,n){return(t[0]-e[0])*(n[1]-e[1])===(n[0]-e[0])*(t[1]-e[1])}(e,t,n)&&(r=e[i=+(e[0]===t[0])],o=n[i],a=t[i],r<=o&&o<=a||a<=o&&o<=r)}function Vw(e,t,n){return function(i){var r=(0,m.We)(i),o=n?Math.min(r[0],0):r[0],a=r[1],s=a-o,l=t?U(o,a,e):s/(e+1);return pa(o+l,a,l)}}function Yw(e){no.call(this,null,e)}function Kw(e,t,n,i,r){const o=e.x1||0,a=e.y1||0,s=t*n<0;function l(e){e.forEach(u)}function u(e){s&&e.reverse(),e.forEach(c)}function c(e){e[0]=(e[0]-o)*t+i,e[1]=(e[1]-a)*n+r}return function(e){return e.coordinates.forEach(l),e}}function Zw(e,t,n){const i=e>=0?e:xo(t,n);return Math.round((Math.sqrt(4*i*i+1)-1)/2)}function Qw(e){return(0,m.mf)(e)?e:(0,m.a9)(+e)}function ek(){var e=e=>e[0],t=e=>e[1],n=m.kX,i=[-1,-1],r=960,o=500,a=2;function s(s,l){const u=Zw(i[0],s,e)>>a,c=Zw(i[1],s,t)>>a,f=u?u+2:0,d=c?c+2:0,h=2*f+(r>>a),p=2*d+(o>>a),m=new Float32Array(h*p),g=new Float32Array(h*p);let y=m;s.forEach((i=>{const r=f+(+e(i)>>a),o=d+(+t(i)>>a);r>=0&&r<h&&o>=0&&o<p&&(m[r+o*h]+=+n(i))})),u>0&&c>0?(tk(h,p,m,g,u),nk(h,p,g,m,c),tk(h,p,m,g,u),nk(h,p,g,m,c),tk(h,p,m,g,u),nk(h,p,g,m,c)):u>0?(tk(h,p,m,g,u),tk(h,p,g,m,u),tk(h,p,m,g,u),y=g):c>0&&(nk(h,p,m,g,c),nk(h,p,g,m,c),nk(h,p,m,g,c),y=g);const v=l?Math.pow(2,-2*a):1/Gv(y);for(let e=0,t=h*p;e<t;++e)y[e]*=v;return{values:y,scale:1<<a,width:h,height:p,x1:f,y1:d,x2:f+(r>>a),y2:d+(o>>a)}}return s.x=function(t){return arguments.length?(e=Qw(t),s):e},s.y=function(e){return arguments.length?(t=Qw(e),s):t},s.weight=function(e){return arguments.length?(n=Qw(e),s):n},s.size=function(e){if(!arguments.length)return[r,o];var t=+e[0],n=+e[1];return t>=0&&n>=0||(0,m.vU)("invalid size"),r=t,o=n,s},s.cellSize=function(e){return arguments.length?((e=+e)>=1||(0,m.vU)("invalid cell size"),a=Math.floor(Math.log(e)/Math.LN2),s):1<<a},s.bandwidth=function(e){return arguments.length?(1===(e=(0,m.IX)(e)).length&&(e=[+e[0],+e[0]]),2!==e.length&&(0,m.vU)("invalid bandwidth"),i=e,s):i},s}function tk(e,t,n,i,r){const o=1+(r<<1);for(let a=0;a<t;++a)for(let t=0,s=0;t<e+r;++t)t<e&&(s+=n[t+a*e]),t>=r&&(t>=o&&(s-=n[t-o+a*e]),i[t-r+a*e]=s/Math.min(t+1,e-1+o-t,o))}function nk(e,t,n,i,r){const o=1+(r<<1);for(let a=0;a<e;++a)for(let s=0,l=0;s<t+r;++s)s<t&&(l+=n[a+s*e]),s>=r&&(s>=o&&(l-=n[a+(s-o)*e]),i[a+(s-r)*e]=l/Math.min(s+1,t-1+o-s,o))}function ik(e){no.call(this,null,e)}Yw.Definition={type:"Isocontour",metadata:{generates:!0},params:[{name:"field",type:"field"},{name:"thresholds",type:"number",array:!0},{name:"levels",type:"number"},{name:"nice",type:"boolean",default:!1},{name:"resolve",type:"enum",values:["shared","independent"],default:"independent"},{name:"zero",type:"boolean",default:!0},{name:"smooth",type:"boolean",default:!0},{name:"scale",type:"number",expr:!0},{name:"translate",type:"number",array:!0,expr:!0},{name:"as",type:"string",null:!0,default:"contour"}]},(0,m.XW)(Yw,no,{transform(e,t){if(this.value&&!t.changed()&&!e.modified())return t.StopPropagation;var n=t.fork(t.NO_SOURCE|t.NO_FIELDS),i=t.materialize(t.SOURCE).source,r=e.field||m.yR,o=Hw().smooth(!1!==e.smooth),a=e.thresholds||function(e,t,n){const i=Vw(n.levels||10,n.nice,!1!==n.zero);return"shared"!==n.resolve?i:i(e.map((e=>ao(t(e).values))))}(i,r,e),s=null===e.as?null:e.as||"contour",l=[];return i.forEach((t=>{const n=r(t),i=o.size([n.width,n.height])(n.values,(0,m.kJ)(a)?a:a(n.values));!function(e,t,n,i){let r=i.scale||t.scale,o=i.translate||t.translate;(0,m.mf)(r)&&(r=r(n,i));(0,m.mf)(o)&&(o=o(n,i));if((1===r||null==r)&&!o)return;const a=((0,m.hj)(r)?r:r[0])||1,s=((0,m.hj)(r)?r:r[1])||1,l=o&&o[0]||0,u=o&&o[1]||0;e.forEach(Kw(t,a,s,l,u))}(i,n,t,e),i.forEach((e=>{l.push(Ar(t,Dr(null!=s?{[s]:e}:e)))}))})),this.value&&(n.rem=this.value),this.value=n.source=n.add=l,n}}),ik.Definition={type:"KDE2D",metadata:{generates:!0},params:[{name:"size",type:"number",array:!0,length:2,required:!0},{name:"x",type:"field",required:!0},{name:"y",type:"field",required:!0},{name:"weight",type:"field"},{name:"groupby",type:"field",array:!0},{name:"cellSize",type:"number"},{name:"bandwidth",type:"number",array:!0,length:2},{name:"counts",type:"boolean",default:!1},{name:"as",type:"string",default:"grid"}]};const rk=["x","y","weight","size","cellSize","bandwidth"];function ok(e,t){return rk.forEach((n=>null!=t[n]?e[n](t[n]):0)),e}function ak(e){no.call(this,null,e)}(0,m.XW)(ik,no,{transform(e,t){if(this.value&&!t.changed()&&!e.modified())return t.StopPropagation;var n,i=t.fork(t.NO_SOURCE|t.NO_FIELDS),r=function(e,t){var n,i,r,o,a,s,l=[],u=e=>e(o);if(null==t)l.push(e);else for(n={},i=0,r=e.length;i<r;++i)o=e[i],(s=n[a=t.map(u)])||(n[a]=s=[],s.dims=a,l.push(s)),s.push(o);return l}(t.materialize(t.SOURCE).source,e.groupby),o=(e.groupby||[]).map(m.el),a=ok(ek(),e),s=e.as||"grid";return n=r.map((t=>Dr(function(e,t){for(let n=0;n<o.length;++n)e[o[n]]=t[n];return e}({[s]:a(t,e.counts)},t.dims)))),this.value&&(i.rem=this.value),this.value=i.source=i.add=n,i}}),ak.Definition={type:"Contour",metadata:{generates:!0},params:[{name:"size",type:"number",array:!0,length:2,required:!0},{name:"values",type:"number",array:!0},{name:"x",type:"field"},{name:"y",type:"field"},{name:"weight",type:"field"},{name:"cellSize",type:"number"},{name:"bandwidth",type:"number"},{name:"count",type:"number"},{name:"nice",type:"boolean",default:!1},{name:"thresholds",type:"number",array:!0},{name:"smooth",type:"boolean",default:!0}]},(0,m.XW)(ak,no,{transform(e,t){if(this.value&&!t.changed()&&!e.modified())return t.StopPropagation;var n,i,r=t.fork(t.NO_SOURCE|t.NO_FIELDS),o=Hw().smooth(!1!==e.smooth),a=e.values,s=e.thresholds||Vw(e.count||10,e.nice,!!a),l=e.size;return a||(a=t.materialize(t.SOURCE).source,i=Kw(n=ok(ek(),e)(a,!0),n.scale||1,n.scale||1,0,0),l=[n.width,n.height],a=n.values),s=(0,m.kJ)(s)?s:s(a),a=o.size(l)(a,s),i&&a.forEach(i),this.value&&(r.rem=this.value),this.value=r.source=r.add=(a||[]).map(Dr),r}});const sk="Feature",lk="FeatureCollection";function uk(e){no.call(this,null,e)}function ck(e){no.call(this,null,e)}function fk(e){no.call(this,null,e)}function dk(e){no.call(this,null,e)}function hk(e){no.call(this,[],e),this.generator=Iw()}function pk(e){no.call(this,null,e)}function mk(e){if(!(0,m.mf)(e))return!1;const t=(0,m.Rg)((0,m.Oj)(e));return t.$x||t.$y||t.$value||t.$max}function gk(e){no.call(this,null,e),this.modified(!0)}function yk(e,t,n){(0,m.mf)(e[t])&&e[t](n)}function vk(e,t,n,i){if(isNaN(t)||isNaN(n))return e;var r,o,a,s,l,u,c,f,d,h=e._root,p={data:i},m=e._x0,g=e._y0,y=e._x1,v=e._y1;if(!h)return e._root=p,e;for(;h.length;)if((u=t>=(o=(m+y)/2))?m=o:y=o,(c=n>=(a=(g+v)/2))?g=a:v=a,r=h,!(h=h[f=c<<1|u]))return r[f]=p,e;if(s=+e._x.call(null,h.data),l=+e._y.call(null,h.data),t===s&&n===l)return p.next=h,r?r[f]=p:e._root=p,e;do{r=r?r[f]=new Array(4):e._root=new Array(4),(u=t>=(o=(m+y)/2))?m=o:y=o,(c=n>=(a=(g+v)/2))?g=a:v=a}while((f=c<<1|u)===(d=(l>=a)<<1|s>=o));return r[d]=h,r[f]=p,e}function bk(e,t,n,i,r){this.node=e,this.x0=t,this.y0=n,this.x1=i,this.y1=r}function xk(e){return e[0]}function _k(e){return e[1]}function wk(e,t,n){var i=new kk(null==t?xk:t,null==n?_k:n,NaN,NaN,NaN,NaN);return null==e?i:i.addAll(e)}function kk(e,t,n,i,r,o){this._x=e,this._y=t,this._x0=n,this._y0=i,this._x1=r,this._y1=o,this._root=void 0}function Ek(e){for(var t={data:e.data},n=t;e=e.next;)n=n.next={data:e.data};return t}uk.Definition={type:"GeoJSON",metadata:{},params:[{name:"fields",type:"field",array:!0,length:2},{name:"geojson",type:"field"}]},(0,m.XW)(uk,no,{transform(e,t){var n,i=this._features,r=this._points,o=e.fields,a=o&&o[0],s=o&&o[1],l=e.geojson||!o&&m.yR,u=t.ADD;n=e.modified()||t.changed(t.REM)||t.modified((0,m.Oj)(l))||a&&t.modified((0,m.Oj)(a))||s&&t.modified((0,m.Oj)(s)),this.value&&!n||(u=t.SOURCE,this._features=i=[],this._points=r=[]),l&&t.visit(u,(e=>i.push(l(e)))),a&&s&&(t.visit(u,(e=>{var t=a(e),n=s(e);null!=t&&null!=n&&(t=+t)===t&&(n=+n)===n&&r.push([t,n])})),i=i.concat({type:sk,geometry:{type:"MultiPoint",coordinates:r}})),this.value={type:lk,features:i}}}),ck.Definition={type:"GeoPath",metadata:{modifies:!0},params:[{name:"projection",type:"projection"},{name:"field",type:"field"},{name:"pointRadius",type:"number",expr:!0},{name:"as",type:"string",default:"path"}]},(0,m.XW)(ck,no,{transform(e,t){var n=t.fork(t.ALL),i=this.value,r=e.field||m.yR,o=e.as||"path",a=n.SOURCE;!i||e.modified()?(this.value=i=Lw(e.projection),n.materialize().reflow()):a=r===m.yR||t.modified(r.fields)?n.ADD_MOD:n.ADD;const s=function(e,t){const n=e.pointRadius();e.context(null),null!=t&&e.pointRadius(t);return n}(i,e.pointRadius);return n.visit(a,(e=>e[o]=i(r(e)))),i.pointRadius(s),n.modifies(o)}}),fk.Definition={type:"GeoPoint",metadata:{modifies:!0},params:[{name:"projection",type:"projection",required:!0},{name:"fields",type:"field",array:!0,required:!0,length:2},{name:"as",type:"string",array:!0,length:2,default:["x","y"]}]},(0,m.XW)(fk,no,{transform(e,t){var n,i=e.projection,r=e.fields[0],o=e.fields[1],a=e.as||["x","y"],s=a[0],l=a[1];function u(e){const t=i([r(e),o(e)]);t?(e[s]=t[0],e[l]=t[1]):(e[s]=void 0,e[l]=void 0)}return e.modified()?t=t.materialize().reflow(!0).visit(t.SOURCE,u):(n=t.modified(r.fields)||t.modified(o.fields),t.visit(n?t.ADD_MOD:t.ADD,u)),t.modifies(a)}}),dk.Definition={type:"GeoShape",metadata:{modifies:!0,nomod:!0},params:[{name:"projection",type:"projection"},{name:"field",type:"field",default:"datum"},{name:"pointRadius",type:"number",expr:!0},{name:"as",type:"string",default:"shape"}]},(0,m.XW)(dk,no,{transform(e,t){var n=t.fork(t.ALL),i=this.value,r=e.as||"shape",o=n.ADD;return i&&!e.modified()||(this.value=i=function(e,t,n){const i=null==n?n=>e(t(n)):i=>{var r=e.pointRadius(),o=e.pointRadius(n)(t(i));return e.pointRadius(r),o};return i.context=t=>(e.context(t),i),i}(Lw(e.projection),e.field||(0,m.EP)("datum"),e.pointRadius),n.materialize().reflow(),o=n.SOURCE),n.visit(o,(e=>e[r]=i)),n.modifies(r)}}),hk.Definition={type:"Graticule",metadata:{changes:!0,generates:!0},params:[{name:"extent",type:"array",array:!0,length:2,content:{type:"number",array:!0,length:2}},{name:"extentMajor",type:"array",array:!0,length:2,content:{type:"number",array:!0,length:2}},{name:"extentMinor",type:"array",array:!0,length:2,content:{type:"number",array:!0,length:2}},{name:"step",type:"number",array:!0,length:2},{name:"stepMajor",type:"number",array:!0,length:2,default:[90,360]},{name:"stepMinor",type:"number",array:!0,length:2,default:[10,10]},{name:"precision",type:"number",default:2.5}]},(0,m.XW)(hk,no,{transform(e,t){var n,i=this.value,r=this.generator;if(!i.length||e.modified())for(const o in e)(0,m.mf)(r[o])&&r[o](e[o]);return n=r(),i.length?t.mod.push(Sr(i[0],n)):t.add.push(Dr(n)),i[0]=n,t}}),pk.Definition={type:"heatmap",metadata:{modifies:!0},params:[{name:"field",type:"field"},{name:"color",type:"string",expr:!0},{name:"opacity",type:"number",expr:!0},{name:"resolve",type:"enum",values:["shared","independent"],default:"independent"},{name:"as",type:"string",default:"image"}]},(0,m.XW)(pk,no,{transform(e,t){if(!t.changed()&&!e.modified())return t.StopPropagation;var n=t.materialize(t.SOURCE).source,i="shared"===e.resolve,r=e.field||m.yR,o=function(e,t){let n;(0,m.mf)(e)?(n=n=>e(n,t),n.dep=mk(e)):e?n=(0,m.a9)(e):(n=e=>e.$value/e.$max||0,n.dep=!0);return n}(e.opacity,e),a=function(e,t){let n;(0,m.mf)(e)?(n=n=>(0,su.B8)(e(n,t)),n.dep=mk(e)):n=(0,m.a9)((0,su.B8)(e||"#888"));return n}(e.color,e),s=e.as||"image",l={$x:0,$y:0,$value:0,$max:i?ao(n.map((e=>ao(r(e).values)))):0};return n.forEach((e=>{const t=r(e),n=(0,m.l7)({},e,l);i||(n.$max=ao(t.values||[])),e[s]=function(e,t,n,i){const r=e.width,o=e.height,a=e.x1||0,s=e.y1||0,l=e.x2||r,u=e.y2||o,c=e.values,f=c?e=>c[e]:m.bM,d=tu(l-a,u-s),h=d.getContext("2d"),p=h.getImageData(0,0,l-a,u-s),g=p.data;for(let m=s,y=0;m<u;++m){t.$y=m-s;for(let e=a,o=m*r;e<l;++e,y+=4){t.$x=e-a,t.$value=f(e+o);const r=n(t);g[y+0]=r.r,g[y+1]=r.g,g[y+2]=r.b,g[y+3]=~~(255*i(t))}}return h.putImageData(p,0,0),d}(t,n,a.dep?a:(0,m.a9)(a(n)),o.dep?o:(0,m.a9)(o(n)))})),t.reflow(!0).modifies(s)}}),(0,m.XW)(gk,no,{transform(e,t){let n=this.value;return!n||e.modified("type")?(this.value=n=function(e){const t=Pw((e||"mercator").toLowerCase());t||(0,m.vU)("Unrecognized projection type: "+e);return t()}(e.type),Rw.forEach((t=>{null!=e[t]&&yk(n,t,e[t])}))):Rw.forEach((t=>{e.modified(t)&&yk(n,t,e[t])})),null!=e.pointRadius&&n.path.pointRadius(e.pointRadius),e.fit&&function(e,t){const n=function(e){return e=(0,m.IX)(e),1===e.length?e[0]:{type:lk,features:e.reduce(((e,t)=>e.concat(function(e){return e.type===lk?e.features:(0,m.IX)(e).filter((e=>null!=e)).map((e=>e.type===sk?e:{type:sk,geometry:e}))}(t))),[])}}(t.fit);t.extent?e.fitExtent(t.extent,n):t.size&&e.fitSize(t.size,n)}(n,e),t.fork(t.NO_SOURCE|t.NO_FIELDS)}});var Dk=wk.prototype=kk.prototype;function $k(e){return function(){return e}}function Ak(e){return 1e-6*(e()-.5)}function Sk(e){return e.x+e.vx}function Mk(e){return e.y+e.vy}Dk.copy=function(){var e,t,n=new kk(this._x,this._y,this._x0,this._y0,this._x1,this._y1),i=this._root;if(!i)return n;if(!i.length)return n._root=Ek(i),n;for(e=[{source:i,target:n._root=new Array(4)}];i=e.pop();)for(var r=0;r<4;++r)(t=i.source[r])&&(t.length?e.push({source:t,target:i.target[r]=new Array(4)}):i.target[r]=Ek(t));return n},Dk.add=function(e){const t=+this._x.call(null,e),n=+this._y.call(null,e);return vk(this.cover(t,n),t,n,e)},Dk.addAll=function(e){var t,n,i,r,o=e.length,a=new Array(o),s=new Array(o),l=1/0,u=1/0,c=-1/0,f=-1/0;for(n=0;n<o;++n)isNaN(i=+this._x.call(null,t=e[n]))||isNaN(r=+this._y.call(null,t))||(a[n]=i,s[n]=r,i<l&&(l=i),i>c&&(c=i),r<u&&(u=r),r>f&&(f=r));if(l>c||u>f)return this;for(this.cover(l,u).cover(c,f),n=0;n<o;++n)vk(this,a[n],s[n],e[n]);return this},Dk.cover=function(e,t){if(isNaN(e=+e)||isNaN(t=+t))return this;var n=this._x0,i=this._y0,r=this._x1,o=this._y1;if(isNaN(n))r=(n=Math.floor(e))+1,o=(i=Math.floor(t))+1;else{for(var a,s,l=r-n||1,u=this._root;n>e||e>=r||i>t||t>=o;)switch(s=(t<i)<<1|e<n,(a=new Array(4))[s]=u,u=a,l*=2,s){case 0:r=n+l,o=i+l;break;case 1:n=r-l,o=i+l;break;case 2:r=n+l,i=o-l;break;case 3:n=r-l,i=o-l}this._root&&this._root.length&&(this._root=u)}return this._x0=n,this._y0=i,this._x1=r,this._y1=o,this},Dk.data=function(){var e=[];return this.visit((function(t){if(!t.length)do{e.push(t.data)}while(t=t.next)})),e},Dk.extent=function(e){return arguments.length?this.cover(+e[0][0],+e[0][1]).cover(+e[1][0],+e[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]},Dk.find=function(e,t,n){var i,r,o,a,s,l,u,c=this._x0,f=this._y0,d=this._x1,h=this._y1,p=[],m=this._root;for(m&&p.push(new bk(m,c,f,d,h)),null==n?n=1/0:(c=e-n,f=t-n,d=e+n,h=t+n,n*=n);l=p.pop();)if(!(!(m=l.node)||(r=l.x0)>d||(o=l.y0)>h||(a=l.x1)<c||(s=l.y1)<f))if(m.length){var g=(r+a)/2,y=(o+s)/2;p.push(new bk(m[3],g,y,a,s),new bk(m[2],r,y,g,s),new bk(m[1],g,o,a,y),new bk(m[0],r,o,g,y)),(u=(t>=y)<<1|e>=g)&&(l=p[p.length-1],p[p.length-1]=p[p.length-1-u],p[p.length-1-u]=l)}else{var v=e-+this._x.call(null,m.data),b=t-+this._y.call(null,m.data),x=v*v+b*b;if(x<n){var _=Math.sqrt(n=x);c=e-_,f=t-_,d=e+_,h=t+_,i=m.data}}return i},Dk.remove=function(e){if(isNaN(o=+this._x.call(null,e))||isNaN(a=+this._y.call(null,e)))return this;var t,n,i,r,o,a,s,l,u,c,f,d,h=this._root,p=this._x0,m=this._y0,g=this._x1,y=this._y1;if(!h)return this;if(h.length)for(;;){if((u=o>=(s=(p+g)/2))?p=s:g=s,(c=a>=(l=(m+y)/2))?m=l:y=l,t=h,!(h=h[f=c<<1|u]))return this;if(!h.length)break;(t[f+1&3]||t[f+2&3]||t[f+3&3])&&(n=t,d=f)}for(;h.data!==e;)if(i=h,!(h=h.next))return this;return(r=h.next)&&delete h.next,i?(r?i.next=r:delete i.next,this):t?(r?t[f]=r:delete t[f],(h=t[0]||t[1]||t[2]||t[3])&&h===(t[3]||t[2]||t[1]||t[0])&&!h.length&&(n?n[d]=h:this._root=h),this):(this._root=r,this)},Dk.removeAll=function(e){for(var t=0,n=e.length;t<n;++t)this.remove(e[t]);return this},Dk.root=function(){return this._root},Dk.size=function(){var e=0;return this.visit((function(t){if(!t.length)do{++e}while(t=t.next)})),e},Dk.visit=function(e){var t,n,i,r,o,a,s=[],l=this._root;for(l&&s.push(new bk(l,this._x0,this._y0,this._x1,this._y1));t=s.pop();)if(!e(l=t.node,i=t.x0,r=t.y0,o=t.x1,a=t.y1)&&l.length){var u=(i+o)/2,c=(r+a)/2;(n=l[3])&&s.push(new bk(n,u,c,o,a)),(n=l[2])&&s.push(new bk(n,i,c,u,a)),(n=l[1])&&s.push(new bk(n,u,r,o,c)),(n=l[0])&&s.push(new bk(n,i,r,u,c))}return this},Dk.visitAfter=function(e){var t,n=[],i=[];for(this._root&&n.push(new bk(this._root,this._x0,this._y0,this._x1,this._y1));t=n.pop();){var r=t.node;if(r.length){var o,a=t.x0,s=t.y0,l=t.x1,u=t.y1,c=(a+l)/2,f=(s+u)/2;(o=r[0])&&n.push(new bk(o,a,s,c,f)),(o=r[1])&&n.push(new bk(o,c,s,l,f)),(o=r[2])&&n.push(new bk(o,a,f,c,u)),(o=r[3])&&n.push(new bk(o,c,f,l,u))}i.push(t)}for(;t=i.pop();)e(t.node,t.x0,t.y0,t.x1,t.y1);return this},Dk.x=function(e){return arguments.length?(this._x=e,this):this._x},Dk.y=function(e){return arguments.length?(this._y=e,this):this._y};var Ck={value:()=>{}};function Fk(){for(var e,t=0,n=arguments.length,i={};t<n;++t){if(!(e=arguments[t]+"")||e in i||/[\s.]/.test(e))throw new Error("illegal type: "+e);i[e]=[]}return new Ok(i)}function Ok(e){this._=e}function Tk(e,t){for(var n,i=0,r=e.length;i<r;++i)if((n=e[i]).name===t)return n.value}function Nk(e,t,n){for(var i=0,r=e.length;i<r;++i)if(e[i].name===t){e[i]=Ck,e=e.slice(0,i).concat(e.slice(i+1));break}return null!=n&&e.push({name:t,value:n}),e}Ok.prototype=Fk.prototype={constructor:Ok,on:function(e,t){var n,i,r=this._,o=(i=r,(e+"").trim().split(/^|\s+/).map((function(e){var t="",n=e.indexOf(".");if(n>=0&&(t=e.slice(n+1),e=e.slice(0,n)),e&&!i.hasOwnProperty(e))throw new Error("unknown type: "+e);return{type:e,name:t}}))),a=-1,s=o.length;if(!(arguments.length<2)){if(null!=t&&"function"!==typeof t)throw new Error("invalid callback: "+t);for(;++a<s;)if(n=(e=o[a]).type)r[n]=Nk(r[n],e.name,t);else if(null==t)for(n in r)r[n]=Nk(r[n],e.name,null);return this}for(;++a<s;)if((n=(e=o[a]).type)&&(n=Tk(r[n],e.name)))return n},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new Ok(e)},call:function(e,t){if((n=arguments.length-2)>0)for(var n,i,r=new Array(n),o=0;o<n;++o)r[o]=arguments[o+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(o=0,n=(i=this._[e]).length;o<n;++o)i[o].value.apply(t,r)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var i=this._[e],r=0,o=i.length;r<o;++r)i[r].value.apply(t,n)}};const zk=Fk;var Rk=n(22583);const Pk=1664525,Lk=1013904223,Uk=4294967296;function Bk(e){return e.x}function jk(e){return e.y}var Ik=10,qk=Math.PI*(3-Math.sqrt(5));function Wk(e){var t,n=1,i=.001,r=1-Math.pow(i,1/300),o=0,a=.6,s=new Map,l=(0,Rk.HT)(f),u=zk("tick","end"),c=function(){let e=1;return()=>(e=(Pk*e+Lk)%Uk)/Uk}();function f(){d(),u.call("tick",t),n<i&&(l.stop(),u.call("end",t))}function d(i){var l,u,c=e.length;void 0===i&&(i=1);for(var f=0;f<i;++f)for(n+=(o-n)*r,s.forEach((function(e){e(n)})),l=0;l<c;++l)null==(u=e[l]).fx?u.x+=u.vx*=a:(u.x=u.fx,u.vx=0),null==u.fy?u.y+=u.vy*=a:(u.y=u.fy,u.vy=0);return t}function h(){for(var t,n=0,i=e.length;n<i;++n){if((t=e[n]).index=n,null!=t.fx&&(t.x=t.fx),null!=t.fy&&(t.y=t.fy),isNaN(t.x)||isNaN(t.y)){var r=Ik*Math.sqrt(.5+n),o=n*qk;t.x=r*Math.cos(o),t.y=r*Math.sin(o)}(isNaN(t.vx)||isNaN(t.vy))&&(t.vx=t.vy=0)}}function p(t){return t.initialize&&t.initialize(e,c),t}return null==e&&(e=[]),h(),t={tick:d,restart:function(){return l.restart(f),t},stop:function(){return l.stop(),t},nodes:function(n){return arguments.length?(e=n,h(),s.forEach(p),t):e},alpha:function(e){return arguments.length?(n=+e,t):n},alphaMin:function(e){return arguments.length?(i=+e,t):i},alphaDecay:function(e){return arguments.length?(r=+e,t):+r},alphaTarget:function(e){return arguments.length?(o=+e,t):o},velocityDecay:function(e){return arguments.length?(a=1-e,t):1-a},randomSource:function(e){return arguments.length?(c=e,s.forEach(p),t):c},force:function(e,n){return arguments.length>1?(null==n?s.delete(e):s.set(e,p(n)),t):s.get(e)},find:function(t,n,i){var r,o,a,s,l,u=0,c=e.length;for(null==i?i=1/0:i*=i,u=0;u<c;++u)(a=(r=t-(s=e[u]).x)*r+(o=n-s.y)*o)<i&&(l=s,i=a);return l},on:function(e,n){return arguments.length>1?(u.on(e,n),t):u.on(e)}}}function Hk(e){return e.index}function Xk(e,t){var n=e.get(t);if(!n)throw new Error("node not found: "+t);return n}const Jk={center:function(e,t){var n,i=1;function r(){var r,o,a=n.length,s=0,l=0;for(r=0;r<a;++r)s+=(o=n[r]).x,l+=o.y;for(s=(s/a-e)*i,l=(l/a-t)*i,r=0;r<a;++r)(o=n[r]).x-=s,o.y-=l}return null==e&&(e=0),null==t&&(t=0),r.initialize=function(e){n=e},r.x=function(t){return arguments.length?(e=+t,r):e},r.y=function(e){return arguments.length?(t=+e,r):t},r.strength=function(e){return arguments.length?(i=+e,r):i},r},collide:function(e){var t,n,i,r=1,o=1;function a(){for(var e,a,l,u,c,f,d,h=t.length,p=0;p<o;++p)for(a=wk(t,Sk,Mk).visitAfter(s),e=0;e<h;++e)l=t[e],f=n[l.index],d=f*f,u=l.x+l.vx,c=l.y+l.vy,a.visit(m);function m(e,t,n,o,a){var s=e.data,h=e.r,p=f+h;if(!s)return t>u+p||o<u-p||n>c+p||a<c-p;if(s.index>l.index){var m=u-s.x-s.vx,g=c-s.y-s.vy,y=m*m+g*g;y<p*p&&(0===m&&(y+=(m=Ak(i))*m),0===g&&(y+=(g=Ak(i))*g),y=(p-(y=Math.sqrt(y)))/y*r,l.vx+=(m*=y)*(p=(h*=h)/(d+h)),l.vy+=(g*=y)*p,s.vx-=m*(p=1-p),s.vy-=g*p)}}}function s(e){if(e.data)return e.r=n[e.data.index];for(var t=e.r=0;t<4;++t)e[t]&&e[t].r>e.r&&(e.r=e[t].r)}function l(){if(t){var i,r,o=t.length;for(n=new Array(o),i=0;i<o;++i)r=t[i],n[r.index]=+e(r,i,t)}}return"function"!==typeof e&&(e=$k(null==e?1:+e)),a.initialize=function(e,n){t=e,i=n,l()},a.iterations=function(e){return arguments.length?(o=+e,a):o},a.strength=function(e){return arguments.length?(r=+e,a):r},a.radius=function(t){return arguments.length?(e="function"===typeof t?t:$k(+t),l(),a):e},a},nbody:function(){var e,t,n,i,r,o=$k(-30),a=1,s=1/0,l=.81;function u(n){var r,o=e.length,a=wk(e,Bk,jk).visitAfter(f);for(i=n,r=0;r<o;++r)t=e[r],a.visit(d)}function c(){if(e){var t,n,i=e.length;for(r=new Array(i),t=0;t<i;++t)n=e[t],r[n.index]=+o(n,t,e)}}function f(e){var t,n,i,o,a,s=0,l=0;if(e.length){for(i=o=a=0;a<4;++a)(t=e[a])&&(n=Math.abs(t.value))&&(s+=t.value,l+=n,i+=n*t.x,o+=n*t.y);e.x=i/l,e.y=o/l}else{(t=e).x=t.data.x,t.y=t.data.y;do{s+=r[t.data.index]}while(t=t.next)}e.value=s}function d(e,o,u,c){if(!e.value)return!0;var f=e.x-t.x,d=e.y-t.y,h=c-o,p=f*f+d*d;if(h*h/l<p)return p<s&&(0===f&&(p+=(f=Ak(n))*f),0===d&&(p+=(d=Ak(n))*d),p<a&&(p=Math.sqrt(a*p)),t.vx+=f*e.value*i/p,t.vy+=d*e.value*i/p),!0;if(!(e.length||p>=s)){(e.data!==t||e.next)&&(0===f&&(p+=(f=Ak(n))*f),0===d&&(p+=(d=Ak(n))*d),p<a&&(p=Math.sqrt(a*p)));do{e.data!==t&&(h=r[e.data.index]*i/p,t.vx+=f*h,t.vy+=d*h)}while(e=e.next)}}return u.initialize=function(t,i){e=t,n=i,c()},u.strength=function(e){return arguments.length?(o="function"===typeof e?e:$k(+e),c(),u):o},u.distanceMin=function(e){return arguments.length?(a=e*e,u):Math.sqrt(a)},u.distanceMax=function(e){return arguments.length?(s=e*e,u):Math.sqrt(s)},u.theta=function(e){return arguments.length?(l=e*e,u):Math.sqrt(l)},u},link:function(e){var t,n,i,r,o,a,s=Hk,l=function(e){return 1/Math.min(r[e.source.index],r[e.target.index])},u=$k(30),c=1;function f(i){for(var r=0,s=e.length;r<c;++r)for(var l,u,f,d,h,p,m,g=0;g<s;++g)u=(l=e[g]).source,d=(f=l.target).x+f.vx-u.x-u.vx||Ak(a),h=f.y+f.vy-u.y-u.vy||Ak(a),d*=p=((p=Math.sqrt(d*d+h*h))-n[g])/p*i*t[g],h*=p,f.vx-=d*(m=o[g]),f.vy-=h*m,u.vx+=d*(m=1-m),u.vy+=h*m}function d(){if(i){var a,l,u=i.length,c=e.length,f=new Map(i.map(((e,t)=>[s(e,t,i),e])));for(a=0,r=new Array(u);a<c;++a)(l=e[a]).index=a,"object"!==typeof l.source&&(l.source=Xk(f,l.source)),"object"!==typeof l.target&&(l.target=Xk(f,l.target)),r[l.source.index]=(r[l.source.index]||0)+1,r[l.target.index]=(r[l.target.index]||0)+1;for(a=0,o=new Array(c);a<c;++a)l=e[a],o[a]=r[l.source.index]/(r[l.source.index]+r[l.target.index]);t=new Array(c),h(),n=new Array(c),p()}}function h(){if(i)for(var n=0,r=e.length;n<r;++n)t[n]=+l(e[n],n,e)}function p(){if(i)for(var t=0,r=e.length;t<r;++t)n[t]=+u(e[t],t,e)}return null==e&&(e=[]),f.initialize=function(e,t){i=e,a=t,d()},f.links=function(t){return arguments.length?(e=t,d(),f):e},f.id=function(e){return arguments.length?(s=e,f):s},f.iterations=function(e){return arguments.length?(c=+e,f):c},f.strength=function(e){return arguments.length?(l="function"===typeof e?e:$k(+e),h(),f):l},f.distance=function(e){return arguments.length?(u="function"===typeof e?e:$k(+e),p(),f):u},f},x:function(e){var t,n,i,r=$k(.1);function o(e){for(var r,o=0,a=t.length;o<a;++o)(r=t[o]).vx+=(i[o]-r.x)*n[o]*e}function a(){if(t){var o,a=t.length;for(n=new Array(a),i=new Array(a),o=0;o<a;++o)n[o]=isNaN(i[o]=+e(t[o],o,t))?0:+r(t[o],o,t)}}return"function"!==typeof e&&(e=$k(null==e?0:+e)),o.initialize=function(e){t=e,a()},o.strength=function(e){return arguments.length?(r="function"===typeof e?e:$k(+e),a(),o):r},o.x=function(t){return arguments.length?(e="function"===typeof t?t:$k(+t),a(),o):e},o},y:function(e){var t,n,i,r=$k(.1);function o(e){for(var r,o=0,a=t.length;o<a;++o)(r=t[o]).vy+=(i[o]-r.y)*n[o]*e}function a(){if(t){var o,a=t.length;for(n=new Array(a),i=new Array(a),o=0;o<a;++o)n[o]=isNaN(i[o]=+e(t[o],o,t))?0:+r(t[o],o,t)}}return"function"!==typeof e&&(e=$k(null==e?0:+e)),o.initialize=function(e){t=e,a()},o.strength=function(e){return arguments.length?(r="function"===typeof e?e:$k(+e),a(),o):r},o.y=function(t){return arguments.length?(e="function"===typeof t?t:$k(+t),a(),o):e},o}},Gk="forces",Vk=["alpha","alphaMin","alphaTarget","velocityDecay","forces"],Yk=["static","iterations"],Kk=["x","y","vx","vy"];function Zk(e){no.call(this,null,e)}function Qk(e,t,n,i){var r,o,a,s,l=(0,m.IX)(t.forces);for(r=0,o=Vk.length;r<o;++r)(a=Vk[r])!==Gk&&t.modified(a)&&e[a](t[a]);for(r=0,o=l.length;r<o;++r)s=Gk+r,(a=n||t.modified(Gk,r)?tE(l[r]):i&&eE(l[r],i)?e.force(s):null)&&e.force(s,a);for(o=e.numForces||0;r<o;++r)e.force(Gk+r,null);return e.numForces=l.length,e}function eE(e,t){var n,i;for(n in e)if((0,m.mf)(i=e[n])&&t.modified((0,m.Oj)(i)))return 1;return 0}function tE(e){var t,n;for(n in(0,m.nr)(Jk,e.force)||(0,m.vU)("Unrecognized force: "+e.force),t=Jk[e.force](),e)(0,m.mf)(t[n])&&nE(t[n],e[n],e);return t}function nE(e,t,n){e((0,m.mf)(t)?e=>t(e,n):t)}function iE(e){var t=0,n=e.children,i=n&&n.length;if(i)for(;--i>=0;)t+=n[i].value;else t=1;e.value=t}function rE(e,t){e instanceof Map?(e=[void 0,e],void 0===t&&(t=aE)):void 0===t&&(t=oE);for(var n,i,r,o,a,s=new uE(e),l=[s];n=l.pop();)if((r=t(n.data))&&(a=(r=Array.from(r)).length))for(n.children=r,o=a-1;o>=0;--o)l.push(i=r[o]=new uE(r[o])),i.parent=n,i.depth=n.depth+1;return s.eachBefore(lE)}function oE(e){return e.children}function aE(e){return Array.isArray(e)?e[1]:null}function sE(e){void 0!==e.data.value&&(e.value=e.data.value),e.data=e.data.data}function lE(e){var t=0;do{e.height=t}while((e=e.parent)&&e.height<++t)}function uE(e){this.data=e,this.depth=this.height=0,this.parent=null}function cE(e){return null==e?null:fE(e)}function fE(e){if("function"!==typeof e)throw new Error;return e}function dE(){return 0}function hE(e){return function(){return e}}Zk.Definition={type:"Force",metadata:{modifies:!0},params:[{name:"static",type:"boolean",default:!1},{name:"restart",type:"boolean",default:!1},{name:"iterations",type:"number",default:300},{name:"alpha",type:"number",default:1},{name:"alphaMin",type:"number",default:.001},{name:"alphaTarget",type:"number",default:0},{name:"velocityDecay",type:"number",default:.4},{name:"forces",type:"param",array:!0,params:[{key:{force:"center"},params:[{name:"x",type:"number",default:0},{name:"y",type:"number",default:0}]},{key:{force:"collide"},params:[{name:"radius",type:"number",expr:!0},{name:"strength",type:"number",default:.7},{name:"iterations",type:"number",default:1}]},{key:{force:"nbody"},params:[{name:"strength",type:"number",default:-30,expr:!0},{name:"theta",type:"number",default:.9},{name:"distanceMin",type:"number",default:1},{name:"distanceMax",type:"number"}]},{key:{force:"link"},params:[{name:"links",type:"data"},{name:"id",type:"field"},{name:"distance",type:"number",default:30,expr:!0},{name:"strength",type:"number",expr:!0},{name:"iterations",type:"number",default:1}]},{key:{force:"x"},params:[{name:"strength",type:"number",default:.1},{name:"x",type:"field"}]},{key:{force:"y"},params:[{name:"strength",type:"number",default:.1},{name:"y",type:"field"}]}]},{name:"as",type:"string",array:!0,modify:!1,default:Kk}]},(0,m.XW)(Zk,no,{transform(e,t){var n,i,r=this.value,o=t.changed(t.ADD_REM),a=e.modified(Vk),s=e.iterations||300;if(r?(o&&(t.modifies("index"),r.nodes(t.source)),(a||t.changed(t.MOD))&&Qk(r,e,0,t)):(this.value=r=function(e,t){const n=Wk(e),i=n.stop,r=n.restart;let o=!1;return n.stopped=()=>o,n.restart=()=>(o=!1,r()),n.stop=()=>(o=!0,i()),Qk(n,t,!0).on("end",(()=>o=!0))}(t.source,e),r.on("tick",(n=t.dataflow,i=this,()=>n.touch(i).run())),e.static||(o=!0,r.tick()),t.modifies("index")),a||o||e.modified(Yk)||t.changed()&&e.restart)if(r.alpha(Math.max(r.alpha(),e.alpha||1)).alphaDecay(1-Math.pow(r.alphaMin(),1/s)),e.static)for(r.stop();--s>=0;)r.tick();else if(r.stopped()&&r.restart(),!o)return t.StopPropagation;return this.finish(e,t)},finish(e,t){const n=t.dataflow;for(let s,l=this._argops,u=0,c=l.length;u<c;++u)if(s=l[u],s.name===Gk&&"link"===s.op._argval.force)for(var i,r=s.op._argops,o=0,a=r.length;o<a;++o)if("links"===r[o].name&&(i=r[o].op.source)){n.pulse(i,n.changeset().reflow());break}return t.reflow(e.modified()).modifies(Kk)}}),uE.prototype=rE.prototype={constructor:uE,count:function(){return this.eachAfter(iE)},each:function(e,t){let n=-1;for(const i of this)e.call(t,i,++n,this);return this},eachAfter:function(e,t){for(var n,i,r,o=this,a=[o],s=[],l=-1;o=a.pop();)if(s.push(o),n=o.children)for(i=0,r=n.length;i<r;++i)a.push(n[i]);for(;o=s.pop();)e.call(t,o,++l,this);return this},eachBefore:function(e,t){for(var n,i,r=this,o=[r],a=-1;r=o.pop();)if(e.call(t,r,++a,this),n=r.children)for(i=n.length-1;i>=0;--i)o.push(n[i]);return this},find:function(e,t){let n=-1;for(const i of this)if(e.call(t,i,++n,this))return i},sum:function(e){return this.eachAfter((function(t){for(var n=+e(t.data)||0,i=t.children,r=i&&i.length;--r>=0;)n+=i[r].value;t.value=n}))},sort:function(e){return this.eachBefore((function(t){t.children&&t.children.sort(e)}))},path:function(e){for(var t=this,n=function(e,t){if(e===t)return e;var n=e.ancestors(),i=t.ancestors(),r=null;e=n.pop(),t=i.pop();for(;e===t;)r=e,e=n.pop(),t=i.pop();return r}(t,e),i=[t];t!==n;)t=t.parent,i.push(t);for(var r=i.length;e!==n;)i.splice(r,0,e),e=e.parent;return i},ancestors:function(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t},descendants:function(){return Array.from(this)},leaves:function(){var e=[];return this.eachBefore((function(t){t.children||e.push(t)})),e},links:function(){var e=this,t=[];return e.each((function(n){n!==e&&t.push({source:n.parent,target:n})})),t},copy:function(){return rE(this).eachBefore(sE)},[Symbol.iterator]:function*(){var e,t,n,i,r=this,o=[r];do{for(e=o.reverse(),o=[];r=e.pop();)if(yield r,t=r.children)for(n=0,i=t.length;n<i;++n)o.push(t[n])}while(o.length)}};const pE=1664525,mE=1013904223,gE=4294967296;function yE(e,t){for(var n,i,r=0,o=(e=function(e,t){let n,i,r=e.length;for(;r;)i=t()*r--|0,n=e[r],e[r]=e[i],e[i]=n;return e}(Array.from(e),t)).length,a=[];r<o;)n=e[r],i&&xE(i,n)?++r:(i=wE(a=vE(a,n)),r=0);return i}function vE(e,t){var n,i;if(_E(t,e))return[t];for(n=0;n<e.length;++n)if(bE(t,e[n])&&_E(kE(e[n],t),e))return[e[n],t];for(n=0;n<e.length-1;++n)for(i=n+1;i<e.length;++i)if(bE(kE(e[n],e[i]),t)&&bE(kE(e[n],t),e[i])&&bE(kE(e[i],t),e[n])&&_E(EE(e[n],e[i],t),e))return[e[n],e[i],t];throw new Error}function bE(e,t){var n=e.r-t.r,i=t.x-e.x,r=t.y-e.y;return n<0||n*n<i*i+r*r}function xE(e,t){var n=e.r-t.r+1e-9*Math.max(e.r,t.r,1),i=t.x-e.x,r=t.y-e.y;return n>0&&n*n>i*i+r*r}function _E(e,t){for(var n=0;n<t.length;++n)if(!xE(e,t[n]))return!1;return!0}function wE(e){switch(e.length){case 1:return function(e){return{x:e.x,y:e.y,r:e.r}}(e[0]);case 2:return kE(e[0],e[1]);case 3:return EE(e[0],e[1],e[2])}}function kE(e,t){var n=e.x,i=e.y,r=e.r,o=t.x,a=t.y,s=t.r,l=o-n,u=a-i,c=s-r,f=Math.sqrt(l*l+u*u);return{x:(n+o+l/f*c)/2,y:(i+a+u/f*c)/2,r:(f+r+s)/2}}function EE(e,t,n){var i=e.x,r=e.y,o=e.r,a=t.x,s=t.y,l=t.r,u=n.x,c=n.y,f=n.r,d=i-a,h=i-u,p=r-s,m=r-c,g=l-o,y=f-o,v=i*i+r*r-o*o,b=v-a*a-s*s+l*l,x=v-u*u-c*c+f*f,_=h*p-d*m,w=(p*x-m*b)/(2*_)-i,k=(m*g-p*y)/_,E=(h*b-d*x)/(2*_)-r,D=(d*y-h*g)/_,$=k*k+D*D-1,A=2*(o+w*k+E*D),S=w*w+E*E-o*o,M=-(Math.abs($)>1e-6?(A+Math.sqrt(A*A-4*$*S))/(2*$):S/A);return{x:i+w+k*M,y:r+E+D*M,r:M}}function DE(e,t,n){var i,r,o,a,s=e.x-t.x,l=e.y-t.y,u=s*s+l*l;u?(r=t.r+n.r,r*=r,a=e.r+n.r,r>(a*=a)?(i=(u+a-r)/(2*u),o=Math.sqrt(Math.max(0,a/u-i*i)),n.x=e.x-i*s-o*l,n.y=e.y-i*l+o*s):(i=(u+r-a)/(2*u),o=Math.sqrt(Math.max(0,r/u-i*i)),n.x=t.x+i*s-o*l,n.y=t.y+i*l+o*s)):(n.x=t.x+n.r,n.y=t.y)}function $E(e,t){var n=e.r+t.r-1e-6,i=t.x-e.x,r=t.y-e.y;return n>0&&n*n>i*i+r*r}function AE(e){var t=e._,n=e.next._,i=t.r+n.r,r=(t.x*n.r+n.x*t.r)/i,o=(t.y*n.r+n.y*t.r)/i;return r*r+o*o}function SE(e){this._=e,this.next=null,this.previous=null}function ME(e,t){if(!(o=(e=function(e){return"object"===typeof e&&"length"in e?e:Array.from(e)}(e)).length))return 0;var n,i,r,o,a,s,l,u,c,f,d;if((n=e[0]).x=0,n.y=0,!(o>1))return n.r;if(i=e[1],n.x=-i.r,i.x=n.r,i.y=0,!(o>2))return n.r+i.r;DE(i,n,r=e[2]),n=new SE(n),i=new SE(i),r=new SE(r),n.next=r.previous=i,i.next=n.previous=r,r.next=i.previous=n;e:for(l=3;l<o;++l){DE(n._,i._,r=e[l]),r=new SE(r),u=i.next,c=n.previous,f=i._.r,d=n._.r;do{if(f<=d){if($E(u._,r._)){i=u,n.next=i,i.previous=n,--l;continue e}f+=u._.r,u=u.next}else{if($E(c._,r._)){(n=c).next=i,i.previous=n,--l;continue e}d+=c._.r,c=c.previous}}while(u!==c.next);for(r.previous=n,r.next=i,n.next=i.previous=i=r,a=AE(n);(r=r.next)!==i;)(s=AE(r))<a&&(n=r,a=s);i=n.next}for(n=[i._],r=i;(r=r.next)!==i;)n.push(r._);for(r=yE(n,t),l=0;l<o;++l)(n=e[l]).x-=r.x,n.y-=r.y;return r.r}function CE(e){return Math.sqrt(e.value)}function FE(e){return function(t){t.children||(t.r=Math.max(0,+e(t)||0))}}function OE(e,t,n){return function(i){if(r=i.children){var r,o,a,s=r.length,l=e(i)*t||0;if(l)for(o=0;o<s;++o)r[o].r+=l;if(a=ME(r,n),l)for(o=0;o<s;++o)r[o].r-=l;i.r=a+l}}}function TE(e){return function(t){var n=t.parent;t.r*=e,n&&(t.x=n.x+e*t.x,t.y=n.y+e*t.y)}}function NE(e){e.x0=Math.round(e.x0),e.y0=Math.round(e.y0),e.x1=Math.round(e.x1),e.y1=Math.round(e.y1)}function zE(e,t,n,i,r){for(var o,a=e.children,s=-1,l=a.length,u=e.value&&(i-t)/e.value;++s<l;)(o=a[s]).y0=n,o.y1=r,o.x0=t,o.x1=t+=o.value*u}var RE={depth:-1},PE={},LE={};function UE(e){return e.id}function BE(e){return e.parentId}function jE(){var e,t=UE,n=BE;function i(i){var r,o,a,s,l,u,c,f,d=Array.from(i),h=t,p=n,m=new Map;if(null!=e){const t=d.map(((t,n)=>function(e){e=`${e}`;let t=e.length;qE(e,t-1)&&!qE(e,t-2)&&(e=e.slice(0,-1));return"/"===e[0]?e:`/${e}`}(e(t,n,i)))),n=t.map(IE),r=new Set(t).add("");for(const e of n)r.has(e)||(r.add(e),t.push(e),n.push(IE(e)),d.push(LE));h=(e,n)=>t[n],p=(e,t)=>n[t]}for(a=0,r=d.length;a<r;++a)o=d[a],u=d[a]=new uE(o),null!=(c=h(o,a,i))&&(c+="")&&(f=u.id=c,m.set(f,m.has(f)?PE:u)),null!=(c=p(o,a,i))&&(c+="")&&(u.parent=c);for(a=0;a<r;++a)if(c=(u=d[a]).parent){if(!(l=m.get(c)))throw new Error("missing: "+c);if(l===PE)throw new Error("ambiguous: "+c);l.children?l.children.push(u):l.children=[u],u.parent=l}else{if(s)throw new Error("multiple roots");s=u}if(!s)throw new Error("no root");if(null!=e){for(;s.data===LE&&1===s.children.length;)s=s.children[0],--r;for(let e=d.length-1;e>=0&&(u=d[e]).data===LE;--e)u.data=null}if(s.parent=RE,s.eachBefore((function(e){e.depth=e.parent.depth+1,--r})).eachBefore(lE),s.parent=null,r>0)throw new Error("cycle");return s}return i.id=function(e){return arguments.length?(t=cE(e),i):t},i.parentId=function(e){return arguments.length?(n=cE(e),i):n},i.path=function(t){return arguments.length?(e=cE(t),i):e},i}function IE(e){let t=e.length;if(t<2)return"";for(;--t>1&&!qE(e,t););return e.slice(0,t)}function qE(e,t){if("/"===e[t]){let n=0;for(;t>0&&"\\"===e[--t];)++n;if(0===(1&n))return!0}return!1}function WE(e,t){return e.parent===t.parent?1:2}function HE(e){var t=e.children;return t?t[0]:e.t}function XE(e){var t=e.children;return t?t[t.length-1]:e.t}function JE(e,t,n){var i=n/(t.i-e.i);t.c-=i,t.s+=n,e.c+=i,t.z+=n,t.m+=n}function GE(e,t,n){return e.a.parent===t.parent?e.a:n}function VE(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}function YE(e,t){return e.parent===t.parent?1:2}function KE(e,t){return e+t.x}function ZE(e,t){return Math.max(e,t.y)}function QE(e,t,n,i,r){for(var o,a=e.children,s=-1,l=a.length,u=e.value&&(r-n)/e.value;++s<l;)(o=a[s]).x0=t,o.x1=i,o.y0=n,o.y1=n+=o.value*u}VE.prototype=Object.create(uE.prototype);var eD=(1+Math.sqrt(5))/2;function tD(e,t,n,i,r,o){for(var a,s,l,u,c,f,d,h,p,m,g,y=[],v=t.children,b=0,x=0,_=v.length,w=t.value;b<_;){l=r-n,u=o-i;do{c=v[x++].value}while(!c&&x<_);for(f=d=c,g=c*c*(m=Math.max(u/l,l/u)/(w*e)),p=Math.max(d/g,g/f);x<_;++x){if(c+=s=v[x].value,s<f&&(f=s),s>d&&(d=s),g=c*c*m,(h=Math.max(d/g,g/f))>p){c-=s;break}p=h}y.push(a={value:c,dice:l<u,children:v.slice(b,x)}),a.dice?zE(a,n,i,r,w?i+=u*c/w:o):QE(a,n,i,w?n+=l*c/w:r,o),w-=c,b=x}return y}const nD=function e(t){function n(e,n,i,r,o){tD(t,e,n,i,r,o)}return n.ratio=function(t){return e((t=+t)>1?t:1)},n}(eD),iD=function e(t){function n(e,n,i,r,o){if((a=e._squarify)&&a.ratio===t)for(var a,s,l,u,c,f=-1,d=a.length,h=e.value;++f<d;){for(l=(s=a[f]).children,u=s.value=0,c=l.length;u<c;++u)s.value+=l[u].value;s.dice?zE(s,n,i,r,h?i+=(o-i)*s.value/h:o):QE(s,n,i,h?n+=(r-n)*s.value/h:r,o),h-=s.value}else e._squarify=a=tD(t,e,n,i,r,o),a.ratio=t}return n.ratio=function(t){return e((t=+t)>1?t:1)},n}(eD);function rD(e,t,n){const i={};return e.each((e=>{const r=e.data;n(r)&&(i[t(r)]=e)})),e.lookup=i,e}function oD(e){no.call(this,null,e)}oD.Definition={type:"Nest",metadata:{treesource:!0,changes:!0},params:[{name:"keys",type:"field",array:!0},{name:"generate",type:"boolean"}]};const aD=e=>e.values;function sD(){const e=[],t={entries:e=>i(n(e,0),0),key:n=>(e.push(n),t)};function n(t,i){if(i>=e.length)return t;const r=t.length,o=e[i++],a={},s={};let l,u,c,f=-1;for(;++f<r;)l=o(u=t[f])+"",(c=a[l])?c.push(u):a[l]=[u];for(l in a)s[l]=n(a[l],i);return s}function i(t,n){if(++n>e.length)return t;const r=[];for(const e in t)r.push({key:e,values:i(t[e],n)});return r}return t}function lD(e){no.call(this,null,e)}(0,m.XW)(oD,no,{transform(e,t){t.source||(0,m.vU)("Nest transform requires an upstream data source.");var n=e.generate,i=e.modified(),r=t.clone(),o=this.value;return(!o||i||t.changed())&&(o&&o.each((e=>{e.children&&wr(e.data)&&r.rem.push(e.data)})),this.value=o=rE({values:(0,m.IX)(e.keys).reduce(((e,t)=>(e.key(t),e)),sD()).entries(r.source)},aD),n&&o.each((e=>{e.children&&(e=Dr(e.data),r.add.push(e),r.source.push(e))})),rD(o,kr,kr)),r.source.root=o,r}});const uD=(e,t)=>e.parent===t.parent?1:2;(0,m.XW)(lD,no,{transform(e,t){t.source&&t.source.root||(0,m.vU)(this.constructor.name+" transform requires a backing tree data source.");const n=this.layout(e.method),i=this.fields,r=t.source.root,o=e.as||i;e.field?r.sum(e.field):r.count(),e.sort&&r.sort(Mr(e.sort,(e=>e.data))),function(e,t,n){for(let i,r=0,o=t.length;r<o;++r)i=t[r],i in n&&e[i](n[i])}(n,this.params,e),n.separation&&n.separation(!1!==e.separation?uD:m.kX);try{this.value=n(r)}catch(a){(0,m.vU)(a)}return r.each((e=>function(e,t,n){const i=e.data,r=t.length-1;for(let o=0;o<r;++o)i[n[o]]=e[t[o]];i[n[r]]=e.children?e.children.length:0}(e,i,o))),t.reflow(e.modified()).modifies(o).modifies("leaf")}});const cD=["x","y","r","depth","children"];function fD(e){lD.call(this,e)}fD.Definition={type:"Pack",metadata:{tree:!0,modifies:!0},params:[{name:"field",type:"field"},{name:"sort",type:"compare"},{name:"padding",type:"number",default:0},{name:"radius",type:"field",default:null},{name:"size",type:"number",array:!0,length:2},{name:"as",type:"string",array:!0,length:cD.length,default:cD}]},(0,m.XW)(fD,lD,{layout:function(){var e=null,t=1,n=1,i=dE;function r(r){const o=function(){let e=1;return()=>(e=(pE*e+mE)%gE)/gE}();return r.x=t/2,r.y=n/2,e?r.eachBefore(FE(e)).eachAfter(OE(i,.5,o)).eachBefore(TE(1)):r.eachBefore(FE(CE)).eachAfter(OE(dE,1,o)).eachAfter(OE(i,r.r/Math.min(t,n),o)).eachBefore(TE(Math.min(t,n)/(2*r.r))),r}return r.radius=function(t){return arguments.length?(e=cE(t),r):e},r.size=function(e){return arguments.length?(t=+e[0],n=+e[1],r):[t,n]},r.padding=function(e){return arguments.length?(i="function"===typeof e?e:hE(+e),r):i},r},params:["radius","size","padding"],fields:cD});const dD=["x0","y0","x1","y1","depth","children"];function hD(e){lD.call(this,e)}function pD(e){no.call(this,null,e)}hD.Definition={type:"Partition",metadata:{tree:!0,modifies:!0},params:[{name:"field",type:"field"},{name:"sort",type:"compare"},{name:"padding",type:"number",default:0},{name:"round",type:"boolean",default:!1},{name:"size",type:"number",array:!0,length:2},{name:"as",type:"string",array:!0,length:dD.length,default:dD}]},(0,m.XW)(hD,lD,{layout:function(){var e=1,t=1,n=0,i=!1;function r(r){var o=r.height+1;return r.x0=r.y0=n,r.x1=e,r.y1=t/o,r.eachBefore(function(e,t){return function(i){i.children&&zE(i,i.x0,e*(i.depth+1)/t,i.x1,e*(i.depth+2)/t);var r=i.x0,o=i.y0,a=i.x1-n,s=i.y1-n;a<r&&(r=a=(r+a)/2),s<o&&(o=s=(o+s)/2),i.x0=r,i.y0=o,i.x1=a,i.y1=s}}(t,o)),i&&r.eachBefore(NE),r}return r.round=function(e){return arguments.length?(i=!!e,r):i},r.size=function(n){return arguments.length?(e=+n[0],t=+n[1],r):[e,t]},r.padding=function(e){return arguments.length?(n=+e,r):n},r},params:["size","round","padding"],fields:dD}),pD.Definition={type:"Stratify",metadata:{treesource:!0},params:[{name:"key",type:"field",required:!0},{name:"parentKey",type:"field",required:!0}]},(0,m.XW)(pD,no,{transform(e,t){t.source||(0,m.vU)("Stratify transform requires an upstream data source.");let n=this.value;const i=e.modified(),r=t.fork(t.ALL).materialize(t.SOURCE),o=!n||i||t.changed(t.ADD_REM)||t.modified(e.key.fields)||t.modified(e.parentKey.fields);return r.source=r.source.slice(),o&&(n=r.source.length?rD(jE().id(e.key).parentId(e.parentKey)(r.source),e.key,m.yb):rD(jE()([{}]),e.key,e.key)),r.source.root=this.value=n,r}});const mD={tidy:function(){var e=WE,t=1,n=1,i=null;function r(r){var l=function(e){for(var t,n,i,r,o,a=new VE(e,0),s=[a];t=s.pop();)if(i=t._.children)for(t.children=new Array(o=i.length),r=o-1;r>=0;--r)s.push(n=t.children[r]=new VE(i[r],r)),n.parent=t;return(a.parent=new VE(null,0)).children=[a],a}(r);if(l.eachAfter(o),l.parent.m=-l.z,l.eachBefore(a),i)r.eachBefore(s);else{var u=r,c=r,f=r;r.eachBefore((function(e){e.x<u.x&&(u=e),e.x>c.x&&(c=e),e.depth>f.depth&&(f=e)}));var d=u===c?1:e(u,c)/2,h=d-u.x,p=t/(c.x+d+h),m=n/(f.depth||1);r.eachBefore((function(e){e.x=(e.x+h)*p,e.y=e.depth*m}))}return r}function o(t){var n=t.children,i=t.parent.children,r=t.i?i[t.i-1]:null;if(n){!function(e){for(var t,n=0,i=0,r=e.children,o=r.length;--o>=0;)(t=r[o]).z+=n,t.m+=n,n+=t.s+(i+=t.c)}(t);var o=(n[0].z+n[n.length-1].z)/2;r?(t.z=r.z+e(t._,r._),t.m=t.z-o):t.z=o}else r&&(t.z=r.z+e(t._,r._));t.parent.A=function(t,n,i){if(n){for(var r,o=t,a=t,s=n,l=o.parent.children[0],u=o.m,c=a.m,f=s.m,d=l.m;s=XE(s),o=HE(o),s&&o;)l=HE(l),(a=XE(a)).a=t,(r=s.z+f-o.z-u+e(s._,o._))>0&&(JE(GE(s,t,i),t,r),u+=r,c+=r),f+=s.m,u+=o.m,d+=l.m,c+=a.m;s&&!XE(a)&&(a.t=s,a.m+=f-c),o&&!HE(l)&&(l.t=o,l.m+=u-d,i=t)}return i}(t,r,t.parent.A||i[0])}function a(e){e._.x=e.z+e.parent.m,e.m+=e.parent.m}function s(e){e.x*=t,e.y=e.depth*n}return r.separation=function(t){return arguments.length?(e=t,r):e},r.size=function(e){return arguments.length?(i=!1,t=+e[0],n=+e[1],r):i?null:[t,n]},r.nodeSize=function(e){return arguments.length?(i=!0,t=+e[0],n=+e[1],r):i?[t,n]:null},r},cluster:function(){var e=YE,t=1,n=1,i=!1;function r(r){var o,a=0;r.eachAfter((function(t){var n=t.children;n?(t.x=function(e){return e.reduce(KE,0)/e.length}(n),t.y=function(e){return 1+e.reduce(ZE,0)}(n)):(t.x=o?a+=e(t,o):0,t.y=0,o=t)}));var s=function(e){for(var t;t=e.children;)e=t[0];return e}(r),l=function(e){for(var t;t=e.children;)e=t[t.length-1];return e}(r),u=s.x-e(s,l)/2,c=l.x+e(l,s)/2;return r.eachAfter(i?function(e){e.x=(e.x-r.x)*t,e.y=(r.y-e.y)*n}:function(e){e.x=(e.x-u)/(c-u)*t,e.y=(1-(r.y?e.y/r.y:1))*n})}return r.separation=function(t){return arguments.length?(e=t,r):e},r.size=function(e){return arguments.length?(i=!1,t=+e[0],n=+e[1],r):i?null:[t,n]},r.nodeSize=function(e){return arguments.length?(i=!0,t=+e[0],n=+e[1],r):i?[t,n]:null},r}},gD=["x","y","depth","children"];function yD(e){lD.call(this,e)}function vD(e){no.call(this,[],e)}yD.Definition={type:"Tree",metadata:{tree:!0,modifies:!0},params:[{name:"field",type:"field"},{name:"sort",type:"compare"},{name:"method",type:"enum",default:"tidy",values:["tidy","cluster"]},{name:"size",type:"number",array:!0,length:2},{name:"nodeSize",type:"number",array:!0,length:2},{name:"separation",type:"boolean",default:!0},{name:"as",type:"string",array:!0,length:gD.length,default:gD}]},(0,m.XW)(yD,lD,{layout(e){const t=e||"tidy";if((0,m.nr)(mD,t))return mD[t]();(0,m.vU)("Unrecognized Tree layout method: "+t)},params:["size","nodeSize"],fields:gD}),vD.Definition={type:"TreeLinks",metadata:{tree:!0,generates:!0,changes:!0},params:[]},(0,m.XW)(vD,no,{transform(e,t){const n=this.value,i=t.source&&t.source.root,r=t.fork(t.NO_SOURCE),o={};return i||(0,m.vU)("TreeLinks transform requires a tree data source."),t.changed(t.ADD_REM)?(r.rem=n,t.visit(t.SOURCE,(e=>o[kr(e)]=1)),i.each((e=>{const t=e.data,n=e.parent&&e.parent.data;n&&o[kr(t)]&&o[kr(n)]&&r.add.push(Dr({source:n,target:t}))})),this.value=r.add):t.changed(t.MOD)&&(t.visit(t.MOD,(e=>o[kr(e)]=1)),n.forEach((e=>{(o[kr(e.source)]||o[kr(e.target)])&&r.mod.push(e)}))),r}});const bD={binary:function(e,t,n,i,r){var o,a,s=e.children,l=s.length,u=new Array(l+1);for(u[0]=a=o=0;o<l;++o)u[o+1]=a+=s[o].value;!function e(t,n,i,r,o,a,l){if(t>=n-1){var c=s[t];return c.x0=r,c.y0=o,c.x1=a,void(c.y1=l)}var f=u[t],d=i/2+f,h=t+1,p=n-1;for(;h<p;){var m=h+p>>>1;u[m]<d?h=m+1:p=m}d-u[h-1]<u[h]-d&&t+1<h&&--h;var g=u[h]-f,y=i-g;if(a-r>l-o){var v=i?(r*y+a*g)/i:a;e(t,h,g,r,o,v,l),e(h,n,y,v,o,a,l)}else{var b=i?(o*y+l*g)/i:l;e(t,h,g,r,o,a,b),e(h,n,y,r,b,a,l)}}(0,l,e.value,t,n,i,r)},dice:zE,slice:QE,slicedice:function(e,t,n,i,r){(1&e.depth?QE:zE)(e,t,n,i,r)},squarify:nD,resquarify:iD},xD=["x0","y0","x1","y1","depth","children"];function _D(e){lD.call(this,e)}_D.Definition={type:"Treemap",metadata:{tree:!0,modifies:!0},params:[{name:"field",type:"field"},{name:"sort",type:"compare"},{name:"method",type:"enum",default:"squarify",values:["squarify","resquarify","binary","dice","slice","slicedice"]},{name:"padding",type:"number",default:0},{name:"paddingInner",type:"number",default:0},{name:"paddingOuter",type:"number",default:0},{name:"paddingTop",type:"number",default:0},{name:"paddingRight",type:"number",default:0},{name:"paddingBottom",type:"number",default:0},{name:"paddingLeft",type:"number",default:0},{name:"ratio",type:"number",default:1.618033988749895},{name:"round",type:"boolean",default:!1},{name:"size",type:"number",array:!0,length:2},{name:"as",type:"string",array:!0,length:xD.length,default:xD}]},(0,m.XW)(_D,lD,{layout(){const e=function(){var e=nD,t=!1,n=1,i=1,r=[0],o=dE,a=dE,s=dE,l=dE,u=dE;function c(e){return e.x0=e.y0=0,e.x1=n,e.y1=i,e.eachBefore(f),r=[0],t&&e.eachBefore(NE),e}function f(t){var n=r[t.depth],i=t.x0+n,c=t.y0+n,f=t.x1-n,d=t.y1-n;f<i&&(i=f=(i+f)/2),d<c&&(c=d=(c+d)/2),t.x0=i,t.y0=c,t.x1=f,t.y1=d,t.children&&(n=r[t.depth+1]=o(t)/2,i+=u(t)-n,c+=a(t)-n,(f-=s(t)-n)<i&&(i=f=(i+f)/2),(d-=l(t)-n)<c&&(c=d=(c+d)/2),e(t,i,c,f,d))}return c.round=function(e){return arguments.length?(t=!!e,c):t},c.size=function(e){return arguments.length?(n=+e[0],i=+e[1],c):[n,i]},c.tile=function(t){return arguments.length?(e=fE(t),c):e},c.padding=function(e){return arguments.length?c.paddingInner(e).paddingOuter(e):c.paddingInner()},c.paddingInner=function(e){return arguments.length?(o="function"===typeof e?e:hE(+e),c):o},c.paddingOuter=function(e){return arguments.length?c.paddingTop(e).paddingRight(e).paddingBottom(e).paddingLeft(e):c.paddingTop()},c.paddingTop=function(e){return arguments.length?(a="function"===typeof e?e:hE(+e),c):a},c.paddingRight=function(e){return arguments.length?(s="function"===typeof e?e:hE(+e),c):s},c.paddingBottom=function(e){return arguments.length?(l="function"===typeof e?e:hE(+e),c):l},c.paddingLeft=function(e){return arguments.length?(u="function"===typeof e?e:hE(+e),c):u},c}();return e.ratio=t=>{const n=e.tile();n.ratio&&e.tile(n.ratio(t))},e.method=t=>{(0,m.nr)(bD,t)?e.tile(bD[t]):(0,m.vU)("Unrecognized Treemap layout method: "+t)},e},params:["method","ratio","size","round","padding","paddingInner","paddingOuter","paddingTop","paddingRight","paddingBottom","paddingLeft"],fields:xD});const wD=4278190080;function kD(e,t,n){return new Uint32Array(e.getImageData(0,0,t,n).data.buffer)}function ED(e,t,n){if(!t.length)return;const i=t[0].mark.marktype;"group"===i?t.forEach((t=>{t.items.forEach((t=>ED(e,t.items,n)))})):Mm[i].draw(e,{items:n?t.map(DD):t})}function DD(e){const t=Ar(e,{});return t.stroke&&0!==t.strokeOpacity||t.fill&&0!==t.fillOpacity?{...t,strokeOpacity:1,stroke:"#000",fillOpacity:0}:t}const $D=5,AD=31,SD=32,MD=new Uint32Array(SD+1),CD=new Uint32Array(SD+1);CD[0]=0,MD[0]=~CD[0];for(let PN=1;PN<=SD;++PN)CD[PN]=CD[PN-1]<<1|1,MD[PN]=~CD[PN];function FD(e,t,n){const i=Math.max(1,Math.sqrt(e*t/1e6)),r=~~((e+2*n+i)/i),o=~~((t+2*n+i)/i),a=e=>~~((e+n)/i);return a.invert=e=>e*i-n,a.bitmap=()=>function(e,t){const n=new Uint32Array(~~((e*t+SD)/SD));function i(e,t){n[e]|=t}function r(e,t){n[e]&=t}return{array:n,get:(t,i)=>{const r=i*e+t;return n[r>>>$D]&1<<(r&AD)},set:(t,n)=>{const r=n*e+t;i(r>>>$D,1<<(r&AD))},clear:(t,n)=>{const i=n*e+t;r(i>>>$D,~(1<<(i&AD)))},getRange:(t,i,r,o)=>{let a,s,l,u,c=o;for(;c>=i;--c)if(a=c*e+t,s=c*e+r,l=a>>>$D,u=s>>>$D,l===u){if(n[l]&MD[a&AD]&CD[1+(s&AD)])return!0}else{if(n[l]&MD[a&AD])return!0;if(n[u]&CD[1+(s&AD)])return!0;for(let e=l+1;e<u;++e)if(n[e])return!0}return!1},setRange:(t,n,r,o)=>{let a,s,l,u,c;for(;n<=o;++n)if(a=n*e+t,s=n*e+r,l=a>>>$D,u=s>>>$D,l===u)i(l,MD[a&AD]&CD[1+(s&AD)]);else for(i(l,MD[a&AD]),i(u,CD[1+(s&AD)]),c=l+1;c<u;++c)i(c,4294967295)},clearRange:(t,n,i,o)=>{let a,s,l,u,c;for(;n<=o;++n)if(a=n*e+t,s=n*e+i,l=a>>>$D,u=s>>>$D,l===u)r(l,CD[a&AD]|MD[1+(s&AD)]);else for(r(l,CD[a&AD]),r(u,MD[1+(s&AD)]),c=l+1;c<u;++c)r(c,0)},outOfBounds:(n,i,r,o)=>n<0||i<0||o>=t||r>=e}}(r,o),a.ratio=i,a.padding=n,a.width=e,a.height=t,a}function OD(e,t,n,i,r,o){let a=n/2;return e-a<0||e+a>r||t-(a=i/2)<0||t+a>o}function TD(e,t,n,i,r,o,a,s){const l=r*o/(2*i),u=e(t-l),c=e(t+l),f=e(n-(o/=2)),d=e(n+o);return a.outOfBounds(u,f,c,d)||a.getRange(u,f,c,d)||s&&s.getRange(u,f,c,d)}const ND=[-1,-1,1,1],zD=[-1,1,-1,1];const RD=["right","center","left"],PD=["bottom","middle","top"];function LD(e,t,n,i,r,o,a,s,l,u,c,f){return!(r.outOfBounds(e,n,t,i)||(f&&o||r).getRange(e,n,t,i))}const UD={"top-left":0,top:1,"top-right":2,left:4,middle:5,right:6,"bottom-left":8,bottom:9,"bottom-right":10},BD={naive:function(e,t,n,i){const r=e.width,o=e.height;return function(e){const t=e.datum.datum.items[i].items,n=t.length,a=e.datum.fontSize,s=um.width(e.datum,e.datum.text);let l,u,c,f,d,h,p,m=0;for(let i=0;i<n;++i)l=t[i].x,c=t[i].y,u=void 0===t[i].x2?l:t[i].x2,f=void 0===t[i].y2?c:t[i].y2,d=(l+u)/2,h=(c+f)/2,p=Math.abs(u-l+f-c),p>=m&&(m=p,e.x=d,e.y=h);return d=s/2,h=a/2,l=e.x-d,u=e.x+d,c=e.y-h,f=e.y+h,e.align="center",l<0&&u<=r?e.align="left":0<=l&&r<u&&(e.align="right"),e.baseline="middle",c<0&&f<=o?e.baseline="top":0<=c&&o<f&&(e.baseline="bottom"),!0}},"reduced-search":function(e,t,n,i){const r=e.width,o=e.height,a=t[0],s=t[1];function l(t,n,i,l,u){const c=e.invert(t),f=e.invert(n);let d,h=i,p=o;if(!OD(c,f,l,u,r,o)&&!TD(e,c,f,u,l,h,a,s)&&!TD(e,c,f,u,l,u,a,null)){for(;p-h>=1;)d=(h+p)/2,TD(e,c,f,u,l,d,a,s)?p=d:h=d;if(h>i)return[c,f,h,!0]}}return function(t){const s=t.datum.datum.items[i].items,u=s.length,c=t.datum.fontSize,f=um.width(t.datum,t.datum.text);let d,h,p,m,g,y,v,b,x,_,w,k,E,D,$,A,S,M=n?c:0,C=!1,F=!1,O=0;for(let i=0;i<u;++i){for(d=s[i].x,p=s[i].y,h=void 0===s[i].x2?d:s[i].x2,m=void 0===s[i].y2?p:s[i].y2,d>h&&(S=d,d=h,h=S),p>m&&(S=p,p=m,m=S),x=e(d),w=e(h),_=~~((x+w)/2),k=e(p),D=e(m),E=~~((k+D)/2),v=_;v>=x;--v)for(b=E;b>=k;--b)A=l(v,b,M,f,c),A&&([t.x,t.y,M,C]=A);for(v=_;v<=w;++v)for(b=E;b<=D;++b)A=l(v,b,M,f,c),A&&([t.x,t.y,M,C]=A);C||n||($=Math.abs(h-d+m-p),g=(d+h)/2,y=(p+m)/2,$>=O&&!OD(g,y,f,c,r,o)&&!TD(e,g,y,c,f,c,a,null)&&(O=$,t.x=g,t.y=y,F=!0))}return!(!C&&!F)&&(g=f/2,y=c/2,a.setRange(e(t.x-g),e(t.y-y),e(t.x+g),e(t.y+y)),t.align="center",t.baseline="middle",!0)}},floodfill:function(e,t,n,i){const r=e.width,o=e.height,a=t[0],s=t[1],l=e.bitmap();return function(t){const u=t.datum.datum.items[i].items,c=u.length,f=t.datum.fontSize,d=um.width(t.datum,t.datum.text),h=[];let p,m,g,y,v,b,x,_,w,k,E,D,$=n?f:0,A=!1,S=!1,M=0;for(let i=0;i<c;++i){for(p=u[i].x,g=u[i].y,m=void 0===u[i].x2?p:u[i].x2,y=void 0===u[i].y2?g:u[i].y2,h.push([e((p+m)/2),e((g+y)/2)]);h.length;)if([x,_]=h.pop(),!(a.get(x,_)||s.get(x,_)||l.get(x,_))){l.set(x,_);for(let e=0;e<4;++e)v=x+ND[e],b=_+zD[e],l.outOfBounds(v,b,v,b)||h.push([v,b]);if(v=e.invert(x),b=e.invert(_),w=$,k=o,!OD(v,b,d,f,r,o)&&!TD(e,v,b,f,d,w,a,s)&&!TD(e,v,b,f,d,f,a,null)){for(;k-w>=1;)E=(w+k)/2,TD(e,v,b,f,d,E,a,s)?k=E:w=E;w>$&&(t.x=v,t.y=b,$=w,A=!0)}}A||n||(D=Math.abs(m-p+y-g),v=(p+m)/2,b=(g+y)/2,D>=M&&!OD(v,b,d,f,r,o)&&!TD(e,v,b,f,d,f,a,null)&&(M=D,t.x=v,t.y=b,S=!0))}return!(!A&&!S)&&(v=d/2,b=f/2,a.setRange(e(t.x-v),e(t.y-b),e(t.x+v),e(t.y+b)),t.align="center",t.baseline="middle",!0)}}};function jD(e,t,n,i,r,o,a,s,l,u,c){if(!e.length)return e;const f=Math.max(i.length,r.length),d=function(e,t){const n=new Float64Array(t),i=e.length;for(let r=0;r<i;++r)n[r]=e[r]||0;for(let r=i;r<t;++r)n[r]=n[i-1];return n}(i,f),h=function(e,t){const n=new Int8Array(t),i=e.length;for(let r=0;r<i;++r)n[r]|=UD[e[r]];for(let r=i;r<t;++r)n[r]=n[i-1];return n}(r,f),p=(x=e[0].datum)&&x.mark&&x.mark.marktype,m="group"===p&&e[0].datum.items[l].marktype,g="area"===m,y=function(e,t,n,i){const r=e=>[e.x,e.x,e.x,e.y,e.y,e.y];return e?"line"===e||"area"===e?e=>r(e.datum):"line"===t?e=>{const t=e.datum.items[i].items;return r(t.length?t["start"===n?0:t.length-1]:{x:NaN,y:NaN})}:e=>{const t=e.datum.bounds;return[t.x1,(t.x1+t.x2)/2,t.x2,t.y1,(t.y1+t.y2)/2,t.y2]}:r}(p,m,s,l),v=null===u||u===1/0,b=g&&"naive"===c;var x;let _=-1,w=-1;const k=e.map((e=>{const t=v?um.width(e,e.text):void 0;return _=Math.max(_,t),w=Math.max(w,e.fontSize),{datum:e,opacity:0,x:void 0,y:void 0,align:void 0,baseline:void 0,boundary:y(e),textWidth:t}}));u=null===u||u===1/0?Math.max(_,w)+Math.max(...i):u;const E=FD(t[0],t[1],u);let D;if(!b){n&&k.sort(((e,t)=>n(e.datum,t.datum)));let t=!1;for(let e=0;e<h.length&&!t;++e)t=5===h[e]||d[e]<0;const i=(p&&a||g)&&e.map((e=>e.datum));D=o.length||i?function(e,t,n,i,r){const o=e.width,a=e.height,s=i||r,l=tu(o,a).getContext("2d"),u=tu(o,a).getContext("2d"),c=s&&tu(o,a).getContext("2d");n.forEach((e=>ED(l,e,!1))),ED(u,t,!1),s&&ED(c,t,!0);const f=kD(l,o,a),d=kD(u,o,a),h=s&&kD(c,o,a),p=e.bitmap(),m=s&&e.bitmap();let g,y,v,b,x,_,w,k;for(y=0;y<a;++y)for(g=0;g<o;++g)x=y*o+g,_=f[x]&wD,k=d[x]&wD,w=s&&h[x]&wD,(_||w||k)&&(v=e(g),b=e(y),r||!_&&!k||p.set(v,b),s&&(_||w)&&m.set(v,b));return[p,m]}(E,i||[],o,t,g):function(e,t){const n=e.bitmap();return(t||[]).forEach((t=>n.set(e(t.boundary[0]),e(t.boundary[3])))),[n,void 0]}(E,a&&k)}const $=g?BD[c](E,D,a,l):function(e,t,n,i){const r=e.width,o=e.height,a=t[0],s=t[1],l=i.length;return function(t){const u=t.boundary,c=t.datum.fontSize;if(u[2]<0||u[5]<0||u[0]>r||u[3]>o)return!1;let f,d,h,p,m,g,y,v,b,x,_,w,k,E,D,$=t.textWidth??0;for(let r=0;r<l;++r){if(f=(3&n[r])-1,d=(n[r]>>>2&3)-1,h=0===f&&0===d||i[r]<0,p=f&&d?Math.SQRT1_2:1,m=i[r]<0?-1:1,g=u[1+f]+i[r]*f*p,_=u[4+d]+m*c*d/2+i[r]*d*p,v=_-c/2,b=_+c/2,w=e(g),E=e(v),D=e(b),!$){if(!LD(w,w,E,D,a,s,0,0,0,0,0,h))continue;$=um.width(t.datum,t.datum.text)}if(x=g+m*$*f/2,g=x-$/2,y=x+$/2,w=e(g),k=e(y),LD(w,k,E,D,a,s,0,0,0,0,0,h))return t.x=f?f*m<0?y:g:x,t.y=d?d*m<0?b:v:_,t.align=RD[f*m+1],t.baseline=PD[d*m+1],a.setRange(w,E,k,D),!0}return!1}}(E,D,h,d);return k.forEach((e=>e.opacity=+$(e))),k}const ID=["x","y","opacity","align","baseline"],qD=["top-left","left","bottom-left","top","bottom","top-right","right","bottom-right"];function WD(e){no.call(this,null,e)}function HD(e,t){var n,i,r,o,a,s,l=[],u=function(e){return e(o)};if(null==t)l.push(e);else for(n={},i=0,r=e.length;i<r;++i)o=e[i],(s=n[a=t.map(u)])||(n[a]=s=[],s.dims=a,l.push(s)),s.push(o);return l}function XD(e){no.call(this,null,e)}WD.Definition={type:"Label",metadata:{modifies:!0},params:[{name:"size",type:"number",array:!0,length:2,required:!0},{name:"sort",type:"compare"},{name:"anchor",type:"string",array:!0,default:qD},{name:"offset",type:"number",array:!0,default:[1]},{name:"padding",type:"number",default:0,null:!0},{name:"lineAnchor",type:"string",values:["start","end"],default:"end"},{name:"markIndex",type:"number",default:0},{name:"avoidBaseMark",type:"boolean",default:!0},{name:"avoidMarks",type:"data",array:!0},{name:"method",type:"string",default:"naive"},{name:"as",type:"string",array:!0,length:ID.length,default:ID}]},(0,m.XW)(WD,no,{transform(e,t){const n=e.modified();if(!(n||t.changed(t.ADD_REM)||function(n){const i=e[n];return(0,m.mf)(i)&&t.modified(i.fields)}("sort")))return;e.size&&2===e.size.length||(0,m.vU)("Size parameter should be specified as a [width, height] array.");const i=e.as||ID;return jD(t.materialize(t.SOURCE).source||[],e.size,e.sort,(0,m.IX)(null==e.offset?1:e.offset),(0,m.IX)(e.anchor||qD),e.avoidMarks||[],!1!==e.avoidBaseMark,e.lineAnchor||"end",e.markIndex||0,void 0===e.padding?0:e.padding,e.method||"naive").forEach((e=>{const t=e.datum;t[i[0]]=e.x,t[i[1]]=e.y,t[i[2]]=e.opacity,t[i[3]]=e.align,t[i[4]]=e.baseline})),t.reflow(n).modifies(i)}}),XD.Definition={type:"Loess",metadata:{generates:!0},params:[{name:"x",type:"field",required:!0},{name:"y",type:"field",required:!0},{name:"groupby",type:"field",array:!0},{name:"bandwidth",type:"number",default:.3},{name:"as",type:"string",array:!0}]},(0,m.XW)(XD,no,{transform(e,t){const n=t.fork(t.NO_SOURCE|t.NO_FIELDS);if(!this.value||t.changed()||e.modified()){const i=HD(t.materialize(t.SOURCE).source,e.groupby),r=(e.groupby||[]).map(m.el),o=r.length,a=e.as||[(0,m.el)(e.x),(0,m.el)(e.y)],s=[];i.forEach((t=>{la(t,e.x,e.y,e.bandwidth||.3).forEach((e=>{const n={};for(let i=0;i<o;++i)n[r[i]]=t.dims[i];n[a[0]]=e[0],n[a[1]]=e[1],s.push(Dr(n))}))})),this.value&&(n.rem=this.value),this.value=n.add=n.source=s}return n}});const JD={constant:Go,linear:Qo,log:ea,exp:ta,pow:na,quad:ia,poly:ra};function GD(e){no.call(this,null,e)}GD.Definition={type:"Regression",metadata:{generates:!0},params:[{name:"x",type:"field",required:!0},{name:"y",type:"field",required:!0},{name:"groupby",type:"field",array:!0},{name:"method",type:"string",default:"linear",values:Object.keys(JD)},{name:"order",type:"number",default:3},{name:"extent",type:"number",array:!0,length:2},{name:"params",type:"boolean",default:!1},{name:"as",type:"string",array:!0}]},(0,m.XW)(GD,no,{transform(e,t){const n=t.fork(t.NO_SOURCE|t.NO_FIELDS);if(!this.value||t.changed()||e.modified()){const i=HD(t.materialize(t.SOURCE).source,e.groupby),r=(e.groupby||[]).map(m.el),o=e.method||"linear",a=null==e.order?3:e.order,s=((e,t)=>"poly"===e?t:"quad"===e?2:1)(o,a),l=e.as||[(0,m.el)(e.x),(0,m.el)(e.y)],u=JD[o],c=[];let f=e.extent;(0,m.nr)(JD,o)||(0,m.vU)("Invalid regression method: "+o),null!=f&&"log"===o&&f[0]<=0&&(t.dataflow.warn("Ignoring extent with values <= 0 for log regression."),f=null),i.forEach((n=>{if(n.length<=s)return void t.dataflow.warn("Skipping regression with more parameters than data points.");const i=u(n,e.x,e.y,a);if(e.params)return void c.push(Dr({keys:n.dims,coef:i.coef,rSquared:i.rSquared}));const d=f||(0,m.We)(n,e.x),h=e=>{const t={};for(let i=0;i<r.length;++i)t[r[i]]=n.dims[i];t[l[0]]=e[0],t[l[1]]=e[1],c.push(Dr(t))};"linear"===o||"constant"===o?d.forEach((e=>h([e,i.predict(e)]))):da(i.predict,d,25,200).forEach(h)})),this.value&&(n.rem=this.value),this.value=n.add=n.source=c}return n}});const VD=134217729,YD=33306690738754706e-32;function KD(e,t,n,i,r){let o,a,s,l,u=t[0],c=i[0],f=0,d=0;c>u===c>-u?(o=u,u=t[++f]):(o=c,c=i[++d]);let h=0;if(f<e&&d<n)for(c>u===c>-u?(a=u+o,s=o-(a-u),u=t[++f]):(a=c+o,s=o-(a-c),c=i[++d]),o=a,0!==s&&(r[h++]=s);f<e&&d<n;)c>u===c>-u?(a=o+u,l=a-o,s=o-(a-l)+(u-l),u=t[++f]):(a=o+c,l=a-o,s=o-(a-l)+(c-l),c=i[++d]),o=a,0!==s&&(r[h++]=s);for(;f<e;)a=o+u,l=a-o,s=o-(a-l)+(u-l),u=t[++f],o=a,0!==s&&(r[h++]=s);for(;d<n;)a=o+c,l=a-o,s=o-(a-l)+(c-l),c=i[++d],o=a,0!==s&&(r[h++]=s);return 0===o&&0!==h||(r[h++]=o),h}function ZD(e){return new Float64Array(e)}const QD=22204460492503146e-32,e$=11093356479670487e-47,t$=ZD(4),n$=ZD(8),i$=ZD(12),r$=ZD(16),o$=ZD(4);function a$(e,t,n,i,r,o){const a=(t-o)*(n-r),s=(e-r)*(i-o),l=a-s,u=Math.abs(a+s);return Math.abs(l)>=33306690738754716e-32*u?l:-function(e,t,n,i,r,o,a){let s,l,u,c,f,d,h,p,m,g,y,v,b,x,_,w,k,E;const D=e-r,$=n-r,A=t-o,S=i-o;x=D*S,d=VD*D,h=d-(d-D),p=D-h,d=VD*S,m=d-(d-S),g=S-m,_=p*g-(x-h*m-p*m-h*g),w=A*$,d=VD*A,h=d-(d-A),p=A-h,d=VD*$,m=d-(d-$),g=$-m,k=p*g-(w-h*m-p*m-h*g),y=_-k,f=_-y,t$[0]=_-(y+f)+(f-k),v=x+y,f=v-x,b=x-(v-f)+(y-f),y=b-w,f=b-y,t$[1]=b-(y+f)+(f-w),E=v+y,f=E-v,t$[2]=v-(E-f)+(y-f),t$[3]=E;let M=function(e,t){let n=t[0];for(let i=1;i<e;i++)n+=t[i];return n}(4,t$),C=QD*a;if(M>=C||-M>=C)return M;if(f=e-D,s=e-(D+f)+(f-r),f=n-$,u=n-($+f)+(f-r),f=t-A,l=t-(A+f)+(f-o),f=i-S,c=i-(S+f)+(f-o),0===s&&0===l&&0===u&&0===c)return M;if(C=e$*a+YD*Math.abs(M),M+=D*c+S*s-(A*u+$*l),M>=C||-M>=C)return M;x=s*S,d=VD*s,h=d-(d-s),p=s-h,d=VD*S,m=d-(d-S),g=S-m,_=p*g-(x-h*m-p*m-h*g),w=l*$,d=VD*l,h=d-(d-l),p=l-h,d=VD*$,m=d-(d-$),g=$-m,k=p*g-(w-h*m-p*m-h*g),y=_-k,f=_-y,o$[0]=_-(y+f)+(f-k),v=x+y,f=v-x,b=x-(v-f)+(y-f),y=b-w,f=b-y,o$[1]=b-(y+f)+(f-w),E=v+y,f=E-v,o$[2]=v-(E-f)+(y-f),o$[3]=E;const F=KD(4,t$,4,o$,n$);x=D*c,d=VD*D,h=d-(d-D),p=D-h,d=VD*c,m=d-(d-c),g=c-m,_=p*g-(x-h*m-p*m-h*g),w=A*u,d=VD*A,h=d-(d-A),p=A-h,d=VD*u,m=d-(d-u),g=u-m,k=p*g-(w-h*m-p*m-h*g),y=_-k,f=_-y,o$[0]=_-(y+f)+(f-k),v=x+y,f=v-x,b=x-(v-f)+(y-f),y=b-w,f=b-y,o$[1]=b-(y+f)+(f-w),E=v+y,f=E-v,o$[2]=v-(E-f)+(y-f),o$[3]=E;const O=KD(F,n$,4,o$,i$);x=s*c,d=VD*s,h=d-(d-s),p=s-h,d=VD*c,m=d-(d-c),g=c-m,_=p*g-(x-h*m-p*m-h*g),w=l*u,d=VD*l,h=d-(d-l),p=l-h,d=VD*u,m=d-(d-u),g=u-m,k=p*g-(w-h*m-p*m-h*g),y=_-k,f=_-y,o$[0]=_-(y+f)+(f-k),v=x+y,f=v-x,b=x-(v-f)+(y-f),y=b-w,f=b-y,o$[1]=b-(y+f)+(f-w),E=v+y,f=E-v,o$[2]=v-(E-f)+(y-f),o$[3]=E;const T=KD(O,i$,4,o$,r$);return r$[T-1]}(e,t,n,i,r,o,u)}ZD(4),ZD(4),ZD(4),ZD(4),ZD(4),ZD(4),ZD(4),ZD(4),ZD(4),ZD(8),ZD(8),ZD(8),ZD(4),ZD(8),ZD(8),ZD(8),ZD(12);ZD(192),ZD(192);ZD(4),ZD(4),ZD(4),ZD(4),ZD(4),ZD(4),ZD(4),ZD(4),ZD(8),ZD(8),ZD(8),ZD(8),ZD(8),ZD(8),ZD(8),ZD(8),ZD(8),ZD(4),ZD(4),ZD(4),ZD(8),ZD(16),ZD(16),ZD(16),ZD(32),ZD(32),ZD(48),ZD(64);ZD(1152),ZD(1152);ZD(4),ZD(4),ZD(4),ZD(4),ZD(4),ZD(4),ZD(4),ZD(4),ZD(4),ZD(4),ZD(24),ZD(24),ZD(24),ZD(24),ZD(24),ZD(24),ZD(24),ZD(24),ZD(24),ZD(24),ZD(1152),ZD(1152),ZD(1152),ZD(1152),ZD(1152),ZD(2304),ZD(2304),ZD(3456),ZD(5760),ZD(8),ZD(8),ZD(8),ZD(16),ZD(24),ZD(48),ZD(48),ZD(96),ZD(192),ZD(384),ZD(384),ZD(384),ZD(768);ZD(96),ZD(96),ZD(96),ZD(1152);const s$=Math.pow(2,-52),l$=new Uint32Array(512);class u${static from(e,t=m$,n=g$){const i=e.length,r=new Float64Array(2*i);for(let o=0;o<i;o++){const i=e[o];r[2*o]=t(i),r[2*o+1]=n(i)}return new u$(r)}constructor(e){const t=e.length>>1;if(t>0&&"number"!==typeof e[0])throw new Error("Expected coords to contain numbers.");this.coords=e;const n=Math.max(2*t-5,0);this._triangles=new Uint32Array(3*n),this._halfedges=new Int32Array(3*n),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).fill(-1),this._ids=new Uint32Array(t),this._dists=new Float64Array(t),this.update()}update(){const{coords:e,_hullPrev:t,_hullNext:n,_hullTri:i,_hullHash:r}=this,o=e.length>>1;let a=1/0,s=1/0,l=-1/0,u=-1/0;for(let D=0;D<o;D++){const t=e[2*D],n=e[2*D+1];t<a&&(a=t),n<s&&(s=n),t>l&&(l=t),n>u&&(u=n),this._ids[D]=D}const c=(a+l)/2,f=(s+u)/2;let d,h,p,m=1/0;for(let D=0;D<o;D++){const t=c$(c,f,e[2*D],e[2*D+1]);t<m&&(d=D,m=t)}const g=e[2*d],y=e[2*d+1];m=1/0;for(let D=0;D<o;D++){if(D===d)continue;const t=c$(g,y,e[2*D],e[2*D+1]);t<m&&t>0&&(h=D,m=t)}let v=e[2*h],b=e[2*h+1],x=1/0;for(let D=0;D<o;D++){if(D===d||D===h)continue;const t=d$(g,y,v,b,e[2*D],e[2*D+1]);t<x&&(p=D,x=t)}let _=e[2*p],w=e[2*p+1];if(x===1/0){for(let i=0;i<o;i++)this._dists[i]=e[2*i]-e[0]||e[2*i+1]-e[1];h$(this._ids,this._dists,0,o-1);const t=new Uint32Array(o);let n=0;for(let e=0,i=-1/0;e<o;e++){const r=this._ids[e];this._dists[r]>i&&(t[n++]=r,i=this._dists[r])}return this.hull=t.subarray(0,n),this.triangles=new Uint32Array(0),void(this.halfedges=new Uint32Array(0))}if(a$(g,y,v,b,_,w)<0){const e=h,t=v,n=b;h=p,v=_,b=w,p=e,_=t,w=n}const k=function(e,t,n,i,r,o){const a=n-e,s=i-t,l=r-e,u=o-t,c=a*a+s*s,f=l*l+u*u,d=.5/(a*u-s*l),h=e+(u*c-s*f)*d,p=t+(a*f-l*c)*d;return{x:h,y:p}}(g,y,v,b,_,w);this._cx=k.x,this._cy=k.y;for(let D=0;D<o;D++)this._dists[D]=c$(e[2*D],e[2*D+1],k.x,k.y);h$(this._ids,this._dists,0,o-1),this._hullStart=d;let E=3;n[d]=t[p]=h,n[h]=t[d]=p,n[p]=t[h]=d,i[d]=0,i[h]=1,i[p]=2,r.fill(-1),r[this._hashKey(g,y)]=d,r[this._hashKey(v,b)]=h,r[this._hashKey(_,w)]=p,this.trianglesLen=0,this._addTriangle(d,h,p,-1,-1,-1);for(let D,$,A=0;A<this._ids.length;A++){const o=this._ids[A],a=e[2*o],s=e[2*o+1];if(A>0&&Math.abs(a-D)<=s$&&Math.abs(s-$)<=s$)continue;if(D=a,$=s,o===d||o===h||o===p)continue;let l=0;for(let e=0,t=this._hashKey(a,s);e<this._hashSize&&(l=r[(t+e)%this._hashSize],-1===l||l===n[l]);e++);l=t[l];let u,c=l;for(;u=n[c],a$(a,s,e[2*c],e[2*c+1],e[2*u],e[2*u+1])>=0;)if(c=u,c===l){c=-1;break}if(-1===c)continue;let f=this._addTriangle(c,o,n[c],-1,-1,i[c]);i[o]=this._legalize(f+2),i[c]=f,E++;let m=n[c];for(;u=n[m],a$(a,s,e[2*m],e[2*m+1],e[2*u],e[2*u+1])<0;)f=this._addTriangle(m,o,u,i[o],-1,i[m]),i[o]=this._legalize(f+2),n[m]=m,E--,m=u;if(c===l)for(;u=t[c],a$(a,s,e[2*u],e[2*u+1],e[2*c],e[2*c+1])<0;)f=this._addTriangle(u,o,c,-1,i[c],i[u]),this._legalize(f+2),i[u]=f,n[c]=c,E--,c=u;this._hullStart=t[o]=c,n[c]=t[m]=o,n[o]=m,r[this._hashKey(a,s)]=o,r[this._hashKey(e[2*c],e[2*c+1])]=c}this.hull=new Uint32Array(E);for(let D=0,$=this._hullStart;D<E;D++)this.hull[D]=$,$=n[$];this.triangles=this._triangles.subarray(0,this.trianglesLen),this.halfedges=this._halfedges.subarray(0,this.trianglesLen)}_hashKey(e,t){return Math.floor(function(e,t){const n=e/(Math.abs(e)+Math.abs(t));return(t>0?3-n:1+n)/4}(e-this._cx,t-this._cy)*this._hashSize)%this._hashSize}_legalize(e){const{_triangles:t,_halfedges:n,coords:i}=this;let r=0,o=0;for(;;){const a=n[e],s=e-e%3;if(o=s+(e+2)%3,-1===a){if(0===r)break;e=l$[--r];continue}const l=a-a%3,u=s+(e+1)%3,c=l+(a+2)%3,f=t[o],d=t[e],h=t[u],p=t[c];if(f$(i[2*f],i[2*f+1],i[2*d],i[2*d+1],i[2*h],i[2*h+1],i[2*p],i[2*p+1])){t[e]=p,t[a]=f;const i=n[c];if(-1===i){let t=this._hullStart;do{if(this._hullTri[t]===c){this._hullTri[t]=e;break}t=this._hullPrev[t]}while(t!==this._hullStart)}this._link(e,i),this._link(a,n[o]),this._link(o,c);const s=l+(a+1)%3;r<l$.length&&(l$[r++]=s)}else{if(0===r)break;e=l$[--r]}}return o}_link(e,t){this._halfedges[e]=t,-1!==t&&(this._halfedges[t]=e)}_addTriangle(e,t,n,i,r,o){const a=this.trianglesLen;return this._triangles[a]=e,this._triangles[a+1]=t,this._triangles[a+2]=n,this._link(a,i),this._link(a+1,r),this._link(a+2,o),this.trianglesLen+=3,a}}function c$(e,t,n,i){const r=e-n,o=t-i;return r*r+o*o}function f$(e,t,n,i,r,o,a,s){const l=e-a,u=t-s,c=n-a,f=i-s,d=r-a,h=o-s,p=c*c+f*f,m=d*d+h*h;return l*(f*m-p*h)-u*(c*m-p*d)+(l*l+u*u)*(c*h-f*d)<0}function d$(e,t,n,i,r,o){const a=n-e,s=i-t,l=r-e,u=o-t,c=a*a+s*s,f=l*l+u*u,d=.5/(a*u-s*l),h=(u*c-s*f)*d,p=(a*f-l*c)*d;return h*h+p*p}function h$(e,t,n,i){if(i-n<=20)for(let r=n+1;r<=i;r++){const i=e[r],o=t[i];let a=r-1;for(;a>=n&&t[e[a]]>o;)e[a+1]=e[a--];e[a+1]=i}else{let r=n+1,o=i;p$(e,n+i>>1,r),t[e[n]]>t[e[i]]&&p$(e,n,i),t[e[r]]>t[e[i]]&&p$(e,r,i),t[e[n]]>t[e[r]]&&p$(e,n,r);const a=e[r],s=t[a];for(;;){do{r++}while(t[e[r]]<s);do{o--}while(t[e[o]]>s);if(o<r)break;p$(e,r,o)}e[n+1]=e[o],e[o]=a,i-r+1>=o-n?(h$(e,t,r,i),h$(e,t,n,o-1)):(h$(e,t,n,o-1),h$(e,t,r,i))}}function p$(e,t,n){const i=e[t];e[t]=e[n],e[n]=i}function m$(e){return e[0]}function g$(e){return e[1]}const y$=1e-6;class v${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(){null!==this._x1&&(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){const i=(e=+e)+(n=+n),r=t=+t;if(n<0)throw new Error("negative radius");null===this._x1?this._+=`M${i},${r}`:(Math.abs(this._x1-i)>y$||Math.abs(this._y1-r)>y$)&&(this._+="L"+i+","+r),n&&(this._+=`A${n},${n},0,1,1,${e-n},${t}A${n},${n},0,1,1,${this._x1=i},${this._y1=r}`)}rect(e,t,n,i){this._+=`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}h${+n}v${+i}h${-n}Z`}value(){return this._||null}}class b${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}}class x${constructor(e,[t,n,i,r]=[0,0,960,500]){if(!((i=+i)>=(t=+t))||!((r=+r)>=(n=+n)))throw new Error("invalid bounds");this.delaunay=e,this._circumcenters=new Float64Array(2*e.points.length),this.vectors=new Float64Array(2*e.points.length),this.xmax=i,this.xmin=t,this.ymax=r,this.ymin=n,this._init()}update(){return this.delaunay.update(),this._init(),this}_init(){const{delaunay:{points:e,hull:t,triangles:n},vectors:i}=this;let r,o;const a=this.circumcenters=this._circumcenters.subarray(0,n.length/3*2);for(let p,m,g=0,y=0,v=n.length;g<v;g+=3,y+=2){const i=2*n[g],s=2*n[g+1],l=2*n[g+2],u=e[i],c=e[i+1],f=e[s],d=e[s+1],h=e[l],v=e[l+1],b=f-u,x=d-c,_=h-u,w=v-c,k=2*(b*w-x*_);if(Math.abs(k)<1e-9){if(void 0===r){r=o=0;for(const n of t)r+=e[2*n],o+=e[2*n+1];r/=t.length,o/=t.length}const n=1e9*Math.sign((r-u)*w-(o-c)*_);p=(u+h)/2-n*w,m=(c+v)/2+n*_}else{const e=1/k,t=b*b+x*x,n=_*_+w*w;p=u+(w*t-x*n)*e,m=c+(b*n-_*t)*e}a[y]=p,a[y+1]=m}let s,l,u,c=t[t.length-1],f=4*c,d=e[2*c],h=e[2*c+1];i.fill(0);for(let p=0;p<t.length;++p)c=t[p],s=f,l=d,u=h,f=4*c,d=e[2*c],h=e[2*c+1],i[s+2]=i[f]=u-h,i[s+3]=i[f+1]=d-l}render(e){const t=null==e?e=new v$:void 0,{delaunay:{halfedges:n,inedges:i,hull:r},circumcenters:o,vectors:a}=this;if(r.length<=1)return null;for(let u=0,c=n.length;u<c;++u){const t=n[u];if(t<u)continue;const i=2*Math.floor(u/3),r=2*Math.floor(t/3),a=o[i],s=o[i+1],l=o[r],c=o[r+1];this._renderSegment(a,s,l,c,e)}let s,l=r[r.length-1];for(let u=0;u<r.length;++u){s=l,l=r[u];const t=2*Math.floor(i[l]/3),n=o[t],c=o[t+1],f=4*s,d=this._project(n,c,a[f+2],a[f+3]);d&&this._renderSegment(n,c,d[0],d[1],e)}return t&&t.value()}renderBounds(e){const t=null==e?e=new v$:void 0;return e.rect(this.xmin,this.ymin,this.xmax-this.xmin,this.ymax-this.ymin),t&&t.value()}renderCell(e,t){const n=null==t?t=new v$:void 0,i=this._clip(e);if(null===i||!i.length)return;t.moveTo(i[0],i[1]);let r=i.length;for(;i[0]===i[r-2]&&i[1]===i[r-1]&&r>1;)r-=2;for(let o=2;o<r;o+=2)i[o]===i[o-2]&&i[o+1]===i[o-1]||t.lineTo(i[o],i[o+1]);return t.closePath(),n&&n.value()}*cellPolygons(){const{delaunay:{points:e}}=this;for(let t=0,n=e.length/2;t<n;++t){const e=this.cellPolygon(t);e&&(e.index=t,yield e)}}cellPolygon(e){const t=new b$;return this.renderCell(e,t),t.value()}_renderSegment(e,t,n,i,r){let o;const a=this._regioncode(e,t),s=this._regioncode(n,i);0===a&&0===s?(r.moveTo(e,t),r.lineTo(n,i)):(o=this._clipSegment(e,t,n,i,a,s))&&(r.moveTo(o[0],o[1]),r.lineTo(o[2],o[3]))}contains(e,t,n){return(t=+t)===t&&(n=+n)===n&&this.delaunay._step(e,t,n)===e}*neighbors(e){const t=this._clip(e);if(t)for(const n of this.delaunay.neighbors(e)){const e=this._clip(n);if(e)e:for(let i=0,r=t.length;i<r;i+=2)for(let o=0,a=e.length;o<a;o+=2)if(t[i]===e[o]&&t[i+1]===e[o+1]&&t[(i+2)%r]===e[(o+a-2)%a]&&t[(i+3)%r]===e[(o+a-1)%a]){yield n;break e}}}_cell(e){const{circumcenters:t,delaunay:{inedges:n,halfedges:i,triangles:r}}=this,o=n[e];if(-1===o)return null;const a=[];let s=o;do{const n=Math.floor(s/3);if(a.push(t[2*n],t[2*n+1]),s=s%3===2?s-2:s+1,r[s]!==e)break;s=i[s]}while(s!==o&&-1!==s);return a}_clip(e){if(0===e&&1===this.delaunay.hull.length)return[this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax,this.xmin,this.ymin];const t=this._cell(e);if(null===t)return null;const{vectors:n}=this,i=4*e;return this._simplify(n[i]||n[i+1]?this._clipInfinite(e,t,n[i],n[i+1],n[i+2],n[i+3]):this._clipFinite(e,t))}_clipFinite(e,t){const n=t.length;let i,r,o,a,s=null,l=t[n-2],u=t[n-1],c=this._regioncode(l,u),f=0;for(let d=0;d<n;d+=2)if(i=l,r=u,l=t[d],u=t[d+1],o=c,c=this._regioncode(l,u),0===o&&0===c)a=f,f=0,s?s.push(l,u):s=[l,u];else{let t,n,d,h,p;if(0===o){if(null===(t=this._clipSegment(i,r,l,u,o,c)))continue;[n,d,h,p]=t}else{if(null===(t=this._clipSegment(l,u,i,r,c,o)))continue;[h,p,n,d]=t,a=f,f=this._edgecode(n,d),a&&f&&this._edge(e,a,f,s,s.length),s?s.push(n,d):s=[n,d]}a=f,f=this._edgecode(h,p),a&&f&&this._edge(e,a,f,s,s.length),s?s.push(h,p):s=[h,p]}if(s)a=f,f=this._edgecode(s[0],s[1]),a&&f&&this._edge(e,a,f,s,s.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 s}_clipSegment(e,t,n,i,r,o){const a=r<o;for(a&&([e,t,n,i,r,o]=[n,i,e,t,o,r]);;){if(0===r&&0===o)return a?[n,i,e,t]:[e,t,n,i];if(r&o)return null;let s,l,u=r||o;8&u?(s=e+(n-e)*(this.ymax-t)/(i-t),l=this.ymax):4&u?(s=e+(n-e)*(this.ymin-t)/(i-t),l=this.ymin):2&u?(l=t+(i-t)*(this.xmax-e)/(n-e),s=this.xmax):(l=t+(i-t)*(this.xmin-e)/(n-e),s=this.xmin),r?(e=s,t=l,r=this._regioncode(e,t)):(n=s,i=l,o=this._regioncode(n,i))}}_clipInfinite(e,t,n,i,r,o){let a,s=Array.from(t);if((a=this._project(s[0],s[1],n,i))&&s.unshift(a[0],a[1]),(a=this._project(s[s.length-2],s[s.length-1],r,o))&&s.push(a[0],a[1]),s=this._clipFinite(e,s))for(let l,u=0,c=s.length,f=this._edgecode(s[c-2],s[c-1]);u<c;u+=2)l=f,f=this._edgecode(s[u],s[u+1]),l&&f&&(u=this._edge(e,l,f,s,u),c=s.length);else this.contains(e,(this.xmin+this.xmax)/2,(this.ymin+this.ymax)/2)&&(s=[this.xmin,this.ymin,this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax]);return s}_edge(e,t,n,i,r){for(;t!==n;){let n,o;switch(t){case 5:t=4;continue;case 4:t=6,n=this.xmax,o=this.ymin;break;case 6:t=2;continue;case 2:t=10,n=this.xmax,o=this.ymax;break;case 10:t=8;continue;case 8:t=9,n=this.xmin,o=this.ymax;break;case 9:t=1;continue;case 1:t=5,n=this.xmin,o=this.ymin}i[r]===n&&i[r+1]===o||!this.contains(e,n,o)||(i.splice(r,0,n,o),r+=2)}return r}_project(e,t,n,i){let r,o,a,s=1/0;if(i<0){if(t<=this.ymin)return null;(r=(this.ymin-t)/i)<s&&(a=this.ymin,o=e+(s=r)*n)}else if(i>0){if(t>=this.ymax)return null;(r=(this.ymax-t)/i)<s&&(a=this.ymax,o=e+(s=r)*n)}if(n>0){if(e>=this.xmax)return null;(r=(this.xmax-e)/n)<s&&(o=this.xmax,a=t+(s=r)*i)}else if(n<0){if(e<=this.xmin)return null;(r=(this.xmin-e)/n)<s&&(o=this.xmin,a=t+(s=r)*i)}return[o,a]}_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){const n=(t+2)%e.length,i=(t+4)%e.length;(e[t]===e[n]&&e[n]===e[i]||e[t+1]===e[n+1]&&e[n+1]===e[i+1])&&(e.splice(n,2),t-=2)}e.length||(e=null)}return e}}const _$=2*Math.PI,w$=Math.pow;function k$(e){return e[0]}function E$(e){return e[1]}function D$(e,t,n){return[e+Math.sin(e+t)*n,t+Math.cos(e-t)*n]}class $${static from(e,t=k$,n=E$,i){return new $$("length"in e?function(e,t,n,i){const r=e.length,o=new Float64Array(2*r);for(let a=0;a<r;++a){const r=e[a];o[2*a]=t.call(i,r,a,e),o[2*a+1]=n.call(i,r,a,e)}return o}(e,t,n,i):Float64Array.from(function*(e,t,n,i){let r=0;for(const o of e)yield t.call(i,o,r,e),yield n.call(i,o,r,e),++r}(e,t,n,i)))}constructor(e){this._delaunator=new u$(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(){const e=this._delaunator,t=this.points;if(e.hull&&e.hull.length>2&&function(e){const{triangles:t,coords:n}=e;for(let i=0;i<t.length;i+=3){const e=2*t[i],r=2*t[i+1],o=2*t[i+2];if((n[o]-n[e])*(n[r+1]-n[e+1])-(n[r]-n[e])*(n[o+1]-n[e+1])>1e-10)return!1}return!0}(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]));const e=this.collinear[0],n=this.collinear[this.collinear.length-1],i=[t[2*e],t[2*e+1],t[2*n],t[2*n+1]],r=1e-8*Math.hypot(i[3]-i[1],i[2]-i[0]);for(let o=0,a=t.length/2;o<a;++o){const e=D$(t[2*o],t[2*o+1],r);t[2*o]=e[0],t[2*o+1]=e[1]}this._delaunator=new u$(t)}else delete this.collinear;const n=this.halfedges=this._delaunator.halfedges,i=this.hull=this._delaunator.hull,r=this.triangles=this._delaunator.triangles,o=this.inedges.fill(-1),a=this._hullIndex.fill(-1);for(let s=0,l=n.length;s<l;++s){const e=r[s%3===2?s-2:s+1];-1!==n[s]&&-1!==o[e]||(o[e]=s)}for(let s=0,l=i.length;s<l;++s)a[i[s]]=s;i.length<=2&&i.length>0&&(this.triangles=new Int32Array(3).fill(-1),this.halfedges=new Int32Array(3).fill(-1),this.triangles[0]=i[0],o[i[0]]=1,2===i.length&&(o[i[1]]=0,this.triangles[1]=i[1],this.triangles[2]=i[1]))}voronoi(e){return new x$(this,e)}*neighbors(e){const{inedges:t,hull:n,_hullIndex:i,halfedges:r,triangles:o,collinear:a}=this;if(a){const t=a.indexOf(e);return t>0&&(yield a[t-1]),void(t<a.length-1&&(yield a[t+1]))}const s=t[e];if(-1===s)return;let l=s,u=-1;do{if(yield u=o[l],l=l%3===2?l-2:l+1,o[l]!==e)return;if(l=r[l],-1===l){const t=n[(i[e]+1)%n.length];return void(t!==u&&(yield t))}}while(l!==s)}find(e,t,n=0){if((e=+e)!==e||(t=+t)!==t)return-1;const i=n;let r;for(;(r=this._step(n,e,t))>=0&&r!==n&&r!==i;)n=r;return r}_step(e,t,n){const{inedges:i,hull:r,_hullIndex:o,halfedges:a,triangles:s,points:l}=this;if(-1===i[e]||!l.length)return(e+1)%(l.length>>1);let u=e,c=w$(t-l[2*e],2)+w$(n-l[2*e+1],2);const f=i[e];let d=f;do{let i=s[d];const f=w$(t-l[2*i],2)+w$(n-l[2*i+1],2);if(f<c&&(c=f,u=i),d=d%3===2?d-2:d+1,s[d]!==e)break;if(d=a[d],-1===d){if(d=r[(o[e]+1)%r.length],d!==i&&w$(t-l[2*d],2)+w$(n-l[2*d+1],2)<c)return d;break}}while(d!==f);return u}render(e){const t=null==e?e=new v$:void 0,{points:n,halfedges:i,triangles:r}=this;for(let o=0,a=i.length;o<a;++o){const t=i[o];if(t<o)continue;const a=2*r[o],s=2*r[t];e.moveTo(n[a],n[a+1]),e.lineTo(n[s],n[s+1])}return this.renderHull(e),t&&t.value()}renderPoints(e,t){void 0!==t||e&&"function"===typeof e.moveTo||(t=e,e=null),t=void 0==t?2:+t;const n=null==e?e=new v$:void 0,{points:i}=this;for(let r=0,o=i.length;r<o;r+=2){const n=i[r],o=i[r+1];e.moveTo(n+t,o),e.arc(n,o,t,0,_$)}return n&&n.value()}renderHull(e){const t=null==e?e=new v$:void 0,{hull:n,points:i}=this,r=2*n[0],o=n.length;e.moveTo(i[r],i[r+1]);for(let a=1;a<o;++a){const t=2*n[a];e.lineTo(i[t],i[t+1])}return e.closePath(),t&&t.value()}hullPolygon(){const e=new b$;return this.renderHull(e),e.value()}renderTriangle(e,t){const n=null==t?t=new v$:void 0,{points:i,triangles:r}=this,o=2*r[e*=3],a=2*r[e+1],s=2*r[e+2];return t.moveTo(i[o],i[o+1]),t.lineTo(i[a],i[a+1]),t.lineTo(i[s],i[s+1]),t.closePath(),n&&n.value()}*trianglePolygons(){const{triangles:e}=this;for(let t=0,n=e.length/3;t<n;++t)yield this.trianglePolygon(t)}trianglePolygon(e){const t=new b$;return this.renderTriangle(e,t),t.value()}}function A$(e){no.call(this,null,e)}A$.Definition={type:"Voronoi",metadata:{modifies:!0},params:[{name:"x",type:"field",required:!0},{name:"y",type:"field",required:!0},{name:"size",type:"number",array:!0,length:2},{name:"extent",type:"array",array:!0,length:2,default:[[-1e5,-1e5],[1e5,1e5]],content:{type:"number",array:!0,length:2}},{name:"as",type:"string",default:"path"}]};const S$=[-1e5,-1e5,1e5,1e5];function M$(e){const t=e[0][0],n=e[0][1];let i=e.length-1;for(;e[i][0]===t&&e[i][1]===n;--i);return"M"+e.slice(0,i+1).join("L")+"Z"}(0,m.XW)(A$,no,{transform(e,t){const n=e.as||"path",i=t.source;if(!i||!i.length)return t;let r=e.size;r=r?[0,0,r[0],r[1]]:(r=e.extent)?[r[0][0],r[0][1],r[1][0],r[1][1]]:S$;const o=this.value=$$.from(i,e.x,e.y).voronoi(r);for(let s=0,l=i.length;s<l;++s){const e=o.cellPolygon(s);i[s][n]=e&&(2!==(a=e).length||a[0][0]!==a[1][0]||a[0][1]!==a[1][1])?M$(e):null}var a;return t.reflow(e.modified()).modifies(n)}});var C$=Math.PI/180,F$=64,O$=2048;function T$(){var e,t,n,i,r,o,a,s=[256,256],l=L$,u=[],c=Math.random,f={};function d(e,t,n){for(var i,r,o,a=t.x,u=t.y,f=Math.sqrt(s[0]*s[0]+s[1]*s[1]),d=l(s),h=c()<.5?1:-1,p=-h;(i=d(p+=h))&&(r=~~i[0],o=~~i[1],!(Math.min(Math.abs(r),Math.abs(o))>=f));)if(t.x=a+r,t.y=u+o,!(t.x+t.x0<0||t.y+t.y0<0||t.x+t.x1>s[0]||t.y+t.y1>s[1])&&(!n||!z$(t,e,s[0]))&&(!n||P$(t,n))){for(var m,g=t.sprite,y=t.width>>5,v=s[0]>>5,b=t.x-(y<<4),x=127&b,_=32-x,w=t.y1-t.y0,k=(t.y+t.y0)*v+(b>>5),E=0;E<w;E++){m=0;for(var D=0;D<=y;D++)e[k+D]|=m<<_|(D<y?(m=g[E*y+D])>>>x:0);k+=v}return t.sprite=null,!0}return!1}return f.layout=function(){for(var l=function(e){e.width=e.height=1;var t=Math.sqrt(e.getContext("2d").getImageData(0,0,1,1).data.length>>2);e.width=(F$<<5)/t,e.height=O$/t;var n=e.getContext("2d");return n.fillStyle=n.strokeStyle="red",n.textAlign="center",{context:n,ratio:t}}(tu()),f=function(e){var t=[],n=-1;for(;++n<e;)t[n]=0;return t}((s[0]>>5)*s[1]),h=null,p=u.length,m=-1,g=[],y=u.map((s=>({text:e(s),font:t(s),style:i(s),weight:r(s),rotate:o(s),size:~~(n(s)+1e-14),padding:a(s),xoff:0,yoff:0,x1:0,y1:0,x0:0,y0:0,hasText:!1,sprite:null,datum:s}))).sort(((e,t)=>t.size-e.size));++m<p;){var v=y[m];v.x=s[0]*(c()+.5)>>1,v.y=s[1]*(c()+.5)>>1,N$(l,v,y,m),v.hasText&&d(f,v,h)&&(g.push(v),h?R$(h,v):h=[{x:v.x+v.x0,y:v.y+v.y0},{x:v.x+v.x1,y:v.y+v.y1}],v.x-=s[0]>>1,v.y-=s[1]>>1)}return g},f.words=function(e){return arguments.length?(u=e,f):u},f.size=function(e){return arguments.length?(s=[+e[0],+e[1]],f):s},f.font=function(e){return arguments.length?(t=U$(e),f):t},f.fontStyle=function(e){return arguments.length?(i=U$(e),f):i},f.fontWeight=function(e){return arguments.length?(r=U$(e),f):r},f.rotate=function(e){return arguments.length?(o=U$(e),f):o},f.text=function(t){return arguments.length?(e=U$(t),f):e},f.spiral=function(e){return arguments.length?(l=B$[e]||e,f):l},f.fontSize=function(e){return arguments.length?(n=U$(e),f):n},f.padding=function(e){return arguments.length?(a=U$(e),f):a},f.random=function(e){return arguments.length?(c=e,f):c},f}function N$(e,t,n,i){if(!t.sprite){var r=e.context,o=e.ratio;r.clearRect(0,0,(F$<<5)/o,O$/o);var a,s,l,u,c,f=0,d=0,h=0,p=n.length;for(--i;++i<p;){if(t=n[i],r.save(),r.font=t.style+" "+t.weight+" "+~~((t.size+1)/o)+"px "+t.font,a=r.measureText(t.text+"m").width*o,l=t.size<<1,t.rotate){var m=Math.sin(t.rotate*C$),g=Math.cos(t.rotate*C$),y=a*g,v=a*m,b=l*g,x=l*m;a=Math.max(Math.abs(y+x),Math.abs(y-x))+31>>5<<5,l=~~Math.max(Math.abs(v+b),Math.abs(v-b))}else a=a+31>>5<<5;if(l>h&&(h=l),f+a>=F$<<5&&(f=0,d+=h,h=0),d+l>=O$)break;r.translate((f+(a>>1))/o,(d+(l>>1))/o),t.rotate&&r.rotate(t.rotate*C$),r.fillText(t.text,0,0),t.padding&&(r.lineWidth=2*t.padding,r.strokeText(t.text,0,0)),r.restore(),t.width=a,t.height=l,t.xoff=f,t.yoff=d,t.x1=a>>1,t.y1=l>>1,t.x0=-t.x1,t.y0=-t.y1,t.hasText=!0,f+=a}for(var _=r.getImageData(0,0,(F$<<5)/o,O$/o).data,w=[];--i>=0;)if((t=n[i]).hasText){for(s=(a=t.width)>>5,l=t.y1-t.y0,u=0;u<l*s;u++)w[u]=0;if(null==(f=t.xoff))return;d=t.yoff;var k=0,E=-1;for(c=0;c<l;c++){for(u=0;u<a;u++){var D=s*c+(u>>5),$=_[(d+c)*(F$<<5)+(f+u)<<2]?1<<31-u%32:0;w[D]|=$,k|=$}k?E=c:(t.y0++,l--,c--,d++)}t.y1=t.y0+E,t.sprite=w.slice(0,(t.y1-t.y0)*s)}}}function z$(e,t,n){n>>=5;for(var i,r=e.sprite,o=e.width>>5,a=e.x-(o<<4),s=127&a,l=32-s,u=e.y1-e.y0,c=(e.y+e.y0)*n+(a>>5),f=0;f<u;f++){i=0;for(var d=0;d<=o;d++)if((i<<l|(d<o?(i=r[f*o+d])>>>s:0))&t[c+d])return!0;c+=n}return!1}function R$(e,t){var n=e[0],i=e[1];t.x+t.x0<n.x&&(n.x=t.x+t.x0),t.y+t.y0<n.y&&(n.y=t.y+t.y0),t.x+t.x1>i.x&&(i.x=t.x+t.x1),t.y+t.y1>i.y&&(i.y=t.y+t.y1)}function P$(e,t){return e.x+e.x1>t[0].x&&e.x+e.x0<t[1].x&&e.y+e.y1>t[0].y&&e.y+e.y0<t[1].y}function L$(e){var t=e[0]/e[1];return function(e){return[t*(e*=.1)*Math.cos(e),e*Math.sin(e)]}}function U$(e){return"function"===typeof e?e:function(){return e}}var B$={archimedean:L$,rectangular:function(e){var t=4*e[0]/e[1],n=0,i=0;return function(e){var r=e<0?-1:1;switch(Math.sqrt(1+4*r*e)-r&3){case 0:n+=t;break;case 1:i+=4;break;case 2:n-=t;break;default:i-=4}return[n,i]}}};const j$=["x","y","font","fontSize","fontStyle","fontWeight","angle"],I$=["text","font","rotate","fontSize","fontStyle","fontWeight"];function q$(e){no.call(this,T$(),e)}q$.Definition={type:"Wordcloud",metadata:{modifies:!0},params:[{name:"size",type:"number",array:!0,length:2},{name:"font",type:"string",expr:!0,default:"sans-serif"},{name:"fontStyle",type:"string",expr:!0,default:"normal"},{name:"fontWeight",type:"string",expr:!0,default:"normal"},{name:"fontSize",type:"number",expr:!0,default:14},{name:"fontSizeRange",type:"number",array:"nullable",default:[10,50]},{name:"rotate",type:"number",expr:!0,default:0},{name:"text",type:"field"},{name:"spiral",type:"string",values:["archimedean","rectangular"]},{name:"padding",type:"number",expr:!0},{name:"as",type:"string",array:!0,length:7,default:j$}]},(0,m.XW)(q$,no,{transform(e,t){!e.size||e.size[0]&&e.size[1]||(0,m.vU)("Wordcloud size dimensions must be non-zero.");const n=e.modified();if(!(n||t.changed(t.ADD_REM)||I$.some((function(n){const i=e[n];return(0,m.mf)(i)&&t.modified(i.fields)}))))return;const i=t.materialize(t.SOURCE).source,r=this.value,o=e.as||j$;let a,s=e.fontSize||14;if((0,m.mf)(s)?a=e.fontSizeRange:s=(0,m.a9)(s),a){const e=s,t=Wf("sqrt")().domain((0,m.We)(i,e)).range(a);s=n=>t(e(n))}i.forEach((e=>{e[o[0]]=NaN,e[o[1]]=NaN,e[o[3]]=0}));const l=r.words(i).text(e.text).size(e.size||[500,500]).padding(e.padding||1).spiral(e.spiral||"archimedean").rotate(e.rotate||0).font(e.font||"sans-serif").fontStyle(e.fontStyle||"normal").fontWeight(e.fontWeight||"normal").fontSize(s).random(wo).layout(),u=r.size(),c=u[0]>>1,f=u[1]>>1,d=l.length;for(let h,p,m=0;m<d;++m)h=l[m],p=h.datum,p[o[0]]=h.x+c,p[o[1]]=h.y+f,p[o[2]]=h.font,p[o[3]]=h.size,p[o[4]]=h.style,p[o[5]]=h.weight,p[o[6]]=h.rotate;return t.reflow(n).modifies(o)}});const W$=e=>new Uint8Array(e),H$=e=>new Uint16Array(e),X$=e=>new Uint32Array(e);function J$(e,t,n){const i=(t<257?W$:t<65537?H$:X$)(e);return n&&i.set(n),i}function G$(e,t,n){const i=1<<t;return{one:i,zero:~i,range:n.slice(),bisect:e.bisect,index:e.index,size:e.size,onAdd(e,t){const n=this,r=n.bisect(n.range,e.value),o=e.index,a=r[0],s=r[1],l=o.length;let u;for(u=0;u<a;++u)t[o[u]]|=i;for(u=s;u<l;++u)t[o[u]]|=i;return n}}}function V$(){let e=X$(0),t=[],n=0;return{insert:function(i,r,o){if(!r.length)return[];const a=n,s=r.length,l=X$(s);let u,c,f,d=Array(s);for(f=0;f<s;++f)d[f]=i(r[f]),l[f]=f;if(d=function(e,t){return e.sort.call(t,((t,n)=>{const i=e[t],r=e[n];return i<r?-1:i>r?1:0})),function(e,t){return Array.from(t,(t=>e[t]))}(e,t)}(d,l),a)u=t,c=e,t=Array(a+s),e=X$(a+s),function(e,t,n,i,r,o,a,s,l){let u,c=0,f=0;for(u=0;c<i&&f<a;++u)t[c]<r[f]?(s[u]=t[c],l[u]=n[c++]):(s[u]=r[f],l[u]=o[f++]+e);for(;c<i;++c,++u)s[u]=t[c],l[u]=n[c];for(;f<a;++f,++u)s[u]=r[f],l[u]=o[f]+e}(o,u,c,a,d,l,s,t,e);else{if(o>0)for(f=0;f<s;++f)l[f]+=o;t=d,e=l}return n=a+s,{index:l,value:d}},remove:function(i,r){const o=n;let a,s,l;for(s=0;!r[e[s]]&&s<o;++s);for(l=s;s<o;++s)r[a=e[s]]||(e[l]=a,t[l]=t[s],++l);n=o-i},bisect:function(e,i){let r;return i?r=i.length:(i=t,r=n),[ou(i,e[0],0,r),ru(i,e[1],0,r)]},reindex:function(t){for(let i=0,r=n;i<r;++i)e[i]=t[e[i]]},index:()=>e,size:()=>n}}function Y$(e){no.call(this,function(){let e=8,t=[],n=X$(0),i=J$(0,e),r=J$(0,e);return{data:()=>t,seen:()=>n=function(e,t,n){return e.length>=t?e:((n=n||new e.constructor(t)).set(e),n)}(n,t.length),add(e){for(let n,i=0,r=t.length,o=e.length;i<o;++i)n=e[i],n._index=r++,t.push(n)},remove(e,n){const o=t.length,a=Array(o-e),s=t;let l,u,c;for(u=0;!n[u]&&u<o;++u)a[u]=t[u],s[u]=u;for(c=u;u<o;++u)l=t[u],n[u]?s[u]=-1:(s[u]=c,i[c]=i[u],r[c]=r[u],a[c]=l,l._index=c++),i[u]=0;return t=a,s},size:()=>t.length,curr:()=>i,prev:()=>r,reset:e=>r[e]=i[e],all:()=>e<257?255:e<65537?65535:4294967295,set(e,t){i[e]|=t},clear(e,t){i[e]&=~t},resize(t,n){(t>i.length||n>e)&&(e=Math.max(n,e),i=J$(t,e,i),r=J$(t,e))}}}(),e),this._indices=null,this._dims=null}function K$(e){no.call(this,null,e)}Y$.Definition={type:"CrossFilter",metadata:{},params:[{name:"fields",type:"field",array:!0,required:!0},{name:"query",type:"array",array:!0,required:!0,content:{type:"number",array:!0,length:2}}]},(0,m.XW)(Y$,no,{transform(e,t){return this._dims?e.modified("fields")||e.fields.some((e=>t.modified(e.fields)))?this.reinit(e,t):this.eval(e,t):this.init(e,t)},init(e,t){const n=e.fields,i=e.query,r=this._indices={},o=this._dims=[],a=i.length;let s,l,u=0;for(;u<a;++u)s=n[u].fname,l=r[s]||(r[s]=V$()),o.push(G$(l,u,i[u]));return this.eval(e,t)},reinit(e,t){const n=t.materialize().fork(),i=e.fields,r=e.query,o=this._indices,a=this._dims,s=this.value,l=s.curr(),u=s.prev(),c=s.all(),f=n.rem=n.add,d=n.mod,h=r.length,p={};let m,g,y,v,b,x,_,w,k;if(u.set(l),t.rem.length&&(b=this.remove(e,t,n)),t.add.length&&s.add(t.add),t.mod.length)for(x={},v=t.mod,_=0,w=v.length;_<w;++_)x[v[_]._index]=1;for(_=0;_<h;++_)k=i[_],(!a[_]||e.modified("fields",_)||t.modified(k.fields))&&(y=k.fname,(m=p[y])||(o[y]=g=V$(),p[y]=m=g.insert(k,t.source,0)),a[_]=G$(g,_,r[_]).onAdd(m,l));for(_=0,w=s.data().length;_<w;++_)b[_]||(u[_]!==l[_]?f.push(_):x[_]&&l[_]!==c&&d.push(_));return s.mask=(1<<h)-1,n},eval(e,t){const n=t.materialize().fork(),i=this._dims.length;let r=0;return t.rem.length&&(this.remove(e,t,n),r|=(1<<i)-1),e.modified("query")&&!e.modified("fields")&&(r|=this.update(e,t,n)),t.add.length&&(this.insert(e,t,n),r|=(1<<i)-1),t.mod.length&&(this.modify(t,n),r|=(1<<i)-1),this.value.mask=r,n},insert(e,t,n){const i=t.add,r=this.value,o=this._dims,a=this._indices,s=e.fields,l={},u=n.add,c=r.size()+i.length,f=o.length;let d,h,p,m=r.size();r.resize(c,f),r.add(i);const g=r.curr(),y=r.prev(),v=r.all();for(d=0;d<f;++d)h=s[d].fname,p=l[h]||(l[h]=a[h].insert(s[d],i,m)),o[d].onAdd(p,g);for(;m<c;++m)y[m]=v,g[m]!==v&&u.push(m)},modify(e,t){const n=t.mod,i=this.value,r=i.curr(),o=i.all(),a=e.mod;let s,l,u;for(s=0,l=a.length;s<l;++s)u=a[s]._index,r[u]!==o&&n.push(u)},remove(e,t,n){const i=this._indices,r=this.value,o=r.curr(),a=r.prev(),s=r.all(),l={},u=n.rem,c=t.rem;let f,d,h,p;for(f=0,d=c.length;f<d;++f)h=c[f]._index,l[h]=1,a[h]=p=o[h],o[h]=s,p!==s&&u.push(h);for(h in i)i[h].remove(d,l);return this.reindex(t,d,l),l},reindex(e,t,n){const i=this._indices,r=this.value;e.runAfter((()=>{const e=r.remove(t,n);for(const t in i)i[t].reindex(e)}))},update(e,t,n){const i=this._dims,r=e.query,o=t.stamp,a=i.length;let s,l,u=0;for(n.filters=0,l=0;l<a;++l)e.modified("query",l)&&(s=l,++u);if(1===u)u=i[s].one,this.incrementOne(i[s],r[s],n.add,n.rem);else for(l=0,u=0;l<a;++l)e.modified("query",l)&&(u|=i[l].one,this.incrementAll(i[l],r[l],o,n.add),n.rem=n.add);return u},incrementAll(e,t,n,i){const r=this.value,o=r.seen(),a=r.curr(),s=r.prev(),l=e.index(),u=e.bisect(e.range),c=e.bisect(t),f=c[0],d=c[1],h=u[0],p=u[1],m=e.one;let g,y,v;if(f<h)for(g=f,y=Math.min(h,d);g<y;++g)v=l[g],o[v]!==n&&(s[v]=a[v],o[v]=n,i.push(v)),a[v]^=m;else if(f>h)for(g=h,y=Math.min(f,p);g<y;++g)v=l[g],o[v]!==n&&(s[v]=a[v],o[v]=n,i.push(v)),a[v]^=m;if(d>p)for(g=Math.max(f,p),y=d;g<y;++g)v=l[g],o[v]!==n&&(s[v]=a[v],o[v]=n,i.push(v)),a[v]^=m;else if(d<p)for(g=Math.max(h,d),y=p;g<y;++g)v=l[g],o[v]!==n&&(s[v]=a[v],o[v]=n,i.push(v)),a[v]^=m;e.range=t.slice()},incrementOne(e,t,n,i){const r=this.value.curr(),o=e.index(),a=e.bisect(e.range),s=e.bisect(t),l=s[0],u=s[1],c=a[0],f=a[1],d=e.one;let h,p,m;if(l<c)for(h=l,p=Math.min(c,u);h<p;++h)m=o[h],r[m]^=d,n.push(m);else if(l>c)for(h=c,p=Math.min(l,f);h<p;++h)m=o[h],r[m]^=d,i.push(m);if(u>f)for(h=Math.max(l,f),p=u;h<p;++h)m=o[h],r[m]^=d,n.push(m);else if(u<f)for(h=Math.max(c,u),p=f;h<p;++h)m=o[h],r[m]^=d,i.push(m);e.range=t.slice()}}),K$.Definition={type:"ResolveFilter",metadata:{},params:[{name:"ignore",type:"number",required:!0,description:"A bit mask indicating which filters to ignore."},{name:"filter",type:"object",required:!0,description:"Per-tuple filter bitmaps from a CrossFilter transform."}]},(0,m.XW)(K$,no,{transform(e,t){const n=~(e.ignore||0),i=e.filter,r=i.mask;if(0===(r&n))return t.StopPropagation;const o=t.fork(t.ALL),a=i.data(),s=i.curr(),l=i.prev(),u=e=>s[e]&n?null:a[e];return o.filter(o.MOD,u),r&r-1?(o.filter(o.ADD,(e=>{const t=s[e]&n;return!t&&t^l[e]&n?a[e]:null})),o.filter(o.REM,(e=>{const t=s[e]&n;return t&&!(t^t^l[e]&n)?a[e]:null}))):(o.filter(o.ADD,u),o.filter(o.REM,(e=>(s[e]&n)===r?a[e]:null))),o.filter(o.SOURCE,(e=>u(e._index)))}});var Z$,Q$,eA,tA,nA,iA,rA,oA,aA,sA,lA,uA,cA,fA,dA,hA,pA=n(82806),mA=new Tb,gA=new Tb,yA={point:ix,lineStart:ix,lineEnd:ix,polygonStart:function(){mA=new Tb,yA.lineStart=vA,yA.lineEnd=bA},polygonEnd:function(){var e=+mA;gA.add(e<0?Ub+e:e),this.lineStart=this.lineEnd=this.point=ix},sphere:function(){gA.add(Ub)}};function vA(){yA.point=xA}function bA(){_A(Z$,Q$)}function xA(e,t){yA.point=_A,Z$=e,Q$=t,eA=e*=jb,tA=Hb(t=(t*=jb)/2+Lb),nA=Kb(t)}function _A(e,t){var n=(e*=jb)-eA,i=n>=0?1:-1,r=i*n,o=Hb(t=(t*=jb)/2+Lb),a=Kb(t),s=nA*a,l=tA*o+s*Hb(r),u=s*i*Kb(r);mA.add(Wb(u,l)),eA=e,tA=o,nA=a}var wA,kA,EA,DA,$A,AA,SA,MA,CA,FA,OA,TA,NA,zA,RA,PA,LA={point:UA,lineStart:jA,lineEnd:IA,polygonStart:function(){LA.point=qA,LA.lineStart=WA,LA.lineEnd=HA,fA=new Tb,yA.polygonStart()},polygonEnd:function(){yA.polygonEnd(),LA.point=UA,LA.lineStart=jA,LA.lineEnd=IA,mA<0?(iA=-(oA=180),rA=-(aA=90)):fA>Nb?aA=90:fA<-Nb&&(rA=-90),hA[0]=iA,hA[1]=oA},sphere:function(){iA=-(oA=180),rA=-(aA=90)}};function UA(e,t){dA.push(hA=[iA=e,oA=e]),t<rA&&(rA=t),t>aA&&(aA=t)}function BA(e,t){var n=g_([e*jb,t*jb]);if(cA){var i=v_(cA,n),r=v_([i[1],-i[0],0],i);__(r),r=m_(r);var o,a=e-sA,s=a>0?1:-1,l=r[0]*Bb*s,u=Ib(a)>180;u^(s*sA<l&&l<s*e)?(o=r[1]*Bb)>aA&&(aA=o):u^(s*sA<(l=(l+360)%360-180)&&l<s*e)?(o=-r[1]*Bb)<rA&&(rA=o):(t<rA&&(rA=t),t>aA&&(aA=t)),u?e<sA?XA(iA,e)>XA(iA,oA)&&(oA=e):XA(e,oA)>XA(iA,oA)&&(iA=e):oA>=iA?(e<iA&&(iA=e),e>oA&&(oA=e)):e>sA?XA(iA,e)>XA(iA,oA)&&(oA=e):XA(e,oA)>XA(iA,oA)&&(iA=e)}else dA.push(hA=[iA=e,oA=e]);t<rA&&(rA=t),t>aA&&(aA=t),cA=n,sA=e}function jA(){LA.point=BA}function IA(){hA[0]=iA,hA[1]=oA,LA.point=UA,cA=null}function qA(e,t){if(cA){var n=e-sA;fA.add(Ib(n)>180?n+(n>0?360:-360):n)}else lA=e,uA=t;yA.point(e,t),BA(e,t)}function WA(){yA.lineStart()}function HA(){qA(lA,uA),yA.lineEnd(),Ib(fA)>Nb&&(iA=-(oA=180)),hA[0]=iA,hA[1]=oA,cA=null}function XA(e,t){return(t-=e)<0?t+360:t}function JA(e,t){return e[0]-t[0]}function GA(e,t){return e[0]<=e[1]?e[0]<=t&&t<=e[1]:t<e[0]||e[1]<t}var VA={sphere:ix,point:YA,lineStart:ZA,lineEnd:tS,polygonStart:function(){VA.lineStart=nS,VA.lineEnd=iS},polygonEnd:function(){VA.lineStart=ZA,VA.lineEnd=tS}};function YA(e,t){e*=jb;var n=Hb(t*=jb);KA(n*Hb(e),n*Kb(e),Kb(t))}function KA(e,t,n){++wA,EA+=(e-EA)/wA,DA+=(t-DA)/wA,$A+=(n-$A)/wA}function ZA(){VA.point=QA}function QA(e,t){e*=jb;var n=Hb(t*=jb);zA=n*Hb(e),RA=n*Kb(e),PA=Kb(t),VA.point=eS,KA(zA,RA,PA)}function eS(e,t){e*=jb;var n=Hb(t*=jb),i=n*Hb(e),r=n*Kb(e),o=Kb(t),a=Wb(Qb((a=RA*o-PA*r)*a+(a=PA*i-zA*o)*a+(a=zA*r-RA*i)*a),zA*i+RA*r+PA*o);kA+=a,AA+=a*(zA+(zA=i)),SA+=a*(RA+(RA=r)),MA+=a*(PA+(PA=o)),KA(zA,RA,PA)}function tS(){VA.point=YA}function nS(){VA.point=rS}function iS(){oS(TA,NA),VA.point=YA}function rS(e,t){TA=e,NA=t,e*=jb,t*=jb,VA.point=oS;var n=Hb(t);zA=n*Hb(e),RA=n*Kb(e),PA=Kb(t),KA(zA,RA,PA)}function oS(e,t){e*=jb;var n=Hb(t*=jb),i=n*Hb(e),r=n*Kb(e),o=Kb(t),a=RA*o-PA*r,s=PA*i-zA*o,l=zA*r-RA*i,u=Gb(a,s,l),c=nx(u),f=u&&-c/u;CA.add(f*a),FA.add(f*s),OA.add(f*l),kA+=c,AA+=c*(zA+(zA=i)),SA+=c*(RA+(RA=r)),MA+=c*(PA+(PA=o)),KA(zA,RA,PA)}function aS(e){return e instanceof fc?e:new fc(e)}const sS=Symbol("vega_selection_getter");function lS(e){return e.getter&&e.getter[sS]||(e.getter=(0,m.EP)(e.field),e.getter[sS]=!0),e.getter}const uS="intersect",cS="union",fS="_vgsid_",dS=(0,m.EP)(fS),hS="E",pS="R",mS="R-E",gS="R-LE",yS="R-RE",vS="index:unit";function bS(e,t){for(var n,i,r=t.fields,o=t.values,a=r.length,s=0;s<a;++s)if(n=lS(i=r[s])(e),(0,m.J_)(n)&&(n=(0,m.He)(n)),(0,m.J_)(o[s])&&(o[s]=(0,m.He)(o[s])),(0,m.kJ)(o[s])&&(0,m.J_)(o[s][0])&&(o[s]=o[s].map(m.He)),i.type===hS){if((0,m.kJ)(o[s])?o[s].indexOf(n)<0:n!==o[s])return!1}else if(i.type===pS){if(!(0,m.u5)(n,o[s]))return!1}else if(i.type===yS){if(!(0,m.u5)(n,o[s],!0,!1))return!1}else if(i.type===mS){if(!(0,m.u5)(n,o[s],!1,!1))return!1}else if(i.type===gS&&!(0,m.u5)(n,o[s],!1,!0))return!1;return!0}const xS=He(dS),_S=xS.left,wS=xS.right;var kS={[`${fS}_union`]:function(...e){const t=new fc;for(const n of e)for(const e of n)t.add(e);return t},[`${fS}_intersect`]:function(e,...t){e=new fc(e),t=t.map(aS);e:for(const n of e)for(const i of t)if(!i.has(n)){e.delete(n);continue e}return e},E_union:function(e,t){if(!e.length)return t;for(var n=0,i=t.length;n<i;++n)e.indexOf(t[n])<0&&e.push(t[n]);return e},E_intersect:function(e,t){return e.length?e.filter((e=>t.indexOf(e)>=0)):t},R_union:function(e,t){var n=(0,m.He)(t[0]),i=(0,m.He)(t[1]);return n>i&&(n=t[1],i=t[0]),e.length?(e[0]>n&&(e[0]=n),e[1]<i&&(e[1]=i),e):[n,i]},R_intersect:function(e,t){var n=(0,m.He)(t[0]),i=(0,m.He)(t[1]);return n>i&&(n=t[1],i=t[0]),e.length?i<e[0]||e[1]<n?[]:(e[0]<n&&(e[0]=n),e[1]>i&&(e[1]=i),e):[n,i]}};function ES(e,t,n,i){t[0].type!==pA.t$&&(0,m.vU)("First argument to selection functions must be a string literal.");const r=t[0].value,o="unit",a="@"+o,s=":"+r;(t.length>=2&&(0,m.fj)(t).value)!==uS||(0,m.nr)(i,a)||(i[a]=n.getData(r).indataRef(n,o)),(0,m.nr)(i,s)||(i[s]=n.getData(r).tuplesRef())}function DS(e){const t=this.context.data[e];return t?t.values.value:[]}const $S=e=>function(t,n){return this.context.dataflow.locale()[e](n)(t)},AS=$S("format"),SS=$S("timeFormat"),MS=$S("utcFormat"),CS=$S("timeParse"),FS=$S("utcParse"),OS=new Date(2e3,0,1);function TS(e,t,n){return Number.isInteger(e)&&Number.isInteger(t)?(OS.setYear(2e3),OS.setMonth(e),OS.setDate(t),SS.call(this,OS,n)):""}const NS="%",zS="$";function RS(e,t,n,i){t[0].type!==pA.t$&&(0,m.vU)("First argument to data functions must be a string literal.");const r=t[0].value,o=":"+r;if(!(0,m.nr)(o,i))try{i[o]=n.getData(r).tuplesRef()}catch(a){}}function PS(e,t,n,i){if(t[0].type===pA.t$)LS(n,i,t[0].value);else for(e in n.scales)LS(n,i,e)}function LS(e,t,n){const i=NS+n;if(!(0,m.nr)(t,i))try{t[i]=e.scaleRef(n)}catch(r){}}function US(e,t){if((0,m.mf)(e))return e;if((0,m.HD)(e)){const n=t.scales[e];return n&&function(e){return e&&!0===e[If]}(n.value)?n.value:void 0}}function BS(e,t,n){t.__bandwidth=e=>e&&e.bandwidth?e.bandwidth():0,n._bandwidth=PS,n._range=PS,n._scale=PS;const i=t=>"_["+(t.type===pA.t$?(0,m.m8)(NS+t.value):(0,m.m8)(NS)+"+"+e(t))+"]";return{_bandwidth:e=>`this.__bandwidth(${i(e[0])})`,_range:e=>`${i(e[0])}.range()`,_scale:t=>`${i(t[0])}(${e(t[1])})`}}function jS(e,t){return function(n,i,r){if(n){const t=US(n,(r||this).context);return t&&t.path[e](i)}return t(i)}}const IS=jS("area",(function(e){return gA=new Tb,Ob(e,yA),2*gA})),qS=jS("bounds",(function(e){var t,n,i,r,o,a,s;if(aA=oA=-(iA=rA=1/0),dA=[],Ob(e,LA),n=dA.length){for(dA.sort(JA),t=1,o=[i=dA[0]];t<n;++t)GA(i,(r=dA[t])[0])||GA(i,r[1])?(XA(i[0],r[1])>XA(i[0],i[1])&&(i[1]=r[1]),XA(r[0],i[1])>XA(i[0],i[1])&&(i[0]=r[0])):o.push(i=r);for(a=-1/0,t=0,i=o[n=o.length-1];t<=n;i=r,++t)r=o[t],(s=XA(i[1],r[0]))>a&&(a=s,iA=r[0],oA=i[1])}return dA=hA=null,iA===1/0||rA===1/0?[[NaN,NaN],[NaN,NaN]]:[[iA,rA],[oA,aA]]})),WS=jS("centroid",(function(e){wA=kA=EA=DA=$A=AA=SA=MA=0,CA=new Tb,FA=new Tb,OA=new Tb,Ob(e,VA);var t=+CA,n=+FA,i=+OA,r=Gb(t,n,i);return r<zb&&(t=AA,n=SA,i=MA,kA<Nb&&(t=EA,n=DA,i=$A),(r=Gb(t,n,i))<zb)?[NaN,NaN]:[Wb(n,t)*Bb,nx(i/r)*Bb]}));function HS(e,t,n){try{e[t].apply(e,["EXPRESSION"].concat([].slice.call(n)))}catch(i){e.warn(i)}return n[n.length-1]}function XS(e){const t=e/255;return t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4)}function JS(e){const t=(0,su.B8)(e);return.2126*XS(t.r)+.7152*XS(t.g)+.0722*XS(t.b)}function GS(e,t){return e===t||e!==e&&t!==t||((0,m.kJ)(e)?!(!(0,m.kJ)(t)||e.length!==t.length)&&function(e,t){for(let n=0,i=e.length;n<i;++n)if(!GS(e[n],t[n]))return!1;return!0}(e,t):!(!(0,m.Kn)(e)||!(0,m.Kn)(t))&&VS(e,t))}function VS(e,t){for(const n in e)if(!GS(e[n],t[n]))return!1;return!0}function YS(e){return t=>VS(e,t)}const KS={};function ZS(e){return(0,m.kJ)(e)||ArrayBuffer.isView(e)?e:null}function QS(e){return ZS(e)||((0,m.HD)(e)?e:null)}const eM=e=>e.data;function tM(e,t){const n=DS.call(t,e);return n.root&&n.root.lookup||{}}const nM=()=>"undefined"!==typeof window&&window||null;function iM(e,t,n){if(!e)return[];const[i,r]=e,o=(new Oh).set(i[0],i[1],r[0],r[1]);return xy(n||this.context.dataflow.scenegraph().root,o,function(e){let t=null;if(e){const n=(0,m.IX)(e.marktype),i=(0,m.IX)(e.markname);t=e=>(!n.length||n.some((t=>e.marktype===t)))&&(!i.length||i.some((t=>e.name===t)))}return t}(t))}const rM={random:()=>wo(),cumulativeNormal:To,cumulativeLogNormal:Uo,cumulativeUniform:Ho,densityNormal:Oo,densityLogNormal:Lo,densityUniform:Wo,quantileNormal:No,quantileLogNormal:Bo,quantileUniform:Xo,sampleNormal:Fo,sampleLogNormal:Po,sampleUniform:qo,isArray:m.kJ,isBoolean:m.jn,isDate:m.J_,isDefined:e=>void 0!==e,isNumber:m.hj,isObject:m.Kn,isRegExp:m.Kj,isString:m.HD,isTuple:wr,isValid:e=>null!=e&&e===e,toBoolean:m.sw,toDate:e=>(0,m.ZU)(e),toNumber:m.He,toString:m.BB,indexof:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return QS(e).indexOf(...n)},join:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return ZS(e).join(...n)},lastindexof:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return QS(e).lastIndexOf(...n)},replace:function(e,t,n){return(0,m.mf)(n)&&(0,m.vU)("Function argument passed to replace."),String(e).replace(t,n)},reverse:function(e){return ZS(e).slice().reverse()},slice:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return QS(e).slice(...n)},flush:m.yl,lerp:m.t7,merge:function(){const e=[].slice.call(arguments);return e.unshift({}),(0,m.l7)(...e)},pad:m.vk,peek:m.fj,pluck:function(e,t){const n=KS[t]||(KS[t]=(0,m.EP)(t));return(0,m.kJ)(e)?e.map(n):n(e)},span:m.yP,inrange:m.u5,truncate:m.$G,rgb:su.B8,lab:Bc,hcl:Jc,hsl:su.Ym,luminance:JS,contrast:function(e,t){const n=JS(e),i=JS(t);return(Math.max(n,i)+.05)/(Math.min(n,i)+.05)},sequence:pa,format:AS,utcFormat:MS,utcParse:FS,utcOffset:Pt,utcSequence:Bt,timeFormat:SS,timeParse:CS,timeOffset:Rt,timeSequence:Ut,timeUnitSpecifier:lt,monthFormat:function(e){return TS.call(this,e,1,"%B")},monthAbbrevFormat:function(e){return TS.call(this,e,1,"%b")},dayFormat:function(e){return TS.call(this,0,2+e,"%A")},dayAbbrevFormat:function(e){return TS.call(this,0,2+e,"%a")},quarter:m.mS,utcquarter:m.N3,week:dt,utcweek:vt,dayofyear:ft,utcdayofyear:yt,warn:function(){return HS(this.context.dataflow,"warn",arguments)},info:function(){return HS(this.context.dataflow,"info",arguments)},debug:function(){return HS(this.context.dataflow,"debug",arguments)},extent:e=>(0,m.We)(e),inScope:function(e){const t=this.context.group;let n=!1;if(t)for(;e;){if(e===t){n=!0;break}e=e.mark.group}return n},intersect:iM,clampRange:m.l$,pinchDistance:function(e){const t=e.touches,n=t[0].clientX-t[1].clientX,i=t[0].clientY-t[1].clientY;return Math.hypot(n,i)},pinchAngle:function(e){const t=e.touches;return Math.atan2(t[0].clientY-t[1].clientY,t[0].clientX-t[1].clientX)},screen:function(){const e=nM();return e?e.screen:{}},containerSize:function(){const e=this.context.dataflow,t=e.container&&e.container();return t?[t.clientWidth,t.clientHeight]:[void 0,void 0]},windowSize:function(){const e=nM();return e?[e.innerWidth,e.innerHeight]:[void 0,void 0]},bandspace:function(e,t,n){return mf(e||0,t||0,n||0)},setdata:function(e,t){const n=this.context.dataflow,i=this.context.data[e].input;return n.pulse(i,n.changeset().remove(m.yb).insert(t)),1},pathShape:function(e){let t=null;return function(n){return n?th(n,t=t||Wd(e)):e}},panLinear:m.Dw,panLog:m.mJ,panPow:m.QA,panSymlog:m.Zw,zoomLinear:m.ay,zoomLog:m.dH,zoomPow:m.mK,zoomSymlog:m.bV,encode:function(e,t,n){if(e){const n=this.context.dataflow,i=e.mark.source;n.pulse(i,n.changeset().encode(e,t))}return void 0!==n?n:e},modify:function(e,t,n,i,r,o){const a=this.context.dataflow,s=this.context.data[e],l=s.input,u=a.stamp();let c,f,d=s.changes;if(!1===a._trigger||!(l.value.length||t||i))return 0;if((!d||d.stamp<u)&&(s.changes=d=a.changeset(),d.stamp=u,a.runAfter((()=>{s.modified=!0,a.pulse(l,d).run()}),!0,1)),n&&(c=!0===n?m.yb:(0,m.kJ)(n)||wr(n)?n:YS(n),d.remove(c)),t&&d.insert(t),i&&(c=YS(i),l.value.some(c)?d.remove(c):d.insert(i)),r)for(f in o)d.modify(r,f,o[f]);return 1},lassoAppend:function(e,t,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:5;const r=(e=(0,m.IX)(e))[e.length-1];return void 0===r||Math.hypot(r[0]-t,r[1]-n)>i?[...e,[t,n]]:e},lassoPath:function(e){return(0,m.IX)(e).reduce(((t,n,i)=>{let[r,o]=n;return t+(0==i?`M ${r},${o} `:i===e.length-1?" Z":`L ${r},${o} `)}),"")},intersectLasso:function(e,t,n){const{x:i,y:r,mark:o}=n,a=(new Oh).set(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,Number.MIN_SAFE_INTEGER,Number.MIN_SAFE_INTEGER);for(const[s,l]of t)s<a.x1&&(a.x1=s),s>a.x2&&(a.x2=s),l<a.y1&&(a.y1=l),l>a.y2&&(a.y2=l);return a.translate(i,r),iM([[a.x1,a.y1],[a.x2,a.y2]],e,o).filter((e=>function(e,t,n){let i=0;for(let r=0,o=n.length-1;r<n.length;o=r++){const[a,s]=n[o],[l,u]=n[r];u>t!=s>t&&e<(a-l)*(t-u)/(s-u)+l&&i++}return 1&i}(e.x,e.y,t)))}},oM=["view","item","group","xy","x","y"],aM="this.",sM={},lM={forbidden:["_"],allowed:["datum","event","item"],fieldvar:"datum",globalvar:e=>`_[${(0,m.m8)(zS+e)}]`,functions:function(e){const t=(0,pA.wk)(e);oM.forEach((e=>t[e]="event.vega."+e));for(const n in rM)t[n]=aM+n;return(0,m.l7)(t,BS(e,rM,sM)),t},constants:pA._G,visitors:sM},uM=(0,pA.YP)(lM);function cM(e,t,n){return 1===arguments.length?rM[e]:(rM[e]=t,n&&(sM[e]=n),uM&&(uM.functions[e]=aM+e),this)}function fM(e,t){const n={};let i;try{e=(0,m.HD)(e)?e:(0,m.m8)(e)+"",i=(0,pA.BJ)(e)}catch(o){(0,m.vU)("Expression parse error: "+e)}i.visit((e=>{if(e.type!==pA.Lt)return;const i=e.callee.name,r=lM.visitors[i];r&&r(i,e.arguments,t,n)}));const r=uM(i);return r.globals.forEach((e=>{const i=zS+e;!(0,m.nr)(n,i)&&t.getSignal(e)&&(n[i]=t.signalRef(e))})),{$expr:(0,m.l7)({code:r.code},t.options.ast?{ast:i}:null),$fields:r.fields,$params:n}}cM("bandwidth",(function(e,t){const n=US(e,(t||this).context);return n&&n.bandwidth?n.bandwidth():0}),PS),cM("copy",(function(e,t){const n=US(e,(t||this).context);return n?n.copy():void 0}),PS),cM("domain",(function(e,t){const n=US(e,(t||this).context);return n?n.domain():[]}),PS),cM("range",(function(e,t){const n=US(e,(t||this).context);return n&&n.range?n.range():[]}),PS),cM("invert",(function(e,t,n){const i=US(e,(n||this).context);return i?(0,m.kJ)(t)?(i.invertRange||i.invert)(t):(i.invert||i.invertExtent)(t):void 0}),PS),cM("scale",(function(e,t,n){const i=US(e,(n||this).context);return i?i(t):void 0}),PS),cM("gradient",(function(e,t,n,i,r){e=US(e,(r||this).context);const o=Rd(t,n);let a=e.domain(),s=a[0],l=(0,m.fj)(a),u=m.yR;return l-s?u=id(e,s,l):e=(e.interpolator?Wf("sequential")().interpolator(e.interpolator()):Wf("linear")().interpolate(e.interpolate()).range(e.range())).domain([s=0,l=1]),e.ticks&&(a=e.ticks(+i||15),s!==a[0]&&a.unshift(s),l!==(0,m.fj)(a)&&a.push(l)),a.forEach((t=>o.stop(u(t),e(t)))),o}),PS),cM("geoArea",IS,PS),cM("geoBounds",qS,PS),cM("geoCentroid",WS,PS),cM("geoShape",(function(e,t,n){const i=US(e,(n||this).context);return function(e){return i?i.path.context(e)(t):""}}),PS),cM("geoScale",(function(e,t){const n=US(e,(t||this).context);return n&&n.scale()}),PS),cM("indata",(function(e,t,n){const i=this.context.data[e]["index:"+t],r=i?i.value.get(n):void 0;return r?r.count:r}),(function(e,t,n,i){t[0].type!==pA.t$&&(0,m.vU)("First argument to indata must be a string literal."),t[1].type!==pA.t$&&(0,m.vU)("Second argument to indata must be a string literal.");const r=t[0].value,o=t[1].value,a="@"+o;(0,m.nr)(a,i)||(i[a]=n.getData(r).indataRef(n,o))})),cM("data",DS,RS),cM("treePath",(function(e,t,n){const i=tM(e,this),r=i[t],o=i[n];return r&&o?r.path(o).map(eM):void 0}),RS),cM("treeAncestors",(function(e,t){const n=tM(e,this)[t];return n?n.ancestors().map(eM):void 0}),RS),cM("vlSelectionTest",(function(e,t,n){for(var i,r,o,a,s,l=this.context.data[e],u=l?l.values.value:[],c=l?l[vS]&&l[vS].value:void 0,f=n===uS,d=u.length,h=0;h<d;++h)if(i=u[h],c&&f){if(-1===(o=(r=r||{})[a=i.unit]||0))continue;if(s=bS(t,i),r[a]=s?-1:++o,s&&1===c.size)return!0;if(!s&&o===c.get(a).count)return!1}else if(f^(s=bS(t,i)))return s;return d&&f}),ES),cM("vlSelectionIdTest",(function(e,t,n){const i=this.context.data[e],r=i?i.values.value:[],o=i?i[vS]&&i[vS].value:void 0,a=n===uS,s=dS(t),l=_S(r,s);if(l===r.length)return!1;if(dS(r[l])!==s)return!1;if(o&&a){if(1===o.size)return!0;if(wS(r,s)-l<o.size)return!1}return!0}),ES),cM("vlSelectionResolve",(function(e,t,n,i){for(var r,o,a,s,l,u,c,f,d,h,p,g,y=this.context.data[e],v=y?y.values.value:[],b={},x={},_={},w=v.length,k=0;k<w;++k)if(s=(r=v[k]).unit,o=r.fields,a=r.values,o&&a){for(p=0,g=o.length;p<g;++p)l=o[p],f=(c=b[l.field]||(b[l.field]={}))[s]||(c[s]=[]),_[l.field]=d=l.type.charAt(0),h=kS[`${d}_union`],c[s]=h(f,(0,m.IX)(a[p]));n&&(f=x[s]||(x[s]=[])).push((0,m.IX)(a).reduce(((e,t,n)=>(e[o[n].field]=t,e)),{}))}else l=fS,u=dS(r),(f=(c=b[l]||(b[l]={}))[s]||(c[s]=[])).push(u),n&&(f=x[s]||(x[s]=[])).push({[fS]:u});if(t=t||cS,b[fS]?b[fS]=kS[`${fS}_${t}`](...Object.values(b[fS])):Object.keys(b).forEach((e=>{b[e]=Object.keys(b[e]).map((t=>b[e][t])).reduce(((n,i)=>void 0===n?i:kS[`${_[e]}_${t}`](n,i)))})),v=Object.keys(x),n&&v.length){b[i?"vlPoint":"vlMulti"]=t===cS?{or:v.reduce(((e,t)=>(e.push(...x[t]),e)),[])}:{and:v.map((e=>({or:x[e]})))}}return b}),ES),cM("vlSelectionTuples",(function(e,t){return e.map((e=>(0,m.l7)(t.fields?{values:t.fields.map((t=>lS(t)(e.datum)))}:{[fS]:dS(e.datum)},t)))}));const dM=(0,m.Rg)(["rule"]),hM=(0,m.Rg)(["group","image","rect"]);function pM(e){return(e+"").toLowerCase()}function mM(e,t,n){n.endsWith(";")||(n="return("+n+");");const i=Function(...t.concat(n));return e&&e.functions?i.bind(e.functions):i}var gM={operator:(e,t)=>mM(e,["_"],t.code),parameter:(e,t)=>mM(e,["datum","_"],t.code),event:(e,t)=>mM(e,["event"],t.code),handler:(e,t)=>mM(e,["_","event"],`var datum=event.item&&event.item.datum;return ${t.code};`),encode:(e,t)=>{const{marktype:n,channels:i}=t;let r="var o=item,datum=o.datum,m=0,$;";for(const o in i){const e="o["+(0,m.m8)(o)+"]";r+=`$=${i[o].code};if(${e}!==$)${e}=$,m=1;`}return r+=function(e,t){let n="";return dM[t]||(e.x2&&(e.x?(hM[t]&&(n+="if(o.x>o.x2)$=o.x,o.x=o.x2,o.x2=$;"),n+="o.width=o.x2-o.x;"):n+="o.x=o.x2-(o.width||0);"),e.xc&&(n+="o.x=o.xc-(o.width||0)/2;"),e.y2&&(e.y?(hM[t]&&(n+="if(o.y>o.y2)$=o.y,o.y=o.y2,o.y2=$;"),n+="o.height=o.y2-o.y;"):n+="o.y=o.y2-(o.height||0);"),e.yc&&(n+="o.y=o.yc-(o.height||0)/2;")),n}(i,n),r+="return m;",mM(e,["item","_"],r)},codegen:{get(e){const t=`[${e.map(m.m8).join("][")}]`,n=Function("_",`return _${t};`);return n.path=t,n},comparator(e,t){let n;const i=Function("a","b","var u, v; return "+e.map(((e,i)=>{const r=t[i];let o,a;return e.path?(o=`a${e.path}`,a=`b${e.path}`):((n=n||{})["f"+i]=e,o=`this.f${i}(a)`,a=`this.f${i}(b)`),function(e,t,n,i){return`((u = ${e}) < (v = ${t}) || u == null) && v != null ? ${n}\n : (u > v || v == null) && u != null ? ${i}\n : ((v = v instanceof Date ? +v : v), (u = u instanceof Date ? +u : u)) !== u && v === v ? ${n}\n : v !== v && u === u ? ${i} : `}(o,a,-r,r)})).join("")+"0;");return n?i.bind(n):i}}};function yM(e,t,n){if(!e||!(0,m.Kn)(e))return e;for(let i,r=0,o=vM.length;r<o;++r)if(i=vM[r],(0,m.nr)(e,i.key))return i.parse(e,t,n);return e}var vM=[{key:"$ref",parse:function(e,t){return t.get(e.$ref)||(0,m.vU)("Operator not defined: "+e.$ref)}},{key:"$key",parse:function(e,t){const n="k:"+e.$key+"_"+!!e.$flat;return t.fn[n]||(t.fn[n]=(0,m.Jy)(e.$key,e.$flat,t.expr.codegen))}},{key:"$expr",parse:function(e,t,n){e.$params&&t.parseParameters(e.$params,n);const i="e:"+e.$expr.code;return t.fn[i]||(t.fn[i]=(0,m.ZE)(t.parameterExpression(e.$expr),e.$fields))}},{key:"$field",parse:function(e,t){if(!e.$field)return null;const n="f:"+e.$field+"_"+e.$name;return t.fn[n]||(t.fn[n]=(0,m.EP)(e.$field,e.$name,t.expr.codegen))}},{key:"$encode",parse:function(e,t){const n=e.$encode,i={};for(const r in n){const e=n[r];i[r]=(0,m.ZE)(t.encodeExpression(e.$expr),e.$fields),i[r].output=e.$output}return i}},{key:"$compare",parse:function(e,t){const n="c:"+e.$compare+"_"+e.$order,i=(0,m.IX)(e.$compare).map((e=>e&&e.$tupleid?kr:e));return t.fn[n]||(t.fn[n]=(0,m.qu)(i,e.$order,t.expr.codegen))}},{key:"$context",parse:function(e,t){return t}},{key:"$subflow",parse:function(e,t){const n=e.$subflow;return function(e,i,r){const o=t.fork().parse(n),a=o.get(n.operators[0].id),s=o.signals.parent;return s&&s.set(r),a.detachSubflow=()=>t.detach(o),a}}},{key:"$tupleid",parse:function(){return kr}}];const bM={skip:!0};function xM(e,t,n,i){return new _M(e,t,n,i)}function _M(e,t,n,i){this.dataflow=e,this.transforms=t,this.events=e.events.bind(e),this.expr=i||gM,this.signals={},this.scales={},this.nodes={},this.data={},this.fn={},n&&(this.functions=Object.create(n),this.functions.context=this)}function wM(e){this.dataflow=e.dataflow,this.transforms=e.transforms,this.events=e.events,this.expr=e.expr,this.signals=Object.create(e.signals),this.scales=Object.create(e.scales),this.nodes=Object.create(e.nodes),this.data=Object.create(e.data),this.fn=Object.create(e.fn),e.functions&&(this.functions=Object.create(e.functions),this.functions.context=this)}function kM(e,t){e&&(null==t?e.removeAttribute("aria-label"):e.setAttribute("aria-label",t))}_M.prototype=wM.prototype={fork(){const e=new wM(this);return(this.subcontext||(this.subcontext=[])).push(e),e},detach(e){this.subcontext=this.subcontext.filter((t=>t!==e));const t=Object.keys(e.nodes);for(const n of t)e.nodes[n]._targets=null;for(const n of t)e.nodes[n].detach();e.nodes=null},get(e){return this.nodes[e]},set(e,t){return this.nodes[e]=t},add(e,t){const n=this,i=n.dataflow,r=e.value;if(n.set(e.id,t),function(e){return"collect"===pM(e)}(e.type)&&r&&(r.$ingest?i.ingest(t,r.$ingest,r.$format):r.$request?i.preload(t,r.$request,r.$format):i.pulse(t,i.changeset().insert(r))),e.root&&(n.root=t),e.parent){let r=n.get(e.parent.$ref);r?(i.connect(r,[t]),t.targets().add(r)):(n.unresolved=n.unresolved||[]).push((()=>{r=n.get(e.parent.$ref),i.connect(r,[t]),t.targets().add(r)}))}if(e.signal&&(n.signals[e.signal]=t),e.scale&&(n.scales[e.scale]=t),e.data)for(const o in e.data){const i=n.data[o]||(n.data[o]={});e.data[o].forEach((e=>i[e]=t))}},resolve(){return(this.unresolved||[]).forEach((e=>e())),delete this.unresolved,this},operator(e,t){this.add(e,this.dataflow.add(e.value,t))},transform(e,t){this.add(e,this.dataflow.add(this.transforms[pM(t)]))},stream(e,t){this.set(e.id,t)},update(e,t,n,i,r){this.dataflow.on(t,n,i,r,e.options)},operatorExpression(e){return this.expr.operator(this,e)},parameterExpression(e){return this.expr.parameter(this,e)},eventExpression(e){return this.expr.event(this,e)},handlerExpression(e){return this.expr.handler(this,e)},encodeExpression(e){return this.expr.encode(this,e)},parse:function(e){const t=this,n=e.operators||[];return e.background&&(t.background=e.background),e.eventConfig&&(t.eventConfig=e.eventConfig),e.locale&&(t.locale=e.locale),n.forEach((e=>t.parseOperator(e))),n.forEach((e=>t.parseOperatorParameters(e))),(e.streams||[]).forEach((e=>t.parseStream(e))),(e.updates||[]).forEach((e=>t.parseUpdate(e))),t.resolve()},parseOperator:function(e){const t=this;!function(e){return"operator"===pM(e)}(e.type)&&e.type?t.transform(e,e.type):t.operator(e,e.update?t.operatorExpression(e.update):null)},parseOperatorParameters:function(e){const t=this;if(e.params){const n=t.get(e.id);n||(0,m.vU)("Invalid operator id: "+e.id),t.dataflow.connect(n,n.parameters(t.parseParameters(e.params),e.react,e.initonly))}},parseParameters:function(e,t){t=t||{};const n=this;for(const i in e){const r=e[i];t[i]=(0,m.kJ)(r)?r.map((e=>yM(e,n,t))):yM(r,n,t)}return t},parseStream:function(e){var t,n=this,i=null!=e.filter?n.eventExpression(e.filter):void 0,r=null!=e.stream?n.get(e.stream):void 0;e.source?r=n.events(e.source,e.type,i):e.merge&&(r=(t=e.merge.map((e=>n.get(e))))[0].merge.apply(t[0],t.slice(1))),e.between&&(t=e.between.map((e=>n.get(e))),r=r.between(t[0],t[1])),e.filter&&(r=r.filter(i)),null!=e.throttle&&(r=r.throttle(+e.throttle)),null!=e.debounce&&(r=r.debounce(+e.debounce)),null==r&&(0,m.vU)("Invalid stream definition: "+JSON.stringify(e)),e.consume&&r.consume(!0),n.stream(e,r)},parseUpdate:function(e){var t,n=this,i=(0,m.Kn)(i=e.source)?i.$ref:i,r=n.get(i),o=e.update,a=void 0;r||(0,m.vU)("Source not defined: "+e.source),t=e.target&&e.target.$expr?n.eventExpression(e.target.$expr):n.get(e.target),o&&o.$expr&&(o.$params&&(a=n.parseParameters(o.$params)),o=n.handlerExpression(o.$expr)),n.update(e,r,t,o,a)},getState:function(e){var t=this,n={};if(e.signals){var i=n.signals={};Object.keys(t.signals).forEach((n=>{const r=t.signals[n];e.signals(n,r)&&(i[n]=r.value)}))}if(e.data){var r=n.data={};Object.keys(t.data).forEach((n=>{const i=t.data[n];e.data(n,i)&&(r[n]=i.input.value)}))}return t.subcontext&&!1!==e.recurse&&(n.subcontext=t.subcontext.map((t=>t.getState(e)))),n},setState:function(e){var t=this,n=t.dataflow,i=e.data,r=e.signals;Object.keys(r||{}).forEach((e=>{n.update(t.signals[e],r[e],bM)})),Object.keys(i||{}).forEach((e=>{n.pulse(t.data[e].input,n.changeset().remove(m.yb).insert(i[e]))})),(e.subcontext||[]).forEach(((e,n)=>{const i=t.subcontext[n];i&&i.setState(e)}))}};const EM="default";function DM(e,t){const n=e.globalCursor()?"undefined"!==typeof document&&document.body:e.container();if(n)return null==t?n.style.removeProperty("cursor"):n.style.cursor=t}function $M(e,t){var n=e._runtime.data;return(0,m.nr)(n,t)||(0,m.vU)("Unrecognized data set: "+t),n[t]}function AM(e,t){Cr(t)||(0,m.vU)("Second argument to changes must be a changeset.");const n=$M(this,e);return n.modified=!0,this.pulse(n.input,t)}function SM(e){var t=e.padding();return Math.max(0,e._viewWidth+t.left+t.right)}function MM(e){var t=e.padding();return Math.max(0,e._viewHeight+t.top+t.bottom)}function CM(e){var t=e.padding(),n=e._origin;return[t.left+n[0],t.top+n[1]]}function FM(e,t,n){var i,r,o=e._renderer,a=o&&o.canvas();return a&&(r=CM(e),(i=Wm(t.changedTouches?t.changedTouches[0]:t,a))[0]-=r[0],i[1]-=r[1]),t.dataflow=e,t.item=n,t.vega=function(e,t,n){const i=t?"group"===t.mark.marktype?t:t.mark.group:null;function r(e){var n,r=i;if(e)for(n=t;n;n=n.mark.group)if(n.mark.name===e){r=n;break}return r&&r.mark&&r.mark.interactive?r:{}}function o(e){if(!e)return n;(0,m.HD)(e)&&(e=r(e));const t=n.slice();for(;e;)t[0]-=e.x||0,t[1]-=e.y||0,e=e.mark&&e.mark.group;return t}return{view:(0,m.a9)(e),item:(0,m.a9)(t||{}),group:r,xy:o,x:e=>o(e)[0],y:e=>o(e)[1]}}(e,n,i),t}const OM="view",TM={trap:!1};function NM(e,t,n,i){e._eventListeners.push({type:n,sources:(0,m.IX)(t),handler:i})}function zM(e,t,n){const i=e._eventConfig&&e._eventConfig[t];return!(!1===i||(0,m.Kn)(i)&&!i[n])||(e.warn(`Blocked ${t} ${n} event listener.`),!1)}function RM(e){return e.item}function PM(e){return e.item.mark.source}function LM(e){return function(t,n){return n.vega.view().changeset().encode(n.item,e)}}function UM(e,t,n){const i=document.createElement(e);for(const r in t)i.setAttribute(r,t[r]);return null!=n&&(i.textContent=n),i}const BM="vega-bind",jM="vega-bind-name",IM="vega-bind-radio";function qM(e,t,n,i){const r=n.event||"input",o=()=>e.update(t.value);i.signal(n.signal,t.value),t.addEventListener(r,o),NM(i,t,r,o),e.set=e=>{t.value=e,t.dispatchEvent(function(e){return"undefined"!==typeof Event?new Event(e):{type:e}}(r))}}function WM(e,t,n,i){const r=i.signal(n.signal),o=UM("div",{class:BM}),a="radio"===n.input?o:o.appendChild(UM("label"));a.appendChild(UM("span",{class:jM},n.name||n.signal)),t.appendChild(o);let s=HM;switch(n.input){case"checkbox":s=XM;break;case"select":s=JM;break;case"radio":s=GM;break;case"range":s=VM}s(e,a,n,r)}function HM(e,t,n,i){const r=UM("input");for(const o in n)"signal"!==o&&"element"!==o&&r.setAttribute("input"===o?"type":o,n[o]);r.setAttribute("name",n.signal),r.value=i,t.appendChild(r),r.addEventListener("input",(()=>e.update(r.value))),e.elements=[r],e.set=e=>r.value=e}function XM(e,t,n,i){const r={type:"checkbox",name:n.signal};i&&(r.checked=!0);const o=UM("input",r);t.appendChild(o),o.addEventListener("change",(()=>e.update(o.checked))),e.elements=[o],e.set=e=>o.checked=!!e||null}function JM(e,t,n,i){const r=UM("select",{name:n.signal}),o=n.labels||[];n.options.forEach(((e,t)=>{const n={value:e};YM(e,i)&&(n.selected=!0),r.appendChild(UM("option",n,(o[t]||e)+""))})),t.appendChild(r),r.addEventListener("change",(()=>{e.update(n.options[r.selectedIndex])})),e.elements=[r],e.set=e=>{for(let t=0,i=n.options.length;t<i;++t)if(YM(n.options[t],e))return void(r.selectedIndex=t)}}function GM(e,t,n,i){const r=UM("span",{class:IM}),o=n.labels||[];t.appendChild(r),e.elements=n.options.map(((t,a)=>{const s={type:"radio",name:n.signal,value:t};YM(t,i)&&(s.checked=!0);const l=UM("input",s);l.addEventListener("change",(()=>e.update(t)));const u=UM("label",{},(o[a]||t)+"");return u.prepend(l),r.appendChild(u),l})),e.set=t=>{const n=e.elements,i=n.length;for(let e=0;e<i;++e)YM(n[e].value,t)&&(n[e].checked=!0)}}function VM(e,t,n,i){i=void 0!==i?i:(+n.max+ +n.min)/2;const r=null!=n.max?n.max:Math.max(100,+i)||100,o=n.min||Math.min(0,r,+i)||0,a=n.step||U(o,r,100),s=UM("input",{type:"range",name:n.signal,min:o,max:r,step:a});s.value=i;const l=UM("span",{},+i);t.appendChild(s),t.appendChild(l);const u=()=>{l.textContent=s.value,e.update(+s.value)};s.addEventListener("input",u),s.addEventListener("change",u),e.elements=[s],e.set=e=>{s.value=e,l.textContent=e}}function YM(e,t){return e===t||e+""===t+""}function KM(e,t,n,i,r,o){return(t=t||new i(e.loader())).initialize(n,SM(e),MM(e),CM(e),r,o).background(e.background())}function ZM(e,t){return t?function(){try{t.apply(this,arguments)}catch(n){e.error(n)}}:null}function QM(e,t,n){if("string"===typeof t){if("undefined"===typeof document)return e.error("DOM document instance not found."),null;if(!(t=document.querySelector(t)))return e.error("Signal bind element not found: "+t),null}if(t&&n)try{t.textContent=""}catch(i){t=null,e.error(i)}return t}const eC=e=>+e||0;function tC(e){return(0,m.Kn)(e)?{top:eC(e.top),bottom:eC(e.bottom),left:eC(e.left),right:eC(e.right)}:(e=>({top:e,bottom:e,left:e,right:e}))(eC(e))}async function nC(e,t,n,i){const r=by(t),o=r&&r.headless;return o||(0,m.vU)("Unrecognized renderer type: "+t),await e.runAsync(),KM(e,null,null,o,n,i).renderAsync(e._scenegraph.root)}var iC="width",rC="height",oC="padding",aC={skip:!0};function sC(e,t){var n=e.autosize(),i=e.padding();return t-(n&&n.contains===oC?i.left+i.right:0)}function lC(e,t){var n=e.autosize(),i=e.padding();return t-(n&&n.contains===oC?i.top+i.bottom:0)}function uC(e,t){return t.modified&&(0,m.kJ)(t.input.value)&&!e.startsWith("_:vega:_")}function cC(e,t){return!("parent"===e||t instanceof io.proxy)}function fC(e,t,n,i){const r=e.element();r&&r.setAttribute("title",function(e){return null==e?"":(0,m.kJ)(e)?dC(e):(0,m.Kn)(e)&&!(0,m.J_)(e)?(t=e,Object.keys(t).map((e=>{const n=t[e];return e+": "+((0,m.kJ)(n)?dC(n):hC(n))})).join("\n")):e+"";var t}(i))}function dC(e){return"["+e.map(hC).join(", ")+"]"}function hC(e){return(0,m.kJ)(e)?"[\u2026]":(0,m.Kn)(e)&&!(0,m.J_)(e)?"{\u2026}":e}function pC(e,t){const n=this;if(t=t||{},eo.call(n),t.loader&&n.loader(t.loader),t.logger&&n.logger(t.logger),null!=t.logLevel&&n.logLevel(t.logLevel),t.locale||e.locale){const i=(0,m.l7)({},e.locale,t.locale);n.locale(Ii(i.number,i.time))}n._el=null,n._elBind=null,n._renderType=t.renderer||yy.Canvas,n._scenegraph=new Pm;const i=n._scenegraph.root;n._renderer=null,n._tooltip=t.tooltip||fC,n._redraw=!0,n._handler=(new pg).scene(i),n._globalCursor=!1,n._preventDefault=!1,n._timers=[],n._eventListeners=[],n._resizeListeners=[],n._eventConfig=function(e){const t=(0,m.l7)({defaults:{}},e),n=(e,t)=>{t.forEach((t=>{(0,m.kJ)(e[t])&&(e[t]=(0,m.Rg)(e[t]))}))};return n(t.defaults,["prevent","allow"]),n(t,["view","window","selector"]),t}(e.eventConfig),n.globalCursor(n._eventConfig.globalCursor);const r=function(e,t,n){return xM(e,io,rM,n).parse(t)}(n,e,t.expr);n._runtime=r,n._signals=r.signals,n._bind=(e.bindings||[]).map((e=>({state:null,param:(0,m.l7)({},e)}))),r.root&&r.root.set(i),i.source=r.data.root.input,n.pulse(r.data.root.input,n.changeset().insert(i.items)),n._width=n.width(),n._height=n.height(),n._viewWidth=sC(n,n._width),n._viewHeight=lC(n,n._height),n._origin=[0,0],n._resize=0,n._autosize=1,function(e){var t=e._signals,n=t[iC],i=t[rC],r=t[oC];function o(){e._autosize=e._resize=1}e._resizeWidth=e.add(null,(t=>{e._width=t.size,e._viewWidth=sC(e,t.size),o()}),{size:n}),e._resizeHeight=e.add(null,(t=>{e._height=t.size,e._viewHeight=lC(e,t.size),o()}),{size:i});const a=e.add(null,o,{pad:r});e._resizeWidth.rank=n.rank+1,e._resizeHeight.rank=i.rank+1,a.rank=r.rank+1}(n),function(e){e.add(null,(t=>(e._background=t.bg,e._resize=1,t.bg)),{bg:e._signals.background})}(n),function(e){const t=e._signals.cursor||(e._signals.cursor=e.add({user:EM,item:null}));e.on(e.events("view","pointermove"),t,((e,n)=>{const i=t.value,r=i?(0,m.HD)(i)?i:i.user:EM,o=n.item&&n.item.cursor||null;return i&&r===i.user&&o==i.item?i:{user:r,item:o}})),e.add(null,(function(t){let n=t.cursor,i=this.value;return(0,m.HD)(n)||(i=n.item,n=n.user),DM(e,n&&n!==EM?n:i||n),i}),{cursor:t})}(n),n.description(e.description),t.hover&&n.hover(),t.container&&n.initialize(t.container,t.bind),t.watchPixelRatio&&n._watchPixelRatio()}function mC(e,t){return(0,m.nr)(e._signals,t)?e._signals[t]:(0,m.vU)("Unrecognized signal name: "+(0,m.m8)(t))}function gC(e,t){const n=(e._targets||[]).filter((e=>e._update&&e._update.handler===t));return n.length?n[0]:null}function yC(e,t,n,i){let r=gC(n,i);return r||(r=ZM(e,(()=>i(t,n.value))),r.handler=i,e.on(n,null,r)),e}function vC(e,t,n){const i=gC(t,n);return i&&t._targets.remove(i),e}(0,m.XW)(pC,eo,{async evaluate(e,t,n){if(await eo.prototype.evaluate.call(this,e,t),this._redraw||this._resize)try{this._renderer&&(this._resize&&(this._resize=0,function(e){var t=CM(e),n=SM(e),i=MM(e);e._renderer.background(e.background()),e._renderer.resize(n,i,t),e._handler.origin(t),e._resizeListeners.forEach((t=>{try{t(n,i)}catch(r){e.error(r)}}))}(this)),await this._renderer.renderAsync(this._scenegraph.root)),this._redraw=!1}catch(i){this.error(i)}return n&&br(this,n),this},dirty(e){this._redraw=!0,this._renderer&&this._renderer.dirty(e)},description(e){if(arguments.length){const t=null!=e?e+"":null;return t!==this._desc&&kM(this._el,this._desc=t),this}return this._desc},container(){return this._el},scenegraph(){return this._scenegraph},origin(){return this._origin.slice()},signal(e,t,n){const i=mC(this,e);return 1===arguments.length?i.value:this.update(i,t,n)},width(e){return arguments.length?this.signal("width",e):this.signal("width")},height(e){return arguments.length?this.signal("height",e):this.signal("height")},padding(e){return arguments.length?this.signal("padding",tC(e)):tC(this.signal("padding"))},autosize(e){return arguments.length?this.signal("autosize",e):this.signal("autosize")},background(e){return arguments.length?this.signal("background",e):this.signal("background")},renderer(e){return arguments.length?(by(e)||(0,m.vU)("Unrecognized renderer type: "+e),e!==this._renderType&&(this._renderType=e,this._resetRenderer()),this):this._renderType},tooltip(e){return arguments.length?(e!==this._tooltip&&(this._tooltip=e,this._resetRenderer()),this):this._tooltip},loader(e){return arguments.length?(e!==this._loader&&(eo.prototype.loader.call(this,e),this._resetRenderer()),this):this._loader},resize(){return this._autosize=1,this.touch(mC(this,"autosize"))},_resetRenderer(){this._renderer&&(this._renderer=null,this.initialize(this._el,this._elBind))},_resizeView:function(e,t,n,i,r,o){this.runAfter((a=>{let s=0;a._autosize=0,a.width()!==n&&(s=1,a.signal(iC,n,aC),a._resizeWidth.skip(!0)),a.height()!==i&&(s=1,a.signal(rC,i,aC),a._resizeHeight.skip(!0)),a._viewWidth!==e&&(a._resize=1,a._viewWidth=e),a._viewHeight!==t&&(a._resize=1,a._viewHeight=t),a._origin[0]===r[0]&&a._origin[1]===r[1]||(a._resize=1,a._origin=r),s&&a.run("enter"),o&&a.runAfter((e=>e.resize()))}),!1,1)},addEventListener(e,t,n){let i=t;return n&&!1===n.trap||(i=ZM(this,t),i.raw=t),this._handler.on(e,i),this},removeEventListener(e,t){for(var n,i,r=this._handler.handlers(e),o=r.length;--o>=0;)if(i=r[o].type,n=r[o].handler,e===i&&(t===n||t===n.raw)){this._handler.off(i,n);break}return this},addResizeListener(e){const t=this._resizeListeners;return t.includes(e)||t.push(e),this},removeResizeListener(e){var t=this._resizeListeners,n=t.indexOf(e);return n>=0&&t.splice(n,1),this},addSignalListener(e,t){return yC(this,e,mC(this,e),t)},removeSignalListener(e,t){return vC(this,mC(this,e),t)},addDataListener(e,t){return yC(this,e,$M(this,e).values,t)},removeDataListener(e,t){return vC(this,$M(this,e).values,t)},globalCursor(e){if(arguments.length){if(this._globalCursor!==!!e){const t=DM(this,null);this._globalCursor=!!e,t&&DM(this,t)}return this}return this._globalCursor},preventDefault(e){return arguments.length?(this._preventDefault=e,this):this._preventDefault},timer:function(e,t){this._timers.push(function(e,t,n){var i=new Rk.B7,r=t;return null==t?(i.restart(e,t,n),i):(i._restart=i.restart,i.restart=function(e,t,n){t=+t,n=null==n?(0,Rk.zO)():+n,i._restart((function o(a){a+=r,i._restart(o,r+=t,n),e(a)}),t,n)},i.restart(e,t,n),i)}((function(t){e({timestamp:Date.now(),elapsed:t})}),t))},events:function(e,t,n){var i,r=this,o=new Ur(n),a=function(n,i){r.runAsync(null,(()=>{e===OM&&function(e,t){var n=e._eventConfig.defaults,i=n.prevent,r=n.allow;return!1!==i&&!0!==r&&(!0===i||!1===r||(i?i[t]:r?!r[t]:e.preventDefault()))}(r,t)&&n.preventDefault(),o.receive(FM(r,n,i))}))};if("timer"===e)zM(r,"timer",t)&&r.timer(a,t);else if(e===OM)zM(r,"view",t)&&r.addEventListener(t,a,TM);else if("window"===e?zM(r,"window",t)&&"undefined"!==typeof window&&(i=[window]):"undefined"!==typeof document&&zM(r,"selector",t)&&(i=Array.from(document.querySelectorAll(e))),i){for(var s=0,l=i.length;s<l;++s)i[s].addEventListener(t,a);NM(r,i,t,a)}else r.warn("Can not resolve event source: "+e);return o},finalize:function(){var e,t,n,i=this._tooltip,r=this._timers,o=this._eventListeners;for(e=r.length;--e>=0;)r[e].stop();for(e=o.length;--e>=0;)for(t=(n=o[e]).sources.length;--t>=0;)n.sources[t].removeEventListener(n.type,n.handler);return i&&i.call(this,this._handler,null,null,null),this},hover:function(e,t){return t=[t||"update",(e=[e||"hover"])[0]],this.on(this.events("view","pointerover",RM),PM,LM(e)),this.on(this.events("view","pointerout",RM),PM,LM(t)),this},data:function(e,t){return arguments.length<2?$M(this,e).values.value:AM.call(this,e,Fr().remove(m.yb).insert(t))},change:AM,insert:function(e,t){return AM.call(this,e,Fr().insert(t))},remove:function(e,t){return AM.call(this,e,Fr().remove(t))},scale:function(e){var t=this._runtime.scales;return(0,m.nr)(t,e)||(0,m.vU)("Unrecognized scale or projection: "+e),t[e].value},initialize:function(e,t){const n=this,i=n._renderType,r=n._eventConfig.bind,o=by(i);e=n._el=e?QM(n,e,!0):null,function(e){const t=e.container();t&&(t.setAttribute("role","graphics-document"),t.setAttribute("aria-roleDescription","visualization"),kM(t,e.description()))}(n),o||n.error("Unrecognized renderer type: "+i);const a=o.handler||pg,s=e?o.renderer:o.headless;return n._renderer=s?KM(n,n._renderer,e,s):null,n._handler=function(e,t,n,i){const r=new i(e.loader(),ZM(e,e.tooltip())).scene(e.scenegraph().root).initialize(n,CM(e),e);return t&&t.handlers().forEach((e=>{r.on(e.type,e.handler)})),r}(n,n._handler,e,a),n._redraw=!0,e&&"none"!==r&&(t=t?n._elBind=QM(n,t,!0):e.appendChild(UM("form",{class:"vega-bindings"})),n._bind.forEach((e=>{e.param.element&&"container"!==r&&(e.element=QM(n,e.param.element,!!e.param.input))})),n._bind.forEach((e=>{!function(e,t,n){if(!t)return;const i=n.param;let r=n.state;r||(r=n.state={elements:null,active:!1,set:null,update:t=>{t!=e.signal(i.signal)&&e.runAsync(null,(()=>{r.source=!0,e.signal(i.signal,t)}))}},i.debounce&&(r.update=(0,m.Ds)(i.debounce,r.update))),(null==i.input&&i.element?qM:WM)(r,t,i,e),r.active||(e.on(e._signals[i.signal],null,(()=>{r.source?r.source=!1:r.set(e.signal(i.signal))})),r.active=!0)}(n,e.element||t,e)}))),n},toImageURL:async function(e,t){e!==yy.Canvas&&e!==yy.SVG&&e!==yy.PNG&&(0,m.vU)("Unrecognized image type: "+e);const n=await nC(this,e,t);return e===yy.SVG?function(e,t){const n=new Blob([e],{type:t});return window.URL.createObjectURL(n)}(n.svg(),"image/svg+xml"):n.canvas().toDataURL("image/png")},toCanvas:async function(e,t){return(await nC(this,yy.Canvas,e,t)).canvas()},toSVG:async function(e){return(await nC(this,yy.SVG,e)).svg()},getState:function(e){return this._runtime.getState(e||{data:uC,signals:cC,recurse:!0})},setState:function(e){return this.runAsync(null,(t=>{t._trigger=!1,t._runtime.setState(e)}),(e=>{e._trigger=!0})),this},_watchPixelRatio:function(){if("canvas"===this.renderer()&&this._renderer._canvas){let e=null;const t=()=>{null!=e&&e();const n=matchMedia(`(resolution: ${window.devicePixelRatio}dppx)`);n.addEventListener("change",t),e=()=>{n.removeEventListener("change",t)},this._renderer._canvas.getContext("2d").pixelRatio=window.devicePixelRatio||1,this._redraw=!0,this._resize=1,this.resize().runAsync()};t()}}});var bC=n(52847);function xC(e){return(0,m.Kn)(e)?e:{type:e||"pad"}}const _C=e=>+e||0,wC=e=>({top:e,bottom:e,left:e,right:e});function kC(e){return(0,m.Kn)(e)?e.signal?e:{top:_C(e.top),bottom:_C(e.bottom),left:_C(e.left),right:_C(e.right)}:wC(_C(e))}const EC=e=>(0,m.Kn)(e)&&!(0,m.kJ)(e)?(0,m.l7)({},e):{value:e};function DC(e,t,n,i){if(null!=n){return(0,m.Kn)(n)&&!(0,m.kJ)(n)||(0,m.kJ)(n)&&n.length&&(0,m.Kn)(n[0])?e.update[t]=n:e[i||"enter"][t]={value:n},1}return 0}function $C(e,t,n){for(const i in t)DC(e,i,t[i]);for(const i in n)DC(e,i,n[i],"update")}function AC(e,t,n){for(const i in t)n&&(0,m.nr)(n,i)||(e[i]=(0,m.l7)(e[i]||{},t[i]));return e}function SC(e,t){return t&&(t.enter&&t.enter[e]||t.update&&t.update[e])}const MC="mark",CC="frame",FC="scope",OC="axis",TC="axis-domain",NC="axis-grid",zC="axis-label",RC="axis-tick",PC="axis-title",LC="legend",UC="legend-band",BC="legend-entry",jC="legend-gradient",IC="legend-label",qC="legend-symbol",WC="legend-title",HC="title",XC="title-text",JC="title-subtitle";function GC(e,t,n){e[t]=n&&n.signal?{signal:n.signal}:{value:n}}const VC=e=>(0,m.HD)(e)?(0,m.m8)(e):e.signal?`(${e.signal})`:QC(e);function YC(e){if(null!=e.gradient)return function(e){const t=[e.start,e.stop,e.count].map((e=>null==e?null:(0,m.m8)(e)));for(;t.length&&null==(0,m.fj)(t);)t.pop();return t.unshift(VC(e.gradient)),`gradient(${t.join(",")})`}(e);let t=e.signal?`(${e.signal})`:e.color?function(e){return e.c?KC("hcl",e.h,e.c,e.l):e.h||e.s?KC("hsl",e.h,e.s,e.l):e.l||e.a?KC("lab",e.l,e.a,e.b):e.r||e.g||e.b?KC("rgb",e.r,e.g,e.b):null}(e.color):null!=e.field?QC(e.field):void 0!==e.value?(0,m.m8)(e.value):void 0;return null!=e.scale&&(t=function(e,t){const n=VC(e.scale);null!=e.range?t=`lerp(_range(${n}), ${+e.range})`:(void 0!==t&&(t=`_scale(${n}, ${t})`),e.band&&(t=(t?t+"+":"")+`_bandwidth(${n})`+(1===+e.band?"":"*"+ZC(e.band)),e.extra&&(t=`(datum.extra ? _scale(${n}, datum.extra.value) : ${t})`)),null==t&&(t="0"));return t}(e,t)),void 0===t&&(t=null),null!=e.exponent&&(t=`pow(${t},${ZC(e.exponent)})`),null!=e.mult&&(t+=`*${ZC(e.mult)}`),null!=e.offset&&(t+=`+${ZC(e.offset)}`),e.round&&(t=`round(${t})`),t}const KC=(e,t,n,i)=>`(${e}(${[t,n,i].map(YC).join(",")})+'')`;function ZC(e){return(0,m.Kn)(e)?"("+YC(e)+")":e}function QC(e){return eF((0,m.Kn)(e)?e:{datum:e})}function eF(e){let t,n,i;if(e.signal)t="datum",i=e.signal;else if(e.group||e.parent){for(n=Math.max(1,e.level||1),t="item";n-- >0;)t+=".mark.group";e.parent?(i=e.parent,t+=".datum"):i=e.group}else e.datum?(t="datum",i=e.datum):(0,m.vU)("Invalid field reference: "+(0,m.m8)(e));return e.signal||(i=(0,m.HD)(i)?(0,m._k)(i).map(m.m8).join("]["):eF(i)),t+"["+i+"]"}function tF(e,t,n,i,r,o){const a={};(o=o||{}).encoders={$encode:a},e=function(e,t,n,i,r){const o={},a={};let s,l,u,c;for(l in l="lineBreak","text"!==t||null==r[l]||SC(l,e)||GC(o,l,r[l]),("legend"==n||String(n).startsWith("axis"))&&(n=null),c=n===CC?r.group:n===MC?(0,m.l7)({},r.mark,r[t]):null,c)u=SC(l,e)||("fill"===l||"stroke"===l)&&(SC("fill",e)||SC("stroke",e)),u||GC(o,l,c[l]);for(l in(0,m.IX)(i).forEach((t=>{const n=r.style&&r.style[t];for(const i in n)SC(i,e)||GC(o,i,n[i])})),e=(0,m.l7)({},e),o)c=o[l],c.signal?(s=s||{})[l]=c:a[l]=c;return e.enter=(0,m.l7)(a,e.enter),s&&(e.update=(0,m.l7)(s,e.update)),e}(e,t,n,i,r.config);for(const s in e)a[s]=nF(e[s],t,o,r);return o}function nF(e,t,n,i){const r={},o={};for(const s in e)null!=e[s]&&(r[s]=iF((a=e[s],(0,m.kJ)(a)?function(e){let t="";return e.forEach((e=>{const n=YC(e);t+=e.test?`(${e.test})?${n}:`:n})),":"===(0,m.fj)(t)&&(t+="null"),t}(a):YC(a)),i,n,o));var a;return{$expr:{marktype:t,channels:r},$fields:Object.keys(o),$output:Object.keys(e)}}function iF(e,t,n,i){const r=fM(e,t);return r.$fields.forEach((e=>i[e]=1)),(0,m.l7)(n,r.$params),r.$expr}const rF="outer",oF=["value","update","init","react","bind"];function aF(e,t){(0,m.vU)(e+' for "outer" push: '+(0,m.m8)(t))}function sF(e,t){const n=e.name;if(e.push===rF)t.signals[n]||aF("No prior signal definition",n),oF.forEach((t=>{void 0!==e[t]&&aF("Invalid property ",t)}));else{const i=t.addSignal(n,e.value);!1===e.react&&(i.react=!1),e.bind&&t.addBinding(n,e.bind)}}function lF(e,t,n,i){this.id=-1,this.type=e,this.value=t,this.params=n,i&&(this.parent=i)}function uF(e,t,n,i){return new lF(e,t,n,i)}function cF(e,t){return uF("operator",e,t)}function fF(e){const t={$ref:e.id};return e.id<0&&(e.refs=e.refs||[]).push(t),t}function dF(e,t){return t?{$field:e,$name:t}:{$field:e}}const hF=dF("key");function pF(e,t){return{$compare:e,$order:t}}const mF="descending";function gF(e,t){return(e&&e.signal?"$"+e.signal:e||"")+(e&&t?"_":"")+(t&&t.signal?"$"+t.signal:t||"")}const yF="scope",vF="view";function bF(e){return e&&e.signal}function xF(e){if(bF(e))return!0;if((0,m.Kn)(e))for(const t in e)if(xF(e[t]))return!0;return!1}function _F(e,t){return null!=e?e:t}function wF(e){return e&&e.signal||e}const kF="timer";function EF(e,t){return(e.merge?DF:e.stream?$F:e.type?AF:(0,m.vU)("Invalid stream specification: "+(0,m.m8)(e)))(e,t)}function DF(e,t){const n=e.merge.map((e=>EF(e,t))),i=SF({merge:n},e,t);return t.addStream(i).id}function $F(e,t){const n=SF({stream:EF(e.stream,t)},e,t);return t.addStream(n).id}function AF(e,t){let n;e.type===kF?(n=t.event(kF,e.throttle),e={between:e.between,filter:e.filter}):n=t.event(function(e){return e===yF?vF:e||vF}(e.source),e.type);const i=SF({stream:n},e,t);return 1===Object.keys(i).length?n:t.addStream(i).id}function SF(e,t,n){let i=t.between;return i&&(2!==i.length&&(0,m.vU)('Stream "between" parameter must have 2 entries: '+(0,m.m8)(t)),e.between=[EF(i[0],n),EF(i[1],n)]),i=t.filter?[].concat(t.filter):[],(t.marktype||t.markname||t.markrole)&&i.push(function(e,t,n){const i="event.item";return i+(e&&"*"!==e?"&&"+i+".mark.marktype==='"+e+"'":"")+(n?"&&"+i+".mark.role==='"+n+"'":"")+(t?"&&"+i+".mark.name==='"+t+"'":"")}(t.marktype,t.markname,t.markrole)),t.source===yF&&i.push("inScope(event.item)"),i.length&&(e.filter=fM("("+i.join(")&&(")+")",n).$expr),null!=(i=t.throttle)&&(e.throttle=+i),null!=(i=t.debounce)&&(e.debounce=+i),t.consume&&(e.consume=!0),e}const MF={code:"_.$value",ast:{type:"Identifier",value:"value"}};function CF(e,t,n){const i=e.encode,r={target:n};let o=e.events,a=e.update,s=[];o||(0,m.vU)("Signal update missing events specification."),(0,m.HD)(o)&&(o=(0,bC.r)(o,t.isSubscope()?yF:vF)),o=(0,m.IX)(o).filter((e=>e.signal||e.scale?(s.push(e),0):1)),s.length>1&&(s=[FF(s)]),o.length&&s.push(o.length>1?{merge:o}:o[0]),null!=i&&(a&&(0,m.vU)("Signal encode and update are mutually exclusive."),a="encode(item(),"+(0,m.m8)(i)+")"),r.update=(0,m.HD)(a)?fM(a,t):null!=a.expr?fM(a.expr,t):null!=a.value?a.value:null!=a.signal?{$expr:MF,$params:{$value:t.signalRef(a.signal)}}:(0,m.vU)("Invalid signal update specification."),e.force&&(r.options={force:!0}),s.forEach((e=>t.addUpdate((0,m.l7)(function(e,t){return{source:e.signal?t.signalRef(e.signal):e.scale?t.scaleRef(e.scale):EF(e,t)}}(e,t),r))))}function FF(e){return{signal:"["+e.map((e=>e.scale?'scale("'+e.scale+'")':e.signal))+"]"}}const OF=e=>(t,n,i)=>uF(e,n,t||void 0,i),TF=OF("aggregate"),NF=OF("axisticks"),zF=OF("bound"),RF=OF("collect"),PF=OF("compare"),LF=OF("datajoin"),UF=OF("encode"),BF=OF("expression"),jF=OF("facet"),IF=OF("field"),qF=OF("key"),WF=OF("legendentries"),HF=OF("load"),XF=OF("mark"),JF=OF("multiextent"),GF=OF("multivalues"),VF=OF("overlap"),YF=OF("params"),KF=OF("prefacet"),ZF=OF("projection"),QF=OF("proxy"),eO=OF("relay"),tO=OF("render"),nO=OF("scale"),iO=OF("sieve"),rO=OF("sortitems"),oO=OF("viewlayout"),aO=OF("values");let sO=0;const lO={min:"min",max:"max",count:"sum"};function uO(e,t){const n=t.getScale(e.name).params;let i;for(i in n.domain=hO(e.domain,e,t),null!=e.range&&(n.range=_O(e,t,n)),null!=e.interpolate&&function(e,t){t.interpolate=cO(e.type||e),null!=e.gamma&&(t.interpolateGamma=cO(e.gamma))}(e.interpolate,n),null!=e.nice&&(n.nice=function(e){return(0,m.Kn)(e)?{interval:cO(e.interval),step:cO(e.step)}:cO(e)}(e.nice)),null!=e.bins&&(n.bins=function(e,t){return e.signal||(0,m.kJ)(e)?fO(e,t):t.objectProperty(e)}(e.bins,t)),e)(0,m.nr)(n,i)||"name"===i||(n[i]=cO(e[i],t))}function cO(e,t){return(0,m.Kn)(e)?e.signal?t.signalRef(e.signal):(0,m.vU)("Unsupported object: "+(0,m.m8)(e)):e}function fO(e,t){return e.signal?t.signalRef(e.signal):e.map((e=>cO(e,t)))}function dO(e){(0,m.vU)("Can not find data set: "+(0,m.m8)(e))}function hO(e,t,n){if(e)return e.signal?n.signalRef(e.signal):((0,m.kJ)(e)?pO:e.fields?gO:mO)(e,t,n);null==t.domainMin&&null==t.domainMax||(0,m.vU)("No scale domain defined for domainMin/domainMax to override.")}function pO(e,t,n){return e.map((e=>cO(e,n)))}function mO(e,t,n){const i=n.getData(e.data);return i||dO(e.data),Gf(t.type)?i.valuesRef(n,e.field,vO(e.sort,!1)):Zf(t.type)?i.domainRef(n,e.field):i.extentRef(n,e.field)}function gO(e,t,n){const i=e.data,r=e.fields.reduce(((e,t)=>(t=(0,m.HD)(t)?{data:i,field:t}:(0,m.kJ)(t)||t.signal?function(e,t){const n="_:vega:_"+sO++,i=RF({});if((0,m.kJ)(e))i.value={$ingest:e};else if(e.signal){const r="setdata("+(0,m.m8)(n)+","+e.signal+")";i.params.input=t.signalRef(r)}return t.addDataPipeline(n,[i,iO({})]),{data:n,field:"data"}}(t,n):t,e.push(t),e)),[]);return(Gf(t.type)?yO:Zf(t.type)?bO:xO)(e,n,r)}function yO(e,t,n){const i=vO(e.sort,!0);let r,o;const a=n.map((e=>{const n=t.getData(e.data);return n||dO(e.data),n.countsRef(t,e.field,i)})),s={groupby:hF,pulse:a};i&&(r=i.op||"count",o=i.field?gF(r,i.field):"count",s.ops=[lO[r]],s.fields=[t.fieldRef(o)],s.as=[o]),r=t.add(TF(s));const l=t.add(RF({pulse:fF(r)}));return o=t.add(aO({field:hF,sort:t.sortRef(i),pulse:fF(l)})),fF(o)}function vO(e,t){return e&&(e.field||e.op?e.field||"count"===e.op?t&&e.field&&e.op&&!lO[e.op]&&(0,m.vU)("Multiple domain scales can not be sorted using "+e.op):(0,m.vU)("No field provided for sort aggregate op: "+e.op):(0,m.Kn)(e)?e.field="key":e={field:"key"}),e}function bO(e,t,n){const i=n.map((e=>{const n=t.getData(e.data);return n||dO(e.data),n.domainRef(t,e.field)}));return fF(t.add(GF({values:i})))}function xO(e,t,n){const i=n.map((e=>{const n=t.getData(e.data);return n||dO(e.data),n.extentRef(t,e.field)}));return fF(t.add(JF({extents:i})))}function _O(e,t,n){const i=t.config.range;let r=e.range;if(r.signal)return t.signalRef(r.signal);if((0,m.HD)(r)){if(i&&(0,m.nr)(i,r))return _O(e=(0,m.l7)({},e,{range:i[r]}),t,n);"width"===r?r=[0,{signal:"width"}]:"height"===r?r=Gf(e.type)?[0,{signal:"height"}]:[{signal:"height"},0]:(0,m.vU)("Unrecognized scale range value: "+(0,m.m8)(r))}else{if(r.scheme)return n.scheme=(0,m.kJ)(r.scheme)?fO(r.scheme,t):cO(r.scheme,t),r.extent&&(n.schemeExtent=fO(r.extent,t)),void(r.count&&(n.schemeCount=cO(r.count,t)));if(r.step)return void(n.rangeStep=cO(r.step,t));if(Gf(e.type)&&!(0,m.kJ)(r))return hO(r,e,t);(0,m.kJ)(r)||(0,m.vU)("Unsupported range type: "+(0,m.m8)(r))}return r.map((e=>((0,m.kJ)(e)?fO:cO)(e,t)))}function wO(e,t,n){return(0,m.kJ)(e)?e.map((e=>wO(e,t,n))):(0,m.Kn)(e)?e.signal?n.signalRef(e.signal):"fit"===t?e:(0,m.vU)("Unsupported parameter object: "+(0,m.m8)(e)):e}const kO="top",EO="left",DO="right",$O="bottom",AO="center",SO="vertical",MO="start",CO="end",FO="index",OO="label",TO="offset",NO="perc",zO="perc2",RO="value",PO="guide-label",LO="guide-title",UO="group-title",BO="group-subtitle",jO="symbol",IO="gradient",qO="discrete",WO="size",HO=[WO,"shape","fill","stroke","strokeWidth","strokeDash","opacity"],XO={name:1,style:1,interactive:1},JO={value:0},GO={value:1},VO="group",YO="rect",KO="rule",ZO="symbol",QO="text";function eT(e){return e.type=VO,e.interactive=e.interactive||!1,e}function tT(e,t){const n=(n,i)=>_F(e[n],_F(t[n],i));return n.isVertical=n=>SO===_F(e.direction,t.direction||(n?t.symbolDirection:t.gradientDirection)),n.gradientLength=()=>_F(e.gradientLength,t.gradientLength||t.gradientWidth),n.gradientThickness=()=>_F(e.gradientThickness,t.gradientThickness||t.gradientHeight),n.entryColumns=()=>_F(e.columns,_F(t.columns,+n.isVertical(!0))),n}function nT(e,t){const n=t&&(t.update&&t.update[e]||t.enter&&t.enter[e]);return n&&n.signal?n:n?n.value:null}function iT(e,t,n){return`item.anchor === '${MO}' ? ${e} : item.anchor === '${CO}' ? ${t} : ${n}`}const rT=iT((0,m.m8)(EO),(0,m.m8)(DO),(0,m.m8)(AO));function oT(e,t){return t?e?(0,m.Kn)(e)?Object.assign({},e,{offset:oT(e.offset,t)}):{value:e,offset:t}:t:e}function aT(e,t){return t?(e.name=t.name,e.style=t.style||e.style,e.interactive=!!t.interactive,e.encode=AC(e.encode,t,XO)):e.interactive=!1,e}function sT(e,t,n,i){const r=tT(e,n),o=r.isVertical(),a=r.gradientThickness(),s=r.gradientLength();let l,u,c,f,d;o?(u=[0,1],c=[0,0],f=a,d=s):(u=[0,0],c=[1,0],f=s,d=a);const h={enter:l={opacity:JO,x:JO,y:JO,width:EC(f),height:EC(d)},update:(0,m.l7)({},l,{opacity:GO,fill:{gradient:t,start:u,stop:c}}),exit:{opacity:JO}};return $C(h,{stroke:r("gradientStrokeColor"),strokeWidth:r("gradientStrokeWidth")},{opacity:r("gradientOpacity")}),aT({type:YO,role:jC,encode:h},i)}function lT(e,t,n,i,r){const o=tT(e,n),a=o.isVertical(),s=o.gradientThickness(),l=o.gradientLength();let u,c,f,d,h="";a?(u="y",f="y2",c="x",d="width",h="1-"):(u="x",f="x2",c="y",d="height");const p={opacity:JO,fill:{scale:t,field:RO}};p[u]={signal:h+"datum."+NO,mult:l},p[c]=JO,p[f]={signal:h+"datum."+zO,mult:l},p[d]=EC(s);const g={enter:p,update:(0,m.l7)({},p,{opacity:GO}),exit:{opacity:JO}};return $C(g,{stroke:o("gradientStrokeColor"),strokeWidth:o("gradientStrokeWidth")},{opacity:o("gradientOpacity")}),aT({type:YO,role:UC,key:RO,from:r,encode:g},i)}const uT=`datum.${NO}<=0?"${EO}":datum.${NO}>=1?"${DO}":"${AO}"`,cT=`datum.${NO}<=0?"${$O}":datum.${NO}>=1?"${kO}":"middle"`;function fT(e,t,n,i){const r=tT(e,t),o=r.isVertical(),a=EC(r.gradientThickness()),s=r.gradientLength();let l,u,c,f,d=r("labelOverlap"),h="";const p={enter:l={opacity:JO},update:u={opacity:GO,text:{field:OO}},exit:{opacity:JO}};return $C(p,{fill:r("labelColor"),fillOpacity:r("labelOpacity"),font:r("labelFont"),fontSize:r("labelFontSize"),fontStyle:r("labelFontStyle"),fontWeight:r("labelFontWeight"),limit:_F(e.labelLimit,t.gradientLabelLimit)}),o?(l.align={value:"left"},l.baseline=u.baseline={signal:cT},c="y",f="x",h="1-"):(l.align=u.align={signal:uT},l.baseline={value:"top"},c="x",f="y"),l[c]=u[c]={signal:h+"datum."+NO,mult:s},l[f]=u[f]=a,a.offset=_F(e.labelOffset,t.gradientLabelOffset)||0,d=d?{separation:r("labelSeparation"),method:d,order:"datum."+FO}:void 0,aT({type:QO,role:IC,style:PO,key:RO,from:i,encode:p,overlap:d},n)}function dT(e,t,n,i,r){const o=tT(e,t),a=n.entries,s=!(!a||!a.interactive),l=a?a.name:void 0,u=o("clipHeight"),c=o("symbolOffset"),f={data:"value"},d=`(${r}) ? datum.${TO} : datum.${WO}`,h=u?EC(u):{field:WO},p=`datum.${FO}`,m=`max(1, ${r})`;let g,y,v,b,x;h.mult=.5,g={enter:y={opacity:JO,x:{signal:d,mult:.5,offset:c},y:h},update:v={opacity:GO,x:y.x,y:y.y},exit:{opacity:JO}};let _=null,w=null;e.fill||(_=t.symbolBaseFillColor,w=t.symbolBaseStrokeColor),$C(g,{fill:o("symbolFillColor",_),shape:o("symbolType"),size:o("symbolSize"),stroke:o("symbolStrokeColor",w),strokeDash:o("symbolDash"),strokeDashOffset:o("symbolDashOffset"),strokeWidth:o("symbolStrokeWidth")},{opacity:o("symbolOpacity")}),HO.forEach((t=>{e[t]&&(v[t]=y[t]={scale:e[t],field:RO})}));const k=aT({type:ZO,role:qC,key:RO,from:f,clip:!!u||void 0,encode:g},n.symbols),E=EC(c);E.offset=o("labelOffset"),g={enter:y={opacity:JO,x:{signal:d,offset:E},y:h},update:v={opacity:GO,text:{field:OO},x:y.x,y:y.y},exit:{opacity:JO}},$C(g,{align:o("labelAlign"),baseline:o("labelBaseline"),fill:o("labelColor"),fillOpacity:o("labelOpacity"),font:o("labelFont"),fontSize:o("labelFontSize"),fontStyle:o("labelFontStyle"),fontWeight:o("labelFontWeight"),limit:o("labelLimit")});const D=aT({type:QO,role:IC,style:PO,key:RO,from:f,encode:g},n.labels);return g={enter:{noBound:{value:!u},width:JO,height:u?EC(u):JO,opacity:JO},exit:{opacity:JO},update:v={opacity:GO,row:{signal:null},column:{signal:null}}},o.isVertical(!0)?(b=`ceil(item.mark.items.length / ${m})`,v.row.signal=`${p}%${b}`,v.column.signal=`floor(${p} / ${b})`,x={field:["row",p]}):(v.row.signal=`floor(${p} / ${m})`,v.column.signal=`${p} % ${m}`,x={field:p}),v.column.signal=`(${r})?${v.column.signal}:${p}`,eT({role:FC,from:i={facet:{data:i,name:"value",groupby:FO}},encode:AC(g,a,XO),marks:[k,D],name:l,interactive:s,sort:x})}const hT='item.orient === "left"',pT='item.orient === "right"',mT=`(${hT} || ${pT})`,gT=`datum.vgrad && ${mT}`,yT=iT('"top"','"bottom"','"middle"'),vT=`datum.vgrad && ${pT} ? (${iT('"right"','"left"','"center"')}) : (${mT} && !(datum.vgrad && ${hT})) ? "left" : ${rT}`,bT=`item._anchor || (${mT} ? "middle" : "start")`,xT=`${gT} ? (${hT} ? -90 : 90) : 0`,_T=`${mT} ? (datum.vgrad ? (${pT} ? "bottom" : "top") : ${yT}) : "top"`;function wT(e,t){let n;return(0,m.Kn)(e)&&(e.signal?n=e.signal:e.path?n="pathShape("+kT(e.path)+")":e.sphere&&(n="geoShape("+kT(e.sphere)+', {type: "Sphere"})')),n?t.signalRef(n):!!e}function kT(e){return(0,m.Kn)(e)&&e.signal?e.signal:(0,m.m8)(e)}function ET(e){const t=e.role||"";return t.indexOf("axis")&&t.indexOf("legend")&&t.indexOf("title")?e.type===VO?FC:t||MC:t}function DT(e){return{marktype:e.type,name:e.name||void 0,role:e.role||ET(e),zindex:+e.zindex||void 0,aria:e.aria,description:e.description}}function $T(e,t){return e&&e.signal?t.signalRef(e.signal):!1!==e}function AT(e,t){const n=ro(e.type);n||(0,m.vU)("Unrecognized transform type: "+(0,m.m8)(e.type));const i=uF(n.type.toLowerCase(),null,ST(n,e,t));return e.signal&&t.addSignal(e.signal,t.proxy(i)),i.metadata=n.metadata||{},i}function ST(e,t,n){const i={},r=e.params.length;for(let o=0;o<r;++o){const r=e.params[o];i[r.name]=MT(r,t,n)}return i}function MT(e,t,n){const i=e.type,r=t[e.name];return"index"===i?function(e,t,n){(0,m.HD)(t.from)||(0,m.vU)('Lookup "from" parameter must be a string literal.');return n.getData(t.from).lookupRef(n,t.key)}(0,t,n):void 0!==r?"param"===i?function(e,t,n){const i=t[e.name];return e.array?((0,m.kJ)(i)||(0,m.vU)("Expected an array of sub-parameters. Instead: "+(0,m.m8)(i)),i.map((t=>FT(e,t,n)))):FT(e,i,n)}(e,t,n):"projection"===i?n.projectionRef(t[e.name]):e.array&&!bF(r)?r.map((t=>CT(e,t,n))):CT(e,r,n):void(e.required&&(0,m.vU)("Missing required "+(0,m.m8)(t.type)+" parameter: "+(0,m.m8)(e.name)))}function CT(e,t,n){const i=e.type;if(bF(t))return zT(i)?(0,m.vU)("Expression references can not be signals."):RT(i)?n.fieldRef(t):PT(i)?n.compareRef(t):n.signalRef(t.signal);{const r=e.expr||RT(i);return r&&OT(t)?n.exprRef(t.expr,t.as):r&&TT(t)?dF(t.field,t.as):zT(i)?fM(t,n):NT(i)?fF(n.getData(t).values):RT(i)?dF(t):PT(i)?n.compareRef(t):t}}function FT(e,t,n){const i=e.params.length;let r;for(let a=0;a<i;++a){r=e.params[a];for(const e in r.key)if(r.key[e]!==t[e]){r=null;break}if(r)break}r||(0,m.vU)("Unsupported parameter: "+(0,m.m8)(t));const o=(0,m.l7)(ST(r,t,n),r.key);return fF(n.add(YF(o)))}const OT=e=>e&&e.expr,TT=e=>e&&e.field,NT=e=>"data"===e,zT=e=>"expr"===e,RT=e=>"field"===e,PT=e=>"compare"===e;function LT(e,t){return e.$ref?e:e.data&&e.data.$ref?e.data:fF(t.getData(e.data).output)}function UT(e,t,n,i,r){this.scope=e,this.input=t,this.output=n,this.values=i,this.aggregate=r,this.index={}}function BT(e){return(0,m.HD)(e)?e:null}function jT(e,t,n){const i=gF(n.op,n.field);let r;if(t.ops){for(let o=0,a=t.as.length;o<a;++o)if(t.as[o]===i)return}else t.ops=["count"],t.fields=[null],t.as=["count"];n.op&&(t.ops.push((r=n.op.signal)?e.signalRef(r):n.op),t.fields.push(e.fieldRef(n.field)),t.as.push(i))}function IT(e,t,n,i,r,o,a){const s=t[n]||(t[n]={}),l=function(e){return(0,m.Kn)(e)?(e.order===mF?"-":"+")+gF(e.op,e.field):""}(o);let u,c,f=BT(r);if(null!=f&&(e=t.scope,f+=l?"|"+l:"",u=s[f]),!u){const n=o?{field:hF,pulse:t.countsRef(e,r,o)}:{field:e.fieldRef(r),pulse:fF(t.output)};l&&(n.sort=e.sortRef(o)),c=e.add(uF(i,void 0,n)),a&&(t.index[r]=c),u=fF(c),null!=f&&(s[f]=u)}return u}function qT(e,t,n){const i=e.remove,r=e.insert,o=e.toggle,a=e.modify,s=e.values,l=t.add(cF()),u=fM("if("+e.trigger+',modify("'+n+'",'+[r,i,o,a,s].map((e=>null==e?"null":e)).join(",")+"),0)",t);l.update=u.$expr,l.params=u.$params}function WT(e,t){const n=ET(e),i=e.type===VO,r=e.from&&e.from.facet,o=e.overlap;let a,s,l,u,c,f,d,h=e.layout||n===FC||n===CC;const p=n===MC||h||r,g=function(e,t,n){let i,r,o,a,s;return e?(i=e.facet)&&(t||(0,m.vU)("Only group marks can be faceted."),null!=i.field?a=s=LT(i,n):(e.data?s=fF(n.getData(e.data).aggregate):(o=AT((0,m.l7)({type:"aggregate",groupby:(0,m.IX)(i.groupby)},i.aggregate),n),o.params.key=n.keyRef(i.groupby),o.params.pulse=LT(i,n),a=s=fF(n.add(o))),r=n.keyRef(i.groupby,!0))):a=fF(n.add(RF(null,[{}]))),a||(a=LT(e,n)),{key:r,pulse:a,parent:s}}(e.from,i,t);s=t.add(LF({key:g.key||(e.key?dF(e.key):void 0),pulse:g.pulse,clean:!i}));const y=fF(s);s=l=t.add(RF({pulse:y})),s=t.add(XF({markdef:DT(e),interactive:$T(e.interactive,t),clip:wT(e.clip,t),context:{$context:!0},groups:t.lookup(),parent:t.signals.parent?t.signalRef("parent"):null,index:t.markpath(),pulse:fF(s)}));const v=fF(s);s=u=t.add(UF(tF(e.encode,e.type,n,e.style,t,{mod:!1,pulse:v}))),s.params.parent=t.encode(),e.transform&&e.transform.forEach((e=>{const n=AT(e,t),i=n.metadata;(i.generates||i.changes)&&(0,m.vU)("Mark transforms should not generate new data."),i.nomod||(u.params.mod=!0),n.params.pulse=fF(s),t.add(s=n)})),e.sort&&(s=t.add(rO({sort:t.compareRef(e.sort),pulse:fF(s)})));const b=fF(s);(r||h)&&(h=t.add(oO({layout:t.objectProperty(e.layout),legends:t.legends,mark:v,pulse:b})),f=fF(h));const x=t.add(zF({mark:v,pulse:f||b}));d=fF(x),i&&(p&&(a=t.operators,a.pop(),h&&a.pop()),t.pushState(b,f||d,y),r?function(e,t,n){const i=e.from.facet,r=i.name,o=LT(i,t);let a;i.name||(0,m.vU)("Facet must have a name: "+(0,m.m8)(i)),i.data||(0,m.vU)("Facet must reference a data set: "+(0,m.m8)(i)),i.field?a=t.add(KF({field:t.fieldRef(i.field),pulse:o})):i.groupby?a=t.add(jF({key:t.keyRef(i.groupby),group:fF(t.proxy(n.parent)),pulse:o})):(0,m.vU)("Facet must specify groupby or field: "+(0,m.m8)(i));const s=t.fork(),l=s.add(RF()),u=s.add(iO({pulse:fF(l)}));s.addData(r,new UT(s,l,l,u)),s.addSignal("parent",null),a.params.subflow={$subflow:s.parse(e).toRuntime()}}(e,t,g):p?function(e,t,n){const i=t.add(KF({pulse:n.pulse})),r=t.fork();r.add(iO()),r.addSignal("parent",null),i.params.subflow={$subflow:r.parse(e).toRuntime()}}(e,t,g):t.parse(e),t.popState(),p&&(h&&a.push(h),a.push(x))),o&&(d=function(e,t,n){const i=e.method,r=e.bound,o=e.separation,a={separation:bF(o)?n.signalRef(o.signal):o,method:bF(i)?n.signalRef(i.signal):i,pulse:t};e.order&&(a.sort=n.compareRef({field:e.order}));if(r){const e=r.tolerance;a.boundTolerance=bF(e)?n.signalRef(e.signal):+e,a.boundScale=n.scaleRef(r.scale),a.boundOrient=r.orient}return fF(n.add(VF(a)))}(o,d,t));const _=t.add(tO({pulse:d})),w=t.add(iO({pulse:fF(_)},void 0,t.parent()));null!=e.name&&(c=e.name,t.addData(c,new UT(t,l,_,w)),e.on&&e.on.forEach((e=>{(e.insert||e.remove||e.toggle)&&(0,m.vU)("Marks only support modify triggers."),qT(e,t,c)})))}function HT(e,t){const n=t.config.legend,i=e.encode||{},r=tT(e,n),o=i.legend||{},a=o.name||void 0,s=o.interactive,l=o.style,u={};let c,f,d,h=0;HO.forEach((t=>e[t]?(u[t]=e[t],h=h||e[t]):0)),h||(0,m.vU)("Missing valid scale for legend.");const p=function(e,t){let n=e.type||jO;e.type||1!==function(e){return HO.reduce(((t,n)=>t+(e[n]?1:0)),0)}(e)||!e.fill&&!e.stroke||(n=Jf(t)?IO:Vf(t)?qO:jO);return n!==IO?n:Vf(t)?qO:IO}(e,t.scaleType(h)),g={title:null!=e.title,scales:u,type:p,vgrad:"symbol"!==p&&r.isVertical()},y=fF(t.add(RF(null,[g]))),v=fF(t.add(WF(f={type:p,scale:t.scaleRef(h),count:t.objectProperty(r("tickCount")),limit:t.property(r("symbolLimit")),values:t.objectProperty(e.values),minstep:t.property(e.tickMinStep),formatType:t.property(e.formatType),formatSpecifier:t.property(e.format)})));return p===IO?(d=[sT(e,h,n,i.gradient),fT(e,n,i.labels,v)],f.count=f.count||t.signalRef(`max(2,2*floor((${wF(r.gradientLength())})/100))`)):p===qO?d=[lT(e,h,n,i.gradient,v),fT(e,n,i.labels,v)]:(c=function(e,t){const n=tT(e,t);return{align:n("gridAlign"),columns:n.entryColumns(),center:{row:!0,column:!1},padding:{row:n("rowPadding"),column:n("columnPadding")}}}(e,n),d=[dT(e,n,i,v,wF(c.columns))],f.size=function(e,t,n){const i=wF(JT("size",e,n)),r=wF(JT("strokeWidth",e,n)),o=wF(function(e,t,n){return nT("fontSize",e)||function(e,t,n){const i=t.config.style[n];return i&&i[e]}("fontSize",t,n)}(n[1].encode,t,PO));return fM(`max(ceil(sqrt(${i})+${r}),${o})`,t)}(e,t,d[0].marks)),d=[eT({role:BC,from:y,encode:{enter:{x:{value:0},y:{value:0}}},marks:d,layout:c,interactive:s})],g.title&&d.push(function(e,t,n,i){const r=tT(e,t),o={enter:{opacity:JO},update:{opacity:GO,x:{field:{group:"padding"}},y:{field:{group:"padding"}}},exit:{opacity:JO}};return $C(o,{orient:r("titleOrient"),_anchor:r("titleAnchor"),anchor:{signal:bT},angle:{signal:xT},align:{signal:vT},baseline:{signal:_T},text:e.title,fill:r("titleColor"),fillOpacity:r("titleOpacity"),font:r("titleFont"),fontSize:r("titleFontSize"),fontStyle:r("titleFontStyle"),fontWeight:r("titleFontWeight"),limit:r("titleLimit"),lineHeight:r("titleLineHeight")},{align:r("titleAlign"),baseline:r("titleBaseline")}),aT({type:QO,role:WC,style:LO,from:i,encode:o},n)}(e,n,i.title,y)),WT(eT({role:LC,from:y,encode:AC(XT(r,e,n),o,XO),marks:d,aria:r("aria"),description:r("description"),zindex:r("zindex"),name:a,interactive:s,style:l}),t)}function XT(e,t,n){const i={enter:{},update:{}};return $C(i,{orient:e("orient"),offset:e("offset"),padding:e("padding"),titlePadding:e("titlePadding"),cornerRadius:e("cornerRadius"),fill:e("fillColor"),stroke:e("strokeColor"),strokeWidth:n.strokeWidth,strokeDash:n.strokeDash,x:e("legendX"),y:e("legendY"),format:t.format,formatType:t.formatType}),i}function JT(e,t,n){return t[e]?`scale("${t[e]}",datum)`:nT(e,n[0].encode)}UT.fromEntries=function(e,t){const n=t.length,i=t[n-1],r=t[n-2];let o=t[0],a=null,s=1;for(o&&"load"===o.type&&(o=t[1]),e.add(t[0]);s<n;++s)t[s].params.pulse=fF(t[s-1]),e.add(t[s]),"aggregate"===t[s].type&&(a=t[s]);return new UT(e,o,r,i,a)},UT.prototype={countsRef(e,t,n){const i=this,r=i.counts||(i.counts={}),o=BT(t);let a,s,l;return null!=o&&(e=i.scope,a=r[o]),a?n&&n.field&&jT(e,a.agg.params,n):(l={groupby:e.fieldRef(t,"key"),pulse:fF(i.output)},n&&n.field&&jT(e,l,n),s=e.add(TF(l)),a=e.add(RF({pulse:fF(s)})),a={agg:s,ref:fF(a)},null!=o&&(r[o]=a)),a.ref},tuplesRef(){return fF(this.values)},extentRef(e,t){return IT(e,this,"extent","extent",t,!1)},domainRef(e,t){return IT(e,this,"domain","values",t,!1)},valuesRef(e,t,n){return IT(e,this,"vals","values",t,n||!0)},lookupRef(e,t){return IT(e,this,"lookup","tupleindex",t,!1)},indataRef(e,t){return IT(e,this,"indata","tupleindex",t,!0,!0)}};const GT=`item.orient==="${EO}"?-90:item.orient==="${DO}"?90:0`;function VT(e,t){const n=tT(e=(0,m.HD)(e)?{text:e}:e,t.config.title),i=e.encode||{},r=i.group||{},o=r.name||void 0,a=r.interactive,s=r.style,l=[],u=fF(t.add(RF(null,[{}])));return l.push(function(e,t,n,i){const r={value:0},o=e.text,a={enter:{opacity:r},update:{opacity:{value:1}},exit:{opacity:r}};return $C(a,{text:o,align:{signal:"item.mark.group.align"},angle:{signal:"item.mark.group.angle"},limit:{signal:"item.mark.group.limit"},baseline:"top",dx:t("dx"),dy:t("dy"),fill:t("color"),font:t("font"),fontSize:t("fontSize"),fontStyle:t("fontStyle"),fontWeight:t("fontWeight"),lineHeight:t("lineHeight")},{align:t("align"),angle:t("angle"),baseline:t("baseline")}),aT({type:QO,role:XC,style:UO,from:i,encode:a},n)}(e,n,function(e){const t=e.encode;return t&&t.title||(0,m.l7)({name:e.name,interactive:e.interactive,style:e.style},t)}(e),u)),e.subtitle&&l.push(function(e,t,n,i){const r={value:0},o=e.subtitle,a={enter:{opacity:r},update:{opacity:{value:1}},exit:{opacity:r}};return $C(a,{text:o,align:{signal:"item.mark.group.align"},angle:{signal:"item.mark.group.angle"},limit:{signal:"item.mark.group.limit"},baseline:"top",dx:t("dx"),dy:t("dy"),fill:t("subtitleColor"),font:t("subtitleFont"),fontSize:t("subtitleFontSize"),fontStyle:t("subtitleFontStyle"),fontWeight:t("subtitleFontWeight"),lineHeight:t("subtitleLineHeight")},{align:t("align"),angle:t("angle"),baseline:t("baseline")}),aT({type:QO,role:JC,style:BO,from:i,encode:a},n)}(e,n,i.subtitle,u)),WT(eT({role:HC,from:u,encode:YT(n,r),marks:l,aria:n("aria"),description:n("description"),zindex:n("zindex"),name:o,interactive:a,style:s}),t)}function YT(e,t){const n={enter:{},update:{}};return $C(n,{orient:e("orient"),anchor:e("anchor"),align:{signal:rT},angle:{signal:GT},limit:e("limit"),frame:e("frame"),offset:e("offset")||0,padding:e("subtitlePadding")}),AC(n,t,XO)}function KT(e,t){const n=[];e.transform&&e.transform.forEach((e=>{n.push(AT(e,t))})),e.on&&e.on.forEach((n=>{qT(n,t,e.name)})),t.addDataPipeline(e.name,function(e,t,n){const i=[];let r,o,a,s,l,u=null,c=!1,f=!1;e.values?bF(e.values)||xF(e.format)?(i.push(QT(t,e)),i.push(u=ZT())):i.push(u=ZT({$ingest:e.values,$format:e.format})):e.url?xF(e.url)||xF(e.format)?(i.push(QT(t,e)),i.push(u=ZT())):i.push(u=ZT({$request:e.url,$format:e.format})):e.source&&(u=r=(0,m.IX)(e.source).map((e=>fF(t.getData(e).output))),i.push(null));for(o=0,a=n.length;o<a;++o)s=n[o],l=s.metadata,u||l.source||i.push(u=ZT()),i.push(s),l.generates&&(f=!0),l.modifies&&!f&&(c=!0),l.source?u=s:l.changes&&(u=null);r&&(a=r.length-1,i[0]=eO({derive:c,pulse:a?r:r[0]}),(c||a)&&i.splice(1,0,ZT()));u||i.push(ZT());return i.push(iO({})),i}(e,t,n))}function ZT(e){const t=RF({},e);return t.metadata={source:!0},t}function QT(e,t){return HF({url:t.url?e.property(t.url):void 0,async:t.async?e.property(t.async):void 0,values:t.values?e.property(t.values):void 0,format:e.objectProperty(t.format)})}const eN=e=>e===$O||e===kO,tN=(e,t,n)=>bF(e)?lN(e.signal,t,n):e===EO||e===kO?t:n,nN=(e,t,n)=>bF(e)?aN(e.signal,t,n):eN(e)?t:n,iN=(e,t,n)=>bF(e)?sN(e.signal,t,n):eN(e)?n:t,rN=(e,t,n)=>bF(e)?uN(e.signal,t,n):e===kO?{value:t}:{value:n},oN=(e,t,n)=>bF(e)?cN(e.signal,t,n):e===DO?{value:t}:{value:n},aN=(e,t,n)=>fN(`${e} === '${kO}' || ${e} === '${$O}'`,t,n),sN=(e,t,n)=>fN(`${e} !== '${kO}' && ${e} !== '${$O}'`,t,n),lN=(e,t,n)=>hN(`${e} === '${EO}' || ${e} === '${kO}'`,t,n),uN=(e,t,n)=>hN(`${e} === '${kO}'`,t,n),cN=(e,t,n)=>hN(`${e} === '${DO}'`,t,n),fN=(e,t,n)=>(t=null!=t?EC(t):t,n=null!=n?EC(n):n,dN(t)&&dN(n)?{signal:`${e} ? (${t=t?t.signal||(0,m.m8)(t.value):null}) : (${n=n?n.signal||(0,m.m8)(n.value):null})`}:[(0,m.l7)({test:e},t)].concat(n||[])),dN=e=>null==e||1===Object.keys(e).length,hN=(e,t,n)=>({signal:`${e} ? (${mN(t)}) : (${mN(n)})`}),pN=(e,t,n,i,r)=>({signal:(null!=i?`${e} === '${EO}' ? (${mN(i)}) : `:"")+(null!=n?`${e} === '${$O}' ? (${mN(n)}) : `:"")+(null!=r?`${e} === '${DO}' ? (${mN(r)}) : `:"")+(null!=t?`${e} === '${kO}' ? (${mN(t)}) : `:"")+"(null)"}),mN=e=>bF(e)?e.signal:null==e?null:(0,m.m8)(e),gN=(e,t)=>0===t?0:bF(e)?{signal:`(${e.signal}) * ${t}`}:{value:e*t},yN=(e,t)=>{const n=e.signal;return n&&n.endsWith("(null)")?{signal:n.slice(0,-6)+t.signal}:e};function vN(e,t,n,i){let r;if(t&&(0,m.nr)(t,e))return t[e];if((0,m.nr)(n,e))return n[e];if(e.startsWith("title")){switch(e){case"titleColor":r="fill";break;case"titleFont":case"titleFontSize":case"titleFontWeight":r=e[5].toLowerCase()+e.slice(6)}return i[LO][r]}if(e.startsWith("label")){switch(e){case"labelColor":r="fill";break;case"labelFont":case"labelFontSize":r=e[5].toLowerCase()+e.slice(6)}return i[PO][r]}return null}function bN(e){const t={};for(const n of e)if(n)for(const e in n)t[e]=1;return Object.keys(t)}function xN(e,t){return{scale:e.scale,range:t}}function _N(e,t,n,i,r){const o=tT(e,t),a=e.orient,s=e.gridScale,l=tN(a,1,-1),u=function(e,t){if(1===t);else if((0,m.Kn)(e)){let n=e=(0,m.l7)({},e);for(;null!=n.mult;){if(!(0,m.Kn)(n.mult))return n.mult=bF(t)?{signal:`(${n.mult}) * (${t.signal})`}:n.mult*t,e;n=n.mult=(0,m.l7)({},n.mult)}n.mult=t}else e=bF(t)?{signal:`(${t.signal}) * (${e||0})`}:t*(e||0);return e}(e.offset,l);let c,f,d;const h={enter:c={opacity:JO},update:d={opacity:GO},exit:f={opacity:JO}};$C(h,{stroke:o("gridColor"),strokeCap:o("gridCap"),strokeDash:o("gridDash"),strokeDashOffset:o("gridDashOffset"),strokeOpacity:o("gridOpacity"),strokeWidth:o("gridWidth")});const p={scale:e.scale,field:RO,band:r.band,extra:r.extra,offset:r.offset,round:o("tickRound")},g=nN(a,{signal:"height"},{signal:"width"}),y=s?{scale:s,range:0,mult:l,offset:u}:{value:0,offset:u},v=s?{scale:s,range:1,mult:l,offset:u}:(0,m.l7)(g,{mult:l,offset:u});return c.x=d.x=nN(a,p,y),c.y=d.y=iN(a,p,y),c.x2=d.x2=iN(a,v),c.y2=d.y2=nN(a,v),f.x=nN(a,p),f.y=iN(a,p),aT({type:KO,role:NC,key:RO,from:i,encode:h},n)}function wN(e,t,n,i,r){return{signal:'flush(range("'+e+'"), scale("'+e+'", datum.value), '+t+","+n+","+i+","+r+")"}}function kN(e,t,n,i){const r=tT(e,t),o=e.orient,a=tN(o,-1,1);let s,l;const u={enter:s={opacity:JO,anchor:EC(r("titleAnchor",null)),align:{signal:rT}},update:l=(0,m.l7)({},s,{opacity:GO,text:EC(e.title)}),exit:{opacity:JO}},c={signal:`lerp(range("${e.scale}"), ${iT(0,1,.5)})`};return l.x=nN(o,c),l.y=iN(o,c),s.angle=nN(o,JO,gN(a,90)),s.baseline=nN(o,rN(o,$O,kO),{value:$O}),l.angle=s.angle,l.baseline=s.baseline,$C(u,{fill:r("titleColor"),fillOpacity:r("titleOpacity"),font:r("titleFont"),fontSize:r("titleFontSize"),fontStyle:r("titleFontStyle"),fontWeight:r("titleFontWeight"),limit:r("titleLimit"),lineHeight:r("titleLineHeight")},{align:r("titleAlign"),angle:r("titleAngle"),baseline:r("titleBaseline")}),function(e,t,n,i){const r=(e,t)=>null!=e?(n.update[t]=yN(EC(e),n.update[t]),!1):!SC(t,i),o=r(e("titleX"),"x"),a=r(e("titleY"),"y");n.enter.auto=a===o?EC(a):nN(t,EC(a),EC(o))}(r,o,u,n),u.update.align=yN(u.update.align,s.align),u.update.angle=yN(u.update.angle,s.angle),u.update.baseline=yN(u.update.baseline,s.baseline),aT({type:QO,role:PC,style:LO,from:i,encode:u},n)}function EN(e,t){const n=function(e,t){var n,i,r,o=t.config,a=o.style,s=o.axis,l="band"===t.scaleType(e.scale)&&o.axisBand,u=e.orient;if(bF(u)){const e=bN([o.axisX,o.axisY]),t=bN([o.axisTop,o.axisBottom,o.axisLeft,o.axisRight]);for(r of(n={},e))n[r]=nN(u,vN(r,o.axisX,s,a),vN(r,o.axisY,s,a));for(r of(i={},t))i[r]=pN(u.signal,vN(r,o.axisTop,s,a),vN(r,o.axisBottom,s,a),vN(r,o.axisLeft,s,a),vN(r,o.axisRight,s,a))}else n=u===kO||u===$O?o.axisX:o.axisY,i=o["axis"+u[0].toUpperCase()+u.slice(1)];return n||i||l?(0,m.l7)({},s,n,i,l):s}(e,t),i=e.encode||{},r=i.axis||{},o=r.name||void 0,a=r.interactive,s=r.style,l=tT(e,n),u=function(e){const t=e("tickBand");let n,i,r=e("tickOffset");return t?t.signal?(n={signal:`(${t.signal}) === 'extent' ? 1 : 0.5`},i={signal:`(${t.signal}) === 'extent'`},(0,m.Kn)(r)||(r={signal:`(${t.signal}) === 'extent' ? 0 : ${r}`})):"extent"===t?(n=1,i=!0,r=0):(n=.5,i=!1):(n=e("bandPosition"),i=e("tickExtra")),{extra:i,band:n,offset:r}}(l),c={scale:e.scale,ticks:!!l("ticks"),labels:!!l("labels"),grid:!!l("grid"),domain:!!l("domain"),title:null!=e.title},f=fF(t.add(RF({},[c]))),d=fF(t.add(NF({scale:t.scaleRef(e.scale),extra:t.property(u.extra),count:t.objectProperty(e.tickCount),values:t.objectProperty(e.values),minstep:t.property(e.tickMinStep),formatType:t.property(e.formatType),formatSpecifier:t.property(e.format)}))),h=[];let p;return c.grid&&h.push(_N(e,n,i.grid,d,u)),c.ticks&&(p=l("tickSize"),h.push(function(e,t,n,i,r,o){const a=tT(e,t),s=e.orient,l=tN(s,-1,1);let u,c,f;const d={enter:u={opacity:JO},update:f={opacity:GO},exit:c={opacity:JO}};$C(d,{stroke:a("tickColor"),strokeCap:a("tickCap"),strokeDash:a("tickDash"),strokeDashOffset:a("tickDashOffset"),strokeOpacity:a("tickOpacity"),strokeWidth:a("tickWidth")});const h=EC(r);h.mult=l;const p={scale:e.scale,field:RO,band:o.band,extra:o.extra,offset:o.offset,round:a("tickRound")};return f.y=u.y=nN(s,JO,p),f.y2=u.y2=nN(s,h),c.x=nN(s,p),f.x=u.x=iN(s,JO,p),f.x2=u.x2=iN(s,h),c.y=iN(s,p),aT({type:KO,role:RC,key:RO,from:i,encode:d},n)}(e,n,i.ticks,d,p,u))),c.labels&&(p=c.ticks?p:0,h.push(function(e,t,n,i,r,o){const a=tT(e,t),s=e.orient,l=e.scale,u=tN(s,-1,1),c=wF(a("labelFlush")),f=wF(a("labelFlushOffset")),d=a("labelAlign"),h=a("labelBaseline");let p,m=0===c||!!c;const g=EC(r);g.mult=u,g.offset=EC(a("labelPadding")||0),g.offset.mult=u;const y={scale:l,field:RO,band:.5,offset:oT(o.offset,a("labelOffset"))},v=nN(s,m?wN(l,c,'"left"','"right"','"center"'):{value:"center"},oN(s,"left","right")),b=nN(s,rN(s,"bottom","top"),m?wN(l,c,'"top"','"bottom"','"middle"'):{value:"middle"}),x=wN(l,c,`-(${f})`,f,0);m=m&&f;const _={opacity:JO,x:nN(s,y,g),y:iN(s,y,g)},w={enter:_,update:p={opacity:GO,text:{field:OO},x:_.x,y:_.y,align:v,baseline:b},exit:{opacity:JO,x:_.x,y:_.y}};$C(w,{dx:!d&&m?nN(s,x):null,dy:!h&&m?iN(s,x):null}),$C(w,{angle:a("labelAngle"),fill:a("labelColor"),fillOpacity:a("labelOpacity"),font:a("labelFont"),fontSize:a("labelFontSize"),fontWeight:a("labelFontWeight"),fontStyle:a("labelFontStyle"),limit:a("labelLimit"),lineHeight:a("labelLineHeight")},{align:d,baseline:h});const k=a("labelBound");let E=a("labelOverlap");return E=E||k?{separation:a("labelSeparation"),method:E,order:"datum.index",bound:k?{scale:l,orient:s,tolerance:k}:null}:void 0,p.align!==v&&(p.align=yN(p.align,v)),p.baseline!==b&&(p.baseline=yN(p.baseline,b)),aT({type:QO,role:zC,style:PO,key:RO,from:i,encode:w,overlap:E},n)}(e,n,i.labels,d,p,u))),c.domain&&h.push(function(e,t,n,i){const r=tT(e,t),o=e.orient;let a,s;const l={enter:a={opacity:JO},update:s={opacity:GO},exit:{opacity:JO}};$C(l,{stroke:r("domainColor"),strokeCap:r("domainCap"),strokeDash:r("domainDash"),strokeDashOffset:r("domainDashOffset"),strokeWidth:r("domainWidth"),strokeOpacity:r("domainOpacity")});const u=xN(e,0),c=xN(e,1);return a.x=s.x=nN(o,u,JO),a.x2=s.x2=nN(o,c),a.y=s.y=iN(o,u,JO),a.y2=s.y2=iN(o,c),aT({type:KO,role:TC,from:i,encode:l},n)}(e,n,i.domain,f)),c.title&&h.push(kN(e,n,i.title,f)),WT(eT({role:OC,from:f,encode:AC(DN(l,e),r,XO),marks:h,aria:l("aria"),description:l("description"),zindex:l("zindex"),name:o,interactive:a,style:s}),t)}function DN(e,t){const n={enter:{},update:{}};return $C(n,{orient:e("orient"),offset:e("offset")||0,position:_F(t.position,0),titlePadding:e("titlePadding"),minExtent:e("minExtent"),maxExtent:e("maxExtent"),range:{signal:`abs(span(range("${t.scale}")))`},translate:e("translate"),format:t.format,formatType:t.formatType}),n}function $N(e,t,n){const i=(0,m.IX)(e.signals),r=(0,m.IX)(e.scales);return n||i.forEach((e=>sF(e,t))),(0,m.IX)(e.projections).forEach((e=>function(e,t){const n=t.config.projection||{},i={};for(const r in e)"name"!==r&&(i[r]=wO(e[r],r,t));for(const r in n)null==i[r]&&(i[r]=wO(n[r],r,t));t.addProjection(e.name,i)}(e,t))),r.forEach((e=>function(e,t){const n=e.type||"linear";Hf(n)||(0,m.vU)("Unrecognized scale type: "+(0,m.m8)(n)),t.addScale(e.name,{type:n,domain:void 0})}(e,t))),(0,m.IX)(e.data).forEach((e=>KT(e,t))),r.forEach((e=>uO(e,t))),(n||i).forEach((e=>function(e,t){const n=t.getSignal(e.name);let i=e.update;e.init&&(i?(0,m.vU)("Signals can not include both init and update expressions."):(i=e.init,n.initonly=!0)),i&&(i=fM(i,t),n.update=i.$expr,n.params=i.$params),e.on&&e.on.forEach((e=>CF(e,t,n.id)))}(e,t))),(0,m.IX)(e.axes).forEach((e=>EN(e,t))),(0,m.IX)(e.marks).forEach((e=>WT(e,t))),(0,m.IX)(e.legends).forEach((e=>HT(e,t))),e.title&&VT(e.title,t),t.parseLambdas(),t}const AN=e=>AC({enter:{x:{value:0},y:{value:0}},update:{width:{signal:"width"},height:{signal:"height"}}},e);function SN(e,t){const n=t.config,i=fF(t.root=t.add(cF())),r=function(e,t){const n=n=>_F(e[n],t[n]),i=[MN("background",n("background")),MN("autosize",xC(n("autosize"))),MN("padding",kC(n("padding"))),MN("width",n("width")||0),MN("height",n("height")||0)],r=i.reduce(((e,t)=>(e[t.name]=t,e)),{}),o={};return(0,m.IX)(e.signals).forEach((e=>{(0,m.nr)(r,e.name)?e=(0,m.l7)(r[e.name],e):i.push(e),o[e.name]=e})),(0,m.IX)(t.signals).forEach((e=>{(0,m.nr)(o,e.name)||(0,m.nr)(r,e.name)||i.push(e)})),i}(e,n);r.forEach((e=>sF(e,t))),t.description=e.description||n.description,t.eventConfig=n.events,t.legends=t.objectProperty(n.legend&&n.legend.layout),t.locale=n.locale;const o=t.add(RF()),a=t.add(UF(tF(AN(e.encode),VO,CC,e.style,t,{pulse:fF(o)}))),s=t.add(oO({layout:t.objectProperty(e.layout),legends:t.legends,autosize:t.signalRef("autosize"),mark:i,pulse:fF(a)}));t.operators.pop(),t.pushState(fF(a),fF(s),null),$N(e,t,r),t.operators.push(s);let l=t.add(zF({mark:i,pulse:fF(s)}));return l=t.add(tO({pulse:fF(l)})),l=t.add(iO({pulse:fF(l)})),t.addData("root",new UT(t,o,o,l)),t}function MN(e,t){return t&&t.signal?{name:e,update:t.signal}:{name:e,value:t}}function CN(e,t){this.config=e||{},this.options=t||{},this.bindings=[],this.field={},this.signals={},this.lambdas={},this.scales={},this.events={},this.data={},this.streams=[],this.updates=[],this.operators=[],this.eventConfig=null,this.locale=null,this._id=0,this._subid=0,this._nextsub=[0],this._parent=[],this._encode=[],this._lookup=[],this._markpath=[]}function FN(e){this.config=e.config,this.options=e.options,this.legends=e.legends,this.field=Object.create(e.field),this.signals=Object.create(e.signals),this.lambdas=Object.create(e.lambdas),this.scales=Object.create(e.scales),this.events=Object.create(e.events),this.data=Object.create(e.data),this.streams=[],this.updates=[],this.operators=[],this._id=0,this._subid=++e._nextsub[0],this._nextsub=e._nextsub,this._parent=e._parent.slice(),this._encode=e._encode.slice(),this._lookup=e._lookup.slice(),this._markpath=e._markpath}function ON(e){return((0,m.kJ)(e)?TN:NN)(e)}function TN(e){const t=e.length;let n="[";for(let i=0;i<t;++i){const t=e[i];n+=(i>0?",":"")+((0,m.Kn)(t)?t.signal||ON(t):(0,m.m8)(t))}return n+"]"}function NN(e){let t,n,i="{",r=0;for(t in e)n=e[t],i+=(++r>1?",":"")+(0,m.m8)(t)+":"+((0,m.Kn)(n)?n.signal||ON(n):(0,m.m8)(n));return i+"}"}function zN(e,t,n){return(0,m.Kn)(e)||(0,m.vU)("Input Vega specification must be an object."),t=(0,m.fE)(function(){const e="sans-serif",t="#4c78a8",n="#000",i="#888",r="#ddd";return{description:"Vega visualization",padding:0,autosize:"pad",background:null,events:{defaults:{allow:["wheel"]}},group:null,mark:null,arc:{fill:t},area:{fill:t},image:null,line:{stroke:t,strokeWidth:2},path:{stroke:t},rect:{fill:t},rule:{stroke:n},shape:{stroke:t},symbol:{fill:t,size:64},text:{fill:n,font:e,fontSize:11},trail:{fill:t,size:2},style:{"guide-label":{fill:n,font:e,fontSize:10},"guide-title":{fill:n,font:e,fontSize:11,fontWeight:"bold"},"group-title":{fill:n,font:e,fontSize:13,fontWeight:"bold"},"group-subtitle":{fill:n,font:e,fontSize:12},point:{size:30,strokeWidth:2,shape:"circle"},circle:{size:30,strokeWidth:2},square:{size:30,strokeWidth:2,shape:"square"},cell:{fill:"transparent",stroke:r},view:{fill:"transparent"}},title:{orient:"top",anchor:"middle",offset:4,subtitlePadding:3},axis:{minExtent:0,maxExtent:200,bandPosition:.5,domain:!0,domainWidth:1,domainColor:i,grid:!1,gridWidth:1,gridColor:r,labels:!0,labelAngle:0,labelLimit:180,labelOffset:0,labelPadding:2,ticks:!0,tickColor:i,tickOffset:0,tickRound:!0,tickSize:5,tickWidth:1,titlePadding:4},axisBand:{tickOffset:-.5},projection:{type:"mercator"},legend:{orient:"right",padding:0,gridAlign:"each",columnPadding:10,rowPadding:2,symbolDirection:"vertical",gradientDirection:"vertical",gradientLength:200,gradientThickness:16,gradientStrokeColor:r,gradientStrokeWidth:0,gradientLabelOffset:2,labelAlign:"left",labelBaseline:"middle",labelLimit:160,labelOffset:4,labelOverlap:!0,symbolLimit:30,symbolType:"circle",symbolSize:100,symbolOffset:0,symbolStrokeWidth:1.5,symbolBaseFillColor:"transparent",symbolBaseStrokeColor:i,titleLimit:180,titleOrient:"top",titlePadding:5,layout:{offset:18,direction:"horizontal",left:{direction:"vertical"},right:{direction:"vertical"}}},range:{category:{scheme:"tableau10"},ordinal:{scheme:"blues"},heatmap:{scheme:"yellowgreenblue"},ramp:{scheme:"blues"},diverging:{scheme:"blueorange",extent:[1,0]},symbol:["circle","square","triangle-up","cross","diamond","triangle-right","triangle-down","triangle-left"]}}}(),t,e.config),SN(e,new CN(t,n)).toRuntime()}CN.prototype=FN.prototype={parse(e){return $N(e,this)},fork(){return new FN(this)},isSubscope(){return this._subid>0},toRuntime(){return this.finish(),{description:this.description,operators:this.operators,streams:this.streams,updates:this.updates,bindings:this.bindings,eventConfig:this.eventConfig,locale:this.locale}},id(){return(this._subid?this._subid+":":0)+this._id++},add(e){return this.operators.push(e),e.id=this.id(),e.refs&&(e.refs.forEach((t=>{t.$ref=e.id})),e.refs=null),e},proxy(e){const t=e instanceof lF?fF(e):e;return this.add(QF({value:t}))},addStream(e){return this.streams.push(e),e.id=this.id(),e},addUpdate(e){return this.updates.push(e),e},finish(){let e,t;for(e in this.root&&(this.root.root=!0),this.signals)this.signals[e].signal=e;for(e in this.scales)this.scales[e].scale=e;function n(e,t,n){let i,r;e&&(i=e.data||(e.data={}),r=i[t]||(i[t]=[]),r.push(n))}for(e in this.data){t=this.data[e],n(t.input,e,"input"),n(t.output,e,"output"),n(t.values,e,"values");for(const i in t.index)n(t.index[i],e,"index:"+i)}return this},pushState(e,t,n){this._encode.push(fF(this.add(iO({pulse:e})))),this._parent.push(t),this._lookup.push(n?fF(this.proxy(n)):null),this._markpath.push(-1)},popState(){this._encode.pop(),this._parent.pop(),this._lookup.pop(),this._markpath.pop()},parent(){return(0,m.fj)(this._parent)},encode(){return(0,m.fj)(this._encode)},lookup(){return(0,m.fj)(this._lookup)},markpath(){const e=this._markpath;return++e[e.length-1]},fieldRef(e,t){if((0,m.HD)(e))return dF(e,t);e.signal||(0,m.vU)("Unsupported field reference: "+(0,m.m8)(e));const n=e.signal;let i=this.field[n];if(!i){const e={name:this.signalRef(n)};t&&(e.as=t),this.field[n]=i=fF(this.add(IF(e)))}return i},compareRef(e){let t=!1;const n=e=>bF(e)?(t=!0,this.signalRef(e.signal)):function(e){return e&&e.expr}(e)?(t=!0,this.exprRef(e.expr)):e,i=(0,m.IX)(e.field).map(n),r=(0,m.IX)(e.order).map(n);return t?fF(this.add(PF({fields:i,orders:r}))):pF(i,r)},keyRef(e,t){let n=!1;const i=this.signals;return e=(0,m.IX)(e).map((e=>bF(e)?(n=!0,fF(i[e.signal])):e)),n?fF(this.add(qF({fields:e,flat:t}))):function(e,t){const n={$key:e};return t&&(n.$flat=!0),n}(e,t)},sortRef(e){if(!e)return e;const t=gF(e.op,e.field),n=e.order||"ascending";return n.signal?fF(this.add(PF({fields:t,orders:this.signalRef(n.signal)}))):pF(t,n)},event(e,t){const n=e+":"+t;if(!this.events[n]){const i=this.id();this.streams.push({id:i,source:e,type:t}),this.events[n]=i}return this.events[n]},hasOwnSignal(e){return(0,m.nr)(this.signals,e)},addSignal(e,t){this.hasOwnSignal(e)&&(0,m.vU)("Duplicate signal name: "+(0,m.m8)(e));const n=t instanceof lF?t:this.add(cF(t));return this.signals[e]=n},getSignal(e){return this.signals[e]||(0,m.vU)("Unrecognized signal name: "+(0,m.m8)(e)),this.signals[e]},signalRef(e){return this.signals[e]?fF(this.signals[e]):((0,m.nr)(this.lambdas,e)||(this.lambdas[e]=this.add(cF(null))),fF(this.lambdas[e]))},parseLambdas(){const e=Object.keys(this.lambdas);for(let t=0,n=e.length;t<n;++t){const n=e[t],i=fM(n,this),r=this.lambdas[n];r.params=i.$params,r.update=i.$expr}},property(e){return e&&e.signal?this.signalRef(e.signal):e},objectProperty(e){return e&&(0,m.Kn)(e)?this.signalRef(e.signal||ON(e)):e},exprRef(e,t){const n={expr:fM(e,this)};return t&&(n.expr.$name=t),fF(this.add(BF(n)))},addBinding(e,t){this.bindings||(0,m.vU)("Nested signals do not support binding: "+(0,m.m8)(e)),this.bindings.push((0,m.l7)({signal:e},t))},addScaleProj(e,t){(0,m.nr)(this.scales,e)&&(0,m.vU)("Duplicate scale or projection name: "+(0,m.m8)(e)),this.scales[e]=this.add(t)},addScale(e,t){this.addScaleProj(e,nO(t))},addProjection(e,t){this.addScaleProj(e,ZF(t))},getScale(e){return this.scales[e]||(0,m.vU)("Unrecognized scale name: "+(0,m.m8)(e)),this.scales[e]},scaleRef(e){return fF(this.getScale(e))},scaleType(e){return this.getScale(e).params.type},projectionRef(e){return this.scaleRef(e)},projectionType(e){return this.scaleType(e)},addData(e,t){return(0,m.nr)(this.data,e)&&(0,m.vU)("Duplicate data set name: "+(0,m.m8)(e)),this.data[e]=t},getData(e){return this.data[e]||(0,m.vU)("Undefined data set name: "+(0,m.m8)(e)),this.data[e]},addDataPipeline(e,t){return(0,m.nr)(this.data,e)&&(0,m.vU)("Duplicate data set name: "+(0,m.m8)(e)),this.addData(e,UT.fromEntries(this,t))}};var RN="5.27.0";(0,m.l7)(io,i,o,a,s,l,c,u,f,d,h,p)},58381:e=>{"use strict";var t=/("(?:[^\\"]|\\.)*")|[:,]/g;e.exports=function(e,n){var i,r,o;return n=n||{},i=JSON.stringify([1],void 0,void 0===n.indent?2:n.indent).slice(2,-3),r=""===i?1/0:void 0===n.maxLength?80:n.maxLength,o=n.replacer,function e(n,a,s){var l,u,c,f,d,h,p,m,g,y,v,b;if(n&&"function"===typeof n.toJSON&&(n=n.toJSON()),void 0===(v=JSON.stringify(n,o)))return v;if(p=r-a.length-s,v.length<=p&&(g=v.replace(t,(function(e,t){return t||e+" "}))).length<=p)return g;if(null!=o&&(n=JSON.parse(v),o=void 0),"object"===typeof n&&null!==n){if(m=a+i,c=[],u=0,Array.isArray(n))for(y="[",l="]",p=n.length;u<p;u++)c.push(e(n[u],m,u===p-1?0:1)||"null");else for(y="{",l="}",p=(h=Object.keys(n)).length;u<p;u++)f=h[u],d=JSON.stringify(f)+": ",void 0!==(b=e(n[f],m,d.length+(u===p-1?0:1)))&&c.push(d+b);if(c.length>0)return[y,i+c.join(",\n"+m),l].join("\n"+a)}return v}(e,"",0)}}}]);