@stlite/desktop 0.32.0 → 0.34.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.
- package/bin/dump_artifacts.js +5 -4
- package/build/asset-manifest.json +43 -42
- package/build/electron/main.js +13 -0
- package/build/electron/preload.js +1 -0
- package/build/index.html +1 -1
- package/build/static/js/1318.57c335d2.chunk.js +1 -0
- package/build/static/js/{142.85e6074f.chunk.js → 142.2b0ffa81.chunk.js} +1 -1
- package/build/static/js/172.599dcb6e.chunk.js +5 -0
- package/build/static/js/2327.b8572a38.chunk.js +1 -0
- package/build/static/js/2775.c1ed54fa.chunk.js +5 -0
- package/build/static/js/291.aa03bc71.chunk.js +1 -0
- package/build/static/js/3580.e292972c.chunk.js +1 -0
- package/build/static/js/3603.c075eadf.chunk.js +2 -0
- package/build/static/js/3603.c075eadf.chunk.js.LICENSE.txt +135 -0
- package/build/static/js/3744.93bd4bad.chunk.js +2 -0
- package/build/static/js/4140.edb6c36a.chunk.js +1 -0
- package/build/static/js/4141.a101e33c.chunk.js +9 -0
- package/build/static/js/5093.304fcb1e.chunk.js +1 -0
- package/build/static/js/5099.c240313c.chunk.js +1 -0
- package/build/static/js/5177.3eb35171.chunk.js +2 -0
- package/build/static/js/5241.0326c97c.chunk.js +1 -0
- package/build/static/js/5440.c723be7c.chunk.js +1 -0
- package/build/static/js/5617.6141af30.chunk.js +1 -0
- package/build/static/js/{9735.0e70600f.chunk.js → 6557.fd2f35c8.chunk.js} +1 -1
- package/build/static/js/{6422.c2900a88.chunk.js → 6683.aab9fa01.chunk.js} +1 -1
- package/build/static/js/{7842.a98fbb15.chunk.js → 6756.2cb6963c.chunk.js} +1 -1
- package/build/static/js/{6242.5e6f91ac.chunk.js → 6862.886eab8e.chunk.js} +1 -1
- package/build/static/js/6913.094a45e2.chunk.js +17 -0
- package/build/static/js/6939.c09d92c1.chunk.js +1 -0
- package/build/static/js/{7073.5619981b.chunk.js → 7073.376b9d76.chunk.js} +1 -1
- package/build/static/js/787.30ab7f34.chunk.js +1 -0
- package/build/static/js/792.45efff32.chunk.js +1 -0
- package/build/static/js/8035.dc118cc9.chunk.js +1 -0
- package/build/static/js/{6097.56c4b02a.chunk.js → 8295.c3cd87de.chunk.js} +1 -1
- package/build/static/js/8418.aed275df.chunk.js +1 -0
- package/build/static/js/8486.e56533d6.chunk.js +1 -0
- package/build/static/js/865.5abdcdc2.chunk.js +1 -0
- package/build/static/js/9004.6a66722a.chunk.js +1 -0
- package/build/static/js/9042.a6fcbc74.chunk.js +5 -0
- package/build/static/js/9107.b49ea9ea.chunk.js +5 -0
- package/build/static/js/9130.8e10440e.chunk.js +1 -0
- package/build/static/js/9166.1a468fb9.chunk.js +2 -0
- package/build/static/js/{5678.729bced9.chunk.js → 9382.c417d448.chunk.js} +1 -1
- package/build/static/js/9615.82cf4bfb.chunk.js +1 -0
- package/build/static/js/{8355.b110abc9.chunk.js → 9915.fe11690a.chunk.js} +1 -1
- package/build/static/js/main.1313208f.js +28 -0
- package/package.json +5 -4
- package/build/static/js/1367.9dcea0bc.chunk.js +0 -9
- package/build/static/js/2116.fd3de825.chunk.js +0 -1
- package/build/static/js/2458.cfb63c88.chunk.js +0 -1
- package/build/static/js/2523.4761d79a.chunk.js +0 -5
- package/build/static/js/2632.de1769ff.chunk.js +0 -1
- package/build/static/js/277.d9ceff66.chunk.js +0 -1
- package/build/static/js/3376.d5aaecc4.chunk.js +0 -1
- package/build/static/js/3392.5ed3420d.chunk.js +0 -1
- package/build/static/js/3977.24eb5fb8.chunk.js +0 -1
- package/build/static/js/4210.945a5966.chunk.js +0 -1
- package/build/static/js/4514.7931bd64.chunk.js +0 -5
- package/build/static/js/464.7c22f33c.chunk.js +0 -1
- package/build/static/js/5070.1d0d565e.chunk.js +0 -1
- package/build/static/js/5608.b4074ab9.chunk.js +0 -1
- package/build/static/js/5752.d5d30939.chunk.js +0 -1
- package/build/static/js/5865.90a40692.chunk.js +0 -17
- package/build/static/js/6223.4bb0039e.chunk.js +0 -2
- package/build/static/js/6668.8cb69721.chunk.js +0 -2
- package/build/static/js/7496.0f941cac.chunk.js +0 -1
- package/build/static/js/761.ca3883de.chunk.js +0 -1
- package/build/static/js/7698.00f5ff0b.chunk.js +0 -1
- package/build/static/js/7858.e4a6aa6d.chunk.js +0 -5
- package/build/static/js/7937.4b1be66e.chunk.js +0 -1
- package/build/static/js/8461.85faefa1.chunk.js +0 -1
- package/build/static/js/8565.f27e3917.chunk.js +0 -1
- package/build/static/js/8910.e6dda87e.chunk.js +0 -2
- package/build/static/js/91.f23bbeac.chunk.js +0 -1
- package/build/static/js/9462.81f9c52a.chunk.js +0 -1
- package/build/static/js/9551.c45b17cf.chunk.js +0 -1
- package/build/static/js/main.e1e5cd43.js +0 -28
- /package/build/static/css/{3376.60b7ada4.chunk.css → 5099.60b7ada4.chunk.css} +0 -0
- /package/build/static/js/{6668.8cb69721.chunk.js.LICENSE.txt → 3744.93bd4bad.chunk.js.LICENSE.txt} +0 -0
- /package/build/static/js/{6223.4bb0039e.chunk.js.LICENSE.txt → 5177.3eb35171.chunk.js.LICENSE.txt} +0 -0
- /package/build/static/js/{8910.e6dda87e.chunk.js.LICENSE.txt → 9166.1a468fb9.chunk.js.LICENSE.txt} +0 -0
- /package/build/static/js/{main.e1e5cd43.js.LICENSE.txt → main.1313208f.js.LICENSE.txt} +0 -0
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! For license information please see 5177.3eb35171.chunk.js.LICENSE.txt */
|
|
2
|
+
(globalThis.webpackChunk_stlite_desktop=globalThis.webpackChunk_stlite_desktop||[]).push([[5177],{44391:t=>{var e=function(){"use strict";function t(t,e){return null!=e&&t instanceof e}var e,n,r;try{e=Map}catch(s){e=function(){}}try{n=Set}catch(s){n=function(){}}try{r=Promise}catch(s){r=function(){}}function i(o,s,u,l,c){"object"===typeof s&&(u=s.depth,l=s.prototype,c=s.includeNonEnumerable,s=s.circular);var f=[],h=[],d="undefined"!=typeof Buffer;return"undefined"==typeof s&&(s=!0),"undefined"==typeof u&&(u=1/0),function o(u,p){if(null===u)return null;if(0===p)return u;var g,m;if("object"!=typeof u)return u;if(t(u,e))g=new e;else if(t(u,n))g=new n;else if(t(u,r))g=new r((function(t,e){u.then((function(e){t(o(e,p-1))}),(function(t){e(o(t,p-1))}))}));else if(i.__isArray(u))g=[];else if(i.__isRegExp(u))g=new RegExp(u.source,a(u)),u.lastIndex&&(g.lastIndex=u.lastIndex);else if(i.__isDate(u))g=new Date(u.getTime());else{if(d&&Buffer.isBuffer(u))return g=Buffer.allocUnsafe?Buffer.allocUnsafe(u.length):new Buffer(u.length),u.copy(g),g;t(u,Error)?g=Object.create(u):"undefined"==typeof l?(m=Object.getPrototypeOf(u),g=Object.create(m)):(g=Object.create(l),m=l)}if(s){var y=f.indexOf(u);if(-1!=y)return h[y];f.push(u),h.push(g)}for(var v in t(u,e)&&u.forEach((function(t,e){var n=o(e,p-1),r=o(t,p-1);g.set(n,r)})),t(u,n)&&u.forEach((function(t){var e=o(t,p-1);g.add(e)})),u){var b;m&&(b=Object.getOwnPropertyDescriptor(m,v)),b&&null==b.set||(g[v]=o(u[v],p-1))}if(Object.getOwnPropertySymbols){var x=Object.getOwnPropertySymbols(u);for(v=0;v<x.length;v++){var _=x[v];(!(A=Object.getOwnPropertyDescriptor(u,_))||A.enumerable||c)&&(g[_]=o(u[_],p-1),A.enumerable||Object.defineProperty(g,_,{enumerable:!1}))}}if(c){var w=Object.getOwnPropertyNames(u);for(v=0;v<w.length;v++){var A,D=w[v];(A=Object.getOwnPropertyDescriptor(u,D))&&A.enumerable||(g[D]=o(u[D],p-1),Object.defineProperty(g,D,{enumerable:!1}))}}return g}(o,u)}function o(t){return Object.prototype.toString.call(t)}function a(t){var e="";return t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),e}return i.clonePrototype=function(t){if(null===t)return null;var e=function(){};return e.prototype=t,new e},i.__objToStr=o,i.__isDate=function(t){return"object"===typeof t&&"[object Date]"===o(t)},i.__isArray=function(t){return"object"===typeof t&&"[object Array]"===o(t)},i.__isRegExp=function(t){return"object"===typeof t&&"[object RegExp]"===o(t)},i.__getRegExpFlags=a,i}();t.exports&&(t.exports=e)},42484:t=>{"use strict";t.exports=function t(e,n){if(e===n)return!0;if(e&&n&&"object"==typeof e&&"object"==typeof n){if(e.constructor!==n.constructor)return!1;var r,i,o;if(Array.isArray(e)){if((r=e.length)!=n.length)return!1;for(i=r;0!==i--;)if(!t(e[i],n[i]))return!1;return!0}if(e.constructor===RegExp)return e.source===n.source&&e.flags===n.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===n.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===n.toString();if((r=(o=Object.keys(e)).length)!==Object.keys(n).length)return!1;for(i=r;0!==i--;)if(!Object.prototype.hasOwnProperty.call(n,o[i]))return!1;for(i=r;0!==i--;){var a=o[i];if(!t(e[a],n[a]))return!1}return!0}return e!==e&&n!==n}},75990:t=>{"use strict";t.exports=function(t,e){e||(e={}),"function"===typeof e&&(e={cmp:e});var n,r="boolean"===typeof e.cycles&&e.cycles,i=e.cmp&&(n=e.cmp,function(t){return function(e,r){var i={key:e,value:t[e]},o={key:r,value:t[r]};return n(i,o)}}),o=[];return function t(e){if(e&&e.toJSON&&"function"===typeof e.toJSON&&(e=e.toJSON()),void 0!==e){if("number"==typeof e)return isFinite(e)?""+e:"null";if("object"!==typeof e)return JSON.stringify(e);var n,a;if(Array.isArray(e)){for(a="[",n=0;n<e.length;n++)n&&(a+=","),a+=t(e[n])||"null";return a+"]"}if(null===e)return"null";if(-1!==o.indexOf(e)){if(r)return JSON.stringify("__cycle__");throw new TypeError("Converting circular structure to JSON")}var s=o.push(e)-1,u=Object.keys(e).sort(i&&i(e));for(a="",n=0;n<u.length;n++){var l=u[n],c=t(e[l]);c&&(a&&(a+=","),a+=JSON.stringify(l)+":"+c)}return o.splice(s,1),"{"+a+"}"}}(t)}},55177:(t,e,n)=>{"use strict";n.d(e,{ZP:()=>Sx});var r={};n.r(r),n.d(r,{JsonPatchError:()=>v,_areEquals:()=>k,applyOperation:()=>A,applyPatch:()=>D,applyReducer:()=>E,deepClone:()=>b,getValueByPointer:()=>w,validate:()=>C,validator:()=>F});var i={};n.r(i),n.d(i,{compare:()=>z,generate:()=>N,observe:()=>B,unobserve:()=>T});var o={};n.r(o),n.d(o,{accessPathDepth:()=>ae,accessPathWithDatum:()=>te,compile:()=>Uy,contains:()=>Nt,deepEqual:()=>Ft,deleteNestedProperty:()=>Kt,duplicate:()=>Ct,entries:()=>Gt,every:()=>zt,fieldIntersection:()=>Wt,flatAccessWithDatum:()=>ee,getFirstDefined:()=>se,hasIntersection:()=>It,hash:()=>Tt,internalField:()=>fe,isBoolean:()=>Vt,isEmpty:()=>Ht,isEqual:()=>Lt,isInternalField:()=>he,isNullOrFalse:()=>Bt,isNumeric:()=>pe,keys:()=>Xt,logicalExpr:()=>Zt,mergeDeep:()=>Rt,never:()=>kt,normalize:()=>fc,normalizeAngle:()=>de,omit:()=>St,pick:()=>Mt,prefixGenerator:()=>qt,removePathFromField:()=>oe,replaceAll:()=>ie,replacePathInField:()=>re,resetIdCounter:()=>ce,setEqual:()=>jt,some:()=>Ot,stringify:()=>$t,titleCase:()=>Qt,unique:()=>Ut,uniqueId:()=>le,vals:()=>Yt,varName:()=>Jt,version:()=>Ly});var a={};n.r(a),n.d(a,{dark:()=>Hy,excel:()=>Yy,fivethirtyeight:()=>Ky,ggplot2:()=>tv,googlecharts:()=>_v,latimes:()=>av,powerbi:()=>Nv,quartz:()=>lv,urbaninstitute:()=>yv,version:()=>Ov,vox:()=>fv});var s=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),u=Object.prototype.hasOwnProperty;function l(t,e){return u.call(t,e)}function c(t){if(Array.isArray(t)){for(var e=new Array(t.length),n=0;n<e.length;n++)e[n]=""+n;return e}if(Object.keys)return Object.keys(t);var r=[];for(var i in t)l(t,i)&&r.push(i);return r}function f(t){switch(typeof t){case"object":return JSON.parse(JSON.stringify(t));case"undefined":return null;default:return t}}function h(t){for(var e,n=0,r=t.length;n<r;){if(!((e=t.charCodeAt(n))>=48&&e<=57))return!1;n++}return!0}function d(t){return-1===t.indexOf("/")&&-1===t.indexOf("~")?t:t.replace(/~/g,"~0").replace(/\//g,"~1")}function p(t){return t.replace(/~1/g,"/").replace(/~0/g,"~")}function g(t){if(void 0===t)return!0;if(t)if(Array.isArray(t)){for(var e=0,n=t.length;e<n;e++)if(g(t[e]))return!0}else if("object"===typeof t)for(var r=c(t),i=r.length,o=0;o<i;o++)if(g(t[r[o]]))return!0;return!1}function m(t,e){var n=[t];for(var r in e){var i="object"===typeof e[r]?JSON.stringify(e[r],null,2):e[r];"undefined"!==typeof i&&n.push(r+": "+i)}return n.join("\n")}var y=function(t){function e(e,n,r,i,o){var a=this.constructor,s=t.call(this,m(e,{name:n,index:r,operation:i,tree:o}))||this;return s.name=n,s.index=r,s.operation=i,s.tree=o,Object.setPrototypeOf(s,a.prototype),s.message=m(e,{name:n,index:r,operation:i,tree:o}),s}return s(e,t),e}(Error),v=y,b=f,x={add:function(t,e,n){return t[e]=this.value,{newDocument:n}},remove:function(t,e,n){var r=t[e];return delete t[e],{newDocument:n,removed:r}},replace:function(t,e,n){var r=t[e];return t[e]=this.value,{newDocument:n,removed:r}},move:function(t,e,n){var r=w(n,this.path);r&&(r=f(r));var i=A(n,{op:"remove",path:this.from}).removed;return A(n,{op:"add",path:this.path,value:i}),{newDocument:n,removed:r}},copy:function(t,e,n){var r=w(n,this.from);return A(n,{op:"add",path:this.path,value:f(r)}),{newDocument:n}},test:function(t,e,n){return{newDocument:n,test:k(t[e],this.value)}},_get:function(t,e,n){return this.value=t[e],{newDocument:n}}},_={add:function(t,e,n){return h(e)?t.splice(e,0,this.value):t[e]=this.value,{newDocument:n,index:e}},remove:function(t,e,n){return{newDocument:n,removed:t.splice(e,1)[0]}},replace:function(t,e,n){var r=t[e];return t[e]=this.value,{newDocument:n,removed:r}},move:x.move,copy:x.copy,test:x.test,_get:x._get};function w(t,e){if(""==e)return t;var n={op:"_get",path:e};return A(t,n),n.value}function A(t,e,n,r,i,o){if(void 0===n&&(n=!1),void 0===r&&(r=!0),void 0===i&&(i=!0),void 0===o&&(o=0),n&&("function"==typeof n?n(e,0,t,e.path):F(e,0)),""===e.path){var a={newDocument:t};if("add"===e.op)return a.newDocument=e.value,a;if("replace"===e.op)return a.newDocument=e.value,a.removed=t,a;if("move"===e.op||"copy"===e.op)return a.newDocument=w(t,e.from),"move"===e.op&&(a.removed=t),a;if("test"===e.op){if(a.test=k(t,e.value),!1===a.test)throw new v("Test operation failed","TEST_OPERATION_FAILED",o,e,t);return a.newDocument=t,a}if("remove"===e.op)return a.removed=t,a.newDocument=null,a;if("_get"===e.op)return e.value=t,a;if(n)throw new v("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",o,e,t);return a}r||(t=f(t));var s=(e.path||"").split("/"),u=t,l=1,c=s.length,d=void 0,g=void 0,m=void 0;for(m="function"==typeof n?n:F;;){if((g=s[l])&&-1!=g.indexOf("~")&&(g=p(g)),i&&("__proto__"==g||"prototype"==g&&l>0&&"constructor"==s[l-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===d&&(void 0===u[g]?d=s.slice(0,l).join("/"):l==c-1&&(d=e.path),void 0!==d&&m(e,0,t,d)),l++,Array.isArray(u)){if("-"===g)g=u.length;else{if(n&&!h(g))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,e,t);h(g)&&(g=~~g)}if(l>=c){if(n&&"add"===e.op&&g>u.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,e,t);if(!1===(a=_[e.op].call(e,u,g,t)).test)throw new v("Test operation failed","TEST_OPERATION_FAILED",o,e,t);return a}}else if(l>=c){if(!1===(a=x[e.op].call(e,u,g,t)).test)throw new v("Test operation failed","TEST_OPERATION_FAILED",o,e,t);return a}if(u=u[g],n&&l<c&&(!u||"object"!==typeof u))throw new v("Cannot perform operation at the desired path","OPERATION_PATH_UNRESOLVABLE",o,e,t)}}function D(t,e,n,r,i){if(void 0===r&&(r=!0),void 0===i&&(i=!0),n&&!Array.isArray(e))throw new v("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");r||(t=f(t));for(var o=new Array(e.length),a=0,s=e.length;a<s;a++)o[a]=A(t,e[a],n,!0,i,a),t=o[a].newDocument;return o.newDocument=t,o}function E(t,e,n){var r=A(t,e);if(!1===r.test)throw new v("Test operation failed","TEST_OPERATION_FAILED",n,e,t);return r.newDocument}function F(t,e,n,r){if("object"!==typeof t||null===t||Array.isArray(t))throw new v("Operation is not an object","OPERATION_NOT_AN_OBJECT",e,t,n);if(!x[t.op])throw new v("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",e,t,n);if("string"!==typeof t.path)throw new v("Operation `path` property is not a string","OPERATION_PATH_INVALID",e,t,n);if(0!==t.path.indexOf("/")&&t.path.length>0)throw new v('Operation `path` property must start with "/"',"OPERATION_PATH_INVALID",e,t,n);if(("move"===t.op||"copy"===t.op)&&"string"!==typeof t.from)throw new v("Operation `from` property is not present (applicable in `move` and `copy` operations)","OPERATION_FROM_REQUIRED",e,t,n);if(("add"===t.op||"replace"===t.op||"test"===t.op)&&void 0===t.value)throw new v("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_REQUIRED",e,t,n);if(("add"===t.op||"replace"===t.op||"test"===t.op)&&g(t.value))throw new v("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_CANNOT_CONTAIN_UNDEFINED",e,t,n);if(n)if("add"==t.op){var i=t.path.split("/").length,o=r.split("/").length;if(i!==o+1&&i!==o)throw new v("Cannot perform an `add` operation at the desired path","OPERATION_PATH_CANNOT_ADD",e,t,n)}else if("replace"===t.op||"remove"===t.op||"_get"===t.op){if(t.path!==r)throw new v("Cannot perform the operation at a path that does not exist","OPERATION_PATH_UNRESOLVABLE",e,t,n)}else if("move"===t.op||"copy"===t.op){var a=C([{op:"_get",path:t.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",e,t,n)}}function C(t,e,n){try{if(!Array.isArray(t))throw new v("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");if(e)D(f(e),f(t),n||!0);else{n=n||F;for(var r=0;r<t.length;r++)n(t[r],r,e,void 0)}}catch(i){if(i instanceof v)return i;throw i}}function k(t,e){if(t===e)return!0;if(t&&e&&"object"==typeof t&&"object"==typeof e){var n,r,i,o=Array.isArray(t),a=Array.isArray(e);if(o&&a){if((r=t.length)!=e.length)return!1;for(n=r;0!==n--;)if(!k(t[n],e[n]))return!1;return!0}if(o!=a)return!1;var s=Object.keys(t);if((r=s.length)!==Object.keys(e).length)return!1;for(n=r;0!==n--;)if(!e.hasOwnProperty(s[n]))return!1;for(n=r;0!==n--;)if(!k(t[i=s[n]],e[i]))return!1;return!0}return t!==t&&e!==e}var M=new WeakMap,S=function(t){this.observers=new Map,this.obj=t},$=function(t,e){this.callback=t,this.observer=e};function T(t,e){e.unobserve()}function B(t,e){var n,r=function(t){return M.get(t)}(t);if(r){var i=function(t,e){return t.observers.get(e)}(r,e);n=i&&i.observer}else r=new S(t),M.set(t,r);if(n)return n;if(n={},r.value=f(t),e){n.callback=e,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=t,n.unobserve=function(){N(n),clearTimeout(n.next),function(t,e){t.observers.delete(e.callback)}(r,n),"undefined"!==typeof window&&(window.removeEventListener("mouseup",a),window.removeEventListener("keyup",a),window.removeEventListener("mousedown",a),window.removeEventListener("keydown",a),window.removeEventListener("change",a))},r.observers.set(e,new $(e,n)),n}function N(t,e){void 0===e&&(e=!1);var n=M.get(t.object);O(n.value,t.object,t.patches,"",e),t.patches.length&&D(n.value,t.patches);var r=t.patches;return r.length>0&&(t.patches=[],t.callback&&t.callback(r)),r}function O(t,e,n,r,i){if(e!==t){"function"===typeof e.toJSON&&(e=e.toJSON());for(var o=c(e),a=c(t),s=!1,u=a.length-1;u>=0;u--){var h=t[g=a[u]];if(!l(e,g)||void 0===e[g]&&void 0!==h&&!1===Array.isArray(e))Array.isArray(t)===Array.isArray(e)?(i&&n.push({op:"test",path:r+"/"+d(g),value:f(h)}),n.push({op:"remove",path:r+"/"+d(g)}),s=!0):(i&&n.push({op:"test",path:r,value:t}),n.push({op:"replace",path:r,value:e}),!0);else{var p=e[g];"object"==typeof h&&null!=h&&"object"==typeof p&&null!=p&&Array.isArray(h)===Array.isArray(p)?O(h,p,n,r+"/"+d(g),i):h!==p&&(!0,i&&n.push({op:"test",path:r+"/"+d(g),value:f(h)}),n.push({op:"replace",path:r+"/"+d(g),value:f(p)}))}}if(s||o.length!=a.length)for(u=0;u<o.length;u++){var g;l(t,g=o[u])||void 0===e[g]||n.push({op:"add",path:r+"/"+d(g),value:f(e[g])})}}}function z(t,e,n){void 0===n&&(n=!1);var r=[];return O(t,e,r,"",n),r}Object.assign({},r,i,{JsonPatchError:y,deepClone:f,escapePathComponent:d,unescapePathComponent:p});var R=n(58381),P=n.n(R),U=n(42915),L=n(79220);function j(t,e,n){return t.fields=e||[],t.fname=n,t}function I(t){return 1===t.length?q(t[0]):W(t)}const q=t=>function(e){return e[t]},W=t=>{const e=t.length;return function(n){for(let r=0;r<e;++r)n=n[t[r]];return n}};function H(t){throw Error(t)}function X(t){const e=[],n=t.length;let r,i,o,a=null,s=0,u="";function l(){e.push(u+t.substring(r,i)),u="",r=i+1}for(t+="",r=i=0;i<n;++i)if(o=t[i],"\\"===o)u+=t.substring(r,i++),r=i;else if(o===a)l(),a=null,s=-1;else{if(a)continue;r===s&&'"'===o||r===s&&"'"===o?(r=i+1,a=o):"."!==o||s?"["===o?(i>r&&l(),s=r=i+1):"]"===o&&(s||H("Access path missing open bracket: "+t),s>0&&l(),s=0,r=i+1):i>r?l():r=i+1}return s&&H("Access path missing closing bracket: "+t),a&&H("Access path missing closing quote: "+t),i>r&&(i++,l()),e}function Y(t,e,n){const r=X(t);return t=1===r.length?r[0]:t,j((n&&n.get||I)(r),[t],e||t)}Y("id");const G=j((t=>t),[],"identity");j((()=>0),[],"zero"),j((()=>1),[],"one"),j((()=>!0),[],"true"),j((()=>!1),[],"false");function V(t,e,n){const r=[e].concat([].slice.call(n));console[t].apply(console,r)}const J=0,Z=1,K=2,Q=3,tt=4;var et=Array.isArray;function nt(t){return t===Object(t)}const rt=t=>"__proto__"!==t;function it(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return e.reduce(((t,e)=>{for(const n in e)if("signals"===n)t.signals=at(t.signals,e.signals);else{const r="legend"===n?{layout:1}:"style"===n||null;ot(t,n,e[n],r)}return t}),{})}function ot(t,e,n,r){if(!rt(e))return;let i,o;if(nt(n)&&!et(n))for(i in o=nt(t[e])?t[e]:t[e]={},n)r&&(!0===r||r[i])?ot(o,i,n[i]):rt(i)&&(o[i]=n[i]);else t[e]=n}function at(t,e){if(null==t)return e;const n={},r=[];function i(t){n[t.name]||(n[t.name]=1,r.push(t))}return e.forEach(i),t.forEach(i),r}function st(t){return null!=t?et(t)?t:[t]:[]}function ut(t){return"function"===typeof t}const lt=Object.prototype.hasOwnProperty;function ct(t,e){return lt.call(t,e)}function ft(t){return"boolean"===typeof t}function ht(t){return"number"===typeof t}function dt(t){return"string"===typeof t}function pt(t){return et(t)?"["+t.map(pt)+"]":nt(t)||dt(t)?JSON.stringify(t).replace("\u2028","\\u2028").replace("\u2029","\\u2029"):t}var gt=n(44391),mt=n.n(gt),yt=n(42484),vt=n.n(yt),bt=n(75990),xt=n.n(bt);function _t(t){return!!t.or}function wt(t){return!!t.and}function At(t){return!!t.not}function Dt(t,e){if(At(t))Dt(t.not,e);else if(wt(t))for(const n of t.and)Dt(n,e);else if(_t(t))for(const n of t.or)Dt(n,e);else e(t)}function Et(t,e){return At(t)?{not:Et(t.not,e)}:wt(t)?{and:t.and.map((t=>Et(t,e)))}:_t(t)?{or:t.or.map((t=>Et(t,e)))}:e(t)}const Ft=vt(),Ct=mt();function kt(t){throw new Error(t)}function Mt(t,e){const n={};for(const r of e)ct(t,r)&&(n[r]=t[r]);return n}function St(t,e){const n={...t};for(const r of e)delete n[r];return n}Set.prototype.toJSON=function(){return`Set(${[...this].map((t=>xt()(t))).join(",")})`};const $t=xt();function Tt(t){if(ht(t))return t;const e=dt(t)?t:xt()(t);if(e.length<250)return e;let n=0;for(let r=0;r<e.length;r++){n=(n<<5)-n+e.charCodeAt(r),n&=n}return n}function Bt(t){return!1===t||null===t}function Nt(t,e){return t.includes(e)}function Ot(t,e){let n=0;for(const[r,i]of t.entries())if(e(i,r,n++))return!0;return!1}function zt(t,e){let n=0;for(const[r,i]of t.entries())if(!e(i,r,n++))return!1;return!0}function Rt(t,...e){for(const n of e)Pt(t,n??{});return t}function Pt(t,e){for(const n of Xt(e))ot(t,n,e[n],!0)}function Ut(t,e){const n=[],r={};let i;for(const o of t)i=e(o),i in r||(r[i]=1,n.push(o));return n}function Lt(t,e){const n=Xt(t),r=Xt(e);if(n.length!==r.length)return!1;for(const i of n)if(t[i]!==e[i])return!1;return!0}function jt(t,e){if(t.size!==e.size)return!1;for(const n of t)if(!e.has(n))return!1;return!0}function It(t,e){for(const n of t)if(e.has(n))return!0;return!1}function qt(t){const e=new Set;for(const n of t){const t=X(n).map(((t,e)=>0===e?t:`[${t}]`)),r=t.map(((e,n)=>t.slice(0,n+1).join("")));for(const n of r)e.add(n)}return e}function Wt(t,e){return void 0===t||void 0===e||It(qt(t),qt(e))}function Ht(t){return 0===Xt(t).length}const Xt=Object.keys,Yt=Object.values,Gt=Object.entries;function Vt(t){return!0===t||!1===t}function Jt(t){const e=t.replace(/\W/g,"_");return(t.match(/^\d+/)?"_":"")+e}function Zt(t,e){return At(t)?`!(${Zt(t.not,e)})`:wt(t)?`(${t.and.map((t=>Zt(t,e))).join(") && (")})`:_t(t)?`(${t.or.map((t=>Zt(t,e))).join(") || (")})`:e(t)}function Kt(t,e){if(0===e.length)return!0;const n=e.shift();return n in t&&Kt(t[n],e)&&delete t[n],Ht(t)}function Qt(t){return t.charAt(0).toUpperCase()+t.substr(1)}function te(t,e="datum"){const n=X(t),r=[];for(let i=1;i<=n.length;i++){const t=`[${n.slice(0,i).map(pt).join("][")}]`;r.push(`${e}${t}`)}return r.join(" && ")}function ee(t,e="datum"){return`${e}[${pt(X(t).join("."))}]`}function ne(t){return t.replace(/(\[|\]|\.|'|")/g,"\\$1")}function re(t){return`${X(t).map(ne).join("\\.")}`}function ie(t,e,n){return t.replace(new RegExp(e.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),"g"),n)}function oe(t){return`${X(t).join(".")}`}function ae(t){return t?X(t).length:0}function se(...t){for(const e of t)if(void 0!==e)return e}let ue=42;function le(t){const e=++ue;return t?String(t)+e:e}function ce(){ue=42}function fe(t){return he(t)?t:`__${t}`}function he(t){return t.startsWith("__")}function de(t){if(void 0!==t)return(t%360+360)%360}function pe(t){return!!ht(t)||!isNaN(t)&&!isNaN(parseFloat(t))}const ge="row",me="column",ye="facet",ve="x",be="y",xe="x2",_e="y2",we="xOffset",Ae="yOffset",De="radius",Ee="radius2",Fe="theta",Ce="theta2",ke="latitude",Me="longitude",Se="latitude2",$e="longitude2",Te="color",Be="fill",Ne="stroke",Oe="shape",ze="size",Re="angle",Pe="opacity",Ue="fillOpacity",Le="strokeOpacity",je="strokeWidth",Ie="strokeDash",qe="text",We="order",He="detail",Xe="key",Ye="tooltip",Ge="href",Ve="url",Je="description",Ze={theta:1,theta2:1,radius:1,radius2:1};function Ke(t){return t in Ze}const Qe={longitude:1,longitude2:1,latitude:1,latitude2:1};function tn(t){switch(t){case ke:return"y";case Se:return"y2";case Me:return"x";case $e:return"x2"}}function en(t){return t in Qe}const nn=Xt(Qe),rn={x:1,y:1,x2:1,y2:1,...Ze,...Qe,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 on(t){return t===Te||t===Be||t===Ne}const an={row:1,column:1,facet:1},sn=Xt(an),un={...rn,...an},ln=Xt(un),{order:cn,detail:fn,tooltip:hn,...dn}=un,{row:pn,column:gn,facet:mn,...yn}=dn;Xt(dn),Xt(yn);function vn(t){return!!un[t]}const bn=[xe,_e,Se,$e,Ce,Ee];function xn(t){return _n(t)!==t}function _n(t){switch(t){case xe:return ve;case _e:return be;case Se:return ke;case $e:return Me;case Ce:return Fe;case Ee:return De}return t}function wn(t){if(Ke(t))switch(t){case Fe:return"startAngle";case Ce:return"endAngle";case De:return"outerRadius";case Ee:return"innerRadius"}return t}function An(t){switch(t){case ve:return xe;case be:return _e;case ke:return Se;case Me:return $e;case Fe:return Ce;case De:return Ee}}function Dn(t){switch(t){case ve:case xe:return"width";case be:case _e:return"height"}}function En(t){switch(t){case ve:return"xOffset";case be:return"yOffset";case xe:return"x2Offset";case _e:return"y2Offset";case Fe:return"thetaOffset";case De:return"radiusOffset";case Ce:return"theta2Offset";case Ee:return"radius2Offset"}}function Fn(t){switch(t){case ve:return"xOffset";case be:return"yOffset"}}function Cn(t){switch(t){case"xOffset":return"x";case"yOffset":return"y"}}const kn=Xt(rn),{x:Mn,y:Sn,x2:$n,y2:Tn,xOffset:Bn,yOffset:Nn,latitude:On,longitude:zn,latitude2:Rn,longitude2:Pn,theta:Un,theta2:Ln,radius:jn,radius2:In,...qn}=rn,Wn=Xt(qn),Hn={x:1,y:1},Xn=Xt(Hn);function Yn(t){return t in Hn}const Gn={theta:1,radius:1},Vn=Xt(Gn);function Jn(t){return"width"===t?ve:be}const Zn={xOffset:1,yOffset:1};Xt(Zn);function Kn(t){return t in Zn}const{text:Qn,tooltip:tr,href:er,url:nr,description:rr,detail:ir,key:or,order:ar,...sr}=qn,ur=Xt(sr);const lr={...Hn,...Gn,...Zn,...sr},cr=Xt(lr);function fr(t){return!!lr[t]}function hr(t,e){return function(t){switch(t){case Te:case Be:case Ne:case Je:case He:case Xe:case Ye:case Ge:case We:case Pe:case Ue:case Le:case je:case ye:case ge:case me:return dr;case ve:case be:case we:case Ae:case ke:case Me:return gr;case xe:case _e:case Se:case $e:return{area:"always",bar:"always",image:"always",rect:"always",rule:"always",circle:"binned",point:"binned",square:"binned",tick:"binned",line:"binned",trail:"binned"};case ze:return{point:"always",tick:"always",rule:"always",circle:"always",square:"always",bar:"always",text:"always",line:"always",trail:"always"};case Ie:return{line:"always",point:"always",tick:"always",rule:"always",circle:"always",square:"always",bar:"always",geoshape:"always"};case Oe:return{point:"always",geoshape:"always"};case qe:return{text:"always"};case Re:return{point:"always",square:"always",text:"always"};case Ve:return{image:"always"};case Fe:case De:return{text:"always",arc:"always"};case Ce:case Ee:return{arc:"always"}}}(t)[e]}const dr={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:pr,...gr}=dr;function mr(t){switch(t){case ve:case be:case Fe:case De:case we:case Ae:case ze:case Re:case je:case Pe:case Ue:case Le:case xe:case _e:case Ce:case Ee:return;case ye:case ge:case me:case Oe:case Ie:case qe:case Ye:case Ge:case Ve:case Je:return"discrete";case Te:case Be:case Ne:return"flexible";case ke:case Me:case Se:case $e:case He:case Xe:case We:return}}const yr={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},vr={count:1,min:1,max:1};function br(t){return!!t&&!!t.argmin}function xr(t){return!!t&&!!t.argmax}function _r(t){return dt(t)&&!!yr[t]}const wr=new Set(["count","valid","missing","distinct"]);function Ar(t){return dt(t)&&wr.has(t)}const Dr=new Set(["count","sum","distinct","valid","missing"]),Er=new Set(["mean","average","median","q1","q3","min","max"]);function Fr(t){return ft(t)&&(t=Us(t,void 0)),"bin"+Xt(t).map((e=>Sr(t[e])?Jt(`_${e}_${Gt(t[e])}`):Jt(`_${e}_${t[e]}`))).join("")}function Cr(t){return!0===t||Mr(t)&&!t.binned}function kr(t){return"binned"===t||Mr(t)&&!0===t.binned}function Mr(t){return nt(t)}function Sr(t){return t?.param}function $r(t){switch(t){case ge:case me:case ze:case Te:case Be:case Ne:case je:case Pe:case Ue:case Le:case Oe:return 6;case Ie:return 4;default:return 10}}function Tr(t){return!!t?.expr}function Br(t){const e=Xt(t||{}),n={};for(const r of e)n[r]=qr(t[r]);return n}function Nr(t){const{anchor:e,frame:n,offset:r,orient:i,angle:o,limit:a,color:s,subtitleColor:u,subtitleFont:l,subtitleFontSize:c,subtitleFontStyle:f,subtitleFontWeight:h,subtitleLineHeight:d,subtitlePadding:p,...g}=t,m={...e?{anchor:e}:{},...n?{frame:n}:{},...r?{offset:r}:{},...i?{orient:i}:{},...void 0!==o?{angle:o}:{},...void 0!==a?{limit:a}:{}},y={...u?{subtitleColor:u}:{},...l?{subtitleFont:l}:{},...c?{subtitleFontSize:c}:{},...f?{subtitleFontStyle:f}:{},...h?{subtitleFontWeight:h}:{},...d?{subtitleLineHeight:d}:{},...p?{subtitlePadding:p}:{}};return{titleMarkConfig:{...g,...s?{fill:s}:{}},subtitleMarkConfig:Mt(t,["align","baseline","dx","dy","limit"]),nonMarkTitleProperties:m,subtitle:y}}function Or(t){return dt(t)||et(t)&&dt(t[0])}function zr(t){return!!t?.signal}function Rr(t){return!!t.step}function Pr(t){return!et(t)&&("field"in t&&"data"in t)}const Ur=Xt({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}),Lr={arc:1,area:1,group:1,image:1,line:1,path:1,rect:1,rule:1,shape:1,symbol:1,text:1,trail:1},jr=["cornerRadius","cornerRadiusTopLeft","cornerRadiusTopRight","cornerRadiusBottomLeft","cornerRadiusBottomRight"];function Ir(t){const e=et(t.condition)?t.condition.map(Wr):Wr(t.condition);return{...qr(t),condition:e}}function qr(t){if(Tr(t)){const{expr:e,...n}=t;return{signal:e,...n}}return t}function Wr(t){if(Tr(t)){const{expr:e,...n}=t;return{signal:e,...n}}return t}function Hr(t){if(Tr(t)){const{expr:e,...n}=t;return{signal:e,...n}}return zr(t)?t:void 0!==t?{value:t}:void 0}function Xr(t){return zr(t)?t.signal:pt(t.value)}function Yr(t){return zr(t)?t.signal:null==t?null:pt(t)}function Gr(t,e,n){for(const r of n){const n=Zr(r,e.markDef,e.config);void 0!==n&&(t[r]=Hr(n))}return t}function Vr(t){return[].concat(t.type,t.style??[])}function Jr(t,e,n,r={}){const{vgChannel:i,ignoreVgConfig:o}=r;return i&&void 0!==e[i]?e[i]:void 0!==e[t]?e[t]:!o||i&&i!==t?Zr(t,e,n,r):void 0}function Zr(t,e,n,{vgChannel:r}={}){return se(r?Kr(t,e,n.style):void 0,Kr(t,e,n.style),r?n[e.type][r]:void 0,n[e.type][t],r?n.mark[r]:n.mark[t])}function Kr(t,e,n){return Qr(t,Vr(e),n)}function Qr(t,e,n){let r;e=st(e);for(const i of e){const e=n[i];e&&void 0!==e[t]&&(r=e[t])}return r}function ti(t,e){return st(t).reduce(((t,n)=>(t.field.push(Es(n,e)),t.order.push(n.sort??"ascending"),t)),{field:[],order:[]})}function ei(t,e){const n=[...t];return e.forEach((t=>{for(const e of n)if(Ft(e,t))return;n.push(t)})),n}function ni(t,e){return Ft(t,e)||!e?t:t?[...st(t),...st(e)].join(", "):e}function ri(t,e){const n=t.value,r=e.value;if(null==n||null===r)return{explicit:t.explicit,value:null};if((Or(n)||zr(n))&&(Or(r)||zr(r)))return{explicit:t.explicit,value:ni(n,r)};if(Or(n)||zr(n))return{explicit:t.explicit,value:n};if(Or(r)||zr(r))return{explicit:t.explicit,value:r};if(!Or(n)&&!zr(n)&&!Or(r)&&!zr(r))return{explicit:t.explicit,value:ei(n,r)};throw new Error("It should never reach here")}function ii(t){return`Invalid specification ${$t(t)}. Make sure the specification includes at least one of the following properties: "mark", "layer", "facet", "hconcat", "vconcat", "concat", or "repeat".`}const oi='Autosize "fit" only works for single views and layered views.';function ai(t){return`${"width"==t?"Width":"Height"} "container" only works for single views and layered views.`}function si(t){return`${"width"==t?"Width":"Height"} "container" only works well with autosize "fit" or "fit-${"width"==t?"x":"y"}".`}function ui(t){return t?`Dropping "fit-${t}" because spec has discrete ${Dn(t)}.`:'Dropping "fit" because spec has discrete size.'}function li(t){return`Unknown field for ${t}. Cannot calculate view size.`}function ci(t){return`Cannot project a selection on encoding channel "${t}", which has no field.`}function fi(t,e){return`Cannot project a selection on encoding channel "${t}" as it uses an aggregate function ("${e}").`}function hi(t){return`Selection not supported for ${t} yet.`}const di="The same selection must be used to override scale domains in a layered view.";function pi(t){return`The "columns" property cannot be used when "${t}" has nested row/column.`}function gi(t,e,n){return`An ancestor parsed field "${t}" as ${n} but a child wants to parse the field as ${e}.`}function mi(t){return`Config.customFormatTypes is not true, thus custom format type and format for channel ${t} are dropped.`}const yi="Arc marks uses theta channel rather than angle, replacing angle with theta.";function vi(t){return`${t}Offset dropped because ${t} is continuous`}function bi(t){return`There is no ${t} encoding. Replacing ${t}Offset encoding as ${t}.`}function xi(t){return`Invalid field type "${t}".`}function _i(t,e){const{fill:n,stroke:r}=e;return`Dropping color ${t} as the plot also has ${n&&r?"fill and stroke":n?"fill":"stroke"}.`}function wi(t,e){return`Dropping ${$t(t)} from channel "${e}" since it does not contain any data field, datum, value, or signal.`}const Ai="Line marks cannot encode size with a non-groupby field. You may want to use trail marks instead.";function Di(t,e,n){return`${t} dropped as it is incompatible with "${e}"${n?` when ${n}`:""}.`}function Ei(t){return`${t} encoding has no scale, so specified scale is ignored.`}function Fi(t){return`${t} encoding should be discrete (ordinal / nominal / binned).`}function Ci(t){return`${t} encoding should be discrete (ordinal / nominal / binned) or use a discretizing scale (e.g. threshold).`}function ki(t,e){return`Using discrete channel "${t}" to encode "${e}" field can be misleading as it does not encode ${"ordinal"===e?"order":"magnitude"}.`}function Mi(t){return`Using unaggregated domain with raw field has no effect (${$t(t)}).`}function Si(t){return`Unaggregated domain not applicable for "${t}" since it produces values outside the origin domain of the source data.`}function $i(t){return`Unaggregated domain is currently unsupported for log scale (${$t(t)}).`}function Ti(t,e,n){return`${n}-scale's "${e}" is dropped as it does not work with ${t} scale.`}function Bi(t){return`The step for "${t}" is dropped because the ${"width"===t?"x":"y"} is continuous.`}const Ni="Domains that should be unioned has conflicting sort properties. Sort will be set to true.",Oi="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.",zi="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.",Ri="Detected faceted independent scales that union domain of multiple fields from the same data source. We will use the first field. The result view size may be incorrect.";function Pi(t,e){return`Invalid ${t}: ${$t(e)}.`}function Ui(t){return`1D error band does not support ${t}.`}function Li(t){return`Channel ${t} is required for "binned" bin.`}const ji=function(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:V,r=t||J;return{level(t){return arguments.length?(r=+t,this):r},error(){return r>=Z&&n(e||"error","ERROR",arguments),this},warn(){return r>=K&&n(e||"warn","WARN",arguments),this},info(){return r>=Q&&n(e||"log","INFO",arguments),this},debug(){return r>=tt&&n(e||"log","DEBUG",arguments),this}}}(K);let Ii=ji;function qi(){return Ii=ji,Ii}function Wi(...t){Ii.warn(...t)}function Hi(t){if(t&&nt(t))for(const e of Qi)if(e in t)return!0;return!1}new WeakMap;const Xi=["january","february","march","april","may","june","july","august","september","october","november","december"],Yi=Xi.map((t=>t.substr(0,3))),Gi=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"],Vi=Gi.map((t=>t.substr(0,3)));function Ji(t,e){const n=[];if(e&&void 0!==t.day&&Xt(t).length>1&&(Wi(function(t){return`Dropping day from datetime ${$t(t)} as day cannot be combined with other units.`}(t)),delete(t=Ct(t)).day),void 0!==t.year?n.push(t.year):n.push(2012),void 0!==t.month){const r=e?function(t){if(pe(t)&&(t=+t),ht(t))return t-1;{const e=t.toLowerCase(),n=Xi.indexOf(e);if(-1!==n)return n;const r=e.substr(0,3),i=Yi.indexOf(r);if(-1!==i)return i;throw new Error(Pi("month",t))}}(t.month):t.month;n.push(r)}else if(void 0!==t.quarter){const r=e?function(t){if(pe(t)&&(t=+t),ht(t))return t>4&&Wi(Pi("quarter",t)),t-1;throw new Error(Pi("quarter",t))}(t.quarter):t.quarter;n.push(ht(r)?3*r:`${r}*3`)}else n.push(0);if(void 0!==t.date)n.push(t.date);else if(void 0!==t.day){const r=e?function(t){if(pe(t)&&(t=+t),ht(t))return t%7;{const e=t.toLowerCase(),n=Gi.indexOf(e);if(-1!==n)return n;const r=e.substr(0,3),i=Vi.indexOf(r);if(-1!==i)return i;throw new Error(Pi("day",t))}}(t.day):t.day;n.push(ht(r)?r+1:`${r}+1`)}else n.push(1);for(const r of["hours","minutes","seconds","milliseconds"]){const e=t[r];n.push("undefined"===typeof e?0:e)}return n}function Zi(t){const e=Ji(t,!0).join(", ");return t.utc?`utc(${e})`:`datetime(${e})`}const Ki={year:1,quarter:1,month:1,week:1,day:1,dayofyear:1,date:1,hours:1,minutes:1,seconds:1,milliseconds:1},Qi=Xt(Ki);function to(t){return t.startsWith("utc")}const eo={"year-month":"%b %Y ","year-month-date":"%b %d, %Y "};function no(t){return Qi.filter((e=>ro(t,e)))}function ro(t,e){const n=t.indexOf(e);return!(n<0)&&(!(n>0&&"seconds"===e&&"i"===t.charAt(n-1))&&(!(t.length>n+3&&"day"===e&&"o"===t.charAt(n+3))&&!(n>0&&"year"===e&&"f"===t.charAt(n-1))))}function io(t,e,{end:n}={end:!1}){const r=te(e),i=to(t)?"utc":"";let o;const a={};for(const u of Qi)ro(t,u)&&(a[u]="quarter"===(s=u)?`(${i}quarter(${r})-1)`:`${i}${s}(${r})`,o=u);var s;return n&&(a[o]+="+1"),function(t){const e=Ji(t,!1).join(", ");return t.utc?`utc(${e})`:`datetime(${e})`}(a)}function oo(t){if(!t)return;const e=no(t);return`timeUnitSpecifier(${$t(e)}, ${$t(eo)})`}function ao(t){if(!t)return;let e;return dt(t)?e={unit:t}:nt(t)&&(e={...t,...t.unit?{unit:t.unit}:{}}),to(e.unit)&&(e.utc=!0,e.unit=function(t){return t.substr(3)}(e.unit)),e}function so(t,e=(t=>t)){const n=ao(t),r=function(t){const e=no(t);return e[e.length-1]}(n.unit);if(r&&"day"!==r){const t={year:2001,month:1,date:1,hours:0,minutes:0,seconds:0,milliseconds:0},i=n.step||1;return`${e(Zi({...t,..."quarter"===r?{month:+t.month+3*i}:"week"===r?{date:+t.date+7*i}:{[r]:+t[r]+i}}))} - ${e(Zi(t))}`}}function uo(t){return!!t?.field&&void 0!==t.equal}function lo(t){return!!t?.field&&void 0!==t.lt}function co(t){return!!t?.field&&void 0!==t.lte}function fo(t){return!!t?.field&&void 0!==t.gt}function ho(t){return!!t?.field&&void 0!==t.gte}function po(t){if(t?.field){if(et(t.range)&&2===t.range.length)return!0;if(zr(t.range))return!0}return!1}function go(t){return!!t?.field&&(et(t.oneOf)||et(t.in))}function mo(t){return go(t)||uo(t)||po(t)||lo(t)||fo(t)||co(t)||ho(t)}function yo(t,e){return Is(t,{timeUnit:e,wrapTime:!0})}function vo(t,e=!0){const{field:n}=t,r=ao(t.timeUnit)?.unit,i=r?`time(${io(r,n)})`:Es(t,{expr:"datum"});if(uo(t))return`${i}===${yo(t.equal,r)}`;if(lo(t)){return`${i}<${yo(t.lt,r)}`}if(fo(t)){return`${i}>${yo(t.gt,r)}`}if(co(t)){return`${i}<=${yo(t.lte,r)}`}if(ho(t)){return`${i}>=${yo(t.gte,r)}`}if(go(t))return`indexof([${function(t,e){return t.map((t=>yo(t,e)))}(t.oneOf,r).join(",")}], ${i}) !== -1`;if(function(t){return!!t?.field&&void 0!==t.valid}(t))return bo(i,t.valid);if(po(t)){const{range:n}=t,o=zr(n)?{signal:`${n.signal}[0]`}:n[0],a=zr(n)?{signal:`${n.signal}[1]`}:n[1];if(null!==o&&null!==a&&e)return"inrange("+i+", ["+yo(o,r)+", "+yo(a,r)+"])";const s=[];return null!==o&&s.push(`${i} >= ${yo(o,r)}`),null!==a&&s.push(`${i} <= ${yo(a,r)}`),s.length>0?s.join(" && "):"true"}throw new Error(`Invalid field predicate: ${$t(t)}`)}function bo(t,e=!0){return e?`isValid(${t}) && isFinite(+${t})`:`!isValid(${t}) || !isFinite(+${t})`}function xo(t){return mo(t)&&t.timeUnit?{...t,timeUnit:ao(t.timeUnit)?.unit}:t}const _o={quantitative:"quantitative",ordinal:"ordinal",temporal:"temporal",nominal:"nominal",geojson:"geojson"};function wo(t){return"quantitative"===t||"temporal"===t}function Ao(t){return"ordinal"===t||"nominal"===t}const Do=_o.quantitative,Eo=_o.ordinal,Fo=_o.temporal,Co=_o.nominal,ko=_o.geojson;Xt(_o);const Mo={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"},So={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"};Xt(So);function $o(t,e){const n=So[t],r=So[e];return n===r||"ordinal-position"===n&&"time"===r||"ordinal-position"===r&&"time"===n}const To={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 Bo(t){return To[t]}const No=new Set(["linear","log","pow","sqrt","symlog"]),Oo=new Set([...No,"time","utc"]);function zo(t){return No.has(t)}const Ro=new Set(["quantile","quantize","threshold"]),Po=new Set([...Oo,...Ro,"sequential","identity"]),Uo=new Set(["ordinal","bin-ordinal","point","band"]);new Set(["time","utc"]);function Lo(t){return Uo.has(t)}function jo(t){return Po.has(t)}function Io(t){return Oo.has(t)}function qo(t){return Ro.has(t)}function Wo(t){return t?.param}const Ho={type:1,domain:1,domainMax:1,domainMin:1,domainMid: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:Xo,domain:Yo,range:Go,rangeMax:Vo,rangeMin:Jo,scheme:Zo,...Ko}=(Xt(Ho),Ho),Qo=Xt(Ko);function ta(t,e){switch(e){case"type":case"domain":case"reverse":case"range":return!0;case"scheme":case"interpolate":return!["point","band","identity"].includes(t);case"bins":return!["point","band","identity","ordinal"].includes(t);case"round":return Io(t)||"band"===t||"point"===t;case"padding":case"rangeMin":case"rangeMax":return Io(t)||["point","band"].includes(t);case"paddingOuter":case"align":return["point","band"].includes(t);case"paddingInner":return"band"===t;case"domainMax":case"domainMid":case"domainMin":case"clamp":return Io(t);case"nice":return Io(t)||"quantize"===t||"threshold"===t;case"exponent":return"pow"===t;case"base":return"log"===t;case"constant":return"symlog"===t;case"zero":return jo(t)&&!Nt(["log","time","utc","threshold","quantile"],t)}}function ea(t,e){switch(e){case"interpolate":case"scheme":case"domainMid":return on(t)?void 0:`Cannot use the scale property "${e}" with non-color channel.`;case"align":case"type":case"bins":case"domain":case"domainMax":case"domainMin":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 na={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"},ra=na.arc,ia=na.area,oa=na.bar,aa=na.image,sa=na.line,ua=na.point,la=na.rect,ca=na.rule,fa=na.text,ha=na.tick,da=na.trail,pa=na.circle,ga=na.square,ma=na.geoshape;function ya(t){return["line","area","trail"].includes(t)}function va(t){return["rect","bar","image","arc"].includes(t)}const ba=new Set(Xt(na));function xa(t){return t.type}const _a=["stroke","strokeWidth","strokeDash","strokeDashOffset","strokeOpacity","strokeJoin","strokeMiterLimit","fill","fillOpacity"],wa=Xt({color:1,filled:1,invalid:1,order:1,radius2:1,theta2:1,timeUnitBandSize:1,timeUnitBandPosition:1}),Aa=Xt({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 Da(t){return t&&void 0!=t.band}const Ea={horizontal:["cornerRadiusTopRight","cornerRadiusBottomRight"],vertical:["cornerRadiusTopLeft","cornerRadiusTopRight"]},Fa={binSpacing:1,continuousBandSize:5,minBandSize:.25,timeUnitBandPosition:.5},Ca={binSpacing:0,continuousBandSize:5,minBandSize:.25,timeUnitBandPosition:.5};function ka(t){const{channel:e,channelDef:n,markDef:r,scale:i,config:o}=t,a=Ba(t);return fs(n)&&!Ar(n.aggregate)&&i&&Io(i.get("type"))?function({fieldDef:t,channel:e,markDef:n,ref:r,config:i}){if(ya(n.type))return r;const o=Jr("invalid",n,i);if(null===o)return[Ma(t,e),r];return r}({fieldDef:n,channel:e,markDef:r,ref:a,config:o}):a}function Ma(t,e){return{test:Sa(t,!0),..."y"===_n(e)?{field:{group:"height"}}:{value:0}}}function Sa(t,e=!0){return bo(dt(t)?t:Es(t,{expr:"datum"}),!e)}function $a(t,e,n,r){const i={};if(e&&(i.scale=e),ds(t)){const{datum:e}=t;Hi(e)?i.signal=Zi(e):zr(e)?i.signal=e.signal:Tr(e)?i.signal=e.expr:i.value=e}else i.field=Es(t,n);if(r){const{offset:t,band:e}=r;t&&(i.offset=t),e&&(i.band=e)}return i}function Ta({scaleName:t,fieldOrDatumDef:e,fieldOrDatumDef2:n,offset:r,startSuffix:i,bandPosition:o=.5}){const a=0<o&&o<1?"datum":void 0,s=Es(e,{expr:a,suffix:i}),u=void 0!==n?Es(n,{expr:a}):Es(e,{suffix:"end",expr:a}),l={};if(0===o||1===o){l.scale=t;const e=0===o?s:u;l.field=e}else{const e=zr(o)?`${o.signal} * ${s} + (1-${o.signal}) * ${u}`:`${o} * ${s} + ${1-o} * ${u}`;l.signal=`scale("${t}", ${e})`}return r&&(l.offset=r),l}function Ba({channel:t,channelDef:e,channel2Def:n,markDef:r,config:i,scaleName:o,scale:a,stack:s,offset:u,defaultRef:l,bandPosition:c}){if(e){if(ys(e)){const l=a?.get("type");if(vs(e)){c??(c=is({fieldDef:e,fieldDef2:n,markDef:r,config:i}));const{bin:a,timeUnit:f,type:h}=e;if(Cr(a)||c&&f&&h===Fo)return s?.impute?$a(e,o,{binSuffix:"mid"},{offset:u}):c&&!Lo(l)?Ta({scaleName:o,fieldOrDatumDef:e,bandPosition:c,offset:u}):$a(e,o,Ws(e,t)?{binSuffix:"range"}:{},{offset:u});if(kr(a)){if(fs(n))return Ta({scaleName:o,fieldOrDatumDef:e,fieldOrDatumDef2:n,bandPosition:c,offset:u});Wi(Li(t===ve?xe:_e))}}return $a(e,o,Lo(l)?{binSuffix:"range"}:{},{offset:u,band:"band"===l?c??e.bandPosition??.5:void 0})}if(bs(e)){const n=u?{offset:u}:{};return{...Na(t,e.value),...n}}}return ut(l)&&(l=l()),l?{...l,...u?{offset:u}:{}}:l}function Na(t,e){return Nt(["x","x2"],t)&&"width"===e?{field:{group:"width"}}:Nt(["y","y2"],t)&&"height"===e?{field:{group:"height"}}:Hr(e)}function Oa(t){return t&&"number"!==t&&"time"!==t}function za(t,e,n){return`${t}(${e}${n?`, ${$t(n)}`:""})`}const Ra=" \u2013 ";function Pa({fieldOrDatumDef:t,format:e,formatType:n,expr:r,normalizeStack:i,config:o}){if(Oa(n))return La({fieldOrDatumDef:t,format:e,formatType:n,expr:r,config:o});const a=Ua(t,r,i),s=hs(t);if(void 0===e&&void 0===n&&o.customFormatTypes){if("quantitative"===s){if(i&&o.normalizedNumberFormatType)return La({fieldOrDatumDef:t,format:o.normalizedNumberFormat,formatType:o.normalizedNumberFormatType,expr:r,config:o});if(o.numberFormatType)return La({fieldOrDatumDef:t,format:o.numberFormat,formatType:o.numberFormatType,expr:r,config:o})}if("temporal"===s&&o.timeFormatType&&fs(t)&&void 0===t.timeUnit)return La({fieldOrDatumDef:t,format:o.timeFormat,formatType:o.timeFormatType,expr:r,config:o})}if(js(t)){const n=function({field:t,timeUnit:e,format:n,formatType:r,rawTimeFormat:i,isUTCScale:o}){return!e||n?!e&&r?`${r}(${t}, '${n}')`:`${o?"utc":"time"}Format(${t}, '${n=dt(n)?n:i}')`:function(t,e,n){if(!t)return;const r=oo(t);return`${n||to(t)?"utc":"time"}Format(${e}, ${r})`}(e,t,o)}({field:a,timeUnit:fs(t)?ao(t.timeUnit)?.unit:void 0,format:e,formatType:o.timeFormatType,rawTimeFormat:o.timeFormat,isUTCScale:xs(t)&&t.scale?.type===Mo.UTC});return n?{signal:n}:void 0}if(e=qa({type:s,specifiedFormat:e,config:o,normalizeStack:i}),fs(t)&&Cr(t.bin)){return{signal:Xa(a,Es(t,{expr:r,binSuffix:"end"}),e,n,o)}}return e||"quantitative"===hs(t)?{signal:`${Wa(a,e)}`}:{signal:`isValid(${a}) ? ${a} : ""+${a}`}}function Ua(t,e,n){return fs(t)?n?`${Es(t,{expr:e,suffix:"end"})}-${Es(t,{expr:e,suffix:"start"})}`:Es(t,{expr:e}):function(t){const{datum:e}=t;return Hi(e)?Zi(e):`${$t(e)}`}(t)}function La({fieldOrDatumDef:t,format:e,formatType:n,expr:r,normalizeStack:i,config:o,field:a}){if(a??(a=Ua(t,r,i)),"datum.value"!==a&&fs(t)&&Cr(t.bin)){return{signal:Xa(a,Es(t,{expr:r,binSuffix:"end"}),e,n,o)}}return{signal:za(n,a,e)}}function ja(t,e,n,r,i,o){if(!dt(r)||!Oa(r)){if(void 0===n&&void 0===r&&i.customFormatTypes&&"quantitative"===hs(t)){if(i.normalizedNumberFormatType&&_s(t)&&"normalize"===t.stack)return;if(i.numberFormatType)return}if(_s(t)&&"normalize"===t.stack&&i.normalizedNumberFormat)return qa({type:"quantitative",config:i,normalizeStack:!0});if(js(t)){const e=fs(t)?ao(t.timeUnit)?.unit:void 0;if(void 0===e&&i.customFormatTypes&&i.timeFormatType)return;return function({specifiedFormat:t,timeUnit:e,config:n,omitTimeFormatConfig:r}){if(t)return t;if(e)return{signal:oo(e)};return r?void 0:n.timeFormat}({specifiedFormat:n,timeUnit:e,config:i,omitTimeFormatConfig:o})}return qa({type:e,specifiedFormat:n,config:i})}}function Ia(t,e,n){return t&&(zr(t)||"number"===t||"time"===t)?t:js(e)&&"time"!==n&&"utc"!==n?fs(e)&&ao(e?.timeUnit)?.utc?"utc":"time":void 0}function qa({type:t,specifiedFormat:e,config:n,normalizeStack:r}){return dt(e)?e:t===Do?r?n.normalizedNumberFormat:n.numberFormat:void 0}function Wa(t,e){return`format(${t}, "${e||""}")`}function Ha(t,e,n,r){return Oa(n)?za(n,t,e):Wa(t,(dt(e)?e:void 0)??r.numberFormat)}function Xa(t,e,n,r,i){if(void 0===n&&void 0===r&&i.customFormatTypes&&i.numberFormatType)return Xa(t,e,i.numberFormat,i.numberFormatType,i);const o=Ha(t,n,r,i),a=Ha(e,n,r,i);return`${bo(t,!1)} ? "null" : ${o} + "${Ra}" + ${a}`}const Ya="min",Ga={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 Va(t){return t in Ga}function Ja(t){return!!t?.encoding}function Za(t){return t&&("count"===t.op||!!t.field)}function Ka(t){return t&&et(t)}function Qa(t){return"row"in t||"column"in t}function ts(t){return!!t&&"header"in t}function es(t){return"facet"in t}function ns(t){const{field:e,timeUnit:n,bin:r,aggregate:i}=t;return{...n?{timeUnit:n}:{},...r?{bin:r}:{},...i?{aggregate:i}:{},field:e}}function rs(t){return"sort"in t}function is({fieldDef:t,fieldDef2:e,markDef:n,config:r}){if(ys(t)&&void 0!==t.bandPosition)return t.bandPosition;if(fs(t)){const{timeUnit:i,bin:o}=t;if(i&&!e)return va(n.type)?0:Zr("timeUnitBandPosition",n,r);if(Cr(o))return.5}}function os({channel:t,fieldDef:e,fieldDef2:n,markDef:r,config:i,scaleType:o,useVlSizeChannel:a}){const s=Dn(t),u=Jr(a?"size":s,r,i,{vgChannel:s});if(void 0!==u)return u;if(fs(e)){const{timeUnit:t,bin:a}=e;if(t&&!n)return{band:Zr("timeUnitBandSize",r,i)};if(Cr(a)&&!Lo(o))return{band:1}}return va(r.type)?o?Lo(o)?i[r.type]?.discreteBandSize||{band:1}:i[r.type]?.continuousBandSize:i[r.type]?.discreteBandSize:void 0}function as(t,e,n,r){return!!(Cr(t.bin)||t.timeUnit&&vs(t)&&"temporal"===t.type)&&void 0!==is({fieldDef:t,fieldDef2:e,markDef:n,config:r})}function ss(t){return t&&!!t.sort&&!t.field}function us(t){return t&&"condition"in t}function ls(t){const e=t?.condition;return!!e&&!et(e)&&fs(e)}function cs(t){const e=t?.condition;return!!e&&!et(e)&&ys(e)}function fs(t){return t&&(!!t.field||"count"===t.aggregate)}function hs(t){return t?.type}function ds(t){return t&&"datum"in t}function ps(t){return vs(t)&&!Fs(t)||ms(t)}function gs(t){return vs(t)&&"quantitative"===t.type&&!t.bin||ms(t)}function ms(t){return ds(t)&&ht(t.datum)}function ys(t){return fs(t)||ds(t)}function vs(t){return t&&("field"in t||"count"===t.aggregate)&&"type"in t}function bs(t){return t&&"value"in t&&"value"in t}function xs(t){return t&&("scale"in t||"sort"in t)}function _s(t){return t&&("axis"in t||"stack"in t||"impute"in t)}function ws(t){return t&&"legend"in t}function As(t){return t&&("format"in t||"formatType"in t)}function Ds(t){return St(t,["legend","axis","header","scale"])}function Es(t,e={}){let n=t.field;const r=e.prefix;let i=e.suffix,o="";if(function(t){return"count"===t.aggregate}(t))n=fe("count");else{let r;if(!e.nofn)if(function(t){return"op"in t}(t))r=t.op;else{const{bin:a,aggregate:s,timeUnit:u}=t;Cr(a)?(r=Fr(a),i=(e.binSuffix??"")+(e.suffix??"")):s?xr(s)?(o=`["${n}"]`,n=`argmax_${s.argmax}`):br(s)?(o=`["${n}"]`,n=`argmin_${s.argmin}`):r=String(s):u&&(r=function(t){const{utc:e,...n}=ao(t);return n.unit?(e?"utc":"")+Xt(n).map((t=>Jt(`${"unit"===t?"":`_${t}_`}${n[t]}`))).join(""):(e?"utc":"")+"timeunit"+Xt(n).map((t=>Jt(`_${t}_${n[t]}`))).join("")}(u),i=(!["range","mid"].includes(e.binSuffix)&&e.binSuffix||"")+(e.suffix??""))}r&&(n=n?`${r}_${n}`:r)}return i&&(n=`${n}_${i}`),r&&(n=`${r}_${n}`),e.forAs?oe(n):e.expr?ee(n,e.expr)+o:re(n)+o}function Fs(t){switch(t.type){case"nominal":case"ordinal":case"geojson":return!0;case"quantitative":return fs(t)&&!!t.bin;case"temporal":return!1}throw new Error(xi(t.type))}const Cs=(t,e)=>{switch(e.fieldTitle){case"plain":return t.field;case"functional":return function(t){const{aggregate:e,bin:n,timeUnit:r,field:i}=t;if(xr(e))return`${i} for argmax(${e.argmax})`;if(br(e))return`${i} for argmin(${e.argmin})`;const o=ao(r),a=e||o?.unit||o?.maxbins&&"timeunit"||Cr(n)&&"bin";return a?`${a.toUpperCase()}(${i})`:i}(t);default:return function(t,e){const{field:n,bin:r,timeUnit:i,aggregate:o}=t;if("count"===o)return e.countTitle;if(Cr(r))return`${n} (binned)`;if(i){const t=ao(i)?.unit;if(t)return`${n} (${no(t).join("-")})`}else if(o)return xr(o)?`${n} for max ${o.argmax}`:br(o)?`${n} for min ${o.argmin}`:`${Qt(o)} of ${n}`;return n}(t,e)}};let ks=Cs;function Ms(t){ks=t}function Ss(t,e,{allowDisabling:n,includeDefault:r=!0}){const i=$s(t)?.title;if(!fs(t))return i??t.title;const o=t,a=r?Ts(o,e):void 0;return n?se(i,o.title,a):i??o.title??a}function $s(t){return _s(t)&&t.axis?t.axis:ws(t)&&t.legend?t.legend:ts(t)&&t.header?t.header:void 0}function Ts(t,e){return ks(t,e)}function Bs(t){if(As(t)){const{format:e,formatType:n}=t;return{format:e,formatType:n}}{const e=$s(t)??{},{format:n,formatType:r}=e;return{format:n,formatType:r}}}function Ns(t){return fs(t)?t:ls(t)?t.condition:void 0}function Os(t){return ys(t)?t:cs(t)?t.condition:void 0}function zs(t,e,n,r={}){if(dt(t)||ht(t)||ft(t)){return Wi(function(t,e,n){return`Channel ${t} is a ${e}. Converted to {value: ${$t(n)}}.`}(e,dt(t)?"string":ht(t)?"number":"boolean",t)),{value:t}}return ys(t)?Rs(t,e,n,r):cs(t)?{...t,condition:Rs(t.condition,e,n,r)}:t}function Rs(t,e,n,r){if(As(t)){const{format:i,formatType:o,...a}=t;if(Oa(o)&&!n.customFormatTypes)return Wi(mi(e)),Rs(a,e,n,r)}else{const i=_s(t)?"axis":ws(t)?"legend":ts(t)?"header":null;if(i&&t[i]){const{format:o,formatType:a,...s}=t[i];if(Oa(a)&&!n.customFormatTypes)return Wi(mi(e)),Rs({...t,[i]:s},e,n,r)}}return fs(t)?Ps(t,e,r):function(t){let e=t.type;if(e)return t;const{datum:n}=t;return e=ht(n)?"quantitative":dt(n)?"nominal":Hi(n)?"temporal":void 0,{...t,type:e}}(t)}function Ps(t,e,{compositeMark:n=!1}={}){const{aggregate:r,timeUnit:i,bin:o,field:a}=t,s={...t};if(n||!r||_r(r)||xr(r)||br(r)||(Wi(function(t){return`Invalid aggregation operator "${t}".`}(r)),delete s.aggregate),i&&(s.timeUnit=ao(i)),a&&(s.field=`${a}`),Cr(o)&&(s.bin=Us(o,e)),kr(o)&&!Yn(e)&&Wi(function(t){return`Channel ${t} should not be used with "binned" bin.`}(e)),vs(s)){const{type:t}=s,e=function(t){if(t)switch(t=t.toLowerCase()){case"q":case Do:return"quantitative";case"t":case Fo:return"temporal";case"o":case Eo:return"ordinal";case"n":case Co:return"nominal";case ko:return"geojson"}}(t);t!==e&&(s.type=e),"quantitative"!==t&&Ar(r)&&(Wi(function(t,e){return`Invalid field type "${t}" for aggregate: "${e}", using "quantitative" instead.`}(t,r)),s.type="quantitative")}else if(!xn(e)){const t=function(t,e){switch(e){case"latitude":case"longitude":return"quantitative";case"row":case"column":case"facet":case"shape":case"strokeDash":return"nominal";case"order":return"ordinal"}if(rs(t)&&et(t.sort))return"ordinal";const{aggregate:n,bin:r,timeUnit:i}=t;if(i)return"temporal";if(r||n&&!xr(n)&&!br(n))return"quantitative";if(xs(t)&&t.scale?.type)switch(So[t.scale.type]){case"numeric":case"discretizing":return"quantitative";case"time":return"temporal"}return"nominal"}(s,e);s.type=t}if(vs(s)){const{compatible:t,warning:n}=function(t,e){const n=t.type;if("geojson"===n&&"shape"!==e)return{compatible:!1,warning:`Channel ${e} should not be used with a geojson data.`};switch(e){case ge:case me:case ye:return Fs(t)?Ls:{compatible:!1,warning:Fi(e)};case ve:case be:case we:case Ae:case Te:case Be:case Ne:case qe:case He:case Xe:case Ye:case Ge:case Ve:case Re:case Fe:case De:case Je:return Ls;case Me:case $e:case ke:case Se:return n!==Do?{compatible:!1,warning:`Channel ${e} should be used with a quantitative field only, not ${t.type} field.`}:Ls;case Pe:case Ue:case Le:case je:case ze:case Ce:case Ee:case xe:case _e:return"nominal"!==n||t.sort?Ls:{compatible:!1,warning:`Channel ${e} should not be used with an unsorted discrete field.`};case Oe:case Ie:return Fs(t)||xs(r=t)&&qo(r.scale?.type)?Ls:{compatible:!1,warning:Ci(e)};case We:return"nominal"!==t.type||"sort"in t?Ls:{compatible:!1,warning:"Channel order is inappropriate for nominal field, which has no inherent order."}}var r}(s,e)||{};!1===t&&Wi(n)}if(rs(s)&&dt(s.sort)){const{sort:t}=s;if(Va(t))return{...s,sort:{encoding:t}};const e=t.substr(1);if("-"===t.charAt(0)&&Va(e))return{...s,sort:{encoding:e,order:"descending"}}}if(ts(s)){const{header:t}=s;if(t){const{orient:e,...n}=t;if(e)return{...s,header:{...n,labelOrient:t.labelOrient||e,titleOrient:t.titleOrient||e}}}}return s}function Us(t,e){return ft(t)?{maxbins:$r(e)}:"binned"===t?{binned:!0}:t.maxbins||t.step?t:{...t,maxbins:$r(e)}}const Ls={compatible:!0};function js(t){const{formatType:e}=Bs(t);return"time"===e||!e&&((n=t)&&("temporal"===n.type||fs(n)&&!!n.timeUnit));var n}function Is(t,{timeUnit:e,type:n,wrapTime:r,undefinedIfExprNotRequired:i}){const o=e&&ao(e)?.unit;let a,s=o||"temporal"===n;return Tr(t)?a=t.expr:zr(t)?a=t.signal:Hi(t)?(s=!0,a=Zi(t)):(dt(t)||ht(t))&&s&&(a=`datetime(${$t(t)})`,function(t){return!!Ki[t]}(o)&&(ht(t)&&t<1e4||dt(t)&&isNaN(Date.parse(t)))&&(a=Zi({[o]:t}))),a?r&&s?`time(${a})`:a:i?void 0:$t(t)}function qs(t,e){const{type:n}=t;return e.map((e=>{const r=Is(e,{timeUnit:fs(t)?t.timeUnit:void 0,type:n,undefinedIfExprNotRequired:!0});return void 0!==r?{signal:r}:e}))}function Ws(t,e){return Cr(t.bin)?fr(e)&&["ordinal","nominal"].includes(t.type):(console.warn("Only call this method for binned field defs."),!1)}const Hs={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 Xs(t){return t?.condition}const Ys=["domain","grid","labels","ticks","title"],Gs={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"},Vs={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},Js={...Vs,style:1,labelExpr:1,encoding:1};function Zs(t){return!!Js[t]}Xt(Js);const Ks=Xt({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 Qs(t){return"mark"in t}class tu{constructor(t,e){this.name=t,this.run=e}hasMatchingType(t){return!!Qs(t)&&(xa(e=t.mark)?e.type:e)===this.name;var e}}function eu(t,e){const n=t&&t[e];return!!n&&(et(n)?Ot(n,(t=>!!t.field)):fs(n)||ls(n))}function nu(t,e){const n=t&&t[e];return!!n&&(et(n)?Ot(n,(t=>!!t.field)):fs(n)||ds(n)||cs(n))}function ru(t,e){if(Yn(e)){const n=t[e];if((fs(n)||ds(n))&&(Ao(n.type)||fs(n)&&n.timeUnit)){return nu(t,Fn(e))}}return!1}function iu(t){return Ot(ln,(e=>{if(eu(t,e)){const n=t[e];if(et(n))return Ot(n,(t=>!!t.aggregate));{const t=Ns(n);return t&&!!t.aggregate}}return!1}))}function ou(t,e){const n=[],r=[],i=[],o=[],a={};return uu(t,((s,u)=>{if(fs(s)){const{field:l,aggregate:c,bin:f,timeUnit:h,...d}=s;if(c||h||f){const t=$s(s)?.title;let p=Es(s,{forAs:!0});const g={...t?[]:{title:Ss(s,e,{allowDisabling:!0})},...d,field:p};if(c){let t;if(xr(c)?(t="argmax",p=Es({op:"argmax",field:c.argmax},{forAs:!0}),g.field=`${p}.${l}`):br(c)?(t="argmin",p=Es({op:"argmin",field:c.argmin},{forAs:!0}),g.field=`${p}.${l}`):"boxplot"!==c&&"errorbar"!==c&&"errorband"!==c&&(t=c),t){const e={op:t,as:p};l&&(e.field=l),o.push(e)}}else if(n.push(p),vs(s)&&Cr(f)){if(r.push({bin:f,field:l,as:p}),n.push(Es(s,{binSuffix:"end"})),Ws(s,u)&&n.push(Es(s,{binSuffix:"range"})),Yn(u)){const t={field:`${p}_end`};a[`${u}2`]=t}g.bin="binned",xn(u)||(g.type=Do)}else if(h){i.push({timeUnit:h,field:l,as:p});const t=vs(s)&&s.type!==Fo&&"time";t&&(u===qe||u===Ye?g.formatType=t:!function(t){return!!qn[t]}(u)?Yn(u)&&(g.axis={formatType:t,...g.axis}):g.legend={formatType:t,...g.legend})}a[u]=g}else n.push(l),a[u]=t[u]}else a[u]=t[u]})),{bins:r,timeUnits:i,aggregate:o,groupby:n,encoding:a}}function au(t,e,n){const r=hr(e,n);if(!r)return!1;if("binned"===r){const n=t[e===xe?ve:be];return!!(fs(n)&&fs(t[e])&&kr(n.bin))}return!0}function su(t,e){const n={};for(const r of Xt(t)){const i=zs(t[r],r,e,{compositeMark:!0});n[r]=i}return n}function uu(t,e,n){if(t)for(const r of Xt(t)){const i=t[r];if(et(i))for(const t of i)e.call(n,t,r);else e.call(n,i,r)}}function lu(t,e){return Xt(e).reduce(((n,r)=>{switch(r){case ve:case be:case Ge:case Je:case Ve:case xe:case _e:case we:case Ae:case Fe:case Ce:case De:case Ee:case ke:case Me:case Se:case $e:case qe:case Oe:case Re:case Ye:return n;case We:if("line"===t||"trail"===t)return n;case He:case Xe:{const t=e[r];if(et(t)||fs(t))for(const e of st(t))e.aggregate||n.push(Es(e,{}));return n}case ze:if("trail"===t)return n;case Te:case Be:case Ne:case Pe:case Ue:case Le:case Ie:case je:{const t=Ns(e[r]);return t&&!t.aggregate&&n.push(Es(t,{})),n}}}),[])}function cu(t,e,n,r=!0){if("tooltip"in n)return{tooltip:n.tooltip};return{tooltip:[...t.map((({fieldPrefix:t,titlePrefix:n})=>{const i=r?` of ${fu(e)}`:"";return{field:t+e.field,type:e.type,title:zr(n)?{signal:`${n}"${escape(i)}"`}:n+i}})),...Ut(function(t){const e=[];for(const n of Xt(t))if(eu(t,n)){const r=st(t[n]);for(const t of r)fs(t)?e.push(t):ls(t)&&e.push(t.condition)}return e}(n).map(Ds),Tt)]}}function fu(t){const{title:e,field:n}=t;return se(e,n)}function hu(t,e,n,r,i){const{scale:o,axis:a}=n;return({partName:s,mark:u,positionPrefix:l,endPositionPrefix:c,extraEncoding:f={}})=>{const h=fu(n);return du(t,s,i,{mark:u,encoding:{[e]:{field:`${l}_${n.field}`,type:n.type,...void 0!==h?{title:h}:{},...void 0!==o?{scale:o}:{},...void 0!==a?{axis:a}:{}},...dt(c)?{[`${e}2`]:{field:`${c}_${n.field}`}}:{},...r,...f}})}}function du(t,e,n,r){const{clip:i,color:o,opacity:a}=t,s=t.type;return t[e]||void 0===t[e]&&n[e]?[{...r,mark:{...n[e],...i?{clip:i}:{},...o?{color:o}:{},...a?{opacity:a}:{},...xa(r.mark)?r.mark:{type:r.mark},style:`${s}-${String(e)}`,...ft(t[e])?{}:t[e]}}]:[]}function pu(t,e,n){const{encoding:r}=t,i="vertical"===e?"y":"x",o=r[i],a=r[`${i}2`],s=r[`${i}Error`],u=r[`${i}Error2`];return{continuousAxisChannelDef:gu(o,n),continuousAxisChannelDef2:gu(a,n),continuousAxisChannelDefError:gu(s,n),continuousAxisChannelDefError2:gu(u,n),continuousAxis:i}}function gu(t,e){if(t?.aggregate){const{aggregate:n,...r}=t;return n!==e&&Wi(function(t,e){return`Continuous axis should not have customized aggregation function ${t}; ${e} already agregates the axis.`}(n,e)),r}return t}function mu(t,e){const{mark:n,encoding:r}=t,{x:i,y:o}=r;if(xa(n)&&n.orient)return n.orient;if(ps(i)){if(ps(o)){const t=fs(i)&&i.aggregate,n=fs(o)&&o.aggregate;if(t||n!==e){if(n||t!==e){if(t===e&&n===e)throw new Error("Both x and y cannot have aggregate");return js(o)&&!js(i)?"horizontal":"vertical"}return"horizontal"}return"vertical"}return"horizontal"}if(ps(o))return"vertical";throw new Error(`Need a valid continuous axis for ${e}s`)}const yu="boxplot",vu=new tu(yu,xu);function bu(t){return ht(t)?"tukey":t}function xu(t,{config:e}){t={...t,encoding:su(t.encoding,e)};const{mark:n,encoding:r,params:i,projection:o,...a}=t,s=xa(n)?n:{type:n};i&&Wi(hi("boxplot"));const u=s.extent??e.boxplot.extent,l=Jr("size",s,e),c=s.invalid,f=bu(u),{bins:h,timeUnits:d,transform:p,continuousAxisChannelDef:g,continuousAxis:m,groupby:y,aggregate:v,encodingWithoutContinuousAxis:b,ticksOrient:x,boxOrient:_,customTooltipWithoutAggregatedField:w}=function(t,e,n){const r=mu(t,yu),{continuousAxisChannelDef:i,continuousAxis:o}=pu(t,r,yu),a=i.field,s=bu(e),u=[..._u(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}],l="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}"] * ${e}, datum["max_${a}"])`,as:`upper_whisker_${a}`},{calculate:`max(datum["lower_box_${a}"] - datum["iqr_${a}"] * ${e}, datum["min_${a}"])`,as:`lower_whisker_${a}`}],{[o]:c,...f}=t.encoding,{customTooltipWithoutAggregatedField:h,filteredEncoding:d}=function(t){const{tooltip:e,...n}=t;if(!e)return{filteredEncoding:n};let r,i;if(et(e)){for(const t of e)t.aggregate?(r||(r=[]),r.push(t)):(i||(i=[]),i.push(t));r&&(n.tooltip=r)}else e.aggregate?n.tooltip=e:i=e;return et(i)&&1===i.length&&(i=i[0]),{customTooltipWithoutAggregatedField:i,filteredEncoding:n}}(f),{bins:p,timeUnits:g,aggregate:m,groupby:y,encoding:v}=ou(d,n),b="vertical"===r?"horizontal":"vertical",x=r,_=[...p,...g,{aggregate:[...m,...u],groupby:y},...l];return{bins:p,timeUnits:g,transform:_,groupby:y,aggregate:m,continuousAxisChannelDef:i,continuousAxis:o,encodingWithoutContinuousAxis:v,ticksOrient:b,boxOrient:x,customTooltipWithoutAggregatedField:h}}(t,u,e),{color:A,size:D,...E}=b,F=t=>hu(s,m,g,t,e.boxplot),C=F(E),k=F(b),M=F({...E,...D?{size:D}:{}}),S=cu([{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"}],g,b),$={type:"tick",color:"black",opacity:1,orient:x,invalid:c,aria:!1},T="min-max"===f?S:cu([{fieldPrefix:"upper_whisker_",titlePrefix:"Upper Whisker"},{fieldPrefix:"lower_whisker_",titlePrefix:"Lower Whisker"}],g,b),B=[...C({partName:"rule",mark:{type:"rule",invalid:c,aria:!1},positionPrefix:"lower_whisker",endPositionPrefix:"lower_box",extraEncoding:T}),...C({partName:"rule",mark:{type:"rule",invalid:c,aria:!1},positionPrefix:"upper_box",endPositionPrefix:"upper_whisker",extraEncoding:T}),...C({partName:"ticks",mark:$,positionPrefix:"lower_whisker",extraEncoding:T}),...C({partName:"ticks",mark:$,positionPrefix:"upper_whisker",extraEncoding:T})],N=[..."tukey"!==f?B:[],...k({partName:"box",mark:{type:"bar",...l?{size:l}:{},orient:_,invalid:c,ariaRoleDescription:"box"},positionPrefix:"lower_box",endPositionPrefix:"upper_box",extraEncoding:S}),...M({partName:"median",mark:{type:"tick",invalid:c,...nt(e.boxplot.median)&&e.boxplot.median.color?{color:e.boxplot.median.color}:{},...l?{size:l}:{},orient:x,aria:!1},positionPrefix:"mid_box",extraEncoding:S})];if("min-max"===f)return{...a,transform:(a.transform??[]).concat(p),layer:N};const O=`datum["lower_box_${g.field}"]`,z=`datum["upper_box_${g.field}"]`,R=`(${z} - ${O})`,P=`${O} - ${u} * ${R}`,U=`${z} + ${u} * ${R}`,L=`datum["${g.field}"]`,j={joinaggregate:_u(g.field),groupby:y},I={transform:[{filter:`(${P} <= ${L}) && (${L} <= ${U})`},{aggregate:[{op:"min",field:g.field,as:`lower_whisker_${g.field}`},{op:"max",field:g.field,as:`upper_whisker_${g.field}`},{op:"min",field:`lower_box_${g.field}`,as:`lower_box_${g.field}`},{op:"max",field:`upper_box_${g.field}`,as:`upper_box_${g.field}`},...v],groupby:y}],layer:B},{tooltip:q,...W}=E,{scale:H,axis:X}=g,Y=fu(g),G=St(X,["title"]),V=du(s,"outliers",e.boxplot,{transform:[{filter:`(${L} < ${P}) || (${L} > ${U})`}],mark:"point",encoding:{[m]:{field:g.field,type:g.type,...void 0!==Y?{title:Y}:{},...void 0!==H?{scale:H}:{},...Ht(G)?{}:{axis:G}},...W,...A?{color:A}:{},...w?{tooltip:w}:{}}})[0];let J;const Z=[...h,...d,j];return V?J={transform:Z,layer:[V,I]}:(J=I,J.transform.unshift(...Z)),{...a,layer:[J,{transform:p,layer:N}]}}function _u(t){return[{op:"q1",field:t,as:`lower_box_${t}`},{op:"q3",field:t,as:`upper_box_${t}`}]}const wu="errorbar",Au=new tu(wu,Du);function Du(t,{config:e}){t={...t,encoding:su(t.encoding,e)};const{transform:n,continuousAxisChannelDef:r,continuousAxis:i,encodingWithoutContinuousAxis:o,ticksOrient:a,markDef:s,outerSpec:u,tooltipEncoding:l}=Fu(t,wu,e);delete o.size;const c=hu(s,i,r,o,e.errorbar),f=s.thickness,h=s.size,d={type:"tick",orient:a,aria:!1,...void 0!==f?{thickness:f}:{},...void 0!==h?{size:h}:{}},p=[...c({partName:"ticks",mark:d,positionPrefix:"lower",extraEncoding:l}),...c({partName:"ticks",mark:d,positionPrefix:"upper",extraEncoding:l}),...c({partName:"rule",mark:{type:"rule",ariaRoleDescription:"errorbar",...void 0!==f?{size:f}:{}},positionPrefix:"lower",endPositionPrefix:"upper",extraEncoding:l})];return{...u,transform:n,...p.length>1?{layer:p}:{...p[0]}}}function Eu(t,e){const{encoding:n}=t;if(function(t){return(ys(t.x)||ys(t.y))&&!ys(t.x2)&&!ys(t.y2)&&!ys(t.xError)&&!ys(t.xError2)&&!ys(t.yError)&&!ys(t.yError2)}(n))return{orient:mu(t,e),inputType:"raw"};const r=function(t){return ys(t.x2)||ys(t.y2)}(n),i=function(t){return ys(t.xError)||ys(t.xError2)||ys(t.yError)||ys(t.yError2)}(n),o=n.x,a=n.y;if(r){if(i)throw new Error(`${e} cannot be both type aggregated-upper-lower and aggregated-error`);const t=n.x2,r=n.y2;if(ys(t)&&ys(r))throw new Error(`${e} cannot have both x2 and y2`);if(ys(t)){if(ps(o))return{orient:"horizontal",inputType:"aggregated-upper-lower"};throw new Error(`Both x and x2 have to be quantitative in ${e}`)}if(ys(r)){if(ps(a))return{orient:"vertical",inputType:"aggregated-upper-lower"};throw new Error(`Both y and y2 have to be quantitative in ${e}`)}throw new Error("No ranged axis")}{const t=n.xError,r=n.xError2,i=n.yError,s=n.yError2;if(ys(r)&&!ys(t))throw new Error(`${e} cannot have xError2 without xError`);if(ys(s)&&!ys(i))throw new Error(`${e} cannot have yError2 without yError`);if(ys(t)&&ys(i))throw new Error(`${e} cannot have both xError and yError with both are quantiative`);if(ys(t)){if(ps(o))return{orient:"horizontal",inputType:"aggregated-error"};throw new Error("All x, xError, and xError2 (if exist) have to be quantitative")}if(ys(i)){if(ps(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 Fu(t,e,n){const{mark:r,encoding:i,params:o,projection:a,...s}=t,u=xa(r)?r:{type:r};o&&Wi(hi(e));const{orient:l,inputType:c}=Eu(t,e),{continuousAxisChannelDef:f,continuousAxisChannelDef2:h,continuousAxisChannelDefError:d,continuousAxisChannelDefError2:p,continuousAxis:g}=pu(t,l,e),{errorBarSpecificAggregate:m,postAggregateCalculates:y,tooltipSummary:v,tooltipTitleWithFieldName:b}=function(t,e,n,r,i,o,a,s){let u=[],l=[];const c=e.field;let f,h=!1;if("raw"===o){const e=t.center?t.center:t.extent?"iqr"===t.extent?"median":"mean":s.errorbar.center,n=t.extent?t.extent:"mean"===e?"stderr":"iqr";if("median"===e!==("iqr"===n)&&Wi(function(t,e,n){return`${t} is not usually used with ${e} for ${n}.`}(e,n,a)),"stderr"===n||"stdev"===n)u=[{op:n,field:c,as:`extent_${c}`},{op:e,field:c,as:`center_${c}`}],l=[{calculate:`datum["center_${c}"] + datum["extent_${c}"]`,as:`upper_${c}`},{calculate:`datum["center_${c}"] - datum["extent_${c}"]`,as:`lower_${c}`}],f=[{fieldPrefix:"center_",titlePrefix:Qt(e)},{fieldPrefix:"upper_",titlePrefix:Cu(e,n,"+")},{fieldPrefix:"lower_",titlePrefix:Cu(e,n,"-")}],h=!0;else{let t,e,r;"ci"===n?(t="mean",e="ci0",r="ci1"):(t="median",e="q1",r="q3"),u=[{op:e,field:c,as:`lower_${c}`},{op:r,field:c,as:`upper_${c}`},{op:t,field:c,as:`center_${c}`}],f=[{fieldPrefix:"upper_",titlePrefix:Ss({field:c,aggregate:r,type:"quantitative"},s,{allowDisabling:!1})},{fieldPrefix:"lower_",titlePrefix:Ss({field:c,aggregate:e,type:"quantitative"},s,{allowDisabling:!1})},{fieldPrefix:"center_",titlePrefix:Ss({field:c,aggregate:t,type:"quantitative"},s,{allowDisabling:!1})}]}}else{(t.center||t.extent)&&Wi(function(t,e){return`${e?"extent ":""}${e&&t?"and ":""}${t?"center ":""}${e&&t?"are ":"is "}not needed when data are aggregated.`}(t.center,t.extent)),"aggregated-upper-lower"===o?(f=[],l=[{calculate:`datum["${n.field}"]`,as:`upper_${c}`},{calculate:`datum["${c}"]`,as:`lower_${c}`}]):"aggregated-error"===o&&(f=[{fieldPrefix:"",titlePrefix:c}],l=[{calculate:`datum["${c}"] + datum["${r.field}"]`,as:`upper_${c}`}],i?l.push({calculate:`datum["${c}"] + datum["${i.field}"]`,as:`lower_${c}`}):l.push({calculate:`datum["${c}"] - datum["${r.field}"]`,as:`lower_${c}`}));for(const t of l)f.push({fieldPrefix:t.as.substring(0,6),titlePrefix:ie(ie(t.calculate,'datum["',""),'"]',"")})}return{postAggregateCalculates:l,errorBarSpecificAggregate:u,tooltipSummary:f,tooltipTitleWithFieldName:h}}(u,f,h,d,p,c,e,n),{[g]:x,["x"===g?"x2":"y2"]:_,["x"===g?"xError":"yError"]:w,["x"===g?"xError2":"yError2"]:A,...D}=i,{bins:E,timeUnits:F,aggregate:C,groupby:k,encoding:M}=ou(D,n),S=[...C,...m],$="raw"!==c?[]:k,T=cu(v,f,M,b);return{transform:[...s.transform??[],...E,...F,...0===S.length?[]:[{aggregate:S,groupby:$}],...y],groupby:$,continuousAxisChannelDef:f,continuousAxis:g,encodingWithoutContinuousAxis:M,ticksOrient:"vertical"===l?"horizontal":"vertical",markDef:u,outerSpec:s,tooltipEncoding:T}}function Cu(t,e,n){return`${Qt(t)} ${n} ${e}`}const ku="errorband",Mu=new tu(ku,Su);function Su(t,{config:e}){t={...t,encoding:su(t.encoding,e)};const{transform:n,continuousAxisChannelDef:r,continuousAxis:i,encodingWithoutContinuousAxis:o,markDef:a,outerSpec:s,tooltipEncoding:u}=Fu(t,ku,e),l=a,c=hu(l,i,r,o,e.errorband),f=void 0!==t.encoding.x&&void 0!==t.encoding.y;let h={type:f?"area":"rect"},d={type:f?"line":"rule"};const p={...l.interpolate?{interpolate:l.interpolate}:{},...l.tension&&l.interpolate?{tension:l.tension}:{}};return f?(h={...h,...p,ariaRoleDescription:"errorband"},d={...d,...p,aria:!1}):l.interpolate?Wi(Ui("interpolate")):l.tension&&Wi(Ui("tension")),{...s,transform:n,layer:[...c({partName:"band",mark:h,positionPrefix:"lower",endPositionPrefix:"upper",extraEncoding:u}),...c({partName:"borders",mark:d,positionPrefix:"lower",extraEncoding:u}),...c({partName:"borders",mark:d,positionPrefix:"upper",extraEncoding:u})]}}const $u={};function Tu(t,e,n){const r=new tu(t,e);$u[t]={normalizer:r,parts:n}}Tu(yu,xu,["box","median","outliers","rule","ticks"]),Tu(wu,Du,["ticks","rule"]),Tu(ku,Su,["band","borders"]);const Bu=["gradientHorizontalMaxLength","gradientHorizontalMinLength","gradientVerticalMaxLength","gradientVerticalMinLength","unselectedOpacity"],Nu={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"},Ou={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"},zu=Xt(Nu),Ru=Xt(Ou),Pu=Xt({header:1,headerRow:1,headerColumn:1,headerFacet:1}),Uu=["size","shape","fill","stroke","strokeDash","strokeWidth","opacity"],Lu={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},ju=(Xt(Lu),"_vgsid_"),Iu={point:{on:"click",fields:[ju],toggle:"event.shiftKey",resolve:"global",clear:"dblclick"},interval:{on:"[mousedown, window:mouseup] > window:mousemove!",encodings:["x","y"],translate:"[mousedown, window:mouseup] > window:mousemove!",zoom:"wheel!",mark:{fill:"#333",fillOpacity:.125,stroke:"white"},resolve:"global",clear:"dblclick"}};function qu(t){return"legend"===t||!!t?.legend}function Wu(t){return qu(t)&&nt(t)}function Hu(t){return!!t?.select}function Xu(t){const e=[];for(const n of t||[]){if(Hu(n))continue;const{expr:t,bind:r,...i}=n;if(r&&t){const n={...i,bind:r,init:t};e.push(n)}else{const n={...i,...t?{update:t}:{},...r?{bind:r}:{}};e.push(n)}}return e}function Yu(t){return"concat"in t}function Gu(t){return"vconcat"in t}function Vu(t){return"hconcat"in t}function Ju({step:t,offsetIsDiscrete:e}){return e?t.for??"offset":"position"}function Zu(t){return nt(t)&&void 0!==t.step}function Ku(t){return t.view||t.width||t.height}const Qu=Xt({align:1,bounds:1,center:1,columns:1,spacing:1});function tl(t,e){return t[e]??t["width"===e?"continuousWidth":"continuousHeight"]}function el(t,e){const n=nl(t,e);return Zu(n)?n.step:rl}function nl(t,e){return se(t[e]??t["width"===e?"discreteWidth":"discreteHeight"],{step:t.step})}const rl=20;const il={background:"white",padding:5,timeFormat:"%b %d, %Y",countTitle:"Count of Records",view:{continuousWidth:200,continuousHeight:200,step:rl},mark:{color:"#4c78a8",invalid:"filter",timeUnitBandSize:1},arc:{},area:{},bar:Fa,circle:{},geoshape:{},image:{},line:{},point:{},rect:Ca,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:Iu,style:{},title:{},facet:{spacing:20},concat:{spacing:20},normalizedNumberFormat:".0%"},ol=["#4c78a8","#f58518","#e45756","#72b7b2","#54a24b","#eeca3b","#b279a2","#ff9da6","#9d755d","#bab0ac"],al={text:11,guideLabel:10,guideTitle:11,groupTitle:13,groupSubtitle:12},sl={blue:ol[0],orange:ol[1],red:ol[2],teal:ol[3],green:ol[4],yellow:ol[5],purple:ol[6],pink:ol[7],brown:ol[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 ul(t){const e=Xt(t||{}),n={};for(const r of e){const e=t[r];n[r]=Xs(e)?Ir(e):qr(e)}return n}const ll=[...Aa,...Ks,...Pu,"background","padding","legend","lineBreak","scale","style","title","view"];function cl(t={}){const{color:e,font:n,fontSize:r,selection:i,...o}=t,a=it({},Ct(il),n?function(t){return{text:{font:t},style:{"guide-label":{font:t},"guide-title":{font:t},"group-title":{font:t},"group-subtitle":{font:t}}}}(n):{},e?function(t={}){return{signals:[{name:"color",value:nt(t)?{...sl,...t}:sl}],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"}]}}}(e):{},r?function(t){return{signals:[{name:"fontSize",value:nt(t)?{...al,...t}:al}],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"}}}}}(r):{},o||{});i&&(0,U.writeConfig)(a,"selection",i,!0);const s=St(a,ll);for(const u of["background","lineBreak","padding"])a[u]&&(s[u]=qr(a[u]));for(const u of Aa)a[u]&&(s[u]=Br(a[u]));for(const u of Ks)a[u]&&(s[u]=ul(a[u]));for(const u of Pu)a[u]&&(s[u]=Br(a[u]));return a.legend&&(s.legend=Br(a.legend)),a.scale&&(s.scale=Br(a.scale)),a.style&&(s.style=function(t){const e=Xt(t),n={};for(const r of e)n[r]=ul(t[r]);return n}(a.style)),a.title&&(s.title=Br(a.title)),a.view&&(s.view=Br(a.view)),s}const fl=new Set(["view",...ba]),hl=["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"],dl={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 pl(t){t=Ct(t);for(const e of hl)delete t[e];if(t.axis)for(const e in t.axis)Xs(t.axis[e])&&delete t.axis[e];if(t.legend)for(const e of Bu)delete t.legend[e];if(t.mark){for(const e of wa)delete t.mark[e];t.mark.tooltip&&nt(t.mark.tooltip)&&delete t.mark.tooltip}t.params&&(t.signals=(t.signals||[]).concat(Xu(t.params)),delete t.params);for(const e of fl){for(const r of wa)delete t[e][r];const n=dl[e];if(n)for(const r of n)delete t[e][r];gl(t,e)}for(const e of Xt($u))delete t[e];!function(t){const{titleMarkConfig:e,subtitleMarkConfig:n,subtitle:r}=Nr(t.title);Ht(e)||(t.style["group-title"]={...t.style["group-title"],...e});Ht(n)||(t.style["group-subtitle"]={...t.style["group-subtitle"],...n});Ht(r)?delete t.title:t.title=r}(t);for(const e in t)nt(t[e])&&Ht(t[e])&&delete t[e];return Ht(t)?void 0:t}function gl(t,e,n,r){"view"===e&&(n="cell");const i={...r?t[e][r]:t[e],...t.style[n??e]};Ht(i)||(t.style[n??e]=i),r||delete t[e]}function ml(t){return"layer"in t}class yl{map(t,e){return es(t)?this.mapFacet(t,e):function(t){return"repeat"in t}(t)?this.mapRepeat(t,e):Vu(t)?this.mapHConcat(t,e):Gu(t)?this.mapVConcat(t,e):Yu(t)?this.mapConcat(t,e):this.mapLayerOrUnit(t,e)}mapLayerOrUnit(t,e){if(ml(t))return this.mapLayer(t,e);if(Qs(t))return this.mapUnit(t,e);throw new Error(ii(t))}mapLayer(t,e){return{...t,layer:t.layer.map((t=>this.mapLayerOrUnit(t,e)))}}mapHConcat(t,e){return{...t,hconcat:t.hconcat.map((t=>this.map(t,e)))}}mapVConcat(t,e){return{...t,vconcat:t.vconcat.map((t=>this.map(t,e)))}}mapConcat(t,e){const{concat:n,...r}=t;return{...r,concat:n.map((t=>this.map(t,e)))}}mapFacet(t,e){return{...t,spec:this.map(t.spec,e)}}mapRepeat(t,e){return{...t,spec:this.map(t.spec,e)}}}const vl={zero:1,center:1,normalize:1};const bl=new Set([ra,oa,ia,ca,ua,pa,ga,sa,fa,ha]),xl=new Set([oa,ia,ra]);function _l(t){return fs(t)&&"quantitative"===hs(t)&&!t.bin}function wl(t,e,{orient:n,type:r}){const i="x"===e?"y":"radius",o="x"===e,a=t[e],s=t[i];if(fs(a)&&fs(s))if(_l(a)&&_l(s)){if(a.stack)return e;if(s.stack)return i;const t=fs(a)&&!!a.aggregate;if(t!==(fs(s)&&!!s.aggregate))return t?e:i;if(o&&"bar"===r){if("vertical"===n)return i;if("horizontal"===n)return e}}else{if(_l(a))return e;if(_l(s))return i}else{if(_l(a))return e;if(_l(s))return i}}function Al(t,e){const n=xa(t)?t:{type:t},r=n.type;if(!bl.has(r))return null;const i=wl(e,"x",n)||wl(e,"theta",n);if(!i)return null;const o=e[i],a=fs(o)?Es(o,{}):void 0,s=function(t){switch(t){case"x":return"y";case"y":return"x";case"theta":return"radius";case"radius":return"theta"}}(i),u=[],l=new Set;if(e[s]){const t=e[s],n=fs(t)?Es(t,{}):void 0;n&&n!==a&&(u.push(s),l.add(n));const r="x"===s?"xOffset":"yOffset",i=e[r],o=fs(i)?Es(i,{}):void 0;o&&o!==a&&(u.push(r),l.add(o))}const c=Wn.reduce(((t,n)=>{if("tooltip"!==n&&eu(e,n)){const r=e[n];for(const e of st(r)){const r=Ns(e);if(r.aggregate)continue;const i=Es(r,{});i&&l.has(i)||t.push({channel:n,fieldDef:r})}}return t}),[]);let f;return void 0!==o.stack?f=ft(o.stack)?o.stack?"zero":null:o.stack:xl.has(r)&&(f="zero"),f&&f in vl?iu(e)&&0===c.length?null:o?.scale?.type&&o?.scale?.type!==Mo.LINEAR?(o?.stack&&Wi(function(t){return`Cannot stack non-linear scale (${t}).`}(o.scale.type)),null):ys(e[An(i)])?(void 0!==o.stack&&Wi(`Cannot stack "${h=i}" if there is already "${h}2".`),null):(fs(o)&&o.aggregate&&!Dr.has(o.aggregate)&&Wi(`Stacking is applied even though the aggregate function is non-summative ("${o.aggregate}").`),{groupbyChannels:u,groupbyFields:l,fieldChannel:i,impute:null!==o.impute&&ya(r),stackBy:c,offset:f}):null;var h}function Dl(t){const{point:e,line:n,...r}=t;return Xt(r).length>1?r:r.type}function El(t){for(const e of["line","area","rule","trail"])t[e]&&(t={...t,[e]:St(t[e],["point","line"])});return t}function Fl(t,e={},n){return"transparent"===t.point?{opacity:0}:t.point?nt(t.point)?t.point:{}:void 0!==t.point?null:e.point||n.shape?nt(e.point)?e.point:{}:void 0}function Cl(t,e={}){return t.line?!0===t.line?{}:t.line:void 0!==t.line?null:e.line?!0===e.line?{}:e.line:void 0}class kl{constructor(){this.name="path-overlay"}hasMatchingType(t,e){if(Qs(t)){const{mark:n,encoding:r}=t,i=xa(n)?n:{type:n};switch(i.type){case"line":case"rule":case"trail":return!!Fl(i,e[i.type],r);case"area":return!!Fl(i,e[i.type],r)||!!Cl(i,e[i.type])}}return!1}run(t,e,n){const{config:r}=e,{params:i,projection:o,mark:a,name:s,encoding:u,...l}=t,c=su(u,r),f=xa(a)?a:{type:a},h=Fl(f,r[f.type],c),d="area"===f.type&&Cl(f,r[f.type]),p=[{name:s,...i?{params:i}:{},mark:Dl({..."area"===f.type&&void 0===f.opacity&&void 0===f.fillOpacity?{opacity:.7}:{},...f}),encoding:St(c,["shape"])}],g=Al(f,c);let m=c;if(g){const{fieldChannel:t,offset:e}=g;m={...c,[t]:{...c[t],...e?{stack:e}:{}}}}return m=St(m,["y2","x2"]),d&&p.push({...o?{projection:o}:{},mark:{type:"line",...Mt(f,["clip","interpolate","tension","tooltip"]),...d},encoding:m}),h&&p.push({...o?{projection:o}:{},mark:{type:"point",opacity:1,filled:!0,...Mt(f,["clip","tooltip"]),...h},encoding:m}),n({...l,layer:p},{...e,config:El(r)})}}function Ml(t,e){return e?Qa(t)?Ol(t,e):Tl(t,e):t}function Sl(t,e){return e?Ol(t,e):t}function $l(t,e,n){const r=e[t];return function(t){return t&&!dt(t)&&"repeat"in t}(r)?r.repeat in n?{...e,[t]:n[r.repeat]}:void Wi(function(t){return`Unknown repeated value "${t}".`}(r.repeat)):e}function Tl(t,e){if(void 0!==(t=$l("field",t,e))){if(null===t)return null;if(rs(t)&&Za(t.sort)){const n=$l("field",t.sort,e);t={...t,...n?{sort:n}:{}}}return t}}function Bl(t,e){if(fs(t))return Tl(t,e);{const n=$l("datum",t,e);return n===t||n.type||(n.type="nominal"),n}}function Nl(t,e){if(!ys(t)){if(cs(t)){const n=Bl(t.condition,e);if(n)return{...t,condition:n};{const{condition:e,...n}=t;return n}}return t}{const n=Bl(t,e);if(n)return n;if(us(t))return{condition:t.condition}}}function Ol(t,e){const n={};for(const r in t)if(ct(t,r)){const i=t[r];if(et(i))n[r]=i.map((t=>Nl(t,e))).filter((t=>t));else{const t=Nl(i,e);void 0!==t&&(n[r]=t)}}return n}class zl{constructor(){this.name="RuleForRangedLine"}hasMatchingType(t){if(Qs(t)){const{encoding:e,mark:n}=t;if("line"===n||xa(n)&&"line"===n.type)for(const t of bn){const n=e[_n(t)];if(e[t]&&(fs(n)&&!kr(n.bin)||ds(n)))return!0}}return!1}run(t,e,n){const{encoding:r,mark:i}=t;var o,a;return Wi((o=!!r.x2,a=!!r.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({...t,mark:nt(i)?{...i,type:"rule"}:"rule"},e)}}function Rl({parentEncoding:t,encoding:e={},layer:n}){let r={};if(t){const i=new Set([...Xt(t),...Xt(e)]);for(const o of i){const i=e[o],a=t[o];if(ys(i)){const t={...a,...i};r[o]=t}else cs(i)?r[o]={...i,condition:{...a,...i.condition}}:i||null===i?r[o]=i:(n||bs(a)||zr(a)||ys(a)||et(a))&&(r[o]=a)}}else r=e;return!r||Ht(r)?void 0:r}function Pl(t){const{parentProjection:e,projection:n}=t;return e&&n&&Wi(function(t){const{parentProjection:e,projection:n}=t;return`Layer's shared projection ${$t(e)} is overridden by a child projection ${$t(n)}.`}({parentProjection:e,projection:n})),n??e}function Ul(t){return"filter"in t}function Ll(t){return void 0!==t?.stop}function jl(t){return"lookup"in t}function Il(t){return"pivot"in t}function ql(t){return"density"in t}function Wl(t){return"quantile"in t}function Hl(t){return"regression"in t}function Xl(t){return"loess"in t}function Yl(t){return"sample"in t}function Gl(t){return"window"in t}function Vl(t){return"joinaggregate"in t}function Jl(t){return"flatten"in t}function Zl(t){return"calculate"in t}function Kl(t){return"bin"in t}function Ql(t){return"impute"in t}function tc(t){return"timeUnit"in t}function ec(t){return"aggregate"in t}function nc(t){return"stack"in t}function rc(t){return"fold"in t}function ic(t){return"extent"in t&&!("density"in t)}function oc(t,e){const{transform:n,...r}=t;if(n){const t=n.map((t=>{if(Ul(t))return{filter:uc(t,e)};if(Kl(t)&&Mr(t.bin))return{...t,bin:sc(t.bin)};if(jl(t)){const{selection:e,...n}=t.from;return e?{...t,from:{param:e,...n}}:t}return t}));return{...r,transform:t}}return t}function ac(t,e){const n=Ct(t);if(fs(n)&&Mr(n.bin)&&(n.bin=sc(n.bin)),xs(n)&&n.scale?.domain?.selection){const{selection:t,...e}=n.scale.domain;n.scale.domain={...e,...t?{param:t}:{}}}if(us(n))if((0,U.isArray)(n.condition))n.condition=n.condition.map((t=>{const{selection:n,param:r,test:i,...o}=t;return r?t:{...o,test:uc(t,e)}}));else{const{selection:t,param:r,test:i,...o}=ac(n.condition,e);n.condition=r?n.condition:{...o,test:uc(n.condition,e)}}return n}function sc(t){const e=t.extent;if(e?.selection){const{selection:n,...r}=e;return{...t,extent:{...r,param:n}}}return t}function uc(t,e){const n=t=>Et(t,(t=>{var n;const r={param:t,empty:e.emptySelections[t]??!0};return(n=e.selectionPredicates)[t]??(n[t]=[]),e.selectionPredicates[t].push(r),r}));return t.selection?n(t.selection):Et(t.test||t.filter,(t=>t.selection?n(t.selection):t))}class lc extends yl{map(t,e){const n=e.selections??[];if(t.params&&!Qs(t)){const e=[];for(const r of t.params)Hu(r)?n.push(r):e.push(r);t.params=e}return e.selections=n,super.map(t,e)}mapUnit(t,e){const n=e.selections;if(!n||!n.length)return t;const r=(e.path??[]).concat(t.name),i=[];for(const o of n)if(o.views&&o.views.length)for(const e of o.views)((0,U.isString)(e)&&(e===t.name||r.includes(e))||(0,U.isArray)(e)&&e.map((t=>r.indexOf(t))).every(((t,e,n)=>-1!==t&&(0===e||t>n[e-1]))))&&i.push(o);else i.push(o);return i.length&&(t.params=i),t}}for(const Bx of["mapFacet","mapRepeat","mapHConcat","mapVConcat","mapLayer"]){const t=lc.prototype[Bx];lc.prototype[Bx]=function(e,n){return t.call(this,e,cc(e,n))}}function cc(t,e){return t.name?{...e,path:(e.path??[]).concat(t.name)}:e}function fc(t,e){void 0===e&&(e=cl(t.config));const n=function(t,e={}){const n={config:e};return pc.map(hc.map(dc.map(t,n),n),n)}(t,e),{width:r,height:i}=t,o=function(t,e,n){let{width:r,height:i}=e;const o=Qs(t)||ml(t),a={};o?"container"==r&&"container"==i?(a.type="fit",a.contains="padding"):"container"==r?(a.type="fit-x",a.contains="padding"):"container"==i&&(a.type="fit-y",a.contains="padding"):("container"==r&&(Wi(ai("width")),r=void 0),"container"==i&&(Wi(ai("height")),i=void 0));const s={type:"pad",...a,...n?gc(n.autosize):{},...gc(t.autosize)};"fit"!==s.type||o||(Wi(oi),s.type="pad");"container"==r&&"fit"!=s.type&&"fit-x"!=s.type&&Wi(si("width"));"container"==i&&"fit"!=s.type&&"fit-y"!=s.type&&Wi(si("height"));if(Ft(s,{type:"pad"}))return;return s}(n,{width:r,height:i,autosize:t.autosize},e);return{...n,...o?{autosize:o}:{}}}const hc=new class extends yl{constructor(){super(...arguments),this.nonFacetUnitNormalizers=[vu,Au,Mu,new kl,new zl]}map(t,e){if(Qs(t)){const n=eu(t.encoding,ge),r=eu(t.encoding,me),i=eu(t.encoding,ye);if(n||r||i)return this.mapFacetedUnit(t,e)}return super.map(t,e)}mapUnit(t,e){const{parentEncoding:n,parentProjection:r}=e,i=Sl(t.encoding,e.repeater),o={...t,...t.name?{name:[e.repeaterPrefix,t.name].filter((t=>t)).join("_")}:{},...i?{encoding:i}:{}};if(n||r)return this.mapUnitWithParentEncodingOrProjection(o,e);const a=this.mapLayerOrUnit.bind(this);for(const s of this.nonFacetUnitNormalizers)if(s.hasMatchingType(o,e.config))return s.run(o,e,a);return o}mapRepeat(t,e){return function(t){return!et(t.repeat)&&t.repeat.layer}(t)?this.mapLayerRepeat(t,e):this.mapNonLayerRepeat(t,e)}mapLayerRepeat(t,e){const{repeat:n,spec:r,...i}=t,{row:o,column:a,layer:s}=n,{repeater:u={},repeaterPrefix:l=""}=e;return o||a?this.mapRepeat({...t,repeat:{...o?{row:o}:{},...a?{column:a}:{}},spec:{repeat:{layer:s},spec:r}},e):{...i,layer:s.map((t=>{const n={...u,layer:t},i=`${(r.name?`${r.name}_`:"")+l}child__layer_${Jt(t)}`,o=this.mapLayerOrUnit(r,{...e,repeater:n,repeaterPrefix:i});return o.name=i,o}))}}mapNonLayerRepeat(t,e){const{repeat:n,spec:r,data:i,...o}=t;!et(n)&&t.columns&&(t=St(t,["columns"]),Wi(pi("repeat")));const a=[],{repeater:s={},repeaterPrefix:u=""}=e,l=!et(n)&&n.row||[s?s.row:null],c=!et(n)&&n.column||[s?s.column:null],f=et(n)&&n||[s?s.repeat:null];for(const d of f)for(const t of l)for(const i of c){const o={repeat:d,row:t,column:i,layer:s.layer},l=(r.name?`${r.name}_`:"")+u+"child__"+(et(n)?`${Jt(d)}`:(n.row?`row_${Jt(t)}`:"")+(n.column?`column_${Jt(i)}`:"")),c=this.map(r,{...e,repeater:o,repeaterPrefix:l});c.name=l,a.push(St(c,["data"]))}const h=et(n)?t.columns:n.column?n.column.length:1;return{data:r.data??i,align:"all",...o,columns:h,concat:a}}mapFacet(t,e){const{facet:n}=t;return Qa(n)&&t.columns&&(t=St(t,["columns"]),Wi(pi("facet"))),super.mapFacet(t,e)}mapUnitWithParentEncodingOrProjection(t,e){const{encoding:n,projection:r}=t,{parentEncoding:i,parentProjection:o,config:a}=e,s=Pl({parentProjection:o,projection:r}),u=Rl({parentEncoding:i,encoding:Sl(n,e.repeater)});return this.mapUnit({...t,...s?{projection:s}:{},...u?{encoding:u}:{}},{config:a})}mapFacetedUnit(t,e){const{row:n,column:r,facet:i,...o}=t.encoding,{mark:a,width:s,projection:u,height:l,view:c,params:f,encoding:h,...d}=t,{facetMapping:p,layout:g}=this.getFacetMappingAndLayout({row:n,column:r,facet:i},e),m=Sl(o,e.repeater);return this.mapFacet({...d,...g,facet:p,spec:{...s?{width:s}:{},...l?{height:l}:{},...c?{view:c}:{},...u?{projection:u}:{},mark:a,encoding:m,...f?{params:f}:{}}},e)}getFacetMappingAndLayout(t,e){const{row:n,column:r,facet:i}=t;if(n||r){i&&Wi(`Facet encoding dropped as ${(o=[...n?[ge]:[],...r?[me]:[]]).join(" and ")} ${o.length>1?"are":"is"} also specified.`);const e={},a={};for(const n of[ge,me]){const r=t[n];if(r){const{align:t,center:i,spacing:o,columns:s,...u}=r;e[n]=u;for(const e of["align","center","spacing"])void 0!==r[e]&&(a[e]??(a[e]={}),a[e][n]=r[e])}}return{facetMapping:e,layout:a}}{const{align:t,center:n,spacing:r,columns:o,...a}=i;return{facetMapping:Ml(a,e.repeater),layout:{...t?{align:t}:{},...n?{center:n}:{},...r?{spacing:r}:{},...o?{columns:o}:{}}}}var o}mapLayer(t,{parentEncoding:e,parentProjection:n,...r}){const{encoding:i,projection:o,...a}=t,s={...r,parentEncoding:Rl({parentEncoding:e,encoding:i,layer:!0}),parentProjection:Pl({parentProjection:n,projection:o})};return super.mapLayer({...a,...t.name?{name:[s.repeaterPrefix,t.name].filter((t=>t)).join("_")}:{}},s)}},dc=new class extends yl{map(t,e){return e.emptySelections??(e.emptySelections={}),e.selectionPredicates??(e.selectionPredicates={}),t=oc(t,e),super.map(t,e)}mapLayerOrUnit(t,e){if((t=oc(t,e)).encoding){const n={};for(const[r,i]of Gt(t.encoding))n[r]=ac(i,e);t={...t,encoding:n}}return super.mapLayerOrUnit(t,e)}mapUnit(t,e){const{selection:n,...r}=t;return n?{...r,params:Gt(n).map((([t,n])=>{const{init:r,bind:i,empty:o,...a}=n;"single"===a.type?(a.type="point",a.toggle=!1):"multi"===a.type&&(a.type="point"),e.emptySelections[t]="none"!==o;for(const s of Yt(e.selectionPredicates[t]??{}))s.empty="none"!==o;return{name:t,value:r,select:a,bind:i}}))}:t}},pc=new lc;function gc(t){return dt(t)?{type:t}:t??{}}const mc=["background","padding"];function yc(t,e){const n={};for(const r of mc)t&&void 0!==t[r]&&(n[r]=qr(t[r]));return e&&(n.params=t.params),n}class vc{constructor(t={},e={}){this.explicit=t,this.implicit=e}clone(){return new vc(Ct(this.explicit),Ct(this.implicit))}combine(){return{...this.explicit,...this.implicit}}get(t){return se(this.explicit[t],this.implicit[t])}getWithExplicit(t){return void 0!==this.explicit[t]?{explicit:!0,value:this.explicit[t]}:void 0!==this.implicit[t]?{explicit:!1,value:this.implicit[t]}:{explicit:!1,value:void 0}}setWithExplicit(t,{value:e,explicit:n}){void 0!==e&&this.set(t,e,n)}set(t,e,n){return delete this[n?"implicit":"explicit"][t],this[n?"explicit":"implicit"][t]=e,this}copyKeyFromSplit(t,{explicit:e,implicit:n}){void 0!==e[t]?this.set(t,e[t],!0):void 0!==n[t]&&this.set(t,n[t],!1)}copyKeyFromObject(t,e){void 0!==e[t]&&this.set(t,e[t],!0)}copyAll(t){for(const e of Xt(t.combine())){const n=t.getWithExplicit(e);this.setWithExplicit(e,n)}}}function bc(t){return{explicit:!0,value:t}}function xc(t){return{explicit:!1,value:t}}function _c(t){return(e,n,r,i)=>{const o=t(e.value,n.value);return o>0?e:o<0?n:wc(e,n,r,i)}}function wc(t,e,n,r){return t.explicit&&e.explicit&&Wi(function(t,e,n,r){return`Conflicting ${e.toString()} property "${t.toString()}" (${$t(n)} and ${$t(r)}). Using ${$t(n)}.`}(n,r,t.value,e.value)),t}function Ac(t,e,n,r,i=wc){return void 0===t||void 0===t.value?e:t.explicit&&!e.explicit?t:e.explicit&&!t.explicit?e:Ft(t.value,e.value)?t:i(t,e,n,r)}class Dc extends vc{constructor(t={},e={},n=!1){super(t,e),this.explicit=t,this.implicit=e,this.parseNothing=n}clone(){const t=super.clone();return t.parseNothing=this.parseNothing,t}}function Ec(t){return"url"in t}function Fc(t){return"values"in t}function Cc(t){return"name"in t&&!Ec(t)&&!Fc(t)&&!kc(t)}function kc(t){return t&&(Mc(t)||Sc(t)||$c(t))}function Mc(t){return"sequence"in t}function Sc(t){return"sphere"in t}function $c(t){return"graticule"in t}var Tc;!function(t){t[t.Raw=0]="Raw",t[t.Main=1]="Main",t[t.Row=2]="Row",t[t.Column=3]="Column",t[t.Lookup=4]="Lookup"}(Tc||(Tc={}));var Bc=n(52847);function Nc(t){const{signals:e,hasLegend:n,index:r,...i}=t;return i.field=re(i.field),i}function Oc(t,e=!0,n=G){if(et(t)){const r=t.map((t=>Oc(t,e,n)));return e?`[${r.join(", ")}]`:r}return Hi(t)?n(e?Zi(t):function(t){const e=Ji(t,!0);return t.utc?+new Date(Date.UTC(...e)):+new Date(...e)}(t)):e?n($t(t)):t}function zc(t,e){for(const n of Yt(t.component.selection??{})){const r=n.name;let i=`${r}${eh}, ${"global"===n.resolve?"true":`{unit: ${oh(t)}}`}`;for(const o of ih)o.defined(n)&&(o.signals&&(e=o.signals(t,n,e)),o.modifyExpr&&(i=o.modifyExpr(t,n,i)));e.push({name:r+nh,on:[{events:{signal:n.name+eh},update:`modify(${pt(n.name+th)}, ${i})`}]})}return Uc(e)}function Rc(t,e){if(t.component.selection&&Xt(t.component.selection).length){const n=pt(t.getName("cell"));e.unshift({name:"facet",value:{},on:[{events:(0,Bc.r)("mousemove","scope"),update:`isTuple(facet) ? facet : group(${n}).datum`}]})}return Uc(e)}function Pc(t,e){for(const n of Yt(t.component.selection??{}))for(const r of ih)r.defined(n)&&r.marks&&(e=r.marks(t,n,e));return e}function Uc(t){return t.map((t=>(t.on&&!t.on.length&&delete t.on,t)))}class Lc{constructor(t,e){this.debugName=e,this._children=[],this._parent=null,t&&(this.parent=t)}clone(){throw new Error("Cannot clone node")}get parent(){return this._parent}set parent(t){this._parent=t,t&&t.addChild(this)}get children(){return this._children}numChildren(){return this._children.length}addChild(t,e){this._children.includes(t)?Wi("Attempt to add the same child twice."):void 0!==e?this._children.splice(e,0,t):this._children.push(t)}removeChild(t){const e=this._children.indexOf(t);return this._children.splice(e,1),e}remove(){let t=this._parent.removeChild(this);for(const e of this._children)e._parent=this._parent,this._parent.addChild(e,t++)}insertAsParentOf(t){const e=t.parent;e.removeChild(this),this.parent=e,t.parent=this}swapWithParent(){const t=this._parent,e=t.parent;for(const r of this._children)r.parent=t;this._children=[],t.removeChild(this);const n=t.parent.removeChild(t);this._parent=e,e.addChild(this,n),t.parent=this}}class jc extends Lc{clone(){const t=new this.constructor;return t.debugName=`clone_${this.debugName}`,t._source=this._source,t._name=`clone_${this._name}`,t.type=this.type,t.refCounts=this.refCounts,t.refCounts[t._name]=0,t}constructor(t,e,n,r){super(t,e),this.type=n,this.refCounts=r,this._source=this._name=e,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 ${le()}`),this._hash}getSource(){return this.refCounts[this._name]++,this._source}isRequired(){return!!this.refCounts[this._name]}setSource(t){this._source=t}}class Ic extends Lc{clone(){return new Ic(null,Ct(this.formula))}constructor(t,e){super(t),this.formula=e}static makeFromEncoding(t,e){const n=e.reduceFieldDef(((t,e)=>{const{field:n,timeUnit:r}=e;if(r){const i=Es(e,{forAs:!0});t[Tt({as:i,field:n,timeUnit:r})]={as:i,field:n,timeUnit:r}}return t}),{});return Ht(n)?null:new Ic(t,n)}static makeFromTransform(t,e){const{timeUnit:n,...r}={...e},i={...r,timeUnit:ao(n)};return new Ic(t,{[Tt(i)]:i})}merge(t){this.formula={...this.formula};for(const e in t.formula)this.formula[e]||(this.formula[e]=t.formula[e]);for(const e of t.children)t.removeChild(e),e.parent=this;t.remove()}removeFormulas(t){const e={};for(const[n,r]of Gt(this.formula))t.has(r.as)||(e[n]=r);this.formula=e}producedFields(){return new Set(Yt(this.formula).map((t=>t.as)))}dependentFields(){return new Set(Yt(this.formula).map((t=>t.field)))}hash(){return`TimeUnit ${Tt(this.formula)}`}assemble(){const t=[];for(const e of Yt(this.formula)){const{field:n,as:r,timeUnit:i}=e,{unit:o,utc:a,...s}=ao(i);t.push({field:re(n),type:"timeunit",...o?{units:no(o)}:{},...a?{timezone:"utc"}:{},...s,as:[r,`${r}_end`]})}return t}}const qc="_tuple_fields";class Wc{constructor(...t){this.items=t,this.hasChannel={},this.hasField={},this.hasSelectionId=!1}}const Hc={defined:()=>!0,parse:(t,e,n)=>{const r=e.name,i=e.project??(e.project=new Wc),o={},a={},s=new Set,u=(t,e)=>{const n="visual"===e?t.channel:t.field;let i=Jt(`${r}_${n}`);for(let o=1;s.has(i);o++)i=Jt(`${r}_${n}_${o}`);return s.add(i),{[e]:i}},l=e.type,c=t.config.selection[l],f=void 0!==n.value?st(n.value):null;let{fields:h,encodings:d}=nt(n.select)?n.select:{};if(!h&&!d&&f)for(const p of f)if(nt(p))for(const t of Xt(p))yn[t]?(d||(d=[])).push(t):"interval"===l?(Wi('Interval selections should be initialized using "x", "y", "longitude", or "latitude" keys.'),d=c.encodings):(h??(h=[])).push(t);h||d||(d=c.encodings,"fields"in c&&(h=c.fields));for(const p of d??[]){const e=t.fieldDef(p);if(e){let n=e.field;if(e.aggregate){Wi(fi(p,e.aggregate));continue}if(!n){Wi(ci(p));continue}if(e.timeUnit){n=t.vgField(p);const r={timeUnit:e.timeUnit,as:n,field:e.field};a[Tt(r)]=r}if(!o[n]){const r={field:n,channel:p,type:"interval"===l&&fr(p)&&jo(t.getScaleComponent(p).get("type"))?"R":e.bin?"R-RE":"E",index:i.items.length};r.signals={...u(r,"data"),...u(r,"visual")},i.items.push(o[n]=r),i.hasField[n]=o[n],i.hasSelectionId=i.hasSelectionId||n===ju,en(p)?(r.geoChannel=p,r.channel=tn(p),i.hasChannel[r.channel]=o[n]):i.hasChannel[p]=o[n]}}else Wi(ci(p))}for(const p of h??[]){if(i.hasField[p])continue;const t={type:"E",field:p,index:i.items.length};t.signals={...u(t,"data")},i.items.push(t),i.hasField[p]=t,i.hasSelectionId=i.hasSelectionId||p===ju}f&&(e.init=f.map((t=>i.items.map((e=>nt(t)?void 0!==t[e.geoChannel||e.channel]?t[e.geoChannel||e.channel]:t[e.field]:t))))),Ht(a)||(i.timeUnit=new Ic(null,a))},signals:(t,e,n)=>{const r=e.name+qc;return n.filter((t=>t.name===r)).length>0||e.project.hasSelectionId?n:n.concat({name:r,value:e.project.items.map(Nc)})}},Xc=Hc,Yc={defined:t=>"interval"===t.type&&"global"===t.resolve&&t.bind&&"scales"===t.bind,parse:(t,e)=>{const n=e.scales=[];for(const r of e.project.items){const i=r.channel;if(!fr(i))continue;const o=t.getScaleComponent(i),a=o?o.get("type"):void 0;o&&jo(a)?(o.set("selectionExtent",{param:e.name,field:r.field},!0),n.push(r)):Wi("Scale bindings are currently only supported for scales with unbinned, continuous domains.")}},topLevelSignals:(t,e,n)=>{const r=e.scales.filter((t=>0===n.filter((e=>e.name===t.signals.data)).length));if(!t.parent||Jc(t)||0===r.length)return n;const i=n.filter((t=>t.name===e.name))[0];let o=i.update;if(o.indexOf(rh)>=0)i.update=`{${r.map((t=>`${pt(re(t.field))}: ${t.signals.data}`)).join(", ")}}`;else{for(const t of r){const e=`${pt(re(t.field))}: ${t.signals.data}`;o.includes(e)||(o=`${o.substring(0,o.length-1)}, ${e}}`)}i.update=o}return n.concat(r.map((t=>({name:t.signals.data}))))},signals:(t,e,n)=>{if(t.parent&&!Jc(t))for(const r of e.scales){const t=n.filter((t=>t.name===r.signals.data))[0];t.push="outer",delete t.value,delete t.update}return n}},Gc=Yc;function Vc(t,e){return`domain(${pt(t.scaleName(e))})`}function Jc(t){return t.parent&&Pm(t.parent)&&(!t.parent.parent??Jc(t.parent.parent))}const Zc="_brush",Kc="_scale_trigger",Qc="geo_interval_init_tick",tf="_init",ef={defined:t=>"interval"===t.type,parse:(t,e,n)=>{var r;if(t.hasProjection){const t={...(0,U.isObject)(n.select)?n.select:{}};t.fields=[ju],t.encodings||(t.encodings=n.value?Xt(n.value):[Me,ke]),n.select={type:"interval",...t}}if(e.translate&&!Gc.defined(e)){const t=`!event.item || event.item.mark.name !== ${pt(e.name+Zc)}`;for(const n of e.events){if(!n.between){Wi(`${n} is not an ordered event stream for interval selections.`);continue}const e=st((r=n.between[0]).filter??(r.filter=[]));e.indexOf(t)<0&&e.push(t)}}},signals:(t,e,n)=>{const r=e.name,i=r+eh,o=Yt(e.project.hasChannel).filter((t=>t.channel===ve||t.channel===be)),a=e.init?e.init[0]:null;if(n.push(...o.reduce(((n,r)=>n.concat(function(t,e,n,r){const i=!t.hasProjection,o=n.channel,a=n.signals.visual,s=pt(i?t.scaleName(o):t.projectionName()),u=t=>`scale(${s}, ${t})`,l=t.getSizeSignalRef(o===ve?"width":"height").signal,c=`${o}(unit)`,f=e.events.reduce(((t,e)=>[...t,{events:e.between[0],update:`[${c}, ${c}]`},{events:e,update:`[${a}[0], clamp(${c}, 0, ${l})]`}]),[]);if(i){const i=n.signals.data,l=Gc.defined(e),c=t.getScaleComponent(o),h=c?c.get("type"):void 0,d=r?{init:Oc(r,!0,u)}:{value:[]};return f.push({events:{signal:e.name+Kc},update:jo(h)?`[${u(`${i}[0]`)}, ${u(`${i}[1]`)}]`:"[0, 0]"}),l?[{name:i,on:[]}]:[{name:a,...d,on:f},{name:i,...r?{init:Oc(r)}:{},on:[{events:{signal:a},update:`${a}[0] === ${a}[1] ? null : invert(${s}, ${a})`}]}]}{const t=o===ve?0:1,n=e.name+tf;return[{name:a,...r?{init:`[${n}[0][${t}], ${n}[1][${t}]]`}:{value:[]},on:f}]}}(t,e,r,a&&a[r.index]))),[])),t.hasProjection){const s=pt(t.projectionName()),u=t.projectionName()+"_center",{x:l,y:c}=e.project.hasChannel,f=l&&l.signals.visual,h=c&&c.signals.visual,d=l?a&&a[l.index]:`${u}[0]`,p=c?a&&a[c.index]:`${u}[1]`,g=e=>t.getSizeSignalRef(e).signal,m=`[[${f?f+"[0]":"0"}, ${h?h+"[0]":"0"}],[${f?f+"[1]":g("width")}, ${h?h+"[1]":g("height")}]]`;if(a&&(n.unshift({name:r+tf,init:`[scale(${s}, [${l?d[0]:d}, ${c?p[0]:p}]), scale(${s}, [${l?d[1]:d}, ${c?p[1]:p}])]`}),!l||!c)){n.find((t=>t.name===u))||n.unshift({name:u,update:`invert(${s}, [${g("width")}/2, ${g("height")}/2])`})}const y=`vlSelectionTuples(${`intersect(${m}, {markname: ${pt(t.getName("marks"))}}, unit.mark)`}, ${`{unit: ${oh(t)}}`})`,v=o.map((t=>t.signals.visual));return n.concat({name:i,on:[{events:[...v.length?[{signal:v.join(" || ")}]:[],...a?[{signal:Qc}]:[]],update:y}]})}{if(!Gc.defined(e)){const e=r+Kc,i=o.map((e=>{const n=e.channel,{data:r,visual:i}=e.signals,o=pt(t.scaleName(n)),a=jo(t.getScaleComponent(n).get("type"))?"+":"";return`(!isArray(${r}) || (${a}invert(${o}, ${i})[0] === ${a}${r}[0] && ${a}invert(${o}, ${i})[1] === ${a}${r}[1]))`}));i.length&&n.push({name:e,value:{},on:[{events:o.map((e=>({scale:t.scaleName(e.channel)}))),update:i.join(" && ")+` ? ${e} : {}`}]})}const s=o.map((t=>t.signals.data)),u=`unit: ${oh(t)}, fields: ${r+qc}, values`;return n.concat({name:i,...a?{init:`{${u}: ${Oc(a)}}`}:{},...s.length?{on:[{events:[{signal:s.join(" || ")}],update:`${s.join(" && ")} ? {${u}: [${s}]} : null`}]}:{}})}},topLevelSignals:(t,e,n)=>{if(Om(t)&&t.hasProjection&&e.init){n.filter((t=>t.name===Qc)).length||n.unshift({name:Qc,value:null,on:[{events:"timer{1}",update:`${Qc} === null ? {} : ${Qc}`}]})}return n},marks:(t,e,n)=>{const r=e.name,{x:i,y:o}=e.project.hasChannel,a=i?.signals.visual,s=o?.signals.visual,u=`data(${pt(e.name+th)})`;if(Gc.defined(e)||!i&&!o)return n;const l={x:void 0!==i?{signal:`${a}[0]`}:{value:0},y:void 0!==o?{signal:`${s}[0]`}:{value:0},x2:void 0!==i?{signal:`${a}[1]`}:{field:{group:"width"}},y2:void 0!==o?{signal:`${s}[1]`}:{field:{group:"height"}}};if("global"===e.resolve)for(const g of Xt(l))l[g]=[{test:`${u}.length && ${u}[0].unit === ${oh(t)}`,...l[g]},{value:0}];const{fill:c,fillOpacity:f,cursor:h,...d}=e.mark,p=Xt(d).reduce(((t,e)=>(t[e]=[{test:[void 0!==i&&`${a}[0] !== ${a}[1]`,void 0!==o&&`${s}[0] !== ${s}[1]`].filter((t=>t)).join(" && "),value:d[e]},{value:null}],t)),{});return[{name:`${r+Zc}_bg`,type:"rect",clip:!0,encode:{enter:{fill:{value:c},fillOpacity:{value:f}},update:l}},...n,{name:r+Zc,type:"rect",clip:!0,encode:{enter:{...h?{cursor:{value:h}}:{},fill:{value:"transparent"}},update:{...l,...p}}}]}},nf=ef;const rf={defined:t=>"point"===t.type,signals:(t,e,n)=>{const r=e.name,i=r+qc,o=e.project,a="(item().isVoronoi ? datum.datum : datum)",s=Yt(t.component.selection??{}).reduce(((t,e)=>"interval"===e.type?t.concat(e.name+Zc):t),[]).map((t=>`indexof(item().mark.name, '${t}') < 0`)).join(" && "),u="datum && item().mark.marktype !== 'group' && indexof(item().mark.role, 'legend') < 0"+(s?` && ${s}`:"");let l=`unit: ${oh(t)}, `;if(e.project.hasSelectionId)l+=`${ju}: ${a}[${pt(ju)}]`;else{l+=`fields: ${i}, values: [${o.items.map((e=>t.fieldDef(e.channel)?.bin?`[${a}[${pt(t.vgField(e.channel,{}))}], ${a}[${pt(t.vgField(e.channel,{binSuffix:"end"}))}]]`:`${a}[${pt(e.field)}]`)).join(", ")}]`}const c=e.events;return n.concat([{name:r+eh,on:c?[{events:c,update:`${u} ? {${l}} : null`,force:!0}]:[]}])}},of=rf;function af(t,e,n,r){const i=us(e)&&e.condition,o=r(e);if(i){return{[n]:[...st(i).map((e=>{const n=r(e);if(function(t){return t.param}(e)){const{param:r,empty:i}=e;return{test:ip(t,{param:r,empty:i}),...n}}return{test:ap(t,e.test),...n}})),...void 0!==o?[o]:[]]}}return void 0!==o?{[n]:o}:{}}function sf(t,e="text"){const n=t.encoding[e];return af(t,n,e,(e=>uf(e,t.config)))}function uf(t,e,n="datum"){if(t){if(bs(t))return Hr(t.value);if(ys(t)){const{format:r,formatType:i}=Bs(t);return Pa({fieldOrDatumDef:t,format:r,formatType:i,expr:n,config:e})}}}function lf(t,e={}){const{encoding:n,markDef:r,config:i,stack:o}=t,a=n.tooltip;if(et(a))return{tooltip:ff({tooltip:a},o,i,e)};{const s=e.reactiveGeom?"datum.datum":"datum";return af(t,a,"tooltip",(t=>{const a=uf(t,i,s);if(a)return a;if(null===t)return;let u=Jr("tooltip",r,i);return!0===u&&(u={content:"encoding"}),dt(u)?{value:u}:nt(u)?zr(u)?u:"encoding"===u.content?ff(n,o,i,e):{signal:s}:void 0}))}}function cf(t,e,n,{reactiveGeom:r}={}){const i={...n,...n.tooltipFormat},o={},a=r?"datum.datum":"datum",s=[];function u(n,r){const u=_n(r),l=vs(n)?n:{...n,type:t[u].type},c=st(l.title||Ts(l,i)).join(", ");let f;if(Yn(r)){const e="x"===r?"x2":"y2",n=Ns(t[e]);if(kr(l.bin)&&n){const t=Es(l,{expr:a}),r=Es(n,{expr:a}),{format:s,formatType:u}=Bs(l);f=Xa(t,r,s,u,i),o[e]=!0}}if((Yn(r)||r===Fe||r===De)&&e&&e.fieldChannel===r&&"normalize"===e.offset){const{format:t,formatType:e}=Bs(l);f=Pa({fieldOrDatumDef:l,format:t,formatType:e,expr:a,config:i,normalizeStack:!0}).signal}f??(f=uf(l,i,a).signal),s.push({channel:r,key:c,value:f})}uu(t,((t,e)=>{fs(t)?u(t,e):ls(t)&&u(t.condition,e)}));const l={};for(const{channel:c,key:f,value:h}of s)o[c]||l[f]||(l[f]=h);return l}function ff(t,e,n,{reactiveGeom:r}={}){const i=cf(t,e,n,{reactiveGeom:r}),o=Gt(i).map((([t,e])=>`"${t}": ${e}`));return o.length>0?{signal:`{${o.join(", ")}}`}:void 0}function hf(t){const{markDef:e,config:n}=t,r=Jr("aria",e,n);return!1===r?{}:{...r?{aria:r}:{},...df(t),...pf(t)}}function df(t){const{mark:e,markDef:n,config:r}=t;if(!1===r.aria)return{};const i=Jr("ariaRoleDescription",n,r);return null!=i?{ariaRoleDescription:{value:i}}:e in Lr?{}:{ariaRoleDescription:{value:e}}}function pf(t){const{encoding:e,markDef:n,config:r,stack:i}=t,o=e.description;if(o)return af(t,o,"description",(e=>uf(e,t.config)));const a=Jr("description",n,r);if(null!=a)return{description:Hr(a)};if(!1===r.aria)return{};const s=cf(e,i,r);return Ht(s)?void 0:{description:{signal:Gt(s).map((([t,e],n)=>`"${n>0?"; ":""}${t}: " + (${e})`)).join(" + ")}}}function gf(t,e,n={}){const{markDef:r,encoding:i,config:o}=e,{vgChannel:a}=n;let{defaultRef:s,defaultValue:u}=n;void 0===s&&(u??(u=Jr(t,r,o,{vgChannel:a,ignoreVgConfig:!0})),void 0!==u&&(s=Hr(u)));const l=i[t];return af(e,l,a??t,(n=>Ba({channel:t,channelDef:n,markDef:r,config:o,scaleName:e.scaleName(t),scale:e.getScaleComponent(t),stack:null,defaultRef:s})))}function mf(t,e={filled:void 0}){const{markDef:n,encoding:r,config:i}=t,{type:o}=n,a=e.filled??Jr("filled",n,i),s=Nt(["bar","point","circle","square","geoshape"],o)?"transparent":void 0,u=Jr(!0===a?"color":void 0,n,i,{vgChannel:"fill"})??i.mark[!0===a&&"color"]??s,l=Jr(!1===a?"color":void 0,n,i,{vgChannel:"stroke"})??i.mark[!1===a&&"color"],c=a?"fill":"stroke",f={...u?{fill:Hr(u)}:{},...l?{stroke:Hr(l)}:{}};return n.color&&(a?n.fill:n.stroke)&&Wi(_i("property",{fill:"fill"in n,stroke:"stroke"in n})),{...f,...gf("color",t,{vgChannel:c,defaultValue:a?u:l}),...gf("fill",t,{defaultValue:r.fill?u:void 0}),...gf("stroke",t,{defaultValue:r.stroke?l:void 0})}}function yf(t){const{encoding:e,mark:n}=t,r=e.order;return!ya(n)&&bs(r)?af(t,r,"zindex",(t=>Hr(t.value))):{}}function vf({channel:t,markDef:e,encoding:n={},model:r,bandPosition:i}){const o=`${t}Offset`,a=e[o],s=n[o];if(("xOffset"===o||"yOffset"===o)&&s){return{offsetType:"encoding",offset:Ba({channel:o,channelDef:s,markDef:e,config:r?.config,scaleName:r.scaleName(o),scale:r.getScaleComponent(o),stack:null,defaultRef:Hr(a),bandPosition:i})}}const u=e[o];return u?{offsetType:"visual",offset:u}:{}}function bf(t,e,{defaultPos:n,vgChannel:r}){const{encoding:i,markDef:o,config:a,stack:s}=e,u=i[t],l=i[An(t)],c=e.scaleName(t),f=e.getScaleComponent(t),{offset:h,offsetType:d}=vf({channel:t,markDef:o,encoding:i,model:e,bandPosition:.5}),p=xf({model:e,defaultPos:n,channel:t,scaleName:c,scale:f}),g=!u&&Yn(t)&&(i.latitude||i.longitude)?{field:e.getName(t)}:function(t){const{channel:e,channelDef:n,scaleName:r,stack:i,offset:o,markDef:a}=t;if(ys(n)&&i&&e===i.fieldChannel){if(fs(n)){let t=n.bandPosition;if(void 0!==t||"text"!==a.type||"radius"!==e&&"theta"!==e||(t=.5),void 0!==t)return Ta({scaleName:r,fieldOrDatumDef:n,startSuffix:"start",bandPosition:t,offset:o})}return $a(n,r,{suffix:"end"},{offset:o})}return ka(t)}({channel:t,channelDef:u,channel2Def:l,markDef:o,config:a,scaleName:c,scale:f,stack:s,offset:h,defaultRef:p,bandPosition:"encoding"===d?0:void 0});return g?{[r||t]:g}:void 0}function xf({model:t,defaultPos:e,channel:n,scaleName:r,scale:i}){const{markDef:o,config:a}=t;return()=>{const s=_n(n),u=wn(n),l=Jr(n,o,a,{vgChannel:u});if(void 0!==l)return Na(n,l);switch(e){case"zeroOrMin":case"zeroOrMax":if(r){const t=i.get("type");if(Nt([Mo.LOG,Mo.TIME,Mo.UTC],t));else if(i.domainDefinitelyIncludesZero())return{scale:r,value:0}}if("zeroOrMin"===e)return"y"===s?{field:{group:"height"}}:{value:0};switch(s){case"radius":return{signal:`min(${t.width.signal},${t.height.signal})/2`};case"theta":return{signal:"2*PI"};case"x":return{field:{group:"width"}};case"y":return{value:0}}break;case"mid":return{...t[Dn(n)],mult:.5}}}}const _f={left:"x",center:"xc",right:"x2"},wf={top:"y",middle:"yc",bottom:"y2"};function Af(t,e,n,r="middle"){if("radius"===t||"theta"===t)return wn(t);const i="x"===t?"align":"baseline",o=Jr(i,e,n);let a;return zr(o)?(Wi(function(t){return`The ${t} for range marks cannot be an expression`}(i)),a=void 0):a=o,"x"===t?_f[a||("top"===r?"left":"center")]:wf[a||r]}function Df(t,e,{defaultPos:n,defaultPos2:r,range:i}){return i?Ef(t,e,{defaultPos:n,defaultPos2:r}):bf(t,e,{defaultPos:n})}function Ef(t,e,{defaultPos:n,defaultPos2:r}){const{markDef:i,config:o}=e,a=An(t),s=Dn(t),u=function(t,e,n){const{encoding:r,mark:i,markDef:o,stack:a,config:s}=t,u=_n(n),l=Dn(n),c=wn(n),f=r[u],h=t.scaleName(u),d=t.getScaleComponent(u),{offset:p}=vf(n in r||n in o?{channel:n,markDef:o,encoding:r,model:t}:{channel:u,markDef:o,encoding:r,model:t});if(!f&&("x2"===n||"y2"===n)&&(r.latitude||r.longitude)){const e=Dn(n),r=t.markDef[e];return null!=r?{[e]:{value:r}}:{[c]:{field:t.getName(n)}}}const g=function({channel:t,channelDef:e,channel2Def:n,markDef:r,config:i,scaleName:o,scale:a,stack:s,offset:u,defaultRef:l}){if(ys(e)&&s&&t.charAt(0)===s.fieldChannel.charAt(0))return $a(e,o,{suffix:"start"},{offset:u});return ka({channel:t,channelDef:n,scaleName:o,scale:a,stack:s,markDef:r,config:i,offset:u,defaultRef:l})}({channel:n,channelDef:f,channel2Def:r[n],markDef:o,config:s,scaleName:h,scale:d,stack:a,offset:p,defaultRef:void 0});if(void 0!==g)return{[c]:g};return Ff(n,o)||Ff(n,{[n]:Kr(n,o,s.style),[l]:Kr(l,o,s.style)})||Ff(n,s[i])||Ff(n,s.mark)||{[c]:xf({model:t,defaultPos:e,channel:n,scaleName:h,scale:d})()}}(e,r,a);return{...bf(t,e,{defaultPos:n,vgChannel:u[s]?Af(t,i,o):wn(t)}),...u}}function Ff(t,e){const n=Dn(t),r=wn(t);if(void 0!==e[r])return{[r]:Na(t,e[r])};if(void 0!==e[t])return{[r]:Na(t,e[t])};if(e[n]){const r=e[n];if(!Da(r))return{[n]:Na(t,r)};Wi(function(t){return`Position range does not support relative band size for ${t}.`}(n))}}function Cf(t,e){const{config:n,encoding:r,markDef:i}=t,o=i.type,a=An(e),s=Dn(e),u=r[e],l=r[a],c=t.getScaleComponent(e),f=c?c.get("type"):void 0,h=i.orient,d=r[s]??r.size??Jr("size",i,n,{vgChannel:s}),p=En(e),g="bar"===o&&("x"===e?"vertical"===h:"horizontal"===h);return!fs(u)||!(Cr(u.bin)||kr(u.bin)||u.timeUnit&&!l)||d&&!Da(d)||r[p]||Lo(f)?(ys(u)&&Lo(f)||g)&&!l?function(t,e,n){const{markDef:r,encoding:i,config:o,stack:a}=n,s=r.orient,u=n.scaleName(e),l=n.getScaleComponent(e),c=Dn(e),f=An(e),h=En(e),d=n.scaleName(h),p=n.getScaleComponent(Fn(e)),g="horizontal"===s&&"y"===e||"vertical"===s&&"x"===e;let m;(i.size||r.size)&&(g?m=gf("size",n,{vgChannel:c,defaultRef:Hr(r.size)}):Wi(function(t){return`Cannot apply size to non-oriented mark "${t}".`}(r.type)));const y=!!m,v=os({channel:e,fieldDef:t,markDef:r,config:o,scaleType:l?.get("type"),useVlSizeChannel:g});m=m||{[c]:kf(c,d||u,p||l,o,v,!!t,r.type)};const b="band"===l?.get("type")&&Da(v)&&!y?"top":"middle",x=Af(e,r,o,b),_="xc"===x||"yc"===x,{offset:w,offsetType:A}=vf({channel:e,markDef:r,encoding:i,model:n,bandPosition:_?.5:0}),D=ka({channel:e,channelDef:t,markDef:r,config:o,scaleName:u,scale:l,stack:a,offset:w,defaultRef:xf({model:n,defaultPos:"mid",channel:e,scaleName:u,scale:l}),bandPosition:_?"encoding"===A?0:.5:zr(v)?{signal:`(1-${v})/2`}:Da(v)?(1-v.band)/2:0});if(c)return{[x]:D,...m};{const t=wn(f),e=m[c],n=w?{...e,offset:w}:e;return{[x]:D,[t]:et(D)?[D[0],{...D[1],offset:n}]:{...D,offset:n}}}}(u,e,t):Ef(e,t,{defaultPos:"zeroOrMax",defaultPos2:"zeroOrMin"}):function({fieldDef:t,fieldDef2:e,channel:n,model:r}){const{config:i,markDef:o,encoding:a}=r,s=r.getScaleComponent(n),u=r.scaleName(n),l=s?s.get("type"):void 0,c=s.get("reverse"),f=os({channel:n,fieldDef:t,markDef:o,config:i,scaleType:l}),h=r.component.axes[n]?.[0],d=h?.get("translate")??.5,p=Yn(n)?Jr("binSpacing",o,i)??0:0,g=An(n),m=wn(n),y=wn(g),v=Zr("minBandSize",o,i),{offset:b}=vf({channel:n,markDef:o,encoding:a,model:r,bandPosition:0}),{offset:x}=vf({channel:g,markDef:o,encoding:a,model:r,bandPosition:0}),_=function({scaleName:t,fieldDef:e}){const n=Es(e,{expr:"datum"});return`abs(scale("${t}", ${Es(e,{expr:"datum",suffix:"end"})}) - scale("${t}", ${n}))`}({fieldDef:t,scaleName:u}),w=Mf(n,p,c,d,b,v,_),A=Mf(g,p,c,d,x??b,v,_),D=zr(f)?{signal:`(1-${f.signal})/2`}:Da(f)?(1-f.band)/2:.5;if(Cr(t.bin)||t.timeUnit)return{[y]:Sf({fieldDef:t,scaleName:u,bandPosition:D,offset:A}),[m]:Sf({fieldDef:t,scaleName:u,bandPosition:zr(D)?{signal:`1-${D.signal}`}:1-D,offset:w})};if(kr(t.bin)){const n=$a(t,u,{},{offset:A});if(fs(e))return{[y]:n,[m]:$a(e,u,{},{offset:w})};if(Mr(t.bin)&&t.bin.step)return{[y]:n,[m]:{signal:`scale("${u}", ${Es(t,{expr:"datum"})} + ${t.bin.step})`,offset:w}}}return void Wi(Li(g))}({fieldDef:u,fieldDef2:l,channel:e,model:t})}function kf(t,e,n,r,i,o,a){if(Da(i)){if(!n)return{mult:i.band,field:{group:t}};{const t=n.get("type");if("band"===t){let t=`bandwidth('${e}')`;1!==i.band&&(t=`${i.band} * ${t}`);const n=Zr("minBandSize",{type:a},r);return{signal:n?`max(${Yr(n)}, ${t})`:t}}1!==i.band&&(Wi(function(t){return`Cannot use the relative band size with ${t} scale.`}(t)),i=void 0)}}else{if(zr(i))return i;if(i)return{value:i}}if(n){const t=n.get("range");if(Rr(t)&&ht(t.step))return{value:t.step-2}}if(!o){const{bandPaddingInner:e,barBandPaddingInner:n,rectBandPaddingInner:i}=r.scale,o=se(e,"bar"===a?n:i);if(zr(o))return{signal:`(1 - (${o.signal})) * ${t}`};if(ht(o))return{signal:`${1-o} * ${t}`}}return{value:el(r.view,t)-2}}function Mf(t,e,n,r,i,o,a){if(Ke(t))return 0;const s="x"===t||"y2"===t,u=s?-e/2:e/2;if(zr(n)||zr(i)||zr(r)||o){const t=Yr(n),e=Yr(i),l=Yr(r),c=Yr(o),f=o?`(${a} < ${c} ? ${s?"":"-"}0.5 * (${c} - (${a})) : ${u})`:u;return{signal:(l?`${l} + `:"")+(t?`(${t} ? -1 : 1) * `:"")+(e?`(${e} + ${f})`:f)}}return i=i||0,r+(n?-i-u:+i+u)}function Sf({fieldDef:t,scaleName:e,bandPosition:n,offset:r}){return Ta({scaleName:e,fieldOrDatumDef:t,bandPosition:n,offset:r})}const $f=new Set(["aria","width","height"]);function Tf(t,e){const{fill:n,stroke:r}="include"===e.color?mf(t):{};return{...Nf(t.markDef,e),...Bf(t,"fill",n),...Bf(t,"stroke",r),...gf("opacity",t),...gf("fillOpacity",t),...gf("strokeOpacity",t),...gf("strokeWidth",t),...gf("strokeDash",t),...yf(t),...lf(t),...sf(t,"href"),...hf(t)}}function Bf(t,e,n){const{config:r,mark:i,markDef:o}=t;if("hide"===Jr("invalid",o,r)&&n&&!ya(i)){const r=function(t,{invalid:e=!1,channels:n}){const r=n.reduce(((e,n)=>{const r=t.getScaleComponent(n);if(r){const i=r.get("type"),o=t.vgField(n,{expr:"datum"});o&&jo(i)&&(e[o]=!0)}return e}),{}),i=Xt(r);if(i.length>0){const t=e?"||":"&&";return i.map((t=>Sa(t,e))).join(` ${t} `)}return}(t,{invalid:!0,channels:cr});if(r)return{[e]:[{test:r,value:null},...st(n)]}}return n?{[e]:n}:{}}function Nf(t,e){return Ur.reduce(((n,r)=>($f.has(r)||void 0===t[r]||"ignore"===e[r]||(n[r]=Hr(t[r])),n)),{})}function Of(t){const{config:e,markDef:n}=t;if(Jr("invalid",n,e)){const e=function(t,{invalid:e=!1,channels:n}){const r=n.reduce(((e,n)=>{const r=t.getScaleComponent(n);if(r){const i=r.get("type"),o=t.vgField(n,{expr:"datum",binSuffix:t.stack?.impute?"mid":void 0});o&&jo(i)&&(e[o]=!0)}return e}),{}),i=Xt(r);if(i.length>0){const t=e?"||":"&&";return i.map((t=>Sa(t,e))).join(` ${t} `)}return}(t,{channels:Xn});if(e)return{defined:{signal:e}}}return{}}function zf(t,e){if(void 0!==e)return{[t]:Hr(e)}}const Rf="voronoi",Pf={defined:t=>"point"===t.type&&t.nearest,parse:(t,e)=>{if(e.events)for(const n of e.events)n.markname=t.getName(Rf)},marks:(t,e,n)=>{const{x:r,y:i}=e.project.hasChannel,o=t.mark;if(ya(o))return Wi(`The "nearest" transform is not supported for ${o} marks.`),n;const a={name:t.getName(Rf),type:"path",interactive:!0,from:{data:t.getName("marks")},encode:{update:{fill:{value:"transparent"},strokeWidth:{value:.35},stroke:{value:"transparent"},isVoronoi:{value:!0},...lf(t,{reactiveGeom:!0})}},transform:[{type:"voronoi",x:{expr:r||!i?"datum.datum.x || 0":"0"},y:{expr:i||!r?"datum.datum.y || 0":"0"},size:[t.getSizeSignalRef("width"),t.getSizeSignalRef("height")]}]};let s=0,u=!1;return n.forEach(((e,n)=>{const r=e.name??"";r===t.component.mark[0].name?s=n:r.indexOf(Rf)>=0&&(u=!0)})),u||n.splice(s+1,0,a),n}},Uf=Pf,Lf={defined:t=>"point"===t.type&&"global"===t.resolve&&t.bind&&"scales"!==t.bind&&!qu(t.bind),parse:(t,e,n)=>sh(e,n),topLevelSignals:(t,e,n)=>{const r=e.name,i=e.project,o=e.bind,a=e.init&&e.init[0],s=Uf.defined(e)?"(item().isVoronoi ? datum.datum : datum)":"datum";return i.items.forEach(((t,i)=>{const u=Jt(`${r}_${t.field}`);n.filter((t=>t.name===u)).length||n.unshift({name:u,...a?{init:Oc(a[i])}:{value:null},on:e.events?[{events:e.events,update:`datum && item().mark.marktype !== 'group' ? ${s}[${pt(t.field)}] : null`}]:[],bind:o[t.field]??o[t.channel]??o})})),n},signals:(t,e,n)=>{const r=e.name,i=e.project,o=n.filter((t=>t.name===r+eh))[0],a=r+qc,s=i.items.map((t=>Jt(`${r}_${t.field}`))),u=s.map((t=>`${t} !== null`)).join(" && ");return s.length&&(o.update=`${u} ? {fields: ${a}, values: [${s.join(", ")}]} : null`),delete o.value,delete o.on,n}},jf=Lf,If="_toggle",qf={defined:t=>"point"===t.type&&!!t.toggle,signals:(t,e,n)=>n.concat({name:e.name+If,value:!1,on:[{events:e.events,update:e.toggle}]}),modifyExpr:(t,e)=>{const n=e.name+eh,r=e.name+If;return`${r} ? null : ${n}, `+("global"===e.resolve?`${r} ? null : true, `:`${r} ? null : {unit: ${oh(t)}}, `)+`${r} ? ${n} : null`}},Wf={defined:t=>void 0!==t.clear&&!1!==t.clear,parse:(t,e)=>{e.clear&&(e.clear=dt(e.clear)?(0,Bc.r)(e.clear,"view"):e.clear)},topLevelSignals:(t,e,n)=>{if(jf.defined(e))for(const r of e.project.items){const t=n.findIndex((t=>t.name===Jt(`${e.name}_${r.field}`)));-1!==t&&n[t].on.push({events:e.clear,update:"null"})}return n},signals:(t,e,n)=>{function r(t,r){-1!==t&&n[t].on&&n[t].on.push({events:e.clear,update:r})}if("interval"===e.type)for(const i of e.project.items){const t=n.findIndex((t=>t.name===i.signals.visual));if(r(t,"[0, 0]"),-1===t){r(n.findIndex((t=>t.name===i.signals.data)),"null")}}else{let t=n.findIndex((t=>t.name===e.name+eh));r(t,"null"),qf.defined(e)&&(t=n.findIndex((t=>t.name===e.name+If)),r(t,"false"))}return n}},Hf={defined:t=>{const e="global"===t.resolve&&t.bind&&qu(t.bind),n=1===t.project.items.length&&t.project.items[0].field!==ju;return e&&!n&&Wi("Legend bindings are only supported for selections over an individual field or encoding channel."),e&&n},parse:(t,e,n)=>{const r=Ct(n);if(r.select=dt(r.select)?{type:r.select,toggle:e.toggle}:{...r.select,toggle:e.toggle},sh(e,r),(0,U.isObject)(n.select)&&(n.select.on||n.select.clear)){const t='event.item && indexof(event.item.mark.role, "legend") < 0';for(const n of e.events)n.filter=st(n.filter??[]),n.filter.includes(t)||n.filter.push(t)}const i=Wu(e.bind)?e.bind.legend:"click",o=dt(i)?(0,Bc.r)(i,"view"):st(i);e.bind={legend:{merge:o}}},topLevelSignals:(t,e,n)=>{const r=e.name,i=Wu(e.bind)&&e.bind.legend,o=t=>e=>{const n=Ct(e);return n.markname=t,n};for(const a of e.project.items){if(!a.hasLegend)continue;const t=`${Jt(a.field)}_legend`,s=`${r}_${t}`;if(0===n.filter((t=>t.name===s)).length){const r=i.merge.map(o(`${t}_symbols`)).concat(i.merge.map(o(`${t}_labels`))).concat(i.merge.map(o(`${t}_entries`)));n.unshift({name:s,...e.init?{}:{value:null},on:[{events:r,update:"isDefined(datum.value) ? datum.value : item().items[0].items[0].datum.value",force:!0},{events:i.merge,update:`!event.item || !datum ? null : ${s}`,force:!0}]})}}return n},signals:(t,e,n)=>{const r=e.name,i=e.project,o=n.find((t=>t.name===r+eh)),a=r+qc,s=i.items.filter((t=>t.hasLegend)).map((t=>Jt(`${r}_${Jt(t.field)}_legend`))),u=`${s.map((t=>`${t} !== null`)).join(" && ")} ? {fields: ${a}, values: [${s.join(", ")}]} : null`;e.events&&s.length>0?o.on.push({events:s.map((t=>({signal:t}))),update:u}):s.length>0&&(o.update=u,delete o.value,delete o.on);const l=n.find((t=>t.name===r+If)),c=Wu(e.bind)&&e.bind.legend;return l&&(e.events?l.on.push({...l.on[0],events:c}):l.on[0].events=c),n}};const Xf="_translate_anchor",Yf="_translate_delta",Gf={defined:t=>"interval"===t.type&&t.translate,signals:(t,e,n)=>{const r=e.name,i=Gc.defined(e),o=r+Xf,{x:a,y:s}=e.project.hasChannel;let u=(0,Bc.r)(e.translate,"scope");return i||(u=u.map((t=>(t.between[0].markname=r+Zc,t)))),n.push({name:o,value:{},on:[{events:u.map((t=>t.between[0])),update:"{x: x(unit), y: y(unit)"+(void 0!==a?`, extent_x: ${i?Vc(t,ve):`slice(${a.signals.visual})`}`:"")+(void 0!==s?`, extent_y: ${i?Vc(t,be):`slice(${s.signals.visual})`}`:"")+"}"}]},{name:r+Yf,value:{},on:[{events:u,update:`{x: ${o}.x - x(unit), y: ${o}.y - y(unit)}`}]}),void 0!==a&&Vf(t,e,a,"width",n),void 0!==s&&Vf(t,e,s,"height",n),n}};function Vf(t,e,n,r,i){const o=e.name,a=o+Xf,s=o+Yf,u=n.channel,l=Gc.defined(e),c=i.filter((t=>t.name===n.signals[l?"data":"visual"]))[0],f=t.getSizeSignalRef(r).signal,h=t.getScaleComponent(u),d=h&&h.get("type"),p=h&&h.get("reverse"),g=`${a}.extent_${u}`,m=`${l&&h?"log"===d?"panLog":"symlog"===d?"panSymlog":"pow"===d?"panPow":"panLinear":"panLinear"}(${g}, ${`${l?u===ve?p?"":"-":p?"-":"":""}${s}.${u} / ${l?`${f}`:`span(${g})`}`}${l?"pow"===d?`, ${h.get("exponent")??1}`:"symlog"===d?`, ${h.get("constant")??1}`:"":""})`;c.on.push({events:{signal:s},update:l?m:`clampRange(${m}, 0, ${f})`})}const Jf="_zoom_anchor",Zf="_zoom_delta",Kf={defined:t=>"interval"===t.type&&t.zoom,signals:(t,e,n)=>{const r=e.name,i=Gc.defined(e),o=r+Zf,{x:a,y:s}=e.project.hasChannel,u=pt(t.scaleName(ve)),l=pt(t.scaleName(be));let c=(0,Bc.r)(e.zoom,"scope");return i||(c=c.map((t=>(t.markname=r+Zc,t)))),n.push({name:r+Jf,on:[{events:c,update:i?"{"+[u?`x: invert(${u}, x(unit))`:"",l?`y: invert(${l}, y(unit))`:""].filter((t=>t)).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&&Qf(t,e,a,"width",n),void 0!==s&&Qf(t,e,s,"height",n),n}};function Qf(t,e,n,r,i){const o=e.name,a=n.channel,s=Gc.defined(e),u=i.filter((t=>t.name===n.signals[s?"data":"visual"]))[0],l=t.getSizeSignalRef(r).signal,c=t.getScaleComponent(a),f=c&&c.get("type"),h=s?Vc(t,a):u.name,d=o+Zf,p=`${s&&c?"log"===f?"zoomLog":"symlog"===f?"zoomSymlog":"pow"===f?"zoomPow":"zoomLinear":"zoomLinear"}(${h}, ${`${o}${Jf}.${a}`}, ${d}${s?"pow"===f?`, ${c.get("exponent")??1}`:"symlog"===f?`, ${c.get("constant")??1}`:"":""})`;u.on.push({events:{signal:d},update:s?p:`clampRange(${p}, 0, ${l})`})}const th="_store",eh="_tuple",nh="_modify",rh="vlSelectionResolve",ih=[of,nf,Xc,qf,jf,Gc,Hf,Wf,Gf,Kf,Uf];function oh(t,{escape:e}={escape:!0}){let n=e?pt(t.name):t.name;const r=function(t){let e=t.parent;for(;e&&!zm(e);)e=e.parent;return e}(t);if(r){const{facet:t}=r;for(const e of sn)t[e]&&(n+=` + '__facet_${e}_' + (facet[${pt(r.vgField(e))}])`)}return n}function ah(t){return Yt(t.component.selection??{}).reduce(((t,e)=>t||e.project.hasSelectionId),!1)}function sh(t,e){!(0,U.isString)(e.select)&&e.select.on||delete t.events,!(0,U.isString)(e.select)&&e.select.clear||delete t.clear,!(0,U.isString)(e.select)&&e.select.toggle||delete t.toggle}function uh(t,e,n){return t.fields=e||[],t.fname=n,t}function lh(t){return 1===t.length?ch(t[0]):fh(t)}const ch=t=>function(e){return e[t]},fh=t=>{const e=t.length;return function(n){for(let r=0;r<e;++r)n=n[t[r]];return n}};function hh(t){throw Error(t)}function dh(t){const e=[],n=t.length;let r,i,o,a=null,s=0,u="";function l(){e.push(u+t.substring(r,i)),u="",r=i+1}for(t+="",r=i=0;i<n;++i)if(o=t[i],"\\"===o)u+=t.substring(r,i),u+=t.substring(++i,++i),r=i;else if(o===a)l(),a=null,s=-1;else{if(a)continue;r===s&&'"'===o||r===s&&"'"===o?(r=i+1,a=o):"."!==o||s?"["===o?(i>r&&l(),s=r=i+1):"]"===o&&(s||hh("Access path missing open bracket: "+t),s>0&&l(),s=0,r=i+1):i>r?l():r=i+1}return s&&hh("Access path missing closing bracket: "+t),a&&hh("Access path missing closing quote: "+t),i>r&&(i++,l()),e}function ph(t,e,n){const r=dh(t);return t=1===r.length?r[0]:t,uh((n&&n.get||lh)(r),[t],e||t)}ph("id"),uh((t=>t),[],"identity"),uh((()=>0),[],"zero"),uh((()=>1),[],"one"),uh((()=>!0),[],"true"),uh((()=>!1),[],"false");Array.isArray;Object.prototype.hasOwnProperty;const gh="Property",mh="ArrayExpression",yh="BinaryExpression",vh="CallExpression",bh="ConditionalExpression",xh="LogicalExpression",_h="MemberExpression",wh="ObjectExpression",Ah="UnaryExpression";function Dh(t){this.type=t}var Eh,Fh,Ch,kh,Mh;Dh.prototype.visit=function(t){let e,n,r;if(t(this))return 1;for(e=function(t){switch(t.type){case mh:return t.elements;case yh:case xh:return[t.left,t.right];case vh:return[t.callee].concat(t.arguments);case bh:return[t.test,t.consequent,t.alternate];case _h:return[t.object,t.property];case wh:return t.properties;case gh:return[t.key,t.value];case Ah:return[t.argument];default:return[]}}(this),n=0,r=e.length;n<r;++n)if(e[n].visit(t))return 1};var Sh=1,$h=2,Th=3,Bh=4,Nh=5,Oh=6,zh=7,Rh=8;(Eh={})[Sh]="Boolean",Eh[$h]="<end>",Eh[Th]="Identifier",Eh[Bh]="Keyword",Eh[Nh]="Null",Eh[Oh]="Numeric",Eh[zh]="Punctuator",Eh[Rh]="String",Eh[9]="RegularExpression";var Ph="ArrayExpression",Uh="BinaryExpression",Lh="CallExpression",jh="ConditionalExpression",Ih="Identifier",qh="Literal",Wh="LogicalExpression",Hh="MemberExpression",Xh="ObjectExpression",Yh="Property",Gh="UnaryExpression",Vh="Unexpected token %0",Jh="Unexpected number",Zh="Unexpected string",Kh="Unexpected identifier",Qh="Unexpected reserved word",td="Unexpected end of input",ed="Invalid regular expression",nd="Invalid regular expression: missing /",rd="Octal literals are not allowed in strict mode.",id="Duplicate data property in object literal not allowed in strict mode",od="ILLEGAL",ad="Disabled.",sd=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]"),ud=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 ld(t,e){if(!t)throw new Error("ASSERT: "+e)}function cd(t){return t>=48&&t<=57}function fd(t){return"0123456789abcdefABCDEF".indexOf(t)>=0}function hd(t){return"01234567".indexOf(t)>=0}function dd(t){return 32===t||9===t||11===t||12===t||160===t||t>=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].indexOf(t)>=0}function pd(t){return 10===t||13===t||8232===t||8233===t}function gd(t){return 36===t||95===t||t>=65&&t<=90||t>=97&&t<=122||92===t||t>=128&&sd.test(String.fromCharCode(t))}function md(t){return 36===t||95===t||t>=65&&t<=90||t>=97&&t<=122||t>=48&&t<=57||92===t||t>=128&&ud.test(String.fromCharCode(t))}const yd={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 vd(){for(;Ch<kh;){const t=Fh.charCodeAt(Ch);if(!dd(t)&&!pd(t))break;++Ch}}function bd(t){var e,n,r,i=0;for(n="u"===t?4:2,e=0;e<n;++e)Ch<kh&&fd(Fh[Ch])?(r=Fh[Ch++],i=16*i+"0123456789abcdef".indexOf(r.toLowerCase())):Od({},Vh,od);return String.fromCharCode(i)}function xd(){var t,e,n,r;for(e=0,"}"===(t=Fh[Ch])&&Od({},Vh,od);Ch<kh&&fd(t=Fh[Ch++]);)e=16*e+"0123456789abcdef".indexOf(t.toLowerCase());return(e>1114111||"}"!==t)&&Od({},Vh,od),e<=65535?String.fromCharCode(e):(n=55296+(e-65536>>10),r=56320+(e-65536&1023),String.fromCharCode(n,r))}function _d(){var t,e;for(t=Fh.charCodeAt(Ch++),e=String.fromCharCode(t),92===t&&(117!==Fh.charCodeAt(Ch)&&Od({},Vh,od),++Ch,(t=bd("u"))&&"\\"!==t&&gd(t.charCodeAt(0))||Od({},Vh,od),e=t);Ch<kh&&md(t=Fh.charCodeAt(Ch));)++Ch,e+=String.fromCharCode(t),92===t&&(e=e.substr(0,e.length-1),117!==Fh.charCodeAt(Ch)&&Od({},Vh,od),++Ch,(t=bd("u"))&&"\\"!==t&&md(t.charCodeAt(0))||Od({},Vh,od),e+=t);return e}function wd(){var t,e;return t=Ch,e=92===Fh.charCodeAt(Ch)?_d():function(){var t,e;for(t=Ch++;Ch<kh;){if(92===(e=Fh.charCodeAt(Ch)))return Ch=t,_d();if(!md(e))break;++Ch}return Fh.slice(t,Ch)}(),{type:1===e.length?Th:yd.hasOwnProperty(e)?Bh:"null"===e?Nh:"true"===e||"false"===e?Sh:Th,value:e,start:t,end:Ch}}function Ad(){var t,e,n,r,i=Ch,o=Fh.charCodeAt(Ch),a=Fh[Ch];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++Ch,{type:zh,value:String.fromCharCode(o),start:i,end:Ch};default:if(61===(t=Fh.charCodeAt(Ch+1)))switch(o){case 43:case 45:case 47:case 60:case 62:case 94:case 124:case 37:case 38:case 42:return Ch+=2,{type:zh,value:String.fromCharCode(o)+String.fromCharCode(t),start:i,end:Ch};case 33:case 61:return Ch+=2,61===Fh.charCodeAt(Ch)&&++Ch,{type:zh,value:Fh.slice(i,Ch),start:i,end:Ch}}}return">>>="===(r=Fh.substr(Ch,4))?{type:zh,value:r,start:i,end:Ch+=4}:">>>"===(n=r.substr(0,3))||"<<="===n||">>="===n?{type:zh,value:n,start:i,end:Ch+=3}:a===(e=n.substr(0,2))[1]&&"+-<>&|".indexOf(a)>=0||"=>"===e?{type:zh,value:e,start:i,end:Ch+=2}:("//"===e&&Od({},Vh,od),"<>=!+-*%&|^/".indexOf(a)>=0?(++Ch,{type:zh,value:a,start:i,end:Ch}):void Od({},Vh,od))}function Dd(){var t,e,n;if(ld(cd((n=Fh[Ch]).charCodeAt(0))||"."===n,"Numeric literal must start with a decimal digit or a decimal point"),e=Ch,t="","."!==n){if(t=Fh[Ch++],n=Fh[Ch],"0"===t){if("x"===n||"X"===n)return++Ch,function(t){let e="";for(;Ch<kh&&fd(Fh[Ch]);)e+=Fh[Ch++];return 0===e.length&&Od({},Vh,od),gd(Fh.charCodeAt(Ch))&&Od({},Vh,od),{type:Oh,value:parseInt("0x"+e,16),start:t,end:Ch}}(e);if(hd(n))return function(t){let e="0"+Fh[Ch++];for(;Ch<kh&&hd(Fh[Ch]);)e+=Fh[Ch++];return(gd(Fh.charCodeAt(Ch))||cd(Fh.charCodeAt(Ch)))&&Od({},Vh,od),{type:Oh,value:parseInt(e,8),octal:!0,start:t,end:Ch}}(e);n&&cd(n.charCodeAt(0))&&Od({},Vh,od)}for(;cd(Fh.charCodeAt(Ch));)t+=Fh[Ch++];n=Fh[Ch]}if("."===n){for(t+=Fh[Ch++];cd(Fh.charCodeAt(Ch));)t+=Fh[Ch++];n=Fh[Ch]}if("e"===n||"E"===n)if(t+=Fh[Ch++],"+"!==(n=Fh[Ch])&&"-"!==n||(t+=Fh[Ch++]),cd(Fh.charCodeAt(Ch)))for(;cd(Fh.charCodeAt(Ch));)t+=Fh[Ch++];else Od({},Vh,od);return gd(Fh.charCodeAt(Ch))&&Od({},Vh,od),{type:Oh,value:parseFloat(t),start:e,end:Ch}}function Ed(){var t,e,n,r;return Mh=null,vd(),t=Ch,e=function(){var t,e,n,r;for(ld("/"===(t=Fh[Ch]),"Regular expression literal must start with a slash"),e=Fh[Ch++],n=!1,r=!1;Ch<kh;)if(e+=t=Fh[Ch++],"\\"===t)pd((t=Fh[Ch++]).charCodeAt(0))&&Od({},nd),e+=t;else if(pd(t.charCodeAt(0)))Od({},nd);else if(n)"]"===t&&(n=!1);else{if("/"===t){r=!0;break}"["===t&&(n=!0)}return r||Od({},nd),{value:e.substr(1,e.length-2),literal:e}}(),n=function(){var t,e,n;for(e="",n="";Ch<kh&&md((t=Fh[Ch]).charCodeAt(0));)++Ch,"\\"===t&&Ch<kh?Od({},Vh,od):(n+=t,e+=t);return n.search(/[^gimuy]/g)>=0&&Od({},ed,n),{value:n,literal:e}}(),r=function(t,e){let n=t;e.indexOf("u")>=0&&(n=n.replace(/\\u\{([0-9a-fA-F]+)\}/g,((t,e)=>{if(parseInt(e,16)<=1114111)return"x";Od({},ed)})).replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"x"));try{new RegExp(n)}catch(r){Od({},ed)}try{return new RegExp(t,e)}catch(i){return null}}(e.value,n.value),{literal:e.literal+n.literal,value:r,regex:{pattern:e.value,flags:n.value},start:t,end:Ch}}function Fd(){if(vd(),Ch>=kh)return{type:$h,start:Ch,end:Ch};const t=Fh.charCodeAt(Ch);return gd(t)?wd():40===t||41===t||59===t?Ad():39===t||34===t?function(){var t,e,n,r,i="",o=!1;for(ld("'"===(t=Fh[Ch])||'"'===t,"String literal must starts with a quote"),e=Ch,++Ch;Ch<kh;){if((n=Fh[Ch++])===t){t="";break}if("\\"===n)if((n=Fh[Ch++])&&pd(n.charCodeAt(0)))"\r"===n&&"\n"===Fh[Ch]&&++Ch;else switch(n){case"u":case"x":"{"===Fh[Ch]?(++Ch,i+=xd()):i+=bd(n);break;case"n":i+="\n";break;case"r":i+="\r";break;case"t":i+="\t";break;case"b":i+="\b";break;case"f":i+="\f";break;case"v":i+="\v";break;default:hd(n)?(0!==(r="01234567".indexOf(n))&&(o=!0),Ch<kh&&hd(Fh[Ch])&&(o=!0,r=8*r+"01234567".indexOf(Fh[Ch++]),"0123".indexOf(n)>=0&&Ch<kh&&hd(Fh[Ch])&&(r=8*r+"01234567".indexOf(Fh[Ch++]))),i+=String.fromCharCode(r)):i+=n}else{if(pd(n.charCodeAt(0)))break;i+=n}}return""!==t&&Od({},Vh,od),{type:Rh,value:i,octal:o,start:e,end:Ch}}():46===t?cd(Fh.charCodeAt(Ch+1))?Dd():Ad():cd(t)?Dd():Ad()}function Cd(){const t=Mh;return Ch=t.end,Mh=Fd(),Ch=t.end,t}function kd(){const t=Ch;Mh=Fd(),Ch=t}function Md(t,e,n){const r=new Dh("||"===t||"&&"===t?Wh:Uh);return r.operator=t,r.left=e,r.right=n,r}function Sd(t,e){const n=new Dh(Lh);return n.callee=t,n.arguments=e,n}function $d(t){const e=new Dh(Ih);return e.name=t,e}function Td(t){const e=new Dh(qh);return e.value=t.value,e.raw=Fh.slice(t.start,t.end),t.regex&&("//"===e.raw&&(e.raw="/(?:)/"),e.regex=t.regex),e}function Bd(t,e,n){const r=new Dh(Hh);return r.computed="["===t,r.object=e,r.property=n,r.computed||(n.member=!0),r}function Nd(t,e,n){const r=new Dh(Yh);return r.key=e,r.value=n,r.kind=t,r}function Od(t,e){var n,r=Array.prototype.slice.call(arguments,2),i=e.replace(/%(\d)/g,((t,e)=>(ld(e<r.length,"Message reference must be in range"),r[e])));throw(n=new Error(i)).index=Ch,n.description=i,n}function zd(t){t.type===$h&&Od(t,td),t.type===Oh&&Od(t,Jh),t.type===Rh&&Od(t,Zh),t.type===Th&&Od(t,Kh),t.type===Bh&&Od(t,Qh),Od(t,Vh,t.value)}function Rd(t){const e=Cd();e.type===zh&&e.value===t||zd(e)}function Pd(t){return Mh.type===zh&&Mh.value===t}function Ud(t){return Mh.type===Bh&&Mh.value===t}function Ld(){const t=[];for(Ch=Mh.start,Rd("[");!Pd("]");)Pd(",")?(Cd(),t.push(null)):(t.push(Kd()),Pd("]")||Rd(","));return Cd(),function(t){const e=new Dh(Ph);return e.elements=t,e}(t)}function jd(){Ch=Mh.start;const t=Cd();return t.type===Rh||t.type===Oh?(t.octal&&Od(t,rd),Td(t)):$d(t.value)}function Id(){var t,e,n;return Ch=Mh.start,(t=Mh).type===Th?(n=jd(),Rd(":"),Nd("init",n,Kd())):t.type!==$h&&t.type!==zh?(e=jd(),Rd(":"),Nd("init",e,Kd())):void zd(t)}function qd(){var t,e,n=[],r={},i=String;for(Ch=Mh.start,Rd("{");!Pd("}");)e="$"+((t=Id()).key.type===Ih?t.key.name:i(t.key.value)),Object.prototype.hasOwnProperty.call(r,e)?Od({},id):r[e]=!0,n.push(t),Pd("}")||Rd(",");return Rd("}"),function(t){const e=new Dh(Xh);return e.properties=t,e}(n)}const Wd={if:1};function Hd(){var t,e,n;if(Pd("("))return function(){Rd("(");const t=Qd();return Rd(")"),t}();if(Pd("["))return Ld();if(Pd("{"))return qd();if(t=Mh.type,Ch=Mh.start,t===Th||Wd[Mh.value])n=$d(Cd().value);else if(t===Rh||t===Oh)Mh.octal&&Od(Mh,rd),n=Td(Cd());else{if(t===Bh)throw new Error(ad);t===Sh?((e=Cd()).value="true"===e.value,n=Td(e)):t===Nh?((e=Cd()).value=null,n=Td(e)):Pd("/")||Pd("/=")?(n=Td(Ed()),kd()):zd(Cd())}return n}function Xd(){const t=[];if(Rd("("),!Pd(")"))for(;Ch<kh&&(t.push(Kd()),!Pd(")"));)Rd(",");return Rd(")"),t}function Yd(){Ch=Mh.start;const t=Cd();return function(t){return t.type===Th||t.type===Bh||t.type===Sh||t.type===Nh}(t)||zd(t),$d(t.value)}function Gd(){Rd("[");const t=Qd();return Rd("]"),t}function Vd(){const t=function(){var t;for(t=Hd();;)if(Pd("."))Rd("."),t=Bd(".",t,Yd());else if(Pd("("))t=Sd(t,Xd());else{if(!Pd("["))break;t=Bd("[",t,Gd())}return t}();if(Mh.type===zh&&(Pd("++")||Pd("--")))throw new Error(ad);return t}function Jd(){var t,e;if(Mh.type!==zh&&Mh.type!==Bh)e=Vd();else{if(Pd("++")||Pd("--"))throw new Error(ad);if(Pd("+")||Pd("-")||Pd("~")||Pd("!"))t=Cd(),e=Jd(),e=function(t,e){const n=new Dh(Gh);return n.operator=t,n.argument=e,n.prefix=!0,n}(t.value,e);else{if(Ud("delete")||Ud("void")||Ud("typeof"))throw new Error(ad);e=Vd()}}return e}function Zd(t){let e=0;if(t.type!==zh&&t.type!==Bh)return 0;switch(t.value){case"||":e=1;break;case"&&":e=2;break;case"|":e=3;break;case"^":e=4;break;case"&":e=5;break;case"==":case"!=":case"===":case"!==":e=6;break;case"<":case">":case"<=":case">=":case"instanceof":case"in":e=7;break;case"<<":case">>":case">>>":e=8;break;case"+":case"-":e=9;break;case"*":case"/":case"%":e=11}return e}function Kd(){var t,e;return t=function(){var t,e,n,r,i,o,a,s,u,l;if(t=Mh,u=Jd(),0===(i=Zd(r=Mh)))return u;for(r.prec=i,Cd(),e=[t,Mh],o=[u,r,a=Jd()];(i=Zd(Mh))>0;){for(;o.length>2&&i<=o[o.length-2].prec;)a=o.pop(),s=o.pop().value,u=o.pop(),e.pop(),n=Md(s,u,a),o.push(n);(r=Cd()).prec=i,o.push(r),e.push(Mh),n=Jd(),o.push(n)}for(n=o[l=o.length-1],e.pop();l>1;)e.pop(),n=Md(o[l-1].value,o[l-2],n),l-=2;return n}(),Pd("?")&&(Cd(),e=Kd(),Rd(":"),t=function(t,e,n){const r=new Dh(jh);return r.test=t,r.consequent=e,r.alternate=n,r}(t,e,Kd())),t}function Qd(){const t=Kd();if(Pd(","))throw new Error(ad);return t}function tp(t){const e=[];return"Identifier"===t.type?[t.name]:"Literal"===t.type?[t.value]:("MemberExpression"===t.type&&(e.push(...tp(t.object)),e.push(...tp(t.property))),e)}function ep(t){return"MemberExpression"===t.object.type?ep(t.object):"datum"===t.object.name}function np(t){const e=function(t){Ch=0,kh=(Fh=t).length,Mh=null,kd();const e=Qd();if(Mh.type!==$h)throw new Error("Unexpect token after expression.");return e}(t),n=new Set;return e.visit((t=>{"MemberExpression"===t.type&&ep(t)&&n.add(tp(t).slice(1).join("."))})),n}class rp extends Lc{clone(){return new rp(null,this.model,Ct(this.filter))}constructor(t,e,n){super(t),this.model=e,this.filter=n,this.expr=ap(this.model,this.filter,this),this._dependentFields=np(this.expr)}dependentFields(){return this._dependentFields}producedFields(){return new Set}assemble(){return{type:"filter",expr:this.expr}}hash(){return`Filter ${this.expr}`}}function ip(t,e,n,r="datum"){const i=dt(e)?e:e.param,o=Jt(i),a=pt(o+th);let s;try{s=t.getSelectionComponent(o,i)}catch(c){return`!!${o}`}if(s.project.timeUnit){const e=n??t.component.data.raw,r=s.project.timeUnit.clone();e.parent?r.insertAsParentOf(e):e.parent=r}const u=`${s.project.hasSelectionId?"vlSelectionIdTest(":"vlSelectionTest("}${a}, ${r}${"global"===s.resolve?")":`, ${pt(s.resolve)})`}`,l=`length(data(${a}))`;return!1===e.empty?`${l} && ${u}`:`!${l} || ${u}`}function op(t,e,n){const r=Jt(e),i=n.encoding;let o,a=n.field;try{o=t.getSelectionComponent(r,e)}catch(s){return r}if(i||a){if(i&&!a){const t=o.project.items.filter((t=>t.channel===i));!t.length||t.length>1?(a=o.project.items[0].field,Wi((t.length?"Multiple ":"No ")+`matching ${pt(i)} encoding found for selection ${pt(n.param)}. `+`Using "field": ${pt(a)}.`)):a=t[0].field}}else a=o.project.items[0].field,o.project.items.length>1&&Wi(`A "field" or "encoding" must be specified when using a selection as a scale domain. Using "field": ${pt(a)}.`);return`${o.name}[${pt(re(a))}]`}function ap(t,e,n){return Zt(e,(e=>dt(e)?e:function(t){return t?.param}(e)?ip(t,e,n):vo(e)))}function sp(t,e,n,r){var i,o;t.encode??(t.encode={}),(i=t.encode)[e]??(i[e]={}),(o=t.encode[e]).update??(o.update={}),t.encode[e].update[n]=r}function up(t,e,n,r={header:!1}){const{disable:i,orient:o,scale:a,labelExpr:s,title:u,zindex:l,...c}=t.combine();if(!i){for(const t in c){const n=Gs[t],r=c[t];if(n&&n!==e&&"both"!==n)delete c[t];else if(Xs(r)){const{condition:e,...n}=r,i=st(e),o=Hs[t];if(o){const{vgProp:e,part:r}=o;sp(c,r,e,[...i.map((t=>{const{test:e,...n}=t;return{test:ap(null,e),...n}})),n]),delete c[t]}else if(null===o){const e={signal:i.map((t=>{const{test:e,...n}=t;return`${ap(null,e)} ? ${Xr(n)} : `})).join("")+Xr(n)};c[t]=e}}else if(zr(r)){const e=Hs[t];if(e){const{vgProp:n,part:i}=e;sp(c,i,n,r),delete c[t]}}Nt(["labelAlign","labelBaseline"],t)&&null===c[t]&&delete c[t]}if("grid"===e){if(!c.grid)return;if(c.encode){const{grid:t}=c.encode;c.encode={...t?{grid:t}:{}},Ht(c.encode)&&delete c.encode}return{scale:a,orient:o,...c,domain:!1,labels:!1,aria:!1,maxExtent:0,minExtent:0,ticks:!1,zindex:se(l,0)}}{if(!r.header&&t.mainExtracted)return;if(void 0!==s){let t=s;c.encode?.labels?.update&&zr(c.encode.labels.update.text)&&(t=ie(s,"datum.label",c.encode.labels.update.text.signal)),sp(c,"labels","text",{signal:t})}if(null===c.labelAlign&&delete c.labelAlign,c.encode){for(const e of Ys)t.hasAxisPart(e)||delete c.encode[e];Ht(c.encode)&&delete c.encode}const e=function(t,e){if(t)return et(t)&&!Or(t)?t.map((t=>Ts(t,e))).join(", "):t}(u,n);return{scale:a,orient:o,grid:!1,...e?{title:e}:{},...c,...!1===n.aria?{aria:!1}:{},zindex:se(l,0)}}}}function lp(t){const{axes:e}=t.component,n=[];for(const r of Xn)if(e[r])for(const i of e[r])if(!i.get("disable")&&!i.get("gridScale")){const e="x"===r?"height":"width",i=t.getSizeSignalRef(e).signal;e!==i&&n.push({name:e,update:i})}return n}function cp(t,e,n,r){return Object.assign.apply(null,[{},...t.map((t=>{if("axisOrient"===t){const t="x"===n?"bottom":"left",i=e["x"===n?"axisBottom":"axisLeft"]||{},o=e["x"===n?"axisTop":"axisRight"]||{},a=new Set([...Xt(i),...Xt(o)]),s={};for(const e of a.values())s[e]={signal:`${r.signal} === "${t}" ? ${Yr(i[e])} : ${Yr(o[e])}`};return s}return e[t]}))])}function fp(t,e){const n=[{}];for(const r of t){let t=e[r]?.style;if(t){t=st(t);for(const r of t)n.push(e.style[r])}}return Object.assign.apply(null,n)}function hp(t,e,n,r={}){const i=Qr(t,n,e);if(void 0!==i)return{configFrom:"style",configValue:i};for(const o of["vlOnlyAxisConfig","vgAxisConfig","axisConfigStyle"])if(void 0!==r[o]?.[t])return{configFrom:o,configValue:r[o][t]};return{}}const dp={scale:({model:t,channel:e})=>t.scaleName(e),format:({format:t})=>t,formatType:({formatType:t})=>t,grid:({fieldOrDatumDef:t,axis:e,scaleType:n})=>e.grid??function(t,e){return!Lo(t)&&fs(e)&&!Cr(e?.bin)&&!kr(e?.bin)}(n,t),gridScale:({model:t,channel:e})=>function(t,e){const n="x"===e?"y":"x";if(t.getScaleComponent(n))return t.scaleName(n);return}(t,e),labelAlign:({axis:t,labelAngle:e,orient:n,channel:r})=>t.labelAlign||mp(e,n,r),labelAngle:({labelAngle:t})=>t,labelBaseline:({axis:t,labelAngle:e,orient:n,channel:r})=>t.labelBaseline||gp(e,n,r),labelFlush:({axis:t,fieldOrDatumDef:e,channel:n})=>t.labelFlush??function(t,e){if("x"===e&&Nt(["quantitative","temporal"],t))return!0;return}(e.type,n),labelOverlap:({axis:t,fieldOrDatumDef:e,scaleType:n})=>t.labelOverlap??function(t,e,n,r){if(n&&!nt(r)||"nominal"!==t&&"ordinal"!==t)return"log"!==e&&"symlog"!==e||"greedy";return}(e.type,n,fs(e)&&!!e.timeUnit,fs(e)?e.sort:void 0),orient:({orient:t})=>t,tickCount:({channel:t,model:e,axis:n,fieldOrDatumDef:r,scaleType:i})=>{const o="x"===t?"width":"y"===t?"height":void 0,a=o?e.getSizeSignalRef(o):void 0;return n.tickCount??function({fieldOrDatumDef:t,scaleType:e,size:n,values:r}){if(!r&&!Lo(e)&&"log"!==e){if(fs(t)){if(Cr(t.bin))return{signal:`ceil(${n.signal}/10)`};if(t.timeUnit&&Nt(["month","hours","day","quarter"],ao(t.timeUnit)?.unit))return}return{signal:`ceil(${n.signal}/40)`}}return}({fieldOrDatumDef:r,scaleType:i,size:a,values:n.values})},tickMinStep:function({format:t,fieldOrDatumDef:e}){if("d"===t)return 1;if(fs(e)){const{timeUnit:t}=e;if(t){const e=so(t);if(e)return{signal:e}}}return},title:({axis:t,model:e,channel:n})=>{if(void 0!==t.title)return t.title;const r=yp(e,n);if(void 0!==r)return r;const i=e.typedFieldDef(n),o="x"===n?"x2":"y2",a=e.fieldDef(o);return ei(i?[ns(i)]:[],fs(a)?[ns(a)]:[])},values:({axis:t,fieldOrDatumDef:e})=>function(t,e){const n=t.values;if(et(n))return qs(e,n);if(zr(n))return n;return}(t,e),zindex:({axis:t,fieldOrDatumDef:e,mark:n})=>t.zindex??function(t,e){if("rect"===t&&Fs(e))return 1;return 0}(n,e)};function pp(t){return`(((${t.signal} % 360) + 360) % 360)`}function gp(t,e,n,r){if(void 0!==t){if("x"===n){if(zr(t)){const n=pp(t);return{signal:`(45 < ${n} && ${n} < 135) || (225 < ${n} && ${n} < 315) ? "middle" :(${n} <= 45 || 315 <= ${n}) === ${zr(e)?`(${e.signal} === "top")`:"top"===e} ? "bottom" : "top"`}}if(45<t&&t<135||225<t&&t<315)return"middle";if(zr(e)){const n=t<=45||315<=t?"===":"!==";return{signal:`${e.signal} ${n} "top" ? "bottom" : "top"`}}return(t<=45||315<=t)===("top"===e)?"bottom":"top"}if(zr(t)){const n=pp(t);return{signal:`${n} <= 45 || 315 <= ${n} || (135 <= ${n} && ${n} <= 225) ? ${r?'"middle"':"null"} : (45 <= ${n} && ${n} <= 135) === ${zr(e)?`(${e.signal} === "left")`:"left"===e} ? "top" : "bottom"`}}if(t<=45||315<=t||135<=t&&t<=225)return r?"middle":null;if(zr(e)){const n=45<=t&&t<=135?"===":"!==";return{signal:`${e.signal} ${n} "left" ? "top" : "bottom"`}}return(45<=t&&t<=135)===("left"===e)?"top":"bottom"}}function mp(t,e,n){if(void 0===t)return;const r="x"===n,i=r?0:90,o=r?"bottom":"left";if(zr(t)){const n=pp(t);return{signal:`(${i?`(${n} + 90)`:n} % 180 === 0) ? ${r?null:'"center"'} :(${i} < ${n} && ${n} < ${180+i}) === ${zr(e)?`(${e.signal} === "${o}")`:e===o} ? "left" : "right"`}}if((t+i)%180===0)return r?null:"center";if(zr(e)){const n=i<t&&t<180+i?"===":"!==";return{signal:`${`${e.signal} ${n} "${o}"`} ? "left" : "right"`}}return(i<t&&t<180+i)===(e===o)?"left":"right"}function yp(t,e){const n="x"===e?"x2":"y2",r=t.fieldDef(e),i=t.fieldDef(n),o=r?r.title:void 0,a=i?i.title:void 0;return o&&a?ni(o,a):o||(a||(void 0!==o?o:void 0!==a?a:void 0))}class vp extends Lc{clone(){return new vp(null,Ct(this.transform))}constructor(t,e){super(t),this.transform=e,this._dependentFields=np(this.transform.calculate)}static parseAllForSortIndex(t,e){return e.forEachFieldDef(((e,n)=>{if(xs(e)&&Ka(e.sort)){const{field:r,timeUnit:i}=e,o=e.sort,a=o.map(((t,e)=>`${vo({field:r,timeUnit:i,equal:t})} ? ${e} : `)).join("")+o.length;t=new vp(t,{calculate:a,as:bp(e,n,{forAs:!0})})}})),t}producedFields(){return new Set([this.transform.as])}dependentFields(){return this._dependentFields}assemble(){return{type:"formula",expr:this.transform.calculate,as:this.transform.as}}hash(){return`Calculate ${Tt(this.transform)}`}}function bp(t,e,n){return Es(t,{prefix:e,suffix:"sort_index",...n??{}})}function xp(t,e){return Nt(["top","bottom"],e)?"column":Nt(["left","right"],e)||"row"===t?"row":"column"}function _p(t,e,n,r){const i="row"===r?n.headerRow:"column"===r?n.headerColumn:n.headerFacet;return se((e||{})[t],i[t],n.header[t])}function wp(t,e,n,r){const i={};for(const o of t){const t=_p(o,e||{},n,r);void 0!==t&&(i[o]=t)}return i}const Ap=["row","column"],Dp=["header","footer"];function Ep(t,e){const n=t.component.layoutHeaders[e].title,r=t.config?t.config:void 0,i=t.component.layoutHeaders[e].facetFieldDef?t.component.layoutHeaders[e].facetFieldDef:void 0,{titleAnchor:o,titleAngle:a,titleOrient:s}=wp(["titleAnchor","titleAngle","titleOrient"],i.header,r,e),u=xp(e,s),l=de(a);return{name:`${e}-title`,type:"group",role:`${u}-title`,title:{text:n,..."row"===e?{orient:"left"}:{},style:"guide-title",...Cp(l,u),...Fp(u,l,o),...Np(r,i,e,zu,Nu)}}}function Fp(t,e,n="middle"){switch(n){case"start":return{align:"left"};case"end":return{align:"right"}}const r=mp(e,"row"===t?"left":"top","row"===t?"y":"x");return r?{align:r}:{}}function Cp(t,e){const n=gp(t,"row"===e?"left":"top","row"===e?"y":"x",!0);return n?{baseline:n}:{}}function kp(t,e){const n=t.component.layoutHeaders[e],r=[];for(const i of Dp)if(n[i])for(const o of n[i]){const a=$p(t,e,i,n,o);null!=a&&r.push(a)}return r}function Mp(t,e){const{sort:n}=t;return Za(n)?{field:Es(n,{expr:"datum"}),order:n.order??"ascending"}:et(n)?{field:bp(t,e,{expr:"datum"}),order:"ascending"}:{field:Es(t,{expr:"datum"}),order:n??"ascending"}}function Sp(t,e,n){const{format:r,formatType:i,labelAngle:o,labelAnchor:a,labelOrient:s,labelExpr:u}=wp(["format","formatType","labelAngle","labelAnchor","labelOrient","labelExpr"],t.header,n,e),l=Pa({fieldOrDatumDef:t,format:r,formatType:i,expr:"parent",config:n}).signal,c=xp(e,s);return{text:{signal:u?ie(ie(u,"datum.label",l),"datum.value",Es(t,{expr:"parent"})):l},..."row"===e?{orient:"left"}:{},style:"guide-label",frame:"group",...Cp(o,c),...Fp(c,o,a),...Np(n,t,e,Ru,Ou)}}function $p(t,e,n,r,i){if(i){let o=null;const{facetFieldDef:a}=r,s=t.config?t.config:void 0;if(a&&i.labels){const{labelOrient:t}=wp(["labelOrient"],a.header,s,e);("row"===e&&!Nt(["top","bottom"],t)||"column"===e&&!Nt(["left","right"],t))&&(o=Sp(a,e,s))}const u=zm(t)&&!Qa(t.facet),l=i.axes,c=l?.length>0;if(o||c){const s="row"===e?"height":"width";return{name:t.getName(`${e}_${n}`),type:"group",role:`${e}-${n}`,...r.facetFieldDef?{from:{data:t.getName(`${e}_domain`)},sort:Mp(a,e)}:{},...c&&u?{from:{data:t.getName(`facet_domain_${e}`)}}:{},...o?{title:o}:{},...i.sizeSignal?{encode:{update:{[s]:i.sizeSignal}}}:{},...c?{axes:l}:{}}}}return null}const Tp={column:{start:0,end:1},row:{start:1,end:0}};function Bp(t,e){return Tp[e][t]}function Np(t,e,n,r,i){const o={};for(const a of r){if(!i[a])continue;const r=_p(a,e?.header,t,n);void 0!==r&&(o[i[a]]=r)}return o}function Op(t){return[...zp(t,"width"),...zp(t,"height"),...zp(t,"childWidth"),...zp(t,"childHeight")]}function zp(t,e){const n="width"===e?"x":"y",r=t.component.layoutSize.get(e);if(!r||"merged"===r)return[];const i=t.getSizeSignalRef(e).signal;if("step"===r){const e=t.getScaleComponent(n);if(e){const r=e.get("type"),o=e.get("range");if(Lo(r)&&Rr(o)){const r=t.scaleName(n);if(zm(t.parent)){if("independent"===t.parent.component.resolve.scale[n])return[Rp(r,o)]}return[Rp(r,o),{name:i,update:Pp(r,e,`domain('${r}').length`)}]}}throw new Error("layout size is step although width/height is not step.")}if("container"==r){const e=i.endsWith("width"),n=e?"containerSize()[0]":"containerSize()[1]",r=`isFinite(${n}) ? ${n} : ${tl(t.config.view,e?"width":"height")}`;return[{name:i,init:r,on:[{update:r,events:"window:resize"}]}]}return[{name:i,value:r}]}function Rp(t,e){const n=`${t}_step`;return zr(e.step)?{name:n,update:e.step.signal}:{name:n,value:e.step}}function Pp(t,e,n){const r=e.get("type"),i=e.get("padding"),o=se(e.get("paddingOuter"),i);let a=e.get("paddingInner");return a="band"===r?void 0!==a?a:i:1,`bandspace(${n}, ${Yr(a)}, ${Yr(o)}) * ${t}_step`}function Up(t){return"childWidth"===t?"width":"childHeight"===t?"height":t}function Lp(t,e){return Xt(t).reduce(((n,r)=>{const i=t[r];return{...n,...af(e,i,r,(t=>Hr(t.value)))}}),{})}function jp(t,e){if(zm(e))return"theta"===t?"independent":"shared";if(Pm(e))return"shared";if(Rm(e))return Yn(t)||"theta"===t||"radius"===t?"independent":"shared";throw new Error("invalid model type for resolve")}function Ip(t,e){const n=t.scale[e],r=Yn(e)?"axis":"legend";return"independent"===n?("shared"===t[r][e]&&Wi(function(t){return`Setting the scale to be independent for "${t}" means we also have to set the guide (axis or legend) to be independent.`}(e)),"independent"):t[r][e]||"shared"}const qp={...Lu,disable:1,labelExpr:1,selections:1,opacity:1,shape:1,stroke:1,fill:1,size:1,strokeWidth:1,strokeDash:1,encode:1},Wp=Xt(qp);class Hp extends vc{}const Xp={symbols:function(t,{fieldOrDatumDef:e,model:n,channel:r,legendCmpt:i,legendType:o}){if("symbol"!==o)return;const{markDef:a,encoding:s,config:u,mark:l}=n,c=a.filled&&"trail"!==l;let f={...Gr({},n,_a),...mf(n,{filled:c})};const h=i.get("symbolOpacity")??u.legend.symbolOpacity,d=i.get("symbolFillColor")??u.legend.symbolFillColor,p=i.get("symbolStrokeColor")??u.legend.symbolStrokeColor,g=void 0===h?Yp(s.opacity)??a.opacity:void 0;if(f.fill)if("fill"===r||c&&r===Te)delete f.fill;else if(f.fill.field)d?delete f.fill:(f.fill=Hr(u.legend.symbolBaseFillColor??"black"),f.fillOpacity=Hr(g??1));else if(et(f.fill)){const t=Gp(s.fill??s.color)??a.fill??(c&&a.color);t&&(f.fill=Hr(t))}if(f.stroke)if("stroke"===r||!c&&r===Te)delete f.stroke;else if(f.stroke.field||p)delete f.stroke;else if(et(f.stroke)){const t=se(Gp(s.stroke||s.color),a.stroke,c?a.color:void 0);t&&(f.stroke={value:t})}if(r!==Pe){const t=fs(e)&&Jp(n,i,e);t?f.opacity=[{test:t,...Hr(g??1)},Hr(u.legend.unselectedOpacity)]:g&&(f.opacity=Hr(g))}return f={...f,...t},Ht(f)?void 0:f},gradient:function(t,{model:e,legendType:n,legendCmpt:r}){if("gradient"!==n)return;const{config:i,markDef:o,encoding:a}=e;let s={};const u=void 0===(r.get("gradientOpacity")??i.legend.gradientOpacity)?Yp(a.opacity)||o.opacity:void 0;u&&(s.opacity=Hr(u));return s={...s,...t},Ht(s)?void 0:s},labels:function(t,{fieldOrDatumDef:e,model:n,channel:r,legendCmpt:i}){const o=n.legend(r)||{},a=n.config,s=fs(e)?Jp(n,i,e):void 0,u=s?[{test:s,value:1},{value:a.legend.unselectedOpacity}]:void 0,{format:l,formatType:c}=o;let f;Oa(c)?f=La({fieldOrDatumDef:e,field:"datum.value",format:l,formatType:c,config:a}):void 0===l&&void 0===c&&a.customFormatTypes&&("quantitative"===e.type&&a.numberFormatType?f=La({fieldOrDatumDef:e,field:"datum.value",format:a.numberFormat,formatType:a.numberFormatType,config:a}):"temporal"===e.type&&a.timeFormatType&&fs(e)&&void 0===e.timeUnit&&(f=La({fieldOrDatumDef:e,field:"datum.value",format:a.timeFormat,formatType:a.timeFormatType,config:a})));const h={...u?{opacity:u}:{},...f?{text:f}:{},...t};return Ht(h)?void 0:h},entries:function(t,{legendCmpt:e}){return e.get("selections")?.length?{...t,fill:{value:"transparent"}}:t}};function Yp(t){return Vp(t,((t,e)=>Math.max(t,e.value)))}function Gp(t){return Vp(t,((t,e)=>se(t,e.value)))}function Vp(t,e){return function(t){const e=t?.condition;return!!e&&(et(e)||bs(e))}(t)?st(t.condition).reduce(e,t.value):bs(t)?t.value:void 0}function Jp(t,e,n){const r=e.get("selections");if(!r?.length)return;const i=pt(n.field);return r.map((t=>`(!length(data(${pt(Jt(t)+th)})) || (${t}[${i}] && indexof(${t}[${i}], datum.value) >= 0))`)).join(" || ")}const Zp={direction:({direction:t})=>t,format:({fieldOrDatumDef:t,legend:e,config:n})=>{const{format:r,formatType:i}=e;return ja(t,t.type,r,i,n,!1)},formatType:({legend:t,fieldOrDatumDef:e,scaleType:n})=>{const{formatType:r}=t;return Ia(r,e,n)},gradientLength:t=>{const{legend:e,legendConfig:n}=t;return e.gradientLength??n.gradientLength??function({legendConfig:t,model:e,direction:n,orient:r,scaleType:i}){const{gradientHorizontalMaxLength:o,gradientHorizontalMinLength:a,gradientVerticalMaxLength:s,gradientVerticalMinLength:u}=t;if(Io(i))return"horizontal"===n?"top"===r||"bottom"===r?tg(e,"width",a,o):a:tg(e,"height",u,s);return}(t)},labelOverlap:({legend:t,legendConfig:e,scaleType:n})=>t.labelOverlap??e.labelOverlap??function(t){if(Nt(["quantile","threshold","log","symlog"],t))return"greedy";return}(n),symbolType:({legend:t,markDef:e,channel:n,encoding:r})=>t.symbolType??function(t,e,n,r){if("shape"!==e){const t=Gp(n)??r;if(t)return t}switch(t){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"}}(e.type,n,r.shape,e.shape),title:({fieldOrDatumDef:t,config:e})=>Ss(t,e,{allowDisabling:!0}),type:({legendType:t,scaleType:e,channel:n})=>{if(on(n)&&Io(e)){if("gradient"===t)return}else if("symbol"===t)return;return t},values:({fieldOrDatumDef:t,legend:e})=>function(t,e){const n=t.values;if(et(n))return qs(e,n);if(zr(n))return n;return}(e,t)};function Kp(t){const{legend:e}=t;return se(e.type,function({channel:t,timeUnit:e,scaleType:n}){if(on(t)){if(Nt(["quarter","month","day"],e))return"symbol";if(Io(n))return"gradient"}return"symbol"}(t))}function Qp({legendConfig:t,legendType:e,orient:n,legend:r}){return r.direction??t[e?"gradientDirection":"symbolDirection"]??function(t,e){switch(t){case"top":case"bottom":return"horizontal";case"left":case"right":case"none":case void 0:return;default:return"gradient"===e?"horizontal":void 0}}(n,e)}function tg(t,e,n,r){return{signal:`clamp(${t.getSizeSignalRef(e).signal}, ${n}, ${r})`}}function eg(t){const e=Om(t)?function(t){const{encoding:e}=t,n={};for(const r of[Te,...Uu]){const i=Os(e[r]);i&&t.getScaleComponent(r)&&(r===Oe&&fs(i)&&i.type===ko||(n[r]=rg(t,r)))}return n}(t):function(t){const{legends:e,resolve:n}=t.component;for(const r of t.children){eg(r);for(const i of Xt(r.component.legends))n.legend[i]=Ip(t.component.resolve,i),"shared"===n.legend[i]&&(e[i]=ig(e[i],r.component.legends[i]),e[i]||(n.legend[i]="independent",delete e[i]))}for(const r of Xt(e))for(const e of t.children)e.component.legends[r]&&"shared"===n.legend[r]&&delete e.component.legends[r];return e}(t);return t.component.legends=e,e}function ng(t,e,n,r){switch(e){case"disable":return void 0!==n;case"values":return!!n?.values;case"title":if("title"===e&&t===r?.title)return!0}return t===(n||{})[e]}function rg(t,e){let n=t.legend(e);const{markDef:r,encoding:i,config:o}=t,a=o.legend,s=new Hp({},function(t,e){const n=t.scaleName(e);if("trail"===t.mark){if("color"===e)return{stroke:n};if("size"===e)return{strokeWidth:n}}return"color"===e?t.markDef.filled?{fill:n}:{stroke:n}:{[e]:n}}(t,e));!function(t,e,n){const r=t.fieldDef(e)?.field;for(const i of Yt(t.component.selection??{})){const t=i.project.hasField[r]??i.project.hasChannel[e];if(t&&Hf.defined(i)){const e=n.get("selections")??[];e.push(i.name),n.set("selections",e,!1),t.hasLegend=!0}}}(t,e,s);const u=void 0!==n?!n:a.disable;if(s.set("disable",u,void 0!==n),u)return s;n=n||{};const l=t.getScaleComponent(e).get("type"),c=Os(i[e]),f=fs(c)?ao(c.timeUnit)?.unit:void 0,h=n.orient||o.legend.orient||"right",d=Kp({legend:n,channel:e,timeUnit:f,scaleType:l}),p={legend:n,channel:e,model:t,markDef:r,encoding:i,fieldOrDatumDef:c,legendConfig:a,config:o,scaleType:l,orient:h,legendType:d,direction:Qp({legend:n,legendType:d,orient:h,legendConfig:a})};for(const b of Wp){if("gradient"===d&&b.startsWith("symbol")||"symbol"===d&&b.startsWith("gradient"))continue;const r=b in Zp?Zp[b](p):n[b];if(void 0!==r){const i=ng(r,b,n,t.fieldDef(e));(i||void 0===o.legend[b])&&s.set(b,r,i)}}const g=n?.encoding??{},m=s.get("selections"),y={},v={fieldOrDatumDef:c,model:t,channel:e,legendCmpt:s,legendType:d};for(const b of["labels","legend","title","symbols","gradient","entries"]){const e=Lp(g[b]??{},t),n=b in Xp?Xp[b](e,v):e;void 0===n||Ht(n)||(y[b]={...m?.length&&fs(c)?{name:`${Jt(c.field)}_legend_${b}`}:{},...m?.length?{interactive:!!m}:{},update:n})}return Ht(y)||s.set("encode",y,!!n?.encoding),s}function ig(t,e){if(!t)return e.clone();const n=t.getWithExplicit("orient"),r=e.getWithExplicit("orient");if(n.explicit&&r.explicit&&n.value!==r.value)return;let i=!1;for(const o of Wp){const n=Ac(t.getWithExplicit(o),e.getWithExplicit(o),o,"legend",((t,e)=>{switch(o){case"symbolType":return og(t,e);case"title":return ri(t,e);case"type":return i=!0,xc("symbol")}return wc(t,e,o,"legend")}));t.setWithExplicit(o,n)}return i&&(t.implicit?.encode?.gradient&&Kt(t.implicit,["encode","gradient"]),t.explicit?.encode?.gradient&&Kt(t.explicit,["encode","gradient"])),t}function og(t,e){return"circle"===e.value?e:t}function ag(t){const e=t.component.legends,n={};for(const r of Xt(e)){const i=t.getScaleComponent(r),o=$t(i.get("domains"));if(n[o])for(const t of n[o]){ig(t,e[r])||n[o].push(e[r])}else n[o]=[e[r].clone()]}return Yt(n).flat().map((e=>function(t,e){const{disable:n,labelExpr:r,selections:i,...o}=t.combine();if(n)return;!1===e.aria&&void 0==o.aria&&(o.aria=!1);if(o.encode?.symbols){const t=o.encode.symbols.update;!t.fill||"transparent"===t.fill.value||t.stroke||o.stroke||(t.stroke={value:"transparent"});for(const e of Uu)o[e]&&delete t[e]}o.title||delete o.title;if(void 0!==r){let t=r;o.encode?.labels?.update&&zr(o.encode.labels.update.text)&&(t=ie(r,"datum.label",o.encode.labels.update.text.signal)),function(t,e,n,r){var i,o;t.encode??(t.encode={}),(i=t.encode)[e]??(i[e]={}),(o=t.encode[e]).update??(o.update={}),t.encode[e].update[n]=r}(o,"labels","text",{signal:t})}return o}(e,t.config))).filter((t=>void 0!==t))}function sg(t){return Pm(t)||Rm(t)?function(t){return t.children.reduce(((t,e)=>t.concat(e.assembleProjections())),ug(t))}(t):ug(t)}function ug(t){const e=t.component.projection;if(!e||e.merged)return[];const n=e.combine(),{name:r}=n;if(e.data){const i={signal:`[${e.size.map((t=>t.signal)).join(", ")}]`},o=e.data.reduce(((e,n)=>{const r=zr(n)?n.signal:`data('${t.lookupDataSource(n)}')`;return Nt(e,r)||e.push(r),e}),[]);if(o.length<=0)throw new Error("Projection's fit didn't find any data sources");return[{name:r,size:i,fit:{signal:o.length>1?`[${o.join(", ")}]`:o[0]},...n}]}return[{name:r,translate:{signal:"[width / 2, height / 2]"},...n}]}const lg=["type","clipAngle","clipExtent","center","rotate","precision","reflectX","reflectY","coefficient","distance","fraction","lobes","parallel","radius","ratio","spacing","tilt"];class cg extends vc{constructor(t,e,n,r){super({...e},{name:t}),this.specifiedProjection=e,this.size=n,this.data=r,this.merged=!1}get isFit(){return!!this.data}}function fg(t){t.component.projection=Om(t)?function(t){if(t.hasProjection){const e=Br(t.specifiedProjection),n=!(e&&(null!=e.scale||null!=e.translate)),r=n?[t.getSizeSignalRef("width"),t.getSizeSignalRef("height")]:void 0,i=n?function(t){const e=[],{encoding:n}=t;for(const r of[[Me,ke],[$e,Se]])(Os(n[r[0]])||Os(n[r[1]]))&&e.push({signal:t.getName(`geojson_${e.length}`)});t.channelHasField(Oe)&&t.typedFieldDef(Oe).type===ko&&e.push({signal:t.getName(`geojson_${e.length}`)});0===e.length&&e.push(t.requestDataName(Tc.Main));return e}(t):void 0,o=new cg(t.projectionName(!0),{...Br(t.config.projection)??{},...e??{}},r,i);return o.get("type")||o.set("type","equalEarth",!1),o}return}(t):function(t){if(0===t.children.length)return;let e;for(const r of t.children)fg(r);const n=zt(t.children,(t=>{const n=t.component.projection;if(n){if(e){const t=function(t,e){const n=zt(lg,(n=>!ct(t.explicit,n)&&!ct(e.explicit,n)||!!(ct(t.explicit,n)&&ct(e.explicit,n)&&Ft(t.get(n),e.get(n)))));if(Ft(t.size,e.size)){if(n)return t;if(Ft(t.explicit,{}))return e;if(Ft(e.explicit,{}))return t}return null}(e,n);return t&&(e=t),!!t}return e=n,!0}return!0}));if(e&&n){const n=t.projectionName(!0),r=new cg(n,e.specifiedProjection,e.size,Ct(e.data));for(const e of t.children){const t=e.component.projection;t&&(t.isFit&&r.data.push(...e.component.projection.data),e.renameProjection(t.get("name"),n),t.merged=!0)}return r}return}(t)}function hg(t,e,n,r){if(Ws(e,n)){const i=Om(t)?t.axis(n)??t.legend(n)??{}:{},o=Es(e,{expr:"datum"}),a=Es(e,{expr:"datum",binSuffix:"end"});return{formulaAs:Es(e,{binSuffix:"range",forAs:!0}),formula:Xa(o,a,i.format,i.formatType,r)}}return{}}function dg(t,e){return`${Fr(t)}_${e}`}function pg(t,e,n){const r=dg(Us(n,void 0)??{},e);return t.getName(`${r}_bins`)}function gg(t,e,n){let r,i;r=function(t){return"as"in t}(t)?dt(t.as)?[t.as,`${t.as}_end`]:[t.as[0],t.as[1]]:[Es(t,{forAs:!0}),Es(t,{binSuffix:"end",forAs:!0})];const o={...Us(e,void 0)},a=dg(o,t.field),{signal:s,extentSignal:u}=function(t,e){return{signal:t.getName(`${e}_bins`),extentSignal:t.getName(`${e}_extent`)}}(n,a);if(Sr(o.extent)){const t=o.extent;i=op(n,t.param,t),delete o.extent}return{key:a,binComponent:{bin:o,field:t.field,as:[r],...s?{signal:s}:{},...u?{extentSignal:u}:{},...i?{span:i}:{}}}}class mg extends Lc{clone(){return new mg(null,Ct(this.bins))}constructor(t,e){super(t),this.bins=e}static makeFromEncoding(t,e){const n=e.reduceFieldDef(((t,n,r)=>{if(vs(n)&&Cr(n.bin)){const{key:i,binComponent:o}=gg(n,n.bin,e);t[i]={...o,...t[i],...hg(e,n,r,e.config)}}return t}),{});return Ht(n)?null:new mg(t,n)}static makeFromTransform(t,e,n){const{key:r,binComponent:i}=gg(e,e.bin,n);return new mg(t,{[r]:i})}merge(t,e){for(const n of Xt(t.bins))n in this.bins?(e(t.bins[n].signal,this.bins[n].signal),this.bins[n].as=Ut([...this.bins[n].as,...t.bins[n].as],Tt)):this.bins[n]=t.bins[n];for(const n of t.children)t.removeChild(n),n.parent=this;t.remove()}producedFields(){return new Set(Yt(this.bins).map((t=>t.as)).flat(2))}dependentFields(){return new Set(Yt(this.bins).map((t=>t.field)))}hash(){return`Bin ${Tt(this.bins)}`}assemble(){return Yt(this.bins).flatMap((t=>{const e=[],[n,...r]=t.as,{extent:i,...o}=t.bin,a={type:"bin",field:re(t.field),as:n,signal:t.signal,...Sr(i)?{extent:null}:{extent:i},...t.span?{span:{signal:`span(${t.span})`}}:{},...o};!i&&t.extentSignal&&(e.push({type:"extent",field:re(t.field),signal:t.extentSignal}),a.extent={signal:t.extentSignal}),e.push(a);for(const s of r)for(let t=0;t<2;t++)e.push({type:"formula",expr:Es({field:n[t]},{expr:"datum"}),as:s[t]});return t.formula&&e.push({type:"formula",expr:t.formula,as:t.formulaAs}),e}))}}function yg(t,e,n,r){const i=Om(r)?r.encoding[An(e)]:void 0;if(vs(n)&&Om(r)&&as(n,i,r.markDef,r.config))t.add(Es(n,{})),t.add(Es(n,{suffix:"end"})),n.bin&&Ws(n,e)&&t.add(Es(n,{binSuffix:"range"}));else if(en(e)){const n=tn(e);t.add(r.getName(n))}else t.add(Es(n));return xs(n)&&function(t){return(0,U.isObject)(t)&&"field"in t}(n.scale?.range)&&t.add(n.scale.range.field),t}class vg extends Lc{clone(){return new vg(null,new Set(this.dimensions),Ct(this.measures))}constructor(t,e,n){super(t),this.dimensions=e,this.measures=n}get groupBy(){return this.dimensions}static makeFromEncoding(t,e){let n=!1;e.forEachFieldDef((t=>{t.aggregate&&(n=!0)}));const r={},i=new Set;return n?(e.forEachFieldDef(((t,n)=>{const{aggregate:o,field:a}=t;if(o)if("count"===o)r["*"]??(r["*"]={}),r["*"].count=new Set([Es(t,{forAs:!0})]);else{if(br(o)||xr(o)){const t=br(o)?"argmin":"argmax",e=o[t];r[e]??(r[e]={}),r[e][t]=new Set([Es({op:t,field:e},{forAs:!0})])}else r[a]??(r[a]={}),r[a][o]=new Set([Es(t,{forAs:!0})]);fr(n)&&"unaggregated"===e.scaleDomain(n)&&(r[a]??(r[a]={}),r[a].min=new Set([Es({field:a,aggregate:"min"},{forAs:!0})]),r[a].max=new Set([Es({field:a,aggregate:"max"},{forAs:!0})]))}else yg(i,n,t,e)})),i.size+Xt(r).length===0?null:new vg(t,i,r)):null}static makeFromTransform(t,e){const n=new Set,r={};for(const i of e.aggregate){const{op:t,field:e,as:n}=i;t&&("count"===t?(r["*"]??(r["*"]={}),r["*"].count=new Set([n||Es(i,{forAs:!0})])):(r[e]??(r[e]={}),r[e][t]=new Set([n||Es(i,{forAs:!0})])))}for(const i of e.groupby??[])n.add(i);return n.size+Xt(r).length===0?null:new vg(t,n,r)}merge(t){return jt(this.dimensions,t.dimensions)?(function(t,e){for(const n of Xt(e)){const r=e[n];for(const e of Xt(r))n in t?t[n][e]=new Set([...t[n][e]??[],...r[e]]):t[n]={[e]:r[e]}}}(this.measures,t.measures),!0):(function(...t){Ii.debug(...t)}("different dimensions, cannot merge"),!1)}addDimensions(t){t.forEach(this.dimensions.add,this.dimensions)}dependentFields(){return new Set([...this.dimensions,...Xt(this.measures)])}producedFields(){const t=new Set;for(const e of Xt(this.measures))for(const n of Xt(this.measures[e])){const r=this.measures[e][n];0===r.size?t.add(`${n}_${e}`):r.forEach(t.add,t)}return t}hash(){return`Aggregate ${Tt({dimensions:this.dimensions,measures:this.measures})}`}assemble(){const t=[],e=[],n=[];for(const r of Xt(this.measures))for(const i of Xt(this.measures[r]))for(const o of this.measures[r][i])n.push(o),t.push(i),e.push("*"===r?null:re(r));return{type:"aggregate",groupby:[...this.dimensions].map(re),ops:t,fields:e,as:n}}}class bg extends Lc{constructor(t,e,n,r){super(t),this.model=e,this.name=n,this.data=r;for(const i of sn){const t=e.facet[i];if(t){const{bin:n,sort:r}=t;this[i]={name:e.getName(`${i}_domain`),fields:[Es(t),...Cr(n)?[Es(t,{binSuffix:"end"})]:[]],...Za(r)?{sortField:r}:et(r)?{sortIndexField:bp(t,i)}:{}}}}this.childModel=e.child}hash(){let t="Facet";for(const e of sn)this[e]&&(t+=` ${e.charAt(0)}:${Tt(this[e])}`);return t}get fields(){const t=[];for(const e of sn)this[e]?.fields&&t.push(...this[e].fields);return t}dependentFields(){const t=new Set(this.fields);for(const e of sn)this[e]&&(this[e].sortField&&t.add(this[e].sortField.field),this[e].sortIndexField&&t.add(this[e].sortIndexField));return t}producedFields(){return new Set}getSource(){return this.name}getChildIndependentFieldsWithStep(){const t={};for(const e of Xn){const n=this.childModel.component.scales[e];if(n&&!n.merged){const r=n.get("type"),i=n.get("range");if(Lo(r)&&Rr(i)){const n=hm(dm(this.childModel,e));n?t[e]=n:Wi(li(e))}}}return t}assembleRowColumnHeaderData(t,e,n){const r={row:"y",column:"x",facet:void 0}[t],i=[],o=[],a=[];r&&n&&n[r]&&(e?(i.push(`distinct_${n[r]}`),o.push("max")):(i.push(n[r]),o.push("distinct")),a.push(`distinct_${n[r]}`));const{sortField:s,sortIndexField:u}=this[t];if(s){const{op:t=Ya,field:e}=s;i.push(e),o.push(t),a.push(Es(s,{forAs:!0}))}else u&&(i.push(u),o.push("max"),a.push(u));return{name:this[t].name,source:e??this.data,transform:[{type:"aggregate",groupby:this[t].fields,...i.length?{fields:i,ops:o,as:a}:{}}]}}assembleFacetHeaderData(t){const{columns:e}=this.model.layout,{layoutHeaders:n}=this.model.component,r=[],i={};for(const s of Ap){for(const t of Dp){const e=(n[s]&&n[s][t])??[];for(const t of e)if(t.axes?.length>0){i[s]=!0;break}}if(i[s]){const t=`length(data("${this.facet.name}"))`,n="row"===s?e?{signal:`ceil(${t} / ${e})`}:1:e?{signal:`min(${t}, ${e})`}:{signal:t};r.push({name:`${this.facet.name}_${s}`,transform:[{type:"sequence",start:0,stop:n}]})}}const{row:o,column:a}=i;return(o||a)&&r.unshift(this.assembleRowColumnHeaderData("facet",null,t)),r}assemble(){const t=[];let e=null;const n=this.getChildIndependentFieldsWithStep(),{column:r,row:i,facet:o}=this;if(r&&i&&(n.x||n.y)){e=`cross_${this.column.name}_${this.row.name}`;const r=[].concat(n.x??[],n.y??[]),i=r.map((()=>"distinct"));t.push({name:e,source:this.data,transform:[{type:"aggregate",groupby:this.fields,fields:r,ops:i}]})}for(const a of[me,ge])this[a]&&t.push(this.assembleRowColumnHeaderData(a,e,n));if(o){const e=this.assembleFacetHeaderData(n);e&&t.push(...e)}return t}}function xg(t){return t.startsWith("'")&&t.endsWith("'")||t.startsWith('"')&&t.endsWith('"')?t.slice(1,-1):t}function _g(t){const e={};return Dt(t.filter,(t=>{if(mo(t)){let n=null;uo(t)?n=qr(t.equal):co(t)?n=qr(t.lte):lo(t)?n=qr(t.lt):fo(t)?n=qr(t.gt):ho(t)?n=qr(t.gte):po(t)?n=t.range[0]:go(t)&&(n=(t.oneOf??t.in)[0]),n&&(Hi(n)?e[t.field]="date":ht(n)?e[t.field]="number":dt(n)&&(e[t.field]="string")),t.timeUnit&&(e[t.field]="date")}})),e}function wg(t){const e={};function n(t){var n;js(t)?e[t.field]="date":"quantitative"===t.type&&(dt(n=t.aggregate)&&Nt(["min","max"],n))?e[t.field]="number":ae(t.field)>1?t.field in e||(e[t.field]="flatten"):xs(t)&&Za(t.sort)&&ae(t.sort.field)>1&&(t.sort.field in e||(e[t.sort.field]="flatten"))}if((Om(t)||zm(t))&&t.forEachFieldDef(((e,r)=>{if(vs(e))n(e);else{const i=_n(r),o=t.fieldDef(i);n({...e,type:o.type})}})),Om(t)){const{mark:n,markDef:r,encoding:i}=t;if(ya(n)&&!t.encoding.order){const t=i["horizontal"===r.orient?"y":"x"];fs(t)&&"quantitative"===t.type&&!(t.field in e)&&(e[t.field]="number")}}return e}class Ag extends Lc{clone(){return new Ag(null,Ct(this._parse))}constructor(t,e){super(t),this._parse=e}hash(){return`Parse ${Tt(this._parse)}`}static makeExplicit(t,e,n){let r={};const i=e.data;return!kc(i)&&i?.format?.parse&&(r=i.format.parse),this.makeWithAncestors(t,r,{},n)}static makeWithAncestors(t,e,n,r){for(const a of Xt(n)){const t=r.getWithExplicit(a);void 0!==t.value&&(t.explicit||t.value===n[a]||"derived"===t.value||"flatten"===n[a]?delete n[a]:Wi(gi(a,n[a],t.value)))}for(const a of Xt(e)){const t=r.get(a);void 0!==t&&(t===e[a]?delete e[a]:Wi(gi(a,e[a],t)))}const i=new vc(e,n);r.copyAll(i);const o={};for(const a of Xt(i.combine())){const t=i.get(a);null!==t&&(o[a]=t)}return 0===Xt(o).length||r.parseNothing?null:new Ag(t,o)}get parse(){return this._parse}merge(t){this._parse={...this._parse,...t.parse},t.remove()}assembleFormatParse(){const t={};for(const e of Xt(this._parse)){const n=this._parse[e];1===ae(e)&&(t[e]=n)}return t}producedFields(){return new Set(Xt(this._parse))}dependentFields(){return new Set(Xt(this._parse))}assembleTransforms(t=!1){return Xt(this._parse).filter((e=>!t||ae(e)>1)).map((t=>{const e=function(t,e){const n=te(t);if("number"===e)return`toNumber(${n})`;if("boolean"===e)return`toBoolean(${n})`;if("string"===e)return`toString(${n})`;if("date"===e)return`toDate(${n})`;if("flatten"===e)return n;if(e.startsWith("date:"))return`timeParse(${n},'${xg(e.slice(5,e.length))}')`;if(e.startsWith("utc:"))return`utcParse(${n},'${xg(e.slice(4,e.length))}')`;return Wi(`Unrecognized parse "${e}".`),null}(t,this._parse[t]);if(!e)return null;return{type:"formula",expr:e,as:oe(t)}})).filter((t=>null!==t))}}class Dg extends Lc{clone(){return new Dg(null)}constructor(t){super(t)}dependentFields(){return new Set}producedFields(){return new Set([ju])}hash(){return"Identifier"}assemble(){return{type:"identifier",as:ju}}}class Eg extends Lc{clone(){return new Eg(null,this.params)}constructor(t,e){super(t),this.params=e}dependentFields(){return new Set}producedFields(){}hash(){return`Graticule ${Tt(this.params)}`}assemble(){return{type:"graticule",...!0===this.params?{}:this.params}}}class Fg extends Lc{clone(){return new Fg(null,this.params)}constructor(t,e){super(t),this.params=e}dependentFields(){return new Set}producedFields(){return new Set([this.params.as??"data"])}hash(){return`Hash ${Tt(this.params)}`}assemble(){return{type:"sequence",...this.params}}}class Cg extends Lc{constructor(t){let e;if(super(null),t??(t={name:"source"}),kc(t)||(e=t.format?{...St(t.format,["parse"])}:{}),Fc(t))this._data={values:t.values};else if(Ec(t)){if(this._data={url:t.url},!e.type){let n=/(?:\.([^.]+))?$/.exec(t.url)[1];Nt(["json","csv","tsv","dsv","topojson"],n)||(n="json"),e.type=n}}else Sc(t)?this._data={values:[{type:"Sphere"}]}:(Cc(t)||kc(t))&&(this._data={});this._generator=kc(t),t.name&&(this._name=t.name),e&&!Ht(e)&&(this._data.format=e)}dependentFields(){return new Set}producedFields(){}get data(){return this._data}hasName(){return!!this._name}get isGenerator(){return this._generator}get dataName(){return this._name}set dataName(t){this._name=t}set parent(t){throw new Error("Source nodes have to be roots.")}remove(){throw new Error("Source nodes are roots and cannot be removed.")}hash(){throw new Error("Cannot hash sources")}assemble(){return{name:this._name,...this._data,transform:[]}}}var kg,Mg=function(t,e,n,r,i){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"===typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?i.call(t,n):i?i.value=n:e.set(t,n),n},Sg=function(t,e,n,r){if("a"===n&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"===typeof e?t!==e||!r:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(t):r?r.value:e.get(t)};function $g(t){return t instanceof Cg||t instanceof Eg||t instanceof Fg}class Tg{constructor(){kg.set(this,void 0),Mg(this,kg,!1,"f")}setModified(){Mg(this,kg,!0,"f")}get modifiedFlag(){return Sg(this,kg,"f")}}kg=new WeakMap;class Bg extends Tg{getNodeDepths(t,e,n){n.set(t,e);for(const r of t.children)this.getNodeDepths(r,e+1,n);return n}optimize(t){const e=[...this.getNodeDepths(t,0,new Map).entries()].sort(((t,e)=>e[1]-t[1]));for(const n of e)this.run(n[0]);return this.modifiedFlag}}class Ng extends Tg{optimize(t){this.run(t);for(const e of t.children)this.optimize(e);return this.modifiedFlag}}class Og extends Ng{mergeNodes(t,e){const n=e.shift();for(const r of e)t.removeChild(r),r.parent=n,r.remove()}run(t){const e=t.children.map((t=>t.hash())),n={};for(let r=0;r<e.length;r++)void 0===n[e[r]]?n[e[r]]=[t.children[r]]:n[e[r]].push(t.children[r]);for(const r of Xt(n))n[r].length>1&&(this.setModified(),this.mergeNodes(t,n[r]))}}class zg extends Ng{constructor(t){super(),this.requiresSelectionId=t&&ah(t)}run(t){t instanceof Dg&&(this.requiresSelectionId&&($g(t.parent)||t.parent instanceof vg||t.parent instanceof Ag)||(this.setModified(),t.remove()))}}class Rg extends Tg{optimize(t){return this.run(t,new Set),this.modifiedFlag}run(t,e){let n=new Set;t instanceof Ic&&(n=t.producedFields(),It(n,e)&&(this.setModified(),t.removeFormulas(e),0===t.producedFields.length&&t.remove()));for(const r of t.children)this.run(r,new Set([...e,...n]))}}class Pg extends Ng{constructor(){super()}run(t){t instanceof jc&&!t.isRequired()&&(this.setModified(),t.remove())}}class Ug extends Bg{run(t){if(!$g(t)&&!(t.numChildren()>1))for(const e of t.children)if(e instanceof Ag)if(t instanceof Ag)this.setModified(),t.merge(e);else{if(Wt(t.producedFields(),e.dependentFields()))continue;this.setModified(),e.swapWithParent()}}}class Lg extends Bg{run(t){const e=[...t.children],n=t.children.filter((t=>t instanceof Ag));if(t.numChildren()>1&&n.length>=1){const r={},i=new Set;for(const t of n){const e=t.parse;for(const t of Xt(e))t in r?r[t]!==e[t]&&i.add(t):r[t]=e[t]}for(const t of i)delete r[t];if(!Ht(r)){this.setModified();const n=new Ag(t,r);for(const i of e){if(i instanceof Ag)for(const t of Xt(r))delete i.parse[t];t.removeChild(i),i.parent=n,i instanceof Ag&&0===Xt(i.parse).length&&i.remove()}}}}}class jg extends Bg{run(t){t instanceof jc||t.numChildren()>0||t instanceof bg||t instanceof Cg||(this.setModified(),t.remove())}}class Ig extends Bg{run(t){const e=t.children.filter((t=>t instanceof Ic)),n=e.pop();for(const r of e)this.setModified(),n.merge(r)}}class qg extends Bg{run(t){const e=t.children.filter((t=>t instanceof vg)),n={};for(const r of e){const t=Tt(r.groupBy);t in n||(n[t]=[]),n[t].push(r)}for(const r of Xt(n)){const e=n[r];if(e.length>1){const n=e.pop();for(const r of e)n.merge(r)&&(t.removeChild(r),r.parent=n,r.remove(),this.setModified())}}}}class Wg extends Bg{constructor(t){super(),this.model=t}run(t){const e=!($g(t)||t instanceof rp||t instanceof Ag||t instanceof Dg),n=[],r=[];for(const i of t.children)i instanceof mg&&(e&&!Wt(t.producedFields(),i.dependentFields())?n.push(i):r.push(i));if(n.length>0){const e=n.pop();for(const t of n)e.merge(t,this.model.renameSignal.bind(this.model));this.setModified(),t instanceof mg?t.merge(e,this.model.renameSignal.bind(this.model)):e.swapWithParent()}if(r.length>1){const t=r.pop();for(const e of r)t.merge(e,this.model.renameSignal.bind(this.model));this.setModified()}}}class Hg extends Bg{run(t){const e=[...t.children];if(!Ot(e,(t=>t instanceof jc))||t.numChildren()<=1)return;const n=[];let r;for(const i of e)if(i instanceof jc){let e=i;for(;1===e.numChildren();){const[t]=e.children;if(!(t instanceof jc))break;e=t}n.push(...e.children),r?(t.removeChild(i),i.parent=r.parent,r.parent.removeChild(r),r.parent=e,this.setModified()):r=e}else n.push(i);if(n.length){this.setModified();for(const t of n)t.parent.removeChild(t),t.parent=r}}}class Xg extends Lc{clone(){return new Xg(null,Ct(this.transform))}constructor(t,e){super(t),this.transform=e}addDimensions(t){this.transform.groupby=Ut(this.transform.groupby.concat(t),(t=>t))}dependentFields(){const t=new Set;return this.transform.groupby&&this.transform.groupby.forEach(t.add,t),this.transform.joinaggregate.map((t=>t.field)).filter((t=>void 0!==t)).forEach(t.add,t),t}producedFields(){return new Set(this.transform.joinaggregate.map(this.getDefaultName))}getDefaultName(t){return t.as??Es(t)}hash(){return`JoinAggregateTransform ${Tt(this.transform)}`}assemble(){const t=[],e=[],n=[];for(const i of this.transform.joinaggregate)e.push(i.op),n.push(this.getDefaultName(i)),t.push(void 0===i.field?null:i.field);const r=this.transform.groupby;return{type:"joinaggregate",as:n,ops:e,fields:t,...void 0!==r?{groupby:r}:{}}}}class Yg extends Lc{clone(){return new Yg(null,Ct(this._stack))}constructor(t,e){super(t),this._stack=e}static makeFromTransform(t,e){const{stack:n,groupby:r,as:i,offset:o="zero"}=e,a=[],s=[];if(void 0!==e.sort)for(const c of e.sort)a.push(c.field),s.push(se(c.order,"ascending"));const u={field:a,order:s};let l;return l=function(t){return et(t)&&t.every((t=>dt(t)))&&t.length>1}(i)?i:dt(i)?[i,`${i}_end`]:[`${e.stack}_start`,`${e.stack}_end`],new Yg(t,{dimensionFieldDefs:[],stackField:n,groupby:r,offset:o,sort:u,facetby:[],as:l})}static makeFromEncoding(t,e){const n=e.stack,{encoding:r}=e;if(!n)return null;const{groupbyChannels:i,fieldChannel:o,offset:a,impute:s}=n,u=i.map((t=>Ns(r[t]))).filter((t=>!!t)),l=function(t){return t.stack.stackBy.reduce(((t,e)=>{const n=Es(e.fieldDef);return n&&t.push(n),t}),[])}(e),c=e.encoding.order;let f;if(et(c)||fs(c))f=ti(c);else{const t=ss(c)?c.sort:"y"===o?"descending":"ascending";f=l.reduce(((e,n)=>(e.field.push(n),e.order.push(t),e)),{field:[],order:[]})}return new Yg(t,{dimensionFieldDefs:u,stackField:e.vgField(o),facetby:[],stackby:l,sort:f,offset:a,impute:s,as:[e.vgField(o,{suffix:"start",forAs:!0}),e.vgField(o,{suffix:"end",forAs:!0})]})}get stack(){return this._stack}addDimensions(t){this._stack.facetby.push(...t)}dependentFields(){const t=new Set;return t.add(this._stack.stackField),this.getGroupbyFields().forEach(t.add,t),this._stack.facetby.forEach(t.add,t),this._stack.sort.field.forEach(t.add,t),t}producedFields(){return new Set(this._stack.as)}hash(){return`Stack ${Tt(this._stack)}`}getGroupbyFields(){const{dimensionFieldDefs:t,impute:e,groupby:n}=this._stack;return t.length>0?t.map((t=>t.bin?e?[Es(t,{binSuffix:"mid"})]:[Es(t,{}),Es(t,{binSuffix:"end"})]:[Es(t)])).flat():n??[]}assemble(){const t=[],{facetby:e,dimensionFieldDefs:n,stackField:r,stackby:i,sort:o,offset:a,impute:s,as:u}=this._stack;if(s)for(const l of n){const{bandPosition:n=.5,bin:o}=l;if(o){const e=Es(l,{expr:"datum"}),r=Es(l,{expr:"datum",binSuffix:"end"});t.push({type:"formula",expr:`${n}*${e}+${1-n}*${r}`,as:Es(l,{binSuffix:"mid",forAs:!0})})}t.push({type:"impute",field:r,groupby:[...i,...e],key:Es(l,{binSuffix:"mid"}),method:"value",value:0})}return t.push({type:"stack",groupby:[...this.getGroupbyFields(),...e],field:r,sort:o,as:u,offset:a}),t}}class Gg extends Lc{clone(){return new Gg(null,Ct(this.transform))}constructor(t,e){super(t),this.transform=e}addDimensions(t){this.transform.groupby=Ut(this.transform.groupby.concat(t),(t=>t))}dependentFields(){const t=new Set;return(this.transform.groupby??[]).forEach(t.add,t),(this.transform.sort??[]).forEach((e=>t.add(e.field))),this.transform.window.map((t=>t.field)).filter((t=>void 0!==t)).forEach(t.add,t),t}producedFields(){return new Set(this.transform.window.map(this.getDefaultName))}getDefaultName(t){return t.as??Es(t)}hash(){return`WindowTransform ${Tt(this.transform)}`}assemble(){const t=[],e=[],n=[],r=[];for(const c of this.transform.window)e.push(c.op),n.push(this.getDefaultName(c)),r.push(void 0===c.param?null:c.param),t.push(void 0===c.field?null:c.field);const i=this.transform.frame,o=this.transform.groupby;if(i&&null===i[0]&&null===i[1]&&e.every((t=>_r(t))))return{type:"joinaggregate",as:n,ops:e,fields:t,...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 u={field:a,order:s},l=this.transform.ignorePeers;return{type:"window",params:r,as:n,ops:e,fields:t,sort:u,...void 0!==l?{ignorePeers:l}:{},...void 0!==o?{groupby:o}:{},...void 0!==i?{frame:i}:{}}}}function Vg(t){if(t instanceof bg)if(1!==t.numChildren()||t.children[0]instanceof jc){const n=t.model.component.data.main;Jg(n);const r=(e=t,function t(n){if(!(n instanceof bg)){const r=n.clone();if(r instanceof jc){const t=Zg+r.getSource();r.setSource(t),e.model.component.data.outputNodes[t]=r}else(r instanceof vg||r instanceof Yg||r instanceof Gg||r instanceof Xg)&&r.addDimensions(e.fields);for(const e of n.children.flatMap(t))e.parent=r;return[r]}return n.children.flatMap(t)}),i=t.children.map(r).flat();for(const t of i)t.parent=n}else{const e=t.children[0];(e instanceof vg||e instanceof Yg||e instanceof Gg||e instanceof Xg)&&e.addDimensions(t.fields),e.swapWithParent(),Vg(t)}else t.children.map(Vg);var e}function Jg(t){if(t instanceof jc&&t.type===Tc.Main&&1===t.numChildren()){const e=t.children[0];e instanceof bg||(e.swapWithParent(),Jg(t))}}const Zg="scale_",Kg=5;function Qg(t){for(const e of t){for(const t of e.children)if(t.parent!==e)return!1;if(!Qg(e.children))return!1}return!0}function tm(t,e){let n=!1;for(const r of e)n=t.optimize(r)||n;return n}function em(t,e,n){let r=t.sources,i=!1;return i=tm(new Pg,r)||i,i=tm(new zg(e),r)||i,r=r.filter((t=>t.numChildren()>0)),i=tm(new jg,r)||i,r=r.filter((t=>t.numChildren()>0)),n||(i=tm(new Ug,r)||i,i=tm(new Wg(e),r)||i,i=tm(new Rg,r)||i,i=tm(new Lg,r)||i,i=tm(new qg,r)||i,i=tm(new Ig,r)||i,i=tm(new Og,r)||i,i=tm(new Hg,r)||i),t.sources=r,i}class nm{constructor(t){Object.defineProperty(this,"signal",{enumerable:!0,get:t})}static fromName(t,e){return new nm((()=>t(e)))}}function rm(t){Om(t)?function(t){const e=t.component.scales;for(const n of Xt(e)){const r=im(t,n);if(e[n].setWithExplicit("domains",r),um(t,n),t.component.data.isFaceted){let e=t;for(;!zm(e)&&e.parent;)e=e.parent;if("shared"===e.component.resolve.scale[n])for(const t of r.value)Pr(t)&&(t.data=Zg+t.data.replace(Zg,""))}}}(t):function(t){for(const n of t.children)rm(n);const e=t.component.scales;for(const n of Xt(e)){let r,i=null;for(const e of t.children){const t=e.component.scales[n];if(t){r=void 0===r?t.getWithExplicit("domains"):Ac(r,t.getWithExplicit("domains"),"domains","scale",cm);const e=t.get("selectionExtent");i&&e&&i.param!==e.param&&Wi(di),i=e}}e[n].setWithExplicit("domains",r),i&&e[n].set("selectionExtent",i,!0)}}(t)}function im(t,e){const n=t.getScaleComponent(e).get("type"),{encoding:r}=t,i=function(t,e,n,r){if("unaggregated"===t){const{valid:t,reason:r}=lm(e,n);if(!t)return void Wi(r)}else if(void 0===t&&r.useUnaggregatedDomain){const{valid:t}=lm(e,n);if(t)return"unaggregated"}return t}(t.scaleDomain(e),t.typedFieldDef(e),n,t.config.scale);return i!==t.scaleDomain(e)&&(t.specifiedScales[e]={...t.specifiedScales[e],domain:i}),"x"===e&&Os(r.x2)?Os(r.x)?Ac(am(n,i,t,"x"),am(n,i,t,"x2"),"domain","scale",cm):am(n,i,t,"x2"):"y"===e&&Os(r.y2)?Os(r.y)?Ac(am(n,i,t,"y"),am(n,i,t,"y2"),"domain","scale",cm):am(n,i,t,"y2"):am(n,i,t,e)}function om(t,e,n){const r=ao(n)?.unit;return"temporal"===e||r?function(t,e,n){return t.map((t=>({signal:`{data: ${Is(t,{timeUnit:n,type:e})}}`})))}(t,e,r):[t]}function am(t,e,n,r){const{encoding:i}=n,o=Os(i[r]),{type:a}=o,s=o.timeUnit;if(function(t){return t?.unionWith}(e)){const i=am(t,void 0,n,r);return bc([...om(e.unionWith,a,s),...i.value])}if(zr(e))return bc([e]);if(e&&"unaggregated"!==e&&!Wo(e))return bc(om(e,a,s));const u=n.stack;if(u&&r===u.fieldChannel){if("normalize"===u.offset)return xc([[0,1]]);const t=n.requestDataName(Tc.Main);return xc([{data:t,field:n.vgField(r,{suffix:"start"})},{data:t,field:n.vgField(r,{suffix:"end"})}])}const l=fr(r)&&fs(o)?function(t,e,n){if(!Lo(n))return;const r=t.fieldDef(e),i=r.sort;if(Ka(i))return{op:"min",field:bp(r,e),order:"ascending"};const{stack:o}=t,a=o?new Set([...o.groupbyFields,...o.stackBy.map((t=>t.fieldDef.field))]):void 0;if(Za(i)){return sm(i,o&&!a.has(i.field))}if(Ja(i)){const{encoding:e,order:n}=i,r=t.fieldDef(e),{aggregate:s,field:u}=r,l=o&&!a.has(u);if(br(s)||xr(s))return sm({field:Es(r),order:n},l);if(_r(s)||!s)return sm({op:s,field:u,order:n},l)}else{if("descending"===i)return{op:"min",field:t.vgField(e),order:"descending"};if(Nt(["ascending",void 0],i))return!0}return}(n,r,t):void 0;if(ds(o)){return xc(om([o.datum],a,s))}const c=o;if("unaggregated"===e){const t=n.requestDataName(Tc.Main),{field:e}=o;return xc([{data:t,field:Es({field:e,aggregate:"min"})},{data:t,field:Es({field:e,aggregate:"max"})}])}if(Cr(c.bin)){if(Lo(t))return xc("bin-ordinal"===t?[]:[{data:Vt(l)?n.requestDataName(Tc.Main):n.requestDataName(Tc.Raw),field:n.vgField(r,Ws(c,r)?{binSuffix:"range"}:{}),sort:!0!==l&&nt(l)?l:{field:n.vgField(r,{}),op:"min"}}]);{const{bin:t}=c;if(Cr(t)){const e=pg(n,c.field,t);return xc([new nm((()=>{const t=n.getSignalName(e);return`[${t}.start, ${t}.stop]`}))])}return xc([{data:n.requestDataName(Tc.Main),field:n.vgField(r,{})}])}}if(c.timeUnit&&Nt(["time","utc"],t)&&as(c,Om(n)?n.encoding[An(r)]:void 0,n.markDef,n.config)){const t=n.requestDataName(Tc.Main);return xc([{data:t,field:n.vgField(r)},{data:t,field:n.vgField(r,{suffix:"end"})}])}return xc(l?[{data:Vt(l)?n.requestDataName(Tc.Main):n.requestDataName(Tc.Raw),field:n.vgField(r),sort:l}]:[{data:n.requestDataName(Tc.Main),field:n.vgField(r)}])}function sm(t,e){const{op:n,field:r,order:i}=t;return{op:n??(e?"sum":Ya),...r?{field:re(r)}:{},...i?{order:i}:{}}}function um(t,e){const n=t.component.scales[e],r=t.specifiedScales[e].domain,i=t.fieldDef(e)?.bin,o=Wo(r)&&r,a=Mr(i)&&Sr(i.extent)&&i.extent;(o||a)&&n.set("selectionExtent",o??a,!0)}function lm(t,e){const{aggregate:n,type:r}=t;return n?dt(n)&&!Er.has(n)?{valid:!1,reason:Si(n)}:"quantitative"===r&&"log"===e?{valid:!1,reason:$i(t)}:{valid:!0}:{valid:!1,reason:Mi(t)}}function cm(t,e,n,r){return t.explicit&&e.explicit&&Wi(function(t,e,n,r){return`Conflicting ${e.toString()} property "${t.toString()}" (${$t(n)} and ${$t(r)}). Using the union of the two domains.`}(n,r,t.value,e.value)),{explicit:t.explicit,value:[...t.value,...e.value]}}function fm(t){const e=Ut(t.map((t=>{if(Pr(t)){const{sort:e,...n}=t;return n}return t})),Tt),n=Ut(t.map((t=>{if(Pr(t)){const e=t.sort;return void 0===e||Vt(e)||("op"in e&&"count"===e.op&&delete e.field,"ascending"===e.order&&delete e.order),e}})).filter((t=>void 0!==t)),Tt);if(0===e.length)return;if(1===e.length){const e=t[0];if(Pr(e)&&n.length>0){let t=n[0];if(n.length>1){Wi(Ni);const e=n.filter((t=>nt(t)&&"op"in t&&"min"!==t.op));t=!n.every((t=>nt(t)&&"op"in t))||1!==e.length||e[0]}else if(nt(t)&&"field"in t){const n=t.field;e.field===n&&(t=!t.order||{order:t.order})}return{...e,sort:t}}return e}const r=Ut(n.map((t=>Vt(t)||!("op"in t)||dt(t.op)&&t.op in vr?t:(Wi(function(t){return`Dropping sort property ${$t(t)} as unioned domains only support boolean or op "count", "min", and "max".`}(t)),!0))),Tt);let i;1===r.length?i=r[0]:r.length>1&&(Wi(Ni),i=!0);const o=Ut(t.map((t=>Pr(t)?t.data:null)),(t=>t));if(1===o.length&&null!==o[0]){return{data:o[0],fields:e.map((t=>t.field)),...i?{sort:i}:{}}}return{fields:e,...i?{sort:i}:{}}}function hm(t){if(Pr(t)&&dt(t.field))return t.field;if(function(t){return!et(t)&&"fields"in t&&!("data"in t)}(t)){let e;for(const n of t.fields)if(Pr(n)&&dt(n.field))if(e){if(e!==n.field)return Wi(Oi),e}else e=n.field;return Wi(zi),e}if(function(t){return!et(t)&&"fields"in t&&"data"in t}(t)){Wi(Ri);const e=t.fields[0];return dt(e)?e:void 0}}function dm(t,e){const n=t.component.scales[e].get("domains").map((e=>(Pr(e)&&(e.data=t.lookupDataSource(e.data)),e)));return fm(n)}function pm(t){return Pm(t)||Rm(t)?t.children.reduce(((t,e)=>t.concat(pm(e))),gm(t)):gm(t)}function gm(t){return Xt(t.component.scales).reduce(((e,n)=>{const r=t.component.scales[n];if(r.merged)return e;const i=r.combine(),{name:o,type:a,selectionExtent:s,domains:u,range:l,reverse:c,...f}=i,h=function(t,e,n,r){if(Yn(n)){if(Rr(t))return{step:{signal:`${e}_step`}}}else if(nt(t)&&Pr(t))return{...t,data:r.lookupDataSource(t.data)};return t}(i.range,o,n,t),d=dm(t,n),p=s?function(t,e,n,r){const i=op(t,e.param,e);return{signal:jo(n.get("type"))&&et(r)&&r[0]>r[1]?`isValid(${i}) && reverse(${i})`:i}}(t,s,r,d):null;return e.push({name:o,type:a,...d?{domain:d}:{},...p?{domainRaw:p}:{},range:h,...void 0!==c?{reverse:c}:{},...f}),e}),[])}class mm extends vc{constructor(t,e){super({},{name:t}),this.merged=!1,this.setWithExplicit("type",e)}domainDefinitelyIncludesZero(){return!1!==this.get("zero")||Ot(this.get("domains"),(t=>et(t)&&2===t.length&&t[0]<=0&&t[1]>=0))}}const ym=["range","scheme"];function vm(t,e){const n=t.fieldDef(e);if(n?.bin){const{bin:r,field:i}=n,o=Dn(e),a=t.getName(o);if(nt(r)&&r.binned&&void 0!==r.step)return new nm((()=>{const n=t.scaleName(e),i=`(domain("${n}")[1] - domain("${n}")[0]) / ${r.step}`;return`${t.getSignalName(a)} / (${i})`}));if(Cr(r)){const e=pg(t,i,r);return new nm((()=>{const n=t.getSignalName(e),r=`(${n}.stop - ${n}.start) / ${n}.step`;return`${t.getSignalName(a)} / (${r})`}))}}}function bm(t,e){const n=e.specifiedScales[t],{size:r}=e,i=e.getScaleComponent(t).get("type");for(const c of ym)if(void 0!==n[c]){const r=ta(i,c),o=ea(t,c);if(r)if(o)Wi(o);else switch(c){case"range":{const r=n.range;if(et(r)){if(Yn(t))return bc(r.map((t=>{if("width"===t||"height"===t){const n=e.getName(t),r=e.getSignalName.bind(e);return nm.fromName(r,n)}return t})))}else if(nt(r))return bc({data:e.requestDataName(Tc.Main),field:r.field,sort:{op:"min",field:e.vgField(t)}});return bc(r)}case"scheme":return bc(xm(n[c]))}else Wi(Ti(i,c,t))}const o=t===ve||"xOffset"===t?"width":"height",a=r[o];if(Zu(a))if(Yn(t))if(Lo(i)){const n=_m(a,e,t);if(n)return bc({step:n})}else Wi(Bi(o));else if(Kn(t)){const n=t===we?"x":"y";if("band"===e.getScaleComponent(n).get("type")){const t=wm(a,i);if(t)return bc(t)}}const{rangeMin:s,rangeMax:u}=n,l=function(t,e){const{size:n,config:r,mark:i,encoding:o}=e,a=e.getSignalName.bind(e),{type:s}=Os(o[t]),u=e.getScaleComponent(t),l=u.get("type"),{domain:c,domainMid:f}=e.specifiedScales[t];switch(t){case ve:case be:{if(Nt(["point","band"],l)){const i=Am(t,n,r.view);if(Zu(i)){return{step:_m(i,e,t)}}}const i=Dn(t),o=e.getName(i);return t===be&&jo(l)?[nm.fromName(a,o),0]:[0,nm.fromName(a,o)]}case we:case Ae:return function(t,e,n){const r=t===we?"x":"y",i=e.getScaleComponent(r),o=i.get("type"),a=e.scaleName(r);if("band"===o){const t=Am(r,e.size,e.config.view);if(Zu(t)){const e=wm(t,n);if(e)return e}return[0,{signal:`bandwidth('${a}')`}]}{const n=e.encoding[r];if(fs(n)&&n.timeUnit){const t=so(n.timeUnit,(t=>`scale('${a}', ${t})`)),r=e.config.scale.bandWithNestedOffsetPaddingInner;if(r){return[{signal:`${zr(r)?`${r.signal}/2`:""+r/2} * (${t})`},{signal:`${zr(r)?`(1 - ${r.signal}/2)`:""+(1-r/2)} * (${t})`}]}return[0,{signal:t}]}return kt(`Cannot use ${t} scale if ${r} scale is not discrete.`)}}(t,e,l);case ze:{const o=Dm(i,e.component.scales[t].get("zero"),r),a=function(t,e,n,r){const i={x:vm(n,"x"),y:vm(n,"y")};switch(t){case"bar":case"tick":{if(void 0!==r.scale.maxBandSize)return r.scale.maxBandSize;const t=Fm(e,i,r.view);return ht(t)?t-1:new nm((()=>`${t.signal} - 1`))}case"line":case"trail":case"rule":return r.scale.maxStrokeWidth;case"text":return r.scale.maxFontSize;case"point":case"square":case"circle":{if(r.scale.maxSize)return r.scale.maxSize;const t=Fm(e,i,r.view);return ht(t)?Math.pow(Em*t,2):new nm((()=>`pow(${Em} * ${t.signal}, 2)`))}}throw new Error(Di("size",t))}(i,n,e,r);return qo(l)?function(t,e,n){const r=()=>{const r=Yr(e),i=Yr(t),o=`(${r} - ${i}) / (${n} - 1)`;return`sequence(${i}, ${r} + ${o}, ${o})`};return zr(e)?new nm(r):{signal:r()}}(o,a,function(t,e,n,r){switch(t){case"quantile":return e.scale.quantileCount;case"quantize":return e.scale.quantizeCount;case"threshold":return void 0!==n&&et(n)?n.length+1:(Wi(function(t){return`Domain for ${t} is required for threshold scale.`}(r)),3)}}(l,r,c,t)):[o,a]}case Fe:return[0,2*Math.PI];case Re:return[0,360];case De:return[0,new nm((()=>`min(${e.getSignalName("width")},${e.getSignalName("height")})/2`))];case je:return[r.scale.minStrokeWidth,r.scale.maxStrokeWidth];case Ie:return[[1,0],[4,2],[2,1],[1,1],[1,2,4,2]];case Oe:return"symbol";case Te:case Be:case Ne:return"ordinal"===l?"nominal"===s?"category":"ordinal":void 0!==f?"diverging":"rect"===i||"geoshape"===i?"heatmap":"ramp";case Pe:case Ue:case Le:return[r.scale.minOpacity,r.scale.maxOpacity]}}(t,e);return(void 0!==s||void 0!==u)&&ta(i,"rangeMin")&&et(l)&&2===l.length?bc([s??l[0],u??l[1]]):xc(l)}function xm(t){return function(t){return!dt(t)&&!!t.name}(t)?{scheme:t.name,...St(t,["name"])}:{scheme:t}}function _m(t,e,n){const{encoding:r}=e,i=e.getScaleComponent(n),o=Fn(n),a=r[o];if("offset"===Ju({step:t,offsetIsDiscrete:ys(a)&&Ao(a.type)})&&nu(r,o)){const n=e.getScaleComponent(o);let r=`domain('${e.scaleName(o)}').length`;if("band"===n.get("type")){r=`bandspace(${r}, ${n.get("paddingInner")??n.get("padding")??0}, ${n.get("paddingOuter")??n.get("padding")??0})`}const a=i.get("paddingInner")??i.get("padding");return{signal:`${t.step} * ${r} / (1-${s=a,zr(s)?s.signal:pt(s)})`}}return t.step;var s}function wm(t,e){if("offset"===Ju({step:t,offsetIsDiscrete:Lo(e)}))return{step:t.step}}function Am(t,e,n){const r=t===ve?"width":"height",i=e[r];return i||nl(n,r)}function Dm(t,e,n){if(e)return zr(e)?{signal:`${e.signal} ? 0 : ${Dm(t,!1,n)}`}:0;switch(t){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(Di("size",t))}const Em=.95;function Fm(t,e,n){const r=Zu(t.width)?t.width.step:el(n,"width"),i=Zu(t.height)?t.height.step:el(n,"height");return e.x||e.y?new nm((()=>`min(${[e.x?e.x.signal:r,e.y?e.y.signal:i].join(", ")})`)):Math.min(r,i)}function Cm(t,e){Om(t)?function(t,e){const n=t.component.scales,{config:r,encoding:i,markDef:o,specifiedScales:a}=t;for(const s of Xt(n)){const u=a[s],l=n[s],c=t.getScaleComponent(s),f=Os(i[s]),h=u[e],d=c.get("type"),p=c.get("padding"),g=c.get("paddingInner"),m=ta(d,e),y=ea(s,e);if(void 0!==h&&(m?y&&Wi(y):Wi(Ti(d,e,s))),m&&void 0===y)if(void 0!==h){const t=f.timeUnit,n=f.type;switch(e){case"domainMax":case"domainMin":Hi(u[e])||"temporal"===n||t?l.set(e,{signal:Is(u[e],{type:n,timeUnit:t})},!0):l.set(e,u[e],!0);break;default:l.copyKeyFromObject(e,u)}}else{const n=e in km?km[e]({model:t,channel:s,fieldOrDatumDef:f,scaleType:d,scalePadding:p,scalePaddingInner:g,domain:u.domain,domainMin:u.domainMin,domainMax:u.domainMax,markDef:o,config:r,hasNestedOffsetScale:ru(i,s),hasSecondaryRangeChannel:!!i[An(s)]}):r.scale[e];void 0!==n&&l.set(e,n,!1)}}}(t,e):Sm(t,e)}const km={bins:({model:t,fieldOrDatumDef:e})=>fs(e)?function(t,e){const n=e.bin;if(Cr(n)){const r=pg(t,e.field,n);return new nm((()=>t.getSignalName(r)))}if(kr(n)&&Mr(n)&&void 0!==n.step)return{step:n.step};return}(t,e):void 0,interpolate:({channel:t,fieldOrDatumDef:e})=>function(t,e){if(Nt([Te,Be,Ne],t)&&"nominal"!==e)return"hcl";return}(t,e.type),nice:({scaleType:t,channel:e,domain:n,domainMin:r,domainMax:i,fieldOrDatumDef:o})=>function(t,e,n,r,i,o){if(Ns(o)?.bin||et(n)||null!=i||null!=r||Nt([Mo.TIME,Mo.UTC],t))return;return!!Yn(e)||void 0}(t,e,n,r,i,o),padding:({channel:t,scaleType:e,fieldOrDatumDef:n,markDef:r,config:i})=>function(t,e,n,r,i,o){if(Yn(t)){if(Io(e)){if(void 0!==n.continuousPadding)return n.continuousPadding;const{type:e,orient:a}=i;if("bar"===e&&(!fs(r)||!r.bin&&!r.timeUnit)&&("vertical"===a&&"x"===t||"horizontal"===a&&"y"===t))return o.continuousBandSize}if(e===Mo.POINT)return n.pointPadding}return}(t,e,i.scale,n,r,i.bar),paddingInner:({scalePadding:t,channel:e,markDef:n,scaleType:r,config:i,hasNestedOffsetScale:o})=>function(t,e,n,r,i,o=!1){if(void 0!==t)return;if(Yn(e)){const{bandPaddingInner:t,barBandPaddingInner:e,rectBandPaddingInner:r,bandWithNestedOffsetPaddingInner:a}=i;return o?a:se(t,"bar"===n?e:r)}if(Kn(e)&&r===Mo.BAND)return i.offsetBandPaddingInner;return}(t,e,n.type,r,i.scale,o),paddingOuter:({scalePadding:t,channel:e,scaleType:n,scalePaddingInner:r,config:i,hasNestedOffsetScale:o})=>function(t,e,n,r,i,o=!1){if(void 0!==t)return;if(Yn(e)){const{bandPaddingOuter:t,bandWithNestedOffsetPaddingOuter:e}=i;if(o)return e;if(n===Mo.BAND)return se(t,zr(r)?{signal:`${r.signal}/2`}:r/2)}else if(Kn(e)){if(n===Mo.POINT)return.5;if(n===Mo.BAND)return i.offsetBandPaddingOuter}return}(t,e,n,r,i.scale,o),reverse:({fieldOrDatumDef:t,scaleType:e,channel:n,config:r})=>function(t,e,n,r){if("x"===n&&void 0!==r.xReverse)return jo(t)&&"descending"===e?zr(r.xReverse)?{signal:`!${r.xReverse.signal}`}:!r.xReverse:r.xReverse;if(jo(t)&&"descending"===e)return!0;return}(e,fs(t)?t.sort:void 0,n,r.scale),zero:({channel:t,fieldOrDatumDef:e,domain:n,markDef:r,scaleType:i,config:o,hasSecondaryRangeChannel:a})=>function(t,e,n,r,i,o,a){if(n&&"unaggregated"!==n&&jo(i)){if(et(n)){const t=n[0],e=n[n.length-1];if(t<=0&&e>=0)return!0}return!1}if("size"===t&&"quantitative"===e.type&&!qo(i))return!0;if((!fs(e)||!e.bin)&&Nt([...Xn,...Vn],t)){const{orient:e,type:n}=r;return(!Nt(["bar","area","line","trail"],n)||!("horizontal"===e&&"y"===t||"vertical"===e&&"x"===t))&&(!(!Nt(["bar","area"],n)||a)||o?.zero)}return!1}(t,e,n,r,i,o.scale,a)};function Mm(t){Om(t)?function(t){const e=t.component.scales;for(const n of cr){const r=e[n];if(!r)continue;const i=bm(n,t);r.setWithExplicit("range",i)}}(t):Sm(t,"range")}function Sm(t,e){const n=t.component.scales;for(const r of t.children)"range"===e?Mm(r):Cm(r,e);for(const r of Xt(n)){let i;for(const n of t.children){const t=n.component.scales[r];if(t){i=Ac(i,t.getWithExplicit(e),e,"scale",_c(((t,n)=>"range"===e&&t.step&&n.step?t.step-n.step:0)))}}n[r].setWithExplicit(e,i)}}function $m(t,e,n,r,i=!1){const o=function(t,e,n,r){switch(e.type){case"nominal":case"ordinal":if(on(t)||"discrete"===mr(t))return"shape"===t&&"ordinal"===e.type&&Wi(ki(t,"ordinal")),"ordinal";if(Yn(t)||Kn(t)){if(Nt(["rect","bar","image","rule"],n.type))return"band";if(r)return"band"}else if("arc"===n.type&&t in Gn)return"band";return Da(n[Dn(t)])||_s(e)&&e.axis?.tickBand?"band":"point";case"temporal":return on(t)?"time":"discrete"===mr(t)?(Wi(ki(t,"temporal")),"ordinal"):fs(e)&&e.timeUnit&&ao(e.timeUnit).utc?"utc":"time";case"quantitative":return on(t)?fs(e)&&Cr(e.bin)?"bin-ordinal":"linear":"discrete"===mr(t)?(Wi(ki(t,"quantitative")),"ordinal"):"linear";case"geojson":return}throw new Error(xi(e.type))}(e,n,r,i),{type:a}=t;return fr(e)?void 0!==a?function(t,e,n=!1){if(!fr(t))return!1;switch(t){case ve:case be:case we:case Ae:case Fe:case De:return!!Io(e)||"band"===e||"point"===e&&!n;case ze:case je:case Pe:case Ue:case Le:case Re:return Io(e)||qo(e)||Nt(["band","point","ordinal"],e);case Te:case Be:case Ne:return"band"!==e;case Ie:case Oe:return"ordinal"===e||qo(e)}}(e,a)?fs(n)&&(s=a,u=n.type,!(Nt([Eo,Co],u)?void 0===s||Lo(s):u===Fo?Nt([Mo.TIME,Mo.UTC,void 0],s):u!==Do||zo(s)||qo(s)||void 0===s))?(Wi(function(t,e){return`FieldDef does not work with "${t}" scale. We are using "${e}" scale instead.`}(a,o)),o):a:(Wi(function(t,e,n){return`Channel "${t}" does not work with "${e}" scale. We are using "${n}" scale instead.`}(e,a,o)),o):o:null;var s,u}function Tm(t){Om(t)?t.component.scales=function(t){const{encoding:e,mark:n,markDef:r}=t,i={};for(const o of cr){const a=Os(e[o]);if(a&&n===ma&&o===Oe&&a.type===ko)continue;let s=a&&a.scale;if(Kn(o)){if(!ru(e,Cn(o))){s&&Wi(Ei(o));continue}}if(a&&null!==s&&!1!==s){s??(s={});const n=$m(s,o,a,r,ru(e,o));i[o]=new mm(t.scaleName(`${o}`,!0),{value:n,explicit:s.type===n})}}return i}(t):t.component.scales=function(t){var e;const n=t.component.scales={},r={},i=t.component.resolve;for(const o of t.children){Tm(o);for(const n of Xt(o.component.scales))if((e=i.scale)[n]??(e[n]=jp(n,t)),"shared"===i.scale[n]){const t=r[n],e=o.component.scales[n].getWithExplicit("type");t?$o(t.value,e.value)?r[n]=Ac(t,e,"type","scale",Bm):(i.scale[n]="independent",delete r[n]):r[n]=e}}for(const o of Xt(r)){const e=t.scaleName(o,!0),i=r[o];n[o]=new mm(e,i);for(const n of t.children){const t=n.component.scales[o];t&&(n.renameScale(t.get("name"),e),t.merged=!0)}}return n}(t)}const Bm=_c(((t,e)=>Bo(t)-Bo(e)));class Nm{constructor(){this.nameMap={}}rename(t,e){this.nameMap[t]=e}has(t){return void 0!==this.nameMap[t]}get(t){for(;this.nameMap[t]&&t!==this.nameMap[t];)t=this.nameMap[t];return t}}function Om(t){return"unit"===t?.type}function zm(t){return"facet"===t?.type}function Rm(t){return"concat"===t?.type}function Pm(t){return"layer"===t?.type}class Um{constructor(t,e,n,r,i,o,a){this.type=e,this.parent=n,this.config=i,this.correctDataNames=t=>(t.from?.data&&(t.from.data=this.lookupDataSource(t.from.data)),t.from?.facet?.data&&(t.from.facet.data=this.lookupDataSource(t.from.facet.data)),t),this.parent=n,this.config=i,this.view=Br(a),this.name=t.name??r,this.title=Or(t.title)?{text:t.title}:t.title?Br(t.title):void 0,this.scaleNameMap=n?n.scaleNameMap:new Nm,this.projectionNameMap=n?n.projectionNameMap:new Nm,this.signalNameMap=n?n.signalNameMap:new Nm,this.data=t.data,this.description=t.description,this.transforms=(t.transform??[]).map((t=>Ul(t)?{filter:Et(t.filter,xo)}:t)),this.layout="layer"===e||"unit"===e?{}:function(t,e,n){const r=n[e],i={},{spacing:o,columns:a}=r;void 0!==o&&(i.spacing=o),void 0!==a&&(es(t)&&!Qa(t.facet)||Yu(t))&&(i.columns=a),Gu(t)&&(i.columns=1);for(const s of Qu)if(void 0!==t[s])if("spacing"===s){const e=t[s];i[s]=ht(e)?e:{row:e.row??o,column:e.column??o}}else i[s]=t[s];return i}(t,e,i),this.component={data:{sources:n?n.component.data.sources:[],outputNodes:n?n.component.data.outputNodes:{},outputNodeRefCounts:n?n.component.data.outputNodeRefCounts:{},isFaceted:es(t)||n?.component.data.isFaceted&&void 0===t.data},layoutSize:new vc,layoutHeaders:{row:{},column:{},facet:{}},mark:null,resolve:{scale:{},axis:{},legend:{},...o?Ct(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(t,{ignoreRange:e}={}){Tm(t),rm(t);for(const n of Qo)Cm(t,n);e||Mm(t)}(this)}parseProjection(){fg(this)}renameTopLevelLayoutSizeSignal(){"width"!==this.getName("width")&&this.renameSignal(this.getName("width"),"width"),"height"!==this.getName("height")&&this.renameSignal(this.getName("height"),"height")}parseLegends(){eg(this)}assembleEncodeFromView(t){const{style:e,...n}=t,r={};for(const i of Xt(n)){const t=n[i];void 0!==t&&(r[i]=Hr(t))}return r}assembleGroupEncodeEntry(t){let e={};return this.view&&(e=this.assembleEncodeFromView(this.view)),t||(this.description&&(e.description=Hr(this.description)),"unit"!==this.type&&"layer"!==this.type)?Ht(e)?void 0:e:{width:this.getSizeSignalRef("width"),height:this.getSizeSignalRef("height"),...e??{}}}assembleLayout(){if(!this.layout)return;const{spacing:t,...e}=this.layout,{component:n,config:r}=this,i=function(t,e){const n={};for(const r of sn){const i=t[r];if(i?.facetFieldDef){const{titleAnchor:t,titleOrient:o}=wp(["titleAnchor","titleOrient"],i.facetFieldDef.header,e,r),a=xp(r,o),s=Bp(t,a);void 0!==s&&(n[a]=s)}}return Ht(n)?void 0:n}(n.layoutHeaders,r);return{padding:t,...this.assembleDefaultLayout(),...e,...i?{titleBand:i}:{}}}assembleDefaultLayout(){return{}}assembleHeaderMarks(){const{layoutHeaders:t}=this.component;let e=[];for(const n of sn)t[n].title&&e.push(Ep(this,n));for(const n of Ap)e=e.concat(kp(this,n));return e}assembleAxes(){return function(t,e){const{x:n=[],y:r=[]}=t;return[...n.map((t=>up(t,"grid",e))),...r.map((t=>up(t,"grid",e))),...n.map((t=>up(t,"main",e))),...r.map((t=>up(t,"main",e)))].filter((t=>t))}(this.component.axes,this.config)}assembleLegends(){return ag(this)}assembleProjections(){return sg(this)}assembleTitle(){const{encoding:t,...e}=this.title??{},n={...Nr(this.config.title).nonMarkTitleProperties,...e,...t?{encode:{update:t}}:{}};if(n.text)return Nt(["unit","layer"],this.type)?Nt(["middle",void 0],n.anchor)&&(n.frame??(n.frame="group")):n.anchor??(n.anchor="start"),Ht(n)?void 0:n}assembleGroup(t=[]){const e={};(t=t.concat(this.assembleSignals())).length>0&&(e.signals=t);const n=this.assembleLayout();n&&(e.layout=n),e.marks=[].concat(this.assembleHeaderMarks(),this.assembleMarks());const r=!this.parent||zm(this.parent)?pm(this):[];r.length>0&&(e.scales=r);const i=this.assembleAxes();i.length>0&&(e.axes=i);const o=this.assembleLegends();return o.length>0&&(e.legends=o),e}getName(t){return Jt((this.name?`${this.name}_`:"")+t)}getDataName(t){return this.getName(Tc[t].toLowerCase())}requestDataName(t){const e=this.getDataName(t),n=this.component.data.outputNodeRefCounts;return n[e]=(n[e]||0)+1,e}getSizeSignalRef(t){if(zm(this.parent)){const e=Jn(Up(t)),n=this.component.scales[e];if(n&&!n.merged){const t=n.get("type"),r=n.get("range");if(Lo(t)&&Rr(r)){const t=n.get("name"),r=hm(dm(this,e));if(r){return{signal:Pp(t,n,Es({aggregate:"distinct",field:r},{expr:"datum"}))}}return Wi(li(e)),null}}}return{signal:this.signalNameMap.get(this.getName(t))}}lookupDataSource(t){const e=this.component.data.outputNodes[t];return e?e.getSource():t}getSignalName(t){return this.signalNameMap.get(t)}renameSignal(t,e){this.signalNameMap.rename(t,e)}renameScale(t,e){this.scaleNameMap.rename(t,e)}renameProjection(t,e){this.projectionNameMap.rename(t,e)}scaleName(t,e){return e?this.getName(t):vn(t)&&fr(t)&&this.component.scales[t]||this.scaleNameMap.has(this.getName(t))?this.scaleNameMap.get(this.getName(t)):void 0}projectionName(t){return t?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(t){if(!this.component.scales)throw new Error("getScaleComponent cannot be called before parseScale(). Make sure you have called parseScale or use parseUnitModelWithScale().");const e=this.component.scales[t];return e&&!e.merged?e:this.parent?this.parent.getScaleComponent(t):void 0}getSelectionComponent(t,e){let n=this.component.selection[t];if(!n&&this.parent&&(n=this.parent.getSelectionComponent(t,e)),!n)throw new Error(`Cannot find a selection named "${e}".`);return n}hasAxisOrientSignalRef(){return this.component.axes.x?.some((t=>t.hasOrientSignalRef()))||this.component.axes.y?.some((t=>t.hasOrientSignalRef()))}}class Lm extends Um{vgField(t,e={}){const n=this.fieldDef(t);if(n)return Es(n,e)}reduceFieldDef(t,e){return function(t,e,n,r){return t?Xt(t).reduce(((n,i)=>{const o=t[i];return et(o)?o.reduce(((t,n)=>e.call(r,t,n,i)),n):e.call(r,n,o,i)}),n):n}(this.getMapping(),((e,n,r)=>{const i=Ns(n);return i?t(e,i,r):e}),e)}forEachFieldDef(t,e){uu(this.getMapping(),((e,n)=>{const r=Ns(e);r&&t(r,n)}),e)}}class jm extends Lc{clone(){return new jm(null,Ct(this.transform))}constructor(t,e){super(t),this.transform=e,this.transform=Ct(e);const n=this.transform.as??[void 0,void 0];this.transform.as=[n[0]??"value",n[1]??"density"],e.groupby&&null==e.minsteps&&null==e.maxsteps&&null==e.steps&&(this.transform.steps=200)}dependentFields(){return new Set([this.transform.density,...this.transform.groupby??[]])}producedFields(){return new Set(this.transform.as)}hash(){return`DensityTransform ${Tt(this.transform)}`}assemble(){const{density:t,...e}=this.transform;return{type:"kde",field:t,...e}}}class Im extends Lc{clone(){return new Im(null,Ct(this.transform))}constructor(t,e){super(t),this.transform=e,this.transform=Ct(e)}dependentFields(){return new Set([this.transform.extent])}producedFields(){return new Set([])}hash(){return`ExtentTransform ${Tt(this.transform)}`}assemble(){const{extent:t,param:e}=this.transform;return{type:"extent",field:t,signal:e}}}class qm extends Lc{clone(){return new qm(null,{...this.filter})}constructor(t,e){super(t),this.filter=e}static make(t,e){const{config:n,mark:r,markDef:i}=e;if("filter"!==Jr("invalid",i,n))return null;const o=e.reduceFieldDef(((t,n,i)=>{const o=fr(i)&&e.getScaleComponent(i);if(o){jo(o.get("type"))&&"count"!==n.aggregate&&!ya(r)&&(t[n.field]=n)}return t}),{});return Xt(o).length?new qm(t,o):null}dependentFields(){return new Set(Xt(this.filter))}producedFields(){return new Set}hash(){return`FilterInvalid ${Tt(this.filter)}`}assemble(){const t=Xt(this.filter).reduce(((t,e)=>{const n=this.filter[e],r=Es(n,{expr:"datum"});return null!==n&&("temporal"===n.type?t.push(`(isDate(${r}) || (isValid(${r}) && isFinite(+${r})))`):"quantitative"===n.type&&(t.push(`isValid(${r})`),t.push(`isFinite(+${r})`))),t}),[]);return t.length>0?{type:"filter",expr:t.join(" && ")}:null}}class Wm extends Lc{clone(){return new Wm(this.parent,Ct(this.transform))}constructor(t,e){super(t),this.transform=e,this.transform=Ct(e);const{flatten:n,as:r=[]}=this.transform;this.transform.as=n.map(((t,e)=>r[e]??t))}dependentFields(){return new Set(this.transform.flatten)}producedFields(){return new Set(this.transform.as)}hash(){return`FlattenTransform ${Tt(this.transform)}`}assemble(){const{flatten:t,as:e}=this.transform;return{type:"flatten",fields:t,as:e}}}class Hm extends Lc{clone(){return new Hm(null,Ct(this.transform))}constructor(t,e){super(t),this.transform=e,this.transform=Ct(e);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 ${Tt(this.transform)}`}assemble(){const{fold:t,as:e}=this.transform;return{type:"fold",fields:t,as:e}}}class Xm extends Lc{clone(){return new Xm(null,Ct(this.fields),this.geojson,this.signal)}static parseAll(t,e){if(e.component.projection&&!e.component.projection.isFit)return t;let n=0;for(const r of[[Me,ke],[$e,Se]]){const i=r.map((t=>{const n=Os(e.encoding[t]);return fs(n)?n.field:ds(n)?{expr:`${n.datum}`}:bs(n)?{expr:`${n.value}`}:void 0}));(i[0]||i[1])&&(t=new Xm(t,i,null,e.getName("geojson_"+n++)))}if(e.channelHasField(Oe)){const r=e.typedFieldDef(Oe);r.type===ko&&(t=new Xm(t,null,r.field,e.getName("geojson_"+n++)))}return t}constructor(t,e,n,r){super(t),this.fields=e,this.geojson=n,this.signal=r}dependentFields(){const t=(this.fields??[]).filter(dt);return new Set([...this.geojson?[this.geojson]:[],...t])}producedFields(){return new Set}hash(){return`GeoJSON ${this.geojson} ${this.signal} ${Tt(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 Ym extends Lc{clone(){return new Ym(null,this.projection,Ct(this.fields),Ct(this.as))}constructor(t,e,n,r){super(t),this.projection=e,this.fields=n,this.as=r}static parseAll(t,e){if(!e.projectionName())return t;for(const n of[[Me,ke],[$e,Se]]){const r=n.map((t=>{const n=Os(e.encoding[t]);return fs(n)?n.field:ds(n)?{expr:`${n.datum}`}:bs(n)?{expr:`${n.value}`}:void 0})),i=n[0]===$e?"2":"";(r[0]||r[1])&&(t=new Ym(t,e.projectionName(),r,[e.getName(`x${i}`),e.getName(`y${i}`)]))}return t}dependentFields(){return new Set(this.fields.filter(dt))}producedFields(){return new Set(this.as)}hash(){return`Geopoint ${this.projection} ${Tt(this.fields)} ${Tt(this.as)}`}assemble(){return{type:"geopoint",projection:this.projection,fields:this.fields,as:this.as}}}class Gm extends Lc{clone(){return new Gm(null,Ct(this.transform))}constructor(t,e){super(t),this.transform=e}dependentFields(){return new Set([this.transform.impute,this.transform.key,...this.transform.groupby??[]])}producedFields(){return new Set([this.transform.impute])}processSequence(t){const{start:e=0,stop:n,step:r}=t;return{signal:`sequence(${[e,n,...r?[r]:[]].join(",")})`}}static makeFromTransform(t,e){return new Gm(t,e)}static makeFromEncoding(t,e){const n=e.encoding,r=n.x,i=n.y;if(fs(r)&&fs(i)){const o=r.impute?r:i.impute?i:void 0;if(void 0===o)return;const a=r.impute?i:i.impute?r:void 0,{method:s,value:u,frame:l,keyvals:c}=o.impute,f=lu(e.mark,n);return new Gm(t,{impute:o.field,key:a.field,...s?{method:s}:{},...void 0!==u?{value:u}:{},...l?{frame:l}:{},...void 0!==c?{keyvals:c}:{},...f.length?{groupby:f}:{}})}return null}hash(){return`Impute ${Tt(this.transform)}`}assemble(){const{impute:t,key:e,keyvals:n,method:r,groupby:i,value:o,frame:a=[null,null]}=this.transform,s={type:"impute",field:t,key:e,...n?{keyvals:Ll(n)?this.processSequence(n):n}:{},method:"value",...i?{groupby:i}:{},value:r&&"value"!==r?null:o};if(r&&"value"!==r){return[s,{type:"window",as:[`imputed_${t}_value`],ops:[r],fields:[t],frame:a,ignorePeers:!1,...i?{groupby:i}:{}},{type:"formula",expr:`datum.${t} === null ? datum.imputed_${t}_value : datum.${t}`,as:t}]}return[s]}}class Vm extends Lc{clone(){return new Vm(null,Ct(this.transform))}constructor(t,e){super(t),this.transform=e,this.transform=Ct(e);const n=this.transform.as??[void 0,void 0];this.transform.as=[n[0]??e.on,n[1]??e.loess]}dependentFields(){return new Set([this.transform.loess,this.transform.on,...this.transform.groupby??[]])}producedFields(){return new Set(this.transform.as)}hash(){return`LoessTransform ${Tt(this.transform)}`}assemble(){const{loess:t,on:e,...n}=this.transform;return{type:"loess",x:e,y:t,...n}}}class Jm extends Lc{clone(){return new Jm(null,Ct(this.transform),this.secondary)}constructor(t,e,n){super(t),this.transform=e,this.secondary=n}static make(t,e,n,r){const i=e.component.data.sources,{from:o}=n;let a=null;if(function(t){return"data"in t}(o)){let t=fy(o.data,i);t||(t=new Cg(o.data),i.push(t));const n=e.getName(`lookup_${r}`);a=new jc(t,n,Tc.Lookup,e.component.data.outputNodeRefCounts),e.component.data.outputNodes[n]=a}else if(function(t){return"param"in t}(o)){const t=o.param;let r;n={as:t,...n};try{r=e.getSelectionComponent(Jt(t),t)}catch(s){throw new Error(`Lookups can only be performed on selection parameters. "${t}" is a variable parameter.`)}if(a=r.materialized,!a)throw new Error(function(t){return`Cannot define and lookup the "${t}" selection in the same view. Try moving the lookup into a second, layered view?`}(t))}return new Jm(t,n,a.getSource())}dependentFields(){return new Set([this.transform.lookup])}producedFields(){return new Set(this.transform.as?st(this.transform.as):this.transform.from.fields)}hash(){return`Lookup ${Tt({transform:this.transform,secondary:this.secondary})}`}assemble(){let t;if(this.transform.from.fields)t={values:this.transform.from.fields,...this.transform.as?{as:st(this.transform.as)}:{}};else{let e=this.transform.as;dt(e)||(Wi('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.'),e="_lookup"),t={as:[e]}}return{type:"lookup",from:this.secondary,key:this.transform.from.key,fields:[this.transform.lookup],...t,...this.transform.default?{default:this.transform.default}:{}}}}class Zm extends Lc{clone(){return new Zm(null,Ct(this.transform))}constructor(t,e){super(t),this.transform=e,this.transform=Ct(e);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 ${Tt(this.transform)}`}assemble(){const{quantile:t,...e}=this.transform;return{type:"quantile",field:t,...e}}}class Km extends Lc{clone(){return new Km(null,Ct(this.transform))}constructor(t,e){super(t),this.transform=e,this.transform=Ct(e);const n=this.transform.as??[void 0,void 0];this.transform.as=[n[0]??e.on,n[1]??e.regression]}dependentFields(){return new Set([this.transform.regression,this.transform.on,...this.transform.groupby??[]])}producedFields(){return new Set(this.transform.as)}hash(){return`RegressionTransform ${Tt(this.transform)}`}assemble(){const{regression:t,on:e,...n}=this.transform;return{type:"regression",x:e,y:t,...n}}}class Qm extends Lc{clone(){return new Qm(null,Ct(this.transform))}constructor(t,e){super(t),this.transform=e}addDimensions(t){this.transform.groupby=Ut((this.transform.groupby??[]).concat(t),(t=>t))}producedFields(){}dependentFields(){return new Set([this.transform.pivot,this.transform.value,...this.transform.groupby??[]])}hash(){return`PivotTransform ${Tt(this.transform)}`}assemble(){const{pivot:t,value:e,groupby:n,limit:r,op:i}=this.transform;return{type:"pivot",field:t,value:e,...void 0!==r?{limit:r}:{},...void 0!==i?{op:i}:{},...void 0!==n?{groupby:n}:{}}}}class ty extends Lc{clone(){return new ty(null,Ct(this.transform))}constructor(t,e){super(t),this.transform=e}dependentFields(){return new Set}producedFields(){return new Set}hash(){return`SampleTransform ${Tt(this.transform)}`}assemble(){return{type:"sample",size:this.transform.sample}}}function ey(t){let e=0;return function n(r,i){if(r instanceof Cg&&!r.isGenerator&&!Ec(r.data)){t.push(i);i={name:null,source:i.name,transform:[]}}if(r instanceof Ag&&(r.parent instanceof Cg&&!i.source?(i.format={...i.format??{},parse:r.assembleFormatParse()},i.transform.push(...r.assembleTransforms(!0))):i.transform.push(...r.assembleTransforms())),r instanceof bg)return i.name||(i.name="data_"+e++),!i.source||i.transform.length>0?(t.push(i),r.data=i.name):r.data=i.source,void t.push(...r.assemble());if((r instanceof Eg||r instanceof Fg||r instanceof qm||r instanceof rp||r instanceof vp||r instanceof Ym||r instanceof vg||r instanceof Jm||r instanceof Gg||r instanceof Xg||r instanceof Hm||r instanceof Wm||r instanceof jm||r instanceof Vm||r instanceof Zm||r instanceof Km||r instanceof Dg||r instanceof ty||r instanceof Qm||r instanceof Im)&&i.transform.push(r.assemble()),(r instanceof mg||r instanceof Ic||r instanceof Gm||r instanceof Yg||r instanceof Xm)&&i.transform.push(...r.assemble()),r instanceof jc)if(i.source&&0===i.transform.length)r.setSource(i.source);else if(r.parent instanceof jc)r.setSource(i.name);else if(i.name||(i.name="data_"+e++),r.setSource(i.name),1===r.numChildren()){t.push(i);i={name:null,source:i.name,transform:[]}}switch(r.numChildren()){case 0:r instanceof jc&&(!i.source||i.transform.length>0)&&t.push(i);break;case 1:n(r.children[0],i);break;default:{i.name||(i.name="data_"+e++);let o=i.name;!i.source||i.transform.length>0?t.push(i):o=i.source;for(const t of r.children){n(t,{name:null,source:o,transform:[]})}break}}}}function ny(t){return"top"===t||"left"===t||zr(t)?"header":"footer"}function ry(t,e){const{facet:n,config:r,child:i,component:o}=t;if(t.channelHasField(e)){const a=n[e],s=_p("title",null,r,e);let u=Ss(a,r,{allowDisabling:!0,includeDefault:void 0===s||!!s});i.component.layoutHeaders[e].title&&(u=et(u)?u.join(", "):u,u+=` / ${i.component.layoutHeaders[e].title}`,i.component.layoutHeaders[e].title=null);const l=_p("labelOrient",a.header,r,e),c=null!==a.header&&se(a.header?.labels,r.header.labels,!0),f=Nt(["bottom","right"],l)?"footer":"header";o.layoutHeaders[e]={title:null!==a.header?u:null,facetFieldDef:a,[f]:"facet"===e?[]:[iy(t,e,c)]}}}function iy(t,e,n){const r="row"===e?"height":"width";return{labels:n,sizeSignal:t.child.component.layoutSize.get(r)?t.child.getSizeSignalRef(r):void 0,axes:[]}}function oy(t,e){const{child:n}=t;if(n.component.axes[e]){const{layoutHeaders:r,resolve:i}=t.component;if(i.axis[e]=Ip(i,e),"shared"===i.axis[e]){const i="x"===e?"column":"row",o=r[i];for(const r of n.component.axes[e]){const e=ny(r.get("orient"));o[e]??(o[e]=[iy(t,i,!1)]);const n=up(r,"main",t.config,{header:!0});n&&o[e][0].axes.push(n),r.mainExtracted=!0}}}}function ay(t){for(const e of t.children)e.parseLayoutSize()}function sy(t,e){const n=Up(e),r=Jn(n),i=t.component.resolve,o=t.component.layoutSize;let a;for(const s of t.children){const e=s.component.layoutSize.getWithExplicit(n),o=i.scale[r]??jp(r,t);if("independent"===o&&"step"===e.value){a=void 0;break}if(a){if("independent"===o&&a.value!==e.value){a=void 0;break}a=Ac(a,e,n,"")}else a=e}if(a){for(const r of t.children)t.renameSignal(r.getName(n),t.getName(e)),r.component.layoutSize.set(n,"merged",!1);o.setWithExplicit(e,a)}else o.setWithExplicit(e,{explicit:!1,value:void 0})}function uy(t,e){const n="width"===e?"x":"y",r=t.config,i=t.getScaleComponent(n);if(i){const t=i.get("type"),n=i.get("range");if(Lo(t)){const t=nl(r.view,e);return Rr(n)||Zu(t)?"step":t}return tl(r.view,e)}if(t.hasProjection||"arc"===t.mark)return tl(r.view,e);{const t=nl(r.view,e);return Zu(t)?t.step:t}}function ly(t,e,n){return Es(e,{suffix:`by_${Es(t)}`,...n??{}})}class cy extends Lm{constructor(t,e,n,r){super(t,"facet",e,n,r,t.resolve),this.child=Py(t.spec,this,this.getName("child"),void 0,r),this.children=[this.child],this.facet=this.initFacet(t.facet)}initFacet(t){if(!Qa(t))return{facet:this.initFacetFieldDef(t,"facet")};const e=Xt(t),n={};for(const r of e){if(![ge,me].includes(r)){Wi(Di(r,"facet"));break}const e=t[r];if(void 0===e.field){Wi(wi(e,r));break}n[r]=this.initFacetFieldDef(e,r)}return n}initFacetFieldDef(t,e){const n=Ps(t,e);return n.header?n.header=Br(n.header):null===n.header&&(n.header=null),n}channelHasField(t){return!!this.facet[t]}fieldDef(t){return this.facet[t]}parseData(){this.component.data=hy(this),this.child.parseData()}parseLayoutSize(){ay(this)}parseSelections(){this.child.parseSelections(),this.component.selection=this.child.component.selection}parseMarkGroup(){this.child.parseMarkGroup()}parseAxesAndHeaders(){this.child.parseAxesAndHeaders(),function(t){for(const e of sn)ry(t,e);oy(t,"x"),oy(t,"y")}(this)}assembleSelectionTopLevelSignals(t){return this.child.assembleSelectionTopLevelSignals(t)}assembleSignals(){return this.child.assembleSignals(),[]}assembleSelectionData(t){return this.child.assembleSelectionData(t)}getHeaderLayoutMixins(){const t={};for(const e of sn)for(const n of Dp){const r=this.component.layoutHeaders[e],i=r[n],{facetFieldDef:o}=r;if(o){const n=_p("titleOrient",o.header,this.config,e);if(["right","bottom"].includes(n)){const r=xp(e,n);t.titleAnchor??(t.titleAnchor={}),t.titleAnchor[r]="end"}}if(i?.[0]){const i="row"===e?"height":"width",o="header"===n?"headerBand":"footerBand";"facet"===e||this.child.component.layoutSize.get(i)||(t[o]??(t[o]={}),t[o][e]=.5),r.title&&(t.offset??(t.offset={}),t.offset["row"===e?"rowTitle":"columnTitle"]=10)}}return t}assembleDefaultLayout(){const{column:t,row:e}=this.facet,n=t?this.columnDistinctSignal():e?1:void 0;let r="all";return(e||"independent"!==this.component.resolve.scale.x)&&(t||"independent"!==this.component.resolve.scale.y)||(r="none"),{...this.getHeaderLayoutMixins(),...n?{columns:n}:{},bounds:"full",align:r}}assembleLayoutSignals(){return this.child.assembleLayoutSignals()}columnDistinctSignal(){if(!(this.parent&&this.parent instanceof cy)){return{signal:`length(data('${this.getName("column_domain")}'))`}}}assembleGroupStyle(){}assembleGroup(t){return this.parent&&this.parent instanceof cy?{...this.channelHasField("column")?{encode:{update:{columns:{field:Es(this.facet.column,{prefix:"distinct"})}}}}:{},...super.assembleGroup(t)}:super.assembleGroup(t)}getCardinalityAggregateForChild(){const t=[],e=[],n=[];if(this.child instanceof cy){if(this.child.channelHasField("column")){const r=Es(this.child.facet.column);t.push(r),e.push("distinct"),n.push(`distinct_${r}`)}}else for(const r of Xn){const i=this.child.component.scales[r];if(i&&!i.merged){const o=i.get("type"),a=i.get("range");if(Lo(o)&&Rr(a)){const i=hm(dm(this.child,r));i?(t.push(i),e.push("distinct"),n.push(`distinct_${i}`)):Wi(li(r))}}}return{fields:t,ops:e,as:n}}assembleFacet(){const{name:t,data:e}=this.component.data.facetRoot,{row:n,column:r}=this.facet,{fields:i,ops:o,as:a}=this.getCardinalityAggregateForChild(),s=[];for(const l of sn){const t=this.facet[l];if(t){s.push(Es(t));const{bin:e,sort:u}=t;if(Cr(e)&&s.push(Es(t,{binSuffix:"end"})),Za(u)){const{field:e,op:s=Ya}=u,l=ly(t,u);n&&r?(i.push(l),o.push("max"),a.push(l)):(i.push(e),o.push(s),a.push(l))}else if(et(u)){const e=bp(t,l);i.push(e),o.push("max"),a.push(e)}}}const u=!!n&&!!r;return{name:t,data:e,groupby:s,...u||i.length>0?{aggregate:{...u?{cross:u}:{},...i.length?{fields:i,ops:o,as:a}:{}}}:{}}}facetSortFields(t){const{facet:e}=this,n=e[t];return n?Za(n.sort)?[ly(n,n.sort,{expr:"datum"})]:et(n.sort)?[bp(n,t,{expr:"datum"})]:[Es(n,{expr:"datum"})]:[]}facetSortOrder(t){const{facet:e}=this,n=e[t];if(n){const{sort:t}=n;return[(Za(t)?t.order:!et(t)&&t)||"ascending"]}return[]}assembleLabelTitle(){const{facet:t,config:e}=this;if(t.facet)return Sp(t.facet,"facet",e);const n={row:["top","bottom"],column:["left","right"]};for(const r of Ap)if(t[r]){const i=_p("labelOrient",t[r]?.header,e,r);if(n[r].includes(i))return Sp(t[r],r,e)}}assembleMarks(){const{child:t}=this,e=function(t){const e=[],n=ey(e);for(const r of t.children)n(r,{source:t.name,name:null,transform:[]});return e}(this.component.data.facetRoot),n=t.assembleGroupEncodeEntry(!1),r=this.assembleLabelTitle()||t.assembleTitle(),i=t.assembleGroupStyle();return[{name:this.getName("cell"),type:"group",...r?{title:r}:{},...i?{style:i}:{},from:{facet:this.assembleFacet()},sort:{field:sn.map((t=>this.facetSortFields(t))).flat(),order:sn.map((t=>this.facetSortOrder(t))).flat()},...e.length>0?{data:e}:{},...n?{encode:{update:n}}:{},...t.assembleGroup(Rc(this,[]))}]}getMapping(){return this.facet}}function fy(t,e){for(const n of e){const e=n.data;if(t.name&&n.hasName()&&t.name!==n.dataName)continue;const r=t.format?.mesh,i=e.format?.feature;if(r&&i)continue;const o=t.format?.feature;if((o||i)&&o!==i)continue;const a=e.format?.mesh;if(!r&&!a||r===a)if(Fc(t)&&Fc(e)){if(Ft(t.values,e.values))return n}else if(Ec(t)&&Ec(e)){if(t.url===e.url)return n}else if(Cc(t)&&t.name===n.dataName)return n}return null}function hy(t){let e=function(t,e){if(t.data||!t.parent){if(null===t.data){const t=new Cg({values:[]});return e.push(t),t}const n=fy(t.data,e);if(n)return kc(t.data)||(n.data.format=Rt({},t.data.format,n.data.format)),!n.hasName()&&t.data.name&&(n.dataName=t.data.name),n;{const n=new Cg(t.data);return e.push(n),n}}return t.parent.component.data.facetRoot?t.parent.component.data.facetRoot:t.parent.component.data.main}(t,t.component.data.sources);const{outputNodes:n,outputNodeRefCounts:r}=t.component.data,i=t.data,o=!(i&&(kc(i)||Ec(i)||Fc(i)))&&t.parent?t.parent.component.data.ancestorParse.clone():new Dc;kc(i)?(Mc(i)?e=new Fg(e,i.sequence):$c(i)&&(e=new Eg(e,i.graticule)),o.parseNothing=!0):null===i?.format?.parse&&(o.parseNothing=!0),e=Ag.makeExplicit(e,t,o)??e,e=new Dg(e);const a=t.parent&&Pm(t.parent);(Om(t)||zm(t))&&a&&(e=mg.makeFromEncoding(e,t)??e),t.transforms.length>0&&(e=function(t,e,n){let r=0;for(const i of e.transforms){let o,a;if(Zl(i))a=t=new vp(t,i),o="derived";else if(Ul(i)){const r=_g(i);a=t=Ag.makeWithAncestors(t,{},r,n)??t,t=new rp(t,e,i.filter)}else if(Kl(i))a=t=mg.makeFromTransform(t,i,e),o="number";else if(tc(i))o="date",void 0===n.getWithExplicit(i.field).value&&(t=new Ag(t,{[i.field]:o}),n.set(i.field,o,!1)),a=t=Ic.makeFromTransform(t,i);else if(ec(i))a=t=vg.makeFromTransform(t,i),o="number",ah(e)&&(t=new Dg(t));else if(jl(i))a=t=Jm.make(t,e,i,r++),o="derived";else if(Gl(i))a=t=new Gg(t,i),o="number";else if(Vl(i))a=t=new Xg(t,i),o="number";else if(nc(i))a=t=Yg.makeFromTransform(t,i),o="derived";else if(rc(i))a=t=new Hm(t,i),o="derived";else if(ic(i))a=t=new Im(t,i),o="derived";else if(Jl(i))a=t=new Wm(t,i),o="derived";else if(Il(i))a=t=new Qm(t,i),o="derived";else if(Yl(i))t=new ty(t,i);else if(Ql(i))a=t=Gm.makeFromTransform(t,i),o="derived";else if(ql(i))a=t=new jm(t,i),o="derived";else if(Wl(i))a=t=new Zm(t,i),o="derived";else if(Hl(i))a=t=new Km(t,i),o="derived";else{if(!Xl(i)){Wi(`Ignoring an invalid transform: ${$t(i)}.`);continue}a=t=new Vm(t,i),o="derived"}if(a&&void 0!==o)for(const t of a.producedFields()??[])n.set(t,o,!1)}return t}(e,t,o));const s=function(t){const e={};if(Om(t)&&t.component.selection)for(const n of Xt(t.component.selection)){const r=t.component.selection[n];for(const t of r.project.items)!t.channel&&ae(t.field)>1&&(e[t.field]="flatten")}return e}(t),u=wg(t);e=Ag.makeWithAncestors(e,{},{...s,...u},o)??e,Om(t)&&(e=Xm.parseAll(e,t),e=Ym.parseAll(e,t)),(Om(t)||zm(t))&&(a||(e=mg.makeFromEncoding(e,t)??e),e=Ic.makeFromEncoding(e,t)??e,e=vp.parseAllForSortIndex(e,t));const l=t.getDataName(Tc.Raw),c=new jc(e,l,Tc.Raw,r);if(n[l]=c,e=c,Om(t)){const n=vg.makeFromEncoding(e,t);n&&(e=n,ah(t)&&(e=new Dg(e))),e=Gm.makeFromEncoding(e,t)??e,e=Yg.makeFromEncoding(e,t)??e}Om(t)&&(e=qm.make(e,t)??e);const f=t.getDataName(Tc.Main),h=new jc(e,f,Tc.Main,r);n[f]=h,e=h,Om(t)&&function(t,e){for(const[n,r]of Gt(t.component.selection??{})){const i=t.getName(`lookup_${n}`);t.component.data.outputNodes[i]=r.materialized=new jc(new rp(e,t,{param:n}),i,Tc.Lookup,t.component.data.outputNodeRefCounts)}}(t,h);let d=null;if(zm(t)){const r=t.getName("facet");e=function(t,e){const{row:n,column:r}=e;if(n&&r){let e=null;for(const i of[n,r])if(Za(i.sort)){const{field:n,op:r=Ya}=i.sort;t=e=new Xg(t,{joinaggregate:[{op:r,field:n,as:ly(i,i.sort,{forAs:!0})}],groupby:[Es(i)]})}return e}return null}(e,t.facet)??e,d=new bg(e,t,r,h.getSource()),n[r]=d}return{...t.component.data,outputNodes:n,outputNodeRefCounts:r,raw:c,main:h,facetRoot:d,ancestorParse:o}}class dy extends Um{constructor(t,e,n,r){super(t,"concat",e,n,r,t.resolve),"shared"!==t.resolve?.axis?.x&&"shared"!==t.resolve?.axis?.y||Wi("Axes cannot be shared in concatenated or repeated views yet (https://github.com/vega/vega-lite/issues/2415)."),this.children=this.getChildren(t).map(((t,e)=>Py(t,this,this.getName(`concat_${e}`),void 0,r)))}parseData(){this.component.data=hy(this);for(const t of this.children)t.parseData()}parseSelections(){this.component.selection={};for(const t of this.children){t.parseSelections();for(const e of Xt(t.component.selection))this.component.selection[e]=t.component.selection[e]}}parseMarkGroup(){for(const t of this.children)t.parseMarkGroup()}parseAxesAndHeaders(){for(const t of this.children)t.parseAxesAndHeaders()}getChildren(t){return Gu(t)?t.vconcat:Vu(t)?t.hconcat:t.concat}parseLayoutSize(){!function(t){ay(t);const e=1===t.layout.columns?"width":"childWidth",n=void 0===t.layout.columns?"height":"childHeight";sy(t,e),sy(t,n)}(this)}parseAxisGroup(){return null}assembleSelectionTopLevelSignals(t){return this.children.reduce(((t,e)=>e.assembleSelectionTopLevelSignals(t)),t)}assembleSignals(){return this.children.forEach((t=>t.assembleSignals())),[]}assembleLayoutSignals(){const t=Op(this);for(const e of this.children)t.push(...e.assembleLayoutSignals());return t}assembleSelectionData(t){return this.children.reduce(((t,e)=>e.assembleSelectionData(t)),t)}assembleMarks(){return this.children.map((t=>{const e=t.assembleTitle(),n=t.assembleGroupStyle(),r=t.assembleGroupEncodeEntry(!1);return{type:"group",name:t.getName("group"),...e?{title:e}:{},...n?{style:n}:{},...r?{encode:{update:r}}:{},...t.assembleGroup()}}))}assembleGroupStyle(){}assembleDefaultLayout(){const t=this.layout.columns;return{...null!=t?{columns:t}:{},bounds:"full",align:"each"}}}const py={disable:1,gridScale:1,scale:1,...Vs,labelExpr:1,encode:1},gy=Xt(py);class my extends vc{constructor(t={},e={},n=!1){super(),this.explicit=t,this.implicit=e,this.mainExtracted=n}clone(){return new my(Ct(this.explicit),Ct(this.implicit),this.mainExtracted)}hasAxisPart(t){return"axis"===t||("grid"===t||"title"===t?!!this.get(t):!(!1===(e=this.get(t))||null===e));var e}hasOrientSignalRef(){return zr(this.explicit.orient)}}const yy={bottom:"top",top:"bottom",left:"right",right:"left"};function vy(t,e){if(!t)return e.map((t=>t.clone()));{if(t.length!==e.length)return;const n=t.length;for(let r=0;r<n;r++){const n=t[r],i=e[r];if(!!n!==!!i)return;if(n&&i){const e=n.getWithExplicit("orient"),o=i.getWithExplicit("orient");if(e.explicit&&o.explicit&&e.value!==o.value)return;t[r]=by(n,i)}}}return t}function by(t,e){for(const n of gy){const r=Ac(t.getWithExplicit(n),e.getWithExplicit(n),n,"axis",((t,e)=>{switch(n){case"title":return ri(t,e);case"gridScale":return{explicit:t.explicit,value:se(t.value,e.value)}}return wc(t,e,n,"axis")}));t.setWithExplicit(n,r)}return t}function xy(t,e,n,r,i){if("disable"===e)return void 0!==n;switch(n=n||{},e){case"titleAngle":case"labelAngle":return t===(zr(n.labelAngle)?n.labelAngle:de(n.labelAngle));case"values":return!!n.values;case"encode":return!!n.encoding||!!n.labelAngle;case"title":if(t===yp(r,i))return!0}return t===n[e]}const _y=new Set(["grid","translate","format","formatType","orient","labelExpr","tickCount","position","tickMinStep"]);function wy(t,e){let n=e.axis(t);const r=new my,i=Os(e.encoding[t]),{mark:o,config:a}=e,s=n?.orient||a["x"===t?"axisX":"axisY"]?.orient||a.axis?.orient||function(t){return"x"===t?"bottom":"left"}(t),u=e.getScaleComponent(t).get("type"),l=function(t,e,n,r){const i="band"===e?["axisDiscrete","axisBand"]:"point"===e?["axisDiscrete","axisPoint"]:zo(e)?["axisQuantitative"]:"time"===e||"utc"===e?["axisTemporal"]:[],o="x"===t?"axisX":"axisY",a=zr(n)?"axisOrient":`axis${Qt(n)}`,s=[...i,...i.map((t=>o+t.substr(4)))],u=["axis",a,o];return{vlOnlyAxisConfig:cp(s,r,t,n),vgAxisConfig:cp(u,r,t,n),axisConfigStyle:fp([...u,...s],r)}}(t,u,s,e.config),c=void 0!==n?!n:hp("disable",a.style,n?.style,l).configValue;if(r.set("disable",c,void 0!==n),c)return r;n=n||{};const f=function(t,e,n,r,i){const o=e?.labelAngle;if(void 0!==o)return zr(o)?o:de(o);{const{configValue:o}=hp("labelAngle",r,e?.style,i);return void 0!==o?de(o):n!==ve||!Nt([Co,Eo],t.type)||fs(t)&&t.timeUnit?void 0:270}}(i,n,t,a.style,l),h=Ia(n.formatType,i,u),d=ja(i,i.type,n.format,n.formatType,a,!0),p={fieldOrDatumDef:i,axis:n,channel:t,model:e,scaleType:u,orient:s,labelAngle:f,format:d,formatType:h,mark:o,config:a};for(const y of gy){const i=y in dp?dp[y](p):Zs(y)?n[y]:void 0,o=void 0!==i,s=xy(i,y,n,e,t);if(o&&s)r.set(y,i,s);else{const{configValue:t,configFrom:e}=Zs(y)&&"values"!==y?hp(y,a.style,n.style,l):{},u=void 0!==t;o&&!u?r.set(y,i,s):("vgAxisConfig"!==e||_y.has(y)&&u||Xs(t)||zr(t))&&r.set(y,t,!1)}}const g=n.encoding??{},m=Ys.reduce(((n,i)=>{if(!r.hasAxisPart(i))return n;const o=Lp(g[i]??{},e),a="labels"===i?function(t,e,n){const{encoding:r,config:i}=t,o=Os(r[e])??Os(r[An(e)]),a=t.axis(e)||{},{format:s,formatType:u}=a;if(Oa(u))return{text:La({fieldOrDatumDef:o,field:"datum.value",format:s,formatType:u,config:i}),...n};if(void 0===s&&void 0===u&&i.customFormatTypes){if("quantitative"===hs(o)){if(_s(o)&&"normalize"===o.stack&&i.normalizedNumberFormatType)return{text:La({fieldOrDatumDef:o,field:"datum.value",format:i.normalizedNumberFormat,formatType:i.normalizedNumberFormatType,config:i}),...n};if(i.numberFormatType)return{text:La({fieldOrDatumDef:o,field:"datum.value",format:i.numberFormat,formatType:i.numberFormatType,config:i}),...n}}if("temporal"===hs(o)&&i.timeFormatType&&fs(o)&&!o.timeUnit)return{text:La({fieldOrDatumDef:o,field:"datum.value",format:i.timeFormat,formatType:i.timeFormatType,config:i}),...n}}return n}(e,t,o):o;return void 0===a||Ht(a)||(n[i]={update:a}),n}),{});return Ht(m)||r.set("encode",m,!!n.encoding||void 0!==n.labelAngle),r}function Ay(t,e,n){const r=Br(t),i=Jr("orient",r,n);if(r.orient=function(t,e,n){switch(t){case ua:case pa:case ga:case fa:case la:case aa:return}const{x:r,y:i,x2:o,y2:a}=e;switch(t){case oa:if(fs(r)&&(kr(r.bin)||fs(i)&&i.aggregate&&!r.aggregate))return"vertical";if(fs(i)&&(kr(i.bin)||fs(r)&&r.aggregate&&!i.aggregate))return"horizontal";if(a||o){if(n)return n;if(!o)return(fs(r)&&r.type===Do&&!Cr(r.bin)||ms(r))&&fs(i)&&kr(i.bin)?"horizontal":"vertical";if(!a)return(fs(i)&&i.type===Do&&!Cr(i.bin)||ms(i))&&fs(r)&&kr(r.bin)?"vertical":"horizontal"}case ca:if(o&&(!fs(r)||!kr(r.bin))&&a&&(!fs(i)||!kr(i.bin)))return;case ia:if(a)return fs(i)&&kr(i.bin)?"horizontal":"vertical";if(o)return fs(r)&&kr(r.bin)?"vertical":"horizontal";if(t===ca){if(r&&!i)return"vertical";if(i&&!r)return"horizontal"}case sa:case ha:{const e=gs(r),o=gs(i);if(n)return n;if(e&&!o)return"tick"!==t?"horizontal":"vertical";if(!e&&o)return"tick"!==t?"vertical":"horizontal";if(e&&o)return"vertical";{const t=vs(r)&&r.type===Fo,e=vs(i)&&i.type===Fo;if(t&&!e)return"vertical";if(!t&&e)return"horizontal"}return}}return"vertical"}(r.type,e,i),void 0!==i&&i!==r.orient&&Wi(`Specified orient "${r.orient}" overridden with "${i}".`),"bar"===r.type&&r.orient){const t=Jr("cornerRadiusEnd",r,n);if(void 0!==t){const n="horizontal"===r.orient&&e.x2||"vertical"===r.orient&&e.y2?["cornerRadius"]:Ea[r.orient];for(const e of n)r[e]=t;void 0!==r.cornerRadiusEnd&&delete r.cornerRadiusEnd}}void 0===Jr("opacity",r,n)&&(r.opacity=function(t,e){if(Nt([ua,ha,pa,ga],t)&&!iu(e))return.7;return}(r.type,e));return void 0===Jr("cursor",r,n)&&(r.cursor=function(t,e,n){if(e.href||t.href||Jr("href",t,n))return"pointer";return t.cursor}(r,e,n)),r}function Dy(t,e){const{config:n}=t;return{...Tf(t,{align:"ignore",baseline:"ignore",color:"include",size:"include",orient:"ignore",theta:"ignore"}),...bf("x",t,{defaultPos:"mid"}),...bf("y",t,{defaultPos:"mid"}),...gf("size",t),...gf("angle",t),...Ey(t,n,e)}}function Ey(t,e,n){return n?{shape:{value:n}}:gf("shape",t)}const Fy={vgMark:"rule",encodeEntry:t=>{const{markDef:e}=t,n=e.orient;return t.encoding.x||t.encoding.y||t.encoding.latitude||t.encoding.longitude?{...Tf(t,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...Df("x",t,{defaultPos:"horizontal"===n?"zeroOrMax":"mid",defaultPos2:"zeroOrMin",range:"vertical"!==n}),...Df("y",t,{defaultPos:"vertical"===n?"zeroOrMax":"mid",defaultPos2:"zeroOrMin",range:"horizontal"!==n}),...gf("size",t,{vgChannel:"strokeWidth"})}:{}}};function Cy(t,e,n){if(void 0===Jr("align",t,n))return"center"}function ky(t,e,n){if(void 0===Jr("baseline",t,n))return"middle"}const My={vgMark:"rect",encodeEntry:t=>{const{config:e,markDef:n}=t,r=n.orient,i="horizontal"===r?"width":"height",o="horizontal"===r?"height":"width";return{...Tf(t,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...bf("x",t,{defaultPos:"mid",vgChannel:"xc"}),...bf("y",t,{defaultPos:"mid",vgChannel:"yc"}),...gf("size",t,{defaultValue:Sy(t),vgChannel:i}),[o]:Hr(Jr("thickness",n,e))}}};function Sy(t){const{config:e,markDef:n}=t,{orient:r}=n,i="horizontal"===r?"width":"height",o=t.getScaleComponent("horizontal"===r?"x":"y"),a=Jr("size",n,e,{vgChannel:i})??e.tick.bandSize;if(void 0!==a)return a;{const t=o?o.get("range"):void 0;if(t&&Rr(t)&&ht(t.step))return 3*t.step/4;return 3*el(e.view,i)/4}}const $y={arc:{vgMark:"arc",encodeEntry:t=>({...Tf(t,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore",theta:"ignore"}),...bf("x",t,{defaultPos:"mid"}),...bf("y",t,{defaultPos:"mid"}),...Cf(t,"radius"),...Cf(t,"theta")})},area:{vgMark:"area",encodeEntry:t=>({...Tf(t,{align:"ignore",baseline:"ignore",color:"include",orient:"include",size:"ignore",theta:"ignore"}),...Df("x",t,{defaultPos:"zeroOrMin",defaultPos2:"zeroOrMin",range:"horizontal"===t.markDef.orient}),...Df("y",t,{defaultPos:"zeroOrMin",defaultPos2:"zeroOrMin",range:"vertical"===t.markDef.orient}),...Of(t)})},bar:{vgMark:"rect",encodeEntry:t=>({...Tf(t,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...Cf(t,"x"),...Cf(t,"y")})},circle:{vgMark:"symbol",encodeEntry:t=>Dy(t,"circle")},geoshape:{vgMark:"shape",encodeEntry:t=>({...Tf(t,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore",theta:"ignore"})}),postEncodingTransform:t=>{const{encoding:e}=t,n=e.shape;return[{type:"geoshape",projection:t.projectionName(),...n&&fs(n)&&n.type===ko?{field:Es(n,{expr:"datum"})}:{}}]}},image:{vgMark:"image",encodeEntry:t=>({...Tf(t,{align:"ignore",baseline:"ignore",color:"ignore",orient:"ignore",size:"ignore",theta:"ignore"}),...Cf(t,"x"),...Cf(t,"y"),...sf(t,"url")})},line:{vgMark:"line",encodeEntry:t=>({...Tf(t,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore",theta:"ignore"}),...bf("x",t,{defaultPos:"mid"}),...bf("y",t,{defaultPos:"mid"}),...gf("size",t,{vgChannel:"strokeWidth"}),...Of(t)})},point:{vgMark:"symbol",encodeEntry:t=>Dy(t)},rect:{vgMark:"rect",encodeEntry:t=>({...Tf(t,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...Cf(t,"x"),...Cf(t,"y")})},rule:Fy,square:{vgMark:"symbol",encodeEntry:t=>Dy(t,"square")},text:{vgMark:"text",encodeEntry:t=>{const{config:e,encoding:n}=t;return{...Tf(t,{align:"include",baseline:"include",color:"include",size:"ignore",orient:"ignore",theta:"include"}),...bf("x",t,{defaultPos:"mid"}),...bf("y",t,{defaultPos:"mid"}),...sf(t),...gf("size",t,{vgChannel:"fontSize"}),...gf("angle",t),...zf("align",Cy(t.markDef,n,e)),...zf("baseline",ky(t.markDef,n,e)),...bf("radius",t,{defaultPos:null}),...bf("theta",t,{defaultPos:null})}}},tick:My,trail:{vgMark:"trail",encodeEntry:t=>({...Tf(t,{align:"ignore",baseline:"ignore",color:"include",size:"include",orient:"ignore",theta:"ignore"}),...bf("x",t,{defaultPos:"mid"}),...bf("y",t,{defaultPos:"mid"}),...gf("size",t),...Of(t)})}};function Ty(t){if(Nt([sa,ia,da],t.mark)){const e=lu(t.mark,t.encoding);if(e.length>0)return function(t,e){return[{name:t.getName("pathgroup"),type:"group",from:{facet:{name:By+t.requestDataName(Tc.Main),data:t.requestDataName(Tc.Main),groupby:e}},encode:{update:{width:{field:{group:"width"}},height:{field:{group:"height"}}}},marks:Oy(t,{fromPrefix:By})}]}(t,e)}else if(t.mark===oa){const e=jr.some((e=>Jr(e,t.markDef,t.config)));if(t.stack&&!t.fieldDef("size")&&e)return function(t){const[e]=Oy(t,{fromPrefix:Ny}),n=t.scaleName(t.stack.fieldChannel),r=(e={})=>t.vgField(t.stack.fieldChannel,e),i=(t,e)=>`${t}(${[r({prefix:"min",suffix:"start",expr:e}),r({prefix:"max",suffix:"start",expr:e}),r({prefix:"min",suffix:"end",expr:e}),r({prefix:"max",suffix:"end",expr:e})].map((t=>`scale('${n}',${t})`)).join(",")})`;let o,a;"x"===t.stack.fieldChannel?(o={...Mt(e.encode.update,["y","yc","y2","height",...jr]),x:{signal:i("min","datum")},x2:{signal:i("max","datum")},clip:{value:!0}},a={x:{field:{group:"x"},mult:-1},height:{field:{group:"height"}}},e.encode.update={...St(e.encode.update,["y","yc","y2"]),height:{field:{group:"height"}}}):(o={...Mt(e.encode.update,["x","xc","x2","width"]),y:{signal:i("min","datum")},y2:{signal:i("max","datum")},clip:{value:!0}},a={y:{field:{group:"y"},mult:-1},width:{field:{group:"width"}}},e.encode.update={...St(e.encode.update,["x","xc","x2"]),width:{field:{group:"width"}}});for(const u of jr){const n=Zr(u,t.markDef,t.config);e.encode.update[u]?(o[u]=e.encode.update[u],delete e.encode.update[u]):n&&(o[u]=Hr(n)),n&&(e.encode.update[u]={value:0})}const s=[];if(t.stack.groupbyChannels?.length>0)for(const u of t.stack.groupbyChannels){const e=t.fieldDef(u),n=Es(e);n&&s.push(n),(e?.bin||e?.timeUnit)&&s.push(Es(e,{binSuffix:"end"}))}o=["stroke","strokeWidth","strokeJoin","strokeCap","strokeDash","strokeDashOffset","strokeMiterLimit","strokeOpacity"].reduce(((n,r)=>{if(e.encode.update[r])return{...n,[r]:e.encode.update[r]};{const e=Zr(r,t.markDef,t.config);return void 0!==e?{...n,[r]:Hr(e)}:n}}),o),o.stroke&&(o.strokeForeground={value:!0},o.strokeOffset={value:0});return[{type:"group",from:{facet:{data:t.requestDataName(Tc.Main),name:Ny+t.requestDataName(Tc.Main),groupby:s,aggregate:{fields:[r({suffix:"start"}),r({suffix:"start"}),r({suffix:"end"}),r({suffix:"end"})],ops:["min","max","min","max"]}}},encode:{update:o},marks:[{type:"group",encode:{update:a},marks:[e]}]}]}(t)}return Oy(t)}const By="faceted_path_";const Ny="stack_group_";function Oy(t,e={fromPrefix:""}){const{mark:n,markDef:r,encoding:i,config:o}=t,a=se(r.clip,function(t){const e=t.getScaleComponent("x"),n=t.getScaleComponent("y");return!(!e?.get("selectionExtent")&&!n?.get("selectionExtent"))||void 0}(t),function(t){const e=t.component.projection;return!(!e||e.isFit)||void 0}(t)),s=Vr(r),u=i.key,l=function(t){const{encoding:e,stack:n,mark:r,markDef:i,config:o}=t,a=e.order;if(!(!et(a)&&bs(a)&&Bt(a.value)||!a&&Bt(Jr("order",i,o)))){if((et(a)||fs(a))&&!n)return ti(a,{expr:"datum"});if(ya(r)){const n="horizontal"===i.orient?"y":"x",r=e[n];if(fs(r)){const e=r.sort;return et(e)?{field:Es(r,{prefix:n,suffix:"sort_index",expr:"datum"})}:Za(e)?{field:Es({aggregate:iu(t.encoding)?e.op:void 0,field:e.field},{expr:"datum"})}:Ja(e)?{field:Es(t.fieldDef(e.encoding),{expr:"datum"}),order:e.order}:null===e?void 0:{field:Es(r,{binSuffix:t.stack?.impute?"mid":void 0,expr:"datum"})}}}}}(t),c=function(t){if(!t.component.selection)return null;const e=Xt(t.component.selection).length;let n=e,r=t.parent;for(;r&&0===n;)n=Xt(r.component.selection).length,r=r.parent;return n?{interactive:e>0||"geoshape"===t.mark||!!t.encoding.tooltip}:null}(t),f=Jr("aria",r,o),h=$y[n].postEncodingTransform?$y[n].postEncodingTransform(t):null;return[{name:t.getName("marks"),type:$y[n].vgMark,...a?{clip:!0}:{},...s?{style:s}:{},...u?{key:u.field}:{},...l?{sort:l}:{},...c||{},...!1===f?{aria:f}:{},from:{data:e.fromPrefix+t.requestDataName(Tc.Main)},encode:{update:$y[n].encodeEntry(t)},...h?{transform:h}:{}}]}class zy extends Lm{constructor(t,e,n,r={},i){super(t,"unit",e,n,i,void 0,Ku(t)?t.view:void 0),this.specifiedScales={},this.specifiedAxes={},this.specifiedLegends={},this.specifiedProjection={},this.selection=[],this.children=[];const o=xa(t.mark)?{...t.mark}:{type:t.mark},a=o.type;void 0===o.filled&&(o.filled=function(t,e,{graticule:n}){if(n)return!1;const r=Zr("filled",t,e),i=t.type;return se(r,i!==ua&&i!==sa&&i!==ca)}(o,i,{graticule:t.data&&$c(t.data)}));const s=this.encoding=function(t,e,n,r){const i={};for(const a of Xt(t))vn(a)||Wi(`${o=a}-encoding is dropped as ${o} is not a valid encoding channel.`);var o;for(let a of kn){if(!t[a])continue;const o=t[a];if(Kn(a)){const t=Cn(a),e=i[t];if(fs(e)){if(wo(e.type)&&fs(o)&&!e.timeUnit){Wi(vi(t));continue}}else a=t,Wi(bi(t))}if("angle"!==a||"arc"!==e||t.theta||(Wi(yi),a=Fe),au(t,a,e)){if(a===ze&&"line"===e&&Ns(t[a])?.aggregate){Wi(Ai);continue}if(a===Te&&(n?"fill"in t:"stroke"in t))Wi(_i("encoding",{fill:"fill"in t,stroke:"stroke"in t}));else if(a===He||a===We&&!et(o)&&!bs(o)||a===Ye&&et(o)){if(o){if(a===We){const e=t[a];if(ss(e)){i[a]=e;continue}}i[a]=st(o).reduce(((t,e)=>(fs(e)?t.push(Ps(e,a)):Wi(wi(e,a)),t)),[])}}else{if(a===Ye&&null===o)i[a]=null;else if(!fs(o)&&!ds(o)&&!bs(o)&&!us(o)&&!zr(o)){Wi(wi(o,a));continue}i[a]=zs(o,a,r)}}else Wi(Di(a,e))}return i}(t.encoding||{},a,o.filled,i);this.markDef=Ay(o,s,i),this.size=function({encoding:t,size:e}){for(const n of Xn){const r=Dn(n);Zu(e[r])&&ps(t[n])&&(delete e[r],Wi(Bi(r)))}return e}({encoding:s,size:Ku(t)?{...r,...t.width?{width:t.width}:{},...t.height?{height:t.height}:{}}:r}),this.stack=Al(this.markDef,s),this.specifiedScales=this.initScales(a,s),this.specifiedAxes=this.initAxes(s),this.specifiedLegends=this.initLegends(s),this.specifiedProjection=t.projection,this.selection=(t.params??[]).filter((t=>Hu(t)))}get hasProjection(){const{encoding:t}=this,e=this.mark===ma,n=t&&nn.some((e=>ys(t[e])));return e||n}scaleDomain(t){const e=this.specifiedScales[t];return e?e.domain:void 0}axis(t){return this.specifiedAxes[t]}legend(t){return this.specifiedLegends[t]}initScales(t,e){return cr.reduce(((t,n)=>{const r=Os(e[n]);return r&&(t[n]=this.initScale(r.scale??{})),t}),{})}initScale(t){const{domain:e,range:n}=t,r=Br(t);return et(e)&&(r.domain=e.map(qr)),et(n)&&(r.range=n.map(qr)),r}initAxes(t){return Xn.reduce(((e,n)=>{const r=t[n];if(ys(r)||n===ve&&ys(t.x2)||n===be&&ys(t.y2)){const t=ys(r)?r.axis:void 0;e[n]=t?this.initAxis({...t}):t}return e}),{})}initAxis(t){const e=Xt(t),n={};for(const r of e){const e=t[r];n[r]=Xs(e)?Ir(e):qr(e)}return n}initLegends(t){return ur.reduce(((e,n)=>{const r=Os(t[n]);if(r&&function(t){switch(t){case Te:case Be:case Ne:case ze:case Oe:case Pe:case je:case Ie:return!0;case Ue:case Le:case Re:return!1}}(n)){const t=r.legend;e[n]=t?Br(t):t}return e}),{})}parseData(){this.component.data=hy(this)}parseLayoutSize(){!function(t){const{size:e,component:n}=t;for(const r of Xn){const i=Dn(r);if(e[i]){const t=e[i];n.layoutSize.set(i,Zu(t)?"step":t,!0)}else{const e=uy(t,i);n.layoutSize.set(i,e,!1)}}}(this)}parseSelections(){this.component.selection=function(t,e){const n={},r=t.config.selection;if(!e||!e.length)return n;for(const i of e){const e=Jt(i.name),o=i.select,a=dt(o)?o:o.type,s=nt(o)?Ct(o):{type:a},u=r[a];for(const t in u)"fields"!==t&&"encodings"!==t&&("mark"===t&&(s[t]={...u[t],...s[t]}),void 0!==s[t]&&!0!==s[t]||(s[t]=Ct(u[t]??s[t])));const l=n[e]={...s,name:e,type:a,init:i.value,bind:i.bind,events:dt(s.on)?(0,Bc.r)(s.on,"scope"):st(Ct(s.on))},c=Ct(i);for(const n of ih)n.defined(l)&&n.parse&&n.parse(t,l,c)}return n}(this,this.selection)}parseMarkGroup(){this.component.mark=Ty(this)}parseAxesAndHeaders(){var t;this.component.axes=(t=this,Xn.reduce(((e,n)=>(t.component.scales[n]&&(e[n]=[wy(n,t)]),e)),{}))}assembleSelectionTopLevelSignals(t){return function(t,e){let n=!1;for(const r of Yt(t.component.selection??{})){const i=r.name,o=pt(i+th);if(0===e.filter((t=>t.name===i)).length){const t="global"===r.resolve?"union":r.resolve,n="point"===r.type?", true, true)":")";e.push({name:r.name,update:`${rh}(${o}, ${pt(t)}${n}`})}n=!0;for(const n of ih)n.defined(r)&&n.topLevelSignals&&(e=n.topLevelSignals(t,r,e))}n&&0===e.filter((t=>"unit"===t.name)).length&&e.unshift({name:"unit",value:{},on:[{events:"mousemove",update:"isTuple(group()) ? group() : unit"}]});return Uc(e)}(this,t)}assembleSignals(){return[...lp(this),...zc(this,[])]}assembleSelectionData(t){return function(t,e){const n=[...e],r=oh(t,{escape:!1});for(const i of Yt(t.component.selection??{})){const t={name:i.name+th};if(i.project.hasSelectionId&&(t.transform=[{type:"collect",sort:{field:ju}}]),i.init){const e=i.project.items.map(Nc);t.values=i.project.hasSelectionId?i.init.map((t=>({unit:r,[ju]:Oc(t,!1)[0]}))):i.init.map((t=>({unit:r,fields:e,values:Oc(t,!1)})))}n.filter((t=>t.name===i.name+th)).length||n.push(t)}return n}(this,t)}assembleLayout(){return null}assembleLayoutSignals(){return Op(this)}assembleMarks(){let t=this.component.mark??[];return this.parent&&Pm(this.parent)||(t=Pc(this,t)),t.map(this.correctDataNames)}assembleGroupStyle(){const{style:t}=this.view||{};return void 0!==t?t:this.encoding.x||this.encoding.y?"cell":"view"}getMapping(){return this.encoding}get mark(){return this.markDef.type}channelHasField(t){return eu(this.encoding,t)}fieldDef(t){return Ns(this.encoding[t])}typedFieldDef(t){const e=this.fieldDef(t);return vs(e)?e:null}}class Ry extends Um{constructor(t,e,n,r,i){super(t,"layer",e,n,i,t.resolve,t.view);const o={...r,...t.width?{width:t.width}:{},...t.height?{height:t.height}:{}};this.children=t.layer.map(((t,e)=>{if(ml(t))return new Ry(t,this,this.getName(`layer_${e}`),o,i);if(Qs(t))return new zy(t,this,this.getName(`layer_${e}`),o,i);throw new Error(ii(t))}))}parseData(){this.component.data=hy(this);for(const t of this.children)t.parseData()}parseLayoutSize(){var t;ay(t=this),sy(t,"width"),sy(t,"height")}parseSelections(){this.component.selection={};for(const t of this.children){t.parseSelections();for(const e of Xt(t.component.selection))this.component.selection[e]=t.component.selection[e]}}parseMarkGroup(){for(const t of this.children)t.parseMarkGroup()}parseAxesAndHeaders(){!function(t){const{axes:e,resolve:n}=t.component,r={top:0,bottom:0,right:0,left:0};for(const i of t.children){i.parseAxesAndHeaders();for(const r of Xt(i.component.axes))n.axis[r]=Ip(t.component.resolve,r),"shared"===n.axis[r]&&(e[r]=vy(e[r],i.component.axes[r]),e[r]||(n.axis[r]="independent",delete e[r]))}for(const i of Xn){for(const o of t.children)if(o.component.axes[i]){if("independent"===n.axis[i]){e[i]=(e[i]??[]).concat(o.component.axes[i]);for(const t of o.component.axes[i]){const{value:e,explicit:n}=t.getWithExplicit("orient");if(!zr(e)){if(r[e]>0&&!n){const n=yy[e];r[e]>r[n]&&t.set("orient",n,!1)}r[e]++}}}delete o.component.axes[i]}if("independent"===n.axis[i]&&e[i]&&e[i].length>1)for(const[t,n]of(e[i]||[]).entries())t>0&&n.get("grid")&&!n.explicit.grid&&(n.implicit.grid=!1)}}(this)}assembleSelectionTopLevelSignals(t){return this.children.reduce(((t,e)=>e.assembleSelectionTopLevelSignals(t)),t)}assembleSignals(){return this.children.reduce(((t,e)=>t.concat(e.assembleSignals())),lp(this))}assembleLayoutSignals(){return this.children.reduce(((t,e)=>t.concat(e.assembleLayoutSignals())),Op(this))}assembleSelectionData(t){return this.children.reduce(((t,e)=>e.assembleSelectionData(t)),t)}assembleGroupStyle(){const t=new Set;for(const n of this.children)for(const e of st(n.assembleGroupStyle()))t.add(e);const e=Array.from(t);return e.length>1?e:1===e.length?e[0]:void 0}assembleTitle(){let t=super.assembleTitle();if(t)return t;for(const e of this.children)if(t=e.assembleTitle(),t)return t}assembleLayout(){return null}assembleMarks(){return function(t,e){for(const n of t.children)Om(n)&&(e=Pc(n,e));return e}(this,this.children.flatMap((t=>t.assembleMarks())))}assembleLegends(){return this.children.reduce(((t,e)=>t.concat(e.assembleLegends())),ag(this))}}function Py(t,e,n,r,i){if(es(t))return new cy(t,e,n,i);if(ml(t))return new Ry(t,e,n,r,i);if(Qs(t))return new zy(t,e,n,r,i);if(function(t){return Gu(t)||Vu(t)||Yu(t)}(t))return new dy(t,e,n,i);throw new Error(ii(t))}function Uy(t,e={}){var n;e.logger&&(n=e.logger,Ii=n),e.fieldTitle&&Ms(e.fieldTitle);try{const n=cl(it(e.config,t.config)),r=fc(t,n),i=Py(r,null,"",void 0,n);i.parse(),function(t,e){Qg(t.sources);let n=0,r=0;for(let i=0;i<Kg&&em(t,e,!0);i++)n++;t.sources.map(Vg);for(let i=0;i<Kg&&em(t,e,!1);i++)r++;Qg(t.sources),Math.max(n,r)===Kg&&Wi(`Maximum optimization runs(${Kg}) reached.`)}(i.component.data,i);const o=function(t,e,n={},r){const i=t.config?pl(t.config):void 0,o=[].concat(t.assembleSelectionData([]),function(t,e){const n=[],r=ey(n);let i=0;for(const a of t.sources){a.hasName()||(a.dataName="source_"+i++);const t=a.assemble();r(a,t)}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 e of a.transform??[])"lookup"===e.type&&(e.from=t.outputNodes[e.from].getSource());for(const a of n)a.name in e&&(a.values=e[a.name]);return n}(t.component.data,n)),a=t.assembleProjections(),s=t.assembleTitle(),u=t.assembleGroupStyle(),l=t.assembleGroupEncodeEntry(!0);let c=t.assembleLayoutSignals();c=c.filter((t=>"width"!==t.name&&"height"!==t.name||void 0===t.value||(e[t.name]=+t.value,!1)));const{params:f,...h}=e;return{$schema:"https://vega.github.io/schema/vega/v5.json",...t.description?{description:t.description}:{},...h,...s?{title:s}:{},...u?{style:u}:{},...l?{encode:{update:l}}:{},data:o,...a.length>0?{projections:a}:{},...t.assembleGroup([...c,...t.assembleSelectionTopLevelSignals([]),...Xu(f)]),...i?{config:i}:{},...r?{usermeta:r}:{}}}(i,function(t,e,n,r){const i=r.component.layoutSize.get("width"),o=r.component.layoutSize.get("height");void 0===e?(e={type:"pad"},r.hasAxisOrientSignalRef()&&(e.resize=!0)):dt(e)&&(e={type:e});if(i&&o&&(a=e.type,"fit"===a||"fit-x"===a||"fit-y"===a))if("step"===i&&"step"===o)Wi(ui()),e.type="pad";else if("step"===i||"step"===o){const t="step"===i?"width":"height";Wi(ui(Jn(t)));const n="width"===t?"height":"width";e.type=function(t){return t?`fit-${Jn(t)}`:"fit"}(n)}var a;return{...1===Xt(e).length&&e.type?"pad"===e.type?{}:{autosize:e.type}:{autosize:e},...yc(n,!1),...yc(t,!0)}}(t,r.autosize,n,i),t.datasets,t.usermeta);return{spec:o,normalized:r}}finally{e.logger&&qi(),e.fieldTitle&&Ms(Cs)}}const Ly="5.11.1";const jy=function(t){const[e,n]=/schema\/([\w-]+)\/([\w\.\-]+)\.json$/g.exec(t).slice(1,3);return{library:e,version:n}};var Iy="2.13.0";const qy="#fff",Wy="#888",Hy={background:"#333",view:{stroke:Wy},title:{color:qy,subtitleColor:qy},style:{"guide-label":{fill:qy},"guide-title":{fill:qy}},axis:{domainColor:qy,gridColor:Wy,tickColor:qy}},Xy="#4572a7",Yy={background:"#fff",arc:{fill:Xy},area:{fill:Xy},line:{stroke:Xy,strokeWidth:2},path:{stroke:Xy},rect:{fill:Xy},shape:{stroke:Xy},symbol:{fill:Xy,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"]}},Gy="#30a2da",Vy="#cbcbcb",Jy="#f0f0f0",Zy="#333",Ky={arc:{fill:Gy},area:{fill:Gy},axis:{domainColor:Vy,grid:!0,gridColor:Vy,gridWidth:1,labelColor:"#999",labelFontSize:10,titleColor:"#333",tickColor:Vy,tickSize:10,titleFontSize:14,titlePadding:10,labelPadding:4},axisBand:{grid:!1},background:Jy,group:{fill:Jy},legend:{labelColor:Zy,labelFontSize:11,padding:1,symbolSize:30,symbolType:"square",titleColor:Zy,titleFontSize:14,titlePadding:10},line:{stroke:Gy,strokeWidth:2},path:{stroke:Gy,strokeWidth:.5},rect:{fill:Gy},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:Gy},bar:{binSpacing:2,fill:Gy,stroke:null},title:{anchor:"start",fontSize:24,fontWeight:600,offset:20}},Qy="#000",tv={group:{fill:"#e5e5e5"},arc:{fill:Qy},area:{fill:Qy},line:{stroke:Qy},path:{stroke:Qy},rect:{fill:Qy},shape:{stroke:Qy},symbol:{fill:Qy,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"]}},ev="Benton Gothic, sans-serif",nv="#82c6df",rv="Benton Gothic Bold, sans-serif",iv="normal",ov={"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"]},av={background:"#ffffff",title:{anchor:"start",color:"#000000",font:rv,fontSize:22,fontWeight:"normal"},arc:{fill:nv},area:{fill:nv},line:{stroke:nv,strokeWidth:2},path:{stroke:nv},rect:{fill:nv},shape:{stroke:nv},symbol:{fill:nv,size:30},axis:{labelFont:ev,labelFontSize:11.5,labelFontWeight:"normal",titleFont:rv,titleFontSize:13,titleFontWeight:iv},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:ev,labelFontSize:11.5,symbolType:"square",titleFont:rv,titleFontSize:13,titleFontWeight:iv},range:{category:ov["category-6"],diverging:ov["fireandice-6"],heatmap:ov["fire-7"],ordinal:ov["fire-7"],ramp:ov["fire-7"]}},sv="#ab5787",uv="#979797",lv={background:"#f9f9f9",arc:{fill:sv},area:{fill:sv},line:{stroke:sv},path:{stroke:sv},rect:{fill:sv},shape:{stroke:sv},symbol:{fill:sv,size:30},axis:{domainColor:uv,domainWidth:.5,gridWidth:.2,labelColor:uv,tickColor:uv,tickWidth:.2,titleColor:uv},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"]}},cv="#3e5c69",fv={background:"#fff",arc:{fill:cv},area:{fill:cv},line:{stroke:cv},path:{stroke:cv},rect:{fill:cv},shape:{stroke:cv},symbol:{fill:cv},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"]}},hv="#1696d2",dv="#000000",pv="Lato",gv="Lato",mv={"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"]},yv={background:"#FFFFFF",title:{anchor:"start",fontSize:18,font:pv},axisX:{domain:!0,domainColor:dv,domainWidth:1,grid:!1,labelFontSize:12,labelFont:gv,labelAngle:0,tickColor:dv,tickSize:5,titleFontSize:12,titlePadding:10,titleFont:pv},axisY:{domain:!1,domainWidth:1,grid:!0,gridColor:"#DEDDDD",gridWidth:1,labelFontSize:12,labelFont:gv,labelPadding:8,ticks:!1,titleFontSize:12,titlePadding:10,titleFont:pv,titleAngle:0,titleY:-10,titleX:18},legend:{labelFontSize:12,labelFont:gv,symbolSize:100,titleFontSize:12,titlePadding:10,titleFont:pv,orient:"right",offset:10},view:{stroke:"transparent"},range:{category:mv["six-groups-cat-1"],diverging:mv["diverging-colors"],heatmap:mv["diverging-colors"],ordinal:mv["six-groups-seq"],ramp:mv["shades-blue"]},area:{fill:hv},rect:{fill:hv},line:{color:hv,stroke:hv,strokeWidth:5},trail:{color:hv,stroke:hv,strokeWidth:0,size:1},path:{stroke:hv,strokeWidth:.5},point:{filled:!0},text:{font:"Lato",color:hv,fontSize:11,align:"center",fontWeight:400,size:11},style:{bar:{fill:hv,stroke:null}},arc:{fill:hv},shape:{stroke:hv},symbol:{fill:hv,size:30}},vv="#3366CC",bv="#ccc",xv="Arial, sans-serif",_v={arc:{fill:vv},area:{fill:vv},path:{stroke:vv},rect:{fill:vv},shape:{stroke:vv},symbol:{stroke:vv},circle:{fill:vv},background:"#fff",padding:{top:10,right:10,bottom:10,left:10},style:{"guide-label":{font:xv,fontSize:12},"guide-title":{font:xv,fontSize:12},"group-title":{font:xv,fontSize:12}},title:{font:xv,fontSize:14,fontWeight:"bold",dy:-3,anchor:"start"},axis:{gridColor:bv,tickColor:bv,domain:!1,grid:!0},range:{category:["#4285F4","#DB4437","#F4B400","#0F9D58","#AB47BC","#00ACC1","#FF7043","#9E9D24","#5C6BC0","#F06292","#00796B","#C2185B"],heatmap:["#c6dafc","#5e97f6","#2a56c6"]}},wv=t=>t*(1/3+1),Av=wv(9),Dv=wv(10),Ev=wv(12),Fv="Segoe UI",Cv="wf_standard-font, helvetica, arial, sans-serif",kv="#252423",Mv="#605E5C",Sv="transparent",$v="#118DFF",Tv="#DEEFFF",Bv=[Tv,$v],Nv={view:{stroke:Sv},background:Sv,font:Fv,header:{titleFont:Cv,titleFontSize:Ev,titleColor:kv,labelFont:Fv,labelFontSize:Dv,labelColor:Mv},axis:{ticks:!1,grid:!1,domain:!1,labelColor:Mv,labelFontSize:Av,titleFont:Cv,titleColor:kv,titleFontSize:Ev,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:$v},line:{stroke:$v,strokeWidth:3,strokeCap:"round",strokeJoin:"round"},text:{font:Fv,fontSize:Av,fill:Mv},arc:{fill:$v},area:{fill:$v,line:!0,opacity:.6},path:{stroke:$v},rect:{fill:$v},point:{fill:$v,filled:!0,size:75},shape:{stroke:$v},symbol:{fill:$v,strokeWidth:1.5,size:50},legend:{titleFont:Fv,titleFontWeight:"bold",titleColor:Mv,labelFont:Fv,labelFontSize:Dv,labelColor:Mv,symbolType:"circle",symbolSize:75},range:{category:[$v,"#12239E","#E66C37","#6B007B","#E044A7","#744EC2","#D9B300","#D64550"],diverging:Bv,heatmap:Bv,ordinal:[Tv,"#c7e4ff","#b0d9ff","#9aceff","#83c3ff","#6cb9ff","#55aeff","#3fa3ff","#2898ff",$v]}},Ov=Iy;var zv=n(45528);function Rv(t){return Rv="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Rv(t)}function Pv(t){var e=function(t,e){if("object"!==Rv(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!==Rv(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===Rv(e)?e:String(e)}function Uv(t,e,n){return(e=Pv(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Lv(t,e){if(null==t)return{};var n,r,i=function(t,e){if(null==t)return{};var n,r,i={},o=Object.keys(t);for(r=0;r<o.length;r++)n=o[r],e.indexOf(n)>=0||(i[n]=t[n]);return i}(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(r=0;r<o.length;r++)n=o[r],e.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}const jv=["title","image"];function Iv(t,e){return JSON.stringify(t,function(t){const e=[];return function(n,r){if("object"!==typeof r||null===r)return r;const i=e.indexOf(this)+1;return e.length=i,e.length>t?"[Object]":e.indexOf(r)>=0?"[Circular]":(e.push(r),r)}}(e))}var qv="#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 Wv="vg-tooltip-element",Hv={offsetX:10,offsetY:10,id:Wv,styleId:"vega-tooltip-style",theme:"light",disableDefaultStyle:!1,sanitize:function(t){return String(t).replace(/&/g,"&").replace(/</g,"<")},maxDepth:2,formatTooltip:function(t,e,n){if((0,zv.kJ)(t))return`[${t.map((t=>e((0,zv.HD)(t)?t:Iv(t,n)))).join(", ")}]`;if((0,zv.Kn)(t)){let r="";const i=t,{title:o,image:a}=i,s=Lv(i,jv);o&&(r+=`<h2>${e(o)}</h2>`),a&&(r+=`<img src="${e(a)}">`);const u=Object.keys(s);if(u.length>0){r+="<table>";for(const t of u){let i=s[t];void 0!==i&&((0,zv.Kn)(i)&&(i=Iv(i,n)),r+=`<tr><td class="key">${e(t)}:</td><td class="value">${e(i)}</td></tr>`)}r+="</table>"}return r||"{}"}return e(t)}};function Xv(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Yv(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Xv(Object(n),!0).forEach((function(e){Uv(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Xv(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}class Gv{constructor(t){this.options=Yv(Yv({},Hv),t);const e=this.options.id;if(this.el=null,this.call=this.tooltipHandler.bind(this),!this.options.disableDefaultStyle&&!document.getElementById(this.options.styleId)){const t=document.createElement("style");t.setAttribute("id",this.options.styleId),t.innerHTML=function(t){if(!/^[A-Za-z]+[-:.\w]*$/.test(t))throw new Error("Invalid HTML ID");return qv.toString().replace(Wv,t)}(e);const n=document.head;n.childNodes.length>0?n.insertBefore(t,n.childNodes[0]):n.appendChild(t)}}tooltipHandler(t,e,n,r){if(this.el=document.getElementById(this.options.id),!this.el){this.el=document.createElement("div"),this.el.setAttribute("id",this.options.id),this.el.classList.add("vg-tooltip");(document.fullscreenElement??document.body).appendChild(this.el)}if(null==r||""===r)return void this.el.classList.remove("visible",`${this.options.theme}-theme`);this.el.innerHTML=this.options.formatTooltip(r,this.options.sanitize,this.options.maxDepth),this.el.classList.add("visible",`${this.options.theme}-theme`);const{x:i,y:o}=function(t,e,n,r){let i=t.clientX+n;i+e.width>window.innerWidth&&(i=+t.clientX-n-e.width);let o=t.clientY+r;return o+e.height>window.innerHeight&&(o=+t.clientY-r-e.height),{x:i,y:o}}(e,this.el.getBoundingClientRect(),this.options.offsetX,this.options.offsetY);this.el.style.top=`${o}px`,this.el.style.left=`${i}px`}}function Vv(t){return Vv="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Vv(t)}function Jv(t){var e=function(t,e){if("object"!==Vv(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!==Vv(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===Vv(e)?e:String(e)}function Zv(t,e,n){return(e=Jv(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Kv(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Qv,tb;var eb=nb;function nb(t){var e=this;if(e instanceof nb||(e=new nb),e.tail=null,e.head=null,e.length=0,t&&"function"===typeof t.forEach)t.forEach((function(t){e.push(t)}));else if(arguments.length>0)for(var n=0,r=arguments.length;n<r;n++)e.push(arguments[n]);return e}function rb(t,e,n){var r=e===t.head?new ab(n,null,e,t):new ab(n,e,e.next,t);return null===r.next&&(t.tail=r),null===r.prev&&(t.head=r),t.length++,r}function ib(t,e){t.tail=new ab(e,t.tail,null,t),t.head||(t.head=t.tail),t.length++}function ob(t,e){t.head=new ab(e,null,t.head,t),t.tail||(t.tail=t.head),t.length++}function ab(t,e,n,r){if(!(this instanceof ab))return new ab(t,e,n,r);this.list=r,this.value=t,e?(e.next=this,this.prev=e):this.prev=null,n?(n.prev=this,this.next=n):this.next=null}nb.Node=ab,nb.create=nb,nb.prototype.removeNode=function(t){if(t.list!==this)throw new Error("removing node which does not belong to this list");var e=t.next,n=t.prev;return e&&(e.prev=n),n&&(n.next=e),t===this.head&&(this.head=e),t===this.tail&&(this.tail=n),t.list.length--,t.next=null,t.prev=null,t.list=null,e},nb.prototype.unshiftNode=function(t){if(t!==this.head){t.list&&t.list.removeNode(t);var e=this.head;t.list=this,t.next=e,e&&(e.prev=t),this.head=t,this.tail||(this.tail=t),this.length++}},nb.prototype.pushNode=function(t){if(t!==this.tail){t.list&&t.list.removeNode(t);var e=this.tail;t.list=this,t.prev=e,e&&(e.next=t),this.tail=t,this.head||(this.head=t),this.length++}},nb.prototype.push=function(){for(var t=0,e=arguments.length;t<e;t++)ib(this,arguments[t]);return this.length},nb.prototype.unshift=function(){for(var t=0,e=arguments.length;t<e;t++)ob(this,arguments[t]);return this.length},nb.prototype.pop=function(){if(this.tail){var t=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,t}},nb.prototype.shift=function(){if(this.head){var t=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,t}},nb.prototype.forEach=function(t,e){e=e||this;for(var n=this.head,r=0;null!==n;r++)t.call(e,n.value,r,this),n=n.next},nb.prototype.forEachReverse=function(t,e){e=e||this;for(var n=this.tail,r=this.length-1;null!==n;r--)t.call(e,n.value,r,this),n=n.prev},nb.prototype.get=function(t){for(var e=0,n=this.head;null!==n&&e<t;e++)n=n.next;if(e===t&&null!==n)return n.value},nb.prototype.getReverse=function(t){for(var e=0,n=this.tail;null!==n&&e<t;e++)n=n.prev;if(e===t&&null!==n)return n.value},nb.prototype.map=function(t,e){e=e||this;for(var n=new nb,r=this.head;null!==r;)n.push(t.call(e,r.value,this)),r=r.next;return n},nb.prototype.mapReverse=function(t,e){e=e||this;for(var n=new nb,r=this.tail;null!==r;)n.push(t.call(e,r.value,this)),r=r.prev;return n},nb.prototype.reduce=function(t,e){var n,r=this.head;if(arguments.length>1)n=e;else{if(!this.head)throw new TypeError("Reduce of empty list with no initial value");r=this.head.next,n=this.head.value}for(var i=0;null!==r;i++)n=t(n,r.value,i),r=r.next;return n},nb.prototype.reduceReverse=function(t,e){var n,r=this.tail;if(arguments.length>1)n=e;else{if(!this.tail)throw new TypeError("Reduce of empty list with no initial value");r=this.tail.prev,n=this.tail.value}for(var i=this.length-1;null!==r;i--)n=t(n,r.value,i),r=r.prev;return n},nb.prototype.toArray=function(){for(var t=new Array(this.length),e=0,n=this.head;null!==n;e++)t[e]=n.value,n=n.next;return t},nb.prototype.toArrayReverse=function(){for(var t=new Array(this.length),e=0,n=this.tail;null!==n;e++)t[e]=n.value,n=n.prev;return t},nb.prototype.slice=function(t,e){(e=e||this.length)<0&&(e+=this.length),(t=t||0)<0&&(t+=this.length);var n=new nb;if(e<t||e<0)return n;t<0&&(t=0),e>this.length&&(e=this.length);for(var r=0,i=this.head;null!==i&&r<t;r++)i=i.next;for(;null!==i&&r<e;r++,i=i.next)n.push(i.value);return n},nb.prototype.sliceReverse=function(t,e){(e=e||this.length)<0&&(e+=this.length),(t=t||0)<0&&(t+=this.length);var n=new nb;if(e<t||e<0)return n;t<0&&(t=0),e>this.length&&(e=this.length);for(var r=this.length,i=this.tail;null!==i&&r>e;r--)i=i.prev;for(;null!==i&&r>t;r--,i=i.prev)n.push(i.value);return n},nb.prototype.splice=function(t,e,...n){t>this.length&&(t=this.length-1),t<0&&(t=this.length+t);for(var r=0,i=this.head;null!==i&&r<t;r++)i=i.next;var o=[];for(r=0;i&&r<e;r++)o.push(i.value),i=this.removeNode(i);null===i&&(i=this.tail),i!==this.head&&i!==this.tail&&(i=i.prev);for(r=0;r<n.length;r++)i=rb(this,i,n[r]);return o},nb.prototype.reverse=function(){for(var t=this.head,e=this.tail,n=t;null!==n;n=n.prev){var r=n.prev;n.prev=n.next,n.next=r}return this.head=e,this.tail=t,this};try{(tb||(tb=1,Qv=function(t){t.prototype[Symbol.iterator]=function*(){for(let t=this.head;t;t=t.next)yield t.value}}),Qv)(nb)}catch(Tx){}const sb=eb,ub=Symbol("max"),lb=Symbol("length"),cb=Symbol("lengthCalculator"),fb=Symbol("allowStale"),hb=Symbol("maxAge"),db=Symbol("dispose"),pb=Symbol("noDisposeOnSet"),gb=Symbol("lruList"),mb=Symbol("cache"),yb=Symbol("updateAgeOnGet"),vb=()=>1;const bb=(t,e,n)=>{const r=t[mb].get(e);if(r){const e=r.value;if(xb(t,e)){if(wb(t,r),!t[fb])return}else n&&(t[yb]&&(r.value.now=Date.now()),t[gb].unshiftNode(r));return e.value}},xb=(t,e)=>{if(!e||!e.maxAge&&!t[hb])return!1;const n=Date.now()-e.now;return e.maxAge?n>e.maxAge:t[hb]&&n>t[hb]},_b=t=>{if(t[lb]>t[ub])for(let e=t[gb].tail;t[lb]>t[ub]&&null!==e;){const n=e.prev;wb(t,e),e=n}},wb=(t,e)=>{if(e){const n=e.value;t[db]&&t[db](n.key,n.value),t[lb]-=n.length,t[mb].delete(n.key),t[gb].removeNode(e)}};class Ab{constructor(t,e,n,r,i){this.key=t,this.value=e,this.length=n,this.now=r,this.maxAge=i||0}}const Db=(t,e,n,r)=>{let i=n.value;xb(t,i)&&(wb(t,n),t[fb]||(i=void 0)),i&&e.call(r,i.value,i.key,t)};var Eb=class{constructor(t){if("number"===typeof t&&(t={max:t}),t||(t={}),t.max&&("number"!==typeof t.max||t.max<0))throw new TypeError("max must be a non-negative number");this[ub]=t.max||1/0;const e=t.length||vb;if(this[cb]="function"!==typeof e?vb:e,this[fb]=t.stale||!1,t.maxAge&&"number"!==typeof t.maxAge)throw new TypeError("maxAge must be a number");this[hb]=t.maxAge||0,this[db]=t.dispose,this[pb]=t.noDisposeOnSet||!1,this[yb]=t.updateAgeOnGet||!1,this.reset()}set max(t){if("number"!==typeof t||t<0)throw new TypeError("max must be a non-negative number");this[ub]=t||1/0,_b(this)}get max(){return this[ub]}set allowStale(t){this[fb]=!!t}get allowStale(){return this[fb]}set maxAge(t){if("number"!==typeof t)throw new TypeError("maxAge must be a non-negative number");this[hb]=t,_b(this)}get maxAge(){return this[hb]}set lengthCalculator(t){"function"!==typeof t&&(t=vb),t!==this[cb]&&(this[cb]=t,this[lb]=0,this[gb].forEach((t=>{t.length=this[cb](t.value,t.key),this[lb]+=t.length}))),_b(this)}get lengthCalculator(){return this[cb]}get length(){return this[lb]}get itemCount(){return this[gb].length}rforEach(t,e){e=e||this;for(let n=this[gb].tail;null!==n;){const r=n.prev;Db(this,t,n,e),n=r}}forEach(t,e){e=e||this;for(let n=this[gb].head;null!==n;){const r=n.next;Db(this,t,n,e),n=r}}keys(){return this[gb].toArray().map((t=>t.key))}values(){return this[gb].toArray().map((t=>t.value))}reset(){this[db]&&this[gb]&&this[gb].length&&this[gb].forEach((t=>this[db](t.key,t.value))),this[mb]=new Map,this[gb]=new sb,this[lb]=0}dump(){return this[gb].map((t=>!xb(this,t)&&{k:t.key,v:t.value,e:t.now+(t.maxAge||0)})).toArray().filter((t=>t))}dumpLru(){return this[gb]}set(t,e,n){if((n=n||this[hb])&&"number"!==typeof n)throw new TypeError("maxAge must be a number");const r=n?Date.now():0,i=this[cb](e,t);if(this[mb].has(t)){if(i>this[ub])return wb(this,this[mb].get(t)),!1;const o=this[mb].get(t).value;return this[db]&&(this[pb]||this[db](t,o.value)),o.now=r,o.maxAge=n,o.value=e,this[lb]+=i-o.length,o.length=i,this.get(t),_b(this),!0}const o=new Ab(t,e,i,r,n);return o.length>this[ub]?(this[db]&&this[db](t,e),!1):(this[lb]+=o.length,this[gb].unshift(o),this[mb].set(t,this[gb].head),_b(this),!0)}has(t){if(!this[mb].has(t))return!1;const e=this[mb].get(t).value;return!xb(this,e)}get(t){return bb(this,t,!0)}peek(t){return bb(this,t,!1)}pop(){const t=this[gb].tail;return t?(wb(this,t),t.value):null}del(t){wb(this,this[mb].get(t))}load(t){this.reset();const e=Date.now();for(let n=t.length-1;n>=0;n--){const r=t[n],i=r.e||0;if(0===i)this.set(r.k,r.v);else{const t=i-e;t>0&&this.set(r.k,r.v,t)}}}prune(){this[mb].forEach(((t,e)=>bb(this,e,!1)))}};const Fb=Object.freeze({loose:!0}),Cb=Object.freeze({});var kb=t=>t?"object"!==typeof t?Fb:t:Cb,Mb={exports:{}};var Sb={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,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 $b="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)?(...t)=>console.error("SEMVER",...t):()=>{};!function(t,e){const{MAX_SAFE_COMPONENT_LENGTH:n}=Sb,r=$b,i=(e=t.exports={}).re=[],o=e.src=[],a=e.t={};let s=0;const u=(t,e,n)=>{const u=s++;r(t,u,e),a[t]=u,o[u]=e,i[u]=new RegExp(e,n?"g":void 0)};u("NUMERICIDENTIFIER","0|[1-9]\\d*"),u("NUMERICIDENTIFIERLOOSE","[0-9]+"),u("NONNUMERICIDENTIFIER","\\d*[a-zA-Z-][a-zA-Z0-9-]*"),u("MAINVERSION",`(${o[a.NUMERICIDENTIFIER]})\\.(${o[a.NUMERICIDENTIFIER]})\\.(${o[a.NUMERICIDENTIFIER]})`),u("MAINVERSIONLOOSE",`(${o[a.NUMERICIDENTIFIERLOOSE]})\\.(${o[a.NUMERICIDENTIFIERLOOSE]})\\.(${o[a.NUMERICIDENTIFIERLOOSE]})`),u("PRERELEASEIDENTIFIER",`(?:${o[a.NUMERICIDENTIFIER]}|${o[a.NONNUMERICIDENTIFIER]})`),u("PRERELEASEIDENTIFIERLOOSE",`(?:${o[a.NUMERICIDENTIFIERLOOSE]}|${o[a.NONNUMERICIDENTIFIER]})`),u("PRERELEASE",`(?:-(${o[a.PRERELEASEIDENTIFIER]}(?:\\.${o[a.PRERELEASEIDENTIFIER]})*))`),u("PRERELEASELOOSE",`(?:-?(${o[a.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${o[a.PRERELEASEIDENTIFIERLOOSE]})*))`),u("BUILDIDENTIFIER","[0-9A-Za-z-]+"),u("BUILD",`(?:\\+(${o[a.BUILDIDENTIFIER]}(?:\\.${o[a.BUILDIDENTIFIER]})*))`),u("FULLPLAIN",`v?${o[a.MAINVERSION]}${o[a.PRERELEASE]}?${o[a.BUILD]}?`),u("FULL",`^${o[a.FULLPLAIN]}$`),u("LOOSEPLAIN",`[v=\\s]*${o[a.MAINVERSIONLOOSE]}${o[a.PRERELEASELOOSE]}?${o[a.BUILD]}?`),u("LOOSE",`^${o[a.LOOSEPLAIN]}$`),u("GTLT","((?:<|>)?=?)"),u("XRANGEIDENTIFIERLOOSE",`${o[a.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),u("XRANGEIDENTIFIER",`${o[a.NUMERICIDENTIFIER]}|x|X|\\*`),u("XRANGEPLAIN",`[v=\\s]*(${o[a.XRANGEIDENTIFIER]})(?:\\.(${o[a.XRANGEIDENTIFIER]})(?:\\.(${o[a.XRANGEIDENTIFIER]})(?:${o[a.PRERELEASE]})?${o[a.BUILD]}?)?)?`),u("XRANGEPLAINLOOSE",`[v=\\s]*(${o[a.XRANGEIDENTIFIERLOOSE]})(?:\\.(${o[a.XRANGEIDENTIFIERLOOSE]})(?:\\.(${o[a.XRANGEIDENTIFIERLOOSE]})(?:${o[a.PRERELEASELOOSE]})?${o[a.BUILD]}?)?)?`),u("XRANGE",`^${o[a.GTLT]}\\s*${o[a.XRANGEPLAIN]}$`),u("XRANGELOOSE",`^${o[a.GTLT]}\\s*${o[a.XRANGEPLAINLOOSE]}$`),u("COERCE",`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?(?:$|[^\\d])`),u("COERCERTL",o[a.COERCE],!0),u("LONETILDE","(?:~>?)"),u("TILDETRIM",`(\\s*)${o[a.LONETILDE]}\\s+`,!0),e.tildeTrimReplace="$1~",u("TILDE",`^${o[a.LONETILDE]}${o[a.XRANGEPLAIN]}$`),u("TILDELOOSE",`^${o[a.LONETILDE]}${o[a.XRANGEPLAINLOOSE]}$`),u("LONECARET","(?:\\^)"),u("CARETTRIM",`(\\s*)${o[a.LONECARET]}\\s+`,!0),e.caretTrimReplace="$1^",u("CARET",`^${o[a.LONECARET]}${o[a.XRANGEPLAIN]}$`),u("CARETLOOSE",`^${o[a.LONECARET]}${o[a.XRANGEPLAINLOOSE]}$`),u("COMPARATORLOOSE",`^${o[a.GTLT]}\\s*(${o[a.LOOSEPLAIN]})$|^$`),u("COMPARATOR",`^${o[a.GTLT]}\\s*(${o[a.FULLPLAIN]})$|^$`),u("COMPARATORTRIM",`(\\s*)${o[a.GTLT]}\\s*(${o[a.LOOSEPLAIN]}|${o[a.XRANGEPLAIN]})`,!0),e.comparatorTrimReplace="$1$2$3",u("HYPHENRANGE",`^\\s*(${o[a.XRANGEPLAIN]})\\s+-\\s+(${o[a.XRANGEPLAIN]})\\s*$`),u("HYPHENRANGELOOSE",`^\\s*(${o[a.XRANGEPLAINLOOSE]})\\s+-\\s+(${o[a.XRANGEPLAINLOOSE]})\\s*$`),u("STAR","(<|>)?=?\\s*\\*"),u("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),u("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")}(Mb,Mb.exports);var Tb=Mb.exports;const Bb=/^[0-9]+$/,Nb=(t,e)=>{const n=Bb.test(t),r=Bb.test(e);return n&&r&&(t=+t,e=+e),t===e?0:n&&!r?-1:r&&!n?1:t<e?-1:1};var Ob={compareIdentifiers:Nb,rcompareIdentifiers:(t,e)=>Nb(e,t)};const zb=$b,{MAX_LENGTH:Rb,MAX_SAFE_INTEGER:Pb}=Sb,{re:Ub,t:Lb}=Tb,jb=kb,{compareIdentifiers:Ib}=Ob;var qb=class t{constructor(e,n){if(n=jb(n),e instanceof t){if(e.loose===!!n.loose&&e.includePrerelease===!!n.includePrerelease)return e;e=e.version}else if("string"!==typeof e)throw new TypeError(`Invalid Version: ${e}`);if(e.length>Rb)throw new TypeError(`version is longer than ${Rb} characters`);zb("SemVer",e,n),this.options=n,this.loose=!!n.loose,this.includePrerelease=!!n.includePrerelease;const r=e.trim().match(n.loose?Ub[Lb.LOOSE]:Ub[Lb.FULL]);if(!r)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>Pb||this.major<0)throw new TypeError("Invalid major version");if(this.minor>Pb||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>Pb||this.patch<0)throw new TypeError("Invalid patch version");r[4]?this.prerelease=r[4].split(".").map((t=>{if(/^[0-9]+$/.test(t)){const e=+t;if(e>=0&&e<Pb)return e}return t})):this.prerelease=[],this.build=r[5]?r[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(e){if(zb("SemVer.compare",this.version,this.options,e),!(e instanceof t)){if("string"===typeof e&&e===this.version)return 0;e=new t(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof t||(e=new t(e,this.options)),Ib(this.major,e.major)||Ib(this.minor,e.minor)||Ib(this.patch,e.patch)}comparePre(e){if(e instanceof t||(e=new t(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let n=0;do{const t=this.prerelease[n],r=e.prerelease[n];if(zb("prerelease compare",n,t,r),void 0===t&&void 0===r)return 0;if(void 0===r)return 1;if(void 0===t)return-1;if(t!==r)return Ib(t,r)}while(++n)}compareBuild(e){e instanceof t||(e=new t(e,this.options));let n=0;do{const t=this.build[n],r=e.build[n];if(zb("prerelease compare",n,t,r),void 0===t&&void 0===r)return 0;if(void 0===r)return 1;if(void 0===t)return-1;if(t!==r)return Ib(t,r)}while(++n)}inc(t,e,n){switch(t){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",e,n);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",e,n);break;case"prepatch":this.prerelease.length=0,this.inc("patch",e,n),this.inc("pre",e,n);break;case"prerelease":0===this.prerelease.length&&this.inc("patch",e,n),this.inc("pre",e,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":if(0===this.prerelease.length)this.prerelease=[0];else{let t=this.prerelease.length;for(;--t>=0;)"number"===typeof this.prerelease[t]&&(this.prerelease[t]++,t=-2);-1===t&&this.prerelease.push(0)}if(e){const t=Number(n)?1:0;0===Ib(this.prerelease[0],e)?isNaN(this.prerelease[1])&&(this.prerelease=[e,t]):this.prerelease=[e,t]}break;default:throw new Error(`invalid increment argument: ${t}`)}return this.format(),this.raw=this.version,this}};const Wb=qb;var Hb=(t,e,n)=>new Wb(t,n).compare(new Wb(e,n));const Xb=Hb;const Yb=Hb;const Gb=Hb;const Vb=Hb;const Jb=Hb;const Zb=Hb;const Kb=(t,e,n)=>0===Xb(t,e,n),Qb=(t,e,n)=>0!==Yb(t,e,n),tx=(t,e,n)=>Gb(t,e,n)>0,ex=(t,e,n)=>Vb(t,e,n)>=0,nx=(t,e,n)=>Jb(t,e,n)<0,rx=(t,e,n)=>Zb(t,e,n)<=0;var ix,ox,ax,sx,ux=(t,e,n,r)=>{switch(e){case"===":return"object"===typeof t&&(t=t.version),"object"===typeof n&&(n=n.version),t===n;case"!==":return"object"===typeof t&&(t=t.version),"object"===typeof n&&(n=n.version),t!==n;case"":case"=":case"==":return Kb(t,n,r);case"!=":return Qb(t,n,r);case">":return tx(t,n,r);case">=":return ex(t,n,r);case"<":return nx(t,n,r);case"<=":return rx(t,n,r);default:throw new TypeError(`Invalid operator: ${e}`)}};function lx(){if(sx)return ax;sx=1;class t{constructor(e,i){if(i=n(i),e instanceof t)return e.loose===!!i.loose&&e.includePrerelease===!!i.includePrerelease?e:new t(e.raw,i);if(e instanceof r)return this.raw=e.value,this.set=[[e]],this.format(),this;if(this.options=i,this.loose=!!i.loose,this.includePrerelease=!!i.includePrerelease,this.raw=e,this.set=e.split("||").map((t=>this.parseRange(t.trim()))).filter((t=>t.length)),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${e}`);if(this.set.length>1){const t=this.set[0];if(this.set=this.set.filter((t=>!d(t[0]))),0===this.set.length)this.set=[t];else if(this.set.length>1)for(const e of this.set)if(1===e.length&&p(e[0])){this.set=[e];break}}this.format()}format(){return this.range=this.set.map((t=>t.join(" ").trim())).join("||").trim(),this.range}toString(){return this.range}parseRange(t){t=t.trim();const n=((this.options.includePrerelease&&f)|(this.options.loose&&h))+":"+t,o=e.get(n);if(o)return o;const p=this.options.loose,g=p?a[s.HYPHENRANGELOOSE]:a[s.HYPHENRANGE];t=t.replace(g,F(this.options.includePrerelease)),i("hyphen replace",t),t=t.replace(a[s.COMPARATORTRIM],u),i("comparator trim",t);let y=(t=(t=(t=t.replace(a[s.TILDETRIM],l)).replace(a[s.CARETTRIM],c)).split(/\s+/).join(" ")).split(" ").map((t=>m(t,this.options))).join(" ").split(/\s+/).map((t=>E(t,this.options)));p&&(y=y.filter((t=>(i("loose invalid filter",t,this.options),!!t.match(a[s.COMPARATORLOOSE]))))),i("range list",y);const v=new Map,b=y.map((t=>new r(t,this.options)));for(const e of b){if(d(e))return[e];v.set(e.value,e)}v.size>1&&v.has("")&&v.delete("");const x=[...v.values()];return e.set(n,x),x}intersects(e,n){if(!(e instanceof t))throw new TypeError("a Range is required");return this.set.some((t=>g(t,n)&&e.set.some((e=>g(e,n)&&t.every((t=>e.every((e=>t.intersects(e,n)))))))))}test(t){if(!t)return!1;if("string"===typeof t)try{t=new o(t,this.options)}catch(Tx){return!1}for(let e=0;e<this.set.length;e++)if(C(this.set[e],t,this.options))return!0;return!1}}ax=t;const e=new Eb({max:1e3}),n=kb,r=function(){if(ox)return ix;ox=1;const t=Symbol("SemVer ANY");class e{static get ANY(){return t}constructor(r,i){if(i=n(i),r instanceof e){if(r.loose===!!i.loose)return r;r=r.value}a("comparator",r,i),this.options=i,this.loose=!!i.loose,this.parse(r),this.semver===t?this.value="":this.value=this.operator+this.semver.version,a("comp",this)}parse(e){const n=this.options.loose?r[i.COMPARATORLOOSE]:r[i.COMPARATOR],o=e.match(n);if(!o)throw new TypeError(`Invalid comparator: ${e}`);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=t}toString(){return this.value}test(e){if(a("Comparator.test",e,this.options.loose),this.semver===t||e===t)return!0;if("string"===typeof e)try{e=new s(e,this.options)}catch(Tx){return!1}return o(e,this.operator,this.semver,this.options)}intersects(t,r){if(!(t instanceof e))throw new TypeError("a Comparator is required");return""===this.operator?""===this.value||new u(t.value,r).test(this.value):""===t.operator?""===t.value||new u(this.value,r).test(t.semver):(!(r=n(r)).includePrerelease||"<0.0.0-0"!==this.value&&"<0.0.0-0"!==t.value)&&!(!r.includePrerelease&&(this.value.startsWith("<0.0.0")||t.value.startsWith("<0.0.0")))&&(!(!this.operator.startsWith(">")||!t.operator.startsWith(">"))||!(!this.operator.startsWith("<")||!t.operator.startsWith("<"))||!(this.semver.version!==t.semver.version||!this.operator.includes("=")||!t.operator.includes("="))||!!(o(this.semver,"<",t.semver,r)&&this.operator.startsWith(">")&&t.operator.startsWith("<"))||!!(o(this.semver,">",t.semver,r)&&this.operator.startsWith("<")&&t.operator.startsWith(">")))}}ix=e;const n=kb,{re:r,t:i}=Tb,o=ux,a=$b,s=qb,u=lx();return ix}(),i=$b,o=qb,{re:a,t:s,comparatorTrimReplace:u,tildeTrimReplace:l,caretTrimReplace:c}=Tb,{FLAG_INCLUDE_PRERELEASE:f,FLAG_LOOSE:h}=Sb,d=t=>"<0.0.0-0"===t.value,p=t=>""===t.value,g=(t,e)=>{let n=!0;const r=t.slice();let i=r.pop();for(;n&&r.length;)n=r.every((t=>i.intersects(t,e))),i=r.pop();return n},m=(t,e)=>(i("comp",t,e),t=x(t,e),i("caret",t),t=v(t,e),i("tildes",t),t=w(t,e),i("xrange",t),t=D(t,e),i("stars",t),t),y=t=>!t||"x"===t.toLowerCase()||"*"===t,v=(t,e)=>t.trim().split(/\s+/).map((t=>b(t,e))).join(" "),b=(t,e)=>{const n=e.loose?a[s.TILDELOOSE]:a[s.TILDE];return t.replace(n,((e,n,r,o,a)=>{let s;return i("tilde",t,e,n,r,o,a),y(n)?s="":y(r)?s=`>=${n}.0.0 <${+n+1}.0.0-0`:y(o)?s=`>=${n}.${r}.0 <${n}.${+r+1}.0-0`:a?(i("replaceTilde pr",a),s=`>=${n}.${r}.${o}-${a} <${n}.${+r+1}.0-0`):s=`>=${n}.${r}.${o} <${n}.${+r+1}.0-0`,i("tilde return",s),s}))},x=(t,e)=>t.trim().split(/\s+/).map((t=>_(t,e))).join(" "),_=(t,e)=>{i("caret",t,e);const n=e.loose?a[s.CARETLOOSE]:a[s.CARET],r=e.includePrerelease?"-0":"";return t.replace(n,((e,n,o,a,s)=>{let u;return i("caret",t,e,n,o,a,s),y(n)?u="":y(o)?u=`>=${n}.0.0${r} <${+n+1}.0.0-0`:y(a)?u="0"===n?`>=${n}.${o}.0${r} <${n}.${+o+1}.0-0`:`>=${n}.${o}.0${r} <${+n+1}.0.0-0`:s?(i("replaceCaret pr",s),u="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`):(i("no pr"),u="0"===n?"0"===o?`>=${n}.${o}.${a}${r} <${n}.${o}.${+a+1}-0`:`>=${n}.${o}.${a}${r} <${n}.${+o+1}.0-0`:`>=${n}.${o}.${a} <${+n+1}.0.0-0`),i("caret return",u),u}))},w=(t,e)=>(i("replaceXRanges",t,e),t.split(/\s+/).map((t=>A(t,e))).join(" ")),A=(t,e)=>{t=t.trim();const n=e.loose?a[s.XRANGELOOSE]:a[s.XRANGE];return t.replace(n,((n,r,o,a,s,u)=>{i("xRange",t,n,r,o,a,s,u);const l=y(o),c=l||y(a),f=c||y(s),h=f;return"="===r&&h&&(r=""),u=e.includePrerelease?"-0":"",l?n=">"===r||"<"===r?"<0.0.0-0":"*":r&&h?(c&&(a=0),s=0,">"===r?(r=">=",c?(o=+o+1,a=0,s=0):(a=+a+1,s=0)):"<="===r&&(r="<",c?o=+o+1:a=+a+1),"<"===r&&(u="-0"),n=`${r+o}.${a}.${s}${u}`):c?n=`>=${o}.0.0${u} <${+o+1}.0.0-0`:f&&(n=`>=${o}.${a}.0${u} <${o}.${+a+1}.0-0`),i("xRange return",n),n}))},D=(t,e)=>(i("replaceStars",t,e),t.trim().replace(a[s.STAR],"")),E=(t,e)=>(i("replaceGTE0",t,e),t.trim().replace(a[e.includePrerelease?s.GTE0PRE:s.GTE0],"")),F=t=>(e,n,r,i,o,a,s,u,l,c,f,h,d)=>`${n=y(r)?"":y(i)?`>=${r}.0.0${t?"-0":""}`:y(o)?`>=${r}.${i}.0${t?"-0":""}`:a?`>=${n}`:`>=${n}${t?"-0":""}`} ${u=y(l)?"":y(c)?`<${+l+1}.0.0-0`:y(f)?`<${l}.${+c+1}.0-0`:h?`<=${l}.${c}.${f}-${h}`:t?`<${l}.${c}.${+f+1}-0`:`<=${u}`}`.trim(),C=(t,e,n)=>{for(let r=0;r<t.length;r++)if(!t[r].test(e))return!1;if(e.prerelease.length&&!n.includePrerelease){for(let n=0;n<t.length;n++)if(i(t[n].semver),t[n].semver!==r.ANY&&t[n].semver.prerelease.length>0){const r=t[n].semver;if(r.major===e.major&&r.minor===e.minor&&r.patch===e.patch)return!0}return!1}return!0};return ax}const cx=lx();var fx=(t,e,n)=>{try{e=new cx(e,n)}catch(Tx){return!1}return e.test(t)},hx=Kv(fx);var dx='.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 px(t,...e){for(const n of e)gx(t,n);return t}function gx(t,e){for(const n of Object.keys(e))(0,U.writeConfig)(t,n,e[n],!0)}function mx(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function yx(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?mx(Object(n),!0).forEach((function(e){Zv(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):mx(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}const vx=U;let bx=o;const xx="undefined"!==typeof window?window:void 0;void 0===bx&&xx?.vl?.compile&&(bx=xx.vl);const _x={export:{svg:!0,png:!0},source:!0,compiled:!0,editor:!0},wx={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"},Ax={vega:"Vega","vega-lite":"Vega-Lite"},Dx={vega:vx.version,"vega-lite":bx?bx.version:"not available"},Ex={vega:t=>t,"vega-lite":(t,e)=>bx.compile(t,{config:e}).spec},Fx='\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>',Cx="chart-wrapper";function kx(t,e,n,r){const i=`<html><head>${e}</head><body><pre><code class="json">`,o=`</code></pre>${n}</body></html>`,a=window.open("");a.document.write(i+t+o),a.document.title=`${Ax[r]} JSON Source`}function Mx(t){return(e=t)&&"load"in e?t:vx.loader(t);var e}async function Sx(t,e,n={}){let r,i;(0,U.isString)(e)?(i=Mx(n.loader),r=JSON.parse(await i.load(e))):r=e;const o=function(t){const e=t.usermeta?.embedOptions??{};return(0,U.isString)(e.defaultStyle)&&(e.defaultStyle=!1),e}(r),s=o.loader;i&&!s||(i=Mx(n.loader??s));const u=await $x(o,i),l=await $x(n,i),c=yx(yx({},px(l,u)),{},{config:(0,U.mergeConfig)(l.config??{},u.config??{})});return await async function(t,e,n={},r){const i=n.theme?(0,U.mergeConfig)(a[n.theme],n.config??{}):n.config,o=(0,U.isBoolean)(n.actions)?n.actions:px({},_x,n.actions??{}),s=yx(yx({},wx),n.i18n),u=n.renderer??"canvas",l=n.logLevel??vx.Warn,c=n.downloadFileName??"visualization",f="string"===typeof t?document.querySelector(t):t;if(!f)throw new Error(`${t} does not exist`);if(!1!==n.defaultStyle){const t="vega-embed-style",{root:e,rootContainer:r}=function(t){const e=t.getRootNode?t.getRootNode():document;return e instanceof ShadowRoot?{root:e,rootContainer:e}:{root:document,rootContainer:document.head??document.body}}(f);if(!e.getElementById(t)){const e=document.createElement("style");e.id=t,e.innerHTML=void 0===n.defaultStyle||!0===n.defaultStyle?dx.toString():n.defaultStyle,r.appendChild(e)}}const h=function(t,e){if(t.$schema){const n=jy(t.$schema);e&&e!==n.library&&console.warn(`The given visualization spec is written in ${Ax[n.library]}, but mode argument sets ${Ax[e]??e}.`);const r=n.library;return hx(Dx[r],`^${n.version.slice(1)}`)||console.warn(`The input spec uses ${Ax[r]} ${n.version}, but the current version of ${Ax[r]} is v${Dx[r]}.`),r}return"mark"in t||"encoding"in t||"layer"in t||"hconcat"in t||"vconcat"in t||"facet"in t||"repeat"in t?"vega-lite":"marks"in t||"signals"in t||"scales"in t||"axes"in t?"vega":e??"vega"}(e,n.mode);let d=Ex[h](e,i);if("vega-lite"===h&&d.$schema){const t=jy(d.$schema);hx(Dx.vega,`^${t.version.slice(1)}`)||console.warn(`The compiled spec uses Vega ${t.version}, but current version is v${Dx.vega}.`)}f.classList.add("vega-embed"),o&&f.classList.add("has-actions");f.innerHTML="";let p=f;if(o){const t=document.createElement("div");t.classList.add(Cx),f.appendChild(t),p=t}const g=n.patch;g&&(d=g instanceof Function?g(d):D(d,g,!0,!1).newDocument);n.formatLocale&&vx.formatLocale(n.formatLocale);n.timeFormatLocale&&vx.timeFormatLocale(n.timeFormatLocale);if(n.expressionFunctions)for(const a in n.expressionFunctions){const t=n.expressionFunctions[a];"fn"in t?vx.expressionFunction(a,t.fn,t.visitor):t instanceof Function&&vx.expressionFunction(a,t)}const{ast:m}=n,y=vx.parse(d,"vega-lite"===h?{}:i,{ast:m}),v=new(n.viewClass||vx.View)(y,yx({loader:r,logLevel:l,renderer:u},m?{expr:vx.expressionInterpreter??n.expr??L.N}:{}));if(v.addSignalListener("autosize",((t,e)=>{const{type:n}=e;"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 t="function"===typeof n.tooltip?n.tooltip:new Gv(!0===n.tooltip?{}:n.tooltip).call;v.tooltip(t)}let b,{hover:x}=n;void 0===x&&(x="vega"===h);if(x){const{hoverSet:t,updateSet:e}="boolean"===typeof x?{}:x;v.hover(t,e)}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 t=f;if(!1!==n.defaultStyle){const e=document.createElement("details");e.title=s.CLICK_TO_VIEW_ACTIONS,f.append(e),t=e;const n=document.createElement("summary");n.innerHTML=Fx,e.append(n),b=t=>{e.contains(t.target)||e.removeAttribute("open")},document.addEventListener("click",b)}const r=document.createElement("div");if(t.append(r),r.classList.add("vega-actions"),!0===o||!1!==o.export)for(const e of["svg","png"])if(!0===o||!0===o.export||o.export[e]){const t=s[`${e.toUpperCase()}_ACTION`],i=document.createElement("a"),o=(0,U.isObject)(n.scaleFactor)?n.scaleFactor[e]:n.scaleFactor;i.text=t,i.href="#",i.target="_blank",i.download=`${c}.${e}`,i.addEventListener("mousedown",(async function(t){t.preventDefault();const n=await v.toImageURL(e,o);this.href=n})),r.append(i)}if(!0===o||!1!==o.source){const t=document.createElement("a");t.text=s.SOURCE_ACTION,t.href="#",t.addEventListener("click",(function(t){kx(P()(e),n.sourceHeader??"",n.sourceFooter??"",h),t.preventDefault()})),r.append(t)}if("vega-lite"===h&&(!0===o||!1!==o.compiled)){const t=document.createElement("a");t.text=s.COMPILED_ACTION,t.href="#",t.addEventListener("click",(function(t){kx(P()(d),n.sourceHeader??"",n.sourceFooter??"","vega"),t.preventDefault()})),r.append(t)}if(!0===o||!1!==o.editor){const t=n.editorUrl??"https://vega.github.io/editor/",o=document.createElement("a");o.text=s.EDITOR_ACTION,o.href="#",o.addEventListener("click",(function(n){!function(t,e,n){const r=t.open(e),i=250,{origin:o}=new URL(e);let a=~~(1e4/i);t.addEventListener("message",(function e(n){n.source===r&&(a=0,t.removeEventListener("message",e,!1))}),!1),setTimeout((function t(){a<=0||(r.postMessage(n,o),setTimeout(t,i),a-=1)}),i)}(window,t,{config:i,mode:h,renderer:u,spec:P()(e)}),n.preventDefault()})),r.append(o)}}function _(){b&&document.removeEventListener("click",b),v.finalize()}return{view:v,spec:e,vgSpec:d,finalize:_,embedOptions:n}}(t,r,c,i)}async function $x(t,e){const n=(0,U.isString)(t.config)?JSON.parse(await e.load(t.config)):t.config??{},r=(0,U.isString)(t.patch)?JSON.parse(await e.load(t.patch)):t.patch;return yx(yx(yx({},t),r?{patch:r}:{}),n?{config:n}:{})}},52847:(t,e,n)=>{"use strict";n.d(e,{r:()=>m});const r="view",i="[",o="]",a="{",s="}",u=":",l=",",c="@",f=">",h=/[[\]{}]/,d={"*":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,g;function m(t,e,n){return p=e||r,g=n||d,v(t.trim()).map(b)}function y(t,e,n,r,i){const o=t.length;let a,s=0;for(;e<o;++e){if(a=t[e],!s&&a===n)return e;i&&i.indexOf(a)>=0?--s:r&&r.indexOf(a)>=0&&++s}return e}function v(t){const e=[],n=t.length;let r=0,u=0;for(;u<n;)u=y(t,u,l,i+a,o+s),e.push(t.substring(r,u).trim()),r=++u;if(0===e.length)throw"Empty event selector: "+t;return e}function b(t){return"["===t[0]?function(t){const e=t.length;let n,r=1;if(r=y(t,r,o,i,o),r===e)throw"Empty between selector: "+t;if(n=v(t.substring(1,r)),2!==n.length)throw"Between selector must have two elements: "+t;if(t=t.slice(r+1).trim(),t[0]!==f)throw"Expected '>' after between selector: "+t;n=n.map(b);const a=b(t.slice(1).trim());if(a.between)return{between:n,stream:a};a.between=n;return a}(t):function(t){const e={source:p},n=[];let r,f,d=[0,0],m=0,v=0,b=t.length,x=0;if(t[b-1]===s){if(x=t.lastIndexOf(a),!(x>=0))throw"Unmatched right brace: "+t;try{d=function(t){const e=t.split(l);if(!t.length||e.length>2)throw t;return e.map((e=>{const n=+e;if(n!==n)throw t;return n}))}(t.substring(x+1,b-1))}catch(w){throw"Invalid throttle specification: "+t}b=(t=t.slice(0,x).trim()).length,x=0}if(!b)throw t;t[0]===c&&(m=++x);r=y(t,x,u),r<b&&(n.push(t.substring(v,r).trim()),v=x=++r);if(x=y(t,x,i),x===b)n.push(t.substring(v,b).trim());else if(n.push(t.substring(v,x).trim()),f=[],v=++x,v===b)throw"Unmatched left bracket: "+t;for(;x<b;){if(x=y(t,x,o),x===b)throw"Unmatched left bracket: "+t;if(f.push(t.substring(v,x).trim()),x<b-1&&t[++x]!==i)throw"Expected left bracket: "+t;v=++x}if(!(b=n.length)||h.test(n[b-1]))throw"Invalid event selector: "+t;b>1?(e.type=n[1],m?e.markname=n[0].slice(1):(_=n[0],g[_]?e.marktype=n[0]:e.source=n[0])):e.type=n[0];var _;"!"===e.type.slice(-1)&&(e.consume=!0,e.type=e.type.slice(0,-1));null!=f&&(e.filter=f);d[0]&&(e.throttle=d[0]);d[1]&&(e.debounce=d[1]);return e}(t)}},79220:(t,e,n)=>{"use strict";n.d(e,{N:()=>d});var r={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},i={"*":(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>>>e},o={"+":t=>+t,"-":t=>-t,"~":t=>~t,"!":t=>!t};const a=Array.prototype.slice,s=(t,e,n)=>{const r=n?n(e[0]):e[0];return r[t].apply(r,a.call(e,1))};var u={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:(t,e,n)=>Math.max(e,Math.min(n,t)),now:Date.now,utc:Date.UTC,datetime:(t,e,n,r,i,o,a)=>new Date(t,e||0,null!=n?n:1,r||0,i||0,o||0,a||0),date:t=>new Date(t).getDate(),day:t=>new Date(t).getDay(),year:t=>new Date(t).getFullYear(),month:t=>new Date(t).getMonth(),hours:t=>new Date(t).getHours(),minutes:t=>new Date(t).getMinutes(),seconds:t=>new Date(t).getSeconds(),milliseconds:t=>new Date(t).getMilliseconds(),time:t=>new Date(t).getTime(),timezoneoffset:t=>new Date(t).getTimezoneOffset(),utcdate:t=>new Date(t).getUTCDate(),utcday:t=>new Date(t).getUTCDay(),utcyear:t=>new Date(t).getUTCFullYear(),utcmonth:t=>new Date(t).getUTCMonth(),utchours:t=>new Date(t).getUTCHours(),utcminutes:t=>new Date(t).getUTCMinutes(),utcseconds:t=>new Date(t).getUTCSeconds(),utcmilliseconds:t=>new Date(t).getUTCMilliseconds(),length:t=>t.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:t=>t.slice().reverse(),parseFloat:parseFloat,parseInt:parseInt,upper:t=>String(t).toUpperCase(),lower:t=>String(t).toLowerCase(),substring:function(){return s("substring",arguments,String)},split:function(){return s("split",arguments,String)},replace:function(){return s("replace",arguments,String)},trim:t=>String(t).trim(),regexp:RegExp,test:(t,e)=>RegExp(t).test(e)};const l=["view","item","group","xy","x","y"],c=new Set([Function,eval,setTimeout,setInterval]);"function"===typeof setImmediate&&c.add(setImmediate);const f={Literal:(t,e)=>e.value,Identifier:(t,e)=>{const n=e.name;return t.memberDepth>0?n:"datum"===n?t.datum:"event"===n?t.event:"item"===n?t.item:r[n]||t.params["$"+n]},MemberExpression:(t,e)=>{const n=!e.computed,r=t(e.object);n&&(t.memberDepth+=1);const i=t(e.property);if(n&&(t.memberDepth-=1),!c.has(r[i]))return r[i];console.error(`Prevented interpretation of member "${i}" which could lead to insecure code execution`)},CallExpression:(t,e)=>{const n=e.arguments;let r=e.callee.name;return r.startsWith("_")&&(r=r.slice(1)),"if"===r?t(n[0])?t(n[1]):t(n[2]):(t.fn[r]||u[r]).apply(t.fn,n.map(t))},ArrayExpression:(t,e)=>e.elements.map(t),BinaryExpression:(t,e)=>i[e.operator](t(e.left),t(e.right)),UnaryExpression:(t,e)=>o[e.operator](t(e.argument)),ConditionalExpression:(t,e)=>t(e.test)?t(e.consequent):t(e.alternate),LogicalExpression:(t,e)=>"&&"===e.operator?t(e.left)&&t(e.right):t(e.left)||t(e.right),ObjectExpression:(t,e)=>e.properties.reduce(((e,n)=>{t.memberDepth+=1;const r=t(n.key);return t.memberDepth-=1,c.has(t(n.value))?console.error(`Prevented interpretation of property "${r}" which could lead to insecure code execution`):e[r]=t(n.value),e}),{})};function h(t,e,n,r,i,o){const a=t=>f[t.type](a,t);return a.memberDepth=0,a.fn=Object.create(e),a.params=n,a.datum=r,a.event=i,a.item=o,l.forEach((t=>a.fn[t]=function(){return i.vega[t](...arguments)})),a(t)}var d={operator(t,e){const n=e.ast,r=t.functions;return t=>h(n,r,t)},parameter(t,e){const n=e.ast,r=t.functions;return(t,e)=>h(n,r,e,t)},event(t,e){const n=e.ast,r=t.functions;return t=>h(n,r,void 0,void 0,t)},handler(t,e){const n=e.ast,r=t.functions;return(t,e)=>{const i=e.item&&e.item.datum;return h(n,r,t,i,e)}},encode(t,e){const{marktype:n,channels:r}=e,i=t.functions,o="group"===n||"image"===n||"rect"===n;return(t,e)=>{const a=t.datum;let s,u=0;for(const n in r)s=h(r[n].ast,i,e,a,void 0,t),t[n]!==s&&(t[n]=s,u=1);return"rule"!==n&&function(t,e,n){let r;e.x2&&(e.x?(n&&t.x>t.x2&&(r=t.x,t.x=t.x2,t.x2=r),t.width=t.x2-t.x):t.x=t.x2-(t.width||0)),e.xc&&(t.x=t.xc-(t.width||0)/2),e.y2&&(e.y?(n&&t.y>t.y2&&(r=t.y,t.y=t.y2,t.y2=r),t.height=t.y2-t.y):t.y=t.y2-(t.height||0)),e.yc&&(t.y=t.yc-(t.height||0)/2)}(t,r,o),u}}}},45528:(t,e,n)=>{"use strict";function r(t,e,n){return t.fields=e||[],t.fname=n,t}function i(t){return null==t?null:t.fname}function o(t){return null==t?null:t.fields}function a(t){return 1===t.length?s(t[0]):u(t)}n.d(e,{$G:()=>Rt,$m:()=>Ft,BB:()=>Ot,Ds:()=>at,Dw:()=>U,EP:()=>f,FP:()=>Pt,HD:()=>wt,He:()=>T,IX:()=>J,J_:()=>vt,Jy:()=>At,Kj:()=>_t,Kn:()=>F,N3:()=>V,Oj:()=>o,QA:()=>j,Rg:()=>zt,TS:()=>Ct,TW:()=>bt,We:()=>ut,XW:()=>gt,Xr:()=>dt,ZE:()=>r,ZU:()=>Nt,Zw:()=>I,_k:()=>c,a9:()=>ot,ay:()=>W,bM:()=>p,bV:()=>Y,dH:()=>H,dI:()=>lt,el:()=>i,fE:()=>k,fj:()=>$,hj:()=>xt,id:()=>h,j2:()=>et,jj:()=>x,jn:()=>yt,k:()=>y,kJ:()=>E,kX:()=>g,kg:()=>D,l$:()=>Z,l7:()=>st,m8:()=>$t,mJ:()=>L,mK:()=>X,mS:()=>G,mf:()=>K,nr:()=>ft,qu:()=>tt,sw:()=>Tt,t7:()=>Dt,u5:()=>mt,vU:()=>l,vk:()=>Mt,yP:()=>St,yR:()=>d,yb:()=>m,yl:()=>pt});const s=t=>function(e){return e[t]},u=t=>{const e=t.length;return function(n){for(let r=0;r<e;++r)n=n[t[r]];return n}};function l(t){throw Error(t)}function c(t){const e=[],n=t.length;let r,i,o,a=null,s=0,u="";function c(){e.push(u+t.substring(r,i)),u="",r=i+1}for(t+="",r=i=0;i<n;++i)if(o=t[i],"\\"===o)u+=t.substring(r,i),u+=t.substring(++i,++i),r=i;else if(o===a)c(),a=null,s=-1;else{if(a)continue;r===s&&'"'===o||r===s&&"'"===o?(r=i+1,a=o):"."!==o||s?"["===o?(i>r&&c(),s=r=i+1):"]"===o&&(s||l("Access path missing open bracket: "+t),s>0&&c(),s=0,r=i+1):i>r?c():r=i+1}return s&&l("Access path missing closing bracket: "+t),a&&l("Access path missing closing quote: "+t),i>r&&(i++,c()),e}function f(t,e,n){const i=c(t);return t=1===i.length?i[0]:t,r((n&&n.get||a)(i),[t],e||t)}const h=f("id"),d=r((t=>t),[],"identity"),p=r((()=>0),[],"zero"),g=r((()=>1),[],"one"),m=r((()=>!0),[],"true"),y=r((()=>!1),[],"false");function v(t,e,n){const r=[e].concat([].slice.call(n));console[t].apply(console,r)}const b=0,x=1,_=2,w=3,A=4;function D(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:v,r=t||b;return{level(t){return arguments.length?(r=+t,this):r},error(){return r>=x&&n(e||"error","ERROR",arguments),this},warn(){return r>=_&&n(e||"warn","WARN",arguments),this},info(){return r>=w&&n(e||"log","INFO",arguments),this},debug(){return r>=A&&n(e||"log","DEBUG",arguments),this}}}var E=Array.isArray;function F(t){return t===Object(t)}const C=t=>"__proto__"!==t;function k(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return e.reduce(((t,e)=>{for(const n in e)if("signals"===n)t.signals=S(t.signals,e.signals);else{const r="legend"===n?{layout:1}:"style"===n||null;M(t,n,e[n],r)}return t}),{})}function M(t,e,n,r){if(!C(e))return;let i,o;if(F(n)&&!E(n))for(i in o=F(t[e])?t[e]:t[e]={},n)r&&(!0===r||r[i])?M(o,i,n[i]):C(i)&&(o[i]=n[i]);else t[e]=n}function S(t,e){if(null==t)return e;const n={},r=[];function i(t){n[t.name]||(n[t.name]=1,r.push(t))}return e.forEach(i),t.forEach(i),r}function $(t){return t[t.length-1]}function T(t){return null==t||""===t?null:+t}const B=t=>e=>t*Math.exp(e),N=t=>e=>Math.log(t*e),O=t=>e=>Math.sign(e)*Math.log1p(Math.abs(e/t)),z=t=>e=>Math.sign(e)*Math.expm1(Math.abs(e))*t,R=t=>e=>e<0?-Math.pow(-e,t):Math.pow(e,t);function P(t,e,n,r){const i=n(t[0]),o=n($(t)),a=(o-i)*e;return[r(i-a),r(o-a)]}function U(t,e){return P(t,e,T,d)}function L(t,e){var n=Math.sign(t[0]);return P(t,e,N(n),B(n))}function j(t,e,n){return P(t,e,R(n),R(1/n))}function I(t,e,n){return P(t,e,O(n),z(n))}function q(t,e,n,r,i){const o=r(t[0]),a=r($(t)),s=null!=e?r(e):(o+a)/2;return[i(s+(o-s)*n),i(s+(a-s)*n)]}function W(t,e,n){return q(t,e,n,T,d)}function H(t,e,n){const r=Math.sign(t[0]);return q(t,e,n,N(r),B(r))}function X(t,e,n,r){return q(t,e,n,R(r),R(1/r))}function Y(t,e,n,r){return q(t,e,n,O(r),z(r))}function G(t){return 1+~~(new Date(t).getMonth()/3)}function V(t){return 1+~~(new Date(t).getUTCMonth()/3)}function J(t){return null!=t?E(t)?t:[t]:[]}function Z(t,e,n){let r,i=t[0],o=t[1];return o<i&&(r=o,o=i,i=r),r=o-i,r>=n-e?[e,n]:[i=Math.min(Math.max(i,e),n-r),i+r]}function K(t){return"function"===typeof t}const Q="descending";function tt(t,e,n){n=n||{},e=J(e)||[];const i=[],a=[],s={},u=n.comparator||nt;return J(t).forEach(((t,r)=>{null!=t&&(i.push(e[r]===Q?-1:1),a.push(t=K(t)?t:f(t,null,n)),(o(t)||[]).forEach((t=>s[t]=1)))})),0===a.length?null:r(u(a,i),Object.keys(s))}const et=(t,e)=>(t<e||null==t)&&null!=e?-1:(t>e||null==e)&&null!=t?1:(e=e instanceof Date?+e:e,(t=t instanceof Date?+t:t)!==t&&e===e?-1:e!==e&&t===t?1:0),nt=(t,e)=>1===t.length?rt(t[0],e[0]):it(t,e,t.length),rt=(t,e)=>function(n,r){return et(t(n),t(r))*e},it=(t,e,n)=>(e.push(0),function(r,i){let o,a=0,s=-1;for(;0===a&&++s<n;)o=t[s],a=et(o(r),o(i));return a*e[s]});function ot(t){return K(t)?t:()=>t}function at(t,e){let n;return r=>{n&&clearTimeout(n),n=setTimeout((()=>(e(r),n=null)),t)}}function st(t){for(let e,n,r=1,i=arguments.length;r<i;++r)for(n in e=arguments[r],e)t[n]=e[n];return t}function ut(t,e){let n,r,i,o,a=0;if(t&&(n=t.length))if(null==e){for(r=t[a];a<n&&(null==r||r!==r);r=t[++a]);for(i=o=r;a<n;++a)r=t[a],null!=r&&(r<i&&(i=r),r>o&&(o=r))}else{for(r=e(t[a]);a<n&&(null==r||r!==r);r=e(t[++a]));for(i=o=r;a<n;++a)r=e(t[a]),null!=r&&(r<i&&(i=r),r>o&&(o=r))}return[i,o]}function lt(t,e){const n=t.length;let r,i,o,a,s,u=-1;if(null==e){for(;++u<n;)if(i=t[u],null!=i&&i>=i){r=o=i;break}if(u===n)return[-1,-1];for(a=s=u;++u<n;)i=t[u],null!=i&&(r>i&&(r=i,a=u),o<i&&(o=i,s=u))}else{for(;++u<n;)if(i=e(t[u],u,t),null!=i&&i>=i){r=o=i;break}if(u===n)return[-1,-1];for(a=s=u;++u<n;)i=e(t[u],u,t),null!=i&&(r>i&&(r=i,a=u),o<i&&(o=i,s=u))}return[a,s]}const ct=Object.prototype.hasOwnProperty;function ft(t,e){return ct.call(t,e)}const ht={};function dt(t){let e,n={};function r(t){return ft(n,t)&&n[t]!==ht}const i={size:0,empty:0,object:n,has:r,get:t=>r(t)?n[t]:void 0,set(t,e){return r(t)||(++i.size,n[t]===ht&&--i.empty),n[t]=e,this},delete(t){return r(t)&&(--i.size,++i.empty,n[t]=ht),this},clear(){i.size=i.empty=0,i.object=n={}},test(t){return arguments.length?(e=t,i):e},clean(){const t={};let r=0;for(const i in n){const o=n[i];o===ht||e&&e(o)||(t[i]=o,++r)}i.size=r,i.empty=0,i.object=n=t}};return t&&Object.keys(t).forEach((e=>{i.set(e,t[e])})),i}function pt(t,e,n,r,i,o){if(!n&&0!==n)return o;const a=+n;let s,u=t[0],l=$(t);l<u&&(s=u,u=l,l=s),s=Math.abs(e-u);const c=Math.abs(l-e);return s<c&&s<=a?r:c<=a?i:o}function gt(t,e,n){const r=t.prototype=Object.create(e.prototype);return Object.defineProperty(r,"constructor",{value:t,writable:!0,enumerable:!0,configurable:!0}),st(r,n)}function mt(t,e,n,r){let i,o=e[0],a=e[e.length-1];return o>a&&(i=o,o=a,a=i),r=void 0===r||r,((n=void 0===n||n)?o<=t:o<t)&&(r?t<=a:t<a)}function yt(t){return"boolean"===typeof t}function vt(t){return"[object Date]"===Object.prototype.toString.call(t)}function bt(t){return t&&K(t[Symbol.iterator])}function xt(t){return"number"===typeof t}function _t(t){return"[object RegExp]"===Object.prototype.toString.call(t)}function wt(t){return"string"===typeof t}function At(t,e,n){t&&(t=e?J(t).map((t=>t.replace(/\\(.)/g,"$1"))):J(t));const i=t&&t.length,o=n&&n.get||a,s=t=>o(e?[t]:c(t));let u;if(i)if(1===i){const e=s(t[0]);u=function(t){return""+e(t)}}else{const e=t.map(s);u=function(t){let n=""+e[0](t),r=0;for(;++r<i;)n+="|"+e[r](t);return n}}else u=function(){return""};return r(u,t,"key")}function Dt(t,e){const n=t[0],r=$(t),i=+e;return i?1===i?r:n+i*(r-n):n}const Et=1e4;function Ft(t){let e,n,r;t=+t||Et;const i=()=>{e={},n={},r=0},o=(i,o)=>(++r>t&&(n=e,e={},r=1),e[i]=o);return i(),{clear:i,has:t=>ft(e,t)||ft(n,t),get:t=>ft(e,t)?e[t]:ft(n,t)?o(t,n[t]):void 0,set:(t,n)=>ft(e,t)?e[t]=n:o(t,n)}}function Ct(t,e,n,r){const i=e.length,o=n.length;if(!o)return e;if(!i)return n;const a=r||new e.constructor(i+o);let s=0,u=0,l=0;for(;s<i&&u<o;++l)a[l]=t(e[s],n[u])>0?n[u++]:e[s++];for(;s<i;++s,++l)a[l]=e[s];for(;u<o;++u,++l)a[l]=n[u];return a}function kt(t,e){let n="";for(;--e>=0;)n+=t;return n}function Mt(t,e,n,r){const i=n||" ",o=t+"",a=e-o.length;return a<=0?o:"left"===r?kt(i,a)+o:"center"===r?kt(i,~~(a/2))+o+kt(i,Math.ceil(a/2)):o+kt(i,a)}function St(t){return t&&$(t)-t[0]||0}function $t(t){return E(t)?"["+t.map($t)+"]":F(t)||wt(t)?JSON.stringify(t).replace("\u2028","\\u2028").replace("\u2029","\\u2029"):t}function Tt(t){return null==t||""===t?null:!(!t||"false"===t||"0"===t)&&!!t}const Bt=t=>xt(t)||vt(t)?t:Date.parse(t);function Nt(t,e){return e=e||Bt,null==t||""===t?null:e(t)}function Ot(t){return null==t||""===t?null:t+""}function zt(t){const e={},n=t.length;for(let r=0;r<n;++r)e[t[r]]=!0;return e}function Rt(t,e,n,r){const i=null!=r?r:"\u2026",o=t+"",a=o.length,s=Math.max(0,e-i.length);return a<=e?o:"left"===n?i+o.slice(a-s):"center"===n?o.slice(0,Math.ceil(s/2))+i+o.slice(a-~~(s/2)):o.slice(0,s)+i}function Pt(t,e,n){if(t)if(e){const r=t.length;for(let i=0;i<r;++i){const r=e(t[i]);r&&n(r,i,t)}}else t.forEach(n)}},42915:(t,e,n)=>{"use strict";n.r(e),n.d(e,{Bounds:()=>Wy,CanvasHandler:()=>wx,CanvasRenderer:()=>kx,DATE:()=>Tn,DAY:()=>Bn,DAYOFYEAR:()=>Nn,Dataflow:()=>us,Debug:()=>z,Error:()=>B,EventStream:()=>Ya,Gradient:()=>Ym,GroupItem:()=>Xy,HOURS:()=>On,Handler:()=>rx,Info:()=>O,Item:()=>Hy,MILLISECONDS:()=>Pn,MINUTES:()=>zn,MONTH:()=>Sn,Marks:()=>jb,MultiPulse:()=>rs,None:()=>T,Operator:()=>Wa,Parameters:()=>ja,Pulse:()=>Qa,QUARTER:()=>Mn,RenderType:()=>b_,Renderer:()=>ox,ResourceLoader:()=>Yy,SECONDS:()=>Rn,SVGHandler:()=>Sx,SVGRenderer:()=>n_,SVGStringRenderer:()=>m_,Scenegraph:()=>Vb,TIME_UNITS:()=>Un,Transform:()=>cs,View:()=>WQ,WEEK:()=>$n,Warn:()=>N,YEAR:()=>kn,accessor:()=>m,accessorFields:()=>v,accessorName:()=>y,array:()=>lt,ascending:()=>pt,bandwidthNRD:()=>CY,bin:()=>kY,bootstrapCI:()=>$Y,boundClip:()=>C_,boundContext:()=>pv,boundItem:()=>Ib,boundMark:()=>Wb,boundStroke:()=>Jy,changeset:()=>Ua,clampRange:()=>ct,codegenExpression:()=>C2,compare:()=>dt,constant:()=>vt,cumulativeLogNormal:()=>XY,cumulativeNormal:()=>LY,cumulativeUniform:()=>KY,dayofyear:()=>Xn,debounce:()=>bt,defaultLocale:()=>Zo,definition:()=>hs,densityLogNormal:()=>HY,densityNormal:()=>UY,densityUniform:()=>ZY,domChild:()=>Qb,domClear:()=>tx,domCreate:()=>Zb,domFind:()=>Kb,dotbin:()=>TY,error:()=>w,expressionFunction:()=>T3,extend:()=>xt,extent:()=>_t,extentIndex:()=>wt,falsy:()=>S,fastmap:()=>Ft,field:()=>D,flush:()=>Ct,font:()=>Bb,fontFamily:()=>Tb,fontSize:()=>Cb,format:()=>_a,formatLocale:()=>qo,formats:()=>wa,hasOwnProperty:()=>Dt,id:()=>E,identity:()=>F,inferType:()=>pa,inferTypes:()=>ga,ingest:()=>Ba,inherits:()=>kt,inrange:()=>Mt,interpolate:()=>gm,interpolateColors:()=>hm,interpolateRange:()=>fm,intersect:()=>w_,intersectBoxLine:()=>Ev,intersectPath:()=>_v,intersectPoint:()=>wv,intersectRule:()=>Dv,isArray:()=>P,isBoolean:()=>St,isDate:()=>$t,isFunction:()=>ft,isIterable:()=>Tt,isNumber:()=>Bt,isObject:()=>U,isRegExp:()=>Nt,isString:()=>Ot,isTuple:()=>Sa,key:()=>zt,lerp:()=>Rt,lineHeight:()=>kb,loader:()=>Ea,locale:()=>Jo,logger:()=>R,lruCache:()=>Ut,markup:()=>Gx,merge:()=>Lt,mergeConfig:()=>j,multiLineOffset:()=>Sb,one:()=>k,pad:()=>It,panLinear:()=>K,panLog:()=>Q,panPow:()=>tt,panSymlog:()=>et,parse:()=>V8,parseExpression:()=>D2,parseSelector:()=>B3.r,path:()=>Ec,pathCurves:()=>Vm,pathEqual:()=>S_,pathParse:()=>ey,pathRectangle:()=>Fy,pathRender:()=>dy,pathSymbols:()=>yy,pathTrail:()=>Cy,peek:()=>W,point:()=>nx,projection:()=>UF,quantileLogNormal:()=>YY,quantileNormal:()=>jY,quantileUniform:()=>QY,quantiles:()=>EY,quantizeInterpolator:()=>dm,quarter:()=>st,quartiles:()=>FY,random:()=>MY,randomInteger:()=>NY,randomKDE:()=>qY,randomLCG:()=>BY,randomLogNormal:()=>GY,randomMixture:()=>VY,randomNormal:()=>IY,randomUniform:()=>tG,read:()=>Da,regressionConstant:()=>eG,regressionExp:()=>uG,regressionLinear:()=>aG,regressionLoess:()=>gG,regressionLog:()=>sG,regressionPoly:()=>fG,regressionPow:()=>lG,regressionQuad:()=>cG,renderModule:()=>__,repeat:()=>jt,resetDefaultLocale:()=>Ko,resetSVGClipId:()=>Iy,resetSVGDefIds:()=>$_,responseType:()=>Aa,runtimeContext:()=>YK,sampleCurve:()=>bG,sampleLogNormal:()=>WY,sampleNormal:()=>PY,sampleUniform:()=>JY,scale:()=>em,sceneEqual:()=>M_,sceneFromJSON:()=>Yb,scenePickVisit:()=>zv,sceneToJSON:()=>Xb,sceneVisit:()=>Ov,sceneZOrder:()=>Nv,scheme:()=>bm,serializeXML:()=>Vx,setRandom:()=>SY,span:()=>qt,splitAccessPath:()=>A,stringValue:()=>Wt,textMetrics:()=>_b,timeBin:()=>zr,timeFloor:()=>ur,timeFormatLocale:()=>Go,timeInterval:()=>pr,timeOffset:()=>yr,timeSequence:()=>xr,timeUnitSpecifier:()=>qn,timeUnits:()=>jn,toBoolean:()=>Ht,toDate:()=>Yt,toNumber:()=>H,toSet:()=>Vt,toString:()=>Gt,transform:()=>ds,transforms:()=>fs,truncate:()=>Jt,truthy:()=>M,tupleid:()=>$a,typeParsers:()=>fa,utcFloor:()=>fr,utcInterval:()=>gr,utcOffset:()=>vr,utcSequence:()=>_r,utcdayofyear:()=>Kn,utcquarter:()=>ut,utcweek:()=>Qn,version:()=>J8,visitArray:()=>Zt,week:()=>Yn,writeConfig:()=>I,zero:()=>C,zoomLinear:()=>rt,zoomLog:()=>it,zoomPow:()=>ot,zoomSymlog:()=>at});var r={};n.r(r),n.d(r,{aggregate:()=>du,bin:()=>pu,collect:()=>mu,compare:()=>yu,countpattern:()=>bu,cross:()=>xu,density:()=>Fu,dotbin:()=>$u,expression:()=>Tu,extent:()=>Nu,facet:()=>zu,field:()=>Ru,filter:()=>Uu,flatten:()=>Lu,fold:()=>ju,formula:()=>Iu,generate:()=>qu,impute:()=>Xu,joinaggregate:()=>Yu,kde:()=>Gu,key:()=>Vu,load:()=>Zu,lookup:()=>Qu,multiextent:()=>tl,multivalues:()=>nl,params:()=>il,pivot:()=>ol,prefacet:()=>al,project:()=>sl,proxy:()=>ul,quantile:()=>ll,relay:()=>cl,sample:()=>fl,sequence:()=>hl,sieve:()=>dl,subflow:()=>Ou,timeunit:()=>pl,tupleindex:()=>ml,values:()=>yl,window:()=>wl});var i={};n.r(i),n.d(i,{interpolate:()=>bf,interpolateArray:()=>hf,interpolateBasis:()=>kp.Z,interpolateBasisClosed:()=>Mp.Z,interpolateCubehelix:()=>wg,interpolateCubehelixLong:()=>Ag,interpolateDate:()=>pf,interpolateDiscrete:()=>Sp,interpolateHcl:()=>lg,interpolateHclLong:()=>cg,interpolateHsl:()=>Pp,interpolateHslLong:()=>Up,interpolateHue:()=>Tp,interpolateLab:()=>sg,interpolateNumber:()=>gf.Z,interpolateNumberArray:()=>cf,interpolateObject:()=>mf,interpolateRgb:()=>lf.ZP,interpolateRgbBasis:()=>lf.hD,interpolateRgbBasisClosed:()=>lf.YD,interpolateRound:()=>xf,interpolateString:()=>yf.Z,interpolateTransformCss:()=>Bp.Y,interpolateTransformSvg:()=>Bp.w,interpolateZoom:()=>zp,piecewise:()=>mp,quantize:()=>Dg});var o={};n.r(o),n.d(o,{bound:()=>gw,identifier:()=>vw,mark:()=>bw,overlap:()=>xw,render:()=>Cw,viewlayout:()=>Vw});var a={};n.r(a),n.d(a,{axisticks:()=>Zw,datajoin:()=>Kw,encode:()=>tA,legendentries:()=>eA,linkpath:()=>aA,pie:()=>fA,scale:()=>gA,sortitems:()=>bA,stack:()=>DA});var s={};n.r(s),n.d(s,{contour:()=>lC,geojson:()=>hC,geopath:()=>dC,geopoint:()=>pC,geoshape:()=>gC,graticule:()=>mC,heatmap:()=>yC,isocontour:()=>QF,kde2d:()=>aC,projection:()=>bC});var u={};n.r(u),n.d(u,{force:()=>ek});var l={};n.r(l),n.d(l,{nest:()=>uM,pack:()=>pM,partition:()=>mM,stratify:()=>yM,tree:()=>xM,treelinks:()=>_M,treemap:()=>DM});var c={};n.r(c),n.d(c,{interpolate:()=>dz,interpolateArray:()=>oz,interpolateBasis:()=>XO,interpolateBasisClosed:()=>YO,interpolateCubehelix:()=>iP,interpolateCubehelixLong:()=>oP,interpolateDate:()=>sz,interpolateDiscrete:()=>uR,interpolateHcl:()=>HR,interpolateHclLong:()=>XR,interpolateHsl:()=>_R,interpolateHslLong:()=>wR,interpolateHue:()=>lR,interpolateLab:()=>qR,interpolateNumber:()=>uz,interpolateNumberArray:()=>rz,interpolateObject:()=>lz,interpolateRgb:()=>QO,interpolateRgbBasis:()=>ez,interpolateRgbBasisClosed:()=>nz,interpolateRound:()=>pz,interpolateString:()=>hz,interpolateTransformCss:()=>gR,interpolateTransformSvg:()=>mR,interpolateZoom:()=>bR,piecewise:()=>iR,quantize:()=>aP});var f={};n.r(f),n.d(f,{label:()=>iW});var h={};n.r(h),n.d(h,{loess:()=>yX,regression:()=>bX});var d={};n.r(d),n.d(d,{voronoi:()=>QX});var p={};n.r(p),n.d(p,{wordcloud:()=>gY});var g={};function m(t,e,n){return t.fields=e||[],t.fname=n,t}function y(t){return null==t?null:t.fname}function v(t){return null==t?null:t.fields}function b(t){return 1===t.length?x(t[0]):_(t)}n.r(g),n.d(g,{crossfilter:()=>wY,resolvefilter:()=>AY});const x=t=>function(e){return e[t]},_=t=>{const e=t.length;return function(n){for(let r=0;r<e;++r)n=n[t[r]];return n}};function w(t){throw Error(t)}function A(t){const e=[],n=t.length;let r,i,o,a=null,s=0,u="";function l(){e.push(u+t.substring(r,i)),u="",r=i+1}for(t+="",r=i=0;i<n;++i)if(o=t[i],"\\"===o)u+=t.substring(r,i++),r=i;else if(o===a)l(),a=null,s=-1;else{if(a)continue;r===s&&'"'===o||r===s&&"'"===o?(r=i+1,a=o):"."!==o||s?"["===o?(i>r&&l(),s=r=i+1):"]"===o&&(s||w("Access path missing open bracket: "+t),s>0&&l(),s=0,r=i+1):i>r?l():r=i+1}return s&&w("Access path missing closing bracket: "+t),a&&w("Access path missing closing quote: "+t),i>r&&(i++,l()),e}function D(t,e,n){const r=A(t);return t=1===r.length?r[0]:t,m((n&&n.get||b)(r),[t],e||t)}const E=D("id"),F=m((t=>t),[],"identity"),C=m((()=>0),[],"zero"),k=m((()=>1),[],"one"),M=m((()=>!0),[],"true"),S=m((()=>!1),[],"false");function $(t,e,n){const r=[e].concat([].slice.call(n));console[t].apply(console,r)}const T=0,B=1,N=2,O=3,z=4;function R(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:$,r=t||T;return{level(t){return arguments.length?(r=+t,this):r},error(){return r>=B&&n(e||"error","ERROR",arguments),this},warn(){return r>=N&&n(e||"warn","WARN",arguments),this},info(){return r>=O&&n(e||"log","INFO",arguments),this},debug(){return r>=z&&n(e||"log","DEBUG",arguments),this}}}var P=Array.isArray;function U(t){return t===Object(t)}const L=t=>"__proto__"!==t;function j(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return e.reduce(((t,e)=>{for(const n in e)if("signals"===n)t.signals=q(t.signals,e.signals);else{const r="legend"===n?{layout:1}:"style"===n||null;I(t,n,e[n],r)}return t}),{})}function I(t,e,n,r){if(!L(e))return;let i,o;if(U(n)&&!P(n))for(i in o=U(t[e])?t[e]:t[e]={},n)r&&(!0===r||r[i])?I(o,i,n[i]):L(i)&&(o[i]=n[i]);else t[e]=n}function q(t,e){if(null==t)return e;const n={},r=[];function i(t){n[t.name]||(n[t.name]=1,r.push(t))}return e.forEach(i),t.forEach(i),r}function W(t){return t[t.length-1]}function H(t){return null==t||""===t?null:+t}const X=t=>e=>t*Math.exp(e),Y=t=>e=>Math.log(t*e),G=t=>e=>Math.sign(e)*Math.log1p(Math.abs(e/t)),V=t=>e=>Math.sign(e)*Math.expm1(Math.abs(e))*t,J=t=>e=>e<0?-Math.pow(-e,t):Math.pow(e,t);function Z(t,e,n,r){const i=n(t[0]),o=n(W(t)),a=(o-i)*e;return[r(i-a),r(o-a)]}function K(t,e){return Z(t,e,H,F)}function Q(t,e){var n=Math.sign(t[0]);return Z(t,e,Y(n),X(n))}function tt(t,e,n){return Z(t,e,J(n),J(1/n))}function et(t,e,n){return Z(t,e,G(n),V(n))}function nt(t,e,n,r,i){const o=r(t[0]),a=r(W(t)),s=null!=e?r(e):(o+a)/2;return[i(s+(o-s)*n),i(s+(a-s)*n)]}function rt(t,e,n){return nt(t,e,n,H,F)}function it(t,e,n){const r=Math.sign(t[0]);return nt(t,e,n,Y(r),X(r))}function ot(t,e,n,r){return nt(t,e,n,J(r),J(1/r))}function at(t,e,n,r){return nt(t,e,n,G(r),V(r))}function st(t){return 1+~~(new Date(t).getMonth()/3)}function ut(t){return 1+~~(new Date(t).getUTCMonth()/3)}function lt(t){return null!=t?P(t)?t:[t]:[]}function ct(t,e,n){let r,i=t[0],o=t[1];return o<i&&(r=o,o=i,i=r),r=o-i,r>=n-e?[e,n]:[i=Math.min(Math.max(i,e),n-r),i+r]}function ft(t){return"function"===typeof t}const ht="descending";function dt(t,e,n){n=n||{},e=lt(e)||[];const r=[],i=[],o={},a=n.comparator||gt;return lt(t).forEach(((t,a)=>{null!=t&&(r.push(e[a]===ht?-1:1),i.push(t=ft(t)?t:D(t,null,n)),(v(t)||[]).forEach((t=>o[t]=1)))})),0===i.length?null:m(a(i,r),Object.keys(o))}const pt=(t,e)=>(t<e||null==t)&&null!=e?-1:(t>e||null==e)&&null!=t?1:(e=e instanceof Date?+e:e,(t=t instanceof Date?+t:t)!==t&&e===e?-1:e!==e&&t===t?1:0),gt=(t,e)=>1===t.length?mt(t[0],e[0]):yt(t,e,t.length),mt=(t,e)=>function(n,r){return pt(t(n),t(r))*e},yt=(t,e,n)=>(e.push(0),function(r,i){let o,a=0,s=-1;for(;0===a&&++s<n;)o=t[s],a=pt(o(r),o(i));return a*e[s]});function vt(t){return ft(t)?t:()=>t}function bt(t,e){let n;return r=>{n&&clearTimeout(n),n=setTimeout((()=>(e(r),n=null)),t)}}function xt(t){for(let e,n,r=1,i=arguments.length;r<i;++r)for(n in e=arguments[r],e)t[n]=e[n];return t}function _t(t,e){let n,r,i,o,a=0;if(t&&(n=t.length))if(null==e){for(r=t[a];a<n&&(null==r||r!==r);r=t[++a]);for(i=o=r;a<n;++a)r=t[a],null!=r&&(r<i&&(i=r),r>o&&(o=r))}else{for(r=e(t[a]);a<n&&(null==r||r!==r);r=e(t[++a]));for(i=o=r;a<n;++a)r=e(t[a]),null!=r&&(r<i&&(i=r),r>o&&(o=r))}return[i,o]}function wt(t,e){const n=t.length;let r,i,o,a,s,u=-1;if(null==e){for(;++u<n;)if(i=t[u],null!=i&&i>=i){r=o=i;break}if(u===n)return[-1,-1];for(a=s=u;++u<n;)i=t[u],null!=i&&(r>i&&(r=i,a=u),o<i&&(o=i,s=u))}else{for(;++u<n;)if(i=e(t[u],u,t),null!=i&&i>=i){r=o=i;break}if(u===n)return[-1,-1];for(a=s=u;++u<n;)i=e(t[u],u,t),null!=i&&(r>i&&(r=i,a=u),o<i&&(o=i,s=u))}return[a,s]}const At=Object.prototype.hasOwnProperty;function Dt(t,e){return At.call(t,e)}const Et={};function Ft(t){let e,n={};function r(t){return Dt(n,t)&&n[t]!==Et}const i={size:0,empty:0,object:n,has:r,get:t=>r(t)?n[t]:void 0,set(t,e){return r(t)||(++i.size,n[t]===Et&&--i.empty),n[t]=e,this},delete(t){return r(t)&&(--i.size,++i.empty,n[t]=Et),this},clear(){i.size=i.empty=0,i.object=n={}},test(t){return arguments.length?(e=t,i):e},clean(){const t={};let r=0;for(const i in n){const o=n[i];o===Et||e&&e(o)||(t[i]=o,++r)}i.size=r,i.empty=0,i.object=n=t}};return t&&Object.keys(t).forEach((e=>{i.set(e,t[e])})),i}function Ct(t,e,n,r,i,o){if(!n&&0!==n)return o;const a=+n;let s,u=t[0],l=W(t);l<u&&(s=u,u=l,l=s),s=Math.abs(e-u);const c=Math.abs(l-e);return s<c&&s<=a?r:c<=a?i:o}function kt(t,e,n){const r=t.prototype=Object.create(e.prototype);return Object.defineProperty(r,"constructor",{value:t,writable:!0,enumerable:!0,configurable:!0}),xt(r,n)}function Mt(t,e,n,r){let i,o=e[0],a=e[e.length-1];return o>a&&(i=o,o=a,a=i),r=void 0===r||r,((n=void 0===n||n)?o<=t:o<t)&&(r?t<=a:t<a)}function St(t){return"boolean"===typeof t}function $t(t){return"[object Date]"===Object.prototype.toString.call(t)}function Tt(t){return t&&ft(t[Symbol.iterator])}function Bt(t){return"number"===typeof t}function Nt(t){return"[object RegExp]"===Object.prototype.toString.call(t)}function Ot(t){return"string"===typeof t}function zt(t,e,n){t&&(t=e?lt(t).map((t=>t.replace(/\\(.)/g,"$1"))):lt(t));const r=t&&t.length,i=n&&n.get||b,o=t=>i(e?[t]:A(t));let a;if(r)if(1===r){const e=o(t[0]);a=function(t){return""+e(t)}}else{const e=t.map(o);a=function(t){let n=""+e[0](t),i=0;for(;++i<r;)n+="|"+e[i](t);return n}}else a=function(){return""};return m(a,t,"key")}function Rt(t,e){const n=t[0],r=W(t),i=+e;return i?1===i?r:n+i*(r-n):n}const Pt=1e4;function Ut(t){let e,n,r;t=+t||Pt;const i=()=>{e={},n={},r=0},o=(i,o)=>(++r>t&&(n=e,e={},r=1),e[i]=o);return i(),{clear:i,has:t=>Dt(e,t)||Dt(n,t),get:t=>Dt(e,t)?e[t]:Dt(n,t)?o(t,n[t]):void 0,set:(t,n)=>Dt(e,t)?e[t]=n:o(t,n)}}function Lt(t,e,n,r){const i=e.length,o=n.length;if(!o)return e;if(!i)return n;const a=r||new e.constructor(i+o);let s=0,u=0,l=0;for(;s<i&&u<o;++l)a[l]=t(e[s],n[u])>0?n[u++]:e[s++];for(;s<i;++s,++l)a[l]=e[s];for(;u<o;++u,++l)a[l]=n[u];return a}function jt(t,e){let n="";for(;--e>=0;)n+=t;return n}function It(t,e,n,r){const i=n||" ",o=t+"",a=e-o.length;return a<=0?o:"left"===r?jt(i,a)+o:"center"===r?jt(i,~~(a/2))+o+jt(i,Math.ceil(a/2)):o+jt(i,a)}function qt(t){return t&&W(t)-t[0]||0}function Wt(t){return P(t)?"["+t.map(Wt)+"]":U(t)||Ot(t)?JSON.stringify(t).replace("\u2028","\\u2028").replace("\u2029","\\u2029"):t}function Ht(t){return null==t||""===t?null:!(!t||"false"===t||"0"===t)&&!!t}const Xt=t=>Bt(t)||$t(t)?t:Date.parse(t);function Yt(t,e){return e=e||Xt,null==t||""===t?null:e(t)}function Gt(t){return null==t||""===t?null:t+""}function Vt(t){const e={},n=t.length;for(let r=0;r<n;++r)e[t[r]]=!0;return e}function Jt(t,e,n,r){const i=null!=r?r:"\u2026",o=t+"",a=o.length,s=Math.max(0,e-i.length);return a<=e?o:"left"===n?i+o.slice(a-s):"center"===n?o.slice(0,Math.ceil(s/2))+i+o.slice(a-~~(s/2)):o.slice(0,s)+i}function Zt(t,e,n){if(t)if(e){const r=t.length;for(let i=0;i<r;++i){const r=e(t[i]);r&&n(r,i,t)}}else t.forEach(n)}var Kt=n(45528),Qt={},te={},ee=34,ne=10,re=13;function ie(t){return new Function("d","return {"+t.map((function(t,e){return JSON.stringify(t)+": d["+e+'] || ""'})).join(",")+"}")}function oe(t){var e=Object.create(null),n=[];return t.forEach((function(t){for(var r in t)r in e||n.push(e[r]=r)})),n}function ae(t,e){var n=t+"",r=n.length;return r<e?new Array(e-r+1).join(0)+n:n}function se(t){var e=t.getUTCHours(),n=t.getUTCMinutes(),r=t.getUTCSeconds(),i=t.getUTCMilliseconds();return isNaN(t)?"Invalid Date":function(t){return t<0?"-"+ae(-t,6):t>9999?"+"+ae(t,6):ae(t,4)}(t.getUTCFullYear())+"-"+ae(t.getUTCMonth()+1,2)+"-"+ae(t.getUTCDate(),2)+(i?"T"+ae(e,2)+":"+ae(n,2)+":"+ae(r,2)+"."+ae(i,3)+"Z":r?"T"+ae(e,2)+":"+ae(n,2)+":"+ae(r,2)+"Z":n||e?"T"+ae(e,2)+":"+ae(n,2)+"Z":"")}function ue(t){var e=new RegExp('["'+t+"\n\r]"),n=t.charCodeAt(0);function r(t,e){var r,i=[],o=t.length,a=0,s=0,u=o<=0,l=!1;function c(){if(u)return te;if(l)return l=!1,Qt;var e,r,i=a;if(t.charCodeAt(i)===ee){for(;a++<o&&t.charCodeAt(a)!==ee||t.charCodeAt(++a)===ee;);return(e=a)>=o?u=!0:(r=t.charCodeAt(a++))===ne?l=!0:r===re&&(l=!0,t.charCodeAt(a)===ne&&++a),t.slice(i+1,e-1).replace(/""/g,'"')}for(;a<o;){if((r=t.charCodeAt(e=a++))===ne)l=!0;else if(r===re)l=!0,t.charCodeAt(a)===ne&&++a;else if(r!==n)continue;return t.slice(i,e)}return u=!0,t.slice(i,o)}for(t.charCodeAt(o-1)===ne&&--o,t.charCodeAt(o-1)===re&&--o;(r=c())!==te;){for(var f=[];r!==Qt&&r!==te;)f.push(r),r=c();e&&null==(f=e(f,s++))||i.push(f)}return i}function i(e,n){return e.map((function(e){return n.map((function(t){return a(e[t])})).join(t)}))}function o(e){return e.map(a).join(t)}function a(t){return null==t?"":t instanceof Date?se(t):e.test(t+="")?'"'+t.replace(/"/g,'""')+'"':t}return{parse:function(t,e){var n,i,o=r(t,(function(t,r){if(n)return n(t,r-1);i=t,n=e?function(t,e){var n=ie(t);return function(r,i){return e(n(r),i,t)}}(t,e):ie(t)}));return o.columns=i||[],o},parseRows:r,format:function(e,n){return null==n&&(n=oe(e)),[n.map(a).join(t)].concat(i(e,n)).join("\n")},formatBody:function(t,e){return null==e&&(e=oe(t)),i(t,e).join("\n")},formatRows:function(t){return t.map(o).join("\n")},formatRow:o,formatValue:a}}function le(t){return t}function ce(t,e){return"string"===typeof e&&(e=t.objects[e]),"GeometryCollection"===e.type?{type:"FeatureCollection",features:e.geometries.map((function(e){return fe(t,e)}))}:fe(t,e)}function fe(t,e){var n=e.id,r=e.bbox,i=null==e.properties?{}:e.properties,o=he(t,e);return null==n&&null==r?{type:"Feature",properties:i,geometry:o}:null==r?{type:"Feature",id:n,properties:i,geometry:o}:{type:"Feature",id:n,bbox:r,properties:i,geometry:o}}function he(t,e){var n=function(t){if(null==t)return le;var e,n,r=t.scale[0],i=t.scale[1],o=t.translate[0],a=t.translate[1];return function(t,s){s||(e=n=0);var u=2,l=t.length,c=new Array(l);for(c[0]=(e+=t[0])*r+o,c[1]=(n+=t[1])*i+a;u<l;)c[u]=t[u],++u;return c}}(t.transform),r=t.arcs;function i(t,e){e.length&&e.pop();for(var i=r[t<0?~t:t],o=0,a=i.length;o<a;++o)e.push(n(i[o],o));t<0&&function(t,e){for(var n,r=t.length,i=r-e;i<--r;)n=t[i],t[i++]=t[r],t[r]=n}(e,a)}function o(t){return n(t)}function a(t){for(var e=[],n=0,r=t.length;n<r;++n)i(t[n],e);return e.length<2&&e.push(e[0]),e}function s(t){for(var e=a(t);e.length<4;)e.push(e[0]);return e}function u(t){return t.map(s)}return function t(e){var n,r=e.type;switch(r){case"GeometryCollection":return{type:r,geometries:e.geometries.map(t)};case"Point":n=o(e.coordinates);break;case"MultiPoint":n=e.coordinates.map(o);break;case"LineString":n=a(e.arcs);break;case"MultiLineString":n=e.arcs.map(a);break;case"Polygon":n=u(e.arcs);break;case"MultiPolygon":n=e.arcs.map(u);break;default:return null}return{type:r,coordinates:n}}(e)}function de(t,e){var n={},r={},i={},o=[],a=-1;function s(t,e){for(var r in t){var i=t[r];delete e[i.start],delete i.start,delete i.end,i.forEach((function(t){n[t<0?~t:t]=1})),o.push(i)}}return e.forEach((function(n,r){var i,o=t.arcs[n<0?~n:n];o.length<3&&!o[1][0]&&!o[1][1]&&(i=e[++a],e[a]=n,e[r]=i)})),e.forEach((function(e){var n,o,a=function(e){var n,r=t.arcs[e<0?~e:e],i=r[0];t.transform?(n=[0,0],r.forEach((function(t){n[0]+=t[0],n[1]+=t[1]}))):n=r[r.length-1];return e<0?[n,i]:[i,n]}(e),s=a[0],u=a[1];if(n=i[s])if(delete i[n.end],n.push(e),n.end=u,o=r[u]){delete r[o.start];var l=o===n?n:n.concat(o);r[l.start=n.start]=i[l.end=o.end]=l}else r[n.start]=i[n.end]=n;else if(n=r[u])if(delete r[n.start],n.unshift(e),n.start=s,o=i[s]){delete i[o.end];var c=o===n?n:o.concat(n);r[c.start=o.start]=i[c.end=n.end]=c}else r[n.start]=i[n.end]=n;else r[(n=[e]).start=s]=i[n.end=u]=n})),s(i,r),s(r,i),e.forEach((function(t){n[t<0?~t:t]||o.push([t])})),o}function pe(t){return he(t,ge.apply(this,arguments))}function ge(t,e,n){var r,i,o;if(arguments.length>1)r=function(t,e,n){var r,i=[],o=[];function a(t){var e=t<0?~t:t;(o[e]||(o[e]=[])).push({i:t,g:r})}function s(t){t.forEach(a)}function u(t){t.forEach(s)}function l(t){t.forEach(u)}function c(t){switch(r=t,t.type){case"GeometryCollection":t.geometries.forEach(c);break;case"LineString":s(t.arcs);break;case"MultiLineString":case"Polygon":u(t.arcs);break;case"MultiPolygon":l(t.arcs)}}return c(e),o.forEach(null==n?function(t){i.push(t[0].i)}:function(t){n(t[0].g,t[t.length-1].g)&&i.push(t[0].i)}),i}(0,e,n);else for(i=0,r=new Array(o=t.arcs.length);i<o;++i)r[i]=i;return{type:"MultiLineString",arcs:de(t,r)}}const me=Math.sqrt(50),ye=Math.sqrt(10),ve=Math.sqrt(2);function be(t,e,n){const r=(e-t)/Math.max(0,n),i=Math.floor(Math.log10(r)),o=r/Math.pow(10,i),a=o>=me?10:o>=ye?5:o>=ve?2:1;let s,u,l;return i<0?(l=Math.pow(10,-i)/a,s=Math.round(t*l),u=Math.round(e*l),s/l<t&&++s,u/l>e&&--u,l=-l):(l=Math.pow(10,i)*a,s=Math.round(t/l),u=Math.round(e/l),s*l<t&&++s,u*l>e&&--u),u<s&&.5<=n&&n<2?be(t,e,2*n):[s,u,l]}function xe(t,e,n){return be(t=+t,e=+e,n=+n)[2]}function _e(t,e,n){n=+n;const r=(e=+e)<(t=+t),i=r?xe(e,t,n):xe(t,e,n);return(r?-1:1)*(i<0?1/-i:i)}var we,Ae=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function De(t){if(!(e=Ae.exec(t)))throw new Error("invalid format: "+t);var e;return new Ee({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}function Ee(t){this.fill=void 0===t.fill?" ":t.fill+"",this.align=void 0===t.align?">":t.align+"",this.sign=void 0===t.sign?"-":t.sign+"",this.symbol=void 0===t.symbol?"":t.symbol+"",this.zero=!!t.zero,this.width=void 0===t.width?void 0:+t.width,this.comma=!!t.comma,this.precision=void 0===t.precision?void 0:+t.precision,this.trim=!!t.trim,this.type=void 0===t.type?"":t.type+""}function Fe(t,e){if((n=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var n,r=t.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+t.slice(n+1)]}function Ce(t){return(t=Fe(Math.abs(t)))?t[1]:NaN}function ke(t,e){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(Ce(e)/3)))-Ce(Math.abs(t)))}function Me(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,Ce(e)-Ce(t))+1}function Se(t){return Math.max(0,-Ce(Math.abs(t)))}function $e(t,e){var n=Fe(t,e);if(!n)return t+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}De.prototype=Ee.prototype,Ee.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 Te={"%":(t,e)=>(100*t).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:function(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)},e:(t,e)=>t.toExponential(e),f:(t,e)=>t.toFixed(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>$e(100*t,e),r:$e,s:function(t,e){var n=Fe(t,e);if(!n)return t+"";var r=n[0],i=n[1],o=i-(we=3*Math.max(-8,Math.min(8,Math.floor(i/3))))+1,a=r.length;return o===a?r:o>a?r+new Array(o-a+1).join("0"):o>0?r.slice(0,o)+"."+r.slice(o):"0."+new Array(1-o).join("0")+Fe(t,Math.max(0,e+o-1))[0]},X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function Be(t){return t}var Ne,Oe,ze,Re=Array.prototype.map,Pe=["y","z","a","f","p","n","\xb5","m","","k","M","G","T","P","E","Z","Y"];function Ue(t){var e,n,r=void 0===t.grouping||void 0===t.thousands?Be:(e=Re.call(t.grouping,Number),n=t.thousands+"",function(t,r){for(var i=t.length,o=[],a=0,s=e[0],u=0;i>0&&s>0&&(u+s+1>r&&(s=Math.max(1,r-u)),o.push(t.substring(i-=s,i+s)),!((u+=s+1)>r));)s=e[a=(a+1)%e.length];return o.reverse().join(n)}),i=void 0===t.currency?"":t.currency[0]+"",o=void 0===t.currency?"":t.currency[1]+"",a=void 0===t.decimal?".":t.decimal+"",s=void 0===t.numerals?Be:function(t){return function(e){return e.replace(/[0-9]/g,(function(e){return t[+e]}))}}(Re.call(t.numerals,String)),u=void 0===t.percent?"%":t.percent+"",l=void 0===t.minus?"\u2212":t.minus+"",c=void 0===t.nan?"NaN":t.nan+"";function f(t){var e=(t=De(t)).fill,n=t.align,f=t.sign,h=t.symbol,d=t.zero,p=t.width,g=t.comma,m=t.precision,y=t.trim,v=t.type;"n"===v?(g=!0,v="g"):Te[v]||(void 0===m&&(m=12),y=!0,v="g"),(d||"0"===e&&"="===n)&&(d=!0,e="0",n="=");var b="$"===h?i:"#"===h&&/[boxX]/.test(v)?"0"+v.toLowerCase():"",x="$"===h?o:/[%p]/.test(v)?u:"",_=Te[v],w=/[defgprs%]/.test(v);function A(t){var i,o,u,h=b,A=x;if("c"===v)A=_(t)+A,t="";else{var D=(t=+t)<0||1/t<0;if(t=isNaN(t)?c:_(Math.abs(t),m),y&&(t=function(t){t:for(var e,n=t.length,r=1,i=-1;r<n;++r)switch(t[r]){case".":i=e=r;break;case"0":0===i&&(i=r),e=r;break;default:if(!+t[r])break t;i>0&&(i=0)}return i>0?t.slice(0,i)+t.slice(e+1):t}(t)),D&&0===+t&&"+"!==f&&(D=!1),h=(D?"("===f?f:l:"-"===f||"("===f?"":f)+h,A=("s"===v?Pe[8+we/3]:"")+A+(D&&"("===f?")":""),w)for(i=-1,o=t.length;++i<o;)if(48>(u=t.charCodeAt(i))||u>57){A=(46===u?a+t.slice(i+1):t.slice(i))+A,t=t.slice(0,i);break}}g&&!d&&(t=r(t,1/0));var E=h.length+t.length+A.length,F=E<p?new Array(p-E+1).join(e):"";switch(g&&d&&(t=r(F+t,F.length?p-A.length:1/0),F=""),n){case"<":t=h+t+A+F;break;case"=":t=h+F+t+A;break;case"^":t=F.slice(0,E=F.length>>1)+h+t+A+F.slice(E);break;default:t=F+h+t+A}return s(t)}return m=void 0===m?6:/[gprs]/.test(v)?Math.max(1,Math.min(21,m)):Math.max(0,Math.min(20,m)),A.toString=function(){return t+""},A}return{format:f,formatPrefix:function(t,e){var n=f(((t=De(t)).type="f",t)),r=3*Math.max(-8,Math.min(8,Math.floor(Ce(e)/3))),i=Math.pow(10,-r),o=Pe[8+r/3];return function(t){return n(i*t)+o}}}}!function(t){Ne=Ue(t),Oe=Ne.format,ze=Ne.formatPrefix}({thousands:",",grouping:[3],currency:["$",""]});const Le=new Date,je=new Date;function Ie(t,e,n,r){function i(e){return t(e=0===arguments.length?new Date:new Date(+e)),e}return i.floor=e=>(t(e=new Date(+e)),e),i.ceil=n=>(t(n=new Date(n-1)),e(n,1),t(n),n),i.round=t=>{const e=i(t),n=i.ceil(t);return t-e<n-t?e:n},i.offset=(t,n)=>(e(t=new Date(+t),null==n?1:Math.floor(n)),t),i.range=(n,r,o)=>{const a=[];if(n=i.ceil(n),o=null==o?1:Math.floor(o),!(n<r)||!(o>0))return a;let s;do{a.push(s=new Date(+n)),e(n,o),t(n)}while(s<n&&n<r);return a},i.filter=n=>Ie((e=>{if(e>=e)for(;t(e),!n(e);)e.setTime(e-1)}),((t,r)=>{if(t>=t)if(r<0)for(;++r<=0;)for(;e(t,-1),!n(t););else for(;--r>=0;)for(;e(t,1),!n(t););})),n&&(i.count=(e,r)=>(Le.setTime(+e),je.setTime(+r),t(Le),t(je),Math.floor(n(Le,je))),i.every=t=>(t=Math.floor(t),isFinite(t)&&t>0?t>1?i.filter(r?e=>r(e)%t===0:e=>i.count(0,e)%t===0):i:null)),i}const qe=1e3,We=6e4,He=60*We,Xe=24*He,Ye=7*Xe,Ge=Ie((t=>t.setHours(0,0,0,0)),((t,e)=>t.setDate(t.getDate()+e)),((t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*We)/Xe),(t=>t.getDate()-1)),Ve=(Ge.range,Ie((t=>{t.setUTCHours(0,0,0,0)}),((t,e)=>{t.setUTCDate(t.getUTCDate()+e)}),((t,e)=>(e-t)/Xe),(t=>t.getUTCDate()-1))),Je=(Ve.range,Ie((t=>{t.setUTCHours(0,0,0,0)}),((t,e)=>{t.setUTCDate(t.getUTCDate()+e)}),((t,e)=>(e-t)/Xe),(t=>Math.floor(t/Xe))));Je.range;function Ze(t){return Ie((e=>{e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)}),((t,e)=>{t.setDate(t.getDate()+7*e)}),((t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*We)/Ye))}const Ke=Ze(0),Qe=Ze(1),tn=Ze(2),en=Ze(3),nn=Ze(4),rn=Ze(5),on=Ze(6);Ke.range,Qe.range,tn.range,en.range,nn.range,rn.range,on.range;function an(t){return Ie((e=>{e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)}),((t,e)=>{t.setUTCDate(t.getUTCDate()+7*e)}),((t,e)=>(e-t)/Ye))}const sn=an(0),un=an(1),ln=an(2),cn=an(3),fn=an(4),hn=an(5),dn=an(6),pn=(sn.range,un.range,ln.range,cn.range,fn.range,hn.range,dn.range,Ie((t=>{t.setMonth(0,1),t.setHours(0,0,0,0)}),((t,e)=>{t.setFullYear(t.getFullYear()+e)}),((t,e)=>e.getFullYear()-t.getFullYear()),(t=>t.getFullYear())));pn.every=t=>isFinite(t=Math.floor(t))&&t>0?Ie((e=>{e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)}),((e,n)=>{e.setFullYear(e.getFullYear()+n*t)})):null;pn.range;const gn=Ie((t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),((t,e)=>{t.setUTCFullYear(t.getUTCFullYear()+e)}),((t,e)=>e.getUTCFullYear()-t.getUTCFullYear()),(t=>t.getUTCFullYear()));gn.every=t=>isFinite(t=Math.floor(t))&&t>0?Ie((e=>{e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)}),((e,n)=>{e.setUTCFullYear(e.getUTCFullYear()+n*t)})):null;gn.range;const mn=Ie((t=>{t.setDate(1),t.setHours(0,0,0,0)}),((t,e)=>{t.setMonth(t.getMonth()+e)}),((t,e)=>e.getMonth()-t.getMonth()+12*(e.getFullYear()-t.getFullYear())),(t=>t.getMonth())),yn=(mn.range,Ie((t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)}),((t,e)=>{t.setUTCMonth(t.getUTCMonth()+e)}),((t,e)=>e.getUTCMonth()-t.getUTCMonth()+12*(e.getUTCFullYear()-t.getUTCFullYear())),(t=>t.getUTCMonth()))),vn=(yn.range,Ie((t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*qe-t.getMinutes()*We)}),((t,e)=>{t.setTime(+t+e*He)}),((t,e)=>(e-t)/He),(t=>t.getHours()))),bn=(vn.range,Ie((t=>{t.setUTCMinutes(0,0,0)}),((t,e)=>{t.setTime(+t+e*He)}),((t,e)=>(e-t)/He),(t=>t.getUTCHours()))),xn=(bn.range,Ie((t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*qe)}),((t,e)=>{t.setTime(+t+e*We)}),((t,e)=>(e-t)/We),(t=>t.getMinutes()))),_n=(xn.range,Ie((t=>{t.setUTCSeconds(0,0)}),((t,e)=>{t.setTime(+t+e*We)}),((t,e)=>(e-t)/We),(t=>t.getUTCMinutes()))),wn=(_n.range,Ie((t=>{t.setTime(t-t.getMilliseconds())}),((t,e)=>{t.setTime(+t+e*qe)}),((t,e)=>(e-t)/qe),(t=>t.getUTCSeconds()))),An=(wn.range,Ie((()=>{}),((t,e)=>{t.setTime(+t+e)}),((t,e)=>e-t)));An.every=t=>(t=Math.floor(t),isFinite(t)&&t>0?t>1?Ie((e=>{e.setTime(Math.floor(e/t)*t)}),((e,n)=>{e.setTime(+e+n*t)}),((e,n)=>(n-e)/t)):An:null);An.range;function Dn(t,e){return null==t||null==e?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function En(t,e){return null==t||null==e?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function Fn(t){let e,n,r;function i(t,r,i=0,o=t.length){if(i<o){if(0!==e(r,r))return o;do{const e=i+o>>>1;n(t[e],r)<0?i=e+1:o=e}while(i<o)}return i}return 2!==t.length?(e=Dn,n=(e,n)=>Dn(t(e),n),r=(e,n)=>t(e)-n):(e=t===Dn||t===En?t:Cn,n=t,r=t),{left:i,center:function(t,e,n=0,o=t.length){const a=i(t,e,n,o-1);return a>n&&r(t[a-1],e)>-r(t[a],e)?a-1:a},right:function(t,r,i=0,o=t.length){if(i<o){if(0!==e(r,r))return o;do{const e=i+o>>>1;n(t[e],r)<=0?i=e+1:o=e}while(i<o)}return i}}}function Cn(){return 0}const kn="year",Mn="quarter",Sn="month",$n="week",Tn="date",Bn="day",Nn="dayofyear",On="hours",zn="minutes",Rn="seconds",Pn="milliseconds",Un=[kn,Mn,Sn,$n,Tn,Bn,Nn,On,zn,Rn,Pn],Ln=Un.reduce(((t,e,n)=>(t[e]=1+n,t)),{});function jn(t){const e=(0,Kt.IX)(t).slice(),n={};e.length||(0,Kt.vU)("Missing time unit."),e.forEach((t=>{(0,Kt.nr)(Ln,t)?n[t]=1:(0,Kt.vU)(`Invalid time unit: ${t}.`)}));return(n[$n]||n[Bn]?1:0)+(n[Mn]||n[Sn]||n[Tn]?1:0)+(n[Nn]?1:0)>1&&(0,Kt.vU)(`Incompatible time units: ${t}`),e.sort(((t,e)=>Ln[t]-Ln[e])),e}const In={[kn]:"%Y ",[Mn]:"Q%q ",[Sn]:"%b ",[Tn]:"%d ",[$n]:"W%U ",[Bn]:"%a ",[Nn]:"%j ",[On]:"%H:00",[zn]:"00:%M",[Rn]:":%S",[Pn]:".%L",[`${kn}-${Sn}`]:"%Y-%m ",[`${kn}-${Sn}-${Tn}`]:"%Y-%m-%d ",[`${On}-${zn}`]:"%H:%M"};function qn(t,e){const n=(0,Kt.l7)({},In,e),r=jn(t),i=r.length;let o,a,s="",u=0;for(u=0;u<i;)for(o=r.length;o>u;--o)if(a=r.slice(u,o).join("-"),null!=n[a]){s+=n[a],u=o;break}return s.trim()}const Wn=new Date;function Hn(t){return Wn.setFullYear(t),Wn.setMonth(0),Wn.setDate(1),Wn.setHours(0,0,0,0),Wn}function Xn(t){return Gn(new Date(t))}function Yn(t){return Vn(new Date(t))}function Gn(t){return Ge.count(Hn(t.getFullYear())-1,t)}function Vn(t){return Ke.count(Hn(t.getFullYear())-1,t)}function Jn(t){return Hn(t).getDay()}function Zn(t,e,n,r,i,o,a){if(0<=t&&t<100){const s=new Date(-1,e,n,r,i,o,a);return s.setFullYear(t),s}return new Date(t,e,n,r,i,o,a)}function Kn(t){return tr(new Date(t))}function Qn(t){return er(new Date(t))}function tr(t){const e=Date.UTC(t.getUTCFullYear(),0,1);return Ve.count(e-1,t)}function er(t){const e=Date.UTC(t.getUTCFullYear(),0,1);return sn.count(e-1,t)}function nr(t){return Wn.setTime(Date.UTC(t,0,1)),Wn.getUTCDay()}function rr(t,e,n,r,i,o,a){if(0<=t&&t<100){const t=new Date(Date.UTC(-1,e,n,r,i,o,a));return t.setUTCFullYear(n.y),t}return new Date(Date.UTC(t,e,n,r,i,o,a))}function ir(t,e,n,r,i){const o=e||1,a=(0,Kt.fj)(t),s=(t,e,i)=>function(t,e,n,r){const i=n<=1?t:r?(e,i)=>r+n*Math.floor((t(e,i)-r)/n):(e,r)=>n*Math.floor(t(e,r)/n);return e?(t,n)=>e(i(t,n),n):i}(n[i=i||t],r[i],t===a&&o,e),u=new Date,l=(0,Kt.Rg)(t),c=l[kn]?s(kn):(0,Kt.a9)(2012),f=l[Sn]?s(Sn):l[Mn]?s(Mn):Kt.bM,h=l[$n]&&l[Bn]?s(Bn,1,$n+Bn):l[$n]?s($n,1):l[Bn]?s(Bn,1):l[Tn]?s(Tn,1):l[Nn]?s(Nn,1):Kt.kX,d=l[On]?s(On):Kt.bM,p=l[zn]?s(zn):Kt.bM,g=l[Rn]?s(Rn):Kt.bM,m=l[Pn]?s(Pn):Kt.bM;return function(t){u.setTime(+t);const e=c(u);return i(e,f(u),h(u,e),d(u),p(u),g(u),m(u))}}function or(t,e,n){return e+7*t-(n+6)%7}const ar={[kn]:t=>t.getFullYear(),[Mn]:t=>Math.floor(t.getMonth()/3),[Sn]:t=>t.getMonth(),[Tn]:t=>t.getDate(),[On]:t=>t.getHours(),[zn]:t=>t.getMinutes(),[Rn]:t=>t.getSeconds(),[Pn]:t=>t.getMilliseconds(),[Nn]:t=>Gn(t),[$n]:t=>Vn(t),[$n+Bn]:(t,e)=>or(Vn(t),t.getDay(),Jn(e)),[Bn]:(t,e)=>or(1,t.getDay(),Jn(e))},sr={[Mn]:t=>3*t,[$n]:(t,e)=>or(t,0,Jn(e))};function ur(t,e){return ir(t,e||1,ar,sr,Zn)}const lr={[kn]:t=>t.getUTCFullYear(),[Mn]:t=>Math.floor(t.getUTCMonth()/3),[Sn]:t=>t.getUTCMonth(),[Tn]:t=>t.getUTCDate(),[On]:t=>t.getUTCHours(),[zn]:t=>t.getUTCMinutes(),[Rn]:t=>t.getUTCSeconds(),[Pn]:t=>t.getUTCMilliseconds(),[Nn]:t=>tr(t),[$n]:t=>er(t),[Bn]:(t,e)=>or(1,t.getUTCDay(),nr(e)),[$n+Bn]:(t,e)=>or(er(t),t.getUTCDay(),nr(e))},cr={[Mn]:t=>3*t,[$n]:(t,e)=>or(t,0,nr(e))};function fr(t,e){return ir(t,e||1,lr,cr,rr)}const hr={[kn]:pn,[Mn]:mn.every(3),[Sn]:mn,[$n]:Ke,[Tn]:Ge,[Bn]:Ge,[Nn]:Ge,[On]:vn,[zn]:xn,[Rn]:wn,[Pn]:An},dr={[kn]:gn,[Mn]:yn.every(3),[Sn]:yn,[$n]:sn,[Tn]:Ve,[Bn]:Ve,[Nn]:Ve,[On]:bn,[zn]:_n,[Rn]:wn,[Pn]:An};function pr(t){return hr[t]}function gr(t){return dr[t]}function mr(t,e,n){return t?t.offset(e,n):void 0}function yr(t,e,n){return mr(pr(t),e,n)}function vr(t,e,n){return mr(gr(t),e,n)}function br(t,e,n,r){return t?t.range(e,n,r):void 0}function xr(t,e,n,r){return br(pr(t),e,n,r)}function _r(t,e,n,r){return br(gr(t),e,n,r)}const wr=1e3,Ar=6e4,Dr=36e5,Er=864e5,Fr=2592e6,Cr=31536e6,kr=[kn,Sn,Tn,On,zn,Rn,Pn],Mr=kr.slice(0,-1),Sr=Mr.slice(0,-1),$r=Sr.slice(0,-1),Tr=$r.slice(0,-1),Br=[kn,Sn],Nr=[kn],Or=[[Mr,1,wr],[Mr,5,5e3],[Mr,15,15e3],[Mr,30,3e4],[Sr,1,Ar],[Sr,5,3e5],[Sr,15,9e5],[Sr,30,18e5],[$r,1,Dr],[$r,3,108e5],[$r,6,216e5],[$r,12,432e5],[Tr,1,Er],[[kn,$n],1,6048e5],[Br,1,Fr],[Br,3,7776e6],[Nr,1,Cr]];function zr(t){const e=t.extent,n=t.maxbins||40,r=Math.abs((0,Kt.yP)(e))/n;let i,o,a=Fn((t=>t[2])).right(Or,r);return a===Or.length?(i=Nr,o=_e(e[0]/Cr,e[1]/Cr,n)):a?(a=Or[r/Or[a-1][2]<Or[a][2]/r?a-1:a],i=a[0],o=a[1]):(i=kr,o=Math.max(_e(e[0],e[1],n),1)),{units:i,step:o}}const Rr=new Date,Pr=new Date;function Ur(t,e,n,r){function i(e){return t(e=0===arguments.length?new Date:new Date(+e)),e}return i.floor=e=>(t(e=new Date(+e)),e),i.ceil=n=>(t(n=new Date(n-1)),e(n,1),t(n),n),i.round=t=>{const e=i(t),n=i.ceil(t);return t-e<n-t?e:n},i.offset=(t,n)=>(e(t=new Date(+t),null==n?1:Math.floor(n)),t),i.range=(n,r,o)=>{const a=[];if(n=i.ceil(n),o=null==o?1:Math.floor(o),!(n<r)||!(o>0))return a;let s;do{a.push(s=new Date(+n)),e(n,o),t(n)}while(s<n&&n<r);return a},i.filter=n=>Ur((e=>{if(e>=e)for(;t(e),!n(e);)e.setTime(e-1)}),((t,r)=>{if(t>=t)if(r<0)for(;++r<=0;)for(;e(t,-1),!n(t););else for(;--r>=0;)for(;e(t,1),!n(t););})),n&&(i.count=(e,r)=>(Rr.setTime(+e),Pr.setTime(+r),t(Rr),t(Pr),Math.floor(n(Rr,Pr))),i.every=t=>(t=Math.floor(t),isFinite(t)&&t>0?t>1?i.filter(r?e=>r(e)%t===0:e=>i.count(0,e)%t===0):i:null)),i}const Lr=6e4,jr=24*(60*Lr),Ir=7*jr;function qr(t){return Ur((e=>{e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)}),((t,e)=>{t.setDate(t.getDate()+7*e)}),((t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*Lr)/Ir))}const Wr=qr(0),Hr=qr(1),Xr=qr(2),Yr=qr(3),Gr=qr(4),Vr=qr(5),Jr=qr(6);Wr.range,Hr.range,Xr.range,Yr.range,Gr.range,Vr.range,Jr.range;function Zr(t){return Ur((e=>{e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)}),((t,e)=>{t.setUTCDate(t.getUTCDate()+7*e)}),((t,e)=>(e-t)/Ir))}const Kr=Zr(0),Qr=Zr(1),ti=Zr(2),ei=Zr(3),ni=Zr(4),ri=Zr(5),ii=Zr(6),oi=(Kr.range,Qr.range,ti.range,ei.range,ni.range,ri.range,ii.range,Ur((t=>t.setHours(0,0,0,0)),((t,e)=>t.setDate(t.getDate()+e)),((t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*Lr)/jr),(t=>t.getDate()-1))),ai=(oi.range,Ur((t=>{t.setUTCHours(0,0,0,0)}),((t,e)=>{t.setUTCDate(t.getUTCDate()+e)}),((t,e)=>(e-t)/jr),(t=>t.getUTCDate()-1))),si=(ai.range,Ur((t=>{t.setUTCHours(0,0,0,0)}),((t,e)=>{t.setUTCDate(t.getUTCDate()+e)}),((t,e)=>(e-t)/jr),(t=>Math.floor(t/jr)))),ui=(si.range,Ur((t=>{t.setMonth(0,1),t.setHours(0,0,0,0)}),((t,e)=>{t.setFullYear(t.getFullYear()+e)}),((t,e)=>e.getFullYear()-t.getFullYear()),(t=>t.getFullYear())));ui.every=t=>isFinite(t=Math.floor(t))&&t>0?Ur((e=>{e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)}),((e,n)=>{e.setFullYear(e.getFullYear()+n*t)})):null;ui.range;const li=Ur((t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),((t,e)=>{t.setUTCFullYear(t.getUTCFullYear()+e)}),((t,e)=>e.getUTCFullYear()-t.getUTCFullYear()),(t=>t.getUTCFullYear()));li.every=t=>isFinite(t=Math.floor(t))&&t>0?Ur((e=>{e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)}),((e,n)=>{e.setUTCFullYear(e.getUTCFullYear()+n*t)})):null;li.range;function ci(t){if(0<=t.y&&t.y<100){var e=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return e.setFullYear(t.y),e}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function fi(t){if(0<=t.y&&t.y<100){var e=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return e.setUTCFullYear(t.y),e}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function hi(t,e,n){return{y:t,m:e,d:n,H:0,M:0,S:0,L:0}}function di(t){var e=t.dateTime,n=t.date,r=t.time,i=t.periods,o=t.days,a=t.shortDays,s=t.months,u=t.shortMonths,l=Ei(i),c=Fi(i),f=Ei(o),h=Fi(o),d=Ei(a),p=Fi(a),g=Ei(s),m=Fi(s),y=Ei(u),v=Fi(u),b={a:function(t){return a[t.getDay()]},A:function(t){return o[t.getDay()]},b:function(t){return u[t.getMonth()]},B:function(t){return s[t.getMonth()]},c:null,d:Yi,e:Yi,f:Ki,g:lo,G:fo,H:Gi,I:Vi,j:Ji,L:Zi,m:Qi,M:to,p:function(t){return i[+(t.getHours()>=12)]},q:function(t){return 1+~~(t.getMonth()/3)},Q:Oo,s:zo,S:eo,u:no,U:ro,V:oo,w:ao,W:so,x:null,X:null,y:uo,Y:co,Z:ho,"%":No},x={a:function(t){return a[t.getUTCDay()]},A:function(t){return o[t.getUTCDay()]},b:function(t){return u[t.getUTCMonth()]},B:function(t){return s[t.getUTCMonth()]},c:null,d:po,e:po,f:bo,g:So,G:To,H:go,I:mo,j:yo,L:vo,m:xo,M:_o,p:function(t){return i[+(t.getUTCHours()>=12)]},q:function(t){return 1+~~(t.getUTCMonth()/3)},Q:Oo,s:zo,S:wo,u:Ao,U:Do,V:Fo,w:Co,W:ko,x:null,X:null,y:Mo,Y:$o,Z:Bo,"%":No},_={a:function(t,e,n){var r=d.exec(e.slice(n));return r?(t.w=p.get(r[0].toLowerCase()),n+r[0].length):-1},A:function(t,e,n){var r=f.exec(e.slice(n));return r?(t.w=h.get(r[0].toLowerCase()),n+r[0].length):-1},b:function(t,e,n){var r=y.exec(e.slice(n));return r?(t.m=v.get(r[0].toLowerCase()),n+r[0].length):-1},B:function(t,e,n){var r=g.exec(e.slice(n));return r?(t.m=m.get(r[0].toLowerCase()),n+r[0].length):-1},c:function(t,n,r){return D(t,e,n,r)},d:Ri,e:Ri,f:qi,g:Bi,G:Ti,H:Ui,I:Ui,j:Pi,L:Ii,m:zi,M:Li,p:function(t,e,n){var r=l.exec(e.slice(n));return r?(t.p=c.get(r[0].toLowerCase()),n+r[0].length):-1},q:Oi,Q:Hi,s:Xi,S:ji,u:ki,U:Mi,V:Si,w:Ci,W:$i,x:function(t,e,r){return D(t,n,e,r)},X:function(t,e,n){return D(t,r,e,n)},y:Bi,Y:Ti,Z:Ni,"%":Wi};function w(t,e){return function(n){var r,i,o,a=[],s=-1,u=0,l=t.length;for(n instanceof Date||(n=new Date(+n));++s<l;)37===t.charCodeAt(s)&&(a.push(t.slice(u,s)),null!=(i=bi[r=t.charAt(++s)])?r=t.charAt(++s):i="e"===r?" ":"0",(o=e[r])&&(r=o(n,i)),a.push(r),u=s+1);return a.push(t.slice(u,s)),a.join("")}}function A(t,e){return function(n){var r,i,o=hi(1900,void 0,1);if(D(o,t,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(e&&!("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?(i=(r=fi(hi(o.y,0,1))).getUTCDay(),r=i>4||0===i?Qr.ceil(r):Qr(r),r=ai.offset(r,7*(o.V-1)),o.y=r.getUTCFullYear(),o.m=r.getUTCMonth(),o.d=r.getUTCDate()+(o.w+6)%7):(i=(r=ci(hi(o.y,0,1))).getDay(),r=i>4||0===i?Hr.ceil(r):Hr(r),r=oi.offset(r,7*(o.V-1)),o.y=r.getFullYear(),o.m=r.getMonth(),o.d=r.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),i="Z"in o?fi(hi(o.y,0,1)).getUTCDay():ci(hi(o.y,0,1)).getDay(),o.m=0,o.d="W"in o?(o.w+6)%7+7*o.W-(i+5)%7:o.w+7*o.U-(i+6)%7);return"Z"in o?(o.H+=o.Z/100|0,o.M+=o.Z%100,fi(o)):ci(o)}}function D(t,e,n,r){for(var i,o,a=0,s=e.length,u=n.length;a<s;){if(r>=u)return-1;if(37===(i=e.charCodeAt(a++))){if(i=e.charAt(a++),!(o=_[i in bi?e.charAt(a++):i])||(r=o(t,n,r))<0)return-1}else if(i!=n.charCodeAt(r++))return-1}return r}return b.x=w(n,b),b.X=w(r,b),b.c=w(e,b),x.x=w(n,x),x.X=w(r,x),x.c=w(e,x),{format:function(t){var e=w(t+="",b);return e.toString=function(){return t},e},parse:function(t){var e=A(t+="",!1);return e.toString=function(){return t},e},utcFormat:function(t){var e=w(t+="",x);return e.toString=function(){return t},e},utcParse:function(t){var e=A(t+="",!0);return e.toString=function(){return t},e}}}var pi,gi,mi,yi,vi,bi={"-":"",_:" ",0:"0"},xi=/^\s*\d+/,_i=/^%/,wi=/[\\^$*+?|[\]().{}]/g;function Ai(t,e,n){var r=t<0?"-":"",i=(r?-t:t)+"",o=i.length;return r+(o<n?new Array(n-o+1).join(e)+i:i)}function Di(t){return t.replace(wi,"\\$&")}function Ei(t){return new RegExp("^(?:"+t.map(Di).join("|")+")","i")}function Fi(t){return new Map(t.map(((t,e)=>[t.toLowerCase(),e])))}function Ci(t,e,n){var r=xi.exec(e.slice(n,n+1));return r?(t.w=+r[0],n+r[0].length):-1}function ki(t,e,n){var r=xi.exec(e.slice(n,n+1));return r?(t.u=+r[0],n+r[0].length):-1}function Mi(t,e,n){var r=xi.exec(e.slice(n,n+2));return r?(t.U=+r[0],n+r[0].length):-1}function Si(t,e,n){var r=xi.exec(e.slice(n,n+2));return r?(t.V=+r[0],n+r[0].length):-1}function $i(t,e,n){var r=xi.exec(e.slice(n,n+2));return r?(t.W=+r[0],n+r[0].length):-1}function Ti(t,e,n){var r=xi.exec(e.slice(n,n+4));return r?(t.y=+r[0],n+r[0].length):-1}function Bi(t,e,n){var r=xi.exec(e.slice(n,n+2));return r?(t.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function Ni(t,e,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(n,n+6));return r?(t.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function Oi(t,e,n){var r=xi.exec(e.slice(n,n+1));return r?(t.q=3*r[0]-3,n+r[0].length):-1}function zi(t,e,n){var r=xi.exec(e.slice(n,n+2));return r?(t.m=r[0]-1,n+r[0].length):-1}function Ri(t,e,n){var r=xi.exec(e.slice(n,n+2));return r?(t.d=+r[0],n+r[0].length):-1}function Pi(t,e,n){var r=xi.exec(e.slice(n,n+3));return r?(t.m=0,t.d=+r[0],n+r[0].length):-1}function Ui(t,e,n){var r=xi.exec(e.slice(n,n+2));return r?(t.H=+r[0],n+r[0].length):-1}function Li(t,e,n){var r=xi.exec(e.slice(n,n+2));return r?(t.M=+r[0],n+r[0].length):-1}function ji(t,e,n){var r=xi.exec(e.slice(n,n+2));return r?(t.S=+r[0],n+r[0].length):-1}function Ii(t,e,n){var r=xi.exec(e.slice(n,n+3));return r?(t.L=+r[0],n+r[0].length):-1}function qi(t,e,n){var r=xi.exec(e.slice(n,n+6));return r?(t.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function Wi(t,e,n){var r=_i.exec(e.slice(n,n+1));return r?n+r[0].length:-1}function Hi(t,e,n){var r=xi.exec(e.slice(n));return r?(t.Q=+r[0],n+r[0].length):-1}function Xi(t,e,n){var r=xi.exec(e.slice(n));return r?(t.s=+r[0],n+r[0].length):-1}function Yi(t,e){return Ai(t.getDate(),e,2)}function Gi(t,e){return Ai(t.getHours(),e,2)}function Vi(t,e){return Ai(t.getHours()%12||12,e,2)}function Ji(t,e){return Ai(1+oi.count(ui(t),t),e,3)}function Zi(t,e){return Ai(t.getMilliseconds(),e,3)}function Ki(t,e){return Zi(t,e)+"000"}function Qi(t,e){return Ai(t.getMonth()+1,e,2)}function to(t,e){return Ai(t.getMinutes(),e,2)}function eo(t,e){return Ai(t.getSeconds(),e,2)}function no(t){var e=t.getDay();return 0===e?7:e}function ro(t,e){return Ai(Wr.count(ui(t)-1,t),e,2)}function io(t){var e=t.getDay();return e>=4||0===e?Gr(t):Gr.ceil(t)}function oo(t,e){return t=io(t),Ai(Gr.count(ui(t),t)+(4===ui(t).getDay()),e,2)}function ao(t){return t.getDay()}function so(t,e){return Ai(Hr.count(ui(t)-1,t),e,2)}function uo(t,e){return Ai(t.getFullYear()%100,e,2)}function lo(t,e){return Ai((t=io(t)).getFullYear()%100,e,2)}function co(t,e){return Ai(t.getFullYear()%1e4,e,4)}function fo(t,e){var n=t.getDay();return Ai((t=n>=4||0===n?Gr(t):Gr.ceil(t)).getFullYear()%1e4,e,4)}function ho(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+Ai(e/60|0,"0",2)+Ai(e%60,"0",2)}function po(t,e){return Ai(t.getUTCDate(),e,2)}function go(t,e){return Ai(t.getUTCHours(),e,2)}function mo(t,e){return Ai(t.getUTCHours()%12||12,e,2)}function yo(t,e){return Ai(1+ai.count(li(t),t),e,3)}function vo(t,e){return Ai(t.getUTCMilliseconds(),e,3)}function bo(t,e){return vo(t,e)+"000"}function xo(t,e){return Ai(t.getUTCMonth()+1,e,2)}function _o(t,e){return Ai(t.getUTCMinutes(),e,2)}function wo(t,e){return Ai(t.getUTCSeconds(),e,2)}function Ao(t){var e=t.getUTCDay();return 0===e?7:e}function Do(t,e){return Ai(Kr.count(li(t)-1,t),e,2)}function Eo(t){var e=t.getUTCDay();return e>=4||0===e?ni(t):ni.ceil(t)}function Fo(t,e){return t=Eo(t),Ai(ni.count(li(t),t)+(4===li(t).getUTCDay()),e,2)}function Co(t){return t.getUTCDay()}function ko(t,e){return Ai(Qr.count(li(t)-1,t),e,2)}function Mo(t,e){return Ai(t.getUTCFullYear()%100,e,2)}function So(t,e){return Ai((t=Eo(t)).getUTCFullYear()%100,e,2)}function $o(t,e){return Ai(t.getUTCFullYear()%1e4,e,4)}function To(t,e){var n=t.getUTCDay();return Ai((t=n>=4||0===n?ni(t):ni.ceil(t)).getUTCFullYear()%1e4,e,4)}function Bo(){return"+0000"}function No(){return"%"}function Oo(t){return+t}function zo(t){return Math.floor(+t/1e3)}function Ro(t){const e={};return n=>e[n]||(e[n]=t(n))}function Po(t){const e=Ro(t.format),n=t.formatPrefix;return{format:e,formatPrefix:n,formatFloat(t){const n=De(t||",");if(null==n.precision){switch(n.precision=12,n.type){case"%":n.precision-=2;break;case"e":n.precision-=1}return r=e(n),i=e(".1f")(1)[1],t=>{const e=r(t),n=e.indexOf(i);if(n<0)return e;let o=function(t,e){let n,r=t.lastIndexOf("e");if(r>0)return r;for(r=t.length;--r>e;)if(n=t.charCodeAt(r),n>=48&&n<=57)return r+1}(e,n);const a=o<e.length?e.slice(o):"";for(;--o>n;)if("0"!==e[o]){++o;break}return e.slice(0,o)+a}}return e(n);var r,i},formatSpan(t,r,i,o){o=De(null==o?",f":o);const a=_e(t,r,i),s=Math.max(Math.abs(t),Math.abs(r));let u;if(null==o.precision)switch(o.type){case"s":return isNaN(u=ke(a,s))||(o.precision=u),n(o,s);case"":case"e":case"g":case"p":case"r":isNaN(u=Me(a,s))||(o.precision=u-("e"===o.type));break;case"f":case"%":isNaN(u=Se(a))||(o.precision=u-2*("%"===o.type))}return e(o)}}}let Uo,Lo;function jo(){return Uo=Po({format:Oe,formatPrefix:ze})}function Io(t){return Po(Ue(t))}function qo(t){return arguments.length?Uo=Io(t):Uo}function Wo(t,e,n){n=n||{},(0,Kt.Kn)(n)||(0,Kt.vU)(`Invalid time multi-format specifier: ${n}`);const r=e(Rn),i=e(zn),o=e(On),a=e(Tn),s=e($n),u=e(Sn),l=e(Mn),c=e(kn),f=t(n[Pn]||".%L"),h=t(n[Rn]||":%S"),d=t(n[zn]||"%I:%M"),p=t(n[On]||"%I %p"),g=t(n[Tn]||n[Bn]||"%a %d"),m=t(n[$n]||"%b %d"),y=t(n[Sn]||"%B"),v=t(n[Mn]||"%B"),b=t(n[kn]||"%Y");return t=>(r(t)<t?f:i(t)<t?h:o(t)<t?d:a(t)<t?p:u(t)<t?s(t)<t?g:m:c(t)<t?l(t)<t?y:v:b)(t)}function Ho(t){const e=Ro(t.format),n=Ro(t.utcFormat);return{timeFormat:t=>(0,Kt.HD)(t)?e(t):Wo(e,pr,t),utcFormat:t=>(0,Kt.HD)(t)?n(t):Wo(n,gr,t),timeParse:Ro(t.parse),utcParse:Ro(t.utcParse)}}function Xo(){return Lo=Ho({format:gi,parse:mi,utcFormat:yi,utcParse:vi})}function Yo(t){return Ho(di(t))}function Go(t){return arguments.length?Lo=Yo(t):Lo}!function(t){pi=di(t),gi=pi.format,mi=pi.parse,yi=pi.utcFormat,vi=pi.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"]}),jo(),Xo();const Vo=(t,e)=>(0,Kt.l7)({},t,e);function Jo(t,e){const n=t?Io(t):qo(),r=e?Yo(e):Go();return Vo(n,r)}function Zo(t,e){const n=arguments.length;return n&&2!==n&&(0,Kt.vU)("defaultLocale expects either zero or two arguments."),n?Vo(qo(t),Go(e)):Vo(qo(),Go())}function Ko(){return jo(),Xo(),Zo()}const Qo=/^(data:|([A-Za-z]+:)?\/\/)/,ta=/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp|file|data):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i,ea=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205f\u3000]/g,na="file://";async function ra(t,e){const n=await this.sanitize(t,e),r=n.href;return n.localFile?this.file(r):this.http(r,e)}async function ia(t,e){e=(0,Kt.l7)({},this.options,e);const n=this.fileAccess,r={href:null};let i,o,a;const s=ta.test(t.replace(ea,""));null!=t&&"string"===typeof t&&s||(0,Kt.vU)("Sanitize failure, invalid URI: "+(0,Kt.m8)(t));const u=Qo.test(t);return(a=e.baseURL)&&!u&&(t.startsWith("/")||a.endsWith("/")||(t="/"+t),t=a+t),o=(i=t.startsWith(na))||"file"===e.mode||"http"!==e.mode&&!u&&n,i?t=t.slice(na.length):t.startsWith("//")&&("file"===e.defaultProtocol?(t=t.slice(2),o=!0):t=(e.defaultProtocol||"http")+":"+t),Object.defineProperty(r,"localFile",{value:!!o}),r.href=t,e.target&&(r.target=e.target+""),e.rel&&(r.rel=e.rel+""),"image"===e.context&&e.crossOrigin&&(r.crossOrigin=e.crossOrigin+""),r}function oa(t){return t?e=>new Promise(((n,r)=>{t.readFile(e,((t,e)=>{t?r(t):n(e)}))})):aa}async function aa(){(0,Kt.vU)("No file system access.")}function sa(t){return t?async function(e,n){const r=(0,Kt.l7)({},this.options.http,n),i=n&&n.response,o=await t(e,r);return o.ok?(0,Kt.mf)(o[i])?o[i]():o.text():(0,Kt.vU)(o.status+""+o.statusText)}:ua}async function ua(){(0,Kt.vU)("No HTTP fetch method available.")}const la=t=>null!=t&&t===t,ca=t=>!Number.isNaN(+t)&&!(t instanceof Date),fa={boolean:Kt.sw,integer:Kt.He,number:Kt.He,date:Kt.ZU,string:Kt.BB,unknown:Kt.yR},ha=[t=>"true"===t||"false"===t||!0===t||!1===t,t=>ca(t)&&Number.isInteger(+t),ca,t=>!Number.isNaN(Date.parse(t))],da=["boolean","integer","number","date"];function pa(t,e){if(!t||!t.length)return"unknown";const n=t.length,r=ha.length,i=ha.map(((t,e)=>e+1));for(let o,a,s=0,u=0;s<n;++s)for(a=e?t[s][e]:t[s],o=0;o<r;++o)if(i[o]&&la(a)&&!ha[o](a)&&(i[o]=0,++u,u===ha.length))return"string";return da[i.reduce(((t,e)=>0===t?e:t),0)-1]}function ga(t,e){return e.reduce(((e,n)=>(e[n]=pa(t,n),e)),{})}function ma(t){const e=function(e,n){const r={delimiter:t};return ya(e,n?(0,Kt.l7)(n,r):r)};return e.responseType="text",e}function ya(t,e){return e.header&&(t=e.header.map(Kt.m8).join(e.delimiter)+"\n"+t),ue(e.delimiter).parse(t+"")}function va(t,e){const n=e&&e.property?(0,Kt.EP)(e.property):Kt.yR;return!(0,Kt.Kn)(t)||(r=t,"function"===typeof Buffer&&(0,Kt.mf)(Buffer.isBuffer)&&Buffer.isBuffer(r))?n(JSON.parse(t)):function(t,e){!(0,Kt.kJ)(t)&&(0,Kt.TW)(t)&&(t=[...t]);return e&&e.copy?JSON.parse(JSON.stringify(t)):t}(n(t),e);var r}ya.responseType="text",va.responseType="json";const ba={interior:(t,e)=>t!==e,exterior:(t,e)=>t===e};function xa(t,e){let n,r,i,o;return t=va(t,e),e&&e.feature?(n=ce,i=e.feature):e&&e.mesh?(n=pe,i=e.mesh,o=ba[e.filter]):(0,Kt.vU)("Missing TopoJSON feature or mesh parameter."),r=(r=t.objects[i])?n(t,r,o):(0,Kt.vU)("Invalid TopoJSON object: "+i),r&&r.features||[r]}xa.responseType="json";const _a={dsv:ya,csv:ma(","),tsv:ma("\t"),json:va,topojson:xa};function wa(t,e){return arguments.length>1?(_a[t]=e,this):(0,Kt.nr)(_a,t)?_a[t]:null}function Aa(t){const e=wa(t);return e&&e.responseType||"text"}function Da(t,e,n,r){const i=wa((e=e||{}).type||"json");return i||(0,Kt.vU)("Unknown data format type: "+e.type),t=i(t,e),e.parse&&function(t,e,n,r){if(!t.length)return;const i=Go();n=n||i.timeParse,r=r||i.utcParse;let o,a,s,u,l,c,f=t.columns||Object.keys(t[0]);"auto"===e&&(e=ga(t,f));f=Object.keys(e);const h=f.map((t=>{const i=e[t];let o,a;if(i&&(i.startsWith("date:")||i.startsWith("utc:"))){o=i.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]?r:n)(a)}if(!fa[i])throw Error("Illegal format pattern: "+t+":"+i);return fa[i]}));for(s=0,l=t.length,c=f.length;s<l;++s)for(o=t[s],u=0;u<c;++u)a=f[u],o[a]=h[u](o[a])}(t,e.parse,n,r),(0,Kt.nr)(t,"columns")&&delete t.columns,t}const Ea=function(t,e){return n=>({options:n||{},sanitize:ia,load:ra,fileAccess:!!e,file:oa(e),http:sa(t)})}("undefined"!==typeof fetch&&fetch,null);function Fa(t){const e=t||Kt.yR,n=[],r={};return n.add=t=>{const i=e(t);return r[i]||(r[i]=1,n.push(t)),n},n.remove=t=>{const i=e(t);if(r[i]){r[i]=0;const e=n.indexOf(t);e>=0&&n.splice(e,1)}return n},n}async function Ca(t,e){try{await e(t)}catch(n){t.error(n)}}const ka=Symbol("vega_id");let Ma=1;function Sa(t){return!(!t||!$a(t))}function $a(t){return t[ka]}function Ta(t,e){return t[ka]=e,t}function Ba(t){const e=t===Object(t)?t:{data:t};return $a(e)?e:Ta(e,Ma++)}function Na(t){return Oa(t,Ba({}))}function Oa(t,e){for(const n in t)e[n]=t[n];return e}function za(t,e){return Ta(e,$a(t))}function Ra(t,e){return t?e?(n,r)=>t(n,r)||$a(e(n))-$a(e(r)):(e,n)=>t(e,n)||$a(e)-$a(n):null}function Pa(t){return t&&t.constructor===Ua}function Ua(){const t=[],e=[],n=[],r=[],i=[];let o=null,a=!1;return{constructor:Ua,insert(e){const n=(0,Kt.IX)(e),r=n.length;for(let i=0;i<r;++i)t.push(n[i]);return this},remove(t){const n=(0,Kt.mf)(t)?r:e,i=(0,Kt.IX)(t),o=i.length;for(let e=0;e<o;++e)n.push(i[e]);return this},modify(t,e,r){const o={field:e,value:(0,Kt.a9)(r)};return(0,Kt.mf)(t)?(o.filter=t,i.push(o)):(o.tuple=t,n.push(o)),this},encode(t,e){return(0,Kt.mf)(t)?i.push({filter:t,field:e}):n.push({tuple:t,field:e}),this},clean(t){return o=t,this},reflow(){return a=!0,this},pulse(s,u){const l={},c={};let f,h,d,p,g,m;for(f=0,h=u.length;f<h;++f)l[$a(u[f])]=1;for(f=0,h=e.length;f<h;++f)g=e[f],l[$a(g)]=-1;for(f=0,h=r.length;f<h;++f)p=r[f],u.forEach((t=>{p(t)&&(l[$a(t)]=-1)}));for(f=0,h=t.length;f<h;++f)g=t[f],m=$a(g),l[m]?l[m]=1:s.add.push(Ba(t[f]));for(f=0,h=u.length;f<h;++f)g=u[f],l[$a(g)]<0&&s.rem.push(g);function y(t,e,n){n?t[e]=n(t):s.encode=e,a||(c[$a(t)]=t)}for(f=0,h=n.length;f<h;++f)d=n[f],g=d.tuple,p=d.field,m=l[$a(g)],m>0&&(y(g,p,d.value),s.modifies(p));for(f=0,h=i.length;f<h;++f)d=i[f],p=d.filter,u.forEach((t=>{p(t)&&l[$a(t)]>0&&y(t,d.field,d.value)})),s.modifies(d.field);if(a)s.mod=e.length||r.length?u.filter((t=>l[$a(t)]>0)):u.slice();else for(m in c)s.mod.push(c[m]);return(o||null==o&&(e.length||r.length))&&s.clean(!0),s}}}const La="_:mod:_";function ja(){Object.defineProperty(this,La,{writable:!0,value:{}})}ja.prototype={set(t,e,n,r){const i=this,o=i[t],a=i[La];return null!=e&&e>=0?(o[e]!==n||r)&&(o[e]=n,a[e+":"+t]=-1,a[t]=-1):(o!==n||r)&&(i[t]=n,a[t]=(0,Kt.kJ)(n)?1+n.length:-1),i},modified(t,e){const n=this[La];if(!arguments.length){for(const t in n)if(n[t])return!0;return!1}if((0,Kt.kJ)(t)){for(let e=0;e<t.length;++e)if(n[t[e]])return!0;return!1}return null!=e&&e>=0?e+1<n[t]||!!n[e+":"+t]:!!n[t]},clear(){return this[La]={},this}};let Ia=0;const qa=new ja;function Wa(t,e,n,r){this.id=++Ia,this.value=t,this.stamp=-1,this.rank=-1,this.qrank=-1,this.flags=0,e&&(this._update=e),n&&this.parameters(n,r)}function Ha(t){return function(e){const n=this.flags;return 0===arguments.length?!!(n&t):(this.flags=e?n|t:n&~t,this)}}Wa.prototype={targets(){return this._targets||(this._targets=Fa(Kt.id))},set(t){return this.value!==t?(this.value=t,1):0},skip:Ha(1),modified:Ha(2),parameters(t,e,n){e=!1!==e;const r=this._argval=this._argval||new ja,i=this._argops=this._argops||[],o=[];let a,s,u,l;const c=(t,n,a)=>{a instanceof Wa?(a!==this&&(e&&a.targets().add(this),o.push(a)),i.push({op:a,name:t,index:n})):r.set(t,n,a)};for(a in t)if(s=t[a],"pulse"===a)(0,Kt.IX)(s).forEach((t=>{t instanceof Wa?t!==this&&(t.targets().add(this),o.push(t)):(0,Kt.vU)("Pulse parameters must be operator instances.")})),this.source=s;else if((0,Kt.kJ)(s))for(r.set(a,-1,Array(u=s.length)),l=0;l<u;++l)c(a,l,s[l]);else c(a,-1,s);return this.marshall().clear(),n&&(i.initonly=!0),o},marshall(t){const e=this._argval||qa,n=this._argops;let r,i,o,a;if(n){const s=n.length;for(i=0;i<s;++i)r=n[i],o=r.op,a=o.modified()&&o.stamp===t,e.set(r.name,r.index,o.value,a);if(n.initonly){for(i=0;i<s;++i)r=n[i],r.op.targets().remove(this);this._argops=null,this._update=null}}return e},detach(){const t=this._argops;let e,n,r,i;if(t)for(e=0,n=t.length;e<n;++e)r=t[e],i=r.op,i._targets&&i._targets.remove(this);this.pulse=null,this.source=null},evaluate(t){const e=this._update;if(e){const n=this.marshall(t.stamp),r=e.call(this,n,t);if(n.clear(),r!==this.value)this.value=r;else if(!this.modified())return t.StopPropagation}},run(t){if(t.stamp<this.stamp)return t.StopPropagation;let e;return this.skip()?(this.skip(!1),e=0):e=this.evaluate(t),this.pulse=e||t}};let Xa=0;function Ya(t,e,n){this.id=++Xa,this.value=null,n&&(this.receive=n),t&&(this._filter=t),e&&(this._apply=e)}function Ga(t,e,n){return new Ya(t,e,n)}Ya.prototype={_filter:Kt.yb,_apply:Kt.yR,targets(){return this._targets||(this._targets=Fa(Kt.id))},consume(t){return arguments.length?(this._consume=!!t,this):!!this._consume},receive(t){if(this._filter(t)){const e=this.value=this._apply(t),n=this._targets,r=n?n.length:0;for(let t=0;t<r;++t)n[t].receive(e);this._consume&&(t.preventDefault(),t.stopPropagation())}},filter(t){const e=Ga(t);return this.targets().add(e),e},apply(t){const e=Ga(null,t);return this.targets().add(e),e},merge(){const t=Ga();this.targets().add(t);for(let e=0,n=arguments.length;e<n;++e)arguments[e].targets().add(t);return t},throttle(t){let e=-1;return this.filter((()=>{const n=Date.now();return n-e>t?(e=n,1):0}))},debounce(t){const e=Ga();return this.targets().add(Ga(null,null,(0,Kt.Ds)(t,(t=>{const n=t.dataflow;e.receive(t),n&&n.run&&n.run()})))),e},between(t,e){let n=!1;return t.targets().add(Ga(null,null,(()=>n=!0))),e.targets().add(Ga(null,null,(()=>n=!1))),this.filter((()=>n))},detach(){this._filter=Kt.yb,this._targets=null}};const Va={skip:!0};function Ja(t,e,n,r,i,o){const a=(0,Kt.l7)({},o,Va);let s,u;(0,Kt.mf)(n)||(n=(0,Kt.a9)(n)),void 0===r?s=e=>t.touch(n(e)):(0,Kt.mf)(r)?(u=new Wa(null,r,i,!1),s=e=>{u.evaluate(e);const r=n(e),i=u.value;Pa(i)?t.pulse(r,i,o):t.update(r,i,a)}):s=e=>t.update(n(e),r,a),e.apply(s)}function Za(t,e,n,r,i,o){if(void 0===r)e.targets().add(n);else{const a=o||{},s=new Wa(null,function(t,e){return e=(0,Kt.mf)(e)?e:(0,Kt.a9)(e),t?function(n,r){const i=e(n,r);return t.skip()||(t.skip(i!==this.value).value=i),i}:e}(n,r),i,!1);s.modified(a.force),s.rank=e.rank,e.targets().add(s),n&&(s.skip(!0),s.value=n.value,s.targets().add(n),t.connect(n,[s]))}}const Ka={};function Qa(t,e,n){this.dataflow=t,this.stamp=null==e?-1:e,this.add=[],this.rem=[],this.mod=[],this.fields=null,this.encode=n||null}function ts(t,e){const n=[];return(0,Kt.FP)(t,e,(t=>n.push(t))),n}function es(t,e){const n={};return t.visit(e,(t=>{n[$a(t)]=1})),t=>n[$a(t)]?null:t}function ns(t,e){return t?(n,r)=>t(n,r)&&e(n,r):e}function rs(t,e,n,r){const i=this;let o=0;this.dataflow=t,this.stamp=e,this.fields=null,this.encode=r||null,this.pulses=n;for(const a of n)if(a.stamp===e){if(a.fields){const t=i.fields||(i.fields={});for(const e in a.fields)t[e]=1}a.changed(i.ADD)&&(o|=i.ADD),a.changed(i.REM)&&(o|=i.REM),a.changed(i.MOD)&&(o|=i.MOD)}this.changes=o}function is(t){return t.error("Dataflow already running. Use runAsync() to chain invocations."),t}Qa.prototype={StopPropagation:Ka,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(t){return new Qa(this.dataflow).init(this,t)},clone(){const t=this.fork(7);return t.add=t.add.slice(),t.rem=t.rem.slice(),t.mod=t.mod.slice(),t.source&&(t.source=t.source.slice()),t.materialize(23)},addAll(){let t=this;return!t.source||t.add===t.rem||!t.rem.length&&t.source.length===t.add.length||(t=new Qa(this.dataflow).init(this),t.add=t.source,t.rem=[]),t},init(t,e){const n=this;return n.stamp=t.stamp,n.encode=t.encode,!t.fields||64&e||(n.fields=t.fields),1&e?(n.addF=t.addF,n.add=t.add):(n.addF=null,n.add=[]),2&e?(n.remF=t.remF,n.rem=t.rem):(n.remF=null,n.rem=[]),4&e?(n.modF=t.modF,n.mod=t.mod):(n.modF=null,n.mod=[]),32&e?(n.srcF=null,n.source=null):(n.srcF=t.srcF,n.source=t.source,t.cleans&&(n.cleans=t.cleans)),n},runAfter(t){this.dataflow.runAfter(t)},changed(t){const e=t||7;return 1&e&&this.add.length||2&e&&this.rem.length||4&e&&this.mod.length},reflow(t){if(t)return this.fork(7).reflow();const e=this.add.length,n=this.source&&this.source.length;return n&&n!==e&&(this.mod=this.source,e&&this.filter(4,es(this,1))),this},clean(t){return arguments.length?(this.cleans=!!t,this):this.cleans},modifies(t){const e=this.fields||(this.fields={});return(0,Kt.kJ)(t)?t.forEach((t=>e[t]=!0)):e[t]=!0,this},modified(t,e){const n=this.fields;return!(!e&&!this.mod.length||!n)&&(arguments.length?(0,Kt.kJ)(t)?t.some((t=>n[t])):n[t]:!!n)},filter(t,e){const n=this;return 1&t&&(n.addF=ns(n.addF,e)),2&t&&(n.remF=ns(n.remF,e)),4&t&&(n.modF=ns(n.modF,e)),16&t&&(n.srcF=ns(n.srcF,e)),n},materialize(t){const e=this;return 1&(t=t||7)&&e.addF&&(e.add=ts(e.add,e.addF),e.addF=null),2&t&&e.remF&&(e.rem=ts(e.rem,e.remF),e.remF=null),4&t&&e.modF&&(e.mod=ts(e.mod,e.modF),e.modF=null),16&t&&e.srcF&&(e.source=e.source.filter(e.srcF),e.srcF=null),e},visit(t,e){const n=this,r=e;if(16&t)return(0,Kt.FP)(n.source,n.srcF,r),n;1&t&&(0,Kt.FP)(n.add,n.addF,r),2&t&&(0,Kt.FP)(n.rem,n.remF,r),4&t&&(0,Kt.FP)(n.mod,n.modF,r);const i=n.source;if(8&t&&i){const t=n.add.length+n.mod.length;t===i.length||(t?(0,Kt.FP)(i,es(n,5),r):(0,Kt.FP)(i,n.srcF,r))}return n}},(0,Kt.XW)(rs,Qa,{fork(t){const e=new Qa(this.dataflow).init(this,t&this.NO_FIELDS);return void 0!==t&&(t&e.ADD&&this.visit(e.ADD,(t=>e.add.push(t))),t&e.REM&&this.visit(e.REM,(t=>e.rem.push(t))),t&e.MOD&&this.visit(e.MOD,(t=>e.mod.push(t)))),e},changed(t){return this.changes&t},modified(t){const e=this,n=e.fields;return n&&e.changes&e.MOD?(0,Kt.kJ)(t)?t.some((t=>n[t])):n[t]:0},filter(){(0,Kt.vU)("MultiPulse does not support filtering.")},materialize(){(0,Kt.vU)("MultiPulse does not support materialization.")},visit(t,e){const n=this,r=n.pulses,i=r.length;let o=0;if(t&n.SOURCE)for(;o<i;++o)r[o].visit(t,e);else for(;o<i;++o)r[o].stamp===n.stamp&&r[o].visit(t,e);return n}});const os={skip:!1,force:!1};function as(t){let e=[];return{clear:()=>e=[],size:()=>e.length,peek:()=>e[0],push:n=>(e.push(n),ss(e,0,e.length-1,t)),pop:()=>{const n=e.pop();let r;return e.length?(r=e[0],e[0]=n,function(t,e,n){const r=e,i=t.length,o=t[e];let a,s=1+(e<<1);for(;s<i;)a=s+1,a<i&&n(t[s],t[a])>=0&&(s=a),t[e]=t[s],s=1+((e=s)<<1);t[e]=o,ss(t,r,e,n)}(e,0,t)):r=n,r}}}function ss(t,e,n,r){let i,o;const a=t[n];for(;n>e&&(o=n-1>>1,i=t[o],r(a,i)<0);)t[n]=i,n=o;return t[n]=a}function us(){this.logger((0,Kt.kg)()),this.logLevel(Kt.jj),this._clock=0,this._rank=0,this._locale=Zo();try{this._loader=Ea()}catch(t){}this._touched=Fa(Kt.id),this._input={},this._pulse=null,this._heap=as(((t,e)=>t.qrank-e.qrank)),this._postrun=[]}function ls(t){return function(){return this._log[t].apply(this,arguments)}}function cs(t,e){Wa.call(this,t,null,e)}us.prototype={stamp(){return this._clock},loader(t){return arguments.length?(this._loader=t,this):this._loader},locale(t){return arguments.length?(this._locale=t,this):this._locale},logger(t){return arguments.length?(this._log=t,this):this._log},error:ls("error"),warn:ls("warn"),info:ls("info"),debug:ls("debug"),logLevel:ls("level"),cleanThreshold:1e4,add:function(t,e,n,r){let i,o=1;return t instanceof Wa?i=t:t&&t.prototype instanceof Wa?i=new t:(0,Kt.mf)(t)?i=new Wa(null,t):(o=0,i=new Wa(t,e)),this.rank(i),o&&(r=n,n=e),n&&this.connect(i,i.parameters(n,r)),this.touch(i),i},connect:function(t,e){const n=t.rank,r=e.length;for(let i=0;i<r;++i)if(n<e[i].rank)return void this.rerank(t)},rank:function(t){t.rank=++this._rank},rerank:function(t){const e=[t];let n,r,i;for(;e.length;)if(this.rank(n=e.pop()),r=n._targets)for(i=r.length;--i>=0;)e.push(n=r[i]),n===t&&(0,Kt.vU)("Cycle detected in dataflow graph.")},pulse:function(t,e,n){this.touch(t,n||os);const r=new Qa(this,this._clock+(this._pulse?0:1)),i=t.pulse&&t.pulse.source||[];return r.target=t,this._input[t.id]=e.pulse(r,i),this},touch:function(t,e){const n=e||os;return this._pulse?this._enqueue(t):this._touched.add(t),n.skip&&t.skip(!0),this},update:function(t,e,n){const r=n||os;return(t.set(e)||r.force)&&this.touch(t,r),this},changeset:Ua,ingest:function(t,e,n){return e=this.parse(e,n),this.pulse(t,this.changeset().insert(e))},parse:function(t,e){const n=this.locale();return Da(t,e,n.timeParse,n.utcParse)},preload:async function(t,e,n){const r=this,i=r._pending||function(t){let e;const n=new Promise((t=>e=t));return n.requests=0,n.done=()=>{0===--n.requests&&(t._pending=null,e(t))},t._pending=n}(r);i.requests+=1;const o=await r.request(e,n);return r.pulse(t,r.changeset().remove(Kt.yb).insert(o.data||[])),i.done(),o},request:async function(t,e){const n=this;let r,i=0;try{r=await n.loader().load(t,{context:"dataflow",response:Aa(e&&e.type)});try{r=n.parse(r,e)}catch(o){i=-2,n.warn("Data ingestion failed",t,o)}}catch(o){i=-1,n.warn("Loading failed",t,o)}return{data:r,status:i}},events:function(t,e,n,r){const i=this,o=Ga(n,r),a=function(t){t.dataflow=i;try{o.receive(t)}catch(e){i.error(e)}finally{i.run()}};let s;s="string"===typeof t&&"undefined"!==typeof document?document.querySelectorAll(t):(0,Kt.IX)(t);const u=s.length;for(let l=0;l<u;++l)s[l].addEventListener(e,a);return o},on:function(t,e,n,r,i){return(t instanceof Wa?Za:Ja)(this,t,e,n,r,i),this},evaluate:async function(t,e,n){const r=this,i=[];if(r._pulse)return is(r);if(r._pending&&await r._pending,e&&await Ca(r,e),!r._touched.length)return r.debug("Dataflow invoked, but nothing to do."),r;const o=++r._clock;r._pulse=new Qa(r,o,t),r._touched.forEach((t=>r._enqueue(t,!0))),r._touched=Fa(Kt.id);let a,s,u,l=0;try{for(;r._heap.size()>0;)a=r._heap.pop(),a.rank===a.qrank?(s=a.run(r._getPulse(a,t)),s.then?s=await s:s.async&&(i.push(s.async),s=Ka),s!==Ka&&a._targets&&a._targets.forEach((t=>r._enqueue(t))),++l):r._enqueue(a,!0)}catch(c){r._heap.clear(),u=c}if(r._input={},r._pulse=null,r.debug(`Pulse ${o}: ${l} operators`),u&&(r._postrun=[],r.error(u)),r._postrun.length){const t=r._postrun.sort(((t,e)=>e.priority-t.priority));r._postrun=[];for(let e=0;e<t.length;++e)await Ca(r,t[e].callback)}return n&&await Ca(r,n),i.length&&Promise.all(i).then((t=>r.runAsync(null,(()=>{t.forEach((t=>{try{t(r)}catch(c){r.error(c)}}))})))),r},run:function(t,e,n){return this._pulse?is(this):(this.evaluate(t,e,n),this)},runAsync:async function(t,e,n){for(;this._running;)await this._running;const r=()=>this._running=null;return(this._running=this.evaluate(t,e,n)).then(r,r),this._running},runAfter:function(t,e,n){if(this._pulse||e)this._postrun.push({priority:n||0,callback:t});else try{t(this)}catch(r){this.error(r)}},_enqueue:function(t,e){const n=t.stamp<this._clock;n&&(t.stamp=this._clock),(n||e)&&(t.qrank=t.rank,this._heap.push(t))},_getPulse:function(t,e){const n=t.source,r=this._clock;return n&&(0,Kt.kJ)(n)?new rs(this,r,n.map((t=>t.pulse)),e):this._input[t.id]||function(t,e){if(e&&e.stamp===t.stamp)return e;t=t.fork(),e&&e!==Ka&&(t.source=e.source);return t}(this._pulse,n&&n.pulse)}},(0,Kt.XW)(cs,Wa,{run(t){if(t.stamp<this.stamp)return t.StopPropagation;let e;return this.skip()?this.skip(!1):e=this.evaluate(t),e=e||t,e.then?e=e.then((t=>this.pulse=t)):e!==t.StopPropagation&&(this.pulse=e),e},evaluate(t){const e=this.marshall(t.stamp),n=this.transform(e,t);return e.clear(),n},transform(){}});const fs={};function hs(t){const e=ds(t);return e&&e.Definition||null}function ds(t){return t=t&&t.toLowerCase(),(0,Kt.nr)(fs,t)?fs[t]:null}function ps(t,e){let n;if(void 0===e)for(const r of t)null!=r&&(n<r||void 0===n&&r>=r)&&(n=r);else{let r=-1;for(let i of t)null!=(i=e(i,++r,t))&&(n<i||void 0===n&&i>=i)&&(n=i)}return n}function gs(t,e){let n;if(void 0===e)for(const r of t)null!=r&&(n>r||void 0===n&&r>=r)&&(n=r);else{let r=-1;for(let i of t)null!=(i=e(i,++r,t))&&(n>i||void 0===n&&i>=i)&&(n=i)}return n}function ms(t=Dn){if(t===Dn)return ys;if("function"!==typeof t)throw new TypeError("compare is not a function");return(e,n)=>{const r=t(e,n);return r||0===r?r:(0===t(n,n))-(0===t(e,e))}}function ys(t,e){return(null==t||!(t>=t))-(null==e||!(e>=e))||(t<e?-1:t>e?1:0)}function vs(t,e,n=0,r=1/0,i){if(e=Math.floor(e),n=Math.floor(Math.max(0,n)),r=Math.floor(Math.min(t.length-1,r)),!(n<=e&&e<=r))return t;for(i=void 0===i?ys:ms(i);r>n;){if(r-n>600){const o=r-n+1,a=e-n+1,s=Math.log(o),u=.5*Math.exp(2*s/3),l=.5*Math.sqrt(s*u*(o-u)/o)*(a-o/2<0?-1:1);vs(t,e,Math.max(n,Math.floor(e-a*u/o+l)),Math.min(r,Math.floor(e+(o-a)*u/o+l)),i)}const o=t[e];let a=n,s=r;for(bs(t,n,e),i(t[r],o)>0&&bs(t,n,r);a<s;){for(bs(t,a,s),++a,--s;i(t[a],o)<0;)++a;for(;i(t[s],o)>0;)--s}0===i(t[n],o)?bs(t,n,s):(++s,bs(t,s,r)),s<=e&&(n=s+1),e<=s&&(r=s-1)}return t}function bs(t,e,n){const r=t[e];t[e]=t[n],t[n]=r}function xs(t){return null===t?NaN:+t}function _s(t,e,n){if(t=Float64Array.from(function*(t,e){if(void 0===e)for(let n of t)null!=n&&(n=+n)>=n&&(yield n);else{let n=-1;for(let r of t)null!=(r=e(r,++n,t))&&(r=+r)>=r&&(yield r)}}(t,n)),(r=t.length)&&!isNaN(e=+e)){if(e<=0||r<2)return gs(t);if(e>=1)return ps(t);var r,i=(r-1)*e,o=Math.floor(i),a=ps(vs(t,o).subarray(0,o+1));return a+(gs(t.subarray(o+1))-a)*(i-o)}}function ws(t,e,n=xs){if((r=t.length)&&!isNaN(e=+e)){if(e<=0||r<2)return+n(t[0],0,t);if(e>=1)return+n(t[r-1],r-1,t);var r,i=(r-1)*e,o=Math.floor(i),a=+n(t[o],o,t);return a+(+n(t[o+1],o+1,t)-a)*(i-o)}}function As(t,e){const n=function(t,e){let n,r=0,i=0,o=0;if(void 0===e)for(let a of t)null!=a&&(a=+a)>=a&&(n=a-i,i+=n/++r,o+=n*(a-i));else{let a=-1;for(let s of t)null!=(s=e(s,++a,t))&&(s=+s)>=s&&(n=s-i,i+=n/++r,o+=n*(s-i))}if(r>1)return o/(r-1)}(t,e);return n?Math.sqrt(n):n}function*Ds(t,e){if(null==e)for(let n of t)null!=n&&""!==n&&(n=+n)>=n&&(yield n);else{let n=-1;for(let r of t)r=e(r,++n,t),null!=r&&""!==r&&(r=+r)>=r&&(yield r)}}function Es(t,e,n){const r=Float64Array.from(Ds(t,n));return r.sort(Dn),e.map((t=>ws(r,t)))}function Fs(t,e){return Es(t,[.25,.5,.75],e)}function Cs(t,e){const n=t.length,r=As(t,e),i=Fs(t,e),o=(i[2]-i[0])/1.34;return 1.06*(Math.min(r,o)||r||Math.abs(i[0])||1)*Math.pow(n,-.2)}var ks=Math.random;function Ms(t,e,n,r){r=r||(t=>t);const i=t.length,o=new Float64Array(i);let a,s=0,u=1,l=r(t[0]),c=l,f=l+e;for(;u<i;++u){if(a=r(t[u]),a>=f){for(c=(l+c)/2;s<u;++s)o[s]=c;f=a+e,l=a}c=a}for(c=(l+c)/2;s<u;++s)o[s]=c;return n?function(t,e){const n=t.length;let r,i,o=0,a=1;for(;t[o]===t[a];)++a;for(;a<n;){for(r=a+1;t[a]===t[r];)++r;if(t[a]-t[a-1]<e){for(i=a+(o+r-a-a>>1);i<a;)t[i++]=t[a];for(;i>a;)t[i--]=t[o]}o=a,a=r}return t}(o,e+e/4):o}const Ss=Math.sqrt(2*Math.PI),$s=Math.SQRT2;let Ts=NaN;function Bs(t,e){t=t||0,e=null==e?1:e;let n,r,i=0,o=0;if(Ts===Ts)i=Ts,Ts=NaN;else{do{i=2*ks()-1,o=2*ks()-1,n=i*i+o*o}while(0===n||n>1);r=Math.sqrt(-2*Math.log(n)/n),i*=r,Ts=o*r}return t+i*e}function Ns(t,e,n){const r=(t-(e||0))/(n=null==n?1:n);return Math.exp(-.5*r*r)/(n*Ss)}function Os(t,e,n){const r=(t-(e=e||0))/(n=null==n?1:n),i=Math.abs(r);let o;if(i>37)o=0;else{const t=Math.exp(-i*i/2);let e;i<7.07106781186547?(e=.0352624965998911*i+.700383064443688,e=e*i+6.37396220353165,e=e*i+33.912866078383,e=e*i+112.079291497871,e=e*i+221.213596169931,e=e*i+220.206867912376,o=t*e,e=.0883883476483184*i+1.75566716318264,e=e*i+16.064177579207,e=e*i+86.7807322029461,e=e*i+296.564248779674,e=e*i+637.333633378831,e=e*i+793.826512519948,e=e*i+440.413735824752,o/=e):(e=i+.65,e=i+4/e,e=i+3/e,e=i+2/e,e=i+1/e,o=t/e/2.506628274631)}return r>0?1-o:o}function zs(t,e,n){return t<0||t>1?NaN:(e||0)+(null==n?1:n)*$s*function(t){let e,n=-Math.log((1-t)*(1+t));n<6.25?(n-=3.125,e=-364441206401782e-35,e=e*n-16850591381820166e-35,e=128584807152564e-32+e*n,e=11157877678025181e-33+e*n,e=e*n-1333171662854621e-31,e=20972767875968562e-33+e*n,e=6637638134358324e-30+e*n,e=e*n-4054566272975207e-29,e=e*n-8151934197605472e-29,e=26335093153082323e-28+e*n,e=e*n-12975133253453532e-27,e=e*n-5415412054294628e-26,e=1.0512122733215323e-9+e*n,e=e*n-4.112633980346984e-9,e=e*n-2.9070369957882005e-8,e=4.2347877827932404e-7+e*n,e=e*n-13654692000834679e-22,e=e*n-13882523362786469e-21,e=.00018673420803405714+e*n,e=e*n-.000740702534166267,e=e*n-.006033670871430149,e=.24015818242558962+e*n,e=1.6536545626831027+e*n):n<16?(n=Math.sqrt(n)-3.25,e=2.2137376921775787e-9,e=9.075656193888539e-8+e*n,e=e*n-2.7517406297064545e-7,e=1.8239629214389228e-8+e*n,e=15027403968909828e-22+e*n,e=e*n-4013867526981546e-21,e=29234449089955446e-22+e*n,e=12475304481671779e-21+e*n,e=e*n-47318229009055734e-21,e=6828485145957318e-20+e*n,e=24031110387097894e-21+e*n,e=e*n-.0003550375203628475,e=.0009532893797373805+e*n,e=e*n-.0016882755560235047,e=.002491442096107851+e*n,e=e*n-.003751208507569241,e=.005370914553590064+e*n,e=1.0052589676941592+e*n,e=3.0838856104922208+e*n):Number.isFinite(n)?(n=Math.sqrt(n)-5,e=-27109920616438573e-27,e=e*n-2.555641816996525e-10,e=1.5076572693500548e-9+e*n,e=e*n-3.789465440126737e-9,e=7.61570120807834e-9+e*n,e=e*n-1.496002662714924e-8,e=2.914795345090108e-8+e*n,e=e*n-6.771199775845234e-8,e=2.2900482228026655e-7+e*n,e=e*n-9.9298272942317e-7,e=4526062597223154e-21+e*n,e=e*n-1968177810553167e-20,e=7599527703001776e-20+e*n,e=e*n-.00021503011930044477,e=e*n-.00013871931833623122,e=1.0103004648645344+e*n,e=4.849906401408584+e*n):e=1/0;return e*t}(2*t-1)}function Rs(t,e){let n,r;const i={mean(t){return arguments.length?(n=t||0,i):n},stdev(t){return arguments.length?(r=null==t?1:t,i):r},sample:()=>Bs(n,r),pdf:t=>Ns(t,n,r),cdf:t=>Os(t,n,r),icdf:t=>zs(t,n,r)};return i.mean(t).stdev(e)}function Ps(t,e){const n=Rs();let r=0;const i={data(n){return arguments.length?(t=n,r=n?n.length:0,i.bandwidth(e)):t},bandwidth(n){return arguments.length?(!(e=n)&&t&&(e=Cs(t)),i):e},sample:()=>t[~~(ks()*r)]+e*n.sample(),pdf(i){let o=0,a=0;for(;a<r;++a)o+=n.pdf((i-t[a])/e);return o/e/r},cdf(i){let o=0,a=0;for(;a<r;++a)o+=n.cdf((i-t[a])/e);return o/r},icdf(){throw Error("KDE icdf not supported.")}};return i.data(t)}function Us(t,e){return t=t||0,e=null==e?1:e,Math.exp(t+Bs()*e)}function Ls(t,e,n){if(t<=0)return 0;e=e||0,n=null==n?1:n;const r=(Math.log(t)-e)/n;return Math.exp(-.5*r*r)/(n*Ss*t)}function js(t,e,n){return Os(Math.log(t),e,n)}function Is(t,e,n){return Math.exp(zs(t,e,n))}function qs(t,e){return null==e&&(e=null==t?1:t,t=0),t+(e-t)*ks()}function Ws(t,e,n){return null==n&&(n=null==e?1:e,e=0),t>=e&&t<=n?1/(n-e):0}function Hs(t,e,n){return null==n&&(n=null==e?1:e,e=0),t<e?0:t>n?1:(t-e)/(n-e)}function Xs(t,e,n){return null==n&&(n=null==e?1:e,e=0),t>=0&&t<=1?e+t*(n-e):NaN}const Ys=.5*Math.PI/180;function Gs(t,e,n,r){n=n||25,r=Math.max(n,r||200);const i=e=>[e,t(e)],o=e[0],a=e[1],s=a-o,u=s/r,l=[i(o)],c=[];if(n===r){for(let t=1;t<r;++t)l.push(i(o+t/n*s));return l.push(i(a)),l}c.push(i(a));for(let g=n;--g>0;)c.push(i(o+g/n*s));let f=l[0],h=c[c.length-1];const d=1/s,p=function(t,e){let n=t,r=t;const i=e.length;for(let o=0;o<i;++o){const t=e[o][1];t<n&&(n=t),t>r&&(r=t)}return 1/(r-n)}(f[1],c);for(;h;){const t=i((f[0]+h[0])/2);t[0]-f[0]>=u&&Vs(f,t,h,d,p)>Ys?c.push(t):(f=h,l.push(h),c.pop()),h=c[c.length-1]}return l}function Vs(t,e,n,r,i){const o=Math.atan2(i*(n[1]-t[1]),r*(n[0]-t[0])),a=Math.atan2(i*(e[1]-t[1]),r*(e[0]-t[0]));return Math.abs(o-a)}function Js(t,e){return _s(t,.5,e)}function Zs(t,e,n){t=+t,e=+e,n=(i=arguments.length)<2?(e=t,t=0,1):i<3?1:+n;for(var r=-1,i=0|Math.max(0,Math.ceil((e-t)/n)),o=new Array(i);++r<i;)o[r]=t+r*n;return o}function Ks(t){return t&&t.length?1===t.length?t[0]:(e=t,t=>{const n=e.length;let r=1,i=String(e[0](t));for(;r<n;++r)i+="|"+e[r](t);return i}):function(){return""};var e}function Qs(t,e,n){return n||t+(e?"_"+e:"")}const tu=()=>{},eu={init:tu,add:tu,rem:tu,idx:0},nu={values:{init:t=>t.cell.store=!0,value:t=>t.cell.data.values(),idx:-1},count:{value:t=>t.cell.num},__count__:{value:t=>t.missing+t.valid},missing:{value:t=>t.missing},valid:{value:t=>t.valid},sum:{init:t=>t.sum=0,value:t=>t.sum,add:(t,e)=>t.sum+=+e,rem:(t,e)=>t.sum-=e},product:{init:t=>t.product=1,value:t=>t.valid?t.product:void 0,add:(t,e)=>t.product*=e,rem:(t,e)=>t.product/=e},mean:{init:t=>t.mean=0,value:t=>t.valid?t.mean:void 0,add:(t,e)=>(t.mean_d=e-t.mean,t.mean+=t.mean_d/t.valid),rem:(t,e)=>(t.mean_d=e-t.mean,t.mean-=t.valid?t.mean_d/t.valid:t.mean)},average:{value:t=>t.valid?t.mean:void 0,req:["mean"],idx:1},variance:{init:t=>t.dev=0,value:t=>t.valid>1?t.dev/(t.valid-1):void 0,add:(t,e)=>t.dev+=t.mean_d*(e-t.mean),rem:(t,e)=>t.dev-=t.mean_d*(e-t.mean),req:["mean"],idx:1},variancep:{value:t=>t.valid>1?t.dev/t.valid:void 0,req:["variance"],idx:2},stdev:{value:t=>t.valid>1?Math.sqrt(t.dev/(t.valid-1)):void 0,req:["variance"],idx:2},stdevp:{value:t=>t.valid>1?Math.sqrt(t.dev/t.valid):void 0,req:["variance"],idx:2},stderr:{value:t=>t.valid>1?Math.sqrt(t.dev/(t.valid*(t.valid-1))):void 0,req:["variance"],idx:2},distinct:{value:t=>t.cell.data.distinct(t.get),req:["values"],idx:3},ci0:{value:t=>t.cell.data.ci0(t.get),req:["values"],idx:3},ci1:{value:t=>t.cell.data.ci1(t.get),req:["values"],idx:3},median:{value:t=>t.cell.data.q2(t.get),req:["values"],idx:3},q1:{value:t=>t.cell.data.q1(t.get),req:["values"],idx:3},q3:{value:t=>t.cell.data.q3(t.get),req:["values"],idx:3},min:{init:t=>t.min=void 0,value:t=>t.min=Number.isNaN(t.min)?t.cell.data.min(t.get):t.min,add:(t,e)=>{(e<t.min||void 0===t.min)&&(t.min=e)},rem:(t,e)=>{e<=t.min&&(t.min=NaN)},req:["values"],idx:4},max:{init:t=>t.max=void 0,value:t=>t.max=Number.isNaN(t.max)?t.cell.data.max(t.get):t.max,add:(t,e)=>{(e>t.max||void 0===t.max)&&(t.max=e)},rem:(t,e)=>{e>=t.max&&(t.max=NaN)},req:["values"],idx:4},argmin:{init:t=>t.argmin=void 0,value:t=>t.argmin||t.cell.data.argmin(t.get),add:(t,e,n)=>{e<t.min&&(t.argmin=n)},rem:(t,e)=>{e<=t.min&&(t.argmin=void 0)},req:["min","values"],idx:3},argmax:{init:t=>t.argmax=void 0,value:t=>t.argmax||t.cell.data.argmax(t.get),add:(t,e,n)=>{e>t.max&&(t.argmax=n)},rem:(t,e)=>{e>=t.max&&(t.argmax=void 0)},req:["max","values"],idx:3}},ru=Object.keys(nu).filter((t=>"__count__"!==t));function iu(t,e){return nu[t](e)}function ou(t,e){return t.idx-e.idx}function au(){this.valid=0,this.missing=0,this._ops.forEach((t=>t.init(this)))}function su(t,e){null!=t&&""!==t?t===t&&(++this.valid,this._ops.forEach((n=>n.add(this,t,e)))):++this.missing}function uu(t,e){null!=t&&""!==t?t===t&&(--this.valid,this._ops.forEach((n=>n.rem(this,t,e)))):--this.missing}function lu(t){return this._out.forEach((e=>t[e.out]=e.value(this))),t}function cu(t,e){const n=e||Kt.yR,r=function(t){const e={};t.forEach((t=>e[t.name]=t));const n=t=>{t.req&&t.req.forEach((t=>{e[t]||n(e[t]=nu[t]())}))};return t.forEach(n),Object.values(e).sort(ou)}(t),i=t.slice().sort(ou);function o(t){this._ops=r,this._out=i,this.cell=t,this.init()}return o.prototype.init=au,o.prototype.add=su,o.prototype.rem=uu,o.prototype.set=lu,o.prototype.get=n,o.fields=t.map((t=>t.out)),o}function fu(t){this._key=t?(0,Kt.EP)(t):$a,this.reset()}[...ru,"__count__"].forEach((t=>{nu[t]=function(t,e){return n=>(0,Kt.l7)({name:t,out:n||t},eu,e)}(t,nu[t])}));const hu=fu.prototype;function du(t){cs.call(this,null,t),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}hu.reset=function(){this._add=[],this._rem=[],this._ext=null,this._get=null,this._q=null},hu.add=function(t){this._add.push(t)},hu.rem=function(t){this._rem.push(t)},hu.values=function(){if(this._get=null,0===this._rem.length)return this._add;const t=this._add,e=this._rem,n=this._key,r=t.length,i=e.length,o=Array(r-i),a={};let s,u,l;for(s=0;s<i;++s)a[n(e[s])]=1;for(s=0,u=0;s<r;++s)a[n(l=t[s])]?a[n(l)]=0:o[u++]=l;return this._rem=[],this._add=o},hu.distinct=function(t){const e=this.values(),n={};let r,i=e.length,o=0;for(;--i>=0;)r=t(e[i])+"",(0,Kt.nr)(n,r)||(n[r]=1,++o);return o},hu.extent=function(t){if(this._get!==t||!this._ext){const e=this.values(),n=(0,Kt.dI)(e,t);this._ext=[e[n[0]],e[n[1]]],this._get=t}return this._ext},hu.argmin=function(t){return this.extent(t)[0]||{}},hu.argmax=function(t){return this.extent(t)[1]||{}},hu.min=function(t){const e=this.extent(t)[0];return null!=e?t(e):void 0},hu.max=function(t){const e=this.extent(t)[1];return null!=e?t(e):void 0},hu.quartile=function(t){return this._get===t&&this._q||(this._q=Fs(this.values(),t),this._get=t),this._q},hu.q1=function(t){return this.quartile(t)[0]},hu.q2=function(t){return this.quartile(t)[1]},hu.q3=function(t){return this.quartile(t)[2]},hu.ci=function(t){return this._get===t&&this._ci||(this._ci=function(t,e,n,r){if(!t.length)return[void 0,void 0];const i=Float64Array.from(Ds(t,r)),o=i.length,a=e;let s,u,l,c;for(l=0,c=Array(a);l<a;++l){for(s=0,u=0;u<o;++u)s+=i[~~(ks()*o)];c[l]=s/o}return c.sort(Dn),[_s(c,n/2),_s(c,1-n/2)]}(this.values(),1e3,.05,t),this._get=t),this._ci},hu.ci0=function(t){return this.ci(t)[0]},hu.ci1=function(t){return this.ci(t)[1]},du.Definition={type:"Aggregate",metadata:{generates:!0,changes:!0},params:[{name:"groupby",type:"field",array:!0},{name:"ops",type:"enum",array:!0,values:ru},{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,Kt.XW)(du,cs,{transform(t,e){const n=this,r=e.fork(e.NO_SOURCE|e.NO_FIELDS),i=t.modified();return n.stamp=r.stamp,n.value&&(i||e.modified(n._inputs,!0))?(n._prev=n.value,n.value=i?n.init(t):Object.create(null),e.visit(e.SOURCE,(t=>n.add(t)))):(n.value=n.value||n.init(t),e.visit(e.REM,(t=>n.rem(t))),e.visit(e.ADD,(t=>n.add(t)))),r.modifies(n._outputs),n._drop=!1!==t.drop,t.cross&&n._dims.length>1&&(n._drop=!1,n.cross()),e.clean()&&n._drop&&r.clean(!0).runAfter((()=>this.clean())),n.changes(r)},cross(){const t=this,e=t.value,n=t._dnames,r=n.map((()=>({}))),i=n.length;function o(t){let e,o,a,s;for(e in t)for(a=t[e].tuple,o=0;o<i;++o)r[o][s=a[n[o]]]=s}o(t._prev),o(e),function o(a,s,u){const l=n[u],c=r[u++];for(const n in c){const r=a?a+"|"+n:n;s[l]=c[n],u<i?o(r,s,u):e[r]||t.cell(r,s)}}("",{},0)},init(t){const e=this._inputs=[],n=this._outputs=[],r={};function i(t){const n=(0,Kt.IX)((0,Kt.Oj)(t)),i=n.length;let o,a=0;for(;a<i;++a)r[o=n[a]]||(r[o]=1,e.push(o))}this._dims=(0,Kt.IX)(t.groupby),this._dnames=this._dims.map((t=>{const e=(0,Kt.el)(t);return i(t),n.push(e),e})),this.cellkey=t.key?t.key:Ks(this._dims),this._countOnly=!0,this._counts=[],this._measures=[];const o=t.fields||[null],a=t.ops||["count"],s=t.as||[],u=o.length,l={};let c,f,h,d,p,g;for(u!==a.length&&(0,Kt.vU)("Unmatched number of fields and aggregate ops."),g=0;g<u;++g)c=o[g],f=a[g],null==c&&"count"!==f&&(0,Kt.vU)("Null aggregate field specified."),d=(0,Kt.el)(c),p=Qs(f,d,s[g]),n.push(p),"count"!==f?(h=l[d],h||(i(c),h=l[d]=[],h.field=c,this._measures.push(h)),"count"!==f&&(this._countOnly=!1),h.push(iu(f,p))):this._counts.push(p);return this._measures=this._measures.map((t=>cu(t,t.field))),Object.create(null)},cellkey:Ks(),cell(t,e){let n=this.value[t];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[t]=this.newcell(t,e),this._adds[this._alen++]=n),n},newcell(t,e){const n={key:t,num:0,agg:null,tuple:this.newtuple(e,this._prev&&this._prev[t]),stamp:this.stamp,store:!1};if(!this._countOnly){const t=this._measures,e=t.length;n.agg=Array(e);for(let r=0;r<e;++r)n.agg[r]=new t[r](n)}return n.store&&(n.data=new fu),n},newtuple(t,e){const n=this._dnames,r=this._dims,i=r.length,o={};for(let a=0;a<i;++a)o[n[a]]=r[a](t);return e?za(e.tuple,o):Ba(o)},clean(){const t=this.value;for(const e in t)0===t[e].num&&delete t[e]},add(t){const e=this.cellkey(t),n=this.cell(e,t);if(n.num+=1,this._countOnly)return;n.store&&n.data.add(t);const r=n.agg;for(let i=0,o=r.length;i<o;++i)r[i].add(r[i].get(t),t)},rem(t){const e=this.cellkey(t),n=this.cell(e,t);if(n.num-=1,this._countOnly)return;n.store&&n.data.rem(t);const r=n.agg;for(let i=0,o=r.length;i<o;++i)r[i].rem(r[i].get(t),t)},celltuple(t){const e=t.tuple,n=this._counts;t.store&&t.data.values();for(let r=0,i=n.length;r<i;++r)e[n[r]]=t.num;if(!this._countOnly){const n=t.agg;for(let t=0,r=n.length;t<r;++t)n[t].set(e)}return e},changes(t){const e=this._adds,n=this._mods,r=this._prev,i=this._drop,o=t.add,a=t.rem,s=t.mod;let u,l,c,f;if(r)for(l in r)u=r[l],i&&!u.num||a.push(u.tuple);for(c=0,f=this._alen;c<f;++c)o.push(this.celltuple(e[c])),e[c]=null;for(c=0,f=this._mlen;c<f;++c)u=n[c],(0===u.num&&i?a:s).push(this.celltuple(u)),n[c]=null;return this._alen=this._mlen=0,this._prev=null,t}});function pu(t){cs.call(this,null,t)}function gu(t,e,n){const r=t;let i=e||[],o=n||[],a={},s=0;return{add:t=>o.push(t),remove:t=>a[r(t)]=++s,size:()=>i.length,data:(t,e)=>(s&&(i=i.filter((t=>!a[r(t)])),a={},s=0),e&&t&&i.sort(t),o.length&&(i=t?(0,Kt.TS)(t,i,o.sort(t)):i.concat(o),o=[]),i)}}function mu(t){cs.call(this,[],t)}function yu(t){Wa.call(this,null,vu,t)}function vu(t){return this.value&&!t.modified()?this.value:(0,Kt.qu)(t.fields,t.orders)}function bu(t){cs.call(this,null,t)}function xu(t){cs.call(this,null,t)}pu.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,Kt.XW)(pu,cs,{transform(t,e){const n=!1!==t.interval,r=this._bins(t),i=r.start,o=r.step,a=t.as||["bin0","bin1"],s=a[0],u=a[1];let l;return l=t.modified()?(e=e.reflow(!0)).SOURCE:e.modified((0,Kt.Oj)(t.field))?e.ADD_MOD:e.ADD,e.visit(l,n?t=>{const e=r(t);t[s]=e,t[u]=null==e?null:i+o*(1+(e-i)/o)}:t=>t[s]=r(t)),e.modifies(n?a:s)},_bins(t){if(this.value&&!t.modified())return this.value;const e=t.field,n=function(t){const e=t.maxbins||20,n=t.base||10,r=Math.log(n),i=t.divide||[5,2];let o,a,s,u,l,c,f=t.extent[0],h=t.extent[1];const d=t.span||h-f||Math.abs(f)||1;if(t.step)o=t.step;else if(t.steps){for(u=d/e,l=0,c=t.steps.length;l<c&&t.steps[l]<u;++l);o=t.steps[Math.max(0,l-1)]}else{for(a=Math.ceil(Math.log(e)/r),s=t.minstep||0,o=Math.max(s,Math.pow(n,Math.round(Math.log(d)/r)-a));Math.ceil(d/o)>e;)o*=n;for(l=0,c=i.length;l<c;++l)u=o/i[l],u>=s&&d/u<=e&&(o=u)}u=Math.log(o);const p=u>=0?0:1+~~(-u/r),g=Math.pow(n,-p-1);return(t.nice||void 0===t.nice)&&(u=Math.floor(f/o+g)*o,f=f<u?u-o:u,h=Math.ceil(h/o)*o),{start:f,stop:h===f?f+o:h,step:o}}(t),r=n.step;let i,o,a=n.start,s=a+Math.ceil((n.stop-a)/r)*r;null!=(i=t.anchor)&&(o=i-(a+r*Math.floor((i-a)/r)),a+=o,s+=o);const u=function(t){let n=(0,Kt.He)(e(t));return null==n?null:n<a?-1/0:n>s?1/0:(n=Math.max(a,Math.min(n,s-r)),a+r*Math.floor(1e-14+(n-a)/r))};return u.start=a,u.stop=n.stop,u.step=r,this.value=(0,Kt.ZE)(u,(0,Kt.Oj)(e),t.name||"bin_"+(0,Kt.el)(e))}}),mu.Definition={type:"Collect",metadata:{source:!0},params:[{name:"sort",type:"compare"}]},(0,Kt.XW)(mu,cs,{transform(t,e){const n=e.fork(e.ALL),r=gu($a,this.value,n.materialize(n.ADD).add),i=t.sort,o=e.changed()||i&&(t.modified("sort")||e.modified(i.fields));return n.visit(n.REM,r.remove),this.modified(o),this.value=n.source=r.data(Ra(i),o),e.source&&e.source.root&&(this.value.root=e.source.root),n}}),(0,Kt.XW)(yu,Wa),bu.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,Kt.XW)(bu,cs,{transform(t,e){const n=e=>n=>{for(var r,i=function(t,e,n){switch(e){case"upper":t=t.toUpperCase();break;case"lower":t=t.toLowerCase()}return t.match(n)}(s(n),t.case,o)||[],u=0,l=i.length;u<l;++u)a.test(r=i[u])||e(r)},r=this._parameterCheck(t,e),i=this._counts,o=this._match,a=this._stop,s=t.field,u=t.as||["text","count"],l=n((t=>i[t]=1+(i[t]||0))),c=n((t=>i[t]-=1));return r?e.visit(e.SOURCE,l):(e.visit(e.ADD,l),e.visit(e.REM,c)),this._finish(e,u)},_parameterCheck(t,e){let n=!1;return!t.modified("stopwords")&&this._stop||(this._stop=new RegExp("^"+(t.stopwords||"")+"$","i"),n=!0),!t.modified("pattern")&&this._match||(this._match=new RegExp(t.pattern||"[\\w']+","g"),n=!0),(t.modified("field")||e.modified(t.field.fields))&&(n=!0),n&&(this._counts={}),n},_finish(t,e){const n=this._counts,r=this._tuples||(this._tuples={}),i=e[0],o=e[1],a=t.fork(t.NO_SOURCE|t.NO_FIELDS);let s,u,l;for(s in n)u=r[s],l=n[s]||0,!u&&l?(r[s]=u=Ba({}),u[i]=s,u[o]=l,a.add.push(u)):0===l?(u&&a.rem.push(u),n[s]=null,r[s]=null):u[o]!==l&&(u[o]=l,a.mod.push(u));return a.modifies(e)}}),xu.Definition={type:"Cross",metadata:{generates:!0},params:[{name:"filter",type:"expr"},{name:"as",type:"string",array:!0,length:2,default:["a","b"]}]},(0,Kt.XW)(xu,cs,{transform(t,e){const n=e.fork(e.NO_SOURCE),r=t.as||["a","b"],i=r[0],o=r[1],a=!this.value||e.changed(e.ADD_REM)||t.modified("as")||t.modified("filter");let s=this.value;return a?(s&&(n.rem=s),s=e.materialize(e.SOURCE).source,n.add=this.value=function(t,e,n,r){for(var i,o,a=[],s={},u=t.length,l=0;l<u;++l)for(s[e]=o=t[l],i=0;i<u;++i)s[n]=t[i],r(s)&&(a.push(Ba(s)),(s={})[e]=o);return a}(s,i,o,t.filter||Kt.yb)):n.mod=s,n.source=this.value,n.modifies(r)}});const _u={kde:Ps,mixture:function(t,e){let n,r=0;const i={weights(t){return arguments.length?(n=function(t){const e=[];let n,i=0;for(n=0;n<r;++n)i+=e[n]=null==t[n]?1:+t[n];for(n=0;n<r;++n)e[n]/=i;return e}(e=t||[]),i):e},distributions(n){return arguments.length?(n?(r=n.length,t=n):(r=0,t=[]),i.weights(e)):t},sample(){const e=ks();let i=t[r-1],o=n[0],a=0;for(;a<r-1;o+=n[++a])if(e<o){i=t[a];break}return i.sample()},pdf(e){let i=0,o=0;for(;o<r;++o)i+=n[o]*t[o].pdf(e);return i},cdf(e){let i=0,o=0;for(;o<r;++o)i+=n[o]*t[o].cdf(e);return i},icdf(){throw Error("Mixture icdf not supported.")}};return i.distributions(t).weights(e)},normal:Rs,lognormal:function(t,e){let n,r;const i={mean(t){return arguments.length?(n=t||0,i):n},stdev(t){return arguments.length?(r=null==t?1:t,i):r},sample:()=>Us(n,r),pdf:t=>Ls(t,n,r),cdf:t=>js(t,n,r),icdf:t=>Is(t,n,r)};return i.mean(t).stdev(e)},uniform:function(t,e){let n,r;const i={min(t){return arguments.length?(n=t||0,i):n},max(t){return arguments.length?(r=null==t?1:t,i):r},sample:()=>qs(n,r),pdf:t=>Ws(t,n,r),cdf:t=>Hs(t,n,r),icdf:t=>Xs(t,n,r)};return null==e&&(e=null==t?1:t,t=0),i.min(t).max(e)}},wu="distributions",Au="function",Du="field";function Eu(t,e){const n=t[Au];(0,Kt.nr)(_u,n)||(0,Kt.vU)("Unknown distribution function: "+n);const r=_u[n]();for(const i in t)i===Du?r.data((t.from||e()).map(t[i])):i===wu?r[i](t[i].map((t=>Eu(t,e)))):typeof r[i]===Au&&r[i](t[i]);return r}function Fu(t){cs.call(this,null,t)}const Cu=[{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}]}],ku={key:{function:"mixture"},params:[{name:"distributions",type:"param",array:!0,params:Cu},{name:"weights",type:"number",array:!0}]};function Mu(t,e){return t?t.map(((t,n)=>e[n]||(0,Kt.el)(t))):null}function Su(t,e,n){const r=[],i=t=>t(u);let o,a,s,u,l,c;if(null==e)r.push(t.map(n));else for(o={},a=0,s=t.length;a<s;++a)u=t[a],l=e.map(i),c=o[l],c||(o[l]=c=[],c.dims=l,r.push(c)),c.push(n(u));return r}Fu.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:Cu.concat(ku)},{name:"as",type:"string",array:!0,default:["value","density"]}]},(0,Kt.XW)(Fu,cs,{transform(t,e){const n=e.fork(e.NO_SOURCE|e.NO_FIELDS);if(!this.value||e.changed()||t.modified()){const r=Eu(t.distribution,function(t){return()=>t.materialize(t.SOURCE).source}(e)),i=t.steps||t.minsteps||25,o=t.steps||t.maxsteps||200;let a=t.method||"pdf";"pdf"!==a&&"cdf"!==a&&(0,Kt.vU)("Invalid density method: "+a),t.extent||r.data||(0,Kt.vU)("Missing density extent parameter."),a=r[a];const s=t.as||["value","density"],u=Gs(a,t.extent||(0,Kt.We)(r.data()),i,o).map((t=>{const e={};return e[s[0]]=t[0],e[s[1]]=t[1],Ba(e)}));this.value&&(n.rem=this.value),this.value=n.add=n.source=u}return n}});function $u(t){cs.call(this,null,t)}$u.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 Tu(t){Wa.call(this,null,Bu,t),this.modified(!0)}function Bu(t){const e=t.expr;return this.value&&!t.modified("expr")?this.value:(0,Kt.ZE)((n=>e(n,t)),(0,Kt.Oj)(e),(0,Kt.el)(e))}function Nu(t){cs.call(this,[void 0,void 0],t)}function Ou(t,e){Wa.call(this,t),this.parent=e,this.count=0}function zu(t){cs.call(this,{},t),this._keys=(0,Kt.Xr)();const e=this._targets=[];e.active=0,e.forEach=t=>{for(let n=0,r=e.active;n<r;++n)t(e[n],n,e)}}function Ru(t){Wa.call(this,null,Pu,t)}function Pu(t){return this.value&&!t.modified()?this.value:(0,Kt.kJ)(t.name)?(0,Kt.IX)(t.name).map((t=>(0,Kt.EP)(t))):(0,Kt.EP)(t.name,t.as)}function Uu(t){cs.call(this,(0,Kt.Xr)(),t)}function Lu(t){cs.call(this,[],t)}function ju(t){cs.call(this,[],t)}function Iu(t){cs.call(this,null,t)}function qu(t){cs.call(this,[],t)}(0,Kt.XW)($u,cs,{transform(t,e){if(this.value&&!t.modified()&&!e.changed())return e;const n=e.materialize(e.SOURCE).source,r=Su(e.source,t.groupby,Kt.yR),i=t.smooth||!1,o=t.field,a=t.step||((t,e)=>(0,Kt.yP)((0,Kt.We)(t,e))/30)(n,o),s=Ra(((t,e)=>o(t)-o(e))),u=t.as||"bin",l=r.length;let c,f=1/0,h=-1/0,d=0;for(;d<l;++d){const t=r[d].sort(s);c=-1;for(const e of Ms(t,a,i,o))e<f&&(f=e),e>h&&(h=e),t[++c][u]=e}return this.value={start:f,stop:h,step:a},e.reflow(!0).modifies(u)}}),(0,Kt.XW)(Tu,Wa),Nu.Definition={type:"Extent",metadata:{},params:[{name:"field",type:"field",required:!0}]},(0,Kt.XW)(Nu,cs,{transform(t,e){const n=this.value,r=t.field,i=e.changed()||e.modified(r.fields)||t.modified("field");let o=n[0],a=n[1];if((i||null==o)&&(o=1/0,a=-1/0),e.visit(i?e.SOURCE:e.ADD,(t=>{const e=(0,Kt.He)(r(t));null!=e&&(e<o&&(o=e),e>a&&(a=e))})),!Number.isFinite(o)||!Number.isFinite(a)){let t=(0,Kt.el)(r);t&&(t=` for field "${t}"`),e.dataflow.warn(`Infinite extent${t}: [${o}, ${a}]`),o=a=void 0}this.value=[o,a]}}),(0,Kt.XW)(Ou,Wa,{connect(t){return this.detachSubflow=t.detachSubflow,this.targets().add(t),t.source=this},add(t){this.count+=1,this.value.add.push(t)},rem(t){this.count-=1,this.value.rem.push(t)},mod(t){this.value.mod.push(t)},init(t){this.value.init(t,t.NO_SOURCE)},evaluate(){return this.value}}),(0,Kt.XW)(zu,cs,{activate(t){this._targets[this._targets.active++]=t},subflow(t,e,n,r){const i=this.value;let o,a,s=(0,Kt.nr)(i,t)&&i[t];return s?s.value.stamp<n.stamp&&(s.init(n),this.activate(s)):(a=r||(a=this._group[t])&&a.tuple,o=n.dataflow,s=new Ou(n.fork(n.NO_SOURCE),this),o.add(s).connect(e(o,t,a)),i[t]=s,this.activate(s)),s},clean(){const t=this.value;let e=0;for(const n in t)if(0===t[n].count){const r=t[n].detachSubflow;r&&r(),delete t[n],++e}if(e){const t=this._targets.filter((t=>t&&t.count>0));this.initTargets(t)}},initTargets(t){const e=this._targets,n=e.length,r=t?t.length:0;let i=0;for(;i<r;++i)e[i]=t[i];for(;i<n&&null!=e[i];++i)e[i]=null;e.active=r},transform(t,e){const n=e.dataflow,r=t.key,i=t.subflow,o=this._keys,a=t.modified("key"),s=t=>this.subflow(t,i,e);return this._group=t.group||{},this.initTargets(),e.visit(e.REM,(t=>{const e=$a(t),n=o.get(e);void 0!==n&&(o.delete(e),s(n).rem(t))})),e.visit(e.ADD,(t=>{const e=r(t);o.set($a(t),e),s(e).add(t)})),a||e.modified(r.fields)?e.visit(e.MOD,(t=>{const e=$a(t),n=o.get(e),i=r(t);n===i?s(i).mod(t):(o.set(e,i),s(n).rem(t),s(i).add(t))})):e.changed(e.MOD)&&e.visit(e.MOD,(t=>{s(o.get($a(t))).mod(t)})),a&&e.visit(e.REFLOW,(t=>{const e=$a(t),n=o.get(e),i=r(t);n!==i&&(o.set(e,i),s(n).rem(t),s(i).add(t))})),e.clean()?n.runAfter((()=>{this.clean(),o.clean()})):o.empty>n.cleanThreshold&&n.runAfter(o.clean),e}}),(0,Kt.XW)(Ru,Wa),Uu.Definition={type:"Filter",metadata:{changes:!0},params:[{name:"expr",type:"expr",required:!0}]},(0,Kt.XW)(Uu,cs,{transform(t,e){const n=e.dataflow,r=this.value,i=e.fork(),o=i.add,a=i.rem,s=i.mod,u=t.expr;let l=!0;function c(e){const n=$a(e),i=u(e,t),c=r.get(n);i&&c?(r.delete(n),o.push(e)):i||c?l&&i&&!c&&s.push(e):(r.set(n,1),a.push(e))}return e.visit(e.REM,(t=>{const e=$a(t);r.has(e)?r.delete(e):a.push(t)})),e.visit(e.ADD,(e=>{u(e,t)?o.push(e):r.set($a(e),1)})),e.visit(e.MOD,c),t.modified()&&(l=!1,e.visit(e.REFLOW,c)),r.empty>n.cleanThreshold&&n.runAfter(r.clean),i}}),Lu.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,Kt.XW)(Lu,cs,{transform(t,e){const n=e.fork(e.NO_SOURCE),r=t.fields,i=Mu(r,t.as||[]),o=t.index||null,a=i.length;return n.rem=this.value,e.visit(e.SOURCE,(t=>{const e=r.map((e=>e(t))),s=e.reduce(((t,e)=>Math.max(t,e.length)),0);let u,l,c,f=0;for(;f<s;++f){for(l=Na(t),u=0;u<a;++u)l[i[u]]=null==(c=e[u][f])?null:c;o&&(l[o]=f),n.add.push(l)}})),this.value=n.source=n.add,o&&n.modifies(o),n.modifies(i)}}),ju.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,Kt.XW)(ju,cs,{transform(t,e){const n=e.fork(e.NO_SOURCE),r=t.fields,i=r.map(Kt.el),o=t.as||["key","value"],a=o[0],s=o[1],u=r.length;return n.rem=this.value,e.visit(e.SOURCE,(t=>{for(let e,o=0;o<u;++o)e=Na(t),e[a]=i[o],e[s]=r[o](t),n.add.push(e)})),this.value=n.source=n.add,n.modifies(o)}}),Iu.Definition={type:"Formula",metadata:{modifies:!0},params:[{name:"expr",type:"expr",required:!0},{name:"as",type:"string",required:!0},{name:"initonly",type:"boolean"}]},(0,Kt.XW)(Iu,cs,{transform(t,e){const n=t.expr,r=t.as,i=t.modified(),o=t.initonly?e.ADD:i?e.SOURCE:e.modified(n.fields)||e.modified(r)?e.ADD_MOD:e.ADD;return i&&(e=e.materialize().reflow(!0)),t.initonly||e.modifies(r),e.visit(o,(e=>e[r]=n(e,t)))}}),(0,Kt.XW)(qu,cs,{transform(t,e){const n=e.fork(e.ALL),r=t.generator;let i,o,a,s=this.value,u=t.size-s.length;if(u>0){for(i=[];--u>=0;)i.push(a=Ba(r(t))),s.push(a);n.add=n.add.length?n.materialize(n.ADD).add.concat(i):i}else o=s.slice(0,-u),n.rem=n.rem.length?n.materialize(n.REM).rem.concat(o):o,s=s.slice(-u);return n.source=this.value=s,n}});const Wu={value:"value",median:Js,mean:function(t,e){let n=0,r=0;if(void 0===e)for(let i of t)null!=i&&(i=+i)>=i&&(++n,r+=i);else{let i=-1;for(let o of t)null!=(o=e(o,++i,t))&&(o=+o)>=o&&(++n,r+=o)}if(n)return r/n},min:gs,max:ps},Hu=[];function Xu(t){cs.call(this,[],t)}function Yu(t){du.call(this,t)}function Gu(t){cs.call(this,null,t)}function Vu(t){Wa.call(this,null,Ju,t)}function Ju(t){return this.value&&!t.modified()?this.value:(0,Kt.Jy)(t.fields,t.flat)}function Zu(t){cs.call(this,[],t),this._pending=null}function Ku(t,e,n){n.forEach(Ba);const r=e.fork(e.NO_FIELDS&e.NO_SOURCE);return r.rem=t.value,t.value=r.source=r.add=n,t._pending=null,r.rem.length&&r.clean(!0),r}function Qu(t){cs.call(this,{},t)}function tl(t){Wa.call(this,null,el,t)}function el(t){if(this.value&&!t.modified())return this.value;const e=t.extents,n=e.length;let r,i,o=1/0,a=-1/0;for(r=0;r<n;++r)i=e[r],i[0]<o&&(o=i[0]),i[1]>a&&(a=i[1]);return[o,a]}function nl(t){Wa.call(this,null,rl,t)}function rl(t){return this.value&&!t.modified()?this.value:t.values.reduce(((t,e)=>t.concat(e)),[])}function il(t){cs.call(this,null,t)}function ol(t){du.call(this,t)}function al(t){zu.call(this,t)}function sl(t){cs.call(this,null,t)}function ul(t){cs.call(this,null,t)}function ll(t){cs.call(this,null,t)}Xu.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,Kt.XW)(Xu,cs,{transform(t,e){var n,r,i,o,a,s,u,l,c,f,h=e.fork(e.ALL),d=function(t){var e,n=t.method||Wu.value;if(null!=Wu[n])return n===Wu.value?(e=void 0!==t.value?t.value:0,()=>e):Wu[n];(0,Kt.vU)("Unrecognized imputation method: "+n)}(t),p=function(t){const e=t.field;return t=>t?e(t):NaN}(t),g=(0,Kt.el)(t.field),m=(0,Kt.el)(t.key),y=(t.groupby||[]).map(Kt.el),v=function(t,e,n,r){var i,o,a,s,u,l,c,f,h=t=>t(f),d=[],p=r?r.slice():[],g={},m={};for(p.forEach(((t,e)=>g[t]=e+1)),s=0,c=t.length;s<c;++s)l=n(f=t[s]),u=g[l]||(g[l]=p.push(l)),(a=m[o=(i=e?e.map(h):Hu)+""])||(a=m[o]=[],d.push(a),a.values=i),a[u-1]=f;return d.domain=p,d}(e.source,t.groupby,t.key,t.keyvals),b=[],x=this.value,_=v.domain.length;for(a=0,l=v.length;a<l;++a)for(i=(n=v[a]).values,r=NaN,u=0;u<_;++u)if(null==n[u]){for(o=v.domain[u],f={_impute:!0},s=0,c=i.length;s<c;++s)f[y[s]]=i[s];f[m]=o,f[g]=Number.isNaN(r)?r=d(n,p):r,b.push(Ba(f))}return b.length&&(h.add=h.materialize(h.ADD).add.concat(b)),x.length&&(h.rem=h.materialize(h.REM).rem.concat(x)),this.value=b,h}}),Yu.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:ru},{name:"as",type:"string",null:!0,array:!0},{name:"key",type:"field"}]},(0,Kt.XW)(Yu,du,{transform(t,e){const n=this,r=t.modified();let i;return n.value&&(r||e.modified(n._inputs,!0))?(i=n.value=r?n.init(t):{},e.visit(e.SOURCE,(t=>n.add(t)))):(i=n.value=n.value||this.init(t),e.visit(e.REM,(t=>n.rem(t))),e.visit(e.ADD,(t=>n.add(t)))),n.changes(),e.visit(e.SOURCE,(t=>{(0,Kt.l7)(t,i[n.cellkey(t)].tuple)})),e.reflow(r).modifies(this._outputs)},changes(){const t=this._adds,e=this._mods;let n,r;for(n=0,r=this._alen;n<r;++n)this.celltuple(t[n]),t[n]=null;for(n=0,r=this._mlen;n<r;++n)this.celltuple(e[n]),e[n]=null;this._alen=this._mlen=0}}),Gu.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,Kt.XW)(Gu,cs,{transform(t,e){const n=e.fork(e.NO_SOURCE|e.NO_FIELDS);if(!this.value||e.changed()||t.modified()){const r=e.materialize(e.SOURCE).source,i=Su(r,t.groupby,t.field),o=(t.groupby||[]).map(Kt.el),a=t.bandwidth,s=t.cumulative?"cdf":"pdf",u=t.as||["value","density"],l=[];let c=t.extent,f=t.steps||t.minsteps||25,h=t.steps||t.maxsteps||200;"pdf"!==s&&"cdf"!==s&&(0,Kt.vU)("Invalid density method: "+s),"shared"===t.resolve&&(c||(c=(0,Kt.We)(r,t.field)),f=h=t.steps||h),i.forEach((e=>{const n=Ps(e,a)[s],r=t.counts?e.length:1;Gs(n,c||(0,Kt.We)(e),f,h).forEach((t=>{const n={};for(let r=0;r<o.length;++r)n[o[r]]=e.dims[r];n[u[0]]=t[0],n[u[1]]=t[1]*r,l.push(Ba(n))}))})),this.value&&(n.rem=this.value),this.value=n.add=n.source=l}return n}}),(0,Kt.XW)(Vu,Wa),(0,Kt.XW)(Zu,cs,{transform(t,e){const n=e.dataflow;if(this._pending)return Ku(this,e,this._pending);if(function(t){return t.modified("async")&&!(t.modified("values")||t.modified("url")||t.modified("format"))}(t))return e.StopPropagation;if(t.values)return Ku(this,e,n.parse(t.values,t.format));if(t.async){const e=n.request(t.url,t.format).then((t=>(this._pending=(0,Kt.IX)(t.data),t=>t.touch(this))));return{async:e}}return n.request(t.url,t.format).then((t=>Ku(this,e,(0,Kt.IX)(t.data))))}}),Qu.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,Kt.XW)(Qu,cs,{transform(t,e){const n=t.fields,r=t.index,i=t.values,o=null==t.default?null:t.default,a=t.modified(),s=n.length;let u,l,c,f=a?e.SOURCE:e.ADD,h=e,d=t.as;return i?(l=i.length,s>1&&!d&&(0,Kt.vU)('Multi-field lookup requires explicit "as" parameter.'),d&&d.length!==s*l&&(0,Kt.vU)('The "as" parameter has too few output field names.'),d=d||i.map(Kt.el),u=function(t){for(var e,a,u=0,c=0;u<s;++u)if(null==(a=r.get(n[u](t))))for(e=0;e<l;++e,++c)t[d[c]]=o;else for(e=0;e<l;++e,++c)t[d[c]]=i[e](a)}):(d||(0,Kt.vU)("Missing output field names."),u=function(t){for(var e,i=0;i<s;++i)e=r.get(n[i](t)),t[d[i]]=null==e?o:e}),a?h=e.reflow(!0):(c=n.some((t=>e.modified(t.fields))),f|=c?e.MOD:0),e.visit(f,u),h.modifies(d)}}),(0,Kt.XW)(tl,Wa),(0,Kt.XW)(nl,Wa),(0,Kt.XW)(il,cs,{transform(t,e){return this.modified(t.modified()),this.value=t,e.fork(e.NO_SOURCE|e.NO_FIELDS)}}),ol.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:ru,default:"sum"},{name:"limit",type:"number",default:0},{name:"key",type:"field"}]},(0,Kt.XW)(ol,du,{_transform:du.prototype.transform,transform(t,e){return this._transform(function(t,e){const n=t.field,r=t.value,i=("count"===t.op?"__count__":t.op)||"sum",o=(0,Kt.Oj)(n).concat((0,Kt.Oj)(r)),a=function(t,e,n){const r={},i=[];return n.visit(n.SOURCE,(e=>{const n=t(e);r[n]||(r[n]=1,i.push(n))})),i.sort(Kt.j2),e?i.slice(0,e):i}(n,t.limit||0,e);e.changed()&&t.set("__pivot__",null,null,!0);return{key:t.key,groupby:t.groupby,ops:a.map((()=>i)),fields:a.map((t=>function(t,e,n,r){return(0,Kt.ZE)((r=>e(r)===t?n(r):NaN),r,t+"")}(t,n,r,o))),as:a.map((t=>t+"")),modified:t.modified.bind(t)}}(t,e),e)}}),(0,Kt.XW)(al,zu,{transform(t,e){const n=t.subflow,r=t.field,i=t=>this.subflow($a(t),n,e,t);return(t.modified("field")||r&&e.modified((0,Kt.Oj)(r)))&&(0,Kt.vU)("PreFacet does not support field modification."),this.initTargets(),r?(e.visit(e.MOD,(t=>{const e=i(t);r(t).forEach((t=>e.mod(t)))})),e.visit(e.ADD,(t=>{const e=i(t);r(t).forEach((t=>e.add(Ba(t))))})),e.visit(e.REM,(t=>{const e=i(t);r(t).forEach((t=>e.rem(t)))}))):(e.visit(e.MOD,(t=>i(t).mod(t))),e.visit(e.ADD,(t=>i(t).add(t))),e.visit(e.REM,(t=>i(t).rem(t)))),e.clean()&&e.runAfter((()=>this.clean())),e}}),sl.Definition={type:"Project",metadata:{generates:!0,changes:!0},params:[{name:"fields",type:"field",array:!0},{name:"as",type:"string",null:!0,array:!0}]},(0,Kt.XW)(sl,cs,{transform(t,e){const n=e.fork(e.NO_SOURCE),r=t.fields,i=Mu(t.fields,t.as||[]),o=r?(t,e)=>function(t,e,n,r){for(let i=0,o=n.length;i<o;++i)e[r[i]]=n[i](t);return e}(t,e,r,i):Oa;let a;return this.value?a=this.value:(e=e.addAll(),a=this.value={}),e.visit(e.REM,(t=>{const e=$a(t);n.rem.push(a[e]),a[e]=null})),e.visit(e.ADD,(t=>{const e=o(t,Ba({}));a[$a(t)]=e,n.add.push(e)})),e.visit(e.MOD,(t=>{n.mod.push(o(t,a[$a(t)]))})),n}}),(0,Kt.XW)(ul,cs,{transform(t,e){return this.value=t.value,t.modified("value")?e.fork(e.NO_SOURCE|e.NO_FIELDS):e.StopPropagation}}),ll.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 cl(t){cs.call(this,null,t)}function fl(t){cs.call(this,[],t),this.count=0}function hl(t){cs.call(this,null,t)}function dl(t){cs.call(this,null,t),this.modified(!0)}function pl(t){cs.call(this,null,t)}(0,Kt.XW)(ll,cs,{transform(t,e){const n=e.fork(e.NO_SOURCE|e.NO_FIELDS),r=t.as||["prob","value"];if(this.value&&!t.modified()&&!e.changed())return n.source=this.value,n;const i=Su(e.materialize(e.SOURCE).source,t.groupby,t.field),o=(t.groupby||[]).map(Kt.el),a=[],s=t.step||.01,u=t.probs||Zs(s/2,1-1e-14,s),l=u.length;return i.forEach((t=>{const e=Es(t,u);for(let n=0;n<l;++n){const i={};for(let e=0;e<o.length;++e)i[o[e]]=t.dims[e];i[r[0]]=u[n],i[r[1]]=e[n],a.push(Ba(i))}})),this.value&&(n.rem=this.value),this.value=n.add=n.source=a,n}}),(0,Kt.XW)(cl,cs,{transform(t,e){let n,r;return this.value?r=this.value:(n=e=e.addAll(),r=this.value={}),t.derive&&(n=e.fork(e.NO_SOURCE),e.visit(e.REM,(t=>{const e=$a(t);n.rem.push(r[e]),r[e]=null})),e.visit(e.ADD,(t=>{const e=Na(t);r[$a(t)]=e,n.add.push(e)})),e.visit(e.MOD,(t=>{const e=r[$a(t)];for(const r in t)e[r]=t[r],n.modifies(r);n.mod.push(e)}))),n}}),fl.Definition={type:"Sample",metadata:{},params:[{name:"size",type:"number",default:1e3}]},(0,Kt.XW)(fl,cs,{transform(t,e){const n=e.fork(e.NO_SOURCE),r=t.modified("size"),i=t.size,o=this.value.reduce(((t,e)=>(t[$a(e)]=1,t)),{});let a=this.value,s=this.count,u=0;function l(t){let e,r;a.length<i?a.push(t):(r=~~((s+1)*ks()),r<a.length&&r>=u&&(e=a[r],o[$a(e)]&&n.rem.push(e),a[r]=t)),++s}if(e.rem.length&&(e.visit(e.REM,(t=>{const e=$a(t);o[e]&&(o[e]=-1,n.rem.push(t)),--s})),a=a.filter((t=>-1!==o[$a(t)]))),(e.rem.length||r)&&a.length<i&&e.source&&(u=s=a.length,e.visit(e.SOURCE,(t=>{o[$a(t)]||l(t)})),u=-1),r&&a.length>i){const t=a.length-i;for(let e=0;e<t;++e)o[$a(a[e])]=-1,n.rem.push(a[e]);a=a.slice(t)}return e.mod.length&&e.visit(e.MOD,(t=>{o[$a(t)]&&n.mod.push(t)})),e.add.length&&e.visit(e.ADD,l),(e.add.length||u<0)&&(n.add=a.filter((t=>!o[$a(t)]))),this.count=s,this.value=n.source=a,n}}),hl.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,Kt.XW)(hl,cs,{transform(t,e){if(this.value&&!t.modified())return;const n=e.materialize().fork(e.MOD),r=t.as||"data";return n.rem=this.value?e.rem.concat(this.value):e.rem,this.value=Zs(t.start,t.stop,t.step||1).map((t=>{const e={};return e[r]=t,Ba(e)})),n.add=e.add.concat(this.value),n}}),(0,Kt.XW)(dl,cs,{transform(t,e){return this.value=e.source,e.changed()?e.fork(e.NO_SOURCE|e.NO_FIELDS):e.StopPropagation}});const gl=["unit0","unit1"];function ml(t){cs.call(this,(0,Kt.Xr)(),t)}function yl(t){cs.call(this,null,t)}pl.Definition={type:"TimeUnit",metadata:{modifies:!0},params:[{name:"field",type:"field",required:!0},{name:"interval",type:"boolean",default:!0},{name:"units",type:"enum",values:Un,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:gl}]},(0,Kt.XW)(pl,cs,{transform(t,e){const n=t.field,r=!1!==t.interval,i="utc"===t.timezone,o=this._floor(t,e),a=(i?gr:pr)(o.unit).offset,s=t.as||gl,u=s[0],l=s[1],c=o.step;let f=o.start||1/0,h=o.stop||-1/0,d=e.ADD;return(t.modified()||e.changed(e.REM)||e.modified((0,Kt.Oj)(n)))&&(d=(e=e.reflow(!0)).SOURCE,f=1/0,h=-1/0),e.visit(d,(t=>{const e=n(t);let i,s;null==e?(t[u]=null,r&&(t[l]=null)):(t[u]=i=s=o(e),r&&(t[l]=s=a(i,c)),i<f&&(f=i),s>h&&(h=s))})),o.start=f,o.stop=h,e.modifies(r?s:u)},_floor(t,e){const n="utc"===t.timezone,{units:r,step:i}=t.units?{units:t.units,step:t.step||1}:zr({extent:t.extent||(0,Kt.We)(e.materialize(e.SOURCE).source,t.field),maxbins:t.maxbins}),o=jn(r),a=this.value||{},s=(n?fr:ur)(o,i);return s.unit=(0,Kt.fj)(o),s.units=o,s.step=i,s.start=a.start,s.stop=a.stop,this.value=s}}),(0,Kt.XW)(ml,cs,{transform(t,e){const n=e.dataflow,r=t.field,i=this.value,o=t=>i.set(r(t),t);let a=!0;return t.modified("field")||e.modified(r.fields)?(i.clear(),e.visit(e.SOURCE,o)):e.changed()?(e.visit(e.REM,(t=>i.delete(r(t)))),e.visit(e.ADD,o)):a=!1,this.modified(a),i.empty>n.cleanThreshold&&n.runAfter(i.clean),e.fork()}}),(0,Kt.XW)(yl,cs,{transform(t,e){(!this.value||t.modified("field")||t.modified("sort")||e.changed()||t.sort&&e.modified(t.sort.fields))&&(this.value=(t.sort?e.source.slice().sort(Ra(t.sort)):e.source).map(t.field))}});const vl={row_number:function(){return{next:t=>t.index+1}},rank:function(){let t;return{init:()=>t=1,next:e=>{const n=e.index,r=e.data;return n&&e.compare(r[n-1],r[n])?t=n+1:t}}},dense_rank:function(){let t;return{init:()=>t=1,next:e=>{const n=e.index,r=e.data;return n&&e.compare(r[n-1],r[n])?++t:t}}},percent_rank:function(){const t=vl.rank(),e=t.next;return{init:t.init,next:t=>(e(t)-1)/(t.data.length-1)}},cume_dist:function(){let t;return{init:()=>t=0,next:e=>{const n=e.data,r=e.compare;let i=e.index;if(t<i){for(;i+1<n.length&&!r(n[i],n[i+1]);)++i;t=i}return(1+t)/n.length}}},ntile:function(t,e){(e=+e)>0||(0,Kt.vU)("ntile num must be greater than zero.");const n=vl.cume_dist(),r=n.next;return{init:n.init,next:t=>Math.ceil(e*r(t))}},lag:function(t,e){return e=+e||1,{next:n=>{const r=n.index-e;return r>=0?t(n.data[r]):null}}},lead:function(t,e){return e=+e||1,{next:n=>{const r=n.index+e,i=n.data;return r<i.length?t(i[r]):null}}},first_value:function(t){return{next:e=>t(e.data[e.i0])}},last_value:function(t){return{next:e=>t(e.data[e.i1-1])}},nth_value:function(t,e){return(e=+e)>0||(0,Kt.vU)("nth_value nth must be greater than zero."),{next:n=>{const r=n.i0+(e-1);return r<n.i1?t(n.data[r]):null}}},prev_value:function(t){let e;return{init:()=>e=null,next:n=>{const r=t(n.data[n.index]);return null!=r?e=r:e}}},next_value:function(t){let e,n;return{init:()=>(e=null,n=-1),next:r=>{const i=r.data;return r.index<=n?e:(n=function(t,e,n){for(let r=e.length;n<r;++n){if(null!=t(e[n]))return n}return-1}(t,i,r.index))<0?(n=i.length,e=null):e=t(i[n])}}}};const bl=Object.keys(vl);function xl(t){const e=(0,Kt.IX)(t.ops),n=(0,Kt.IX)(t.fields),r=(0,Kt.IX)(t.params),i=(0,Kt.IX)(t.as),o=this.outputs=[],a=this.windows=[],s={},u={},l=[],c=[];let f=!0;function h(t){(0,Kt.IX)((0,Kt.Oj)(t)).forEach((t=>s[t]=1))}h(t.sort),e.forEach(((t,e)=>{const s=n[e],d=(0,Kt.el)(s),p=Qs(t,d,i[e]);if(h(s),o.push(p),(0,Kt.nr)(vl,t))a.push(function(t,e,n,r){const i=vl[t](e,n);return{init:i.init||Kt.bM,update:function(t,e){e[r]=i.next(t)}}}(t,n[e],r[e],p));else{if(null==s&&"count"!==t&&(0,Kt.vU)("Null aggregate field specified."),"count"===t)return void l.push(p);f=!1;let e=u[d];e||(e=u[d]=[],e.field=s,c.push(e)),e.push(iu(t,p))}})),(l.length||c.length)&&(this.cell=function(t,e,n){t=t.map((t=>cu(t,t.field)));const r={num:0,agg:null,store:!1,count:e};if(!n)for(var i=t.length,o=r.agg=Array(i),a=0;a<i;++a)o[a]=new t[a](r);if(r.store)var s=r.data=new fu;return r.add=function(t){if(r.num+=1,!n){s&&s.add(t);for(let e=0;e<i;++e)o[e].add(o[e].get(t),t)}},r.rem=function(t){if(r.num-=1,!n){s&&s.rem(t);for(let e=0;e<i;++e)o[e].rem(o[e].get(t),t)}},r.set=function(t){let i,a;for(s&&s.values(),i=0,a=e.length;i<a;++i)t[e[i]]=r.num;if(!n)for(i=0,a=o.length;i<a;++i)o[i].set(t)},r.init=function(){r.num=0,s&&s.reset();for(let t=0;t<i;++t)o[t].init()},r}(c,l,f)),this.inputs=Object.keys(s)}const _l=xl.prototype;function wl(t){cs.call(this,{},t),this._mlen=0,this._mods=[]}function Al(t,e,n,r){const i=r.sort,o=i&&!r.ignorePeers,a=r.frame||[null,0],s=t.data(n),u=s.length,l=o?Fn(i):null,c={i0:0,i1:0,p0:0,p1:0,index:0,data:s,compare:i||(0,Kt.a9)(-1)};e.init();for(let f=0;f<u;++f)Dl(c,a,f,u),o&&El(c,l),e.update(c,s[f])}function Dl(t,e,n,r){t.p0=t.i0,t.p1=t.i1,t.i0=null==e[0]?0:Math.max(0,n-Math.abs(e[0])),t.i1=null==e[1]?r:Math.min(r,n+Math.abs(e[1])+1),t.index=n}function El(t,e){const n=t.i0,r=t.i1-1,i=t.compare,o=t.data,a=o.length-1;n>0&&!i(o[n],o[n-1])&&(t.i0=e.left(o,o[n])),r<a&&!i(o[r],o[r+1])&&(t.i1=e.right(o,o[r]))}function Fl(t,e,n){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+n)/6)}function Cl(t){this._context=t}function kl(){}function Ml(t){this._context=t}function Sl(t){this._context=t}function $l(t,e){this._basis=new Cl(t),this._beta=e}_l.init=function(){this.windows.forEach((t=>t.init())),this.cell&&this.cell.init()},_l.update=function(t,e){const n=this.cell,r=this.windows,i=t.data,o=r&&r.length;let a;if(n){for(a=t.p0;a<t.i0;++a)n.rem(i[a]);for(a=t.p1;a<t.i1;++a)n.add(i[a]);n.set(e)}for(a=0;a<o;++a)r[a].update(t,e)},wl.Definition={type:"Window",metadata:{modifies:!0},params:[{name:"sort",type:"compare"},{name:"groupby",type:"field",array:!0},{name:"ops",type:"enum",array:!0,values:bl.concat(ru)},{name:"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,Kt.XW)(wl,cs,{transform(t,e){this.stamp=e.stamp;const n=t.modified(),r=Ra(t.sort),i=Ks(t.groupby),o=t=>this.group(i(t));let a=this.state;a&&!n||(a=this.state=new xl(t)),n||e.modified(a.inputs)?(this.value={},e.visit(e.SOURCE,(t=>o(t).add(t)))):(e.visit(e.REM,(t=>o(t).remove(t))),e.visit(e.ADD,(t=>o(t).add(t))));for(let s=0,u=this._mlen;s<u;++s)Al(this._mods[s],a,r,t);return this._mlen=0,this._mods=[],e.reflow(n).modifies(a.outputs)},group(t){let e=this.value[t];return e||(e=this.value[t]=gu($a),e.stamp=-1),e.stamp<this.stamp&&(e.stamp=this.stamp,this._mods[this._mlen++]=e),e}}),Cl.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:Fl(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(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);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:Fl(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}},Ml.prototype={areaStart:kl,areaEnd:kl,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(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x2=t,this._y2=e;break;case 1:this._point=2,this._x3=t,this._y3=e;break;case 2:this._point=3,this._x4=t,this._y4=e,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+e)/6);break;default:Fl(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}},Sl.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(t,e){switch(t=+t,e=+e,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+t)/6,r=(this._y0+4*this._y1+e)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:Fl(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}},$l.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var t=this._x,e=this._y,n=t.length-1;if(n>0)for(var r,i=t[0],o=e[0],a=t[n]-i,s=e[n]-o,u=-1;++u<=n;)r=u/n,this._basis.point(this._beta*t[u]+(1-this._beta)*(i+r*a),this._beta*e[u]+(1-this._beta)*(o+r*s));this._x=this._y=null,this._basis.lineEnd()},point:function(t,e){this._x.push(+t),this._y.push(+e)}};const Tl=function t(e){function n(t){return 1===e?new Cl(t):new $l(t,e)}return n.beta=function(e){return t(+e)},n}(.85);function Bl(t,e,n){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-e),t._y2+t._k*(t._y1-n),t._x2,t._y2)}function Nl(t,e){this._context=t,this._k=(1-e)/6}Nl.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:Bl(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2,this._x1=t,this._y1=e;break;case 2:this._point=3;default:Bl(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const Ol=function t(e){function n(t){return new Nl(t,e)}return n.tension=function(e){return t(+e)},n}(0);function zl(t,e){this._context=t,this._k=(1-e)/6}zl.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(t,e){switch(t=+t,e=+e,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:Bl(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const Rl=function t(e){function n(t){return new zl(t,e)}return n.tension=function(e){return t(+e)},n}(0);function Pl(t,e){this._context=t,this._k=(1-e)/6}Pl.prototype={areaStart:kl,areaEnd:kl,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(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:Bl(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const Ul=function t(e){function n(t){return new Pl(t,e)}return n.tension=function(e){return t(+e)},n}(0),Ll=Math.abs,jl=Math.atan2,Il=Math.cos,ql=Math.max,Wl=Math.min,Hl=Math.sin,Xl=Math.sqrt,Yl=1e-12,Gl=Math.PI,Vl=Gl/2,Jl=2*Gl;function Zl(t){return t>=1?Vl:t<=-1?-Vl:Math.asin(t)}function Kl(t,e,n){var r=t._x1,i=t._y1,o=t._x2,a=t._y2;if(t._l01_a>Yl){var s=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,u=3*t._l01_a*(t._l01_a+t._l12_a);r=(r*s-t._x0*t._l12_2a+t._x2*t._l01_2a)/u,i=(i*s-t._y0*t._l12_2a+t._y2*t._l01_2a)/u}if(t._l23_a>Yl){var l=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,c=3*t._l23_a*(t._l23_a+t._l12_a);o=(o*l+t._x1*t._l23_2a-e*t._l12_2a)/c,a=(a*l+t._y1*t._l23_2a-n*t._l12_2a)/c}t._context.bezierCurveTo(r,i,o,a,t._x2,t._y2)}function Ql(t,e){this._context=t,this._alpha=e}Ql.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(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,r=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3;default:Kl(this,t,e)}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=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const tc=function t(e){function n(t){return e?new Ql(t,e):new Nl(t,0)}return n.alpha=function(e){return t(+e)},n}(.5);function ec(t,e){this._context=t,this._alpha=e}ec.prototype={areaStart:kl,areaEnd:kl,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(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,r=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:Kl(this,t,e)}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=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const nc=function t(e){function n(t){return e?new ec(t,e):new Pl(t,0)}return n.alpha=function(e){return t(+e)},n}(.5);function rc(t,e){this._context=t,this._alpha=e}rc.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(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,r=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:Kl(this,t,e)}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=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const ic=function t(e){function n(t){return e?new rc(t,e):new zl(t,0)}return n.alpha=function(e){return t(+e)},n}(.5);function oc(t){this._context=t}function ac(t){return new oc(t)}function sc(t){this._context=t}function uc(t){return t<0?-1:1}function lc(t,e,n){var r=t._x1-t._x0,i=e-t._x1,o=(t._y1-t._y0)/(r||i<0&&-0),a=(n-t._y1)/(i||r<0&&-0),s=(o*i+a*r)/(r+i);return(uc(o)+uc(a))*Math.min(Math.abs(o),Math.abs(a),.5*Math.abs(s))||0}function cc(t,e){var n=t._x1-t._x0;return n?(3*(t._y1-t._y0)/n-e)/2:e}function fc(t,e,n){var r=t._x0,i=t._y0,o=t._x1,a=t._y1,s=(o-r)/3;t._context.bezierCurveTo(r+s,i+s*e,o-s,a-s*n,o,a)}function hc(t){this._context=t}function dc(t){this._context=new pc(t)}function pc(t){this._context=t}function gc(t){this._context=t}function mc(t){var e,n,r=t.length-1,i=new Array(r),o=new Array(r),a=new Array(r);for(i[0]=0,o[0]=2,a[0]=t[0]+2*t[1],e=1;e<r-1;++e)i[e]=1,o[e]=4,a[e]=4*t[e]+2*t[e+1];for(i[r-1]=2,o[r-1]=7,a[r-1]=8*t[r-1]+t[r],e=1;e<r;++e)n=i[e]/o[e-1],o[e]-=n,a[e]-=n*a[e-1];for(i[r-1]=a[r-1]/o[r-1],e=r-2;e>=0;--e)i[e]=(a[e]-i[e+1])/o[e];for(o[r-1]=(t[r]+i[r-1])/2,e=0;e<r-1;++e)o[e]=2*t[e+1]-i[e+1];return[i,o]}function yc(t,e){this._context=t,this._t=e}function vc(t){return function(){return t}}oc.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(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._context.lineTo(t,e)}}},sc.prototype={areaStart:kl,areaEnd:kl,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,e){t=+t,e=+e,this._point?this._context.lineTo(t,e):(this._point=1,this._context.moveTo(t,e))}},hc.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:fc(this,this._t0,cc(this,this._t0))}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){var n=NaN;if(e=+e,(t=+t)!==this._x1||e!==this._y1){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,fc(this,cc(this,n=lc(this,t,e)),n);break;default:fc(this,this._t0,n=lc(this,t,e))}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=n}}},(dc.prototype=Object.create(hc.prototype)).point=function(t,e){hc.prototype.point.call(this,e,t)},pc.prototype={moveTo:function(t,e){this._context.moveTo(e,t)},closePath:function(){this._context.closePath()},lineTo:function(t,e){this._context.lineTo(e,t)},bezierCurveTo:function(t,e,n,r,i,o){this._context.bezierCurveTo(e,t,r,n,o,i)}},gc.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var t=this._x,e=this._y,n=t.length;if(n)if(this._line?this._context.lineTo(t[0],e[0]):this._context.moveTo(t[0],e[0]),2===n)this._context.lineTo(t[1],e[1]);else for(var r=mc(t),i=mc(e),o=0,a=1;a<n;++o,++a)this._context.bezierCurveTo(r[0][o],i[0][o],r[1][o],i[1][o],t[a],e[a]);(this._line||0!==this._line&&1===n)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(t,e){this._x.push(+t),this._y.push(+e)}},yc.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(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,e),this._context.lineTo(t,e);else{var n=this._x*(1-this._t)+t*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,e)}}this._x=t,this._y=e}};const bc=Math.PI,xc=2*bc,_c=1e-6,wc=xc-_c;function Ac(t){this._+=t[0];for(let e=1,n=t.length;e<n;++e)this._+=arguments[e]+t[e]}class Dc{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=null==t?Ac:function(t){let e=Math.floor(t);if(!(e>=0))throw new Error(`invalid digits: ${t}`);if(e>15)return Ac;const n=10**e;return function(t){this._+=t[0];for(let e=1,r=t.length;e<r;++e)this._+=Math.round(arguments[e]*n)/n+t[e]}}(t)}moveTo(t,e){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+e}`}closePath(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,e){this._append`L${this._x1=+t},${this._y1=+e}`}quadraticCurveTo(t,e,n,r){this._append`Q${+t},${+e},${this._x1=+n},${this._y1=+r}`}bezierCurveTo(t,e,n,r,i,o){this._append`C${+t},${+e},${+n},${+r},${this._x1=+i},${this._y1=+o}`}arcTo(t,e,n,r,i){if(t=+t,e=+e,n=+n,r=+r,(i=+i)<0)throw new Error(`negative radius: ${i}`);let o=this._x1,a=this._y1,s=n-t,u=r-e,l=o-t,c=a-e,f=l*l+c*c;if(null===this._x1)this._append`M${this._x1=t},${this._y1=e}`;else if(f>_c)if(Math.abs(c*s-u*l)>_c&&i){let h=n-o,d=r-a,p=s*s+u*u,g=h*h+d*d,m=Math.sqrt(p),y=Math.sqrt(f),v=i*Math.tan((bc-Math.acos((p+f-g)/(2*m*y)))/2),b=v/y,x=v/m;Math.abs(b-1)>_c&&this._append`L${t+b*l},${e+b*c}`,this._append`A${i},${i},0,0,${+(c*h>l*d)},${this._x1=t+x*s},${this._y1=e+x*u}`}else this._append`L${this._x1=t},${this._y1=e}`;else;}arc(t,e,n,r,i,o){if(t=+t,e=+e,o=!!o,(n=+n)<0)throw new Error(`negative radius: ${n}`);let a=n*Math.cos(r),s=n*Math.sin(r),u=t+a,l=e+s,c=1^o,f=o?r-i:i-r;null===this._x1?this._append`M${u},${l}`:(Math.abs(this._x1-u)>_c||Math.abs(this._y1-l)>_c)&&this._append`L${u},${l}`,n&&(f<0&&(f=f%xc+xc),f>wc?this._append`A${n},${n},0,1,${c},${t-a},${e-s}A${n},${n},0,1,${c},${this._x1=u},${this._y1=l}`:f>_c&&this._append`A${n},${n},0,${+(f>=bc)},${c},${this._x1=t+n*Math.cos(i)},${this._y1=e+n*Math.sin(i)}`)}rect(t,e,n,r){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+e}h${n=+n}v${+r}h${-n}Z`}toString(){return this._}}function Ec(){return new Dc}function Fc(t){let e=3;return t.digits=function(n){if(!arguments.length)return e;if(null==n)e=null;else{const t=Math.floor(n);if(!(t>=0))throw new RangeError(`invalid digits: ${n}`);e=t}return t},()=>new Dc(e)}function Cc(t){return t.innerRadius}function kc(t){return t.outerRadius}function Mc(t){return t.startAngle}function Sc(t){return t.endAngle}function $c(t){return t&&t.padAngle}function Tc(t,e,n,r,i,o,a){var s=t-n,u=e-r,l=(a?o:-o)/Xl(s*s+u*u),c=l*u,f=-l*s,h=t+c,d=e+f,p=n+c,g=r+f,m=(h+p)/2,y=(d+g)/2,v=p-h,b=g-d,x=v*v+b*b,_=i-o,w=h*g-p*d,A=(b<0?-1:1)*Xl(ql(0,_*_*x-w*w)),D=(w*b-v*A)/x,E=(-w*v-b*A)/x,F=(w*b+v*A)/x,C=(-w*v+b*A)/x,k=D-m,M=E-y,S=F-m,$=C-y;return k*k+M*M>S*S+$*$&&(D=F,E=C),{cx:D,cy:E,x01:-c,y01:-f,x11:D*(i/_-1),y11:E*(i/_-1)}}Ec.prototype=Dc.prototype;Array.prototype.slice;function Bc(t){return"object"===typeof t&&"length"in t?t:Array.from(t)}function Nc(t){return t[0]}function Oc(t){return t[1]}function zc(t,e){var n=vc(!0),r=null,i=ac,o=null,a=Fc(s);function s(s){var u,l,c,f=(s=Bc(s)).length,h=!1;for(null==r&&(o=i(c=a())),u=0;u<=f;++u)!(u<f&&n(l=s[u],u,s))===h&&((h=!h)?o.lineStart():o.lineEnd()),h&&o.point(+t(l,u,s),+e(l,u,s));if(c)return o=null,c+""||null}return t="function"===typeof t?t:void 0===t?Nc:vc(t),e="function"===typeof e?e:void 0===e?Oc:vc(e),s.x=function(e){return arguments.length?(t="function"===typeof e?e:vc(+e),s):t},s.y=function(t){return arguments.length?(e="function"===typeof t?t:vc(+t),s):e},s.defined=function(t){return arguments.length?(n="function"===typeof t?t:vc(!!t),s):n},s.curve=function(t){return arguments.length?(i=t,null!=r&&(o=i(r)),s):i},s.context=function(t){return arguments.length?(null==t?r=o=null:o=i(r=t),s):r},s}function Rc(t,e,n){var r=null,i=vc(!0),o=null,a=ac,s=null,u=Fc(l);function l(l){var c,f,h,d,p,g=(l=Bc(l)).length,m=!1,y=new Array(g),v=new Array(g);for(null==o&&(s=a(p=u())),c=0;c<=g;++c){if(!(c<g&&i(d=l[c],c,l))===m)if(m=!m)f=c,s.areaStart(),s.lineStart();else{for(s.lineEnd(),s.lineStart(),h=c-1;h>=f;--h)s.point(y[h],v[h]);s.lineEnd(),s.areaEnd()}m&&(y[c]=+t(d,c,l),v[c]=+e(d,c,l),s.point(r?+r(d,c,l):y[c],n?+n(d,c,l):v[c]))}if(p)return s=null,p+""||null}function c(){return zc().defined(i).curve(a).context(o)}return t="function"===typeof t?t:void 0===t?Nc:vc(+t),e="function"===typeof e?e:vc(void 0===e?0:+e),n="function"===typeof n?n:void 0===n?Oc:vc(+n),l.x=function(e){return arguments.length?(t="function"===typeof e?e:vc(+e),r=null,l):t},l.x0=function(e){return arguments.length?(t="function"===typeof e?e:vc(+e),l):t},l.x1=function(t){return arguments.length?(r=null==t?null:"function"===typeof t?t:vc(+t),l):r},l.y=function(t){return arguments.length?(e="function"===typeof t?t:vc(+t),n=null,l):e},l.y0=function(t){return arguments.length?(e="function"===typeof t?t:vc(+t),l):e},l.y1=function(t){return arguments.length?(n=null==t?null:"function"===typeof t?t:vc(+t),l):n},l.lineX0=l.lineY0=function(){return c().x(t).y(e)},l.lineY1=function(){return c().x(t).y(n)},l.lineX1=function(){return c().x(r).y(e)},l.defined=function(t){return arguments.length?(i="function"===typeof t?t:vc(!!t),l):i},l.curve=function(t){return arguments.length?(a=t,null!=o&&(s=a(o)),l):a},l.context=function(t){return arguments.length?(null==t?o=s=null:s=a(o=t),l):o},l}Xl(3);const Pc={draw(t,e){const n=Xl(e/Gl);t.moveTo(n,0),t.arc(0,0,n,0,Jl)}},Uc=(Xl(1/3),Hl(Gl/10)/Hl(7*Gl/10));Hl(Jl/10),Il(Jl/10),Xl(3),Xl(3),Xl(3),Xl(12);function Lc(t,e){if("undefined"!==typeof document&&document.createElement){const n=document.createElement("canvas");if(n&&n.getContext)return n.width=t,n.height=e,n}return null}const jc=()=>"undefined"!==typeof Image?Image:null,Ic=Fn(Dn),qc=Ic.right,Wc=Ic.left,Hc=(Fn(xs).center,qc),Xc=Math.sqrt(50),Yc=Math.sqrt(10),Gc=Math.sqrt(2);function Vc(t,e,n){const r=(e-t)/Math.max(0,n),i=Math.floor(Math.log10(r)),o=r/Math.pow(10,i),a=o>=Xc?10:o>=Yc?5:o>=Gc?2:1;let s,u,l;return i<0?(l=Math.pow(10,-i)/a,s=Math.round(t*l),u=Math.round(e*l),s/l<t&&++s,u/l>e&&--u,l=-l):(l=Math.pow(10,i)*a,s=Math.round(t/l),u=Math.round(e/l),s*l<t&&++s,u*l>e&&--u),u<s&&.5<=n&&n<2?Vc(t,e,2*n):[s,u,l]}function Jc(t,e,n){if(!((n=+n)>0))return[];if((t=+t)===(e=+e))return[t];const r=e<t,[i,o,a]=r?Vc(e,t,n):Vc(t,e,n);if(!(o>=i))return[];const s=o-i+1,u=new Array(s);if(r)if(a<0)for(let l=0;l<s;++l)u[l]=(o-l)/-a;else for(let l=0;l<s;++l)u[l]=(o-l)*a;else if(a<0)for(let l=0;l<s;++l)u[l]=(i+l)/-a;else for(let l=0;l<s;++l)u[l]=(i+l)*a;return u}function Zc(t,e,n){return Vc(t=+t,e=+e,n=+n)[2]}function Kc(t,e,n){n=+n;const r=(e=+e)<(t=+t),i=r?Zc(e,t,n):Zc(t,e,n);return(r?-1:1)*(i<0?1/-i:i)}function Qc(t,e){return null==t||null==e?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function tf(t,e){return null==t||null==e?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function ef(t){let e,n,r;function i(t,r,i=0,o=t.length){if(i<o){if(0!==e(r,r))return o;do{const e=i+o>>>1;n(t[e],r)<0?i=e+1:o=e}while(i<o)}return i}return 2!==t.length?(e=Qc,n=(e,n)=>Qc(t(e),n),r=(e,n)=>t(e)-n):(e=t===Qc||t===tf?t:nf,n=t,r=t),{left:i,center:function(t,e,n=0,o=t.length){const a=i(t,e,n,o-1);return a>n&&r(t[a-1],e)>-r(t[a],e)?a-1:a},right:function(t,r,i=0,o=t.length){if(i<o){if(0!==e(r,r))return o;do{const e=i+o>>>1;n(t[e],r)<=0?i=e+1:o=e}while(i<o)}return i}}}function nf(){return 0}function rf(t){return null===t?NaN:+t}const of=ef(Qc),af=of.right,sf=(of.left,ef(rf).center,af);var uf=n(23244),lf=n(58355);function cf(t,e){e||(e=[]);var n,r=t?Math.min(e.length,t.length):0,i=e.slice();return function(o){for(n=0;n<r;++n)i[n]=t[n]*(1-o)+e[n]*o;return i}}function ff(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function hf(t,e){return(ff(e)?cf:df)(t,e)}function df(t,e){var n,r=e?e.length:0,i=t?Math.min(r,t.length):0,o=new Array(i),a=new Array(r);for(n=0;n<i;++n)o[n]=bf(t[n],e[n]);for(;n<r;++n)a[n]=e[n];return function(t){for(n=0;n<i;++n)a[n]=o[n](t);return a}}function pf(t,e){var n=new Date;return t=+t,e=+e,function(r){return n.setTime(t*(1-r)+e*r),n}}var gf=n(96539);function mf(t,e){var n,r={},i={};for(n in null!==t&&"object"===typeof t||(t={}),null!==e&&"object"===typeof e||(e={}),e)n in t?r[n]=bf(t[n],e[n]):i[n]=e[n];return function(t){for(n in r)i[n]=r[n](t);return i}}var yf=n(47135),vf=n(76025);function bf(t,e){var n,r=typeof e;return null==e||"boolean"===r?(0,vf.Z)(e):("number"===r?gf.Z:"string"===r?(n=(0,uf.ZP)(e))?(e=n,lf.ZP):yf.Z:e instanceof uf.ZP?lf.ZP:e instanceof Date?pf:ff(e)?cf:Array.isArray(e)?df:"function"!==typeof e.valueOf&&"function"!==typeof e.toString||isNaN(e)?mf:gf.Z)(t,e)}function xf(t,e){return t=+t,e=+e,function(n){return Math.round(t*(1-n)+e*n)}}function _f(t){return+t}var wf=[0,1];function Af(t){return t}function Df(t,e){return(e-=t=+t)?function(n){return(n-t)/e}:function(t){return function(){return t}}(isNaN(e)?NaN:.5)}function Ef(t,e,n){var r=t[0],i=t[1],o=e[0],a=e[1];return i<r?(r=Df(i,r),o=n(a,o)):(r=Df(r,i),o=n(o,a)),function(t){return o(r(t))}}function Ff(t,e,n){var r=Math.min(t.length,e.length)-1,i=new Array(r),o=new Array(r),a=-1;for(t[r]<t[0]&&(t=t.slice().reverse(),e=e.slice().reverse());++a<r;)i[a]=Df(t[a],t[a+1]),o[a]=n(e[a],e[a+1]);return function(e){var n=sf(t,e,1,r)-1;return o[n](i[n](e))}}function Cf(t,e){return e.domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown())}function kf(){var t,e,n,r,i,o,a=wf,s=wf,u=bf,l=Af;function c(){var t=Math.min(a.length,s.length);return l!==Af&&(l=function(t,e){var n;return t>e&&(n=t,t=e,e=n),function(n){return Math.max(t,Math.min(e,n))}}(a[0],a[t-1])),r=t>2?Ff:Ef,i=o=null,f}function f(e){return null==e||isNaN(e=+e)?n:(i||(i=r(a.map(t),s,u)))(t(l(e)))}return f.invert=function(n){return l(e((o||(o=r(s,a.map(t),gf.Z)))(n)))},f.domain=function(t){return arguments.length?(a=Array.from(t,_f),c()):a.slice()},f.range=function(t){return arguments.length?(s=Array.from(t),c()):s.slice()},f.rangeRound=function(t){return s=Array.from(t),u=xf,c()},f.clamp=function(t){return arguments.length?(l=!!t||Af,c()):l!==Af},f.interpolate=function(t){return arguments.length?(u=t,c()):u},f.unknown=function(t){return arguments.length?(n=t,f):n},function(n,r){return t=n,e=r,c()}}function Mf(){return kf()(Af,Af)}function Sf(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t)}return this}function $f(t,e){switch(arguments.length){case 0:break;case 1:"function"===typeof t?this.interpolator(t):this.range(t);break;default:this.domain(t),"function"===typeof e?this.interpolator(e):this.range(e)}return this}function Tf(t,e,n,r){var i,o=Kc(t,e,n);switch((r=De(null==r?",f":r)).type){case"s":var a=Math.max(Math.abs(t),Math.abs(e));return null!=r.precision||isNaN(i=ke(o,a))||(r.precision=i),ze(r,a);case"":case"e":case"g":case"p":case"r":null!=r.precision||isNaN(i=Me(o,Math.max(Math.abs(t),Math.abs(e))))||(r.precision=i-("e"===r.type));break;case"f":case"%":null!=r.precision||isNaN(i=Se(o))||(r.precision=i-2*("%"===r.type))}return Oe(r)}function Bf(t){var e=t.domain;return t.ticks=function(t){var n=e();return Jc(n[0],n[n.length-1],null==t?10:t)},t.tickFormat=function(t,n){var r=e();return Tf(r[0],r[r.length-1],null==t?10:t,n)},t.nice=function(n){null==n&&(n=10);var r,i,o=e(),a=0,s=o.length-1,u=o[a],l=o[s],c=10;for(l<u&&(i=u,u=l,l=i,i=a,a=s,s=i);c-- >0;){if((i=Zc(u,l,n))===r)return o[a]=u,o[s]=l,e(o);if(i>0)u=Math.floor(u/i)*i,l=Math.ceil(l/i)*i;else{if(!(i<0))break;u=Math.ceil(u*i)/i,l=Math.floor(l*i)/i}r=i}return t},t}function Nf(t,e){var n,r=0,i=(t=t.slice()).length-1,o=t[r],a=t[i];return a<o&&(n=r,r=i,i=n,n=o,o=a,a=n),t[r]=e.floor(o),t[i]=e.ceil(a),t}function Of(t){return Math.log(t)}function zf(t){return Math.exp(t)}function Rf(t){return-Math.log(-t)}function Pf(t){return-Math.exp(-t)}function Uf(t){return isFinite(t)?+("1e"+t):t<0?0:t}function Lf(t){return(e,n)=>-t(-e,n)}function jf(t){const e=t(Of,zf),n=e.domain;let r,i,o=10;function a(){return r=function(t){return t===Math.E?Math.log:10===t&&Math.log10||2===t&&Math.log2||(t=Math.log(t),e=>Math.log(e)/t)}(o),i=function(t){return 10===t?Uf:t===Math.E?Math.exp:e=>Math.pow(t,e)}(o),n()[0]<0?(r=Lf(r),i=Lf(i),t(Rf,Pf)):t(Of,zf),e}return e.base=function(t){return arguments.length?(o=+t,a()):o},e.domain=function(t){return arguments.length?(n(t),a()):n()},e.ticks=t=>{const e=n();let a=e[0],s=e[e.length-1];const u=s<a;u&&([a,s]=[s,a]);let l,c,f=r(a),h=r(s);const d=null==t?10:+t;let p=[];if(!(o%1)&&h-f<d){if(f=Math.floor(f),h=Math.ceil(h),a>0){for(;f<=h;++f)for(l=1;l<o;++l)if(c=f<0?l/i(-f):l*i(f),!(c<a)){if(c>s)break;p.push(c)}}else for(;f<=h;++f)for(l=o-1;l>=1;--l)if(c=f>0?l/i(-f):l*i(f),!(c<a)){if(c>s)break;p.push(c)}2*p.length<d&&(p=Jc(a,s,d))}else p=Jc(f,h,Math.min(h-f,d)).map(i);return u?p.reverse():p},e.tickFormat=(t,n)=>{if(null==t&&(t=10),null==n&&(n=10===o?"s":","),"function"!==typeof n&&(o%1||null!=(n=De(n)).precision||(n.trim=!0),n=Oe(n)),t===1/0)return n;const a=Math.max(1,o*t/e.ticks().length);return t=>{let e=t/i(Math.round(r(t)));return e*o<o-.5&&(e*=o),e<=a?n(t):""}},e.nice=()=>n(Nf(n(),{floor:t=>i(Math.floor(r(t))),ceil:t=>i(Math.ceil(r(t)))})),e}function If(t){return function(e){return e<0?-Math.pow(-e,t):Math.pow(e,t)}}function qf(t){return t<0?-Math.sqrt(-t):Math.sqrt(t)}function Wf(t){return t<0?-t*t:t*t}function Hf(t){var e=t(Af,Af),n=1;return e.exponent=function(e){return arguments.length?1===(n=+e)?t(Af,Af):.5===n?t(qf,Wf):t(If(n),If(1/n)):n},Bf(e)}function Xf(){var t=Hf(kf());return t.copy=function(){return Cf(t,Xf()).exponent(t.exponent())},Sf.apply(t,arguments),t}function Yf(t){return function(e){return Math.sign(e)*Math.log1p(Math.abs(e/t))}}function Gf(t){return function(e){return Math.sign(e)*Math.expm1(Math.abs(e))*t}}function Vf(t){var e=1,n=t(Yf(e),Gf(e));return n.constant=function(n){return arguments.length?t(Yf(e=+n),Gf(e)):e},Bf(n)}const Jf=1e3,Zf=60*Jf,Kf=60*Zf,Qf=24*Kf,th=7*Qf,eh=30*Qf,nh=365*Qf,rh=new Date,ih=new Date;function oh(t,e,n,r){function i(e){return t(e=0===arguments.length?new Date:new Date(+e)),e}return i.floor=e=>(t(e=new Date(+e)),e),i.ceil=n=>(t(n=new Date(n-1)),e(n,1),t(n),n),i.round=t=>{const e=i(t),n=i.ceil(t);return t-e<n-t?e:n},i.offset=(t,n)=>(e(t=new Date(+t),null==n?1:Math.floor(n)),t),i.range=(n,r,o)=>{const a=[];if(n=i.ceil(n),o=null==o?1:Math.floor(o),!(n<r)||!(o>0))return a;let s;do{a.push(s=new Date(+n)),e(n,o),t(n)}while(s<n&&n<r);return a},i.filter=n=>oh((e=>{if(e>=e)for(;t(e),!n(e);)e.setTime(e-1)}),((t,r)=>{if(t>=t)if(r<0)for(;++r<=0;)for(;e(t,-1),!n(t););else for(;--r>=0;)for(;e(t,1),!n(t););})),n&&(i.count=(e,r)=>(rh.setTime(+e),ih.setTime(+r),t(rh),t(ih),Math.floor(n(rh,ih))),i.every=t=>(t=Math.floor(t),isFinite(t)&&t>0?t>1?i.filter(r?e=>r(e)%t===0:e=>i.count(0,e)%t===0):i:null)),i}const ah=oh((()=>{}),((t,e)=>{t.setTime(+t+e)}),((t,e)=>e-t));ah.every=t=>(t=Math.floor(t),isFinite(t)&&t>0?t>1?oh((e=>{e.setTime(Math.floor(e/t)*t)}),((e,n)=>{e.setTime(+e+n*t)}),((e,n)=>(n-e)/t)):ah:null);ah.range;const sh=oh((t=>{t.setTime(t-t.getMilliseconds())}),((t,e)=>{t.setTime(+t+e*Jf)}),((t,e)=>(e-t)/Jf),(t=>t.getUTCSeconds())),uh=(sh.range,oh((t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*Jf)}),((t,e)=>{t.setTime(+t+e*Zf)}),((t,e)=>(e-t)/Zf),(t=>t.getMinutes()))),lh=(uh.range,oh((t=>{t.setUTCSeconds(0,0)}),((t,e)=>{t.setTime(+t+e*Zf)}),((t,e)=>(e-t)/Zf),(t=>t.getUTCMinutes()))),ch=(lh.range,oh((t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*Jf-t.getMinutes()*Zf)}),((t,e)=>{t.setTime(+t+e*Kf)}),((t,e)=>(e-t)/Kf),(t=>t.getHours()))),fh=(ch.range,oh((t=>{t.setUTCMinutes(0,0,0)}),((t,e)=>{t.setTime(+t+e*Kf)}),((t,e)=>(e-t)/Kf),(t=>t.getUTCHours()))),hh=(fh.range,oh((t=>t.setHours(0,0,0,0)),((t,e)=>t.setDate(t.getDate()+e)),((t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*Zf)/Qf),(t=>t.getDate()-1))),dh=(hh.range,oh((t=>{t.setUTCHours(0,0,0,0)}),((t,e)=>{t.setUTCDate(t.getUTCDate()+e)}),((t,e)=>(e-t)/Qf),(t=>t.getUTCDate()-1))),ph=(dh.range,oh((t=>{t.setUTCHours(0,0,0,0)}),((t,e)=>{t.setUTCDate(t.getUTCDate()+e)}),((t,e)=>(e-t)/Qf),(t=>Math.floor(t/Qf))));ph.range;function gh(t){return oh((e=>{e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)}),((t,e)=>{t.setDate(t.getDate()+7*e)}),((t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*Zf)/th))}const mh=gh(0),yh=gh(1),vh=gh(2),bh=gh(3),xh=gh(4),_h=gh(5),wh=gh(6);mh.range,yh.range,vh.range,bh.range,xh.range,_h.range,wh.range;function Ah(t){return oh((e=>{e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)}),((t,e)=>{t.setUTCDate(t.getUTCDate()+7*e)}),((t,e)=>(e-t)/th))}const Dh=Ah(0),Eh=Ah(1),Fh=Ah(2),Ch=Ah(3),kh=Ah(4),Mh=Ah(5),Sh=Ah(6),$h=(Dh.range,Eh.range,Fh.range,Ch.range,kh.range,Mh.range,Sh.range,oh((t=>{t.setDate(1),t.setHours(0,0,0,0)}),((t,e)=>{t.setMonth(t.getMonth()+e)}),((t,e)=>e.getMonth()-t.getMonth()+12*(e.getFullYear()-t.getFullYear())),(t=>t.getMonth()))),Th=($h.range,oh((t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)}),((t,e)=>{t.setUTCMonth(t.getUTCMonth()+e)}),((t,e)=>e.getUTCMonth()-t.getUTCMonth()+12*(e.getUTCFullYear()-t.getUTCFullYear())),(t=>t.getUTCMonth()))),Bh=(Th.range,oh((t=>{t.setMonth(0,1),t.setHours(0,0,0,0)}),((t,e)=>{t.setFullYear(t.getFullYear()+e)}),((t,e)=>e.getFullYear()-t.getFullYear()),(t=>t.getFullYear())));Bh.every=t=>isFinite(t=Math.floor(t))&&t>0?oh((e=>{e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)}),((e,n)=>{e.setFullYear(e.getFullYear()+n*t)})):null;Bh.range;const Nh=oh((t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),((t,e)=>{t.setUTCFullYear(t.getUTCFullYear()+e)}),((t,e)=>e.getUTCFullYear()-t.getUTCFullYear()),(t=>t.getUTCFullYear()));Nh.every=t=>isFinite(t=Math.floor(t))&&t>0?oh((e=>{e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)}),((e,n)=>{e.setUTCFullYear(e.getUTCFullYear()+n*t)})):null;Nh.range;function Oh(t,e,n,r,i,o){const a=[[sh,1,Jf],[sh,5,5*Jf],[sh,15,15*Jf],[sh,30,30*Jf],[o,1,Zf],[o,5,5*Zf],[o,15,15*Zf],[o,30,30*Zf],[i,1,Kf],[i,3,3*Kf],[i,6,6*Kf],[i,12,12*Kf],[r,1,Qf],[r,2,2*Qf],[n,1,th],[e,1,eh],[e,3,3*eh],[t,1,nh]];function s(e,n,r){const i=Math.abs(n-e)/r,o=ef((([,,t])=>t)).right(a,i);if(o===a.length)return t.every(Kc(e/nh,n/nh,r));if(0===o)return ah.every(Math.max(Kc(e,n,r),1));const[s,u]=a[i/a[o-1][2]<a[o][2]/i?o-1:o];return s.every(u)}return[function(t,e,n){const r=e<t;r&&([t,e]=[e,t]);const i=n&&"function"===typeof n.range?n:s(t,e,n),o=i?i.range(t,+e+1):[];return r?o.reverse():o},s]}const[zh,Rh]=Oh(Nh,Th,Dh,ph,fh,lh),[Ph,Uh]=Oh(Bh,$h,mh,hh,ch,uh);function Lh(t){if(0<=t.y&&t.y<100){var e=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return e.setFullYear(t.y),e}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function jh(t){if(0<=t.y&&t.y<100){var e=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return e.setUTCFullYear(t.y),e}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function Ih(t,e,n){return{y:t,m:e,d:n,H:0,M:0,S:0,L:0}}var qh,Wh,Hh,Xh={"-":"",_:" ",0:"0"},Yh=/^\s*\d+/,Gh=/^%/,Vh=/[\\^$*+?|[\]().{}]/g;function Jh(t,e,n){var r=t<0?"-":"",i=(r?-t:t)+"",o=i.length;return r+(o<n?new Array(n-o+1).join(e)+i:i)}function Zh(t){return t.replace(Vh,"\\$&")}function Kh(t){return new RegExp("^(?:"+t.map(Zh).join("|")+")","i")}function Qh(t){return new Map(t.map(((t,e)=>[t.toLowerCase(),e])))}function td(t,e,n){var r=Yh.exec(e.slice(n,n+1));return r?(t.w=+r[0],n+r[0].length):-1}function ed(t,e,n){var r=Yh.exec(e.slice(n,n+1));return r?(t.u=+r[0],n+r[0].length):-1}function nd(t,e,n){var r=Yh.exec(e.slice(n,n+2));return r?(t.U=+r[0],n+r[0].length):-1}function rd(t,e,n){var r=Yh.exec(e.slice(n,n+2));return r?(t.V=+r[0],n+r[0].length):-1}function id(t,e,n){var r=Yh.exec(e.slice(n,n+2));return r?(t.W=+r[0],n+r[0].length):-1}function od(t,e,n){var r=Yh.exec(e.slice(n,n+4));return r?(t.y=+r[0],n+r[0].length):-1}function ad(t,e,n){var r=Yh.exec(e.slice(n,n+2));return r?(t.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function sd(t,e,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(n,n+6));return r?(t.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function ud(t,e,n){var r=Yh.exec(e.slice(n,n+1));return r?(t.q=3*r[0]-3,n+r[0].length):-1}function ld(t,e,n){var r=Yh.exec(e.slice(n,n+2));return r?(t.m=r[0]-1,n+r[0].length):-1}function cd(t,e,n){var r=Yh.exec(e.slice(n,n+2));return r?(t.d=+r[0],n+r[0].length):-1}function fd(t,e,n){var r=Yh.exec(e.slice(n,n+3));return r?(t.m=0,t.d=+r[0],n+r[0].length):-1}function hd(t,e,n){var r=Yh.exec(e.slice(n,n+2));return r?(t.H=+r[0],n+r[0].length):-1}function dd(t,e,n){var r=Yh.exec(e.slice(n,n+2));return r?(t.M=+r[0],n+r[0].length):-1}function pd(t,e,n){var r=Yh.exec(e.slice(n,n+2));return r?(t.S=+r[0],n+r[0].length):-1}function gd(t,e,n){var r=Yh.exec(e.slice(n,n+3));return r?(t.L=+r[0],n+r[0].length):-1}function md(t,e,n){var r=Yh.exec(e.slice(n,n+6));return r?(t.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function yd(t,e,n){var r=Gh.exec(e.slice(n,n+1));return r?n+r[0].length:-1}function vd(t,e,n){var r=Yh.exec(e.slice(n));return r?(t.Q=+r[0],n+r[0].length):-1}function bd(t,e,n){var r=Yh.exec(e.slice(n));return r?(t.s=+r[0],n+r[0].length):-1}function xd(t,e){return Jh(t.getDate(),e,2)}function _d(t,e){return Jh(t.getHours(),e,2)}function wd(t,e){return Jh(t.getHours()%12||12,e,2)}function Ad(t,e){return Jh(1+hh.count(Bh(t),t),e,3)}function Dd(t,e){return Jh(t.getMilliseconds(),e,3)}function Ed(t,e){return Dd(t,e)+"000"}function Fd(t,e){return Jh(t.getMonth()+1,e,2)}function Cd(t,e){return Jh(t.getMinutes(),e,2)}function kd(t,e){return Jh(t.getSeconds(),e,2)}function Md(t){var e=t.getDay();return 0===e?7:e}function Sd(t,e){return Jh(mh.count(Bh(t)-1,t),e,2)}function $d(t){var e=t.getDay();return e>=4||0===e?xh(t):xh.ceil(t)}function Td(t,e){return t=$d(t),Jh(xh.count(Bh(t),t)+(4===Bh(t).getDay()),e,2)}function Bd(t){return t.getDay()}function Nd(t,e){return Jh(yh.count(Bh(t)-1,t),e,2)}function Od(t,e){return Jh(t.getFullYear()%100,e,2)}function zd(t,e){return Jh((t=$d(t)).getFullYear()%100,e,2)}function Rd(t,e){return Jh(t.getFullYear()%1e4,e,4)}function Pd(t,e){var n=t.getDay();return Jh((t=n>=4||0===n?xh(t):xh.ceil(t)).getFullYear()%1e4,e,4)}function Ud(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+Jh(e/60|0,"0",2)+Jh(e%60,"0",2)}function Ld(t,e){return Jh(t.getUTCDate(),e,2)}function jd(t,e){return Jh(t.getUTCHours(),e,2)}function Id(t,e){return Jh(t.getUTCHours()%12||12,e,2)}function qd(t,e){return Jh(1+dh.count(Nh(t),t),e,3)}function Wd(t,e){return Jh(t.getUTCMilliseconds(),e,3)}function Hd(t,e){return Wd(t,e)+"000"}function Xd(t,e){return Jh(t.getUTCMonth()+1,e,2)}function Yd(t,e){return Jh(t.getUTCMinutes(),e,2)}function Gd(t,e){return Jh(t.getUTCSeconds(),e,2)}function Vd(t){var e=t.getUTCDay();return 0===e?7:e}function Jd(t,e){return Jh(Dh.count(Nh(t)-1,t),e,2)}function Zd(t){var e=t.getUTCDay();return e>=4||0===e?kh(t):kh.ceil(t)}function Kd(t,e){return t=Zd(t),Jh(kh.count(Nh(t),t)+(4===Nh(t).getUTCDay()),e,2)}function Qd(t){return t.getUTCDay()}function tp(t,e){return Jh(Eh.count(Nh(t)-1,t),e,2)}function ep(t,e){return Jh(t.getUTCFullYear()%100,e,2)}function np(t,e){return Jh((t=Zd(t)).getUTCFullYear()%100,e,2)}function rp(t,e){return Jh(t.getUTCFullYear()%1e4,e,4)}function ip(t,e){var n=t.getUTCDay();return Jh((t=n>=4||0===n?kh(t):kh.ceil(t)).getUTCFullYear()%1e4,e,4)}function op(){return"+0000"}function ap(){return"%"}function sp(t){return+t}function up(t){return Math.floor(+t/1e3)}function lp(t){return new Date(t)}function cp(t){return t instanceof Date?+t:+new Date(+t)}function fp(t,e,n,r,i,o,a,s,u,l){var c=Mf(),f=c.invert,h=c.domain,d=l(".%L"),p=l(":%S"),g=l("%I:%M"),m=l("%I %p"),y=l("%a %d"),v=l("%b %d"),b=l("%B"),x=l("%Y");function _(t){return(u(t)<t?d:s(t)<t?p:a(t)<t?g:o(t)<t?m:r(t)<t?i(t)<t?y:v:n(t)<t?b:x)(t)}return c.invert=function(t){return new Date(f(t))},c.domain=function(t){return arguments.length?h(Array.from(t,cp)):h().map(lp)},c.ticks=function(e){var n=h();return t(n[0],n[n.length-1],null==e?10:e)},c.tickFormat=function(t,e){return null==e?_:l(e)},c.nice=function(t){var n=h();return t&&"function"===typeof t.range||(t=e(n[0],n[n.length-1],null==t?10:t)),t?h(Nf(n,t)):c},c.copy=function(){return Cf(c,fp(t,e,n,r,i,o,a,s,u,l))},c}function hp(){var t,e,n,r,i,o=0,a=1,s=Af,u=!1;function l(e){return null==e||isNaN(e=+e)?i:s(0===n?.5:(e=(r(e)-t)*n,u?Math.max(0,Math.min(1,e)):e))}function c(t){return function(e){var n,r;return arguments.length?([n,r]=e,s=t(n,r),l):[s(0),s(1)]}}return l.domain=function(i){return arguments.length?([o,a]=i,t=r(o=+o),e=r(a=+a),n=t===e?0:1/(e-t),l):[o,a]},l.clamp=function(t){return arguments.length?(u=!!t,l):u},l.interpolator=function(t){return arguments.length?(s=t,l):s},l.range=c(bf),l.rangeRound=c(xf),l.unknown=function(t){return arguments.length?(i=t,l):i},function(i){return r=i,t=i(o),e=i(a),n=t===e?0:1/(e-t),l}}function dp(t,e){return e.domain(t.domain()).interpolator(t.interpolator()).clamp(t.clamp()).unknown(t.unknown())}function pp(){var t=Bf(hp()(Af));return t.copy=function(){return dp(t,pp())},$f.apply(t,arguments)}function gp(){var t=Hf(hp());return t.copy=function(){return dp(t,gp()).exponent(t.exponent())},$f.apply(t,arguments)}function mp(t,e){void 0===e&&(e=t,t=bf);for(var n=0,r=e.length-1,i=e[0],o=new Array(r<0?0:r);n<r;)o[n]=t(i,i=e[++n]);return function(t){var e=Math.max(0,Math.min(r-1,Math.floor(t*=r)));return o[e](t-e)}}function yp(){var t,e,n,r,i,o,a,s=0,u=.5,l=1,c=1,f=Af,h=!1;function d(t){return isNaN(t=+t)?a:(t=.5+((t=+o(t))-e)*(c*t<c*e?r:i),f(h?Math.max(0,Math.min(1,t)):t))}function p(t){return function(e){var n,r,i;return arguments.length?([n,r,i]=e,f=mp(t,[n,r,i]),d):[f(0),f(.5),f(1)]}}return d.domain=function(a){return arguments.length?([s,u,l]=a,t=o(s=+s),e=o(u=+u),n=o(l=+l),r=t===e?0:.5/(e-t),i=e===n?0:.5/(n-e),c=e<t?-1:1,d):[s,u,l]},d.clamp=function(t){return arguments.length?(h=!!t,d):h},d.interpolator=function(t){return arguments.length?(f=t,d):f},d.range=p(bf),d.rangeRound=p(xf),d.unknown=function(t){return arguments.length?(a=t,d):a},function(a){return o=a,t=a(s),e=a(u),n=a(l),r=t===e?0:.5/(e-t),i=e===n?0:.5/(n-e),c=e<t?-1:1,d}}function vp(){var t=Hf(yp());return t.copy=function(){return dp(t,vp()).exponent(t.exponent())},$f.apply(t,arguments)}function bp(t,e,n=rf){if((r=t.length)&&!isNaN(e=+e)){if(e<=0||r<2)return+n(t[0],0,t);if(e>=1)return+n(t[r-1],r-1,t);var r,i=(r-1)*e,o=Math.floor(i),a=+n(t[o],o,t);return a+(+n(t[o+1],o+1,t)-a)*(i-o)}}!function(t){qh=function(t){var e=t.dateTime,n=t.date,r=t.time,i=t.periods,o=t.days,a=t.shortDays,s=t.months,u=t.shortMonths,l=Kh(i),c=Qh(i),f=Kh(o),h=Qh(o),d=Kh(a),p=Qh(a),g=Kh(s),m=Qh(s),y=Kh(u),v=Qh(u),b={a:function(t){return a[t.getDay()]},A:function(t){return o[t.getDay()]},b:function(t){return u[t.getMonth()]},B:function(t){return s[t.getMonth()]},c:null,d:xd,e:xd,f:Ed,g:zd,G:Pd,H:_d,I:wd,j:Ad,L:Dd,m:Fd,M:Cd,p:function(t){return i[+(t.getHours()>=12)]},q:function(t){return 1+~~(t.getMonth()/3)},Q:sp,s:up,S:kd,u:Md,U:Sd,V:Td,w:Bd,W:Nd,x:null,X:null,y:Od,Y:Rd,Z:Ud,"%":ap},x={a:function(t){return a[t.getUTCDay()]},A:function(t){return o[t.getUTCDay()]},b:function(t){return u[t.getUTCMonth()]},B:function(t){return s[t.getUTCMonth()]},c:null,d:Ld,e:Ld,f:Hd,g:np,G:ip,H:jd,I:Id,j:qd,L:Wd,m:Xd,M:Yd,p:function(t){return i[+(t.getUTCHours()>=12)]},q:function(t){return 1+~~(t.getUTCMonth()/3)},Q:sp,s:up,S:Gd,u:Vd,U:Jd,V:Kd,w:Qd,W:tp,x:null,X:null,y:ep,Y:rp,Z:op,"%":ap},_={a:function(t,e,n){var r=d.exec(e.slice(n));return r?(t.w=p.get(r[0].toLowerCase()),n+r[0].length):-1},A:function(t,e,n){var r=f.exec(e.slice(n));return r?(t.w=h.get(r[0].toLowerCase()),n+r[0].length):-1},b:function(t,e,n){var r=y.exec(e.slice(n));return r?(t.m=v.get(r[0].toLowerCase()),n+r[0].length):-1},B:function(t,e,n){var r=g.exec(e.slice(n));return r?(t.m=m.get(r[0].toLowerCase()),n+r[0].length):-1},c:function(t,n,r){return D(t,e,n,r)},d:cd,e:cd,f:md,g:ad,G:od,H:hd,I:hd,j:fd,L:gd,m:ld,M:dd,p:function(t,e,n){var r=l.exec(e.slice(n));return r?(t.p=c.get(r[0].toLowerCase()),n+r[0].length):-1},q:ud,Q:vd,s:bd,S:pd,u:ed,U:nd,V:rd,w:td,W:id,x:function(t,e,r){return D(t,n,e,r)},X:function(t,e,n){return D(t,r,e,n)},y:ad,Y:od,Z:sd,"%":yd};function w(t,e){return function(n){var r,i,o,a=[],s=-1,u=0,l=t.length;for(n instanceof Date||(n=new Date(+n));++s<l;)37===t.charCodeAt(s)&&(a.push(t.slice(u,s)),null!=(i=Xh[r=t.charAt(++s)])?r=t.charAt(++s):i="e"===r?" ":"0",(o=e[r])&&(r=o(n,i)),a.push(r),u=s+1);return a.push(t.slice(u,s)),a.join("")}}function A(t,e){return function(n){var r,i,o=Ih(1900,void 0,1);if(D(o,t,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(e&&!("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?(i=(r=jh(Ih(o.y,0,1))).getUTCDay(),r=i>4||0===i?Eh.ceil(r):Eh(r),r=dh.offset(r,7*(o.V-1)),o.y=r.getUTCFullYear(),o.m=r.getUTCMonth(),o.d=r.getUTCDate()+(o.w+6)%7):(i=(r=Lh(Ih(o.y,0,1))).getDay(),r=i>4||0===i?yh.ceil(r):yh(r),r=hh.offset(r,7*(o.V-1)),o.y=r.getFullYear(),o.m=r.getMonth(),o.d=r.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),i="Z"in o?jh(Ih(o.y,0,1)).getUTCDay():Lh(Ih(o.y,0,1)).getDay(),o.m=0,o.d="W"in o?(o.w+6)%7+7*o.W-(i+5)%7:o.w+7*o.U-(i+6)%7);return"Z"in o?(o.H+=o.Z/100|0,o.M+=o.Z%100,jh(o)):Lh(o)}}function D(t,e,n,r){for(var i,o,a=0,s=e.length,u=n.length;a<s;){if(r>=u)return-1;if(37===(i=e.charCodeAt(a++))){if(i=e.charAt(a++),!(o=_[i in Xh?e.charAt(a++):i])||(r=o(t,n,r))<0)return-1}else if(i!=n.charCodeAt(r++))return-1}return r}return b.x=w(n,b),b.X=w(r,b),b.c=w(e,b),x.x=w(n,x),x.X=w(r,x),x.c=w(e,x),{format:function(t){var e=w(t+="",b);return e.toString=function(){return t},e},parse:function(t){var e=A(t+="",!1);return e.toString=function(){return t},e},utcFormat:function(t){var e=w(t+="",x);return e.toString=function(){return t},e},utcParse:function(t){var e=A(t+="",!0);return e.toString=function(){return t},e}}}(t),Wh=qh.format,qh.parse,Hh=qh.utcFormat,qh.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"]});class xp extends Map{constructor(t,e=Ep){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:e}}),null!=t)for(const[n,r]of t)this.set(n,r)}get(t){return super.get(wp(this,t))}has(t){return super.has(wp(this,t))}set(t,e){return super.set(Ap(this,t),e)}delete(t){return super.delete(Dp(this,t))}}class _p extends Set{constructor(t,e=Ep){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:e}}),null!=t)for(const n of t)this.add(n)}has(t){return super.has(wp(this,t))}add(t){return super.add(Ap(this,t))}delete(t){return super.delete(Dp(this,t))}}function wp({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):n}function Ap({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):(t.set(r,n),n)}function Dp({_intern:t,_key:e},n){const r=e(n);return t.has(r)&&(n=t.get(r),t.delete(r)),n}function Ep(t){return null!==t&&"object"===typeof t?t.valueOf():t}const Fp=Symbol("implicit");function Cp(){var t=new xp,e=[],n=[],r=Fp;function i(i){let o=t.get(i);if(void 0===o){if(r!==Fp)return r;t.set(i,o=e.push(i)-1)}return n[o%n.length]}return i.domain=function(n){if(!arguments.length)return e.slice();e=[],t=new xp;for(const r of n)t.has(r)||t.set(r,e.push(r)-1);return i},i.range=function(t){return arguments.length?(n=Array.from(t),i):n.slice()},i.unknown=function(t){return arguments.length?(r=t,i):r},i.copy=function(){return Cp(e,n).unknown(r)},Sf.apply(i,arguments),i}var kp=n(77256),Mp=n(5963);function Sp(t){var e=t.length;return function(n){return t[Math.max(0,Math.min(e-1,Math.floor(n*e)))]}}var $p=n(38337);function Tp(t,e){var n=(0,$p.wx)(+t,+e);return function(t){var e=n(t);return e-360*Math.floor(e/360)}}var Bp=n(64826),Np=1e-12;function Op(t){return((t=Math.exp(t))+1/t)/2}const zp=function t(e,n,r){function i(t,i){var o,a,s=t[0],u=t[1],l=t[2],c=i[0],f=i[1],h=i[2],d=c-s,p=f-u,g=d*d+p*p;if(g<Np)a=Math.log(h/l)/e,o=function(t){return[s+t*d,u+t*p,l*Math.exp(e*t*a)]};else{var m=Math.sqrt(g),y=(h*h-l*l+r*g)/(2*l*n*m),v=(h*h-l*l-r*g)/(2*h*n*m),b=Math.log(Math.sqrt(y*y+1)-y),x=Math.log(Math.sqrt(v*v+1)-v);a=(x-b)/e,o=function(t){var r=t*a,i=Op(b),o=l/(n*m)*(i*function(t){return((t=Math.exp(2*t))-1)/(t+1)}(e*r+b)-function(t){return((t=Math.exp(t))-1/t)/2}(b));return[s+o*d,u+o*p,l*i/Op(e*r+b)]}}return o.duration=1e3*a*e/Math.SQRT2,o}return i.rho=function(e){var n=Math.max(.001,+e),r=n*n;return t(n,r,r*r)},i}(Math.SQRT2,2,4);function Rp(t){return function(e,n){var r=t((e=(0,uf.Ym)(e)).h,(n=(0,uf.Ym)(n)).h),i=(0,$p.ZP)(e.s,n.s),o=(0,$p.ZP)(e.l,n.l),a=(0,$p.ZP)(e.opacity,n.opacity);return function(t){return e.h=r(t),e.s=i(t),e.l=o(t),e.opacity=a(t),e+""}}}const Pp=Rp($p.wx);var Up=Rp($p.ZP),Lp=n(28608);const jp=Math.PI/180,Ip=180/Math.PI,qp=.96422,Wp=1,Hp=.82521,Xp=4/29,Yp=6/29,Gp=3*Yp*Yp,Vp=Yp*Yp*Yp;function Jp(t){if(t instanceof Kp)return new Kp(t.l,t.a,t.b,t.opacity);if(t instanceof og)return ag(t);t instanceof uf.Ss||(t=(0,uf.SU)(t));var e,n,r=ng(t.r),i=ng(t.g),o=ng(t.b),a=Qp((.2225045*r+.7168786*i+.0606169*o)/Wp);return r===i&&i===o?e=n=a:(e=Qp((.4360747*r+.3850649*i+.1430804*o)/qp),n=Qp((.0139322*r+.0971045*i+.7141733*o)/Hp)),new Kp(116*a-16,500*(e-a),200*(a-n),t.opacity)}function Zp(t,e,n,r){return 1===arguments.length?Jp(t):new Kp(t,e,n,null==r?1:r)}function Kp(t,e,n,r){this.l=+t,this.a=+e,this.b=+n,this.opacity=+r}function Qp(t){return t>Vp?Math.pow(t,1/3):t/Gp+Xp}function tg(t){return t>Yp?t*t*t:Gp*(t-Xp)}function eg(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function ng(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function rg(t){if(t instanceof og)return new og(t.h,t.c,t.l,t.opacity);if(t instanceof Kp||(t=Jp(t)),0===t.a&&0===t.b)return new og(NaN,0<t.l&&t.l<100?0:NaN,t.l,t.opacity);var e=Math.atan2(t.b,t.a)*Ip;return new og(e<0?e+360:e,Math.sqrt(t.a*t.a+t.b*t.b),t.l,t.opacity)}function ig(t,e,n,r){return 1===arguments.length?rg(t):new og(t,e,n,null==r?1:r)}function og(t,e,n,r){this.h=+t,this.c=+e,this.l=+n,this.opacity=+r}function ag(t){if(isNaN(t.h))return new Kp(t.l,0,0,t.opacity);var e=t.h*jp;return new Kp(t.l,Math.cos(e)*t.c,Math.sin(e)*t.c,t.opacity)}function sg(t,e){var n=(0,$p.ZP)((t=Zp(t)).l,(e=Zp(e)).l),r=(0,$p.ZP)(t.a,e.a),i=(0,$p.ZP)(t.b,e.b),o=(0,$p.ZP)(t.opacity,e.opacity);return function(e){return t.l=n(e),t.a=r(e),t.b=i(e),t.opacity=o(e),t+""}}function ug(t){return function(e,n){var r=t((e=ig(e)).h,(n=ig(n)).h),i=(0,$p.ZP)(e.c,n.c),o=(0,$p.ZP)(e.l,n.l),a=(0,$p.ZP)(e.opacity,n.opacity);return function(t){return e.h=r(t),e.c=i(t),e.l=o(t),e.opacity=a(t),e+""}}}(0,Lp.Z)(Kp,Zp,(0,Lp.l)(uf.Il,{brighter(t){return new Kp(this.l+18*(null==t?1:t),this.a,this.b,this.opacity)},darker(t){return new Kp(this.l-18*(null==t?1:t),this.a,this.b,this.opacity)},rgb(){var t=(this.l+16)/116,e=isNaN(this.a)?t:t+this.a/500,n=isNaN(this.b)?t:t-this.b/200;return e=qp*tg(e),t=Wp*tg(t),n=Hp*tg(n),new uf.Ss(eg(3.1338561*e-1.6168667*t-.4906146*n),eg(-.9787684*e+1.9161415*t+.033454*n),eg(.0719453*e-.2289914*t+1.4052427*n),this.opacity)}})),(0,Lp.Z)(og,ig,(0,Lp.l)(uf.Il,{brighter(t){return new og(this.h,this.c,this.l+18*(null==t?1:t),this.opacity)},darker(t){return new og(this.h,this.c,this.l-18*(null==t?1:t),this.opacity)},rgb(){return ag(this).rgb()}}));const lg=ug($p.wx);var cg=ug($p.ZP),fg=-.14861,hg=1.78277,dg=-.29227,pg=-.90649,gg=1.97294,mg=gg*pg,yg=gg*hg,vg=hg*dg-pg*fg;function bg(t,e,n,r){return 1===arguments.length?function(t){if(t instanceof xg)return new xg(t.h,t.s,t.l,t.opacity);t instanceof uf.Ss||(t=(0,uf.SU)(t));var e=t.r/255,n=t.g/255,r=t.b/255,i=(vg*r+mg*e-yg*n)/(vg+mg-yg),o=r-i,a=(gg*(n-i)-dg*o)/pg,s=Math.sqrt(a*a+o*o)/(gg*i*(1-i)),u=s?Math.atan2(a,o)*Ip-120:NaN;return new xg(u<0?u+360:u,s,i,t.opacity)}(t):new xg(t,e,n,null==r?1:r)}function xg(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function _g(t){return function e(n){function r(e,r){var i=t((e=bg(e)).h,(r=bg(r)).h),o=(0,$p.ZP)(e.s,r.s),a=(0,$p.ZP)(e.l,r.l),s=(0,$p.ZP)(e.opacity,r.opacity);return function(t){return e.h=i(t),e.s=o(t),e.l=a(Math.pow(t,n)),e.opacity=s(t),e+""}}return n=+n,r.gamma=e,r}(1)}(0,Lp.Z)(xg,bg,(0,Lp.l)(uf.Il,{brighter(t){return t=null==t?uf.J5:Math.pow(uf.J5,t),new xg(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?uf.xV:Math.pow(uf.xV,t),new xg(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=isNaN(this.h)?0:(this.h+120)*jp,e=+this.l,n=isNaN(this.s)?0:this.s*e*(1-e),r=Math.cos(t),i=Math.sin(t);return new uf.Ss(255*(e+n*(fg*r+hg*i)),255*(e+n*(dg*r+pg*i)),255*(e+n*(gg*r)),this.opacity)}}));const wg=_g($p.wx);var Ag=_g($p.ZP);function Dg(t,e){for(var n=new Array(e),r=0;r<e;++r)n[r]=t(r/(e-1));return n}function Eg(t,e,n){const r=t-e+2*n;return t?r>0?r:1:0}const Fg="linear",Cg="log",kg="pow",Mg="sqrt",Sg="symlog",$g="time",Tg="utc",Bg="sequential",Ng="diverging",Og="quantile",zg="quantize",Rg="threshold",Pg="ordinal",Ug="point",Lg="band",jg="bin-ordinal",Ig="continuous",qg="discrete",Wg="discretizing",Hg="interpolating",Xg="temporal";function Yg(){const t=Cp().unknown(void 0),e=t.domain,n=t.range;let r,i,o=[0,1],a=!1,s=0,u=0,l=.5;function c(){const t=e().length,c=o[1]<o[0],f=o[1-c],h=Eg(t,s,u);let d=o[c-0];r=(f-d)/(h||1),a&&(r=Math.floor(r)),d+=(f-d-r*(t-s))*l,i=r*(1-s),a&&(d=Math.round(d),i=Math.round(i));const p=Zs(t).map((t=>d+r*t));return n(c?p.reverse():p)}return delete t.unknown,t.domain=function(t){return arguments.length?(e(t),c()):e()},t.range=function(t){return arguments.length?(o=[+t[0],+t[1]],c()):o.slice()},t.rangeRound=function(t){return o=[+t[0],+t[1]],a=!0,c()},t.bandwidth=function(){return i},t.step=function(){return r},t.round=function(t){return arguments.length?(a=!!t,c()):a},t.padding=function(t){return arguments.length?(u=Math.max(0,Math.min(1,t)),s=u,c()):s},t.paddingInner=function(t){return arguments.length?(s=Math.max(0,Math.min(1,t)),c()):s},t.paddingOuter=function(t){return arguments.length?(u=Math.max(0,Math.min(1,t)),c()):u},t.align=function(t){return arguments.length?(l=Math.max(0,Math.min(1,t)),c()):l},t.invertRange=function(t){if(null==t[0]||null==t[1])return;const r=o[1]<o[0],a=r?n().reverse():n(),s=a.length-1;let u,l,c,f=+t[0],h=+t[1];return f!==f||h!==h||(h<f&&(c=f,f=h,h=c),h<a[0]||f>o[1-r])?void 0:(u=Math.max(0,qc(a,f)-1),l=f===h?u:qc(a,h)-1,f-a[u]>i+1e-10&&++u,r&&(c=u,u=s-l,l=s-c),u>l?void 0:e().slice(u,l+1))},t.invert=function(e){const n=t.invertRange([e,e]);return n?n[0]:n},t.copy=function(){return Yg().domain(e()).range(o).round(a).paddingInner(s).paddingOuter(u).align(l)},c()}function Gg(t){const e=t.copy;return t.padding=t.paddingOuter,delete t.paddingInner,t.copy=function(){return Gg(e())},t}var Vg=Array.prototype.map;const Jg=Array.prototype.slice;const Zg=new Map,Kg=Symbol("vega_scale");function Qg(t){return t[Kg]=!0,t}function tm(t){return t&&!0===t[Kg]}function em(t,e,n){return arguments.length>1?(Zg.set(t,function(t,e,n){const r=function(){const n=e();return n.invertRange||(n.invertRange=n.invert?function(t){return function(e){let n,r=e[0],i=e[1];return i<r&&(n=r,r=i,i=n),[t.invert(r),t.invert(i)]}}(n):n.invertExtent?function(t){return function(e){const n=t.range();let r,i,o,a,s=e[0],u=e[1],l=-1;for(u<s&&(i=s,s=u,u=i),o=0,a=n.length;o<a;++o)n[o]>=s&&n[o]<=u&&(l<0&&(l=o),r=o);if(!(l<0))return s=t.invertExtent(n[l]),u=t.invertExtent(n[r]),[void 0===s[0]?s[1]:s[0],void 0===u[1]?u[0]:u[1]]}}(n):void 0),n.type=t,Qg(n)};return r.metadata=(0,Kt.Rg)((0,Kt.IX)(n)),r}(t,e,n)),this):nm(t)?Zg.get(t):void 0}function nm(t){return Zg.has(t)}function rm(t,e){const n=Zg.get(t);return n&&n.metadata[e]}function im(t){return rm(t,Ig)}function om(t){return rm(t,qg)}function am(t){return rm(t,Wg)}function sm(t){return rm(t,Cg)}function um(t){return rm(t,Hg)}function lm(t){return rm(t,Og)}em("identity",(function t(e){var n;function r(t){return null==t||isNaN(t=+t)?n:t}return r.invert=r,r.domain=r.range=function(t){return arguments.length?(e=Array.from(t,_f),r):e.slice()},r.unknown=function(t){return arguments.length?(n=t,r):n},r.copy=function(){return t(e).unknown(n)},e=arguments.length?Array.from(e,_f):[0,1],Bf(r)})),em(Fg,(function t(){var e=Mf();return e.copy=function(){return Cf(e,t())},Sf.apply(e,arguments),Bf(e)}),Ig),em(Cg,(function t(){const e=jf(kf()).domain([1,10]);return e.copy=()=>Cf(e,t()).base(e.base()),Sf.apply(e,arguments),e}),[Ig,Cg]),em(kg,Xf,Ig),em(Mg,(function(){return Xf.apply(null,arguments).exponent(.5)}),Ig),em(Sg,(function t(){var e=Vf(kf());return e.copy=function(){return Cf(e,t()).constant(e.constant())},Sf.apply(e,arguments)}),Ig),em($g,(function(){return Sf.apply(fp(Ph,Uh,Bh,$h,mh,hh,ch,uh,sh,Wh).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}),[Ig,Xg]),em(Tg,(function(){return Sf.apply(fp(zh,Rh,Nh,Th,Dh,dh,fh,lh,sh,Hh).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}),[Ig,Xg]),em(Bg,pp,[Ig,Hg]),em(`${Bg}-${Fg}`,pp,[Ig,Hg]),em(`${Bg}-${Cg}`,(function t(){var e=jf(hp()).domain([1,10]);return e.copy=function(){return dp(e,t()).base(e.base())},$f.apply(e,arguments)}),[Ig,Hg,Cg]),em(`${Bg}-${kg}`,gp,[Ig,Hg]),em(`${Bg}-${Mg}`,(function(){return gp.apply(null,arguments).exponent(.5)}),[Ig,Hg]),em(`${Bg}-${Sg}`,(function t(){var e=Vf(hp());return e.copy=function(){return dp(e,t()).constant(e.constant())},$f.apply(e,arguments)}),[Ig,Hg]),em(`${Ng}-${Fg}`,(function t(){var e=Bf(yp()(Af));return e.copy=function(){return dp(e,t())},$f.apply(e,arguments)}),[Ig,Hg]),em(`${Ng}-${Cg}`,(function t(){var e=jf(yp()).domain([.1,1,10]);return e.copy=function(){return dp(e,t()).base(e.base())},$f.apply(e,arguments)}),[Ig,Hg,Cg]),em(`${Ng}-${kg}`,vp,[Ig,Hg]),em(`${Ng}-${Mg}`,(function(){return vp.apply(null,arguments).exponent(.5)}),[Ig,Hg]),em(`${Ng}-${Sg}`,(function t(){var e=Vf(yp());return e.copy=function(){return dp(e,t()).constant(e.constant())},$f.apply(e,arguments)}),[Ig,Hg]),em(Og,(function t(){var e,n=[],r=[],i=[];function o(){var t=0,e=Math.max(1,r.length);for(i=new Array(e-1);++t<e;)i[t-1]=bp(n,t/e);return a}function a(t){return null==t||isNaN(t=+t)?e:r[sf(i,t)]}return a.invertExtent=function(t){var e=r.indexOf(t);return e<0?[NaN,NaN]:[e>0?i[e-1]:n[0],e<i.length?i[e]:n[n.length-1]]},a.domain=function(t){if(!arguments.length)return n.slice();n=[];for(let e of t)null==e||isNaN(e=+e)||n.push(e);return n.sort(Qc),o()},a.range=function(t){return arguments.length?(r=Array.from(t),o()):r.slice()},a.unknown=function(t){return arguments.length?(e=t,a):e},a.quantiles=function(){return i.slice()},a.copy=function(){return t().domain(n).range(r).unknown(e)},Sf.apply(a,arguments)}),[Wg,Og]),em(zg,(function t(){var e,n=0,r=1,i=1,o=[.5],a=[0,1];function s(t){return null!=t&&t<=t?a[sf(o,t,0,i)]:e}function u(){var t=-1;for(o=new Array(i);++t<i;)o[t]=((t+1)*r-(t-i)*n)/(i+1);return s}return s.domain=function(t){return arguments.length?([n,r]=t,n=+n,r=+r,u()):[n,r]},s.range=function(t){return arguments.length?(i=(a=Array.from(t)).length-1,u()):a.slice()},s.invertExtent=function(t){var e=a.indexOf(t);return e<0?[NaN,NaN]:e<1?[n,o[0]]:e>=i?[o[i-1],r]:[o[e-1],o[e]]},s.unknown=function(t){return arguments.length?(e=t,s):s},s.thresholds=function(){return o.slice()},s.copy=function(){return t().domain([n,r]).range(a).unknown(e)},Sf.apply(Bf(s),arguments)}),Wg),em(Rg,(function t(){var e,n=[.5],r=[0,1],i=1;function o(t){return null!=t&&t<=t?r[sf(n,t,0,i)]:e}return o.domain=function(t){return arguments.length?(n=Array.from(t),i=Math.min(n.length,r.length-1),o):n.slice()},o.range=function(t){return arguments.length?(r=Array.from(t),i=Math.min(n.length,r.length-1),o):r.slice()},o.invertExtent=function(t){var e=r.indexOf(t);return[n[e-1],n[e]]},o.unknown=function(t){return arguments.length?(e=t,o):e},o.copy=function(){return t().domain(n).range(r).unknown(e)},Sf.apply(o,arguments)}),Wg),em(jg,(function t(){let e=[],n=[];function r(t){return null==t||t!==t?void 0:n[(Hc(e,t)-1)%n.length]}return r.domain=function(t){return arguments.length?(e=function(t){return Vg.call(t,Kt.He)}(t),r):e.slice()},r.range=function(t){return arguments.length?(n=Jg.call(t),r):n.slice()},r.tickFormat=function(t,n){return Tf(e[0],(0,Kt.fj)(e),null==t?10:t,n)},r.copy=function(){return t().domain(r.domain()).range(r.range())},r}),[qg,Wg]),em(Pg,Cp,qg),em(Lg,Yg,qg),em(Ug,(function(){return Gg(Yg().paddingInner(1))}),qg);const cm=["clamp","base","constant","exponent"];function fm(t,e){const n=e[0],r=(0,Kt.fj)(e)-n;return function(e){return t(n+e*r)}}function hm(t,e,n){return mp(gm(e||"rgb",n),t)}function dm(t,e){const n=new Array(e),r=e+1;for(let i=0;i<e;)n[i]=t(++i/r);return n}function pm(t,e,n){const r=n-e;let i,o,a;return r&&Number.isFinite(r)?(i=(o=t.type).indexOf("-"),o=i<0?o:o.slice(i+1),a=em(o)().domain([e,n]).range([0,1]),cm.forEach((e=>t[e]?a[e](t[e]()):0)),a):(0,Kt.a9)(.5)}function gm(t,e){const n=i[function(t){return"interpolate"+t.toLowerCase().split("-").map((t=>t[0].toUpperCase()+t.slice(1))).join("")}(t)];return null!=e&&n&&n.gamma?n.gamma(e):n}function mm(t){const e=t.length/6|0,n=new Array(e);for(let r=0;r<e;)n[r]="#"+t.slice(6*r,6*++r);return n}function ym(t,e){for(const n in t)bm(n,e(t[n]))}const vm={};function bm(t,e){return t=t&&t.toLowerCase(),arguments.length>1?(vm[t]=e,this):vm[t]}ym({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"},mm),ym({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"},(t=>hm(mm(t))));const xm="symbol",_m="discrete",wm=t=>(0,Kt.kJ)(t)?t.map((t=>String(t))):String(t),Am=(t,e)=>t[1]-e[1],Dm=(t,e)=>e[1]-t[1];function Em(t,e,n){let r;return(0,Kt.hj)(e)&&(t.bins&&(e=Math.max(e,t.bins.length)),null!=n&&(e=Math.min(e,Math.floor((0,Kt.yP)(t.domain())/n||1)))),(0,Kt.Kn)(e)&&(r=e.step,e=e.interval),(0,Kt.HD)(e)&&(e=t.type===$g?pr(e):t.type==Tg?gr(e):(0,Kt.vU)("Only time and utc scales accept interval strings."),r&&(e=e.every(r))),e}function Fm(t,e,n){let r=t.range(),i=r[0],o=(0,Kt.fj)(r),a=Am;if(i>o&&(r=o,o=i,i=r,a=Dm),i=Math.floor(i),o=Math.ceil(o),e=e.map((e=>[e,t(e)])).filter((t=>i<=t[1]&&t[1]<=o)).sort(a).map((t=>t[0])),n>0&&e.length>1){const t=[e[0],(0,Kt.fj)(e)];for(;e.length>n&&e.length>=3;)e=e.filter(((t,e)=>!(e%2)));e.length<3&&(e=t)}return e}function Cm(t,e){return t.bins?Fm(t,t.bins):t.ticks?t.ticks(e):t.domain()}function km(t,e,n,r,i,o){const a=e.type;let s=wm;if(a===$g||i===$g)s=t.timeFormat(r);else if(a===Tg||i===Tg)s=t.utcFormat(r);else if(sm(a)){const i=t.formatFloat(r);if(o||e.bins)s=i;else{const t=Mm(e,n,!1);s=e=>t(e)?i(e):""}}else if(e.tickFormat){const i=e.domain();s=t.formatSpan(i[0],i[i.length-1],n,r)}else r&&(s=t.format(r));return s}function Mm(t,e,n){const r=Cm(t,e),i=t.base(),o=Math.log(i),a=Math.max(1,i*e/r.length),s=t=>{let e=t/Math.pow(i,Math.round(Math.log(t)/o));return e*i<i-.5&&(e*=i),e<=a};return n?r.filter(s):s}const Sm={[Og]:"quantiles",[zg]:"thresholds",[Rg]:"domain"},$m={[Og]:"quantiles",[zg]:"domain"};function Tm(t,e){return t.bins?function(t){const e=t.slice(0,-1);return e.max=(0,Kt.fj)(t),e}(t.bins):t.type===Cg?Mm(t,e,!0):Sm[t.type]?function(t){const e=[-1/0].concat(t);return e.max=1/0,e}(t[Sm[t.type]]()):Cm(t,e)}const Bm=t=>Sm[t.type]||t.bins;function Nm(t,e,n,r,i,o,a){const s=$m[e.type]&&o!==$g&&o!==Tg?function(t,e,n){const r=e[$m[e.type]](),i=r.length;let o,a=i>1?r[1]-r[0]:r[0];for(o=1;o<i;++o)a=Math.min(a,r[o]-r[o-1]);return t.formatSpan(0,a,30,n)}(t,e,i):km(t,e,n,i,o,a);return r===xm&&Bm(e)?Om(s):r===_m?Rm(s):Pm(s)}const Om=t=>(e,n,r)=>{const i=zm(r[n+1],zm(r.max,1/0)),o=Um(e,t),a=Um(i,t);return o&&a?o+" \u2013 "+a:a?"< "+a:"\u2265 "+o},zm=(t,e)=>null!=t?t:e,Rm=t=>(e,n)=>n?t(e):null,Pm=t=>e=>t(e),Um=(t,e)=>Number.isFinite(t)?e(t):null;function Lm(t,e,n,r){const i=r||e.type;return(0,Kt.HD)(n)&&function(t){return rm(t,Xg)}(i)&&(n=n.replace(/%a/g,"%A").replace(/%b/g,"%B")),n||i!==$g?n||i!==Tg?Nm(t,e,5,null,n,r,!0):t.utcFormat("%A, %d %B %Y, %X UTC"):t.timeFormat("%A, %d %B %Y, %X")}function jm(t,e,n){n=n||{};const r=Math.max(3,n.maxlen||7),i=Lm(t,e,n.format,n.formatType);if(am(e.type)){const t=Tm(e).slice(1).map(i),n=t.length;return`${n} boundar${1===n?"y":"ies"}: ${t.join(", ")}`}if(om(e.type)){const t=e.domain(),n=t.length;return`${n} value${1===n?"":"s"}: ${n>r?t.slice(0,r-2).map(i).join(", ")+", ending with "+t.slice(-1).map(i):t.map(i).join(", ")}`}{const t=e.domain();return`values from ${i(t[0])} to ${i((0,Kt.fj)(t))}`}}let Im=0;const qm="p_";function Wm(t){return t&&t.gradient}function Hm(t,e,n){const r=t.gradient;let i=t.id,o="radial"===r?qm:"";return i||(i=t.id="gradient_"+Im++,"radial"===r?(t.x1=Xm(t.x1,.5),t.y1=Xm(t.y1,.5),t.r1=Xm(t.r1,0),t.x2=Xm(t.x2,.5),t.y2=Xm(t.y2,.5),t.r2=Xm(t.r2,.5),o=qm):(t.x1=Xm(t.x1,0),t.y1=Xm(t.y1,0),t.x2=Xm(t.x2,1),t.y2=Xm(t.y2,0))),e[i]=t,"url("+(n||"")+"#"+o+i+")"}function Xm(t,e){return null!=t?t:e}function Ym(t,e){var n,r=[];return n={gradient:"linear",x1:t?t[0]:0,y1:t?t[1]:0,x2:e?e[0]:1,y2:e?e[1]:0,stops:r,stop:function(t,e){return r.push({offset:t,color:e}),n}}}const Gm={basis:{curve:function(t){return new Cl(t)}},"basis-closed":{curve:function(t){return new Ml(t)}},"basis-open":{curve:function(t){return new Sl(t)}},bundle:{curve:Tl,tension:"beta",value:.85},cardinal:{curve:Ol,tension:"tension",value:0},"cardinal-open":{curve:Rl,tension:"tension",value:0},"cardinal-closed":{curve:Ul,tension:"tension",value:0},"catmull-rom":{curve:tc,tension:"alpha",value:.5},"catmull-rom-closed":{curve:nc,tension:"alpha",value:.5},"catmull-rom-open":{curve:ic,tension:"alpha",value:.5},linear:{curve:ac},"linear-closed":{curve:function(t){return new sc(t)}},monotone:{horizontal:function(t){return new dc(t)},vertical:function(t){return new hc(t)}},natural:{curve:function(t){return new gc(t)}},step:{curve:function(t){return new yc(t,.5)}},"step-after":{curve:function(t){return new yc(t,1)}},"step-before":{curve:function(t){return new yc(t,0)}}};function Vm(t,e,n){var r=(0,Kt.nr)(Gm,t)&&Gm[t],i=null;return r&&(i=r.curve||r[e||"vertical"],r.tension&&null!=n&&(i=i[r.tension](n))),i}const Jm={m:2,l:2,h:1,v:1,z:0,c:6,s:4,q:4,t:2,a:7},Zm=/[mlhvzcsqta]([^mlhvzcsqta]+|$)/gi,Km=/^[+-]?(([0-9]*\.[0-9]+)|([0-9]+\.)|([0-9]+))([eE][+-]?[0-9]+)?/,Qm=/^((\s+,?\s*)|(,\s*))/,ty=/^[01]/;function ey(t){const e=[];return(t.match(Zm)||[]).forEach((t=>{let n=t[0];const r=n.toLowerCase(),i=Jm[r],o=function(t,e,n){const r=[];for(let i=0;e&&i<n.length;)for(let o=0;o<e;++o){const e="a"!==t||3!==o&&4!==o?Km:ty,a=n.slice(i).match(e);if(null===a)throw Error("Invalid SVG path, incorrect parameter type");i+=a[0].length,r.push(+a[0]);const s=n.slice(i).match(Qm);null!==s&&(i+=s[0].length)}return r}(r,i,t.slice(1).trim()),a=o.length;if(a<i||a&&a%i!==0)throw Error("Invalid SVG path, incorrect parameter count");if(e.push([n,...o.slice(0,i)]),a!==i){"m"===r&&(n="M"===n?"L":"l");for(let t=i;t<a;t+=i)e.push([n,...o.slice(t,t+i)])}})),e}const ny=Math.PI/180,ry=1e-14,iy=Math.PI/2,oy=2*Math.PI,ay=Math.sqrt(3)/2;var sy={},uy={},ly=[].join;function cy(t){const e=ly.call(t);if(uy[e])return uy[e];var n=t[0],r=t[1],i=t[2],o=t[3],a=t[4],s=t[5],u=t[6],l=t[7];const c=l*a,f=-u*s,h=u*a,d=l*s,p=Math.cos(i),g=Math.sin(i),m=Math.cos(o),y=Math.sin(o),v=.5*(o-i),b=Math.sin(.5*v),x=8/3*b*b/Math.sin(v),_=n+p-x*g,w=r+g+x*p,A=n+m,D=r+y,E=A+x*y,F=D-x*m;return uy[e]=[c*_+f*w,h*_+d*w,c*E+f*F,h*E+d*F,c*A+f*D,h*A+d*D]}const fy=["l",0,0,0,0,0,0,0];function hy(t,e,n){const r=fy[0]=t[0];if("a"===r||"A"===r)fy[1]=e*t[1],fy[2]=n*t[2],fy[3]=t[3],fy[4]=t[4],fy[5]=t[5],fy[6]=e*t[6],fy[7]=n*t[7];else if("h"===r||"H"===r)fy[1]=e*t[1];else if("v"===r||"V"===r)fy[1]=n*t[1];else for(var i=1,o=t.length;i<o;++i)fy[i]=(i%2==1?e:n)*t[i];return fy}function dy(t,e,n,r,i,o){var a,s,u,l,c,f=null,h=0,d=0,p=0,g=0,m=0,y=0;null==n&&(n=0),null==r&&(r=0),null==i&&(i=1),null==o&&(o=i),t.beginPath&&t.beginPath();for(var v=0,b=e.length;v<b;++v){switch(a=e[v],1===i&&1===o||(a=hy(a,i,o)),a[0]){case"l":h+=a[1],d+=a[2],t.lineTo(h+n,d+r);break;case"L":h=a[1],d=a[2],t.lineTo(h+n,d+r);break;case"h":h+=a[1],t.lineTo(h+n,d+r);break;case"H":h=a[1],t.lineTo(h+n,d+r);break;case"v":d+=a[1],t.lineTo(h+n,d+r);break;case"V":d=a[1],t.lineTo(h+n,d+r);break;case"m":m=h+=a[1],y=d+=a[2],t.moveTo(h+n,d+r);break;case"M":m=h=a[1],y=d=a[2],t.moveTo(h+n,d+r);break;case"c":s=h+a[5],u=d+a[6],p=h+a[3],g=d+a[4],t.bezierCurveTo(h+a[1]+n,d+a[2]+r,p+n,g+r,s+n,u+r),h=s,d=u;break;case"C":h=a[5],d=a[6],p=a[3],g=a[4],t.bezierCurveTo(a[1]+n,a[2]+r,p+n,g+r,h+n,d+r);break;case"s":s=h+a[3],u=d+a[4],p=2*h-p,g=2*d-g,t.bezierCurveTo(p+n,g+r,h+a[1]+n,d+a[2]+r,s+n,u+r),p=h+a[1],g=d+a[2],h=s,d=u;break;case"S":s=a[3],u=a[4],p=2*h-p,g=2*d-g,t.bezierCurveTo(p+n,g+r,a[1]+n,a[2]+r,s+n,u+r),h=s,d=u,p=a[1],g=a[2];break;case"q":s=h+a[3],u=d+a[4],p=h+a[1],g=d+a[2],t.quadraticCurveTo(p+n,g+r,s+n,u+r),h=s,d=u;break;case"Q":s=a[3],u=a[4],t.quadraticCurveTo(a[1]+n,a[2]+r,s+n,u+r),h=s,d=u,p=a[1],g=a[2];break;case"t":s=h+a[1],u=d+a[2],null===f[0].match(/[QqTt]/)?(p=h,g=d):"t"===f[0]?(p=2*h-l,g=2*d-c):"q"===f[0]&&(p=2*h-p,g=2*d-g),l=p,c=g,t.quadraticCurveTo(p+n,g+r,s+n,u+r),d=u,p=(h=s)+a[1],g=d+a[2];break;case"T":s=a[1],u=a[2],p=2*h-p,g=2*d-g,t.quadraticCurveTo(p+n,g+r,s+n,u+r),h=s,d=u;break;case"a":py(t,h+n,d+r,[a[1],a[2],a[3],a[4],a[5],a[6]+h+n,a[7]+d+r]),h+=a[6],d+=a[7];break;case"A":py(t,h+n,d+r,[a[1],a[2],a[3],a[4],a[5],a[6]+n,a[7]+r]),h=a[6],d=a[7];break;case"z":case"Z":h=m,d=y,t.closePath()}f=a}}function py(t,e,n,r){const i=function(t,e,n,r,i,o,a,s,u){const l=ly.call(arguments);if(sy[l])return sy[l];const c=a*ny,f=Math.sin(c),h=Math.cos(c),d=h*(s-t)*.5+f*(u-e)*.5,p=h*(u-e)*.5-f*(s-t)*.5;let g=d*d/((n=Math.abs(n))*n)+p*p/((r=Math.abs(r))*r);g>1&&(g=Math.sqrt(g),n*=g,r*=g);const m=h/n,y=f/n,v=-f/r,b=h/r,x=m*s+y*u,_=v*s+b*u,w=m*t+y*e,A=v*t+b*e;let D=1/((w-x)*(w-x)+(A-_)*(A-_))-.25;D<0&&(D=0);let E=Math.sqrt(D);o==i&&(E=-E);const F=.5*(x+w)-E*(A-_),C=.5*(_+A)+E*(w-x),k=Math.atan2(_-C,x-F);let M=Math.atan2(A-C,w-F)-k;M<0&&1===o?M+=oy:M>0&&0===o&&(M-=oy);const S=Math.ceil(Math.abs(M/(iy+.001))),$=[];for(let T=0;T<S;++T){const t=k+T*M/S,e=k+(T+1)*M/S;$[T]=[F,C,t,e,n,r,f,h]}return sy[l]=$}(r[5],r[6],r[0],r[1],r[3],r[4],r[2],e,n);for(let o=0;o<i.length;++o){const e=cy(i[o]);t.bezierCurveTo(e[0],e[1],e[2],e[3],e[4],e[5])}}const gy=.5773502691896257,my={circle:{draw:function(t,e){const n=Math.sqrt(e)/2;t.moveTo(n,0),t.arc(0,0,n,0,oy)}},cross:{draw:function(t,e){var n=Math.sqrt(e)/2,r=n/2.5;t.moveTo(-n,-r),t.lineTo(-n,r),t.lineTo(-r,r),t.lineTo(-r,n),t.lineTo(r,n),t.lineTo(r,r),t.lineTo(n,r),t.lineTo(n,-r),t.lineTo(r,-r),t.lineTo(r,-n),t.lineTo(-r,-n),t.lineTo(-r,-r),t.closePath()}},diamond:{draw:function(t,e){const n=Math.sqrt(e)/2;t.moveTo(-n,0),t.lineTo(0,-n),t.lineTo(n,0),t.lineTo(0,n),t.closePath()}},square:{draw:function(t,e){var n=Math.sqrt(e),r=-n/2;t.rect(r,r,n,n)}},arrow:{draw:function(t,e){var n=Math.sqrt(e)/2,r=n/7,i=n/2.5,o=n/8;t.moveTo(-r,n),t.lineTo(r,n),t.lineTo(r,-o),t.lineTo(i,-o),t.lineTo(0,-n),t.lineTo(-i,-o),t.lineTo(-r,-o),t.closePath()}},wedge:{draw:function(t,e){var n=Math.sqrt(e)/2,r=ay*n,i=r-n*gy,o=n/4;t.moveTo(0,-r-i),t.lineTo(-o,r-i),t.lineTo(o,r-i),t.closePath()}},triangle:{draw:function(t,e){var n=Math.sqrt(e)/2,r=ay*n,i=r-n*gy;t.moveTo(0,-r-i),t.lineTo(-n,r-i),t.lineTo(n,r-i),t.closePath()}},"triangle-up":{draw:function(t,e){var n=Math.sqrt(e)/2,r=ay*n;t.moveTo(0,-r),t.lineTo(-n,r),t.lineTo(n,r),t.closePath()}},"triangle-down":{draw:function(t,e){var n=Math.sqrt(e)/2,r=ay*n;t.moveTo(0,r),t.lineTo(-n,-r),t.lineTo(n,-r),t.closePath()}},"triangle-right":{draw:function(t,e){var n=Math.sqrt(e)/2,r=ay*n;t.moveTo(r,0),t.lineTo(-r,-n),t.lineTo(-r,n),t.closePath()}},"triangle-left":{draw:function(t,e){var n=Math.sqrt(e)/2,r=ay*n;t.moveTo(-r,0),t.lineTo(r,-n),t.lineTo(r,n),t.closePath()}},stroke:{draw:function(t,e){const n=Math.sqrt(e)/2;t.moveTo(-n,0),t.lineTo(n,0)}}};function yy(t){return(0,Kt.nr)(my,t)?my[t]:function(t){if(!(0,Kt.nr)(vy,t)){const e=ey(t);vy[t]={draw:function(t,n){dy(t,e,0,0,Math.sqrt(n)/2)}}}return vy[t]}(t)}var vy={};const by=.448084975506;function xy(t){return t.x}function _y(t){return t.y}function wy(t){return t.width}function Ay(t){return t.height}function Dy(t){return"function"===typeof t?t:()=>+t}function Ey(t,e,n){return Math.max(e,Math.min(t,n))}function Fy(){var t=xy,e=_y,n=wy,r=Ay,i=Dy(0),o=i,a=i,s=i,u=null;function l(l,c,f){var h,d=null!=c?c:+t.call(this,l),p=null!=f?f:+e.call(this,l),g=+n.call(this,l),m=+r.call(this,l),y=Math.min(g,m)/2,v=Ey(+i.call(this,l),0,y),b=Ey(+o.call(this,l),0,y),x=Ey(+a.call(this,l),0,y),_=Ey(+s.call(this,l),0,y);if(u||(u=h=Ec()),v<=0&&b<=0&&x<=0&&_<=0)u.rect(d,p,g,m);else{var w=d+g,A=p+m;u.moveTo(d+v,p),u.lineTo(w-b,p),u.bezierCurveTo(w-by*b,p,w,p+by*b,w,p+b),u.lineTo(w,A-_),u.bezierCurveTo(w,A-by*_,w-by*_,A,w-_,A),u.lineTo(d+x,A),u.bezierCurveTo(d+by*x,A,d,A-by*x,d,A-x),u.lineTo(d,p+v),u.bezierCurveTo(d,p+by*v,d+by*v,p,d+v,p),u.closePath()}if(h)return u=null,h+""||null}return l.x=function(e){return arguments.length?(t=Dy(e),l):t},l.y=function(t){return arguments.length?(e=Dy(t),l):e},l.width=function(t){return arguments.length?(n=Dy(t),l):n},l.height=function(t){return arguments.length?(r=Dy(t),l):r},l.cornerRadius=function(t,e,n,r){return arguments.length?(i=Dy(t),o=null!=e?Dy(e):i,s=null!=n?Dy(n):i,a=null!=r?Dy(r):o,l):i},l.context=function(t){return arguments.length?(u=null==t?null:t,l):u},l}function Cy(){var t,e,n,r,i,o,a,s,u=null;function l(t,e,n){const r=n/2;if(i){var l=a-e,c=t-o;if(l||c){var f=Math.sqrt(l*l+c*c),h=(l/=f)*s,d=(c/=f)*s,p=Math.atan2(c,l);u.moveTo(o-h,a-d),u.lineTo(t-l*r,e-c*r),u.arc(t,e,r,p-Math.PI,p),u.lineTo(o+h,a+d),u.arc(o,a,s,p,p+Math.PI)}else u.arc(t,e,r,0,oy);u.closePath()}else i=1;o=t,a=e,s=r}function c(o){var a,s,c,f=o.length,h=!1;for(null==u&&(u=c=Ec()),a=0;a<=f;++a)!(a<f&&r(s=o[a],a,o))===h&&(h=!h)&&(i=0),h&&l(+t(s,a,o),+e(s,a,o),+n(s,a,o));if(c)return u=null,c+""||null}return c.x=function(e){return arguments.length?(t=e,c):t},c.y=function(t){return arguments.length?(e=t,c):e},c.size=function(t){return arguments.length?(n=t,c):n},c.defined=function(t){return arguments.length?(r=t,c):r},c.context=function(t){return arguments.length?(u=null==t?null:t,c):u},c}function ky(t,e){return null!=t?t:e}const My=t=>t.x||0,Sy=t=>t.y||0,$y=t=>!(!1===t.defined),Ty=function(){var t=Cc,e=kc,n=vc(0),r=null,i=Mc,o=Sc,a=$c,s=null,u=Fc(l);function l(){var l,c,f=+t.apply(this,arguments),h=+e.apply(this,arguments),d=i.apply(this,arguments)-Vl,p=o.apply(this,arguments)-Vl,g=Ll(p-d),m=p>d;if(s||(s=l=u()),h<f&&(c=h,h=f,f=c),h>Yl)if(g>Jl-Yl)s.moveTo(h*Il(d),h*Hl(d)),s.arc(0,0,h,d,p,!m),f>Yl&&(s.moveTo(f*Il(p),f*Hl(p)),s.arc(0,0,f,p,d,m));else{var y,v,b=d,x=p,_=d,w=p,A=g,D=g,E=a.apply(this,arguments)/2,F=E>Yl&&(r?+r.apply(this,arguments):Xl(f*f+h*h)),C=Wl(Ll(h-f)/2,+n.apply(this,arguments)),k=C,M=C;if(F>Yl){var S=Zl(F/f*Hl(E)),$=Zl(F/h*Hl(E));(A-=2*S)>Yl?(_+=S*=m?1:-1,w-=S):(A=0,_=w=(d+p)/2),(D-=2*$)>Yl?(b+=$*=m?1:-1,x-=$):(D=0,b=x=(d+p)/2)}var T=h*Il(b),B=h*Hl(b),N=f*Il(w),O=f*Hl(w);if(C>Yl){var z,R=h*Il(x),P=h*Hl(x),U=f*Il(_),L=f*Hl(_);if(g<Gl)if(z=function(t,e,n,r,i,o,a,s){var u=n-t,l=r-e,c=a-i,f=s-o,h=f*u-c*l;if(!(h*h<Yl))return[t+(h=(c*(e-o)-f*(t-i))/h)*u,e+h*l]}(T,B,U,L,R,P,N,O)){var j=T-z[0],I=B-z[1],q=R-z[0],W=P-z[1],H=1/Hl(function(t){return t>1?0:t<-1?Gl:Math.acos(t)}((j*q+I*W)/(Xl(j*j+I*I)*Xl(q*q+W*W)))/2),X=Xl(z[0]*z[0]+z[1]*z[1]);k=Wl(C,(f-X)/(H-1)),M=Wl(C,(h-X)/(H+1))}else k=M=0}D>Yl?M>Yl?(y=Tc(U,L,T,B,h,M,m),v=Tc(R,P,N,O,h,M,m),s.moveTo(y.cx+y.x01,y.cy+y.y01),M<C?s.arc(y.cx,y.cy,M,jl(y.y01,y.x01),jl(v.y01,v.x01),!m):(s.arc(y.cx,y.cy,M,jl(y.y01,y.x01),jl(y.y11,y.x11),!m),s.arc(0,0,h,jl(y.cy+y.y11,y.cx+y.x11),jl(v.cy+v.y11,v.cx+v.x11),!m),s.arc(v.cx,v.cy,M,jl(v.y11,v.x11),jl(v.y01,v.x01),!m))):(s.moveTo(T,B),s.arc(0,0,h,b,x,!m)):s.moveTo(T,B),f>Yl&&A>Yl?k>Yl?(y=Tc(N,O,R,P,f,-k,m),v=Tc(T,B,U,L,f,-k,m),s.lineTo(y.cx+y.x01,y.cy+y.y01),k<C?s.arc(y.cx,y.cy,k,jl(y.y01,y.x01),jl(v.y01,v.x01),!m):(s.arc(y.cx,y.cy,k,jl(y.y01,y.x01),jl(y.y11,y.x11),!m),s.arc(0,0,f,jl(y.cy+y.y11,y.cx+y.x11),jl(v.cy+v.y11,v.cx+v.x11),m),s.arc(v.cx,v.cy,k,jl(v.y11,v.x11),jl(v.y01,v.x01),!m))):s.arc(0,0,f,w,_,m):s.lineTo(N,O)}else s.moveTo(0,0);if(s.closePath(),l)return s=null,l+""||null}return l.centroid=function(){var n=(+t.apply(this,arguments)+ +e.apply(this,arguments))/2,r=(+i.apply(this,arguments)+ +o.apply(this,arguments))/2-Gl/2;return[Il(r)*n,Hl(r)*n]},l.innerRadius=function(e){return arguments.length?(t="function"===typeof e?e:vc(+e),l):t},l.outerRadius=function(t){return arguments.length?(e="function"===typeof t?t:vc(+t),l):e},l.cornerRadius=function(t){return arguments.length?(n="function"===typeof t?t:vc(+t),l):n},l.padRadius=function(t){return arguments.length?(r=null==t?null:"function"===typeof t?t:vc(+t),l):r},l.startAngle=function(t){return arguments.length?(i="function"===typeof t?t:vc(+t),l):i},l.endAngle=function(t){return arguments.length?(o="function"===typeof t?t:vc(+t),l):o},l.padAngle=function(t){return arguments.length?(a="function"===typeof t?t:vc(+t),l):a},l.context=function(t){return arguments.length?(s=null==t?null:t,l):s},l}().startAngle((t=>t.startAngle||0)).endAngle((t=>t.endAngle||0)).padAngle((t=>t.padAngle||0)).innerRadius((t=>t.innerRadius||0)).outerRadius((t=>t.outerRadius||0)).cornerRadius((t=>t.cornerRadius||0)),By=Rc().x(My).y1(Sy).y0((t=>(t.y||0)+(t.height||0))).defined($y),Ny=Rc().y(Sy).x1(My).x0((t=>(t.x||0)+(t.width||0))).defined($y),Oy=zc().x(My).y(Sy).defined($y),zy=Fy().x(My).y(Sy).width((t=>t.width||0)).height((t=>t.height||0)).cornerRadius((t=>ky(t.cornerRadiusTopLeft,t.cornerRadius)||0),(t=>ky(t.cornerRadiusTopRight,t.cornerRadius)||0),(t=>ky(t.cornerRadiusBottomRight,t.cornerRadius)||0),(t=>ky(t.cornerRadiusBottomLeft,t.cornerRadius)||0)),Ry=function(t,e){let n=null,r=Fc(i);function i(){let i;if(n||(n=i=r()),t.apply(this,arguments).draw(n,+e.apply(this,arguments)),i)return n=null,i+""||null}return t="function"===typeof t?t:vc(t||Pc),e="function"===typeof e?e:vc(void 0===e?64:+e),i.type=function(e){return arguments.length?(t="function"===typeof e?e:vc(e),i):t},i.size=function(t){return arguments.length?(e="function"===typeof t?t:vc(+t),i):e},i.context=function(t){return arguments.length?(n=null==t?null:t,i):n},i}().type((t=>yy(t.shape||"circle"))).size((t=>ky(t.size,64))),Py=Cy().x(My).y(Sy).defined($y).size((t=>t.size||1));function Uy(t){return t.cornerRadius||t.cornerRadiusTopLeft||t.cornerRadiusTopRight||t.cornerRadiusBottomRight||t.cornerRadiusBottomLeft}function Ly(t,e,n,r){return zy.context(t)(e,n,r)}var jy=1;function Iy(){jy=1}function qy(t,e,n){var r=e.clip,i=t._defs,o=e.clip_id||(e.clip_id="clip"+jy++),a=i.clipping[o]||(i.clipping[o]={id:o});return(0,Kt.mf)(r)?a.path=r(null):Uy(n)?a.path=Ly(null,n,0,0):(a.width=n.width||0,a.height=n.height||0),"url(#"+o+")"}function Wy(t){this.clear(),t&&this.union(t)}function Hy(t){this.mark=t,this.bounds=this.bounds||new Wy}function Xy(t){Hy.call(this,t),this.items=this.items||[]}function Yy(t){this._pending=0,this._loader=t||Ea()}function Gy(t){t._pending+=1}function Vy(t){t._pending-=1}function Jy(t,e,n){if(e.stroke&&0!==e.opacity&&0!==e.strokeOpacity){const r=null!=e.strokeWidth?+e.strokeWidth:1;t.expand(r+(n?function(t,e){return t.strokeJoin&&"miter"!==t.strokeJoin?0:e}(e,r):0))}return t}Wy.prototype={clone(){return new Wy(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(t){return this.x1===t.x1&&this.y1===t.y1&&this.x2===t.x2&&this.y2===t.y2},set(t,e,n,r){return n<t?(this.x2=t,this.x1=n):(this.x1=t,this.x2=n),r<e?(this.y2=e,this.y1=r):(this.y1=e,this.y2=r),this},add(t,e){return t<this.x1&&(this.x1=t),e<this.y1&&(this.y1=e),t>this.x2&&(this.x2=t),e>this.y2&&(this.y2=e),this},expand(t){return this.x1-=t,this.y1-=t,this.x2+=t,this.y2+=t,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(t){return this.x1*=t,this.y1*=t,this.x2*=t,this.y2*=t,this},translate(t,e){return this.x1+=t,this.x2+=t,this.y1+=e,this.y2+=e,this},rotate(t,e,n){const r=this.rotatedPoints(t,e,n);return this.clear().add(r[0],r[1]).add(r[2],r[3]).add(r[4],r[5]).add(r[6],r[7])},rotatedPoints(t,e,n){var{x1:r,y1:i,x2:o,y2:a}=this,s=Math.cos(t),u=Math.sin(t),l=e-e*s+n*u,c=n-e*u-n*s;return[s*r-u*i+l,u*r+s*i+c,s*r-u*a+l,u*r+s*a+c,s*o-u*i+l,u*o+s*i+c,s*o-u*a+l,u*o+s*a+c]},union(t){return t.x1<this.x1&&(this.x1=t.x1),t.y1<this.y1&&(this.y1=t.y1),t.x2>this.x2&&(this.x2=t.x2),t.y2>this.y2&&(this.y2=t.y2),this},intersect(t){return t.x1>this.x1&&(this.x1=t.x1),t.y1>this.y1&&(this.y1=t.y1),t.x2<this.x2&&(this.x2=t.x2),t.y2<this.y2&&(this.y2=t.y2),this},encloses(t){return t&&this.x1<=t.x1&&this.x2>=t.x2&&this.y1<=t.y1&&this.y2>=t.y2},alignsWith(t){return t&&(this.x1==t.x1||this.x2==t.x2||this.y1==t.y1||this.y2==t.y2)},intersects(t){return t&&!(this.x2<t.x1||this.x1>t.x2||this.y2<t.y1||this.y1>t.y2)},contains(t,e){return!(t<this.x1||t>this.x2||e<this.y1||e>this.y2)},width(){return this.x2-this.x1},height(){return this.y2-this.y1}},(0,Kt.XW)(Xy,Hy),Yy.prototype={pending(){return this._pending},sanitizeURL(t){const e=this;return Gy(e),e._loader.sanitize(t,{context:"href"}).then((t=>(Vy(e),t))).catch((()=>(Vy(e),null)))},loadImage(t){const e=this,n=jc();return Gy(e),e._loader.sanitize(t,{context:"image"}).then((t=>{const r=t.href;if(!r||!n)throw{url:r};const i=new n,o=(0,Kt.nr)(t,"crossOrigin")?t.crossOrigin:"anonymous";return null!=o&&(i.crossOrigin=o),i.onload=()=>Vy(e),i.onerror=()=>Vy(e),i.src=r,i})).catch((t=>(Vy(e),{complete:!1,width:0,height:0,src:t&&t.url||""})))},ready(){const t=this;return new Promise((e=>{!function n(r){t.pending()?setTimeout((()=>{n(!0)}),10):e(r)}(!1)}))}};const Zy=oy-1e-8;let Ky,Qy,tv,ev,nv,rv,iv,ov;const av=(t,e)=>Ky.add(t,e),sv=(t,e)=>av(Qy=t,tv=e),uv=t=>av(t,Ky.y1),lv=t=>av(Ky.x1,t),cv=(t,e)=>nv*t+iv*e,fv=(t,e)=>rv*t+ov*e,hv=(t,e)=>av(cv(t,e),fv(t,e)),dv=(t,e)=>sv(cv(t,e),fv(t,e));function pv(t,e){return Ky=t,e?(ev=e*ny,nv=ov=Math.cos(ev),rv=Math.sin(ev),iv=-rv):(nv=ov=1,ev=rv=iv=0),gv}const gv={beginPath(){},closePath(){},moveTo:dv,lineTo:dv,rect(t,e,n,r){ev?(hv(t+n,e),hv(t+n,e+r),hv(t,e+r),dv(t,e)):(av(t+n,e+r),sv(t,e))},quadraticCurveTo(t,e,n,r){const i=cv(t,e),o=fv(t,e),a=cv(n,r),s=fv(n,r);mv(Qy,i,a,uv),mv(tv,o,s,lv),sv(a,s)},bezierCurveTo(t,e,n,r,i,o){const a=cv(t,e),s=fv(t,e),u=cv(n,r),l=fv(n,r),c=cv(i,o),f=fv(i,o);yv(Qy,a,u,c,uv),yv(tv,s,l,f,lv),sv(c,f)},arc(t,e,n,r,i,o){if(r+=ev,i+=ev,Qy=n*Math.cos(i)+t,tv=n*Math.sin(i)+e,Math.abs(i-r)>Zy)av(t-n,e-n),av(t+n,e+n);else{const a=r=>av(n*Math.cos(r)+t,n*Math.sin(r)+e);let s,u;if(a(r),a(i),i!==r)if((r%=oy)<0&&(r+=oy),(i%=oy)<0&&(i+=oy),i<r&&(o=!o,s=r,r=i,i=s),o)for(i-=oy,s=r-r%iy,u=0;u<4&&s>i;++u,s-=iy)a(s);else for(s=r-r%iy+iy,u=0;u<4&&s<i;++u,s+=iy)a(s)}}};function mv(t,e,n,r){const i=(t-e)/(t+n-2*e);0<i&&i<1&&r(t+(e-t)*i)}function yv(t,e,n,r,i){const o=r-t+3*e-3*n,a=t+n-2*e,s=t-e;let u,l=0,c=0;Math.abs(o)>ry?(u=a*a+s*o,u>=0&&(u=Math.sqrt(u),l=(-a+u)/o,c=(-a-u)/o)):l=.5*s/a,0<l&&l<1&&i(vv(l,t,e,n,r)),0<c&&c<1&&i(vv(c,t,e,n,r))}function vv(t,e,n,r,i){const o=1-t,a=o*o,s=t*t;return a*o*e+3*a*t*n+3*o*s*r+s*t*i}var bv=(bv=Lc(1,1))?bv.getContext("2d"):null;const xv=new Wy;function _v(t){return function(e,n){if(!bv)return!0;t(bv,e),xv.clear().union(e.bounds).intersect(n).round();const{x1:r,y1:i,x2:o,y2:a}=xv;for(let t=i;t<=a;++t)for(let e=r;e<=o;++e)if(bv.isPointInPath(e,t))return!0;return!1}}function wv(t,e){return e.contains(t.x||0,t.y||0)}function Av(t,e){const n=t.x||0,r=t.y||0,i=t.width||0,o=t.height||0;return e.intersects(xv.set(n,r,n+i,r+o))}function Dv(t,e){const n=t.x||0,r=t.y||0;return Ev(e,n,r,null!=t.x2?t.x2:n,null!=t.y2?t.y2:r)}function Ev(t,e,n,r,i){const{x1:o,y1:a,x2:s,y2:u}=t,l=r-e,c=i-n;let f,h,d,p,g=0,m=1;for(p=0;p<4;++p){if(0===p&&(f=-l,h=-(o-e)),1===p&&(f=l,h=s-e),2===p&&(f=-c,h=-(a-n)),3===p&&(f=c,h=u-n),Math.abs(f)<1e-10&&h<0)return!1;if(d=h/f,f<0){if(d>m)return!1;d>g&&(g=d)}else if(f>0){if(d<g)return!1;d<m&&(m=d)}}return!0}function Fv(t,e){t.globalCompositeOperation=e.blend||"source-over"}function Cv(t,e){return null==t?e:t}function kv(t,e){const n=e.length;for(let r=0;r<n;++r)t.addColorStop(e[r].offset,e[r].color);return t}function Mv(t,e,n){return Wm(n)?function(t,e,n){const r=n.width(),i=n.height();let o;if("radial"===e.gradient)o=t.createRadialGradient(n.x1+Cv(e.x1,.5)*r,n.y1+Cv(e.y1,.5)*i,Math.max(r,i)*Cv(e.r1,0),n.x1+Cv(e.x2,.5)*r,n.y1+Cv(e.y2,.5)*i,Math.max(r,i)*Cv(e.r2,.5));else{const a=Cv(e.x1,0),s=Cv(e.y1,0),u=Cv(e.x2,1),l=Cv(e.y2,0);if(a!==u&&s!==l&&r!==i){const n=Lc(Math.ceil(r),Math.ceil(i)),o=n.getContext("2d");return o.scale(r,i),o.fillStyle=kv(o.createLinearGradient(a,s,u,l),e.stops),o.fillRect(0,0,r,i),t.createPattern(n,"no-repeat")}o=t.createLinearGradient(n.x1+a*r,n.y1+s*i,n.x1+u*r,n.y1+l*i)}return kv(o,e.stops)}(t,n,e.bounds):n}function Sv(t,e,n){return(n*=null==e.fillOpacity?1:e.fillOpacity)>0&&(t.globalAlpha=n,t.fillStyle=Mv(t,e,e.fill),!0)}var $v=[];function Tv(t,e,n){var r=null!=(r=e.strokeWidth)?r:1;return!(r<=0)&&((n*=null==e.strokeOpacity?1:e.strokeOpacity)>0&&(t.globalAlpha=n,t.strokeStyle=Mv(t,e,e.stroke),t.lineWidth=r,t.lineCap=e.strokeCap||"butt",t.lineJoin=e.strokeJoin||"miter",t.miterLimit=e.strokeMiterLimit||10,t.setLineDash&&(t.setLineDash(e.strokeDash||$v),t.lineDashOffset=e.strokeDashOffset||0),!0))}function Bv(t,e){return t.zindex-e.zindex||t.index-e.index}function Nv(t){if(!t.zdirty)return t.zitems;var e,n,r,i=t.items,o=[];for(n=0,r=i.length;n<r;++n)(e=i[n]).index=n,e.zindex&&o.push(e);return t.zdirty=!1,t.zitems=o.sort(Bv)}function Ov(t,e){var n,r,i=t.items;if(!i||!i.length)return;const o=Nv(t);if(o&&o.length){for(n=0,r=i.length;n<r;++n)i[n].zindex||e(i[n]);i=o}for(n=0,r=i.length;n<r;++n)e(i[n])}function zv(t,e){var n,r,i=t.items;if(!i||!i.length)return null;const o=Nv(t);for(o&&o.length&&(i=o),r=i.length;--r>=0;)if(n=e(i[r]))return n;if(i===o)for(r=(i=t.items).length;--r>=0;)if(!i[r].zindex&&(n=e(i[r])))return n;return null}function Rv(t){return function(e,n,r){Ov(n,(n=>{r&&!r.intersects(n.bounds)||Uv(t,e,n,n)}))}}function Pv(t){return function(e,n,r){!n.items.length||r&&!r.intersects(n.bounds)||Uv(t,e,n.items[0],n.items)}}function Uv(t,e,n,r){var i=null==n.opacity?1:n.opacity;0!==i&&(t(e,r)||(Fv(e,n),n.fill&&Sv(e,n,i)&&e.fill(),n.stroke&&Tv(e,n,i)&&e.stroke()))}function Lv(t){return t=t||Kt.yb,function(e,n,r,i,o,a){return r*=e.pixelRatio,i*=e.pixelRatio,zv(n,(n=>{const s=n.bounds;if((!s||s.contains(o,a))&&s)return t(e,n,r,i,o,a)?n:void 0}))}}function jv(t,e){return function(n,r,i,o){var a,s,u=Array.isArray(r)?r[0]:r,l=null==e?u.fill:e,c=u.stroke&&n.isPointInStroke;return c&&(a=u.strokeWidth,s=u.strokeCap,n.lineWidth=null!=a?a:1,n.lineCap=null!=s?s:"butt"),!t(n,r)&&(l&&n.isPointInPath(i,o)||c&&n.isPointInStroke(i,o))}}function Iv(t){return Lv(jv(t))}function qv(t,e){return"translate("+t+","+e+")"}function Wv(t){return"rotate("+t+")"}function Hv(t){return qv(t.x||0,t.y||0)}function Xv(t,e,n){function r(t,n){var r=n.x||0,i=n.y||0,o=n.angle||0;t.translate(r,i),o&&t.rotate(o*=ny),t.beginPath(),e(t,n),o&&t.rotate(-o),t.translate(-r,-i)}return{type:t,tag:"path",nested:!1,attr:function(t,n){t("transform",function(t){return qv(t.x||0,t.y||0)+(t.angle?" "+Wv(t.angle):"")}(n)),t("d",e(null,n))},bound:function(t,n){return e(pv(t,n.angle),n),Jy(t,n).translate(n.x||0,n.y||0)},draw:Rv(r),pick:Iv(r),isect:n||_v(r)}}var Yv=Xv("arc",(function(t,e){return Ty.context(t)(e)}));function Gv(t,e,n){function r(t,n){t.beginPath(),e(t,n)}const i=jv(r);return{type:t,tag:"path",nested:!0,attr:function(t,n){var r=n.mark.items;r.length&&t("d",e(null,r))},bound:function(t,n){var r=n.items;return 0===r.length?t:(e(pv(t),r),Jy(t,r[0]))},draw:Pv(r),pick:function(t,e,n,r,o,a){var s=e.items,u=e.bounds;return!s||!s.length||u&&!u.contains(o,a)?null:(n*=t.pixelRatio,r*=t.pixelRatio,i(t,s,n,r)?s[0]:null)},isect:wv,tip:n}}var Vv=Gv("area",(function(t,e){const n=e[0],r=n.interpolate||"linear";return("horizontal"===n.orient?Ny:By).curve(Vm(r,n.orient,n.tension)).context(t)(e)}),(function(t,e){for(var n,r,i="horizontal"===t[0].orient?e[1]:e[0],o="horizontal"===t[0].orient?"y":"x",a=t.length,s=1/0;--a>=0;)!1!==t[a].defined&&(r=Math.abs(t[a][o]-i))<s&&(s=r,n=t[a]);return n}));function Jv(t,e){t.beginPath(),Uy(e)?Ly(t,e,0,0):t.rect(0,0,e.width||0,e.height||0),t.clip()}function Zv(t){const e=Cv(t.strokeWidth,1);return null!=t.strokeOffset?t.strokeOffset:t.stroke&&e>.5&&e<1.5?.5-Math.abs(e-1):0}function Kv(t,e){const n=Zv(e);t("d",Ly(null,e,n,n))}function Qv(t,e,n,r){const i=Zv(e);t.beginPath(),Ly(t,e,(n||0)+i,(r||0)+i)}const tb=jv(Qv),eb=jv(Qv,!1),nb=jv(Qv,!0);var rb={type:"group",tag:"g",nested:!1,attr:function(t,e){t("transform",Hv(e))},bound:function(t,e){if(!e.clip&&e.items){const n=e.items,r=n.length;for(let e=0;e<r;++e)t.union(n[e].bounds)}return(e.clip||e.width||e.height)&&!e.noBound&&t.add(0,0).add(e.width||0,e.height||0),Jy(t,e),t.translate(e.x||0,e.y||0)},draw:function(t,e,n){Ov(e,(e=>{const r=e.x||0,i=e.y||0,o=e.strokeForeground,a=null==e.opacity?1:e.opacity;(e.stroke||e.fill)&&a&&(Qv(t,e,r,i),Fv(t,e),e.fill&&Sv(t,e,a)&&t.fill(),e.stroke&&!o&&Tv(t,e,a)&&t.stroke()),t.save(),t.translate(r,i),e.clip&&Jv(t,e),n&&n.translate(-r,-i),Ov(e,(e=>{this.draw(t,e,n)})),n&&n.translate(r,i),t.restore(),o&&e.stroke&&a&&(Qv(t,e,r,i),Fv(t,e),Tv(t,e,a)&&t.stroke())}))},pick:function(t,e,n,r,i,o){if(e.bounds&&!e.bounds.contains(i,o)||!e.items)return null;const a=n*t.pixelRatio,s=r*t.pixelRatio;return zv(e,(u=>{let l,c,f;const h=u.bounds;if(h&&!h.contains(i,o))return;c=u.x||0,f=u.y||0;const d=c+(u.width||0),p=f+(u.height||0),g=u.clip;if(g&&(i<c||i>d||o<f||o>p))return;if(t.save(),t.translate(c,f),c=i-c,f=o-f,g&&Uy(u)&&!nb(t,u,a,s))return t.restore(),null;const m=u.strokeForeground,y=!1!==e.interactive;return y&&m&&u.stroke&&eb(t,u,a,s)?(t.restore(),u):(l=zv(u,(t=>function(t,e,n){return(!1!==t.interactive||"group"===t.marktype)&&t.bounds&&t.bounds.contains(e,n)}(t,c,f)?this.pick(t,n,r,c,f):null)),!l&&y&&(u.fill||!m&&u.stroke)&&tb(t,u,a,s)&&(l=u),t.restore(),l||null)}))},isect:Av,content:function(t,e,n){t("clip-path",e.clip?qy(n,e,e):null)},background:function(t,e){t("class","background"),t("aria-hidden",!0),Kv(t,e)},foreground:function(t,e){t("class","foreground"),t("aria-hidden",!0),e.strokeForeground?Kv(t,e):t("d","")}},ib={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",version:"1.1"};function ob(t,e){var n=t.image;return(!n||t.url&&t.url!==n.url)&&(n={complete:!1,width:0,height:0},e.loadImage(t.url).then((e=>{t.image=e,t.image.url=t.url}))),n}function ab(t,e){return null!=t.width?t.width:e&&e.width?!1!==t.aspect&&t.height?t.height*e.width/e.height:e.width:0}function sb(t,e){return null!=t.height?t.height:e&&e.height?!1!==t.aspect&&t.width?t.width*e.height/e.width:e.height:0}function ub(t,e){return"center"===t?e/2:"right"===t?e:0}function lb(t,e){return"middle"===t?e/2:"bottom"===t?e:0}var cb={type:"image",tag:"image",nested:!1,attr:function(t,e,n){const r=ob(e,n),i=ab(e,r),o=sb(e,r),a=(e.x||0)-ub(e.align,i),s=(e.y||0)-lb(e.baseline,o);t("href",!r.src&&r.toDataURL?r.toDataURL():r.src||"",ib["xmlns:xlink"],"xlink:href"),t("transform",qv(a,s)),t("width",i),t("height",o),t("preserveAspectRatio",!1===e.aspect?"none":"xMidYMid")},bound:function(t,e){const n=e.image,r=ab(e,n),i=sb(e,n),o=(e.x||0)-ub(e.align,r),a=(e.y||0)-lb(e.baseline,i);return t.set(o,a,o+r,a+i)},draw:function(t,e,n){Ov(e,(e=>{if(n&&!n.intersects(e.bounds))return;const r=ob(e,this);let i=ab(e,r),o=sb(e,r);if(0===i||0===o)return;let a,s,u,l,c=(e.x||0)-ub(e.align,i),f=(e.y||0)-lb(e.baseline,o);!1!==e.aspect&&(s=r.width/r.height,u=e.width/e.height,s===s&&u===u&&s!==u&&(u<s?(l=i/s,f+=(o-l)/2,o=l):(l=o*s,c+=(i-l)/2,i=l))),(r.complete||r.toDataURL)&&(Fv(t,e),t.globalAlpha=null!=(a=e.opacity)?a:1,t.imageSmoothingEnabled=!1!==e.smooth,t.drawImage(r,c,f,i,o))}))},pick:Lv(),isect:Kt.yb,get:ob,xOffset:ub,yOffset:lb},fb=Gv("line",(function(t,e){const n=e[0],r=n.interpolate||"linear";return Oy.curve(Vm(r,n.orient,n.tension)).context(t)(e)}),(function(t,e){for(var n,r,i=Math.pow(t[0].strokeWidth||1,2),o=t.length;--o>=0;)if(!1!==t[o].defined&&(n=t[o].x-e[0])*n+(r=t[o].y-e[1])*r<i)return t[o];return null}));function hb(t,e){var n=e.path;if(null==n)return!0;var r=e.x||0,i=e.y||0,o=e.scaleX||1,a=e.scaleY||1,s=(e.angle||0)*ny,u=e.pathCache;u&&u.path===n||((e.pathCache=u=ey(n)).path=n),s&&t.rotate&&t.translate?(t.translate(r,i),t.rotate(s),dy(t,u,0,0,o,a),t.rotate(-s),t.translate(-r,-i)):dy(t,u,r,i,o,a)}var db={type:"path",tag:"path",nested:!1,attr:function(t,e){var n=e.scaleX||1,r=e.scaleY||1;1===n&&1===r||t("vector-effect","non-scaling-stroke"),t("transform",function(t){return qv(t.x||0,t.y||0)+(t.angle?" "+Wv(t.angle):"")+(t.scaleX||t.scaleY?" "+function(t,e){return"scale("+t+","+e+")"}(t.scaleX||1,t.scaleY||1):"")}(e)),t("d",e.path)},bound:function(t,e){return hb(pv(t,e.angle),e)?t.set(0,0,0,0):Jy(t,e,!0)},draw:Rv(hb),pick:Iv(hb),isect:_v(hb)};function pb(t,e){t.beginPath(),Ly(t,e)}var gb={type:"rect",tag:"path",nested:!1,attr:function(t,e){t("d",Ly(null,e))},bound:function(t,e){var n,r;return Jy(t.set(n=e.x||0,r=e.y||0,n+e.width||0,r+e.height||0),e)},draw:Rv(pb),pick:Iv(pb),isect:Av};function mb(t,e,n){var r,i,o,a;return!(!e.stroke||!Tv(t,e,n))&&(r=e.x||0,i=e.y||0,o=null!=e.x2?e.x2:r,a=null!=e.y2?e.y2:i,t.beginPath(),t.moveTo(r,i),t.lineTo(o,a),!0)}var yb={type:"rule",tag:"line",nested:!1,attr:function(t,e){t("transform",Hv(e)),t("x2",null!=e.x2?e.x2-(e.x||0):0),t("y2",null!=e.y2?e.y2-(e.y||0):0)},bound:function(t,e){var n,r;return Jy(t.set(n=e.x||0,r=e.y||0,null!=e.x2?e.x2:n,null!=e.y2?e.y2:r),e)},draw:function(t,e,n){Ov(e,(e=>{if(!n||n.intersects(e.bounds)){var r=null==e.opacity?1:e.opacity;r&&mb(t,e,r)&&(Fv(t,e),t.stroke())}}))},pick:Lv((function(t,e,n,r){return!!t.isPointInStroke&&(mb(t,e,1)&&t.isPointInStroke(n,r))})),isect:Dv},vb=Xv("shape",(function(t,e){return(e.mark.shape||e.shape).context(t)(e)})),bb=Xv("symbol",(function(t,e){return Ry.context(t)(e)}),wv);const xb=(0,Kt.$m)();var _b={height:Cb,measureWidth:Eb,estimateWidth:Ab,width:Ab,canvas:wb};function wb(t){_b.width=t&&bv?Eb:Ab}function Ab(t,e){return Db($b(t,e),Cb(t))}function Db(t,e){return~~(.8*t.length*e)}function Eb(t,e){return Cb(t)<=0||!(e=$b(t,e))?0:Fb(e,Bb(t))}function Fb(t,e){const n=`(${e}) ${t}`;let r=xb.get(n);return void 0===r&&(bv.font=e,r=bv.measureText(t).width,xb.set(n,r)),r}function Cb(t){return null!=t.fontSize?+t.fontSize||0:11}function kb(t){return null!=t.lineHeight?t.lineHeight:Cb(t)+2}function Mb(t){return e=t.lineBreak&&t.text&&!(0,Kt.kJ)(t.text)?t.text.split(t.lineBreak):t.text,(0,Kt.kJ)(e)?e.length>1?e:e[0]:e;var e}function Sb(t){const e=Mb(t);return((0,Kt.kJ)(e)?e.length-1:0)*kb(t)}function $b(t,e){const n=null==e?"":(e+"").trim();return t.limit>0&&n.length?function(t,e){var n=+t.limit,r=function(t){if(_b.width===Eb){const e=Bb(t);return t=>Fb(t,e)}{const e=Cb(t);return t=>Db(t,e)}}(t);if(r(e)<n)return e;var i,o=t.ellipsis||"\u2026",a="rtl"===t.dir,s=0,u=e.length;if(n-=r(o),a){for(;s<u;)i=s+u>>>1,r(e.slice(i))>n?s=i+1:u=i;return o+e.slice(s)}for(;s<u;)i=1+(s+u>>>1),r(e.slice(0,i))<n?s=i:u=i-1;return e.slice(0,s)+o}(t,n):n}function Tb(t,e){var n=t.font;return(e&&n?String(n).replace(/"/g,"'"):n)||"sans-serif"}function Bb(t,e){return(t.fontStyle?t.fontStyle+" ":"")+(t.fontVariant?t.fontVariant+" ":"")+(t.fontWeight?t.fontWeight+" ":"")+Cb(t)+"px "+Tb(t,e)}function Nb(t){var e=t.baseline,n=Cb(t);return Math.round("top"===e?.79*n:"middle"===e?.3*n:"bottom"===e?-.21*n:"line-top"===e?.29*n+.5*kb(t):"line-bottom"===e?.29*n-.5*kb(t):0)}wb(!0);const Ob={left:"start",center:"middle",right:"end"},zb=new Wy;function Rb(t){var e,n=t.x||0,r=t.y||0,i=t.radius||0;return i&&(e=(t.theta||0)-iy,n+=i*Math.cos(e),r+=i*Math.sin(e)),zb.x1=n,zb.y1=r,zb}function Pb(t,e,n){var r,i=_b.height(e),o=e.align,a=Rb(e),s=a.x1,u=a.y1,l=e.dx||0,c=(e.dy||0)+Nb(e)-Math.round(.8*i),f=Mb(e);if((0,Kt.kJ)(f)?(i+=kb(e)*(f.length-1),r=f.reduce(((t,n)=>Math.max(t,_b.width(e,n))),0)):r=_b.width(e,f),"center"===o?l-=r/2:"right"===o&&(l-=r),t.set(l+=s,c+=u,l+r,c+i),e.angle&&!n)t.rotate(e.angle*ny,s,u);else if(2===n)return t.rotatedPoints(e.angle*ny,s,u);return t}var Ub={type:"text",tag:"text",nested:!1,attr:function(t,e){var n,r=e.dx||0,i=(e.dy||0)+Nb(e),o=Rb(e),a=o.x1,s=o.y1,u=e.angle||0;t("text-anchor",Ob[e.align]||"start"),u?(n=qv(a,s)+" "+Wv(u),(r||i)&&(n+=" "+qv(r,i))):n=qv(a+r,s+i),t("transform",n)},bound:Pb,draw:function(t,e,n){Ov(e,(e=>{var r,i,o,a,s,u,l,c=null==e.opacity?1:e.opacity;if(!(n&&!n.intersects(e.bounds)||0===c||e.fontSize<=0||null==e.text||0===e.text.length)){if(t.font=Bb(e),t.textAlign=e.align||"left",i=(r=Rb(e)).x1,o=r.y1,e.angle&&(t.save(),t.translate(i,o),t.rotate(e.angle*ny),i=o=0),i+=e.dx||0,o+=(e.dy||0)+Nb(e),u=Mb(e),Fv(t,e),(0,Kt.kJ)(u))for(s=kb(e),a=0;a<u.length;++a)l=$b(e,u[a]),e.fill&&Sv(t,e,c)&&t.fillText(l,i,o),e.stroke&&Tv(t,e,c)&&t.strokeText(l,i,o),o+=s;else l=$b(e,u),e.fill&&Sv(t,e,c)&&t.fillText(l,i,o),e.stroke&&Tv(t,e,c)&&t.strokeText(l,i,o);e.angle&&t.restore()}}))},pick:Lv((function(t,e,n,r,i,o){if(e.fontSize<=0)return!1;if(!e.angle)return!0;var a=Rb(e),s=a.x1,u=a.y1,l=Pb(zb,e,1),c=-e.angle*ny,f=Math.cos(c),h=Math.sin(c),d=f*i-h*o+(s-f*s+h*u),p=h*i+f*o+(u-h*s-f*u);return l.contains(d,p)})),isect:function(t,e){const n=Pb(zb,t,2);return Ev(e,n[0],n[1],n[2],n[3])||Ev(e,n[0],n[1],n[4],n[5])||Ev(e,n[4],n[5],n[6],n[7])||Ev(e,n[2],n[3],n[6],n[7])}},Lb=Gv("trail",(function(t,e){return Py.context(t)(e)}),(function(t,e){for(var n,r,i=t.length;--i>=0;)if(!1!==t[i].defined&&(n=t[i].x-e[0])*n+(r=t[i].y-e[1])*r<(n=t[i].size||1)*n)return t[i];return null})),jb={arc:Yv,area:Vv,group:rb,image:cb,line:fb,path:db,rect:gb,rule:yb,shape:vb,symbol:bb,text:Ub,trail:Lb};function Ib(t,e,n){var r=jb[t.mark.marktype],i=e||r.bound;return r.nested&&(t=t.mark),i(t.bounds||(t.bounds=new Wy),t,n)}var qb={mark:null};function Wb(t,e,n){var r,i,o,a,s=jb[t.marktype],u=s.bound,l=t.items,c=l&&l.length;if(s.nested)return c?o=l[0]:(qb.mark=t,o=qb),a=Ib(o,u,n),e=e&&e.union(a)||a;if(e=e||t.bounds&&t.bounds.clear()||new Wy,c)for(r=0,i=l.length;r<i;++r)e.union(Ib(l[r],u,n));return t.bounds=e}const Hb=["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 Xb(t,e){return JSON.stringify(t,Hb,e)}function Yb(t){return Gb("string"===typeof t?JSON.parse(t):t)}function Gb(t){var e,n,r,i=t.marktype,o=t.items;if(o)for(n=0,r=o.length;n<r;++n)e=i?"mark":"group",o[n][e]=t,o[n].zindex&&(o[n][e].zdirty=!0),"group"===(i||e)&&Gb(o[n]);return i&&Wb(t),t}function Vb(t){arguments.length?this.root=Yb(t):(this.root=Jb({marktype:"group",name:"root",role:"frame"}),this.root.items=[new Xy(this.root)])}function Jb(t,e){const n={bounds:new Wy,clip:!!t.clip,group:e,interactive:!1!==t.interactive,items:[],marktype:t.marktype,name:t.name||void 0,role:t.role||void 0,zindex:t.zindex||0};return null!=t.aria&&(n.aria=t.aria),t.description&&(n.description=t.description),n}function Zb(t,e,n){return!t&&"undefined"!==typeof document&&document.createElement&&(t=document),t?n?t.createElementNS(n,e):t.createElement(e):null}function Kb(t,e){e=e.toLowerCase();for(var n=t.childNodes,r=0,i=n.length;r<i;++r)if(n[r].tagName.toLowerCase()===e)return n[r]}function Qb(t,e,n,r){var i,o=t.childNodes[e];return o&&o.tagName.toLowerCase()===n.toLowerCase()||(i=o||null,o=Zb(t.ownerDocument,n,r),t.insertBefore(o,i)),o}function tx(t,e){for(var n=t.childNodes,r=n.length;r>e;)t.removeChild(n[--r]);return t}function ex(t){return"mark-"+t.marktype+(t.role?" role-"+t.role:"")+(t.name?" "+t.name:"")}function nx(t,e){const n=e.getBoundingClientRect();return[t.clientX-n.left-(e.clientLeft||0),t.clientY-n.top-(e.clientTop||0)]}function rx(t,e){this._active=null,this._handlers={},this._loader=t||Ea(),this._tooltip=e||ix}function ix(t,e,n,r){t.element().setAttribute("title",r||"")}function ox(t){this._el=null,this._bgcolor=null,this._loader=new Yy(t)}Vb.prototype={toJSON(t){return Xb(this.root,t||0)},mark(t,e,n){const r=Jb(t,e=e||this.root.items[0]);return e.items[n]=r,r.zindex&&(r.group.zdirty=!0),r}},rx.prototype={initialize(t,e,n){return this._el=t,this._obj=n||null,this.origin(e)},element(){return this._el},canvas(){return this._el&&this._el.firstChild},origin(t){return arguments.length?(this._origin=t||[0,0],this):this._origin.slice()},scene(t){return arguments.length?(this._scene=t,this):this._scene},on(){},off(){},_handlerIndex(t,e,n){for(let r=t?t.length:0;--r>=0;)if(t[r].type===e&&(!n||t[r].handler===n))return r;return-1},handlers(t){const e=this._handlers,n=[];if(t)n.push(...e[this.eventName(t)]);else for(const r in e)n.push(...e[r]);return n},eventName(t){const e=t.indexOf(".");return e<0?t:t.slice(0,e)},handleHref(t,e,n){this._loader.sanitize(n,{context:"href"}).then((e=>{const n=new MouseEvent(t.type,t),r=Zb(null,"a");for(const t in e)r.setAttribute(t,e[t]);r.dispatchEvent(n)})).catch((()=>{}))},handleTooltip(t,e,n){if(e&&null!=e.tooltip){e=function(t,e,n,r){var i,o,a=t&&t.mark;if(a&&(i=jb[a.marktype]).tip){for((o=nx(e,n))[0]-=r[0],o[1]-=r[1];t=t.mark.group;)o[0]-=t.x||0,o[1]-=t.y||0;t=i.tip(a.items,o)}return t}(e,t,this.canvas(),this._origin);const r=n&&e&&e.tooltip||null;this._tooltip.call(this._obj,this,t,e,r)}},getItemBoundingClientRect(t){const e=this.canvas();if(!e)return;const n=e.getBoundingClientRect(),r=this._origin,i=t.bounds,o=i.width(),a=i.height();let s=i.x1+r[0]+n.left,u=i.y1+r[1]+n.top;for(;t.mark&&(t=t.mark.group);)s+=t.x||0,u+=t.y||0;return{x:s,y:u,width:o,height:a,left:s,top:u,right:s+o,bottom:u+a}}},ox.prototype={initialize(t,e,n,r,i){return this._el=t,this.resize(e,n,r,i)},element(){return this._el},canvas(){return this._el&&this._el.firstChild},background(t){return 0===arguments.length?this._bgcolor:(this._bgcolor=t,this)},resize(t,e,n,r){return this._width=t,this._height=e,this._origin=n||[0,0],this._scale=r||1,this},dirty(){},render(t){const e=this;return e._call=function(){e._render(t)},e._call(),e._call=null,e},_render(){},renderAsync(t){const e=this.render(t);return this._ready?this._ready.then((()=>e)):Promise.resolve(e)},_load(t,e){var n=this,r=n._loader[t](e);if(!n._ready){const t=n._call;n._ready=n._loader.ready().then((e=>{e&&t(),n._ready=null}))}return r},sanitizeURL(t){return this._load("sanitizeURL",t)},loadImage(t){return this._load("loadImage",t)}};const ax="dragenter",sx="dragleave",ux="dragover",lx="mousedown",cx="mousemove",fx="mouseout",hx="mouseover",dx="click",px="mousewheel",gx="touchstart",mx="touchmove",yx="touchend",vx=["keydown","keypress","keyup",ax,sx,ux,lx,"mouseup",cx,fx,hx,dx,"dblclick","wheel",px,gx,mx,yx],bx=cx,xx=fx,_x=dx;function wx(t,e){rx.call(this,t,e),this._down=null,this._touch=null,this._first=!0,this._events={}}const Ax=t=>t===gx||t===mx||t===yx?[gx,mx,yx]:[t];function Dx(t,e){Ax(e).forEach((e=>function(t,e){const n=t.canvas();n&&!t._events[e]&&(t._events[e]=1,n.addEventListener(e,t[e]?n=>t[e](n):n=>t.fire(e,n)))}(t,e)))}function Ex(t,e,n){return function(r){const i=this._active,o=this.pickEvent(r);o===i||(i&&i.exit||this.fire(n,r),this._active=o,this.fire(e,r)),this.fire(t,r)}}function Fx(t){return function(e){this.fire(t,e),this._active=null}}(0,Kt.XW)(wx,rx,{initialize(t,e,n){return this._canvas=t&&Kb(t,"canvas"),[dx,lx,cx,fx,sx].forEach((t=>Dx(this,t))),rx.prototype.initialize.call(this,t,e,n)},canvas(){return this._canvas},context(){return this._canvas.getContext("2d")},events:vx,DOMMouseScroll(t){this.fire(px,t)},mousemove:Ex(cx,hx,fx),dragover:Ex(ux,ax,sx),mouseout:Fx(fx),dragleave:Fx(sx),mousedown(t){this._down=this._active,this.fire(lx,t)},click(t){this._down===this._active&&(this.fire(dx,t),this._down=null)},touchstart(t){this._touch=this.pickEvent(t.changedTouches[0]),this._first&&(this._active=this._touch,this._first=!1),this.fire(gx,t,!0)},touchmove(t){this.fire(mx,t,!0)},touchend(t){this.fire(yx,t,!0),this._touch=null},fire(t,e,n){const r=n?this._touch:this._active,i=this._handlers[t];if(e.vegaType=t,t===_x&&r&&r.href?this.handleHref(e,r,r.href):t!==bx&&t!==xx||this.handleTooltip(e,r,t!==xx),i)for(let o=0,a=i.length;o<a;++o)i[o].handler.call(this._obj,e,r)},on(t,e){const n=this.eventName(t),r=this._handlers;return this._handlerIndex(r[n],t,e)<0&&(Dx(this,t),(r[n]||(r[n]=[])).push({type:t,handler:e})),this},off(t,e){const n=this.eventName(t),r=this._handlers[n],i=this._handlerIndex(r,t,e);return i>=0&&r.splice(i,1),this},pickEvent(t){const e=nx(t,this._canvas),n=this._origin;return this.pick(this._scene,e[0],e[1],e[0]-n[0],e[1]-n[1])},pick(t,e,n,r,i){const o=this.context();return jb[t.marktype].pick.call(this,o,t,e,n,r,i)}});var Cx="undefined"!==typeof window&&window.devicePixelRatio||1;function kx(t){ox.call(this,t),this._options={},this._redraw=!1,this._dirty=new Wy,this._tempb=new Wy}const Mx=ox.prototype;function Sx(t,e){rx.call(this,t,e);const n=this;n._hrefHandler=$x(n,((t,e)=>{e&&e.href&&n.handleHref(t,e,e.href)})),n._tooltipHandler=$x(n,((t,e)=>{n.handleTooltip(t,e,t.type!==xx)}))}(0,Kt.XW)(kx,ox,{initialize(t,e,n,r,i,o){return this._options=o||{},this._canvas=this._options.externalContext?null:Lc(1,1,this._options.type),t&&this._canvas&&(tx(t,0).appendChild(this._canvas),this._canvas.setAttribute("class","marks")),Mx.initialize.call(this,t,e,n,r,i)},resize(t,e,n,r){if(Mx.resize.call(this,t,e,n,r),this._canvas)!function(t,e,n,r,i,o){const a="undefined"!==typeof HTMLElement&&t instanceof HTMLElement&&null!=t.parentNode,s=t.getContext("2d"),u=a?Cx:i;t.width=e*u,t.height=n*u;for(const l in o)s[l]=o[l];a&&1!==u&&(t.style.width=e+"px",t.style.height=n+"px"),s.pixelRatio=u,s.setTransform(u,0,0,u,u*r[0],u*r[1])}(this._canvas,this._width,this._height,this._origin,this._scale,this._options.context);else{const t=this._options.externalContext;t||(0,Kt.vU)("CanvasRenderer is missing a valid canvas or context"),t.scale(this._scale,this._scale),t.translate(this._origin[0],this._origin[1])}return this._redraw=!0,this},canvas(){return this._canvas},context(){return this._options.externalContext||(this._canvas?this._canvas.getContext("2d"):null)},dirty(t){const e=this._tempb.clear().union(t.bounds);let n=t.mark.group;for(;n;)e.translate(n.x||0,n.y||0),n=n.mark.group;this._dirty.union(e)},_render(t){const e=this.context(),n=this._origin,r=this._width,i=this._height,o=this._dirty,a=((t,e,n)=>(new Wy).set(0,0,e,n).translate(-t[0],-t[1]))(n,r,i);e.save();const s=this._redraw||o.empty()?(this._redraw=!1,a.expand(1)):function(t,e,n){return e.expand(1).round(),t.pixelRatio%1&&e.scale(t.pixelRatio).round().scale(1/t.pixelRatio),e.translate(-n[0]%1,-n[1]%1),t.beginPath(),t.rect(e.x1,e.y1,e.width(),e.height()),t.clip(),e}(e,a.intersect(o),n);return this.clear(-n[0],-n[1],r,i),this.draw(e,t,s),e.restore(),o.clear(),this},draw(t,e,n){const r=jb[e.marktype];e.clip&&function(t,e){var n=e.clip;t.save(),(0,Kt.mf)(n)?(t.beginPath(),n(t),t.clip()):Jv(t,e.group)}(t,e),r.draw.call(this,t,e,n),e.clip&&t.restore()},clear(t,e,n,r){const i=this._options,o=this.context();"pdf"===i.type||i.externalContext||o.clearRect(t,e,n,r),null!=this._bgcolor&&(o.fillStyle=this._bgcolor,o.fillRect(t,e,n,r))}});const $x=(t,e)=>n=>{let r=n.target.__data__;r=Array.isArray(r)?r[0]:r,n.vegaType=n.type,e.call(t._obj,n,r)};(0,Kt.XW)(Sx,rx,{initialize(t,e,n){let r=this._svg;return r&&(r.removeEventListener(_x,this._hrefHandler),r.removeEventListener(bx,this._tooltipHandler),r.removeEventListener(xx,this._tooltipHandler)),this._svg=r=t&&Kb(t,"svg"),r&&(r.addEventListener(_x,this._hrefHandler),r.addEventListener(bx,this._tooltipHandler),r.addEventListener(xx,this._tooltipHandler)),rx.prototype.initialize.call(this,t,e,n)},canvas(){return this._svg},on(t,e){const n=this.eventName(t),r=this._handlers;if(this._handlerIndex(r[n],t,e)<0){const i={type:t,handler:e,listener:$x(this,e)};(r[n]||(r[n]=[])).push(i),this._svg&&this._svg.addEventListener(n,i.listener)}return this},off(t,e){const n=this.eventName(t),r=this._handlers[n],i=this._handlerIndex(r,t,e);return i>=0&&(this._svg&&this._svg.removeEventListener(n,r[i].listener),r.splice(i,1)),this}});const Tx="aria-hidden",Bx="aria-label",Nx="role",Ox="aria-roledescription",zx="graphics-object",Rx="graphics-symbol",Px=(t,e,n)=>({[Nx]:t,[Ox]:e,[Bx]:n||void 0}),Ux=(0,Kt.Rg)(["axis-domain","axis-grid","axis-label","axis-tick","axis-title","legend-band","legend-entry","legend-gradient","legend-label","legend-title","legend-symbol","title"]),Lx={axis:{desc:"axis",caption:function(t){const e=t.datum,n=t.orient,r=e.title?Hx(t):null,i=t.context,o=i.scales[e.scale].value,a=i.dataflow.locale(),s=o.type;return("left"===n||"right"===n?"Y":"X")+"-axis"+(r?` titled '${r}'`:"")+` for a ${om(s)?"discrete":s} scale`+` with ${jm(a,o,t)}`}},legend:{desc:"legend",caption:function(t){const e=t.datum,n=e.title?Hx(t):null,r=`${e.type||""} legend`.trim(),i=e.scales,o=Object.keys(i),a=t.context,s=a.scales[i[o[0]]].value,u=a.dataflow.locale();return function(t){return t.length?t[0].toUpperCase()+t.slice(1):t}(r)+(n?` titled '${n}'`:"")+` for ${function(t){return t=t.map((t=>t+("fill"===t||"stroke"===t?" color":""))),t.length<2?t[0]:t.slice(0,-1).join(", ")+" and "+(0,Kt.fj)(t)}(o)}`+` with ${jm(u,s,t)}`}},"title-text":{desc:"title",caption:t=>`Title text '${Wx(t)}'`},"title-subtitle":{desc:"subtitle",caption:t=>`Subtitle text '${Wx(t)}'`}},jx={ariaRole:Nx,ariaRoleDescription:Ox,description:Bx};function Ix(t,e){const n=!1===e.aria;if(t(Tx,n||void 0),n||null==e.description)for(const r in jx)t(jx[r],void 0);else{const n=e.mark.marktype;t(Bx,e.description),t(Nx,e.ariaRole||("group"===n?zx:Rx)),t(Ox,e.ariaRoleDescription||`${n} mark`)}}function qx(t){return!1===t.aria?{[Tx]:!0}:Ux[t.role]?null:Lx[t.role]?function(t,e){try{const n=t.items[0],r=e.caption||(()=>"");return Px(e.role||Rx,e.desc,n.description||r(n))}catch(n){return null}}(t,Lx[t.role]):function(t){const e=t.marktype,n="group"===e||"text"===e||t.items.some((t=>null!=t.description&&!1!==t.aria));return Px(n?zx:Rx,`${e} mark container`,t.description)}(t)}function Wx(t){return(0,Kt.IX)(t.text).join(" ")}function Hx(t){try{return(0,Kt.IX)((0,Kt.fj)(t.items).items[0].text).join(" ")}catch(e){return null}}const Xx=t=>(t+"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">"),Yx=t=>Xx(t).replace(/"/g,""").replace(/\t/g,"	").replace(/\n/g,"
").replace(/\r/g,"
");function Gx(){let t="",e="",n="";const r=[],i=()=>e=n="",o=(t,n)=>(null!=n&&(e+=` ${t}="${Yx(n)}"`),a),a={open(s){(o=>{e&&(t+=`${e}>${n}`,i()),r.push(o)})(s),e="<"+s;for(var u=arguments.length,l=new Array(u>1?u-1:0),c=1;c<u;c++)l[c-1]=arguments[c];for(const t of l)for(const e in t)o(e,t[e]);return a},close(){const o=r.pop();return t+=e?e+(n?`>${n}</${o}>`:"/>"):`</${o}>`,i(),a},attr:o,text:t=>(n+=Xx(t),a),toString:()=>t};return a}const Vx=t=>Jx(Gx(),t)+"";function Jx(t,e){if(t.open(e.tagName),e.hasAttributes()){const n=e.attributes,r=n.length;for(let e=0;e<r;++e)t.attr(n[e].name,n[e].value)}if(e.hasChildNodes()){const n=e.childNodes;for(const e of n)3===e.nodeType?t.text(e.nodeValue):Jx(t,e)}return t.close()}const Zx={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"},Kx={blend:"mix-blend-mode"},Qx={fill:"none","stroke-miterlimit":10},t_="http://www.w3.org/2000/xmlns/",e_=ib.xmlns;function n_(t){ox.call(this,t),this._dirtyID=0,this._dirty=[],this._svg=null,this._root=null,this._defs=null}const r_=ox.prototype;function i_(t,e){for(;t&&t.dirty!==e;t=t.mark.group){if(t.dirty=e,!t.mark||t.mark.dirty===e)return;t.mark.dirty=e}}function o_(t,e,n){let r,i,o;if("radial"===e.gradient){let r=Qb(t,n++,"pattern",e_);d_(r,{id:qm+e.id,viewBox:"0,0,1,1",width:"100%",height:"100%",preserveAspectRatio:"xMidYMid slice"}),r=Qb(r,0,"rect",e_),d_(r,{width:1,height:1,fill:`url(${g_()}#${e.id})`}),d_(t=Qb(t,n++,"radialGradient",e_),{id:e.id,fx:e.x1,fy:e.y1,fr:e.r1,cx:e.x2,cy:e.y2,r:e.r2})}else d_(t=Qb(t,n++,"linearGradient",e_),{id:e.id,x1:e.x1,x2:e.x2,y1:e.y1,y2:e.y2});for(r=0,i=e.stops.length;r<i;++r)o=Qb(t,r,"stop",e_),o.setAttribute("offset",e.stops[r].offset),o.setAttribute("stop-color",e.stops[r].color);return tx(t,r),n}function a_(t,e,n){let r;return(t=Qb(t,n,"clipPath",e_)).setAttribute("id",e.id),e.path?(r=Qb(t,0,"path",e_),r.setAttribute("d",e.path)):(r=Qb(t,0,"rect",e_),d_(r,{x:0,y:0,width:e.width,height:e.height})),tx(t,1),n+1}function s_(t,e,n,r,i){let o,a=t._svg;if(!a&&(o=e.ownerDocument,a=Zb(o,r,e_),t._svg=a,t.mark&&(a.__data__=t,a.__values__={fill:"default"},"g"===r))){const e=Zb(o,"path",e_);a.appendChild(e),e.__data__=t;const n=Zb(o,"g",e_);a.appendChild(n),n.__data__=t;const r=Zb(o,"path",e_);a.appendChild(r),r.__data__=t,r.__values__={fill:"default"}}return(a.ownerSVGElement!==i||function(t,e){return t.parentNode&&t.parentNode.childNodes.length>1&&t.previousSibling!=e}(a,n))&&e.insertBefore(a,n?n.nextSibling:e.firstChild),a}(0,Kt.XW)(n_,ox,{initialize(t,e,n,r,i){return this._defs={},this._clearDefs(),t&&(this._svg=Qb(t,0,"svg",e_),this._svg.setAttributeNS(t_,"xmlns",e_),this._svg.setAttributeNS(t_,"xmlns:xlink",ib["xmlns:xlink"]),this._svg.setAttribute("version",ib.version),this._svg.setAttribute("class","marks"),tx(t,1),this._root=Qb(this._svg,0,"g",e_),d_(this._root,Qx),tx(this._svg,1)),this.background(this._bgcolor),r_.initialize.call(this,t,e,n,r,i)},background(t){return arguments.length&&this._svg&&this._svg.style.setProperty("background-color",t),r_.background.apply(this,arguments)},resize(t,e,n,r){return r_.resize.call(this,t,e,n,r),this._svg&&(d_(this._svg,{width:this._width*this._scale,height:this._height*this._scale,viewBox:`0 0 ${this._width} ${this._height}`}),this._root.setAttribute("transform",`translate(${this._origin})`)),this._dirty=[],this},canvas(){return this._svg},svg(){const t=this._svg,e=this._bgcolor;if(!t)return null;let n;e&&(t.removeAttribute("style"),n=Qb(t,0,"rect",e_),d_(n,{width:this._width,height:this._height,fill:e}));const r=Vx(t);return e&&(t.removeChild(n),this._svg.style.setProperty("background-color",e)),r},_render(t){return this._dirtyCheck()&&(this._dirtyAll&&this._clearDefs(),this.mark(this._root,t),tx(this._root,1)),this.defs(),this._dirty=[],++this._dirtyID,this},dirty(t){t.dirty!==this._dirtyID&&(t.dirty=this._dirtyID,this._dirty.push(t))},isDirty(t){return this._dirtyAll||!t._svg||!t._svg.ownerSVGElement||t.dirty===this._dirtyID},_dirtyCheck(){this._dirtyAll=!0;const t=this._dirty;if(!t.length||!this._dirtyID)return!0;const e=++this._dirtyID;let n,r,i,o,a,s,u;for(a=0,s=t.length;a<s;++a)n=t[a],r=n.mark,r.marktype!==i&&(i=r.marktype,o=jb[i]),r.zdirty&&r.dirty!==e&&(this._dirtyAll=!1,i_(n,e),r.items.forEach((t=>{t.dirty=e}))),r.zdirty||(n.exit?(o.nested&&r.items.length?(u=r.items[0],u._svg&&this._update(o,u._svg,u)):n._svg&&(u=n._svg.parentNode,u&&u.removeChild(n._svg)),n._svg=null):(n=o.nested?r.items[0]:n,n._update!==e&&(n._svg&&n._svg.ownerSVGElement?this._update(o,n._svg,n):(this._dirtyAll=!1,i_(n,e)),n._update=e)));return!this._dirtyAll},mark(t,e,n){if(!this.isDirty(e))return e._svg;const r=this._svg,i=jb[e.marktype],o=!1===e.interactive?"none":null,a="g"===i.tag,s=s_(e,t,n,"g",r);s.setAttribute("class",ex(e));const u=qx(e);for(const h in u)p_(s,h,u[h]);a||p_(s,"pointer-events",o),p_(s,"clip-path",e.clip?qy(this,e,e.group):null);let l=null,c=0;const f=t=>{const e=this.isDirty(t),n=s_(t,s,l,i.tag,r);e&&(this._update(i,n,t),a&&function(t,e,n){e=e.lastChild.previousSibling;let r,i=0;Ov(n,(n=>{r=t.mark(e,n,r),++i})),tx(e,1+i)}(this,n,t)),l=n,++c};return i.nested?e.items.length&&f(e.items[0]):Ov(e,f),tx(s,c),s},_update(t,e,n){u_=e,l_=e.__values__,Ix(f_,n),t.attr(f_,n,this);const r=c_[t.type];r&&r.call(this,t,e,n),u_&&this.style(u_,n)},style(t,e){if(null!=e){for(const n in Zx){let r="font"===n?Tb(e):e[n];if(r===l_[n])continue;const i=Zx[n];null==r?t.removeAttribute(i):(Wm(r)&&(r=Hm(r,this._defs.gradient,g_())),t.setAttribute(i,r+"")),l_[n]=r}for(const n in Kx)h_(t,Kx[n],e[n])}},defs(){const t=this._svg,e=this._defs;let n=e.el,r=0;for(const i in e.gradient)n||(e.el=n=Qb(t,1,"defs",e_)),r=o_(n,e.gradient[i],r);for(const i in e.clipping)n||(e.el=n=Qb(t,1,"defs",e_)),r=a_(n,e.clipping[i],r);n&&(0===r?(t.removeChild(n),e.el=null):tx(n,r))},_clearDefs(){const t=this._defs;t.gradient={},t.clipping={}}});let u_=null,l_=null;const c_={group(t,e,n){const r=u_=e.childNodes[2];l_=r.__values__,t.foreground(f_,n,this),l_=e.__values__,u_=e.childNodes[1],t.content(f_,n,this);const i=u_=e.childNodes[0];t.background(f_,n,this);const o=!1===n.mark.interactive?"none":null;if(o!==l_.events&&(p_(r,"pointer-events",o),p_(i,"pointer-events",o),l_.events=o),n.strokeForeground&&n.stroke){const t=n.fill;p_(r,"display",null),this.style(i,n),p_(i,"stroke",null),t&&(n.fill=null),l_=r.__values__,this.style(r,n),t&&(n.fill=t),u_=null}else p_(r,"display","none")},image(t,e,n){!1===n.smooth?(h_(e,"image-rendering","optimizeSpeed"),h_(e,"image-rendering","pixelated")):h_(e,"image-rendering",null)},text(t,e,n){const r=Mb(n);let i,o,a,s;(0,Kt.kJ)(r)?(o=r.map((t=>$b(n,t))),i=o.join("\n"),i!==l_.text&&(tx(e,0),a=e.ownerDocument,s=kb(n),o.forEach(((t,r)=>{const i=Zb(a,"tspan",e_);i.__data__=n,i.textContent=t,r&&(i.setAttribute("x",0),i.setAttribute("dy",s)),e.appendChild(i)})),l_.text=i)):(o=$b(n,r),o!==l_.text&&(e.textContent=o,l_.text=o)),p_(e,"font-family",Tb(n)),p_(e,"font-size",Cb(n)+"px"),p_(e,"font-style",n.fontStyle),p_(e,"font-variant",n.fontVariant),p_(e,"font-weight",n.fontWeight)}};function f_(t,e,n){e!==l_[t]&&(n?function(t,e,n,r){null!=n?t.setAttributeNS(r,e,n):t.removeAttributeNS(r,e)}(u_,t,e,n):p_(u_,t,e),l_[t]=e)}function h_(t,e,n){n!==l_[e]&&(null==n?t.style.removeProperty(e):t.style.setProperty(e,n+""),l_[e]=n)}function d_(t,e){for(const n in e)p_(t,n,e[n])}function p_(t,e,n){null!=n?t.setAttribute(e,n):t.removeAttribute(e)}function g_(){let t;return"undefined"===typeof window?"":(t=window.location).hash?t.href.slice(0,-t.hash.length):t.href}function m_(t){ox.call(this,t),this._text=null,this._defs={gradient:{},clipping:{}}}(0,Kt.XW)(m_,ox,{svg(){return this._text},_render(t){const e=Gx();e.open("svg",(0,Kt.l7)({},ib,{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&&e.open("rect",{width:this._width,height:this._height,fill:n}).close(),e.open("g",Qx,{transform:"translate("+this._origin+")"}),this.mark(e,t),e.close(),this.defs(e),this._text=e.close()+"",this},mark(t,e){const n=jb[e.marktype],r=n.tag,i=[Ix,n.attr];t.open("g",{class:ex(e),"clip-path":e.clip?qy(this,e,e.group):null},qx(e),{"pointer-events":"g"!==r&&!1===e.interactive?"none":null});const o=o=>{const a=this.href(o);if(a&&t.open("a",a),t.open(r,this.attr(e,o,i,"g"!==r?r:null)),"text"===r){const e=Mb(o);if((0,Kt.kJ)(e)){const n={x:0,dy:kb(o)};for(let r=0;r<e.length;++r)t.open("tspan",r?n:null).text($b(o,e[r])).close()}else t.text($b(o,e))}else if("g"===r){const r=o.strokeForeground,i=o.fill,a=o.stroke;r&&a&&(o.stroke=null),t.open("path",this.attr(e,o,n.background,"bgrect")).close(),t.open("g",this.attr(e,o,n.content)),Ov(o,(e=>this.mark(t,e))),t.close(),r&&a?(i&&(o.fill=null),o.stroke=a,t.open("path",this.attr(e,o,n.foreground,"bgrect")).close(),i&&(o.fill=i)):t.open("path",this.attr(e,o,n.foreground,"bgfore")).close()}t.close(),a&&t.close()};return n.nested?e.items&&e.items.length&&o(e.items[0]):Ov(e,o),t.close()},href(t){const e=t.href;let n;if(e){if(n=this._hrefs&&this._hrefs[e])return n;this.sanitizeURL(e).then((t=>{t["xlink:href"]=t.href,t.href=null,(this._hrefs||(this._hrefs={}))[e]=t}))}return null},attr(t,e,n,r){const i={},o=(t,e,n,r)=>{i[r||t]=e};return Array.isArray(n)?n.forEach((t=>t(o,e,this))):n(o,e,this),r&&function(t,e,n,r,i){let o;if(null==e)return t;"bgrect"===r&&!1===n.interactive&&(t["pointer-events"]="none");if("bgfore"===r&&(!1===n.interactive&&(t["pointer-events"]="none"),t.display="none",null!==e.fill))return t;"image"===r&&!1===e.smooth&&(o=["image-rendering: optimizeSpeed;","image-rendering: pixelated;"]);"text"===r&&(t["font-family"]=Tb(e),t["font-size"]=Cb(e)+"px",t["font-style"]=e.fontStyle,t["font-variant"]=e.fontVariant,t["font-weight"]=e.fontWeight);for(const a in Zx){let n=e[a];const r=Zx[a];("transparent"!==n||"fill"!==r&&"stroke"!==r)&&null!=n&&(Wm(n)&&(n=Hm(n,i.gradient,"")),t[r]=n)}for(const a in Kx){const t=e[a];null!=t&&(o=o||[],o.push(`${Kx[a]}: ${t};`))}o&&(t.style=o.join(" "))}(i,e,t,r,this._defs),i},defs(t){const e=this._defs.gradient,n=this._defs.clipping;if(0!==Object.keys(e).length+Object.keys(n).length){t.open("defs");for(const n in e){const r=e[n],i=r.stops;"radial"===r.gradient?(t.open("pattern",{id:qm+n,viewBox:"0,0,1,1",width:"100%",height:"100%",preserveAspectRatio:"xMidYMid slice"}),t.open("rect",{width:"1",height:"1",fill:"url(#"+n+")"}).close(),t.close(),t.open("radialGradient",{id:n,fx:r.x1,fy:r.y1,fr:r.r1,cx:r.x2,cy:r.y2,r:r.r2})):t.open("linearGradient",{id:n,x1:r.x1,x2:r.x2,y1:r.y1,y2:r.y2});for(let e=0;e<i.length;++e)t.open("stop",{offset:i[e].offset,"stop-color":i[e].color}).close();t.close()}for(const e in n){const r=n[e];t.open("clipPath",{id:e}),r.path?t.open("path",{d:r.path}).close():t.open("rect",{x:0,y:0,width:r.width,height:r.height}).close(),t.close()}t.close()}}});const y_="canvas",v_="none",b_={Canvas:y_,PNG:"png",SVG:"svg",None:v_},x_={};function __(t,e){return t=String(t||"").toLowerCase(),arguments.length>1?(x_[t]=e,this):x_[t]}function w_(t,e,n){const r=[],i=(new Wy).union(e),o=t.marktype;return o?A_(t,i,n,r):"group"===o?D_(t,i,n,r):(0,Kt.vU)("Intersect scene must be mark node or group item.")}function A_(t,e,n,r){if(function(t,e,n){return t.bounds&&e.intersects(t.bounds)&&("group"===t.marktype||!1!==t.interactive&&(!n||n(t)))}(t,e,n)){const i=t.items,o=t.marktype,a=i.length;let s=0;if("group"===o)for(;s<a;++s)D_(i[s],e,n,r);else for(const t=jb[o].isect;s<a;++s){const n=i[s];E_(n,e,t)&&r.push(n)}}return r}function D_(t,e,n,r){n&&n(t.mark)&&E_(t,e,jb.group.isect)&&r.push(t);const i=t.items,o=i&&i.length;if(o){const a=t.x||0,s=t.y||0;e.translate(-a,-s);for(let t=0;t<o;++t)A_(i[t],e,n,r);e.translate(a,s)}return r}function E_(t,e,n){const r=t.bounds;return e.encloses(r)||e.intersects(r)&&n(t,e)}x_[y_]=x_.png={renderer:kx,headless:kx,handler:wx},x_.svg={renderer:n_,headless:m_,handler:Sx},x_[v_]={};const F_=new Wy;function C_(t){const e=t.clip;if((0,Kt.mf)(e))e(pv(F_.clear()));else{if(!e)return;F_.set(0,0,t.group.width,t.group.height)}t.bounds.intersect(F_)}const k_=1e-9;function M_(t,e,n){return t===e||("path"===n?S_(t,e):t instanceof Date&&e instanceof Date?+t===+e:(0,Kt.hj)(t)&&(0,Kt.hj)(e)?Math.abs(t-e)<=k_:t&&e&&((0,Kt.Kn)(t)||(0,Kt.Kn)(e))?function(t,e){var n,r,i=Object.keys(t),o=Object.keys(e);if(i.length!==o.length)return!1;for(i.sort(),o.sort(),r=i.length-1;r>=0;r--)if(i[r]!=o[r])return!1;for(r=i.length-1;r>=0;r--)if(!M_(t[n=i[r]],e[n],n))return!1;return typeof t===typeof e}(t,e):t==e)}function S_(t,e){return M_(ey(t),ey(e))}function $_(){Iy(),Im=0}const T_="top",B_="left",N_="right",O_="bottom",z_="top-left",R_="top-right",P_="bottom-left",U_="bottom-right",L_="start",j_="middle",I_="end",q_="x",W_="y",H_="group",X_="axis",Y_="title",G_="frame",V_="scope",J_="legend",Z_="row-header",K_="row-footer",Q_="row-title",tw="column-header",ew="column-footer",nw="column-title",rw="padding",iw="symbol",ow="fit",aw="fit-x",sw="fit-y",uw="pad",lw="none",cw="all",fw="each",hw="flush",dw="column",pw="row";function gw(t){cs.call(this,null,t)}function mw(t,e,n){return e(t.bounds.clear(),t,n)}(0,Kt.XW)(gw,cs,{transform(t,e){const n=e.dataflow,r=t.mark,i=r.marktype,o=jb[i],a=o.bound;let s,u=r.bounds;if(o.nested)r.items.length&&n.dirty(r.items[0]),u=mw(r,a),r.items.forEach((t=>{t.bounds.clear().union(u)}));else if(i===H_||t.modified())switch(e.visit(e.MOD,(t=>n.dirty(t))),u.clear(),r.items.forEach((t=>u.union(mw(t,a)))),r.role){case X_:case J_:case Y_:e.reflow()}else s=e.changed(e.REM),e.visit(e.ADD,(t=>{u.union(mw(t,a))})),e.visit(e.MOD,(t=>{s=s||u.alignsWith(t.bounds),n.dirty(t),u.union(mw(t,a))})),s&&(u.clear(),r.items.forEach((t=>u.union(t.bounds))));return C_(r),e.modifies("bounds")}});const yw=":vega_identifier:";function vw(t){cs.call(this,0,t)}function bw(t){cs.call(this,null,t)}function xw(t){cs.call(this,null,t)}vw.Definition={type:"Identifier",metadata:{modifies:!0},params:[{name:"as",type:"string",required:!0}]},(0,Kt.XW)(vw,cs,{transform(t,e){const n=(i=e.dataflow)._signals[yw]||(i._signals[yw]=i.add(0)),r=t.as;var i;let o=n.value;return e.visit(e.ADD,(t=>t[r]=t[r]||++o)),n.set(this.value=o),e}}),(0,Kt.XW)(bw,cs,{transform(t,e){let n=this.value;n||(n=e.dataflow.scenegraph().mark(t.markdef,function(t){const e=t.groups,n=t.parent;return e&&1===e.size?e.get(Object.keys(e.object)[0]):e&&n?e.lookup(n):null}(t),t.index),n.group.context=t.context,t.context.group||(t.context.group=n.group),n.source=this.source,n.clip=t.clip,n.interactive=t.interactive,this.value=n);const r=n.marktype===H_?Xy:Hy;return e.visit(e.ADD,(t=>r.call(t,n))),(t.modified("clip")||t.modified("interactive"))&&(n.clip=t.clip,n.interactive=!!t.interactive,n.zdirty=!0,e.reflow()),n.items=e.source,e}});const _w={parity:t=>t.filter(((t,e)=>e%2?t.opacity=0:1)),greedy:(t,e)=>{let n;return t.filter(((t,r)=>r&&ww(n.bounds,t.bounds,e)?t.opacity=0:(n=t,1)))}},ww=(t,e,n)=>n>Math.max(e.x1-t.x2,t.x1-e.x2,e.y1-t.y2,t.y1-e.y2),Aw=(t,e)=>{for(var n,r=1,i=t.length,o=t[0].bounds;r<i;o=n,++r)if(ww(o,n=t[r].bounds,e))return!0},Dw=t=>{const e=t.bounds;return e.width()>1&&e.height()>1},Ew=t=>(t.forEach((t=>t.opacity=1)),t),Fw=(t,e)=>t.reflow(e.modified()).modifies("opacity");function Cw(t){cs.call(this,null,t)}(0,Kt.XW)(xw,cs,{transform(t,e){const n=_w[t.method]||_w.parity,r=t.separation||0;let i,o,a=e.materialize(e.SOURCE).source;if(!a||!a.length)return;if(!t.method)return t.modified("method")&&(Ew(a),e=Fw(e,t)),e;if(a=a.filter(Dw),!a.length)return;if(t.sort&&(a=a.slice().sort(t.sort)),i=Ew(a),e=Fw(e,t),i.length>=3&&Aw(i,r)){do{i=n(i,r)}while(i.length>=3&&Aw(i,r));i.length<3&&!(0,Kt.fj)(a).opacity&&(i.length>1&&((0,Kt.fj)(i).opacity=0),(0,Kt.fj)(a).opacity=1)}t.boundScale&&t.boundTolerance>=0&&(o=((t,e,n)=>{var r=t.range(),i=new Wy;return e===T_||e===O_?i.set(r[0],-1/0,r[1],1/0):i.set(-1/0,r[0],1/0,r[1]),i.expand(n||1),t=>i.encloses(t.bounds)})(t.boundScale,t.boundOrient,+t.boundTolerance),a.forEach((t=>{o(t)||(t.opacity=0)})));const s=i[0].mark.bounds.clear();return a.forEach((t=>{t.opacity&&s.union(t.bounds)})),e}}),(0,Kt.XW)(Cw,cs,{transform(t,e){const n=e.dataflow;if(e.visit(e.ALL,(t=>n.dirty(t))),e.fields&&e.fields.zindex){const t=e.source&&e.source[0];t&&(t.mark.zdirty=!0)}}});const kw=new Wy;function Mw(t,e,n){return t[e]===n?0:(t[e]=n,1)}function Sw(t){var e=t.items[0].orient;return e===B_||e===N_}function $w(t,e,n,r){var i,o,a=e.items[0],s=a.datum,u=null!=a.translate?a.translate:.5,l=a.orient,c=function(t){let e=+t.grid;return[t.ticks?e++:-1,t.labels?e++:-1,e+ +t.domain]}(s),f=a.range,h=a.offset,d=a.position,p=a.minExtent,g=a.maxExtent,m=s.title&&a.items[c[2]].items[0],y=a.titlePadding,v=a.bounds,b=m&&Sb(m),x=0,_=0;switch(kw.clear().union(v),v.clear(),(i=c[0])>-1&&v.union(a.items[i].bounds),(i=c[1])>-1&&v.union(a.items[i].bounds),l){case T_:x=d||0,_=-h,o=Math.max(p,Math.min(g,-v.y1)),v.add(0,-o).add(f,0),m&&Tw(t,m,o,y,b,0,-1,v);break;case B_:x=-h,_=d||0,o=Math.max(p,Math.min(g,-v.x1)),v.add(-o,0).add(0,f),m&&Tw(t,m,o,y,b,1,-1,v);break;case N_:x=n+h,_=d||0,o=Math.max(p,Math.min(g,v.x2)),v.add(0,0).add(o,f),m&&Tw(t,m,o,y,b,1,1,v);break;case O_:x=d||0,_=r+h,o=Math.max(p,Math.min(g,v.y2)),v.add(0,0).add(f,o),m&&Tw(t,m,o,y,0,0,1,v);break;default:x=a.x,_=a.y}return Jy(v.translate(x,_),a),Mw(a,"x",x+u)|Mw(a,"y",_+u)&&(a.bounds=kw,t.dirty(a),a.bounds=v,t.dirty(a)),a.mark.bounds.clear().union(v)}function Tw(t,e,n,r,i,o,a,s){const u=e.bounds;if(e.auto){const s=a*(n+i+r);let l=0,c=0;t.dirty(e),o?l=(e.x||0)-(e.x=s):c=(e.y||0)-(e.y=s),e.mark.bounds.clear().union(u.translate(-l,-c)),t.dirty(e)}s.union(u)}const Bw=(t,e)=>Math.floor(Math.min(t,e)),Nw=(t,e)=>Math.ceil(Math.max(t,e));function Ow(t){return(new Wy).set(0,0,t.width||0,t.height||0)}function zw(t){const e=t.bounds.clone();return e.empty()?e.set(0,0,0,0):e.translate(-(t.x||0),-(t.y||0))}function Rw(t,e,n){const r=(0,Kt.Kn)(t)?t[e]:t;return null!=r?r:void 0!==n?n:0}function Pw(t){return t<0?Math.ceil(-t):0}function Uw(t,e,n){var r,i,o,a,s,u,l,c,f,h,d,p=!n.nodirty,g=n.bounds===hw?Ow:zw,m=kw.set(0,0,0,0),y=Rw(n.align,dw),v=Rw(n.align,pw),b=Rw(n.padding,dw),x=Rw(n.padding,pw),_=n.columns||e.length,w=_<=0?1:Math.ceil(e.length/_),A=e.length,D=Array(A),E=Array(_),F=0,C=Array(A),k=Array(w),M=0,S=Array(A),$=Array(A),T=Array(A);for(i=0;i<_;++i)E[i]=0;for(i=0;i<w;++i)k[i]=0;for(i=0;i<A;++i)u=e[i],s=T[i]=g(u),u.x=u.x||0,S[i]=0,u.y=u.y||0,$[i]=0,o=i%_,a=~~(i/_),F=Math.max(F,l=Math.ceil(s.x2)),M=Math.max(M,c=Math.ceil(s.y2)),E[o]=Math.max(E[o],l),k[a]=Math.max(k[a],c),D[i]=b+Pw(s.x1),C[i]=x+Pw(s.y1),p&&t.dirty(e[i]);for(i=0;i<A;++i)i%_===0&&(D[i]=0),i<_&&(C[i]=0);if(y===fw)for(o=1;o<_;++o){for(d=0,i=o;i<A;i+=_)d<D[i]&&(d=D[i]);for(i=o;i<A;i+=_)D[i]=d+E[o-1]}else if(y===cw){for(d=0,i=0;i<A;++i)i%_&&d<D[i]&&(d=D[i]);for(i=0;i<A;++i)i%_&&(D[i]=d+F)}else for(y=!1,o=1;o<_;++o)for(i=o;i<A;i+=_)D[i]+=E[o-1];if(v===fw)for(a=1;a<w;++a){for(d=0,r=(i=a*_)+_;i<r;++i)d<C[i]&&(d=C[i]);for(i=a*_;i<r;++i)C[i]=d+k[a-1]}else if(v===cw){for(d=0,i=_;i<A;++i)d<C[i]&&(d=C[i]);for(i=_;i<A;++i)C[i]=d+M}else for(v=!1,a=1;a<w;++a)for(r=(i=a*_)+_;i<r;++i)C[i]+=k[a-1];for(f=0,i=0;i<A;++i)f=D[i]+(i%_?f:0),S[i]+=f-e[i].x;for(o=0;o<_;++o)for(h=0,i=o;i<A;i+=_)h+=C[i],$[i]+=h-e[i].y;if(y&&Rw(n.center,dw)&&w>1)for(i=0;i<A;++i)(f=(s=y===cw?F:E[i%_])-T[i].x2-e[i].x-S[i])>0&&(S[i]+=f/2);if(v&&Rw(n.center,pw)&&1!==_)for(i=0;i<A;++i)(h=(s=v===cw?M:k[~~(i/_)])-T[i].y2-e[i].y-$[i])>0&&($[i]+=h/2);for(i=0;i<A;++i)m.union(T[i].translate(S[i],$[i]));switch(f=Rw(n.anchor,q_),h=Rw(n.anchor,W_),Rw(n.anchor,dw)){case I_:f-=m.width();break;case j_:f-=m.width()/2}switch(Rw(n.anchor,pw)){case I_:h-=m.height();break;case j_:h-=m.height()/2}for(f=Math.round(f),h=Math.round(h),m.clear(),i=0;i<A;++i)e[i].mark.bounds.clear();for(i=0;i<A;++i)(u=e[i]).x+=S[i]+=f,u.y+=$[i]+=h,m.union(u.mark.bounds.union(u.bounds.translate(S[i],$[i]))),p&&t.dirty(u);return m}function Lw(t,e,n){var r,i,o,a,s,u,l,c=function(t){var e,n,r=t.items,i=r.length,o=0;const a={marks:[],rowheaders:[],rowfooters:[],colheaders:[],colfooters:[],rowtitle:null,coltitle:null};for(;o<i;++o)if(n=(e=r[o]).items,e.marktype===H_)switch(e.role){case X_:case J_:case Y_:break;case Z_:a.rowheaders.push(...n);break;case K_:a.rowfooters.push(...n);break;case tw:a.colheaders.push(...n);break;case ew:a.colfooters.push(...n);break;case Q_:a.rowtitle=n[0];break;case nw:a.coltitle=n[0];break;default:a.marks.push(...n)}return a}(e),f=c.marks,h=n.bounds===hw?jw:Iw,d=n.offset,p=n.columns||f.length,g=p<=0?1:Math.ceil(f.length/p),m=g*p;const y=Uw(t,f,n);y.empty()&&y.set(0,0,0,0),c.rowheaders&&(u=Rw(n.headerBand,pw,null),r=qw(t,c.rowheaders,f,p,g,-Rw(d,"rowHeader"),Bw,0,h,"x1",0,p,1,u)),c.colheaders&&(u=Rw(n.headerBand,dw,null),i=qw(t,c.colheaders,f,p,p,-Rw(d,"columnHeader"),Bw,1,h,"y1",0,1,p,u)),c.rowfooters&&(u=Rw(n.footerBand,pw,null),o=qw(t,c.rowfooters,f,p,g,Rw(d,"rowFooter"),Nw,0,h,"x2",p-1,p,1,u)),c.colfooters&&(u=Rw(n.footerBand,dw,null),a=qw(t,c.colfooters,f,p,p,Rw(d,"columnFooter"),Nw,1,h,"y2",m-p,1,p,u)),c.rowtitle&&(s=Rw(n.titleAnchor,pw),l=Rw(d,"rowTitle"),l=s===I_?o+l:r-l,u=Rw(n.titleBand,pw,.5),Ww(t,c.rowtitle,l,0,y,u)),c.coltitle&&(s=Rw(n.titleAnchor,dw),l=Rw(d,"columnTitle"),l=s===I_?a+l:i-l,u=Rw(n.titleBand,dw,.5),Ww(t,c.coltitle,l,1,y,u))}function jw(t,e){return"x1"===e?t.x||0:"y1"===e?t.y||0:"x2"===e?(t.x||0)+(t.width||0):"y2"===e?(t.y||0)+(t.height||0):void 0}function Iw(t,e){return t.bounds[e]}function qw(t,e,n,r,i,o,a,s,u,l,c,f,h,d){var p,g,m,y,v,b,x,_,w,A=n.length,D=0,E=0;if(!A)return D;for(p=c;p<A;p+=f)n[p]&&(D=a(D,u(n[p],l)));if(!e.length)return D;for(e.length>i&&(t.warn("Grid headers exceed limit: "+i),e=e.slice(0,i)),D+=o,g=0,y=e.length;g<y;++g)t.dirty(e[g]),e[g].mark.bounds.clear();for(p=c,g=0,y=e.length;g<y;++g,p+=f){for(v=(b=e[g]).mark.bounds,m=p;m>=0&&null==(x=n[m]);m-=h);s?(_=null==d?x.x:Math.round(x.bounds.x1+d*x.bounds.width()),w=D):(_=D,w=null==d?x.y:Math.round(x.bounds.y1+d*x.bounds.height())),v.union(b.bounds.translate(_-(b.x||0),w-(b.y||0))),b.x=_,b.y=w,t.dirty(b),E=a(E,v[l])}return E}function Ww(t,e,n,r,i,o){if(e){t.dirty(e);var a=n,s=n;r?a=Math.round(i.x1+o*i.width()):s=Math.round(i.y1+o*i.height()),e.bounds.translate(a-(e.x||0),s-(e.y||0)),e.mark.bounds.clear().union(e.bounds),e.x=a,e.y=s,t.dirty(e)}}function Hw(t,e,n,r,i,o,a){const s=function(t,e){const n=t[e]||{};return(e,r)=>null!=n[e]?n[e]:null!=t[e]?t[e]:r}(n,e),u=function(t,e){let n=-1/0;return t.forEach((t=>{null!=t.offset&&(n=Math.max(n,t.offset))})),n>-1/0?n:e}(t,s("offset",0)),l=s("anchor",L_),c=l===I_?1:l===j_?.5:0,f={align:fw,bounds:s("bounds",hw),columns:"vertical"===s("direction")?1:t.length,padding:s("margin",8),center:s("center"),nodirty:!0};switch(e){case B_:f.anchor={x:Math.floor(r.x1)-u,column:I_,y:c*(a||r.height()+2*r.y1),row:l};break;case N_:f.anchor={x:Math.ceil(r.x2)+u,y:c*(a||r.height()+2*r.y1),row:l};break;case T_:f.anchor={y:Math.floor(i.y1)-u,row:I_,x:c*(o||i.width()+2*i.x1),column:l};break;case O_:f.anchor={y:Math.ceil(i.y2)+u,x:c*(o||i.width()+2*i.x1),column:l};break;case z_:f.anchor={x:u,y:u};break;case R_:f.anchor={x:o-u,y:u,column:I_};break;case P_:f.anchor={x:u,y:a-u,row:I_};break;case U_:f.anchor={x:o-u,y:a-u,column:I_,row:I_}}return f}function Xw(t,e){var n,r,i=e.items[0],o=i.datum,a=i.orient,s=i.bounds,u=i.x,l=i.y;return i._bounds?i._bounds.clear().union(s):i._bounds=s.clone(),s.clear(),function(t,e,n){var r=e.padding,i=r-n.x,o=r-n.y;if(e.datum.title){var a=e.items[1].items[0],s=a.anchor,u=e.titlePadding||0,l=r-a.x,c=r-a.y;switch(a.orient){case B_:i+=Math.ceil(a.bounds.width())+u;break;case N_:case O_:break;default:o+=a.bounds.height()+u}switch((i||o)&&Gw(t,n,i,o),a.orient){case B_:c+=Yw(e,n,a,s,1,1);break;case N_:l+=Yw(e,n,a,I_,0,0)+u,c+=Yw(e,n,a,s,1,1);break;case O_:l+=Yw(e,n,a,s,0,0),c+=Yw(e,n,a,I_,-1,0,1)+u;break;default:l+=Yw(e,n,a,s,0,0)}(l||c)&&Gw(t,a,l,c),(l=Math.round(a.bounds.x1-r))<0&&(Gw(t,n,-l,0),Gw(t,a,-l,0))}else(i||o)&&Gw(t,n,i,o)}(t,i,i.items[0].items[0]),s=function(t,e){return t.items.forEach((t=>e.union(t.bounds))),e.x1=t.padding,e.y1=t.padding,e}(i,s),n=2*i.padding,r=2*i.padding,s.empty()||(n=Math.ceil(s.width()+n),r=Math.ceil(s.height()+r)),o.type===iw&&function(t){const e=t.reduce(((t,e)=>(t[e.column]=Math.max(e.bounds.x2-e.x,t[e.column]||0),t)),{});t.forEach((t=>{t.width=e[t.column],t.height=t.bounds.y2-t.y}))}(i.items[0].items[0].items[0].items),a!==lw&&(i.x=u=0,i.y=l=0),i.width=n,i.height=r,Jy(s.set(u,l,u+n,l+r),i),i.mark.bounds.clear().union(s),i}function Yw(t,e,n,r,i,o,a){const s="symbol"!==t.datum.type,u=n.datum.vgrad,l=(!s||!o&&u||a?e:e.items[0]).bounds[i?"y2":"x2"]-t.padding,c=u&&o?l:0,f=u&&o?0:l,h=i<=0?0:Sb(n);return Math.round(r===L_?c:r===I_?f-h:.5*(l-h))}function Gw(t,e,n,r){e.x+=n,e.y+=r,e.bounds.translate(n,r),e.mark.bounds.translate(n,r),t.dirty(e)}function Vw(t){cs.call(this,null,t)}function Jw(t,e){let n=0;if(void 0===e)for(let r of t)(r=+r)&&(n+=r);else{let r=-1;for(let i of t)(i=+e(i,++r,t))&&(n+=i)}return n}function Zw(t){cs.call(this,null,t)}function Kw(t){cs.call(this,null,t)}function Qw(){return Ba({})}function tA(t){cs.call(this,null,t)}function eA(t){cs.call(this,[],t)}(0,Kt.XW)(Vw,cs,{transform(t,e){const n=e.dataflow;return t.mark.items.forEach((e=>{t.layout&&Lw(n,e,t.layout),function(t,e,n){var r,i,o,a,s,u=e.items,l=Math.max(0,e.width||0),c=Math.max(0,e.height||0),f=(new Wy).set(0,0,l,c),h=f.clone(),d=f.clone(),p=[];for(a=0,s=u.length;a<s;++a)switch((i=u[a]).role){case X_:(Sw(i)?h:d).union($w(t,i,l,c));break;case Y_:r=i;break;case J_:p.push(Xw(t,i));break;case G_:case V_:case Z_:case K_:case Q_:case tw:case ew:case nw:h.union(i.bounds),d.union(i.bounds);break;default:f.union(i.bounds)}if(p.length){const e={};p.forEach((t=>{(o=t.orient||N_)!==lw&&(e[o]||(e[o]=[])).push(t)}));for(const r in e){const i=e[r];Uw(t,i,Hw(i,r,n.legends,h,d,l,c))}p.forEach((e=>{const r=e.bounds;if(r.equals(e._bounds)||(e.bounds=e._bounds,t.dirty(e),e.bounds=r,t.dirty(e)),!n.autosize||n.autosize.type!==ow&&n.autosize.type!==aw&&n.autosize.type!==sw)f.union(r);else switch(e.orient){case B_:case N_:f.add(r.x1,0).add(r.x2,0);break;case T_:case O_:f.add(0,r.y1).add(0,r.y2)}}))}f.union(h).union(d),r&&f.union(function(t,e,n,r,i){var o,a=e.items[0],s=a.frame,u=a.orient,l=a.anchor,c=a.offset,f=a.padding,h=a.items[0].items[0],d=a.items[1]&&a.items[1].items[0],p=u===B_||u===N_?r:n,g=0,m=0,y=0,v=0,b=0;if(s!==H_?u===B_?(g=i.y2,p=i.y1):u===N_?(g=i.y1,p=i.y2):(g=i.x1,p=i.x2):u===B_&&(g=r,p=0),o=l===L_?g:l===I_?p:(g+p)/2,d&&d.text){switch(u){case T_:case O_:b=h.bounds.height()+f;break;case B_:v=h.bounds.width()+f;break;case N_:v=-h.bounds.width()-f}kw.clear().union(d.bounds),kw.translate(v-(d.x||0),b-(d.y||0)),Mw(d,"x",v)|Mw(d,"y",b)&&(t.dirty(d),d.bounds.clear().union(kw),d.mark.bounds.clear().union(kw),t.dirty(d)),kw.clear().union(d.bounds)}else kw.clear();switch(kw.union(h.bounds),u){case T_:m=o,y=i.y1-kw.height()-c;break;case B_:m=i.x1-kw.width()-c,y=o;break;case N_:m=i.x2+kw.width()+c,y=o;break;case O_:m=o,y=i.y2+c;break;default:m=a.x,y=a.y}return Mw(a,"x",m)|Mw(a,"y",y)&&(kw.translate(m,y),t.dirty(a),a.bounds.clear().union(kw),e.bounds.clear().union(kw),t.dirty(a)),a.bounds}(t,r,l,c,f));e.clip&&f.set(0,0,e.width||0,e.height||0);!function(t,e,n,r){const i=r.autosize||{},o=i.type;if(t._autosize<1||!o)return;let a=t._width,s=t._height,u=Math.max(0,e.width||0),l=Math.max(0,Math.ceil(-n.x1)),c=Math.max(0,e.height||0),f=Math.max(0,Math.ceil(-n.y1));const h=Math.max(0,Math.ceil(n.x2-u)),d=Math.max(0,Math.ceil(n.y2-c));if(i.contains===rw){const e=t.padding();a-=e.left+e.right,s-=e.top+e.bottom}o===lw?(l=0,f=0,u=a,c=s):o===ow?(u=Math.max(0,a-l-h),c=Math.max(0,s-f-d)):o===aw?(u=Math.max(0,a-l-h),s=c+f+d):o===sw?(a=u+l+h,c=Math.max(0,s-f-d)):o===uw&&(a=u+l+h,s=c+f+d);t._resizeView(a,s,u,c,[l,f],i.resize)}(t,e,f,n)}(n,e,t)})),function(t){return t&&"legend-entry"!==t.mark.role}(t.mark.group)?e.reflow():e}}),(0,Kt.XW)(Zw,cs,{transform(t,e){if(this.value&&!t.modified())return e.StopPropagation;var n=e.dataflow.locale(),r=e.fork(e.NO_SOURCE|e.NO_FIELDS),i=this.value,o=t.scale,a=Em(o,null==t.count?t.values?t.values.length:10:t.count,t.minstep),s=t.format||km(n,o,a,t.formatSpecifier,t.formatType,!!t.values),u=t.values?Fm(o,t.values,a):Cm(o,a);return i&&(r.rem=i),i=u.map(((t,e)=>Ba({index:e/(u.length-1||1),value:t,label:s(t)}))),t.extra&&i.length&&i.push(Ba({index:-1,extra:{value:i[0].value},label:""})),r.source=i,r.add=i,this.value=i,r}}),(0,Kt.XW)(Kw,cs,{transform(t,e){var n=e.dataflow,r=e.fork(e.NO_SOURCE|e.NO_FIELDS),i=t.item||Qw,o=t.key||$a,a=this.value;return(0,Kt.kJ)(r.encode)&&(r.encode=null),a&&(t.modified("key")||e.modified(o))&&(0,Kt.vU)("DataJoin does not support modified key function or fields."),a||(e=e.addAll(),this.value=a=function(t){const e=(0,Kt.Xr)().test((t=>t.exit));return e.lookup=n=>e.get(t(n)),e}(o)),e.visit(e.ADD,(t=>{const e=o(t);let n=a.get(e);n?n.exit?(a.empty--,r.add.push(n)):r.mod.push(n):(n=i(t),a.set(e,n),r.add.push(n)),n.datum=t,n.exit=!1})),e.visit(e.MOD,(t=>{const e=o(t),n=a.get(e);n&&(n.datum=t,r.mod.push(n))})),e.visit(e.REM,(t=>{const e=o(t),n=a.get(e);t!==n.datum||n.exit||(r.rem.push(n),n.exit=!0,++a.empty)})),e.changed(e.ADD_MOD)&&r.modifies("datum"),(e.clean()||t.clean&&a.empty>n.cleanThreshold)&&n.runAfter(a.clean),r}}),(0,Kt.XW)(tA,cs,{transform(t,e){var n=e.fork(e.ADD_REM),r=t.mod||!1,i=t.encoders,o=e.encode;if((0,Kt.kJ)(o)){if(!n.changed()&&!o.every((t=>i[t])))return e.StopPropagation;o=o[0],n.encode=null}var a="enter"===o,s=i.update||Kt.k,u=i.enter||Kt.k,l=i.exit||Kt.k,c=(o&&!a?i[o]:s)||Kt.k;if(e.changed(e.ADD)&&(e.visit(e.ADD,(e=>{u(e,t),s(e,t)})),n.modifies(u.output),n.modifies(s.output),c!==Kt.k&&c!==s&&(e.visit(e.ADD,(e=>{c(e,t)})),n.modifies(c.output))),e.changed(e.REM)&&l!==Kt.k&&(e.visit(e.REM,(e=>{l(e,t)})),n.modifies(l.output)),a||c!==Kt.k){const i=e.MOD|(t.modified()?e.REFLOW:0);a?(e.visit(i,(e=>{const i=u(e,t)||r;(c(e,t)||i)&&n.mod.push(e)})),n.mod.length&&n.modifies(u.output)):e.visit(i,(e=>{(c(e,t)||r)&&n.mod.push(e)})),n.mod.length&&n.modifies(c.output)}return n.changed()?n:e.StopPropagation}}),(0,Kt.XW)(eA,cs,{transform(t,e){if(null!=this.value&&!t.modified())return e.StopPropagation;var n,r,i,o,a,s=e.dataflow.locale(),u=e.fork(e.NO_SOURCE|e.NO_FIELDS),l=this.value,c=t.type||xm,f=t.scale,h=+t.limit,d=Em(f,null==t.count?5:t.count,t.minstep),p=!!t.values||c===xm,g=t.format||Nm(s,f,d,c,t.formatSpecifier,t.formatType,p),m=t.values||Tm(f,d);return l&&(u.rem=l),c===xm?(h&&m.length>h?(e.dataflow.warn("Symbol legend count exceeds limit, filtering items."),l=m.slice(0,h-1),a=!0):l=m,(0,Kt.mf)(i=t.size)?(t.values||0!==f(l[0])||(l=l.slice(1)),o=l.reduce(((e,n)=>Math.max(e,i(n,t))),0)):i=(0,Kt.a9)(o=i||8),l=l.map(((e,n)=>Ba({index:n,label:g(e,n,l),value:e,offset:o,size:i(e,t)}))),a&&(a=m[l.length],l.push(Ba({index:l.length,label:`\u2026${m.length-l.length} entries`,value:a,offset:o,size:i(a,t)})))):"gradient"===c?(n=f.domain(),r=pm(f,n[0],(0,Kt.fj)(n)),m.length<3&&!t.values&&n[0]!==(0,Kt.fj)(n)&&(m=[n[0],(0,Kt.fj)(n)]),l=m.map(((t,e)=>Ba({index:e,label:g(t,e,m),value:t,perc:r(t)})))):(i=m.length-1,r=function(t){const e=t.domain(),n=e.length-1;let r=+e[0],i=+(0,Kt.fj)(e),o=i-r;if(t.type===Rg){const t=n?o/n:.1;r-=t,i+=t,o=i-r}return t=>(t-r)/o}(f),l=m.map(((t,e)=>Ba({index:e,label:g(t,e,m),value:t,perc:e?r(t):0,perc2:e===i?1:r(m[e+1])})))),u.source=l,u.add=l,this.value=l,u}});const nA=t=>t.source.x,rA=t=>t.source.y,iA=t=>t.target.x,oA=t=>t.target.y;function aA(t){cs.call(this,{},t)}aA.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,Kt.XW)(aA,cs,{transform(t,e){var n=t.sourceX||nA,r=t.sourceY||rA,i=t.targetX||iA,o=t.targetY||oA,a=t.as||"path",s=t.orient||"vertical",u=t.shape||"line",l=cA.get(u+"-"+s)||cA.get(u);return l||(0,Kt.vU)("LinkPath unsupported type: "+t.shape+(t.orient?"-"+t.orient:"")),e.visit(e.SOURCE,(t=>{t[a]=l(n(t),r(t),i(t),o(t))})),e.reflow(t.modified()).modifies(a)}});const sA=(t,e,n,r)=>"M"+t+","+e+"L"+n+","+r,uA=(t,e,n,r)=>{var i=n-t,o=r-e,a=Math.hypot(i,o)/2;return"M"+t+","+e+"A"+a+","+a+" "+180*Math.atan2(o,i)/Math.PI+" 0 1 "+n+","+r},lA=(t,e,n,r)=>{const i=n-t,o=r-e,a=.2*(i+o),s=.2*(o-i);return"M"+t+","+e+"C"+(t+a)+","+(e+s)+" "+(n+s)+","+(r-a)+" "+n+","+r},cA=(0,Kt.Xr)({line:sA,"line-radial":(t,e,n,r)=>sA(e*Math.cos(t),e*Math.sin(t),r*Math.cos(n),r*Math.sin(n)),arc:uA,"arc-radial":(t,e,n,r)=>uA(e*Math.cos(t),e*Math.sin(t),r*Math.cos(n),r*Math.sin(n)),curve:lA,"curve-radial":(t,e,n,r)=>lA(e*Math.cos(t),e*Math.sin(t),r*Math.cos(n),r*Math.sin(n)),"orthogonal-horizontal":(t,e,n,r)=>"M"+t+","+e+"V"+r+"H"+n,"orthogonal-vertical":(t,e,n,r)=>"M"+t+","+e+"H"+n+"V"+r,"orthogonal-radial":(t,e,n,r)=>{const i=Math.cos(t),o=Math.sin(t),a=Math.cos(n),s=Math.sin(n);return"M"+e*i+","+e*o+"A"+e+","+e+" 0 0,"+((Math.abs(n-t)>Math.PI?n<=t:n>t)?1:0)+" "+e*a+","+e*s+"L"+r*a+","+r*s},"diagonal-horizontal":(t,e,n,r)=>{const i=(t+n)/2;return"M"+t+","+e+"C"+i+","+e+" "+i+","+r+" "+n+","+r},"diagonal-vertical":(t,e,n,r)=>{const i=(e+r)/2;return"M"+t+","+e+"C"+t+","+i+" "+n+","+i+" "+n+","+r},"diagonal-radial":(t,e,n,r)=>{const i=Math.cos(t),o=Math.sin(t),a=Math.cos(n),s=Math.sin(n),u=(e+r)/2;return"M"+e*i+","+e*o+"C"+u*i+","+u*o+" "+u*a+","+u*s+" "+r*a+","+r*s}});function fA(t){cs.call(this,null,t)}fA.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,Kt.XW)(fA,cs,{transform(t,e){var n,r,i,o=t.as||["startAngle","endAngle"],a=o[0],s=o[1],u=t.field||Kt.kX,l=t.startAngle||0,c=null!=t.endAngle?t.endAngle:2*Math.PI,f=e.source,h=f.map(u),d=h.length,p=l,g=(c-l)/Jw(h),m=Zs(d);for(t.sort&&m.sort(((t,e)=>h[t]-h[e])),n=0;n<d;++n)i=h[m[n]],(r=f[m[n]])[a]=p,r[s]=p+=i*g;return this.value=h,e.reflow(t.modified()).modifies(o)}});const hA=5;function dA(t){return im(t)&&t!==Bg}const pA=(0,Kt.Rg)(["set","modified","clear","type","scheme","schemeExtent","schemeCount","domain","domainMin","domainMid","domainMax","domainRaw","domainImplicit","nice","zero","bins","range","rangeStep","round","reverse","interpolate","interpolateGamma"]);function gA(t){cs.call(this,null,t),this.modified(!0)}function mA(t,e,n){if(sm(t)){var r=Math.abs(e.reduce(((t,e)=>t+(e<0?-1:e>0?1:0)),0));r!==e.length&&n.warn("Log scale domain includes zero: "+(0,Kt.m8)(e))}return e}function yA(t,e,n){return(0,Kt.mf)(t)&&(e||n)?fm(t,vA(e||[0,1],n)):t}function vA(t,e){return e?t.slice().reverse():t}function bA(t){cs.call(this,null,t)}(0,Kt.XW)(gA,cs,{transform(t,e){var n=e.dataflow,r=this.value,i=function(t){var e,n=t.type,r="";if(n===Bg)return Bg+"-"+Fg;(function(t){const e=t.type;return im(e)&&e!==$g&&e!==Tg&&(t.scheme||t.range&&t.range.length&&t.range.every(Kt.HD))})(t)&&(r=2===(e=t.rawDomain?t.rawDomain.length:t.domain?t.domain.length+ +(null!=t.domainMid):0)?Bg+"-":3===e?Ng+"-":"");return(r+n||Fg).toLowerCase()}(t);for(i in r&&i===r.type||(this.value=r=em(i)()),t)if(!pA[i]){if("padding"===i&&dA(r.type))continue;(0,Kt.mf)(r[i])?r[i](t[i]):n.warn("Unsupported scale property: "+i)}return function(t,e,n){var r=t.type,i=e.round||!1,o=e.range;if(null!=e.rangeStep)o=function(t,e,n){t!==Lg&&t!==Ug&&(0,Kt.vU)("Only band and point scales support rangeStep.");var r=(null!=e.paddingOuter?e.paddingOuter:e.padding)||0,i=t===Ug?1:(null!=e.paddingInner?e.paddingInner:e.padding)||0;return[0,e.rangeStep*Eg(n,i,r)]}(r,e,n);else if(e.scheme&&(o=function(t,e,n){var r,i=e.schemeExtent;(0,Kt.kJ)(e.scheme)?r=hm(e.scheme,e.interpolate,e.interpolateGamma):(r=bm(e.scheme.toLowerCase()))||(0,Kt.vU)(`Unrecognized scheme name: ${e.scheme}`);return n=t===Rg?n+1:t===jg?n-1:t===Og||t===zg?+e.schemeCount||hA:n,um(t)?yA(r,i,e.reverse):(0,Kt.mf)(r)?dm(yA(r,i),n):t===Pg?r:r.slice(0,n)}(r,e,n),(0,Kt.mf)(o))){if(t.interpolator)return t.interpolator(o);(0,Kt.vU)(`Scale type ${r} does not support interpolating color schemes.`)}if(o&&um(r))return t.interpolator(hm(vA(o,e.reverse),e.interpolate,e.interpolateGamma));o&&e.interpolate&&t.interpolate?t.interpolate(gm(e.interpolate,e.interpolateGamma)):(0,Kt.mf)(t.round)?t.round(i):(0,Kt.mf)(t.rangeRound)&&t.interpolate(i?xf:bf);o&&t.range(vA(o,e.reverse))}(r,t,function(t,e,n){let r=e.bins;if(r&&!(0,Kt.kJ)(r)){const e=t.domain(),n=e[0],i=(0,Kt.fj)(e),o=r.step;let a=null==r.start?n:r.start,s=null==r.stop?i:r.stop;o||(0,Kt.vU)("Scale bins parameter missing step property."),a<n&&(a=o*Math.ceil(n/o)),s>i&&(s=o*Math.floor(i/o)),r=Zs(a,s+o/2,o)}r?t.bins=r:t.bins&&delete t.bins;t.type===jg&&(r?e.domain||e.domainRaw||(t.domain(r),n=r.length):t.bins=t.domain());return n}(r,t,function(t,e,n){const r=function(t,e,n){return e?(t.domain(mA(t.type,e,n)),e.length):-1}(t,e.domainRaw,n);if(r>-1)return r;var i,o,a=e.domain,s=t.type,u=e.zero||void 0===e.zero&&function(t){const e=t.type;return!t.bins&&(e===Fg||e===kg||e===Mg)}(t);if(!a)return 0;dA(s)&&e.padding&&a[0]!==(0,Kt.fj)(a)&&(a=function(t,e,n,r,i,o){var a=Math.abs((0,Kt.fj)(n)-n[0]),s=a/(a-2*r),u=t===Cg?(0,Kt.dH)(e,null,s):t===Mg?(0,Kt.mK)(e,null,s,.5):t===kg?(0,Kt.mK)(e,null,s,i||1):t===Sg?(0,Kt.bV)(e,null,s,o||1):(0,Kt.ay)(e,null,s);return e=e.slice(),e[0]=u[0],e[e.length-1]=u[1],e}(s,a,e.range,e.padding,e.exponent,e.constant));if((u||null!=e.domainMin||null!=e.domainMax||null!=e.domainMid)&&(i=(a=a.slice()).length-1||1,u&&(a[0]>0&&(a[0]=0),a[i]<0&&(a[i]=0)),null!=e.domainMin&&(a[0]=e.domainMin),null!=e.domainMax&&(a[i]=e.domainMax),null!=e.domainMid)){const t=(o=e.domainMid)>a[i]?i+1:o<a[0]?0:i;t!==i&&n.warn("Scale domainMid exceeds domain min or max.",o),a.splice(t,0,o)}t.domain(mA(s,a,n)),s===Pg&&t.unknown(e.domainImplicit?Fp:void 0);e.nice&&t.nice&&t.nice(!0!==e.nice&&Em(t,e.nice)||null);return a.length}(r,t,n))),e.fork(e.NO_SOURCE|e.NO_FIELDS)}}),(0,Kt.XW)(bA,cs,{transform(t,e){const n=t.modified("sort")||e.changed(e.ADD)||e.modified(t.sort.fields)||e.modified("datum");return n&&e.source.sort(Ra(t.sort)),this.modified(n),e}});const xA="zero",_A="center",wA="normalize",AA=["y0","y1"];function DA(t){cs.call(this,null,t)}function EA(t,e,n,r,i){for(var o,a=(e-t.sum)/2,s=t.length,u=0;u<s;++u)(o=t[u])[r]=a,o[i]=a+=Math.abs(n(o))}function FA(t,e,n,r,i){for(var o,a=1/t.sum,s=0,u=t.length,l=0,c=0;l<u;++l)(o=t[l])[r]=s,o[i]=s=a*(c+=Math.abs(n(o)))}function CA(t,e,n,r,i){for(var o,a,s=0,u=0,l=t.length,c=0;c<l;++c)(o=+n(a=t[c]))<0?(a[r]=u,a[i]=u+=o):(a[r]=s,a[i]=s+=o)}DA.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:xA,values:[xA,_A,wA]},{name:"as",type:"string",array:!0,length:2,default:AA}]},(0,Kt.XW)(DA,cs,{transform(t,e){var n,r,i,o,a=t.as||AA,s=a[0],u=a[1],l=Ra(t.sort),c=t.field||Kt.kX,f=t.offset===_A?EA:t.offset===wA?FA:CA;for(n=function(t,e,n,r){var i,o,a,s,u,l,c,f,h,d=[],p=t=>t(u);if(null==e)d.push(t.slice());else for(i={},o=0,a=t.length;o<a;++o)u=t[o],(c=i[l=e.map(p)])||(i[l]=c=[],d.push(c)),c.push(u);for(l=0,h=0,s=d.length;l<s;++l){for(o=0,f=0,a=(c=d[l]).length;o<a;++o)f+=Math.abs(r(c[o]));c.sum=f,f>h&&(h=f),n&&c.sort(n)}return d.max=h,d}(e.source,t.groupby,l,c),r=0,i=n.length,o=n.max;r<i;++r)f(n[r],o,c,s,u);return e.reflow(t.modified()).modifies(a)}});const kA=t=>t;function MA(t,e){t&&$A.hasOwnProperty(t.type)&&$A[t.type](t,e)}var SA={Feature:function(t,e){MA(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,r=-1,i=n.length;++r<i;)MA(n[r].geometry,e)}},$A={Sphere:function(t,e){e.sphere()},Point:function(t,e){t=t.coordinates,e.point(t[0],t[1],t[2])},MultiPoint:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)t=n[r],e.point(t[0],t[1],t[2])},LineString:function(t,e){TA(t.coordinates,e,0)},MultiLineString:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)TA(n[r],e,0)},Polygon:function(t,e){BA(t.coordinates,e)},MultiPolygon:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)BA(n[r],e)},GeometryCollection:function(t,e){for(var n=t.geometries,r=-1,i=n.length;++r<i;)MA(n[r],e)}};function TA(t,e,n){var r,i=-1,o=t.length-n;for(e.lineStart();++i<o;)r=t[i],e.point(r[0],r[1],r[2]);e.lineEnd()}function BA(t,e){var n=-1,r=t.length;for(e.polygonStart();++n<r;)TA(t[n],e,1);e.polygonEnd()}function NA(t,e){t&&SA.hasOwnProperty(t.type)?SA[t.type](t,e):MA(t,e)}class OA{constructor(){this._partials=new Float64Array(32),this._n=0}add(t){const e=this._partials;let n=0;for(let r=0;r<this._n&&r<32;r++){const i=e[r],o=t+i,a=Math.abs(t)<Math.abs(i)?t-(o-i):i-(o-t);a&&(e[n++]=a),t=o}return e[n]=t,this._n=n+1,this}valueOf(){const t=this._partials;let e,n,r,i=this._n,o=0;if(i>0){for(o=t[--i];i>0&&(e=o,n=t[--i],o=e+n,r=n-(o-e),!r););i>0&&(r<0&&t[i-1]<0||r>0&&t[i-1]>0)&&(n=2*r,e=o+n,n==e-o&&(o=e))}return o}}var zA=1e-6,RA=1e-12,PA=Math.PI,UA=PA/2,LA=PA/4,jA=2*PA,IA=180/PA,qA=PA/180,WA=Math.abs,HA=Math.atan,XA=Math.atan2,YA=Math.cos,GA=Math.ceil,VA=Math.exp,JA=(Math.floor,Math.hypot),ZA=Math.log,KA=Math.pow,QA=Math.sin,tD=Math.sign||function(t){return t>0?1:t<0?-1:0},eD=Math.sqrt,nD=Math.tan;function rD(t){return t>1?0:t<-1?PA:Math.acos(t)}function iD(t){return t>1?UA:t<-1?-UA:Math.asin(t)}function oD(){}var aD,sD,uD,lD,cD=new OA,fD=new OA,hD={point:oD,lineStart:oD,lineEnd:oD,polygonStart:function(){hD.lineStart=dD,hD.lineEnd=mD},polygonEnd:function(){hD.lineStart=hD.lineEnd=hD.point=oD,cD.add(WA(fD)),fD=new OA},result:function(){var t=cD/2;return cD=new OA,t}};function dD(){hD.point=pD}function pD(t,e){hD.point=gD,aD=uD=t,sD=lD=e}function gD(t,e){fD.add(lD*t-uD*e),uD=t,lD=e}function mD(){gD(aD,sD)}const yD=hD;var vD=1/0,bD=vD,xD=-vD,_D=xD,wD={point:function(t,e){t<vD&&(vD=t);t>xD&&(xD=t);e<bD&&(bD=e);e>_D&&(_D=e)},lineStart:oD,lineEnd:oD,polygonStart:oD,polygonEnd:oD,result:function(){var t=[[vD,bD],[xD,_D]];return xD=_D=-(bD=vD=1/0),t}};const AD=wD;var DD,ED,FD,CD,kD=0,MD=0,SD=0,$D=0,TD=0,BD=0,ND=0,OD=0,zD=0,RD={point:PD,lineStart:UD,lineEnd:ID,polygonStart:function(){RD.lineStart=qD,RD.lineEnd=WD},polygonEnd:function(){RD.point=PD,RD.lineStart=UD,RD.lineEnd=ID},result:function(){var t=zD?[ND/zD,OD/zD]:BD?[$D/BD,TD/BD]:SD?[kD/SD,MD/SD]:[NaN,NaN];return kD=MD=SD=$D=TD=BD=ND=OD=zD=0,t}};function PD(t,e){kD+=t,MD+=e,++SD}function UD(){RD.point=LD}function LD(t,e){RD.point=jD,PD(FD=t,CD=e)}function jD(t,e){var n=t-FD,r=e-CD,i=eD(n*n+r*r);$D+=i*(FD+t)/2,TD+=i*(CD+e)/2,BD+=i,PD(FD=t,CD=e)}function ID(){RD.point=PD}function qD(){RD.point=HD}function WD(){XD(DD,ED)}function HD(t,e){RD.point=XD,PD(DD=FD=t,ED=CD=e)}function XD(t,e){var n=t-FD,r=e-CD,i=eD(n*n+r*r);$D+=i*(FD+t)/2,TD+=i*(CD+e)/2,BD+=i,ND+=(i=CD*t-FD*e)*(FD+t),OD+=i*(CD+e),zD+=3*i,PD(FD=t,CD=e)}const YD=RD;function GD(t){this._context=t}GD.prototype={_radius:4.5,pointRadius:function(t){return this._radius=t,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(t,e){switch(this._point){case 0:this._context.moveTo(t,e),this._point=1;break;case 1:this._context.lineTo(t,e);break;default:this._context.moveTo(t+this._radius,e),this._context.arc(t,e,this._radius,0,jA)}},result:oD};var VD,JD,ZD,KD,QD,tE=new OA,eE={point:oD,lineStart:function(){eE.point=nE},lineEnd:function(){VD&&rE(JD,ZD),eE.point=oD},polygonStart:function(){VD=!0},polygonEnd:function(){VD=null},result:function(){var t=+tE;return tE=new OA,t}};function nE(t,e){eE.point=rE,JD=KD=t,ZD=QD=e}function rE(t,e){KD-=t,QD-=e,tE.add(eD(KD*KD+QD*QD)),KD=t,QD=e}const iE=eE;let oE,aE,sE,uE;class lE{constructor(t){this._append=null==t?cE:function(t){const e=Math.floor(t);if(!(e>=0))throw new RangeError(`invalid digits: ${t}`);if(e>15)return cE;if(e!==oE){const t=10**e;oE=e,aE=function(e){let n=1;this._+=e[0];for(const r=e.length;n<r;++n)this._+=Math.round(arguments[n]*t)/t+e[n]}}return aE}(t),this._radius=4.5,this._=""}pointRadius(t){return this._radius=+t,this}polygonStart(){this._line=0}polygonEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){0===this._line&&(this._+="Z"),this._point=NaN}point(t,e){switch(this._point){case 0:this._append`M${t},${e}`,this._point=1;break;case 1:this._append`L${t},${e}`;break;default:if(this._append`M${t},${e}`,this._radius!==sE||this._append!==aE){const t=this._radius,e=this._;this._="",this._append`m0,${t}a${t},${t} 0 1,1 0,${-2*t}a${t},${t} 0 1,1 0,${2*t}z`,sE=t,aE=this._append,uE=this._,this._=e}this._+=uE}}result(){const t=this._;return this._="",t.length?t:null}}function cE(t){let e=1;this._+=t[0];for(const n=t.length;e<n;++e)this._+=arguments[e]+t[e]}function fE(t,e){let n,r,i=3,o=4.5;function a(t){return t&&("function"===typeof o&&r.pointRadius(+o.apply(this,arguments)),NA(t,n(r))),r.result()}return a.area=function(t){return NA(t,n(yD)),yD.result()},a.measure=function(t){return NA(t,n(iE)),iE.result()},a.bounds=function(t){return NA(t,n(AD)),AD.result()},a.centroid=function(t){return NA(t,n(YD)),YD.result()},a.projection=function(e){return arguments.length?(n=null==e?(t=null,kA):(t=e).stream,a):t},a.context=function(t){return arguments.length?(r=null==t?(e=null,new lE(i)):new GD(e=t),"function"!==typeof o&&r.pointRadius(o),a):e},a.pointRadius=function(t){return arguments.length?(o="function"===typeof t?t:(r.pointRadius(+t),+t),a):o},a.digits=function(t){if(!arguments.length)return i;if(null==t)i=null;else{const e=Math.floor(t);if(!(e>=0))throw new RangeError(`invalid digits: ${t}`);i=e}return null===e&&(r=new lE(i)),a},a.projection(t).digits(i).context(e)}function hE(){var t,e=[];return{point:function(e,n,r){t.push([e,n,r])},lineStart:function(){e.push(t=[])},lineEnd:oD,rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}}function dE(t,e){return WA(t[0]-e[0])<zA&&WA(t[1]-e[1])<zA}function pE(t,e,n,r){this.x=t,this.z=e,this.o=n,this.e=r,this.v=!1,this.n=this.p=null}function gE(t,e,n,r,i){var o,a,s=[],u=[];if(t.forEach((function(t){if(!((e=t.length-1)<=0)){var e,n,r=t[0],a=t[e];if(dE(r,a)){if(!r[2]&&!a[2]){for(i.lineStart(),o=0;o<e;++o)i.point((r=t[o])[0],r[1]);return void i.lineEnd()}a[0]+=2*zA}s.push(n=new pE(r,t,null,!0)),u.push(n.o=new pE(r,null,n,!1)),s.push(n=new pE(a,t,null,!1)),u.push(n.o=new pE(a,null,n,!0))}})),s.length){for(u.sort(e),mE(s),mE(u),o=0,a=u.length;o<a;++o)u[o].e=n=!n;for(var l,c,f=s[0];;){for(var h=f,d=!0;h.v;)if((h=h.n)===f)return;l=h.z,i.lineStart();do{if(h.v=h.o.v=!0,h.e){if(d)for(o=0,a=l.length;o<a;++o)i.point((c=l[o])[0],c[1]);else r(h.x,h.n.x,1,i);h=h.n}else{if(d)for(l=h.p.z,o=l.length-1;o>=0;--o)i.point((c=l[o])[0],c[1]);else r(h.x,h.p.x,-1,i);h=h.p}l=(h=h.o).z,d=!d}while(!h.v);i.lineEnd()}}}function mE(t){if(e=t.length){for(var e,n,r=0,i=t[0];++r<e;)i.n=n=t[r],n.p=i,i=n;i.n=n=t[0],n.p=i}}function yE(t){return[XA(t[1],t[0]),iD(t[2])]}function vE(t){var e=t[0],n=t[1],r=YA(n);return[r*YA(e),r*QA(e),QA(n)]}function bE(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function xE(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function _E(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function wE(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function AE(t){var e=eD(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}function DE(t){return WA(t[0])<=PA?t[0]:tD(t[0])*((WA(t[0])+PA)%jA-PA)}function EE(t){return Array.from(function*(t){for(const e of t)yield*e}(t))}function FE(t,e,n,r){return function(i){var o,a,s,u=e(i),l=hE(),c=e(l),f=!1,h={point:d,lineStart:g,lineEnd:m,polygonStart:function(){h.point=y,h.lineStart=v,h.lineEnd=b,a=[],o=[]},polygonEnd:function(){h.point=d,h.lineStart=g,h.lineEnd=m,a=EE(a);var t=function(t,e){var n=DE(e),r=e[1],i=QA(r),o=[QA(n),-YA(n),0],a=0,s=0,u=new OA;1===i?r=UA+zA:-1===i&&(r=-UA-zA);for(var l=0,c=t.length;l<c;++l)if(h=(f=t[l]).length)for(var f,h,d=f[h-1],p=DE(d),g=d[1]/2+LA,m=QA(g),y=YA(g),v=0;v<h;++v,p=x,m=w,y=A,d=b){var b=f[v],x=DE(b),_=b[1]/2+LA,w=QA(_),A=YA(_),D=x-p,E=D>=0?1:-1,F=E*D,C=F>PA,k=m*w;if(u.add(XA(k*E*QA(F),y*A+k*YA(F))),a+=C?D+E*jA:D,C^p>=n^x>=n){var M=xE(vE(d),vE(b));AE(M);var S=xE(o,M);AE(S);var $=(C^D>=0?-1:1)*iD(S[2]);(r>$||r===$&&(M[0]||M[1]))&&(s+=C^D>=0?1:-1)}}return(a<-zA||a<zA&&u<-RA)^1&s}(o,r);a.length?(f||(i.polygonStart(),f=!0),gE(a,kE,t,n,i)):t&&(f||(i.polygonStart(),f=!0),i.lineStart(),n(null,null,1,i),i.lineEnd()),f&&(i.polygonEnd(),f=!1),a=o=null},sphere:function(){i.polygonStart(),i.lineStart(),n(null,null,1,i),i.lineEnd(),i.polygonEnd()}};function d(e,n){t(e,n)&&i.point(e,n)}function p(t,e){u.point(t,e)}function g(){h.point=p,u.lineStart()}function m(){h.point=d,u.lineEnd()}function y(t,e){s.push([t,e]),c.point(t,e)}function v(){c.lineStart(),s=[]}function b(){y(s[0][0],s[0][1]),c.lineEnd();var t,e,n,r,u=c.clean(),h=l.result(),d=h.length;if(s.pop(),o.push(s),s=null,d)if(1&u){if((e=(n=h[0]).length-1)>0){for(f||(i.polygonStart(),f=!0),i.lineStart(),t=0;t<e;++t)i.point((r=n[t])[0],r[1]);i.lineEnd()}}else d>1&&2&u&&h.push(h.pop().concat(h.shift())),a.push(h.filter(CE))}return h}}function CE(t){return t.length>1}function kE(t,e){return((t=t.x)[0]<0?t[1]-UA-zA:UA-t[1])-((e=e.x)[0]<0?e[1]-UA-zA:UA-e[1])}const ME=FE((function(){return!0}),(function(t){var e,n=NaN,r=NaN,i=NaN;return{lineStart:function(){t.lineStart(),e=1},point:function(o,a){var s=o>0?PA:-PA,u=WA(o-n);WA(u-PA)<zA?(t.point(n,r=(r+a)/2>0?UA:-UA),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(s,r),t.point(o,r),e=0):i!==s&&u>=PA&&(WA(n-i)<zA&&(n-=i*zA),WA(o-s)<zA&&(o-=s*zA),r=function(t,e,n,r){var i,o,a=QA(t-n);return WA(a)>zA?HA((QA(e)*(o=YA(r))*QA(n)-QA(r)*(i=YA(e))*QA(t))/(i*o*a)):(e+r)/2}(n,r,o,a),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(s,r),e=0),t.point(n=o,r=a),i=s},lineEnd:function(){t.lineEnd(),n=r=NaN},clean:function(){return 2-e}}}),(function(t,e,n,r){var i;if(null==t)i=n*UA,r.point(-PA,i),r.point(0,i),r.point(PA,i),r.point(PA,0),r.point(PA,-i),r.point(0,-i),r.point(-PA,-i),r.point(-PA,0),r.point(-PA,i);else if(WA(t[0]-e[0])>zA){var o=t[0]<e[0]?PA:-PA;i=n*o/2,r.point(-o,i),r.point(0,i),r.point(o,i)}else r.point(e[0],e[1])}),[-PA,-UA]);function SE(t,e,n,r,i,o){if(n){var a=YA(e),s=QA(e),u=r*n;null==i?(i=e+r*jA,o=e-u/2):(i=$E(a,i),o=$E(a,o),(r>0?i<o:i>o)&&(i+=r*jA));for(var l,c=i;r>0?c>o:c<o;c-=u)l=yE([a,-s*YA(c),-s*QA(c)]),t.point(l[0],l[1])}}function $E(t,e){(e=vE(e))[0]-=t,AE(e);var n=rD(-e[1]);return((-e[2]<0?-n:n)+jA-zA)%jA}var TE=1e9,BE=-TE;function NE(t,e,n,r){function i(i,o){return t<=i&&i<=n&&e<=o&&o<=r}function o(i,o,s,l){var c=0,f=0;if(null==i||(c=a(i,s))!==(f=a(o,s))||u(i,o)<0^s>0)do{l.point(0===c||3===c?t:n,c>1?r:e)}while((c=(c+s+4)%4)!==f);else l.point(o[0],o[1])}function a(r,i){return WA(r[0]-t)<zA?i>0?0:3:WA(r[0]-n)<zA?i>0?2:1:WA(r[1]-e)<zA?i>0?1:0:i>0?3:2}function s(t,e){return u(t.x,e.x)}function u(t,e){var n=a(t,1),r=a(e,1);return n!==r?n-r:0===n?e[1]-t[1]:1===n?t[0]-e[0]:2===n?t[1]-e[1]:e[0]-t[0]}return function(a){var u,l,c,f,h,d,p,g,m,y,v,b=a,x=hE(),_={point:w,lineStart:function(){_.point=A,l&&l.push(c=[]);y=!0,m=!1,p=g=NaN},lineEnd:function(){u&&(A(f,h),d&&m&&x.rejoin(),u.push(x.result()));_.point=w,m&&b.lineEnd()},polygonStart:function(){b=x,u=[],l=[],v=!0},polygonEnd:function(){var e=function(){for(var e=0,n=0,i=l.length;n<i;++n)for(var o,a,s=l[n],u=1,c=s.length,f=s[0],h=f[0],d=f[1];u<c;++u)o=h,a=d,h=(f=s[u])[0],d=f[1],a<=r?d>r&&(h-o)*(r-a)>(d-a)*(t-o)&&++e:d<=r&&(h-o)*(r-a)<(d-a)*(t-o)&&--e;return e}(),n=v&&e,i=(u=EE(u)).length;(n||i)&&(a.polygonStart(),n&&(a.lineStart(),o(null,null,1,a),a.lineEnd()),i&&gE(u,s,e,o,a),a.polygonEnd());b=a,u=l=c=null}};function w(t,e){i(t,e)&&b.point(t,e)}function A(o,a){var s=i(o,a);if(l&&c.push([o,a]),y)f=o,h=a,d=s,y=!1,s&&(b.lineStart(),b.point(o,a));else if(s&&m)b.point(o,a);else{var u=[p=Math.max(BE,Math.min(TE,p)),g=Math.max(BE,Math.min(TE,g))],x=[o=Math.max(BE,Math.min(TE,o)),a=Math.max(BE,Math.min(TE,a))];!function(t,e,n,r,i,o){var a,s=t[0],u=t[1],l=0,c=1,f=e[0]-s,h=e[1]-u;if(a=n-s,f||!(a>0)){if(a/=f,f<0){if(a<l)return;a<c&&(c=a)}else if(f>0){if(a>c)return;a>l&&(l=a)}if(a=i-s,f||!(a<0)){if(a/=f,f<0){if(a>c)return;a>l&&(l=a)}else if(f>0){if(a<l)return;a<c&&(c=a)}if(a=r-u,h||!(a>0)){if(a/=h,h<0){if(a<l)return;a<c&&(c=a)}else if(h>0){if(a>c)return;a>l&&(l=a)}if(a=o-u,h||!(a<0)){if(a/=h,h<0){if(a>c)return;a>l&&(l=a)}else if(h>0){if(a<l)return;a<c&&(c=a)}return l>0&&(t[0]=s+l*f,t[1]=u+l*h),c<1&&(e[0]=s+c*f,e[1]=u+c*h),!0}}}}}(u,x,t,e,n,r)?s&&(b.lineStart(),b.point(o,a),v=!1):(m||(b.lineStart(),b.point(u[0],u[1])),b.point(x[0],x[1]),s||b.lineEnd(),v=!1)}p=o,g=a,m=s}return _}}function OE(t,e){function n(n,r){return n=t(n,r),e(n[0],n[1])}return t.invert&&e.invert&&(n.invert=function(n,r){return(n=e.invert(n,r))&&t.invert(n[0],n[1])}),n}function zE(t,e){return WA(t)>PA&&(t-=Math.round(t/jA)*jA),[t,e]}function RE(t,e,n){return(t%=jA)?e||n?OE(UE(t),LE(e,n)):UE(t):e||n?LE(e,n):zE}function PE(t){return function(e,n){return WA(e+=t)>PA&&(e-=Math.round(e/jA)*jA),[e,n]}}function UE(t){var e=PE(t);return e.invert=PE(-t),e}function LE(t,e){var n=YA(t),r=QA(t),i=YA(e),o=QA(e);function a(t,e){var a=YA(e),s=YA(t)*a,u=QA(t)*a,l=QA(e),c=l*n+s*r;return[XA(u*i-c*o,s*n-l*r),iD(c*i+u*o)]}return a.invert=function(t,e){var a=YA(e),s=YA(t)*a,u=QA(t)*a,l=QA(e),c=l*i-u*o;return[XA(u*i+l*o,s*n+c*r),iD(c*n-s*r)]},a}function jE(t){return function(e){var n=new IE;for(var r in t)n[r]=t[r];return n.stream=e,n}}function IE(){}function qE(t,e,n){var r=t.clipExtent&&t.clipExtent();return t.scale(150).translate([0,0]),null!=r&&t.clipExtent(null),NA(n,t.stream(AD)),e(AD.result()),null!=r&&t.clipExtent(r),t}function WE(t,e,n){return qE(t,(function(n){var r=e[1][0]-e[0][0],i=e[1][1]-e[0][1],o=Math.min(r/(n[1][0]-n[0][0]),i/(n[1][1]-n[0][1])),a=+e[0][0]+(r-o*(n[1][0]+n[0][0]))/2,s=+e[0][1]+(i-o*(n[1][1]+n[0][1]))/2;t.scale(150*o).translate([a,s])}),n)}function HE(t,e,n){return WE(t,[[0,0],e],n)}function XE(t,e,n){return qE(t,(function(n){var r=+e,i=r/(n[1][0]-n[0][0]),o=(r-i*(n[1][0]+n[0][0]))/2,a=-i*n[0][1];t.scale(150*i).translate([o,a])}),n)}function YE(t,e,n){return qE(t,(function(n){var r=+e,i=r/(n[1][1]-n[0][1]),o=-i*n[0][0],a=(r-i*(n[1][1]+n[0][1]))/2;t.scale(150*i).translate([o,a])}),n)}zE.invert=zE,IE.prototype={constructor:IE,point:function(t,e){this.stream.point(t,e)},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 GE=16,VE=YA(30*qA);function JE(t,e){return+e?function(t,e){function n(r,i,o,a,s,u,l,c,f,h,d,p,g,m){var y=l-r,v=c-i,b=y*y+v*v;if(b>4*e&&g--){var x=a+h,_=s+d,w=u+p,A=eD(x*x+_*_+w*w),D=iD(w/=A),E=WA(WA(w)-1)<zA||WA(o-f)<zA?(o+f)/2:XA(_,x),F=t(E,D),C=F[0],k=F[1],M=C-r,S=k-i,$=v*M-y*S;($*$/b>e||WA((y*M+v*S)/b-.5)>.3||a*h+s*d+u*p<VE)&&(n(r,i,o,a,s,u,C,k,E,x/=A,_/=A,w,g,m),m.point(C,k),n(C,k,E,x,_,w,l,c,f,h,d,p,g,m))}}return function(e){var r,i,o,a,s,u,l,c,f,h,d,p,g={point:m,lineStart:y,lineEnd:b,polygonStart:function(){e.polygonStart(),g.lineStart=x},polygonEnd:function(){e.polygonEnd(),g.lineStart=y}};function m(n,r){n=t(n,r),e.point(n[0],n[1])}function y(){c=NaN,g.point=v,e.lineStart()}function v(r,i){var o=vE([r,i]),a=t(r,i);n(c,f,l,h,d,p,c=a[0],f=a[1],l=r,h=o[0],d=o[1],p=o[2],GE,e),e.point(c,f)}function b(){g.point=m,e.lineEnd()}function x(){y(),g.point=_,g.lineEnd=w}function _(t,e){v(r=t,e),i=c,o=f,a=h,s=d,u=p,g.point=v}function w(){n(c,f,l,h,d,p,i,o,r,a,s,u,GE,e),g.lineEnd=b,b()}return g}}(t,e):function(t){return jE({point:function(e,n){e=t(e,n),this.stream.point(e[0],e[1])}})}(t)}var ZE=jE({point:function(t,e){this.stream.point(t*qA,e*qA)}});function KE(t,e,n,r,i,o){if(!o)return function(t,e,n,r,i){function o(o,a){return[e+t*(o*=r),n-t*(a*=i)]}return o.invert=function(o,a){return[(o-e)/t*r,(n-a)/t*i]},o}(t,e,n,r,i);var a=YA(o),s=QA(o),u=a*t,l=s*t,c=a/t,f=s/t,h=(s*n-a*e)/t,d=(s*e+a*n)/t;function p(t,o){return[u*(t*=r)-l*(o*=i)+e,n-l*t-u*o]}return p.invert=function(t,e){return[r*(c*t-f*e+h),i*(d-f*t-c*e)]},p}function QE(t){return tF((function(){return t}))()}function tF(t){var e,n,r,i,o,a,s,u,l,c,f=150,h=480,d=250,p=0,g=0,m=0,y=0,v=0,b=0,x=1,_=1,w=null,A=ME,D=null,E=kA,F=.5;function C(t){return u(t[0]*qA,t[1]*qA)}function k(t){return(t=u.invert(t[0],t[1]))&&[t[0]*IA,t[1]*IA]}function M(){var t=KE(f,0,0,x,_,b).apply(null,e(p,g)),r=KE(f,h-t[0],d-t[1],x,_,b);return n=RE(m,y,v),s=OE(e,r),u=OE(n,s),a=JE(s,F),S()}function S(){return l=c=null,C}return C.stream=function(t){return l&&c===t?l:l=ZE(function(t){return jE({point:function(e,n){var r=t(e,n);return this.stream.point(r[0],r[1])}})}(n)(A(a(E(c=t)))))},C.preclip=function(t){return arguments.length?(A=t,w=void 0,S()):A},C.postclip=function(t){return arguments.length?(E=t,D=r=i=o=null,S()):E},C.clipAngle=function(t){return arguments.length?(A=+t?function(t){var e=YA(t),n=6*qA,r=e>0,i=WA(e)>zA;function o(t,n){return YA(t)*YA(n)>e}function a(t,n,r){var i=[1,0,0],o=xE(vE(t),vE(n)),a=bE(o,o),s=o[0],u=a-s*s;if(!u)return!r&&t;var l=e*a/u,c=-e*s/u,f=xE(i,o),h=wE(i,l);_E(h,wE(o,c));var d=f,p=bE(h,d),g=bE(d,d),m=p*p-g*(bE(h,h)-1);if(!(m<0)){var y=eD(m),v=wE(d,(-p-y)/g);if(_E(v,h),v=yE(v),!r)return v;var b,x=t[0],_=n[0],w=t[1],A=n[1];_<x&&(b=x,x=_,_=b);var D=_-x,E=WA(D-PA)<zA;if(!E&&A<w&&(b=w,w=A,A=b),E||D<zA?E?w+A>0^v[1]<(WA(v[0]-x)<zA?w:A):w<=v[1]&&v[1]<=A:D>PA^(x<=v[0]&&v[0]<=_)){var F=wE(d,(-p+y)/g);return _E(F,h),[v,yE(F)]}}}function s(e,n){var i=r?t:PA-t,o=0;return e<-i?o|=1:e>i&&(o|=2),n<-i?o|=4:n>i&&(o|=8),o}return FE(o,(function(t){var e,n,u,l,c;return{lineStart:function(){l=u=!1,c=1},point:function(f,h){var d,p=[f,h],g=o(f,h),m=r?g?0:s(f,h):g?s(f+(f<0?PA:-PA),h):0;if(!e&&(l=u=g)&&t.lineStart(),g!==u&&(!(d=a(e,p))||dE(e,d)||dE(p,d))&&(p[2]=1),g!==u)c=0,g?(t.lineStart(),d=a(p,e),t.point(d[0],d[1])):(d=a(e,p),t.point(d[0],d[1],2),t.lineEnd()),e=d;else if(i&&e&&r^g){var y;m&n||!(y=a(p,e,!0))||(c=0,r?(t.lineStart(),t.point(y[0][0],y[0][1]),t.point(y[1][0],y[1][1]),t.lineEnd()):(t.point(y[1][0],y[1][1]),t.lineEnd(),t.lineStart(),t.point(y[0][0],y[0][1],3)))}!g||e&&dE(e,p)||t.point(p[0],p[1]),e=p,u=g,n=m},lineEnd:function(){u&&t.lineEnd(),e=null},clean:function(){return c|(l&&u)<<1}}}),(function(e,r,i,o){SE(o,t,n,i,e,r)}),r?[0,-t]:[-PA,t-PA])}(w=t*qA):(w=null,ME),S()):w*IA},C.clipExtent=function(t){return arguments.length?(E=null==t?(D=r=i=o=null,kA):NE(D=+t[0][0],r=+t[0][1],i=+t[1][0],o=+t[1][1]),S()):null==D?null:[[D,r],[i,o]]},C.scale=function(t){return arguments.length?(f=+t,M()):f},C.translate=function(t){return arguments.length?(h=+t[0],d=+t[1],M()):[h,d]},C.center=function(t){return arguments.length?(p=t[0]%360*qA,g=t[1]%360*qA,M()):[p*IA,g*IA]},C.rotate=function(t){return arguments.length?(m=t[0]%360*qA,y=t[1]%360*qA,v=t.length>2?t[2]%360*qA:0,M()):[m*IA,y*IA,v*IA]},C.angle=function(t){return arguments.length?(b=t%360*qA,M()):b*IA},C.reflectX=function(t){return arguments.length?(x=t?-1:1,M()):x<0},C.reflectY=function(t){return arguments.length?(_=t?-1:1,M()):_<0},C.precision=function(t){return arguments.length?(a=JE(s,F=t*t),S()):eD(F)},C.fitExtent=function(t,e){return WE(C,t,e)},C.fitSize=function(t,e){return HE(C,t,e)},C.fitWidth=function(t,e){return XE(C,t,e)},C.fitHeight=function(t,e){return YE(C,t,e)},function(){return e=t.apply(this,arguments),C.invert=e.invert&&k,M()}}function eF(t){var e=0,n=PA/3,r=tF(t),i=r(e,n);return i.parallels=function(t){return arguments.length?r(e=t[0]*qA,n=t[1]*qA):[e*IA,n*IA]},i}function nF(t,e){var n=QA(t),r=(n+QA(e))/2;if(WA(r)<zA)return function(t){var e=YA(t);function n(t,n){return[t*e,QA(n)/e]}return n.invert=function(t,n){return[t/e,iD(n*e)]},n}(t);var i=1+n*(2*r-n),o=eD(i)/r;function a(t,e){var n=eD(i-2*r*QA(e))/r;return[n*QA(t*=r),o-n*YA(t)]}return a.invert=function(t,e){var n=o-e,a=XA(t,WA(n))*tD(n);return n*r<0&&(a-=PA*tD(t)*tD(n)),[a/r,iD((i-(t*t+n*n)*r*r)/(2*r))]},a}function rF(){return eF(nF).scale(155.424).center([0,33.6442])}function iF(){return rF().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])}function oF(t){return function(e,n){var r=YA(e),i=YA(n),o=t(r*i);return o===1/0?[2,0]:[o*i*QA(e),o*QA(n)]}}function aF(t){return function(e,n){var r=eD(e*e+n*n),i=t(r),o=QA(i),a=YA(i);return[XA(e*o,r*a),iD(r&&n*o/r)]}}var sF=oF((function(t){return eD(2/(1+t))}));sF.invert=aF((function(t){return 2*iD(t/2)}));var uF=oF((function(t){return(t=rD(t))&&t/QA(t)}));function lF(t,e){return[t,ZA(nD((UA+e)/2))]}function cF(t){var e,n,r,i=QE(t),o=i.center,a=i.scale,s=i.translate,u=i.clipExtent,l=null;function c(){var o=PA*a(),s=i(function(t){function e(e){return(e=t(e[0]*qA,e[1]*qA))[0]*=IA,e[1]*=IA,e}return t=RE(t[0]*qA,t[1]*qA,t.length>2?t[2]*qA:0),e.invert=function(e){return(e=t.invert(e[0]*qA,e[1]*qA))[0]*=IA,e[1]*=IA,e},e}(i.rotate()).invert([0,0]));return u(null==l?[[s[0]-o,s[1]-o],[s[0]+o,s[1]+o]]:t===lF?[[Math.max(s[0]-o,l),e],[Math.min(s[0]+o,n),r]]:[[l,Math.max(s[1]-o,e)],[n,Math.min(s[1]+o,r)]])}return i.scale=function(t){return arguments.length?(a(t),c()):a()},i.translate=function(t){return arguments.length?(s(t),c()):s()},i.center=function(t){return arguments.length?(o(t),c()):o()},i.clipExtent=function(t){return arguments.length?(null==t?l=e=n=r=null:(l=+t[0][0],e=+t[0][1],n=+t[1][0],r=+t[1][1]),c()):null==l?null:[[l,e],[n,r]]},c()}function fF(t){return nD((UA+t)/2)}function hF(t,e){var n=YA(t),r=t===e?QA(t):ZA(n/YA(e))/ZA(fF(e)/fF(t)),i=n*KA(fF(t),r)/r;if(!r)return lF;function o(t,e){i>0?e<-UA+zA&&(e=-UA+zA):e>UA-zA&&(e=UA-zA);var n=i/KA(fF(e),r);return[n*QA(r*t),i-n*YA(r*t)]}return o.invert=function(t,e){var n=i-e,o=tD(r)*eD(t*t+n*n),a=XA(t,WA(n))*tD(n);return n*r<0&&(a-=PA*tD(t)*tD(n)),[a/r,2*HA(KA(i/o,1/r))-UA]},o}function dF(t,e){return[t,e]}function pF(t,e){var n=YA(t),r=t===e?QA(t):(n-YA(e))/(e-t),i=n/r+t;if(WA(r)<zA)return dF;function o(t,e){var n=i-e,o=r*t;return[n*QA(o),i-n*YA(o)]}return o.invert=function(t,e){var n=i-e,o=XA(t,WA(n))*tD(n);return n*r<0&&(o-=PA*tD(t)*tD(n)),[o/r,i-tD(r)*eD(t*t+n*n)]},o}uF.invert=aF((function(t){return t})),lF.invert=function(t,e){return[t,2*HA(VA(e))-UA]},dF.invert=dF;var gF=1.340264,mF=-.081106,yF=893e-6,vF=.003796,bF=eD(3)/2;function xF(t,e){var n=iD(bF*QA(e)),r=n*n,i=r*r*r;return[t*YA(n)/(bF*(gF+3*mF*r+i*(7*yF+9*vF*r))),n*(gF+mF*r+i*(yF+vF*r))]}function _F(t,e){var n=YA(e),r=YA(t)*n;return[n*QA(t)/r,QA(e)/r]}function wF(t,e){var n=e*e,r=n*n;return[t*(.8707-.131979*n+r*(r*(.003971*n-.001529*r)-.013791)),e*(1.007226+n*(.015085+r*(.028874*n-.044475-.005916*r)))]}function AF(t,e){return[YA(e)*QA(t),QA(e)]}function DF(t,e){var n=YA(e),r=1+YA(t)*n;return[n*QA(t)/r,QA(e)/r]}function EF(t,e){return[ZA(nD((UA+e)/2)),-t]}xF.invert=function(t,e){for(var n,r=e,i=r*r,o=i*i*i,a=0;a<12&&(o=(i=(r-=n=(r*(gF+mF*i+o*(yF+vF*i))-e)/(gF+3*mF*i+o*(7*yF+9*vF*i)))*r)*i*i,!(WA(n)<RA));++a);return[bF*t*(gF+3*mF*i+o*(7*yF+9*vF*i))/YA(r),iD(QA(r)/bF)]},_F.invert=aF(HA),wF.invert=function(t,e){var n,r=e,i=25;do{var o=r*r,a=o*o;r-=n=(r*(1.007226+o*(.015085+a*(.028874*o-.044475-.005916*a)))-e)/(1.007226+o*(.045255+a*(.259866*o-.311325-.005916*11*a)))}while(WA(n)>zA&&--i>0);return[t/(.8707+(o=r*r)*(o*(o*o*o*(.003971-.001529*o)-.013791)-.131979)),r]},AF.invert=aF(iD),DF.invert=aF((function(t){return 2*HA(t)})),EF.invert=function(t,e){return[-e,2*HA(VA(t))-UA]};var FF=Math.abs,CF=(Math.atan,Math.atan2,Math.ceil,Math.cos),kF=(Math.exp,Math.floor,Math.log,Math.max,Math.min,Math.pow,Math.round,Math.sign,Math.sin),MF=(Math.tan,1e-6),SF=Math.PI,$F=SF/2,TF=(Math.SQRT1_2,NF(2));NF(SF);function BF(t){return t>1?$F:t<-1?-$F:Math.asin(t)}function NF(t){return t>0?Math.sqrt(t):0}function OF(t,e){var n,r=t*kF(e),i=30;do{e-=n=(e+kF(e)-r)/(1+CF(e))}while(FF(n)>MF&&--i>0);return e/2}var zF=function(t,e,n){function r(r,i){return[t*r*CF(i=OF(n,i)),e*kF(i)]}return r.invert=function(r,i){return i=BF(i/e),[r/(t*CF(i)),BF((2*i+kF(2*i))/n)]},r}(TF/$F,TF,SF);const RF=fE(),PF=["clipAngle","clipExtent","scale","translate","center","rotate","parallels","precision","reflectX","reflectY","coefficient","distance","fraction","lobes","parallel","radius","ratio","spacing","tilt"];function UF(t,e){if(!t||"string"!==typeof t)throw new Error("Projection type must be a name string.");return t=t.toLowerCase(),arguments.length>1?(jF[t]=function(t,e){return function n(){const r=e();return r.type=t,r.path=fE().projection(r),r.copy=r.copy||function(){const t=n();return PF.forEach((e=>{r[e]&&t[e](r[e]())})),t.path.pointRadius(r.path.pointRadius()),t},Qg(r)}}(t,e),this):jF[t]||null}function LF(t){return t&&t.path||RF}const jF={albers:iF,albersusa:function(){var t,e,n,r,i,o,a=iF(),s=rF().rotate([154,0]).center([-2,58.5]).parallels([55,65]),u=rF().rotate([157,0]).center([-3,19.9]).parallels([8,18]),l={point:function(t,e){o=[t,e]}};function c(t){var e=t[0],a=t[1];return o=null,n.point(e,a),o||(r.point(e,a),o)||(i.point(e,a),o)}function f(){return t=e=null,c}return c.invert=function(t){var e=a.scale(),n=a.translate(),r=(t[0]-n[0])/e,i=(t[1]-n[1])/e;return(i>=.12&&i<.234&&r>=-.425&&r<-.214?s:i>=.166&&i<.234&&r>=-.214&&r<-.115?u:a).invert(t)},c.stream=function(n){return t&&e===n?t:t=function(t){var e=t.length;return{point:function(n,r){for(var i=-1;++i<e;)t[i].point(n,r)},sphere:function(){for(var n=-1;++n<e;)t[n].sphere()},lineStart:function(){for(var n=-1;++n<e;)t[n].lineStart()},lineEnd:function(){for(var n=-1;++n<e;)t[n].lineEnd()},polygonStart:function(){for(var n=-1;++n<e;)t[n].polygonStart()},polygonEnd:function(){for(var n=-1;++n<e;)t[n].polygonEnd()}}}([a.stream(e=n),s.stream(n),u.stream(n)])},c.precision=function(t){return arguments.length?(a.precision(t),s.precision(t),u.precision(t),f()):a.precision()},c.scale=function(t){return arguments.length?(a.scale(t),s.scale(.35*t),u.scale(t),c.translate(a.translate())):a.scale()},c.translate=function(t){if(!arguments.length)return a.translate();var e=a.scale(),o=+t[0],c=+t[1];return n=a.translate(t).clipExtent([[o-.455*e,c-.238*e],[o+.455*e,c+.238*e]]).stream(l),r=s.translate([o-.307*e,c+.201*e]).clipExtent([[o-.425*e+zA,c+.12*e+zA],[o-.214*e-zA,c+.234*e-zA]]).stream(l),i=u.translate([o-.205*e,c+.212*e]).clipExtent([[o-.214*e+zA,c+.166*e+zA],[o-.115*e-zA,c+.234*e-zA]]).stream(l),f()},c.fitExtent=function(t,e){return WE(c,t,e)},c.fitSize=function(t,e){return HE(c,t,e)},c.fitWidth=function(t,e){return XE(c,t,e)},c.fitHeight=function(t,e){return YE(c,t,e)},c.scale(1070)},azimuthalequalarea:function(){return QE(sF).scale(124.75).clipAngle(179.999)},azimuthalequidistant:function(){return QE(uF).scale(79.4188).clipAngle(179.999)},conicconformal:function(){return eF(hF).scale(109.5).parallels([30,30])},conicequalarea:rF,conicequidistant:function(){return eF(pF).scale(131.154).center([0,13.9389])},equalEarth:function(){return QE(xF).scale(177.158)},equirectangular:function(){return QE(dF).scale(152.63)},gnomonic:function(){return QE(_F).scale(144.049).clipAngle(60)},identity:function(){var t,e,n,r,i,o,a,s=1,u=0,l=0,c=1,f=1,h=0,d=null,p=1,g=1,m=jE({point:function(t,e){var n=b([t,e]);this.stream.point(n[0],n[1])}}),y=kA;function v(){return p=s*c,g=s*f,o=a=null,b}function b(n){var r=n[0]*p,i=n[1]*g;if(h){var o=i*t-r*e;r=r*t+i*e,i=o}return[r+u,i+l]}return b.invert=function(n){var r=n[0]-u,i=n[1]-l;if(h){var o=i*t+r*e;r=r*t-i*e,i=o}return[r/p,i/g]},b.stream=function(t){return o&&a===t?o:o=m(y(a=t))},b.postclip=function(t){return arguments.length?(y=t,d=n=r=i=null,v()):y},b.clipExtent=function(t){return arguments.length?(y=null==t?(d=n=r=i=null,kA):NE(d=+t[0][0],n=+t[0][1],r=+t[1][0],i=+t[1][1]),v()):null==d?null:[[d,n],[r,i]]},b.scale=function(t){return arguments.length?(s=+t,v()):s},b.translate=function(t){return arguments.length?(u=+t[0],l=+t[1],v()):[u,l]},b.angle=function(n){return arguments.length?(e=QA(h=n%360*qA),t=YA(h),v()):h*IA},b.reflectX=function(t){return arguments.length?(c=t?-1:1,v()):c<0},b.reflectY=function(t){return arguments.length?(f=t?-1:1,v()):f<0},b.fitExtent=function(t,e){return WE(b,t,e)},b.fitSize=function(t,e){return HE(b,t,e)},b.fitWidth=function(t,e){return XE(b,t,e)},b.fitHeight=function(t,e){return YE(b,t,e)},b},mercator:function(){return cF(lF).scale(961/jA)},mollweide:function(){return QE(zF).scale(169.529)},naturalEarth1:function(){return QE(wF).scale(175.295)},orthographic:function(){return QE(AF).scale(249.5).clipAngle(90+zA)},stereographic:function(){return QE(DF).scale(250).clipAngle(142)},transversemercator:function(){var t=cF(EF),e=t.center,n=t.rotate;return t.center=function(t){return arguments.length?e([-t[1],t[0]]):[(t=e())[1],-t[0]]},t.rotate=function(t){return arguments.length?n([t[0],t[1],t.length>2?t[2]+90:90]):[(t=n())[0],t[1],t[2]-90]},n([0,0,90]).scale(159.155)}};for(const Z8 in jF)UF(Z8,jF[Z8]);function IF(t,e,n){t=+t,e=+e,n=(i=arguments.length)<2?(e=t,t=0,1):i<3?1:+n;for(var r=-1,i=0|Math.max(0,Math.ceil((e-t)/n)),o=new Array(i);++r<i;)o[r]=t+r*n;return o}function qF(t,e,n){var r=IF(t,e-zA,n).concat(e);return function(t){return r.map((function(e){return[t,e]}))}}function WF(t,e,n){var r=IF(t,e-zA,n).concat(e);return function(t){return r.map((function(e){return[e,t]}))}}function HF(){var t,e,n,r,i,o,a,s,u,l,c,f,h=10,d=h,p=90,g=360,m=2.5;function y(){return{type:"MultiLineString",coordinates:v()}}function v(){return IF(GA(r/p)*p,n,p).map(c).concat(IF(GA(s/g)*g,a,g).map(f)).concat(IF(GA(e/h)*h,t,h).filter((function(t){return WA(t%p)>zA})).map(u)).concat(IF(GA(o/d)*d,i,d).filter((function(t){return WA(t%g)>zA})).map(l))}return y.lines=function(){return v().map((function(t){return{type:"LineString",coordinates:t}}))},y.outline=function(){return{type:"Polygon",coordinates:[c(r).concat(f(a).slice(1),c(n).reverse().slice(1),f(s).reverse().slice(1))]}},y.extent=function(t){return arguments.length?y.extentMajor(t).extentMinor(t):y.extentMinor()},y.extentMajor=function(t){return arguments.length?(r=+t[0][0],n=+t[1][0],s=+t[0][1],a=+t[1][1],r>n&&(t=r,r=n,n=t),s>a&&(t=s,s=a,a=t),y.precision(m)):[[r,s],[n,a]]},y.extentMinor=function(n){return arguments.length?(e=+n[0][0],t=+n[1][0],o=+n[0][1],i=+n[1][1],e>t&&(n=e,e=t,t=n),o>i&&(n=o,o=i,i=n),y.precision(m)):[[e,o],[t,i]]},y.step=function(t){return arguments.length?y.stepMajor(t).stepMinor(t):y.stepMinor()},y.stepMajor=function(t){return arguments.length?(p=+t[0],g=+t[1],y):[p,g]},y.stepMinor=function(t){return arguments.length?(h=+t[0],d=+t[1],y):[h,d]},y.precision=function(h){return arguments.length?(m=+h,u=qF(o,i,90),l=WF(e,t,m),c=qF(s,a,90),f=WF(r,n,m),y):m},y.extentMajor([[-180,-90+zA],[180,90-zA]]).extentMinor([[-180,-80-zA],[180,80+zA]])}function XF(){}const YF=[[],[[[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 GF(){var t=1,e=1,n=a;function r(t,e){return e.map((e=>i(t,e)))}function i(r,i){var a=[],s=[];return function(n,r,i){var a,s,u,l,c,f,h=new Array,d=new Array;a=s=-1,l=n[0]>=r,YF[l<<1].forEach(p);for(;++a<t-1;)u=l,l=n[a+1]>=r,YF[u|l<<1].forEach(p);YF[l<<0].forEach(p);for(;++s<e-1;){for(a=-1,l=n[s*t+t]>=r,c=n[s*t]>=r,YF[l<<1|c<<2].forEach(p);++a<t-1;)u=l,l=n[s*t+t+a+1]>=r,f=c,c=n[s*t+a+1]>=r,YF[u|l<<1|c<<2|f<<3].forEach(p);YF[l|c<<3].forEach(p)}a=-1,c=n[s*t]>=r,YF[c<<2].forEach(p);for(;++a<t-1;)f=c,c=n[s*t+a+1]>=r,YF[c<<2|f<<3].forEach(p);function p(t){var e,n,r=[t[0][0]+a,t[0][1]+s],u=[t[1][0]+a,t[1][1]+s],l=o(r),c=o(u);(e=d[l])?(n=h[c])?(delete d[e.end],delete h[n.start],e===n?(e.ring.push(u),i(e.ring)):h[e.start]=d[n.end]={start:e.start,end:n.end,ring:e.ring.concat(n.ring)}):(delete d[e.end],e.ring.push(u),d[e.end=c]=e):(e=h[c])?(n=d[l])?(delete h[e.start],delete d[n.end],e===n?(e.ring.push(u),i(e.ring)):h[n.start]=d[e.end]={start:n.start,end:e.end,ring:n.ring.concat(e.ring)}):(delete h[e.start],e.ring.unshift(r),h[e.start=l]=e):h[l]=d[c]={start:l,end:c,ring:[r,u]}}YF[c<<3].forEach(p)}(r,i,(t=>{n(t,r,i),function(t){var e=0,n=t.length,r=t[n-1][1]*t[0][0]-t[n-1][0]*t[0][1];for(;++e<n;)r+=t[e-1][1]*t[e][0]-t[e-1][0]*t[e][1];return r}(t)>0?a.push([t]):s.push(t)})),s.forEach((t=>{for(var e,n=0,r=a.length;n<r;++n)if(-1!==VF((e=a[n])[0],t))return void e.push(t)})),{type:"MultiPolygon",value:i,coordinates:a}}function o(e){return 2*e[0]+e[1]*(t+1)*4}function a(n,r,i){n.forEach((n=>{var o,a=n[0],s=n[1],u=0|a,l=0|s,c=r[l*t+u];a>0&&a<t&&u===a&&(o=r[l*t+u-1],n[0]=a+(i-o)/(c-o)-.5),s>0&&s<e&&l===s&&(o=r[(l-1)*t+u],n[1]=s+(i-o)/(c-o)-.5)}))}return r.contour=i,r.size=function(n){if(!arguments.length)return[t,e];var i=Math.floor(n[0]),o=Math.floor(n[1]);return i>=0&&o>=0||(0,Kt.vU)("invalid size"),t=i,e=o,r},r.smooth=function(t){return arguments.length?(n=t?a:XF,r):n===a},r}function VF(t,e){for(var n,r=-1,i=e.length;++r<i;)if(n=JF(t,e[r]))return n;return 0}function JF(t,e){for(var n=e[0],r=e[1],i=-1,o=0,a=t.length,s=a-1;o<a;s=o++){var u=t[o],l=u[0],c=u[1],f=t[s],h=f[0],d=f[1];if(ZF(u,f,e))return 0;c>r!==d>r&&n<(h-l)*(r-c)/(d-c)+l&&(i=-i)}return i}function ZF(t,e,n){var r,i,o,a;return function(t,e,n){return(e[0]-t[0])*(n[1]-t[1])===(n[0]-t[0])*(e[1]-t[1])}(t,e,n)&&(i=t[r=+(t[0]===e[0])],o=n[r],a=e[r],i<=o&&o<=a||a<=o&&o<=i)}function KF(t,e,n){return function(r){var i=(0,Kt.We)(r),o=n?Math.min(i[0],0):i[0],a=i[1],s=a-o,u=e?_e(o,a,t):s/(t+1);return Zs(o+u,a,u)}}function QF(t){cs.call(this,null,t)}function tC(t,e,n,r,i){const o=t.x1||0,a=t.y1||0,s=e*n<0;function u(t){t.forEach(l)}function l(t){s&&t.reverse(),t.forEach(c)}function c(t){t[0]=(t[0]-o)*e+r,t[1]=(t[1]-a)*n+i}return function(t){return t.coordinates.forEach(u),t}}function eC(t,e,n){const r=t>=0?t:Cs(e,n);return Math.round((Math.sqrt(4*r*r+1)-1)/2)}function nC(t){return(0,Kt.mf)(t)?t:(0,Kt.a9)(+t)}function rC(){var t=t=>t[0],e=t=>t[1],n=Kt.kX,r=[-1,-1],i=960,o=500,a=2;function s(s,u){const l=eC(r[0],s,t)>>a,c=eC(r[1],s,e)>>a,f=l?l+2:0,h=c?c+2:0,d=2*f+(i>>a),p=2*h+(o>>a),g=new Float32Array(d*p),m=new Float32Array(d*p);let y=g;s.forEach((r=>{const i=f+(+t(r)>>a),o=h+(+e(r)>>a);i>=0&&i<d&&o>=0&&o<p&&(g[i+o*d]+=+n(r))})),l>0&&c>0?(iC(d,p,g,m,l),oC(d,p,m,g,c),iC(d,p,g,m,l),oC(d,p,m,g,c),iC(d,p,g,m,l),oC(d,p,m,g,c)):l>0?(iC(d,p,g,m,l),iC(d,p,m,g,l),iC(d,p,g,m,l),y=m):c>0&&(oC(d,p,g,m,c),oC(d,p,m,g,c),oC(d,p,g,m,c),y=m);const v=u?Math.pow(2,-2*a):1/Jw(y);for(let t=0,e=d*p;t<e;++t)y[t]*=v;return{values:y,scale:1<<a,width:d,height:p,x1:f,y1:h,x2:f+(i>>a),y2:h+(o>>a)}}return s.x=function(e){return arguments.length?(t=nC(e),s):t},s.y=function(t){return arguments.length?(e=nC(t),s):e},s.weight=function(t){return arguments.length?(n=nC(t),s):n},s.size=function(t){if(!arguments.length)return[i,o];var e=+t[0],n=+t[1];return e>=0&&n>=0||(0,Kt.vU)("invalid size"),i=e,o=n,s},s.cellSize=function(t){return arguments.length?((t=+t)>=1||(0,Kt.vU)("invalid cell size"),a=Math.floor(Math.log(t)/Math.LN2),s):1<<a},s.bandwidth=function(t){return arguments.length?(1===(t=(0,Kt.IX)(t)).length&&(t=[+t[0],+t[0]]),2!==t.length&&(0,Kt.vU)("invalid bandwidth"),r=t,s):r},s}function iC(t,e,n,r,i){const o=1+(i<<1);for(let a=0;a<e;++a)for(let e=0,s=0;e<t+i;++e)e<t&&(s+=n[e+a*t]),e>=i&&(e>=o&&(s-=n[e-o+a*t]),r[e-i+a*t]=s/Math.min(e+1,t-1+o-e,o))}function oC(t,e,n,r,i){const o=1+(i<<1);for(let a=0;a<t;++a)for(let s=0,u=0;s<e+i;++s)s<e&&(u+=n[a+s*t]),s>=i&&(s>=o&&(u-=n[a+(s-o)*t]),r[a+(s-i)*t]=u/Math.min(s+1,e-1+o-s,o))}function aC(t){cs.call(this,null,t)}QF.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,Kt.XW)(QF,cs,{transform(t,e){if(this.value&&!e.changed()&&!t.modified())return e.StopPropagation;var n=e.fork(e.NO_SOURCE|e.NO_FIELDS),r=e.materialize(e.SOURCE).source,i=t.field||Kt.yR,o=GF().smooth(!1!==t.smooth),a=t.thresholds||function(t,e,n){const r=KF(n.levels||10,n.nice,!1!==n.zero);return"shared"!==n.resolve?r:r(t.map((t=>ps(e(t).values))))}(r,i,t),s=null===t.as?null:t.as||"contour",u=[];return r.forEach((e=>{const n=i(e),r=o.size([n.width,n.height])(n.values,(0,Kt.kJ)(a)?a:a(n.values));!function(t,e,n,r){let i=r.scale||e.scale,o=r.translate||e.translate;(0,Kt.mf)(i)&&(i=i(n,r));(0,Kt.mf)(o)&&(o=o(n,r));if((1===i||null==i)&&!o)return;const a=((0,Kt.hj)(i)?i:i[0])||1,s=((0,Kt.hj)(i)?i:i[1])||1,u=o&&o[0]||0,l=o&&o[1]||0;t.forEach(tC(e,a,s,u,l))}(r,n,e,t),r.forEach((t=>{u.push(Oa(e,Ba(null!=s?{[s]:t}:t)))}))})),this.value&&(n.rem=this.value),this.value=n.source=n.add=u,n}}),aC.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 sC=["x","y","weight","size","cellSize","bandwidth"];function uC(t,e){return sC.forEach((n=>null!=e[n]?t[n](e[n]):0)),t}function lC(t){cs.call(this,null,t)}(0,Kt.XW)(aC,cs,{transform(t,e){if(this.value&&!e.changed()&&!t.modified())return e.StopPropagation;var n,r=e.fork(e.NO_SOURCE|e.NO_FIELDS),i=function(t,e){var n,r,i,o,a,s,u=[],l=t=>t(o);if(null==e)u.push(t);else for(n={},r=0,i=t.length;r<i;++r)o=t[r],(s=n[a=e.map(l)])||(n[a]=s=[],s.dims=a,u.push(s)),s.push(o);return u}(e.materialize(e.SOURCE).source,t.groupby),o=(t.groupby||[]).map(Kt.el),a=uC(rC(),t),s=t.as||"grid";return n=i.map((e=>Ba(function(t,e){for(let n=0;n<o.length;++n)t[o[n]]=e[n];return t}({[s]:a(e,t.counts)},e.dims)))),this.value&&(r.rem=this.value),this.value=r.source=r.add=n,r}}),lC.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,Kt.XW)(lC,cs,{transform(t,e){if(this.value&&!e.changed()&&!t.modified())return e.StopPropagation;var n,r,i=e.fork(e.NO_SOURCE|e.NO_FIELDS),o=GF().smooth(!1!==t.smooth),a=t.values,s=t.thresholds||KF(t.count||10,t.nice,!!a),u=t.size;return a||(a=e.materialize(e.SOURCE).source,r=tC(n=uC(rC(),t)(a,!0),n.scale||1,n.scale||1,0,0),u=[n.width,n.height],a=n.values),s=(0,Kt.kJ)(s)?s:s(a),a=o.size(u)(a,s),r&&a.forEach(r),this.value&&(i.rem=this.value),this.value=i.source=i.add=(a||[]).map(Ba),i}});const cC="Feature",fC="FeatureCollection";function hC(t){cs.call(this,null,t)}function dC(t){cs.call(this,null,t)}function pC(t){cs.call(this,null,t)}function gC(t){cs.call(this,null,t)}function mC(t){cs.call(this,[],t),this.generator=HF()}function yC(t){cs.call(this,null,t)}function vC(t){if(!(0,Kt.mf)(t))return!1;const e=(0,Kt.Rg)((0,Kt.Oj)(t));return e.$x||e.$y||e.$value||e.$max}function bC(t){cs.call(this,null,t),this.modified(!0)}function xC(t,e,n){(0,Kt.mf)(t[e])&&t[e](n)}function _C(t,e,n,r){if(isNaN(e)||isNaN(n))return t;var i,o,a,s,u,l,c,f,h,d=t._root,p={data:r},g=t._x0,m=t._y0,y=t._x1,v=t._y1;if(!d)return t._root=p,t;for(;d.length;)if((l=e>=(o=(g+y)/2))?g=o:y=o,(c=n>=(a=(m+v)/2))?m=a:v=a,i=d,!(d=d[f=c<<1|l]))return i[f]=p,t;if(s=+t._x.call(null,d.data),u=+t._y.call(null,d.data),e===s&&n===u)return p.next=d,i?i[f]=p:t._root=p,t;do{i=i?i[f]=new Array(4):t._root=new Array(4),(l=e>=(o=(g+y)/2))?g=o:y=o,(c=n>=(a=(m+v)/2))?m=a:v=a}while((f=c<<1|l)===(h=(u>=a)<<1|s>=o));return i[h]=d,i[f]=p,t}function wC(t,e,n,r,i){this.node=t,this.x0=e,this.y0=n,this.x1=r,this.y1=i}function AC(t){return t[0]}function DC(t){return t[1]}function EC(t,e,n){var r=new FC(null==e?AC:e,null==n?DC:n,NaN,NaN,NaN,NaN);return null==t?r:r.addAll(t)}function FC(t,e,n,r,i,o){this._x=t,this._y=e,this._x0=n,this._y0=r,this._x1=i,this._y1=o,this._root=void 0}function CC(t){for(var e={data:t.data},n=e;t=t.next;)n=n.next={data:t.data};return e}hC.Definition={type:"GeoJSON",metadata:{},params:[{name:"fields",type:"field",array:!0,length:2},{name:"geojson",type:"field"}]},(0,Kt.XW)(hC,cs,{transform(t,e){var n,r=this._features,i=this._points,o=t.fields,a=o&&o[0],s=o&&o[1],u=t.geojson||!o&&Kt.yR,l=e.ADD;n=t.modified()||e.changed(e.REM)||e.modified((0,Kt.Oj)(u))||a&&e.modified((0,Kt.Oj)(a))||s&&e.modified((0,Kt.Oj)(s)),this.value&&!n||(l=e.SOURCE,this._features=r=[],this._points=i=[]),u&&e.visit(l,(t=>r.push(u(t)))),a&&s&&(e.visit(l,(t=>{var e=a(t),n=s(t);null!=e&&null!=n&&(e=+e)===e&&(n=+n)===n&&i.push([e,n])})),r=r.concat({type:cC,geometry:{type:"MultiPoint",coordinates:i}})),this.value={type:fC,features:r}}}),dC.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,Kt.XW)(dC,cs,{transform(t,e){var n=e.fork(e.ALL),r=this.value,i=t.field||Kt.yR,o=t.as||"path",a=n.SOURCE;!r||t.modified()?(this.value=r=LF(t.projection),n.materialize().reflow()):a=i===Kt.yR||e.modified(i.fields)?n.ADD_MOD:n.ADD;const s=function(t,e){const n=t.pointRadius();t.context(null),null!=e&&t.pointRadius(e);return n}(r,t.pointRadius);return n.visit(a,(t=>t[o]=r(i(t)))),r.pointRadius(s),n.modifies(o)}}),pC.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,Kt.XW)(pC,cs,{transform(t,e){var n,r=t.projection,i=t.fields[0],o=t.fields[1],a=t.as||["x","y"],s=a[0],u=a[1];function l(t){const e=r([i(t),o(t)]);e?(t[s]=e[0],t[u]=e[1]):(t[s]=void 0,t[u]=void 0)}return t.modified()?e=e.materialize().reflow(!0).visit(e.SOURCE,l):(n=e.modified(i.fields)||e.modified(o.fields),e.visit(n?e.ADD_MOD:e.ADD,l)),e.modifies(a)}}),gC.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,Kt.XW)(gC,cs,{transform(t,e){var n=e.fork(e.ALL),r=this.value,i=t.as||"shape",o=n.ADD;return r&&!t.modified()||(this.value=r=function(t,e,n){const r=null==n?n=>t(e(n)):r=>{var i=t.pointRadius(),o=t.pointRadius(n)(e(r));return t.pointRadius(i),o};return r.context=e=>(t.context(e),r),r}(LF(t.projection),t.field||(0,Kt.EP)("datum"),t.pointRadius),n.materialize().reflow(),o=n.SOURCE),n.visit(o,(t=>t[i]=r)),n.modifies(i)}}),mC.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,Kt.XW)(mC,cs,{transform(t,e){var n,r=this.value,i=this.generator;if(!r.length||t.modified())for(const o in t)(0,Kt.mf)(i[o])&&i[o](t[o]);return n=i(),r.length?e.mod.push(za(r[0],n)):e.add.push(Ba(n)),r[0]=n,e}}),yC.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,Kt.XW)(yC,cs,{transform(t,e){if(!e.changed()&&!t.modified())return e.StopPropagation;var n=e.materialize(e.SOURCE).source,r="shared"===t.resolve,i=t.field||Kt.yR,o=function(t,e){let n;(0,Kt.mf)(t)?(n=n=>t(n,e),n.dep=vC(t)):t?n=(0,Kt.a9)(t):(n=t=>t.$value/t.$max||0,n.dep=!0);return n}(t.opacity,t),a=function(t,e){let n;(0,Kt.mf)(t)?(n=n=>(0,uf.B8)(t(n,e)),n.dep=vC(t)):n=(0,Kt.a9)((0,uf.B8)(t||"#888"));return n}(t.color,t),s=t.as||"image",u={$x:0,$y:0,$value:0,$max:r?ps(n.map((t=>ps(i(t).values)))):0};return n.forEach((t=>{const e=i(t),n=(0,Kt.l7)({},t,u);r||(n.$max=ps(e.values||[])),t[s]=function(t,e,n,r){const i=t.width,o=t.height,a=t.x1||0,s=t.y1||0,u=t.x2||i,l=t.y2||o,c=t.values,f=c?t=>c[t]:Kt.bM,h=Lc(u-a,l-s),d=h.getContext("2d"),p=d.getImageData(0,0,u-a,l-s),g=p.data;for(let m=s,y=0;m<l;++m){e.$y=m-s;for(let t=a,o=m*i;t<u;++t,y+=4){e.$x=t-a,e.$value=f(t+o);const i=n(e);g[y+0]=i.r,g[y+1]=i.g,g[y+2]=i.b,g[y+3]=~~(255*r(e))}}return d.putImageData(p,0,0),h}(e,n,a.dep?a:(0,Kt.a9)(a(n)),o.dep?o:(0,Kt.a9)(o(n)))})),e.reflow(!0).modifies(s)}}),(0,Kt.XW)(bC,cs,{transform(t,e){let n=this.value;return!n||t.modified("type")?(this.value=n=function(t){const e=UF((t||"mercator").toLowerCase());e||(0,Kt.vU)("Unrecognized projection type: "+t);return e()}(t.type),PF.forEach((e=>{null!=t[e]&&xC(n,e,t[e])}))):PF.forEach((e=>{t.modified(e)&&xC(n,e,t[e])})),null!=t.pointRadius&&n.path.pointRadius(t.pointRadius),t.fit&&function(t,e){const n=function(t){return t=(0,Kt.IX)(t),1===t.length?t[0]:{type:fC,features:t.reduce(((t,e)=>t.concat(function(t){return t.type===fC?t.features:(0,Kt.IX)(t).filter((t=>null!=t)).map((t=>t.type===cC?t:{type:cC,geometry:t}))}(e))),[])}}(e.fit);e.extent?t.fitExtent(e.extent,n):e.size&&t.fitSize(e.size,n)}(n,t),e.fork(e.NO_SOURCE|e.NO_FIELDS)}});var kC=EC.prototype=FC.prototype;function MC(t){return function(){return t}}function SC(t){return 1e-6*(t()-.5)}function $C(t){return t.x+t.vx}function TC(t){return t.y+t.vy}kC.copy=function(){var t,e,n=new FC(this._x,this._y,this._x0,this._y0,this._x1,this._y1),r=this._root;if(!r)return n;if(!r.length)return n._root=CC(r),n;for(t=[{source:r,target:n._root=new Array(4)}];r=t.pop();)for(var i=0;i<4;++i)(e=r.source[i])&&(e.length?t.push({source:e,target:r.target[i]=new Array(4)}):r.target[i]=CC(e));return n},kC.add=function(t){const e=+this._x.call(null,t),n=+this._y.call(null,t);return _C(this.cover(e,n),e,n,t)},kC.addAll=function(t){var e,n,r,i,o=t.length,a=new Array(o),s=new Array(o),u=1/0,l=1/0,c=-1/0,f=-1/0;for(n=0;n<o;++n)isNaN(r=+this._x.call(null,e=t[n]))||isNaN(i=+this._y.call(null,e))||(a[n]=r,s[n]=i,r<u&&(u=r),r>c&&(c=r),i<l&&(l=i),i>f&&(f=i));if(u>c||l>f)return this;for(this.cover(u,l).cover(c,f),n=0;n<o;++n)_C(this,a[n],s[n],t[n]);return this},kC.cover=function(t,e){if(isNaN(t=+t)||isNaN(e=+e))return this;var n=this._x0,r=this._y0,i=this._x1,o=this._y1;if(isNaN(n))i=(n=Math.floor(t))+1,o=(r=Math.floor(e))+1;else{for(var a,s,u=i-n||1,l=this._root;n>t||t>=i||r>e||e>=o;)switch(s=(e<r)<<1|t<n,(a=new Array(4))[s]=l,l=a,u*=2,s){case 0:i=n+u,o=r+u;break;case 1:n=i-u,o=r+u;break;case 2:i=n+u,r=o-u;break;case 3:n=i-u,r=o-u}this._root&&this._root.length&&(this._root=l)}return this._x0=n,this._y0=r,this._x1=i,this._y1=o,this},kC.data=function(){var t=[];return this.visit((function(e){if(!e.length)do{t.push(e.data)}while(e=e.next)})),t},kC.extent=function(t){return arguments.length?this.cover(+t[0][0],+t[0][1]).cover(+t[1][0],+t[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]},kC.find=function(t,e,n){var r,i,o,a,s,u,l,c=this._x0,f=this._y0,h=this._x1,d=this._y1,p=[],g=this._root;for(g&&p.push(new wC(g,c,f,h,d)),null==n?n=1/0:(c=t-n,f=e-n,h=t+n,d=e+n,n*=n);u=p.pop();)if(!(!(g=u.node)||(i=u.x0)>h||(o=u.y0)>d||(a=u.x1)<c||(s=u.y1)<f))if(g.length){var m=(i+a)/2,y=(o+s)/2;p.push(new wC(g[3],m,y,a,s),new wC(g[2],i,y,m,s),new wC(g[1],m,o,a,y),new wC(g[0],i,o,m,y)),(l=(e>=y)<<1|t>=m)&&(u=p[p.length-1],p[p.length-1]=p[p.length-1-l],p[p.length-1-l]=u)}else{var v=t-+this._x.call(null,g.data),b=e-+this._y.call(null,g.data),x=v*v+b*b;if(x<n){var _=Math.sqrt(n=x);c=t-_,f=e-_,h=t+_,d=e+_,r=g.data}}return r},kC.remove=function(t){if(isNaN(o=+this._x.call(null,t))||isNaN(a=+this._y.call(null,t)))return this;var e,n,r,i,o,a,s,u,l,c,f,h,d=this._root,p=this._x0,g=this._y0,m=this._x1,y=this._y1;if(!d)return this;if(d.length)for(;;){if((l=o>=(s=(p+m)/2))?p=s:m=s,(c=a>=(u=(g+y)/2))?g=u:y=u,e=d,!(d=d[f=c<<1|l]))return this;if(!d.length)break;(e[f+1&3]||e[f+2&3]||e[f+3&3])&&(n=e,h=f)}for(;d.data!==t;)if(r=d,!(d=d.next))return this;return(i=d.next)&&delete d.next,r?(i?r.next=i:delete r.next,this):e?(i?e[f]=i:delete e[f],(d=e[0]||e[1]||e[2]||e[3])&&d===(e[3]||e[2]||e[1]||e[0])&&!d.length&&(n?n[h]=d:this._root=d),this):(this._root=i,this)},kC.removeAll=function(t){for(var e=0,n=t.length;e<n;++e)this.remove(t[e]);return this},kC.root=function(){return this._root},kC.size=function(){var t=0;return this.visit((function(e){if(!e.length)do{++t}while(e=e.next)})),t},kC.visit=function(t){var e,n,r,i,o,a,s=[],u=this._root;for(u&&s.push(new wC(u,this._x0,this._y0,this._x1,this._y1));e=s.pop();)if(!t(u=e.node,r=e.x0,i=e.y0,o=e.x1,a=e.y1)&&u.length){var l=(r+o)/2,c=(i+a)/2;(n=u[3])&&s.push(new wC(n,l,c,o,a)),(n=u[2])&&s.push(new wC(n,r,c,l,a)),(n=u[1])&&s.push(new wC(n,l,i,o,c)),(n=u[0])&&s.push(new wC(n,r,i,l,c))}return this},kC.visitAfter=function(t){var e,n=[],r=[];for(this._root&&n.push(new wC(this._root,this._x0,this._y0,this._x1,this._y1));e=n.pop();){var i=e.node;if(i.length){var o,a=e.x0,s=e.y0,u=e.x1,l=e.y1,c=(a+u)/2,f=(s+l)/2;(o=i[0])&&n.push(new wC(o,a,s,c,f)),(o=i[1])&&n.push(new wC(o,c,s,u,f)),(o=i[2])&&n.push(new wC(o,a,f,c,l)),(o=i[3])&&n.push(new wC(o,c,f,u,l))}r.push(e)}for(;e=r.pop();)t(e.node,e.x0,e.y0,e.x1,e.y1);return this},kC.x=function(t){return arguments.length?(this._x=t,this):this._x},kC.y=function(t){return arguments.length?(this._y=t,this):this._y};var BC={value:()=>{}};function NC(){for(var t,e=0,n=arguments.length,r={};e<n;++e){if(!(t=arguments[e]+"")||t in r||/[\s.]/.test(t))throw new Error("illegal type: "+t);r[t]=[]}return new OC(r)}function OC(t){this._=t}function zC(t,e){for(var n,r=0,i=t.length;r<i;++r)if((n=t[r]).name===e)return n.value}function RC(t,e,n){for(var r=0,i=t.length;r<i;++r)if(t[r].name===e){t[r]=BC,t=t.slice(0,r).concat(t.slice(r+1));break}return null!=n&&t.push({name:e,value:n}),t}OC.prototype=NC.prototype={constructor:OC,on:function(t,e){var n,r,i=this._,o=(r=i,(t+"").trim().split(/^|\s+/).map((function(t){var e="",n=t.indexOf(".");if(n>=0&&(e=t.slice(n+1),t=t.slice(0,n)),t&&!r.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:e}}))),a=-1,s=o.length;if(!(arguments.length<2)){if(null!=e&&"function"!==typeof e)throw new Error("invalid callback: "+e);for(;++a<s;)if(n=(t=o[a]).type)i[n]=RC(i[n],t.name,e);else if(null==e)for(n in i)i[n]=RC(i[n],t.name,null);return this}for(;++a<s;)if((n=(t=o[a]).type)&&(n=zC(i[n],t.name)))return n},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new OC(t)},call:function(t,e){if((n=arguments.length-2)>0)for(var n,r,i=new Array(n),o=0;o<n;++o)i[o]=arguments[o+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(o=0,n=(r=this._[t]).length;o<n;++o)r[o].value.apply(e,i)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var r=this._[t],i=0,o=r.length;i<o;++i)r[i].value.apply(e,n)}};const PC=NC;var UC=n(22583);const LC=1664525,jC=1013904223,IC=4294967296;function qC(t){return t.x}function WC(t){return t.y}var HC=10,XC=Math.PI*(3-Math.sqrt(5));function YC(t){var e,n=1,r=.001,i=1-Math.pow(r,1/300),o=0,a=.6,s=new Map,u=(0,UC.HT)(f),l=PC("tick","end"),c=function(){let t=1;return()=>(t=(LC*t+jC)%IC)/IC}();function f(){h(),l.call("tick",e),n<r&&(u.stop(),l.call("end",e))}function h(r){var u,l,c=t.length;void 0===r&&(r=1);for(var f=0;f<r;++f)for(n+=(o-n)*i,s.forEach((function(t){t(n)})),u=0;u<c;++u)null==(l=t[u]).fx?l.x+=l.vx*=a:(l.x=l.fx,l.vx=0),null==l.fy?l.y+=l.vy*=a:(l.y=l.fy,l.vy=0);return e}function d(){for(var e,n=0,r=t.length;n<r;++n){if((e=t[n]).index=n,null!=e.fx&&(e.x=e.fx),null!=e.fy&&(e.y=e.fy),isNaN(e.x)||isNaN(e.y)){var i=HC*Math.sqrt(.5+n),o=n*XC;e.x=i*Math.cos(o),e.y=i*Math.sin(o)}(isNaN(e.vx)||isNaN(e.vy))&&(e.vx=e.vy=0)}}function p(e){return e.initialize&&e.initialize(t,c),e}return null==t&&(t=[]),d(),e={tick:h,restart:function(){return u.restart(f),e},stop:function(){return u.stop(),e},nodes:function(n){return arguments.length?(t=n,d(),s.forEach(p),e):t},alpha:function(t){return arguments.length?(n=+t,e):n},alphaMin:function(t){return arguments.length?(r=+t,e):r},alphaDecay:function(t){return arguments.length?(i=+t,e):+i},alphaTarget:function(t){return arguments.length?(o=+t,e):o},velocityDecay:function(t){return arguments.length?(a=1-t,e):1-a},randomSource:function(t){return arguments.length?(c=t,s.forEach(p),e):c},force:function(t,n){return arguments.length>1?(null==n?s.delete(t):s.set(t,p(n)),e):s.get(t)},find:function(e,n,r){var i,o,a,s,u,l=0,c=t.length;for(null==r?r=1/0:r*=r,l=0;l<c;++l)(a=(i=e-(s=t[l]).x)*i+(o=n-s.y)*o)<r&&(u=s,r=a);return u},on:function(t,n){return arguments.length>1?(l.on(t,n),e):l.on(t)}}}function GC(t){return t.index}function VC(t,e){var n=t.get(e);if(!n)throw new Error("node not found: "+e);return n}const JC={center:function(t,e){var n,r=1;function i(){var i,o,a=n.length,s=0,u=0;for(i=0;i<a;++i)s+=(o=n[i]).x,u+=o.y;for(s=(s/a-t)*r,u=(u/a-e)*r,i=0;i<a;++i)(o=n[i]).x-=s,o.y-=u}return null==t&&(t=0),null==e&&(e=0),i.initialize=function(t){n=t},i.x=function(e){return arguments.length?(t=+e,i):t},i.y=function(t){return arguments.length?(e=+t,i):e},i.strength=function(t){return arguments.length?(r=+t,i):r},i},collide:function(t){var e,n,r,i=1,o=1;function a(){for(var t,a,u,l,c,f,h,d=e.length,p=0;p<o;++p)for(a=EC(e,$C,TC).visitAfter(s),t=0;t<d;++t)u=e[t],f=n[u.index],h=f*f,l=u.x+u.vx,c=u.y+u.vy,a.visit(g);function g(t,e,n,o,a){var s=t.data,d=t.r,p=f+d;if(!s)return e>l+p||o<l-p||n>c+p||a<c-p;if(s.index>u.index){var g=l-s.x-s.vx,m=c-s.y-s.vy,y=g*g+m*m;y<p*p&&(0===g&&(y+=(g=SC(r))*g),0===m&&(y+=(m=SC(r))*m),y=(p-(y=Math.sqrt(y)))/y*i,u.vx+=(g*=y)*(p=(d*=d)/(h+d)),u.vy+=(m*=y)*p,s.vx-=g*(p=1-p),s.vy-=m*p)}}}function s(t){if(t.data)return t.r=n[t.data.index];for(var e=t.r=0;e<4;++e)t[e]&&t[e].r>t.r&&(t.r=t[e].r)}function u(){if(e){var r,i,o=e.length;for(n=new Array(o),r=0;r<o;++r)i=e[r],n[i.index]=+t(i,r,e)}}return"function"!==typeof t&&(t=MC(null==t?1:+t)),a.initialize=function(t,n){e=t,r=n,u()},a.iterations=function(t){return arguments.length?(o=+t,a):o},a.strength=function(t){return arguments.length?(i=+t,a):i},a.radius=function(e){return arguments.length?(t="function"===typeof e?e:MC(+e),u(),a):t},a},nbody:function(){var t,e,n,r,i,o=MC(-30),a=1,s=1/0,u=.81;function l(n){var i,o=t.length,a=EC(t,qC,WC).visitAfter(f);for(r=n,i=0;i<o;++i)e=t[i],a.visit(h)}function c(){if(t){var e,n,r=t.length;for(i=new Array(r),e=0;e<r;++e)n=t[e],i[n.index]=+o(n,e,t)}}function f(t){var e,n,r,o,a,s=0,u=0;if(t.length){for(r=o=a=0;a<4;++a)(e=t[a])&&(n=Math.abs(e.value))&&(s+=e.value,u+=n,r+=n*e.x,o+=n*e.y);t.x=r/u,t.y=o/u}else{(e=t).x=e.data.x,e.y=e.data.y;do{s+=i[e.data.index]}while(e=e.next)}t.value=s}function h(t,o,l,c){if(!t.value)return!0;var f=t.x-e.x,h=t.y-e.y,d=c-o,p=f*f+h*h;if(d*d/u<p)return p<s&&(0===f&&(p+=(f=SC(n))*f),0===h&&(p+=(h=SC(n))*h),p<a&&(p=Math.sqrt(a*p)),e.vx+=f*t.value*r/p,e.vy+=h*t.value*r/p),!0;if(!(t.length||p>=s)){(t.data!==e||t.next)&&(0===f&&(p+=(f=SC(n))*f),0===h&&(p+=(h=SC(n))*h),p<a&&(p=Math.sqrt(a*p)));do{t.data!==e&&(d=i[t.data.index]*r/p,e.vx+=f*d,e.vy+=h*d)}while(t=t.next)}}return l.initialize=function(e,r){t=e,n=r,c()},l.strength=function(t){return arguments.length?(o="function"===typeof t?t:MC(+t),c(),l):o},l.distanceMin=function(t){return arguments.length?(a=t*t,l):Math.sqrt(a)},l.distanceMax=function(t){return arguments.length?(s=t*t,l):Math.sqrt(s)},l.theta=function(t){return arguments.length?(u=t*t,l):Math.sqrt(u)},l},link:function(t){var e,n,r,i,o,a,s=GC,u=function(t){return 1/Math.min(i[t.source.index],i[t.target.index])},l=MC(30),c=1;function f(r){for(var i=0,s=t.length;i<c;++i)for(var u,l,f,h,d,p,g,m=0;m<s;++m)l=(u=t[m]).source,h=(f=u.target).x+f.vx-l.x-l.vx||SC(a),d=f.y+f.vy-l.y-l.vy||SC(a),h*=p=((p=Math.sqrt(h*h+d*d))-n[m])/p*r*e[m],d*=p,f.vx-=h*(g=o[m]),f.vy-=d*g,l.vx+=h*(g=1-g),l.vy+=d*g}function h(){if(r){var a,u,l=r.length,c=t.length,f=new Map(r.map(((t,e)=>[s(t,e,r),t])));for(a=0,i=new Array(l);a<c;++a)(u=t[a]).index=a,"object"!==typeof u.source&&(u.source=VC(f,u.source)),"object"!==typeof u.target&&(u.target=VC(f,u.target)),i[u.source.index]=(i[u.source.index]||0)+1,i[u.target.index]=(i[u.target.index]||0)+1;for(a=0,o=new Array(c);a<c;++a)u=t[a],o[a]=i[u.source.index]/(i[u.source.index]+i[u.target.index]);e=new Array(c),d(),n=new Array(c),p()}}function d(){if(r)for(var n=0,i=t.length;n<i;++n)e[n]=+u(t[n],n,t)}function p(){if(r)for(var e=0,i=t.length;e<i;++e)n[e]=+l(t[e],e,t)}return null==t&&(t=[]),f.initialize=function(t,e){r=t,a=e,h()},f.links=function(e){return arguments.length?(t=e,h(),f):t},f.id=function(t){return arguments.length?(s=t,f):s},f.iterations=function(t){return arguments.length?(c=+t,f):c},f.strength=function(t){return arguments.length?(u="function"===typeof t?t:MC(+t),d(),f):u},f.distance=function(t){return arguments.length?(l="function"===typeof t?t:MC(+t),p(),f):l},f},x:function(t){var e,n,r,i=MC(.1);function o(t){for(var i,o=0,a=e.length;o<a;++o)(i=e[o]).vx+=(r[o]-i.x)*n[o]*t}function a(){if(e){var o,a=e.length;for(n=new Array(a),r=new Array(a),o=0;o<a;++o)n[o]=isNaN(r[o]=+t(e[o],o,e))?0:+i(e[o],o,e)}}return"function"!==typeof t&&(t=MC(null==t?0:+t)),o.initialize=function(t){e=t,a()},o.strength=function(t){return arguments.length?(i="function"===typeof t?t:MC(+t),a(),o):i},o.x=function(e){return arguments.length?(t="function"===typeof e?e:MC(+e),a(),o):t},o},y:function(t){var e,n,r,i=MC(.1);function o(t){for(var i,o=0,a=e.length;o<a;++o)(i=e[o]).vy+=(r[o]-i.y)*n[o]*t}function a(){if(e){var o,a=e.length;for(n=new Array(a),r=new Array(a),o=0;o<a;++o)n[o]=isNaN(r[o]=+t(e[o],o,e))?0:+i(e[o],o,e)}}return"function"!==typeof t&&(t=MC(null==t?0:+t)),o.initialize=function(t){e=t,a()},o.strength=function(t){return arguments.length?(i="function"===typeof t?t:MC(+t),a(),o):i},o.y=function(e){return arguments.length?(t="function"===typeof e?e:MC(+e),a(),o):t},o}},ZC="forces",KC=["alpha","alphaMin","alphaTarget","velocityDecay","forces"],QC=["static","iterations"],tk=["x","y","vx","vy"];function ek(t){cs.call(this,null,t)}function nk(t,e,n,r){var i,o,a,s,u=(0,Kt.IX)(e.forces);for(i=0,o=KC.length;i<o;++i)(a=KC[i])!==ZC&&e.modified(a)&&t[a](e[a]);for(i=0,o=u.length;i<o;++i)s=ZC+i,(a=n||e.modified(ZC,i)?ik(u[i]):r&&rk(u[i],r)?t.force(s):null)&&t.force(s,a);for(o=t.numForces||0;i<o;++i)t.force(ZC+i,null);return t.numForces=u.length,t}function rk(t,e){var n,r;for(n in t)if((0,Kt.mf)(r=t[n])&&e.modified((0,Kt.Oj)(r)))return 1;return 0}function ik(t){var e,n;for(n in(0,Kt.nr)(JC,t.force)||(0,Kt.vU)("Unrecognized force: "+t.force),e=JC[t.force](),t)(0,Kt.mf)(e[n])&&ok(e[n],t[n],t);return e}function ok(t,e,n){t((0,Kt.mf)(e)?t=>e(t,n):e)}function ak(t){var e=0,n=t.children,r=n&&n.length;if(r)for(;--r>=0;)e+=n[r].value;else e=1;t.value=e}function sk(t,e){t instanceof Map?(t=[void 0,t],void 0===e&&(e=lk)):void 0===e&&(e=uk);for(var n,r,i,o,a,s=new hk(t),u=[s];n=u.pop();)if((i=e(n.data))&&(a=(i=Array.from(i)).length))for(n.children=i,o=a-1;o>=0;--o)u.push(r=i[o]=new hk(i[o])),r.parent=n,r.depth=n.depth+1;return s.eachBefore(fk)}function uk(t){return t.children}function lk(t){return Array.isArray(t)?t[1]:null}function ck(t){void 0!==t.data.value&&(t.value=t.data.value),t.data=t.data.data}function fk(t){var e=0;do{t.height=e}while((t=t.parent)&&t.height<++e)}function hk(t){this.data=t,this.depth=this.height=0,this.parent=null}function dk(t){return null==t?null:pk(t)}function pk(t){if("function"!==typeof t)throw new Error;return t}function gk(){return 0}function mk(t){return function(){return t}}ek.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:tk}]},(0,Kt.XW)(ek,cs,{transform(t,e){var n,r,i=this.value,o=e.changed(e.ADD_REM),a=t.modified(KC),s=t.iterations||300;if(i?(o&&(e.modifies("index"),i.nodes(e.source)),(a||e.changed(e.MOD))&&nk(i,t,0,e)):(this.value=i=function(t,e){const n=YC(t),r=n.stop,i=n.restart;let o=!1;return n.stopped=()=>o,n.restart=()=>(o=!1,i()),n.stop=()=>(o=!0,r()),nk(n,e,!0).on("end",(()=>o=!0))}(e.source,t),i.on("tick",(n=e.dataflow,r=this,()=>n.touch(r).run())),t.static||(o=!0,i.tick()),e.modifies("index")),a||o||t.modified(QC)||e.changed()&&t.restart)if(i.alpha(Math.max(i.alpha(),t.alpha||1)).alphaDecay(1-Math.pow(i.alphaMin(),1/s)),t.static)for(i.stop();--s>=0;)i.tick();else if(i.stopped()&&i.restart(),!o)return e.StopPropagation;return this.finish(t,e)},finish(t,e){const n=e.dataflow;for(let s,u=this._argops,l=0,c=u.length;l<c;++l)if(s=u[l],s.name===ZC&&"link"===s.op._argval.force)for(var r,i=s.op._argops,o=0,a=i.length;o<a;++o)if("links"===i[o].name&&(r=i[o].op.source)){n.pulse(r,n.changeset().reflow());break}return e.reflow(t.modified()).modifies(tk)}}),hk.prototype=sk.prototype={constructor:hk,count:function(){return this.eachAfter(ak)},each:function(t,e){let n=-1;for(const r of this)t.call(e,r,++n,this);return this},eachAfter:function(t,e){for(var n,r,i,o=this,a=[o],s=[],u=-1;o=a.pop();)if(s.push(o),n=o.children)for(r=0,i=n.length;r<i;++r)a.push(n[r]);for(;o=s.pop();)t.call(e,o,++u,this);return this},eachBefore:function(t,e){for(var n,r,i=this,o=[i],a=-1;i=o.pop();)if(t.call(e,i,++a,this),n=i.children)for(r=n.length-1;r>=0;--r)o.push(n[r]);return this},find:function(t,e){let n=-1;for(const r of this)if(t.call(e,r,++n,this))return r},sum:function(t){return this.eachAfter((function(e){for(var n=+t(e.data)||0,r=e.children,i=r&&r.length;--i>=0;)n+=r[i].value;e.value=n}))},sort:function(t){return this.eachBefore((function(e){e.children&&e.children.sort(t)}))},path:function(t){for(var e=this,n=function(t,e){if(t===e)return t;var n=t.ancestors(),r=e.ancestors(),i=null;t=n.pop(),e=r.pop();for(;t===e;)i=t,t=n.pop(),e=r.pop();return i}(e,t),r=[e];e!==n;)e=e.parent,r.push(e);for(var i=r.length;t!==n;)r.splice(i,0,t),t=t.parent;return r},ancestors:function(){for(var t=this,e=[t];t=t.parent;)e.push(t);return e},descendants:function(){return Array.from(this)},leaves:function(){var t=[];return this.eachBefore((function(e){e.children||t.push(e)})),t},links:function(){var t=this,e=[];return t.each((function(n){n!==t&&e.push({source:n.parent,target:n})})),e},copy:function(){return sk(this).eachBefore(ck)},[Symbol.iterator]:function*(){var t,e,n,r,i=this,o=[i];do{for(t=o.reverse(),o=[];i=t.pop();)if(yield i,e=i.children)for(n=0,r=e.length;n<r;++n)o.push(e[n])}while(o.length)}};const yk=1664525,vk=1013904223,bk=4294967296;function xk(t,e){for(var n,r,i=0,o=(t=function(t,e){let n,r,i=t.length;for(;i;)r=e()*i--|0,n=t[i],t[i]=t[r],t[r]=n;return t}(Array.from(t),e)).length,a=[];i<o;)n=t[i],r&&Ak(r,n)?++i:(r=Ek(a=_k(a,n)),i=0);return r}function _k(t,e){var n,r;if(Dk(e,t))return[e];for(n=0;n<t.length;++n)if(wk(e,t[n])&&Dk(Fk(t[n],e),t))return[t[n],e];for(n=0;n<t.length-1;++n)for(r=n+1;r<t.length;++r)if(wk(Fk(t[n],t[r]),e)&&wk(Fk(t[n],e),t[r])&&wk(Fk(t[r],e),t[n])&&Dk(Ck(t[n],t[r],e),t))return[t[n],t[r],e];throw new Error}function wk(t,e){var n=t.r-e.r,r=e.x-t.x,i=e.y-t.y;return n<0||n*n<r*r+i*i}function Ak(t,e){var n=t.r-e.r+1e-9*Math.max(t.r,e.r,1),r=e.x-t.x,i=e.y-t.y;return n>0&&n*n>r*r+i*i}function Dk(t,e){for(var n=0;n<e.length;++n)if(!Ak(t,e[n]))return!1;return!0}function Ek(t){switch(t.length){case 1:return function(t){return{x:t.x,y:t.y,r:t.r}}(t[0]);case 2:return Fk(t[0],t[1]);case 3:return Ck(t[0],t[1],t[2])}}function Fk(t,e){var n=t.x,r=t.y,i=t.r,o=e.x,a=e.y,s=e.r,u=o-n,l=a-r,c=s-i,f=Math.sqrt(u*u+l*l);return{x:(n+o+u/f*c)/2,y:(r+a+l/f*c)/2,r:(f+i+s)/2}}function Ck(t,e,n){var r=t.x,i=t.y,o=t.r,a=e.x,s=e.y,u=e.r,l=n.x,c=n.y,f=n.r,h=r-a,d=r-l,p=i-s,g=i-c,m=u-o,y=f-o,v=r*r+i*i-o*o,b=v-a*a-s*s+u*u,x=v-l*l-c*c+f*f,_=d*p-h*g,w=(p*x-g*b)/(2*_)-r,A=(g*m-p*y)/_,D=(d*b-h*x)/(2*_)-i,E=(h*y-d*m)/_,F=A*A+E*E-1,C=2*(o+w*A+D*E),k=w*w+D*D-o*o,M=-(Math.abs(F)>1e-6?(C+Math.sqrt(C*C-4*F*k))/(2*F):k/C);return{x:r+w+A*M,y:i+D+E*M,r:M}}function kk(t,e,n){var r,i,o,a,s=t.x-e.x,u=t.y-e.y,l=s*s+u*u;l?(i=e.r+n.r,i*=i,a=t.r+n.r,i>(a*=a)?(r=(l+a-i)/(2*l),o=Math.sqrt(Math.max(0,a/l-r*r)),n.x=t.x-r*s-o*u,n.y=t.y-r*u+o*s):(r=(l+i-a)/(2*l),o=Math.sqrt(Math.max(0,i/l-r*r)),n.x=e.x+r*s-o*u,n.y=e.y+r*u+o*s)):(n.x=e.x+n.r,n.y=e.y)}function Mk(t,e){var n=t.r+e.r-1e-6,r=e.x-t.x,i=e.y-t.y;return n>0&&n*n>r*r+i*i}function Sk(t){var e=t._,n=t.next._,r=e.r+n.r,i=(e.x*n.r+n.x*e.r)/r,o=(e.y*n.r+n.y*e.r)/r;return i*i+o*o}function $k(t){this._=t,this.next=null,this.previous=null}function Tk(t,e){if(!(o=(t=function(t){return"object"===typeof t&&"length"in t?t:Array.from(t)}(t)).length))return 0;var n,r,i,o,a,s,u,l,c,f,h;if((n=t[0]).x=0,n.y=0,!(o>1))return n.r;if(r=t[1],n.x=-r.r,r.x=n.r,r.y=0,!(o>2))return n.r+r.r;kk(r,n,i=t[2]),n=new $k(n),r=new $k(r),i=new $k(i),n.next=i.previous=r,r.next=n.previous=i,i.next=r.previous=n;t:for(u=3;u<o;++u){kk(n._,r._,i=t[u]),i=new $k(i),l=r.next,c=n.previous,f=r._.r,h=n._.r;do{if(f<=h){if(Mk(l._,i._)){r=l,n.next=r,r.previous=n,--u;continue t}f+=l._.r,l=l.next}else{if(Mk(c._,i._)){(n=c).next=r,r.previous=n,--u;continue t}h+=c._.r,c=c.previous}}while(l!==c.next);for(i.previous=n,i.next=r,n.next=r.previous=r=i,a=Sk(n);(i=i.next)!==r;)(s=Sk(i))<a&&(n=i,a=s);r=n.next}for(n=[r._],i=r;(i=i.next)!==r;)n.push(i._);for(i=xk(n,e),u=0;u<o;++u)(n=t[u]).x-=i.x,n.y-=i.y;return i.r}function Bk(t){return Math.sqrt(t.value)}function Nk(t){return function(e){e.children||(e.r=Math.max(0,+t(e)||0))}}function Ok(t,e,n){return function(r){if(i=r.children){var i,o,a,s=i.length,u=t(r)*e||0;if(u)for(o=0;o<s;++o)i[o].r+=u;if(a=Tk(i,n),u)for(o=0;o<s;++o)i[o].r-=u;r.r=a+u}}}function zk(t){return function(e){var n=e.parent;e.r*=t,n&&(e.x=n.x+t*e.x,e.y=n.y+t*e.y)}}function Rk(t){t.x0=Math.round(t.x0),t.y0=Math.round(t.y0),t.x1=Math.round(t.x1),t.y1=Math.round(t.y1)}function Pk(t,e,n,r,i){for(var o,a=t.children,s=-1,u=a.length,l=t.value&&(r-e)/t.value;++s<u;)(o=a[s]).y0=n,o.y1=i,o.x0=e,o.x1=e+=o.value*l}var Uk={depth:-1},Lk={},jk={};function Ik(t){return t.id}function qk(t){return t.parentId}function Wk(){var t,e=Ik,n=qk;function r(r){var i,o,a,s,u,l,c,f,h=Array.from(r),d=e,p=n,g=new Map;if(null!=t){const e=h.map(((e,n)=>function(t){t=`${t}`;let e=t.length;Xk(t,e-1)&&!Xk(t,e-2)&&(t=t.slice(0,-1));return"/"===t[0]?t:`/${t}`}(t(e,n,r)))),n=e.map(Hk),i=new Set(e).add("");for(const t of n)i.has(t)||(i.add(t),e.push(t),n.push(Hk(t)),h.push(jk));d=(t,n)=>e[n],p=(t,e)=>n[e]}for(a=0,i=h.length;a<i;++a)o=h[a],l=h[a]=new hk(o),null!=(c=d(o,a,r))&&(c+="")&&(f=l.id=c,g.set(f,g.has(f)?Lk:l)),null!=(c=p(o,a,r))&&(c+="")&&(l.parent=c);for(a=0;a<i;++a)if(c=(l=h[a]).parent){if(!(u=g.get(c)))throw new Error("missing: "+c);if(u===Lk)throw new Error("ambiguous: "+c);u.children?u.children.push(l):u.children=[l],l.parent=u}else{if(s)throw new Error("multiple roots");s=l}if(!s)throw new Error("no root");if(null!=t){for(;s.data===jk&&1===s.children.length;)s=s.children[0],--i;for(let t=h.length-1;t>=0&&(l=h[t]).data===jk;--t)l.data=null}if(s.parent=Uk,s.eachBefore((function(t){t.depth=t.parent.depth+1,--i})).eachBefore(fk),s.parent=null,i>0)throw new Error("cycle");return s}return r.id=function(t){return arguments.length?(e=dk(t),r):e},r.parentId=function(t){return arguments.length?(n=dk(t),r):n},r.path=function(e){return arguments.length?(t=dk(e),r):t},r}function Hk(t){let e=t.length;if(e<2)return"";for(;--e>1&&!Xk(t,e););return t.slice(0,e)}function Xk(t,e){if("/"===t[e]){let n=0;for(;e>0&&"\\"===t[--e];)++n;if(0===(1&n))return!0}return!1}function Yk(t,e){return t.parent===e.parent?1:2}function Gk(t){var e=t.children;return e?e[0]:t.t}function Vk(t){var e=t.children;return e?e[e.length-1]:t.t}function Jk(t,e,n){var r=n/(e.i-t.i);e.c-=r,e.s+=n,t.c+=r,e.z+=n,e.m+=n}function Zk(t,e,n){return t.a.parent===e.parent?t.a:n}function Kk(t,e){this._=t,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=e}function Qk(t,e){return t.parent===e.parent?1:2}function tM(t,e){return t+e.x}function eM(t,e){return Math.max(t,e.y)}function nM(t,e,n,r,i){for(var o,a=t.children,s=-1,u=a.length,l=t.value&&(i-n)/t.value;++s<u;)(o=a[s]).x0=e,o.x1=r,o.y0=n,o.y1=n+=o.value*l}Kk.prototype=Object.create(hk.prototype);var rM=(1+Math.sqrt(5))/2;function iM(t,e,n,r,i,o){for(var a,s,u,l,c,f,h,d,p,g,m,y=[],v=e.children,b=0,x=0,_=v.length,w=e.value;b<_;){u=i-n,l=o-r;do{c=v[x++].value}while(!c&&x<_);for(f=h=c,m=c*c*(g=Math.max(l/u,u/l)/(w*t)),p=Math.max(h/m,m/f);x<_;++x){if(c+=s=v[x].value,s<f&&(f=s),s>h&&(h=s),m=c*c*g,(d=Math.max(h/m,m/f))>p){c-=s;break}p=d}y.push(a={value:c,dice:u<l,children:v.slice(b,x)}),a.dice?Pk(a,n,r,i,w?r+=l*c/w:o):nM(a,n,r,w?n+=u*c/w:i,o),w-=c,b=x}return y}const oM=function t(e){function n(t,n,r,i,o){iM(e,t,n,r,i,o)}return n.ratio=function(e){return t((e=+e)>1?e:1)},n}(rM),aM=function t(e){function n(t,n,r,i,o){if((a=t._squarify)&&a.ratio===e)for(var a,s,u,l,c,f=-1,h=a.length,d=t.value;++f<h;){for(u=(s=a[f]).children,l=s.value=0,c=u.length;l<c;++l)s.value+=u[l].value;s.dice?Pk(s,n,r,i,d?r+=(o-r)*s.value/d:o):nM(s,n,r,d?n+=(i-n)*s.value/d:i,o),d-=s.value}else t._squarify=a=iM(e,t,n,r,i,o),a.ratio=e}return n.ratio=function(e){return t((e=+e)>1?e:1)},n}(rM);function sM(t,e,n){const r={};return t.each((t=>{const i=t.data;n(i)&&(r[e(i)]=t)})),t.lookup=r,t}function uM(t){cs.call(this,null,t)}uM.Definition={type:"Nest",metadata:{treesource:!0,changes:!0},params:[{name:"keys",type:"field",array:!0},{name:"generate",type:"boolean"}]};const lM=t=>t.values;function cM(){const t=[],e={entries:t=>r(n(t,0),0),key:n=>(t.push(n),e)};function n(e,r){if(r>=t.length)return e;const i=e.length,o=t[r++],a={},s={};let u,l,c,f=-1;for(;++f<i;)u=o(l=e[f])+"",(c=a[u])?c.push(l):a[u]=[l];for(u in a)s[u]=n(a[u],r);return s}function r(e,n){if(++n>t.length)return e;const i=[];for(const t in e)i.push({key:t,values:r(e[t],n)});return i}return e}function fM(t){cs.call(this,null,t)}(0,Kt.XW)(uM,cs,{transform(t,e){e.source||(0,Kt.vU)("Nest transform requires an upstream data source.");var n=t.generate,r=t.modified(),i=e.clone(),o=this.value;return(!o||r||e.changed())&&(o&&o.each((t=>{t.children&&Sa(t.data)&&i.rem.push(t.data)})),this.value=o=sk({values:(0,Kt.IX)(t.keys).reduce(((t,e)=>(t.key(e),t)),cM()).entries(i.source)},lM),n&&o.each((t=>{t.children&&(t=Ba(t.data),i.add.push(t),i.source.push(t))})),sM(o,$a,$a)),i.source.root=o,i}});const hM=(t,e)=>t.parent===e.parent?1:2;(0,Kt.XW)(fM,cs,{transform(t,e){e.source&&e.source.root||(0,Kt.vU)(this.constructor.name+" transform requires a backing tree data source.");const n=this.layout(t.method),r=this.fields,i=e.source.root,o=t.as||r;t.field?i.sum(t.field):i.count(),t.sort&&i.sort(Ra(t.sort,(t=>t.data))),function(t,e,n){for(let r,i=0,o=e.length;i<o;++i)r=e[i],r in n&&t[r](n[r])}(n,this.params,t),n.separation&&n.separation(!1!==t.separation?hM:Kt.kX);try{this.value=n(i)}catch(a){(0,Kt.vU)(a)}return i.each((t=>function(t,e,n){const r=t.data,i=e.length-1;for(let o=0;o<i;++o)r[n[o]]=t[e[o]];r[n[i]]=t.children?t.children.length:0}(t,r,o))),e.reflow(t.modified()).modifies(o).modifies("leaf")}});const dM=["x","y","r","depth","children"];function pM(t){fM.call(this,t)}pM.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:dM.length,default:dM}]},(0,Kt.XW)(pM,fM,{layout:function(){var t=null,e=1,n=1,r=gk;function i(i){const o=function(){let t=1;return()=>(t=(yk*t+vk)%bk)/bk}();return i.x=e/2,i.y=n/2,t?i.eachBefore(Nk(t)).eachAfter(Ok(r,.5,o)).eachBefore(zk(1)):i.eachBefore(Nk(Bk)).eachAfter(Ok(gk,1,o)).eachAfter(Ok(r,i.r/Math.min(e,n),o)).eachBefore(zk(Math.min(e,n)/(2*i.r))),i}return i.radius=function(e){return arguments.length?(t=dk(e),i):t},i.size=function(t){return arguments.length?(e=+t[0],n=+t[1],i):[e,n]},i.padding=function(t){return arguments.length?(r="function"===typeof t?t:mk(+t),i):r},i},params:["radius","size","padding"],fields:dM});const gM=["x0","y0","x1","y1","depth","children"];function mM(t){fM.call(this,t)}function yM(t){cs.call(this,null,t)}mM.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:gM.length,default:gM}]},(0,Kt.XW)(mM,fM,{layout:function(){var t=1,e=1,n=0,r=!1;function i(i){var o=i.height+1;return i.x0=i.y0=n,i.x1=t,i.y1=e/o,i.eachBefore(function(t,e){return function(r){r.children&&Pk(r,r.x0,t*(r.depth+1)/e,r.x1,t*(r.depth+2)/e);var i=r.x0,o=r.y0,a=r.x1-n,s=r.y1-n;a<i&&(i=a=(i+a)/2),s<o&&(o=s=(o+s)/2),r.x0=i,r.y0=o,r.x1=a,r.y1=s}}(e,o)),r&&i.eachBefore(Rk),i}return i.round=function(t){return arguments.length?(r=!!t,i):r},i.size=function(n){return arguments.length?(t=+n[0],e=+n[1],i):[t,e]},i.padding=function(t){return arguments.length?(n=+t,i):n},i},params:["size","round","padding"],fields:gM}),yM.Definition={type:"Stratify",metadata:{treesource:!0},params:[{name:"key",type:"field",required:!0},{name:"parentKey",type:"field",required:!0}]},(0,Kt.XW)(yM,cs,{transform(t,e){e.source||(0,Kt.vU)("Stratify transform requires an upstream data source.");let n=this.value;const r=t.modified(),i=e.fork(e.ALL).materialize(e.SOURCE),o=!n||r||e.changed(e.ADD_REM)||e.modified(t.key.fields)||e.modified(t.parentKey.fields);return i.source=i.source.slice(),o&&(n=i.source.length?sM(Wk().id(t.key).parentId(t.parentKey)(i.source),t.key,Kt.yb):sM(Wk()([{}]),t.key,t.key)),i.source.root=this.value=n,i}});const vM={tidy:function(){var t=Yk,e=1,n=1,r=null;function i(i){var u=function(t){for(var e,n,r,i,o,a=new Kk(t,0),s=[a];e=s.pop();)if(r=e._.children)for(e.children=new Array(o=r.length),i=o-1;i>=0;--i)s.push(n=e.children[i]=new Kk(r[i],i)),n.parent=e;return(a.parent=new Kk(null,0)).children=[a],a}(i);if(u.eachAfter(o),u.parent.m=-u.z,u.eachBefore(a),r)i.eachBefore(s);else{var l=i,c=i,f=i;i.eachBefore((function(t){t.x<l.x&&(l=t),t.x>c.x&&(c=t),t.depth>f.depth&&(f=t)}));var h=l===c?1:t(l,c)/2,d=h-l.x,p=e/(c.x+h+d),g=n/(f.depth||1);i.eachBefore((function(t){t.x=(t.x+d)*p,t.y=t.depth*g}))}return i}function o(e){var n=e.children,r=e.parent.children,i=e.i?r[e.i-1]:null;if(n){!function(t){for(var e,n=0,r=0,i=t.children,o=i.length;--o>=0;)(e=i[o]).z+=n,e.m+=n,n+=e.s+(r+=e.c)}(e);var o=(n[0].z+n[n.length-1].z)/2;i?(e.z=i.z+t(e._,i._),e.m=e.z-o):e.z=o}else i&&(e.z=i.z+t(e._,i._));e.parent.A=function(e,n,r){if(n){for(var i,o=e,a=e,s=n,u=o.parent.children[0],l=o.m,c=a.m,f=s.m,h=u.m;s=Vk(s),o=Gk(o),s&&o;)u=Gk(u),(a=Vk(a)).a=e,(i=s.z+f-o.z-l+t(s._,o._))>0&&(Jk(Zk(s,e,r),e,i),l+=i,c+=i),f+=s.m,l+=o.m,h+=u.m,c+=a.m;s&&!Vk(a)&&(a.t=s,a.m+=f-c),o&&!Gk(u)&&(u.t=o,u.m+=l-h,r=e)}return r}(e,i,e.parent.A||r[0])}function a(t){t._.x=t.z+t.parent.m,t.m+=t.parent.m}function s(t){t.x*=e,t.y=t.depth*n}return i.separation=function(e){return arguments.length?(t=e,i):t},i.size=function(t){return arguments.length?(r=!1,e=+t[0],n=+t[1],i):r?null:[e,n]},i.nodeSize=function(t){return arguments.length?(r=!0,e=+t[0],n=+t[1],i):r?[e,n]:null},i},cluster:function(){var t=Qk,e=1,n=1,r=!1;function i(i){var o,a=0;i.eachAfter((function(e){var n=e.children;n?(e.x=function(t){return t.reduce(tM,0)/t.length}(n),e.y=function(t){return 1+t.reduce(eM,0)}(n)):(e.x=o?a+=t(e,o):0,e.y=0,o=e)}));var s=function(t){for(var e;e=t.children;)t=e[0];return t}(i),u=function(t){for(var e;e=t.children;)t=e[e.length-1];return t}(i),l=s.x-t(s,u)/2,c=u.x+t(u,s)/2;return i.eachAfter(r?function(t){t.x=(t.x-i.x)*e,t.y=(i.y-t.y)*n}:function(t){t.x=(t.x-l)/(c-l)*e,t.y=(1-(i.y?t.y/i.y:1))*n})}return i.separation=function(e){return arguments.length?(t=e,i):t},i.size=function(t){return arguments.length?(r=!1,e=+t[0],n=+t[1],i):r?null:[e,n]},i.nodeSize=function(t){return arguments.length?(r=!0,e=+t[0],n=+t[1],i):r?[e,n]:null},i}},bM=["x","y","depth","children"];function xM(t){fM.call(this,t)}function _M(t){cs.call(this,[],t)}xM.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:bM.length,default:bM}]},(0,Kt.XW)(xM,fM,{layout(t){const e=t||"tidy";if((0,Kt.nr)(vM,e))return vM[e]();(0,Kt.vU)("Unrecognized Tree layout method: "+e)},params:["size","nodeSize"],fields:bM}),_M.Definition={type:"TreeLinks",metadata:{tree:!0,generates:!0,changes:!0},params:[]},(0,Kt.XW)(_M,cs,{transform(t,e){const n=this.value,r=e.source&&e.source.root,i=e.fork(e.NO_SOURCE),o={};return r||(0,Kt.vU)("TreeLinks transform requires a tree data source."),e.changed(e.ADD_REM)?(i.rem=n,e.visit(e.SOURCE,(t=>o[$a(t)]=1)),r.each((t=>{const e=t.data,n=t.parent&&t.parent.data;n&&o[$a(e)]&&o[$a(n)]&&i.add.push(Ba({source:n,target:e}))})),this.value=i.add):e.changed(e.MOD)&&(e.visit(e.MOD,(t=>o[$a(t)]=1)),n.forEach((t=>{(o[$a(t.source)]||o[$a(t.target)])&&i.mod.push(t)}))),i}});const wM={binary:function(t,e,n,r,i){var o,a,s=t.children,u=s.length,l=new Array(u+1);for(l[0]=a=o=0;o<u;++o)l[o+1]=a+=s[o].value;!function t(e,n,r,i,o,a,u){if(e>=n-1){var c=s[e];return c.x0=i,c.y0=o,c.x1=a,void(c.y1=u)}var f=l[e],h=r/2+f,d=e+1,p=n-1;for(;d<p;){var g=d+p>>>1;l[g]<h?d=g+1:p=g}h-l[d-1]<l[d]-h&&e+1<d&&--d;var m=l[d]-f,y=r-m;if(a-i>u-o){var v=r?(i*y+a*m)/r:a;t(e,d,m,i,o,v,u),t(d,n,y,v,o,a,u)}else{var b=r?(o*y+u*m)/r:u;t(e,d,m,i,o,a,b),t(d,n,y,i,b,a,u)}}(0,u,t.value,e,n,r,i)},dice:Pk,slice:nM,slicedice:function(t,e,n,r,i){(1&t.depth?nM:Pk)(t,e,n,r,i)},squarify:oM,resquarify:aM},AM=["x0","y0","x1","y1","depth","children"];function DM(t){fM.call(this,t)}function EM(t,e,n){return t.fields=e||[],t.fname=n,t}function FM(t){return 1===t.length?CM(t[0]):kM(t)}DM.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:AM.length,default:AM}]},(0,Kt.XW)(DM,fM,{layout(){const t=function(){var t=oM,e=!1,n=1,r=1,i=[0],o=gk,a=gk,s=gk,u=gk,l=gk;function c(t){return t.x0=t.y0=0,t.x1=n,t.y1=r,t.eachBefore(f),i=[0],e&&t.eachBefore(Rk),t}function f(e){var n=i[e.depth],r=e.x0+n,c=e.y0+n,f=e.x1-n,h=e.y1-n;f<r&&(r=f=(r+f)/2),h<c&&(c=h=(c+h)/2),e.x0=r,e.y0=c,e.x1=f,e.y1=h,e.children&&(n=i[e.depth+1]=o(e)/2,r+=l(e)-n,c+=a(e)-n,(f-=s(e)-n)<r&&(r=f=(r+f)/2),(h-=u(e)-n)<c&&(c=h=(c+h)/2),t(e,r,c,f,h))}return c.round=function(t){return arguments.length?(e=!!t,c):e},c.size=function(t){return arguments.length?(n=+t[0],r=+t[1],c):[n,r]},c.tile=function(e){return arguments.length?(t=pk(e),c):t},c.padding=function(t){return arguments.length?c.paddingInner(t).paddingOuter(t):c.paddingInner()},c.paddingInner=function(t){return arguments.length?(o="function"===typeof t?t:mk(+t),c):o},c.paddingOuter=function(t){return arguments.length?c.paddingTop(t).paddingRight(t).paddingBottom(t).paddingLeft(t):c.paddingTop()},c.paddingTop=function(t){return arguments.length?(a="function"===typeof t?t:mk(+t),c):a},c.paddingRight=function(t){return arguments.length?(s="function"===typeof t?t:mk(+t),c):s},c.paddingBottom=function(t){return arguments.length?(u="function"===typeof t?t:mk(+t),c):u},c.paddingLeft=function(t){return arguments.length?(l="function"===typeof t?t:mk(+t),c):l},c}();return t.ratio=e=>{const n=t.tile();n.ratio&&t.tile(n.ratio(e))},t.method=e=>{(0,Kt.nr)(wM,e)?t.tile(wM[e]):(0,Kt.vU)("Unrecognized Treemap layout method: "+e)},t},params:["method","ratio","size","round","padding","paddingInner","paddingOuter","paddingTop","paddingRight","paddingBottom","paddingLeft"],fields:AM});const CM=t=>function(e){return e[t]},kM=t=>{const e=t.length;return function(n){for(let r=0;r<e;++r)n=n[t[r]];return n}};function MM(t){throw Error(t)}function SM(t){const e=[],n=t.length;let r,i,o,a=null,s=0,u="";function l(){e.push(u+t.substring(r,i)),u="",r=i+1}for(t+="",r=i=0;i<n;++i)if(o=t[i],"\\"===o)u+=t.substring(r,i),u+=t.substring(++i,++i),r=i;else if(o===a)l(),a=null,s=-1;else{if(a)continue;r===s&&'"'===o||r===s&&"'"===o?(r=i+1,a=o):"."!==o||s?"["===o?(i>r&&l(),s=r=i+1):"]"===o&&(s||MM("Access path missing open bracket: "+t),s>0&&l(),s=0,r=i+1):i>r?l():r=i+1}return s&&MM("Access path missing closing bracket: "+t),a&&MM("Access path missing closing quote: "+t),i>r&&(i++,l()),e}function $M(t,e,n){const r=SM(t);return t=1===r.length?r[0]:t,EM((n&&n.get||FM)(r),[t],e||t)}const TM=$M("id"),BM=EM((t=>t),[],"identity"),NM=(EM((()=>0),[],"zero"),EM((()=>1),[],"one"),EM((()=>!0),[],"true"));EM((()=>!1),[],"false");var OM=Array.isArray;function zM(t){return t===Object(t)}function RM(t){return t[t.length-1]}function PM(t){return null==t||""===t?null:+t}function UM(t){return null!=t?OM(t)?t:[t]:[]}function LM(t){return"function"===typeof t}function jM(t){for(let e,n,r=1,i=arguments.length;r<i;++r)for(n in e=arguments[r],e)t[n]=e[n];return t}const IM=Object.prototype.hasOwnProperty;function qM(t,e){return IM.call(t,e)}function WM(t,e,n){const r=t.prototype=Object.create(e.prototype);return Object.defineProperty(r,"constructor",{value:t,writable:!0,enumerable:!0,configurable:!0}),jM(r,n)}function HM(t){return"string"===typeof t}const XM=1e4;function YM(t){return OM(t)?"["+t.map(YM)+"]":zM(t)||HM(t)?JSON.stringify(t).replace("\u2028","\\u2028").replace("\u2029","\\u2029"):t}function GM(t){const e={},n=t.length;for(let r=0;r<n;++r)e[t[r]]=!0;return e}function VM(t,e,n){if(t)if(e){const r=t.length;for(let i=0;i<r;++i){const r=e(t[i]);r&&n(r,i,t)}}else t.forEach(n)}function JM(t,e,n){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+n)/6)}function ZM(t){this._context=t}function KM(){}function QM(t){this._context=t}function tS(t){this._context=t}function eS(t,e){this._basis=new ZM(t),this._beta=e}ZM.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:JM(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(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);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:JM(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}},QM.prototype={areaStart:KM,areaEnd:KM,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(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x2=t,this._y2=e;break;case 1:this._point=2,this._x3=t,this._y3=e;break;case 2:this._point=3,this._x4=t,this._y4=e,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+e)/6);break;default:JM(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}},tS.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(t,e){switch(t=+t,e=+e,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+t)/6,r=(this._y0+4*this._y1+e)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:JM(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}},eS.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var t=this._x,e=this._y,n=t.length-1;if(n>0)for(var r,i=t[0],o=e[0],a=t[n]-i,s=e[n]-o,u=-1;++u<=n;)r=u/n,this._basis.point(this._beta*t[u]+(1-this._beta)*(i+r*a),this._beta*e[u]+(1-this._beta)*(o+r*s));this._x=this._y=null,this._basis.lineEnd()},point:function(t,e){this._x.push(+t),this._y.push(+e)}};const nS=function t(e){function n(t){return 1===e?new ZM(t):new eS(t,e)}return n.beta=function(e){return t(+e)},n}(.85);function rS(t,e,n){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-e),t._y2+t._k*(t._y1-n),t._x2,t._y2)}function iS(t,e){this._context=t,this._k=(1-e)/6}iS.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:rS(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2,this._x1=t,this._y1=e;break;case 2:this._point=3;default:rS(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const oS=function t(e){function n(t){return new iS(t,e)}return n.tension=function(e){return t(+e)},n}(0);function aS(t,e){this._context=t,this._k=(1-e)/6}aS.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(t,e){switch(t=+t,e=+e,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:rS(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const sS=function t(e){function n(t){return new aS(t,e)}return n.tension=function(e){return t(+e)},n}(0);function uS(t,e){this._context=t,this._k=(1-e)/6}uS.prototype={areaStart:KM,areaEnd:KM,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(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:rS(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const lS=function t(e){function n(t){return new uS(t,e)}return n.tension=function(e){return t(+e)},n}(0);var cS=Math.abs,fS=Math.atan2,hS=Math.cos,dS=Math.max,pS=Math.min,gS=Math.sin,mS=Math.sqrt,yS=1e-12,vS=Math.PI,bS=vS/2,xS=2*vS;function _S(t){return t>=1?bS:t<=-1?-bS:Math.asin(t)}function wS(t,e,n){var r=t._x1,i=t._y1,o=t._x2,a=t._y2;if(t._l01_a>yS){var s=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,u=3*t._l01_a*(t._l01_a+t._l12_a);r=(r*s-t._x0*t._l12_2a+t._x2*t._l01_2a)/u,i=(i*s-t._y0*t._l12_2a+t._y2*t._l01_2a)/u}if(t._l23_a>yS){var l=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,c=3*t._l23_a*(t._l23_a+t._l12_a);o=(o*l+t._x1*t._l23_2a-e*t._l12_2a)/c,a=(a*l+t._y1*t._l23_2a-n*t._l12_2a)/c}t._context.bezierCurveTo(r,i,o,a,t._x2,t._y2)}function AS(t,e){this._context=t,this._alpha=e}AS.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(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,r=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3;default:wS(this,t,e)}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=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const DS=function t(e){function n(t){return e?new AS(t,e):new iS(t,0)}return n.alpha=function(e){return t(+e)},n}(.5);function ES(t,e){this._context=t,this._alpha=e}ES.prototype={areaStart:KM,areaEnd:KM,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(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,r=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:wS(this,t,e)}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=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const FS=function t(e){function n(t){return e?new ES(t,e):new uS(t,0)}return n.alpha=function(e){return t(+e)},n}(.5);function CS(t,e){this._context=t,this._alpha=e}CS.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(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,r=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:wS(this,t,e)}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=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const kS=function t(e){function n(t){return e?new CS(t,e):new aS(t,0)}return n.alpha=function(e){return t(+e)},n}(.5);function MS(t){this._context=t}function SS(t){return new MS(t)}function $S(t){this._context=t}function TS(t){return t<0?-1:1}function BS(t,e,n){var r=t._x1-t._x0,i=e-t._x1,o=(t._y1-t._y0)/(r||i<0&&-0),a=(n-t._y1)/(i||r<0&&-0),s=(o*i+a*r)/(r+i);return(TS(o)+TS(a))*Math.min(Math.abs(o),Math.abs(a),.5*Math.abs(s))||0}function NS(t,e){var n=t._x1-t._x0;return n?(3*(t._y1-t._y0)/n-e)/2:e}function OS(t,e,n){var r=t._x0,i=t._y0,o=t._x1,a=t._y1,s=(o-r)/3;t._context.bezierCurveTo(r+s,i+s*e,o-s,a-s*n,o,a)}function zS(t){this._context=t}function RS(t){this._context=new PS(t)}function PS(t){this._context=t}function US(t){this._context=t}function LS(t){var e,n,r=t.length-1,i=new Array(r),o=new Array(r),a=new Array(r);for(i[0]=0,o[0]=2,a[0]=t[0]+2*t[1],e=1;e<r-1;++e)i[e]=1,o[e]=4,a[e]=4*t[e]+2*t[e+1];for(i[r-1]=2,o[r-1]=7,a[r-1]=8*t[r-1]+t[r],e=1;e<r;++e)n=i[e]/o[e-1],o[e]-=n,a[e]-=n*a[e-1];for(i[r-1]=a[r-1]/o[r-1],e=r-2;e>=0;--e)i[e]=(a[e]-i[e+1])/o[e];for(o[r-1]=(t[r]+i[r-1])/2,e=0;e<r-1;++e)o[e]=2*t[e+1]-i[e+1];return[i,o]}function jS(t,e){this._context=t,this._t=e}MS.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(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._context.lineTo(t,e)}}},$S.prototype={areaStart:KM,areaEnd:KM,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,e){t=+t,e=+e,this._point?this._context.lineTo(t,e):(this._point=1,this._context.moveTo(t,e))}},zS.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:OS(this,this._t0,NS(this,this._t0))}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){var n=NaN;if(e=+e,(t=+t)!==this._x1||e!==this._y1){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,OS(this,NS(this,n=BS(this,t,e)),n);break;default:OS(this,this._t0,n=BS(this,t,e))}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=n}}},(RS.prototype=Object.create(zS.prototype)).point=function(t,e){zS.prototype.point.call(this,e,t)},PS.prototype={moveTo:function(t,e){this._context.moveTo(e,t)},closePath:function(){this._context.closePath()},lineTo:function(t,e){this._context.lineTo(e,t)},bezierCurveTo:function(t,e,n,r,i,o){this._context.bezierCurveTo(e,t,r,n,o,i)}},US.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var t=this._x,e=this._y,n=t.length;if(n)if(this._line?this._context.lineTo(t[0],e[0]):this._context.moveTo(t[0],e[0]),2===n)this._context.lineTo(t[1],e[1]);else for(var r=LS(t),i=LS(e),o=0,a=1;a<n;++o,++a)this._context.bezierCurveTo(r[0][o],i[0][o],r[1][o],i[1][o],t[a],e[a]);(this._line||0!==this._line&&1===n)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(t,e){this._x.push(+t),this._y.push(+e)}},jS.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(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,e),this._context.lineTo(t,e);else{var n=this._x*(1-this._t)+t*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,e)}}this._x=t,this._y=e}};const IS=Math.PI,qS=2*IS,WS=1e-6,HS=qS-WS;function XS(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function YS(){return new XS}XS.prototype=YS.prototype={constructor:XS,moveTo:function(t,e){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)},closePath:function(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(t,e){this._+="L"+(this._x1=+t)+","+(this._y1=+e)},quadraticCurveTo:function(t,e,n,r){this._+="Q"+ +t+","+ +e+","+(this._x1=+n)+","+(this._y1=+r)},bezierCurveTo:function(t,e,n,r,i,o){this._+="C"+ +t+","+ +e+","+ +n+","+ +r+","+(this._x1=+i)+","+(this._y1=+o)},arcTo:function(t,e,n,r,i){t=+t,e=+e,n=+n,r=+r,i=+i;var o=this._x1,a=this._y1,s=n-t,u=r-e,l=o-t,c=a-e,f=l*l+c*c;if(i<0)throw new Error("negative radius: "+i);if(null===this._x1)this._+="M"+(this._x1=t)+","+(this._y1=e);else if(f>WS)if(Math.abs(c*s-u*l)>WS&&i){var h=n-o,d=r-a,p=s*s+u*u,g=h*h+d*d,m=Math.sqrt(p),y=Math.sqrt(f),v=i*Math.tan((IS-Math.acos((p+f-g)/(2*m*y)))/2),b=v/y,x=v/m;Math.abs(b-1)>WS&&(this._+="L"+(t+b*l)+","+(e+b*c)),this._+="A"+i+","+i+",0,0,"+ +(c*h>l*d)+","+(this._x1=t+x*s)+","+(this._y1=e+x*u)}else this._+="L"+(this._x1=t)+","+(this._y1=e);else;},arc:function(t,e,n,r,i,o){t=+t,e=+e,o=!!o;var a=(n=+n)*Math.cos(r),s=n*Math.sin(r),u=t+a,l=e+s,c=1^o,f=o?r-i:i-r;if(n<0)throw new Error("negative radius: "+n);null===this._x1?this._+="M"+u+","+l:(Math.abs(this._x1-u)>WS||Math.abs(this._y1-l)>WS)&&(this._+="L"+u+","+l),n&&(f<0&&(f=f%qS+qS),f>HS?this._+="A"+n+","+n+",0,1,"+c+","+(t-a)+","+(e-s)+"A"+n+","+n+",0,1,"+c+","+(this._x1=u)+","+(this._y1=l):f>WS&&(this._+="A"+n+","+n+",0,"+ +(f>=IS)+","+c+","+(this._x1=t+n*Math.cos(i))+","+(this._y1=e+n*Math.sin(i))))},rect:function(t,e,n,r){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)+"h"+ +n+"v"+ +r+"h"+-n+"Z"},toString:function(){return this._}};const GS=YS;function VS(t){return function(){return t}}function JS(t){return t.innerRadius}function ZS(t){return t.outerRadius}function KS(t){return t.startAngle}function QS(t){return t.endAngle}function t$(t){return t&&t.padAngle}function e$(t,e,n,r,i,o,a){var s=t-n,u=e-r,l=(a?o:-o)/mS(s*s+u*u),c=l*u,f=-l*s,h=t+c,d=e+f,p=n+c,g=r+f,m=(h+p)/2,y=(d+g)/2,v=p-h,b=g-d,x=v*v+b*b,_=i-o,w=h*g-p*d,A=(b<0?-1:1)*mS(dS(0,_*_*x-w*w)),D=(w*b-v*A)/x,E=(-w*v-b*A)/x,F=(w*b+v*A)/x,C=(-w*v+b*A)/x,k=D-m,M=E-y,S=F-m,$=C-y;return k*k+M*M>S*S+$*$&&(D=F,E=C),{cx:D,cy:E,x01:-c,y01:-f,x11:D*(i/_-1),y11:E*(i/_-1)}}Array.prototype.slice;function n$(t){return"object"===typeof t&&"length"in t?t:Array.from(t)}function r$(t){return t[0]}function i$(t){return t[1]}function o$(t,e){var n=VS(!0),r=null,i=SS,o=null;function a(a){var s,u,l,c=(a=n$(a)).length,f=!1;for(null==r&&(o=i(l=GS())),s=0;s<=c;++s)!(s<c&&n(u=a[s],s,a))===f&&((f=!f)?o.lineStart():o.lineEnd()),f&&o.point(+t(u,s,a),+e(u,s,a));if(l)return o=null,l+""||null}return t="function"===typeof t?t:void 0===t?r$:VS(t),e="function"===typeof e?e:void 0===e?i$:VS(e),a.x=function(e){return arguments.length?(t="function"===typeof e?e:VS(+e),a):t},a.y=function(t){return arguments.length?(e="function"===typeof t?t:VS(+t),a):e},a.defined=function(t){return arguments.length?(n="function"===typeof t?t:VS(!!t),a):n},a.curve=function(t){return arguments.length?(i=t,null!=r&&(o=i(r)),a):i},a.context=function(t){return arguments.length?(null==t?r=o=null:o=i(r=t),a):r},a}function a$(t,e,n){var r=null,i=VS(!0),o=null,a=SS,s=null;function u(u){var l,c,f,h,d,p=(u=n$(u)).length,g=!1,m=new Array(p),y=new Array(p);for(null==o&&(s=a(d=GS())),l=0;l<=p;++l){if(!(l<p&&i(h=u[l],l,u))===g)if(g=!g)c=l,s.areaStart(),s.lineStart();else{for(s.lineEnd(),s.lineStart(),f=l-1;f>=c;--f)s.point(m[f],y[f]);s.lineEnd(),s.areaEnd()}g&&(m[l]=+t(h,l,u),y[l]=+e(h,l,u),s.point(r?+r(h,l,u):m[l],n?+n(h,l,u):y[l]))}if(d)return s=null,d+""||null}function l(){return o$().defined(i).curve(a).context(o)}return t="function"===typeof t?t:void 0===t?r$:VS(+t),e="function"===typeof e?e:VS(void 0===e?0:+e),n="function"===typeof n?n:void 0===n?i$:VS(+n),u.x=function(e){return arguments.length?(t="function"===typeof e?e:VS(+e),r=null,u):t},u.x0=function(e){return arguments.length?(t="function"===typeof e?e:VS(+e),u):t},u.x1=function(t){return arguments.length?(r=null==t?null:"function"===typeof t?t:VS(+t),u):r},u.y=function(t){return arguments.length?(e="function"===typeof t?t:VS(+t),n=null,u):e},u.y0=function(t){return arguments.length?(e="function"===typeof t?t:VS(+t),u):e},u.y1=function(t){return arguments.length?(n=null==t?null:"function"===typeof t?t:VS(+t),u):n},u.lineX0=u.lineY0=function(){return l().x(t).y(e)},u.lineY1=function(){return l().x(t).y(n)},u.lineX1=function(){return l().x(r).y(e)},u.defined=function(t){return arguments.length?(i="function"===typeof t?t:VS(!!t),u):i},u.curve=function(t){return arguments.length?(a=t,null!=o&&(s=a(o)),u):a},u.context=function(t){return arguments.length?(null==t?o=s=null:s=a(o=t),u):o},u}const s$={draw:function(t,e){var n=Math.sqrt(e/vS);t.moveTo(n,0),t.arc(0,0,n,0,xS)}};Math.sqrt(1/3);var u$=Math.sin(vS/10)/Math.sin(7*vS/10);Math.sin(xS/10),Math.cos(xS/10);Math.sqrt(3);Math.sqrt(3),Math.sqrt(12);function l$(t,e){if("undefined"!==typeof document&&document.createElement){const n=document.createElement("canvas");if(n&&n.getContext)return n.width=t,n.height=e,n}return null}const c$=()=>"undefined"!==typeof Image?Image:null;var f$={},h$={},d$=34,p$=10,g$=13;function m$(t){return new Function("d","return {"+t.map((function(t,e){return JSON.stringify(t)+": d["+e+'] || ""'})).join(",")+"}")}function y$(t){var e=Object.create(null),n=[];return t.forEach((function(t){for(var r in t)r in e||n.push(e[r]=r)})),n}function v$(t,e){var n=t+"",r=n.length;return r<e?new Array(e-r+1).join(0)+n:n}function b$(t){var e=t.getUTCHours(),n=t.getUTCMinutes(),r=t.getUTCSeconds(),i=t.getUTCMilliseconds();return isNaN(t)?"Invalid Date":function(t){return t<0?"-"+v$(-t,6):t>9999?"+"+v$(t,6):v$(t,4)}(t.getUTCFullYear())+"-"+v$(t.getUTCMonth()+1,2)+"-"+v$(t.getUTCDate(),2)+(i?"T"+v$(e,2)+":"+v$(n,2)+":"+v$(r,2)+"."+v$(i,3)+"Z":r?"T"+v$(e,2)+":"+v$(n,2)+":"+v$(r,2)+"Z":n||e?"T"+v$(e,2)+":"+v$(n,2)+"Z":"")}function x$(t){var e=new RegExp('["'+t+"\n\r]"),n=t.charCodeAt(0);function r(t,e){var r,i=[],o=t.length,a=0,s=0,u=o<=0,l=!1;function c(){if(u)return h$;if(l)return l=!1,f$;var e,r,i=a;if(t.charCodeAt(i)===d$){for(;a++<o&&t.charCodeAt(a)!==d$||t.charCodeAt(++a)===d$;);return(e=a)>=o?u=!0:(r=t.charCodeAt(a++))===p$?l=!0:r===g$&&(l=!0,t.charCodeAt(a)===p$&&++a),t.slice(i+1,e-1).replace(/""/g,'"')}for(;a<o;){if((r=t.charCodeAt(e=a++))===p$)l=!0;else if(r===g$)l=!0,t.charCodeAt(a)===p$&&++a;else if(r!==n)continue;return t.slice(i,e)}return u=!0,t.slice(i,o)}for(t.charCodeAt(o-1)===p$&&--o,t.charCodeAt(o-1)===g$&&--o;(r=c())!==h$;){for(var f=[];r!==f$&&r!==h$;)f.push(r),r=c();e&&null==(f=e(f,s++))||i.push(f)}return i}function i(e,n){return e.map((function(e){return n.map((function(t){return a(e[t])})).join(t)}))}function o(e){return e.map(a).join(t)}function a(t){return null==t?"":t instanceof Date?b$(t):e.test(t+="")?'"'+t.replace(/"/g,'""')+'"':t}return{parse:function(t,e){var n,i,o=r(t,(function(t,r){if(n)return n(t,r-1);i=t,n=e?function(t,e){var n=m$(t);return function(r,i){return e(n(r),i,t)}}(t,e):m$(t)}));return o.columns=i||[],o},parseRows:r,format:function(e,n){return null==n&&(n=y$(e)),[n.map(a).join(t)].concat(i(e,n)).join("\n")},formatBody:function(t,e){return null==e&&(e=y$(t)),i(t,e).join("\n")},formatRows:function(t){return t.map(o).join("\n")},formatRow:o,formatValue:a}}var _$=Math.sqrt(50),w$=Math.sqrt(10),A$=Math.sqrt(2);function D$(t,e,n){var r,i,o,a,s=-1;if(n=+n,(t=+t)===(e=+e)&&n>0)return[t];if((r=e<t)&&(i=t,t=e,e=i),0===(a=E$(t,e,n))||!isFinite(a))return[];if(a>0){let n=Math.round(t/a),r=Math.round(e/a);for(n*a<t&&++n,r*a>e&&--r,o=new Array(i=r-n+1);++s<i;)o[s]=(n+s)*a}else{a=-a;let n=Math.round(t*a),r=Math.round(e*a);for(n/a<t&&++n,r/a>e&&--r,o=new Array(i=r-n+1);++s<i;)o[s]=(n+s)/a}return r&&o.reverse(),o}function E$(t,e,n){var r=(e-t)/Math.max(0,n),i=Math.floor(Math.log(r)/Math.LN10),o=r/Math.pow(10,i);return i>=0?(o>=_$?10:o>=w$?5:o>=A$?2:1)*Math.pow(10,i):-Math.pow(10,-i)/(o>=_$?10:o>=w$?5:o>=A$?2:1)}function F$(t,e,n){var r=Math.abs(e-t)/Math.max(0,n),i=Math.pow(10,Math.floor(Math.log(r)/Math.LN10)),o=r/i;return o>=_$?i*=10:o>=w$?i*=5:o>=A$&&(i*=2),e<t?-i:i}var C$,k$=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function M$(t){if(!(e=k$.exec(t)))throw new Error("invalid format: "+t);var e;return new S$({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}function S$(t){this.fill=void 0===t.fill?" ":t.fill+"",this.align=void 0===t.align?">":t.align+"",this.sign=void 0===t.sign?"-":t.sign+"",this.symbol=void 0===t.symbol?"":t.symbol+"",this.zero=!!t.zero,this.width=void 0===t.width?void 0:+t.width,this.comma=!!t.comma,this.precision=void 0===t.precision?void 0:+t.precision,this.trim=!!t.trim,this.type=void 0===t.type?"":t.type+""}function $$(t,e){if((n=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var n,r=t.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+t.slice(n+1)]}function T$(t){return(t=$$(Math.abs(t)))?t[1]:NaN}function B$(t,e){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(T$(e)/3)))-T$(Math.abs(t)))}function N$(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,T$(e)-T$(t))+1}function O$(t){return Math.max(0,-T$(Math.abs(t)))}function z$(t,e){var n=$$(t,e);if(!n)return t+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}M$.prototype=S$.prototype,S$.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 R$={"%":(t,e)=>(100*t).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:function(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)},e:(t,e)=>t.toExponential(e),f:(t,e)=>t.toFixed(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>z$(100*t,e),r:z$,s:function(t,e){var n=$$(t,e);if(!n)return t+"";var r=n[0],i=n[1],o=i-(C$=3*Math.max(-8,Math.min(8,Math.floor(i/3))))+1,a=r.length;return o===a?r:o>a?r+new Array(o-a+1).join("0"):o>0?r.slice(0,o)+"."+r.slice(o):"0."+new Array(1-o).join("0")+$$(t,Math.max(0,e+o-1))[0]},X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function P$(t){return t}var U$,L$,j$,I$=Array.prototype.map,q$=["y","z","a","f","p","n","\xb5","m","","k","M","G","T","P","E","Z","Y"];function W$(t){var e,n,r=void 0===t.grouping||void 0===t.thousands?P$:(e=I$.call(t.grouping,Number),n=t.thousands+"",function(t,r){for(var i=t.length,o=[],a=0,s=e[0],u=0;i>0&&s>0&&(u+s+1>r&&(s=Math.max(1,r-u)),o.push(t.substring(i-=s,i+s)),!((u+=s+1)>r));)s=e[a=(a+1)%e.length];return o.reverse().join(n)}),i=void 0===t.currency?"":t.currency[0]+"",o=void 0===t.currency?"":t.currency[1]+"",a=void 0===t.decimal?".":t.decimal+"",s=void 0===t.numerals?P$:function(t){return function(e){return e.replace(/[0-9]/g,(function(e){return t[+e]}))}}(I$.call(t.numerals,String)),u=void 0===t.percent?"%":t.percent+"",l=void 0===t.minus?"\u2212":t.minus+"",c=void 0===t.nan?"NaN":t.nan+"";function f(t){var e=(t=M$(t)).fill,n=t.align,f=t.sign,h=t.symbol,d=t.zero,p=t.width,g=t.comma,m=t.precision,y=t.trim,v=t.type;"n"===v?(g=!0,v="g"):R$[v]||(void 0===m&&(m=12),y=!0,v="g"),(d||"0"===e&&"="===n)&&(d=!0,e="0",n="=");var b="$"===h?i:"#"===h&&/[boxX]/.test(v)?"0"+v.toLowerCase():"",x="$"===h?o:/[%p]/.test(v)?u:"",_=R$[v],w=/[defgprs%]/.test(v);function A(t){var i,o,u,h=b,A=x;if("c"===v)A=_(t)+A,t="";else{var D=(t=+t)<0||1/t<0;if(t=isNaN(t)?c:_(Math.abs(t),m),y&&(t=function(t){t:for(var e,n=t.length,r=1,i=-1;r<n;++r)switch(t[r]){case".":i=e=r;break;case"0":0===i&&(i=r),e=r;break;default:if(!+t[r])break t;i>0&&(i=0)}return i>0?t.slice(0,i)+t.slice(e+1):t}(t)),D&&0===+t&&"+"!==f&&(D=!1),h=(D?"("===f?f:l:"-"===f||"("===f?"":f)+h,A=("s"===v?q$[8+C$/3]:"")+A+(D&&"("===f?")":""),w)for(i=-1,o=t.length;++i<o;)if(48>(u=t.charCodeAt(i))||u>57){A=(46===u?a+t.slice(i+1):t.slice(i))+A,t=t.slice(0,i);break}}g&&!d&&(t=r(t,1/0));var E=h.length+t.length+A.length,F=E<p?new Array(p-E+1).join(e):"";switch(g&&d&&(t=r(F+t,F.length?p-A.length:1/0),F=""),n){case"<":t=h+t+A+F;break;case"=":t=h+F+t+A;break;case"^":t=F.slice(0,E=F.length>>1)+h+t+A+F.slice(E);break;default:t=F+h+t+A}return s(t)}return m=void 0===m?6:/[gprs]/.test(v)?Math.max(1,Math.min(21,m)):Math.max(0,Math.min(20,m)),A.toString=function(){return t+""},A}return{format:f,formatPrefix:function(t,e){var n=f(((t=M$(t)).type="f",t)),r=3*Math.max(-8,Math.min(8,Math.floor(T$(e)/3))),i=Math.pow(10,-r),o=q$[8+r/3];return function(t){return n(i*t)+o}}}}!function(t){U$=W$(t),L$=U$.format,j$=U$.formatPrefix}({thousands:",",grouping:[3],currency:["$",""]});var H$=new Date,X$=new Date;function Y$(t,e,n,r){function i(e){return t(e=0===arguments.length?new Date:new Date(+e)),e}return i.floor=function(e){return t(e=new Date(+e)),e},i.ceil=function(n){return t(n=new Date(n-1)),e(n,1),t(n),n},i.round=function(t){var e=i(t),n=i.ceil(t);return t-e<n-t?e:n},i.offset=function(t,n){return e(t=new Date(+t),null==n?1:Math.floor(n)),t},i.range=function(n,r,o){var a,s=[];if(n=i.ceil(n),o=null==o?1:Math.floor(o),!(n<r)||!(o>0))return s;do{s.push(a=new Date(+n)),e(n,o),t(n)}while(a<n&&n<r);return s},i.filter=function(n){return Y$((function(e){if(e>=e)for(;t(e),!n(e);)e.setTime(e-1)}),(function(t,r){if(t>=t)if(r<0)for(;++r<=0;)for(;e(t,-1),!n(t););else for(;--r>=0;)for(;e(t,1),!n(t););}))},n&&(i.count=function(e,r){return H$.setTime(+e),X$.setTime(+r),t(H$),t(X$),Math.floor(n(H$,X$))},i.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?i.filter(r?function(e){return r(e)%t===0}:function(e){return i.count(0,e)%t===0}):i:null}),i}const G$=1e3,V$=60*G$,J$=60*V$,Z$=24*J$,K$=7*Z$,Q$=30*Z$,tT=365*Z$;var eT=Y$((t=>t.setHours(0,0,0,0)),((t,e)=>t.setDate(t.getDate()+e)),((t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*V$)/Z$),(t=>t.getDate()-1));const nT=eT;eT.range;function rT(t){return Y$((function(e){e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)}),(function(t,e){t.setDate(t.getDate()+7*e)}),(function(t,e){return(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*V$)/K$}))}var iT=rT(0),oT=rT(1),aT=rT(2),sT=rT(3),uT=rT(4),lT=rT(5),cT=rT(6),fT=(iT.range,oT.range,aT.range,sT.range,uT.range,lT.range,cT.range,Y$((function(t){t.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCDate(t.getUTCDate()+e)}),(function(t,e){return(e-t)/Z$}),(function(t){return t.getUTCDate()-1})));const hT=fT;fT.range;function dT(t){return Y$((function(e){e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCDate(t.getUTCDate()+7*e)}),(function(t,e){return(e-t)/K$}))}var pT=dT(0),gT=dT(1),mT=dT(2),yT=dT(3),vT=dT(4),bT=dT(5),xT=dT(6),_T=(pT.range,gT.range,mT.range,yT.range,vT.range,bT.range,xT.range,Y$((function(t){t.setMonth(0,1),t.setHours(0,0,0,0)}),(function(t,e){t.setFullYear(t.getFullYear()+e)}),(function(t,e){return e.getFullYear()-t.getFullYear()}),(function(t){return t.getFullYear()})));_T.every=function(t){return isFinite(t=Math.floor(t))&&t>0?Y$((function(e){e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)}),(function(e,n){e.setFullYear(e.getFullYear()+n*t)})):null};const wT=_T;_T.range;var AT=Y$((function(t){t.setDate(1),t.setHours(0,0,0,0)}),(function(t,e){t.setMonth(t.getMonth()+e)}),(function(t,e){return e.getMonth()-t.getMonth()+12*(e.getFullYear()-t.getFullYear())}),(function(t){return t.getMonth()}));const DT=AT;AT.range;var ET=Y$((function(t){t.setTime(t-t.getMilliseconds()-t.getSeconds()*G$-t.getMinutes()*V$)}),(function(t,e){t.setTime(+t+e*J$)}),(function(t,e){return(e-t)/J$}),(function(t){return t.getHours()}));const FT=ET;ET.range;var CT=Y$((function(t){t.setTime(t-t.getMilliseconds()-t.getSeconds()*G$)}),(function(t,e){t.setTime(+t+e*V$)}),(function(t,e){return(e-t)/V$}),(function(t){return t.getMinutes()}));const kT=CT;CT.range;var MT=Y$((function(t){t.setTime(t-t.getMilliseconds())}),(function(t,e){t.setTime(+t+e*G$)}),(function(t,e){return(e-t)/G$}),(function(t){return t.getUTCSeconds()}));const ST=MT;MT.range;var $T=Y$((function(){}),(function(t,e){t.setTime(+t+e)}),(function(t,e){return e-t}));$T.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?Y$((function(e){e.setTime(Math.floor(e/t)*t)}),(function(e,n){e.setTime(+e+n*t)}),(function(e,n){return(n-e)/t})):$T:null};const TT=$T;$T.range;var BT=Y$((function(t){t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCFullYear(t.getUTCFullYear()+e)}),(function(t,e){return e.getUTCFullYear()-t.getUTCFullYear()}),(function(t){return t.getUTCFullYear()}));BT.every=function(t){return isFinite(t=Math.floor(t))&&t>0?Y$((function(e){e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)}),(function(e,n){e.setUTCFullYear(e.getUTCFullYear()+n*t)})):null};const NT=BT;BT.range;var OT=Y$((function(t){t.setUTCDate(1),t.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCMonth(t.getUTCMonth()+e)}),(function(t,e){return e.getUTCMonth()-t.getUTCMonth()+12*(e.getUTCFullYear()-t.getUTCFullYear())}),(function(t){return t.getUTCMonth()}));const zT=OT;OT.range;var RT=Y$((function(t){t.setUTCMinutes(0,0,0)}),(function(t,e){t.setTime(+t+e*J$)}),(function(t,e){return(e-t)/J$}),(function(t){return t.getUTCHours()}));const PT=RT;RT.range;var UT=Y$((function(t){t.setUTCSeconds(0,0)}),(function(t,e){t.setTime(+t+e*V$)}),(function(t,e){return(e-t)/V$}),(function(t){return t.getUTCMinutes()}));const LT=UT;UT.range;const jT="year",IT="quarter",qT="month",WT="week",HT="date",XT="day",YT="dayofyear",GT="hours",VT="minutes",JT="seconds",ZT="milliseconds";[jT,IT,qT,WT,HT,XT,YT,GT,VT,JT,ZT].reduce(((t,e,n)=>(t[e]=1+n,t)),{});"".concat(jT,"-").concat(qT),"".concat(jT,"-").concat(qT,"-").concat(HT),"".concat(GT,"-").concat(VT);new Date;const KT={[jT]:wT,[IT]:DT.every(3),[qT]:DT,[WT]:iT,[HT]:nT,[XT]:nT,[YT]:nT,[GT]:FT,[VT]:kT,[JT]:ST,[ZT]:TT},QT={[jT]:NT,[IT]:zT.every(3),[qT]:zT,[WT]:pT,[HT]:hT,[XT]:hT,[YT]:hT,[GT]:PT,[VT]:LT,[JT]:ST,[ZT]:TT};function tB(t){return KT[t]}function eB(t){return QT[t]}const nB=[jT,qT,HT,GT,VT,JT,ZT],rB=nB.slice(0,-1),iB=rB.slice(0,-1),oB=iB.slice(0,-1);oB.slice(0,-1);function aB(t){if(0<=t.y&&t.y<100){var e=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return e.setFullYear(t.y),e}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function sB(t){if(0<=t.y&&t.y<100){var e=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return e.setUTCFullYear(t.y),e}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function uB(t,e,n){return{y:t,m:e,d:n,H:0,M:0,S:0,L:0}}function lB(t){var e=t.dateTime,n=t.date,r=t.time,i=t.periods,o=t.days,a=t.shortDays,s=t.months,u=t.shortMonths,l=_B(i),c=wB(i),f=_B(o),h=wB(o),d=_B(a),p=wB(a),g=_B(s),m=wB(s),y=_B(u),v=wB(u),b={a:function(t){return a[t.getDay()]},A:function(t){return o[t.getDay()]},b:function(t){return u[t.getMonth()]},B:function(t){return s[t.getMonth()]},c:null,d:qB,e:qB,f:GB,g:oN,G:sN,H:WB,I:HB,j:XB,L:YB,m:VB,M:JB,p:function(t){return i[+(t.getHours()>=12)]},q:function(t){return 1+~~(t.getMonth()/3)},Q:SN,s:$N,S:ZB,u:KB,U:QB,V:eN,w:nN,W:rN,x:null,X:null,y:iN,Y:aN,Z:uN,"%":MN},x={a:function(t){return a[t.getUTCDay()]},A:function(t){return o[t.getUTCDay()]},b:function(t){return u[t.getUTCMonth()]},B:function(t){return s[t.getUTCMonth()]},c:null,d:lN,e:lN,f:pN,g:EN,G:CN,H:cN,I:fN,j:hN,L:dN,m:gN,M:mN,p:function(t){return i[+(t.getUTCHours()>=12)]},q:function(t){return 1+~~(t.getUTCMonth()/3)},Q:SN,s:$N,S:yN,u:vN,U:bN,V:_N,w:wN,W:AN,x:null,X:null,y:DN,Y:FN,Z:kN,"%":MN},_={a:function(t,e,n){var r=d.exec(e.slice(n));return r?(t.w=p.get(r[0].toLowerCase()),n+r[0].length):-1},A:function(t,e,n){var r=f.exec(e.slice(n));return r?(t.w=h.get(r[0].toLowerCase()),n+r[0].length):-1},b:function(t,e,n){var r=y.exec(e.slice(n));return r?(t.m=v.get(r[0].toLowerCase()),n+r[0].length):-1},B:function(t,e,n){var r=g.exec(e.slice(n));return r?(t.m=m.get(r[0].toLowerCase()),n+r[0].length):-1},c:function(t,n,r){return D(t,e,n,r)},d:BB,e:BB,f:UB,g:MB,G:kB,H:OB,I:OB,j:NB,L:PB,m:TB,M:zB,p:function(t,e,n){var r=l.exec(e.slice(n));return r?(t.p=c.get(r[0].toLowerCase()),n+r[0].length):-1},q:$B,Q:jB,s:IB,S:RB,u:DB,U:EB,V:FB,w:AB,W:CB,x:function(t,e,r){return D(t,n,e,r)},X:function(t,e,n){return D(t,r,e,n)},y:MB,Y:kB,Z:SB,"%":LB};function w(t,e){return function(n){var r,i,o,a=[],s=-1,u=0,l=t.length;for(n instanceof Date||(n=new Date(+n));++s<l;)37===t.charCodeAt(s)&&(a.push(t.slice(u,s)),null!=(i=gB[r=t.charAt(++s)])?r=t.charAt(++s):i="e"===r?" ":"0",(o=e[r])&&(r=o(n,i)),a.push(r),u=s+1);return a.push(t.slice(u,s)),a.join("")}}function A(t,e){return function(n){var r,i,o=uB(1900,void 0,1);if(D(o,t,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(e&&!("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?(i=(r=sB(uB(o.y,0,1))).getUTCDay(),r=i>4||0===i?gT.ceil(r):gT(r),r=hT.offset(r,7*(o.V-1)),o.y=r.getUTCFullYear(),o.m=r.getUTCMonth(),o.d=r.getUTCDate()+(o.w+6)%7):(i=(r=aB(uB(o.y,0,1))).getDay(),r=i>4||0===i?oT.ceil(r):oT(r),r=nT.offset(r,7*(o.V-1)),o.y=r.getFullYear(),o.m=r.getMonth(),o.d=r.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),i="Z"in o?sB(uB(o.y,0,1)).getUTCDay():aB(uB(o.y,0,1)).getDay(),o.m=0,o.d="W"in o?(o.w+6)%7+7*o.W-(i+5)%7:o.w+7*o.U-(i+6)%7);return"Z"in o?(o.H+=o.Z/100|0,o.M+=o.Z%100,sB(o)):aB(o)}}function D(t,e,n,r){for(var i,o,a=0,s=e.length,u=n.length;a<s;){if(r>=u)return-1;if(37===(i=e.charCodeAt(a++))){if(i=e.charAt(a++),!(o=_[i in gB?e.charAt(a++):i])||(r=o(t,n,r))<0)return-1}else if(i!=n.charCodeAt(r++))return-1}return r}return b.x=w(n,b),b.X=w(r,b),b.c=w(e,b),x.x=w(n,x),x.X=w(r,x),x.c=w(e,x),{format:function(t){var e=w(t+="",b);return e.toString=function(){return t},e},parse:function(t){var e=A(t+="",!1);return e.toString=function(){return t},e},utcFormat:function(t){var e=w(t+="",x);return e.toString=function(){return t},e},utcParse:function(t){var e=A(t+="",!0);return e.toString=function(){return t},e}}}var cB,fB,hB,dB,pB,gB={"-":"",_:" ",0:"0"},mB=/^\s*\d+/,yB=/^%/,vB=/[\\^$*+?|[\]().{}]/g;function bB(t,e,n){var r=t<0?"-":"",i=(r?-t:t)+"",o=i.length;return r+(o<n?new Array(n-o+1).join(e)+i:i)}function xB(t){return t.replace(vB,"\\$&")}function _B(t){return new RegExp("^(?:"+t.map(xB).join("|")+")","i")}function wB(t){return new Map(t.map(((t,e)=>[t.toLowerCase(),e])))}function AB(t,e,n){var r=mB.exec(e.slice(n,n+1));return r?(t.w=+r[0],n+r[0].length):-1}function DB(t,e,n){var r=mB.exec(e.slice(n,n+1));return r?(t.u=+r[0],n+r[0].length):-1}function EB(t,e,n){var r=mB.exec(e.slice(n,n+2));return r?(t.U=+r[0],n+r[0].length):-1}function FB(t,e,n){var r=mB.exec(e.slice(n,n+2));return r?(t.V=+r[0],n+r[0].length):-1}function CB(t,e,n){var r=mB.exec(e.slice(n,n+2));return r?(t.W=+r[0],n+r[0].length):-1}function kB(t,e,n){var r=mB.exec(e.slice(n,n+4));return r?(t.y=+r[0],n+r[0].length):-1}function MB(t,e,n){var r=mB.exec(e.slice(n,n+2));return r?(t.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function SB(t,e,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(n,n+6));return r?(t.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function $B(t,e,n){var r=mB.exec(e.slice(n,n+1));return r?(t.q=3*r[0]-3,n+r[0].length):-1}function TB(t,e,n){var r=mB.exec(e.slice(n,n+2));return r?(t.m=r[0]-1,n+r[0].length):-1}function BB(t,e,n){var r=mB.exec(e.slice(n,n+2));return r?(t.d=+r[0],n+r[0].length):-1}function NB(t,e,n){var r=mB.exec(e.slice(n,n+3));return r?(t.m=0,t.d=+r[0],n+r[0].length):-1}function OB(t,e,n){var r=mB.exec(e.slice(n,n+2));return r?(t.H=+r[0],n+r[0].length):-1}function zB(t,e,n){var r=mB.exec(e.slice(n,n+2));return r?(t.M=+r[0],n+r[0].length):-1}function RB(t,e,n){var r=mB.exec(e.slice(n,n+2));return r?(t.S=+r[0],n+r[0].length):-1}function PB(t,e,n){var r=mB.exec(e.slice(n,n+3));return r?(t.L=+r[0],n+r[0].length):-1}function UB(t,e,n){var r=mB.exec(e.slice(n,n+6));return r?(t.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function LB(t,e,n){var r=yB.exec(e.slice(n,n+1));return r?n+r[0].length:-1}function jB(t,e,n){var r=mB.exec(e.slice(n));return r?(t.Q=+r[0],n+r[0].length):-1}function IB(t,e,n){var r=mB.exec(e.slice(n));return r?(t.s=+r[0],n+r[0].length):-1}function qB(t,e){return bB(t.getDate(),e,2)}function WB(t,e){return bB(t.getHours(),e,2)}function HB(t,e){return bB(t.getHours()%12||12,e,2)}function XB(t,e){return bB(1+nT.count(wT(t),t),e,3)}function YB(t,e){return bB(t.getMilliseconds(),e,3)}function GB(t,e){return YB(t,e)+"000"}function VB(t,e){return bB(t.getMonth()+1,e,2)}function JB(t,e){return bB(t.getMinutes(),e,2)}function ZB(t,e){return bB(t.getSeconds(),e,2)}function KB(t){var e=t.getDay();return 0===e?7:e}function QB(t,e){return bB(iT.count(wT(t)-1,t),e,2)}function tN(t){var e=t.getDay();return e>=4||0===e?uT(t):uT.ceil(t)}function eN(t,e){return t=tN(t),bB(uT.count(wT(t),t)+(4===wT(t).getDay()),e,2)}function nN(t){return t.getDay()}function rN(t,e){return bB(oT.count(wT(t)-1,t),e,2)}function iN(t,e){return bB(t.getFullYear()%100,e,2)}function oN(t,e){return bB((t=tN(t)).getFullYear()%100,e,2)}function aN(t,e){return bB(t.getFullYear()%1e4,e,4)}function sN(t,e){var n=t.getDay();return bB((t=n>=4||0===n?uT(t):uT.ceil(t)).getFullYear()%1e4,e,4)}function uN(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+bB(e/60|0,"0",2)+bB(e%60,"0",2)}function lN(t,e){return bB(t.getUTCDate(),e,2)}function cN(t,e){return bB(t.getUTCHours(),e,2)}function fN(t,e){return bB(t.getUTCHours()%12||12,e,2)}function hN(t,e){return bB(1+hT.count(NT(t),t),e,3)}function dN(t,e){return bB(t.getUTCMilliseconds(),e,3)}function pN(t,e){return dN(t,e)+"000"}function gN(t,e){return bB(t.getUTCMonth()+1,e,2)}function mN(t,e){return bB(t.getUTCMinutes(),e,2)}function yN(t,e){return bB(t.getUTCSeconds(),e,2)}function vN(t){var e=t.getUTCDay();return 0===e?7:e}function bN(t,e){return bB(pT.count(NT(t)-1,t),e,2)}function xN(t){var e=t.getUTCDay();return e>=4||0===e?vT(t):vT.ceil(t)}function _N(t,e){return t=xN(t),bB(vT.count(NT(t),t)+(4===NT(t).getUTCDay()),e,2)}function wN(t){return t.getUTCDay()}function AN(t,e){return bB(gT.count(NT(t)-1,t),e,2)}function DN(t,e){return bB(t.getUTCFullYear()%100,e,2)}function EN(t,e){return bB((t=xN(t)).getUTCFullYear()%100,e,2)}function FN(t,e){return bB(t.getUTCFullYear()%1e4,e,4)}function CN(t,e){var n=t.getUTCDay();return bB((t=n>=4||0===n?vT(t):vT.ceil(t)).getUTCFullYear()%1e4,e,4)}function kN(){return"+0000"}function MN(){return"%"}function SN(t){return+t}function $N(t){return Math.floor(+t/1e3)}function TN(t){const e={};return n=>e[n]||(e[n]=t(n))}function BN(t){const e=TN(t.format),n=t.formatPrefix;return{format:e,formatPrefix:n,formatFloat(t){const n=M$(t||",");if(null==n.precision){switch(n.precision=12,n.type){case"%":n.precision-=2;break;case"e":n.precision-=1}return r=e(n),i=e(".1f")(1)[1],t=>{const e=r(t),n=e.indexOf(i);if(n<0)return e;let o=function(t,e){let n,r=t.lastIndexOf("e");if(r>0)return r;for(r=t.length;--r>e;)if(n=t.charCodeAt(r),n>=48&&n<=57)return r+1}(e,n);const a=o<e.length?e.slice(o):"";for(;--o>n;)if("0"!==e[o]){++o;break}return e.slice(0,o)+a}}return e(n);var r,i},formatSpan(t,r,i,o){o=M$(null==o?",f":o);const a=F$(t,r,i),s=Math.max(Math.abs(t),Math.abs(r));let u;if(null==o.precision)switch(o.type){case"s":return isNaN(u=B$(a,s))||(o.precision=u),n(o,s);case"":case"e":case"g":case"p":case"r":isNaN(u=N$(a,s))||(o.precision=u-("e"===o.type));break;case"f":case"%":isNaN(u=O$(a))||(o.precision=u-2*("%"===o.type))}return e(o)}}}let NN,ON;function zN(){return NN=BN({format:L$,formatPrefix:j$})}function RN(t,e,n){zM(n=n||{})||MM("Invalid time multi-format specifier: ".concat(n));const r=e(JT),i=e(VT),o=e(GT),a=e(HT),s=e(WT),u=e(qT),l=e(IT),c=e(jT),f=t(n[ZT]||".%L"),h=t(n[JT]||":%S"),d=t(n[VT]||"%I:%M"),p=t(n[GT]||"%I %p"),g=t(n[HT]||n[XT]||"%a %d"),m=t(n[WT]||"%b %d"),y=t(n[qT]||"%B"),v=t(n[IT]||"%B"),b=t(n[jT]||"%Y");return t=>(r(t)<t?f:i(t)<t?h:o(t)<t?d:a(t)<t?p:u(t)<t?s(t)<t?g:m:c(t)<t?l(t)<t?y:v:b)(t)}function PN(t){const e=TN(t.format),n=TN(t.utcFormat);return{timeFormat:t=>HM(t)?e(t):RN(e,tB,t),utcFormat:t=>HM(t)?n(t):RN(n,eB,t),timeParse:TN(t.parse),utcParse:TN(t.utcParse)}}function UN(){return ON=PN({format:fB,parse:hB,utcFormat:dB,utcParse:pB})}!function(t){cB=lB(t),fB=cB.format,hB=cB.parse,dB=cB.utcFormat,pB=cB.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"]}),zN(),UN();const LN=/^(data:|([A-Za-z]+:)?\/\/)/,jN=/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp|file|data):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i,IN=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205f\u3000]/g,qN="file://";async function WN(t,e){const n=await this.sanitize(t,e),r=n.href;return n.localFile?this.file(r):this.http(r,e)}async function HN(t,e){e=jM({},this.options,e);const n=this.fileAccess,r={href:null};let i,o,a;const s=jN.test(t.replace(IN,""));null!=t&&"string"===typeof t&&s||MM("Sanitize failure, invalid URI: "+YM(t));const u=LN.test(t);return(a=e.baseURL)&&!u&&(t.startsWith("/")||a.endsWith("/")||(t="/"+t),t=a+t),o=(i=t.startsWith(qN))||"file"===e.mode||"http"!==e.mode&&!u&&n,i?t=t.slice(qN.length):t.startsWith("//")&&("file"===e.defaultProtocol?(t=t.slice(2),o=!0):t=(e.defaultProtocol||"http")+":"+t),Object.defineProperty(r,"localFile",{value:!!o}),r.href=t,e.target&&(r.target=e.target+""),e.rel&&(r.rel=e.rel+""),"image"===e.context&&e.crossOrigin&&(r.crossOrigin=e.crossOrigin+""),r}function XN(t){return t?e=>new Promise(((n,r)=>{t.readFile(e,((t,e)=>{t?r(t):n(e)}))})):YN}async function YN(){MM("No file system access.")}function GN(t){return t?async function(e,n){const r=jM({},this.options.http,n),i=n&&n.response,o=await t(e,r);return o.ok?LM(o[i])?o[i]():o.text():MM(o.status+""+o.statusText)}:VN}async function VN(){MM("No HTTP fetch method available.")}function JN(t){const e=function(e,n){const r={delimiter:t};return ZN(e,n?jM(n,r):r)};return e.responseType="text",e}function ZN(t,e){return e.header&&(t=e.header.map(YM).join(e.delimiter)+"\n"+t),x$(e.delimiter).parse(t+"")}function KN(t,e){const n=e&&e.property?$M(e.property):BM;return!zM(t)||(r=t,"function"===typeof Buffer&&LM(Buffer.isBuffer)&&Buffer.isBuffer(r))?n(JSON.parse(t)):function(t,e){!OM(t)&&function(t){return t&&LM(t[Symbol.iterator])}(t)&&(t=[...t]);return e&&e.copy?JSON.parse(JSON.stringify(t)):t}(n(t),e);var r}ZN.responseType="text",KN.responseType="json";const QN={interior:(t,e)=>t!==e,exterior:(t,e)=>t===e};function tO(t,e){let n,r,i,o;return t=KN(t,e),e&&e.feature?(n=ce,i=e.feature):e&&e.mesh?(n=pe,i=e.mesh,o=QN[e.filter]):MM("Missing TopoJSON feature or mesh parameter."),r=(r=t.objects[i])?n(t,r,o):MM("Invalid TopoJSON object: "+i),r&&r.features||[r]}tO.responseType="json";JN(","),JN("\t");const eO=function(t,e){return n=>({options:n||{},sanitize:HN,load:WN,fileAccess:!!e,file:XN(e),http:GN(t)})}("undefined"!==typeof fetch&&fetch,null);function nO(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function rO(t){let e=t,n=t;function r(t,e,r,i){for(null==r&&(r=0),null==i&&(i=t.length);r<i;){const o=r+i>>>1;n(t[o],e)<0?r=o+1:i=o}return r}return 1===t.length&&(e=(e,n)=>t(e)-n,n=function(t){return(e,n)=>nO(t(e),n)}(t)),{left:r,center:function(t,n,i,o){null==i&&(i=0),null==o&&(o=t.length);const a=r(t,n,i,o-1);return a>i&&e(t[a-1],n)>-e(t[a],n)?a-1:a},right:function(t,e,r,i){for(null==r&&(r=0),null==i&&(i=t.length);r<i;){const o=r+i>>>1;n(t[o],e)>0?i=o:r=o+1}return r}}}function iO(t){return null===t?NaN:+t}const oO=rO(nO),aO=oO.right,sO=(oO.left,rO(iO).center,aO);function uO(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t)}return this}function lO(t,e){switch(arguments.length){case 0:break;case 1:"function"===typeof t?this.interpolator(t):this.range(t);break;default:this.domain(t),"function"===typeof e?this.interpolator(e):this.range(e)}return this}const cO=Symbol("implicit");function fO(){var t=new Map,e=[],n=[],r=cO;function i(i){var o=i+"",a=t.get(o);if(!a){if(r!==cO)return r;t.set(o,a=e.push(i))}return n[(a-1)%n.length]}return i.domain=function(n){if(!arguments.length)return e.slice();e=[],t=new Map;for(const r of n){const n=r+"";t.has(n)||t.set(n,e.push(r))}return i},i.range=function(t){return arguments.length?(n=Array.from(t),i):n.slice()},i.unknown=function(t){return arguments.length?(r=t,i):r},i.copy=function(){return fO(e,n).unknown(r)},uO.apply(i,arguments),i}function hO(t,e,n,r){var i,o=F$(t,e,n);switch((r=M$(null==r?",f":r)).type){case"s":var a=Math.max(Math.abs(t),Math.abs(e));return null!=r.precision||isNaN(i=B$(o,a))||(r.precision=i),j$(r,a);case"":case"e":case"g":case"p":case"r":null!=r.precision||isNaN(i=N$(o,Math.max(Math.abs(t),Math.abs(e))))||(r.precision=i-("e"===r.type));break;case"f":case"%":null!=r.precision||isNaN(i=O$(o))||(r.precision=i-2*("%"===r.type))}return L$(r)}function dO(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function pO(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function gO(){}var mO=.7,yO=1/mO,vO="\\s*([+-]?\\d+)\\s*",bO="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",xO="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",_O=/^#([0-9a-f]{3,8})$/,wO=new RegExp("^rgb\\("+[vO,vO,vO]+"\\)$"),AO=new RegExp("^rgb\\("+[xO,xO,xO]+"\\)$"),DO=new RegExp("^rgba\\("+[vO,vO,vO,bO]+"\\)$"),EO=new RegExp("^rgba\\("+[xO,xO,xO,bO]+"\\)$"),FO=new RegExp("^hsl\\("+[bO,xO,xO]+"\\)$"),CO=new RegExp("^hsla\\("+[bO,xO,xO,bO]+"\\)$"),kO={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function MO(){return this.rgb().formatHex()}function SO(){return this.rgb().formatRgb()}function $O(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=_O.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?TO(e):3===n?new zO(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?BO(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?BO(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=wO.exec(t))?new zO(e[1],e[2],e[3],1):(e=AO.exec(t))?new zO(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=DO.exec(t))?BO(e[1],e[2],e[3],e[4]):(e=EO.exec(t))?BO(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=FO.exec(t))?LO(e[1],e[2]/100,e[3]/100,1):(e=CO.exec(t))?LO(e[1],e[2]/100,e[3]/100,e[4]):kO.hasOwnProperty(t)?TO(kO[t]):"transparent"===t?new zO(NaN,NaN,NaN,0):null}function TO(t){return new zO(t>>16&255,t>>8&255,255&t,1)}function BO(t,e,n,r){return r<=0&&(t=e=n=NaN),new zO(t,e,n,r)}function NO(t){return t instanceof gO||(t=$O(t)),t?new zO((t=t.rgb()).r,t.g,t.b,t.opacity):new zO}function OO(t,e,n,r){return 1===arguments.length?NO(t):new zO(t,e,n,null==r?1:r)}function zO(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function RO(){return"#"+UO(this.r)+UO(this.g)+UO(this.b)}function PO(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===t?")":", "+t+")")}function UO(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function LO(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new qO(t,e,n,r)}function jO(t){if(t instanceof qO)return new qO(t.h,t.s,t.l,t.opacity);if(t instanceof gO||(t=$O(t)),!t)return new qO;if(t instanceof qO)return t;var e=(t=t.rgb()).r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),o=Math.max(e,n,r),a=NaN,s=o-i,u=(o+i)/2;return s?(a=e===o?(n-r)/s+6*(n<r):n===o?(r-e)/s+2:(e-n)/s+4,s/=u<.5?o+i:2-o-i,a*=60):s=u>0&&u<1?0:a,new qO(a,s,u,t.opacity)}function IO(t,e,n,r){return 1===arguments.length?jO(t):new qO(t,e,n,null==r?1:r)}function qO(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function WO(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}function HO(t,e,n,r,i){var o=t*t,a=o*t;return((1-3*t+3*o-a)*e+(4-6*o+3*a)*n+(1+3*t+3*o-3*a)*r+a*i)/6}function XO(t){var e=t.length-1;return function(n){var r=n<=0?n=0:n>=1?(n=1,e-1):Math.floor(n*e),i=t[r],o=t[r+1],a=r>0?t[r-1]:2*i-o,s=r<e-1?t[r+2]:2*o-i;return HO((n-r/e)*e,a,i,o,s)}}function YO(t){var e=t.length;return function(n){var r=Math.floor(((n%=1)<0?++n:n)*e),i=t[(r+e-1)%e],o=t[r%e],a=t[(r+1)%e],s=t[(r+2)%e];return HO((n-r/e)*e,i,o,a,s)}}dO(gO,$O,{copy:function(t){return Object.assign(new this.constructor,this,t)},displayable:function(){return this.rgb().displayable()},hex:MO,formatHex:MO,formatHsl:function(){return jO(this).formatHsl()},formatRgb:SO,toString:SO}),dO(zO,OO,pO(gO,{brighter:function(t){return t=null==t?yO:Math.pow(yO,t),new zO(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?mO:Math.pow(mO,t),new zO(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:RO,formatHex:RO,formatRgb:PO,toString:PO})),dO(qO,IO,pO(gO,{brighter:function(t){return t=null==t?yO:Math.pow(yO,t),new qO(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?mO:Math.pow(mO,t),new qO(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*e,i=2*n-r;return new zO(WO(t>=240?t-240:t+120,i,r),WO(t,i,r),WO(t<120?t+240:t-120,i,r),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"hsl(":"hsla(")+(this.h||0)+", "+100*(this.s||0)+"%, "+100*(this.l||0)+"%"+(1===t?")":", "+t+")")}}));const GO=t=>()=>t;function VO(t,e){return function(n){return t+n*e}}function JO(t,e){var n=e-t;return n?VO(t,n>180||n<-180?n-360*Math.round(n/360):n):GO(isNaN(t)?e:t)}function ZO(t){return 1===(t=+t)?KO:function(e,n){return n-e?function(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(r){return Math.pow(t+r*e,n)}}(e,n,t):GO(isNaN(e)?n:e)}}function KO(t,e){var n=e-t;return n?VO(t,n):GO(isNaN(t)?e:t)}const QO=function t(e){var n=ZO(e);function r(t,e){var r=n((t=OO(t)).r,(e=OO(e)).r),i=n(t.g,e.g),o=n(t.b,e.b),a=KO(t.opacity,e.opacity);return function(e){return t.r=r(e),t.g=i(e),t.b=o(e),t.opacity=a(e),t+""}}return r.gamma=t,r}(1);function tz(t){return function(e){var n,r,i=e.length,o=new Array(i),a=new Array(i),s=new Array(i);for(n=0;n<i;++n)r=OO(e[n]),o[n]=r.r||0,a[n]=r.g||0,s[n]=r.b||0;return o=t(o),a=t(a),s=t(s),r.opacity=1,function(t){return r.r=o(t),r.g=a(t),r.b=s(t),r+""}}}var ez=tz(XO),nz=tz(YO);function rz(t,e){e||(e=[]);var n,r=t?Math.min(e.length,t.length):0,i=e.slice();return function(o){for(n=0;n<r;++n)i[n]=t[n]*(1-o)+e[n]*o;return i}}function iz(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function oz(t,e){return(iz(e)?rz:az)(t,e)}function az(t,e){var n,r=e?e.length:0,i=t?Math.min(r,t.length):0,o=new Array(i),a=new Array(r);for(n=0;n<i;++n)o[n]=dz(t[n],e[n]);for(;n<r;++n)a[n]=e[n];return function(t){for(n=0;n<i;++n)a[n]=o[n](t);return a}}function sz(t,e){var n=new Date;return t=+t,e=+e,function(r){return n.setTime(t*(1-r)+e*r),n}}function uz(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}}function lz(t,e){var n,r={},i={};for(n in null!==t&&"object"===typeof t||(t={}),null!==e&&"object"===typeof e||(e={}),e)n in t?r[n]=dz(t[n],e[n]):i[n]=e[n];return function(t){for(n in r)i[n]=r[n](t);return i}}var cz=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,fz=new RegExp(cz.source,"g");function hz(t,e){var n,r,i,o=cz.lastIndex=fz.lastIndex=0,a=-1,s=[],u=[];for(t+="",e+="";(n=cz.exec(t))&&(r=fz.exec(e));)(i=r.index)>o&&(i=e.slice(o,i),s[a]?s[a]+=i:s[++a]=i),(n=n[0])===(r=r[0])?s[a]?s[a]+=r:s[++a]=r:(s[++a]=null,u.push({i:a,x:uz(n,r)})),o=fz.lastIndex;return o<e.length&&(i=e.slice(o),s[a]?s[a]+=i:s[++a]=i),s.length<2?u[0]?function(t){return function(e){return t(e)+""}}(u[0].x):function(t){return function(){return t}}(e):(e=u.length,function(t){for(var n,r=0;r<e;++r)s[(n=u[r]).i]=n.x(t);return s.join("")})}function dz(t,e){var n,r=typeof e;return null==e||"boolean"===r?GO(e):("number"===r?uz:"string"===r?(n=$O(e))?(e=n,QO):hz:e instanceof $O?QO:e instanceof Date?sz:iz(e)?rz:Array.isArray(e)?az:"function"!==typeof e.valueOf&&"function"!==typeof e.toString||isNaN(e)?lz:uz)(t,e)}function pz(t,e){return t=+t,e=+e,function(n){return Math.round(t*(1-n)+e*n)}}function gz(t){return+t}var mz=[0,1];function yz(t){return t}function vz(t,e){return(e-=t=+t)?function(n){return(n-t)/e}:function(t){return function(){return t}}(isNaN(e)?NaN:.5)}function bz(t,e,n){var r=t[0],i=t[1],o=e[0],a=e[1];return i<r?(r=vz(i,r),o=n(a,o)):(r=vz(r,i),o=n(o,a)),function(t){return o(r(t))}}function xz(t,e,n){var r=Math.min(t.length,e.length)-1,i=new Array(r),o=new Array(r),a=-1;for(t[r]<t[0]&&(t=t.slice().reverse(),e=e.slice().reverse());++a<r;)i[a]=vz(t[a],t[a+1]),o[a]=n(e[a],e[a+1]);return function(e){var n=sO(t,e,1,r)-1;return o[n](i[n](e))}}function _z(t,e){return e.domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown())}function wz(){var t,e,n,r,i,o,a=mz,s=mz,u=dz,l=yz;function c(){var t=Math.min(a.length,s.length);return l!==yz&&(l=function(t,e){var n;return t>e&&(n=t,t=e,e=n),function(n){return Math.max(t,Math.min(e,n))}}(a[0],a[t-1])),r=t>2?xz:bz,i=o=null,f}function f(e){return null==e||isNaN(e=+e)?n:(i||(i=r(a.map(t),s,u)))(t(l(e)))}return f.invert=function(n){return l(e((o||(o=r(s,a.map(t),uz)))(n)))},f.domain=function(t){return arguments.length?(a=Array.from(t,gz),c()):a.slice()},f.range=function(t){return arguments.length?(s=Array.from(t),c()):s.slice()},f.rangeRound=function(t){return s=Array.from(t),u=pz,c()},f.clamp=function(t){return arguments.length?(l=!!t||yz,c()):l!==yz},f.interpolate=function(t){return arguments.length?(u=t,c()):u},f.unknown=function(t){return arguments.length?(n=t,f):n},function(n,r){return t=n,e=r,c()}}function Az(){return wz()(yz,yz)}function Dz(t){var e=t.domain;return t.ticks=function(t){var n=e();return D$(n[0],n[n.length-1],null==t?10:t)},t.tickFormat=function(t,n){var r=e();return hO(r[0],r[r.length-1],null==t?10:t,n)},t.nice=function(n){null==n&&(n=10);var r,i,o=e(),a=0,s=o.length-1,u=o[a],l=o[s],c=10;for(l<u&&(i=u,u=l,l=i,i=a,a=s,s=i);c-- >0;){if((i=E$(u,l,n))===r)return o[a]=u,o[s]=l,e(o);if(i>0)u=Math.floor(u/i)*i,l=Math.ceil(l/i)*i;else{if(!(i<0))break;u=Math.ceil(u*i)/i,l=Math.floor(l*i)/i}r=i}return t},t}function Ez(t,e){var n,r=0,i=(t=t.slice()).length-1,o=t[r],a=t[i];return a<o&&(n=r,r=i,i=n,n=o,o=a,a=n),t[r]=e.floor(o),t[i]=e.ceil(a),t}function Fz(t){return Math.log(t)}function Cz(t){return Math.exp(t)}function kz(t){return-Math.log(-t)}function Mz(t){return-Math.exp(-t)}function Sz(t){return isFinite(t)?+("1e"+t):t<0?0:t}function $z(t){return function(e){return-t(-e)}}function Tz(t){var e,n,r=t(Fz,Cz),i=r.domain,o=10;function a(){return e=function(t){return t===Math.E?Math.log:10===t&&Math.log10||2===t&&Math.log2||(t=Math.log(t),function(e){return Math.log(e)/t})}(o),n=function(t){return 10===t?Sz:t===Math.E?Math.exp:function(e){return Math.pow(t,e)}}(o),i()[0]<0?(e=$z(e),n=$z(n),t(kz,Mz)):t(Fz,Cz),r}return r.base=function(t){return arguments.length?(o=+t,a()):o},r.domain=function(t){return arguments.length?(i(t),a()):i()},r.ticks=function(t){var r,a=i(),s=a[0],u=a[a.length-1];(r=u<s)&&(h=s,s=u,u=h);var l,c,f,h=e(s),d=e(u),p=null==t?10:+t,g=[];if(!(o%1)&&d-h<p){if(h=Math.floor(h),d=Math.ceil(d),s>0){for(;h<=d;++h)for(c=1,l=n(h);c<o;++c)if(!((f=l*c)<s)){if(f>u)break;g.push(f)}}else for(;h<=d;++h)for(c=o-1,l=n(h);c>=1;--c)if(!((f=l*c)<s)){if(f>u)break;g.push(f)}2*g.length<p&&(g=D$(s,u,p))}else g=D$(h,d,Math.min(d-h,p)).map(n);return r?g.reverse():g},r.tickFormat=function(t,i){if(null==i&&(i=10===o?".0e":","),"function"!==typeof i&&(i=L$(i)),t===1/0)return i;null==t&&(t=10);var a=Math.max(1,o*t/r.ticks().length);return function(t){var r=t/n(Math.round(e(t)));return r*o<o-.5&&(r*=o),r<=a?i(t):""}},r.nice=function(){return i(Ez(i(),{floor:function(t){return n(Math.floor(e(t)))},ceil:function(t){return n(Math.ceil(e(t)))}}))},r}function Bz(t){return function(e){return e<0?-Math.pow(-e,t):Math.pow(e,t)}}function Nz(t){return t<0?-Math.sqrt(-t):Math.sqrt(t)}function Oz(t){return t<0?-t*t:t*t}function zz(t){var e=t(yz,yz),n=1;return e.exponent=function(e){return arguments.length?1===(n=+e)?t(yz,yz):.5===n?t(Nz,Oz):t(Bz(n),Bz(1/n)):n},Dz(e)}function Rz(){var t=zz(wz());return t.copy=function(){return _z(t,Rz()).exponent(t.exponent())},uO.apply(t,arguments),t}function Pz(t){return function(e){return Math.sign(e)*Math.log1p(Math.abs(e/t))}}function Uz(t){return function(e){return Math.sign(e)*Math.expm1(Math.abs(e))*t}}function Lz(t){var e=1,n=t(Pz(e),Uz(e));return n.constant=function(n){return arguments.length?t(Pz(e=+n),Uz(e)):e},Dz(n)}function jz(t){let e=t,n=t;function r(t,e,r,i){for(null==r&&(r=0),null==i&&(i=t.length);r<i;){const o=r+i>>>1;n(t[o],e)<0?r=o+1:i=o}return r}return 1===t.length&&(e=(e,n)=>t(e)-n,n=function(t){return(e,n)=>function(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}(t(e),n)}(t)),{left:r,center:function(t,n,i,o){null==i&&(i=0),null==o&&(o=t.length);const a=r(t,n,i,o-1);return a>i&&e(t[a-1],n)>-e(t[a],n)?a-1:a},right:function(t,e,r,i){for(null==r&&(r=0),null==i&&(i=t.length);r<i;){const o=r+i>>>1;n(t[o],e)>0?i=o:r=o+1}return r}}}var Iz=Math.sqrt(50),qz=Math.sqrt(10),Wz=Math.sqrt(2);function Hz(t,e,n){var r=Math.abs(e-t)/Math.max(0,n),i=Math.pow(10,Math.floor(Math.log(r)/Math.LN10)),o=r/i;return o>=Iz?i*=10:o>=qz?i*=5:o>=Wz&&(i*=2),e<t?-i:i}function Xz(t,e,n,r,i,o){const a=[[ST,1,G$],[ST,5,5*G$],[ST,15,15*G$],[ST,30,30*G$],[o,1,V$],[o,5,5*V$],[o,15,15*V$],[o,30,30*V$],[i,1,J$],[i,3,3*J$],[i,6,6*J$],[i,12,12*J$],[r,1,Z$],[r,2,2*Z$],[n,1,K$],[e,1,Q$],[e,3,3*Q$],[t,1,tT]];function s(e,n,r){const i=Math.abs(n-e)/r,o=jz((([,,t])=>t)).right(a,i);if(o===a.length)return t.every(Hz(e/tT,n/tT,r));if(0===o)return TT.every(Math.max(Hz(e,n,r),1));const[s,u]=a[i/a[o-1][2]<a[o][2]/i?o-1:o];return s.every(u)}return[function(t,e,n){const r=e<t;r&&([t,e]=[e,t]);const i=n&&"function"===typeof n.range?n:s(t,e,n),o=i?i.range(t,+e+1):[];return r?o.reverse():o},s]}const[Yz,Gz]=Xz(NT,zT,pT,hT,PT,LT),[Vz,Jz]=Xz(wT,DT,iT,nT,FT,kT);function Zz(t){return new Date(t)}function Kz(t){return t instanceof Date?+t:+new Date(+t)}function Qz(t,e,n,r,i,o,a,s,u,l){var c=Az(),f=c.invert,h=c.domain,d=l(".%L"),p=l(":%S"),g=l("%I:%M"),m=l("%I %p"),y=l("%a %d"),v=l("%b %d"),b=l("%B"),x=l("%Y");function _(t){return(u(t)<t?d:s(t)<t?p:a(t)<t?g:o(t)<t?m:r(t)<t?i(t)<t?y:v:n(t)<t?b:x)(t)}return c.invert=function(t){return new Date(f(t))},c.domain=function(t){return arguments.length?h(Array.from(t,Kz)):h().map(Zz)},c.ticks=function(e){var n=h();return t(n[0],n[n.length-1],null==e?10:e)},c.tickFormat=function(t,e){return null==e?_:l(e)},c.nice=function(t){var n=h();return t&&"function"===typeof t.range||(t=e(n[0],n[n.length-1],null==t?10:t)),t?h(Ez(n,t)):c},c.copy=function(){return _z(c,Qz(t,e,n,r,i,o,a,s,u,l))},c}function tR(){var t,e,n,r,i,o=0,a=1,s=yz,u=!1;function l(e){return null==e||isNaN(e=+e)?i:s(0===n?.5:(e=(r(e)-t)*n,u?Math.max(0,Math.min(1,e)):e))}function c(t){return function(e){var n,r;return arguments.length?([n,r]=e,s=t(n,r),l):[s(0),s(1)]}}return l.domain=function(i){return arguments.length?([o,a]=i,t=r(o=+o),e=r(a=+a),n=t===e?0:1/(e-t),l):[o,a]},l.clamp=function(t){return arguments.length?(u=!!t,l):u},l.interpolator=function(t){return arguments.length?(s=t,l):s},l.range=c(dz),l.rangeRound=c(pz),l.unknown=function(t){return arguments.length?(i=t,l):i},function(i){return r=i,t=i(o),e=i(a),n=t===e?0:1/(e-t),l}}function eR(t,e){return e.domain(t.domain()).interpolator(t.interpolator()).clamp(t.clamp()).unknown(t.unknown())}function nR(){var t=Dz(tR()(yz));return t.copy=function(){return eR(t,nR())},lO.apply(t,arguments)}function rR(){var t=zz(tR());return t.copy=function(){return eR(t,rR()).exponent(t.exponent())},lO.apply(t,arguments)}function iR(t,e){void 0===e&&(e=t,t=dz);for(var n=0,r=e.length-1,i=e[0],o=new Array(r<0?0:r);n<r;)o[n]=t(i,i=e[++n]);return function(t){var e=Math.max(0,Math.min(r-1,Math.floor(t*=r)));return o[e](t-e)}}function oR(){var t,e,n,r,i,o,a,s=0,u=.5,l=1,c=1,f=yz,h=!1;function d(t){return isNaN(t=+t)?a:(t=.5+((t=+o(t))-e)*(c*t<c*e?r:i),f(h?Math.max(0,Math.min(1,t)):t))}function p(t){return function(e){var n,r,i;return arguments.length?([n,r,i]=e,f=iR(t,[n,r,i]),d):[f(0),f(.5),f(1)]}}return d.domain=function(a){return arguments.length?([s,u,l]=a,t=o(s=+s),e=o(u=+u),n=o(l=+l),r=t===e?0:.5/(e-t),i=e===n?0:.5/(n-e),c=e<t?-1:1,d):[s,u,l]},d.clamp=function(t){return arguments.length?(h=!!t,d):h},d.interpolator=function(t){return arguments.length?(f=t,d):f},d.range=p(dz),d.rangeRound=p(pz),d.unknown=function(t){return arguments.length?(a=t,d):a},function(a){return o=a,t=a(s),e=a(u),n=a(l),r=t===e?0:.5/(e-t),i=e===n?0:.5/(n-e),c=e<t?-1:1,d}}function aR(){var t=zz(oR());return t.copy=function(){return eR(t,aR()).exponent(t.exponent())},lO.apply(t,arguments)}function sR(t,e,n=iO){if(r=t.length){if((e=+e)<=0||r<2)return+n(t[0],0,t);if(e>=1)return+n(t[r-1],r-1,t);var r,i=(r-1)*e,o=Math.floor(i),a=+n(t[o],o,t);return a+(+n(t[o+1],o+1,t)-a)*(i-o)}}function uR(t){var e=t.length;return function(n){return t[Math.max(0,Math.min(e-1,Math.floor(n*e)))]}}function lR(t,e){var n=JO(+t,+e);return function(t){var e=n(t);return e-360*Math.floor(e/360)}}var cR,fR=180/Math.PI,hR={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function dR(t,e,n,r,i,o){var a,s,u;return(a=Math.sqrt(t*t+e*e))&&(t/=a,e/=a),(u=t*n+e*r)&&(n-=t*u,r-=e*u),(s=Math.sqrt(n*n+r*r))&&(n/=s,r/=s,u/=s),t*r<e*n&&(t=-t,e=-e,u=-u,a=-a),{translateX:i,translateY:o,rotate:Math.atan2(e,t)*fR,skewX:Math.atan(u)*fR,scaleX:a,scaleY:s}}function pR(t,e,n,r){function i(t){return t.length?t.pop()+" ":""}return function(o,a){var s=[],u=[];return o=t(o),a=t(a),function(t,r,i,o,a,s){if(t!==i||r!==o){var u=a.push("translate(",null,e,null,n);s.push({i:u-4,x:uz(t,i)},{i:u-2,x:uz(r,o)})}else(i||o)&&a.push("translate("+i+e+o+n)}(o.translateX,o.translateY,a.translateX,a.translateY,s,u),function(t,e,n,o){t!==e?(t-e>180?e+=360:e-t>180&&(t+=360),o.push({i:n.push(i(n)+"rotate(",null,r)-2,x:uz(t,e)})):e&&n.push(i(n)+"rotate("+e+r)}(o.rotate,a.rotate,s,u),function(t,e,n,o){t!==e?o.push({i:n.push(i(n)+"skewX(",null,r)-2,x:uz(t,e)}):e&&n.push(i(n)+"skewX("+e+r)}(o.skewX,a.skewX,s,u),function(t,e,n,r,o,a){if(t!==n||e!==r){var s=o.push(i(o)+"scale(",null,",",null,")");a.push({i:s-4,x:uz(t,n)},{i:s-2,x:uz(e,r)})}else 1===n&&1===r||o.push(i(o)+"scale("+n+","+r+")")}(o.scaleX,o.scaleY,a.scaleX,a.scaleY,s,u),o=a=null,function(t){for(var e,n=-1,r=u.length;++n<r;)s[(e=u[n]).i]=e.x(t);return s.join("")}}}var gR=pR((function(t){const e=new("function"===typeof DOMMatrix?DOMMatrix:WebKitCSSMatrix)(t+"");return e.isIdentity?hR:dR(e.a,e.b,e.c,e.d,e.e,e.f)}),"px, ","px)","deg)"),mR=pR((function(t){return null==t?hR:(cR||(cR=document.createElementNS("http://www.w3.org/2000/svg","g")),cR.setAttribute("transform",t),(t=cR.transform.baseVal.consolidate())?dR((t=t.matrix).a,t.b,t.c,t.d,t.e,t.f):hR)}),", ",")",")"),yR=1e-12;function vR(t){return((t=Math.exp(t))+1/t)/2}const bR=function t(e,n,r){function i(t,i){var o,a,s=t[0],u=t[1],l=t[2],c=i[0],f=i[1],h=i[2],d=c-s,p=f-u,g=d*d+p*p;if(g<yR)a=Math.log(h/l)/e,o=function(t){return[s+t*d,u+t*p,l*Math.exp(e*t*a)]};else{var m=Math.sqrt(g),y=(h*h-l*l+r*g)/(2*l*n*m),v=(h*h-l*l-r*g)/(2*h*n*m),b=Math.log(Math.sqrt(y*y+1)-y),x=Math.log(Math.sqrt(v*v+1)-v);a=(x-b)/e,o=function(t){var r=t*a,i=vR(b),o=l/(n*m)*(i*function(t){return((t=Math.exp(2*t))-1)/(t+1)}(e*r+b)-function(t){return((t=Math.exp(t))-1/t)/2}(b));return[s+o*d,u+o*p,l*i/vR(e*r+b)]}}return o.duration=1e3*a*e/Math.SQRT2,o}return i.rho=function(e){var n=Math.max(.001,+e),r=n*n;return t(n,r,r*r)},i}(Math.SQRT2,2,4);function xR(t){return function(e,n){var r=t((e=IO(e)).h,(n=IO(n)).h),i=KO(e.s,n.s),o=KO(e.l,n.l),a=KO(e.opacity,n.opacity);return function(t){return e.h=r(t),e.s=i(t),e.l=o(t),e.opacity=a(t),e+""}}}const _R=xR(JO);var wR=xR(KO);const AR=Math.PI/180,DR=180/Math.PI,ER=.96422,FR=1,CR=.82521,kR=4/29,MR=6/29,SR=3*MR*MR,$R=MR*MR*MR;function TR(t){if(t instanceof NR)return new NR(t.l,t.a,t.b,t.opacity);if(t instanceof jR)return IR(t);t instanceof zO||(t=NO(t));var e,n,r=PR(t.r),i=PR(t.g),o=PR(t.b),a=OR((.2225045*r+.7168786*i+.0606169*o)/FR);return r===i&&i===o?e=n=a:(e=OR((.4360747*r+.3850649*i+.1430804*o)/ER),n=OR((.0139322*r+.0971045*i+.7141733*o)/CR)),new NR(116*a-16,500*(e-a),200*(a-n),t.opacity)}function BR(t,e,n,r){return 1===arguments.length?TR(t):new NR(t,e,n,null==r?1:r)}function NR(t,e,n,r){this.l=+t,this.a=+e,this.b=+n,this.opacity=+r}function OR(t){return t>$R?Math.pow(t,1/3):t/SR+kR}function zR(t){return t>MR?t*t*t:SR*(t-kR)}function RR(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function PR(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function UR(t){if(t instanceof jR)return new jR(t.h,t.c,t.l,t.opacity);if(t instanceof NR||(t=TR(t)),0===t.a&&0===t.b)return new jR(NaN,0<t.l&&t.l<100?0:NaN,t.l,t.opacity);var e=Math.atan2(t.b,t.a)*DR;return new jR(e<0?e+360:e,Math.sqrt(t.a*t.a+t.b*t.b),t.l,t.opacity)}function LR(t,e,n,r){return 1===arguments.length?UR(t):new jR(t,e,n,null==r?1:r)}function jR(t,e,n,r){this.h=+t,this.c=+e,this.l=+n,this.opacity=+r}function IR(t){if(isNaN(t.h))return new NR(t.l,0,0,t.opacity);var e=t.h*AR;return new NR(t.l,Math.cos(e)*t.c,Math.sin(e)*t.c,t.opacity)}function qR(t,e){var n=KO((t=BR(t)).l,(e=BR(e)).l),r=KO(t.a,e.a),i=KO(t.b,e.b),o=KO(t.opacity,e.opacity);return function(e){return t.l=n(e),t.a=r(e),t.b=i(e),t.opacity=o(e),t+""}}function WR(t){return function(e,n){var r=t((e=LR(e)).h,(n=LR(n)).h),i=KO(e.c,n.c),o=KO(e.l,n.l),a=KO(e.opacity,n.opacity);return function(t){return e.h=r(t),e.c=i(t),e.l=o(t),e.opacity=a(t),e+""}}}dO(NR,BR,pO(gO,{brighter:function(t){return new NR(this.l+18*(null==t?1:t),this.a,this.b,this.opacity)},darker:function(t){return new NR(this.l-18*(null==t?1:t),this.a,this.b,this.opacity)},rgb:function(){var t=(this.l+16)/116,e=isNaN(this.a)?t:t+this.a/500,n=isNaN(this.b)?t:t-this.b/200;return new zO(RR(3.1338561*(e=ER*zR(e))-1.6168667*(t=FR*zR(t))-.4906146*(n=CR*zR(n))),RR(-.9787684*e+1.9161415*t+.033454*n),RR(.0719453*e-.2289914*t+1.4052427*n),this.opacity)}})),dO(jR,LR,pO(gO,{brighter:function(t){return new jR(this.h,this.c,this.l+18*(null==t?1:t),this.opacity)},darker:function(t){return new jR(this.h,this.c,this.l-18*(null==t?1:t),this.opacity)},rgb:function(){return IR(this).rgb()}}));const HR=WR(JO);var XR=WR(KO),YR=-.14861,GR=1.78277,VR=-.29227,JR=-.90649,ZR=1.97294,KR=ZR*JR,QR=ZR*GR,tP=GR*VR-JR*YR;function eP(t,e,n,r){return 1===arguments.length?function(t){if(t instanceof nP)return new nP(t.h,t.s,t.l,t.opacity);t instanceof zO||(t=NO(t));var e=t.r/255,n=t.g/255,r=t.b/255,i=(tP*r+KR*e-QR*n)/(tP+KR-QR),o=r-i,a=(ZR*(n-i)-VR*o)/JR,s=Math.sqrt(a*a+o*o)/(ZR*i*(1-i)),u=s?Math.atan2(a,o)*DR-120:NaN;return new nP(u<0?u+360:u,s,i,t.opacity)}(t):new nP(t,e,n,null==r?1:r)}function nP(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function rP(t){return function e(n){function r(e,r){var i=t((e=eP(e)).h,(r=eP(r)).h),o=KO(e.s,r.s),a=KO(e.l,r.l),s=KO(e.opacity,r.opacity);return function(t){return e.h=i(t),e.s=o(t),e.l=a(Math.pow(t,n)),e.opacity=s(t),e+""}}return n=+n,r.gamma=e,r}(1)}dO(nP,eP,pO(gO,{brighter:function(t){return t=null==t?yO:Math.pow(yO,t),new nP(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?mO:Math.pow(mO,t),new nP(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=isNaN(this.h)?0:(this.h+120)*AR,e=+this.l,n=isNaN(this.s)?0:this.s*e*(1-e),r=Math.cos(t),i=Math.sin(t);return new zO(255*(e+n*(YR*r+GR*i)),255*(e+n*(VR*r+JR*i)),255*(e+n*(ZR*r)),this.opacity)}}));const iP=rP(JO);var oP=rP(KO);function aP(t,e){for(var n=new Array(e),r=0;r<e;++r)n[r]=t(r/(e-1));return n}const sP="linear",uP="log",lP="pow",cP="sqrt",fP="symlog",hP="time",dP="utc",pP="sequential",gP="diverging",mP="quantile",yP="quantize",vP="threshold",bP="continuous",xP="discrete",_P="discretizing",wP="interpolating",AP="temporal";function DP(){const t=fO().unknown(void 0),e=t.domain,n=t.range;let r,i,o=[0,1],a=!1,s=0,u=0,l=.5;function c(){const t=e().length,c=o[1]<o[0],f=o[1-c],h=function(t,e,n){const r=t-e+2*n;return t?r>0?r:1:0}(t,s,u);let d=o[c-0];r=(f-d)/(h||1),a&&(r=Math.floor(r)),d+=(f-d-r*(t-s))*l,i=r*(1-s),a&&(d=Math.round(d),i=Math.round(i));const p=function(t,e,n){t=+t,e=+e,n=(i=arguments.length)<2?(e=t,t=0,1):i<3?1:+n;for(var r=-1,i=0|Math.max(0,Math.ceil((e-t)/n)),o=new Array(i);++r<i;)o[r]=t+r*n;return o}(t).map((t=>d+r*t));return n(c?p.reverse():p)}return delete t.unknown,t.domain=function(t){return arguments.length?(e(t),c()):e()},t.range=function(t){return arguments.length?(o=[+t[0],+t[1]],c()):o.slice()},t.rangeRound=function(t){return o=[+t[0],+t[1]],a=!0,c()},t.bandwidth=function(){return i},t.step=function(){return r},t.round=function(t){return arguments.length?(a=!!t,c()):a},t.padding=function(t){return arguments.length?(u=Math.max(0,Math.min(1,t)),s=u,c()):s},t.paddingInner=function(t){return arguments.length?(s=Math.max(0,Math.min(1,t)),c()):s},t.paddingOuter=function(t){return arguments.length?(u=Math.max(0,Math.min(1,t)),c()):u},t.align=function(t){return arguments.length?(l=Math.max(0,Math.min(1,t)),c()):l},t.invertRange=function(t){if(null==t[0]||null==t[1])return;const r=o[1]<o[0],a=r?n().reverse():n(),s=a.length-1;let u,l,c,f=+t[0],h=+t[1];return f!==f||h!==h||(h<f&&(c=f,f=h,h=c),h<a[0]||f>o[1-r])?void 0:(u=Math.max(0,aO(a,f)-1),l=f===h?u:aO(a,h)-1,f-a[u]>i+1e-10&&++u,r&&(c=u,u=s-l,l=s-c),u>l?void 0:e().slice(u,l+1))},t.invert=function(e){const n=t.invertRange([e,e]);return n?n[0]:n},t.copy=function(){return DP().domain(e()).range(o).round(a).paddingInner(s).paddingOuter(u).align(l)},c()}function EP(t){const e=t.copy;return t.padding=t.paddingOuter,delete t.paddingInner,t.copy=function(){return EP(e())},t}var FP=Array.prototype.map;const CP=Array.prototype.slice;const kP={};function MP(t,e,n){return arguments.length>1?(kP[t]=function(t,e,n){const r=function(){const n=e();return n.invertRange||(n.invertRange=n.invert?function(t){return function(e){let n,r=e[0],i=e[1];return i<r&&(n=r,r=i,i=n),[t.invert(r),t.invert(i)]}}(n):n.invertExtent?function(t){return function(e){const n=t.range();let r,i,o,a,s=e[0],u=e[1],l=-1;for(u<s&&(i=s,s=u,u=i),o=0,a=n.length;o<a;++o)n[o]>=s&&n[o]<=u&&(l<0&&(l=o),r=o);if(!(l<0))return s=t.invertExtent(n[l]),u=t.invertExtent(n[r]),[void 0===s[0]?s[1]:s[0],void 0===u[1]?u[0]:u[1]]}}(n):void 0),n.type=t,n};return r.metadata=GM(UM(n)),r}(t,e,n),this):function(t){return qM(kP,t)}(t)?kP[t]:void 0}function SP(t,e){const n=kP[t];return n&&n.metadata[e]}function $P(t){return SP(t,xP)}MP("identity",(function t(e){var n;function r(t){return null==t||isNaN(t=+t)?n:t}return r.invert=r,r.domain=r.range=function(t){return arguments.length?(e=Array.from(t,gz),r):e.slice()},r.unknown=function(t){return arguments.length?(n=t,r):n},r.copy=function(){return t(e).unknown(n)},e=arguments.length?Array.from(e,gz):[0,1],Dz(r)})),MP(sP,(function t(){var e=Az();return e.copy=function(){return _z(e,t())},uO.apply(e,arguments),Dz(e)}),bP),MP(uP,(function t(){var e=Tz(wz()).domain([1,10]);return e.copy=function(){return _z(e,t()).base(e.base())},uO.apply(e,arguments),e}),[bP,uP]),MP(lP,Rz,bP),MP(cP,(function(){return Rz.apply(null,arguments).exponent(.5)}),bP),MP(fP,(function t(){var e=Lz(wz());return e.copy=function(){return _z(e,t()).constant(e.constant())},uO.apply(e,arguments)}),bP),MP(hP,(function(){return uO.apply(Qz(Vz,Jz,wT,DT,iT,nT,FT,kT,ST,fB).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}),[bP,AP]),MP(dP,(function(){return uO.apply(Qz(Yz,Gz,NT,zT,pT,hT,PT,LT,ST,dB).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}),[bP,AP]),MP(pP,nR,[bP,wP]),MP("".concat(pP,"-").concat(sP),nR,[bP,wP]),MP("".concat(pP,"-").concat(uP),(function t(){var e=Tz(tR()).domain([1,10]);return e.copy=function(){return eR(e,t()).base(e.base())},lO.apply(e,arguments)}),[bP,wP,uP]),MP("".concat(pP,"-").concat(lP),rR,[bP,wP]),MP("".concat(pP,"-").concat(cP),(function(){return rR.apply(null,arguments).exponent(.5)}),[bP,wP]),MP("".concat(pP,"-").concat(fP),(function t(){var e=Lz(tR());return e.copy=function(){return eR(e,t()).constant(e.constant())},lO.apply(e,arguments)}),[bP,wP]),MP("".concat(gP,"-").concat(sP),(function t(){var e=Dz(oR()(yz));return e.copy=function(){return eR(e,t())},lO.apply(e,arguments)}),[bP,wP]),MP("".concat(gP,"-").concat(uP),(function t(){var e=Tz(oR()).domain([.1,1,10]);return e.copy=function(){return eR(e,t()).base(e.base())},lO.apply(e,arguments)}),[bP,wP,uP]),MP("".concat(gP,"-").concat(lP),aR,[bP,wP]),MP("".concat(gP,"-").concat(cP),(function(){return aR.apply(null,arguments).exponent(.5)}),[bP,wP]),MP("".concat(gP,"-").concat(fP),(function t(){var e=Lz(oR());return e.copy=function(){return eR(e,t()).constant(e.constant())},lO.apply(e,arguments)}),[bP,wP]),MP(mP,(function t(){var e,n=[],r=[],i=[];function o(){var t=0,e=Math.max(1,r.length);for(i=new Array(e-1);++t<e;)i[t-1]=sR(n,t/e);return a}function a(t){return null==t||isNaN(t=+t)?e:r[sO(i,t)]}return a.invertExtent=function(t){var e=r.indexOf(t);return e<0?[NaN,NaN]:[e>0?i[e-1]:n[0],e<i.length?i[e]:n[n.length-1]]},a.domain=function(t){if(!arguments.length)return n.slice();n=[];for(let e of t)null==e||isNaN(e=+e)||n.push(e);return n.sort(nO),o()},a.range=function(t){return arguments.length?(r=Array.from(t),o()):r.slice()},a.unknown=function(t){return arguments.length?(e=t,a):e},a.quantiles=function(){return i.slice()},a.copy=function(){return t().domain(n).range(r).unknown(e)},uO.apply(a,arguments)}),[_P,mP]),MP(yP,(function t(){var e,n=0,r=1,i=1,o=[.5],a=[0,1];function s(t){return null!=t&&t<=t?a[sO(o,t,0,i)]:e}function u(){var t=-1;for(o=new Array(i);++t<i;)o[t]=((t+1)*r-(t-i)*n)/(i+1);return s}return s.domain=function(t){return arguments.length?([n,r]=t,n=+n,r=+r,u()):[n,r]},s.range=function(t){return arguments.length?(i=(a=Array.from(t)).length-1,u()):a.slice()},s.invertExtent=function(t){var e=a.indexOf(t);return e<0?[NaN,NaN]:e<1?[n,o[0]]:e>=i?[o[i-1],r]:[o[e-1],o[e]]},s.unknown=function(t){return arguments.length?(e=t,s):s},s.thresholds=function(){return o.slice()},s.copy=function(){return t().domain([n,r]).range(a).unknown(e)},uO.apply(Dz(s),arguments)}),_P),MP(vP,(function t(){var e,n=[.5],r=[0,1],i=1;function o(t){return null!=t&&t<=t?r[sO(n,t,0,i)]:e}return o.domain=function(t){return arguments.length?(n=Array.from(t),i=Math.min(n.length,r.length-1),o):n.slice()},o.range=function(t){return arguments.length?(r=Array.from(t),i=Math.min(n.length,r.length-1),o):r.slice()},o.invertExtent=function(t){var e=r.indexOf(t);return[n[e-1],n[e]]},o.unknown=function(t){return arguments.length?(e=t,o):e},o.copy=function(){return t().domain(n).range(r).unknown(e)},uO.apply(o,arguments)}),_P),MP("bin-ordinal",(function t(){let e=[],n=[];function r(t){return null==t||t!==t?void 0:n[(sO(e,t)-1)%n.length]}return r.domain=function(t){return arguments.length?(e=function(t){return FP.call(t,PM)}(t),r):e.slice()},r.range=function(t){return arguments.length?(n=CP.call(t),r):n.slice()},r.tickFormat=function(t,n){return hO(e[0],RM(e),null==t?10:t,n)},r.copy=function(){return t().domain(r.domain()).range(r.range())},r}),[xP,_P]),MP("ordinal",fO,xP),MP("band",DP,xP),MP("point",(function(){return EP(DP().paddingInner(1))}),xP);function TP(t,e,n){return iR(function(t,e){const n=c[function(t){return"interpolate"+t.toLowerCase().split("-").map((t=>t[0].toUpperCase()+t.slice(1))).join("")}(t)];return null!=e&&n&&n.gamma?n.gamma(e):n}(e||"rgb",n),t)}function BP(t){const e=t.length/6|0,n=new Array(e);for(let r=0;r<e;)n[r]="#"+t.slice(6*r,6*++r);return n}function NP(t,e){for(const n in t)zP(n,e(t[n]))}const OP={};function zP(t,e){return t=t&&t.toLowerCase(),arguments.length>1?(OP[t]=e,this):OP[t]}NP({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"},BP),NP({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"},(t=>TP(BP(t))));const RP="symbol",PP="discrete",UP=t=>OM(t)?t.map((t=>String(t))):String(t),LP=(t,e)=>t[1]-e[1],jP=(t,e)=>e[1]-t[1];function IP(t,e){return t.bins?function(t,e,n){let r=t.range(),i=r[0],o=RM(r),a=LP;if(i>o&&(r=o,o=i,i=r,a=jP),i=Math.floor(i),o=Math.ceil(o),e=e.map((e=>[e,t(e)])).filter((t=>i<=t[1]&&t[1]<=o)).sort(a).map((t=>t[0])),n>0&&e.length>1){const t=[e[0],RM(e)];for(;e.length>n&&e.length>=3;)e=e.filter(((t,e)=>!(e%2)));e.length<3&&(e=t)}return e}(t,t.bins):t.ticks?t.ticks(e):t.domain()}function qP(t,e,n,r,i,o){const a=e.type;let s=UP;if(a===hP||i===hP)s=t.timeFormat(r);else if(a===dP||i===dP)s=t.utcFormat(r);else if(function(t){return SP(t,uP)}(a)){const i=t.formatFloat(r);if(o||e.bins)s=i;else{const t=WP(e,n,!1);s=e=>t(e)?i(e):""}}else if(e.tickFormat){const i=e.domain();s=t.formatSpan(i[0],i[i.length-1],n,r)}else r&&(s=t.format(r));return s}function WP(t,e,n){const r=IP(t,e),i=t.base(),o=Math.log(i),a=Math.max(1,i*e/r.length),s=t=>{let e=t/Math.pow(i,Math.round(Math.log(t)/o));return e*i<i-.5&&(e*=i),e<=a};return n?r.filter(s):s}const HP={[mP]:"quantiles",[yP]:"thresholds",[vP]:"domain"},XP={[mP]:"quantiles",[yP]:"domain"};function YP(t,e){return t.bins?function(t){const e=t.slice(0,-1);return e.max=RM(t),e}(t.bins):t.type===uP?WP(t,e,!0):HP[t.type]?function(t){const e=[-1/0].concat(t);return e.max=1/0,e}(t[HP[t.type]]()):IP(t,e)}const GP=t=>HP[t.type]||t.bins;function VP(t,e,n,r,i,o,a){const s=XP[e.type]&&o!==hP&&o!==dP?function(t,e,n){const r=e[XP[e.type]](),i=r.length;let o,a=i>1?r[1]-r[0]:r[0];for(o=1;o<i;++o)a=Math.min(a,r[o]-r[o-1]);return t.formatSpan(0,a,30,n)}(t,e,i):qP(t,e,n,i,o,a);return r===RP&&GP(e)?JP(s):r===PP?KP(s):QP(s)}const JP=t=>(e,n,r)=>{const i=ZP(r[n+1],ZP(r.max,1/0)),o=tU(e,t),a=tU(i,t);return o&&a?o+" \u2013 "+a:a?"< "+a:"\u2265 "+o},ZP=(t,e)=>null!=t?t:e,KP=t=>(e,n)=>n?t(e):null,QP=t=>e=>t(e),tU=(t,e)=>Number.isFinite(t)?e(t):null;function eU(t,e,n,r){const i=r||e.type;return HM(n)&&function(t){return SP(t,AP)}(i)&&(n=n.replace(/%a/g,"%A").replace(/%b/g,"%B")),n||i!==hP?n||i!==dP?VP(t,e,5,null,n,r,!0):t.utcFormat("%A, %d %B %Y, %X UTC"):t.timeFormat("%A, %d %B %Y, %X")}function nU(t,e,n){n=n||{};const r=Math.max(3,n.maxlen||7),i=eU(t,e,n.format,n.formatType);if(function(t){return SP(t,_P)}(e.type)){const t=YP(e).slice(1).map(i),n=t.length;return"".concat(n," boundar").concat(1===n?"y":"ies",": ").concat(t.join(", "))}if($P(e.type)){const t=e.domain(),n=t.length,o=n>r?t.slice(0,r-2).map(i).join(", ")+", ending with "+t.slice(-1).map(i):t.map(i).join(", ");return"".concat(n," value").concat(1===n?"":"s",": ").concat(o)}{const t=e.domain();return"values from ".concat(i(t[0])," to ").concat(i(RM(t)))}}let rU=0;const iU="p_";function oU(t){return t&&t.gradient}function aU(t,e,n){const r=t.gradient;let i=t.id,o="radial"===r?iU:"";return i||(i=t.id="gradient_"+rU++,"radial"===r?(t.x1=sU(t.x1,.5),t.y1=sU(t.y1,.5),t.r1=sU(t.r1,0),t.x2=sU(t.x2,.5),t.y2=sU(t.y2,.5),t.r2=sU(t.r2,.5),o=iU):(t.x1=sU(t.x1,0),t.y1=sU(t.y1,0),t.x2=sU(t.x2,1),t.y2=sU(t.y2,0))),e[i]=t,"url("+(n||"")+"#"+o+i+")"}function sU(t,e){return null!=t?t:e}const uU={basis:{curve:function(t){return new ZM(t)}},"basis-closed":{curve:function(t){return new QM(t)}},"basis-open":{curve:function(t){return new tS(t)}},bundle:{curve:nS,tension:"beta",value:.85},cardinal:{curve:oS,tension:"tension",value:0},"cardinal-open":{curve:sS,tension:"tension",value:0},"cardinal-closed":{curve:lS,tension:"tension",value:0},"catmull-rom":{curve:DS,tension:"alpha",value:.5},"catmull-rom-closed":{curve:FS,tension:"alpha",value:.5},"catmull-rom-open":{curve:kS,tension:"alpha",value:.5},linear:{curve:SS},"linear-closed":{curve:function(t){return new $S(t)}},monotone:{horizontal:function(t){return new RS(t)},vertical:function(t){return new zS(t)}},natural:{curve:function(t){return new US(t)}},step:{curve:function(t){return new jS(t,.5)}},"step-after":{curve:function(t){return new jS(t,1)}},"step-before":{curve:function(t){return new jS(t,0)}}};function lU(t,e,n){var r=qM(uU,t)&&uU[t],i=null;return r&&(i=r.curve||r[e||"vertical"],r.tension&&null!=n&&(i=i[r.tension](n))),i}const cU={m:2,l:2,h:1,v:1,c:6,s:4,q:4,t:2,a:7},fU=[/([MLHVCSQTAZmlhvcsqtaz])/g,/###/,/(\.\d+)(\.\d)/g,/(\d)([-+])/g,/\s|,|###/];function hU(t){const e=[];let n,r,i,o,a,s,u,l,c,f;const h=t.slice().replace(fU[0],"###$1").split(fU[1]).slice(1);for(u=0,c=h.length;u<c;++u){for(n=h[u],r=n.slice(1).trim().replace(fU[2],"$1###$2").replace(fU[3],"$1###$2").split(fU[4]),a=n.charAt(0),i=[a],l=0,f=r.length;l<f;++l)(o=+r[l])===o&&i.push(o);if(s=cU[a.toLowerCase()],i.length-1>s){const t=i.length;for(l=1,e.push([a].concat(i.slice(l,l+=s))),a="M"===a?"L":"m"===a?"l":a;l<t;l+=s)e.push([a].concat(i.slice(l,l+s)))}else e.push(i)}return e}const dU=Math.PI/180,pU=1e-14,gU=Math.PI/2,mU=2*Math.PI,yU=Math.sqrt(3)/2;var vU={},bU={},xU=[].join;function _U(t){const e=xU.call(t);if(bU[e])return bU[e];var n=t[0],r=t[1],i=t[2],o=t[3],a=t[4],s=t[5],u=t[6],l=t[7];const c=l*a,f=-u*s,h=u*a,d=l*s,p=Math.cos(i),g=Math.sin(i),m=Math.cos(o),y=Math.sin(o),v=.5*(o-i),b=Math.sin(.5*v),x=8/3*b*b/Math.sin(v),_=n+p-x*g,w=r+g+x*p,A=n+m,D=r+y,E=A+x*y,F=D-x*m;return bU[e]=[c*_+f*w,h*_+d*w,c*E+f*F,h*E+d*F,c*A+f*D,h*A+d*D]}const wU=["l",0,0,0,0,0,0,0];function AU(t,e,n){const r=wU[0]=t[0];if("a"===r||"A"===r)wU[1]=e*t[1],wU[2]=n*t[2],wU[3]=t[3],wU[4]=t[4],wU[5]=t[5],wU[6]=e*t[6],wU[7]=n*t[7];else if("h"===r||"H"===r)wU[1]=e*t[1];else if("v"===r||"V"===r)wU[1]=n*t[1];else for(var i=1,o=t.length;i<o;++i)wU[i]=(i%2==1?e:n)*t[i];return wU}function DU(t,e,n,r,i,o){var a,s,u,l,c,f=null,h=0,d=0,p=0,g=0;null==n&&(n=0),null==r&&(r=0),null==i&&(i=1),null==o&&(o=i),t.beginPath&&t.beginPath();for(var m=0,y=e.length;m<y;++m){switch(a=e[m],1===i&&1===o||(a=AU(a,i,o)),a[0]){case"l":h+=a[1],d+=a[2],t.lineTo(h+n,d+r);break;case"L":h=a[1],d=a[2],t.lineTo(h+n,d+r);break;case"h":h+=a[1],t.lineTo(h+n,d+r);break;case"H":h=a[1],t.lineTo(h+n,d+r);break;case"v":d+=a[1],t.lineTo(h+n,d+r);break;case"V":d=a[1],t.lineTo(h+n,d+r);break;case"m":h+=a[1],d+=a[2],t.moveTo(h+n,d+r);break;case"M":h=a[1],d=a[2],t.moveTo(h+n,d+r);break;case"c":s=h+a[5],u=d+a[6],p=h+a[3],g=d+a[4],t.bezierCurveTo(h+a[1]+n,d+a[2]+r,p+n,g+r,s+n,u+r),h=s,d=u;break;case"C":h=a[5],d=a[6],p=a[3],g=a[4],t.bezierCurveTo(a[1]+n,a[2]+r,p+n,g+r,h+n,d+r);break;case"s":s=h+a[3],u=d+a[4],p=2*h-p,g=2*d-g,t.bezierCurveTo(p+n,g+r,h+a[1]+n,d+a[2]+r,s+n,u+r),p=h+a[1],g=d+a[2],h=s,d=u;break;case"S":s=a[3],u=a[4],p=2*h-p,g=2*d-g,t.bezierCurveTo(p+n,g+r,a[1]+n,a[2]+r,s+n,u+r),h=s,d=u,p=a[1],g=a[2];break;case"q":s=h+a[3],u=d+a[4],p=h+a[1],g=d+a[2],t.quadraticCurveTo(p+n,g+r,s+n,u+r),h=s,d=u;break;case"Q":s=a[3],u=a[4],t.quadraticCurveTo(a[1]+n,a[2]+r,s+n,u+r),h=s,d=u,p=a[1],g=a[2];break;case"t":s=h+a[1],u=d+a[2],null===f[0].match(/[QqTt]/)?(p=h,g=d):"t"===f[0]?(p=2*h-l,g=2*d-c):"q"===f[0]&&(p=2*h-p,g=2*d-g),l=p,c=g,t.quadraticCurveTo(p+n,g+r,s+n,u+r),d=u,p=(h=s)+a[1],g=d+a[2];break;case"T":s=a[1],u=a[2],p=2*h-p,g=2*d-g,t.quadraticCurveTo(p+n,g+r,s+n,u+r),h=s,d=u;break;case"a":EU(t,h+n,d+r,[a[1],a[2],a[3],a[4],a[5],a[6]+h+n,a[7]+d+r]),h+=a[6],d+=a[7];break;case"A":EU(t,h+n,d+r,[a[1],a[2],a[3],a[4],a[5],a[6]+n,a[7]+r]),h=a[6],d=a[7];break;case"z":case"Z":t.closePath()}f=a}}function EU(t,e,n,r){const i=function(t,e,n,r,i,o,a,s,u){const l=xU.call(arguments);if(vU[l])return vU[l];const c=a*dU,f=Math.sin(c),h=Math.cos(c),d=h*(s-t)*.5+f*(u-e)*.5,p=h*(u-e)*.5-f*(s-t)*.5;let g=d*d/((n=Math.abs(n))*n)+p*p/((r=Math.abs(r))*r);g>1&&(g=Math.sqrt(g),n*=g,r*=g);const m=h/n,y=f/n,v=-f/r,b=h/r,x=m*s+y*u,_=v*s+b*u,w=m*t+y*e,A=v*t+b*e;let D=1/((w-x)*(w-x)+(A-_)*(A-_))-.25;D<0&&(D=0);let E=Math.sqrt(D);o==i&&(E=-E);const F=.5*(x+w)-E*(A-_),C=.5*(_+A)+E*(w-x),k=Math.atan2(_-C,x-F);let M=Math.atan2(A-C,w-F)-k;M<0&&1===o?M+=mU:M>0&&0===o&&(M-=mU);const S=Math.ceil(Math.abs(M/(gU+.001))),$=[];for(let T=0;T<S;++T){const t=k+T*M/S,e=k+(T+1)*M/S;$[T]=[F,C,t,e,n,r,f,h]}return vU[l]=$}(r[5],r[6],r[0],r[1],r[3],r[4],r[2],e,n);for(let o=0;o<i.length;++o){const e=_U(i[o]);t.bezierCurveTo(e[0],e[1],e[2],e[3],e[4],e[5])}}const FU=.5773502691896257,CU={circle:{draw:function(t,e){const n=Math.sqrt(e)/2;t.moveTo(n,0),t.arc(0,0,n,0,mU)}},cross:{draw:function(t,e){var n=Math.sqrt(e)/2,r=n/2.5;t.moveTo(-n,-r),t.lineTo(-n,r),t.lineTo(-r,r),t.lineTo(-r,n),t.lineTo(r,n),t.lineTo(r,r),t.lineTo(n,r),t.lineTo(n,-r),t.lineTo(r,-r),t.lineTo(r,-n),t.lineTo(-r,-n),t.lineTo(-r,-r),t.closePath()}},diamond:{draw:function(t,e){const n=Math.sqrt(e)/2;t.moveTo(-n,0),t.lineTo(0,-n),t.lineTo(n,0),t.lineTo(0,n),t.closePath()}},square:{draw:function(t,e){var n=Math.sqrt(e),r=-n/2;t.rect(r,r,n,n)}},arrow:{draw:function(t,e){var n=Math.sqrt(e)/2,r=n/7,i=n/2.5,o=n/8;t.moveTo(-r,n),t.lineTo(r,n),t.lineTo(r,-o),t.lineTo(i,-o),t.lineTo(0,-n),t.lineTo(-i,-o),t.lineTo(-r,-o),t.closePath()}},wedge:{draw:function(t,e){var n=Math.sqrt(e)/2,r=yU*n,i=r-n*FU,o=n/4;t.moveTo(0,-r-i),t.lineTo(-o,r-i),t.lineTo(o,r-i),t.closePath()}},triangle:{draw:function(t,e){var n=Math.sqrt(e)/2,r=yU*n,i=r-n*FU;t.moveTo(0,-r-i),t.lineTo(-n,r-i),t.lineTo(n,r-i),t.closePath()}},"triangle-up":{draw:function(t,e){var n=Math.sqrt(e)/2,r=yU*n;t.moveTo(0,-r),t.lineTo(-n,r),t.lineTo(n,r),t.closePath()}},"triangle-down":{draw:function(t,e){var n=Math.sqrt(e)/2,r=yU*n;t.moveTo(0,r),t.lineTo(-n,-r),t.lineTo(n,-r),t.closePath()}},"triangle-right":{draw:function(t,e){var n=Math.sqrt(e)/2,r=yU*n;t.moveTo(r,0),t.lineTo(-r,-n),t.lineTo(-r,n),t.closePath()}},"triangle-left":{draw:function(t,e){var n=Math.sqrt(e)/2,r=yU*n;t.moveTo(-r,0),t.lineTo(r,-n),t.lineTo(r,n),t.closePath()}},stroke:{draw:function(t,e){const n=Math.sqrt(e)/2;t.moveTo(-n,0),t.lineTo(n,0)}}};function kU(t){return qM(CU,t)?CU[t]:function(t){if(!qM(MU,t)){const e=hU(t);MU[t]={draw:function(t,n){DU(t,e,0,0,Math.sqrt(n)/2)}}}return MU[t]}(t)}var MU={};const SU=.448084975506;function $U(t){return t.x}function TU(t){return t.y}function BU(t){return t.width}function NU(t){return t.height}function OU(t){return"function"===typeof t?t:()=>+t}function zU(t,e,n){return Math.max(e,Math.min(t,n))}function RU(t,e){return null!=t?t:e}const PU=t=>t.x||0,UU=t=>t.y||0,LU=t=>!(!1===t.defined),jU=function(){var t=JS,e=ZS,n=VS(0),r=null,i=KS,o=QS,a=t$,s=null;function u(){var u,l,c=+t.apply(this,arguments),f=+e.apply(this,arguments),h=i.apply(this,arguments)-bS,d=o.apply(this,arguments)-bS,p=cS(d-h),g=d>h;if(s||(s=u=GS()),f<c&&(l=f,f=c,c=l),f>yS)if(p>xS-yS)s.moveTo(f*hS(h),f*gS(h)),s.arc(0,0,f,h,d,!g),c>yS&&(s.moveTo(c*hS(d),c*gS(d)),s.arc(0,0,c,d,h,g));else{var m,y,v=h,b=d,x=h,_=d,w=p,A=p,D=a.apply(this,arguments)/2,E=D>yS&&(r?+r.apply(this,arguments):mS(c*c+f*f)),F=pS(cS(f-c)/2,+n.apply(this,arguments)),C=F,k=F;if(E>yS){var M=_S(E/c*gS(D)),S=_S(E/f*gS(D));(w-=2*M)>yS?(x+=M*=g?1:-1,_-=M):(w=0,x=_=(h+d)/2),(A-=2*S)>yS?(v+=S*=g?1:-1,b-=S):(A=0,v=b=(h+d)/2)}var $=f*hS(v),T=f*gS(v),B=c*hS(_),N=c*gS(_);if(F>yS){var O,z=f*hS(b),R=f*gS(b),P=c*hS(x),U=c*gS(x);if(p<vS&&(O=function(t,e,n,r,i,o,a,s){var u=n-t,l=r-e,c=a-i,f=s-o,h=f*u-c*l;if(!(h*h<yS))return[t+(h=(c*(e-o)-f*(t-i))/h)*u,e+h*l]}($,T,P,U,z,R,B,N))){var L=$-O[0],j=T-O[1],I=z-O[0],q=R-O[1],W=1/gS(function(t){return t>1?0:t<-1?vS:Math.acos(t)}((L*I+j*q)/(mS(L*L+j*j)*mS(I*I+q*q)))/2),H=mS(O[0]*O[0]+O[1]*O[1]);C=pS(F,(c-H)/(W-1)),k=pS(F,(f-H)/(W+1))}}A>yS?k>yS?(m=e$(P,U,$,T,f,k,g),y=e$(z,R,B,N,f,k,g),s.moveTo(m.cx+m.x01,m.cy+m.y01),k<F?s.arc(m.cx,m.cy,k,fS(m.y01,m.x01),fS(y.y01,y.x01),!g):(s.arc(m.cx,m.cy,k,fS(m.y01,m.x01),fS(m.y11,m.x11),!g),s.arc(0,0,f,fS(m.cy+m.y11,m.cx+m.x11),fS(y.cy+y.y11,y.cx+y.x11),!g),s.arc(y.cx,y.cy,k,fS(y.y11,y.x11),fS(y.y01,y.x01),!g))):(s.moveTo($,T),s.arc(0,0,f,v,b,!g)):s.moveTo($,T),c>yS&&w>yS?C>yS?(m=e$(B,N,z,R,c,-C,g),y=e$($,T,P,U,c,-C,g),s.lineTo(m.cx+m.x01,m.cy+m.y01),C<F?s.arc(m.cx,m.cy,C,fS(m.y01,m.x01),fS(y.y01,y.x01),!g):(s.arc(m.cx,m.cy,C,fS(m.y01,m.x01),fS(m.y11,m.x11),!g),s.arc(0,0,c,fS(m.cy+m.y11,m.cx+m.x11),fS(y.cy+y.y11,y.cx+y.x11),g),s.arc(y.cx,y.cy,C,fS(y.y11,y.x11),fS(y.y01,y.x01),!g))):s.arc(0,0,c,_,x,g):s.lineTo(B,N)}else s.moveTo(0,0);if(s.closePath(),u)return s=null,u+""||null}return u.centroid=function(){var n=(+t.apply(this,arguments)+ +e.apply(this,arguments))/2,r=(+i.apply(this,arguments)+ +o.apply(this,arguments))/2-vS/2;return[hS(r)*n,gS(r)*n]},u.innerRadius=function(e){return arguments.length?(t="function"===typeof e?e:VS(+e),u):t},u.outerRadius=function(t){return arguments.length?(e="function"===typeof t?t:VS(+t),u):e},u.cornerRadius=function(t){return arguments.length?(n="function"===typeof t?t:VS(+t),u):n},u.padRadius=function(t){return arguments.length?(r=null==t?null:"function"===typeof t?t:VS(+t),u):r},u.startAngle=function(t){return arguments.length?(i="function"===typeof t?t:VS(+t),u):i},u.endAngle=function(t){return arguments.length?(o="function"===typeof t?t:VS(+t),u):o},u.padAngle=function(t){return arguments.length?(a="function"===typeof t?t:VS(+t),u):a},u.context=function(t){return arguments.length?(s=null==t?null:t,u):s},u}().startAngle((t=>t.startAngle||0)).endAngle((t=>t.endAngle||0)).padAngle((t=>t.padAngle||0)).innerRadius((t=>t.innerRadius||0)).outerRadius((t=>t.outerRadius||0)).cornerRadius((t=>t.cornerRadius||0)),IU=a$().x(PU).y1(UU).y0((t=>(t.y||0)+(t.height||0))).defined(LU),qU=a$().y(UU).x1(PU).x0((t=>(t.x||0)+(t.width||0))).defined(LU),WU=o$().x(PU).y(UU).defined(LU),HU=function(){var t=$U,e=TU,n=BU,r=NU,i=OU(0),o=i,a=i,s=i,u=null;function l(l,c,f){var h,d=null!=c?c:+t.call(this,l),p=null!=f?f:+e.call(this,l),g=+n.call(this,l),m=+r.call(this,l),y=Math.min(g,m)/2,v=zU(+i.call(this,l),0,y),b=zU(+o.call(this,l),0,y),x=zU(+a.call(this,l),0,y),_=zU(+s.call(this,l),0,y);if(u||(u=h=GS()),v<=0&&b<=0&&x<=0&&_<=0)u.rect(d,p,g,m);else{var w=d+g,A=p+m;u.moveTo(d+v,p),u.lineTo(w-b,p),u.bezierCurveTo(w-SU*b,p,w,p+SU*b,w,p+b),u.lineTo(w,A-_),u.bezierCurveTo(w,A-SU*_,w-SU*_,A,w-_,A),u.lineTo(d+x,A),u.bezierCurveTo(d+SU*x,A,d,A-SU*x,d,A-x),u.lineTo(d,p+v),u.bezierCurveTo(d,p+SU*v,d+SU*v,p,d+v,p),u.closePath()}if(h)return u=null,h+""||null}return l.x=function(e){return arguments.length?(t=OU(e),l):t},l.y=function(t){return arguments.length?(e=OU(t),l):e},l.width=function(t){return arguments.length?(n=OU(t),l):n},l.height=function(t){return arguments.length?(r=OU(t),l):r},l.cornerRadius=function(t,e,n,r){return arguments.length?(i=OU(t),o=null!=e?OU(e):i,s=null!=n?OU(n):i,a=null!=r?OU(r):o,l):i},l.context=function(t){return arguments.length?(u=null==t?null:t,l):u},l}().x(PU).y(UU).width((t=>t.width||0)).height((t=>t.height||0)).cornerRadius((t=>RU(t.cornerRadiusTopLeft,t.cornerRadius)||0),(t=>RU(t.cornerRadiusTopRight,t.cornerRadius)||0),(t=>RU(t.cornerRadiusBottomRight,t.cornerRadius)||0),(t=>RU(t.cornerRadiusBottomLeft,t.cornerRadius)||0)),XU=function(t,e){var n=null;function r(){var r;if(n||(n=r=GS()),t.apply(this,arguments).draw(n,+e.apply(this,arguments)),r)return n=null,r+""||null}return t="function"===typeof t?t:VS(t||s$),e="function"===typeof e?e:VS(void 0===e?64:+e),r.type=function(e){return arguments.length?(t="function"===typeof e?e:VS(e),r):t},r.size=function(t){return arguments.length?(e="function"===typeof t?t:VS(+t),r):e},r.context=function(t){return arguments.length?(n=null==t?null:t,r):n},r}().type((t=>kU(t.shape||"circle"))).size((t=>RU(t.size,64))),YU=function(){var t,e,n,r,i,o,a,s,u=null;function l(t,e,n){const r=n/2;if(i){var l=a-e,c=t-o;if(l||c){var f=Math.sqrt(l*l+c*c),h=(l/=f)*s,d=(c/=f)*s,p=Math.atan2(c,l);u.moveTo(o-h,a-d),u.lineTo(t-l*r,e-c*r),u.arc(t,e,r,p-Math.PI,p),u.lineTo(o+h,a+d),u.arc(o,a,s,p,p+Math.PI)}else u.arc(t,e,r,0,mU);u.closePath()}else i=1;o=t,a=e,s=r}function c(o){var a,s,c,f=o.length,h=!1;for(null==u&&(u=c=GS()),a=0;a<=f;++a)!(a<f&&r(s=o[a],a,o))===h&&(h=!h)&&(i=0),h&&l(+t(s,a,o),+e(s,a,o),+n(s,a,o));if(c)return u=null,c+""||null}return c.x=function(e){return arguments.length?(t=e,c):t},c.y=function(t){return arguments.length?(e=t,c):e},c.size=function(t){return arguments.length?(n=t,c):n},c.defined=function(t){return arguments.length?(r=t,c):r},c.context=function(t){return arguments.length?(u=null==t?null:t,c):u},c}().x(PU).y(UU).defined(LU).size((t=>t.size||1));function GU(t){return t.cornerRadius||t.cornerRadiusTopLeft||t.cornerRadiusTopRight||t.cornerRadiusBottomRight||t.cornerRadiusBottomLeft}function VU(t,e,n,r){return HU.context(t)(e,n,r)}var JU=1;function ZU(t,e,n){var r=e.clip,i=t._defs,o=e.clip_id||(e.clip_id="clip"+JU++),a=i.clipping[o]||(i.clipping[o]={id:o});return LM(r)?a.path=r(null):GU(n)?a.path=VU(null,n,0,0):(a.width=n.width||0,a.height=n.height||0),"url(#"+o+")"}function KU(t){this.clear(),t&&this.union(t)}function QU(t){this.mark=t,this.bounds=this.bounds||new KU}function tL(t){QU.call(this,t),this.items=this.items||[]}function eL(t){this._pending=0,this._loader=t||eO()}function nL(t){t._pending+=1}function rL(t){t._pending-=1}function iL(t,e,n){if(e.stroke&&0!==e.opacity&&0!==e.strokeOpacity){const r=null!=e.strokeWidth?+e.strokeWidth:1;t.expand(r+(n?function(t,e){return t.strokeJoin&&"miter"!==t.strokeJoin?0:e}(e,r):0))}return t}KU.prototype={clone(){return new KU(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(t){return this.x1===t.x1&&this.y1===t.y1&&this.x2===t.x2&&this.y2===t.y2},set(t,e,n,r){return n<t?(this.x2=t,this.x1=n):(this.x1=t,this.x2=n),r<e?(this.y2=e,this.y1=r):(this.y1=e,this.y2=r),this},add(t,e){return t<this.x1&&(this.x1=t),e<this.y1&&(this.y1=e),t>this.x2&&(this.x2=t),e>this.y2&&(this.y2=e),this},expand(t){return this.x1-=t,this.y1-=t,this.x2+=t,this.y2+=t,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(t){return this.x1*=t,this.y1*=t,this.x2*=t,this.y2*=t,this},translate(t,e){return this.x1+=t,this.x2+=t,this.y1+=e,this.y2+=e,this},rotate(t,e,n){const r=this.rotatedPoints(t,e,n);return this.clear().add(r[0],r[1]).add(r[2],r[3]).add(r[4],r[5]).add(r[6],r[7])},rotatedPoints(t,e,n){var{x1:r,y1:i,x2:o,y2:a}=this,s=Math.cos(t),u=Math.sin(t),l=e-e*s+n*u,c=n-e*u-n*s;return[s*r-u*i+l,u*r+s*i+c,s*r-u*a+l,u*r+s*a+c,s*o-u*i+l,u*o+s*i+c,s*o-u*a+l,u*o+s*a+c]},union(t){return t.x1<this.x1&&(this.x1=t.x1),t.y1<this.y1&&(this.y1=t.y1),t.x2>this.x2&&(this.x2=t.x2),t.y2>this.y2&&(this.y2=t.y2),this},intersect(t){return t.x1>this.x1&&(this.x1=t.x1),t.y1>this.y1&&(this.y1=t.y1),t.x2<this.x2&&(this.x2=t.x2),t.y2<this.y2&&(this.y2=t.y2),this},encloses(t){return t&&this.x1<=t.x1&&this.x2>=t.x2&&this.y1<=t.y1&&this.y2>=t.y2},alignsWith(t){return t&&(this.x1==t.x1||this.x2==t.x2||this.y1==t.y1||this.y2==t.y2)},intersects(t){return t&&!(this.x2<t.x1||this.x1>t.x2||this.y2<t.y1||this.y1>t.y2)},contains(t,e){return!(t<this.x1||t>this.x2||e<this.y1||e>this.y2)},width(){return this.x2-this.x1},height(){return this.y2-this.y1}},WM(tL,QU),eL.prototype={pending(){return this._pending},sanitizeURL(t){const e=this;return nL(e),e._loader.sanitize(t,{context:"href"}).then((t=>(rL(e),t))).catch((()=>(rL(e),null)))},loadImage(t){const e=this,n=c$();return nL(e),e._loader.sanitize(t,{context:"image"}).then((t=>{const r=t.href;if(!r||!n)throw{url:r};const i=new n,o=qM(t,"crossOrigin")?t.crossOrigin:"anonymous";return null!=o&&(i.crossOrigin=o),i.onload=()=>rL(e),i.onerror=()=>rL(e),i.src=r,i})).catch((t=>(rL(e),{complete:!1,width:0,height:0,src:t&&t.url||""})))},ready(){const t=this;return new Promise((e=>{!function n(r){t.pending()?setTimeout((()=>{n(!0)}),10):e(r)}(!1)}))}};const oL=mU-1e-8;let aL,sL,uL,lL,cL,fL,hL,dL;const pL=(t,e)=>aL.add(t,e),gL=(t,e)=>pL(sL=t,uL=e),mL=t=>pL(t,aL.y1),yL=t=>pL(aL.x1,t),vL=(t,e)=>cL*t+hL*e,bL=(t,e)=>fL*t+dL*e,xL=(t,e)=>pL(vL(t,e),bL(t,e)),_L=(t,e)=>gL(vL(t,e),bL(t,e));function wL(t,e){return aL=t,e?(lL=e*dU,cL=dL=Math.cos(lL),fL=Math.sin(lL),hL=-fL):(cL=dL=1,lL=fL=hL=0),AL}const AL={beginPath(){},closePath(){},moveTo:_L,lineTo:_L,rect(t,e,n,r){lL?(xL(t+n,e),xL(t+n,e+r),xL(t,e+r),_L(t,e)):(pL(t+n,e+r),gL(t,e))},quadraticCurveTo(t,e,n,r){const i=vL(t,e),o=bL(t,e),a=vL(n,r),s=bL(n,r);DL(sL,i,a,mL),DL(uL,o,s,yL),gL(a,s)},bezierCurveTo(t,e,n,r,i,o){const a=vL(t,e),s=bL(t,e),u=vL(n,r),l=bL(n,r),c=vL(i,o),f=bL(i,o);EL(sL,a,u,c,mL),EL(uL,s,l,f,yL),gL(c,f)},arc(t,e,n,r,i,o){if(r+=lL,i+=lL,sL=n*Math.cos(i)+t,uL=n*Math.sin(i)+e,Math.abs(i-r)>oL)pL(t-n,e-n),pL(t+n,e+n);else{const a=r=>pL(n*Math.cos(r)+t,n*Math.sin(r)+e);let s,u;if(a(r),a(i),i!==r)if((r%=mU)<0&&(r+=mU),(i%=mU)<0&&(i+=mU),i<r&&(o=!o,s=r,r=i,i=s),o)for(i-=mU,s=r-r%gU,u=0;u<4&&s>i;++u,s-=gU)a(s);else for(s=r-r%gU+gU,u=0;u<4&&s<i;++u,s+=gU)a(s)}}};function DL(t,e,n,r){const i=(t-e)/(t+n-2*e);0<i&&i<1&&r(t+(e-t)*i)}function EL(t,e,n,r,i){const o=r-t+3*e-3*n,a=t+n-2*e,s=t-e;let u,l=0,c=0;Math.abs(o)>pU?(u=a*a+s*o,u>=0&&(u=Math.sqrt(u),l=(-a+u)/o,c=(-a-u)/o)):l=.5*s/a,0<l&&l<1&&i(FL(l,t,e,n,r)),0<c&&c<1&&i(FL(c,t,e,n,r))}function FL(t,e,n,r,i){const o=1-t,a=o*o,s=t*t;return a*o*e+3*a*t*n+3*o*s*r+s*t*i}var CL=(CL=l$(1,1))?CL.getContext("2d"):null;const kL=new KU;function ML(t){return function(e,n){if(!CL)return!0;t(CL,e),kL.clear().union(e.bounds).intersect(n).round();const{x1:r,y1:i,x2:o,y2:a}=kL;for(let t=i;t<=a;++t)for(let e=r;e<=o;++e)if(CL.isPointInPath(e,t))return!0;return!1}}function SL(t,e){return e.contains(t.x||0,t.y||0)}function $L(t,e){const n=t.x||0,r=t.y||0,i=t.width||0,o=t.height||0;return e.intersects(kL.set(n,r,n+i,r+o))}function TL(t,e,n,r,i){const{x1:o,y1:a,x2:s,y2:u}=t,l=r-e,c=i-n;let f,h,d,p,g=0,m=1;for(p=0;p<4;++p){if(0===p&&(f=-l,h=-(o-e)),1===p&&(f=l,h=s-e),2===p&&(f=-c,h=-(a-n)),3===p&&(f=c,h=u-n),Math.abs(f)<1e-10&&h<0)return!1;if(d=h/f,f<0){if(d>m)return!1;d>g&&(g=d)}else if(f>0){if(d<g)return!1;d<m&&(m=d)}}return!0}function BL(t,e){t.globalCompositeOperation=e.blend||"source-over"}function NL(t,e){return null==t?e:t}function OL(t,e){const n=e.length;for(let r=0;r<n;++r)t.addColorStop(e[r].offset,e[r].color);return t}function zL(t,e,n){return oU(n)?function(t,e,n){const r=n.width(),i=n.height();let o;if("radial"===e.gradient)o=t.createRadialGradient(n.x1+NL(e.x1,.5)*r,n.y1+NL(e.y1,.5)*i,Math.max(r,i)*NL(e.r1,0),n.x1+NL(e.x2,.5)*r,n.y1+NL(e.y2,.5)*i,Math.max(r,i)*NL(e.r2,.5));else{const a=NL(e.x1,0),s=NL(e.y1,0),u=NL(e.x2,1),l=NL(e.y2,0);if(a!==u&&s!==l&&r!==i){const n=l$(Math.ceil(r),Math.ceil(i)),o=n.getContext("2d");return o.scale(r,i),o.fillStyle=OL(o.createLinearGradient(a,s,u,l),e.stops),o.fillRect(0,0,r,i),t.createPattern(n,"no-repeat")}o=t.createLinearGradient(n.x1+a*r,n.y1+s*i,n.x1+u*r,n.y1+l*i)}return OL(o,e.stops)}(t,n,e.bounds):n}function RL(t,e,n){return(n*=null==e.fillOpacity?1:e.fillOpacity)>0&&(t.globalAlpha=n,t.fillStyle=zL(t,e,e.fill),!0)}var PL=[];function UL(t,e,n){var r=null!=(r=e.strokeWidth)?r:1;return!(r<=0)&&((n*=null==e.strokeOpacity?1:e.strokeOpacity)>0&&(t.globalAlpha=n,t.strokeStyle=zL(t,e,e.stroke),t.lineWidth=r,t.lineCap=e.strokeCap||"butt",t.lineJoin=e.strokeJoin||"miter",t.miterLimit=e.strokeMiterLimit||10,t.setLineDash&&(t.setLineDash(e.strokeDash||PL),t.lineDashOffset=e.strokeDashOffset||0),!0))}function LL(t,e){return t.zindex-e.zindex||t.index-e.index}function jL(t){if(!t.zdirty)return t.zitems;var e,n,r,i=t.items,o=[];for(n=0,r=i.length;n<r;++n)(e=i[n]).index=n,e.zindex&&o.push(e);return t.zdirty=!1,t.zitems=o.sort(LL)}function IL(t,e){var n,r,i=t.items;if(!i||!i.length)return;const o=jL(t);if(o&&o.length){for(n=0,r=i.length;n<r;++n)i[n].zindex||e(i[n]);i=o}for(n=0,r=i.length;n<r;++n)e(i[n])}function qL(t,e){var n,r,i=t.items;if(!i||!i.length)return null;const o=jL(t);for(o&&o.length&&(i=o),r=i.length;--r>=0;)if(n=e(i[r]))return n;if(i===o)for(r=(i=t.items).length;--r>=0;)if(!i[r].zindex&&(n=e(i[r])))return n;return null}function WL(t){return function(e,n,r){IL(n,(n=>{r&&!r.intersects(n.bounds)||XL(t,e,n,n)}))}}function HL(t){return function(e,n,r){!n.items.length||r&&!r.intersects(n.bounds)||XL(t,e,n.items[0],n.items)}}function XL(t,e,n,r){var i=null==n.opacity?1:n.opacity;0!==i&&(t(e,r)||(BL(e,n),n.fill&&RL(e,n,i)&&e.fill(),n.stroke&&UL(e,n,i)&&e.stroke()))}function YL(t){return t=t||NM,function(e,n,r,i,o,a){return r*=e.pixelRatio,i*=e.pixelRatio,qL(n,(n=>{const s=n.bounds;if((!s||s.contains(o,a))&&s)return t(e,n,r,i,o,a)?n:void 0}))}}function GL(t,e){return function(n,r,i,o){var a,s,u=Array.isArray(r)?r[0]:r,l=null==e?u.fill:e,c=u.stroke&&n.isPointInStroke;return c&&(a=u.strokeWidth,s=u.strokeCap,n.lineWidth=null!=a?a:1,n.lineCap=null!=s?s:"butt"),!t(n,r)&&(l&&n.isPointInPath(i,o)||c&&n.isPointInStroke(i,o))}}function VL(t){return YL(GL(t))}function JL(t,e){return"translate("+t+","+e+")"}function ZL(t){return"rotate("+t+")"}function KL(t){return JL(t.x||0,t.y||0)}function QL(t,e,n){function r(t,n){var r=n.x||0,i=n.y||0,o=n.angle||0;t.translate(r,i),o&&t.rotate(o*=dU),t.beginPath(),e(t,n),o&&t.rotate(-o),t.translate(-r,-i)}return{type:t,tag:"path",nested:!1,attr:function(t,n){t("transform",function(t){return JL(t.x||0,t.y||0)+(t.angle?" "+ZL(t.angle):"")}(n)),t("d",e(null,n))},bound:function(t,n){return e(wL(t,n.angle),n),iL(t,n).translate(n.x||0,n.y||0)},draw:WL(r),pick:VL(r),isect:n||ML(r)}}var tj=QL("arc",(function(t,e){return jU.context(t)(e)}));function ej(t,e,n){function r(t,n){t.beginPath(),e(t,n)}const i=GL(r);return{type:t,tag:"path",nested:!0,attr:function(t,n){var r=n.mark.items;r.length&&t("d",e(null,r))},bound:function(t,n){var r=n.items;return 0===r.length?t:(e(wL(t),r),iL(t,r[0]))},draw:HL(r),pick:function(t,e,n,r,o,a){var s=e.items,u=e.bounds;return!s||!s.length||u&&!u.contains(o,a)?null:(n*=t.pixelRatio,r*=t.pixelRatio,i(t,s,n,r)?s[0]:null)},isect:SL,tip:n}}var nj=ej("area",(function(t,e){const n=e[0],r=n.interpolate||"linear";return("horizontal"===n.orient?qU:IU).curve(lU(r,n.orient,n.tension)).context(t)(e)}),(function(t,e){for(var n,r,i="horizontal"===t[0].orient?e[1]:e[0],o="horizontal"===t[0].orient?"y":"x",a=t.length,s=1/0;--a>=0;)!1!==t[a].defined&&(r=Math.abs(t[a][o]-i))<s&&(s=r,n=t[a]);return n}));function rj(t,e){t.beginPath(),GU(e)?VU(t,e,0,0):t.rect(0,0,e.width||0,e.height||0),t.clip()}function ij(t){const e=NL(t.strokeWidth,1);return null!=t.strokeOffset?t.strokeOffset:t.stroke&&e>.5&&e<1.5?.5-Math.abs(e-1):0}function oj(t,e){const n=ij(e);t("d",VU(null,e,n,n))}function aj(t,e,n,r){const i=ij(e);t.beginPath(),VU(t,e,(n||0)+i,(r||0)+i)}const sj=GL(aj),uj=GL(aj,!1),lj=GL(aj,!0);var cj={type:"group",tag:"g",nested:!1,attr:function(t,e){t("transform",KL(e))},bound:function(t,e){if(!e.clip&&e.items){const n=e.items,r=n.length;for(let e=0;e<r;++e)t.union(n[e].bounds)}return(e.clip||e.width||e.height)&&!e.noBound&&t.add(0,0).add(e.width||0,e.height||0),iL(t,e),t.translate(e.x||0,e.y||0)},draw:function(t,e,n){IL(e,(e=>{const r=e.x||0,i=e.y||0,o=e.strokeForeground,a=null==e.opacity?1:e.opacity;(e.stroke||e.fill)&&a&&(aj(t,e,r,i),BL(t,e),e.fill&&RL(t,e,a)&&t.fill(),e.stroke&&!o&&UL(t,e,a)&&t.stroke()),t.save(),t.translate(r,i),e.clip&&rj(t,e),n&&n.translate(-r,-i),IL(e,(e=>{this.draw(t,e,n)})),n&&n.translate(r,i),t.restore(),o&&e.stroke&&a&&(aj(t,e,r,i),BL(t,e),UL(t,e,a)&&t.stroke())}))},pick:function(t,e,n,r,i,o){if(e.bounds&&!e.bounds.contains(i,o)||!e.items)return null;const a=n*t.pixelRatio,s=r*t.pixelRatio;return qL(e,(u=>{let l,c,f;const h=u.bounds;if(h&&!h.contains(i,o))return;c=u.x||0,f=u.y||0;const d=c+(u.width||0),p=f+(u.height||0),g=u.clip;if(g&&(i<c||i>d||o<f||o>p))return;if(t.save(),t.translate(c,f),c=i-c,f=o-f,g&&GU(u)&&!lj(t,u,a,s))return t.restore(),null;const m=u.strokeForeground,y=!1!==e.interactive;return y&&m&&u.stroke&&uj(t,u,a,s)?(t.restore(),u):(l=qL(u,(t=>function(t,e,n){return(!1!==t.interactive||"group"===t.marktype)&&t.bounds&&t.bounds.contains(e,n)}(t,c,f)?this.pick(t,n,r,c,f):null)),!l&&y&&(u.fill||!m&&u.stroke)&&sj(t,u,a,s)&&(l=u),t.restore(),l||null)}))},isect:$L,content:function(t,e,n){t("clip-path",e.clip?ZU(n,e,e):null)},background:function(t,e){t("class","background"),t("aria-hidden",!0),oj(t,e)},foreground:function(t,e){t("class","foreground"),t("aria-hidden",!0),e.strokeForeground?oj(t,e):t("d","")}},fj={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",version:"1.1"};function hj(t,e){var n=t.image;return(!n||t.url&&t.url!==n.url)&&(n={complete:!1,width:0,height:0},e.loadImage(t.url).then((e=>{t.image=e,t.image.url=t.url}))),n}function dj(t,e){return null!=t.width?t.width:e&&e.width?!1!==t.aspect&&t.height?t.height*e.width/e.height:e.width:0}function pj(t,e){return null!=t.height?t.height:e&&e.height?!1!==t.aspect&&t.width?t.width*e.height/e.width:e.height:0}function gj(t,e){return"center"===t?e/2:"right"===t?e:0}function mj(t,e){return"middle"===t?e/2:"bottom"===t?e:0}var yj={type:"image",tag:"image",nested:!1,attr:function(t,e,n){const r=hj(e,n),i=dj(e,r),o=pj(e,r),a=(e.x||0)-gj(e.align,i),s=(e.y||0)-mj(e.baseline,o);t("href",!r.src&&r.toDataURL?r.toDataURL():r.src||"",fj["xmlns:xlink"],"xlink:href"),t("transform",JL(a,s)),t("width",i),t("height",o),t("preserveAspectRatio",!1===e.aspect?"none":"xMidYMid")},bound:function(t,e){const n=e.image,r=dj(e,n),i=pj(e,n),o=(e.x||0)-gj(e.align,r),a=(e.y||0)-mj(e.baseline,i);return t.set(o,a,o+r,a+i)},draw:function(t,e,n){IL(e,(e=>{if(n&&!n.intersects(e.bounds))return;const r=hj(e,this);let i=dj(e,r),o=pj(e,r);if(0===i||0===o)return;let a,s,u,l,c=(e.x||0)-gj(e.align,i),f=(e.y||0)-mj(e.baseline,o);!1!==e.aspect&&(s=r.width/r.height,u=e.width/e.height,s===s&&u===u&&s!==u&&(u<s?(l=i/s,f+=(o-l)/2,o=l):(l=o*s,c+=(i-l)/2,i=l))),(r.complete||r.toDataURL)&&(BL(t,e),t.globalAlpha=null!=(a=e.opacity)?a:1,t.imageSmoothingEnabled=!1!==e.smooth,t.drawImage(r,c,f,i,o))}))},pick:YL(),isect:NM,get:hj,xOffset:gj,yOffset:mj},vj=ej("line",(function(t,e){const n=e[0],r=n.interpolate||"linear";return WU.curve(lU(r,n.orient,n.tension)).context(t)(e)}),(function(t,e){for(var n,r,i=Math.pow(t[0].strokeWidth||1,2),o=t.length;--o>=0;)if(!1!==t[o].defined&&(n=t[o].x-e[0])*n+(r=t[o].y-e[1])*r<i)return t[o];return null}));function bj(t,e){var n=e.path;if(null==n)return!0;var r=e.x||0,i=e.y||0,o=e.scaleX||1,a=e.scaleY||1,s=(e.angle||0)*dU,u=e.pathCache;u&&u.path===n||((e.pathCache=u=hU(n)).path=n),s&&t.rotate&&t.translate?(t.translate(r,i),t.rotate(s),DU(t,u,0,0,o,a),t.rotate(-s),t.translate(-r,-i)):DU(t,u,r,i,o,a)}var xj={type:"path",tag:"path",nested:!1,attr:function(t,e){var n=e.scaleX||1,r=e.scaleY||1;1===n&&1===r||t("vector-effect","non-scaling-stroke"),t("transform",function(t){return JL(t.x||0,t.y||0)+(t.angle?" "+ZL(t.angle):"")+(t.scaleX||t.scaleY?" "+function(t,e){return"scale("+t+","+e+")"}(t.scaleX||1,t.scaleY||1):"")}(e)),t("d",e.path)},bound:function(t,e){return bj(wL(t,e.angle),e)?t.set(0,0,0,0):iL(t,e,!0)},draw:WL(bj),pick:VL(bj),isect:ML(bj)};function _j(t,e){t.beginPath(),VU(t,e)}var wj={type:"rect",tag:"path",nested:!1,attr:function(t,e){t("d",VU(null,e))},bound:function(t,e){var n,r;return iL(t.set(n=e.x||0,r=e.y||0,n+e.width||0,r+e.height||0),e)},draw:WL(_j),pick:VL(_j),isect:$L};function Aj(t,e,n){var r,i,o,a;return!(!e.stroke||!UL(t,e,n))&&(r=e.x||0,i=e.y||0,o=null!=e.x2?e.x2:r,a=null!=e.y2?e.y2:i,t.beginPath(),t.moveTo(r,i),t.lineTo(o,a),!0)}var Dj={type:"rule",tag:"line",nested:!1,attr:function(t,e){t("transform",KL(e)),t("x2",null!=e.x2?e.x2-(e.x||0):0),t("y2",null!=e.y2?e.y2-(e.y||0):0)},bound:function(t,e){var n,r;return iL(t.set(n=e.x||0,r=e.y||0,null!=e.x2?e.x2:n,null!=e.y2?e.y2:r),e)},draw:function(t,e,n){IL(e,(e=>{if(!n||n.intersects(e.bounds)){var r=null==e.opacity?1:e.opacity;r&&Aj(t,e,r)&&(BL(t,e),t.stroke())}}))},pick:YL((function(t,e,n,r){return!!t.isPointInStroke&&(Aj(t,e,1)&&t.isPointInStroke(n,r))})),isect:function(t,e){const n=t.x||0,r=t.y||0;return TL(e,n,r,null!=t.x2?t.x2:n,null!=t.y2?t.y2:r)}},Ej=QL("shape",(function(t,e){return(e.mark.shape||e.shape).context(t)(e)})),Fj=QL("symbol",(function(t,e){return XU.context(t)(e)}),SL);const Cj=function(t){let e,n,r;t=+t||XM;const i=()=>{e={},n={},r=0},o=(i,o)=>(++r>t&&(n=e,e={},r=1),e[i]=o);return i(),{clear:i,has:t=>qM(e,t)||qM(n,t),get:t=>qM(e,t)?e[t]:qM(n,t)?o(t,n[t]):void 0,set:(t,n)=>qM(e,t)?e[t]=n:o(t,n)}}();var kj={height:Nj,measureWidth:Tj,estimateWidth:Sj,width:Sj,canvas:Mj};function Mj(t){kj.width=t&&CL?Tj:Sj}function Sj(t,e){return $j(Rj(t,e),Nj(t))}function $j(t,e){return~~(.8*t.length*e)}function Tj(t,e){return Nj(t)<=0||!(e=Rj(t,e))?0:Bj(e,Uj(t))}function Bj(t,e){const n=`(${e}) ${t}`;let r=Cj.get(n);return void 0===r&&(CL.font=e,r=CL.measureText(t).width,Cj.set(n,r)),r}function Nj(t){return null!=t.fontSize?+t.fontSize||0:11}function Oj(t){return null!=t.lineHeight?t.lineHeight:Nj(t)+2}function zj(t){return e=t.lineBreak&&t.text&&!OM(t.text)?t.text.split(t.lineBreak):t.text,OM(e)?e.length>1?e:e[0]:e;var e}function Rj(t,e){const n=null==e?"":(e+"").trim();return t.limit>0&&n.length?function(t,e){var n=+t.limit,r=function(t){if(kj.width===Tj){const e=Uj(t);return t=>Bj(t,e)}{const e=Nj(t);return t=>$j(t,e)}}(t);if(r(e)<n)return e;var i,o=t.ellipsis||"\u2026",a="rtl"===t.dir,s=0,u=e.length;if(n-=r(o),a){for(;s<u;)i=s+u>>>1,r(e.slice(i))>n?s=i+1:u=i;return o+e.slice(s)}for(;s<u;)i=1+(s+u>>>1),r(e.slice(0,i))<n?s=i:u=i-1;return e.slice(0,s)+o}(t,n):n}function Pj(t,e){var n=t.font;return(e&&n?String(n).replace(/"/g,"'"):n)||"sans-serif"}function Uj(t,e){return(t.fontStyle?t.fontStyle+" ":"")+(t.fontVariant?t.fontVariant+" ":"")+(t.fontWeight?t.fontWeight+" ":"")+Nj(t)+"px "+Pj(t,e)}function Lj(t){var e=t.baseline,n=Nj(t);return Math.round("top"===e?.79*n:"middle"===e?.3*n:"bottom"===e?-.21*n:"line-top"===e?.29*n+.5*Oj(t):"line-bottom"===e?.29*n-.5*Oj(t):0)}Mj(!0);const jj={left:"start",center:"middle",right:"end"},Ij=new KU;function qj(t){var e,n=t.x||0,r=t.y||0,i=t.radius||0;return i&&(e=(t.theta||0)-gU,n+=i*Math.cos(e),r+=i*Math.sin(e)),Ij.x1=n,Ij.y1=r,Ij}function Wj(t,e,n){var r,i=kj.height(e),o=e.align,a=qj(e),s=a.x1,u=a.y1,l=e.dx||0,c=(e.dy||0)+Lj(e)-Math.round(.8*i),f=zj(e);if(OM(f)?(i+=Oj(e)*(f.length-1),r=f.reduce(((t,n)=>Math.max(t,kj.width(e,n))),0)):r=kj.width(e,f),"center"===o?l-=r/2:"right"===o&&(l-=r),t.set(l+=s,c+=u,l+r,c+i),e.angle&&!n)t.rotate(e.angle*dU,s,u);else if(2===n)return t.rotatedPoints(e.angle*dU,s,u);return t}var Hj={type:"text",tag:"text",nested:!1,attr:function(t,e){var n,r=e.dx||0,i=(e.dy||0)+Lj(e),o=qj(e),a=o.x1,s=o.y1,u=e.angle||0;t("text-anchor",jj[e.align]||"start"),u?(n=JL(a,s)+" "+ZL(u),(r||i)&&(n+=" "+JL(r,i))):n=JL(a+r,s+i),t("transform",n)},bound:Wj,draw:function(t,e,n){IL(e,(e=>{var r,i,o,a,s,u,l,c=null==e.opacity?1:e.opacity;if(!(n&&!n.intersects(e.bounds)||0===c||e.fontSize<=0||null==e.text||0===e.text.length)){if(t.font=Uj(e),t.textAlign=e.align||"left",i=(r=qj(e)).x1,o=r.y1,e.angle&&(t.save(),t.translate(i,o),t.rotate(e.angle*dU),i=o=0),i+=e.dx||0,o+=(e.dy||0)+Lj(e),u=zj(e),BL(t,e),OM(u))for(s=Oj(e),a=0;a<u.length;++a)l=Rj(e,u[a]),e.fill&&RL(t,e,c)&&t.fillText(l,i,o),e.stroke&&UL(t,e,c)&&t.strokeText(l,i,o),o+=s;else l=Rj(e,u),e.fill&&RL(t,e,c)&&t.fillText(l,i,o),e.stroke&&UL(t,e,c)&&t.strokeText(l,i,o);e.angle&&t.restore()}}))},pick:YL((function(t,e,n,r,i,o){if(e.fontSize<=0)return!1;if(!e.angle)return!0;var a=qj(e),s=a.x1,u=a.y1,l=Wj(Ij,e,1),c=-e.angle*dU,f=Math.cos(c),h=Math.sin(c),d=f*i-h*o+(s-f*s+h*u),p=h*i+f*o+(u-h*s-f*u);return l.contains(d,p)})),isect:function(t,e){const n=Wj(Ij,t,2);return TL(e,n[0],n[1],n[2],n[3])||TL(e,n[0],n[1],n[4],n[5])||TL(e,n[4],n[5],n[6],n[7])||TL(e,n[2],n[3],n[6],n[7])}},Xj=ej("trail",(function(t,e){return YU.context(t)(e)}),(function(t,e){for(var n,r,i=t.length;--i>=0;)if(!1!==t[i].defined&&(n=t[i].x-e[0])*n+(r=t[i].y-e[1])*r<(n=t[i].size||1)*n)return t[i];return null})),Yj={arc:tj,area:nj,group:cj,image:yj,line:vj,path:xj,rect:wj,rule:Dj,shape:Ej,symbol:Fj,text:Hj,trail:Xj};function Gj(t,e,n){return!t&&"undefined"!==typeof document&&document.createElement&&(t=document),t?n?t.createElementNS(n,e):t.createElement(e):null}function Vj(t,e){e=e.toLowerCase();for(var n=t.childNodes,r=0,i=n.length;r<i;++r)if(n[r].tagName.toLowerCase()===e)return n[r]}function Jj(t,e,n,r){var i,o=t.childNodes[e];return o&&o.tagName.toLowerCase()===n.toLowerCase()||(i=o||null,o=Gj(t.ownerDocument,n,r),t.insertBefore(o,i)),o}function Zj(t,e){for(var n=t.childNodes,r=n.length;r>e;)t.removeChild(n[--r]);return t}function Kj(t){return"mark-"+t.marktype+(t.role?" role-"+t.role:"")+(t.name?" "+t.name:"")}function Qj(t,e){const n=e.getBoundingClientRect();return[t.clientX-n.left-(e.clientLeft||0),t.clientY-n.top-(e.clientTop||0)]}function tI(t,e){this._active=null,this._handlers={},this._loader=t||eO(),this._tooltip=e||eI}function eI(t,e,n,r){t.element().setAttribute("title",r||"")}function nI(t){this._el=null,this._bgcolor=null,this._loader=new eL(t)}tI.prototype={initialize(t,e,n){return this._el=t,this._obj=n||null,this.origin(e)},element(){return this._el},canvas(){return this._el&&this._el.firstChild},origin(t){return arguments.length?(this._origin=t||[0,0],this):this._origin.slice()},scene(t){return arguments.length?(this._scene=t,this):this._scene},on(){},off(){},_handlerIndex(t,e,n){for(let r=t?t.length:0;--r>=0;)if(t[r].type===e&&(!n||t[r].handler===n))return r;return-1},handlers(t){const e=this._handlers,n=[];if(t)n.push(...e[this.eventName(t)]);else for(const r in e)n.push(...e[r]);return n},eventName(t){const e=t.indexOf(".");return e<0?t:t.slice(0,e)},handleHref(t,e,n){this._loader.sanitize(n,{context:"href"}).then((e=>{const n=new MouseEvent(t.type,t),r=Gj(null,"a");for(const t in e)r.setAttribute(t,e[t]);r.dispatchEvent(n)})).catch((()=>{}))},handleTooltip(t,e,n){if(e&&null!=e.tooltip){e=function(t,e,n,r){var i,o,a=t&&t.mark;if(a&&(i=Yj[a.marktype]).tip){for((o=Qj(e,n))[0]-=r[0],o[1]-=r[1];t=t.mark.group;)o[0]-=t.x||0,o[1]-=t.y||0;t=i.tip(a.items,o)}return t}(e,t,this.canvas(),this._origin);const r=n&&e&&e.tooltip||null;this._tooltip.call(this._obj,this,t,e,r)}},getItemBoundingClientRect(t){const e=this.canvas();if(!e)return;const n=e.getBoundingClientRect(),r=this._origin,i=t.bounds,o=i.width(),a=i.height();let s=i.x1+r[0]+n.left,u=i.y1+r[1]+n.top;for(;t.mark&&(t=t.mark.group);)s+=t.x||0,u+=t.y||0;return{x:s,y:u,width:o,height:a,left:s,top:u,right:s+o,bottom:u+a}}},nI.prototype={initialize(t,e,n,r,i){return this._el=t,this.resize(e,n,r,i)},element(){return this._el},canvas(){return this._el&&this._el.firstChild},background(t){return 0===arguments.length?this._bgcolor:(this._bgcolor=t,this)},resize(t,e,n,r){return this._width=t,this._height=e,this._origin=n||[0,0],this._scale=r||1,this},dirty(){},render(t){const e=this;return e._call=function(){e._render(t)},e._call(),e._call=null,e},_render(){},renderAsync(t){const e=this.render(t);return this._ready?this._ready.then((()=>e)):Promise.resolve(e)},_load(t,e){var n=this,r=n._loader[t](e);if(!n._ready){const t=n._call;n._ready=n._loader.ready().then((e=>{e&&t(),n._ready=null}))}return r},sanitizeURL(t){return this._load("sanitizeURL",t)},loadImage(t){return this._load("loadImage",t)}};const rI="dragenter",iI="dragleave",oI="dragover",aI="mousedown",sI="mousemove",uI="mouseout",lI="mouseover",cI="click",fI="mousewheel",hI="touchstart",dI="touchmove",pI="touchend",gI=sI,mI=uI,yI=cI;function vI(t,e){tI.call(this,t,e),this._down=null,this._touch=null,this._first=!0,this._events={}}const bI=t=>t===hI||t===dI||t===pI?[hI,dI,pI]:[t];function xI(t,e){bI(e).forEach((e=>function(t,e){const n=t.canvas();n&&!t._events[e]&&(t._events[e]=1,n.addEventListener(e,t[e]?n=>t[e](n):n=>t.fire(e,n)))}(t,e)))}function _I(t,e,n){return function(r){const i=this._active,o=this.pickEvent(r);o===i||(i&&i.exit||this.fire(n,r),this._active=o,this.fire(e,r)),this.fire(t,r)}}function wI(t){return function(e){this.fire(t,e),this._active=null}}WM(vI,tI,{initialize(t,e,n){return this._canvas=t&&Vj(t,"canvas"),[cI,aI,sI,uI,iI].forEach((t=>xI(this,t))),tI.prototype.initialize.call(this,t,e,n)},canvas(){return this._canvas},context(){return this._canvas.getContext("2d")},events:["keydown","keypress","keyup",rI,iI,oI,aI,"mouseup",sI,uI,lI,cI,"dblclick","wheel",fI,hI,dI,pI],DOMMouseScroll(t){this.fire(fI,t)},mousemove:_I(sI,lI,uI),dragover:_I(oI,rI,iI),mouseout:wI(uI),dragleave:wI(iI),mousedown(t){this._down=this._active,this.fire(aI,t)},click(t){this._down===this._active&&(this.fire(cI,t),this._down=null)},touchstart(t){this._touch=this.pickEvent(t.changedTouches[0]),this._first&&(this._active=this._touch,this._first=!1),this.fire(hI,t,!0)},touchmove(t){this.fire(dI,t,!0)},touchend(t){this.fire(pI,t,!0),this._touch=null},fire(t,e,n){const r=n?this._touch:this._active,i=this._handlers[t];if(e.vegaType=t,t===yI&&r&&r.href?this.handleHref(e,r,r.href):t!==gI&&t!==mI||this.handleTooltip(e,r,t!==mI),i)for(let o=0,a=i.length;o<a;++o)i[o].handler.call(this._obj,e,r)},on(t,e){const n=this.eventName(t),r=this._handlers;return this._handlerIndex(r[n],t,e)<0&&(xI(this,t),(r[n]||(r[n]=[])).push({type:t,handler:e})),this},off(t,e){const n=this.eventName(t),r=this._handlers[n],i=this._handlerIndex(r,t,e);return i>=0&&r.splice(i,1),this},pickEvent(t){const e=Qj(t,this._canvas),n=this._origin;return this.pick(this._scene,e[0],e[1],e[0]-n[0],e[1]-n[1])},pick(t,e,n,r,i){const o=this.context();return Yj[t.marktype].pick.call(this,o,t,e,n,r,i)}});var AI="undefined"!==typeof window&&window.devicePixelRatio||1;function DI(t){nI.call(this,t),this._options={},this._redraw=!1,this._dirty=new KU,this._tempb=new KU}const EI=nI.prototype;function FI(t,e){tI.call(this,t,e);const n=this;n._hrefHandler=CI(n,((t,e)=>{e&&e.href&&n.handleHref(t,e,e.href)})),n._tooltipHandler=CI(n,((t,e)=>{n.handleTooltip(t,e,t.type!==mI)}))}WM(DI,nI,{initialize(t,e,n,r,i,o){return this._options=o||{},this._canvas=this._options.externalContext?null:l$(1,1,this._options.type),t&&this._canvas&&(Zj(t,0).appendChild(this._canvas),this._canvas.setAttribute("class","marks")),EI.initialize.call(this,t,e,n,r,i)},resize(t,e,n,r){if(EI.resize.call(this,t,e,n,r),this._canvas)!function(t,e,n,r,i,o){const a="undefined"!==typeof HTMLElement&&t instanceof HTMLElement&&null!=t.parentNode,s=t.getContext("2d"),u=a?AI:i;t.width=e*u,t.height=n*u;for(const l in o)s[l]=o[l];a&&1!==u&&(t.style.width=e+"px",t.style.height=n+"px"),s.pixelRatio=u,s.setTransform(u,0,0,u,u*r[0],u*r[1])}(this._canvas,this._width,this._height,this._origin,this._scale,this._options.context);else{const t=this._options.externalContext;t||MM("CanvasRenderer is missing a valid canvas or context"),t.scale(this._scale,this._scale),t.translate(this._origin[0],this._origin[1])}return this._redraw=!0,this},canvas(){return this._canvas},context(){return this._options.externalContext||(this._canvas?this._canvas.getContext("2d"):null)},dirty(t){const e=this._tempb.clear().union(t.bounds);let n=t.mark.group;for(;n;)e.translate(n.x||0,n.y||0),n=n.mark.group;this._dirty.union(e)},_render(t){const e=this.context(),n=this._origin,r=this._width,i=this._height,o=this._dirty,a=((t,e,n)=>(new KU).set(0,0,e,n).translate(-t[0],-t[1]))(n,r,i);e.save();const s=this._redraw||o.empty()?(this._redraw=!1,a.expand(1)):function(t,e,n){return e.expand(1).round(),t.pixelRatio%1&&e.scale(t.pixelRatio).round().scale(1/t.pixelRatio),e.translate(-n[0]%1,-n[1]%1),t.beginPath(),t.rect(e.x1,e.y1,e.width(),e.height()),t.clip(),e}(e,a.intersect(o),n);return this.clear(-n[0],-n[1],r,i),this.draw(e,t,s),e.restore(),o.clear(),this},draw(t,e,n){const r=Yj[e.marktype];e.clip&&function(t,e){var n=e.clip;t.save(),LM(n)?(t.beginPath(),n(t),t.clip()):rj(t,e.group)}(t,e),r.draw.call(this,t,e,n),e.clip&&t.restore()},clear(t,e,n,r){const i=this._options,o=this.context();"pdf"===i.type||i.externalContext||o.clearRect(t,e,n,r),null!=this._bgcolor&&(o.fillStyle=this._bgcolor,o.fillRect(t,e,n,r))}});const CI=(t,e)=>n=>{let r=n.target.__data__;r=Array.isArray(r)?r[0]:r,n.vegaType=n.type,e.call(t._obj,n,r)};WM(FI,tI,{initialize(t,e,n){let r=this._svg;return r&&(r.removeEventListener(yI,this._hrefHandler),r.removeEventListener(gI,this._tooltipHandler),r.removeEventListener(mI,this._tooltipHandler)),this._svg=r=t&&Vj(t,"svg"),r&&(r.addEventListener(yI,this._hrefHandler),r.addEventListener(gI,this._tooltipHandler),r.addEventListener(mI,this._tooltipHandler)),tI.prototype.initialize.call(this,t,e,n)},canvas(){return this._svg},on(t,e){const n=this.eventName(t),r=this._handlers;if(this._handlerIndex(r[n],t,e)<0){const i={type:t,handler:e,listener:CI(this,e)};(r[n]||(r[n]=[])).push(i),this._svg&&this._svg.addEventListener(n,i.listener)}return this},off(t,e){const n=this.eventName(t),r=this._handlers[n],i=this._handlerIndex(r,t,e);return i>=0&&(this._svg&&this._svg.removeEventListener(n,r[i].listener),r.splice(i,1)),this}});const kI="aria-hidden",MI="aria-label",SI="role",$I="aria-roledescription",TI="graphics-object",BI="graphics-symbol",NI=(t,e,n)=>({[SI]:t,[$I]:e,[MI]:n||void 0}),OI=GM(["axis-domain","axis-grid","axis-label","axis-tick","axis-title","legend-band","legend-entry","legend-gradient","legend-label","legend-title","legend-symbol","title"]),zI={axis:{desc:"axis",caption:function(t){const e=t.datum,n=t.orient,r=e.title?jI(t):null,i=t.context,o=i.scales[e.scale].value,a=i.dataflow.locale(),s=o.type;return("left"===n||"right"===n?"Y":"X")+"-axis"+(r?` titled '${r}'`:"")+` for a ${$P(s)?"discrete":s} scale`+` with ${nU(a,o,t)}`}},legend:{desc:"legend",caption:function(t){const e=t.datum,n=e.title?jI(t):null,r=`${e.type||""} legend`.trim(),i=e.scales,o=Object.keys(i),a=t.context,s=a.scales[i[o[0]]].value,u=a.dataflow.locale();return function(t){return t.length?t[0].toUpperCase()+t.slice(1):t}(r)+(n?` titled '${n}'`:"")+` for ${function(t){return t=t.map((t=>t+("fill"===t||"stroke"===t?" color":""))),t.length<2?t[0]:t.slice(0,-1).join(", ")+" and "+RM(t)}(o)}`+` with ${nU(u,s,t)}`}},"title-text":{desc:"title",caption:t=>`Title text '${LI(t)}'`},"title-subtitle":{desc:"subtitle",caption:t=>`Subtitle text '${LI(t)}'`}},RI={ariaRole:SI,ariaRoleDescription:$I,description:MI};function PI(t,e){const n=!1===e.aria;if(t(kI,n||void 0),n||null==e.description)for(const r in RI)t(RI[r],void 0);else{const n=e.mark.marktype;t(MI,e.description),t(SI,e.ariaRole||("group"===n?TI:BI)),t($I,e.ariaRoleDescription||`${n} mark`)}}function UI(t){return!1===t.aria?{[kI]:!0}:OI[t.role]?null:zI[t.role]?function(t,e){try{const n=t.items[0],r=e.caption||(()=>"");return NI(e.role||BI,e.desc,n.description||r(n))}catch(n){return null}}(t,zI[t.role]):function(t){const e=t.marktype,n="group"===e||"text"===e||t.items.some((t=>null!=t.description&&!1!==t.aria));return NI(n?TI:BI,`${e} mark container`,t.description)}(t)}function LI(t){return UM(t.text).join(" ")}function jI(t){try{return UM(RM(t.items).items[0].text).join(" ")}catch(e){return null}}const II=t=>(t+"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">"),qI=t=>II(t).replace(/"/g,""").replace(/\t/g,"	").replace(/\n/g,"
").replace(/\r/g,"
");function WI(){let t="",e="",n="";const r=[],i=()=>e=n="",o=(t,n)=>(null!=n&&(e+=` ${t}="${qI(n)}"`),a),a={open(s,...u){(o=>{e&&(t+=`${e}>${n}`,i()),r.push(o)})(s),e="<"+s;for(const t of u)for(const e in t)o(e,t[e]);return a},close(){const o=r.pop();return t+=e?e+(n?`>${n}</${o}>`:"/>"):`</${o}>`,i(),a},attr:o,text:t=>(n+=II(t),a),toString:()=>t};return a}const HI=t=>XI(WI(),t)+"";function XI(t,e){if(t.open(e.tagName),e.hasAttributes()){const n=e.attributes,r=n.length;for(let e=0;e<r;++e)t.attr(n[e].name,n[e].value)}if(e.hasChildNodes()){const n=e.childNodes,r=n.length;for(let e=0;e<r;e++){const r=n[e];3===r.nodeType?t.text(r.nodeValue):XI(t,r)}}return t.close()}const YI={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",blend:"mix-blend-mode"},GI={fill:"none","stroke-miterlimit":10},VI="http://www.w3.org/2000/xmlns/",JI=fj.xmlns;function ZI(t){nI.call(this,t),this._dirtyID=0,this._dirty=[],this._svg=null,this._root=null,this._defs=null}const KI=nI.prototype;function QI(t,e){for(;t&&t.dirty!==e;t=t.mark.group){if(t.dirty=e,!t.mark||t.mark.dirty===e)return;t.mark.dirty=e}}function tq(t,e,n){let r,i,o;if("radial"===e.gradient){let r=Jj(t,n++,"pattern",JI);uq(r,{id:iU+e.id,viewBox:"0,0,1,1",width:"100%",height:"100%",preserveAspectRatio:"xMidYMid slice"}),r=Jj(r,0,"rect",JI),uq(r,{width:1,height:1,fill:`url(${cq()}#${e.id})`}),uq(t=Jj(t,n++,"radialGradient",JI),{id:e.id,fx:e.x1,fy:e.y1,fr:e.r1,cx:e.x2,cy:e.y2,r:e.r2})}else uq(t=Jj(t,n++,"linearGradient",JI),{id:e.id,x1:e.x1,x2:e.x2,y1:e.y1,y2:e.y2});for(r=0,i=e.stops.length;r<i;++r)o=Jj(t,r,"stop",JI),o.setAttribute("offset",e.stops[r].offset),o.setAttribute("stop-color",e.stops[r].color);return Zj(t,r),n}function eq(t,e,n){let r;return(t=Jj(t,n,"clipPath",JI)).setAttribute("id",e.id),e.path?(r=Jj(t,0,"path",JI),r.setAttribute("d",e.path)):(r=Jj(t,0,"rect",JI),uq(r,{x:0,y:0,width:e.width,height:e.height})),Zj(t,1),n+1}function nq(t,e,n,r,i){let o,a=t._svg;if(!a&&(o=e.ownerDocument,a=Gj(o,r,JI),t._svg=a,t.mark&&(a.__data__=t,a.__values__={fill:"default"},"g"===r))){const e=Gj(o,"path",JI);a.appendChild(e),e.__data__=t;const n=Gj(o,"g",JI);a.appendChild(n),n.__data__=t;const r=Gj(o,"path",JI);a.appendChild(r),r.__data__=t,r.__values__={fill:"default"}}return(a.ownerSVGElement!==i||function(t,e){return t.parentNode&&t.parentNode.childNodes.length>1&&t.previousSibling!=e}(a,n))&&e.insertBefore(a,n?n.nextSibling:e.firstChild),a}WM(ZI,nI,{initialize(t,e,n,r,i){return this._defs={},this._clearDefs(),t&&(this._svg=Jj(t,0,"svg",JI),this._svg.setAttributeNS(VI,"xmlns",JI),this._svg.setAttributeNS(VI,"xmlns:xlink",fj["xmlns:xlink"]),this._svg.setAttribute("version",fj.version),this._svg.setAttribute("class","marks"),Zj(t,1),this._root=Jj(this._svg,0,"g",JI),uq(this._root,GI),Zj(this._svg,1)),this.background(this._bgcolor),KI.initialize.call(this,t,e,n,r,i)},background(t){return arguments.length&&this._svg&&this._svg.style.setProperty("background-color",t),KI.background.apply(this,arguments)},resize(t,e,n,r){return KI.resize.call(this,t,e,n,r),this._svg&&(uq(this._svg,{width:this._width*this._scale,height:this._height*this._scale,viewBox:`0 0 ${this._width} ${this._height}`}),this._root.setAttribute("transform",`translate(${this._origin})`)),this._dirty=[],this},canvas(){return this._svg},svg(){const t=this._svg,e=this._bgcolor;if(!t)return null;let n;e&&(t.removeAttribute("style"),n=Jj(t,0,"rect",JI),uq(n,{width:this._width,height:this._height,fill:e}));const r=HI(t);return e&&(t.removeChild(n),this._svg.style.setProperty("background-color",e)),r},_render(t){return this._dirtyCheck()&&(this._dirtyAll&&this._clearDefs(),this.mark(this._root,t),Zj(this._root,1)),this.defs(),this._dirty=[],++this._dirtyID,this},dirty(t){t.dirty!==this._dirtyID&&(t.dirty=this._dirtyID,this._dirty.push(t))},isDirty(t){return this._dirtyAll||!t._svg||t.dirty===this._dirtyID},_dirtyCheck(){this._dirtyAll=!0;const t=this._dirty;if(!t.length||!this._dirtyID)return!0;const e=++this._dirtyID;let n,r,i,o,a,s,u;for(a=0,s=t.length;a<s;++a)n=t[a],r=n.mark,r.marktype!==i&&(i=r.marktype,o=Yj[i]),r.zdirty&&r.dirty!==e&&(this._dirtyAll=!1,QI(n,e),r.items.forEach((t=>{t.dirty=e}))),r.zdirty||(n.exit?(o.nested&&r.items.length?(u=r.items[0],u._svg&&this._update(o,u._svg,u)):n._svg&&(u=n._svg.parentNode,u&&u.removeChild(n._svg)),n._svg=null):(n=o.nested?r.items[0]:n,n._update!==e&&(n._svg&&n._svg.ownerSVGElement?this._update(o,n._svg,n):(this._dirtyAll=!1,QI(n,e)),n._update=e)));return!this._dirtyAll},mark(t,e,n){if(!this.isDirty(e))return e._svg;const r=this._svg,i=Yj[e.marktype],o=!1===e.interactive?"none":null,a="g"===i.tag;let s=null,u=0;const l=nq(e,t,n,"g",r);l.setAttribute("class",Kj(e));const c=UI(e);for(const h in c)lq(l,h,c[h]);a||lq(l,"pointer-events",o),lq(l,"clip-path",e.clip?ZU(this,e,e.group):null);const f=t=>{const e=this.isDirty(t),n=nq(t,l,s,i.tag,r);e&&(this._update(i,n,t),a&&function(t,e,n){e=e.lastChild.previousSibling;let r,i=0;IL(n,(n=>{r=t.mark(e,n,r),++i})),Zj(e,1+i)}(this,n,t)),s=n,++u};return i.nested?e.items.length&&f(e.items[0]):IL(e,f),Zj(l,u),l},_update(t,e,n){rq=e,iq=e.__values__,PI(aq,n),t.attr(aq,n,this);const r=oq[t.type];r&&r.call(this,t,e,n),rq&&this.style(rq,n)},style(t,e){if(null!=e)for(const n in YI){let r="font"===n?Pj(e):e[n];if(r===iq[n])continue;const i=YI[n];null==r?t.removeAttribute(i):(oU(r)&&(r=aU(r,this._defs.gradient,cq())),t.setAttribute(i,r+"")),iq[n]=r}},defs(){const t=this._svg,e=this._defs;let n=e.el,r=0;for(const i in e.gradient)n||(e.el=n=Jj(t,1,"defs",JI)),r=tq(n,e.gradient[i],r);for(const i in e.clipping)n||(e.el=n=Jj(t,1,"defs",JI)),r=eq(n,e.clipping[i],r);n&&(0===r?(t.removeChild(n),e.el=null):Zj(n,r))},_clearDefs(){const t=this._defs;t.gradient={},t.clipping={}}});let rq=null,iq=null;const oq={group(t,e,n){const r=rq=e.childNodes[2];iq=r.__values__,t.foreground(aq,n,this),iq=e.__values__,rq=e.childNodes[1],t.content(aq,n,this);const i=rq=e.childNodes[0];t.background(aq,n,this);const o=!1===n.mark.interactive?"none":null;if(o!==iq.events&&(lq(r,"pointer-events",o),lq(i,"pointer-events",o),iq.events=o),n.strokeForeground&&n.stroke){const t=n.fill;lq(r,"display",null),this.style(i,n),lq(i,"stroke",null),t&&(n.fill=null),iq=r.__values__,this.style(r,n),t&&(n.fill=t),rq=null}else lq(r,"display","none")},image(t,e,n){!1===n.smooth?(sq(e,"image-rendering","optimizeSpeed"),sq(e,"image-rendering","pixelated")):sq(e,"image-rendering",null)},text(t,e,n){const r=zj(n);let i,o,a,s;OM(r)?(o=r.map((t=>Rj(n,t))),i=o.join("\n"),i!==iq.text&&(Zj(e,0),a=e.ownerDocument,s=Oj(n),o.forEach(((t,r)=>{const i=Gj(a,"tspan",JI);i.__data__=n,i.textContent=t,r&&(i.setAttribute("x",0),i.setAttribute("dy",s)),e.appendChild(i)})),iq.text=i)):(o=Rj(n,r),o!==iq.text&&(e.textContent=o,iq.text=o)),lq(e,"font-family",Pj(n)),lq(e,"font-size",Nj(n)+"px"),lq(e,"font-style",n.fontStyle),lq(e,"font-variant",n.fontVariant),lq(e,"font-weight",n.fontWeight)}};function aq(t,e,n){e!==iq[t]&&(n?function(t,e,n,r){null!=n?t.setAttributeNS(r,e,n):t.removeAttributeNS(r,e)}(rq,t,e,n):lq(rq,t,e),iq[t]=e)}function sq(t,e,n){n!==iq[e]&&(null==n?t.style.removeProperty(e):t.style.setProperty(e,n+""),iq[e]=n)}function uq(t,e){for(const n in e)lq(t,n,e[n])}function lq(t,e,n){null!=n?t.setAttribute(e,n):t.removeAttribute(e)}function cq(){let t;return"undefined"===typeof window?"":(t=window.location).hash?t.href.slice(0,-t.hash.length):t.href}function fq(t){nI.call(this,t),this._text=null,this._defs={gradient:{},clipping:{}}}WM(fq,nI,{svg(){return this._text},_render(t){const e=WI();e.open("svg",jM({},fj,{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&&e.open("rect",{width:this._width,height:this._height,fill:n}).close(),e.open("g",GI,{transform:"translate("+this._origin+")"}),this.mark(e,t),e.close(),this.defs(e),this._text=e.close()+"",this},mark(t,e){const n=Yj[e.marktype],r=n.tag,i=[PI,n.attr];t.open("g",{class:Kj(e),"clip-path":e.clip?ZU(this,e,e.group):null},UI(e),{"pointer-events":"g"!==r&&!1===e.interactive?"none":null});const o=o=>{const a=this.href(o);if(a&&t.open("a",a),t.open(r,this.attr(e,o,i,"g"!==r?r:null)),"text"===r){const e=zj(o);if(OM(e)){const n={x:0,dy:Oj(o)};for(let r=0;r<e.length;++r)t.open("tspan",r?n:null).text(Rj(o,e[r])).close()}else t.text(Rj(o,e))}else if("g"===r){const r=o.strokeForeground,i=o.fill,a=o.stroke;r&&a&&(o.stroke=null),t.open("path",this.attr(e,o,n.background,"bgrect")).close(),t.open("g",this.attr(e,o,n.content)),IL(o,(e=>this.mark(t,e))),t.close(),r&&a?(i&&(o.fill=null),o.stroke=a,t.open("path",this.attr(e,o,n.foreground,"bgrect")).close(),i&&(o.fill=i)):t.open("path",this.attr(e,o,n.foreground,"bgfore")).close()}t.close(),a&&t.close()};return n.nested?e.items&&e.items.length&&o(e.items[0]):IL(e,o),t.close()},href(t){const e=t.href;let n;if(e){if(n=this._hrefs&&this._hrefs[e])return n;this.sanitizeURL(e).then((t=>{t["xlink:href"]=t.href,t.href=null,(this._hrefs||(this._hrefs={}))[e]=t}))}return null},attr(t,e,n,r){const i={},o=(t,e,n,r)=>{i[r||t]=e};return Array.isArray(n)?n.forEach((t=>t(o,e,this))):n(o,e,this),r&&function(t,e,n,r,i){if(null==e)return t;"bgrect"===r&&!1===n.interactive&&(t["pointer-events"]="none");if("bgfore"===r&&(!1===n.interactive&&(t["pointer-events"]="none"),t.display="none",null!==e.fill))return t;"image"===r&&!1===e.smooth&&(t.style="image-rendering: optimizeSpeed; image-rendering: pixelated;");"text"===r&&(t["font-family"]=Pj(e),t["font-size"]=Nj(e)+"px",t["font-style"]=e.fontStyle,t["font-variant"]=e.fontVariant,t["font-weight"]=e.fontWeight);for(const o in YI){let n=e[o];const r=YI[o];("transparent"!==n||"fill"!==r&&"stroke"!==r)&&null!=n&&(oU(n)&&(n=aU(n,i.gradient,"")),t[r]=n)}}(i,e,t,r,this._defs),i},defs(t){const e=this._defs.gradient,n=this._defs.clipping;if(0!==Object.keys(e).length+Object.keys(n).length){t.open("defs");for(const n in e){const r=e[n],i=r.stops;"radial"===r.gradient?(t.open("pattern",{id:iU+n,viewBox:"0,0,1,1",width:"100%",height:"100%",preserveAspectRatio:"xMidYMid slice"}),t.open("rect",{width:"1",height:"1",fill:"url(#"+n+")"}).close(),t.close(),t.open("radialGradient",{id:n,fx:r.x1,fy:r.y1,fr:r.r1,cx:r.x2,cy:r.y2,r:r.r2})):t.open("linearGradient",{id:n,x1:r.x1,x2:r.x2,y1:r.y1,y2:r.y2});for(let e=0;e<i.length;++e)t.open("stop",{offset:i[e].offset,"stop-color":i[e].color}).close();t.close()}for(const e in n){const r=n[e];t.open("clipPath",{id:e}),r.path?t.open("path",{d:r.path}).close():t.open("rect",{x:0,y:0,width:r.width,height:r.height}).close(),t.close()}t.close()}}});const hq="canvas",dq="none",pq={};pq[hq]=pq.png={renderer:DI,headless:DI,handler:vI},pq.svg={renderer:ZI,headless:fq,handler:FI},pq[dq]={};new KU;function gq(t){const e=t||BM,n=[],r={};return n.add=t=>{const i=e(t);return r[i]||(r[i]=1,n.push(t)),n},n.remove=t=>{const i=e(t);if(r[i]){r[i]=0;const e=n.indexOf(t);e>=0&&n.splice(e,1)}return n},n}const mq=Symbol("vega_id");function yq(t){return t[mq]}function vq(t,e){for(const n in t)e[n]=t[n];return e}const bq="_:mod:_";function xq(){Object.defineProperty(this,bq,{writable:!0,value:{}})}xq.prototype={set(t,e,n,r){const i=this,o=i[t],a=i[bq];return null!=e&&e>=0?(o[e]!==n||r)&&(o[e]=n,a[e+":"+t]=-1,a[t]=-1):(o!==n||r)&&(i[t]=n,a[t]=OM(n)?1+n.length:-1),i},modified(t,e){const n=this[bq];if(!arguments.length){for(const t in n)if(n[t])return!0;return!1}if(OM(t)){for(let e=0;e<t.length;++e)if(n[t[e]])return!0;return!1}return null!=e&&e>=0?e+1<n[t]||!!n[e+":"+t]:!!n[t]},clear(){return this[bq]={},this}};let _q=0;const wq=new xq;function Aq(t,e,n,r){this.id=++_q,this.value=t,this.stamp=-1,this.rank=-1,this.qrank=-1,this.flags=0,e&&(this._update=e),n&&this.parameters(n,r)}function Dq(t){return function(e){const n=this.flags;return 0===arguments.length?!!(n&t):(this.flags=e?n|t:n&~t,this)}}Aq.prototype={targets(){return this._targets||(this._targets=gq(TM))},set(t){return this.value!==t?(this.value=t,1):0},skip:Dq(1),modified:Dq(2),parameters(t,e,n){e=!1!==e;const r=this._argval=this._argval||new xq,i=this._argops=this._argops||[],o=[];let a,s,u,l;const c=(t,n,a)=>{a instanceof Aq?(a!==this&&(e&&a.targets().add(this),o.push(a)),i.push({op:a,name:t,index:n})):r.set(t,n,a)};for(a in t)if(s=t[a],"pulse"===a)UM(s).forEach((t=>{t instanceof Aq?t!==this&&(t.targets().add(this),o.push(t)):MM("Pulse parameters must be operator instances.")})),this.source=s;else if(OM(s))for(r.set(a,-1,Array(u=s.length)),l=0;l<u;++l)c(a,l,s[l]);else c(a,-1,s);return this.marshall().clear(),n&&(i.initonly=!0),o},marshall(t){const e=this._argval||wq,n=this._argops;let r,i,o,a;if(n){const s=n.length;for(i=0;i<s;++i)r=n[i],o=r.op,a=o.modified()&&o.stamp===t,e.set(r.name,r.index,o.value,a);if(n.initonly){for(i=0;i<s;++i)r=n[i],r.op.targets().remove(this);this._argops=null,this._update=null}}return e},detach(){const t=this._argops;let e,n,r,i;if(t)for(e=0,n=t.length;e<n;++e)r=t[e],i=r.op,i._targets&&i._targets.remove(this);this.pulse=null,this.source=null},evaluate(t){const e=this._update;if(e){const n=this.marshall(t.stamp),r=e.call(this,n,t);if(n.clear(),r!==this.value)this.value=r;else if(!this.modified())return t.StopPropagation}},run(t){if(t.stamp<this.stamp)return t.StopPropagation;let e;return this.skip()?(this.skip(!1),e=0):e=this.evaluate(t),this.pulse=e||t}};let Eq=0;function Fq(t,e,n){this.id=++Eq,this.value=null,n&&(this.receive=n),t&&(this._filter=t),e&&(this._apply=e)}function Cq(t,e,n){return new Fq(t,e,n)}Fq.prototype={_filter:NM,_apply:BM,targets(){return this._targets||(this._targets=gq(TM))},consume(t){return arguments.length?(this._consume=!!t,this):!!this._consume},receive(t){if(this._filter(t)){const e=this.value=this._apply(t),n=this._targets,r=n?n.length:0;for(let t=0;t<r;++t)n[t].receive(e);this._consume&&(t.preventDefault(),t.stopPropagation())}},filter(t){const e=Cq(t);return this.targets().add(e),e},apply(t){const e=Cq(null,t);return this.targets().add(e),e},merge(){const t=Cq();this.targets().add(t);for(let e=0,n=arguments.length;e<n;++e)arguments[e].targets().add(t);return t},throttle(t){let e=-1;return this.filter((()=>{const n=Date.now();return n-e>t?(e=n,1):0}))},debounce(t){const e=Cq();return this.targets().add(Cq(null,null,function(t,e){let n;return r=>{n&&clearTimeout(n),n=setTimeout((()=>(e(r),n=null)),t)}}(t,(t=>{const n=t.dataflow;e.receive(t),n&&n.run&&n.run()})))),e},between(t,e){let n=!1;return t.targets().add(Cq(null,null,(()=>n=!0))),e.targets().add(Cq(null,null,(()=>n=!1))),this.filter((()=>n))},detach(){this._filter=NM,this._targets=null}};const kq={};function Mq(t,e,n){this.dataflow=t,this.stamp=null==e?-1:e,this.add=[],this.rem=[],this.mod=[],this.fields=null,this.encode=n||null}function Sq(t,e){const n=[];return VM(t,e,(t=>n.push(t))),n}function $q(t,e){const n={};return t.visit(e,(t=>{n[yq(t)]=1})),t=>n[yq(t)]?null:t}function Tq(t,e){return t?(n,r)=>t(n,r)&&e(n,r):e}function Bq(t,e,n,r){const i=this,o=n.length;let a=0;this.dataflow=t,this.stamp=e,this.fields=null,this.encode=r||null,this.pulses=n;for(let s=0;s<o;++s){const t=n[s];if(t.stamp===e){if(t.fields){const e=i.fields||(i.fields={});for(const n in t.fields)e[n]=1}t.changed(i.ADD)&&(a|=i.ADD),t.changed(i.REM)&&(a|=i.REM),t.changed(i.MOD)&&(a|=i.MOD)}}this.changes=a}Mq.prototype={StopPropagation:kq,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(t){return new Mq(this.dataflow).init(this,t)},clone(){const t=this.fork(7);return t.add=t.add.slice(),t.rem=t.rem.slice(),t.mod=t.mod.slice(),t.source&&(t.source=t.source.slice()),t.materialize(23)},addAll(){let t=this;return!t.source||t.add===t.rem||!t.rem.length&&t.source.length===t.add.length||(t=new Mq(this.dataflow).init(this),t.add=t.source,t.rem=[]),t},init(t,e){const n=this;return n.stamp=t.stamp,n.encode=t.encode,!t.fields||64&e||(n.fields=t.fields),1&e?(n.addF=t.addF,n.add=t.add):(n.addF=null,n.add=[]),2&e?(n.remF=t.remF,n.rem=t.rem):(n.remF=null,n.rem=[]),4&e?(n.modF=t.modF,n.mod=t.mod):(n.modF=null,n.mod=[]),32&e?(n.srcF=null,n.source=null):(n.srcF=t.srcF,n.source=t.source,t.cleans&&(n.cleans=t.cleans)),n},runAfter(t){this.dataflow.runAfter(t)},changed(t){const e=t||7;return 1&e&&this.add.length||2&e&&this.rem.length||4&e&&this.mod.length},reflow(t){if(t)return this.fork(7).reflow();const e=this.add.length,n=this.source&&this.source.length;return n&&n!==e&&(this.mod=this.source,e&&this.filter(4,$q(this,1))),this},clean(t){return arguments.length?(this.cleans=!!t,this):this.cleans},modifies(t){const e=this.fields||(this.fields={});return OM(t)?t.forEach((t=>e[t]=!0)):e[t]=!0,this},modified(t,e){const n=this.fields;return!(!e&&!this.mod.length||!n)&&(arguments.length?OM(t)?t.some((t=>n[t])):n[t]:!!n)},filter(t,e){const n=this;return 1&t&&(n.addF=Tq(n.addF,e)),2&t&&(n.remF=Tq(n.remF,e)),4&t&&(n.modF=Tq(n.modF,e)),16&t&&(n.srcF=Tq(n.srcF,e)),n},materialize(t){const e=this;return 1&(t=t||7)&&e.addF&&(e.add=Sq(e.add,e.addF),e.addF=null),2&t&&e.remF&&(e.rem=Sq(e.rem,e.remF),e.remF=null),4&t&&e.modF&&(e.mod=Sq(e.mod,e.modF),e.modF=null),16&t&&e.srcF&&(e.source=e.source.filter(e.srcF),e.srcF=null),e},visit(t,e){const n=this,r=e;if(16&t)return VM(n.source,n.srcF,r),n;1&t&&VM(n.add,n.addF,r),2&t&&VM(n.rem,n.remF,r),4&t&&VM(n.mod,n.modF,r);const i=n.source;if(8&t&&i){const t=n.add.length+n.mod.length;t===i.length||VM(i,t?$q(n,5):n.srcF,r)}return n}},WM(Bq,Mq,{fork(t){const e=new Mq(this.dataflow).init(this,t&this.NO_FIELDS);return void 0!==t&&(t&e.ADD&&this.visit(e.ADD,(t=>e.add.push(t))),t&e.REM&&this.visit(e.REM,(t=>e.rem.push(t))),t&e.MOD&&this.visit(e.MOD,(t=>e.mod.push(t)))),e},changed(t){return this.changes&t},modified(t){const e=this,n=e.fields;return n&&e.changes&e.MOD?OM(t)?t.some((t=>n[t])):n[t]:0},filter(){MM("MultiPulse does not support filtering.")},materialize(){MM("MultiPulse does not support materialization.")},visit(t,e){const n=this,r=n.pulses,i=r.length;let o=0;if(t&n.SOURCE)for(;o<i;++o)r[o].visit(t,e);else for(;o<i;++o)r[o].stamp===n.stamp&&r[o].visit(t,e);return n}});function Nq(t){return function(){return this._log[t].apply(this,arguments)}}function Oq(t,e){Aq.call(this,t,null,e)}Nq("error"),Nq("warn"),Nq("info"),Nq("debug"),Nq("level"),WM(Oq,Aq,{run(t){if(t.stamp<this.stamp)return t.StopPropagation;let e;return this.skip()?this.skip(!1):e=this.evaluate(t),e=e||t,e.then?e=e.then((t=>this.pulse=t)):e!==t.StopPropagation&&(this.pulse=e),e},evaluate(t){const e=this.marshall(t.stamp),n=this.transform(e,t);return e.clear(),n},transform(){}});const zq=4278190080;function Rq(t,e,n){return new Uint32Array(t.getImageData(0,0,e,n).data.buffer)}function Pq(t,e,n){if(!e.length)return;const r=e[0].mark.marktype;"group"===r?e.forEach((e=>{e.items.forEach((e=>Pq(t,e.items,n)))})):Yj[r].draw(t,{items:n?e.map(Uq):e})}function Uq(t){const e=vq(t,{});return e.stroke&&0!==e.strokeOpacity||e.fill&&0!==e.fillOpacity?{...e,strokeOpacity:1,stroke:"#000",fillOpacity:0}:e}const Lq=5,jq=31,Iq=32,qq=new Uint32Array(Iq+1),Wq=new Uint32Array(Iq+1);Wq[0]=0,qq[0]=~Wq[0];for(let Z8=1;Z8<=Iq;++Z8)Wq[Z8]=Wq[Z8-1]<<1|1,qq[Z8]=~Wq[Z8];function Hq(t,e,n){const r=Math.max(1,Math.sqrt(t*e/1e6)),i=~~((t+2*n+r)/r),o=~~((e+2*n+r)/r),a=t=>~~((t+n)/r);return a.invert=t=>t*r-n,a.bitmap=()=>function(t,e){const n=new Uint32Array(~~((t*e+Iq)/Iq));function r(t,e){n[t]|=e}function i(t,e){n[t]&=e}return{array:n,get:(e,r)=>{const i=r*t+e;return n[i>>>Lq]&1<<(i&jq)},set:(e,n)=>{const i=n*t+e;r(i>>>Lq,1<<(i&jq))},clear:(e,n)=>{const r=n*t+e;i(r>>>Lq,~(1<<(r&jq)))},getRange:(e,r,i,o)=>{let a,s,u,l,c=o;for(;c>=r;--c)if(a=c*t+e,s=c*t+i,u=a>>>Lq,l=s>>>Lq,u===l){if(n[u]&qq[a&jq]&Wq[1+(s&jq)])return!0}else{if(n[u]&qq[a&jq])return!0;if(n[l]&Wq[1+(s&jq)])return!0;for(let t=u+1;t<l;++t)if(n[t])return!0}return!1},setRange:(e,n,i,o)=>{let a,s,u,l,c;for(;n<=o;++n)if(a=n*t+e,s=n*t+i,u=a>>>Lq,l=s>>>Lq,u===l)r(u,qq[a&jq]&Wq[1+(s&jq)]);else for(r(u,qq[a&jq]),r(l,Wq[1+(s&jq)]),c=u+1;c<l;++c)r(c,4294967295)},clearRange:(e,n,r,o)=>{let a,s,u,l,c;for(;n<=o;++n)if(a=n*t+e,s=n*t+r,u=a>>>Lq,l=s>>>Lq,u===l)i(u,Wq[a&jq]|qq[1+(s&jq)]);else for(i(u,Wq[a&jq]),i(l,qq[1+(s&jq)]),c=u+1;c<l;++c)i(c,0)},outOfBounds:(n,r,i,o)=>n<0||r<0||o>=e||i>=t}}(i,o),a.ratio=r,a.padding=n,a.width=t,a.height=e,a}function Xq(t,e,n,r,i,o){let a=n/2;return t-a<0||t+a>i||e-(a=r/2)<0||e+a>o}function Yq(t,e,n,r,i,o,a,s){const u=i*o/(2*r),l=t(e-u),c=t(e+u),f=t(n-(o/=2)),h=t(n+o);return a.outOfBounds(l,f,c,h)||a.getRange(l,f,c,h)||s&&s.getRange(l,f,c,h)}const Gq=[-1,-1,1,1],Vq=[-1,1,-1,1];const Jq=["right","center","left"],Zq=["bottom","middle","top"];function Kq(t,e,n,r,i,o,a,s,u,l,c,f){return!(i.outOfBounds(t,n,e,r)||(f&&o||i).getRange(t,n,e,r))}const Qq={"top-left":0,top:1,"top-right":2,left:4,middle:5,right:6,"bottom-left":8,bottom:9,"bottom-right":10},tW={naive:function(t,e,n,r){const i=t.width,o=t.height;return function(t){const e=t.datum.datum.items[r].items,n=e.length,a=t.datum.fontSize,s=kj.width(t.datum,t.datum.text);let u,l,c,f,h,d,p,g=0;for(let r=0;r<n;++r)u=e[r].x,c=e[r].y,l=void 0===e[r].x2?u:e[r].x2,f=void 0===e[r].y2?c:e[r].y2,h=(u+l)/2,d=(c+f)/2,p=Math.abs(l-u+f-c),p>=g&&(g=p,t.x=h,t.y=d);return h=s/2,d=a/2,u=t.x-h,l=t.x+h,c=t.y-d,f=t.y+d,t.align="center",u<0&&l<=i?t.align="left":0<=u&&i<l&&(t.align="right"),t.baseline="middle",c<0&&f<=o?t.baseline="top":0<=c&&o<f&&(t.baseline="bottom"),!0}},"reduced-search":function(t,e,n,r){const i=t.width,o=t.height,a=e[0],s=e[1];function u(e,n,r,u,l){const c=t.invert(e),f=t.invert(n);let h,d=r,p=o;if(!Xq(c,f,u,l,i,o)&&!Yq(t,c,f,l,u,d,a,s)&&!Yq(t,c,f,l,u,l,a,null)){for(;p-d>=1;)h=(d+p)/2,Yq(t,c,f,l,u,h,a,s)?p=h:d=h;if(d>r)return[c,f,d,!0]}}return function(e){const s=e.datum.datum.items[r].items,l=s.length,c=e.datum.fontSize,f=kj.width(e.datum,e.datum.text);let h,d,p,g,m,y,v,b,x,_,w,A,D,E,F,C,k,M=n?c:0,S=!1,$=!1,T=0;for(let r=0;r<l;++r){for(h=s[r].x,p=s[r].y,d=void 0===s[r].x2?h:s[r].x2,g=void 0===s[r].y2?p:s[r].y2,h>d&&(k=h,h=d,d=k),p>g&&(k=p,p=g,g=k),x=t(h),w=t(d),_=~~((x+w)/2),A=t(p),E=t(g),D=~~((A+E)/2),v=_;v>=x;--v)for(b=D;b>=A;--b)C=u(v,b,M,f,c),C&&([e.x,e.y,M,S]=C);for(v=_;v<=w;++v)for(b=D;b<=E;++b)C=u(v,b,M,f,c),C&&([e.x,e.y,M,S]=C);S||n||(F=Math.abs(d-h+g-p),m=(h+d)/2,y=(p+g)/2,F>=T&&!Xq(m,y,f,c,i,o)&&!Yq(t,m,y,c,f,c,a,null)&&(T=F,e.x=m,e.y=y,$=!0))}return!(!S&&!$)&&(m=f/2,y=c/2,a.setRange(t(e.x-m),t(e.y-y),t(e.x+m),t(e.y+y)),e.align="center",e.baseline="middle",!0)}},floodfill:function(t,e,n,r){const i=t.width,o=t.height,a=e[0],s=e[1],u=t.bitmap();return function(e){const l=e.datum.datum.items[r].items,c=l.length,f=e.datum.fontSize,h=kj.width(e.datum,e.datum.text),d=[];let p,g,m,y,v,b,x,_,w,A,D,E,F=n?f:0,C=!1,k=!1,M=0;for(let r=0;r<c;++r){for(p=l[r].x,m=l[r].y,g=void 0===l[r].x2?p:l[r].x2,y=void 0===l[r].y2?m:l[r].y2,d.push([t((p+g)/2),t((m+y)/2)]);d.length;)if([x,_]=d.pop(),!(a.get(x,_)||s.get(x,_)||u.get(x,_))){u.set(x,_);for(let t=0;t<4;++t)v=x+Gq[t],b=_+Vq[t],u.outOfBounds(v,b,v,b)||d.push([v,b]);if(v=t.invert(x),b=t.invert(_),w=F,A=o,!Xq(v,b,h,f,i,o)&&!Yq(t,v,b,f,h,w,a,s)&&!Yq(t,v,b,f,h,f,a,null)){for(;A-w>=1;)D=(w+A)/2,Yq(t,v,b,f,h,D,a,s)?A=D:w=D;w>F&&(e.x=v,e.y=b,F=w,C=!0)}}C||n||(E=Math.abs(g-p+y-m),v=(p+g)/2,b=(m+y)/2,E>=M&&!Xq(v,b,h,f,i,o)&&!Yq(t,v,b,f,h,f,a,null)&&(M=E,e.x=v,e.y=b,k=!0))}return!(!C&&!k)&&(v=h/2,b=f/2,a.setRange(t(e.x-v),t(e.y-b),t(e.x+v),t(e.y+b)),e.align="center",e.baseline="middle",!0)}}};function eW(t,e,n,r,i,o,a,s,u,l,c){if(!t.length)return t;const f=Math.max(r.length,i.length),h=function(t,e){const n=new Float64Array(e),r=t.length;for(let i=0;i<r;++i)n[i]=t[i]||0;for(let i=r;i<e;++i)n[i]=n[r-1];return n}(r,f),d=function(t,e){const n=new Int8Array(e),r=t.length;for(let i=0;i<r;++i)n[i]|=Qq[t[i]];for(let i=r;i<e;++i)n[i]=n[r-1];return n}(i,f),p=(x=t[0].datum)&&x.mark&&x.mark.marktype,g="group"===p&&t[0].datum.items[u].marktype,m="area"===g,y=function(t,e,n,r){const i=t=>[t.x,t.x,t.x,t.y,t.y,t.y];return t?"line"===t||"area"===t?t=>i(t.datum):"line"===e?t=>{const e=t.datum.items[r].items;return i(e.length?e["start"===n?0:e.length-1]:{x:NaN,y:NaN})}:t=>{const e=t.datum.bounds;return[e.x1,(e.x1+e.x2)/2,e.x2,e.y1,(e.y1+e.y2)/2,e.y2]}:i}(p,g,s,u),v=null===l||l===1/0,b=m&&"naive"===c;var x;let _=-1,w=-1;const A=t.map((t=>{const e=v?kj.width(t,t.text):void 0;return _=Math.max(_,e),w=Math.max(w,t.fontSize),{datum:t,opacity:0,x:void 0,y:void 0,align:void 0,baseline:void 0,boundary:y(t),textWidth:e}}));l=null===l||l===1/0?Math.max(_,w)+Math.max(...r):l;const D=Hq(e[0],e[1],l);let E;if(!b){n&&A.sort(((t,e)=>n(t.datum,e.datum)));let e=!1;for(let t=0;t<d.length&&!e;++t)e=5===d[t]||h[t]<0;const r=(p&&a||m)&&t.map((t=>t.datum));E=o.length||r?function(t,e,n,r,i){const o=t.width,a=t.height,s=r||i,u=l$(o,a).getContext("2d"),l=l$(o,a).getContext("2d"),c=s&&l$(o,a).getContext("2d");n.forEach((t=>Pq(u,t,!1))),Pq(l,e,!1),s&&Pq(c,e,!0);const f=Rq(u,o,a),h=Rq(l,o,a),d=s&&Rq(c,o,a),p=t.bitmap(),g=s&&t.bitmap();let m,y,v,b,x,_,w,A;for(y=0;y<a;++y)for(m=0;m<o;++m)x=y*o+m,_=f[x]&zq,A=h[x]&zq,w=s&&d[x]&zq,(_||w||A)&&(v=t(m),b=t(y),i||!_&&!A||p.set(v,b),s&&(_||w)&&g.set(v,b));return[p,g]}(D,r||[],o,e,m):function(t,e){const n=t.bitmap();return(e||[]).forEach((e=>n.set(t(e.boundary[0]),t(e.boundary[3])))),[n,void 0]}(D,a&&A)}const F=m?tW[c](D,E,a,u):function(t,e,n,r){const i=t.width,o=t.height,a=e[0],s=e[1],u=r.length;return function(e){const l=e.boundary,c=e.datum.fontSize;if(l[2]<0||l[5]<0||l[0]>i||l[3]>o)return!1;let f,h,d,p,g,m,y,v,b,x,_,w,A,D,E,F=e.textWidth??0;for(let i=0;i<u;++i){if(f=(3&n[i])-1,h=(n[i]>>>2&3)-1,d=0===f&&0===h||r[i]<0,p=f&&h?Math.SQRT1_2:1,g=r[i]<0?-1:1,m=l[1+f]+r[i]*f*p,_=l[4+h]+g*c*h/2+r[i]*h*p,v=_-c/2,b=_+c/2,w=t(m),D=t(v),E=t(b),!F){if(!Kq(w,w,D,E,a,s,0,0,0,0,0,d))continue;F=kj.width(e.datum,e.datum.text)}if(x=m+g*F*f/2,m=x-F/2,y=x+F/2,w=t(m),A=t(y),Kq(w,A,D,E,a,s,0,0,0,0,0,d))return e.x=f?f*g<0?y:m:x,e.y=h?h*g<0?b:v:_,e.align=Jq[f*g+1],e.baseline=Zq[h*g+1],a.setRange(w,D,A,E),!0}return!1}}(D,E,d,h);return A.forEach((t=>t.opacity=+F(t))),A}const nW=["x","y","opacity","align","baseline"],rW=["top-left","left","bottom-left","top","bottom","top-right","right","bottom-right"];function iW(t){Oq.call(this,null,t)}iW.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:rW},{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:nW.length,default:nW}]},WM(iW,Oq,{transform(t,e){const n=t.modified();if(!(n||e.changed(e.ADD_REM)||function(n){const r=t[n];return LM(r)&&e.modified(r.fields)}("sort")))return;t.size&&2===t.size.length||MM("Size parameter should be specified as a [width, height] array.");const r=t.as||nW;return eW(e.materialize(e.SOURCE).source||[],t.size,t.sort,UM(null==t.offset?1:t.offset),UM(t.anchor||rW),t.avoidMarks||[],!1!==t.avoidBaseMark,t.lineAnchor||"end",t.markIndex||0,void 0===t.padding?0:t.padding,t.method||"naive").forEach((t=>{const e=t.datum;e[r[0]]=t.x,e[r[1]]=t.y,e[r[2]]=t.opacity,e[r[3]]=t.align,e[r[4]]=t.baseline})),e.reflow(n).modifies(r)}});Math.random;Math.sqrt(2*Math.PI),Math.SQRT2;function oW(t,e,n){let r=0,i=0;for(const o of t){const t=n(o);null==e(o)||null==t||isNaN(t)||(r+=(t-r)/++i)}return{coef:[r],predict:()=>r,rSquared:0}}function aW(t,e,n,r){const i=r-t*t,o=Math.abs(i)<1e-24?0:(n-t*e)/i;return[e-o*t,o]}function sW(t,e,n,r){t=t.filter((t=>{let r=e(t),i=n(t);return null!=r&&(r=+r)>=r&&null!=i&&(i=+i)>=i})),r&&t.sort(((t,n)=>e(t)-e(n)));const i=t.length,o=new Float64Array(i),a=new Float64Array(i);let s,u,l,c=0,f=0,h=0;for(l of t)o[c]=s=+e(l),a[c]=u=+n(l),++c,f+=(s-f)/c,h+=(u-h)/c;for(c=0;c<i;++c)o[c]-=f,a[c]-=h;return[o,a,f,h]}function uW(t,e,n,r){let i,o,a=-1;for(const s of t)i=e(s),o=n(s),null!=i&&(i=+i)>=i&&null!=o&&(o=+o)>=o&&r(i,o,++a)}function lW(t,e,n,r,i){let o=0,a=0;return uW(t,e,n,((t,e)=>{const n=e-i(t),s=e-r;o+=n*n,a+=s*s})),1-o/a}function cW(t,e,n){let r=0,i=0,o=0,a=0,s=0;uW(t,e,n,((t,e)=>{++s,r+=(t-r)/s,i+=(e-i)/s,o+=(t*e-o)/s,a+=(t*t-a)/s}));const u=aW(r,i,o,a),l=t=>u[0]+u[1]*t;return{coef:u,predict:l,rSquared:lW(t,e,n,i,l)}}function fW(t,e,n){const[r,i,o,a]=sW(t,e,n),s=r.length;let u,l,c,f,h=0,d=0,p=0,g=0,m=0;for(u=0;u<s;)l=r[u],c=i[u++],f=l*l,h+=(f-h)/u,d+=(f*l-d)/u,p+=(f*f-p)/u,g+=(l*c-g)/u,m+=(f*c-m)/u;const y=p-h*h,v=h*y-d*d,b=(m*h-g*d)/v,x=(g*y-m*d)/v,_=-b*h,w=t=>b*(t-=o)*t+x*t+_+a;return{coef:[_-x*o+b*o*o+a,x-2*b*o,b],predict:w,rSquared:lW(t,e,n,a,w)}}function hW(t,e,n,r){const i=Array(t);let o,a,s,u;for(o=0;o<t;++o)i[o]=0;for(o=t-1;o>=0;--o)for(s=e[o],u=1,i[o]+=s,a=1;a<=o;++a)u*=(o+1-a)/a,i[o-a]+=s*Math.pow(n,a)*u;return i[0]+=r,i}const dW=2,pW=1e-12;function gW(t){return(t=1-t*t*t)*t*t}function mW(t,e,n){const r=t[e];let i=n[0],o=n[1]+1;if(!(o>=t.length))for(;e>i&&t[o]-r<=r-t[i];)n[0]=++i,n[1]=o,++o}const yW=.5*Math.PI/180;function vW(t,e,n,r,i){const o=Math.atan2(i*(n[1]-t[1]),r*(n[0]-t[0])),a=Math.atan2(i*(e[1]-t[1]),r*(e[0]-t[0]));return Math.abs(o-a)}function bW(t,e,n){return t.fields=e||[],t.fname=n,t}function xW(t){return null==t?null:t.fname}function _W(t){return 1===t.length?wW(t[0]):AW(t)}const wW=t=>function(e){return e[t]},AW=t=>{const e=t.length;return function(n){for(let r=0;r<e;++r)n=n[t[r]];return n}};function DW(t){throw Error(t)}function EW(t){const e=[],n=t.length;let r,i,o,a=null,s=0,u="";function l(){e.push(u+t.substring(r,i)),u="",r=i+1}for(t+="",r=i=0;i<n;++i)if(o=t[i],"\\"===o)u+=t.substring(r,i),u+=t.substring(++i,++i),r=i;else if(o===a)l(),a=null,s=-1;else{if(a)continue;r===s&&'"'===o||r===s&&"'"===o?(r=i+1,a=o):"."!==o||s?"["===o?(i>r&&l(),s=r=i+1):"]"===o&&(s||DW("Access path missing open bracket: "+t),s>0&&l(),s=0,r=i+1):i>r?l():r=i+1}return s&&DW("Access path missing closing bracket: "+t),a&&DW("Access path missing closing quote: "+t),i>r&&(i++,l()),e}function FW(t,e,n){const r=EW(t);return t=1===r.length?r[0]:t,bW((n&&n.get||_W)(r),[t],e||t)}const CW=FW("id"),kW=bW((t=>t),[],"identity"),MW=(bW((()=>0),[],"zero"),bW((()=>1),[],"one"),bW((()=>!0),[],"true"));bW((()=>!1),[],"false");var SW=Array.isArray;function $W(t){return t===Object(t)}function TW(t){return null!=t?SW(t)?t:[t]:[]}function BW(t){return"function"===typeof t}function NW(t){for(let e,n,r=1,i=arguments.length;r<i;++r)for(n in e=arguments[r],e)t[n]=e[n];return t}const OW=Object.prototype.hasOwnProperty;function zW(t,e){return OW.call(t,e)}function RW(t,e,n){const r=t.prototype=Object.create(e.prototype);return Object.defineProperty(r,"constructor",{value:t,writable:!0,enumerable:!0,configurable:!0}),NW(r,n)}function PW(t){return"string"===typeof t}function UW(t){return SW(t)?"["+t.map(UW)+"]":$W(t)||PW(t)?JSON.stringify(t).replace("\u2028","\\u2028").replace("\u2029","\\u2029"):t}function LW(t,e,n){if(t)if(e){const r=t.length;for(let i=0;i<r;++i){const r=e(t[i]);r&&n(r,i,t)}}else t.forEach(n)}var jW=Math.sqrt(50),IW=Math.sqrt(10),qW=Math.sqrt(2);var WW,HW=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function XW(t){if(!(e=HW.exec(t)))throw new Error("invalid format: "+t);var e;return new YW({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}function YW(t){this.fill=void 0===t.fill?" ":t.fill+"",this.align=void 0===t.align?">":t.align+"",this.sign=void 0===t.sign?"-":t.sign+"",this.symbol=void 0===t.symbol?"":t.symbol+"",this.zero=!!t.zero,this.width=void 0===t.width?void 0:+t.width,this.comma=!!t.comma,this.precision=void 0===t.precision?void 0:+t.precision,this.trim=!!t.trim,this.type=void 0===t.type?"":t.type+""}function GW(t,e){if((n=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var n,r=t.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+t.slice(n+1)]}function VW(t){return(t=GW(Math.abs(t)))?t[1]:NaN}function JW(t,e){var n=GW(t,e);if(!n)return t+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}XW.prototype=YW.prototype,YW.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 ZW={"%":(t,e)=>(100*t).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:function(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)},e:(t,e)=>t.toExponential(e),f:(t,e)=>t.toFixed(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>JW(100*t,e),r:JW,s:function(t,e){var n=GW(t,e);if(!n)return t+"";var r=n[0],i=n[1],o=i-(WW=3*Math.max(-8,Math.min(8,Math.floor(i/3))))+1,a=r.length;return o===a?r:o>a?r+new Array(o-a+1).join("0"):o>0?r.slice(0,o)+"."+r.slice(o):"0."+new Array(1-o).join("0")+GW(t,Math.max(0,e+o-1))[0]},X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function KW(t){return t}var QW,tH,eH,nH=Array.prototype.map,rH=["y","z","a","f","p","n","\xb5","m","","k","M","G","T","P","E","Z","Y"];function iH(t){var e,n,r=void 0===t.grouping||void 0===t.thousands?KW:(e=nH.call(t.grouping,Number),n=t.thousands+"",function(t,r){for(var i=t.length,o=[],a=0,s=e[0],u=0;i>0&&s>0&&(u+s+1>r&&(s=Math.max(1,r-u)),o.push(t.substring(i-=s,i+s)),!((u+=s+1)>r));)s=e[a=(a+1)%e.length];return o.reverse().join(n)}),i=void 0===t.currency?"":t.currency[0]+"",o=void 0===t.currency?"":t.currency[1]+"",a=void 0===t.decimal?".":t.decimal+"",s=void 0===t.numerals?KW:function(t){return function(e){return e.replace(/[0-9]/g,(function(e){return t[+e]}))}}(nH.call(t.numerals,String)),u=void 0===t.percent?"%":t.percent+"",l=void 0===t.minus?"\u2212":t.minus+"",c=void 0===t.nan?"NaN":t.nan+"";function f(t){var e=(t=XW(t)).fill,n=t.align,f=t.sign,h=t.symbol,d=t.zero,p=t.width,g=t.comma,m=t.precision,y=t.trim,v=t.type;"n"===v?(g=!0,v="g"):ZW[v]||(void 0===m&&(m=12),y=!0,v="g"),(d||"0"===e&&"="===n)&&(d=!0,e="0",n="=");var b="$"===h?i:"#"===h&&/[boxX]/.test(v)?"0"+v.toLowerCase():"",x="$"===h?o:/[%p]/.test(v)?u:"",_=ZW[v],w=/[defgprs%]/.test(v);function A(t){var i,o,u,h=b,A=x;if("c"===v)A=_(t)+A,t="";else{var D=(t=+t)<0||1/t<0;if(t=isNaN(t)?c:_(Math.abs(t),m),y&&(t=function(t){t:for(var e,n=t.length,r=1,i=-1;r<n;++r)switch(t[r]){case".":i=e=r;break;case"0":0===i&&(i=r),e=r;break;default:if(!+t[r])break t;i>0&&(i=0)}return i>0?t.slice(0,i)+t.slice(e+1):t}(t)),D&&0===+t&&"+"!==f&&(D=!1),h=(D?"("===f?f:l:"-"===f||"("===f?"":f)+h,A=("s"===v?rH[8+WW/3]:"")+A+(D&&"("===f?")":""),w)for(i=-1,o=t.length;++i<o;)if(48>(u=t.charCodeAt(i))||u>57){A=(46===u?a+t.slice(i+1):t.slice(i))+A,t=t.slice(0,i);break}}g&&!d&&(t=r(t,1/0));var E=h.length+t.length+A.length,F=E<p?new Array(p-E+1).join(e):"";switch(g&&d&&(t=r(F+t,F.length?p-A.length:1/0),F=""),n){case"<":t=h+t+A+F;break;case"=":t=h+F+t+A;break;case"^":t=F.slice(0,E=F.length>>1)+h+t+A+F.slice(E);break;default:t=F+h+t+A}return s(t)}return m=void 0===m?6:/[gprs]/.test(v)?Math.max(1,Math.min(21,m)):Math.max(0,Math.min(20,m)),A.toString=function(){return t+""},A}return{format:f,formatPrefix:function(t,e){var n=f(((t=XW(t)).type="f",t)),r=3*Math.max(-8,Math.min(8,Math.floor(VW(e)/3))),i=Math.pow(10,-r),o=rH[8+r/3];return function(t){return n(i*t)+o}}}}!function(t){QW=iH(t),tH=QW.format,eH=QW.formatPrefix}({thousands:",",grouping:[3],currency:["$",""]});const oH="year",aH="quarter",sH="month",uH="week",lH="date",cH="day",fH="dayofyear",hH="hours",dH="minutes",pH="seconds",gH="milliseconds";[oH,aH,sH,uH,lH,cH,fH,hH,dH,pH,gH].reduce(((t,e,n)=>(t[e]=1+n,t)),{});"".concat(oH,"-").concat(sH),"".concat(oH,"-").concat(sH,"-").concat(lH),"".concat(hH,"-").concat(dH);new Date;const mH={[oH]:wT,[aH]:DT.every(3),[sH]:DT,[uH]:iT,[lH]:nT,[cH]:nT,[fH]:nT,[hH]:FT,[dH]:kT,[pH]:ST,[gH]:TT},yH={[oH]:NT,[aH]:zT.every(3),[sH]:zT,[uH]:pT,[lH]:hT,[cH]:hT,[fH]:hT,[hH]:PT,[dH]:LT,[pH]:ST,[gH]:TT};function vH(t){return mH[t]}function bH(t){return yH[t]}const xH=[oH,sH,lH,hH,dH,pH,gH],_H=xH.slice(0,-1),wH=_H.slice(0,-1),AH=wH.slice(0,-1);AH.slice(0,-1);function DH(t){const e={};return n=>e[n]||(e[n]=t(n))}function EH(t){const e=DH(t.format),n=t.formatPrefix;return{format:e,formatPrefix:n,formatFloat(t){const n=XW(t||",");if(null==n.precision){switch(n.precision=12,n.type){case"%":n.precision-=2;break;case"e":n.precision-=1}return r=e(n),i=e(".1f")(1)[1],t=>{const e=r(t),n=e.indexOf(i);if(n<0)return e;let o=function(t,e){let n,r=t.lastIndexOf("e");if(r>0)return r;for(r=t.length;--r>e;)if(n=t.charCodeAt(r),n>=48&&n<=57)return r+1}(e,n);const a=o<e.length?e.slice(o):"";for(;--o>n;)if("0"!==e[o]){++o;break}return e.slice(0,o)+a}}return e(n);var r,i},formatSpan(t,r,i,o){o=XW(null==o?",f":o);const a=function(t,e,n){var r=Math.abs(e-t)/Math.max(0,n),i=Math.pow(10,Math.floor(Math.log(r)/Math.LN10)),o=r/i;return o>=jW?i*=10:o>=IW?i*=5:o>=qW&&(i*=2),e<t?-i:i}(t,r,i),s=Math.max(Math.abs(t),Math.abs(r));let u;if(null==o.precision)switch(o.type){case"s":return isNaN(u=function(t,e){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(VW(e)/3)))-VW(Math.abs(t)))}(a,s))||(o.precision=u),n(o,s);case"":case"e":case"g":case"p":case"r":isNaN(u=function(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,VW(e)-VW(t))+1}(a,s))||(o.precision=u-("e"===o.type));break;case"f":case"%":isNaN(u=function(t){return Math.max(0,-VW(Math.abs(t)))}(a))||(o.precision=u-2*("%"===o.type))}return e(o)}}}let FH,CH;function kH(){return FH=EH({format:tH,formatPrefix:eH})}function MH(t,e,n){$W(n=n||{})||DW("Invalid time multi-format specifier: ".concat(n));const r=e(pH),i=e(dH),o=e(hH),a=e(lH),s=e(uH),u=e(sH),l=e(aH),c=e(oH),f=t(n[gH]||".%L"),h=t(n[pH]||":%S"),d=t(n[dH]||"%I:%M"),p=t(n[hH]||"%I %p"),g=t(n[lH]||n[cH]||"%a %d"),m=t(n[uH]||"%b %d"),y=t(n[sH]||"%B"),v=t(n[aH]||"%B"),b=t(n[oH]||"%Y");return t=>(r(t)<t?f:i(t)<t?h:o(t)<t?d:a(t)<t?p:u(t)<t?s(t)<t?g:m:c(t)<t?l(t)<t?y:v:b)(t)}function SH(t){const e=DH(t.format),n=DH(t.utcFormat);return{timeFormat:t=>PW(t)?e(t):MH(e,vH,t),utcFormat:t=>PW(t)?n(t):MH(n,bH,t),timeParse:DH(t.parse),utcParse:DH(t.utcParse)}}function $H(){return CH=SH({format:fB,parse:hB,utcFormat:dB,utcParse:pB})}kH(),$H();const TH=/^(data:|([A-Za-z]+:)?\/\/)/,BH=/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp|file|data):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i,NH=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205f\u3000]/g,OH="file://";async function zH(t,e){const n=await this.sanitize(t,e),r=n.href;return n.localFile?this.file(r):this.http(r,e)}async function RH(t,e){e=NW({},this.options,e);const n=this.fileAccess,r={href:null};let i,o,a;const s=BH.test(t.replace(NH,""));null!=t&&"string"===typeof t&&s||DW("Sanitize failure, invalid URI: "+UW(t));const u=TH.test(t);return(a=e.baseURL)&&!u&&(t.startsWith("/")||a.endsWith("/")||(t="/"+t),t=a+t),o=(i=t.startsWith(OH))||"file"===e.mode||"http"!==e.mode&&!u&&n,i?t=t.slice(OH.length):t.startsWith("//")&&("file"===e.defaultProtocol?(t=t.slice(2),o=!0):t=(e.defaultProtocol||"http")+":"+t),Object.defineProperty(r,"localFile",{value:!!o}),r.href=t,e.target&&(r.target=e.target+""),e.rel&&(r.rel=e.rel+""),"image"===e.context&&e.crossOrigin&&(r.crossOrigin=e.crossOrigin+""),r}function PH(t){return t?e=>new Promise(((n,r)=>{t.readFile(e,((t,e)=>{t?r(t):n(e)}))})):UH}async function UH(){DW("No file system access.")}function LH(t){return t?async function(e,n){const r=NW({},this.options.http,n),i=n&&n.response,o=await t(e,r);return o.ok?BW(o[i])?o[i]():o.text():DW(o.status+""+o.statusText)}:jH}async function jH(){DW("No HTTP fetch method available.")}function IH(t){const e=function(e,n){const r={delimiter:t};return qH(e,n?NW(n,r):r)};return e.responseType="text",e}function qH(t,e){return e.header&&(t=e.header.map(UW).join(e.delimiter)+"\n"+t),x$(e.delimiter).parse(t+"")}function WH(t,e){const n=e&&e.property?FW(e.property):kW;return!$W(t)||(r=t,"function"===typeof Buffer&&BW(Buffer.isBuffer)&&Buffer.isBuffer(r))?n(JSON.parse(t)):function(t,e){!SW(t)&&function(t){return t&&BW(t[Symbol.iterator])}(t)&&(t=[...t]);return e&&e.copy?JSON.parse(JSON.stringify(t)):t}(n(t),e);var r}qH.responseType="text",WH.responseType="json";const HH={interior:(t,e)=>t!==e,exterior:(t,e)=>t===e};function XH(t,e){let n,r,i,o;return t=WH(t,e),e&&e.feature?(n=ce,i=e.feature):e&&e.mesh?(n=pe,i=e.mesh,o=HH[e.filter]):DW("Missing TopoJSON feature or mesh parameter."),r=(r=t.objects[i])?n(t,r,o):DW("Invalid TopoJSON object: "+i),r&&r.features||[r]}XH.responseType="json";IH(","),IH("\t");"undefined"!==typeof fetch&&fetch;function YH(t){const e=t||kW,n=[],r={};return n.add=t=>{const i=e(t);return r[i]||(r[i]=1,n.push(t)),n},n.remove=t=>{const i=e(t);if(r[i]){r[i]=0;const e=n.indexOf(t);e>=0&&n.splice(e,1)}return n},n}const GH=Symbol("vega_id");let VH=1;function JH(t){return t[GH]}function ZH(t,e){return t[GH]=e,t}function KH(t){const e=t===Object(t)?t:{data:t};return JH(e)?e:ZH(e,VH++)}const QH="_:mod:_";function tX(){Object.defineProperty(this,QH,{writable:!0,value:{}})}tX.prototype={set(t,e,n,r){const i=this,o=i[t],a=i[QH];return null!=e&&e>=0?(o[e]!==n||r)&&(o[e]=n,a[e+":"+t]=-1,a[t]=-1):(o!==n||r)&&(i[t]=n,a[t]=SW(n)?1+n.length:-1),i},modified(t,e){const n=this[QH];if(!arguments.length){for(const t in n)if(n[t])return!0;return!1}if(SW(t)){for(let e=0;e<t.length;++e)if(n[t[e]])return!0;return!1}return null!=e&&e>=0?e+1<n[t]||!!n[e+":"+t]:!!n[t]},clear(){return this[QH]={},this}};let eX=0;const nX=new tX;function rX(t,e,n,r){this.id=++eX,this.value=t,this.stamp=-1,this.rank=-1,this.qrank=-1,this.flags=0,e&&(this._update=e),n&&this.parameters(n,r)}function iX(t){return function(e){const n=this.flags;return 0===arguments.length?!!(n&t):(this.flags=e?n|t:n&~t,this)}}rX.prototype={targets(){return this._targets||(this._targets=YH(CW))},set(t){return this.value!==t?(this.value=t,1):0},skip:iX(1),modified:iX(2),parameters(t,e,n){e=!1!==e;const r=this._argval=this._argval||new tX,i=this._argops=this._argops||[],o=[];let a,s,u,l;const c=(t,n,a)=>{a instanceof rX?(a!==this&&(e&&a.targets().add(this),o.push(a)),i.push({op:a,name:t,index:n})):r.set(t,n,a)};for(a in t)if(s=t[a],"pulse"===a)TW(s).forEach((t=>{t instanceof rX?t!==this&&(t.targets().add(this),o.push(t)):DW("Pulse parameters must be operator instances.")})),this.source=s;else if(SW(s))for(r.set(a,-1,Array(u=s.length)),l=0;l<u;++l)c(a,l,s[l]);else c(a,-1,s);return this.marshall().clear(),n&&(i.initonly=!0),o},marshall(t){const e=this._argval||nX,n=this._argops;let r,i,o,a;if(n){const s=n.length;for(i=0;i<s;++i)r=n[i],o=r.op,a=o.modified()&&o.stamp===t,e.set(r.name,r.index,o.value,a);if(n.initonly){for(i=0;i<s;++i)r=n[i],r.op.targets().remove(this);this._argops=null,this._update=null}}return e},detach(){const t=this._argops;let e,n,r,i;if(t)for(e=0,n=t.length;e<n;++e)r=t[e],i=r.op,i._targets&&i._targets.remove(this);this.pulse=null,this.source=null},evaluate(t){const e=this._update;if(e){const n=this.marshall(t.stamp),r=e.call(this,n,t);if(n.clear(),r!==this.value)this.value=r;else if(!this.modified())return t.StopPropagation}},run(t){if(t.stamp<this.stamp)return t.StopPropagation;let e;return this.skip()?(this.skip(!1),e=0):e=this.evaluate(t),this.pulse=e||t}};let oX=0;function aX(t,e,n){this.id=++oX,this.value=null,n&&(this.receive=n),t&&(this._filter=t),e&&(this._apply=e)}function sX(t,e,n){return new aX(t,e,n)}aX.prototype={_filter:MW,_apply:kW,targets(){return this._targets||(this._targets=YH(CW))},consume(t){return arguments.length?(this._consume=!!t,this):!!this._consume},receive(t){if(this._filter(t)){const e=this.value=this._apply(t),n=this._targets,r=n?n.length:0;for(let t=0;t<r;++t)n[t].receive(e);this._consume&&(t.preventDefault(),t.stopPropagation())}},filter(t){const e=sX(t);return this.targets().add(e),e},apply(t){const e=sX(null,t);return this.targets().add(e),e},merge(){const t=sX();this.targets().add(t);for(let e=0,n=arguments.length;e<n;++e)arguments[e].targets().add(t);return t},throttle(t){let e=-1;return this.filter((()=>{const n=Date.now();return n-e>t?(e=n,1):0}))},debounce(t){const e=sX();return this.targets().add(sX(null,null,function(t,e){let n;return r=>{n&&clearTimeout(n),n=setTimeout((()=>(e(r),n=null)),t)}}(t,(t=>{const n=t.dataflow;e.receive(t),n&&n.run&&n.run()})))),e},between(t,e){let n=!1;return t.targets().add(sX(null,null,(()=>n=!0))),e.targets().add(sX(null,null,(()=>n=!1))),this.filter((()=>n))},detach(){this._filter=MW,this._targets=null}};const uX={};function lX(t,e,n){this.dataflow=t,this.stamp=null==e?-1:e,this.add=[],this.rem=[],this.mod=[],this.fields=null,this.encode=n||null}function cX(t,e){const n=[];return LW(t,e,(t=>n.push(t))),n}function fX(t,e){const n={};return t.visit(e,(t=>{n[JH(t)]=1})),t=>n[JH(t)]?null:t}function hX(t,e){return t?(n,r)=>t(n,r)&&e(n,r):e}function dX(t,e,n,r){const i=this,o=n.length;let a=0;this.dataflow=t,this.stamp=e,this.fields=null,this.encode=r||null,this.pulses=n;for(let s=0;s<o;++s){const t=n[s];if(t.stamp===e){if(t.fields){const e=i.fields||(i.fields={});for(const n in t.fields)e[n]=1}t.changed(i.ADD)&&(a|=i.ADD),t.changed(i.REM)&&(a|=i.REM),t.changed(i.MOD)&&(a|=i.MOD)}}this.changes=a}lX.prototype={StopPropagation:uX,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(t){return new lX(this.dataflow).init(this,t)},clone(){const t=this.fork(7);return t.add=t.add.slice(),t.rem=t.rem.slice(),t.mod=t.mod.slice(),t.source&&(t.source=t.source.slice()),t.materialize(23)},addAll(){let t=this;return!t.source||t.add===t.rem||!t.rem.length&&t.source.length===t.add.length||(t=new lX(this.dataflow).init(this),t.add=t.source,t.rem=[]),t},init(t,e){const n=this;return n.stamp=t.stamp,n.encode=t.encode,!t.fields||64&e||(n.fields=t.fields),1&e?(n.addF=t.addF,n.add=t.add):(n.addF=null,n.add=[]),2&e?(n.remF=t.remF,n.rem=t.rem):(n.remF=null,n.rem=[]),4&e?(n.modF=t.modF,n.mod=t.mod):(n.modF=null,n.mod=[]),32&e?(n.srcF=null,n.source=null):(n.srcF=t.srcF,n.source=t.source,t.cleans&&(n.cleans=t.cleans)),n},runAfter(t){this.dataflow.runAfter(t)},changed(t){const e=t||7;return 1&e&&this.add.length||2&e&&this.rem.length||4&e&&this.mod.length},reflow(t){if(t)return this.fork(7).reflow();const e=this.add.length,n=this.source&&this.source.length;return n&&n!==e&&(this.mod=this.source,e&&this.filter(4,fX(this,1))),this},clean(t){return arguments.length?(this.cleans=!!t,this):this.cleans},modifies(t){const e=this.fields||(this.fields={});return SW(t)?t.forEach((t=>e[t]=!0)):e[t]=!0,this},modified(t,e){const n=this.fields;return!(!e&&!this.mod.length||!n)&&(arguments.length?SW(t)?t.some((t=>n[t])):n[t]:!!n)},filter(t,e){const n=this;return 1&t&&(n.addF=hX(n.addF,e)),2&t&&(n.remF=hX(n.remF,e)),4&t&&(n.modF=hX(n.modF,e)),16&t&&(n.srcF=hX(n.srcF,e)),n},materialize(t){const e=this;return 1&(t=t||7)&&e.addF&&(e.add=cX(e.add,e.addF),e.addF=null),2&t&&e.remF&&(e.rem=cX(e.rem,e.remF),e.remF=null),4&t&&e.modF&&(e.mod=cX(e.mod,e.modF),e.modF=null),16&t&&e.srcF&&(e.source=e.source.filter(e.srcF),e.srcF=null),e},visit(t,e){const n=this,r=e;if(16&t)return LW(n.source,n.srcF,r),n;1&t&&LW(n.add,n.addF,r),2&t&&LW(n.rem,n.remF,r),4&t&&LW(n.mod,n.modF,r);const i=n.source;if(8&t&&i){const t=n.add.length+n.mod.length;t===i.length||LW(i,t?fX(n,5):n.srcF,r)}return n}},RW(dX,lX,{fork(t){const e=new lX(this.dataflow).init(this,t&this.NO_FIELDS);return void 0!==t&&(t&e.ADD&&this.visit(e.ADD,(t=>e.add.push(t))),t&e.REM&&this.visit(e.REM,(t=>e.rem.push(t))),t&e.MOD&&this.visit(e.MOD,(t=>e.mod.push(t)))),e},changed(t){return this.changes&t},modified(t){const e=this,n=e.fields;return n&&e.changes&e.MOD?SW(t)?t.some((t=>n[t])):n[t]:0},filter(){DW("MultiPulse does not support filtering.")},materialize(){DW("MultiPulse does not support materialization.")},visit(t,e){const n=this,r=n.pulses,i=r.length;let o=0;if(t&n.SOURCE)for(;o<i;++o)r[o].visit(t,e);else for(;o<i;++o)r[o].stamp===n.stamp&&r[o].visit(t,e);return n}});function pX(t){return function(){return this._log[t].apply(this,arguments)}}function gX(t,e){rX.call(this,t,null,e)}pX("error"),pX("warn"),pX("info"),pX("debug"),pX("level"),RW(gX,rX,{run(t){if(t.stamp<this.stamp)return t.StopPropagation;let e;return this.skip()?this.skip(!1):e=this.evaluate(t),e=e||t,e.then?e=e.then((t=>this.pulse=t)):e!==t.StopPropagation&&(this.pulse=e),e},evaluate(t){const e=this.marshall(t.stamp),n=this.transform(e,t);return e.clear(),n},transform(){}});function mX(t,e){var n,r,i,o,a,s,u=[],l=function(t){return t(o)};if(null==e)u.push(t);else for(n={},r=0,i=t.length;r<i;++r)o=t[r],(s=n[a=e.map(l)])||(n[a]=s=[],s.dims=a,u.push(s)),s.push(o);return u}function yX(t){gX.call(this,null,t)}yX.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}]},RW(yX,gX,{transform(t,e){const n=e.fork(e.NO_SOURCE|e.NO_FIELDS);if(!this.value||e.changed()||t.modified()){const r=mX(e.materialize(e.SOURCE).source,t.groupby),i=(t.groupby||[]).map(xW),o=i.length,a=t.as||[xW(t.x),xW(t.y)],s=[];r.forEach((e=>{(function(t,e,n,r){const[i,o,a,s]=sW(t,e,n,!0),u=i.length,l=Math.max(2,~~(r*u)),c=new Float64Array(u),f=new Float64Array(u),h=new Float64Array(u).fill(1);for(let d=-1;++d<=dW;){const t=[0,l-1];for(let n=0;n<u;++n){const e=i[n],r=t[0],a=t[1],s=e-i[r]>i[a]-e?r:a;let u=0,l=0,d=0,p=0,g=0;const m=1/Math.abs(i[s]-e||1);for(let t=r;t<=a;++t){const n=i[t],r=o[t],a=gW(Math.abs(e-n)*m)*h[t],s=n*a;u+=a,l+=s,d+=r*a,p+=r*s,g+=n*s}const[y,v]=aW(l/u,d/u,p/u,g/u);c[n]=y+v*e,f[n]=Math.abs(o[n]-c[n]),mW(i,n+1,t)}if(d===dW)break;const e=Js(f);if(Math.abs(e)<pW)break;for(let n,r,i=0;i<u;++i)n=f[i]/(6*e),h[i]=n>=1?pW:(r=1-n*n)*r}return function(t,e,n,r){const i=t.length,o=[];let a,s=0,u=0,l=[];for(;s<i;++s)a=t[s]+n,l[0]===a?l[1]+=(e[s]-l[1])/++u:(u=0,l[1]+=r,l=[a,e[s]],o.push(l));return l[1]+=r,o}(i,c,a,s)})(e,t.x,t.y,t.bandwidth||.3).forEach((t=>{const n={};for(let r=0;r<o;++r)n[i[r]]=e.dims[r];n[a[0]]=t[0],n[a[1]]=t[1],s.push(KH(n))}))})),this.value&&(n.rem=this.value),this.value=n.add=n.source=s}return n}});const vX={constant:oW,linear:cW,log:function(t,e,n){let r=0,i=0,o=0,a=0,s=0;uW(t,e,n,((t,e)=>{++s,t=Math.log(t),r+=(t-r)/s,i+=(e-i)/s,o+=(t*e-o)/s,a+=(t*t-a)/s}));const u=aW(r,i,o,a),l=t=>u[0]+u[1]*Math.log(t);return{coef:u,predict:l,rSquared:lW(t,e,n,i,l)}},exp:function(t,e,n){const[r,i,o,a]=sW(t,e,n);let s,u,l,c=0,f=0,h=0,d=0,p=0;uW(t,e,n,((t,e)=>{s=r[p++],u=Math.log(e),l=s*e,c+=(e*u-c)/p,f+=(l-f)/p,h+=(l*u-h)/p,d+=(s*l-d)/p}));const[g,m]=aW(f/a,c/a,h/a,d/a),y=t=>Math.exp(g+m*(t-o));return{coef:[Math.exp(g-m*o),m],predict:y,rSquared:lW(t,e,n,a,y)}},pow:function(t,e,n){let r=0,i=0,o=0,a=0,s=0,u=0;uW(t,e,n,((t,e)=>{const n=Math.log(t),l=Math.log(e);++u,r+=(n-r)/u,i+=(l-i)/u,o+=(n*l-o)/u,a+=(n*n-a)/u,s+=(e-s)/u}));const l=aW(r,i,o,a),c=t=>l[0]*Math.pow(t,l[1]);return l[0]=Math.exp(l[0]),{coef:l,predict:c,rSquared:lW(t,e,n,s,c)}},quad:fW,poly:function(t,e,n,r){if(0===r)return oW(t,e,n);if(1===r)return cW(t,e,n);if(2===r)return fW(t,e,n);const[i,o,a,s]=sW(t,e,n),u=i.length,l=[],c=[],f=r+1;let h,d,p,g,m;for(h=0;h<f;++h){for(p=0,g=0;p<u;++p)g+=Math.pow(i[p],h)*o[p];for(l.push(g),m=new Float64Array(f),d=0;d<f;++d){for(p=0,g=0;p<u;++p)g+=Math.pow(i[p],h+d);m[d]=g}c.push(m)}c.push(l);const y=function(t){const e=t.length-1,n=[];let r,i,o,a,s;for(r=0;r<e;++r){for(a=r,i=r+1;i<e;++i)Math.abs(t[r][i])>Math.abs(t[r][a])&&(a=i);for(o=r;o<e+1;++o)s=t[o][r],t[o][r]=t[o][a],t[o][a]=s;for(i=r+1;i<e;++i)for(o=e;o>=r;o--)t[o][i]-=t[o][r]*t[r][i]/t[r][r]}for(i=e-1;i>=0;--i){for(s=0,o=i+1;o<e;++o)s+=t[o][i]*n[o];n[i]=(t[e][i]-s)/t[i][i]}return n}(c),v=t=>{t-=a;let e=s+y[0]+y[1]*t+y[2]*t*t;for(h=3;h<f;++h)e+=y[h]*Math.pow(t,h);return e};return{coef:hW(f,y,-a,s),predict:v,rSquared:lW(t,e,n,s,v)}}};function bX(t){gX.call(this,null,t)}bX.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(vX)},{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}]},RW(bX,gX,{transform(t,e){const n=e.fork(e.NO_SOURCE|e.NO_FIELDS);if(!this.value||e.changed()||t.modified()){const r=mX(e.materialize(e.SOURCE).source,t.groupby),i=(t.groupby||[]).map(xW),o=t.method||"linear",a=null==t.order?3:t.order,s=((t,e)=>"poly"===t?e:"quad"===t?2:1)(o,a),u=t.as||[xW(t.x),xW(t.y)],l=vX[o],c=[];let f=t.extent;zW(vX,o)||DW("Invalid regression method: "+o),null!=f&&"log"===o&&f[0]<=0&&(e.dataflow.warn("Ignoring extent with values <= 0 for log regression."),f=null),r.forEach((n=>{if(n.length<=s)return void e.dataflow.warn("Skipping regression with more parameters than data points.");const r=l(n,t.x,t.y,a);if(t.params)return void c.push(KH({keys:n.dims,coef:r.coef,rSquared:r.rSquared}));const h=f||function(t,e){let n,r,i,o,a=0;if(t&&(n=t.length))if(null==e){for(r=t[a];a<n&&(null==r||r!==r);r=t[++a]);for(i=o=r;a<n;++a)r=t[a],null!=r&&(r<i&&(i=r),r>o&&(o=r))}else{for(r=e(t[a]);a<n&&(null==r||r!==r);r=e(t[++a]));for(i=o=r;a<n;++a)r=e(t[a]),null!=r&&(r<i&&(i=r),r>o&&(o=r))}return[i,o]}(n,t.x),d=t=>{const e={};for(let r=0;r<i.length;++r)e[i[r]]=n.dims[r];e[u[0]]=t[0],e[u[1]]=t[1],c.push(KH(e))};"linear"===o||"constant"===o?h.forEach((t=>d([t,r.predict(t)]))):function(t,e,n,r){n=n||25,r=Math.max(n,r||200);const i=e=>[e,t(e)],o=e[0],a=e[1],s=a-o,u=s/r,l=[i(o)],c=[];if(n===r){for(let t=1;t<r;++t)l.push(i(o+t/n*s));return l.push(i(a)),l}c.push(i(a));for(let g=n;--g>0;)c.push(i(o+g/n*s));let f=l[0],h=c[c.length-1];const d=1/s,p=function(t,e){let n=t,r=t;const i=e.length;for(let o=0;o<i;++o){const t=e[o][1];t<n&&(n=t),t>r&&(r=t)}return 1/(r-n)}(f[1],c);for(;h;){const t=i((f[0]+h[0])/2);t[0]-f[0]>=u&&vW(f,t,h,d,p)>yW?c.push(t):(f=h,l.push(h),c.pop()),h=c[c.length-1]}return l}(r.predict,h,25,200).forEach(d)})),this.value&&(n.rem=this.value),this.value=n.add=n.source=c}return n}});const xX=134217729,_X=33306690738754706e-32;function wX(t,e,n,r,i){let o,a,s,u,l=e[0],c=r[0],f=0,h=0;c>l===c>-l?(o=l,l=e[++f]):(o=c,c=r[++h]);let d=0;if(f<t&&h<n)for(c>l===c>-l?(a=l+o,s=o-(a-l),l=e[++f]):(a=c+o,s=o-(a-c),c=r[++h]),o=a,0!==s&&(i[d++]=s);f<t&&h<n;)c>l===c>-l?(a=o+l,u=a-o,s=o-(a-u)+(l-u),l=e[++f]):(a=o+c,u=a-o,s=o-(a-u)+(c-u),c=r[++h]),o=a,0!==s&&(i[d++]=s);for(;f<t;)a=o+l,u=a-o,s=o-(a-u)+(l-u),l=e[++f],o=a,0!==s&&(i[d++]=s);for(;h<n;)a=o+c,u=a-o,s=o-(a-u)+(c-u),c=r[++h],o=a,0!==s&&(i[d++]=s);return 0===o&&0!==d||(i[d++]=o),d}function AX(t){return new Float64Array(t)}const DX=33306690738754716e-32,EX=22204460492503146e-32,FX=11093356479670487e-47,CX=AX(4),kX=AX(8),MX=AX(12),SX=AX(16),$X=AX(4);function TX(t,e,n,r,i,o){const a=(e-o)*(n-i),s=(t-i)*(r-o),u=a-s;if(0===a||0===s||a>0!==s>0)return u;const l=Math.abs(a+s);return Math.abs(u)>=DX*l?u:-function(t,e,n,r,i,o,a){let s,u,l,c,f,h,d,p,g,m,y,v,b,x,_,w,A,D;const E=t-i,F=n-i,C=e-o,k=r-o;x=E*k,h=xX*E,d=h-(h-E),p=E-d,h=xX*k,g=h-(h-k),m=k-g,_=p*m-(x-d*g-p*g-d*m),w=C*F,h=xX*C,d=h-(h-C),p=C-d,h=xX*F,g=h-(h-F),m=F-g,A=p*m-(w-d*g-p*g-d*m),y=_-A,f=_-y,CX[0]=_-(y+f)+(f-A),v=x+y,f=v-x,b=x-(v-f)+(y-f),y=b-w,f=b-y,CX[1]=b-(y+f)+(f-w),D=v+y,f=D-v,CX[2]=v-(D-f)+(y-f),CX[3]=D;let M=function(t,e){let n=e[0];for(let r=1;r<t;r++)n+=e[r];return n}(4,CX),S=EX*a;if(M>=S||-M>=S)return M;if(f=t-E,s=t-(E+f)+(f-i),f=n-F,l=n-(F+f)+(f-i),f=e-C,u=e-(C+f)+(f-o),f=r-k,c=r-(k+f)+(f-o),0===s&&0===u&&0===l&&0===c)return M;if(S=FX*a+_X*Math.abs(M),M+=E*c+k*s-(C*l+F*u),M>=S||-M>=S)return M;x=s*k,h=xX*s,d=h-(h-s),p=s-d,h=xX*k,g=h-(h-k),m=k-g,_=p*m-(x-d*g-p*g-d*m),w=u*F,h=xX*u,d=h-(h-u),p=u-d,h=xX*F,g=h-(h-F),m=F-g,A=p*m-(w-d*g-p*g-d*m),y=_-A,f=_-y,$X[0]=_-(y+f)+(f-A),v=x+y,f=v-x,b=x-(v-f)+(y-f),y=b-w,f=b-y,$X[1]=b-(y+f)+(f-w),D=v+y,f=D-v,$X[2]=v-(D-f)+(y-f),$X[3]=D;const $=wX(4,CX,4,$X,kX);x=E*c,h=xX*E,d=h-(h-E),p=E-d,h=xX*c,g=h-(h-c),m=c-g,_=p*m-(x-d*g-p*g-d*m),w=C*l,h=xX*C,d=h-(h-C),p=C-d,h=xX*l,g=h-(h-l),m=l-g,A=p*m-(w-d*g-p*g-d*m),y=_-A,f=_-y,$X[0]=_-(y+f)+(f-A),v=x+y,f=v-x,b=x-(v-f)+(y-f),y=b-w,f=b-y,$X[1]=b-(y+f)+(f-w),D=v+y,f=D-v,$X[2]=v-(D-f)+(y-f),$X[3]=D;const T=wX($,kX,4,$X,MX);x=s*c,h=xX*s,d=h-(h-s),p=s-d,h=xX*c,g=h-(h-c),m=c-g,_=p*m-(x-d*g-p*g-d*m),w=u*l,h=xX*u,d=h-(h-u),p=u-d,h=xX*l,g=h-(h-l),m=l-g,A=p*m-(w-d*g-p*g-d*m),y=_-A,f=_-y,$X[0]=_-(y+f)+(f-A),v=x+y,f=v-x,b=x-(v-f)+(y-f),y=b-w,f=b-y,$X[1]=b-(y+f)+(f-w),D=v+y,f=D-v,$X[2]=v-(D-f)+(y-f),$X[3]=D;const B=wX(T,MX,4,$X,SX);return SX[B-1]}(t,e,n,r,i,o,l)}AX(4),AX(4),AX(4),AX(4),AX(4),AX(4),AX(4),AX(4),AX(4),AX(8),AX(8),AX(8),AX(4),AX(8),AX(8),AX(8),AX(12);AX(192),AX(192);AX(4),AX(4),AX(4),AX(4),AX(4),AX(4),AX(4),AX(4),AX(8),AX(8),AX(8),AX(8),AX(8),AX(8),AX(8),AX(8),AX(8),AX(4),AX(4),AX(4),AX(8),AX(16),AX(16),AX(16),AX(32),AX(32),AX(48),AX(64);AX(1152),AX(1152);AX(4),AX(4),AX(4),AX(4),AX(4),AX(4),AX(4),AX(4),AX(4),AX(4),AX(24),AX(24),AX(24),AX(24),AX(24),AX(24),AX(24),AX(24),AX(24),AX(24),AX(1152),AX(1152),AX(1152),AX(1152),AX(1152),AX(2304),AX(2304),AX(3456),AX(5760),AX(8),AX(8),AX(8),AX(16),AX(24),AX(48),AX(48),AX(96),AX(192),AX(384),AX(384),AX(384),AX(768);AX(96),AX(96),AX(96),AX(1152);const BX=Math.pow(2,-52),NX=new Uint32Array(512);class OX{static from(t,e=jX,n=IX){const r=t.length,i=new Float64Array(2*r);for(let o=0;o<r;o++){const r=t[o];i[2*o]=e(r),i[2*o+1]=n(r)}return new OX(i)}constructor(t){const e=t.length>>1;if(e>0&&"number"!==typeof t[0])throw new Error("Expected coords to contain numbers.");this.coords=t;const n=Math.max(2*e-5,0);this._triangles=new Uint32Array(3*n),this._halfedges=new Int32Array(3*n),this._hashSize=Math.ceil(Math.sqrt(e)),this._hullPrev=new Uint32Array(e),this._hullNext=new Uint32Array(e),this._hullTri=new Uint32Array(e),this._hullHash=new Int32Array(this._hashSize).fill(-1),this._ids=new Uint32Array(e),this._dists=new Float64Array(e),this.update()}update(){const{coords:t,_hullPrev:e,_hullNext:n,_hullTri:r,_hullHash:i}=this,o=t.length>>1;let a=1/0,s=1/0,u=-1/0,l=-1/0;for(let E=0;E<o;E++){const e=t[2*E],n=t[2*E+1];e<a&&(a=e),n<s&&(s=n),e>u&&(u=e),n>l&&(l=n),this._ids[E]=E}const c=(a+u)/2,f=(s+l)/2;let h,d,p,g=1/0;for(let E=0;E<o;E++){const e=zX(c,f,t[2*E],t[2*E+1]);e<g&&(h=E,g=e)}const m=t[2*h],y=t[2*h+1];g=1/0;for(let E=0;E<o;E++){if(E===h)continue;const e=zX(m,y,t[2*E],t[2*E+1]);e<g&&e>0&&(d=E,g=e)}let v=t[2*d],b=t[2*d+1],x=1/0;for(let E=0;E<o;E++){if(E===h||E===d)continue;const e=PX(m,y,v,b,t[2*E],t[2*E+1]);e<x&&(p=E,x=e)}let _=t[2*p],w=t[2*p+1];if(x===1/0){for(let r=0;r<o;r++)this._dists[r]=t[2*r]-t[0]||t[2*r+1]-t[1];UX(this._ids,this._dists,0,o-1);const e=new Uint32Array(o);let n=0;for(let t=0,r=-1/0;t<o;t++){const i=this._ids[t];this._dists[i]>r&&(e[n++]=i,r=this._dists[i])}return this.hull=e.subarray(0,n),this.triangles=new Uint32Array(0),void(this.halfedges=new Uint32Array(0))}if(TX(m,y,v,b,_,w)<0){const t=d,e=v,n=b;d=p,v=_,b=w,p=t,_=e,w=n}const A=function(t,e,n,r,i,o){const a=n-t,s=r-e,u=i-t,l=o-e,c=a*a+s*s,f=u*u+l*l,h=.5/(a*l-s*u),d=t+(l*c-s*f)*h,p=e+(a*f-u*c)*h;return{x:d,y:p}}(m,y,v,b,_,w);this._cx=A.x,this._cy=A.y;for(let E=0;E<o;E++)this._dists[E]=zX(t[2*E],t[2*E+1],A.x,A.y);UX(this._ids,this._dists,0,o-1),this._hullStart=h;let D=3;n[h]=e[p]=d,n[d]=e[h]=p,n[p]=e[d]=h,r[h]=0,r[d]=1,r[p]=2,i.fill(-1),i[this._hashKey(m,y)]=h,i[this._hashKey(v,b)]=d,i[this._hashKey(_,w)]=p,this.trianglesLen=0,this._addTriangle(h,d,p,-1,-1,-1);for(let E,F,C=0;C<this._ids.length;C++){const o=this._ids[C],a=t[2*o],s=t[2*o+1];if(C>0&&Math.abs(a-E)<=BX&&Math.abs(s-F)<=BX)continue;if(E=a,F=s,o===h||o===d||o===p)continue;let u=0;for(let t=0,e=this._hashKey(a,s);t<this._hashSize&&(u=i[(e+t)%this._hashSize],-1===u||u===n[u]);t++);u=e[u];let l,c=u;for(;l=n[c],TX(a,s,t[2*c],t[2*c+1],t[2*l],t[2*l+1])>=0;)if(c=l,c===u){c=-1;break}if(-1===c)continue;let f=this._addTriangle(c,o,n[c],-1,-1,r[c]);r[o]=this._legalize(f+2),r[c]=f,D++;let g=n[c];for(;l=n[g],TX(a,s,t[2*g],t[2*g+1],t[2*l],t[2*l+1])<0;)f=this._addTriangle(g,o,l,r[o],-1,r[g]),r[o]=this._legalize(f+2),n[g]=g,D--,g=l;if(c===u)for(;l=e[c],TX(a,s,t[2*l],t[2*l+1],t[2*c],t[2*c+1])<0;)f=this._addTriangle(l,o,c,-1,r[c],r[l]),this._legalize(f+2),r[l]=f,n[c]=c,D--,c=l;this._hullStart=e[o]=c,n[c]=e[g]=o,n[o]=g,i[this._hashKey(a,s)]=o,i[this._hashKey(t[2*c],t[2*c+1])]=c}this.hull=new Uint32Array(D);for(let E=0,F=this._hullStart;E<D;E++)this.hull[E]=F,F=n[F];this.triangles=this._triangles.subarray(0,this.trianglesLen),this.halfedges=this._halfedges.subarray(0,this.trianglesLen)}_hashKey(t,e){return Math.floor(function(t,e){const n=t/(Math.abs(t)+Math.abs(e));return(e>0?3-n:1+n)/4}(t-this._cx,e-this._cy)*this._hashSize)%this._hashSize}_legalize(t){const{_triangles:e,_halfedges:n,coords:r}=this;let i=0,o=0;for(;;){const a=n[t],s=t-t%3;if(o=s+(t+2)%3,-1===a){if(0===i)break;t=NX[--i];continue}const u=a-a%3,l=s+(t+1)%3,c=u+(a+2)%3,f=e[o],h=e[t],d=e[l],p=e[c];if(RX(r[2*f],r[2*f+1],r[2*h],r[2*h+1],r[2*d],r[2*d+1],r[2*p],r[2*p+1])){e[t]=p,e[a]=f;const r=n[c];if(-1===r){let e=this._hullStart;do{if(this._hullTri[e]===c){this._hullTri[e]=t;break}e=this._hullPrev[e]}while(e!==this._hullStart)}this._link(t,r),this._link(a,n[o]),this._link(o,c);const s=u+(a+1)%3;i<NX.length&&(NX[i++]=s)}else{if(0===i)break;t=NX[--i]}}return o}_link(t,e){this._halfedges[t]=e,-1!==e&&(this._halfedges[e]=t)}_addTriangle(t,e,n,r,i,o){const a=this.trianglesLen;return this._triangles[a]=t,this._triangles[a+1]=e,this._triangles[a+2]=n,this._link(a,r),this._link(a+1,i),this._link(a+2,o),this.trianglesLen+=3,a}}function zX(t,e,n,r){const i=t-n,o=e-r;return i*i+o*o}function RX(t,e,n,r,i,o,a,s){const u=t-a,l=e-s,c=n-a,f=r-s,h=i-a,d=o-s,p=c*c+f*f,g=h*h+d*d;return u*(f*g-p*d)-l*(c*g-p*h)+(u*u+l*l)*(c*d-f*h)<0}function PX(t,e,n,r,i,o){const a=n-t,s=r-e,u=i-t,l=o-e,c=a*a+s*s,f=u*u+l*l,h=.5/(a*l-s*u),d=(l*c-s*f)*h,p=(a*f-u*c)*h;return d*d+p*p}function UX(t,e,n,r){if(r-n<=20)for(let i=n+1;i<=r;i++){const r=t[i],o=e[r];let a=i-1;for(;a>=n&&e[t[a]]>o;)t[a+1]=t[a--];t[a+1]=r}else{let i=n+1,o=r;LX(t,n+r>>1,i),e[t[n]]>e[t[r]]&&LX(t,n,r),e[t[i]]>e[t[r]]&&LX(t,i,r),e[t[n]]>e[t[i]]&&LX(t,n,i);const a=t[i],s=e[a];for(;;){do{i++}while(e[t[i]]<s);do{o--}while(e[t[o]]>s);if(o<i)break;LX(t,i,o)}t[n+1]=t[o],t[o]=a,r-i+1>=o-n?(UX(t,e,i,r),UX(t,e,n,o-1)):(UX(t,e,n,o-1),UX(t,e,i,r))}}function LX(t,e,n){const r=t[e];t[e]=t[n],t[n]=r}function jX(t){return t[0]}function IX(t){return t[1]}const qX=1e-6;class WX{constructor(){this._x0=this._y0=this._x1=this._y1=null,this._=""}moveTo(t,e){this._+=`M${this._x0=this._x1=+t},${this._y0=this._y1=+e}`}closePath(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")}lineTo(t,e){this._+=`L${this._x1=+t},${this._y1=+e}`}arc(t,e,n){const r=(t=+t)+(n=+n),i=e=+e;if(n<0)throw new Error("negative radius");null===this._x1?this._+=`M${r},${i}`:(Math.abs(this._x1-r)>qX||Math.abs(this._y1-i)>qX)&&(this._+="L"+r+","+i),n&&(this._+=`A${n},${n},0,1,1,${t-n},${e}A${n},${n},0,1,1,${this._x1=r},${this._y1=i}`)}rect(t,e,n,r){this._+=`M${this._x0=this._x1=+t},${this._y0=this._y1=+e}h${+n}v${+r}h${-n}Z`}value(){return this._||null}}class HX{constructor(){this._=[]}moveTo(t,e){this._.push([t,e])}closePath(){this._.push(this._[0].slice())}lineTo(t,e){this._.push([t,e])}value(){return this._.length?this._:null}}class XX{constructor(t,[e,n,r,i]=[0,0,960,500]){if(!((r=+r)>=(e=+e))||!((i=+i)>=(n=+n)))throw new Error("invalid bounds");this.delaunay=t,this._circumcenters=new Float64Array(2*t.points.length),this.vectors=new Float64Array(2*t.points.length),this.xmax=r,this.xmin=e,this.ymax=i,this.ymin=n,this._init()}update(){return this.delaunay.update(),this._init(),this}_init(){const{delaunay:{points:t,hull:e,triangles:n},vectors:r}=this,i=this.circumcenters=this._circumcenters.subarray(0,n.length/3*2);for(let h,d,p=0,g=0,m=n.length;p<m;p+=3,g+=2){const e=2*n[p],r=2*n[p+1],o=2*n[p+2],a=t[e],s=t[e+1],u=t[r],l=t[r+1],c=t[o],f=t[o+1],m=u-a,y=l-s,v=c-a,b=f-s,x=2*(m*b-y*v);if(Math.abs(x)<1e-9){let e=1e9;const r=2*n[0];e*=Math.sign((t[r]-a)*b-(t[r+1]-s)*v),h=(a+c)/2-e*b,d=(s+f)/2+e*v}else{const t=1/x,e=m*m+y*y,n=v*v+b*b;h=a+(b*e-y*n)*t,d=s+(m*n-v*e)*t}i[g]=h,i[g+1]=d}let o,a,s,u=e[e.length-1],l=4*u,c=t[2*u],f=t[2*u+1];r.fill(0);for(let h=0;h<e.length;++h)u=e[h],o=l,a=c,s=f,l=4*u,c=t[2*u],f=t[2*u+1],r[o+2]=r[l]=s-f,r[o+3]=r[l+1]=c-a}render(t){const e=null==t?t=new WX:void 0,{delaunay:{halfedges:n,inedges:r,hull:i},circumcenters:o,vectors:a}=this;if(i.length<=1)return null;for(let l=0,c=n.length;l<c;++l){const e=n[l];if(e<l)continue;const r=2*Math.floor(l/3),i=2*Math.floor(e/3),a=o[r],s=o[r+1],u=o[i],c=o[i+1];this._renderSegment(a,s,u,c,t)}let s,u=i[i.length-1];for(let l=0;l<i.length;++l){s=u,u=i[l];const e=2*Math.floor(r[u]/3),n=o[e],c=o[e+1],f=4*s,h=this._project(n,c,a[f+2],a[f+3]);h&&this._renderSegment(n,c,h[0],h[1],t)}return e&&e.value()}renderBounds(t){const e=null==t?t=new WX:void 0;return t.rect(this.xmin,this.ymin,this.xmax-this.xmin,this.ymax-this.ymin),e&&e.value()}renderCell(t,e){const n=null==e?e=new WX:void 0,r=this._clip(t);if(null===r||!r.length)return;e.moveTo(r[0],r[1]);let i=r.length;for(;r[0]===r[i-2]&&r[1]===r[i-1]&&i>1;)i-=2;for(let o=2;o<i;o+=2)r[o]===r[o-2]&&r[o+1]===r[o-1]||e.lineTo(r[o],r[o+1]);return e.closePath(),n&&n.value()}*cellPolygons(){const{delaunay:{points:t}}=this;for(let e=0,n=t.length/2;e<n;++e){const t=this.cellPolygon(e);t&&(t.index=e,yield t)}}cellPolygon(t){const e=new HX;return this.renderCell(t,e),e.value()}_renderSegment(t,e,n,r,i){let o;const a=this._regioncode(t,e),s=this._regioncode(n,r);0===a&&0===s?(i.moveTo(t,e),i.lineTo(n,r)):(o=this._clipSegment(t,e,n,r,a,s))&&(i.moveTo(o[0],o[1]),i.lineTo(o[2],o[3]))}contains(t,e,n){return(e=+e)===e&&(n=+n)===n&&this.delaunay._step(t,e,n)===t}*neighbors(t){const e=this._clip(t);if(e)for(const n of this.delaunay.neighbors(t)){const t=this._clip(n);if(t)t:for(let r=0,i=e.length;r<i;r+=2)for(let o=0,a=t.length;o<a;o+=2)if(e[r]==t[o]&&e[r+1]==t[o+1]&&e[(r+2)%i]==t[(o+a-2)%a]&&e[(r+3)%i]==t[(o+a-1)%a]){yield n;break t}}}_cell(t){const{circumcenters:e,delaunay:{inedges:n,halfedges:r,triangles:i}}=this,o=n[t];if(-1===o)return null;const a=[];let s=o;do{const n=Math.floor(s/3);if(a.push(e[2*n],e[2*n+1]),s=s%3===2?s-2:s+1,i[s]!==t)break;s=r[s]}while(s!==o&&-1!==s);return a}_clip(t){if(0===t&&1===this.delaunay.hull.length)return[this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax,this.xmin,this.ymin];const e=this._cell(t);if(null===e)return null;const{vectors:n}=this,r=4*t;return n[r]||n[r+1]?this._clipInfinite(t,e,n[r],n[r+1],n[r+2],n[r+3]):this._clipFinite(t,e)}_clipFinite(t,e){const n=e.length;let r,i,o,a,s=null,u=e[n-2],l=e[n-1],c=this._regioncode(u,l),f=0;for(let h=0;h<n;h+=2)if(r=u,i=l,u=e[h],l=e[h+1],o=c,c=this._regioncode(u,l),0===o&&0===c)a=f,f=0,s?s.push(u,l):s=[u,l];else{let e,n,h,d,p;if(0===o){if(null===(e=this._clipSegment(r,i,u,l,o,c)))continue;[n,h,d,p]=e}else{if(null===(e=this._clipSegment(u,l,r,i,c,o)))continue;[d,p,n,h]=e,a=f,f=this._edgecode(n,h),a&&f&&this._edge(t,a,f,s,s.length),s?s.push(n,h):s=[n,h]}a=f,f=this._edgecode(d,p),a&&f&&this._edge(t,a,f,s,s.length),s?s.push(d,p):s=[d,p]}if(s)a=f,f=this._edgecode(s[0],s[1]),a&&f&&this._edge(t,a,f,s,s.length);else if(this.contains(t,(this.xmin+this.xmax)/2,(this.ymin+this.ymax)/2))return[this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax,this.xmin,this.ymin];return s}_clipSegment(t,e,n,r,i,o){for(;;){if(0===i&&0===o)return[t,e,n,r];if(i&o)return null;let a,s,u=i||o;8&u?(a=t+(n-t)*(this.ymax-e)/(r-e),s=this.ymax):4&u?(a=t+(n-t)*(this.ymin-e)/(r-e),s=this.ymin):2&u?(s=e+(r-e)*(this.xmax-t)/(n-t),a=this.xmax):(s=e+(r-e)*(this.xmin-t)/(n-t),a=this.xmin),i?(t=a,e=s,i=this._regioncode(t,e)):(n=a,r=s,o=this._regioncode(n,r))}}_clipInfinite(t,e,n,r,i,o){let a,s=Array.from(e);if((a=this._project(s[0],s[1],n,r))&&s.unshift(a[0],a[1]),(a=this._project(s[s.length-2],s[s.length-1],i,o))&&s.push(a[0],a[1]),s=this._clipFinite(t,s))for(let u,l=0,c=s.length,f=this._edgecode(s[c-2],s[c-1]);l<c;l+=2)u=f,f=this._edgecode(s[l],s[l+1]),u&&f&&(l=this._edge(t,u,f,s,l),c=s.length);else this.contains(t,(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(t,e,n,r,i){for(;e!==n;){let n,o;switch(e){case 5:e=4;continue;case 4:e=6,n=this.xmax,o=this.ymin;break;case 6:e=2;continue;case 2:e=10,n=this.xmax,o=this.ymax;break;case 10:e=8;continue;case 8:e=9,n=this.xmin,o=this.ymax;break;case 9:e=1;continue;case 1:e=5,n=this.xmin,o=this.ymin}r[i]===n&&r[i+1]===o||!this.contains(t,n,o)||(r.splice(i,0,n,o),i+=2)}if(r.length>4)for(let o=0;o<r.length;o+=2){const t=(o+2)%r.length,e=(o+4)%r.length;(r[o]===r[t]&&r[t]===r[e]||r[o+1]===r[t+1]&&r[t+1]===r[e+1])&&(r.splice(t,2),o-=2)}return i}_project(t,e,n,r){let i,o,a,s=1/0;if(r<0){if(e<=this.ymin)return null;(i=(this.ymin-e)/r)<s&&(a=this.ymin,o=t+(s=i)*n)}else if(r>0){if(e>=this.ymax)return null;(i=(this.ymax-e)/r)<s&&(a=this.ymax,o=t+(s=i)*n)}if(n>0){if(t>=this.xmax)return null;(i=(this.xmax-t)/n)<s&&(o=this.xmax,a=e+(s=i)*r)}else if(n<0){if(t<=this.xmin)return null;(i=(this.xmin-t)/n)<s&&(o=this.xmin,a=e+(s=i)*r)}return[o,a]}_edgecode(t,e){return(t===this.xmin?1:t===this.xmax?2:0)|(e===this.ymin?4:e===this.ymax?8:0)}_regioncode(t,e){return(t<this.xmin?1:t>this.xmax?2:0)|(e<this.ymin?4:e>this.ymax?8:0)}}const YX=2*Math.PI,GX=Math.pow;function VX(t){return t[0]}function JX(t){return t[1]}function ZX(t,e,n){return[t+Math.sin(t+e)*n,e+Math.cos(t-e)*n]}class KX{static from(t,e=VX,n=JX,r){return new KX("length"in t?function(t,e,n,r){const i=t.length,o=new Float64Array(2*i);for(let a=0;a<i;++a){const i=t[a];o[2*a]=e.call(r,i,a,t),o[2*a+1]=n.call(r,i,a,t)}return o}(t,e,n,r):Float64Array.from(function*(t,e,n,r){let i=0;for(const o of t)yield e.call(r,o,i,t),yield n.call(r,o,i,t),++i}(t,e,n,r)))}constructor(t){this._delaunator=new OX(t),this.inedges=new Int32Array(t.length/2),this._hullIndex=new Int32Array(t.length/2),this.points=this._delaunator.coords,this._init()}update(){return this._delaunator.update(),this._init(),this}_init(){const t=this._delaunator,e=this.points;if(t.hull&&t.hull.length>2&&function(t){const{triangles:e,coords:n}=t;for(let r=0;r<e.length;r+=3){const t=2*e[r],i=2*e[r+1],o=2*e[r+2];if((n[o]-n[t])*(n[i+1]-n[t+1])-(n[i]-n[t])*(n[o+1]-n[t+1])>1e-10)return!1}return!0}(t)){this.collinear=Int32Array.from({length:e.length/2},((t,e)=>e)).sort(((t,n)=>e[2*t]-e[2*n]||e[2*t+1]-e[2*n+1]));const t=this.collinear[0],n=this.collinear[this.collinear.length-1],r=[e[2*t],e[2*t+1],e[2*n],e[2*n+1]],i=1e-8*Math.hypot(r[3]-r[1],r[2]-r[0]);for(let o=0,a=e.length/2;o<a;++o){const t=ZX(e[2*o],e[2*o+1],i);e[2*o]=t[0],e[2*o+1]=t[1]}this._delaunator=new OX(e)}else delete this.collinear;const n=this.halfedges=this._delaunator.halfedges,r=this.hull=this._delaunator.hull,i=this.triangles=this._delaunator.triangles,o=this.inedges.fill(-1),a=this._hullIndex.fill(-1);for(let s=0,u=n.length;s<u;++s){const t=i[s%3===2?s-2:s+1];-1!==n[s]&&-1!==o[t]||(o[t]=s)}for(let s=0,u=r.length;s<u;++s)a[r[s]]=s;r.length<=2&&r.length>0&&(this.triangles=new Int32Array(3).fill(-1),this.halfedges=new Int32Array(3).fill(-1),this.triangles[0]=r[0],o[r[0]]=1,2===r.length&&(o[r[1]]=0,this.triangles[1]=r[1],this.triangles[2]=r[1]))}voronoi(t){return new XX(this,t)}*neighbors(t){const{inedges:e,hull:n,_hullIndex:r,halfedges:i,triangles:o,collinear:a}=this;if(a){const e=a.indexOf(t);return e>0&&(yield a[e-1]),void(e<a.length-1&&(yield a[e+1]))}const s=e[t];if(-1===s)return;let u=s,l=-1;do{if(yield l=o[u],u=u%3===2?u-2:u+1,o[u]!==t)return;if(u=i[u],-1===u){const e=n[(r[t]+1)%n.length];return void(e!==l&&(yield e))}}while(u!==s)}find(t,e,n=0){if((t=+t)!==t||(e=+e)!==e)return-1;const r=n;let i;for(;(i=this._step(n,t,e))>=0&&i!==n&&i!==r;)n=i;return i}_step(t,e,n){const{inedges:r,hull:i,_hullIndex:o,halfedges:a,triangles:s,points:u}=this;if(-1===r[t]||!u.length)return(t+1)%(u.length>>1);let l=t,c=GX(e-u[2*t],2)+GX(n-u[2*t+1],2);const f=r[t];let h=f;do{let r=s[h];const f=GX(e-u[2*r],2)+GX(n-u[2*r+1],2);if(f<c&&(c=f,l=r),h=h%3===2?h-2:h+1,s[h]!==t)break;if(h=a[h],-1===h){if(h=i[(o[t]+1)%i.length],h!==r&&GX(e-u[2*h],2)+GX(n-u[2*h+1],2)<c)return h;break}}while(h!==f);return l}render(t){const e=null==t?t=new WX:void 0,{points:n,halfedges:r,triangles:i}=this;for(let o=0,a=r.length;o<a;++o){const e=r[o];if(e<o)continue;const a=2*i[o],s=2*i[e];t.moveTo(n[a],n[a+1]),t.lineTo(n[s],n[s+1])}return this.renderHull(t),e&&e.value()}renderPoints(t,e){void 0!==e||t&&"function"===typeof t.moveTo||(e=t,t=null),e=void 0==e?2:+e;const n=null==t?t=new WX:void 0,{points:r}=this;for(let i=0,o=r.length;i<o;i+=2){const n=r[i],o=r[i+1];t.moveTo(n+e,o),t.arc(n,o,e,0,YX)}return n&&n.value()}renderHull(t){const e=null==t?t=new WX:void 0,{hull:n,points:r}=this,i=2*n[0],o=n.length;t.moveTo(r[i],r[i+1]);for(let a=1;a<o;++a){const e=2*n[a];t.lineTo(r[e],r[e+1])}return t.closePath(),e&&e.value()}hullPolygon(){const t=new HX;return this.renderHull(t),t.value()}renderTriangle(t,e){const n=null==e?e=new WX:void 0,{points:r,triangles:i}=this,o=2*i[t*=3],a=2*i[t+1],s=2*i[t+2];return e.moveTo(r[o],r[o+1]),e.lineTo(r[a],r[a+1]),e.lineTo(r[s],r[s+1]),e.closePath(),n&&n.value()}*trianglePolygons(){const{triangles:t}=this;for(let e=0,n=t.length/3;e<n;++e)yield this.trianglePolygon(e)}trianglePolygon(t){const e=new HX;return this.renderTriangle(t,e),e.value()}}function QX(t){cs.call(this,null,t)}QX.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 tY=[-1e5,-1e5,1e5,1e5];function eY(t){const e=t[0][0],n=t[0][1];let r=t.length-1;for(;t[r][0]===e&&t[r][1]===n;--r);return"M"+t.slice(0,r+1).join("L")+"Z"}(0,Kt.XW)(QX,cs,{transform(t,e){const n=t.as||"path",r=e.source;if(!r||!r.length)return e;let i=t.size;i=i?[0,0,i[0],i[1]]:(i=t.extent)?[i[0][0],i[0][1],i[1][0],i[1][1]]:tY;const o=this.value=KX.from(r,t.x,t.y).voronoi(i);for(let a=0,s=r.length;a<s;++a){const t=o.cellPolygon(a);r[a][n]=t?eY(t):null}return e.reflow(t.modified()).modifies(n)}});var nY=Math.PI/180,rY=64,iY=2048;function oY(){var t,e,n,r,i,o,a,s=[256,256],u=cY,l=[],c=Math.random,f={};function h(t,e,n){for(var r,i,o,a=e.x,l=e.y,f=Math.sqrt(s[0]*s[0]+s[1]*s[1]),h=u(s),d=c()<.5?1:-1,p=-d;(r=h(p+=d))&&(i=~~r[0],o=~~r[1],!(Math.min(Math.abs(i),Math.abs(o))>=f));)if(e.x=a+i,e.y=l+o,!(e.x+e.x0<0||e.y+e.y0<0||e.x+e.x1>s[0]||e.y+e.y1>s[1])&&(!n||!sY(e,t,s[0]))&&(!n||lY(e,n))){for(var g,m=e.sprite,y=e.width>>5,v=s[0]>>5,b=e.x-(y<<4),x=127&b,_=32-x,w=e.y1-e.y0,A=(e.y+e.y0)*v+(b>>5),D=0;D<w;D++){g=0;for(var E=0;E<=y;E++)t[A+E]|=g<<_|(E<y?(g=m[D*y+E])>>>x:0);A+=v}return e.sprite=null,!0}return!1}return f.layout=function(){for(var u=function(t){t.width=t.height=1;var e=Math.sqrt(t.getContext("2d").getImageData(0,0,1,1).data.length>>2);t.width=(rY<<5)/e,t.height=iY/e;var n=t.getContext("2d");return n.fillStyle=n.strokeStyle="red",n.textAlign="center",{context:n,ratio:e}}(Lc()),f=function(t){var e=[],n=-1;for(;++n<t;)e[n]=0;return e}((s[0]>>5)*s[1]),d=null,p=l.length,g=-1,m=[],y=l.map((s=>({text:t(s),font:e(s),style:r(s),weight:i(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(((t,e)=>e.size-t.size));++g<p;){var v=y[g];v.x=s[0]*(c()+.5)>>1,v.y=s[1]*(c()+.5)>>1,aY(u,v,y,g),v.hasText&&h(f,v,d)&&(m.push(v),d?uY(d,v):d=[{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 m},f.words=function(t){return arguments.length?(l=t,f):l},f.size=function(t){return arguments.length?(s=[+t[0],+t[1]],f):s},f.font=function(t){return arguments.length?(e=fY(t),f):e},f.fontStyle=function(t){return arguments.length?(r=fY(t),f):r},f.fontWeight=function(t){return arguments.length?(i=fY(t),f):i},f.rotate=function(t){return arguments.length?(o=fY(t),f):o},f.text=function(e){return arguments.length?(t=fY(e),f):t},f.spiral=function(t){return arguments.length?(u=hY[t]||t,f):u},f.fontSize=function(t){return arguments.length?(n=fY(t),f):n},f.padding=function(t){return arguments.length?(a=fY(t),f):a},f.random=function(t){return arguments.length?(c=t,f):c},f}function aY(t,e,n,r){if(!e.sprite){var i=t.context,o=t.ratio;i.clearRect(0,0,(rY<<5)/o,iY/o);var a,s,u,l,c,f=0,h=0,d=0,p=n.length;for(--r;++r<p;){if(e=n[r],i.save(),i.font=e.style+" "+e.weight+" "+~~((e.size+1)/o)+"px "+e.font,a=i.measureText(e.text+"m").width*o,u=e.size<<1,e.rotate){var g=Math.sin(e.rotate*nY),m=Math.cos(e.rotate*nY),y=a*m,v=a*g,b=u*m,x=u*g;a=Math.max(Math.abs(y+x),Math.abs(y-x))+31>>5<<5,u=~~Math.max(Math.abs(v+b),Math.abs(v-b))}else a=a+31>>5<<5;if(u>d&&(d=u),f+a>=rY<<5&&(f=0,h+=d,d=0),h+u>=iY)break;i.translate((f+(a>>1))/o,(h+(u>>1))/o),e.rotate&&i.rotate(e.rotate*nY),i.fillText(e.text,0,0),e.padding&&(i.lineWidth=2*e.padding,i.strokeText(e.text,0,0)),i.restore(),e.width=a,e.height=u,e.xoff=f,e.yoff=h,e.x1=a>>1,e.y1=u>>1,e.x0=-e.x1,e.y0=-e.y1,e.hasText=!0,f+=a}for(var _=i.getImageData(0,0,(rY<<5)/o,iY/o).data,w=[];--r>=0;)if((e=n[r]).hasText){for(s=(a=e.width)>>5,u=e.y1-e.y0,l=0;l<u*s;l++)w[l]=0;if(null==(f=e.xoff))return;h=e.yoff;var A=0,D=-1;for(c=0;c<u;c++){for(l=0;l<a;l++){var E=s*c+(l>>5),F=_[(h+c)*(rY<<5)+(f+l)<<2]?1<<31-l%32:0;w[E]|=F,A|=F}A?D=c:(e.y0++,u--,c--,h++)}e.y1=e.y0+D,e.sprite=w.slice(0,(e.y1-e.y0)*s)}}}function sY(t,e,n){n>>=5;for(var r,i=t.sprite,o=t.width>>5,a=t.x-(o<<4),s=127&a,u=32-s,l=t.y1-t.y0,c=(t.y+t.y0)*n+(a>>5),f=0;f<l;f++){r=0;for(var h=0;h<=o;h++)if((r<<u|(h<o?(r=i[f*o+h])>>>s:0))&e[c+h])return!0;c+=n}return!1}function uY(t,e){var n=t[0],r=t[1];e.x+e.x0<n.x&&(n.x=e.x+e.x0),e.y+e.y0<n.y&&(n.y=e.y+e.y0),e.x+e.x1>r.x&&(r.x=e.x+e.x1),e.y+e.y1>r.y&&(r.y=e.y+e.y1)}function lY(t,e){return t.x+t.x1>e[0].x&&t.x+t.x0<e[1].x&&t.y+t.y1>e[0].y&&t.y+t.y0<e[1].y}function cY(t){var e=t[0]/t[1];return function(t){return[e*(t*=.1)*Math.cos(t),t*Math.sin(t)]}}function fY(t){return"function"===typeof t?t:function(){return t}}var hY={archimedean:cY,rectangular:function(t){var e=4*t[0]/t[1],n=0,r=0;return function(t){var i=t<0?-1:1;switch(Math.sqrt(1+4*i*t)-i&3){case 0:n+=e;break;case 1:r+=4;break;case 2:n-=e;break;default:r-=4}return[n,r]}}};const dY=["x","y","font","fontSize","fontStyle","fontWeight","angle"],pY=["text","font","rotate","fontSize","fontStyle","fontWeight"];function gY(t){cs.call(this,oY(),t)}gY.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:dY}]},(0,Kt.XW)(gY,cs,{transform(t,e){!t.size||t.size[0]&&t.size[1]||(0,Kt.vU)("Wordcloud size dimensions must be non-zero.");const n=t.modified();if(!(n||e.changed(e.ADD_REM)||pY.some((function(n){const r=t[n];return(0,Kt.mf)(r)&&e.modified(r.fields)}))))return;const r=e.materialize(e.SOURCE).source,i=this.value,o=t.as||dY;let a,s=t.fontSize||14;if((0,Kt.mf)(s)?a=t.fontSizeRange:s=(0,Kt.a9)(s),a){const t=s,e=em("sqrt")().domain((0,Kt.We)(r,t)).range(a);s=n=>e(t(n))}r.forEach((t=>{t[o[0]]=NaN,t[o[1]]=NaN,t[o[3]]=0}));const u=i.words(r).text(t.text).size(t.size||[500,500]).padding(t.padding||1).spiral(t.spiral||"archimedean").rotate(t.rotate||0).font(t.font||"sans-serif").fontStyle(t.fontStyle||"normal").fontWeight(t.fontWeight||"normal").fontSize(s).random(ks).layout(),l=i.size(),c=l[0]>>1,f=l[1]>>1,h=u.length;for(let d,p,g=0;g<h;++g)d=u[g],p=d.datum,p[o[0]]=d.x+c,p[o[1]]=d.y+f,p[o[2]]=d.font,p[o[3]]=d.size,p[o[4]]=d.style,p[o[5]]=d.weight,p[o[6]]=d.rotate;return e.reflow(n).modifies(o)}});const mY=t=>new Uint8Array(t),yY=t=>new Uint16Array(t),vY=t=>new Uint32Array(t);function bY(t,e,n){const r=(e<257?mY:e<65537?yY:vY)(t);return n&&r.set(n),r}function xY(t,e,n){const r=1<<e;return{one:r,zero:~r,range:n.slice(),bisect:t.bisect,index:t.index,size:t.size,onAdd(t,e){const n=this,i=n.bisect(n.range,t.value),o=t.index,a=i[0],s=i[1],u=o.length;let l;for(l=0;l<a;++l)e[o[l]]|=r;for(l=s;l<u;++l)e[o[l]]|=r;return n}}}function _Y(){let t=vY(0),e=[],n=0;return{insert:function(r,i,o){if(!i.length)return[];const a=n,s=i.length,u=vY(s);let l,c,f,h=Array(s);for(f=0;f<s;++f)h[f]=r(i[f]),u[f]=f;if(h=function(t,e){return t.sort.call(e,((e,n)=>{const r=t[e],i=t[n];return r<i?-1:r>i?1:0})),function(t,e){return Array.from(e,(e=>t[e]))}(t,e)}(h,u),a)l=e,c=t,e=Array(a+s),t=vY(a+s),function(t,e,n,r,i,o,a,s,u){let l,c=0,f=0;for(l=0;c<r&&f<a;++l)e[c]<i[f]?(s[l]=e[c],u[l]=n[c++]):(s[l]=i[f],u[l]=o[f++]+t);for(;c<r;++c,++l)s[l]=e[c],u[l]=n[c];for(;f<a;++f,++l)s[l]=i[f],u[l]=o[f]+t}(o,l,c,a,h,u,s,e,t);else{if(o>0)for(f=0;f<s;++f)u[f]+=o;e=h,t=u}return n=a+s,{index:u,value:h}},remove:function(r,i){const o=n;let a,s,u;for(s=0;!i[t[s]]&&s<o;++s);for(u=s;s<o;++s)i[a=t[s]]||(t[u]=a,e[u]=e[s],++u);n=o-r},bisect:function(t,r){let i;return r?i=r.length:(r=e,i=n),[Wc(r,t[0],0,i),qc(r,t[1],0,i)]},reindex:function(e){for(let r=0,i=n;r<i;++r)t[r]=e[t[r]]},index:()=>t,size:()=>n}}function wY(t){cs.call(this,function(){let t=8,e=[],n=vY(0),r=bY(0,t),i=bY(0,t);return{data:()=>e,seen:()=>n=function(t,e,n){return t.length>=e?t:((n=n||new t.constructor(e)).set(t),n)}(n,e.length),add(t){for(let n,r=0,i=e.length,o=t.length;r<o;++r)n=t[r],n._index=i++,e.push(n)},remove(t,n){const o=e.length,a=Array(o-t),s=e;let u,l,c;for(l=0;!n[l]&&l<o;++l)a[l]=e[l],s[l]=l;for(c=l;l<o;++l)u=e[l],n[l]?s[l]=-1:(s[l]=c,r[c]=r[l],i[c]=i[l],a[c]=u,u._index=c++),r[l]=0;return e=a,s},size:()=>e.length,curr:()=>r,prev:()=>i,reset:t=>i[t]=r[t],all:()=>t<257?255:t<65537?65535:4294967295,set(t,e){r[t]|=e},clear(t,e){r[t]&=~e},resize(e,n){(e>r.length||n>t)&&(t=Math.max(n,t),r=bY(e,t,r),i=bY(e,t))}}}(),t),this._indices=null,this._dims=null}function AY(t){cs.call(this,null,t)}function*DY(t,e){if(null==e)for(let n of t)null!=n&&""!==n&&(n=+n)>=n&&(yield n);else{let n=-1;for(let r of t)r=e(r,++n,t),null!=r&&""!==r&&(r=+r)>=r&&(yield r)}}function EY(t,e,n){const r=Float64Array.from(DY(t,n));return r.sort(Dn),e.map((t=>ws(r,t)))}function FY(t,e){return EY(t,[.25,.5,.75],e)}function CY(t,e){const n=t.length,r=As(t,e),i=FY(t,e),o=(i[2]-i[0])/1.34;return 1.06*(Math.min(r,o)||r||Math.abs(i[0])||1)*Math.pow(n,-.2)}function kY(t){const e=t.maxbins||20,n=t.base||10,r=Math.log(n),i=t.divide||[5,2];let o,a,s,u,l,c,f=t.extent[0],h=t.extent[1];const d=t.span||h-f||Math.abs(f)||1;if(t.step)o=t.step;else if(t.steps){for(u=d/e,l=0,c=t.steps.length;l<c&&t.steps[l]<u;++l);o=t.steps[Math.max(0,l-1)]}else{for(a=Math.ceil(Math.log(e)/r),s=t.minstep||0,o=Math.max(s,Math.pow(n,Math.round(Math.log(d)/r)-a));Math.ceil(d/o)>e;)o*=n;for(l=0,c=i.length;l<c;++l)u=o/i[l],u>=s&&d/u<=e&&(o=u)}u=Math.log(o);const p=u>=0?0:1+~~(-u/r),g=Math.pow(n,-p-1);return(t.nice||void 0===t.nice)&&(u=Math.floor(f/o+g)*o,f=f<u?u-o:u,h=Math.ceil(h/o)*o),{start:f,stop:h===f?f+o:h,step:o}}wY.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,Kt.XW)(wY,cs,{transform(t,e){return this._dims?t.modified("fields")||t.fields.some((t=>e.modified(t.fields)))?this.reinit(t,e):this.eval(t,e):this.init(t,e)},init(t,e){const n=t.fields,r=t.query,i=this._indices={},o=this._dims=[],a=r.length;let s,u,l=0;for(;l<a;++l)s=n[l].fname,u=i[s]||(i[s]=_Y()),o.push(xY(u,l,r[l]));return this.eval(t,e)},reinit(t,e){const n=e.materialize().fork(),r=t.fields,i=t.query,o=this._indices,a=this._dims,s=this.value,u=s.curr(),l=s.prev(),c=s.all(),f=n.rem=n.add,h=n.mod,d=i.length,p={};let g,m,y,v,b,x,_,w,A;if(l.set(u),e.rem.length&&(b=this.remove(t,e,n)),e.add.length&&s.add(e.add),e.mod.length)for(x={},v=e.mod,_=0,w=v.length;_<w;++_)x[v[_]._index]=1;for(_=0;_<d;++_)A=r[_],(!a[_]||t.modified("fields",_)||e.modified(A.fields))&&(y=A.fname,(g=p[y])||(o[y]=m=_Y(),p[y]=g=m.insert(A,e.source,0)),a[_]=xY(m,_,i[_]).onAdd(g,u));for(_=0,w=s.data().length;_<w;++_)b[_]||(l[_]!==u[_]?f.push(_):x[_]&&u[_]!==c&&h.push(_));return s.mask=(1<<d)-1,n},eval(t,e){const n=e.materialize().fork(),r=this._dims.length;let i=0;return e.rem.length&&(this.remove(t,e,n),i|=(1<<r)-1),t.modified("query")&&!t.modified("fields")&&(i|=this.update(t,e,n)),e.add.length&&(this.insert(t,e,n),i|=(1<<r)-1),e.mod.length&&(this.modify(e,n),i|=(1<<r)-1),this.value.mask=i,n},insert(t,e,n){const r=e.add,i=this.value,o=this._dims,a=this._indices,s=t.fields,u={},l=n.add,c=i.size()+r.length,f=o.length;let h,d,p,g=i.size();i.resize(c,f),i.add(r);const m=i.curr(),y=i.prev(),v=i.all();for(h=0;h<f;++h)d=s[h].fname,p=u[d]||(u[d]=a[d].insert(s[h],r,g)),o[h].onAdd(p,m);for(;g<c;++g)y[g]=v,m[g]!==v&&l.push(g)},modify(t,e){const n=e.mod,r=this.value,i=r.curr(),o=r.all(),a=t.mod;let s,u,l;for(s=0,u=a.length;s<u;++s)l=a[s]._index,i[l]!==o&&n.push(l)},remove(t,e,n){const r=this._indices,i=this.value,o=i.curr(),a=i.prev(),s=i.all(),u={},l=n.rem,c=e.rem;let f,h,d,p;for(f=0,h=c.length;f<h;++f)d=c[f]._index,u[d]=1,a[d]=p=o[d],o[d]=s,p!==s&&l.push(d);for(d in r)r[d].remove(h,u);return this.reindex(e,h,u),u},reindex(t,e,n){const r=this._indices,i=this.value;t.runAfter((()=>{const t=i.remove(e,n);for(const e in r)r[e].reindex(t)}))},update(t,e,n){const r=this._dims,i=t.query,o=e.stamp,a=r.length;let s,u,l=0;for(n.filters=0,u=0;u<a;++u)t.modified("query",u)&&(s=u,++l);if(1===l)l=r[s].one,this.incrementOne(r[s],i[s],n.add,n.rem);else for(u=0,l=0;u<a;++u)t.modified("query",u)&&(l|=r[u].one,this.incrementAll(r[u],i[u],o,n.add),n.rem=n.add);return l},incrementAll(t,e,n,r){const i=this.value,o=i.seen(),a=i.curr(),s=i.prev(),u=t.index(),l=t.bisect(t.range),c=t.bisect(e),f=c[0],h=c[1],d=l[0],p=l[1],g=t.one;let m,y,v;if(f<d)for(m=f,y=Math.min(d,h);m<y;++m)v=u[m],o[v]!==n&&(s[v]=a[v],o[v]=n,r.push(v)),a[v]^=g;else if(f>d)for(m=d,y=Math.min(f,p);m<y;++m)v=u[m],o[v]!==n&&(s[v]=a[v],o[v]=n,r.push(v)),a[v]^=g;if(h>p)for(m=Math.max(f,p),y=h;m<y;++m)v=u[m],o[v]!==n&&(s[v]=a[v],o[v]=n,r.push(v)),a[v]^=g;else if(h<p)for(m=Math.max(d,h),y=p;m<y;++m)v=u[m],o[v]!==n&&(s[v]=a[v],o[v]=n,r.push(v)),a[v]^=g;t.range=e.slice()},incrementOne(t,e,n,r){const i=this.value.curr(),o=t.index(),a=t.bisect(t.range),s=t.bisect(e),u=s[0],l=s[1],c=a[0],f=a[1],h=t.one;let d,p,g;if(u<c)for(d=u,p=Math.min(c,l);d<p;++d)g=o[d],i[g]^=h,n.push(g);else if(u>c)for(d=c,p=Math.min(u,f);d<p;++d)g=o[d],i[g]^=h,r.push(g);if(l>f)for(d=Math.max(u,f),p=l;d<p;++d)g=o[d],i[g]^=h,n.push(g);else if(l<f)for(d=Math.max(c,l),p=f;d<p;++d)g=o[d],i[g]^=h,r.push(g);t.range=e.slice()}}),AY.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,Kt.XW)(AY,cs,{transform(t,e){const n=~(t.ignore||0),r=t.filter,i=r.mask;if(0===(i&n))return e.StopPropagation;const o=e.fork(e.ALL),a=r.data(),s=r.curr(),u=r.prev(),l=t=>s[t]&n?null:a[t];return o.filter(o.MOD,l),i&i-1?(o.filter(o.ADD,(t=>{const e=s[t]&n;return!e&&e^u[t]&n?a[t]:null})),o.filter(o.REM,(t=>{const e=s[t]&n;return e&&!(e^e^u[t]&n)?a[t]:null}))):(o.filter(o.ADD,l),o.filter(o.REM,(t=>(s[t]&n)===i?a[t]:null))),o.filter(o.SOURCE,(t=>l(t._index)))}});var MY=Math.random;function SY(t){MY=t}function $Y(t,e,n,r){if(!t.length)return[void 0,void 0];const i=Float64Array.from(DY(t,r)),o=i.length,a=e;let s,u,l,c;for(l=0,c=Array(a);l<a;++l){for(s=0,u=0;u<o;++u)s+=i[~~(MY()*o)];c[l]=s/o}return c.sort(Dn),[_s(c,n/2),_s(c,1-n/2)]}function TY(t,e,n,r){r=r||(t=>t);const i=t.length,o=new Float64Array(i);let a,s=0,u=1,l=r(t[0]),c=l,f=l+e;for(;u<i;++u){if(a=r(t[u]),a>=f){for(c=(l+c)/2;s<u;++s)o[s]=c;f=a+e,l=a}c=a}for(c=(l+c)/2;s<u;++s)o[s]=c;return n?function(t,e){const n=t.length;let r,i,o=0,a=1;for(;t[o]===t[a];)++a;for(;a<n;){for(r=a+1;t[a]===t[r];)++r;if(t[a]-t[a-1]<e){for(i=a+(o+r-a-a>>1);i<a;)t[i++]=t[a];for(;i>a;)t[i--]=t[o]}o=a,a=r}return t}(o,e+e/4):o}function BY(t){return function(){return(t=(1103515245*t+12345)%2147483647)/2147483647}}function NY(t,e){let n,r,i;null==e&&(e=t,t=0);const o={min(t){return arguments.length?(n=t||0,i=r-n,o):n},max(t){return arguments.length?(r=t||0,i=r-n,o):r},sample:()=>n+Math.floor(i*MY()),pdf:t=>t===Math.floor(t)&&t>=n&&t<r?1/i:0,cdf(t){const e=Math.floor(t);return e<n?0:e>=r?1:(e-n+1)/i},icdf:t=>t>=0&&t<=1?n-1+Math.floor(t*i):NaN};return o.min(t).max(e)}const OY=Math.sqrt(2*Math.PI),zY=Math.SQRT2;let RY=NaN;function PY(t,e){t=t||0,e=null==e?1:e;let n,r,i=0,o=0;if(RY===RY)i=RY,RY=NaN;else{do{i=2*MY()-1,o=2*MY()-1,n=i*i+o*o}while(0===n||n>1);r=Math.sqrt(-2*Math.log(n)/n),i*=r,RY=o*r}return t+i*e}function UY(t,e,n){const r=(t-(e||0))/(n=null==n?1:n);return Math.exp(-.5*r*r)/(n*OY)}function LY(t,e,n){const r=(t-(e=e||0))/(n=null==n?1:n),i=Math.abs(r);let o;if(i>37)o=0;else{const t=Math.exp(-i*i/2);let e;i<7.07106781186547?(e=.0352624965998911*i+.700383064443688,e=e*i+6.37396220353165,e=e*i+33.912866078383,e=e*i+112.079291497871,e=e*i+221.213596169931,e=e*i+220.206867912376,o=t*e,e=.0883883476483184*i+1.75566716318264,e=e*i+16.064177579207,e=e*i+86.7807322029461,e=e*i+296.564248779674,e=e*i+637.333633378831,e=e*i+793.826512519948,e=e*i+440.413735824752,o/=e):(e=i+.65,e=i+4/e,e=i+3/e,e=i+2/e,e=i+1/e,o=t/e/2.506628274631)}return r>0?1-o:o}function jY(t,e,n){return t<0||t>1?NaN:(e||0)+(null==n?1:n)*zY*function(t){let e,n=-Math.log((1-t)*(1+t));n<6.25?(n-=3.125,e=-364441206401782e-35,e=e*n-16850591381820166e-35,e=128584807152564e-32+e*n,e=11157877678025181e-33+e*n,e=e*n-1333171662854621e-31,e=20972767875968562e-33+e*n,e=6637638134358324e-30+e*n,e=e*n-4054566272975207e-29,e=e*n-8151934197605472e-29,e=26335093153082323e-28+e*n,e=e*n-12975133253453532e-27,e=e*n-5415412054294628e-26,e=1.0512122733215323e-9+e*n,e=e*n-4.112633980346984e-9,e=e*n-2.9070369957882005e-8,e=4.2347877827932404e-7+e*n,e=e*n-13654692000834679e-22,e=e*n-13882523362786469e-21,e=.00018673420803405714+e*n,e=e*n-.000740702534166267,e=e*n-.006033670871430149,e=.24015818242558962+e*n,e=1.6536545626831027+e*n):n<16?(n=Math.sqrt(n)-3.25,e=2.2137376921775787e-9,e=9.075656193888539e-8+e*n,e=e*n-2.7517406297064545e-7,e=1.8239629214389228e-8+e*n,e=15027403968909828e-22+e*n,e=e*n-4013867526981546e-21,e=29234449089955446e-22+e*n,e=12475304481671779e-21+e*n,e=e*n-47318229009055734e-21,e=6828485145957318e-20+e*n,e=24031110387097894e-21+e*n,e=e*n-.0003550375203628475,e=.0009532893797373805+e*n,e=e*n-.0016882755560235047,e=.002491442096107851+e*n,e=e*n-.003751208507569241,e=.005370914553590064+e*n,e=1.0052589676941592+e*n,e=3.0838856104922208+e*n):Number.isFinite(n)?(n=Math.sqrt(n)-5,e=-27109920616438573e-27,e=e*n-2.555641816996525e-10,e=1.5076572693500548e-9+e*n,e=e*n-3.789465440126737e-9,e=7.61570120807834e-9+e*n,e=e*n-1.496002662714924e-8,e=2.914795345090108e-8+e*n,e=e*n-6.771199775845234e-8,e=2.2900482228026655e-7+e*n,e=e*n-9.9298272942317e-7,e=4526062597223154e-21+e*n,e=e*n-1968177810553167e-20,e=7599527703001776e-20+e*n,e=e*n-.00021503011930044477,e=e*n-.00013871931833623122,e=1.0103004648645344+e*n,e=4.849906401408584+e*n):e=1/0;return e*t}(2*t-1)}function IY(t,e){let n,r;const i={mean(t){return arguments.length?(n=t||0,i):n},stdev(t){return arguments.length?(r=null==t?1:t,i):r},sample:()=>PY(n,r),pdf:t=>UY(t,n,r),cdf:t=>LY(t,n,r),icdf:t=>jY(t,n,r)};return i.mean(t).stdev(e)}function qY(t,e){const n=IY();let r=0;const i={data(n){return arguments.length?(t=n,r=n?n.length:0,i.bandwidth(e)):t},bandwidth(n){return arguments.length?(!(e=n)&&t&&(e=CY(t)),i):e},sample:()=>t[~~(MY()*r)]+e*n.sample(),pdf(i){let o=0,a=0;for(;a<r;++a)o+=n.pdf((i-t[a])/e);return o/e/r},cdf(i){let o=0,a=0;for(;a<r;++a)o+=n.cdf((i-t[a])/e);return o/r},icdf(){throw Error("KDE icdf not supported.")}};return i.data(t)}function WY(t,e){return t=t||0,e=null==e?1:e,Math.exp(t+PY()*e)}function HY(t,e,n){if(t<=0)return 0;e=e||0,n=null==n?1:n;const r=(Math.log(t)-e)/n;return Math.exp(-.5*r*r)/(n*OY*t)}function XY(t,e,n){return LY(Math.log(t),e,n)}function YY(t,e,n){return Math.exp(jY(t,e,n))}function GY(t,e){let n,r;const i={mean(t){return arguments.length?(n=t||0,i):n},stdev(t){return arguments.length?(r=null==t?1:t,i):r},sample:()=>WY(n,r),pdf:t=>HY(t,n,r),cdf:t=>XY(t,n,r),icdf:t=>YY(t,n,r)};return i.mean(t).stdev(e)}function VY(t,e){let n,r=0;const i={weights(t){return arguments.length?(n=function(t){const e=[];let n,i=0;for(n=0;n<r;++n)i+=e[n]=null==t[n]?1:+t[n];for(n=0;n<r;++n)e[n]/=i;return e}(e=t||[]),i):e},distributions(n){return arguments.length?(n?(r=n.length,t=n):(r=0,t=[]),i.weights(e)):t},sample(){const e=MY();let i=t[r-1],o=n[0],a=0;for(;a<r-1;o+=n[++a])if(e<o){i=t[a];break}return i.sample()},pdf(e){let i=0,o=0;for(;o<r;++o)i+=n[o]*t[o].pdf(e);return i},cdf(e){let i=0,o=0;for(;o<r;++o)i+=n[o]*t[o].cdf(e);return i},icdf(){throw Error("Mixture icdf not supported.")}};return i.distributions(t).weights(e)}function JY(t,e){return null==e&&(e=null==t?1:t,t=0),t+(e-t)*MY()}function ZY(t,e,n){return null==n&&(n=null==e?1:e,e=0),t>=e&&t<=n?1/(n-e):0}function KY(t,e,n){return null==n&&(n=null==e?1:e,e=0),t<e?0:t>n?1:(t-e)/(n-e)}function QY(t,e,n){return null==n&&(n=null==e?1:e,e=0),t>=0&&t<=1?e+t*(n-e):NaN}function tG(t,e){let n,r;const i={min(t){return arguments.length?(n=t||0,i):n},max(t){return arguments.length?(r=null==t?1:t,i):r},sample:()=>JY(n,r),pdf:t=>ZY(t,n,r),cdf:t=>KY(t,n,r),icdf:t=>QY(t,n,r)};return null==e&&(e=null==t?1:t,t=0),i.min(t).max(e)}function eG(t,e,n){let r=0,i=0;for(const o of t){const t=n(o);null==e(o)||null==t||isNaN(t)||(r+=(t-r)/++i)}return{coef:[r],predict:()=>r,rSquared:0}}function nG(t,e,n,r){const i=r-t*t,o=Math.abs(i)<1e-24?0:(n-t*e)/i;return[e-o*t,o]}function rG(t,e,n,r){t=t.filter((t=>{let r=e(t),i=n(t);return null!=r&&(r=+r)>=r&&null!=i&&(i=+i)>=i})),r&&t.sort(((t,n)=>e(t)-e(n)));const i=t.length,o=new Float64Array(i),a=new Float64Array(i);let s,u,l,c=0,f=0,h=0;for(l of t)o[c]=s=+e(l),a[c]=u=+n(l),++c,f+=(s-f)/c,h+=(u-h)/c;for(c=0;c<i;++c)o[c]-=f,a[c]-=h;return[o,a,f,h]}function iG(t,e,n,r){let i,o,a=-1;for(const s of t)i=e(s),o=n(s),null!=i&&(i=+i)>=i&&null!=o&&(o=+o)>=o&&r(i,o,++a)}function oG(t,e,n,r,i){let o=0,a=0;return iG(t,e,n,((t,e)=>{const n=e-i(t),s=e-r;o+=n*n,a+=s*s})),1-o/a}function aG(t,e,n){let r=0,i=0,o=0,a=0,s=0;iG(t,e,n,((t,e)=>{++s,r+=(t-r)/s,i+=(e-i)/s,o+=(t*e-o)/s,a+=(t*t-a)/s}));const u=nG(r,i,o,a),l=t=>u[0]+u[1]*t;return{coef:u,predict:l,rSquared:oG(t,e,n,i,l)}}function sG(t,e,n){let r=0,i=0,o=0,a=0,s=0;iG(t,e,n,((t,e)=>{++s,t=Math.log(t),r+=(t-r)/s,i+=(e-i)/s,o+=(t*e-o)/s,a+=(t*t-a)/s}));const u=nG(r,i,o,a),l=t=>u[0]+u[1]*Math.log(t);return{coef:u,predict:l,rSquared:oG(t,e,n,i,l)}}function uG(t,e,n){const[r,i,o,a]=rG(t,e,n);let s,u,l,c=0,f=0,h=0,d=0,p=0;iG(t,e,n,((t,e)=>{s=r[p++],u=Math.log(e),l=s*e,c+=(e*u-c)/p,f+=(l-f)/p,h+=(l*u-h)/p,d+=(s*l-d)/p}));const[g,m]=nG(f/a,c/a,h/a,d/a),y=t=>Math.exp(g+m*(t-o));return{coef:[Math.exp(g-m*o),m],predict:y,rSquared:oG(t,e,n,a,y)}}function lG(t,e,n){let r=0,i=0,o=0,a=0,s=0,u=0;iG(t,e,n,((t,e)=>{const n=Math.log(t),l=Math.log(e);++u,r+=(n-r)/u,i+=(l-i)/u,o+=(n*l-o)/u,a+=(n*n-a)/u,s+=(e-s)/u}));const l=nG(r,i,o,a),c=t=>l[0]*Math.pow(t,l[1]);return l[0]=Math.exp(l[0]),{coef:l,predict:c,rSquared:oG(t,e,n,s,c)}}function cG(t,e,n){const[r,i,o,a]=rG(t,e,n),s=r.length;let u,l,c,f,h=0,d=0,p=0,g=0,m=0;for(u=0;u<s;)l=r[u],c=i[u++],f=l*l,h+=(f-h)/u,d+=(f*l-d)/u,p+=(f*f-p)/u,g+=(l*c-g)/u,m+=(f*c-m)/u;const y=p-h*h,v=h*y-d*d,b=(m*h-g*d)/v,x=(g*y-m*d)/v,_=-b*h,w=t=>b*(t-=o)*t+x*t+_+a;return{coef:[_-x*o+b*o*o+a,x-2*b*o,b],predict:w,rSquared:oG(t,e,n,a,w)}}function fG(t,e,n,r){if(0===r)return eG(t,e,n);if(1===r)return aG(t,e,n);if(2===r)return cG(t,e,n);const[i,o,a,s]=rG(t,e,n),u=i.length,l=[],c=[],f=r+1;let h,d,p,g,m;for(h=0;h<f;++h){for(p=0,g=0;p<u;++p)g+=Math.pow(i[p],h)*o[p];for(l.push(g),m=new Float64Array(f),d=0;d<f;++d){for(p=0,g=0;p<u;++p)g+=Math.pow(i[p],h+d);m[d]=g}c.push(m)}c.push(l);const y=function(t){const e=t.length-1,n=[];let r,i,o,a,s;for(r=0;r<e;++r){for(a=r,i=r+1;i<e;++i)Math.abs(t[r][i])>Math.abs(t[r][a])&&(a=i);for(o=r;o<e+1;++o)s=t[o][r],t[o][r]=t[o][a],t[o][a]=s;for(i=r+1;i<e;++i)for(o=e;o>=r;o--)t[o][i]-=t[o][r]*t[r][i]/t[r][r]}for(i=e-1;i>=0;--i){for(s=0,o=i+1;o<e;++o)s+=t[o][i]*n[o];n[i]=(t[e][i]-s)/t[i][i]}return n}(c),v=t=>{t-=a;let e=s+y[0]+y[1]*t+y[2]*t*t;for(h=3;h<f;++h)e+=y[h]*Math.pow(t,h);return e};return{coef:hG(f,y,-a,s),predict:v,rSquared:oG(t,e,n,s,v)}}function hG(t,e,n,r){const i=Array(t);let o,a,s,u;for(o=0;o<t;++o)i[o]=0;for(o=t-1;o>=0;--o)for(s=e[o],u=1,i[o]+=s,a=1;a<=o;++a)u*=(o+1-a)/a,i[o-a]+=s*Math.pow(n,a)*u;return i[0]+=r,i}const dG=2,pG=1e-12;function gG(t,e,n,r){const[i,o,a,s]=rG(t,e,n,!0),u=i.length,l=Math.max(2,~~(r*u)),c=new Float64Array(u),f=new Float64Array(u),h=new Float64Array(u).fill(1);for(let d=-1;++d<=dG;){const t=[0,l-1];for(let n=0;n<u;++n){const e=i[n],r=t[0],a=t[1],s=e-i[r]>i[a]-e?r:a;let u=0,l=0,d=0,p=0,g=0;const m=1/Math.abs(i[s]-e||1);for(let t=r;t<=a;++t){const n=i[t],r=o[t],a=mG(Math.abs(e-n)*m)*h[t],s=n*a;u+=a,l+=s,d+=r*a,p+=r*s,g+=n*s}const[y,v]=nG(l/u,d/u,p/u,g/u);c[n]=y+v*e,f[n]=Math.abs(o[n]-c[n]),yG(i,n+1,t)}if(d===dG)break;const e=Js(f);if(Math.abs(e)<pG)break;for(let n,r,i=0;i<u;++i)n=f[i]/(6*e),h[i]=n>=1?pG:(r=1-n*n)*r}return function(t,e,n,r){const i=t.length,o=[];let a,s=0,u=0,l=[];for(;s<i;++s)a=t[s]+n,l[0]===a?l[1]+=(e[s]-l[1])/++u:(u=0,l[1]+=r,l=[a,e[s]],o.push(l));return l[1]+=r,o}(i,c,a,s)}function mG(t){return(t=1-t*t*t)*t*t}function yG(t,e,n){const r=t[e];let i=n[0],o=n[1]+1;if(!(o>=t.length))for(;e>i&&t[o]-r<=r-t[i];)n[0]=++i,n[1]=o,++o}const vG=.5*Math.PI/180;function bG(t,e,n,r){n=n||25,r=Math.max(n,r||200);const i=e=>[e,t(e)],o=e[0],a=e[1],s=a-o,u=s/r,l=[i(o)],c=[];if(n===r){for(let t=1;t<r;++t)l.push(i(o+t/n*s));return l.push(i(a)),l}c.push(i(a));for(let g=n;--g>0;)c.push(i(o+g/n*s));let f=l[0],h=c[c.length-1];const d=1/s,p=function(t,e){let n=t,r=t;const i=e.length;for(let o=0;o<i;++o){const t=e[o][1];t<n&&(n=t),t>r&&(r=t)}return 1/(r-n)}(f[1],c);for(;h;){const t=i((f[0]+h[0])/2);t[0]-f[0]>=u&&xG(f,t,h,d,p)>vG?c.push(t):(f=h,l.push(h),c.pop()),h=c[c.length-1]}return l}function xG(t,e,n,r,i){const o=Math.atan2(i*(n[1]-t[1]),r*(n[0]-t[0])),a=Math.atan2(i*(e[1]-t[1]),r*(e[0]-t[0]));return Math.abs(o-a)}const _G="Literal",wG="Property",AG="ArrayExpression",DG="BinaryExpression",EG="CallExpression",FG="ConditionalExpression",CG="LogicalExpression",kG="MemberExpression",MG="ObjectExpression",SG="UnaryExpression";function $G(t){this.type=t}var TG,BG,NG,OG,zG;$G.prototype.visit=function(t){let e,n,r;if(t(this))return 1;for(e=function(t){switch(t.type){case AG:return t.elements;case DG:case CG:return[t.left,t.right];case EG:return[t.callee].concat(t.arguments);case FG:return[t.test,t.consequent,t.alternate];case kG:return[t.object,t.property];case MG:return t.properties;case wG:return[t.key,t.value];case SG:return[t.argument];default:return[]}}(this),n=0,r=e.length;n<r;++n)if(e[n].visit(t))return 1};var RG=1,PG=2,UG=3,LG=4,jG=5,IG=6,qG=7,WG=8;(TG={})[RG]="Boolean",TG[PG]="<end>",TG[UG]="Identifier",TG[LG]="Keyword",TG[jG]="Null",TG[IG]="Numeric",TG[qG]="Punctuator",TG[WG]="String",TG[9]="RegularExpression";var HG="ArrayExpression",XG="BinaryExpression",YG="CallExpression",GG="ConditionalExpression",VG="Identifier",JG="Literal",ZG="LogicalExpression",KG="MemberExpression",QG="ObjectExpression",tV="Property",eV="UnaryExpression",nV="Unexpected token %0",rV="Unexpected number",iV="Unexpected string",oV="Unexpected identifier",aV="Unexpected reserved word",sV="Unexpected end of input",uV="Invalid regular expression",lV="Invalid regular expression: missing /",cV="Octal literals are not allowed in strict mode.",fV="Duplicate data property in object literal not allowed in strict mode",hV="ILLEGAL",dV="Disabled.",pV=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]"),gV=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 mV(t,e){if(!t)throw new Error("ASSERT: "+e)}function yV(t){return t>=48&&t<=57}function vV(t){return"0123456789abcdefABCDEF".indexOf(t)>=0}function bV(t){return"01234567".indexOf(t)>=0}function xV(t){return 32===t||9===t||11===t||12===t||160===t||t>=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].indexOf(t)>=0}function _V(t){return 10===t||13===t||8232===t||8233===t}function wV(t){return 36===t||95===t||t>=65&&t<=90||t>=97&&t<=122||92===t||t>=128&&pV.test(String.fromCharCode(t))}function AV(t){return 36===t||95===t||t>=65&&t<=90||t>=97&&t<=122||t>=48&&t<=57||92===t||t>=128&&gV.test(String.fromCharCode(t))}const DV={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 EV(){for(;NG<OG;){const t=BG.charCodeAt(NG);if(!xV(t)&&!_V(t))break;++NG}}function FV(t){var e,n,r,i=0;for(n="u"===t?4:2,e=0;e<n;++e)NG<OG&&vV(BG[NG])?(r=BG[NG++],i=16*i+"0123456789abcdef".indexOf(r.toLowerCase())):IV({},nV,hV);return String.fromCharCode(i)}function CV(){var t,e,n,r;for(e=0,"}"===(t=BG[NG])&&IV({},nV,hV);NG<OG&&vV(t=BG[NG++]);)e=16*e+"0123456789abcdef".indexOf(t.toLowerCase());return(e>1114111||"}"!==t)&&IV({},nV,hV),e<=65535?String.fromCharCode(e):(n=55296+(e-65536>>10),r=56320+(e-65536&1023),String.fromCharCode(n,r))}function kV(){var t,e;for(t=BG.charCodeAt(NG++),e=String.fromCharCode(t),92===t&&(117!==BG.charCodeAt(NG)&&IV({},nV,hV),++NG,(t=FV("u"))&&"\\"!==t&&wV(t.charCodeAt(0))||IV({},nV,hV),e=t);NG<OG&&AV(t=BG.charCodeAt(NG));)++NG,e+=String.fromCharCode(t),92===t&&(e=e.substr(0,e.length-1),117!==BG.charCodeAt(NG)&&IV({},nV,hV),++NG,(t=FV("u"))&&"\\"!==t&&AV(t.charCodeAt(0))||IV({},nV,hV),e+=t);return e}function MV(){var t,e;return t=NG,e=92===BG.charCodeAt(NG)?kV():function(){var t,e;for(t=NG++;NG<OG;){if(92===(e=BG.charCodeAt(NG)))return NG=t,kV();if(!AV(e))break;++NG}return BG.slice(t,NG)}(),{type:1===e.length?UG:DV.hasOwnProperty(e)?LG:"null"===e?jG:"true"===e||"false"===e?RG:UG,value:e,start:t,end:NG}}function SV(){var t,e,n,r,i=NG,o=BG.charCodeAt(NG),a=BG[NG];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++NG,{type:qG,value:String.fromCharCode(o),start:i,end:NG};default:if(61===(t=BG.charCodeAt(NG+1)))switch(o){case 43:case 45:case 47:case 60:case 62:case 94:case 124:case 37:case 38:case 42:return NG+=2,{type:qG,value:String.fromCharCode(o)+String.fromCharCode(t),start:i,end:NG};case 33:case 61:return NG+=2,61===BG.charCodeAt(NG)&&++NG,{type:qG,value:BG.slice(i,NG),start:i,end:NG}}}return">>>="===(r=BG.substr(NG,4))?{type:qG,value:r,start:i,end:NG+=4}:">>>"===(n=r.substr(0,3))||"<<="===n||">>="===n?{type:qG,value:n,start:i,end:NG+=3}:a===(e=n.substr(0,2))[1]&&"+-<>&|".indexOf(a)>=0||"=>"===e?{type:qG,value:e,start:i,end:NG+=2}:("//"===e&&IV({},nV,hV),"<>=!+-*%&|^/".indexOf(a)>=0?(++NG,{type:qG,value:a,start:i,end:NG}):void IV({},nV,hV))}function $V(){var t,e,n;if(mV(yV((n=BG[NG]).charCodeAt(0))||"."===n,"Numeric literal must start with a decimal digit or a decimal point"),e=NG,t="","."!==n){if(t=BG[NG++],n=BG[NG],"0"===t){if("x"===n||"X"===n)return++NG,function(t){let e="";for(;NG<OG&&vV(BG[NG]);)e+=BG[NG++];return 0===e.length&&IV({},nV,hV),wV(BG.charCodeAt(NG))&&IV({},nV,hV),{type:IG,value:parseInt("0x"+e,16),start:t,end:NG}}(e);if(bV(n))return function(t){let e="0"+BG[NG++];for(;NG<OG&&bV(BG[NG]);)e+=BG[NG++];return(wV(BG.charCodeAt(NG))||yV(BG.charCodeAt(NG)))&&IV({},nV,hV),{type:IG,value:parseInt(e,8),octal:!0,start:t,end:NG}}(e);n&&yV(n.charCodeAt(0))&&IV({},nV,hV)}for(;yV(BG.charCodeAt(NG));)t+=BG[NG++];n=BG[NG]}if("."===n){for(t+=BG[NG++];yV(BG.charCodeAt(NG));)t+=BG[NG++];n=BG[NG]}if("e"===n||"E"===n)if(t+=BG[NG++],"+"!==(n=BG[NG])&&"-"!==n||(t+=BG[NG++]),yV(BG.charCodeAt(NG)))for(;yV(BG.charCodeAt(NG));)t+=BG[NG++];else IV({},nV,hV);return wV(BG.charCodeAt(NG))&&IV({},nV,hV),{type:IG,value:parseFloat(t),start:e,end:NG}}function TV(){var t,e,n,r;return zG=null,EV(),t=NG,e=function(){var t,e,n,r;for(mV("/"===(t=BG[NG]),"Regular expression literal must start with a slash"),e=BG[NG++],n=!1,r=!1;NG<OG;)if(e+=t=BG[NG++],"\\"===t)_V((t=BG[NG++]).charCodeAt(0))&&IV({},lV),e+=t;else if(_V(t.charCodeAt(0)))IV({},lV);else if(n)"]"===t&&(n=!1);else{if("/"===t){r=!0;break}"["===t&&(n=!0)}return r||IV({},lV),{value:e.substr(1,e.length-2),literal:e}}(),n=function(){var t,e,n;for(e="",n="";NG<OG&&AV((t=BG[NG]).charCodeAt(0));)++NG,"\\"===t&&NG<OG?IV({},nV,hV):(n+=t,e+=t);return n.search(/[^gimuy]/g)>=0&&IV({},uV,n),{value:n,literal:e}}(),r=function(t,e){let n=t;e.indexOf("u")>=0&&(n=n.replace(/\\u\{([0-9a-fA-F]+)\}/g,((t,e)=>{if(parseInt(e,16)<=1114111)return"x";IV({},uV)})).replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"x"));try{new RegExp(n)}catch(r){IV({},uV)}try{return new RegExp(t,e)}catch(i){return null}}(e.value,n.value),{literal:e.literal+n.literal,value:r,regex:{pattern:e.value,flags:n.value},start:t,end:NG}}function BV(){if(EV(),NG>=OG)return{type:PG,start:NG,end:NG};const t=BG.charCodeAt(NG);return wV(t)?MV():40===t||41===t||59===t?SV():39===t||34===t?function(){var t,e,n,r,i="",o=!1;for(mV("'"===(t=BG[NG])||'"'===t,"String literal must starts with a quote"),e=NG,++NG;NG<OG;){if((n=BG[NG++])===t){t="";break}if("\\"===n)if((n=BG[NG++])&&_V(n.charCodeAt(0)))"\r"===n&&"\n"===BG[NG]&&++NG;else switch(n){case"u":case"x":"{"===BG[NG]?(++NG,i+=CV()):i+=FV(n);break;case"n":i+="\n";break;case"r":i+="\r";break;case"t":i+="\t";break;case"b":i+="\b";break;case"f":i+="\f";break;case"v":i+="\v";break;default:bV(n)?(0!==(r="01234567".indexOf(n))&&(o=!0),NG<OG&&bV(BG[NG])&&(o=!0,r=8*r+"01234567".indexOf(BG[NG++]),"0123".indexOf(n)>=0&&NG<OG&&bV(BG[NG])&&(r=8*r+"01234567".indexOf(BG[NG++]))),i+=String.fromCharCode(r)):i+=n}else{if(_V(n.charCodeAt(0)))break;i+=n}}return""!==t&&IV({},nV,hV),{type:WG,value:i,octal:o,start:e,end:NG}}():46===t?yV(BG.charCodeAt(NG+1))?$V():SV():yV(t)?$V():SV()}function NV(){const t=zG;return NG=t.end,zG=BV(),NG=t.end,t}function OV(){const t=NG;zG=BV(),NG=t}function zV(t,e,n){const r=new $G("||"===t||"&&"===t?ZG:XG);return r.operator=t,r.left=e,r.right=n,r}function RV(t,e){const n=new $G(YG);return n.callee=t,n.arguments=e,n}function PV(t){const e=new $G(VG);return e.name=t,e}function UV(t){const e=new $G(JG);return e.value=t.value,e.raw=BG.slice(t.start,t.end),t.regex&&("//"===e.raw&&(e.raw="/(?:)/"),e.regex=t.regex),e}function LV(t,e,n){const r=new $G(KG);return r.computed="["===t,r.object=e,r.property=n,r.computed||(n.member=!0),r}function jV(t,e,n){const r=new $G(tV);return r.key=e,r.value=n,r.kind=t,r}function IV(t,e){var n,r=Array.prototype.slice.call(arguments,2),i=e.replace(/%(\d)/g,((t,e)=>(mV(e<r.length,"Message reference must be in range"),r[e])));throw(n=new Error(i)).index=NG,n.description=i,n}function qV(t){t.type===PG&&IV(t,sV),t.type===IG&&IV(t,rV),t.type===WG&&IV(t,iV),t.type===UG&&IV(t,oV),t.type===LG&&IV(t,aV),IV(t,nV,t.value)}function WV(t){const e=NV();e.type===qG&&e.value===t||qV(e)}function HV(t){return zG.type===qG&&zG.value===t}function XV(t){return zG.type===LG&&zG.value===t}function YV(){const t=[];for(NG=zG.start,WV("[");!HV("]");)HV(",")?(NV(),t.push(null)):(t.push(oJ()),HV("]")||WV(","));return NV(),function(t){const e=new $G(HG);return e.elements=t,e}(t)}function GV(){NG=zG.start;const t=NV();return t.type===WG||t.type===IG?(t.octal&&IV(t,cV),UV(t)):PV(t.value)}function VV(){var t,e,n;return NG=zG.start,(t=zG).type===UG?(n=GV(),WV(":"),jV("init",n,oJ())):t.type!==PG&&t.type!==qG?(e=GV(),WV(":"),jV("init",e,oJ())):void qV(t)}function JV(){var t,e,n=[],r={},i=String;for(NG=zG.start,WV("{");!HV("}");)e="$"+((t=VV()).key.type===VG?t.key.name:i(t.key.value)),Object.prototype.hasOwnProperty.call(r,e)?IV({},fV):r[e]=!0,n.push(t),HV("}")||WV(",");return WV("}"),function(t){const e=new $G(QG);return e.properties=t,e}(n)}const ZV={if:1};function KV(){var t,e,n;if(HV("("))return function(){WV("(");const t=aJ();return WV(")"),t}();if(HV("["))return YV();if(HV("{"))return JV();if(t=zG.type,NG=zG.start,t===UG||ZV[zG.value])n=PV(NV().value);else if(t===WG||t===IG)zG.octal&&IV(zG,cV),n=UV(NV());else{if(t===LG)throw new Error(dV);t===RG?((e=NV()).value="true"===e.value,n=UV(e)):t===jG?((e=NV()).value=null,n=UV(e)):HV("/")||HV("/=")?(n=UV(TV()),OV()):qV(NV())}return n}function QV(){const t=[];if(WV("("),!HV(")"))for(;NG<OG&&(t.push(oJ()),!HV(")"));)WV(",");return WV(")"),t}function tJ(){NG=zG.start;const t=NV();return function(t){return t.type===UG||t.type===LG||t.type===RG||t.type===jG}(t)||qV(t),PV(t.value)}function eJ(){WV("[");const t=aJ();return WV("]"),t}function nJ(){const t=function(){var t;for(t=KV();;)if(HV("."))WV("."),t=LV(".",t,tJ());else if(HV("("))t=RV(t,QV());else{if(!HV("["))break;t=LV("[",t,eJ())}return t}();if(zG.type===qG&&(HV("++")||HV("--")))throw new Error(dV);return t}function rJ(){var t,e;if(zG.type!==qG&&zG.type!==LG)e=nJ();else{if(HV("++")||HV("--"))throw new Error(dV);if(HV("+")||HV("-")||HV("~")||HV("!"))t=NV(),e=rJ(),e=function(t,e){const n=new $G(eV);return n.operator=t,n.argument=e,n.prefix=!0,n}(t.value,e);else{if(XV("delete")||XV("void")||XV("typeof"))throw new Error(dV);e=nJ()}}return e}function iJ(t){let e=0;if(t.type!==qG&&t.type!==LG)return 0;switch(t.value){case"||":e=1;break;case"&&":e=2;break;case"|":e=3;break;case"^":e=4;break;case"&":e=5;break;case"==":case"!=":case"===":case"!==":e=6;break;case"<":case">":case"<=":case">=":case"instanceof":case"in":e=7;break;case"<<":case">>":case">>>":e=8;break;case"+":case"-":e=9;break;case"*":case"/":case"%":e=11}return e}function oJ(){var t,e;return t=function(){var t,e,n,r,i,o,a,s,u,l;if(t=zG,u=rJ(),0===(i=iJ(r=zG)))return u;for(r.prec=i,NV(),e=[t,zG],o=[u,r,a=rJ()];(i=iJ(zG))>0;){for(;o.length>2&&i<=o[o.length-2].prec;)a=o.pop(),s=o.pop().value,u=o.pop(),e.pop(),n=zV(s,u,a),o.push(n);(r=NV()).prec=i,o.push(r),e.push(zG),n=rJ(),o.push(n)}for(n=o[l=o.length-1],e.pop();l>1;)e.pop(),n=zV(o[l-1].value,o[l-2],n),l-=2;return n}(),HV("?")&&(NV(),e=oJ(),WV(":"),t=function(t,e,n){const r=new $G(GG);return r.test=t,r.consequent=e,r.alternate=n,r}(t,e,oJ())),t}function aJ(){const t=oJ();if(HV(","))throw new Error(dV);return t}var sJ={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 uJ(t){function e(e,n,r){return i=>function(e,n,r,i){let o=t(n[0]);return r&&(o=r+"("+o+")",0===r.lastIndexOf("new ",0)&&(o="("+o+")")),o+"."+e+(i<0?"":0===i?"()":"("+n.slice(1).map(t).join(",")+")")}(e,i,n,r)}const n="new Date",r="String",i="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",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(e){e.length<3&&(0,Kt.vU)("Missing arguments to clamp function."),e.length>3&&(0,Kt.vU)("Too many arguments to clamp function.");const n=e.map(t);return"Math.max("+n[1]+", Math.min("+n[2]+","+n[0]+"))"},now:"Date.now",utc:"Date.UTC",datetime:n,date:e("getDate",n,0),day:e("getDay",n,0),year:e("getFullYear",n,0),month:e("getMonth",n,0),hours:e("getHours",n,0),minutes:e("getMinutes",n,0),seconds:e("getSeconds",n,0),milliseconds:e("getMilliseconds",n,0),time:e("getTime",n,0),timezoneoffset:e("getTimezoneOffset",n,0),utcdate:e("getUTCDate",n,0),utcday:e("getUTCDay",n,0),utcyear:e("getUTCFullYear",n,0),utcmonth:e("getUTCMonth",n,0),utchours:e("getUTCHours",n,0),utcminutes:e("getUTCMinutes",n,0),utcseconds:e("getUTCSeconds",n,0),utcmilliseconds:e("getUTCMilliseconds",n,0),length:e("length",null,-1),parseFloat:"parseFloat",parseInt:"parseInt",upper:e("toUpperCase",r,0),lower:e("toLowerCase",r,0),substring:e("substring",r),split:e("split",r),trim:e("trim",r,0),regexp:i,test:e("test",i),if:function(e){e.length<3&&(0,Kt.vU)("Missing arguments to if function."),e.length>3&&(0,Kt.vU)("Too many arguments to if function.");const n=e.map(t);return"("+n[0]+"?"+n[1]+":"+n[2]+")"}}}var lJ,cJ,fJ,hJ,dJ,pJ,gJ,mJ,yJ,vJ,bJ,xJ,_J,wJ,AJ,DJ,EJ=new OA,FJ=new OA,CJ={point:oD,lineStart:oD,lineEnd:oD,polygonStart:function(){EJ=new OA,CJ.lineStart=kJ,CJ.lineEnd=MJ},polygonEnd:function(){var t=+EJ;FJ.add(t<0?jA+t:t),this.lineStart=this.lineEnd=this.point=oD},sphere:function(){FJ.add(jA)}};function kJ(){CJ.point=SJ}function MJ(){$J(lJ,cJ)}function SJ(t,e){CJ.point=$J,lJ=t,cJ=e,fJ=t*=qA,hJ=YA(e=(e*=qA)/2+LA),dJ=QA(e)}function $J(t,e){var n=(t*=qA)-fJ,r=n>=0?1:-1,i=r*n,o=YA(e=(e*=qA)/2+LA),a=QA(e),s=dJ*a,u=hJ*o+s*YA(i),l=s*r*QA(i);EJ.add(XA(l,u)),fJ=t,hJ=o,dJ=a}function TJ(t){return FJ=new OA,NA(t,CJ),2*FJ}var BJ,NJ,OJ,zJ,RJ,PJ,UJ,LJ,jJ,IJ,qJ,WJ,HJ,XJ,YJ,GJ,VJ={point:JJ,lineStart:KJ,lineEnd:QJ,polygonStart:function(){VJ.point=tZ,VJ.lineStart=eZ,VJ.lineEnd=nZ,wJ=new OA,CJ.polygonStart()},polygonEnd:function(){CJ.polygonEnd(),VJ.point=JJ,VJ.lineStart=KJ,VJ.lineEnd=QJ,EJ<0?(pJ=-(mJ=180),gJ=-(yJ=90)):wJ>zA?yJ=90:wJ<-zA&&(gJ=-90),DJ[0]=pJ,DJ[1]=mJ},sphere:function(){pJ=-(mJ=180),gJ=-(yJ=90)}};function JJ(t,e){AJ.push(DJ=[pJ=t,mJ=t]),e<gJ&&(gJ=e),e>yJ&&(yJ=e)}function ZJ(t,e){var n=vE([t*qA,e*qA]);if(_J){var r=xE(_J,n),i=xE([r[1],-r[0],0],r);AE(i),i=yE(i);var o,a=t-vJ,s=a>0?1:-1,u=i[0]*IA*s,l=WA(a)>180;l^(s*vJ<u&&u<s*t)?(o=i[1]*IA)>yJ&&(yJ=o):l^(s*vJ<(u=(u+360)%360-180)&&u<s*t)?(o=-i[1]*IA)<gJ&&(gJ=o):(e<gJ&&(gJ=e),e>yJ&&(yJ=e)),l?t<vJ?rZ(pJ,t)>rZ(pJ,mJ)&&(mJ=t):rZ(t,mJ)>rZ(pJ,mJ)&&(pJ=t):mJ>=pJ?(t<pJ&&(pJ=t),t>mJ&&(mJ=t)):t>vJ?rZ(pJ,t)>rZ(pJ,mJ)&&(mJ=t):rZ(t,mJ)>rZ(pJ,mJ)&&(pJ=t)}else AJ.push(DJ=[pJ=t,mJ=t]);e<gJ&&(gJ=e),e>yJ&&(yJ=e),_J=n,vJ=t}function KJ(){VJ.point=ZJ}function QJ(){DJ[0]=pJ,DJ[1]=mJ,VJ.point=JJ,_J=null}function tZ(t,e){if(_J){var n=t-vJ;wJ.add(WA(n)>180?n+(n>0?360:-360):n)}else bJ=t,xJ=e;CJ.point(t,e),ZJ(t,e)}function eZ(){CJ.lineStart()}function nZ(){tZ(bJ,xJ),CJ.lineEnd(),WA(wJ)>zA&&(pJ=-(mJ=180)),DJ[0]=pJ,DJ[1]=mJ,_J=null}function rZ(t,e){return(e-=t)<0?e+360:e}function iZ(t,e){return t[0]-e[0]}function oZ(t,e){return t[0]<=t[1]?t[0]<=e&&e<=t[1]:e<t[0]||t[1]<e}function aZ(t){var e,n,r,i,o,a,s;if(yJ=mJ=-(pJ=gJ=1/0),AJ=[],NA(t,VJ),n=AJ.length){for(AJ.sort(iZ),e=1,o=[r=AJ[0]];e<n;++e)oZ(r,(i=AJ[e])[0])||oZ(r,i[1])?(rZ(r[0],i[1])>rZ(r[0],r[1])&&(r[1]=i[1]),rZ(i[0],r[1])>rZ(r[0],r[1])&&(r[0]=i[0])):o.push(r=i);for(a=-1/0,e=0,r=o[n=o.length-1];e<=n;r=i,++e)i=o[e],(s=rZ(r[1],i[0]))>a&&(a=s,pJ=i[0],mJ=r[1])}return AJ=DJ=null,pJ===1/0||gJ===1/0?[[NaN,NaN],[NaN,NaN]]:[[pJ,gJ],[mJ,yJ]]}var sZ={sphere:oD,point:uZ,lineStart:cZ,lineEnd:dZ,polygonStart:function(){sZ.lineStart=pZ,sZ.lineEnd=gZ},polygonEnd:function(){sZ.lineStart=cZ,sZ.lineEnd=dZ}};function uZ(t,e){t*=qA;var n=YA(e*=qA);lZ(n*YA(t),n*QA(t),QA(e))}function lZ(t,e,n){++BJ,OJ+=(t-OJ)/BJ,zJ+=(e-zJ)/BJ,RJ+=(n-RJ)/BJ}function cZ(){sZ.point=fZ}function fZ(t,e){t*=qA;var n=YA(e*=qA);XJ=n*YA(t),YJ=n*QA(t),GJ=QA(e),sZ.point=hZ,lZ(XJ,YJ,GJ)}function hZ(t,e){t*=qA;var n=YA(e*=qA),r=n*YA(t),i=n*QA(t),o=QA(e),a=XA(eD((a=YJ*o-GJ*i)*a+(a=GJ*r-XJ*o)*a+(a=XJ*i-YJ*r)*a),XJ*r+YJ*i+GJ*o);NJ+=a,PJ+=a*(XJ+(XJ=r)),UJ+=a*(YJ+(YJ=i)),LJ+=a*(GJ+(GJ=o)),lZ(XJ,YJ,GJ)}function dZ(){sZ.point=uZ}function pZ(){sZ.point=mZ}function gZ(){yZ(WJ,HJ),sZ.point=uZ}function mZ(t,e){WJ=t,HJ=e,t*=qA,e*=qA,sZ.point=yZ;var n=YA(e);XJ=n*YA(t),YJ=n*QA(t),GJ=QA(e),lZ(XJ,YJ,GJ)}function yZ(t,e){t*=qA;var n=YA(e*=qA),r=n*YA(t),i=n*QA(t),o=QA(e),a=YJ*o-GJ*i,s=GJ*r-XJ*o,u=XJ*i-YJ*r,l=JA(a,s,u),c=iD(l),f=l&&-c/l;jJ.add(f*a),IJ.add(f*s),qJ.add(f*u),NJ+=c,PJ+=c*(XJ+(XJ=r)),UJ+=c*(YJ+(YJ=i)),LJ+=c*(GJ+(GJ=o)),lZ(XJ,YJ,GJ)}function vZ(t){BJ=NJ=OJ=zJ=RJ=PJ=UJ=LJ=0,jJ=new OA,IJ=new OA,qJ=new OA,NA(t,sZ);var e=+jJ,n=+IJ,r=+qJ,i=JA(e,n,r);return i<RA&&(e=PJ,n=UJ,r=LJ,NJ<zA&&(e=OJ,n=zJ,r=RJ),(i=JA(e,n,r))<RA)?[NaN,NaN]:[XA(n,e)*IA,iD(r/i)*IA]}function bZ(t,e){return null==t||null==e?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function xZ(t,e){return null==t||null==e?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function _Z(){return 0}function wZ(t){return t instanceof _p?t:new _p(t)}const AZ="intersect",DZ="union",EZ="vlMulti",FZ="vlPoint",CZ="or",kZ="and",MZ="_vgsid_",SZ=(0,Kt.EP)(MZ),$Z="E",TZ="R",BZ="R-E",NZ="R-LE",OZ="R-RE",zZ="index:unit";function RZ(t,e){for(var n,r,i=e.fields,o=e.values,a=i.length,s=0;s<a;++s)if((r=i[s]).getter=Kt.EP.getter||(0,Kt.EP)(r.field),n=r.getter(t),(0,Kt.J_)(n)&&(n=(0,Kt.He)(n)),(0,Kt.J_)(o[s])&&(o[s]=(0,Kt.He)(o[s])),(0,Kt.J_)(o[s][0])&&(o[s]=o[s].map(Kt.He)),r.type===$Z){if((0,Kt.kJ)(o[s])?o[s].indexOf(n)<0:n!==o[s])return!1}else if(r.type===TZ){if(!(0,Kt.u5)(n,o[s]))return!1}else if(r.type===OZ){if(!(0,Kt.u5)(n,o[s],!0,!1))return!1}else if(r.type===BZ){if(!(0,Kt.u5)(n,o[s],!1,!1))return!1}else if(r.type===NZ&&!(0,Kt.u5)(n,o[s],!1,!0))return!1;return!0}function PZ(t,e,n){for(var r,i,o,a,s,u=this.context.data[t],l=u?u.values.value:[],c=u?u[zZ]&&u[zZ].value:void 0,f=n===AZ,h=l.length,d=0;d<h;++d)if(r=l[d],c&&f){if(-1===(o=(i=i||{})[a=r.unit]||0))continue;if(s=RZ(e,r),i[a]=s?-1:++o,s&&1===c.size)return!0;if(!s&&o===c.get(a).count)return!1}else if(f^(s=RZ(e,r)))return s;return h&&f}const UZ=function(t){let e,n,r;function i(t,r,i=0,o=t.length){if(i<o){if(0!==e(r,r))return o;do{const e=i+o>>>1;n(t[e],r)<0?i=e+1:o=e}while(i<o)}return i}return 2!==t.length?(e=bZ,n=(e,n)=>bZ(t(e),n),r=(e,n)=>t(e)-n):(e=t===bZ||t===xZ?t:_Z,n=t,r=t),{left:i,center:function(t,e,n=0,o=t.length){const a=i(t,e,n,o-1);return a>n&&r(t[a-1],e)>-r(t[a],e)?a-1:a},right:function(t,r,i=0,o=t.length){if(i<o){if(0!==e(r,r))return o;do{const e=i+o>>>1;n(t[e],r)<=0?i=e+1:o=e}while(i<o)}return i}}}(SZ),LZ=UZ.left,jZ=UZ.right;function IZ(t,e,n){const r=this.context.data[t],i=r?r.values.value:[],o=r?r[zZ]&&r[zZ].value:void 0,a=n===AZ,s=SZ(e),u=LZ(i,s);if(u===i.length)return!1;if(SZ(i[u])!==s)return!1;if(o&&a){if(1===o.size)return!0;if(jZ(i,s)-u<o.size)return!1}return!0}function qZ(t,e){return t.map((t=>(0,Kt.l7)(e.fields?{values:e.fields.map((e=>(e.getter||(e.getter=(0,Kt.EP)(e.field)))(t.datum)))}:{[MZ]:SZ(t.datum)},e)))}function WZ(t,e,n,r){for(var i,o,a,s,u,l,c,f,h,d,p,g,m=this.context.data[t],y=m?m.values.value:[],v={},b={},x={},_=y.length,w=0;w<_;++w)if(s=(i=y[w]).unit,o=i.fields,a=i.values,o&&a){for(p=0,g=o.length;p<g;++p)u=o[p],f=(c=v[u.field]||(v[u.field]={}))[s]||(c[s]=[]),x[u.field]=h=u.type.charAt(0),d=HZ[`${h}_union`],c[s]=d(f,(0,Kt.IX)(a[p]));n&&(f=b[s]||(b[s]=[])).push((0,Kt.IX)(a).reduce(((t,e,n)=>(t[o[n].field]=e,t)),{}))}else u=MZ,l=SZ(i),(f=(c=v[u]||(v[u]={}))[s]||(c[s]=[])).push(l),n&&(f=b[s]||(b[s]=[])).push({[MZ]:l});if(e=e||DZ,v[MZ]?v[MZ]=HZ[`${MZ}_${e}`](...Object.values(v[MZ])):Object.keys(v).forEach((t=>{v[t]=Object.keys(v[t]).map((e=>v[t][e])).reduce(((n,r)=>void 0===n?r:HZ[`${x[t]}_${e}`](n,r)))})),y=Object.keys(b),n&&y.length){v[r?FZ:EZ]=e===DZ?{[CZ]:y.reduce(((t,e)=>(t.push(...b[e]),t)),[])}:{[kZ]:y.map((t=>({[CZ]:b[t]})))}}return v}var HZ={[`${MZ}_union`]:function(...t){const e=new _p;for(const n of t)for(const t of n)e.add(t);return e},[`${MZ}_intersect`]:function(t,...e){t=new _p(t),e=e.map(wZ);t:for(const n of t)for(const r of e)if(!r.has(n)){t.delete(n);continue t}return t},E_union:function(t,e){if(!t.length)return e;for(var n=0,r=e.length;n<r;++n)t.indexOf(e[n])<0&&t.push(e[n]);return t},E_intersect:function(t,e){return t.length?t.filter((t=>e.indexOf(t)>=0)):e},R_union:function(t,e){var n=(0,Kt.He)(e[0]),r=(0,Kt.He)(e[1]);return n>r&&(n=e[1],r=e[0]),t.length?(t[0]>n&&(t[0]=n),t[1]<r&&(t[1]=r),t):[n,r]},R_intersect:function(t,e){var n=(0,Kt.He)(e[0]),r=(0,Kt.He)(e[1]);return n>r&&(n=e[1],r=e[0]),t.length?r<t[0]||t[1]<n?[]:(t[0]<n&&(t[0]=n),t[1]>r&&(t[1]=r),t):[n,r]}};const XZ=":",YZ="@";function GZ(t,e,n,r){e[0].type!==_G&&(0,Kt.vU)("First argument to selection functions must be a string literal.");const i=e[0].value,o=e.length>=2&&(0,Kt.fj)(e).value,a="unit",s=YZ+a,u=XZ+i;o!==AZ||(0,Kt.nr)(r,s)||(r[s]=n.getData(i).indataRef(n,a)),(0,Kt.nr)(r,u)||(r[u]=n.getData(i).tuplesRef())}function VZ(t){const e=this.context.data[t];return e?e.values.value:[]}const JZ=t=>function(e,n){return this.context.dataflow.locale()[t](n)(e)},ZZ=JZ("format"),KZ=JZ("timeFormat"),QZ=JZ("utcFormat"),tK=JZ("timeParse"),eK=JZ("utcParse"),nK=new Date(2e3,0,1);function rK(t,e,n){return Number.isInteger(t)&&Number.isInteger(e)?(nK.setYear(2e3),nK.setMonth(t),nK.setDate(e),KZ.call(this,nK,n)):""}const iK=":",oK="@",aK="%",sK="$";function uK(t,e,n,r){e[0].type!==_G&&(0,Kt.vU)("First argument to data functions must be a string literal.");const i=e[0].value,o=iK+i;if(!(0,Kt.nr)(o,r))try{r[o]=n.getData(i).tuplesRef()}catch(a){}}function lK(t,e,n,r){if(e[0].type===_G)cK(n,r,e[0].value);else for(t in n.scales)cK(n,r,t)}function cK(t,e,n){const r=aK+n;if(!(0,Kt.nr)(e,r))try{e[r]=t.scaleRef(n)}catch(i){}}function fK(t,e){if((0,Kt.mf)(t))return t;if((0,Kt.HD)(t)){const n=e.scales[t];return n&&tm(n.value)?n.value:void 0}}function hK(t,e,n){e.__bandwidth=t=>t&&t.bandwidth?t.bandwidth():0,n._bandwidth=lK,n._range=lK,n._scale=lK;const r=e=>"_["+(e.type===_G?(0,Kt.m8)(aK+e.value):(0,Kt.m8)(aK)+"+"+t(e))+"]";return{_bandwidth:t=>`this.__bandwidth(${r(t[0])})`,_range:t=>`${r(t[0])}.range()`,_scale:e=>`${r(e[0])}(${t(e[1])})`}}function dK(t,e){return function(n,r,i){if(n){const e=fK(n,(i||this).context);return e&&e.path[t](r)}return e(r)}}const pK=dK("area",TJ),gK=dK("bounds",aZ),mK=dK("centroid",vZ);function yK(t,e,n){try{t[e].apply(t,["EXPRESSION"].concat([].slice.call(n)))}catch(r){t.warn(r)}return n[n.length-1]}function vK(t){const e=t/255;return e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4)}function bK(t){const e=(0,uf.B8)(t);return.2126*vK(e.r)+.7152*vK(e.g)+.0722*vK(e.b)}function xK(t,e){return t===e||t!==t&&e!==e||((0,Kt.kJ)(t)?!(!(0,Kt.kJ)(e)||t.length!==e.length)&&function(t,e){for(let n=0,r=t.length;n<r;++n)if(!xK(t[n],e[n]))return!1;return!0}(t,e):!(!(0,Kt.Kn)(t)||!(0,Kt.Kn)(e))&&_K(t,e))}function _K(t,e){for(const n in t)if(!xK(t[n],e[n]))return!1;return!0}function wK(t){return e=>_K(t,e)}const AK={};function DK(t){return(0,Kt.kJ)(t)||ArrayBuffer.isView(t)?t:null}function EK(t){return DK(t)||((0,Kt.HD)(t)?t:null)}const FK=t=>t.data;function CK(t,e){const n=VZ.call(e,t);return n.root&&n.root.lookup||{}}const kK=()=>"undefined"!==typeof window&&window||null;function MK(t,e,n){if(!t)return[];const[r,i]=t,o=(new Wy).set(r[0],r[1],i[0],i[1]);return w_(n||this.context.dataflow.scenegraph().root,o,function(t){let e=null;if(t){const n=(0,Kt.IX)(t.marktype),r=(0,Kt.IX)(t.markname);e=t=>(!n.length||n.some((e=>t.marktype===e)))&&(!r.length||r.some((e=>t.name===e)))}return e}(e))}const SK={random:()=>ks(),cumulativeNormal:Os,cumulativeLogNormal:js,cumulativeUniform:Hs,densityNormal:Ns,densityLogNormal:Ls,densityUniform:Ws,quantileNormal:zs,quantileLogNormal:Is,quantileUniform:Xs,sampleNormal:Bs,sampleLogNormal:Us,sampleUniform:qs,isArray:Kt.kJ,isBoolean:Kt.jn,isDate:Kt.J_,isDefined:t=>void 0!==t,isNumber:Kt.hj,isObject:Kt.Kn,isRegExp:Kt.Kj,isString:Kt.HD,isTuple:Sa,isValid:t=>null!=t&&t===t,toBoolean:Kt.sw,toDate:t=>(0,Kt.ZU)(t),toNumber:Kt.He,toString:Kt.BB,indexof:function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return EK(t).indexOf(...n)},join:function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return DK(t).join(...n)},lastindexof:function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return EK(t).lastIndexOf(...n)},replace:function(t,e,n){return(0,Kt.mf)(n)&&(0,Kt.vU)("Function argument passed to replace."),String(t).replace(e,n)},reverse:function(t){return DK(t).slice().reverse()},slice:function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return EK(t).slice(...n)},flush:Kt.yl,lerp:Kt.t7,merge:function(){const t=[].slice.call(arguments);return t.unshift({}),(0,Kt.l7)(...t)},pad:Kt.vk,peek:Kt.fj,pluck:function(t,e){const n=AK[e]||(AK[e]=(0,Kt.EP)(e));return(0,Kt.kJ)(t)?t.map(n):n(t)},span:Kt.yP,inrange:Kt.u5,truncate:Kt.$G,rgb:uf.B8,lab:Zp,hcl:ig,hsl:uf.Ym,luminance:bK,contrast:function(t,e){const n=bK(t),r=bK(e);return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)},sequence:Zs,format:ZZ,utcFormat:QZ,utcParse:eK,utcOffset:vr,utcSequence:_r,timeFormat:KZ,timeParse:tK,timeOffset:yr,timeSequence:xr,timeUnitSpecifier:qn,monthFormat:function(t){return rK.call(this,t,1,"%B")},monthAbbrevFormat:function(t){return rK.call(this,t,1,"%b")},dayFormat:function(t){return rK.call(this,0,2+t,"%A")},dayAbbrevFormat:function(t){return rK.call(this,0,2+t,"%a")},quarter:Kt.mS,utcquarter:Kt.N3,week:Yn,utcweek:Qn,dayofyear:Xn,utcdayofyear:Kn,warn:function(){return yK(this.context.dataflow,"warn",arguments)},info:function(){return yK(this.context.dataflow,"info",arguments)},debug:function(){return yK(this.context.dataflow,"debug",arguments)},extent:t=>(0,Kt.We)(t),inScope:function(t){const e=this.context.group;let n=!1;if(e)for(;t;){if(t===e){n=!0;break}t=t.mark.group}return n},intersect:MK,clampRange:Kt.l$,pinchDistance:function(t){const e=t.touches,n=e[0].clientX-e[1].clientX,r=e[0].clientY-e[1].clientY;return Math.sqrt(n*n+r*r)},pinchAngle:function(t){const e=t.touches;return Math.atan2(e[0].clientY-e[1].clientY,e[0].clientX-e[1].clientX)},screen:function(){const t=kK();return t?t.screen:{}},containerSize:function(){const t=this.context.dataflow,e=t.container&&t.container();return e?[e.clientWidth,e.clientHeight]:[void 0,void 0]},windowSize:function(){const t=kK();return t?[t.innerWidth,t.innerHeight]:[void 0,void 0]},bandspace:function(t,e,n){return Eg(t||0,e||0,n||0)},setdata:function(t,e){const n=this.context.dataflow,r=this.context.data[t].input;return n.pulse(r,n.changeset().remove(Kt.yb).insert(e)),1},pathShape:function(t){let e=null;return function(n){return n?dy(n,e=e||ey(t)):t}},panLinear:Kt.Dw,panLog:Kt.mJ,panPow:Kt.QA,panSymlog:Kt.Zw,zoomLinear:Kt.ay,zoomLog:Kt.dH,zoomPow:Kt.mK,zoomSymlog:Kt.bV,encode:function(t,e,n){if(t){const n=this.context.dataflow,r=t.mark.source;n.pulse(r,n.changeset().encode(t,e))}return void 0!==n?n:t},modify:function(t,e,n,r,i,o){const a=this.context.dataflow,s=this.context.data[t],u=s.input,l=a.stamp();let c,f,h=s.changes;if(!1===a._trigger||!(u.value.length||e||r))return 0;if((!h||h.stamp<l)&&(s.changes=h=a.changeset(),h.stamp=l,a.runAfter((()=>{s.modified=!0,a.pulse(u,h).run()}),!0,1)),n&&(c=!0===n?Kt.yb:(0,Kt.kJ)(n)||Sa(n)?n:wK(n),h.remove(c)),e&&h.insert(e),r&&(c=wK(r),u.value.some(c)?h.remove(c):h.insert(r)),i)for(f in o)h.modify(i,f,o[f]);return 1},lassoAppend:function(t,e,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:5;const i=(t=(0,Kt.IX)(t))[t.length-1];return void 0===i||Math.sqrt((i[0]-e)**2+(i[1]-n)**2)>r?[...t,[e,n]]:t},lassoPath:function(t){return(0,Kt.IX)(t).reduce(((e,n,r)=>{let[i,o]=n;return e+(0==r?`M ${i},${o} `:r===t.length-1?" Z":`L ${i},${o} `)}),"")},intersectLasso:function(t,e,n){const{x:r,y:i,mark:o}=n,a=(new Wy).set(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,Number.MIN_SAFE_INTEGER,Number.MIN_SAFE_INTEGER);for(const[s,u]of e)s<a.x1&&(a.x1=s),s>a.x2&&(a.x2=s),u<a.y1&&(a.y1=u),u>a.y2&&(a.y2=u);return a.translate(r,i),MK([[a.x1,a.y1],[a.x2,a.y2]],t,o).filter((t=>function(t,e,n){let r=0;for(let i=0,o=n.length-1;i<n.length;o=i++){const[a,s]=n[o],[u,l]=n[i];l>e!=s>e&&t<(a-u)*(e-l)/(s-l)+u&&r++}return 1&r}(t.x,t.y,e)))}},$K=["view","item","group","xy","x","y"],TK="event.vega.",BK="this.",NK={},OK={forbidden:["_"],allowed:["datum","event","item"],fieldvar:"datum",globalvar:t=>`_[${(0,Kt.m8)(sK+t)}]`,functions:function(t){const e=uJ(t);$K.forEach((t=>e[t]=TK+t));for(const n in SK)e[n]=BK+n;return(0,Kt.l7)(e,hK(t,SK,NK)),e},constants:sJ,visitors:NK},zK=function(t){const e=(t=t||{}).allowed?(0,Kt.Rg)(t.allowed):{},n=t.forbidden?(0,Kt.Rg)(t.forbidden):{},r=t.constants||sJ,i=(t.functions||uJ)(f),o=t.globalvar,a=t.fieldvar,s=(0,Kt.mf)(o)?o:t=>`${o}["${t}"]`;let u={},l={},c=0;function f(t){if((0,Kt.HD)(t))return t;const e=h[t.type];return null==e&&(0,Kt.vU)("Unsupported type: "+t.type),e(t)}const h={Literal:t=>t.raw,Identifier:t=>{const i=t.name;return c>0?i:(0,Kt.nr)(n,i)?(0,Kt.vU)("Illegal identifier: "+i):(0,Kt.nr)(r,i)?r[i]:(0,Kt.nr)(e,i)?i:(u[i]=1,s(i))},MemberExpression:t=>{const e=!t.computed,n=f(t.object);e&&(c+=1);const r=f(t.property);return n===a&&(l[function(t){const e=t&&t.length-1;return e&&('"'===t[0]&&'"'===t[e]||"'"===t[0]&&"'"===t[e])?t.slice(1,-1):t}(r)]=1),e&&(c-=1),n+(e?"."+r:"["+r+"]")},CallExpression:t=>{"Identifier"!==t.callee.type&&(0,Kt.vU)("Illegal callee type: "+t.callee.type);const e=t.callee.name,n=t.arguments,r=(0,Kt.nr)(i,e)&&i[e];return r||(0,Kt.vU)("Unrecognized function: "+e),(0,Kt.mf)(r)?r(n):r+"("+n.map(f).join(",")+")"},ArrayExpression:t=>"["+t.elements.map(f).join(",")+"]",BinaryExpression:t=>"("+f(t.left)+" "+t.operator+" "+f(t.right)+")",UnaryExpression:t=>"("+t.operator+f(t.argument)+")",ConditionalExpression:t=>"("+f(t.test)+"?"+f(t.consequent)+":"+f(t.alternate)+")",LogicalExpression:t=>"("+f(t.left)+t.operator+f(t.right)+")",ObjectExpression:t=>"{"+t.properties.map(f).join(",")+"}",Property:t=>{c+=1;const e=f(t.key);return c-=1,e+":"+f(t.value)}};function d(t){const e={code:f(t),globals:Object.keys(u),fields:Object.keys(l)};return u={},l={},e}return d.functions=i,d.constants=r,d}(OK);function RK(t,e,n){return 1===arguments.length?SK[t]:(SK[t]=e,n&&(NK[t]=n),zK&&(zK.functions[t]=BK+t),this)}function PK(t,e){const n={};let r;try{r=function(t){NG=0,OG=(BG=t).length,zG=null,OV();const e=aJ();if(zG.type!==PG)throw new Error("Unexpect token after expression.");return e}(t=(0,Kt.HD)(t)?t:(0,Kt.m8)(t)+"")}catch(o){(0,Kt.vU)("Expression parse error: "+t)}r.visit((t=>{if(t.type!==EG)return;const r=t.callee.name,i=OK.visitors[r];i&&i(r,t.arguments,e,n)}));const i=zK(r);return i.globals.forEach((t=>{const r=sK+t;!(0,Kt.nr)(n,r)&&e.getSignal(t)&&(n[r]=e.signalRef(t))})),{$expr:(0,Kt.l7)({code:i.code},e.options.ast?{ast:r}:null),$fields:i.fields,$params:n}}RK("bandwidth",(function(t,e){const n=fK(t,(e||this).context);return n&&n.bandwidth?n.bandwidth():0}),lK),RK("copy",(function(t,e){const n=fK(t,(e||this).context);return n?n.copy():void 0}),lK),RK("domain",(function(t,e){const n=fK(t,(e||this).context);return n?n.domain():[]}),lK),RK("range",(function(t,e){const n=fK(t,(e||this).context);return n&&n.range?n.range():[]}),lK),RK("invert",(function(t,e,n){const r=fK(t,(n||this).context);return r?(0,Kt.kJ)(e)?(r.invertRange||r.invert)(e):(r.invert||r.invertExtent)(e):void 0}),lK),RK("scale",(function(t,e,n){const r=fK(t,(n||this).context);return r?r(e):void 0}),lK),RK("gradient",(function(t,e,n,r,i){t=fK(t,(i||this).context);const o=Ym(e,n);let a=t.domain(),s=a[0],u=(0,Kt.fj)(a),l=Kt.yR;return u-s?l=pm(t,s,u):t=(t.interpolator?em("sequential")().interpolator(t.interpolator()):em("linear")().interpolate(t.interpolate()).range(t.range())).domain([s=0,u=1]),t.ticks&&(a=t.ticks(+r||15),s!==a[0]&&a.unshift(s),u!==(0,Kt.fj)(a)&&a.push(u)),a.forEach((e=>o.stop(l(e),t(e)))),o}),lK),RK("geoArea",pK,lK),RK("geoBounds",gK,lK),RK("geoCentroid",mK,lK),RK("geoShape",(function(t,e,n){const r=fK(t,(n||this).context);return function(t){return r?r.path.context(t)(e):""}}),lK),RK("indata",(function(t,e,n){const r=this.context.data[t]["index:"+e],i=r?r.value.get(n):void 0;return i?i.count:i}),(function(t,e,n,r){e[0].type!==_G&&(0,Kt.vU)("First argument to indata must be a string literal."),e[1].type!==_G&&(0,Kt.vU)("Second argument to indata must be a string literal.");const i=e[0].value,o=e[1].value,a=oK+o;(0,Kt.nr)(a,r)||(r[a]=n.getData(i).indataRef(n,o))})),RK("data",VZ,uK),RK("treePath",(function(t,e,n){const r=CK(t,this),i=r[e],o=r[n];return i&&o?i.path(o).map(FK):void 0}),uK),RK("treeAncestors",(function(t,e){const n=CK(t,this)[e];return n?n.ancestors().map(FK):void 0}),uK),RK("vlSelectionTest",PZ,GZ),RK("vlSelectionIdTest",IZ,GZ),RK("vlSelectionResolve",WZ,GZ),RK("vlSelectionTuples",qZ);const UK=(0,Kt.Rg)(["rule"]),LK=(0,Kt.Rg)(["group","image","rect"]);function jK(t){return(t+"").toLowerCase()}function IK(t,e,n){n.endsWith(";")||(n="return("+n+");");const r=Function(...e.concat(n));return t&&t.functions?r.bind(t.functions):r}var qK={operator:(t,e)=>IK(t,["_"],e.code),parameter:(t,e)=>IK(t,["datum","_"],e.code),event:(t,e)=>IK(t,["event"],e.code),handler:(t,e)=>IK(t,["_","event"],`var datum=event.item&&event.item.datum;return ${e.code};`),encode:(t,e)=>{const{marktype:n,channels:r}=e;let i="var o=item,datum=o.datum,m=0,$;";for(const o in r){const t="o["+(0,Kt.m8)(o)+"]";i+=`$=${r[o].code};if(${t}!==$)${t}=$,m=1;`}return i+=function(t,e){let n="";return UK[e]||(t.x2&&(t.x?(LK[e]&&(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);"),t.xc&&(n+="o.x=o.xc-(o.width||0)/2;"),t.y2&&(t.y?(LK[e]&&(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);"),t.yc&&(n+="o.y=o.yc-(o.height||0)/2;")),n}(r,n),i+="return m;",IK(t,["item","_"],i)},codegen:{get(t){const e=`[${t.map(Kt.m8).join("][")}]`,n=Function("_",`return _${e};`);return n.path=e,n},comparator(t,e){let n;const r=Function("a","b","var u, v; return "+t.map(((t,r)=>{const i=e[r];let o,a;return t.path?(o=`a${t.path}`,a=`b${t.path}`):((n=n||{})["f"+r]=t,o=`this.f${r}(a)`,a=`this.f${r}(b)`),function(t,e,n,r){return`((u = ${t}) < (v = ${e}) || u == null) && v != null ? ${n}\n : (u > v || v == null) && u != null ? ${r}\n : ((v = v instanceof Date ? +v : v), (u = u instanceof Date ? +u : u)) !== u && v === v ? ${n}\n : v !== v && u === u ? ${r} : `}(o,a,-i,i)})).join("")+"0;");return n?r.bind(n):r}}};function WK(t,e,n){if(!t||!(0,Kt.Kn)(t))return t;for(let r,i=0,o=HK.length;i<o;++i)if(r=HK[i],(0,Kt.nr)(t,r.key))return r.parse(t,e,n);return t}var HK=[{key:"$ref",parse:function(t,e){return e.get(t.$ref)||(0,Kt.vU)("Operator not defined: "+t.$ref)}},{key:"$key",parse:function(t,e){const n="k:"+t.$key+"_"+!!t.$flat;return e.fn[n]||(e.fn[n]=(0,Kt.Jy)(t.$key,t.$flat,e.expr.codegen))}},{key:"$expr",parse:function(t,e,n){t.$params&&e.parseParameters(t.$params,n);const r="e:"+t.$expr.code;return e.fn[r]||(e.fn[r]=(0,Kt.ZE)(e.parameterExpression(t.$expr),t.$fields))}},{key:"$field",parse:function(t,e){if(!t.$field)return null;const n="f:"+t.$field+"_"+t.$name;return e.fn[n]||(e.fn[n]=(0,Kt.EP)(t.$field,t.$name,e.expr.codegen))}},{key:"$encode",parse:function(t,e){const n=t.$encode,r={};for(const i in n){const t=n[i];r[i]=(0,Kt.ZE)(e.encodeExpression(t.$expr),t.$fields),r[i].output=t.$output}return r}},{key:"$compare",parse:function(t,e){const n="c:"+t.$compare+"_"+t.$order,r=(0,Kt.IX)(t.$compare).map((t=>t&&t.$tupleid?$a:t));return e.fn[n]||(e.fn[n]=(0,Kt.qu)(r,t.$order,e.expr.codegen))}},{key:"$context",parse:function(t,e){return e}},{key:"$subflow",parse:function(t,e){const n=t.$subflow;return function(t,r,i){const o=e.fork().parse(n),a=o.get(n.operators[0].id),s=o.signals.parent;return s&&s.set(i),a.detachSubflow=()=>e.detach(o),a}}},{key:"$tupleid",parse:function(){return $a}}];const XK={skip:!0};function YK(t,e,n,r){return new GK(t,e,n,r)}function GK(t,e,n,r){this.dataflow=t,this.transforms=e,this.events=t.events.bind(t),this.expr=r||qK,this.signals={},this.scales={},this.nodes={},this.data={},this.fn={},n&&(this.functions=Object.create(n),this.functions.context=this)}function VK(t){this.dataflow=t.dataflow,this.transforms=t.transforms,this.events=t.events,this.expr=t.expr,this.signals=Object.create(t.signals),this.scales=Object.create(t.scales),this.nodes=Object.create(t.nodes),this.data=Object.create(t.data),this.fn=Object.create(t.fn),t.functions&&(this.functions=Object.create(t.functions),this.functions.context=this)}function JK(t,e){t&&(null==e?t.removeAttribute("aria-label"):t.setAttribute("aria-label",e))}GK.prototype=VK.prototype={fork(){const t=new VK(this);return(this.subcontext||(this.subcontext=[])).push(t),t},detach(t){this.subcontext=this.subcontext.filter((e=>e!==t));const e=Object.keys(t.nodes);for(const n of e)t.nodes[n]._targets=null;for(const n of e)t.nodes[n].detach();t.nodes=null},get(t){return this.nodes[t]},set(t,e){return this.nodes[t]=e},add(t,e){const n=this,r=n.dataflow,i=t.value;if(n.set(t.id,e),function(t){return"collect"===jK(t)}(t.type)&&i&&(i.$ingest?r.ingest(e,i.$ingest,i.$format):i.$request?r.preload(e,i.$request,i.$format):r.pulse(e,r.changeset().insert(i))),t.root&&(n.root=e),t.parent){let i=n.get(t.parent.$ref);i?(r.connect(i,[e]),e.targets().add(i)):(n.unresolved=n.unresolved||[]).push((()=>{i=n.get(t.parent.$ref),r.connect(i,[e]),e.targets().add(i)}))}if(t.signal&&(n.signals[t.signal]=e),t.scale&&(n.scales[t.scale]=e),t.data)for(const o in t.data){const r=n.data[o]||(n.data[o]={});t.data[o].forEach((t=>r[t]=e))}},resolve(){return(this.unresolved||[]).forEach((t=>t())),delete this.unresolved,this},operator(t,e){this.add(t,this.dataflow.add(t.value,e))},transform(t,e){this.add(t,this.dataflow.add(this.transforms[jK(e)]))},stream(t,e){this.set(t.id,e)},update(t,e,n,r,i){this.dataflow.on(e,n,r,i,t.options)},operatorExpression(t){return this.expr.operator(this,t)},parameterExpression(t){return this.expr.parameter(this,t)},eventExpression(t){return this.expr.event(this,t)},handlerExpression(t){return this.expr.handler(this,t)},encodeExpression(t){return this.expr.encode(this,t)},parse:function(t){const e=this,n=t.operators||[];return t.background&&(e.background=t.background),t.eventConfig&&(e.eventConfig=t.eventConfig),t.locale&&(e.locale=t.locale),n.forEach((t=>e.parseOperator(t))),n.forEach((t=>e.parseOperatorParameters(t))),(t.streams||[]).forEach((t=>e.parseStream(t))),(t.updates||[]).forEach((t=>e.parseUpdate(t))),e.resolve()},parseOperator:function(t){const e=this;!function(t){return"operator"===jK(t)}(t.type)&&t.type?e.transform(t,t.type):e.operator(t,t.update?e.operatorExpression(t.update):null)},parseOperatorParameters:function(t){const e=this;if(t.params){const n=e.get(t.id);n||(0,Kt.vU)("Invalid operator id: "+t.id),e.dataflow.connect(n,n.parameters(e.parseParameters(t.params),t.react,t.initonly))}},parseParameters:function(t,e){e=e||{};const n=this;for(const r in t){const i=t[r];e[r]=(0,Kt.kJ)(i)?i.map((t=>WK(t,n,e))):WK(i,n,e)}return e},parseStream:function(t){var e,n=this,r=null!=t.filter?n.eventExpression(t.filter):void 0,i=null!=t.stream?n.get(t.stream):void 0;t.source?i=n.events(t.source,t.type,r):t.merge&&(i=(e=t.merge.map((t=>n.get(t))))[0].merge.apply(e[0],e.slice(1))),t.between&&(e=t.between.map((t=>n.get(t))),i=i.between(e[0],e[1])),t.filter&&(i=i.filter(r)),null!=t.throttle&&(i=i.throttle(+t.throttle)),null!=t.debounce&&(i=i.debounce(+t.debounce)),null==i&&(0,Kt.vU)("Invalid stream definition: "+JSON.stringify(t)),t.consume&&i.consume(!0),n.stream(t,i)},parseUpdate:function(t){var e,n=this,r=(0,Kt.Kn)(r=t.source)?r.$ref:r,i=n.get(r),o=t.update,a=void 0;i||(0,Kt.vU)("Source not defined: "+t.source),e=t.target&&t.target.$expr?n.eventExpression(t.target.$expr):n.get(t.target),o&&o.$expr&&(o.$params&&(a=n.parseParameters(o.$params)),o=n.handlerExpression(o.$expr)),n.update(t,i,e,o,a)},getState:function(t){var e=this,n={};if(t.signals){var r=n.signals={};Object.keys(e.signals).forEach((n=>{const i=e.signals[n];t.signals(n,i)&&(r[n]=i.value)}))}if(t.data){var i=n.data={};Object.keys(e.data).forEach((n=>{const r=e.data[n];t.data(n,r)&&(i[n]=r.input.value)}))}return e.subcontext&&!1!==t.recurse&&(n.subcontext=e.subcontext.map((e=>e.getState(t)))),n},setState:function(t){var e=this,n=e.dataflow,r=t.data,i=t.signals;Object.keys(i||{}).forEach((t=>{n.update(e.signals[t],i[t],XK)})),Object.keys(r||{}).forEach((t=>{n.pulse(e.data[t].input,n.changeset().remove(Kt.yb).insert(r[t]))})),(t.subcontext||[]).forEach(((t,n)=>{const r=e.subcontext[n];r&&r.setState(t)}))}};const ZK="default";function KK(t,e){const n=t.globalCursor()?"undefined"!==typeof document&&document.body:t.container();if(n)return null==e?n.style.removeProperty("cursor"):n.style.cursor=e}function QK(t,e){var n=t._runtime.data;return(0,Kt.nr)(n,e)||(0,Kt.vU)("Unrecognized data set: "+e),n[e]}function tQ(t,e){Pa(e)||(0,Kt.vU)("Second argument to changes must be a changeset.");const n=QK(this,t);return n.modified=!0,this.pulse(n.input,e)}function eQ(t){var e=t.padding();return Math.max(0,t._viewWidth+e.left+e.right)}function nQ(t){var e=t.padding();return Math.max(0,t._viewHeight+e.top+e.bottom)}function rQ(t){var e=t.padding(),n=t._origin;return[e.left+n[0],e.top+n[1]]}function iQ(t,e,n){var r,i,o=t._renderer,a=o&&o.canvas();return a&&(i=rQ(t),(r=nx(e.changedTouches?e.changedTouches[0]:e,a))[0]-=i[0],r[1]-=i[1]),e.dataflow=t,e.item=n,e.vega=function(t,e,n){const r=e?"group"===e.mark.marktype?e:e.mark.group:null;function i(t){var n,i=r;if(t)for(n=e;n;n=n.mark.group)if(n.mark.name===t){i=n;break}return i&&i.mark&&i.mark.interactive?i:{}}function o(t){if(!t)return n;(0,Kt.HD)(t)&&(t=i(t));const e=n.slice();for(;t;)e[0]-=t.x||0,e[1]-=t.y||0,t=t.mark&&t.mark.group;return e}return{view:(0,Kt.a9)(t),item:(0,Kt.a9)(e||{}),group:i,xy:o,x:t=>o(t)[0],y:t=>o(t)[1]}}(t,n,r),e}const oQ="view",aQ="timer",sQ="window",uQ={trap:!1};function lQ(t,e,n,r){t._eventListeners.push({type:n,sources:(0,Kt.IX)(e),handler:r})}function cQ(t,e,n){const r=t._eventConfig&&t._eventConfig[e];return!(!1===r||(0,Kt.Kn)(r)&&!r[n])||(t.warn(`Blocked ${e} ${n} event listener.`),!1)}function fQ(t){return t.item}function hQ(t){return t.item.mark.source}function dQ(t){return function(e,n){return n.vega.view().changeset().encode(n.item,t)}}function pQ(t,e,n){const r=document.createElement(t);for(const i in e)r.setAttribute(i,e[i]);return null!=n&&(r.textContent=n),r}const gQ="vega-bind",mQ="vega-bind-name",yQ="vega-bind-radio";function vQ(t,e,n,r){const i=n.event||"input",o=()=>t.update(e.value);r.signal(n.signal,e.value),e.addEventListener(i,o),lQ(r,e,i,o),t.set=t=>{e.value=t,e.dispatchEvent(function(t){return"undefined"!==typeof Event?new Event(t):{type:t}}(i))}}function bQ(t,e,n,r){const i=r.signal(n.signal),o=pQ("div",{class:gQ}),a="radio"===n.input?o:o.appendChild(pQ("label"));a.appendChild(pQ("span",{class:mQ},n.name||n.signal)),e.appendChild(o);let s=xQ;switch(n.input){case"checkbox":s=_Q;break;case"select":s=wQ;break;case"radio":s=AQ;break;case"range":s=DQ}s(t,a,n,i)}function xQ(t,e,n,r){const i=pQ("input");for(const o in n)"signal"!==o&&"element"!==o&&i.setAttribute("input"===o?"type":o,n[o]);i.setAttribute("name",n.signal),i.value=r,e.appendChild(i),i.addEventListener("input",(()=>t.update(i.value))),t.elements=[i],t.set=t=>i.value=t}function _Q(t,e,n,r){const i={type:"checkbox",name:n.signal};r&&(i.checked=!0);const o=pQ("input",i);e.appendChild(o),o.addEventListener("change",(()=>t.update(o.checked))),t.elements=[o],t.set=t=>o.checked=!!t||null}function wQ(t,e,n,r){const i=pQ("select",{name:n.signal}),o=n.labels||[];n.options.forEach(((t,e)=>{const n={value:t};EQ(t,r)&&(n.selected=!0),i.appendChild(pQ("option",n,(o[e]||t)+""))})),e.appendChild(i),i.addEventListener("change",(()=>{t.update(n.options[i.selectedIndex])})),t.elements=[i],t.set=t=>{for(let e=0,r=n.options.length;e<r;++e)if(EQ(n.options[e],t))return void(i.selectedIndex=e)}}function AQ(t,e,n,r){const i=pQ("span",{class:yQ}),o=n.labels||[];e.appendChild(i),t.elements=n.options.map(((e,a)=>{const s={type:"radio",name:n.signal,value:e};EQ(e,r)&&(s.checked=!0);const u=pQ("input",s);u.addEventListener("change",(()=>t.update(e)));const l=pQ("label",{},(o[a]||e)+"");return l.prepend(u),i.appendChild(l),u})),t.set=e=>{const n=t.elements,r=n.length;for(let t=0;t<r;++t)EQ(n[t].value,e)&&(n[t].checked=!0)}}function DQ(t,e,n,r){r=void 0!==r?r:(+n.max+ +n.min)/2;const i=null!=n.max?n.max:Math.max(100,+r)||100,o=n.min||Math.min(0,i,+r)||0,a=n.step||_e(o,i,100),s=pQ("input",{type:"range",name:n.signal,min:o,max:i,step:a});s.value=r;const u=pQ("span",{},+r);e.appendChild(s),e.appendChild(u);const l=()=>{u.textContent=s.value,t.update(+s.value)};s.addEventListener("input",l),s.addEventListener("change",l),t.elements=[s],t.set=t=>{s.value=t,u.textContent=t}}function EQ(t,e){return t===e||t+""===e+""}function FQ(t,e,n,r,i,o){return(e=e||new r(t.loader())).initialize(n,eQ(t),nQ(t),rQ(t),i,o).background(t.background())}function CQ(t,e){return e?function(){try{e.apply(this,arguments)}catch(n){t.error(n)}}:null}function kQ(t,e,n){if("string"===typeof e){if("undefined"===typeof document)return t.error("DOM document instance not found."),null;if(!(e=document.querySelector(e)))return t.error("Signal bind element not found: "+e),null}if(e&&n)try{e.textContent=""}catch(r){e=null,t.error(r)}return e}const MQ=t=>+t||0,SQ=t=>({top:t,bottom:t,left:t,right:t});function $Q(t){return(0,Kt.Kn)(t)?{top:MQ(t.top),bottom:MQ(t.bottom),left:MQ(t.left),right:MQ(t.right)}:SQ(MQ(t))}async function TQ(t,e,n,r){const i=__(e),o=i&&i.headless;return o||(0,Kt.vU)("Unrecognized renderer type: "+e),await t.runAsync(),FQ(t,null,null,o,n,r).renderAsync(t._scenegraph.root)}var BQ="width",NQ="height",OQ="padding",zQ={skip:!0};function RQ(t,e){var n=t.autosize(),r=t.padding();return e-(n&&n.contains===OQ?r.left+r.right:0)}function PQ(t,e){var n=t.autosize(),r=t.padding();return e-(n&&n.contains===OQ?r.top+r.bottom:0)}function UQ(t,e){return e.modified&&(0,Kt.kJ)(e.input.value)&&t.indexOf("_:vega:_")}function LQ(t,e){return!("parent"===t||e instanceof fs.proxy)}function jQ(t,e,n,r){const i=t.element();i&&i.setAttribute("title",function(t){return null==t?"":(0,Kt.kJ)(t)?IQ(t):(0,Kt.Kn)(t)&&!(0,Kt.J_)(t)?(e=t,Object.keys(e).map((t=>{const n=e[t];return t+": "+((0,Kt.kJ)(n)?IQ(n):qQ(n))})).join("\n")):t+"";var e}(r))}function IQ(t){return"["+t.map(qQ).join(", ")+"]"}function qQ(t){return(0,Kt.kJ)(t)?"[\u2026]":(0,Kt.Kn)(t)&&!(0,Kt.J_)(t)?"{\u2026}":t}function WQ(t,e){const n=this;if(e=e||{},us.call(n),e.loader&&n.loader(e.loader),e.logger&&n.logger(e.logger),null!=e.logLevel&&n.logLevel(e.logLevel),e.locale||t.locale){const r=(0,Kt.l7)({},t.locale,e.locale);n.locale(Jo(r.number,r.time))}n._el=null,n._elBind=null,n._renderType=e.renderer||b_.Canvas,n._scenegraph=new Vb;const r=n._scenegraph.root;n._renderer=null,n._tooltip=e.tooltip||jQ,n._redraw=!0,n._handler=(new wx).scene(r),n._globalCursor=!1,n._preventDefault=!1,n._timers=[],n._eventListeners=[],n._resizeListeners=[],n._eventConfig=function(t){const e=(0,Kt.l7)({defaults:{}},t),n=(t,e)=>{e.forEach((e=>{(0,Kt.kJ)(t[e])&&(t[e]=(0,Kt.Rg)(t[e]))}))};return n(e.defaults,["prevent","allow"]),n(e,["view","window","selector"]),e}(t.eventConfig),n.globalCursor(n._eventConfig.globalCursor);const i=function(t,e,n){return YK(t,fs,SK,n).parse(e)}(n,t,e.expr);n._runtime=i,n._signals=i.signals,n._bind=(t.bindings||[]).map((t=>({state:null,param:(0,Kt.l7)({},t)}))),i.root&&i.root.set(r),r.source=i.data.root.input,n.pulse(i.data.root.input,n.changeset().insert(r.items)),n._width=n.width(),n._height=n.height(),n._viewWidth=RQ(n,n._width),n._viewHeight=PQ(n,n._height),n._origin=[0,0],n._resize=0,n._autosize=1,function(t){var e=t._signals,n=e[BQ],r=e[NQ],i=e[OQ];function o(){t._autosize=t._resize=1}t._resizeWidth=t.add(null,(e=>{t._width=e.size,t._viewWidth=RQ(t,e.size),o()}),{size:n}),t._resizeHeight=t.add(null,(e=>{t._height=e.size,t._viewHeight=PQ(t,e.size),o()}),{size:r});const a=t.add(null,o,{pad:i});t._resizeWidth.rank=n.rank+1,t._resizeHeight.rank=r.rank+1,a.rank=i.rank+1}(n),function(t){t.add(null,(e=>(t._background=e.bg,t._resize=1,e.bg)),{bg:t._signals.background})}(n),function(t){const e=t._signals.cursor||(t._signals.cursor=t.add({user:ZK,item:null}));t.on(t.events("view","mousemove"),e,((t,n)=>{const r=e.value,i=r?(0,Kt.HD)(r)?r:r.user:ZK,o=n.item&&n.item.cursor||null;return r&&i===r.user&&o==r.item?r:{user:i,item:o}})),t.add(null,(function(e){let n=e.cursor,r=this.value;return(0,Kt.HD)(n)||(r=n.item,n=n.user),KK(t,n&&n!==ZK?n:r||n),r}),{cursor:e})}(n),n.description(t.description),e.hover&&n.hover(),e.container&&n.initialize(e.container,e.bind)}function HQ(t,e){return(0,Kt.nr)(t._signals,e)?t._signals[e]:(0,Kt.vU)("Unrecognized signal name: "+(0,Kt.m8)(e))}function XQ(t,e){const n=(t._targets||[]).filter((t=>t._update&&t._update.handler===e));return n.length?n[0]:null}function YQ(t,e,n,r){let i=XQ(n,r);return i||(i=CQ(t,(()=>r(e,n.value))),i.handler=r,t.on(n,null,i)),t}function GQ(t,e,n){const r=XQ(e,n);return r&&e._targets.remove(r),t}function VQ(t,e,n){return t.fields=e||[],t.fname=n,t}function JQ(t){return 1===t.length?ZQ(t[0]):KQ(t)}(0,Kt.XW)(WQ,us,{async evaluate(t,e,n){if(await us.prototype.evaluate.call(this,t,e),this._redraw||this._resize)try{this._renderer&&(this._resize&&(this._resize=0,function(t){var e=rQ(t),n=eQ(t),r=nQ(t);t._renderer.background(t.background()),t._renderer.resize(n,r,e),t._handler.origin(e),t._resizeListeners.forEach((e=>{try{e(n,r)}catch(i){t.error(i)}}))}(this)),await this._renderer.renderAsync(this._scenegraph.root)),this._redraw=!1}catch(r){this.error(r)}return n&&Ca(this,n),this},dirty(t){this._redraw=!0,this._renderer&&this._renderer.dirty(t)},description(t){if(arguments.length){const e=null!=t?t+"":null;return e!==this._desc&&JK(this._el,this._desc=e),this}return this._desc},container(){return this._el},scenegraph(){return this._scenegraph},origin(){return this._origin.slice()},signal(t,e,n){const r=HQ(this,t);return 1===arguments.length?r.value:this.update(r,e,n)},width(t){return arguments.length?this.signal("width",t):this.signal("width")},height(t){return arguments.length?this.signal("height",t):this.signal("height")},padding(t){return arguments.length?this.signal("padding",$Q(t)):$Q(this.signal("padding"))},autosize(t){return arguments.length?this.signal("autosize",t):this.signal("autosize")},background(t){return arguments.length?this.signal("background",t):this.signal("background")},renderer(t){return arguments.length?(__(t)||(0,Kt.vU)("Unrecognized renderer type: "+t),t!==this._renderType&&(this._renderType=t,this._resetRenderer()),this):this._renderType},tooltip(t){return arguments.length?(t!==this._tooltip&&(this._tooltip=t,this._resetRenderer()),this):this._tooltip},loader(t){return arguments.length?(t!==this._loader&&(us.prototype.loader.call(this,t),this._resetRenderer()),this):this._loader},resize(){return this._autosize=1,this.touch(HQ(this,"autosize"))},_resetRenderer(){this._renderer&&(this._renderer=null,this.initialize(this._el,this._elBind))},_resizeView:function(t,e,n,r,i,o){this.runAfter((a=>{let s=0;a._autosize=0,a.width()!==n&&(s=1,a.signal(BQ,n,zQ),a._resizeWidth.skip(!0)),a.height()!==r&&(s=1,a.signal(NQ,r,zQ),a._resizeHeight.skip(!0)),a._viewWidth!==t&&(a._resize=1,a._viewWidth=t),a._viewHeight!==e&&(a._resize=1,a._viewHeight=e),a._origin[0]===i[0]&&a._origin[1]===i[1]||(a._resize=1,a._origin=i),s&&a.run("enter"),o&&a.runAfter((t=>t.resize()))}),!1,1)},addEventListener(t,e,n){let r=e;return n&&!1===n.trap||(r=CQ(this,e),r.raw=e),this._handler.on(t,r),this},removeEventListener(t,e){for(var n,r,i=this._handler.handlers(t),o=i.length;--o>=0;)if(r=i[o].type,n=i[o].handler,t===r&&(e===n||e===n.raw)){this._handler.off(r,n);break}return this},addResizeListener(t){const e=this._resizeListeners;return e.indexOf(t)<0&&e.push(t),this},removeResizeListener(t){var e=this._resizeListeners,n=e.indexOf(t);return n>=0&&e.splice(n,1),this},addSignalListener(t,e){return YQ(this,t,HQ(this,t),e)},removeSignalListener(t,e){return GQ(this,HQ(this,t),e)},addDataListener(t,e){return YQ(this,t,QK(this,t).values,e)},removeDataListener(t,e){return GQ(this,QK(this,t).values,e)},globalCursor(t){if(arguments.length){if(this._globalCursor!==!!t){const e=KK(this,null);this._globalCursor=!!t,e&&KK(this,e)}return this}return this._globalCursor},preventDefault(t){return arguments.length?(this._preventDefault=t,this):this._preventDefault},timer:function(t,e){this._timers.push(function(t,e,n){var r=new UC.B7,i=e;return null==e?(r.restart(t,e,n),r):(r._restart=r.restart,r.restart=function(t,e,n){e=+e,n=null==n?(0,UC.zO)():+n,r._restart((function o(a){a+=i,r._restart(o,i+=e,n),t(a)}),e,n)},r.restart(t,e,n),r)}((function(e){t({timestamp:Date.now(),elapsed:e})}),e))},events:function(t,e,n){var r,i=this,o=new Ya(n),a=function(n,r){i.runAsync(null,(()=>{t===oQ&&function(t,e){var n=t._eventConfig.defaults,r=n.prevent,i=n.allow;return!1!==r&&!0!==i&&(!0===r||!1===i||(r?r[e]:i?!i[e]:t.preventDefault()))}(i,e)&&n.preventDefault(),o.receive(iQ(i,n,r))}))};if(t===aQ)cQ(i,"timer",e)&&i.timer(a,e);else if(t===oQ)cQ(i,"view",e)&&i.addEventListener(e,a,uQ);else if(t===sQ?cQ(i,"window",e)&&"undefined"!==typeof window&&(r=[window]):"undefined"!==typeof document&&cQ(i,"selector",e)&&(r=Array.from(document.querySelectorAll(t))),r){for(var s=0,u=r.length;s<u;++s)r[s].addEventListener(e,a);lQ(i,r,e,a)}else i.warn("Can not resolve event source: "+t);return o},finalize:function(){var t,e,n,r=this._tooltip,i=this._timers,o=this._eventListeners;for(t=i.length;--t>=0;)i[t].stop();for(t=o.length;--t>=0;)for(e=(n=o[t]).sources.length;--e>=0;)n.sources[e].removeEventListener(n.type,n.handler);return r&&r.call(this,this._handler,null,null,null),this},hover:function(t,e){return e=[e||"update",(t=[t||"hover"])[0]],this.on(this.events("view","mouseover",fQ),hQ,dQ(t)),this.on(this.events("view","mouseout",fQ),hQ,dQ(e)),this},data:function(t,e){return arguments.length<2?QK(this,t).values.value:tQ.call(this,t,Ua().remove(Kt.yb).insert(e))},change:tQ,insert:function(t,e){return tQ.call(this,t,Ua().insert(e))},remove:function(t,e){return tQ.call(this,t,Ua().remove(e))},scale:function(t){var e=this._runtime.scales;return(0,Kt.nr)(e,t)||(0,Kt.vU)("Unrecognized scale or projection: "+t),e[t].value},initialize:function(t,e){const n=this,r=n._renderType,i=n._eventConfig.bind,o=__(r);t=n._el=t?kQ(n,t,!0):null,function(t){const e=t.container();e&&(e.setAttribute("role","graphics-document"),e.setAttribute("aria-roleDescription","visualization"),JK(e,t.description()))}(n),o||n.error("Unrecognized renderer type: "+r);const a=o.handler||wx,s=t?o.renderer:o.headless;return n._renderer=s?FQ(n,n._renderer,t,s):null,n._handler=function(t,e,n,r){const i=new r(t.loader(),CQ(t,t.tooltip())).scene(t.scenegraph().root).initialize(n,rQ(t),t);return e&&e.handlers().forEach((t=>{i.on(t.type,t.handler)})),i}(n,n._handler,t,a),n._redraw=!0,t&&"none"!==i&&(e=e?n._elBind=kQ(n,e,!0):t.appendChild(pQ("form",{class:"vega-bindings"})),n._bind.forEach((t=>{t.param.element&&"container"!==i&&(t.element=kQ(n,t.param.element,!!t.param.input))})),n._bind.forEach((t=>{!function(t,e,n){if(!e)return;const r=n.param;let i=n.state;i||(i=n.state={elements:null,active:!1,set:null,update:e=>{e!=t.signal(r.signal)&&t.runAsync(null,(()=>{i.source=!0,t.signal(r.signal,e)}))}},r.debounce&&(i.update=(0,Kt.Ds)(r.debounce,i.update))),(null==r.input&&r.element?vQ:bQ)(i,e,r,t),i.active||(t.on(t._signals[r.signal],null,(()=>{i.source?i.source=!1:i.set(t.signal(r.signal))})),i.active=!0)}(n,t.element||e,t)}))),n},toImageURL:async function(t,e){t!==b_.Canvas&&t!==b_.SVG&&t!==b_.PNG&&(0,Kt.vU)("Unrecognized image type: "+t);const n=await TQ(this,t,e);return t===b_.SVG?function(t,e){const n=new Blob([t],{type:e});return window.URL.createObjectURL(n)}(n.svg(),"image/svg+xml"):n.canvas().toDataURL("image/png")},toCanvas:async function(t,e){return(await TQ(this,b_.Canvas,t,e)).canvas()},toSVG:async function(t){return(await TQ(this,b_.SVG,t)).svg()},getState:function(t){return this._runtime.getState(t||{data:UQ,signals:LQ,recurse:!0})},setState:function(t){return this.runAsync(null,(e=>{e._trigger=!1,e._runtime.setState(t)}),(t=>{t._trigger=!0})),this}});const ZQ=t=>function(e){return e[t]},KQ=t=>{const e=t.length;return function(n){for(let r=0;r<e;++r)n=n[t[r]];return n}};function QQ(t){throw Error(t)}function t0(t){const e=[],n=t.length;let r,i,o,a=null,s=0,u="";function l(){e.push(u+t.substring(r,i)),u="",r=i+1}for(t+="",r=i=0;i<n;++i)if(o=t[i],"\\"===o)u+=t.substring(r,i),u+=t.substring(++i,++i),r=i;else if(o===a)l(),a=null,s=-1;else{if(a)continue;r===s&&'"'===o||r===s&&"'"===o?(r=i+1,a=o):"."!==o||s?"["===o?(i>r&&l(),s=r=i+1):"]"===o&&(s||QQ("Access path missing open bracket: "+t),s>0&&l(),s=0,r=i+1):i>r?l():r=i+1}return s&&QQ("Access path missing closing bracket: "+t),a&&QQ("Access path missing closing quote: "+t),i>r&&(i++,l()),e}function e0(t,e,n){const r=t0(t);return t=1===r.length?r[0]:t,VQ((n&&n.get||JQ)(r),[t],e||t)}e0("id");const n0=VQ((t=>t),[],"identity"),r0=(VQ((()=>0),[],"zero"),VQ((()=>1),[],"one"),VQ((()=>!0),[],"true"));VQ((()=>!1),[],"false");var i0=Array.isArray;function o0(t){return t===Object(t)}function a0(t){return t[t.length-1]}function s0(t){return null==t||""===t?null:+t}const u0=t=>e=>t*Math.exp(e),l0=t=>e=>Math.log(t*e),c0=t=>e=>Math.sign(e)*Math.log1p(Math.abs(e/t)),f0=t=>e=>Math.sign(e)*Math.expm1(Math.abs(e))*t,h0=t=>e=>e<0?-Math.pow(-e,t):Math.pow(e,t);function d0(t,e,n,r){const i=n(t[0]),o=n(a0(t)),a=(o-i)*e;return[r(i-a),r(o-a)]}function p0(t,e,n,r,i){const o=r(t[0]),a=r(a0(t)),s=null!=e?r(e):(o+a)/2;return[i(s+(o-s)*n),i(s+(a-s)*n)]}function g0(t){return null!=t?i0(t)?t:[t]:[]}function m0(t){return"function"===typeof t}function y0(t){for(let e,n,r=1,i=arguments.length;r<i;++r)for(n in e=arguments[r],e)t[n]=e[n];return t}const v0=Object.prototype.hasOwnProperty;function b0(t,e){return v0.call(t,e)}function x0(t){return"[object Date]"===Object.prototype.toString.call(t)}function _0(t){return"number"===typeof t}function w0(t){return"string"===typeof t}function A0(t,e){let n="";for(;--e>=0;)n+=t;return n}function D0(t){return i0(t)?"["+t.map(D0)+"]":o0(t)||w0(t)?JSON.stringify(t).replace("\u2028","\\u2028").replace("\u2029","\\u2029"):t}const E0=t=>_0(t)||x0(t)?t:Date.parse(t);function F0(t,e,n){return t.fields=e||[],t.fname=n,t}function C0(t){return 1===t.length?k0(t[0]):M0(t)}const k0=t=>function(e){return e[t]},M0=t=>{const e=t.length;return function(n){for(let r=0;r<e;++r)n=n[t[r]];return n}};function S0(t){throw Error(t)}function $0(t){const e=[],n=t.length;let r,i,o,a=null,s=0,u="";function l(){e.push(u+t.substring(r,i)),u="",r=i+1}for(t+="",r=i=0;i<n;++i)if(o=t[i],"\\"===o)u+=t.substring(r,i),u+=t.substring(++i,++i),r=i;else if(o===a)l(),a=null,s=-1;else{if(a)continue;r===s&&'"'===o||r===s&&"'"===o?(r=i+1,a=o):"."!==o||s?"["===o?(i>r&&l(),s=r=i+1):"]"===o&&(s||S0("Access path missing open bracket: "+t),s>0&&l(),s=0,r=i+1):i>r?l():r=i+1}return s&&S0("Access path missing closing bracket: "+t),a&&S0("Access path missing closing quote: "+t),i>r&&(i++,l()),e}function T0(t,e,n){const r=$0(t);return t=1===r.length?r[0]:t,F0((n&&n.get||C0)(r),[t],e||t)}T0("id"),F0((t=>t),[],"identity"),F0((()=>0),[],"zero"),F0((()=>1),[],"one"),F0((()=>!0),[],"true"),F0((()=>!1),[],"false");Array.isArray;function B0(t){return"function"===typeof t}const N0=Object.prototype.hasOwnProperty;function O0(t,e){return N0.call(t,e)}function z0(t){return"string"===typeof t}function R0(t){const e={},n=t.length;for(let r=0;r<n;++r)e[t[r]]=!0;return e}const P0="Literal",U0="Property",L0="ArrayExpression",j0="BinaryExpression",I0="CallExpression",q0="ConditionalExpression",W0="LogicalExpression",H0="MemberExpression",X0="ObjectExpression",Y0="UnaryExpression";function G0(t){this.type=t}var V0,J0,Z0,K0,Q0;G0.prototype.visit=function(t){let e,n,r;if(t(this))return 1;for(e=function(t){switch(t.type){case L0:return t.elements;case j0:case W0:return[t.left,t.right];case I0:return[t.callee].concat(t.arguments);case q0:return[t.test,t.consequent,t.alternate];case H0:return[t.object,t.property];case X0:return t.properties;case U0:return[t.key,t.value];case Y0:return[t.argument];default:return[]}}(this),n=0,r=e.length;n<r;++n)if(e[n].visit(t))return 1};var t1=1,e1=2,n1=3,r1=4,i1=5,o1=6,a1=7,s1=8;(V0={})[t1]="Boolean",V0[e1]="<end>",V0[n1]="Identifier",V0[r1]="Keyword",V0[i1]="Null",V0[o1]="Numeric",V0[a1]="Punctuator",V0[s1]="String",V0[9]="RegularExpression";var u1="ArrayExpression",l1="BinaryExpression",c1="CallExpression",f1="ConditionalExpression",h1="Identifier",d1="Literal",p1="LogicalExpression",g1="MemberExpression",m1="ObjectExpression",y1="Property",v1="UnaryExpression",b1="Unexpected token %0",x1="Unexpected number",_1="Unexpected string",w1="Unexpected identifier",A1="Unexpected reserved word",D1="Unexpected end of input",E1="Invalid regular expression",F1="Invalid regular expression: missing /",C1="Octal literals are not allowed in strict mode.",k1="Duplicate data property in object literal not allowed in strict mode",M1="ILLEGAL",S1="Disabled.",$1=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]"),T1=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 B1(t,e){if(!t)throw new Error("ASSERT: "+e)}function N1(t){return t>=48&&t<=57}function O1(t){return"0123456789abcdefABCDEF".indexOf(t)>=0}function z1(t){return"01234567".indexOf(t)>=0}function R1(t){return 32===t||9===t||11===t||12===t||160===t||t>=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].indexOf(t)>=0}function P1(t){return 10===t||13===t||8232===t||8233===t}function U1(t){return 36===t||95===t||t>=65&&t<=90||t>=97&&t<=122||92===t||t>=128&&$1.test(String.fromCharCode(t))}function L1(t){return 36===t||95===t||t>=65&&t<=90||t>=97&&t<=122||t>=48&&t<=57||92===t||t>=128&&T1.test(String.fromCharCode(t))}const j1={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 I1(){for(;Z0<K0;){const t=J0.charCodeAt(Z0);if(!R1(t)&&!P1(t))break;++Z0}}function q1(t){var e,n,r,i=0;for(n="u"===t?4:2,e=0;e<n;++e)Z0<K0&&O1(J0[Z0])?(r=J0[Z0++],i=16*i+"0123456789abcdef".indexOf(r.toLowerCase())):o2({},b1,M1);return String.fromCharCode(i)}function W1(){var t,e,n,r;for(e=0,"}"===(t=J0[Z0])&&o2({},b1,M1);Z0<K0&&O1(t=J0[Z0++]);)e=16*e+"0123456789abcdef".indexOf(t.toLowerCase());return(e>1114111||"}"!==t)&&o2({},b1,M1),e<=65535?String.fromCharCode(e):(n=55296+(e-65536>>10),r=56320+(e-65536&1023),String.fromCharCode(n,r))}function H1(){var t,e;for(t=J0.charCodeAt(Z0++),e=String.fromCharCode(t),92===t&&(117!==J0.charCodeAt(Z0)&&o2({},b1,M1),++Z0,(t=q1("u"))&&"\\"!==t&&U1(t.charCodeAt(0))||o2({},b1,M1),e=t);Z0<K0&&L1(t=J0.charCodeAt(Z0));)++Z0,e+=String.fromCharCode(t),92===t&&(e=e.substr(0,e.length-1),117!==J0.charCodeAt(Z0)&&o2({},b1,M1),++Z0,(t=q1("u"))&&"\\"!==t&&L1(t.charCodeAt(0))||o2({},b1,M1),e+=t);return e}function X1(){var t,e;return t=Z0,e=92===J0.charCodeAt(Z0)?H1():function(){var t,e;for(t=Z0++;Z0<K0;){if(92===(e=J0.charCodeAt(Z0)))return Z0=t,H1();if(!L1(e))break;++Z0}return J0.slice(t,Z0)}(),{type:1===e.length?n1:j1.hasOwnProperty(e)?r1:"null"===e?i1:"true"===e||"false"===e?t1:n1,value:e,start:t,end:Z0}}function Y1(){var t,e,n,r,i=Z0,o=J0.charCodeAt(Z0),a=J0[Z0];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++Z0,{type:a1,value:String.fromCharCode(o),start:i,end:Z0};default:if(61===(t=J0.charCodeAt(Z0+1)))switch(o){case 43:case 45:case 47:case 60:case 62:case 94:case 124:case 37:case 38:case 42:return Z0+=2,{type:a1,value:String.fromCharCode(o)+String.fromCharCode(t),start:i,end:Z0};case 33:case 61:return Z0+=2,61===J0.charCodeAt(Z0)&&++Z0,{type:a1,value:J0.slice(i,Z0),start:i,end:Z0}}}return">>>="===(r=J0.substr(Z0,4))?{type:a1,value:r,start:i,end:Z0+=4}:">>>"===(n=r.substr(0,3))||"<<="===n||">>="===n?{type:a1,value:n,start:i,end:Z0+=3}:a===(e=n.substr(0,2))[1]&&"+-<>&|".indexOf(a)>=0||"=>"===e?{type:a1,value:e,start:i,end:Z0+=2}:("//"===e&&o2({},b1,M1),"<>=!+-*%&|^/".indexOf(a)>=0?(++Z0,{type:a1,value:a,start:i,end:Z0}):void o2({},b1,M1))}function G1(){var t,e,n;if(B1(N1((n=J0[Z0]).charCodeAt(0))||"."===n,"Numeric literal must start with a decimal digit or a decimal point"),e=Z0,t="","."!==n){if(t=J0[Z0++],n=J0[Z0],"0"===t){if("x"===n||"X"===n)return++Z0,function(t){let e="";for(;Z0<K0&&O1(J0[Z0]);)e+=J0[Z0++];return 0===e.length&&o2({},b1,M1),U1(J0.charCodeAt(Z0))&&o2({},b1,M1),{type:o1,value:parseInt("0x"+e,16),start:t,end:Z0}}(e);if(z1(n))return function(t){let e="0"+J0[Z0++];for(;Z0<K0&&z1(J0[Z0]);)e+=J0[Z0++];return(U1(J0.charCodeAt(Z0))||N1(J0.charCodeAt(Z0)))&&o2({},b1,M1),{type:o1,value:parseInt(e,8),octal:!0,start:t,end:Z0}}(e);n&&N1(n.charCodeAt(0))&&o2({},b1,M1)}for(;N1(J0.charCodeAt(Z0));)t+=J0[Z0++];n=J0[Z0]}if("."===n){for(t+=J0[Z0++];N1(J0.charCodeAt(Z0));)t+=J0[Z0++];n=J0[Z0]}if("e"===n||"E"===n)if(t+=J0[Z0++],"+"!==(n=J0[Z0])&&"-"!==n||(t+=J0[Z0++]),N1(J0.charCodeAt(Z0)))for(;N1(J0.charCodeAt(Z0));)t+=J0[Z0++];else o2({},b1,M1);return U1(J0.charCodeAt(Z0))&&o2({},b1,M1),{type:o1,value:parseFloat(t),start:e,end:Z0}}function V1(){var t,e,n,r;return Q0=null,I1(),t=Z0,e=function(){var t,e,n,r;for(B1("/"===(t=J0[Z0]),"Regular expression literal must start with a slash"),e=J0[Z0++],n=!1,r=!1;Z0<K0;)if(e+=t=J0[Z0++],"\\"===t)P1((t=J0[Z0++]).charCodeAt(0))&&o2({},F1),e+=t;else if(P1(t.charCodeAt(0)))o2({},F1);else if(n)"]"===t&&(n=!1);else{if("/"===t){r=!0;break}"["===t&&(n=!0)}return r||o2({},F1),{value:e.substr(1,e.length-2),literal:e}}(),n=function(){var t,e,n;for(e="",n="";Z0<K0&&L1((t=J0[Z0]).charCodeAt(0));)++Z0,"\\"===t&&Z0<K0?o2({},b1,M1):(n+=t,e+=t);return n.search(/[^gimuy]/g)>=0&&o2({},E1,n),{value:n,literal:e}}(),r=function(t,e){let n=t;e.indexOf("u")>=0&&(n=n.replace(/\\u\{([0-9a-fA-F]+)\}/g,((t,e)=>{if(parseInt(e,16)<=1114111)return"x";o2({},E1)})).replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"x"));try{new RegExp(n)}catch(r){o2({},E1)}try{return new RegExp(t,e)}catch(i){return null}}(e.value,n.value),{literal:e.literal+n.literal,value:r,regex:{pattern:e.value,flags:n.value},start:t,end:Z0}}function J1(){if(I1(),Z0>=K0)return{type:e1,start:Z0,end:Z0};const t=J0.charCodeAt(Z0);return U1(t)?X1():40===t||41===t||59===t?Y1():39===t||34===t?function(){var t,e,n,r,i="",o=!1;for(B1("'"===(t=J0[Z0])||'"'===t,"String literal must starts with a quote"),e=Z0,++Z0;Z0<K0;){if((n=J0[Z0++])===t){t="";break}if("\\"===n)if((n=J0[Z0++])&&P1(n.charCodeAt(0)))"\r"===n&&"\n"===J0[Z0]&&++Z0;else switch(n){case"u":case"x":"{"===J0[Z0]?(++Z0,i+=W1()):i+=q1(n);break;case"n":i+="\n";break;case"r":i+="\r";break;case"t":i+="\t";break;case"b":i+="\b";break;case"f":i+="\f";break;case"v":i+="\v";break;default:z1(n)?(0!==(r="01234567".indexOf(n))&&(o=!0),Z0<K0&&z1(J0[Z0])&&(o=!0,r=8*r+"01234567".indexOf(J0[Z0++]),"0123".indexOf(n)>=0&&Z0<K0&&z1(J0[Z0])&&(r=8*r+"01234567".indexOf(J0[Z0++]))),i+=String.fromCharCode(r)):i+=n}else{if(P1(n.charCodeAt(0)))break;i+=n}}return""!==t&&o2({},b1,M1),{type:s1,value:i,octal:o,start:e,end:Z0}}():46===t?N1(J0.charCodeAt(Z0+1))?G1():Y1():N1(t)?G1():Y1()}function Z1(){const t=Q0;return Z0=t.end,Q0=J1(),Z0=t.end,t}function K1(){const t=Z0;Q0=J1(),Z0=t}function Q1(t,e,n){const r=new G0("||"===t||"&&"===t?p1:l1);return r.operator=t,r.left=e,r.right=n,r}function t2(t,e){const n=new G0(c1);return n.callee=t,n.arguments=e,n}function e2(t){const e=new G0(h1);return e.name=t,e}function n2(t){const e=new G0(d1);return e.value=t.value,e.raw=J0.slice(t.start,t.end),t.regex&&("//"===e.raw&&(e.raw="/(?:)/"),e.regex=t.regex),e}function r2(t,e,n){const r=new G0(g1);return r.computed="["===t,r.object=e,r.property=n,r.computed||(n.member=!0),r}function i2(t,e,n){const r=new G0(y1);return r.key=e,r.value=n,r.kind=t,r}function o2(t,e){var n,r=Array.prototype.slice.call(arguments,2),i=e.replace(/%(\d)/g,((t,e)=>(B1(e<r.length,"Message reference must be in range"),r[e])));throw(n=new Error(i)).index=Z0,n.description=i,n}function a2(t){t.type===e1&&o2(t,D1),t.type===o1&&o2(t,x1),t.type===s1&&o2(t,_1),t.type===n1&&o2(t,w1),t.type===r1&&o2(t,A1),o2(t,b1,t.value)}function s2(t){const e=Z1();e.type===a1&&e.value===t||a2(e)}function u2(t){return Q0.type===a1&&Q0.value===t}function l2(t){return Q0.type===r1&&Q0.value===t}function c2(){const t=[];for(Z0=Q0.start,s2("[");!u2("]");)u2(",")?(Z1(),t.push(null)):(t.push(w2()),u2("]")||s2(","));return Z1(),function(t){const e=new G0(u1);return e.elements=t,e}(t)}function f2(){Z0=Q0.start;const t=Z1();return t.type===s1||t.type===o1?(t.octal&&o2(t,C1),n2(t)):e2(t.value)}function h2(){var t,e,n;return Z0=Q0.start,(t=Q0).type===n1?(n=f2(),s2(":"),i2("init",n,w2())):t.type!==e1&&t.type!==a1?(e=f2(),s2(":"),i2("init",e,w2())):void a2(t)}function d2(){var t,e,n=[],r={},i=String;for(Z0=Q0.start,s2("{");!u2("}");)e="$"+((t=h2()).key.type===h1?t.key.name:i(t.key.value)),Object.prototype.hasOwnProperty.call(r,e)?o2({},k1):r[e]=!0,n.push(t),u2("}")||s2(",");return s2("}"),function(t){const e=new G0(m1);return e.properties=t,e}(n)}const p2={if:1};function g2(){var t,e,n;if(u2("("))return function(){s2("(");const t=A2();return s2(")"),t}();if(u2("["))return c2();if(u2("{"))return d2();if(t=Q0.type,Z0=Q0.start,t===n1||p2[Q0.value])n=e2(Z1().value);else if(t===s1||t===o1)Q0.octal&&o2(Q0,C1),n=n2(Z1());else{if(t===r1)throw new Error(S1);t===t1?((e=Z1()).value="true"===e.value,n=n2(e)):t===i1?((e=Z1()).value=null,n=n2(e)):u2("/")||u2("/=")?(n=n2(V1()),K1()):a2(Z1())}return n}function m2(){const t=[];if(s2("("),!u2(")"))for(;Z0<K0&&(t.push(w2()),!u2(")"));)s2(",");return s2(")"),t}function y2(){Z0=Q0.start;const t=Z1();return function(t){return t.type===n1||t.type===r1||t.type===t1||t.type===i1}(t)||a2(t),e2(t.value)}function v2(){s2("[");const t=A2();return s2("]"),t}function b2(){const t=function(){var t;for(t=g2();;)if(u2("."))s2("."),t=r2(".",t,y2());else if(u2("("))t=t2(t,m2());else{if(!u2("["))break;t=r2("[",t,v2())}return t}();if(Q0.type===a1&&(u2("++")||u2("--")))throw new Error(S1);return t}function x2(){var t,e;if(Q0.type!==a1&&Q0.type!==r1)e=b2();else{if(u2("++")||u2("--"))throw new Error(S1);if(u2("+")||u2("-")||u2("~")||u2("!"))t=Z1(),e=x2(),e=function(t,e){const n=new G0(v1);return n.operator=t,n.argument=e,n.prefix=!0,n}(t.value,e);else{if(l2("delete")||l2("void")||l2("typeof"))throw new Error(S1);e=b2()}}return e}function _2(t){let e=0;if(t.type!==a1&&t.type!==r1)return 0;switch(t.value){case"||":e=1;break;case"&&":e=2;break;case"|":e=3;break;case"^":e=4;break;case"&":e=5;break;case"==":case"!=":case"===":case"!==":e=6;break;case"<":case">":case"<=":case">=":case"instanceof":case"in":e=7;break;case"<<":case">>":case">>>":e=8;break;case"+":case"-":e=9;break;case"*":case"/":case"%":e=11}return e}function w2(){var t,e;return t=function(){var t,e,n,r,i,o,a,s,u,l;if(t=Q0,u=x2(),0===(i=_2(r=Q0)))return u;for(r.prec=i,Z1(),e=[t,Q0],o=[u,r,a=x2()];(i=_2(Q0))>0;){for(;o.length>2&&i<=o[o.length-2].prec;)a=o.pop(),s=o.pop().value,u=o.pop(),e.pop(),n=Q1(s,u,a),o.push(n);(r=Z1()).prec=i,o.push(r),e.push(Q0),n=x2(),o.push(n)}for(n=o[l=o.length-1],e.pop();l>1;)e.pop(),n=Q1(o[l-1].value,o[l-2],n),l-=2;return n}(),u2("?")&&(Z1(),e=w2(),s2(":"),t=function(t,e,n){const r=new G0(f1);return r.test=t,r.consequent=e,r.alternate=n,r}(t,e,w2())),t}function A2(){const t=w2();if(u2(","))throw new Error(S1);return t}function D2(t){Z0=0,K0=(J0=t).length,Q0=null,K1();const e=A2();if(Q0.type!==e1)throw new Error("Unexpect token after expression.");return e}var E2={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 F2(t){function e(e,n,r){return i=>function(e,n,r,i){let o=t(n[0]);return r&&(o=r+"("+o+")",0===r.lastIndexOf("new ",0)&&(o="("+o+")")),o+"."+e+(i<0?"":0===i?"()":"("+n.slice(1).map(t).join(",")+")")}(e,i,n,r)}const n="new Date",r="String",i="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(e){e.length<3&&S0("Missing arguments to clamp function."),e.length>3&&S0("Too many arguments to clamp function.");const n=e.map(t);return"Math.max("+n[1]+", Math.min("+n[2]+","+n[0]+"))"},now:"Date.now",utc:"Date.UTC",datetime:n,date:e("getDate",n,0),day:e("getDay",n,0),year:e("getFullYear",n,0),month:e("getMonth",n,0),hours:e("getHours",n,0),minutes:e("getMinutes",n,0),seconds:e("getSeconds",n,0),milliseconds:e("getMilliseconds",n,0),time:e("getTime",n,0),timezoneoffset:e("getTimezoneOffset",n,0),utcdate:e("getUTCDate",n,0),utcday:e("getUTCDay",n,0),utcyear:e("getUTCFullYear",n,0),utcmonth:e("getUTCMonth",n,0),utchours:e("getUTCHours",n,0),utcminutes:e("getUTCMinutes",n,0),utcseconds:e("getUTCSeconds",n,0),utcmilliseconds:e("getUTCMilliseconds",n,0),length:e("length",null,-1),parseFloat:"parseFloat",parseInt:"parseInt",upper:e("toUpperCase",r,0),lower:e("toLowerCase",r,0),substring:e("substring",r),split:e("split",r),trim:e("trim",r,0),regexp:i,test:e("test",i),if:function(e){e.length<3&&S0("Missing arguments to if function."),e.length>3&&S0("Too many arguments to if function.");const n=e.map(t);return"("+n[0]+"?"+n[1]+":"+n[2]+")"}}}function C2(t){const e=(t=t||{}).allowed?R0(t.allowed):{},n=t.forbidden?R0(t.forbidden):{},r=t.constants||E2,i=(t.functions||F2)(f),o=t.globalvar,a=t.fieldvar,s=B0(o)?o:t=>`${o}["${t}"]`;let u={},l={},c=0;function f(t){if(z0(t))return t;const e=h[t.type];return null==e&&S0("Unsupported type: "+t.type),e(t)}const h={Literal:t=>t.raw,Identifier:t=>{const i=t.name;return c>0?i:O0(n,i)?S0("Illegal identifier: "+i):O0(r,i)?r[i]:O0(e,i)?i:(u[i]=1,s(i))},MemberExpression:t=>{const e=!t.computed,n=f(t.object);e&&(c+=1);const r=f(t.property);return n===a&&(l[function(t){const e=t&&t.length-1;return e&&('"'===t[0]&&'"'===t[e]||"'"===t[0]&&"'"===t[e])?t.slice(1,-1):t}(r)]=1),e&&(c-=1),n+(e?"."+r:"["+r+"]")},CallExpression:t=>{"Identifier"!==t.callee.type&&S0("Illegal callee type: "+t.callee.type);const e=t.callee.name,n=t.arguments,r=O0(i,e)&&i[e];return r||S0("Unrecognized function: "+e),B0(r)?r(n):r+"("+n.map(f).join(",")+")"},ArrayExpression:t=>"["+t.elements.map(f).join(",")+"]",BinaryExpression:t=>"("+f(t.left)+" "+t.operator+" "+f(t.right)+")",UnaryExpression:t=>"("+t.operator+f(t.argument)+")",ConditionalExpression:t=>"("+f(t.test)+"?"+f(t.consequent)+":"+f(t.alternate)+")",LogicalExpression:t=>"("+f(t.left)+t.operator+f(t.right)+")",ObjectExpression:t=>"{"+t.properties.map(f).join(",")+"}",Property:t=>{c+=1;const e=f(t.key);return c-=1,e+":"+f(t.value)}};function d(t){const e={code:f(t),globals:Object.keys(u),fields:Object.keys(l)};return u={},l={},e}return d.functions=i,d.constants=r,d}var k2=Math.random;const M2=Math.sqrt(2*Math.PI),S2=Math.SQRT2;let $2=NaN;function T2(t,e){t=t||0,e=null==e?1:e;let n,r,i=0,o=0;if($2===$2)i=$2,$2=NaN;else{do{i=2*k2()-1,o=2*k2()-1,n=i*i+o*o}while(0===n||n>1);r=Math.sqrt(-2*Math.log(n)/n),i*=r,$2=o*r}return t+i*e}function B2(t,e,n){const r=(t-(e||0))/(n=null==n?1:n);return Math.exp(-.5*r*r)/(n*M2)}function N2(t,e,n){const r=(t-(e=e||0))/(n=null==n?1:n),i=Math.abs(r);let o;if(i>37)o=0;else{const t=Math.exp(-i*i/2);let e;i<7.07106781186547?(e=.0352624965998911*i+.700383064443688,e=e*i+6.37396220353165,e=e*i+33.912866078383,e=e*i+112.079291497871,e=e*i+221.213596169931,e=e*i+220.206867912376,o=t*e,e=.0883883476483184*i+1.75566716318264,e=e*i+16.064177579207,e=e*i+86.7807322029461,e=e*i+296.564248779674,e=e*i+637.333633378831,e=e*i+793.826512519948,e=e*i+440.413735824752,o/=e):(e=i+.65,e=i+4/e,e=i+3/e,e=i+2/e,e=i+1/e,o=t/e/2.506628274631)}return r>0?1-o:o}function O2(t,e,n){return t<0||t>1?NaN:(e||0)+(null==n?1:n)*S2*function(t){let e,n=-Math.log((1-t)*(1+t));n<6.25?(n-=3.125,e=-364441206401782e-35,e=e*n-16850591381820166e-35,e=128584807152564e-32+e*n,e=11157877678025181e-33+e*n,e=e*n-1333171662854621e-31,e=20972767875968562e-33+e*n,e=6637638134358324e-30+e*n,e=e*n-4054566272975207e-29,e=e*n-8151934197605472e-29,e=26335093153082323e-28+e*n,e=e*n-12975133253453532e-27,e=e*n-5415412054294628e-26,e=1.0512122733215323e-9+e*n,e=e*n-4.112633980346984e-9,e=e*n-2.9070369957882005e-8,e=4.2347877827932404e-7+e*n,e=e*n-13654692000834679e-22,e=e*n-13882523362786469e-21,e=.00018673420803405714+e*n,e=e*n-.000740702534166267,e=e*n-.006033670871430149,e=.24015818242558962+e*n,e=1.6536545626831027+e*n):n<16?(n=Math.sqrt(n)-3.25,e=2.2137376921775787e-9,e=9.075656193888539e-8+e*n,e=e*n-2.7517406297064545e-7,e=1.8239629214389228e-8+e*n,e=15027403968909828e-22+e*n,e=e*n-4013867526981546e-21,e=29234449089955446e-22+e*n,e=12475304481671779e-21+e*n,e=e*n-47318229009055734e-21,e=6828485145957318e-20+e*n,e=24031110387097894e-21+e*n,e=e*n-.0003550375203628475,e=.0009532893797373805+e*n,e=e*n-.0016882755560235047,e=.002491442096107851+e*n,e=e*n-.003751208507569241,e=.005370914553590064+e*n,e=1.0052589676941592+e*n,e=3.0838856104922208+e*n):Number.isFinite(n)?(n=Math.sqrt(n)-5,e=-27109920616438573e-27,e=e*n-2.555641816996525e-10,e=1.5076572693500548e-9+e*n,e=e*n-3.789465440126737e-9,e=7.61570120807834e-9+e*n,e=e*n-1.496002662714924e-8,e=2.914795345090108e-8+e*n,e=e*n-6.771199775845234e-8,e=2.2900482228026655e-7+e*n,e=e*n-9.9298272942317e-7,e=4526062597223154e-21+e*n,e=e*n-1968177810553167e-20,e=7599527703001776e-20+e*n,e=e*n-.00021503011930044477,e=e*n-.00013871931833623122,e=1.0103004648645344+e*n,e=4.849906401408584+e*n):e=1/0;return e*t}(2*t-1)}function z2(t,e){return t=t||0,e=null==e?1:e,Math.exp(t+T2()*e)}function R2(t,e,n){if(t<=0)return 0;e=e||0,n=null==n?1:n;const r=(Math.log(t)-e)/n;return Math.exp(-.5*r*r)/(n*M2*t)}function P2(t,e,n){return N2(Math.log(t),e,n)}function U2(t,e,n){return Math.exp(O2(t,e,n))}function L2(t,e){return null==e&&(e=null==t?1:t,t=0),t+(e-t)*k2()}function j2(t,e,n){return null==n&&(n=null==e?1:e,e=0),t>=e&&t<=n?1/(n-e):0}function I2(t,e,n){return null==n&&(n=null==e?1:e,e=0),t<e?0:t>n?1:(t-e)/(n-e)}function q2(t,e,n){return null==n&&(n=null==e?1:e,e=0),t>=0&&t<=1?e+t*(n-e):NaN}Math.PI;function W2(t){const e=this.context.data[t];return e?e.values.value:[]}const H2=t=>function(e,n){return this.context.dataflow.locale()[t](n)(e)},X2=H2("format"),Y2=H2("timeFormat"),G2=H2("utcFormat"),V2=H2("timeParse"),J2=H2("utcParse"),Z2=new Date(2e3,0,1);function K2(t,e,n){return Number.isInteger(t)&&Number.isInteger(e)?(Z2.setYear(2e3),Z2.setMonth(t),Z2.setDate(e),Y2.call(this,Z2,n)):""}const Q2=":",t3="@",e3="%",n3="$";function r3(t,e,n,r){e[0].type!==P0&&QQ("First argument to data functions must be a string literal.");const i=e[0].value,o=Q2+i;if(!b0(o,r))try{r[o]=n.getData(i).tuplesRef()}catch(a){}}function i3(t,e,n,r){if(e[0].type===P0)o3(n,r,e[0].value);else for(t in n.scales)o3(n,r,t)}function o3(t,e,n){const r=e3+n;if(!b0(e,r))try{e[r]=t.scaleRef(n)}catch(i){}}function a3(t,e){if(m0(t))return t;if(w0(t)){const n=e.scales[t];return n&&tm(n.value)?n.value:void 0}}function s3(t,e,n){e.__bandwidth=t=>t&&t.bandwidth?t.bandwidth():0,n._bandwidth=i3,n._range=i3,n._scale=i3;const r=e=>"_["+(e.type===P0?D0(e3+e.value):D0(e3)+"+"+t(e))+"]";return{_bandwidth:t=>`this.__bandwidth(${r(t[0])})`,_range:t=>`${r(t[0])}.range()`,_scale:e=>`${r(e[0])}(${t(e[1])})`}}function u3(t,e){return function(n,r,i){if(n){const e=a3(n,(i||this).context);return e&&e.path[t](r)}return e(r)}}const l3=u3("area",TJ),c3=u3("bounds",aZ),f3=u3("centroid",vZ);function h3(t,e,n){try{t[e].apply(t,["EXPRESSION"].concat([].slice.call(n)))}catch(r){t.warn(r)}return n[n.length-1]}function d3(t){const e=t/255;return e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4)}function p3(t){const e=(0,uf.B8)(t);return.2126*d3(e.r)+.7152*d3(e.g)+.0722*d3(e.b)}function g3(t,e){return t===e||t!==t&&e!==e||(i0(t)?!(!i0(e)||t.length!==e.length)&&function(t,e){for(let n=0,r=t.length;n<r;++n)if(!g3(t[n],e[n]))return!1;return!0}(t,e):!(!o0(t)||!o0(e))&&m3(t,e))}function m3(t,e){for(const n in t)if(!g3(t[n],e[n]))return!1;return!0}function y3(t){return e=>m3(t,e)}const v3={};function b3(t){return i0(t)||ArrayBuffer.isView(t)?t:null}function x3(t){return b3(t)||(w0(t)?t:null)}const _3=t=>t.data;function w3(t,e){const n=W2.call(e,t);return n.root&&n.root.lookup||{}}const A3=()=>"undefined"!==typeof window&&window||null;function D3(t,e,n){if(!t)return[];const[r,i]=t,o=(new Wy).set(r[0],r[1],i[0],i[1]);return w_(n||this.context.dataflow.scenegraph().root,o,function(t){let e=null;if(t){const n=g0(t.marktype),r=g0(t.markname);e=t=>(!n.length||n.some((e=>t.marktype===e)))&&(!r.length||r.some((e=>t.name===e)))}return e}(e))}const E3={random:()=>k2(),cumulativeNormal:N2,cumulativeLogNormal:P2,cumulativeUniform:I2,densityNormal:B2,densityLogNormal:R2,densityUniform:j2,quantileNormal:O2,quantileLogNormal:U2,quantileUniform:q2,sampleNormal:T2,sampleLogNormal:z2,sampleUniform:L2,isArray:i0,isBoolean:function(t){return"boolean"===typeof t},isDate:x0,isDefined:t=>void 0!==t,isNumber:_0,isObject:o0,isRegExp:function(t){return"[object RegExp]"===Object.prototype.toString.call(t)},isString:w0,isTuple:Sa,isValid:t=>null!=t&&t===t,toBoolean:function(t){return null==t||""===t?null:!(!t||"false"===t||"0"===t)&&!!t},toDate:t=>function(t,e){return e=e||E0,null==t||""===t?null:e(t)}(t),toNumber:s0,toString:function(t){return null==t||""===t?null:t+""},indexof:function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return x3(t).indexOf(...n)},join:function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return b3(t).join(...n)},lastindexof:function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return x3(t).lastIndexOf(...n)},replace:function(t,e,n){return m0(n)&&QQ("Function argument passed to replace."),String(t).replace(e,n)},reverse:function(t){return b3(t).slice().reverse()},slice:function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return x3(t).slice(...n)},flush:function(t,e,n,r,i,o){if(!n&&0!==n)return o;const a=+n;let s,u=t[0],l=a0(t);l<u&&(s=u,u=l,l=s),s=Math.abs(e-u);const c=Math.abs(l-e);return s<c&&s<=a?r:c<=a?i:o},lerp:function(t,e){const n=t[0],r=a0(t),i=+e;return i?1===i?r:n+i*(r-n):n},merge:function(){const t=[].slice.call(arguments);return t.unshift({}),y0(...t)},pad:function(t,e,n,r){const i=n||" ",o=t+"",a=e-o.length;return a<=0?o:"left"===r?A0(i,a)+o:"center"===r?A0(i,~~(a/2))+o+A0(i,Math.ceil(a/2)):o+A0(i,a)},peek:a0,pluck:function(t,e){const n=v3[e]||(v3[e]=e0(e));return i0(t)?t.map(n):n(t)},span:function(t){return t&&a0(t)-t[0]||0},inrange:function(t,e,n,r){let i,o=e[0],a=e[e.length-1];return o>a&&(i=o,o=a,a=i),r=void 0===r||r,((n=void 0===n||n)?o<=t:o<t)&&(r?t<=a:t<a)},truncate:function(t,e,n,r){const i=null!=r?r:"\u2026",o=t+"",a=o.length,s=Math.max(0,e-i.length);return a<=e?o:"left"===n?i+o.slice(a-s):"center"===n?o.slice(0,Math.ceil(s/2))+i+o.slice(a-~~(s/2)):o.slice(0,s)+i},rgb:uf.B8,lab:Zp,hcl:ig,hsl:uf.Ym,luminance:p3,contrast:function(t,e){const n=p3(t),r=p3(e);return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)},sequence:Zs,format:X2,utcFormat:G2,utcParse:J2,utcOffset:vr,utcSequence:_r,timeFormat:Y2,timeParse:V2,timeOffset:yr,timeSequence:xr,timeUnitSpecifier:qn,monthFormat:function(t){return K2.call(this,t,1,"%B")},monthAbbrevFormat:function(t){return K2.call(this,t,1,"%b")},dayFormat:function(t){return K2.call(this,0,2+t,"%A")},dayAbbrevFormat:function(t){return K2.call(this,0,2+t,"%a")},quarter:function(t){return 1+~~(new Date(t).getMonth()/3)},utcquarter:function(t){return 1+~~(new Date(t).getUTCMonth()/3)},week:Yn,utcweek:Qn,dayofyear:Xn,utcdayofyear:Kn,warn:function(){return h3(this.context.dataflow,"warn",arguments)},info:function(){return h3(this.context.dataflow,"info",arguments)},debug:function(){return h3(this.context.dataflow,"debug",arguments)},extent:t=>function(t,e){let n,r,i,o,a=0;if(t&&(n=t.length))if(null==e){for(r=t[a];a<n&&(null==r||r!==r);r=t[++a]);for(i=o=r;a<n;++a)r=t[a],null!=r&&(r<i&&(i=r),r>o&&(o=r))}else{for(r=e(t[a]);a<n&&(null==r||r!==r);r=e(t[++a]));for(i=o=r;a<n;++a)r=e(t[a]),null!=r&&(r<i&&(i=r),r>o&&(o=r))}return[i,o]}(t),inScope:function(t){const e=this.context.group;let n=!1;if(e)for(;t;){if(t===e){n=!0;break}t=t.mark.group}return n},intersect:D3,clampRange:function(t,e,n){let r,i=t[0],o=t[1];return o<i&&(r=o,o=i,i=r),r=o-i,r>=n-e?[e,n]:[i=Math.min(Math.max(i,e),n-r),i+r]},pinchDistance:function(t){const e=t.touches,n=e[0].clientX-e[1].clientX,r=e[0].clientY-e[1].clientY;return Math.hypot(n,r)},pinchAngle:function(t){const e=t.touches;return Math.atan2(e[0].clientY-e[1].clientY,e[0].clientX-e[1].clientX)},screen:function(){const t=A3();return t?t.screen:{}},containerSize:function(){const t=this.context.dataflow,e=t.container&&t.container();return e?[e.clientWidth,e.clientHeight]:[void 0,void 0]},windowSize:function(){const t=A3();return t?[t.innerWidth,t.innerHeight]:[void 0,void 0]},bandspace:function(t,e,n){return Eg(t||0,e||0,n||0)},setdata:function(t,e){const n=this.context.dataflow,r=this.context.data[t].input;return n.pulse(r,n.changeset().remove(r0).insert(e)),1},pathShape:function(t){let e=null;return function(n){return n?dy(n,e=e||ey(t)):t}},panLinear:function(t,e){return d0(t,e,s0,n0)},panLog:function(t,e){var n=Math.sign(t[0]);return d0(t,e,l0(n),u0(n))},panPow:function(t,e,n){return d0(t,e,h0(n),h0(1/n))},panSymlog:function(t,e,n){return d0(t,e,c0(n),f0(n))},zoomLinear:function(t,e,n){return p0(t,e,n,s0,n0)},zoomLog:function(t,e,n){const r=Math.sign(t[0]);return p0(t,e,n,l0(r),u0(r))},zoomPow:function(t,e,n,r){return p0(t,e,n,h0(r),h0(1/r))},zoomSymlog:function(t,e,n,r){return p0(t,e,n,c0(r),f0(r))},encode:function(t,e,n){if(t){const n=this.context.dataflow,r=t.mark.source;n.pulse(r,n.changeset().encode(t,e))}return void 0!==n?n:t},modify:function(t,e,n,r,i,o){const a=this.context.dataflow,s=this.context.data[t],u=s.input,l=a.stamp();let c,f,h=s.changes;if(!1===a._trigger||!(u.value.length||e||r))return 0;if((!h||h.stamp<l)&&(s.changes=h=a.changeset(),h.stamp=l,a.runAfter((()=>{s.modified=!0,a.pulse(u,h).run()}),!0,1)),n&&(c=!0===n?r0:i0(n)||Sa(n)?n:y3(n),h.remove(c)),e&&h.insert(e),r&&(c=y3(r),u.value.some(c)?h.remove(c):h.insert(r)),i)for(f in o)h.modify(i,f,o[f]);return 1},lassoAppend:function(t,e,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:5;const i=(t=g0(t))[t.length-1];return void 0===i||Math.hypot(i[0]-e,i[1]-n)>r?[...t,[e,n]]:t},lassoPath:function(t){return g0(t).reduce(((e,n,r)=>{let[i,o]=n;return e+(0==r?`M ${i},${o} `:r===t.length-1?" Z":`L ${i},${o} `)}),"")},intersectLasso:function(t,e,n){const{x:r,y:i,mark:o}=n,a=(new Wy).set(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,Number.MIN_SAFE_INTEGER,Number.MIN_SAFE_INTEGER);for(const[s,u]of e)s<a.x1&&(a.x1=s),s>a.x2&&(a.x2=s),u<a.y1&&(a.y1=u),u>a.y2&&(a.y2=u);return a.translate(r,i),D3([[a.x1,a.y1],[a.x2,a.y2]],t,o).filter((t=>function(t,e,n){let r=0;for(let i=0,o=n.length-1;i<n.length;o=i++){const[a,s]=n[o],[u,l]=n[i];l>e!=s>e&&t<(a-u)*(e-l)/(s-l)+u&&r++}return 1&r}(t.x,t.y,e)))}},F3=["view","item","group","xy","x","y"],C3="event.vega.",k3="this.",M3={},S3={forbidden:["_"],allowed:["datum","event","item"],fieldvar:"datum",globalvar:t=>`_[${D0(n3+t)}]`,functions:function(t){const e=F2(t);F3.forEach((t=>e[t]=C3+t));for(const n in E3)e[n]=k3+n;return y0(e,s3(t,E3,M3)),e},constants:E2,visitors:M3},$3=C2(S3);function T3(t,e,n){return 1===arguments.length?E3[t]:(E3[t]=e,n&&(M3[t]=n),$3&&($3.functions[t]=k3+t),this)}T3("bandwidth",(function(t,e){const n=a3(t,(e||this).context);return n&&n.bandwidth?n.bandwidth():0}),i3),T3("copy",(function(t,e){const n=a3(t,(e||this).context);return n?n.copy():void 0}),i3),T3("domain",(function(t,e){const n=a3(t,(e||this).context);return n?n.domain():[]}),i3),T3("range",(function(t,e){const n=a3(t,(e||this).context);return n&&n.range?n.range():[]}),i3),T3("invert",(function(t,e,n){const r=a3(t,(n||this).context);return r?i0(e)?(r.invertRange||r.invert)(e):(r.invert||r.invertExtent)(e):void 0}),i3),T3("scale",(function(t,e,n){const r=a3(t,(n||this).context);return r?r(e):void 0}),i3),T3("gradient",(function(t,e,n,r,i){t=a3(t,(i||this).context);const o=Ym(e,n);let a=t.domain(),s=a[0],u=a0(a),l=n0;return u-s?l=pm(t,s,u):t=(t.interpolator?em("sequential")().interpolator(t.interpolator()):em("linear")().interpolate(t.interpolate()).range(t.range())).domain([s=0,u=1]),t.ticks&&(a=t.ticks(+r||15),s!==a[0]&&a.unshift(s),u!==a0(a)&&a.push(u)),a.forEach((e=>o.stop(l(e),t(e)))),o}),i3),T3("geoArea",l3,i3),T3("geoBounds",c3,i3),T3("geoCentroid",f3,i3),T3("geoShape",(function(t,e,n){const r=a3(t,(n||this).context);return function(t){return r?r.path.context(t)(e):""}}),i3),T3("indata",(function(t,e,n){const r=this.context.data[t]["index:"+e],i=r?r.value.get(n):void 0;return i?i.count:i}),(function(t,e,n,r){e[0].type!==P0&&QQ("First argument to indata must be a string literal."),e[1].type!==P0&&QQ("Second argument to indata must be a string literal.");const i=e[0].value,o=e[1].value,a=t3+o;b0(a,r)||(r[a]=n.getData(i).indataRef(n,o))})),T3("data",W2,r3),T3("treePath",(function(t,e,n){const r=w3(t,this),i=r[e],o=r[n];return i&&o?i.path(o).map(_3):void 0}),r3),T3("treeAncestors",(function(t,e){const n=w3(t,this)[e];return n?n.ancestors().map(_3):void 0}),r3),T3("vlSelectionTest",PZ,GZ),T3("vlSelectionIdTest",IZ,GZ),T3("vlSelectionResolve",WZ,GZ),T3("vlSelectionTuples",qZ);var B3=n(52847);function N3(t){return(0,Kt.Kn)(t)?t:{type:t||"pad"}}const O3=t=>+t||0,z3=t=>({top:t,bottom:t,left:t,right:t});function R3(t){return(0,Kt.Kn)(t)?t.signal?t:{top:O3(t.top),bottom:O3(t.bottom),left:O3(t.left),right:O3(t.right)}:z3(O3(t))}const P3=t=>(0,Kt.Kn)(t)&&!(0,Kt.kJ)(t)?(0,Kt.l7)({},t):{value:t};function U3(t,e,n,r){if(null!=n){return(0,Kt.Kn)(n)&&!(0,Kt.kJ)(n)||(0,Kt.kJ)(n)&&n.length&&(0,Kt.Kn)(n[0])?t.update[e]=n:t[r||"enter"][e]={value:n},1}return 0}function L3(t,e,n){for(const r in e)U3(t,r,e[r]);for(const r in n)U3(t,r,n[r],"update")}function j3(t,e,n){for(const r in e)n&&(0,Kt.nr)(n,r)||(t[r]=(0,Kt.l7)(t[r]||{},e[r]));return t}function I3(t,e){return e&&(e.enter&&e.enter[t]||e.update&&e.update[t])}const q3="mark",W3="frame",H3="scope",X3="axis",Y3="axis-domain",G3="axis-grid",V3="axis-label",J3="axis-tick",Z3="axis-title",K3="legend",Q3="legend-band",t5="legend-entry",e5="legend-gradient",n5="legend-label",r5="legend-symbol",i5="legend-title",o5="title",a5="title-text",s5="title-subtitle";function u5(t,e,n){t[e]=n&&n.signal?{signal:n.signal}:{value:n}}const l5=t=>(0,Kt.HD)(t)?(0,Kt.m8)(t):t.signal?`(${t.signal})`:d5(t);function c5(t){if(null!=t.gradient)return function(t){const e=[t.start,t.stop,t.count].map((t=>null==t?null:(0,Kt.m8)(t)));for(;e.length&&null==(0,Kt.fj)(e);)e.pop();return e.unshift(l5(t.gradient)),`gradient(${e.join(",")})`}(t);let e=t.signal?`(${t.signal})`:t.color?function(t){return t.c?f5("hcl",t.h,t.c,t.l):t.h||t.s?f5("hsl",t.h,t.s,t.l):t.l||t.a?f5("lab",t.l,t.a,t.b):t.r||t.g||t.b?f5("rgb",t.r,t.g,t.b):null}(t.color):null!=t.field?d5(t.field):void 0!==t.value?(0,Kt.m8)(t.value):void 0;return null!=t.scale&&(e=function(t,e){const n=l5(t.scale);null!=t.range?e=`lerp(_range(${n}), ${+t.range})`:(void 0!==e&&(e=`_scale(${n}, ${e})`),t.band&&(e=(e?e+"+":"")+`_bandwidth(${n})`+(1===+t.band?"":"*"+h5(t.band)),t.extra&&(e=`(datum.extra ? _scale(${n}, datum.extra.value) : ${e})`)),null==e&&(e="0"));return e}(t,e)),void 0===e&&(e=null),null!=t.exponent&&(e=`pow(${e},${h5(t.exponent)})`),null!=t.mult&&(e+=`*${h5(t.mult)}`),null!=t.offset&&(e+=`+${h5(t.offset)}`),t.round&&(e=`round(${e})`),e}const f5=(t,e,n,r)=>`(${t}(${[e,n,r].map(c5).join(",")})+'')`;function h5(t){return(0,Kt.Kn)(t)?"("+c5(t)+")":t}function d5(t){return p5((0,Kt.Kn)(t)?t:{datum:t})}function p5(t){let e,n,r;if(t.signal)e="datum",r=t.signal;else if(t.group||t.parent){for(n=Math.max(1,t.level||1),e="item";n-- >0;)e+=".mark.group";t.parent?(r=t.parent,e+=".datum"):r=t.group}else t.datum?(e="datum",r=t.datum):(0,Kt.vU)("Invalid field reference: "+(0,Kt.m8)(t));return t.signal||(r=(0,Kt.HD)(r)?(0,Kt._k)(r).map(Kt.m8).join("]["):p5(r)),e+"["+r+"]"}function g5(t,e,n,r,i,o){const a={};(o=o||{}).encoders={$encode:a},t=function(t,e,n,r,i){const o={},a={};let s,u,l,c;for(u in u="lineBreak","text"!==e||null==i[u]||I3(u,t)||u5(o,u,i[u]),("legend"==n||String(n).startsWith("axis"))&&(n=null),c=n===W3?i.group:n===q3?(0,Kt.l7)({},i.mark,i[e]):null,c)l=I3(u,t)||("fill"===u||"stroke"===u)&&(I3("fill",t)||I3("stroke",t)),l||u5(o,u,c[u]);for(u in(0,Kt.IX)(r).forEach((e=>{const n=i.style&&i.style[e];for(const r in n)I3(r,t)||u5(o,r,n[r])})),t=(0,Kt.l7)({},t),o)c=o[u],c.signal?(s=s||{})[u]=c:a[u]=c;return t.enter=(0,Kt.l7)(a,t.enter),s&&(t.update=(0,Kt.l7)(s,t.update)),t}(t,e,n,r,i.config);for(const s in t)a[s]=m5(t[s],e,o,i);return o}function m5(t,e,n,r){const i={},o={};for(const s in t)null!=t[s]&&(i[s]=y5((a=t[s],(0,Kt.kJ)(a)?function(t){let e="";return t.forEach((t=>{const n=c5(t);e+=t.test?`(${t.test})?${n}:`:n})),":"===(0,Kt.fj)(e)&&(e+="null"),e}(a):c5(a)),r,n,o));var a;return{$expr:{marktype:e,channels:i},$fields:Object.keys(o),$output:Object.keys(t)}}function y5(t,e,n,r){const i=PK(t,e);return i.$fields.forEach((t=>r[t]=1)),(0,Kt.l7)(n,i.$params),i.$expr}const v5="outer",b5=["value","update","init","react","bind"];function x5(t,e){(0,Kt.vU)(t+' for "outer" push: '+(0,Kt.m8)(e))}function _5(t,e){const n=t.name;if(t.push===v5)e.signals[n]||x5("No prior signal definition",n),b5.forEach((e=>{void 0!==t[e]&&x5("Invalid property ",e)}));else{const r=e.addSignal(n,t.value);!1===t.react&&(r.react=!1),t.bind&&e.addBinding(n,t.bind)}}function w5(t,e,n,r){this.id=-1,this.type=t,this.value=e,this.params=n,r&&(this.parent=r)}function A5(t,e,n,r){return new w5(t,e,n,r)}function D5(t,e){return A5("operator",t,e)}function E5(t){const e={$ref:t.id};return t.id<0&&(t.refs=t.refs||[]).push(e),e}function F5(t,e){return e?{$field:t,$name:e}:{$field:t}}const C5=F5("key");function k5(t,e){return{$compare:t,$order:e}}const M5="descending";function S5(t,e){return(t&&t.signal?"$"+t.signal:t||"")+(t&&e?"_":"")+(e&&e.signal?"$"+e.signal:e||"")}const $5="scope",T5="view";function B5(t){return t&&t.signal}function N5(t){if(B5(t))return!0;if((0,Kt.Kn)(t))for(const e in t)if(N5(t[e]))return!0;return!1}function O5(t,e){return null!=t?t:e}function z5(t){return t&&t.signal||t}const R5="timer";function P5(t,e){return(t.merge?U5:t.stream?L5:t.type?j5:(0,Kt.vU)("Invalid stream specification: "+(0,Kt.m8)(t)))(t,e)}function U5(t,e){const n=t.merge.map((t=>P5(t,e))),r=I5({merge:n},t,e);return e.addStream(r).id}function L5(t,e){const n=I5({stream:P5(t.stream,e)},t,e);return e.addStream(n).id}function j5(t,e){let n;t.type===R5?(n=e.event(R5,t.throttle),t={between:t.between,filter:t.filter}):n=e.event(function(t){return t===$5?T5:t||T5}(t.source),t.type);const r=I5({stream:n},t,e);return 1===Object.keys(r).length?n:e.addStream(r).id}function I5(t,e,n){let r=e.between;return r&&(2!==r.length&&(0,Kt.vU)('Stream "between" parameter must have 2 entries: '+(0,Kt.m8)(e)),t.between=[P5(r[0],n),P5(r[1],n)]),r=e.filter?[].concat(e.filter):[],(e.marktype||e.markname||e.markrole)&&r.push(function(t,e,n){const r="event.item";return r+(t&&"*"!==t?"&&"+r+".mark.marktype==='"+t+"'":"")+(n?"&&"+r+".mark.role==='"+n+"'":"")+(e?"&&"+r+".mark.name==='"+e+"'":"")}(e.marktype,e.markname,e.markrole)),e.source===$5&&r.push("inScope(event.item)"),r.length&&(t.filter=PK("("+r.join(")&&(")+")",n).$expr),null!=(r=e.throttle)&&(t.throttle=+r),null!=(r=e.debounce)&&(t.debounce=+r),e.consume&&(t.consume=!0),t}const q5={code:"_.$value",ast:{type:"Identifier",value:"value"}};function W5(t,e,n){const r=t.encode,i={target:n};let o=t.events,a=t.update,s=[];o||(0,Kt.vU)("Signal update missing events specification."),(0,Kt.HD)(o)&&(o=(0,B3.r)(o,e.isSubscope()?$5:T5)),o=(0,Kt.IX)(o).filter((t=>t.signal||t.scale?(s.push(t),0):1)),s.length>1&&(s=[H5(s)]),o.length&&s.push(o.length>1?{merge:o}:o[0]),null!=r&&(a&&(0,Kt.vU)("Signal encode and update are mutually exclusive."),a="encode(item(),"+(0,Kt.m8)(r)+")"),i.update=(0,Kt.HD)(a)?PK(a,e):null!=a.expr?PK(a.expr,e):null!=a.value?a.value:null!=a.signal?{$expr:q5,$params:{$value:e.signalRef(a.signal)}}:(0,Kt.vU)("Invalid signal update specification."),t.force&&(i.options={force:!0}),s.forEach((t=>e.addUpdate((0,Kt.l7)(function(t,e){return{source:t.signal?e.signalRef(t.signal):t.scale?e.scaleRef(t.scale):P5(t,e)}}(t,e),i))))}function H5(t){return{signal:"["+t.map((t=>t.scale?'scale("'+t.scale+'")':t.signal))+"]"}}const X5=t=>(e,n,r)=>A5(t,n,e||void 0,r),Y5=X5("aggregate"),G5=X5("axisticks"),V5=X5("bound"),J5=X5("collect"),Z5=X5("compare"),K5=X5("datajoin"),Q5=X5("encode"),t6=X5("expression"),e6=X5("facet"),n6=X5("field"),r6=X5("key"),i6=X5("legendentries"),o6=X5("load"),a6=X5("mark"),s6=X5("multiextent"),u6=X5("multivalues"),l6=X5("overlap"),c6=X5("params"),f6=X5("prefacet"),h6=X5("projection"),d6=X5("proxy"),p6=X5("relay"),g6=X5("render"),m6=X5("scale"),y6=X5("sieve"),v6=X5("sortitems"),b6=X5("viewlayout"),x6=X5("values");let _6=0;const w6={min:"min",max:"max",count:"sum"};function A6(t,e){const n=e.getScale(t.name).params;let r;for(r in n.domain=C6(t.domain,t,e),null!=t.range&&(n.range=O6(t,e,n)),null!=t.interpolate&&function(t,e){e.interpolate=D6(t.type||t),null!=t.gamma&&(e.interpolateGamma=D6(t.gamma))}(t.interpolate,n),null!=t.nice&&(n.nice=function(t){return(0,Kt.Kn)(t)?{interval:D6(t.interval),step:D6(t.step)}:D6(t)}(t.nice)),null!=t.bins&&(n.bins=function(t,e){return t.signal||(0,Kt.kJ)(t)?E6(t,e):e.objectProperty(t)}(t.bins,e)),t)(0,Kt.nr)(n,r)||"name"===r||(n[r]=D6(t[r],e))}function D6(t,e){return(0,Kt.Kn)(t)?t.signal?e.signalRef(t.signal):(0,Kt.vU)("Unsupported object: "+(0,Kt.m8)(t)):t}function E6(t,e){return t.signal?e.signalRef(t.signal):t.map((t=>D6(t,e)))}function F6(t){(0,Kt.vU)("Can not find data set: "+(0,Kt.m8)(t))}function C6(t,e,n){if(t)return t.signal?n.signalRef(t.signal):((0,Kt.kJ)(t)?k6:t.fields?S6:M6)(t,e,n);null==e.domainMin&&null==e.domainMax||(0,Kt.vU)("No scale domain defined for domainMin/domainMax to override.")}function k6(t,e,n){return t.map((t=>D6(t,n)))}function M6(t,e,n){const r=n.getData(t.data);return r||F6(t.data),om(e.type)?r.valuesRef(n,t.field,T6(t.sort,!1)):lm(e.type)?r.domainRef(n,t.field):r.extentRef(n,t.field)}function S6(t,e,n){const r=t.data,i=t.fields.reduce(((t,e)=>(e=(0,Kt.HD)(e)?{data:r,field:e}:(0,Kt.kJ)(e)||e.signal?function(t,e){const n="_:vega:_"+_6++,r=J5({});if((0,Kt.kJ)(t))r.value={$ingest:t};else if(t.signal){const i="setdata("+(0,Kt.m8)(n)+","+t.signal+")";r.params.input=e.signalRef(i)}return e.addDataPipeline(n,[r,y6({})]),{data:n,field:"data"}}(e,n):e,t.push(e),t)),[]);return(om(e.type)?$6:lm(e.type)?B6:N6)(t,n,i)}function $6(t,e,n){const r=T6(t.sort,!0);let i,o;const a=n.map((t=>{const n=e.getData(t.data);return n||F6(t.data),n.countsRef(e,t.field,r)})),s={groupby:C5,pulse:a};r&&(i=r.op||"count",o=r.field?S5(i,r.field):"count",s.ops=[w6[i]],s.fields=[e.fieldRef(o)],s.as=[o]),i=e.add(Y5(s));const u=e.add(J5({pulse:E5(i)}));return o=e.add(x6({field:C5,sort:e.sortRef(r),pulse:E5(u)})),E5(o)}function T6(t,e){return t&&(t.field||t.op?t.field||"count"===t.op?e&&t.field&&t.op&&!w6[t.op]&&(0,Kt.vU)("Multiple domain scales can not be sorted using "+t.op):(0,Kt.vU)("No field provided for sort aggregate op: "+t.op):(0,Kt.Kn)(t)?t.field="key":t={field:"key"}),t}function B6(t,e,n){const r=n.map((t=>{const n=e.getData(t.data);return n||F6(t.data),n.domainRef(e,t.field)}));return E5(e.add(u6({values:r})))}function N6(t,e,n){const r=n.map((t=>{const n=e.getData(t.data);return n||F6(t.data),n.extentRef(e,t.field)}));return E5(e.add(s6({extents:r})))}function O6(t,e,n){const r=e.config.range;let i=t.range;if(i.signal)return e.signalRef(i.signal);if((0,Kt.HD)(i)){if(r&&(0,Kt.nr)(r,i))return O6(t=(0,Kt.l7)({},t,{range:r[i]}),e,n);"width"===i?i=[0,{signal:"width"}]:"height"===i?i=om(t.type)?[0,{signal:"height"}]:[{signal:"height"},0]:(0,Kt.vU)("Unrecognized scale range value: "+(0,Kt.m8)(i))}else{if(i.scheme)return n.scheme=(0,Kt.kJ)(i.scheme)?E6(i.scheme,e):D6(i.scheme,e),i.extent&&(n.schemeExtent=E6(i.extent,e)),void(i.count&&(n.schemeCount=D6(i.count,e)));if(i.step)return void(n.rangeStep=D6(i.step,e));if(om(t.type)&&!(0,Kt.kJ)(i))return C6(i,t,e);(0,Kt.kJ)(i)||(0,Kt.vU)("Unsupported range type: "+(0,Kt.m8)(i))}return i.map((t=>((0,Kt.kJ)(t)?E6:D6)(t,e)))}function z6(t,e,n){return(0,Kt.kJ)(t)?t.map((t=>z6(t,e,n))):(0,Kt.Kn)(t)?t.signal?n.signalRef(t.signal):"fit"===e?t:(0,Kt.vU)("Unsupported parameter object: "+(0,Kt.m8)(t)):t}const R6="top",P6="left",U6="right",L6="bottom",j6="center",I6="vertical",q6="start",W6="end",H6="index",X6="label",Y6="offset",G6="perc",V6="perc2",J6="value",Z6="guide-label",K6="guide-title",Q6="group-title",t4="group-subtitle",e4="symbol",n4="gradient",r4="discrete",i4="size",o4=[i4,"shape","fill","stroke","strokeWidth","strokeDash","opacity"],a4={name:1,style:1,interactive:1},s4={value:0},u4={value:1},l4="group",c4="rect",f4="rule",h4="symbol",d4="text";function p4(t){return t.type=l4,t.interactive=t.interactive||!1,t}function g4(t,e){const n=(n,r)=>O5(t[n],O5(e[n],r));return n.isVertical=n=>I6===O5(t.direction,e.direction||(n?e.symbolDirection:e.gradientDirection)),n.gradientLength=()=>O5(t.gradientLength,e.gradientLength||e.gradientWidth),n.gradientThickness=()=>O5(t.gradientThickness,e.gradientThickness||e.gradientHeight),n.entryColumns=()=>O5(t.columns,O5(e.columns,+n.isVertical(!0))),n}function m4(t,e){const n=e&&(e.update&&e.update[t]||e.enter&&e.enter[t]);return n&&n.signal?n:n?n.value:null}function y4(t,e,n){return`item.anchor === '${q6}' ? ${t} : item.anchor === '${W6}' ? ${e} : ${n}`}const v4=y4((0,Kt.m8)(P6),(0,Kt.m8)(U6),(0,Kt.m8)(j6));function b4(t,e){return e?t?(0,Kt.Kn)(t)?Object.assign({},t,{offset:b4(t.offset,e)}):{value:t,offset:e}:e:t}function x4(t,e){return e?(t.name=e.name,t.style=e.style||t.style,t.interactive=!!e.interactive,t.encode=j3(t.encode,e,a4)):t.interactive=!1,t}function _4(t,e,n,r){const i=g4(t,n),o=i.isVertical(),a=i.gradientThickness(),s=i.gradientLength();let u,l,c,f,h;o?(l=[0,1],c=[0,0],f=a,h=s):(l=[0,0],c=[1,0],f=s,h=a);const d={enter:u={opacity:s4,x:s4,y:s4,width:P3(f),height:P3(h)},update:(0,Kt.l7)({},u,{opacity:u4,fill:{gradient:e,start:l,stop:c}}),exit:{opacity:s4}};return L3(d,{stroke:i("gradientStrokeColor"),strokeWidth:i("gradientStrokeWidth")},{opacity:i("gradientOpacity")}),x4({type:c4,role:e5,encode:d},r)}function w4(t,e,n,r,i){const o=g4(t,n),a=o.isVertical(),s=o.gradientThickness(),u=o.gradientLength();let l,c,f,h,d="";a?(l="y",f="y2",c="x",h="width",d="1-"):(l="x",f="x2",c="y",h="height");const p={opacity:s4,fill:{scale:e,field:J6}};p[l]={signal:d+"datum."+G6,mult:u},p[c]=s4,p[f]={signal:d+"datum."+V6,mult:u},p[h]=P3(s);const g={enter:p,update:(0,Kt.l7)({},p,{opacity:u4}),exit:{opacity:s4}};return L3(g,{stroke:o("gradientStrokeColor"),strokeWidth:o("gradientStrokeWidth")},{opacity:o("gradientOpacity")}),x4({type:c4,role:Q3,key:J6,from:i,encode:g},r)}const A4=`datum.${G6}<=0?"${P6}":datum.${G6}>=1?"${U6}":"${j6}"`,D4=`datum.${G6}<=0?"${L6}":datum.${G6}>=1?"${R6}":"middle"`;function E4(t,e,n,r){const i=g4(t,e),o=i.isVertical(),a=P3(i.gradientThickness()),s=i.gradientLength();let u,l,c,f,h=i("labelOverlap"),d="";const p={enter:u={opacity:s4},update:l={opacity:u4,text:{field:X6}},exit:{opacity:s4}};return L3(p,{fill:i("labelColor"),fillOpacity:i("labelOpacity"),font:i("labelFont"),fontSize:i("labelFontSize"),fontStyle:i("labelFontStyle"),fontWeight:i("labelFontWeight"),limit:O5(t.labelLimit,e.gradientLabelLimit)}),o?(u.align={value:"left"},u.baseline=l.baseline={signal:D4},c="y",f="x",d="1-"):(u.align=l.align={signal:A4},u.baseline={value:"top"},c="x",f="y"),u[c]=l[c]={signal:d+"datum."+G6,mult:s},u[f]=l[f]=a,a.offset=O5(t.labelOffset,e.gradientLabelOffset)||0,h=h?{separation:i("labelSeparation"),method:h,order:"datum."+H6}:void 0,x4({type:d4,role:n5,style:Z6,key:J6,from:r,encode:p,overlap:h},n)}function F4(t,e,n,r,i){const o=g4(t,e),a=n.entries,s=!(!a||!a.interactive),u=a?a.name:void 0,l=o("clipHeight"),c=o("symbolOffset"),f={data:"value"},h=`(${i}) ? datum.${Y6} : datum.${i4}`,d=l?P3(l):{field:i4},p=`datum.${H6}`,g=`max(1, ${i})`;let m,y,v,b,x;d.mult=.5,m={enter:y={opacity:s4,x:{signal:h,mult:.5,offset:c},y:d},update:v={opacity:u4,x:y.x,y:y.y},exit:{opacity:s4}};let _=null,w=null;t.fill||(_=e.symbolBaseFillColor,w=e.symbolBaseStrokeColor),L3(m,{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")}),o4.forEach((e=>{t[e]&&(v[e]=y[e]={scale:t[e],field:J6})}));const A=x4({type:h4,role:r5,key:J6,from:f,clip:!!l||void 0,encode:m},n.symbols),D=P3(c);D.offset=o("labelOffset"),m={enter:y={opacity:s4,x:{signal:h,offset:D},y:d},update:v={opacity:u4,text:{field:X6},x:y.x,y:y.y},exit:{opacity:s4}},L3(m,{align:o("labelAlign"),baseline:o("labelBaseline"),fill:o("labelColor"),fillOpacity:o("labelOpacity"),font:o("labelFont"),fontSize:o("labelFontSize"),fontStyle:o("labelFontStyle"),fontWeight:o("labelFontWeight"),limit:o("labelLimit")});const E=x4({type:d4,role:n5,style:Z6,key:J6,from:f,encode:m},n.labels);return m={enter:{noBound:{value:!l},width:s4,height:l?P3(l):s4,opacity:s4},exit:{opacity:s4},update:v={opacity:u4,row:{signal:null},column:{signal:null}}},o.isVertical(!0)?(b=`ceil(item.mark.items.length / ${g})`,v.row.signal=`${p}%${b}`,v.column.signal=`floor(${p} / ${b})`,x={field:["row",p]}):(v.row.signal=`floor(${p} / ${g})`,v.column.signal=`${p} % ${g}`,x={field:p}),v.column.signal=`(${i})?${v.column.signal}:${p}`,p4({role:H3,from:r={facet:{data:r,name:"value",groupby:H6}},encode:j3(m,a,a4),marks:[A,E],name:u,interactive:s,sort:x})}const C4='item.orient === "left"',k4='item.orient === "right"',M4=`(${C4} || ${k4})`,S4=`datum.vgrad && ${M4}`,$4=y4('"top"','"bottom"','"middle"'),T4=`datum.vgrad && ${k4} ? (${y4('"right"','"left"','"center"')}) : (${M4} && !(datum.vgrad && ${C4})) ? "left" : ${v4}`,B4=`item._anchor || (${M4} ? "middle" : "start")`,N4=`${S4} ? (${C4} ? -90 : 90) : 0`,O4=`${M4} ? (datum.vgrad ? (${k4} ? "bottom" : "top") : ${$4}) : "top"`;function z4(t,e){let n;return(0,Kt.Kn)(t)&&(t.signal?n=t.signal:t.path?n="pathShape("+R4(t.path)+")":t.sphere&&(n="geoShape("+R4(t.sphere)+', {type: "Sphere"})')),n?e.signalRef(n):!!t}function R4(t){return(0,Kt.Kn)(t)&&t.signal?t.signal:(0,Kt.m8)(t)}function P4(t){const e=t.role||"";return e.indexOf("axis")&&e.indexOf("legend")&&e.indexOf("title")?t.type===l4?H3:e||q3:e}function U4(t){return{marktype:t.type,name:t.name||void 0,role:t.role||P4(t),zindex:+t.zindex||void 0,aria:t.aria,description:t.description}}function L4(t,e){return t&&t.signal?e.signalRef(t.signal):!1!==t}function j4(t,e){const n=hs(t.type);n||(0,Kt.vU)("Unrecognized transform type: "+(0,Kt.m8)(t.type));const r=A5(n.type.toLowerCase(),null,I4(n,t,e));return t.signal&&e.addSignal(t.signal,e.proxy(r)),r.metadata=n.metadata||{},r}function I4(t,e,n){const r={},i=t.params.length;for(let o=0;o<i;++o){const i=t.params[o];r[i.name]=q4(i,e,n)}return r}function q4(t,e,n){const r=t.type,i=e[t.name];return"index"===r?function(t,e,n){(0,Kt.HD)(e.from)||(0,Kt.vU)('Lookup "from" parameter must be a string literal.');return n.getData(e.from).lookupRef(n,e.key)}(0,e,n):void 0!==i?"param"===r?function(t,e,n){const r=e[t.name];return t.array?((0,Kt.kJ)(r)||(0,Kt.vU)("Expected an array of sub-parameters. Instead: "+(0,Kt.m8)(r)),r.map((e=>H4(t,e,n)))):H4(t,r,n)}(t,e,n):"projection"===r?n.projectionRef(e[t.name]):t.array&&!B5(i)?i.map((e=>W4(t,e,n))):W4(t,i,n):void(t.required&&(0,Kt.vU)("Missing required "+(0,Kt.m8)(e.type)+" parameter: "+(0,Kt.m8)(t.name)))}function W4(t,e,n){const r=t.type;if(B5(e))return V4(r)?(0,Kt.vU)("Expression references can not be signals."):J4(r)?n.fieldRef(e):Z4(r)?n.compareRef(e):n.signalRef(e.signal);{const i=t.expr||J4(r);return i&&X4(e)?n.exprRef(e.expr,e.as):i&&Y4(e)?F5(e.field,e.as):V4(r)?PK(e,n):G4(r)?E5(n.getData(e).values):J4(r)?F5(e):Z4(r)?n.compareRef(e):e}}function H4(t,e,n){const r=t.params.length;let i;for(let a=0;a<r;++a){i=t.params[a];for(const t in i.key)if(i.key[t]!==e[t]){i=null;break}if(i)break}i||(0,Kt.vU)("Unsupported parameter: "+(0,Kt.m8)(e));const o=(0,Kt.l7)(I4(i,e,n),i.key);return E5(n.add(c6(o)))}const X4=t=>t&&t.expr,Y4=t=>t&&t.field,G4=t=>"data"===t,V4=t=>"expr"===t,J4=t=>"field"===t,Z4=t=>"compare"===t;function K4(t,e){return t.$ref?t:t.data&&t.data.$ref?t.data:E5(e.getData(t.data).output)}function Q4(t,e,n,r,i){this.scope=t,this.input=e,this.output=n,this.values=r,this.aggregate=i,this.index={}}function t8(t){return(0,Kt.HD)(t)?t:null}function e8(t,e,n){const r=S5(n.op,n.field);let i;if(e.ops){for(let o=0,a=e.as.length;o<a;++o)if(e.as[o]===r)return}else e.ops=["count"],e.fields=[null],e.as=["count"];n.op&&(e.ops.push((i=n.op.signal)?t.signalRef(i):n.op),e.fields.push(t.fieldRef(n.field)),e.as.push(r))}function n8(t,e,n,r,i,o,a){const s=e[n]||(e[n]={}),u=function(t){return(0,Kt.Kn)(t)?(t.order===M5?"-":"+")+S5(t.op,t.field):""}(o);let l,c,f=t8(i);if(null!=f&&(t=e.scope,f+=u?"|"+u:"",l=s[f]),!l){const n=o?{field:C5,pulse:e.countsRef(t,i,o)}:{field:t.fieldRef(i),pulse:E5(e.output)};u&&(n.sort=t.sortRef(o)),c=t.add(A5(r,void 0,n)),a&&(e.index[i]=c),l=E5(c),null!=f&&(s[f]=l)}return l}function r8(t,e,n){const r=t.remove,i=t.insert,o=t.toggle,a=t.modify,s=t.values,u=e.add(D5()),l=PK("if("+t.trigger+',modify("'+n+'",'+[i,r,o,a,s].map((t=>null==t?"null":t)).join(",")+"),0)",e);u.update=l.$expr,u.params=l.$params}function i8(t,e){const n=P4(t),r=t.type===l4,i=t.from&&t.from.facet,o=t.overlap;let a,s,u,l,c,f,h,d=t.layout||n===H3||n===W3;const p=n===q3||d||i,g=function(t,e,n){let r,i,o,a,s;return t?(r=t.facet)&&(e||(0,Kt.vU)("Only group marks can be faceted."),null!=r.field?a=s=K4(r,n):(t.data?s=E5(n.getData(t.data).aggregate):(o=j4((0,Kt.l7)({type:"aggregate",groupby:(0,Kt.IX)(r.groupby)},r.aggregate),n),o.params.key=n.keyRef(r.groupby),o.params.pulse=K4(r,n),a=s=E5(n.add(o))),i=n.keyRef(r.groupby,!0))):a=E5(n.add(J5(null,[{}]))),a||(a=K4(t,n)),{key:i,pulse:a,parent:s}}(t.from,r,e);s=e.add(K5({key:g.key||(t.key?F5(t.key):void 0),pulse:g.pulse,clean:!r}));const m=E5(s);s=u=e.add(J5({pulse:m})),s=e.add(a6({markdef:U4(t),interactive:L4(t.interactive,e),clip:z4(t.clip,e),context:{$context:!0},groups:e.lookup(),parent:e.signals.parent?e.signalRef("parent"):null,index:e.markpath(),pulse:E5(s)}));const y=E5(s);s=l=e.add(Q5(g5(t.encode,t.type,n,t.style,e,{mod:!1,pulse:y}))),s.params.parent=e.encode(),t.transform&&t.transform.forEach((t=>{const n=j4(t,e),r=n.metadata;(r.generates||r.changes)&&(0,Kt.vU)("Mark transforms should not generate new data."),r.nomod||(l.params.mod=!0),n.params.pulse=E5(s),e.add(s=n)})),t.sort&&(s=e.add(v6({sort:e.compareRef(t.sort),pulse:E5(s)})));const v=E5(s);(i||d)&&(d=e.add(b6({layout:e.objectProperty(t.layout),legends:e.legends,mark:y,pulse:v})),f=E5(d));const b=e.add(V5({mark:y,pulse:f||v}));h=E5(b),r&&(p&&(a=e.operators,a.pop(),d&&a.pop()),e.pushState(v,f||h,m),i?function(t,e,n){const r=t.from.facet,i=r.name,o=K4(r,e);let a;r.name||(0,Kt.vU)("Facet must have a name: "+(0,Kt.m8)(r)),r.data||(0,Kt.vU)("Facet must reference a data set: "+(0,Kt.m8)(r)),r.field?a=e.add(f6({field:e.fieldRef(r.field),pulse:o})):r.groupby?a=e.add(e6({key:e.keyRef(r.groupby),group:E5(e.proxy(n.parent)),pulse:o})):(0,Kt.vU)("Facet must specify groupby or field: "+(0,Kt.m8)(r));const s=e.fork(),u=s.add(J5()),l=s.add(y6({pulse:E5(u)}));s.addData(i,new Q4(s,u,u,l)),s.addSignal("parent",null),a.params.subflow={$subflow:s.parse(t).toRuntime()}}(t,e,g):p?function(t,e,n){const r=e.add(f6({pulse:n.pulse})),i=e.fork();i.add(y6()),i.addSignal("parent",null),r.params.subflow={$subflow:i.parse(t).toRuntime()}}(t,e,g):e.parse(t),e.popState(),p&&(d&&a.push(d),a.push(b))),o&&(h=function(t,e,n){const r=t.method,i=t.bound,o=t.separation,a={separation:B5(o)?n.signalRef(o.signal):o,method:B5(r)?n.signalRef(r.signal):r,pulse:e};t.order&&(a.sort=n.compareRef({field:t.order}));if(i){const t=i.tolerance;a.boundTolerance=B5(t)?n.signalRef(t.signal):+t,a.boundScale=n.scaleRef(i.scale),a.boundOrient=i.orient}return E5(n.add(l6(a)))}(o,h,e));const x=e.add(g6({pulse:h})),_=e.add(y6({pulse:E5(x)},void 0,e.parent()));null!=t.name&&(c=t.name,e.addData(c,new Q4(e,u,x,_)),t.on&&t.on.forEach((t=>{(t.insert||t.remove||t.toggle)&&(0,Kt.vU)("Marks only support modify triggers."),r8(t,e,c)})))}function o8(t,e){const n=e.config.legend,r=t.encode||{},i=g4(t,n),o=r.legend||{},a=o.name||void 0,s=o.interactive,u=o.style,l={};let c,f,h,d=0;o4.forEach((e=>t[e]?(l[e]=t[e],d=d||t[e]):0)),d||(0,Kt.vU)("Missing valid scale for legend.");const p=function(t,e){let n=t.type||e4;t.type||1!==function(t){return o4.reduce(((e,n)=>e+(t[n]?1:0)),0)}(t)||!t.fill&&!t.stroke||(n=im(e)?n4:am(e)?r4:e4);return n!==n4?n:am(e)?r4:n4}(t,e.scaleType(d)),g={title:null!=t.title,scales:l,type:p,vgrad:"symbol"!==p&&i.isVertical()},m=E5(e.add(J5(null,[g]))),y=E5(e.add(i6(f={type:p,scale:e.scaleRef(d),count:e.objectProperty(i("tickCount")),limit:e.property(i("symbolLimit")),values:e.objectProperty(t.values),minstep:e.property(t.tickMinStep),formatType:e.property(t.formatType),formatSpecifier:e.property(t.format)})));return p===n4?(h=[_4(t,d,n,r.gradient),E4(t,n,r.labels,y)],f.count=f.count||e.signalRef(`max(2,2*floor((${z5(i.gradientLength())})/100))`)):p===r4?h=[w4(t,d,n,r.gradient,y),E4(t,n,r.labels,y)]:(c=function(t,e){const n=g4(t,e);return{align:n("gridAlign"),columns:n.entryColumns(),center:{row:!0,column:!1},padding:{row:n("rowPadding"),column:n("columnPadding")}}}(t,n),h=[F4(t,n,r,y,z5(c.columns))],f.size=function(t,e,n){const r=z5(s8("size",t,n)),i=z5(s8("strokeWidth",t,n)),o=z5(function(t,e,n){return m4("fontSize",t)||function(t,e,n){const r=e.config.style[n];return r&&r[t]}("fontSize",e,n)}(n[1].encode,e,Z6));return PK(`max(ceil(sqrt(${r})+${i}),${o})`,e)}(t,e,h[0].marks)),h=[p4({role:t5,from:m,encode:{enter:{x:{value:0},y:{value:0}}},marks:h,layout:c,interactive:s})],g.title&&h.push(function(t,e,n,r){const i=g4(t,e),o={enter:{opacity:s4},update:{opacity:u4,x:{field:{group:"padding"}},y:{field:{group:"padding"}}},exit:{opacity:s4}};return L3(o,{orient:i("titleOrient"),_anchor:i("titleAnchor"),anchor:{signal:B4},angle:{signal:N4},align:{signal:T4},baseline:{signal:O4},text:t.title,fill:i("titleColor"),fillOpacity:i("titleOpacity"),font:i("titleFont"),fontSize:i("titleFontSize"),fontStyle:i("titleFontStyle"),fontWeight:i("titleFontWeight"),limit:i("titleLimit"),lineHeight:i("titleLineHeight")},{align:i("titleAlign"),baseline:i("titleBaseline")}),x4({type:d4,role:i5,style:K6,from:r,encode:o},n)}(t,n,r.title,m)),i8(p4({role:K3,from:m,encode:j3(a8(i,t,n),o,a4),marks:h,aria:i("aria"),description:i("description"),zindex:i("zindex"),name:a,interactive:s,style:u}),e)}function a8(t,e,n){const r={enter:{},update:{}};return L3(r,{orient:t("orient"),offset:t("offset"),padding:t("padding"),titlePadding:t("titlePadding"),cornerRadius:t("cornerRadius"),fill:t("fillColor"),stroke:t("strokeColor"),strokeWidth:n.strokeWidth,strokeDash:n.strokeDash,x:t("legendX"),y:t("legendY"),format:e.format,formatType:e.formatType}),r}function s8(t,e,n){return e[t]?`scale("${e[t]}",datum)`:m4(t,n[0].encode)}Q4.fromEntries=function(t,e){const n=e.length,r=e[n-1],i=e[n-2];let o=e[0],a=null,s=1;for(o&&"load"===o.type&&(o=e[1]),t.add(e[0]);s<n;++s)e[s].params.pulse=E5(e[s-1]),t.add(e[s]),"aggregate"===e[s].type&&(a=e[s]);return new Q4(t,o,i,r,a)},Q4.prototype={countsRef(t,e,n){const r=this,i=r.counts||(r.counts={}),o=t8(e);let a,s,u;return null!=o&&(t=r.scope,a=i[o]),a?n&&n.field&&e8(t,a.agg.params,n):(u={groupby:t.fieldRef(e,"key"),pulse:E5(r.output)},n&&n.field&&e8(t,u,n),s=t.add(Y5(u)),a=t.add(J5({pulse:E5(s)})),a={agg:s,ref:E5(a)},null!=o&&(i[o]=a)),a.ref},tuplesRef(){return E5(this.values)},extentRef(t,e){return n8(t,this,"extent","extent",e,!1)},domainRef(t,e){return n8(t,this,"domain","values",e,!1)},valuesRef(t,e,n){return n8(t,this,"vals","values",e,n||!0)},lookupRef(t,e){return n8(t,this,"lookup","tupleindex",e,!1)},indataRef(t,e){return n8(t,this,"indata","tupleindex",e,!0,!0)}};const u8=`item.orient==="${P6}"?-90:item.orient==="${U6}"?90:0`;function l8(t,e){const n=g4(t=(0,Kt.HD)(t)?{text:t}:t,e.config.title),r=t.encode||{},i=r.group||{},o=i.name||void 0,a=i.interactive,s=i.style,u=[],l=E5(e.add(J5(null,[{}])));return u.push(function(t,e,n,r){const i={value:0},o=t.text,a={enter:{opacity:i},update:{opacity:{value:1}},exit:{opacity:i}};return L3(a,{text:o,align:{signal:"item.mark.group.align"},angle:{signal:"item.mark.group.angle"},limit:{signal:"item.mark.group.limit"},baseline:"top",dx:e("dx"),dy:e("dy"),fill:e("color"),font:e("font"),fontSize:e("fontSize"),fontStyle:e("fontStyle"),fontWeight:e("fontWeight"),lineHeight:e("lineHeight")},{align:e("align"),angle:e("angle"),baseline:e("baseline")}),x4({type:d4,role:a5,style:Q6,from:r,encode:a},n)}(t,n,function(t){const e=t.encode;return e&&e.title||(0,Kt.l7)({name:t.name,interactive:t.interactive,style:t.style},e)}(t),l)),t.subtitle&&u.push(function(t,e,n,r){const i={value:0},o=t.subtitle,a={enter:{opacity:i},update:{opacity:{value:1}},exit:{opacity:i}};return L3(a,{text:o,align:{signal:"item.mark.group.align"},angle:{signal:"item.mark.group.angle"},limit:{signal:"item.mark.group.limit"},baseline:"top",dx:e("dx"),dy:e("dy"),fill:e("subtitleColor"),font:e("subtitleFont"),fontSize:e("subtitleFontSize"),fontStyle:e("subtitleFontStyle"),fontWeight:e("subtitleFontWeight"),lineHeight:e("subtitleLineHeight")},{align:e("align"),angle:e("angle"),baseline:e("baseline")}),x4({type:d4,role:s5,style:t4,from:r,encode:a},n)}(t,n,r.subtitle,l)),i8(p4({role:o5,from:l,encode:c8(n,i),marks:u,aria:n("aria"),description:n("description"),zindex:n("zindex"),name:o,interactive:a,style:s}),e)}function c8(t,e){const n={enter:{},update:{}};return L3(n,{orient:t("orient"),anchor:t("anchor"),align:{signal:v4},angle:{signal:u8},limit:t("limit"),frame:t("frame"),offset:t("offset")||0,padding:t("subtitlePadding")}),j3(n,e,a4)}function f8(t,e){const n=[];t.transform&&t.transform.forEach((t=>{n.push(j4(t,e))})),t.on&&t.on.forEach((n=>{r8(n,e,t.name)})),e.addDataPipeline(t.name,function(t,e,n){const r=[];let i,o,a,s,u,l=null,c=!1,f=!1;t.values?B5(t.values)||N5(t.format)?(r.push(d8(e,t)),r.push(l=h8())):r.push(l=h8({$ingest:t.values,$format:t.format})):t.url?N5(t.url)||N5(t.format)?(r.push(d8(e,t)),r.push(l=h8())):r.push(l=h8({$request:t.url,$format:t.format})):t.source&&(l=i=(0,Kt.IX)(t.source).map((t=>E5(e.getData(t).output))),r.push(null));for(o=0,a=n.length;o<a;++o)s=n[o],u=s.metadata,l||u.source||r.push(l=h8()),r.push(s),u.generates&&(f=!0),u.modifies&&!f&&(c=!0),u.source?l=s:u.changes&&(l=null);i&&(a=i.length-1,r[0]=p6({derive:c,pulse:a?i:i[0]}),(c||a)&&r.splice(1,0,h8()));l||r.push(h8());return r.push(y6({})),r}(t,e,n))}function h8(t){const e=J5({},t);return e.metadata={source:!0},e}function d8(t,e){return o6({url:e.url?t.property(e.url):void 0,async:e.async?t.property(e.async):void 0,values:e.values?t.property(e.values):void 0,format:t.objectProperty(e.format)})}const p8=t=>t===L6||t===R6,g8=(t,e,n)=>B5(t)?w8(t.signal,e,n):t===P6||t===R6?e:n,m8=(t,e,n)=>B5(t)?x8(t.signal,e,n):p8(t)?e:n,y8=(t,e,n)=>B5(t)?_8(t.signal,e,n):p8(t)?n:e,v8=(t,e,n)=>B5(t)?A8(t.signal,e,n):t===R6?{value:e}:{value:n},b8=(t,e,n)=>B5(t)?D8(t.signal,e,n):t===U6?{value:e}:{value:n},x8=(t,e,n)=>E8(`${t} === '${R6}' || ${t} === '${L6}'`,e,n),_8=(t,e,n)=>E8(`${t} !== '${R6}' && ${t} !== '${L6}'`,e,n),w8=(t,e,n)=>C8(`${t} === '${P6}' || ${t} === '${R6}'`,e,n),A8=(t,e,n)=>C8(`${t} === '${R6}'`,e,n),D8=(t,e,n)=>C8(`${t} === '${U6}'`,e,n),E8=(t,e,n)=>(e=null!=e?P3(e):e,n=null!=n?P3(n):n,F8(e)&&F8(n)?{signal:`${t} ? (${e=e?e.signal||(0,Kt.m8)(e.value):null}) : (${n=n?n.signal||(0,Kt.m8)(n.value):null})`}:[(0,Kt.l7)({test:t},e)].concat(n||[])),F8=t=>null==t||1===Object.keys(t).length,C8=(t,e,n)=>({signal:`${t} ? (${M8(e)}) : (${M8(n)})`}),k8=(t,e,n,r,i)=>({signal:(null!=r?`${t} === '${P6}' ? (${M8(r)}) : `:"")+(null!=n?`${t} === '${L6}' ? (${M8(n)}) : `:"")+(null!=i?`${t} === '${U6}' ? (${M8(i)}) : `:"")+(null!=e?`${t} === '${R6}' ? (${M8(e)}) : `:"")+"(null)"}),M8=t=>B5(t)?t.signal:null==t?null:(0,Kt.m8)(t),S8=(t,e)=>0===e?0:B5(t)?{signal:`(${t.signal}) * ${e}`}:{value:t*e},$8=(t,e)=>{const n=t.signal;return n&&n.endsWith("(null)")?{signal:n.slice(0,-6)+e.signal}:t};function T8(t,e,n,r){let i;if(e&&(0,Kt.nr)(e,t))return e[t];if((0,Kt.nr)(n,t))return n[t];if(t.startsWith("title")){switch(t){case"titleColor":i="fill";break;case"titleFont":case"titleFontSize":case"titleFontWeight":i=t[5].toLowerCase()+t.slice(6)}return r[K6][i]}if(t.startsWith("label")){switch(t){case"labelColor":i="fill";break;case"labelFont":case"labelFontSize":i=t[5].toLowerCase()+t.slice(6)}return r[Z6][i]}return null}function B8(t){const e={};for(const n of t)if(n)for(const t in n)e[t]=1;return Object.keys(e)}function N8(t,e){return{scale:t.scale,range:e}}function O8(t,e,n,r,i){const o=g4(t,e),a=t.orient,s=t.gridScale,u=g8(a,1,-1),l=function(t,e){if(1===e);else if((0,Kt.Kn)(t)){let n=t=(0,Kt.l7)({},t);for(;null!=n.mult;){if(!(0,Kt.Kn)(n.mult))return n.mult=B5(e)?{signal:`(${n.mult}) * (${e.signal})`}:n.mult*e,t;n=n.mult=(0,Kt.l7)({},n.mult)}n.mult=e}else t=B5(e)?{signal:`(${e.signal}) * (${t||0})`}:e*(t||0);return t}(t.offset,u);let c,f,h;const d={enter:c={opacity:s4},update:h={opacity:u4},exit:f={opacity:s4}};L3(d,{stroke:o("gridColor"),strokeCap:o("gridCap"),strokeDash:o("gridDash"),strokeDashOffset:o("gridDashOffset"),strokeOpacity:o("gridOpacity"),strokeWidth:o("gridWidth")});const p={scale:t.scale,field:J6,band:i.band,extra:i.extra,offset:i.offset,round:o("tickRound")},g=m8(a,{signal:"height"},{signal:"width"}),m=s?{scale:s,range:0,mult:u,offset:l}:{value:0,offset:l},y=s?{scale:s,range:1,mult:u,offset:l}:(0,Kt.l7)(g,{mult:u,offset:l});return c.x=h.x=m8(a,p,m),c.y=h.y=y8(a,p,m),c.x2=h.x2=y8(a,y),c.y2=h.y2=m8(a,y),f.x=m8(a,p),f.y=y8(a,p),x4({type:f4,role:G3,key:J6,from:r,encode:d},n)}function z8(t,e,n,r,i){return{signal:'flush(range("'+t+'"), scale("'+t+'", datum.value), '+e+","+n+","+r+","+i+")"}}function R8(t,e,n,r){const i=g4(t,e),o=t.orient,a=g8(o,-1,1);let s,u;const l={enter:s={opacity:s4,anchor:P3(i("titleAnchor",null)),align:{signal:v4}},update:u=(0,Kt.l7)({},s,{opacity:u4,text:P3(t.title)}),exit:{opacity:s4}},c={signal:`lerp(range("${t.scale}"), ${y4(0,1,.5)})`};return u.x=m8(o,c),u.y=y8(o,c),s.angle=m8(o,s4,S8(a,90)),s.baseline=m8(o,v8(o,L6,R6),{value:L6}),u.angle=s.angle,u.baseline=s.baseline,L3(l,{fill:i("titleColor"),fillOpacity:i("titleOpacity"),font:i("titleFont"),fontSize:i("titleFontSize"),fontStyle:i("titleFontStyle"),fontWeight:i("titleFontWeight"),limit:i("titleLimit"),lineHeight:i("titleLineHeight")},{align:i("titleAlign"),angle:i("titleAngle"),baseline:i("titleBaseline")}),function(t,e,n,r){const i=(t,e)=>null!=t?(n.update[e]=$8(P3(t),n.update[e]),!1):!I3(e,r),o=i(t("titleX"),"x"),a=i(t("titleY"),"y");n.enter.auto=a===o?P3(a):m8(e,P3(a),P3(o))}(i,o,l,n),l.update.align=$8(l.update.align,s.align),l.update.angle=$8(l.update.angle,s.angle),l.update.baseline=$8(l.update.baseline,s.baseline),x4({type:d4,role:Z3,style:K6,from:r,encode:l},n)}function P8(t,e){const n=function(t,e){var n,r,i,o=e.config,a=o.style,s=o.axis,u="band"===e.scaleType(t.scale)&&o.axisBand,l=t.orient;if(B5(l)){const t=B8([o.axisX,o.axisY]),e=B8([o.axisTop,o.axisBottom,o.axisLeft,o.axisRight]);for(i of(n={},t))n[i]=m8(l,T8(i,o.axisX,s,a),T8(i,o.axisY,s,a));for(i of(r={},e))r[i]=k8(l.signal,T8(i,o.axisTop,s,a),T8(i,o.axisBottom,s,a),T8(i,o.axisLeft,s,a),T8(i,o.axisRight,s,a))}else n=l===R6||l===L6?o.axisX:o.axisY,r=o["axis"+l[0].toUpperCase()+l.slice(1)];return n||r||u?(0,Kt.l7)({},s,n,r,u):s}(t,e),r=t.encode||{},i=r.axis||{},o=i.name||void 0,a=i.interactive,s=i.style,u=g4(t,n),l=function(t){const e=t("tickBand");let n,r,i=t("tickOffset");return e?e.signal?(n={signal:`(${e.signal}) === 'extent' ? 1 : 0.5`},r={signal:`(${e.signal}) === 'extent'`},(0,Kt.Kn)(i)||(i={signal:`(${e.signal}) === 'extent' ? 0 : ${i}`})):"extent"===e?(n=1,r=!0,i=0):(n=.5,r=!1):(n=t("bandPosition"),r=t("tickExtra")),{extra:r,band:n,offset:i}}(u),c={scale:t.scale,ticks:!!u("ticks"),labels:!!u("labels"),grid:!!u("grid"),domain:!!u("domain"),title:null!=t.title},f=E5(e.add(J5({},[c]))),h=E5(e.add(G5({scale:e.scaleRef(t.scale),extra:e.property(l.extra),count:e.objectProperty(t.tickCount),values:e.objectProperty(t.values),minstep:e.property(t.tickMinStep),formatType:e.property(t.formatType),formatSpecifier:e.property(t.format)}))),d=[];let p;return c.grid&&d.push(O8(t,n,r.grid,h,l)),c.ticks&&(p=u("tickSize"),d.push(function(t,e,n,r,i,o){const a=g4(t,e),s=t.orient,u=g8(s,-1,1);let l,c,f;const h={enter:l={opacity:s4},update:f={opacity:u4},exit:c={opacity:s4}};L3(h,{stroke:a("tickColor"),strokeCap:a("tickCap"),strokeDash:a("tickDash"),strokeDashOffset:a("tickDashOffset"),strokeOpacity:a("tickOpacity"),strokeWidth:a("tickWidth")});const d=P3(i);d.mult=u;const p={scale:t.scale,field:J6,band:o.band,extra:o.extra,offset:o.offset,round:a("tickRound")};return f.y=l.y=m8(s,s4,p),f.y2=l.y2=m8(s,d),c.x=m8(s,p),f.x=l.x=y8(s,s4,p),f.x2=l.x2=y8(s,d),c.y=y8(s,p),x4({type:f4,role:J3,key:J6,from:r,encode:h},n)}(t,n,r.ticks,h,p,l))),c.labels&&(p=c.ticks?p:0,d.push(function(t,e,n,r,i,o){const a=g4(t,e),s=t.orient,u=t.scale,l=g8(s,-1,1),c=z5(a("labelFlush")),f=z5(a("labelFlushOffset")),h=a("labelAlign"),d=a("labelBaseline");let p,g=0===c||!!c;const m=P3(i);m.mult=l,m.offset=P3(a("labelPadding")||0),m.offset.mult=l;const y={scale:u,field:J6,band:.5,offset:b4(o.offset,a("labelOffset"))},v=m8(s,g?z8(u,c,'"left"','"right"','"center"'):{value:"center"},b8(s,"left","right")),b=m8(s,v8(s,"bottom","top"),g?z8(u,c,'"top"','"bottom"','"middle"'):{value:"middle"}),x=z8(u,c,`-(${f})`,f,0);g=g&&f;const _={opacity:s4,x:m8(s,y,m),y:y8(s,y,m)},w={enter:_,update:p={opacity:u4,text:{field:X6},x:_.x,y:_.y,align:v,baseline:b},exit:{opacity:s4,x:_.x,y:_.y}};L3(w,{dx:!h&&g?m8(s,x):null,dy:!d&&g?y8(s,x):null}),L3(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:h,baseline:d});const A=a("labelBound");let D=a("labelOverlap");return D=D||A?{separation:a("labelSeparation"),method:D,order:"datum.index",bound:A?{scale:u,orient:s,tolerance:A}:null}:void 0,p.align!==v&&(p.align=$8(p.align,v)),p.baseline!==b&&(p.baseline=$8(p.baseline,b)),x4({type:d4,role:V3,style:Z6,key:J6,from:r,encode:w,overlap:D},n)}(t,n,r.labels,h,p,l))),c.domain&&d.push(function(t,e,n,r){const i=g4(t,e),o=t.orient;let a,s;const u={enter:a={opacity:s4},update:s={opacity:u4},exit:{opacity:s4}};L3(u,{stroke:i("domainColor"),strokeCap:i("domainCap"),strokeDash:i("domainDash"),strokeDashOffset:i("domainDashOffset"),strokeWidth:i("domainWidth"),strokeOpacity:i("domainOpacity")});const l=N8(t,0),c=N8(t,1);return a.x=s.x=m8(o,l,s4),a.x2=s.x2=m8(o,c),a.y=s.y=y8(o,l,s4),a.y2=s.y2=y8(o,c),x4({type:f4,role:Y3,from:r,encode:u},n)}(t,n,r.domain,f)),c.title&&d.push(R8(t,n,r.title,f)),i8(p4({role:X3,from:f,encode:j3(U8(u,t),i,a4),marks:d,aria:u("aria"),description:u("description"),zindex:u("zindex"),name:o,interactive:a,style:s}),e)}function U8(t,e){const n={enter:{},update:{}};return L3(n,{orient:t("orient"),offset:t("offset")||0,position:O5(e.position,0),titlePadding:t("titlePadding"),minExtent:t("minExtent"),maxExtent:t("maxExtent"),range:{signal:`abs(span(range("${e.scale}")))`},translate:t("translate"),format:e.format,formatType:e.formatType}),n}function L8(t,e,n){const r=(0,Kt.IX)(t.signals),i=(0,Kt.IX)(t.scales);return n||r.forEach((t=>_5(t,e))),(0,Kt.IX)(t.projections).forEach((t=>function(t,e){const n=e.config.projection||{},r={};for(const i in t)"name"!==i&&(r[i]=z6(t[i],i,e));for(const i in n)null==r[i]&&(r[i]=z6(n[i],i,e));e.addProjection(t.name,r)}(t,e))),i.forEach((t=>function(t,e){const n=t.type||"linear";nm(n)||(0,Kt.vU)("Unrecognized scale type: "+(0,Kt.m8)(n)),e.addScale(t.name,{type:n,domain:void 0})}(t,e))),(0,Kt.IX)(t.data).forEach((t=>f8(t,e))),i.forEach((t=>A6(t,e))),(n||r).forEach((t=>function(t,e){const n=e.getSignal(t.name);let r=t.update;t.init&&(r?(0,Kt.vU)("Signals can not include both init and update expressions."):(r=t.init,n.initonly=!0)),r&&(r=PK(r,e),n.update=r.$expr,n.params=r.$params),t.on&&t.on.forEach((t=>W5(t,e,n.id)))}(t,e))),(0,Kt.IX)(t.axes).forEach((t=>P8(t,e))),(0,Kt.IX)(t.marks).forEach((t=>i8(t,e))),(0,Kt.IX)(t.legends).forEach((t=>o8(t,e))),t.title&&l8(t.title,e),e.parseLambdas(),e}const j8=t=>j3({enter:{x:{value:0},y:{value:0}},update:{width:{signal:"width"},height:{signal:"height"}}},t);function I8(t,e){const n=e.config,r=E5(e.root=e.add(D5())),i=function(t,e){const n=n=>O5(t[n],e[n]),r=[q8("background",n("background")),q8("autosize",N3(n("autosize"))),q8("padding",R3(n("padding"))),q8("width",n("width")||0),q8("height",n("height")||0)],i=r.reduce(((t,e)=>(t[e.name]=e,t)),{}),o={};return(0,Kt.IX)(t.signals).forEach((t=>{(0,Kt.nr)(i,t.name)?t=(0,Kt.l7)(i[t.name],t):r.push(t),o[t.name]=t})),(0,Kt.IX)(e.signals).forEach((t=>{(0,Kt.nr)(o,t.name)||(0,Kt.nr)(i,t.name)||r.push(t)})),r}(t,n);i.forEach((t=>_5(t,e))),e.description=t.description||n.description,e.eventConfig=n.events,e.legends=e.objectProperty(n.legend&&n.legend.layout),e.locale=n.locale;const o=e.add(J5()),a=e.add(Q5(g5(j8(t.encode),l4,W3,t.style,e,{pulse:E5(o)}))),s=e.add(b6({layout:e.objectProperty(t.layout),legends:e.legends,autosize:e.signalRef("autosize"),mark:r,pulse:E5(a)}));e.operators.pop(),e.pushState(E5(a),E5(s),null),L8(t,e,i),e.operators.push(s);let u=e.add(V5({mark:r,pulse:E5(s)}));return u=e.add(g6({pulse:E5(u)})),u=e.add(y6({pulse:E5(u)})),e.addData("root",new Q4(e,o,o,u)),e}function q8(t,e){return e&&e.signal?{name:t,update:e.signal}:{name:t,value:e}}function W8(t,e){this.config=t||{},this.options=e||{},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 H8(t){this.config=t.config,this.options=t.options,this.legends=t.legends,this.field=Object.create(t.field),this.signals=Object.create(t.signals),this.lambdas=Object.create(t.lambdas),this.scales=Object.create(t.scales),this.events=Object.create(t.events),this.data=Object.create(t.data),this.streams=[],this.updates=[],this.operators=[],this._id=0,this._subid=++t._nextsub[0],this._nextsub=t._nextsub,this._parent=t._parent.slice(),this._encode=t._encode.slice(),this._lookup=t._lookup.slice(),this._markpath=t._markpath}function X8(t){return((0,Kt.kJ)(t)?Y8:G8)(t)}function Y8(t){const e=t.length;let n="[";for(let r=0;r<e;++r){const e=t[r];n+=(r>0?",":"")+((0,Kt.Kn)(e)?e.signal||X8(e):(0,Kt.m8)(e))}return n+"]"}function G8(t){let e,n,r="{",i=0;for(e in t)n=t[e],r+=(++i>1?",":"")+(0,Kt.m8)(e)+":"+((0,Kt.Kn)(n)?n.signal||X8(n):(0,Kt.m8)(n));return r+"}"}function V8(t,e,n){return(0,Kt.Kn)(t)||(0,Kt.vU)("Input Vega specification must be an object."),e=(0,Kt.fE)(function(){const t="sans-serif",e="#4c78a8",n="#000",r="#888",i="#ddd";return{description:"Vega visualization",padding:0,autosize:"pad",background:null,events:{defaults:{allow:["wheel"]}},group:null,mark:null,arc:{fill:e},area:{fill:e},image:null,line:{stroke:e,strokeWidth:2},path:{stroke:e},rect:{fill:e},rule:{stroke:n},shape:{stroke:e},symbol:{fill:e,size:64},text:{fill:n,font:t,fontSize:11},trail:{fill:e,size:2},style:{"guide-label":{fill:n,font:t,fontSize:10},"guide-title":{fill:n,font:t,fontSize:11,fontWeight:"bold"},"group-title":{fill:n,font:t,fontSize:13,fontWeight:"bold"},"group-subtitle":{fill:n,font:t,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:i},view:{fill:"transparent"}},title:{orient:"top",anchor:"middle",offset:4,subtitlePadding:3},axis:{minExtent:0,maxExtent:200,bandPosition:.5,domain:!0,domainWidth:1,domainColor:r,grid:!1,gridWidth:1,gridColor:i,labels:!0,labelAngle:0,labelLimit:180,labelOffset:0,labelPadding:2,ticks:!0,tickColor:r,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:i,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:r,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"]}}}(),e,t.config),I8(t,new W8(e,n)).toRuntime()}W8.prototype=H8.prototype={parse(t){return L8(t,this)},fork(){return new H8(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(t){return this.operators.push(t),t.id=this.id(),t.refs&&(t.refs.forEach((e=>{e.$ref=t.id})),t.refs=null),t},proxy(t){const e=t instanceof w5?E5(t):t;return this.add(d6({value:e}))},addStream(t){return this.streams.push(t),t.id=this.id(),t},addUpdate(t){return this.updates.push(t),t},finish(){let t,e;for(t in this.root&&(this.root.root=!0),this.signals)this.signals[t].signal=t;for(t in this.scales)this.scales[t].scale=t;function n(t,e,n){let r,i;t&&(r=t.data||(t.data={}),i=r[e]||(r[e]=[]),i.push(n))}for(t in this.data){e=this.data[t],n(e.input,t,"input"),n(e.output,t,"output"),n(e.values,t,"values");for(const r in e.index)n(e.index[r],t,"index:"+r)}return this},pushState(t,e,n){this._encode.push(E5(this.add(y6({pulse:t})))),this._parent.push(e),this._lookup.push(n?E5(this.proxy(n)):null),this._markpath.push(-1)},popState(){this._encode.pop(),this._parent.pop(),this._lookup.pop(),this._markpath.pop()},parent(){return(0,Kt.fj)(this._parent)},encode(){return(0,Kt.fj)(this._encode)},lookup(){return(0,Kt.fj)(this._lookup)},markpath(){const t=this._markpath;return++t[t.length-1]},fieldRef(t,e){if((0,Kt.HD)(t))return F5(t,e);t.signal||(0,Kt.vU)("Unsupported field reference: "+(0,Kt.m8)(t));const n=t.signal;let r=this.field[n];if(!r){const t={name:this.signalRef(n)};e&&(t.as=e),this.field[n]=r=E5(this.add(n6(t)))}return r},compareRef(t){let e=!1;const n=t=>B5(t)?(e=!0,this.signalRef(t.signal)):function(t){return t&&t.expr}(t)?(e=!0,this.exprRef(t.expr)):t,r=(0,Kt.IX)(t.field).map(n),i=(0,Kt.IX)(t.order).map(n);return e?E5(this.add(Z5({fields:r,orders:i}))):k5(r,i)},keyRef(t,e){let n=!1;const r=this.signals;return t=(0,Kt.IX)(t).map((t=>B5(t)?(n=!0,E5(r[t.signal])):t)),n?E5(this.add(r6({fields:t,flat:e}))):function(t,e){const n={$key:t};return e&&(n.$flat=!0),n}(t,e)},sortRef(t){if(!t)return t;const e=S5(t.op,t.field),n=t.order||"ascending";return n.signal?E5(this.add(Z5({fields:e,orders:this.signalRef(n.signal)}))):k5(e,n)},event(t,e){const n=t+":"+e;if(!this.events[n]){const r=this.id();this.streams.push({id:r,source:t,type:e}),this.events[n]=r}return this.events[n]},hasOwnSignal(t){return(0,Kt.nr)(this.signals,t)},addSignal(t,e){this.hasOwnSignal(t)&&(0,Kt.vU)("Duplicate signal name: "+(0,Kt.m8)(t));const n=e instanceof w5?e:this.add(D5(e));return this.signals[t]=n},getSignal(t){return this.signals[t]||(0,Kt.vU)("Unrecognized signal name: "+(0,Kt.m8)(t)),this.signals[t]},signalRef(t){return this.signals[t]?E5(this.signals[t]):((0,Kt.nr)(this.lambdas,t)||(this.lambdas[t]=this.add(D5(null))),E5(this.lambdas[t]))},parseLambdas(){const t=Object.keys(this.lambdas);for(let e=0,n=t.length;e<n;++e){const n=t[e],r=PK(n,this),i=this.lambdas[n];i.params=r.$params,i.update=r.$expr}},property(t){return t&&t.signal?this.signalRef(t.signal):t},objectProperty(t){return t&&(0,Kt.Kn)(t)?this.signalRef(t.signal||X8(t)):t},exprRef(t,e){const n={expr:PK(t,this)};return e&&(n.expr.$name=e),E5(this.add(t6(n)))},addBinding(t,e){this.bindings||(0,Kt.vU)("Nested signals do not support binding: "+(0,Kt.m8)(t)),this.bindings.push((0,Kt.l7)({signal:t},e))},addScaleProj(t,e){(0,Kt.nr)(this.scales,t)&&(0,Kt.vU)("Duplicate scale or projection name: "+(0,Kt.m8)(t)),this.scales[t]=this.add(e)},addScale(t,e){this.addScaleProj(t,m6(e))},addProjection(t,e){this.addScaleProj(t,h6(e))},getScale(t){return this.scales[t]||(0,Kt.vU)("Unrecognized scale name: "+(0,Kt.m8)(t)),this.scales[t]},scaleRef(t){return E5(this.getScale(t))},scaleType(t){return this.getScale(t).params.type},projectionRef(t){return this.scaleRef(t)},projectionType(t){return this.scaleType(t)},addData(t,e){return(0,Kt.nr)(this.data,t)&&(0,Kt.vU)("Duplicate data set name: "+(0,Kt.m8)(t)),this.data[t]=e},getData(t){return this.data[t]||(0,Kt.vU)("Undefined data set name: "+(0,Kt.m8)(t)),this.data[t]},addDataPipeline(t,e){return(0,Kt.nr)(this.data,t)&&(0,Kt.vU)("Duplicate data set name: "+(0,Kt.m8)(t)),this.addData(t,Q4.fromEntries(this,e))}};var J8="5.25.0";xt(fs,r,o,a,s,u,f,l,h,d,p,g)},58381:t=>{"use strict";var e=/("(?:[^\\"]|\\.)*")|[:,]/g;t.exports=function(t,n){var r,i,o;return n=n||{},r=JSON.stringify([1],void 0,void 0===n.indent?2:n.indent).slice(2,-3),i=""===r?1/0:void 0===n.maxLength?80:n.maxLength,o=n.replacer,function t(n,a,s){var u,l,c,f,h,d,p,g,m,y,v,b;if(n&&"function"===typeof n.toJSON&&(n=n.toJSON()),void 0===(v=JSON.stringify(n,o)))return v;if(p=i-a.length-s,v.length<=p&&(m=v.replace(e,(function(t,e){return e||t+" "}))).length<=p)return m;if(null!=o&&(n=JSON.parse(v),o=void 0),"object"===typeof n&&null!==n){if(g=a+r,c=[],l=0,Array.isArray(n))for(y="[",u="]",p=n.length;l<p;l++)c.push(t(n[l],g,l===p-1?0:1)||"null");else for(y="{",u="}",p=(d=Object.keys(n)).length;l<p;l++)f=d[l],h=JSON.stringify(f)+": ",void 0!==(b=t(n[f],g,h.length+(l===p-1?0:1)))&&c.push(h+b);if(c.length>0)return[y,r+c.join(",\n"+g),u].join("\n"+a)}return v}(t,"",0)}}}]);
|