Luccas Mateus de Medeiros Gomes 58b4c1918f [éxamples]
2023-05-24 13:41:11 -03:00

207 lines
905 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import{R as tl}from"./index-8db94870.js";import{g as Am}from"./_commonjsHelpers-042e6b4d.js";import{P as IF}from"./index-1fc0ca9a.js";const zF={};function E2(e,t){e===void 0&&(e=zF),t===void 0&&(t=zF);const n=Object.keys(e),i=Object.keys(t);return e===t||n.length===i.length&&n.every(r=>e[r]===t[r])}/*!
* https://github.com/Starcounter-Jack/JSON-Patch
* (c) 2017-2022 Joachim Wester
* MIT licensed
*/var AP=globalThis&&globalThis.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var s in r)r.hasOwnProperty(s)&&(i[s]=r[s])},e(t,n)};return function(t,n){e(t,n);function i(){this.constructor=t}t.prototype=n===null?Object.create(n):(i.prototype=n.prototype,new i)}}(),EP=Object.prototype.hasOwnProperty;function w2(e,t){return EP.call(e,t)}function $2(e){if(Array.isArray(e)){for(var t=new Array(e.length),n=0;n<t.length;n++)t[n]=""+n;return t}if(Object.keys)return Object.keys(e);var i=[];for(var r in e)w2(e,r)&&i.push(r);return i}function Xn(e){switch(typeof e){case"object":return JSON.parse(JSON.stringify(e));case"undefined":return null;default:return e}}function C2(e){for(var t=0,n=e.length,i;t<n;){if(i=e.charCodeAt(t),i>=48&&i<=57){t++;continue}return!1}return!0}function ma(e){return e.indexOf("/")===-1&&e.indexOf("~")===-1?e:e.replace(/~/g,"~0").replace(/\//g,"~1")}function U5(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function F2(e){if(e===void 0)return!0;if(e){if(Array.isArray(e)){for(var t=0,n=e.length;t<n;t++)if(F2(e[t]))return!0}else if(typeof e=="object"){for(var i=$2(e),r=i.length,s=0;s<r;s++)if(F2(e[i[s]]))return!0}}return!1}function jF(e,t){var n=[e];for(var i in t){var r=typeof t[i]=="object"?JSON.stringify(t[i],null,2):t[i];typeof r<"u"&&n.push(i+": "+r)}return n.join(`
`)}var q5=function(e){AP(t,e);function t(n,i,r,s,o){var a=this.constructor,u=e.call(this,jF(n,{name:i,index:r,operation:s,tree:o}))||this;return u.name=i,u.index=r,u.operation=s,u.tree=o,Object.setPrototypeOf(u,a.prototype),u.message=jF(n,{name:i,index:r,operation:s,tree:o}),u}return t}(Error),tt=q5,wP=Xn,Xu={add:function(e,t,n){return e[t]=this.value,{newDocument:n}},remove:function(e,t,n){var i=e[t];return delete e[t],{newDocument:n,removed:i}},replace:function(e,t,n){var i=e[t];return e[t]=this.value,{newDocument:n,removed:i}},move:function(e,t,n){var i=Dg(n,this.path);i&&(i=Xn(i));var r=Na(n,{op:"remove",path:this.from}).removed;return Na(n,{op:"add",path:this.path,value:r}),{newDocument:n,removed:i}},copy:function(e,t,n){var i=Dg(n,this.from);return Na(n,{op:"add",path:this.path,value:Xn(i)}),{newDocument:n}},test:function(e,t,n){return{newDocument:n,test:dd(e[t],this.value)}},_get:function(e,t,n){return this.value=e[t],{newDocument:n}}},$P={add:function(e,t,n){return C2(t)?e.splice(t,0,this.value):e[t]=this.value,{newDocument:n,index:t}},remove:function(e,t,n){var i=e.splice(t,1);return{newDocument:n,removed:i[0]}},replace:function(e,t,n){var i=e[t];return e[t]=this.value,{newDocument:n,removed:i}},move:Xu.move,copy:Xu.copy,test:Xu.test,_get:Xu._get};function Dg(e,t){if(t=="")return e;var n={op:"_get",path:t};return Na(e,n),n.value}function Na(e,t,n,i,r,s){if(n===void 0&&(n=!1),i===void 0&&(i=!0),r===void 0&&(r=!0),s===void 0&&(s=0),n&&(typeof n=="function"?n(t,0,e,t.path):_g(t,0)),t.path===""){var o={newDocument:e};if(t.op==="add")return o.newDocument=t.value,o;if(t.op==="replace")return o.newDocument=t.value,o.removed=e,o;if(t.op==="move"||t.op==="copy")return o.newDocument=Dg(e,t.from),t.op==="move"&&(o.removed=e),o;if(t.op==="test"){if(o.test=dd(e,t.value),o.test===!1)throw new tt("Test operation failed","TEST_OPERATION_FAILED",s,t,e);return o.newDocument=e,o}else{if(t.op==="remove")return o.removed=e,o.newDocument=null,o;if(t.op==="_get")return t.value=e,o;if(n)throw new tt("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",s,t,e);return o}}else{i||(e=Xn(e));var a=t.path||"",u=a.split("/"),l=e,c=1,f=u.length,d=void 0,h=void 0,g=void 0;for(typeof n=="function"?g=n:g=_g;;){if(h=u[c],h&&h.indexOf("~")!=-1&&(h=U5(h)),r&&(h=="__proto__"||h=="prototype"&&c>0&&u[c-1]=="constructor"))throw new TypeError("JSON-Patch: modifying `__proto__` or `constructor/prototype` prop is banned for security reasons, if this was on purpose, please set `banPrototypeModifications` flag false and pass it to this function. More info in fast-json-patch README");if(n&&d===void 0&&(l[h]===void 0?d=u.slice(0,c).join("/"):c==f-1&&(d=t.path),d!==void 0&&g(t,0,e,d)),c++,Array.isArray(l)){if(h==="-")h=l.length;else{if(n&&!C2(h))throw new tt("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",s,t,e);C2(h)&&(h=~~h)}if(c>=f){if(n&&t.op==="add"&&h>l.length)throw new tt("The specified index MUST NOT be greater than the number of elements in the array","OPERATION_VALUE_OUT_OF_BOUNDS",s,t,e);var o=$P[t.op].call(t,l,h,e);if(o.test===!1)throw new tt("Test operation failed","TEST_OPERATION_FAILED",s,t,e);return o}}else if(c>=f){var o=Xu[t.op].call(t,l,h,e);if(o.test===!1)throw new tt("Test operation failed","TEST_OPERATION_FAILED",s,t,e);return o}if(l=l[h],n&&c<f&&(!l||typeof l!="object"))throw new tt("Cannot perform operation at the desired path","OPERATION_PATH_UNRESOLVABLE",s,t,e)}}}function Em(e,t,n,i,r){if(i===void 0&&(i=!0),r===void 0&&(r=!0),n&&!Array.isArray(t))throw new tt("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");i||(e=Xn(e));for(var s=new Array(t.length),o=0,a=t.length;o<a;o++)s[o]=Na(e,t[o],n,!0,r,o),e=s[o].newDocument;return s.newDocument=e,s}function CP(e,t,n){var i=Na(e,t);if(i.test===!1)throw new tt("Test operation failed","TEST_OPERATION_FAILED",n,t,e);return i.newDocument}function _g(e,t,n,i){if(typeof e!="object"||e===null||Array.isArray(e))throw new tt("Operation is not an object","OPERATION_NOT_AN_OBJECT",t,e,n);if(Xu[e.op]){if(typeof e.path!="string")throw new tt("Operation `path` property is not a string","OPERATION_PATH_INVALID",t,e,n);if(e.path.indexOf("/")!==0&&e.path.length>0)throw new tt('Operation `path` property must start with "/"',"OPERATION_PATH_INVALID",t,e,n);if((e.op==="move"||e.op==="copy")&&typeof e.from!="string")throw new tt("Operation `from` property is not present (applicable in `move` and `copy` operations)","OPERATION_FROM_REQUIRED",t,e,n);if((e.op==="add"||e.op==="replace"||e.op==="test")&&e.value===void 0)throw new tt("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_REQUIRED",t,e,n);if((e.op==="add"||e.op==="replace"||e.op==="test")&&F2(e.value))throw new tt("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_CANNOT_CONTAIN_UNDEFINED",t,e,n);if(n){if(e.op=="add"){var r=e.path.split("/").length,s=i.split("/").length;if(r!==s+1&&r!==s)throw new tt("Cannot perform an `add` operation at the desired path","OPERATION_PATH_CANNOT_ADD",t,e,n)}else if(e.op==="replace"||e.op==="remove"||e.op==="_get"){if(e.path!==i)throw new tt("Cannot perform the operation at a path that does not exist","OPERATION_PATH_UNRESOLVABLE",t,e,n)}else if(e.op==="move"||e.op==="copy"){var o={op:"_get",path:e.from,value:void 0},a=W5([o],n);if(a&&a.name==="OPERATION_PATH_UNRESOLVABLE")throw new tt("Cannot perform the operation from a path that does not exist","OPERATION_FROM_UNRESOLVABLE",t,e,n)}}}else throw new tt("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",t,e,n)}function W5(e,t,n){try{if(!Array.isArray(e))throw new tt("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");if(t)Em(Xn(t),Xn(e),n||!0);else{n=n||_g;for(var i=0;i<e.length;i++)n(e[i],i,t,void 0)}}catch(r){if(r instanceof tt)return r;throw r}}function dd(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){var n=Array.isArray(e),i=Array.isArray(t),r,s,o;if(n&&i){if(s=e.length,s!=t.length)return!1;for(r=s;r--!==0;)if(!dd(e[r],t[r]))return!1;return!0}if(n!=i)return!1;var a=Object.keys(e);if(s=a.length,s!==Object.keys(t).length)return!1;for(r=s;r--!==0;)if(!t.hasOwnProperty(a[r]))return!1;for(r=s;r--!==0;)if(o=a[r],!dd(e[o],t[o]))return!1;return!0}return e!==e&&t!==t}const FP=Object.freeze(Object.defineProperty({__proto__:null,JsonPatchError:tt,_areEquals:dd,applyOperation:Na,applyPatch:Em,applyReducer:CP,deepClone:wP,getValueByPointer:Dg,validate:W5,validator:_g},Symbol.toStringTag,{value:"Module"}));/*!
* https://github.com/Starcounter-Jack/JSON-Patch
* (c) 2017-2021 Joachim Wester
* MIT license
*/var Vv=new WeakMap,SP=function(){function e(t){this.observers=new Map,this.obj=t}return e}(),DP=function(){function e(t,n){this.callback=t,this.observer=n}return e}();function _P(e){return Vv.get(e)}function kP(e,t){return e.observers.get(t)}function MP(e,t){e.observers.delete(t.callback)}function OP(e,t){t.unobserve()}function NP(e,t){var n=[],i,r=_P(e);if(!r)r=new SP(e),Vv.set(e,r);else{var s=kP(r,t);i=s&&s.observer}if(i)return i;if(i={},r.value=Xn(e),t){i.callback=t,i.next=null;var o=function(){S2(i)},a=function(){clearTimeout(i.next),i.next=setTimeout(o)};typeof window<"u"&&(window.addEventListener("mouseup",a),window.addEventListener("keyup",a),window.addEventListener("mousedown",a),window.addEventListener("keydown",a),window.addEventListener("change",a))}return i.patches=n,i.object=e,i.unobserve=function(){S2(i),clearTimeout(i.next),MP(r,i),typeof window<"u"&&(window.removeEventListener("mouseup",a),window.removeEventListener("keyup",a),window.removeEventListener("mousedown",a),window.removeEventListener("keydown",a),window.removeEventListener("change",a))},r.observers.set(t,new DP(t,i)),i}function S2(e,t){t===void 0&&(t=!1);var n=Vv.get(e.object);Yv(n.value,e.object,e.patches,"",t),e.patches.length&&Em(n.value,e.patches);var i=e.patches;return i.length>0&&(e.patches=[],e.callback&&e.callback(i)),i}function Yv(e,t,n,i,r){if(t!==e){typeof t.toJSON=="function"&&(t=t.toJSON());for(var s=$2(t),o=$2(e),a=!1,u=o.length-1;u>=0;u--){var l=o[u],c=e[l];if(w2(t,l)&&!(t[l]===void 0&&c!==void 0&&Array.isArray(t)===!1)){var f=t[l];typeof c=="object"&&c!=null&&typeof f=="object"&&f!=null&&Array.isArray(c)===Array.isArray(f)?Yv(c,f,n,i+"/"+ma(l),r):c!==f&&(r&&n.push({op:"test",path:i+"/"+ma(l),value:Xn(c)}),n.push({op:"replace",path:i+"/"+ma(l),value:Xn(f)}))}else Array.isArray(e)===Array.isArray(t)?(r&&n.push({op:"test",path:i+"/"+ma(l),value:Xn(c)}),n.push({op:"remove",path:i+"/"+ma(l)}),a=!0):(r&&n.push({op:"test",path:i,value:e}),n.push({op:"replace",path:i,value:t}))}if(!(!a&&s.length==o.length))for(var u=0;u<s.length;u++){var l=s[u];!w2(e,l)&&t[l]!==void 0&&n.push({op:"add",path:i+"/"+ma(l),value:Xn(t[l])})}}}function TP(e,t,n){n===void 0&&(n=!1);var i=[];return Yv(e,t,i,"",n),i}const BP=Object.freeze(Object.defineProperty({__proto__:null,compare:TP,generate:S2,observe:NP,unobserve:OP},Symbol.toStringTag,{value:"Module"}));Object.assign({},FP,BP,{JsonPatchError:q5,deepClone:Xn,escapePathComponent:ma,unescapePathComponent:U5});var RP=/("(?:[^\\"]|\\.)*")|[:,]/g,LP=function(t,n){var i,r,s;return n=n||{},i=JSON.stringify([1],void 0,n.indent===void 0?2:n.indent).slice(2,-3),r=i===""?1/0:n.maxLength===void 0?80:n.maxLength,s=n.replacer,function o(a,u,l){var c,f,d,h,g,p,m,y,b,x,v,A;if(a&&typeof a.toJSON=="function"&&(a=a.toJSON()),v=JSON.stringify(a,s),v===void 0)return v;if(m=r-u.length-l,v.length<=m&&(b=v.replace(RP,function(w,E){return E||w+" "}),b.length<=m))return b;if(s!=null&&(a=JSON.parse(v),s=void 0),typeof a=="object"&&a!==null){if(y=u+i,d=[],f=0,Array.isArray(a))for(x="[",c="]",m=a.length;f<m;f++)d.push(o(a[f],y,f===m-1?0:1)||"null");else for(x="{",c="}",p=Object.keys(a),m=p.length;f<m;f++)h=p[f],g=JSON.stringify(h)+": ",A=o(a[h],y,g.length+(f===m-1?0:1)),A!==void 0&&d.push(g+A);if(d.length>0)return[x,i+d.join(`,
`+y),c].join(`
`+u)}return v}(t,"",0)};const Ly=Am(LP);function ks(e,t,n){return e.fields=t||[],e.fname=n,e}function PP(e){return e==null?null:e.fname}function G5(e){return e==null?null:e.fields}function H5(e){return e.length===1?IP(e[0]):zP(e)}const IP=e=>function(t){return t[e]},zP=e=>{const t=e.length;return function(n){for(let i=0;i<t;++i)n=n[e[i]];return n}};function oi(e){throw Error(e)}function Xv(e){const t=[],n=e.length;let i=null,r=0,s="",o,a,u;e=e+"";function l(){t.push(s+e.substring(o,a)),s="",o=a+1}for(o=a=0;a<n;++a)if(u=e[a],u==="\\")s+=e.substring(o,a++),o=a;else if(u===i)l(),i=null,r=-1;else{if(i)continue;o===r&&u==='"'||o===r&&u==="'"?(o=a+1,i=u):u==="."&&!r?a>o?l():o=a+1:u==="["?(a>o&&l(),r=o=a+1):u==="]"&&(r||oi("Access path missing open bracket: "+e),r>0&&l(),r=0,o=a+1)}return r&&oi("Access path missing closing bracket: "+e),i&&oi("Access path missing closing quote: "+e),a>o&&(a++,l()),t}function Kv(e,t,n){const i=Xv(e);return e=i.length===1?i[0]:e,ks((n&&n.get||H5)(i),[e],t||e)}const jP=Kv("id"),Jv=ks(e=>e,[],"identity"),UP=ks(()=>0,[],"zero"),qP=ks(()=>1,[],"one"),WP=ks(()=>!0,[],"true"),GP=ks(()=>!1,[],"false");function HP(e,t,n){const i=[t].concat([].slice.call(n));console[e].apply(console,i)}const V5=0,Y5=1,X5=2,K5=3,J5=4;function VP(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:HP,i=e||V5;return{level(r){return arguments.length?(i=+r,this):i},error(){return i>=Y5&&n(t||"error","ERROR",arguments),this},warn(){return i>=X5&&n(t||"warn","WARN",arguments),this},info(){return i>=K5&&n(t||"log","INFO",arguments),this},debug(){return i>=J5&&n(t||"log","DEBUG",arguments),this}}}var Xl=Array.isArray;function gl(e){return e===Object(e)}const UF=e=>e!=="__proto__";function Qv(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.reduce((i,r)=>{for(const s in r)if(s==="signals")i.signals=YP(i.signals,r.signals);else{const o=s==="legend"?{layout:1}:s==="style"?!0:null;wm(i,s,r[s],o)}return i},{})}function wm(e,t,n,i){if(!UF(t))return;let r,s;if(gl(n)&&!Xl(n)){s=gl(e[t])?e[t]:e[t]={};for(r in n)i&&(i===!0||i[r])?wm(s,r,n[r]):UF(r)&&(s[r]=n[r])}else e[t]=n}function YP(e,t){if(e==null)return t;const n={},i=[];function r(s){n[s.name]||(n[s.name]=1,i.push(s))}return t.forEach(r),e.forEach(r),i}function Kl(e){return e[e.length-1]}function Zv(e){return e==null||e===""?null:+e}const Q5=e=>t=>e*Math.exp(t),Z5=e=>t=>Math.log(e*t),e6=e=>t=>Math.sign(t)*Math.log1p(Math.abs(t/e)),t6=e=>t=>Math.sign(t)*Math.expm1(Math.abs(t))*e,kg=e=>t=>t<0?-Math.pow(-t,e):Math.pow(t,e);function $m(e,t,n,i){const r=n(e[0]),s=n(Kl(e)),o=(s-r)*t;return[i(r-o),i(s-o)]}function XP(e,t){return $m(e,t,Zv,Jv)}function KP(e,t){var n=Math.sign(e[0]);return $m(e,t,Z5(n),Q5(n))}function JP(e,t,n){return $m(e,t,kg(n),kg(1/n))}function QP(e,t,n){return $m(e,t,e6(n),t6(n))}function Cm(e,t,n,i,r){const s=i(e[0]),o=i(Kl(e)),a=t!=null?i(t):(s+o)/2;return[r(a+(s-a)*n),r(a+(o-a)*n)]}function ZP(e,t,n){return Cm(e,t,n,Zv,Jv)}function eI(e,t,n){const i=Math.sign(e[0]);return Cm(e,t,n,Z5(i),Q5(i))}function tI(e,t,n,i){return Cm(e,t,n,kg(i),kg(1/i))}function nI(e,t,n,i){return Cm(e,t,n,e6(i),t6(i))}function iI(e){return 1+~~(new Date(e).getMonth()/3)}function rI(e){return 1+~~(new Date(e).getUTCMonth()/3)}function hd(e){return e!=null?Xl(e)?e:[e]:[]}function sI(e,t,n){let i=e[0],r=e[1],s;return r<i&&(s=r,r=i,i=s),s=r-i,s>=n-t?[t,n]:[i=Math.min(Math.max(i,t),n-s),i+s]}function pl(e){return typeof e=="function"}const oI="descending";function aI(e,t,n){n=n||{},t=hd(t)||[];const i=[],r=[],s={},o=n.comparator||uI;return hd(e).forEach((a,u)=>{a!=null&&(i.push(t[u]===oI?-1:1),r.push(a=pl(a)?a:Kv(a,null,n)),(G5(a)||[]).forEach(l=>s[l]=1))}),r.length===0?null:ks(o(r,i),Object.keys(s))}const eA=(e,t)=>(e<t||e==null)&&t!=null?-1:(e>t||t==null)&&e!=null?1:(t=t instanceof Date?+t:t,(e=e instanceof Date?+e:e)!==e&&t===t?-1:t!==t&&e===e?1:0),uI=(e,t)=>e.length===1?lI(e[0],t[0]):cI(e,t,e.length),lI=(e,t)=>function(n,i){return eA(e(n),e(i))*t},cI=(e,t,n)=>(t.push(0),function(i,r){let s,o=0,a=-1;for(;o===0&&++a<n;)s=e[a],o=eA(s(i),s(r));return o*t[a]});function fI(e){return pl(e)?e:()=>e}function dI(e,t){let n;return i=>{n&&clearTimeout(n),n=setTimeout(()=>(t(i),n=null),e)}}function tA(e){for(let t,n,i=1,r=arguments.length;i<r;++i){t=arguments[i];for(n in t)e[n]=t[n]}return e}function hI(e,t){let n=0,i,r,s,o;if(e&&(i=e.length))if(t==null){for(r=e[n];n<i&&(r==null||r!==r);r=e[++n]);for(s=o=r;n<i;++n)r=e[n],r!=null&&(r<s&&(s=r),r>o&&(o=r))}else{for(r=t(e[n]);n<i&&(r==null||r!==r);r=t(e[++n]));for(s=o=r;n<i;++n)r=t(e[n]),r!=null&&(r<s&&(s=r),r>o&&(o=r))}return[s,o]}function gI(e,t){const n=e.length;let i=-1,r,s,o,a,u;if(t==null){for(;++i<n;)if(s=e[i],s!=null&&s>=s){r=o=s;break}if(i===n)return[-1,-1];for(a=u=i;++i<n;)s=e[i],s!=null&&(r>s&&(r=s,a=i),o<s&&(o=s,u=i))}else{for(;++i<n;)if(s=t(e[i],i,e),s!=null&&s>=s){r=o=s;break}if(i===n)return[-1,-1];for(a=u=i;++i<n;)s=t(e[i],i,e),s!=null&&(r>s&&(r=s,a=i),o<s&&(o=s,u=i))}return[a,u]}const pI=Object.prototype.hasOwnProperty;function ki(e,t){return pI.call(e,t)}const o0={};function mI(e){let t={},n;function i(s){return ki(t,s)&&t[s]!==o0}const r={size:0,empty:0,object:t,has:i,get(s){return i(s)?t[s]:void 0},set(s,o){return i(s)||(++r.size,t[s]===o0&&--r.empty),t[s]=o,this},delete(s){return i(s)&&(--r.size,++r.empty,t[s]=o0),this},clear(){r.size=r.empty=0,r.object=t={}},test(s){return arguments.length?(n=s,r):n},clean(){const s={};let o=0;for(const a in t){const u=t[a];u!==o0&&(!n||!n(u))&&(s[a]=u,++o)}r.size=o,r.empty=0,r.object=t=s}};return e&&Object.keys(e).forEach(s=>{r.set(s,e[s])}),r}function yI(e,t,n,i,r,s){if(!n&&n!==0)return s;const o=+n;let a=e[0],u=Kl(e),l;u<a&&(l=a,a=u,u=l),l=Math.abs(t-a);const c=Math.abs(u-t);return l<c&&l<=o?i:c<=o?r:s}function bI(e,t,n){const i=e.prototype=Object.create(t.prototype);return Object.defineProperty(i,"constructor",{value:e,writable:!0,enumerable:!0,configurable:!0}),tA(i,n)}function xI(e,t,n,i){let r=t[0],s=t[t.length-1],o;return r>s&&(o=r,r=s,s=o),n=n===void 0||n,i=i===void 0||i,(n?r<=e:r<e)&&(i?e<=s:e<s)}function n6(e){return typeof e=="boolean"}function i6(e){return Object.prototype.toString.call(e)==="[object Date]"}function vI(e){return e&&pl(e[Symbol.iterator])}function r6(e){return typeof e=="number"}function AI(e){return Object.prototype.toString.call(e)==="[object RegExp]"}function Pi(e){return typeof e=="string"}function EI(e,t,n){e&&(e=t?hd(e).map(a=>a.replace(/\\(.)/g,"$1")):hd(e));const i=e&&e.length,r=n&&n.get||H5,s=a=>r(t?[a]:Xv(a));let o;if(!i)o=function(){return""};else if(i===1){const a=s(e[0]);o=function(u){return""+a(u)}}else{const a=e.map(s);o=function(u){let l=""+a[0](u),c=0;for(;++c<i;)l+="|"+a[c](u);return l}}return ks(o,e,"key")}function wI(e,t){const n=e[0],i=Kl(e),r=+t;return r?r===1?i:n+r*(i-n):n}const $I=1e4;function CI(e){e=+e||$I;let t,n,i;const r=()=>{t={},n={},i=0},s=(o,a)=>(++i>e&&(n=t,t={},i=1),t[o]=a);return r(),{clear:r,has:o=>ki(t,o)||ki(n,o),get:o=>ki(t,o)?t[o]:ki(n,o)?s(o,n[o]):void 0,set:(o,a)=>ki(t,o)?t[o]=a:s(o,a)}}function FI(e,t,n,i){const r=t.length,s=n.length;if(!s)return t;if(!r)return n;const o=i||new t.constructor(r+s);let a=0,u=0,l=0;for(;a<r&&u<s;++l)o[l]=e(t[a],n[u])>0?n[u++]:t[a++];for(;a<r;++a,++l)o[l]=t[a];for(;u<s;++u,++l)o[l]=n[u];return o}function mf(e,t){let n="";for(;--t>=0;)n+=e;return n}function SI(e,t,n,i){const r=n||" ",s=e+"",o=t-s.length;return o<=0?s:i==="left"?mf(r,o)+s:i==="center"?mf(r,~~(o/2))+s+mf(r,Math.ceil(o/2)):s+mf(r,o)}function DI(e){return e&&Kl(e)-e[0]||0}function s6(e){return Xl(e)?"["+e.map(s6)+"]":gl(e)||Pi(e)?JSON.stringify(e).replace("\u2028","\\u2028").replace("\u2029","\\u2029"):e}function _I(e){return e==null||e===""?null:!e||e==="false"||e==="0"?!1:!!e}const kI=e=>r6(e)||i6(e)?e:Date.parse(e);function MI(e,t){return t=t||kI,e==null||e===""?null:t(e)}function OI(e){return e==null||e===""?null:e+""}function D2(e){const t={},n=e.length;for(let i=0;i<n;++i)t[e[i]]=!0;return t}function NI(e,t,n,i){const r=i??"…",s=e+"",o=s.length,a=Math.max(0,t-r.length);return o<=t?s:n==="left"?r+s.slice(o-a):n==="center"?s.slice(0,Math.ceil(a/2))+r+s.slice(o-~~(a/2)):s.slice(0,a)+r}function TI(e,t,n){if(e)if(t){const i=e.length;for(let r=0;r<i;++r){const s=t(e[r]);s&&n(s,r,e)}}else e.forEach(n)}function Jl(e,t,n){return e.fields=t||[],e.fname=n,e}function BI(e){return e.length===1?RI(e[0]):LI(e)}const RI=e=>function(t){return t[e]},LI=e=>{const t=e.length;return function(n){for(let i=0;i<t;++i)n=n[e[i]];return n}};function Ta(e){throw Error(e)}function PI(e){const t=[],n=e.length;let i=null,r=0,s="",o,a,u;e=e+"";function l(){t.push(s+e.substring(o,a)),s="",o=a+1}for(o=a=0;a<n;++a)if(u=e[a],u==="\\")s+=e.substring(o,a++),o=a;else if(u===i)l(),i=null,r=-1;else{if(i)continue;o===r&&u==='"'||o===r&&u==="'"?(o=a+1,i=u):u==="."&&!r?a>o?l():o=a+1:u==="["?(a>o&&l(),r=o=a+1):u==="]"&&(r||Ta("Access path missing open bracket: "+e),r>0&&l(),r=0,o=a+1)}return r&&Ta("Access path missing closing bracket: "+e),i&&Ta("Access path missing closing quote: "+e),a>o&&(a++,l()),t}function II(e,t,n){const i=PI(e);return e=i.length===1?i[0]:e,Jl((n&&n.get||BI)(i),[e],t||e)}const Fm=II("id"),o6=Jl(e=>e,[],"identity");Jl(()=>0,[],"zero");Jl(()=>1,[],"one");const _2=Jl(()=>!0,[],"true");Jl(()=>!1,[],"false");function zI(e,t,n){const i=[t].concat([].slice.call(n));console[e].apply(console,i)}const jI=0,a6=1,UI=2,qI=3,WI=4;function GI(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:zI,i=e||jI;return{level(r){return arguments.length?(i=+r,this):i},error(){return i>=a6&&n(t||"error","ERROR",arguments),this},warn(){return i>=UI&&n(t||"warn","WARN",arguments),this},info(){return i>=qI&&n(t||"log","INFO",arguments),this},debug(){return i>=WI&&n(t||"log","DEBUG",arguments),this}}}var mo=Array.isArray;function Mg(e){return e!=null?mo(e)?e:[e]:[]}function ao(e){return typeof e=="function"}function nA(e){return ao(e)?e:()=>e}function HI(e,t){let n;return i=>{n&&clearTimeout(n),n=setTimeout(()=>(t(i),n=null),e)}}function u6(e){for(let t,n,i=1,r=arguments.length;i<r;++i){t=arguments[i];for(n in t)e[n]=t[n]}return e}const VI=Object.prototype.hasOwnProperty;function YI(e,t){return VI.call(e,t)}function l6(e,t,n){const i=e.prototype=Object.create(t.prototype);return Object.defineProperty(i,"constructor",{value:e,writable:!0,enumerable:!0,configurable:!0}),u6(i,n)}function ya(e,t,n){if(e)if(t){const i=e.length;for(let r=0;r<i;++r){const s=t(e[r]);s&&n(s,r,e)}}else e.forEach(n)}function Ql(e,t,n){return e.fields=t||[],e.fname=n,e}function XI(e){return e.length===1?KI(e[0]):JI(e)}const KI=e=>function(t){return t[e]},JI=e=>{const t=e.length;return function(n){for(let i=0;i<t;++i)n=n[e[i]];return n}};function gr(e){throw Error(e)}function QI(e){const t=[],n=e.length;let i=null,r=0,s="",o,a,u;e=e+"";function l(){t.push(s+e.substring(o,a)),s="",o=a+1}for(o=a=0;a<n;++a)if(u=e[a],u==="\\")s+=e.substring(o,a++),o=a;else if(u===i)l(),i=null,r=-1;else{if(i)continue;o===r&&u==='"'||o===r&&u==="'"?(o=a+1,i=u):u==="."&&!r?a>o?l():o=a+1:u==="["?(a>o&&l(),r=o=a+1):u==="]"&&(r||gr("Access path missing open bracket: "+e),r>0&&l(),r=0,o=a+1)}return r&&gr("Access path missing closing bracket: "+e),i&&gr("Access path missing closing quote: "+e),a>o&&(a++,l()),t}function c6(e,t,n){const i=QI(e);return e=i.length===1?i[0]:e,Ql((n&&n.get||XI)(i),[e],t||e)}c6("id");const f6=Ql(e=>e,[],"identity");Ql(()=>0,[],"zero");Ql(()=>1,[],"one");Ql(()=>!0,[],"true");Ql(()=>!1,[],"false");var d6=Array.isArray;function h6(e){return e===Object(e)}function qF(e){return e==null||e===""?null:+e}function iA(e){return typeof e=="function"}function rA(e){for(let t,n,i=1,r=arguments.length;i<r;++i){t=arguments[i];for(n in t)e[n]=t[n]}return e}const ZI=Object.prototype.hasOwnProperty;function g6(e,t){return ZI.call(e,t)}function ez(e){return Object.prototype.toString.call(e)==="[object Date]"}function tz(e){return e&&iA(e[Symbol.iterator])}function nz(e){return typeof e=="number"}function iz(e){return typeof e=="string"}function sA(e){return d6(e)?"["+e.map(sA)+"]":h6(e)||iz(e)?JSON.stringify(e).replace("\u2028","\\u2028").replace("\u2029","\\u2029"):e}function rz(e){return e==null||e===""?null:!e||e==="false"||e==="0"?!1:!!e}const sz=e=>nz(e)||ez(e)?e:Date.parse(e);function oz(e,t){return t=t||sz,e==null||e===""?null:t(e)}function az(e){return e==null||e===""?null:e+""}var WF={},Py={},Iy=34,Uc=10,zy=13;function p6(e){return new Function("d","return {"+e.map(function(t,n){return JSON.stringify(t)+": d["+n+'] || ""'}).join(",")+"}")}function uz(e,t){var n=p6(e);return function(i,r){return t(n(i),r,e)}}function GF(e){var t=Object.create(null),n=[];return e.forEach(function(i){for(var r in i)r in t||n.push(t[r]=r)}),n}function En(e,t){var n=e+"",i=n.length;return i<t?new Array(t-i+1).join(0)+n:n}function lz(e){return e<0?"-"+En(-e,6):e>9999?"+"+En(e,6):En(e,4)}function cz(e){var t=e.getUTCHours(),n=e.getUTCMinutes(),i=e.getUTCSeconds(),r=e.getUTCMilliseconds();return isNaN(e)?"Invalid Date":lz(e.getUTCFullYear())+"-"+En(e.getUTCMonth()+1,2)+"-"+En(e.getUTCDate(),2)+(r?"T"+En(t,2)+":"+En(n,2)+":"+En(i,2)+"."+En(r,3)+"Z":i?"T"+En(t,2)+":"+En(n,2)+":"+En(i,2)+"Z":n||t?"T"+En(t,2)+":"+En(n,2)+"Z":"")}function fz(e){var t=new RegExp('["'+e+`
\r]`),n=e.charCodeAt(0);function i(f,d){var h,g,p=r(f,function(m,y){if(h)return h(m,y-1);g=m,h=d?uz(m,d):p6(m)});return p.columns=g||[],p}function r(f,d){var h=[],g=f.length,p=0,m=0,y,b=g<=0,x=!1;f.charCodeAt(g-1)===Uc&&--g,f.charCodeAt(g-1)===zy&&--g;function v(){if(b)return Py;if(x)return x=!1,WF;var w,E=p,$;if(f.charCodeAt(E)===Iy){for(;p++<g&&f.charCodeAt(p)!==Iy||f.charCodeAt(++p)===Iy;);return(w=p)>=g?b=!0:($=f.charCodeAt(p++))===Uc?x=!0:$===zy&&(x=!0,f.charCodeAt(p)===Uc&&++p),f.slice(E+1,w-1).replace(/""/g,'"')}for(;p<g;){if(($=f.charCodeAt(w=p++))===Uc)x=!0;else if($===zy)x=!0,f.charCodeAt(p)===Uc&&++p;else if($!==n)continue;return f.slice(E,w)}return b=!0,f.slice(E,g)}for(;(y=v())!==Py;){for(var A=[];y!==WF&&y!==Py;)A.push(y),y=v();d&&(A=d(A,m++))==null||h.push(A)}return h}function s(f,d){return f.map(function(h){return d.map(function(g){return c(h[g])}).join(e)})}function o(f,d){return d==null&&(d=GF(f)),[d.map(c).join(e)].concat(s(f,d)).join(`
`)}function a(f,d){return d==null&&(d=GF(f)),s(f,d).join(`
`)}function u(f){return f.map(l).join(`
`)}function l(f){return f.map(c).join(e)}function c(f){return f==null?"":f instanceof Date?cz(f):t.test(f+="")?'"'+f.replace(/"/g,'""')+'"':f}return{parse:i,parseRows:r,format:o,formatBody:a,formatRows:u,formatRow:l,formatValue:c}}function dz(e){return e}function hz(e){if(e==null)return dz;var t,n,i=e.scale[0],r=e.scale[1],s=e.translate[0],o=e.translate[1];return function(a,u){u||(t=n=0);var l=2,c=a.length,f=new Array(c);for(f[0]=(t+=a[0])*i+s,f[1]=(n+=a[1])*r+o;l<c;)f[l]=a[l],++l;return f}}function gz(e,t){for(var n,i=e.length,r=i-t;r<--i;)n=e[r],e[r++]=e[i],e[i]=n}function pz(e,t){return typeof t=="string"&&(t=e.objects[t]),t.type==="GeometryCollection"?{type:"FeatureCollection",features:t.geometries.map(function(n){return HF(e,n)})}:HF(e,t)}function HF(e,t){var n=t.id,i=t.bbox,r=t.properties==null?{}:t.properties,s=m6(e,t);return n==null&&i==null?{type:"Feature",properties:r,geometry:s}:i==null?{type:"Feature",id:n,properties:r,geometry:s}:{type:"Feature",id:n,bbox:i,properties:r,geometry:s}}function m6(e,t){var n=hz(e.transform),i=e.arcs;function r(c,f){f.length&&f.pop();for(var d=i[c<0?~c:c],h=0,g=d.length;h<g;++h)f.push(n(d[h],h));c<0&&gz(f,g)}function s(c){return n(c)}function o(c){for(var f=[],d=0,h=c.length;d<h;++d)r(c[d],f);return f.length<2&&f.push(f[0]),f}function a(c){for(var f=o(c);f.length<4;)f.push(f[0]);return f}function u(c){return c.map(a)}function l(c){var f=c.type,d;switch(f){case"GeometryCollection":return{type:f,geometries:c.geometries.map(l)};case"Point":d=s(c.coordinates);break;case"MultiPoint":d=c.coordinates.map(s);break;case"LineString":d=o(c.arcs);break;case"MultiLineString":d=c.arcs.map(o);break;case"Polygon":d=u(c.arcs);break;case"MultiPolygon":d=c.arcs.map(u);break;default:return null}return{type:f,coordinates:d}}return l(t)}function mz(e,t){var n={},i={},r={},s=[],o=-1;t.forEach(function(l,c){var f=e.arcs[l<0?~l:l],d;f.length<3&&!f[1][0]&&!f[1][1]&&(d=t[++o],t[o]=l,t[c]=d)}),t.forEach(function(l){var c=a(l),f=c[0],d=c[1],h,g;if(h=r[f])if(delete r[h.end],h.push(l),h.end=d,g=i[d]){delete i[g.start];var p=g===h?h:h.concat(g);i[p.start=h.start]=r[p.end=g.end]=p}else i[h.start]=r[h.end]=h;else if(h=i[d])if(delete i[h.start],h.unshift(l),h.start=f,g=r[f]){delete r[g.end];var m=g===h?h:g.concat(h);i[m.start=g.start]=r[m.end=h.end]=m}else i[h.start]=r[h.end]=h;else h=[l],i[h.start=f]=r[h.end=d]=h});function a(l){var c=e.arcs[l<0?~l:l],f=c[0],d;return e.transform?(d=[0,0],c.forEach(function(h){d[0]+=h[0],d[1]+=h[1]})):d=c[c.length-1],l<0?[d,f]:[f,d]}function u(l,c){for(var f in l){var d=l[f];delete c[d.start],delete d.start,delete d.end,d.forEach(function(h){n[h<0?~h:h]=1}),s.push(d)}}return u(r,i),u(i,r),t.forEach(function(l){n[l<0?~l:l]||s.push([l])}),s}function yz(e){return m6(e,bz.apply(this,arguments))}function bz(e,t,n){var i,r,s;if(arguments.length>1)i=xz(e,t,n);else for(r=0,i=new Array(s=e.arcs.length);r<s;++r)i[r]=r;return{type:"MultiLineString",arcs:mz(e,i)}}function xz(e,t,n){var i=[],r=[],s;function o(f){var d=f<0?~f:f;(r[d]||(r[d]=[])).push({i:f,g:s})}function a(f){f.forEach(o)}function u(f){f.forEach(a)}function l(f){f.forEach(u)}function c(f){switch(s=f,f.type){case"GeometryCollection":f.geometries.forEach(c);break;case"LineString":a(f.arcs);break;case"MultiLineString":case"Polygon":u(f.arcs);break;case"MultiPolygon":l(f.arcs);break}}return c(t),r.forEach(n==null?function(f){i.push(f[0].i)}:function(f){n(f[0].g,f[f.length-1].g)&&i.push(f[0].i)}),i}function ms(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function vz(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function uh(e){let t,n,i;e.length!==2?(t=ms,n=(a,u)=>ms(e(a),u),i=(a,u)=>e(a)-u):(t=e===ms||e===vz?e:Az,n=e,i=e);function r(a,u,l=0,c=a.length){if(l<c){if(t(u,u)!==0)return c;do{const f=l+c>>>1;n(a[f],u)<0?l=f+1:c=f}while(l<c)}return l}function s(a,u,l=0,c=a.length){if(l<c){if(t(u,u)!==0)return c;do{const f=l+c>>>1;n(a[f],u)<=0?l=f+1:c=f}while(l<c)}return l}function o(a,u,l=0,c=a.length){const f=r(a,u,l,c-1);return f>l&&i(a[f-1],u)>-i(a[f],u)?f-1:f}return{left:r,center:o,right:s}}function Az(){return 0}function y6(e){return e===null?NaN:+e}function*Ez(e,t){if(t===void 0)for(let n of e)n!=null&&(n=+n)>=n&&(yield n);else{let n=-1;for(let i of e)(i=t(i,++n,e))!=null&&(i=+i)>=i&&(yield i)}}const b6=uh(ms),Og=b6.right,wz=b6.left;uh(y6).center;const lh=Og;function $z(e,t){let n=0,i,r=0,s=0;if(t===void 0)for(let o of e)o!=null&&(o=+o)>=o&&(i=o-r,r+=i/++n,s+=i*(o-r));else{let o=-1;for(let a of e)(a=t(a,++o,e))!=null&&(a=+a)>=a&&(i=a-r,r+=i/++n,s+=i*(a-r))}if(n>1)return s/(n-1)}function Cz(e,t){const n=$z(e,t);return n&&Math.sqrt(n)}class gn{constructor(){this._partials=new Float64Array(32),this._n=0}add(t){const n=this._partials;let i=0;for(let r=0;r<this._n&&r<32;r++){const s=n[r],o=t+s,a=Math.abs(t)<Math.abs(s)?t-(o-s):s-(o-t);a&&(n[i++]=a),t=o}return n[i]=t,this._n=i+1,this}valueOf(){const t=this._partials;let n=this._n,i,r,s,o=0;if(n>0){for(o=t[--n];n>0&&(i=o,r=t[--n],o=i+r,s=r-(o-i),!s););n>0&&(s<0&&t[n-1]<0||s>0&&t[n-1]>0)&&(r=s*2,i=o+r,r==i-o&&(o=i))}return o}}class VF extends Map{constructor(t,n=A6){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),t!=null)for(const[i,r]of t)this.set(i,r)}get(t){return super.get(k2(this,t))}has(t){return super.has(k2(this,t))}set(t,n){return super.set(x6(this,t),n)}delete(t){return super.delete(v6(this,t))}}class Ng extends Set{constructor(t,n=A6){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),t!=null)for(const i of t)this.add(i)}has(t){return super.has(k2(this,t))}add(t){return super.add(x6(this,t))}delete(t){return super.delete(v6(this,t))}}function k2({_intern:e,_key:t},n){const i=t(n);return e.has(i)?e.get(i):n}function x6({_intern:e,_key:t},n){const i=t(n);return e.has(i)?e.get(i):(e.set(i,n),n)}function v6({_intern:e,_key:t},n){const i=t(n);return e.has(i)&&(n=e.get(i),e.delete(i)),n}function A6(e){return e!==null&&typeof e=="object"?e.valueOf():e}function Fz(e,t){return Array.from(t,n=>e[n])}function Sz(e=ms){if(e===ms)return E6;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,n)=>{const i=e(t,n);return i||i===0?i:(e(n,n)===0)-(e(t,t)===0)}}function E6(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}const Dz=Math.sqrt(50),_z=Math.sqrt(10),kz=Math.sqrt(2);function Tg(e,t,n){const i=(t-e)/Math.max(0,n),r=Math.floor(Math.log10(i)),s=i/Math.pow(10,r),o=s>=Dz?10:s>=_z?5:s>=kz?2:1;let a,u,l;return r<0?(l=Math.pow(10,-r)/o,a=Math.round(e*l),u=Math.round(t*l),a/l<e&&++a,u/l>t&&--u,l=-l):(l=Math.pow(10,r)*o,a=Math.round(e/l),u=Math.round(t/l),a*l<e&&++a,u*l>t&&--u),u<a&&.5<=n&&n<2?Tg(e,t,n*2):[a,u,l]}function M2(e,t,n){if(t=+t,e=+e,n=+n,!(n>0))return[];if(e===t)return[e];const i=t<e,[r,s,o]=i?Tg(t,e,n):Tg(e,t,n);if(!(s>=r))return[];const a=s-r+1,u=new Array(a);if(i)if(o<0)for(let l=0;l<a;++l)u[l]=(s-l)/-o;else for(let l=0;l<a;++l)u[l]=(s-l)*o;else if(o<0)for(let l=0;l<a;++l)u[l]=(r+l)/-o;else for(let l=0;l<a;++l)u[l]=(r+l)*o;return u}function O2(e,t,n){return t=+t,e=+e,n=+n,Tg(e,t,n)[2]}function yo(e,t,n){t=+t,e=+e,n=+n;const i=t<e,r=i?O2(t,e,n):O2(e,t,n);return(i?-1:1)*(r<0?1/-r:r)}function Ba(e,t){let n;if(t===void 0)for(const i of e)i!=null&&(n<i||n===void 0&&i>=i)&&(n=i);else{let i=-1;for(let r of e)(r=t(r,++i,e))!=null&&(n<r||n===void 0&&r>=r)&&(n=r)}return n}function N2(e,t){let n;if(t===void 0)for(const i of e)i!=null&&(n>i||n===void 0&&i>=i)&&(n=i);else{let i=-1;for(let r of e)(r=t(r,++i,e))!=null&&(n>r||n===void 0&&r>=r)&&(n=r)}return n}function w6(e,t,n=0,i=1/0,r){if(t=Math.floor(t),n=Math.floor(Math.max(0,n)),i=Math.floor(Math.min(e.length-1,i)),!(n<=t&&t<=i))return e;for(r=r===void 0?E6:Sz(r);i>n;){if(i-n>600){const u=i-n+1,l=t-n+1,c=Math.log(u),f=.5*Math.exp(2*c/3),d=.5*Math.sqrt(c*f*(u-f)/u)*(l-u/2<0?-1:1),h=Math.max(n,Math.floor(t-l*f/u+d)),g=Math.min(i,Math.floor(t+(u-l)*f/u+d));w6(e,t,h,g,r)}const s=e[t];let o=n,a=i;for(qc(e,n,t),r(e[i],s)>0&&qc(e,n,i);o<a;){for(qc(e,o,a),++o,--a;r(e[o],s)<0;)++o;for(;r(e[a],s)>0;)--a}r(e[n],s)===0?qc(e,n,a):(++a,qc(e,a,i)),a<=t&&(n=a+1),t<=a&&(i=a-1)}return e}function qc(e,t,n){const i=e[t];e[t]=e[n],e[n]=i}function T2(e,t,n){if(e=Float64Array.from(Ez(e,n)),!(!(i=e.length)||isNaN(t=+t))){if(t<=0||i<2)return N2(e);if(t>=1)return Ba(e);var i,r=(i-1)*t,s=Math.floor(r),o=Ba(w6(e,s).subarray(0,s+1)),a=N2(e.subarray(s+1));return o+(a-o)*(r-s)}}function $6(e,t,n=y6){if(!(!(i=e.length)||isNaN(t=+t))){if(t<=0||i<2)return+n(e[0],0,e);if(t>=1)return+n(e[i-1],i-1,e);var i,r=(i-1)*t,s=Math.floor(r),o=+n(e[s],s,e),a=+n(e[s+1],s+1,e);return o+(a-o)*(r-s)}}function Mz(e,t){let n=0,i=0;if(t===void 0)for(let r of e)r!=null&&(r=+r)>=r&&(++n,i+=r);else{let r=-1;for(let s of e)(s=t(s,++r,e))!=null&&(s=+s)>=s&&(++n,i+=s)}if(n)return i/n}function C6(e,t){return T2(e,.5,t)}function*Oz(e){for(const t of e)yield*t}function F6(e){return Array.from(Oz(e))}function Kn(e,t,n){e=+e,t=+t,n=(r=arguments.length)<2?(t=e,e=0,1):r<3?1:+n;for(var i=-1,r=Math.max(0,Math.ceil((t-e)/n))|0,s=new Array(r);++i<r;)s[i]=e+i*n;return s}function S6(e,t){let n=0;if(t===void 0)for(let i of e)(i=+i)&&(n+=i);else{let i=-1;for(let r of e)(r=+t(r,++i,e))&&(n+=r)}return n}function Nz(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function Bg(e,t){if((n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var n,i=e.slice(0,n);return[i.length>1?i[0]+i.slice(2):i,+e.slice(n+1)]}function ml(e){return e=Bg(Math.abs(e)),e?e[1]:NaN}function Tz(e,t){return function(n,i){for(var r=n.length,s=[],o=0,a=e[0],u=0;r>0&&a>0&&(u+a+1>i&&(a=Math.max(1,i-u)),s.push(n.substring(r-=a,r+a)),!((u+=a+1)>i));)a=e[o=(o+1)%e.length];return s.reverse().join(t)}}function Bz(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var Rz=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Ha(e){if(!(t=Rz.exec(e)))throw new Error("invalid format: "+e);var t;return new oA({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}Ha.prototype=oA.prototype;function oA(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}oA.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function Lz(e){e:for(var t=e.length,n=1,i=-1,r;n<t;++n)switch(e[n]){case".":i=r=n;break;case"0":i===0&&(i=n),r=n;break;default:if(!+e[n])break e;i>0&&(i=0);break}return i>0?e.slice(0,i)+e.slice(r+1):e}var D6;function Pz(e,t){var n=Bg(e,t);if(!n)return e+"";var i=n[0],r=n[1],s=r-(D6=Math.max(-8,Math.min(8,Math.floor(r/3)))*3)+1,o=i.length;return s===o?i:s>o?i+new Array(s-o+1).join("0"):s>0?i.slice(0,s)+"."+i.slice(s):"0."+new Array(1-s).join("0")+Bg(e,Math.max(0,t+s-1))[0]}function YF(e,t){var n=Bg(e,t);if(!n)return e+"";var i=n[0],r=n[1];return r<0?"0."+new Array(-r).join("0")+i:i.length>r+1?i.slice(0,r+1)+"."+i.slice(r+1):i+new Array(r-i.length+2).join("0")}const XF={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:Nz,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>YF(e*100,t),r:YF,s:Pz,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function KF(e){return e}var JF=Array.prototype.map,QF=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function _6(e){var t=e.grouping===void 0||e.thousands===void 0?KF:Tz(JF.call(e.grouping,Number),e.thousands+""),n=e.currency===void 0?"":e.currency[0]+"",i=e.currency===void 0?"":e.currency[1]+"",r=e.decimal===void 0?".":e.decimal+"",s=e.numerals===void 0?KF:Bz(JF.call(e.numerals,String)),o=e.percent===void 0?"%":e.percent+"",a=e.minus===void 0?"":e.minus+"",u=e.nan===void 0?"NaN":e.nan+"";function l(f){f=Ha(f);var d=f.fill,h=f.align,g=f.sign,p=f.symbol,m=f.zero,y=f.width,b=f.comma,x=f.precision,v=f.trim,A=f.type;A==="n"?(b=!0,A="g"):XF[A]||(x===void 0&&(x=12),v=!0,A="g"),(m||d==="0"&&h==="=")&&(m=!0,d="0",h="=");var w=p==="$"?n:p==="#"&&/[boxX]/.test(A)?"0"+A.toLowerCase():"",E=p==="$"?i:/[%p]/.test(A)?o:"",$=XF[A],k=/[defgprs%]/.test(A);x=x===void 0?6:/[gprs]/.test(A)?Math.max(1,Math.min(21,x)):Math.max(0,Math.min(20,x));function F(D){var T=w,C=E,_,S,M;if(A==="c")C=$(D)+C,D="";else{D=+D;var O=D<0||1/D<0;if(D=isNaN(D)?u:$(Math.abs(D),x),v&&(D=Lz(D)),O&&+D==0&&g!=="+"&&(O=!1),T=(O?g==="("?g:a:g==="-"||g==="("?"":g)+T,C=(A==="s"?QF[8+D6/3]:"")+C+(O&&g==="("?")":""),k){for(_=-1,S=D.length;++_<S;)if(M=D.charCodeAt(_),48>M||M>57){C=(M===46?r+D.slice(_+1):D.slice(_))+C,D=D.slice(0,_);break}}}b&&!m&&(D=t(D,1/0));var B=T.length+D.length+C.length,I=B<y?new Array(y-B+1).join(d):"";switch(b&&m&&(D=t(I+D,I.length?y-C.length:1/0),I=""),h){case"<":D=T+D+C+I;break;case"=":D=T+I+D+C;break;case"^":D=I.slice(0,B=I.length>>1)+T+D+C+I.slice(B);break;default:D=I+T+D+C;break}return s(D)}return F.toString=function(){return f+""},F}function c(f,d){var h=l((f=Ha(f),f.type="f",f)),g=Math.max(-8,Math.min(8,Math.floor(ml(d)/3)))*3,p=Math.pow(10,-g),m=QF[8+g/3];return function(y){return h(p*y)+m}}return{format:l,formatPrefix:c}}var a0,Sm,aA;Iz({thousands:",",grouping:[3],currency:["$",""]});function Iz(e){return a0=_6(e),Sm=a0.format,aA=a0.formatPrefix,a0}function k6(e){return Math.max(0,-ml(Math.abs(e)))}function M6(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(ml(t)/3)))*3-ml(Math.abs(e)))}function O6(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,ml(t)-ml(e))+1}function Zl(e,t,n){return e.fields=t||[],e.fname=n,e}function zz(e){return e.length===1?jz(e[0]):Uz(e)}const jz=e=>function(t){return t[e]},Uz=e=>{const t=e.length;return function(n){for(let i=0;i<t;++i)n=n[e[i]];return n}};function nl(e){throw Error(e)}function qz(e){const t=[],n=e.length;let i=null,r=0,s="",o,a,u;e=e+"";function l(){t.push(s+e.substring(o,a)),s="",o=a+1}for(o=a=0;a<n;++a)if(u=e[a],u==="\\")s+=e.substring(o,a++),o=a;else if(u===i)l(),i=null,r=-1;else{if(i)continue;o===r&&u==='"'||o===r&&u==="'"?(o=a+1,i=u):u==="."&&!r?a>o?l():o=a+1:u==="["?(a>o&&l(),r=o=a+1):u==="]"&&(r||nl("Access path missing open bracket: "+e),r>0&&l(),r=0,o=a+1)}return r&&nl("Access path missing closing bracket: "+e),i&&nl("Access path missing closing quote: "+e),a>o&&(a++,l()),t}function Wz(e,t,n){const i=qz(e);return e=i.length===1?i[0]:e,Zl((n&&n.get||zz)(i),[e],t||e)}Wz("id");Zl(e=>e,[],"identity");const Wc=Zl(()=>0,[],"zero"),Gz=Zl(()=>1,[],"one");Zl(()=>!0,[],"true");Zl(()=>!1,[],"false");var Hz=Array.isArray;function N6(e){return e[e.length-1]}function Vz(e){return e!=null?Hz(e)?e:[e]:[]}function Yz(e){return typeof e=="function"}function Xz(e){return Yz(e)?e:()=>e}function Kz(e){for(let t,n,i=1,r=arguments.length;i<r;++i){t=arguments[i];for(n in t)e[n]=t[n]}return e}const Jz=Object.prototype.hasOwnProperty;function Qz(e,t){return Jz.call(e,t)}function Zz(e){return e&&N6(e)-e[0]||0}function ej(e){const t={},n=e.length;for(let i=0;i<n;++i)t[e[i]]=!0;return t}const jy=new Date,Uy=new Date;function yt(e,t,n,i){function r(s){return e(s=arguments.length===0?new Date:new Date(+s)),s}return r.floor=s=>(e(s=new Date(+s)),s),r.ceil=s=>(e(s=new Date(s-1)),t(s,1),e(s),s),r.round=s=>{const o=r(s),a=r.ceil(s);return s-o<a-s?o:a},r.offset=(s,o)=>(t(s=new Date(+s),o==null?1:Math.floor(o)),s),r.range=(s,o,a)=>{const u=[];if(s=r.ceil(s),a=a==null?1:Math.floor(a),!(s<o)||!(a>0))return u;let l;do u.push(l=new Date(+s)),t(s,a),e(s);while(l<s&&s<o);return u},r.filter=s=>yt(o=>{if(o>=o)for(;e(o),!s(o);)o.setTime(o-1)},(o,a)=>{if(o>=o)if(a<0)for(;++a<=0;)for(;t(o,-1),!s(o););else for(;--a>=0;)for(;t(o,1),!s(o););}),n&&(r.count=(s,o)=>(jy.setTime(+s),Uy.setTime(+o),e(jy),e(Uy),Math.floor(n(jy,Uy))),r.every=s=>(s=Math.floor(s),!isFinite(s)||!(s>0)?null:s>1?r.filter(i?o=>i(o)%s===0:o=>r.count(0,o)%s===0):r)),r}const yl=yt(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);yl.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?yt(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):yl);yl.range;const cs=1e3,ai=cs*60,fs=ai*60,$s=fs*24,uA=$s*7,ZF=$s*30,qy=$s*365,ds=yt(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*cs)},(e,t)=>(t-e)/cs,e=>e.getUTCSeconds());ds.range;const Dm=yt(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*cs)},(e,t)=>{e.setTime(+e+t*ai)},(e,t)=>(t-e)/ai,e=>e.getMinutes());Dm.range;const _m=yt(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*ai)},(e,t)=>(t-e)/ai,e=>e.getUTCMinutes());_m.range;const km=yt(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*cs-e.getMinutes()*ai)},(e,t)=>{e.setTime(+e+t*fs)},(e,t)=>(t-e)/fs,e=>e.getHours());km.range;const Mm=yt(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*fs)},(e,t)=>(t-e)/fs,e=>e.getUTCHours());Mm.range;const ys=yt(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*ai)/$s,e=>e.getDate()-1);ys.range;const uo=yt(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/$s,e=>e.getUTCDate()-1);uo.range;const T6=yt(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/$s,e=>Math.floor(e/$s));T6.range;function gu(e){return yt(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,n)=>{t.setDate(t.getDate()+n*7)},(t,n)=>(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*ai)/uA)}const ec=gu(0),Rg=gu(1),tj=gu(2),nj=gu(3),bl=gu(4),ij=gu(5),rj=gu(6);ec.range;Rg.range;tj.range;nj.range;bl.range;ij.range;rj.range;function pu(e){return yt(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCDate(t.getUTCDate()+n*7)},(t,n)=>(n-t)/uA)}const tc=pu(0),Lg=pu(1),sj=pu(2),oj=pu(3),xl=pu(4),aj=pu(5),uj=pu(6);tc.range;Lg.range;sj.range;oj.range;xl.range;aj.range;uj.range;const gd=yt(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());gd.range;const pd=yt(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());pd.range;const wr=yt(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());wr.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:yt(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,n)=>{t.setFullYear(t.getFullYear()+n*e)});wr.range;const $r=yt(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());$r.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:yt(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)});$r.range;function B6(e,t,n,i,r,s){const o=[[ds,1,cs],[ds,5,5*cs],[ds,15,15*cs],[ds,30,30*cs],[s,1,ai],[s,5,5*ai],[s,15,15*ai],[s,30,30*ai],[r,1,fs],[r,3,3*fs],[r,6,6*fs],[r,12,12*fs],[i,1,$s],[i,2,2*$s],[n,1,uA],[t,1,ZF],[t,3,3*ZF],[e,1,qy]];function a(l,c,f){const d=c<l;d&&([l,c]=[c,l]);const h=f&&typeof f.range=="function"?f:u(l,c,f),g=h?h.range(l,+c+1):[];return d?g.reverse():g}function u(l,c,f){const d=Math.abs(c-l)/f,h=uh(([,,m])=>m).right(o,d);if(h===o.length)return e.every(yo(l/qy,c/qy,f));if(h===0)return yl.every(Math.max(yo(l,c,f),1));const[g,p]=o[d/o[h-1][2]<o[h][2]/d?h-1:h];return g.every(p)}return[a,u]}const[lj,cj]=B6($r,pd,tc,T6,Mm,_m),[fj,dj]=B6(wr,gd,ec,ys,km,Dm),Tt="year",Ln="quarter",Yt="month",ht="week",Pn="date",Wt="day",Cr="dayofyear",Zn="hours",ei="minutes",hi="seconds",qi="milliseconds",lA=[Tt,Ln,Yt,ht,Pn,Wt,Cr,Zn,ei,hi,qi],Wy=lA.reduce((e,t,n)=>(e[t]=1+n,e),{});function cA(e){const t=Vz(e).slice(),n={};return t.length||nl("Missing time unit."),t.forEach(r=>{Qz(Wy,r)?n[r]=1:nl(`Invalid time unit: ${r}.`)}),(n[ht]||n[Wt]?1:0)+(n[Ln]||n[Yt]||n[Pn]?1:0)+(n[Cr]?1:0)>1&&nl(`Incompatible time units: ${e}`),t.sort((r,s)=>Wy[r]-Wy[s]),t}const hj={[Tt]:"%Y ",[Ln]:"Q%q ",[Yt]:"%b ",[Pn]:"%d ",[ht]:"W%U ",[Wt]:"%a ",[Cr]:"%j ",[Zn]:"%H:00",[ei]:"00:%M",[hi]:":%S",[qi]:".%L",[`${Tt}-${Yt}`]:"%Y-%m ",[`${Tt}-${Yt}-${Pn}`]:"%Y-%m-%d ",[`${Zn}-${ei}`]:"%H:%M"};function R6(e,t){const n=Kz({},hj,t),i=cA(e),r=i.length;let s="",o=0,a,u;for(o=0;o<r;)for(a=i.length;a>o;--a)if(u=i.slice(o,a).join("-"),n[u]!=null){s+=n[u],o=a;break}return s.trim()}const va=new Date;function fA(e){return va.setFullYear(e),va.setMonth(0),va.setDate(1),va.setHours(0,0,0,0),va}function L6(e){return I6(new Date(e))}function P6(e){return B2(new Date(e))}function I6(e){return ys.count(fA(e.getFullYear())-1,e)}function B2(e){return ec.count(fA(e.getFullYear())-1,e)}function R2(e){return fA(e).getDay()}function gj(e,t,n,i,r,s,o){if(0<=e&&e<100){const a=new Date(-1,t,n,i,r,s,o);return a.setFullYear(e),a}return new Date(e,t,n,i,r,s,o)}function z6(e){return U6(new Date(e))}function j6(e){return L2(new Date(e))}function U6(e){const t=Date.UTC(e.getUTCFullYear(),0,1);return uo.count(t-1,e)}function L2(e){const t=Date.UTC(e.getUTCFullYear(),0,1);return tc.count(t-1,e)}function P2(e){return va.setTime(Date.UTC(e,0,1)),va.getUTCDay()}function pj(e,t,n,i,r,s,o){if(0<=e&&e<100){const a=new Date(Date.UTC(-1,t,n,i,r,s,o));return a.setUTCFullYear(n.y),a}return new Date(Date.UTC(e,t,n,i,r,s,o))}function q6(e,t,n,i,r){const s=t||1,o=N6(e),a=(y,b,x)=>(x=x||y,mj(n[x],i[x],y===o&&s,b)),u=new Date,l=ej(e),c=l[Tt]?a(Tt):Xz(2012),f=l[Yt]?a(Yt):l[Ln]?a(Ln):Wc,d=l[ht]&&l[Wt]?a(Wt,1,ht+Wt):l[ht]?a(ht,1):l[Wt]?a(Wt,1):l[Pn]?a(Pn,1):l[Cr]?a(Cr,1):Gz,h=l[Zn]?a(Zn):Wc,g=l[ei]?a(ei):Wc,p=l[hi]?a(hi):Wc,m=l[qi]?a(qi):Wc;return function(y){u.setTime(+y);const b=c(u);return r(b,f(u),d(u,b),h(u),g(u),p(u),m(u))}}function mj(e,t,n,i){const r=n<=1?e:i?(s,o)=>i+n*Math.floor((e(s,o)-i)/n):(s,o)=>n*Math.floor(e(s,o)/n);return t?(s,o)=>t(r(s,o),o):r}function vl(e,t,n){return t+e*7-(n+6)%7}const yj={[Tt]:e=>e.getFullYear(),[Ln]:e=>Math.floor(e.getMonth()/3),[Yt]:e=>e.getMonth(),[Pn]:e=>e.getDate(),[Zn]:e=>e.getHours(),[ei]:e=>e.getMinutes(),[hi]:e=>e.getSeconds(),[qi]:e=>e.getMilliseconds(),[Cr]:e=>I6(e),[ht]:e=>B2(e),[ht+Wt]:(e,t)=>vl(B2(e),e.getDay(),R2(t)),[Wt]:(e,t)=>vl(1,e.getDay(),R2(t))},bj={[Ln]:e=>3*e,[ht]:(e,t)=>vl(e,0,R2(t))};function W6(e,t){return q6(e,t||1,yj,bj,gj)}const xj={[Tt]:e=>e.getUTCFullYear(),[Ln]:e=>Math.floor(e.getUTCMonth()/3),[Yt]:e=>e.getUTCMonth(),[Pn]:e=>e.getUTCDate(),[Zn]:e=>e.getUTCHours(),[ei]:e=>e.getUTCMinutes(),[hi]:e=>e.getUTCSeconds(),[qi]:e=>e.getUTCMilliseconds(),[Cr]:e=>U6(e),[ht]:e=>L2(e),[Wt]:(e,t)=>vl(1,e.getUTCDay(),P2(t)),[ht+Wt]:(e,t)=>vl(L2(e),e.getUTCDay(),P2(t))},vj={[Ln]:e=>3*e,[ht]:(e,t)=>vl(e,0,P2(t))};function G6(e,t){return q6(e,t||1,xj,vj,pj)}const Aj={[Tt]:wr,[Ln]:gd.every(3),[Yt]:gd,[ht]:ec,[Pn]:ys,[Wt]:ys,[Cr]:ys,[Zn]:km,[ei]:Dm,[hi]:ds,[qi]:yl},Ej={[Tt]:$r,[Ln]:pd.every(3),[Yt]:pd,[ht]:tc,[Pn]:uo,[Wt]:uo,[Cr]:uo,[Zn]:Mm,[ei]:_m,[hi]:ds,[qi]:yl};function nc(e){return Aj[e]}function ic(e){return Ej[e]}function H6(e,t,n){return e?e.offset(t,n):void 0}function V6(e,t,n){return H6(nc(e),t,n)}function Y6(e,t,n){return H6(ic(e),t,n)}function X6(e,t,n,i){return e?e.range(t,n,i):void 0}function K6(e,t,n,i){return X6(nc(e),t,n,i)}function J6(e,t,n,i){return X6(ic(e),t,n,i)}const yf=1e3,bf=yf*60,xf=bf*60,Om=xf*24,wj=Om*7,eS=Om*30,I2=Om*365,Q6=[Tt,Yt,Pn,Zn,ei,hi,qi],vf=Q6.slice(0,-1),Af=vf.slice(0,-1),Ef=Af.slice(0,-1),$j=Ef.slice(0,-1),Cj=[Tt,ht],tS=[Tt,Yt],Z6=[Tt],Gc=[[vf,1,yf],[vf,5,5*yf],[vf,15,15*yf],[vf,30,30*yf],[Af,1,bf],[Af,5,5*bf],[Af,15,15*bf],[Af,30,30*bf],[Ef,1,xf],[Ef,3,3*xf],[Ef,6,6*xf],[Ef,12,12*xf],[$j,1,Om],[Cj,1,wj],[tS,1,eS],[tS,3,3*eS],[Z6,1,I2]];function eM(e){const t=e.extent,n=e.maxbins||40,i=Math.abs(Zz(t))/n;let r=uh(a=>a[2]).right(Gc,i),s,o;return r===Gc.length?(s=Z6,o=yo(t[0]/I2,t[1]/I2,n)):r?(r=Gc[i/Gc[r-1][2]<Gc[r][2]/i?r-1:r],s=r[0],o=r[1]):(s=Q6,o=Math.max(yo(t[0],t[1],n),1)),{units:s,step:o}}function rc(e,t,n){return e.fields=t||[],e.fname=n,e}function Fj(e){return e.length===1?Sj(e[0]):Dj(e)}const Sj=e=>function(t){return t[e]},Dj=e=>{const t=e.length;return function(n){for(let i=0;i<t;++i)n=n[e[i]];return n}};function Uf(e){throw Error(e)}function _j(e){const t=[],n=e.length;let i=null,r=0,s="",o,a,u;e=e+"";function l(){t.push(s+e.substring(o,a)),s="",o=a+1}for(o=a=0;a<n;++a)if(u=e[a],u==="\\")s+=e.substring(o,a++),o=a;else if(u===i)l(),i=null,r=-1;else{if(i)continue;o===r&&u==='"'||o===r&&u==="'"?(o=a+1,i=u):u==="."&&!r?a>o?l():o=a+1:u==="["?(a>o&&l(),r=o=a+1):u==="]"&&(r||Uf("Access path missing open bracket: "+e),r>0&&l(),r=0,o=a+1)}return r&&Uf("Access path missing closing bracket: "+e),i&&Uf("Access path missing closing quote: "+e),a>o&&(a++,l()),t}function kj(e,t,n){const i=_j(e);return e=i.length===1?i[0]:e,rc((n&&n.get||Fj)(i),[e],t||e)}kj("id");rc(e=>e,[],"identity");rc(()=>0,[],"zero");rc(()=>1,[],"one");rc(()=>!0,[],"true");rc(()=>!1,[],"false");function Mj(e){return e===Object(e)}function Oj(e){for(let t,n,i=1,r=arguments.length;i<r;++i){t=arguments[i];for(n in t)e[n]=t[n]}return e}function nS(e){return typeof e=="string"}function Gy(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function Hy(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function Hc(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function tM(e){var t=e.dateTime,n=e.date,i=e.time,r=e.periods,s=e.days,o=e.shortDays,a=e.months,u=e.shortMonths,l=Vc(r),c=Yc(r),f=Vc(s),d=Yc(s),h=Vc(o),g=Yc(o),p=Vc(a),m=Yc(a),y=Vc(u),b=Yc(u),x={a:O,A:B,b:I,B:G,c:null,d:uS,e:uS,f:tU,g:fU,G:hU,H:Qj,I:Zj,j:eU,L:nM,m:nU,M:iU,p:J,q:oe,Q:fS,s:dS,S:rU,u:sU,U:oU,V:aU,w:uU,W:lU,x:null,X:null,y:cU,Y:dU,Z:gU,"%":cS},v={a:be,A:ve,b:Pe,B:ta,c:null,d:lS,e:lS,f:bU,g:DU,G:kU,H:pU,I:mU,j:yU,L:rM,m:xU,M:vU,p:na,q:Us,Q:fS,s:dS,S:AU,u:EU,U:wU,V:$U,w:CU,W:FU,x:null,X:null,y:SU,Y:_U,Z:MU,"%":cS},A={a:F,A:D,b:T,B:C,c:_,d:oS,e:oS,f:Yj,g:sS,G:rS,H:aS,I:aS,j:Wj,L:Vj,m:qj,M:Gj,p:k,q:Uj,Q:Kj,s:Jj,S:Hj,u:Lj,U:Pj,V:Ij,w:Rj,W:zj,x:S,X:M,y:sS,Y:rS,Z:jj,"%":Xj};x.x=w(n,x),x.X=w(i,x),x.c=w(t,x),v.x=w(n,v),v.X=w(i,v),v.c=w(t,v);function w(H,le){return function(ge){var U=[],ct=-1,Me=0,nn=H.length,qn,ia,PF;for(ge instanceof Date||(ge=new Date(+ge));++ct<nn;)H.charCodeAt(ct)===37&&(U.push(H.slice(Me,ct)),(ia=iS[qn=H.charAt(++ct)])!=null?qn=H.charAt(++ct):ia=qn==="e"?" ":"0",(PF=le[qn])&&(qn=PF(ge,ia)),U.push(qn),Me=ct+1);return U.push(H.slice(Me,ct)),U.join("")}}function E(H,le){return function(ge){var U=Hc(1900,void 0,1),ct=$(U,H,ge+="",0),Me,nn;if(ct!=ge.length)return null;if("Q"in U)return new Date(U.Q);if("s"in U)return new Date(U.s*1e3+("L"in U?U.L:0));if(le&&!("Z"in U)&&(U.Z=0),"p"in U&&(U.H=U.H%12+U.p*12),U.m===void 0&&(U.m="q"in U?U.q:0),"V"in U){if(U.V<1||U.V>53)return null;"w"in U||(U.w=1),"Z"in U?(Me=Hy(Hc(U.y,0,1)),nn=Me.getUTCDay(),Me=nn>4||nn===0?Lg.ceil(Me):Lg(Me),Me=uo.offset(Me,(U.V-1)*7),U.y=Me.getUTCFullYear(),U.m=Me.getUTCMonth(),U.d=Me.getUTCDate()+(U.w+6)%7):(Me=Gy(Hc(U.y,0,1)),nn=Me.getDay(),Me=nn>4||nn===0?Rg.ceil(Me):Rg(Me),Me=ys.offset(Me,(U.V-1)*7),U.y=Me.getFullYear(),U.m=Me.getMonth(),U.d=Me.getDate()+(U.w+6)%7)}else("W"in U||"U"in U)&&("w"in U||(U.w="u"in U?U.u%7:"W"in U?1:0),nn="Z"in U?Hy(Hc(U.y,0,1)).getUTCDay():Gy(Hc(U.y,0,1)).getDay(),U.m=0,U.d="W"in U?(U.w+6)%7+U.W*7-(nn+5)%7:U.w+U.U*7-(nn+6)%7);return"Z"in U?(U.H+=U.Z/100|0,U.M+=U.Z%100,Hy(U)):Gy(U)}}function $(H,le,ge,U){for(var ct=0,Me=le.length,nn=ge.length,qn,ia;ct<Me;){if(U>=nn)return-1;if(qn=le.charCodeAt(ct++),qn===37){if(qn=le.charAt(ct++),ia=A[qn in iS?le.charAt(ct++):qn],!ia||(U=ia(H,ge,U))<0)return-1}else if(qn!=ge.charCodeAt(U++))return-1}return U}function k(H,le,ge){var U=l.exec(le.slice(ge));return U?(H.p=c.get(U[0].toLowerCase()),ge+U[0].length):-1}function F(H,le,ge){var U=h.exec(le.slice(ge));return U?(H.w=g.get(U[0].toLowerCase()),ge+U[0].length):-1}function D(H,le,ge){var U=f.exec(le.slice(ge));return U?(H.w=d.get(U[0].toLowerCase()),ge+U[0].length):-1}function T(H,le,ge){var U=y.exec(le.slice(ge));return U?(H.m=b.get(U[0].toLowerCase()),ge+U[0].length):-1}function C(H,le,ge){var U=p.exec(le.slice(ge));return U?(H.m=m.get(U[0].toLowerCase()),ge+U[0].length):-1}function _(H,le,ge){return $(H,t,le,ge)}function S(H,le,ge){return $(H,n,le,ge)}function M(H,le,ge){return $(H,i,le,ge)}function O(H){return o[H.getDay()]}function B(H){return s[H.getDay()]}function I(H){return u[H.getMonth()]}function G(H){return a[H.getMonth()]}function J(H){return r[+(H.getHours()>=12)]}function oe(H){return 1+~~(H.getMonth()/3)}function be(H){return o[H.getUTCDay()]}function ve(H){return s[H.getUTCDay()]}function Pe(H){return u[H.getUTCMonth()]}function ta(H){return a[H.getUTCMonth()]}function na(H){return r[+(H.getUTCHours()>=12)]}function Us(H){return 1+~~(H.getUTCMonth()/3)}return{format:function(H){var le=w(H+="",x);return le.toString=function(){return H},le},parse:function(H){var le=E(H+="",!1);return le.toString=function(){return H},le},utcFormat:function(H){var le=w(H+="",v);return le.toString=function(){return H},le},utcParse:function(H){var le=E(H+="",!0);return le.toString=function(){return H},le}}}var iS={"-":"",_:" ",0:"0"},_t=/^\s*\d+/,Nj=/^%/,Tj=/[\\^$*+?|[\]().{}]/g;function Ce(e,t,n){var i=e<0?"-":"",r=(i?-e:e)+"",s=r.length;return i+(s<n?new Array(n-s+1).join(t)+r:r)}function Bj(e){return e.replace(Tj,"\\$&")}function Vc(e){return new RegExp("^(?:"+e.map(Bj).join("|")+")","i")}function Yc(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function Rj(e,t,n){var i=_t.exec(t.slice(n,n+1));return i?(e.w=+i[0],n+i[0].length):-1}function Lj(e,t,n){var i=_t.exec(t.slice(n,n+1));return i?(e.u=+i[0],n+i[0].length):-1}function Pj(e,t,n){var i=_t.exec(t.slice(n,n+2));return i?(e.U=+i[0],n+i[0].length):-1}function Ij(e,t,n){var i=_t.exec(t.slice(n,n+2));return i?(e.V=+i[0],n+i[0].length):-1}function zj(e,t,n){var i=_t.exec(t.slice(n,n+2));return i?(e.W=+i[0],n+i[0].length):-1}function rS(e,t,n){var i=_t.exec(t.slice(n,n+4));return i?(e.y=+i[0],n+i[0].length):-1}function sS(e,t,n){var i=_t.exec(t.slice(n,n+2));return i?(e.y=+i[0]+(+i[0]>68?1900:2e3),n+i[0].length):-1}function jj(e,t,n){var i=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return i?(e.Z=i[1]?0:-(i[2]+(i[3]||"00")),n+i[0].length):-1}function Uj(e,t,n){var i=_t.exec(t.slice(n,n+1));return i?(e.q=i[0]*3-3,n+i[0].length):-1}function qj(e,t,n){var i=_t.exec(t.slice(n,n+2));return i?(e.m=i[0]-1,n+i[0].length):-1}function oS(e,t,n){var i=_t.exec(t.slice(n,n+2));return i?(e.d=+i[0],n+i[0].length):-1}function Wj(e,t,n){var i=_t.exec(t.slice(n,n+3));return i?(e.m=0,e.d=+i[0],n+i[0].length):-1}function aS(e,t,n){var i=_t.exec(t.slice(n,n+2));return i?(e.H=+i[0],n+i[0].length):-1}function Gj(e,t,n){var i=_t.exec(t.slice(n,n+2));return i?(e.M=+i[0],n+i[0].length):-1}function Hj(e,t,n){var i=_t.exec(t.slice(n,n+2));return i?(e.S=+i[0],n+i[0].length):-1}function Vj(e,t,n){var i=_t.exec(t.slice(n,n+3));return i?(e.L=+i[0],n+i[0].length):-1}function Yj(e,t,n){var i=_t.exec(t.slice(n,n+6));return i?(e.L=Math.floor(i[0]/1e3),n+i[0].length):-1}function Xj(e,t,n){var i=Nj.exec(t.slice(n,n+1));return i?n+i[0].length:-1}function Kj(e,t,n){var i=_t.exec(t.slice(n));return i?(e.Q=+i[0],n+i[0].length):-1}function Jj(e,t,n){var i=_t.exec(t.slice(n));return i?(e.s=+i[0],n+i[0].length):-1}function uS(e,t){return Ce(e.getDate(),t,2)}function Qj(e,t){return Ce(e.getHours(),t,2)}function Zj(e,t){return Ce(e.getHours()%12||12,t,2)}function eU(e,t){return Ce(1+ys.count(wr(e),e),t,3)}function nM(e,t){return Ce(e.getMilliseconds(),t,3)}function tU(e,t){return nM(e,t)+"000"}function nU(e,t){return Ce(e.getMonth()+1,t,2)}function iU(e,t){return Ce(e.getMinutes(),t,2)}function rU(e,t){return Ce(e.getSeconds(),t,2)}function sU(e){var t=e.getDay();return t===0?7:t}function oU(e,t){return Ce(ec.count(wr(e)-1,e),t,2)}function iM(e){var t=e.getDay();return t>=4||t===0?bl(e):bl.ceil(e)}function aU(e,t){return e=iM(e),Ce(bl.count(wr(e),e)+(wr(e).getDay()===4),t,2)}function uU(e){return e.getDay()}function lU(e,t){return Ce(Rg.count(wr(e)-1,e),t,2)}function cU(e,t){return Ce(e.getFullYear()%100,t,2)}function fU(e,t){return e=iM(e),Ce(e.getFullYear()%100,t,2)}function dU(e,t){return Ce(e.getFullYear()%1e4,t,4)}function hU(e,t){var n=e.getDay();return e=n>=4||n===0?bl(e):bl.ceil(e),Ce(e.getFullYear()%1e4,t,4)}function gU(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+Ce(t/60|0,"0",2)+Ce(t%60,"0",2)}function lS(e,t){return Ce(e.getUTCDate(),t,2)}function pU(e,t){return Ce(e.getUTCHours(),t,2)}function mU(e,t){return Ce(e.getUTCHours()%12||12,t,2)}function yU(e,t){return Ce(1+uo.count($r(e),e),t,3)}function rM(e,t){return Ce(e.getUTCMilliseconds(),t,3)}function bU(e,t){return rM(e,t)+"000"}function xU(e,t){return Ce(e.getUTCMonth()+1,t,2)}function vU(e,t){return Ce(e.getUTCMinutes(),t,2)}function AU(e,t){return Ce(e.getUTCSeconds(),t,2)}function EU(e){var t=e.getUTCDay();return t===0?7:t}function wU(e,t){return Ce(tc.count($r(e)-1,e),t,2)}function sM(e){var t=e.getUTCDay();return t>=4||t===0?xl(e):xl.ceil(e)}function $U(e,t){return e=sM(e),Ce(xl.count($r(e),e)+($r(e).getUTCDay()===4),t,2)}function CU(e){return e.getUTCDay()}function FU(e,t){return Ce(Lg.count($r(e)-1,e),t,2)}function SU(e,t){return Ce(e.getUTCFullYear()%100,t,2)}function DU(e,t){return e=sM(e),Ce(e.getUTCFullYear()%100,t,2)}function _U(e,t){return Ce(e.getUTCFullYear()%1e4,t,4)}function kU(e,t){var n=e.getUTCDay();return e=n>=4||n===0?xl(e):xl.ceil(e),Ce(e.getUTCFullYear()%1e4,t,4)}function MU(){return"+0000"}function cS(){return"%"}function fS(e){return+e}function dS(e){return Math.floor(+e/1e3)}var Tu,dA,oM,hA,aM;OU({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function OU(e){return Tu=tM(e),dA=Tu.format,oM=Tu.parse,hA=Tu.utcFormat,aM=Tu.utcParse,Tu}function wf(e){const t={};return n=>t[n]||(t[n]=e(n))}function NU(e,t){return n=>{const i=e(n),r=i.indexOf(t);if(r<0)return i;let s=TU(i,r);const o=s<i.length?i.slice(s):"";for(;--s>r;)if(i[s]!=="0"){++s;break}return i.slice(0,s)+o}}function TU(e,t){let n=e.lastIndexOf("e"),i;if(n>0)return n;for(n=e.length;--n>t;)if(i=e.charCodeAt(n),i>=48&&i<=57)return n+1}function uM(e){const t=wf(e.format),n=e.formatPrefix;return{format:t,formatPrefix:n,formatFloat(i){const r=Ha(i||",");if(r.precision==null){switch(r.precision=12,r.type){case"%":r.precision-=2;break;case"e":r.precision-=1;break}return NU(t(r),t(".1f")(1)[1])}else return t(r)},formatSpan(i,r,s,o){o=Ha(o??",f");const a=yo(i,r,s),u=Math.max(Math.abs(i),Math.abs(r));let l;if(o.precision==null)switch(o.type){case"s":return isNaN(l=M6(a,u))||(o.precision=l),n(o,u);case"":case"e":case"g":case"p":case"r":{isNaN(l=O6(a,u))||(o.precision=l-(o.type==="e"));break}case"f":case"%":{isNaN(l=k6(a))||(o.precision=l-(o.type==="%")*2);break}}return t(o)}}}let z2;lM();function lM(){return z2=uM({format:Sm,formatPrefix:aA})}function cM(e){return uM(_6(e))}function Pg(e){return arguments.length?z2=cM(e):z2}function hS(e,t,n){n=n||{},Mj(n)||Uf(`Invalid time multi-format specifier: ${n}`);const i=t(hi),r=t(ei),s=t(Zn),o=t(Pn),a=t(ht),u=t(Yt),l=t(Ln),c=t(Tt),f=e(n[qi]||".%L"),d=e(n[hi]||":%S"),h=e(n[ei]||"%I:%M"),g=e(n[Zn]||"%I %p"),p=e(n[Pn]||n[Wt]||"%a %d"),m=e(n[ht]||"%b %d"),y=e(n[Yt]||"%B"),b=e(n[Ln]||"%B"),x=e(n[Tt]||"%Y");return v=>(i(v)<v?f:r(v)<v?d:s(v)<v?h:o(v)<v?g:u(v)<v?a(v)<v?p:m:c(v)<v?l(v)<v?y:b:x)(v)}function fM(e){const t=wf(e.format),n=wf(e.utcFormat);return{timeFormat:i=>nS(i)?t(i):hS(t,nc,i),utcFormat:i=>nS(i)?n(i):hS(n,ic,i),timeParse:wf(e.parse),utcParse:wf(e.utcParse)}}let j2;dM();function dM(){return j2=fM({format:dA,parse:oM,utcFormat:hA,utcParse:aM})}function hM(e){return fM(tM(e))}function md(e){return arguments.length?j2=hM(e):j2}const U2=(e,t)=>Oj({},e,t);function gM(e,t){const n=e?cM(e):Pg(),i=t?hM(t):md();return U2(n,i)}function gA(e,t){const n=arguments.length;return n&&n!==2&&Uf("defaultLocale expects either zero or two arguments."),n?U2(Pg(e),md(t)):U2(Pg(),md())}function BU(){return lM(),dM(),gA()}const RU=/^(data:|([A-Za-z]+:)?\/\/)/,LU=/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp|file|data):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i,PU=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205f\u3000]/g,gS="file://";function IU(e,t){return n=>({options:n||{},sanitize:jU,load:zU,fileAccess:!!t,file:UU(t),http:WU(e)})}async function zU(e,t){const n=await this.sanitize(e,t),i=n.href;return n.localFile?this.file(i):this.http(i,t)}async function jU(e,t){t=rA({},this.options,t);const n=this.fileAccess,i={href:null};let r,s,o;const a=LU.test(e.replace(PU,""));(e==null||typeof e!="string"||!a)&&gr("Sanitize failure, invalid URI: "+sA(e));const u=RU.test(e);return(o=t.baseURL)&&!u&&(!e.startsWith("/")&&!o.endsWith("/")&&(e="/"+e),e=o+e),s=(r=e.startsWith(gS))||t.mode==="file"||t.mode!=="http"&&!u&&n,r?e=e.slice(gS.length):e.startsWith("//")&&(t.defaultProtocol==="file"?(e=e.slice(2),s=!0):e=(t.defaultProtocol||"http")+":"+e),Object.defineProperty(i,"localFile",{value:!!s}),i.href=e,t.target&&(i.target=t.target+""),t.rel&&(i.rel=t.rel+""),t.context==="image"&&t.crossOrigin&&(i.crossOrigin=t.crossOrigin+""),i}function UU(e){return e?t=>new Promise((n,i)=>{e.readFile(t,(r,s)=>{r?i(r):n(s)})}):qU}async function qU(){gr("No file system access.")}function WU(e){return e?async function(t,n){const i=rA({},this.options.http,n),r=n&&n.response,s=await e(t,i);return s.ok?iA(s[r])?s[r]():s.text():gr(s.status+""+s.statusText)}:GU}async function GU(){gr("No HTTP fetch method available.")}const HU=e=>e!=null&&e===e,VU=e=>e==="true"||e==="false"||e===!0||e===!1,YU=e=>!Number.isNaN(Date.parse(e)),pM=e=>!Number.isNaN(+e)&&!(e instanceof Date),XU=e=>pM(e)&&Number.isInteger(+e),q2={boolean:rz,integer:qF,number:qF,date:oz,string:az,unknown:f6},u0=[VU,XU,pM,YU],KU=["boolean","integer","number","date"];function mM(e,t){if(!e||!e.length)return"unknown";const n=e.length,i=u0.length,r=u0.map((s,o)=>o+1);for(let s=0,o=0,a,u;s<n;++s)for(u=t?e[s][t]:e[s],a=0;a<i;++a)if(r[a]&&HU(u)&&!u0[a](u)&&(r[a]=0,++o,o===u0.length))return"string";return KU[r.reduce((s,o)=>s===0?o:s,0)-1]}function yM(e,t){return t.reduce((n,i)=>(n[i]=mM(e,i),n),{})}function pS(e){const t=function(n,i){const r={delimiter:e};return pA(n,i?rA(i,r):r)};return t.responseType="text",t}function pA(e,t){return t.header&&(e=t.header.map(sA).join(t.delimiter)+`
`+e),fz(t.delimiter).parse(e+"")}pA.responseType="text";function JU(e){return typeof Buffer=="function"&&iA(Buffer.isBuffer)?Buffer.isBuffer(e):!1}function mA(e,t){const n=t&&t.property?c6(t.property):f6;return h6(e)&&!JU(e)?QU(n(e),t):n(JSON.parse(e))}mA.responseType="json";function QU(e,t){return!d6(e)&&tz(e)&&(e=[...e]),t&&t.copy?JSON.parse(JSON.stringify(e)):e}const ZU={interior:(e,t)=>e!==t,exterior:(e,t)=>e===t};function bM(e,t){let n,i,r,s;return e=mA(e,t),t&&t.feature?(n=pz,r=t.feature):t&&t.mesh?(n=yz,r=t.mesh,s=ZU[t.filter]):gr("Missing TopoJSON feature or mesh parameter."),i=(i=e.objects[r])?n(e,i,s):gr("Invalid TopoJSON object: "+r),i&&i.features||[i]}bM.responseType="json";const J0={dsv:pA,csv:pS(","),tsv:pS(" "),json:mA,topojson:bM};function yA(e,t){return arguments.length>1?(J0[e]=t,this):g6(J0,e)?J0[e]:null}function xM(e){const t=yA(e);return t&&t.responseType||"text"}function vM(e,t,n,i){t=t||{};const r=yA(t.type||"json");return r||gr("Unknown data format type: "+t.type),e=r(e,t),t.parse&&eq(e,t.parse,n,i),g6(e,"columns")&&delete e.columns,e}function eq(e,t,n,i){if(!e.length)return;const r=md();n=n||r.timeParse,i=i||r.utcParse;let s=e.columns||Object.keys(e[0]),o,a,u,l,c,f;t==="auto"&&(t=yM(e,s)),s=Object.keys(t);const d=s.map(h=>{const g=t[h];let p,m;if(g&&(g.startsWith("date:")||g.startsWith("utc:")))return p=g.split(/:(.+)?/,2),m=p[1],(m[0]==="'"&&m[m.length-1]==="'"||m[0]==='"'&&m[m.length-1]==='"')&&(m=m.slice(1,-1)),(p[0]==="utc"?i:n)(m);if(!q2[g])throw Error("Illegal format pattern: "+h+":"+g);return q2[g]});for(u=0,c=e.length,f=s.length;u<c;++u)for(o=e[u],l=0;l<f;++l)a=s[l],o[a]=d[l](o[a])}const Nm=IU(typeof fetch<"u"&&fetch,null);function Tm(e){const t=e||o6,n=[],i={};return n.add=r=>{const s=t(r);return i[s]||(i[s]=1,n.push(r)),n},n.remove=r=>{const s=t(r);if(i[s]){i[s]=0;const o=n.indexOf(r);o>=0&&n.splice(o,1)}return n},n}async function Q0(e,t){try{await t(e)}catch(n){e.error(n)}}const AM=Symbol("vega_id");let tq=1;function Bm(e){return!!(e&&Z(e))}function Z(e){return e[AM]}function EM(e,t){return e[AM]=t,e}function De(e){const t=e===Object(e)?e:{data:e};return Z(t)?t:EM(t,tq++)}function bA(e){return Rm(e,De({}))}function Rm(e,t){for(const n in e)t[n]=e[n];return t}function wM(e,t){return EM(t,Z(e))}function mu(e,t){return e?t?(n,i)=>e(n,i)||Z(t(n))-Z(t(i)):(n,i)=>e(n,i)||Z(n)-Z(i):null}function $M(e){return e&&e.constructor===yu}function yu(){const e=[],t=[],n=[],i=[],r=[];let s=null,o=!1;return{constructor:yu,insert(a){const u=Mg(a),l=u.length;for(let c=0;c<l;++c)e.push(u[c]);return this},remove(a){const u=ao(a)?i:t,l=Mg(a),c=l.length;for(let f=0;f<c;++f)u.push(l[f]);return this},modify(a,u,l){const c={field:u,value:nA(l)};return ao(a)?(c.filter=a,r.push(c)):(c.tuple=a,n.push(c)),this},encode(a,u){return ao(a)?r.push({filter:a,field:u}):n.push({tuple:a,field:u}),this},clean(a){return s=a,this},reflow(){return o=!0,this},pulse(a,u){const l={},c={};let f,d,h,g,p,m;for(f=0,d=u.length;f<d;++f)l[Z(u[f])]=1;for(f=0,d=t.length;f<d;++f)p=t[f],l[Z(p)]=-1;for(f=0,d=i.length;f<d;++f)g=i[f],u.forEach(b=>{g(b)&&(l[Z(b)]=-1)});for(f=0,d=e.length;f<d;++f)p=e[f],m=Z(p),l[m]?l[m]=1:a.add.push(De(e[f]));for(f=0,d=u.length;f<d;++f)p=u[f],l[Z(p)]<0&&a.rem.push(p);function y(b,x,v){v?b[x]=v(b):a.encode=x,o||(c[Z(b)]=b)}for(f=0,d=n.length;f<d;++f)h=n[f],p=h.tuple,g=h.field,m=l[Z(p)],m>0&&(y(p,g,h.value),a.modifies(g));for(f=0,d=r.length;f<d;++f)h=r[f],g=h.filter,u.forEach(b=>{g(b)&&l[Z(b)]>0&&y(b,h.field,h.value)}),a.modifies(h.field);if(o)a.mod=t.length||i.length?u.filter(b=>l[Z(b)]>0):u.slice();else for(m in c)a.mod.push(c[m]);return(s||s==null&&(t.length||i.length))&&a.clean(!0),a}}}const Z0="_:mod:_";function Lm(){Object.defineProperty(this,Z0,{writable:!0,value:{}})}Lm.prototype={set(e,t,n,i){const r=this,s=r[e],o=r[Z0];return t!=null&&t>=0?(s[t]!==n||i)&&(s[t]=n,o[t+":"+e]=-1,o[e]=-1):(s!==n||i)&&(r[e]=n,o[e]=mo(n)?1+n.length:-1),r},modified(e,t){const n=this[Z0];if(arguments.length){if(mo(e)){for(let i=0;i<e.length;++i)if(n[e[i]])return!0;return!1}}else{for(const i in n)if(n[i])return!0;return!1}return t!=null&&t>=0?t+1<n[e]||!!n[t+":"+e]:!!n[e]},clear(){return this[Z0]={},this}};let nq=0;const iq="pulse",rq=new Lm,sq=1,oq=2;function Ie(e,t,n,i){this.id=++nq,this.value=e,this.stamp=-1,this.rank=-1,this.qrank=-1,this.flags=0,t&&(this._update=t),n&&this.parameters(n,i)}function mS(e){return function(t){const n=this.flags;return arguments.length===0?!!(n&e):(this.flags=t?n|e:n&~e,this)}}Ie.prototype={targets(){return this._targets||(this._targets=Tm(Fm))},set(e){return this.value!==e?(this.value=e,1):0},skip:mS(sq),modified:mS(oq),parameters(e,t,n){t=t!==!1;const i=this._argval=this._argval||new Lm,r=this._argops=this._argops||[],s=[];let o,a,u,l;const c=(f,d,h)=>{h instanceof Ie?(h!==this&&(t&&h.targets().add(this),s.push(h)),r.push({op:h,name:f,index:d})):i.set(f,d,h)};for(o in e)if(a=e[o],o===iq)Mg(a).forEach(f=>{f instanceof Ie?f!==this&&(f.targets().add(this),s.push(f)):Ta("Pulse parameters must be operator instances.")}),this.source=a;else if(mo(a))for(i.set(o,-1,Array(u=a.length)),l=0;l<u;++l)c(o,l,a[l]);else c(o,-1,a);return this.marshall().clear(),n&&(r.initonly=!0),s},marshall(e){const t=this._argval||rq,n=this._argops;let i,r,s,o;if(n){const a=n.length;for(r=0;r<a;++r)i=n[r],s=i.op,o=s.modified()&&s.stamp===e,t.set(i.name,i.index,s.value,o);if(n.initonly){for(r=0;r<a;++r)i=n[r],i.op.targets().remove(this);this._argops=null,this._update=null}}return t},detach(){const e=this._argops;let t,n,i,r;if(e)for(t=0,n=e.length;t<n;++t)i=e[t],r=i.op,r._targets&&r._targets.remove(this);this.pulse=null,this.source=null},evaluate(e){const t=this._update;if(t){const n=this.marshall(e.stamp),i=t.call(this,n,e);if(n.clear(),i!==this.value)this.value=i;else if(!this.modified())return e.StopPropagation}},run(e){if(e.stamp<this.stamp)return e.StopPropagation;let t;return this.skip()?(this.skip(!1),t=0):t=this.evaluate(e),this.pulse=t||e}};function aq(e,t,n,i){let r=1,s;return e instanceof Ie?s=e:e&&e.prototype instanceof Ie?s=new e:ao(e)?s=new Ie(null,e):(r=0,s=new Ie(e,t)),this.rank(s),r&&(i=n,n=t),n&&this.connect(s,s.parameters(n,i)),this.touch(s),s}function uq(e,t){const n=e.rank,i=t.length;for(let r=0;r<i;++r)if(n<t[r].rank){this.rerank(e);return}}let lq=0;function Pm(e,t,n){this.id=++lq,this.value=null,n&&(this.receive=n),e&&(this._filter=e),t&&(this._apply=t)}function Ws(e,t,n){return new Pm(e,t,n)}Pm.prototype={_filter:_2,_apply:o6,targets(){return this._targets||(this._targets=Tm(Fm))},consume(e){return arguments.length?(this._consume=!!e,this):!!this._consume},receive(e){if(this._filter(e)){const t=this.value=this._apply(e),n=this._targets,i=n?n.length:0;for(let r=0;r<i;++r)n[r].receive(t);this._consume&&(e.preventDefault(),e.stopPropagation())}},filter(e){const t=Ws(e);return this.targets().add(t),t},apply(e){const t=Ws(null,e);return this.targets().add(t),t},merge(){const e=Ws();this.targets().add(e);for(let t=0,n=arguments.length;t<n;++t)arguments[t].targets().add(e);return e},throttle(e){let t=-1;return this.filter(()=>{const n=Date.now();return n-t>e?(t=n,1):0})},debounce(e){const t=Ws();return this.targets().add(Ws(null,null,HI(e,n=>{const i=n.dataflow;t.receive(n),i&&i.run&&i.run()}))),t},between(e,t){let n=!1;return e.targets().add(Ws(null,null,()=>n=!0)),t.targets().add(Ws(null,null,()=>n=!1)),this.filter(()=>n)},detach(){this._filter=_2,this._targets=null}};function cq(e,t,n,i){const r=this,s=Ws(n,i),o=function(l){l.dataflow=r;try{s.receive(l)}catch(c){r.error(c)}finally{r.run()}};let a;typeof e=="string"&&typeof document<"u"?a=document.querySelectorAll(e):a=Mg(e);const u=a.length;for(let l=0;l<u;++l)a[l].addEventListener(t,o);return s}function fq(e,t){const n=this.locale();return vM(e,t,n.timeParse,n.utcParse)}function dq(e,t,n){return t=this.parse(t,n),this.pulse(e,this.changeset().insert(t))}async function hq(e,t){const n=this;let i=0,r;try{r=await n.loader().load(e,{context:"dataflow",response:xM(t&&t.type)});try{r=n.parse(r,t)}catch(s){i=-2,n.warn("Data ingestion failed",e,s)}}catch(s){i=-1,n.warn("Loading failed",e,s)}return{data:r,status:i}}async function gq(e,t,n){const i=this,r=i._pending||pq(i);r.requests+=1;const s=await i.request(t,n);return i.pulse(e,i.changeset().remove(_2).insert(s.data||[])),r.done(),s}function pq(e){let t;const n=new Promise(i=>t=i);return n.requests=0,n.done=()=>{--n.requests===0&&(e._pending=null,t(e))},e._pending=n}const mq={skip:!0};function yq(e,t,n,i,r){return(e instanceof Ie?xq:bq)(this,e,t,n,i,r),this}function bq(e,t,n,i,r,s){const o=u6({},s,mq);let a,u;ao(n)||(n=nA(n)),i===void 0?a=l=>e.touch(n(l)):ao(i)?(u=new Ie(null,i,r,!1),a=l=>{u.evaluate(l);const c=n(l),f=u.value;$M(f)?e.pulse(c,f,s):e.update(c,f,o)}):a=l=>e.update(n(l),i,o),t.apply(a)}function xq(e,t,n,i,r,s){if(i===void 0)t.targets().add(n);else{const o=s||{},a=new Ie(null,vq(n,i),r,!1);a.modified(o.force),a.rank=t.rank,t.targets().add(a),n&&(a.skip(!0),a.value=n.value,a.targets().add(n),e.connect(n,[a]))}}function vq(e,t){return t=ao(t)?t:nA(t),e?function(n,i){const r=t(n,i);return e.skip()||(e.skip(r!==this.value).value=r),r}:t}function Aq(e){e.rank=++this._rank}function Eq(e){const t=[e];let n,i,r;for(;t.length;)if(this.rank(n=t.pop()),i=n._targets)for(r=i.length;--r>=0;)t.push(n=i[r]),n===e&&Ta("Cycle detected in dataflow graph.")}const Ig={},or=1<<0,Hs=1<<1,es=1<<2,wq=or|Hs,yS=or|es,Bu=or|Hs|es,bS=1<<3,Xc=1<<4,xS=1<<5,vS=1<<6;function lo(e,t,n){this.dataflow=e,this.stamp=t??-1,this.add=[],this.rem=[],this.mod=[],this.fields=null,this.encode=n||null}function Vy(e,t){const n=[];return ya(e,t,i=>n.push(i)),n}function AS(e,t){const n={};return e.visit(t,i=>{n[Z(i)]=1}),i=>n[Z(i)]?null:i}function l0(e,t){return e?(n,i)=>e(n,i)&&t(n,i):t}lo.prototype={StopPropagation:Ig,ADD:or,REM:Hs,MOD:es,ADD_REM:wq,ADD_MOD:yS,ALL:Bu,REFLOW:bS,SOURCE:Xc,NO_SOURCE:xS,NO_FIELDS:vS,fork(e){return new lo(this.dataflow).init(this,e)},clone(){const e=this.fork(Bu);return e.add=e.add.slice(),e.rem=e.rem.slice(),e.mod=e.mod.slice(),e.source&&(e.source=e.source.slice()),e.materialize(Bu|Xc)},addAll(){let e=this;return!e.source||e.add===e.rem||!e.rem.length&&e.source.length===e.add.length||(e=new lo(this.dataflow).init(this),e.add=e.source,e.rem=[]),e},init(e,t){const n=this;return n.stamp=e.stamp,n.encode=e.encode,e.fields&&!(t&vS)&&(n.fields=e.fields),t&or?(n.addF=e.addF,n.add=e.add):(n.addF=null,n.add=[]),t&Hs?(n.remF=e.remF,n.rem=e.rem):(n.remF=null,n.rem=[]),t&es?(n.modF=e.modF,n.mod=e.mod):(n.modF=null,n.mod=[]),t&xS?(n.srcF=null,n.source=null):(n.srcF=e.srcF,n.source=e.source,e.cleans&&(n.cleans=e.cleans)),n},runAfter(e){this.dataflow.runAfter(e)},changed(e){const t=e||Bu;return t&or&&this.add.length||t&Hs&&this.rem.length||t&es&&this.mod.length},reflow(e){if(e)return this.fork(Bu).reflow();const t=this.add.length,n=this.source&&this.source.length;return n&&n!==t&&(this.mod=this.source,t&&this.filter(es,AS(this,or))),this},clean(e){return arguments.length?(this.cleans=!!e,this):this.cleans},modifies(e){const t=this.fields||(this.fields={});return mo(e)?e.forEach(n=>t[n]=!0):t[e]=!0,this},modified(e,t){const n=this.fields;return(t||this.mod.length)&&n?arguments.length?mo(e)?e.some(i=>n[i]):n[e]:!!n:!1},filter(e,t){const n=this;return e&or&&(n.addF=l0(n.addF,t)),e&Hs&&(n.remF=l0(n.remF,t)),e&es&&(n.modF=l0(n.modF,t)),e&Xc&&(n.srcF=l0(n.srcF,t)),n},materialize(e){e=e||Bu;const t=this;return e&or&&t.addF&&(t.add=Vy(t.add,t.addF),t.addF=null),e&Hs&&t.remF&&(t.rem=Vy(t.rem,t.remF),t.remF=null),e&es&&t.modF&&(t.mod=Vy(t.mod,t.modF),t.modF=null),e&Xc&&t.srcF&&(t.source=t.source.filter(t.srcF),t.srcF=null),t},visit(e,t){const n=this,i=t;if(e&Xc)return ya(n.source,n.srcF,i),n;e&or&&ya(n.add,n.addF,i),e&Hs&&ya(n.rem,n.remF,i),e&es&&ya(n.mod,n.modF,i);const r=n.source;if(e&bS&&r){const s=n.add.length+n.mod.length;s===r.length||(s?ya(r,AS(n,yS),i):ya(r,n.srcF,i))}return n}};function xA(e,t,n,i){const r=this;let s=0;this.dataflow=e,this.stamp=t,this.fields=null,this.encode=i||null,this.pulses=n;for(const o of n)if(o.stamp===t){if(o.fields){const a=r.fields||(r.fields={});for(const u in o.fields)a[u]=1}o.changed(r.ADD)&&(s|=r.ADD),o.changed(r.REM)&&(s|=r.REM),o.changed(r.MOD)&&(s|=r.MOD)}this.changes=s}l6(xA,lo,{fork(e){const t=new lo(this.dataflow).init(this,e&this.NO_FIELDS);return e!==void 0&&(e&t.ADD&&this.visit(t.ADD,n=>t.add.push(n)),e&t.REM&&this.visit(t.REM,n=>t.rem.push(n)),e&t.MOD&&this.visit(t.MOD,n=>t.mod.push(n))),t},changed(e){return this.changes&e},modified(e){const t=this,n=t.fields;return n&&t.changes&t.MOD?mo(e)?e.some(i=>n[i]):n[e]:0},filter(){Ta("MultiPulse does not support filtering.")},materialize(){Ta("MultiPulse does not support materialization.")},visit(e,t){const n=this,i=n.pulses,r=i.length;let s=0;if(e&n.SOURCE)for(;s<r;++s)i[s].visit(e,t);else for(;s<r;++s)i[s].stamp===n.stamp&&i[s].visit(e,t);return n}});async function $q(e,t,n){const i=this,r=[];if(i._pulse)return CM(i);if(i._pending&&await i._pending,t&&await Q0(i,t),!i._touched.length)return i.debug("Dataflow invoked, but nothing to do."),i;const s=++i._clock;i._pulse=new lo(i,s,e),i._touched.forEach(c=>i._enqueue(c,!0)),i._touched=Tm(Fm);let o=0,a,u,l;try{for(;i._heap.size()>0;){if(a=i._heap.pop(),a.rank!==a.qrank){i._enqueue(a,!0);continue}u=a.run(i._getPulse(a,e)),u.then?u=await u:u.async&&(r.push(u.async),u=Ig),u!==Ig&&a._targets&&a._targets.forEach(c=>i._enqueue(c)),++o}}catch(c){i._heap.clear(),l=c}if(i._input={},i._pulse=null,i.debug(`Pulse ${s}: ${o} operators`),l&&(i._postrun=[],i.error(l)),i._postrun.length){const c=i._postrun.sort((f,d)=>d.priority-f.priority);i._postrun=[];for(let f=0;f<c.length;++f)await Q0(i,c[f].callback)}return n&&await Q0(i,n),r.length&&Promise.all(r).then(c=>i.runAsync(null,()=>{c.forEach(f=>{try{f(i)}catch(d){i.error(d)}})})),i}async function Cq(e,t,n){for(;this._running;)await this._running;const i=()=>this._running=null;return(this._running=this.evaluate(e,t,n)).then(i,i),this._running}function Fq(e,t,n){return this._pulse?CM(this):(this.evaluate(e,t,n),this)}function Sq(e,t,n){if(this._pulse||t)this._postrun.push({priority:n||0,callback:e});else try{e(this)}catch(i){this.error(i)}}function CM(e){return e.error("Dataflow already running. Use runAsync() to chain invocations."),e}function Dq(e,t){const n=e.stamp<this._clock;n&&(e.stamp=this._clock),(n||t)&&(e.qrank=e.rank,this._heap.push(e))}function _q(e,t){const n=e.source,i=this._clock;return n&&mo(n)?new xA(this,i,n.map(r=>r.pulse),t):this._input[e.id]||kq(this._pulse,n&&n.pulse)}function kq(e,t){return t&&t.stamp===e.stamp?t:(e=e.fork(),t&&t!==Ig&&(e.source=t.source),e)}const vA={skip:!1,force:!1};function Mq(e,t){const n=t||vA;return this._pulse?this._enqueue(e):this._touched.add(e),n.skip&&e.skip(!0),this}function Oq(e,t,n){const i=n||vA;return(e.set(t)||i.force)&&this.touch(e,i),this}function Nq(e,t,n){this.touch(e,n||vA);const i=new lo(this,this._clock+(this._pulse?0:1)),r=e.pulse&&e.pulse.source||[];return i.target=e,this._input[e.id]=t.pulse(i,r),this}function Tq(e){let t=[];return{clear:()=>t=[],size:()=>t.length,peek:()=>t[0],push:n=>(t.push(n),FM(t,0,t.length-1,e)),pop:()=>{const n=t.pop();let i;return t.length?(i=t[0],t[0]=n,Bq(t,0,e)):i=n,i}}}function FM(e,t,n,i){let r,s;const o=e[n];for(;n>t;){if(s=n-1>>1,r=e[s],i(o,r)<0){e[n]=r,n=s;continue}break}return e[n]=o}function Bq(e,t,n){const i=t,r=e.length,s=e[t];let o=(t<<1)+1,a;for(;o<r;)a=o+1,a<r&&n(e[o],e[a])>=0&&(o=a),e[t]=e[o],t=o,o=(t<<1)+1;return e[t]=s,FM(e,i,t,n)}function il(){this.logger(GI()),this.logLevel(a6),this._clock=0,this._rank=0,this._locale=gA();try{this._loader=Nm()}catch{}this._touched=Tm(Fm),this._input={},this._pulse=null,this._heap=Tq((e,t)=>e.qrank-t.qrank),this._postrun=[]}function Kc(e){return function(){return this._log[e].apply(this,arguments)}}il.prototype={stamp(){return this._clock},loader(e){return arguments.length?(this._loader=e,this):this._loader},locale(e){return arguments.length?(this._locale=e,this):this._locale},logger(e){return arguments.length?(this._log=e,this):this._log},error:Kc("error"),warn:Kc("warn"),info:Kc("info"),debug:Kc("debug"),logLevel:Kc("level"),cleanThreshold:1e4,add:aq,connect:uq,rank:Aq,rerank:Eq,pulse:Nq,touch:Mq,update:Oq,changeset:yu,ingest:dq,parse:fq,preload:gq,request:hq,events:cq,on:yq,evaluate:$q,run:Fq,runAsync:Cq,runAfter:Sq,_enqueue:Dq,_getPulse:_q};function N(e,t){Ie.call(this,e,null,t)}l6(N,Ie,{run(e){if(e.stamp<this.stamp)return e.StopPropagation;let t;return this.skip()?this.skip(!1):t=this.evaluate(e),t=t||e,t.then?t=t.then(n=>this.pulse=n):t!==e.StopPropagation&&(this.pulse=t),t},evaluate(e){const t=this.marshall(e.stamp),n=this.transform(t,e);return t.clear(),n},transform(){}});const Al={};function SM(e){const t=DM(e);return t&&t.Definition||null}function DM(e){return e=e&&e.toLowerCase(),YI(Al,e)?Al[e]:null}function Vi(e,t,n){return e.fields=t||[],e.fname=n,e}function Tn(e){return e==null?null:e.fname}function Fr(e){return e==null?null:e.fields}function _M(e){return e.length===1?Rq(e[0]):Lq(e)}const Rq=e=>function(t){return t[e]},Lq=e=>{const t=e.length;return function(n){for(let i=0;i<t;++i)n=n[e[i]];return n}};function Bt(e){throw Error(e)}function kM(e){const t=[],n=e.length;let i=null,r=0,s="",o,a,u;e=e+"";function l(){t.push(s+e.substring(o,a)),s="",o=a+1}for(o=a=0;a<n;++a)if(u=e[a],u==="\\")s+=e.substring(o,a++),o=a;else if(u===i)l(),i=null,r=-1;else{if(i)continue;o===r&&u==='"'||o===r&&u==="'"?(o=a+1,i=u):u==="."&&!r?a>o?l():o=a+1:u==="["?(a>o&&l(),r=o=a+1):u==="]"&&(r||Bt("Access path missing open bracket: "+e),r>0&&l(),r=0,o=a+1)}return r&&Bt("Access path missing closing bracket: "+e),i&&Bt("Access path missing closing quote: "+e),a>o&&(a++,l()),t}function yd(e,t,n){const i=kM(e);return e=i.length===1?i[0]:e,Vi((n&&n.get||_M)(i),[e],t||e)}yd("id");const MM=Vi(e=>e,[],"identity"),Pq=Vi(()=>0,[],"zero");Vi(()=>1,[],"one");const Iq=Vi(()=>!0,[],"true");Vi(()=>!1,[],"false");var OM=Array.isArray;function NM(e){return e[e.length-1]}function TM(e){return e==null||e===""?null:+e}function Dn(e){return e!=null?OM(e)?e:[e]:[]}function BM(e){return typeof e=="function"}const zq="descending";function jq(e,t,n){n=n||{},t=Dn(t)||[];const i=[],r=[],s={},o=n.comparator||Uq;return Dn(e).forEach((a,u)=>{a!=null&&(i.push(t[u]===zq?-1:1),r.push(a=BM(a)?a:yd(a,null,n)),(Fr(a)||[]).forEach(l=>s[l]=1))}),r.length===0?null:Vi(o(r,i),Object.keys(s))}const AA=(e,t)=>(e<t||e==null)&&t!=null?-1:(e>t||t==null)&&e!=null?1:(t=t instanceof Date?+t:t,(e=e instanceof Date?+e:e)!==e&&t===t?-1:t!==t&&e===e?1:0),Uq=(e,t)=>e.length===1?qq(e[0],t[0]):Wq(e,t,e.length),qq=(e,t)=>function(n,i){return AA(e(n),e(i))*t},Wq=(e,t,n)=>(t.push(0),function(i,r){let s,o=0,a=-1;for(;o===0&&++a<n;)s=e[a],o=AA(s(i),s(r));return o*t[a]});function Gq(e){return BM(e)?e:()=>e}function EA(e){for(let t,n,i=1,r=arguments.length;i<r;++i){t=arguments[i];for(n in t)e[n]=t[n]}return e}function bd(e,t){let n=0,i,r,s,o;if(e&&(i=e.length))if(t==null){for(r=e[n];n<i&&(r==null||r!==r);r=e[++n]);for(s=o=r;n<i;++n)r=e[n],r!=null&&(r<s&&(s=r),r>o&&(o=r))}else{for(r=t(e[n]);n<i&&(r==null||r!==r);r=t(e[++n]));for(s=o=r;n<i;++n)r=t(e[n]),r!=null&&(r<s&&(s=r),r>o&&(o=r))}return[s,o]}function Hq(e,t){const n=e.length;let i=-1,r,s,o,a,u;if(t==null){for(;++i<n;)if(s=e[i],s!=null&&s>=s){r=o=s;break}if(i===n)return[-1,-1];for(a=u=i;++i<n;)s=e[i],s!=null&&(r>s&&(r=s,a=i),o<s&&(o=s,u=i))}else{for(;++i<n;)if(s=t(e[i],i,e),s!=null&&s>=s){r=o=s;break}if(i===n)return[-1,-1];for(a=u=i;++i<n;)s=t(e[i],i,e),s!=null&&(r>s&&(r=s,a=i),o<s&&(o=s,u=i))}return[a,u]}const Vq=Object.prototype.hasOwnProperty;function ch(e,t){return Vq.call(e,t)}const c0={};function wA(e){let t={},n;function i(s){return ch(t,s)&&t[s]!==c0}const r={size:0,empty:0,object:t,has:i,get(s){return i(s)?t[s]:void 0},set(s,o){return i(s)||(++r.size,t[s]===c0&&--r.empty),t[s]=o,this},delete(s){return i(s)&&(--r.size,++r.empty,t[s]=c0),this},clear(){r.size=r.empty=0,r.object=t={}},test(s){return arguments.length?(n=s,r):n},clean(){const s={};let o=0;for(const a in t){const u=t[a];u!==c0&&(!n||!n(u))&&(s[a]=u,++o)}r.size=o,r.empty=0,r.object=t=s}};return e&&Object.keys(e).forEach(s=>{r.set(s,e[s])}),r}function de(e,t,n){const i=e.prototype=Object.create(t.prototype);return Object.defineProperty(i,"constructor",{value:e,writable:!0,enumerable:!0,configurable:!0}),EA(i,n)}function Yq(e,t,n){e&&(e=t?Dn(e).map(a=>a.replace(/\\(.)/g,"$1")):Dn(e));const i=e&&e.length,r=n&&n.get||_M,s=a=>r(t?[a]:kM(a));let o;if(!i)o=function(){return""};else if(i===1){const a=s(e[0]);o=function(u){return""+a(u)}}else{const a=e.map(s);o=function(u){let l=""+a[0](u),c=0;for(;++c<i;)l+="|"+a[c](u);return l}}return Vi(o,e,"key")}function Xq(e,t,n,i){const r=t.length,s=n.length;if(!s)return t;if(!r)return n;const o=i||new t.constructor(r+s);let a=0,u=0,l=0;for(;a<r&&u<s;++l)o[l]=e(t[a],n[u])>0?n[u++]:t[a++];for(;a<r;++a,++l)o[l]=t[a];for(;u<s;++u,++l)o[l]=n[u];return o}function Kq(e){return e&&NM(e)-e[0]||0}function*RM(e,t){if(t==null)for(let n of e)n!=null&&n!==""&&(n=+n)>=n&&(yield n);else{let n=-1;for(let i of e)i=t(i,++n,e),i!=null&&i!==""&&(i=+i)>=i&&(yield i)}}function $A(e,t,n){const i=Float64Array.from(RM(e,n));return i.sort(ms),t.map(r=>$6(i,r))}function CA(e,t){return $A(e,[.25,.5,.75],t)}function FA(e,t){const n=e.length,i=Cz(e,t),r=CA(e,t),s=(r[2]-r[0])/1.34;return 1.06*(Math.min(i,s)||i||Math.abs(r[0])||1)*Math.pow(n,-.2)}function LM(e){const t=e.maxbins||20,n=e.base||10,i=Math.log(n),r=e.divide||[5,2];let s=e.extent[0],o=e.extent[1],a,u,l,c,f,d;const h=e.span||o-s||Math.abs(s)||1;if(e.step)a=e.step;else if(e.steps){for(c=h/t,f=0,d=e.steps.length;f<d&&e.steps[f]<c;++f);a=e.steps[Math.max(0,f-1)]}else{for(u=Math.ceil(Math.log(t)/i),l=e.minstep||0,a=Math.max(l,Math.pow(n,Math.round(Math.log(h)/i)-u));Math.ceil(h/a)>t;)a*=n;for(f=0,d=r.length;f<d;++f)c=a/r[f],c>=l&&h/c<=t&&(a=c)}c=Math.log(a);const g=c>=0?0:~~(-c/i)+1,p=Math.pow(n,-g-1);return(e.nice||e.nice===void 0)&&(c=Math.floor(s/a+p)*a,s=s<c?c-a:c,o=Math.ceil(o/a)*a),{start:s,stop:o===s?s+a:o,step:a}}var gi=Math.random;function Jq(e){gi=e}function PM(e,t,n,i){if(!e.length)return[void 0,void 0];const r=Float64Array.from(RM(e,i)),s=r.length,o=t;let a,u,l,c;for(l=0,c=Array(o);l<o;++l){for(a=0,u=0;u<s;++u)a+=r[~~(gi()*s)];c[l]=a/s}return c.sort(ms),[T2(c,n/2),T2(c,1-n/2)]}function IM(e,t,n,i){i=i||(d=>d);const r=e.length,s=new Float64Array(r);let o=0,a=1,u=i(e[0]),l=u,c=u+t,f;for(;a<r;++a){if(f=i(e[a]),f>=c){for(l=(u+l)/2;o<a;++o)s[o]=l;c=f+t,u=f}l=f}for(l=(u+l)/2;o<a;++o)s[o]=l;return n?Qq(s,t+t/4):s}function Qq(e,t){const n=e.length;let i=0,r=1,s,o;for(;e[i]===e[r];)++r;for(;r<n;){for(s=r+1;e[r]===e[s];)++s;if(e[r]-e[r-1]<t){for(o=r+(i+s-r-r>>1);o<r;)e[o++]=e[r];for(;o>r;)e[o--]=e[i]}i=r,r=s}return e}function Zq(e){return function(){return e=(1103515245*e+12345)%2147483647,e/2147483647}}function eW(e,t){t==null&&(t=e,e=0);let n,i,r;const s={min(o){return arguments.length?(n=o||0,r=i-n,s):n},max(o){return arguments.length?(i=o||0,r=i-n,s):i},sample(){return n+Math.floor(r*gi())},pdf(o){return o===Math.floor(o)&&o>=n&&o<i?1/r:0},cdf(o){const a=Math.floor(o);return a<n?0:a>=i?1:(a-n+1)/r},icdf(o){return o>=0&&o<=1?n-1+Math.floor(o*r):NaN}};return s.min(e).max(t)}const zM=Math.sqrt(2*Math.PI),tW=Math.SQRT2;let Jc=NaN;function Im(e,t){e=e||0,t=t??1;let n=0,i=0,r,s;if(Jc===Jc)n=Jc,Jc=NaN;else{do n=gi()*2-1,i=gi()*2-1,r=n*n+i*i;while(r===0||r>1);s=Math.sqrt(-2*Math.log(r)/r),n*=s,Jc=i*s}return e+n*t}function SA(e,t,n){n=n??1;const i=(e-(t||0))/n;return Math.exp(-.5*i*i)/(n*zM)}function zm(e,t,n){t=t||0,n=n??1;const i=(e-t)/n,r=Math.abs(i);let s;if(r>37)s=0;else{const o=Math.exp(-r*r/2);let a;r<7.07106781186547?(a=.0352624965998911*r+.700383064443688,a=a*r+6.37396220353165,a=a*r+33.912866078383,a=a*r+112.079291497871,a=a*r+221.213596169931,a=a*r+220.206867912376,s=o*a,a=.0883883476483184*r+1.75566716318264,a=a*r+16.064177579207,a=a*r+86.7807322029461,a=a*r+296.564248779674,a=a*r+637.333633378831,a=a*r+793.826512519948,a=a*r+440.413735824752,s=s/a):(a=r+.65,a=r+4/a,a=r+3/a,a=r+2/a,a=r+1/a,s=o/a/2.506628274631)}return i>0?1-s:s}function jm(e,t,n){return e<0||e>1?NaN:(t||0)+(n??1)*tW*nW(2*e-1)}function nW(e){let t=-Math.log((1-e)*(1+e)),n;return t<6.25?(t-=3.125,n=-364441206401782e-35,n=-16850591381820166e-35+n*t,n=128584807152564e-32+n*t,n=11157877678025181e-33+n*t,n=-1333171662854621e-31+n*t,n=20972767875968562e-33+n*t,n=6637638134358324e-30+n*t,n=-4054566272975207e-29+n*t,n=-8151934197605472e-29+n*t,n=26335093153082323e-28+n*t,n=-12975133253453532e-27+n*t,n=-5415412054294628e-26+n*t,n=10512122733215323e-25+n*t,n=-4112633980346984e-24+n*t,n=-29070369957882005e-24+n*t,n=42347877827932404e-23+n*t,n=-13654692000834679e-22+n*t,n=-13882523362786469e-21+n*t,n=.00018673420803405714+n*t,n=-.000740702534166267+n*t,n=-.006033670871430149+n*t,n=.24015818242558962+n*t,n=1.6536545626831027+n*t):t<16?(t=Math.sqrt(t)-3.25,n=22137376921775787e-25,n=9075656193888539e-23+n*t,n=-27517406297064545e-23+n*t,n=18239629214389228e-24+n*t,n=15027403968909828e-22+n*t,n=-4013867526981546e-21+n*t,n=29234449089955446e-22+n*t,n=12475304481671779e-21+n*t,n=-47318229009055734e-21+n*t,n=6828485145957318e-20+n*t,n=24031110387097894e-21+n*t,n=-.0003550375203628475+n*t,n=.0009532893797373805+n*t,n=-.0016882755560235047+n*t,n=.002491442096107851+n*t,n=-.003751208507569241+n*t,n=.005370914553590064+n*t,n=1.0052589676941592+n*t,n=3.0838856104922208+n*t):Number.isFinite(t)?(t=Math.sqrt(t)-5,n=-27109920616438573e-27,n=-2555641816996525e-25+n*t,n=15076572693500548e-25+n*t,n=-3789465440126737e-24+n*t,n=761570120807834e-23+n*t,n=-1496002662714924e-23+n*t,n=2914795345090108e-23+n*t,n=-6771199775845234e-23+n*t,n=22900482228026655e-23+n*t,n=-99298272942317e-20+n*t,n=4526062597223154e-21+n*t,n=-1968177810553167e-20+n*t,n=7599527703001776e-20+n*t,n=-.00021503011930044477+n*t,n=-.00013871931833623122+n*t,n=1.0103004648645344+n*t,n=4.849906401408584+n*t):n=1/0,n*e}function DA(e,t){let n,i;const r={mean(s){return arguments.length?(n=s||0,r):n},stdev(s){return arguments.length?(i=s??1,r):i},sample:()=>Im(n,i),pdf:s=>SA(s,n,i),cdf:s=>zm(s,n,i),icdf:s=>jm(s,n,i)};return r.mean(e).stdev(t)}function _A(e,t){const n=DA();let i=0;const r={data(s){return arguments.length?(e=s,i=s?s.length:0,r.bandwidth(t)):e},bandwidth(s){return arguments.length?(t=s,!t&&e&&(t=FA(e)),r):t},sample(){return e[~~(gi()*i)]+t*n.sample()},pdf(s){let o=0,a=0;for(;a<i;++a)o+=n.pdf((s-e[a])/t);return o/t/i},cdf(s){let o=0,a=0;for(;a<i;++a)o+=n.cdf((s-e[a])/t);return o/i},icdf(){throw Error("KDE icdf not supported.")}};return r.data(e)}function kA(e,t){return e=e||0,t=t??1,Math.exp(e+Im()*t)}function MA(e,t,n){if(e<=0)return 0;t=t||0,n=n??1;const i=(Math.log(e)-t)/n;return Math.exp(-.5*i*i)/(n*zM*e)}function OA(e,t,n){return zm(Math.log(e),t,n)}function NA(e,t,n){return Math.exp(jm(e,t,n))}function jM(e,t){let n,i;const r={mean(s){return arguments.length?(n=s||0,r):n},stdev(s){return arguments.length?(i=s??1,r):i},sample:()=>kA(n,i),pdf:s=>MA(s,n,i),cdf:s=>OA(s,n,i),icdf:s=>NA(s,n,i)};return r.mean(e).stdev(t)}function UM(e,t){let n=0,i;function r(o){const a=[];let u=0,l;for(l=0;l<n;++l)u+=a[l]=o[l]==null?1:+o[l];for(l=0;l<n;++l)a[l]/=u;return a}const s={weights(o){return arguments.length?(i=r(t=o||[]),s):t},distributions(o){return arguments.length?(o?(n=o.length,e=o):(n=0,e=[]),s.weights(t)):e},sample(){const o=gi();let a=e[n-1],u=i[0],l=0;for(;l<n-1;u+=i[++l])if(o<u){a=e[l];break}return a.sample()},pdf(o){let a=0,u=0;for(;u<n;++u)a+=i[u]*e[u].pdf(o);return a},cdf(o){let a=0,u=0;for(;u<n;++u)a+=i[u]*e[u].cdf(o);return a},icdf(){throw Error("Mixture icdf not supported.")}};return s.distributions(e).weights(t)}function TA(e,t){return t==null&&(t=e??1,e=0),e+(t-e)*gi()}function BA(e,t,n){return n==null&&(n=t??1,t=0),e>=t&&e<=n?1/(n-t):0}function RA(e,t,n){return n==null&&(n=t??1,t=0),e<t?0:e>n?1:(e-t)/(n-t)}function LA(e,t,n){return n==null&&(n=t??1,t=0),e>=0&&e<=1?t+e*(n-t):NaN}function qM(e,t){let n,i;const r={min(s){return arguments.length?(n=s||0,r):n},max(s){return arguments.length?(i=s??1,r):i},sample:()=>TA(n,i),pdf:s=>BA(s,n,i),cdf:s=>RA(s,n,i),icdf:s=>LA(s,n,i)};return t==null&&(t=e??1,e=0),r.min(e).max(t)}function PA(e,t,n){let i=0,r=0;for(const s of e){const o=n(s);t(s)==null||o==null||isNaN(o)||(i+=(o-i)/++r)}return{coef:[i],predict:()=>i,rSquared:0}}function fh(e,t,n,i){const r=i-e*e,s=Math.abs(r)<1e-24?0:(n-e*t)/r;return[t-s*e,s]}function Um(e,t,n,i){e=e.filter(h=>{let g=t(h),p=n(h);return g!=null&&(g=+g)>=g&&p!=null&&(p=+p)>=p}),i&&e.sort((h,g)=>t(h)-t(g));const r=e.length,s=new Float64Array(r),o=new Float64Array(r);let a=0,u=0,l=0,c,f,d;for(d of e)s[a]=c=+t(d),o[a]=f=+n(d),++a,u+=(c-u)/a,l+=(f-l)/a;for(a=0;a<r;++a)s[a]-=u,o[a]-=l;return[s,o,u,l]}function dh(e,t,n,i){let r=-1,s,o;for(const a of e)s=t(a),o=n(a),s!=null&&(s=+s)>=s&&o!=null&&(o=+o)>=o&&i(s,o,++r)}function sc(e,t,n,i,r){let s=0,o=0;return dh(e,t,n,(a,u)=>{const l=u-r(a),c=u-i;s+=l*l,o+=c*c}),1-s/o}function IA(e,t,n){let i=0,r=0,s=0,o=0,a=0;dh(e,t,n,(c,f)=>{++a,i+=(c-i)/a,r+=(f-r)/a,s+=(c*f-s)/a,o+=(c*c-o)/a});const u=fh(i,r,s,o),l=c=>u[0]+u[1]*c;return{coef:u,predict:l,rSquared:sc(e,t,n,r,l)}}function WM(e,t,n){let i=0,r=0,s=0,o=0,a=0;dh(e,t,n,(c,f)=>{++a,c=Math.log(c),i+=(c-i)/a,r+=(f-r)/a,s+=(c*f-s)/a,o+=(c*c-o)/a});const u=fh(i,r,s,o),l=c=>u[0]+u[1]*Math.log(c);return{coef:u,predict:l,rSquared:sc(e,t,n,r,l)}}function GM(e,t,n){const[i,r,s,o]=Um(e,t,n);let a=0,u=0,l=0,c=0,f=0,d,h,g;dh(e,t,n,(b,x)=>{d=i[f++],h=Math.log(x),g=d*x,a+=(x*h-a)/f,u+=(g-u)/f,l+=(g*h-l)/f,c+=(d*g-c)/f});const[p,m]=fh(u/o,a/o,l/o,c/o),y=b=>Math.exp(p+m*(b-s));return{coef:[Math.exp(p-m*s),m],predict:y,rSquared:sc(e,t,n,o,y)}}function HM(e,t,n){let i=0,r=0,s=0,o=0,a=0,u=0;dh(e,t,n,(f,d)=>{const h=Math.log(f),g=Math.log(d);++u,i+=(h-i)/u,r+=(g-r)/u,s+=(h*g-s)/u,o+=(h*h-o)/u,a+=(d-a)/u});const l=fh(i,r,s,o),c=f=>l[0]*Math.pow(f,l[1]);return l[0]=Math.exp(l[0]),{coef:l,predict:c,rSquared:sc(e,t,n,a,c)}}function zA(e,t,n){const[i,r,s,o]=Um(e,t,n),a=i.length;let u=0,l=0,c=0,f=0,d=0,h,g,p,m;for(h=0;h<a;)g=i[h],p=r[h++],m=g*g,u+=(m-u)/h,l+=(m*g-l)/h,c+=(m*m-c)/h,f+=(g*p-f)/h,d+=(m*p-d)/h;const y=c-u*u,b=u*y-l*l,x=(d*u-f*l)/b,v=(f*y-d*l)/b,A=-x*u,w=E=>(E=E-s,x*E*E+v*E+A+o);return{coef:[A-v*s+x*s*s+o,v-2*x*s,x],predict:w,rSquared:sc(e,t,n,o,w)}}function VM(e,t,n,i){if(i===0)return PA(e,t,n);if(i===1)return IA(e,t,n);if(i===2)return zA(e,t,n);const[r,s,o,a]=Um(e,t,n),u=r.length,l=[],c=[],f=i+1;let d,h,g,p,m;for(d=0;d<f;++d){for(g=0,p=0;g<u;++g)p+=Math.pow(r[g],d)*s[g];for(l.push(p),m=new Float64Array(f),h=0;h<f;++h){for(g=0,p=0;g<u;++g)p+=Math.pow(r[g],d+h);m[h]=p}c.push(m)}c.push(l);const y=rW(c),b=x=>{x-=o;let v=a+y[0]+y[1]*x+y[2]*x*x;for(d=3;d<f;++d)v+=y[d]*Math.pow(x,d);return v};return{coef:iW(f,y,-o,a),predict:b,rSquared:sc(e,t,n,a,b)}}function iW(e,t,n,i){const r=Array(e);let s,o,a,u;for(s=0;s<e;++s)r[s]=0;for(s=e-1;s>=0;--s)for(a=t[s],u=1,r[s]+=a,o=1;o<=s;++o)u*=(s+1-o)/o,r[s-o]+=a*Math.pow(n,o)*u;return r[0]+=i,r}function rW(e){const t=e.length-1,n=[];let i,r,s,o,a;for(i=0;i<t;++i){for(o=i,r=i+1;r<t;++r)Math.abs(e[i][r])>Math.abs(e[i][o])&&(o=r);for(s=i;s<t+1;++s)a=e[s][i],e[s][i]=e[s][o],e[s][o]=a;for(r=i+1;r<t;++r)for(s=t;s>=i;s--)e[s][r]-=e[s][i]*e[i][r]/e[i][i]}for(r=t-1;r>=0;--r){for(a=0,s=r+1;s<t;++s)a+=e[s][r]*n[s];n[r]=(e[t][r]-a)/e[r][r]}return n}const ES=2,wS=1e-12;function YM(e,t,n,i){const[r,s,o,a]=Um(e,t,n,!0),u=r.length,l=Math.max(2,~~(i*u)),c=new Float64Array(u),f=new Float64Array(u),d=new Float64Array(u).fill(1);for(let h=-1;++h<=ES;){const g=[0,l-1];for(let m=0;m<u;++m){const y=r[m],b=g[0],x=g[1],v=y-r[b]>r[x]-y?b:x;let A=0,w=0,E=0,$=0,k=0;const F=1/Math.abs(r[v]-y||1);for(let C=b;C<=x;++C){const _=r[C],S=s[C],M=sW(Math.abs(y-_)*F)*d[C],O=_*M;A+=M,w+=O,E+=S*M,$+=S*O,k+=_*O}const[D,T]=fh(w/A,E/A,$/A,k/A);c[m]=D+T*y,f[m]=Math.abs(s[m]-c[m]),oW(r,m+1,g)}if(h===ES)break;const p=C6(f);if(Math.abs(p)<wS)break;for(let m=0,y,b;m<u;++m)y=f[m]/(6*p),d[m]=y>=1?wS:(b=1-y*y)*b}return aW(r,c,o,a)}function sW(e){return(e=1-e*e*e)*e*e}function oW(e,t,n){const i=e[t];let r=n[0],s=n[1]+1;if(!(s>=e.length))for(;t>r&&e[s]-i<=i-e[r];)n[0]=++r,n[1]=s,++s}function aW(e,t,n,i){const r=e.length,s=[];let o=0,a=0,u=[],l;for(;o<r;++o)l=e[o]+n,u[0]===l?u[1]+=(t[o]-u[1])/++a:(a=0,u[1]+=i,u=[l,t[o]],s.push(u));return u[1]+=i,s}const uW=.5*Math.PI/180;function qm(e,t,n,i){n=n||25,i=Math.max(n,i||200);const r=p=>[p,e(p)],s=t[0],o=t[1],a=o-s,u=a/i,l=[r(s)],c=[];if(n===i){for(let p=1;p<i;++p)l.push(r(s+p/n*a));return l.push(r(o)),l}else{c.push(r(o));for(let p=n;--p>0;)c.push(r(s+p/n*a))}let f=l[0],d=c[c.length-1];const h=1/a,g=lW(f[1],c);for(;d;){const p=r((f[0]+d[0])/2);p[0]-f[0]>=u&&cW(f,p,d,h,g)>uW?c.push(p):(f=d,l.push(d),c.pop()),d=c[c.length-1]}return l}function lW(e,t){let n=e,i=e;const r=t.length;for(let s=0;s<r;++s){const o=t[s][1];o<n&&(n=o),o>i&&(i=o)}return 1/(i-n)}function cW(e,t,n,i,r){const s=Math.atan2(r*(n[1]-e[1]),i*(n[0]-e[0])),o=Math.atan2(r*(t[1]-e[1]),i*(t[0]-e[0]));return Math.abs(s-o)}function fW(e){return t=>{const n=e.length;let i=1,r=String(e[0](t));for(;i<n;++i)r+="|"+e[i](t);return r}}function W2(e){return!e||!e.length?function(){return""}:e.length===1?e[0]:fW(e)}function XM(e,t,n){return n||e+(t?"_"+t:"")}const Yy=()=>{},dW={init:Yy,add:Yy,rem:Yy,idx:0},xd={values:{init:e=>e.cell.store=!0,value:e=>e.cell.data.values(),idx:-1},count:{value:e=>e.cell.num},__count__:{value:e=>e.missing+e.valid},missing:{value:e=>e.missing},valid:{value:e=>e.valid},sum:{init:e=>e.sum=0,value:e=>e.sum,add:(e,t)=>e.sum+=+t,rem:(e,t)=>e.sum-=t},product:{init:e=>e.product=1,value:e=>e.valid?e.product:void 0,add:(e,t)=>e.product*=t,rem:(e,t)=>e.product/=t},mean:{init:e=>e.mean=0,value:e=>e.valid?e.mean:void 0,add:(e,t)=>(e.mean_d=t-e.mean,e.mean+=e.mean_d/e.valid),rem:(e,t)=>(e.mean_d=t-e.mean,e.mean-=e.valid?e.mean_d/e.valid:e.mean)},average:{value:e=>e.valid?e.mean:void 0,req:["mean"],idx:1},variance:{init:e=>e.dev=0,value:e=>e.valid>1?e.dev/(e.valid-1):void 0,add:(e,t)=>e.dev+=e.mean_d*(t-e.mean),rem:(e,t)=>e.dev-=e.mean_d*(t-e.mean),req:["mean"],idx:1},variancep:{value:e=>e.valid>1?e.dev/e.valid:void 0,req:["variance"],idx:2},stdev:{value:e=>e.valid>1?Math.sqrt(e.dev/(e.valid-1)):void 0,req:["variance"],idx:2},stdevp:{value:e=>e.valid>1?Math.sqrt(e.dev/e.valid):void 0,req:["variance"],idx:2},stderr:{value:e=>e.valid>1?Math.sqrt(e.dev/(e.valid*(e.valid-1))):void 0,req:["variance"],idx:2},distinct:{value:e=>e.cell.data.distinct(e.get),req:["values"],idx:3},ci0:{value:e=>e.cell.data.ci0(e.get),req:["values"],idx:3},ci1:{value:e=>e.cell.data.ci1(e.get),req:["values"],idx:3},median:{value:e=>e.cell.data.q2(e.get),req:["values"],idx:3},q1:{value:e=>e.cell.data.q1(e.get),req:["values"],idx:3},q3:{value:e=>e.cell.data.q3(e.get),req:["values"],idx:3},min:{init:e=>e.min=void 0,value:e=>e.min=Number.isNaN(e.min)?e.cell.data.min(e.get):e.min,add:(e,t)=>{(t<e.min||e.min===void 0)&&(e.min=t)},rem:(e,t)=>{t<=e.min&&(e.min=NaN)},req:["values"],idx:4},max:{init:e=>e.max=void 0,value:e=>e.max=Number.isNaN(e.max)?e.cell.data.max(e.get):e.max,add:(e,t)=>{(t>e.max||e.max===void 0)&&(e.max=t)},rem:(e,t)=>{t>=e.max&&(e.max=NaN)},req:["values"],idx:4},argmin:{init:e=>e.argmin=void 0,value:e=>e.argmin||e.cell.data.argmin(e.get),add:(e,t,n)=>{t<e.min&&(e.argmin=n)},rem:(e,t)=>{t<=e.min&&(e.argmin=void 0)},req:["min","values"],idx:3},argmax:{init:e=>e.argmax=void 0,value:e=>e.argmax||e.cell.data.argmax(e.get),add:(e,t,n)=>{t>e.max&&(e.argmax=n)},rem:(e,t)=>{t>=e.max&&(e.argmax=void 0)},req:["max","values"],idx:3}},hh=Object.keys(xd).filter(e=>e!=="__count__");function hW(e,t){return n=>EA({name:e,out:n||e},dW,t)}[...hh,"__count__"].forEach(e=>{xd[e]=hW(e,xd[e])});function KM(e,t){return xd[e](t)}function JM(e,t){return e.idx-t.idx}function gW(e){const t={};e.forEach(i=>t[i.name]=i);const n=i=>{i.req&&i.req.forEach(r=>{t[r]||n(t[r]=xd[r]())})};return e.forEach(n),Object.values(t).sort(JM)}function pW(){this.valid=0,this.missing=0,this._ops.forEach(e=>e.init(this))}function mW(e,t){if(e==null||e===""){++this.missing;return}e===e&&(++this.valid,this._ops.forEach(n=>n.add(this,e,t)))}function yW(e,t){if(e==null||e===""){--this.missing;return}e===e&&(--this.valid,this._ops.forEach(n=>n.rem(this,e,t)))}function bW(e){return this._out.forEach(t=>e[t.out]=t.value(this)),e}function QM(e,t){const n=t||MM,i=gW(e),r=e.slice().sort(JM);function s(o){this._ops=i,this._out=r,this.cell=o,this.init()}return s.prototype.init=pW,s.prototype.add=mW,s.prototype.rem=yW,s.prototype.set=bW,s.prototype.get=n,s.fields=e.map(o=>o.out),s}function jA(e){this._key=e?yd(e):Z,this.reset()}const Lt=jA.prototype;Lt.reset=function(){this._add=[],this._rem=[],this._ext=null,this._get=null,this._q=null};Lt.add=function(e){this._add.push(e)};Lt.rem=function(e){this._rem.push(e)};Lt.values=function(){if(this._get=null,this._rem.length===0)return this._add;const e=this._add,t=this._rem,n=this._key,i=e.length,r=t.length,s=Array(i-r),o={};let a,u,l;for(a=0;a<r;++a)o[n(t[a])]=1;for(a=0,u=0;a<i;++a)o[n(l=e[a])]?o[n(l)]=0:s[u++]=l;return this._rem=[],this._add=s};Lt.distinct=function(e){const t=this.values(),n={};let i=t.length,r=0,s;for(;--i>=0;)s=e(t[i])+"",ch(n,s)||(n[s]=1,++r);return r};Lt.extent=function(e){if(this._get!==e||!this._ext){const t=this.values(),n=Hq(t,e);this._ext=[t[n[0]],t[n[1]]],this._get=e}return this._ext};Lt.argmin=function(e){return this.extent(e)[0]||{}};Lt.argmax=function(e){return this.extent(e)[1]||{}};Lt.min=function(e){const t=this.extent(e)[0];return t!=null?e(t):void 0};Lt.max=function(e){const t=this.extent(e)[1];return t!=null?e(t):void 0};Lt.quartile=function(e){return(this._get!==e||!this._q)&&(this._q=CA(this.values(),e),this._get=e),this._q};Lt.q1=function(e){return this.quartile(e)[0]};Lt.q2=function(e){return this.quartile(e)[1]};Lt.q3=function(e){return this.quartile(e)[2]};Lt.ci=function(e){return(this._get!==e||!this._ci)&&(this._ci=PM(this.values(),1e3,.05,e),this._get=e),this._ci};Lt.ci0=function(e){return this.ci(e)[0]};Lt.ci1=function(e){return this.ci(e)[1]};function bo(e){N.call(this,null,e),this._adds=[],this._mods=[],this._alen=0,this._mlen=0,this._drop=!0,this._cross=!1,this._dims=[],this._dnames=[],this._measures=[],this._countOnly=!1,this._counts=null,this._prev=null,this._inputs=null,this._outputs=null}bo.Definition={type:"Aggregate",metadata:{generates:!0,changes:!0},params:[{name:"groupby",type:"field",array:!0},{name:"ops",type:"enum",array:!0,values:hh},{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"}]};de(bo,N,{transform(e,t){const n=this,i=t.fork(t.NO_SOURCE|t.NO_FIELDS),r=e.modified();return n.stamp=i.stamp,n.value&&(r||t.modified(n._inputs,!0))?(n._prev=n.value,n.value=r?n.init(e):Object.create(null),t.visit(t.SOURCE,s=>n.add(s))):(n.value=n.value||n.init(e),t.visit(t.REM,s=>n.rem(s)),t.visit(t.ADD,s=>n.add(s))),i.modifies(n._outputs),n._drop=e.drop!==!1,e.cross&&n._dims.length>1&&(n._drop=!1,n.cross()),t.clean()&&n._drop&&i.clean(!0).runAfter(()=>this.clean()),n.changes(i)},cross(){const e=this,t=e.value,n=e._dnames,i=n.map(()=>({})),r=n.length;function s(a){let u,l,c,f;for(u in a)for(c=a[u].tuple,l=0;l<r;++l)i[l][f=c[n[l]]]=f}s(e._prev),s(t);function o(a,u,l){const c=n[l],f=i[l++];for(const d in f){const h=a?a+"|"+d:d;u[c]=f[d],l<r?o(h,u,l):t[h]||e.cell(h,u)}}o("",{},0)},init(e){const t=this._inputs=[],n=this._outputs=[],i={};function r(m){const y=Dn(Fr(m)),b=y.length;let x=0,v;for(;x<b;++x)i[v=y[x]]||(i[v]=1,t.push(v))}this._dims=Dn(e.groupby),this._dnames=this._dims.map(m=>{const y=Tn(m);return r(m),n.push(y),y}),this.cellkey=e.key?e.key:W2(this._dims),this._countOnly=!0,this._counts=[],this._measures=[];const s=e.fields||[null],o=e.ops||["count"],a=e.as||[],u=s.length,l={};let c,f,d,h,g,p;for(u!==o.length&&Bt("Unmatched number of fields and aggregate ops."),p=0;p<u;++p){if(c=s[p],f=o[p],c==null&&f!=="count"&&Bt("Null aggregate field specified."),h=Tn(c),g=XM(f,h,a[p]),n.push(g),f==="count"){this._counts.push(g);continue}d=l[h],d||(r(c),d=l[h]=[],d.field=c,this._measures.push(d)),f!=="count"&&(this._countOnly=!1),d.push(KM(f,g))}return this._measures=this._measures.map(m=>QM(m,m.field)),Object.create(null)},cellkey:W2(),cell(e,t){let n=this.value[e];return n?n.num===0&&this._drop&&n.stamp<this.stamp?(n.stamp=this.stamp,this._adds[this._alen++]=n):n.stamp<this.stamp&&(n.stamp=this.stamp,this._mods[this._mlen++]=n):(n=this.value[e]=this.newcell(e,t),this._adds[this._alen++]=n),n},newcell(e,t){const n={key:e,num:0,agg:null,tuple:this.newtuple(t,this._prev&&this._prev[e]),stamp:this.stamp,store:!1};if(!this._countOnly){const i=this._measures,r=i.length;n.agg=Array(r);for(let s=0;s<r;++s)n.agg[s]=new i[s](n)}return n.store&&(n.data=new jA),n},newtuple(e,t){const n=this._dnames,i=this._dims,r=i.length,s={};for(let o=0;o<r;++o)s[n[o]]=i[o](e);return t?wM(t.tuple,s):De(s)},clean(){const e=this.value;for(const t in e)e[t].num===0&&delete e[t]},add(e){const t=this.cellkey(e),n=this.cell(t,e);if(n.num+=1,this._countOnly)return;n.store&&n.data.add(e);const i=n.agg;for(let r=0,s=i.length;r<s;++r)i[r].add(i[r].get(e),e)},rem(e){const t=this.cellkey(e),n=this.cell(t,e);if(n.num-=1,this._countOnly)return;n.store&&n.data.rem(e);const i=n.agg;for(let r=0,s=i.length;r<s;++r)i[r].rem(i[r].get(e),e)},celltuple(e){const t=e.tuple,n=this._counts;e.store&&e.data.values();for(let i=0,r=n.length;i<r;++i)t[n[i]]=e.num;if(!this._countOnly){const i=e.agg;for(let r=0,s=i.length;r<s;++r)i[r].set(t)}return t},changes(e){const t=this._adds,n=this._mods,i=this._prev,r=this._drop,s=e.add,o=e.rem,a=e.mod;let u,l,c,f;if(i)for(l in i)u=i[l],(!r||u.num)&&o.push(u.tuple);for(c=0,f=this._alen;c<f;++c)s.push(this.celltuple(t[c])),t[c]=null;for(c=0,f=this._mlen;c<f;++c)u=n[c],(u.num===0&&r?o:a).push(this.celltuple(u)),n[c]=null;return this._alen=this._mlen=0,this._prev=null,e}});const xW=1e-14;function UA(e){N.call(this,null,e)}UA.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"]}]};de(UA,N,{transform(e,t){const n=e.interval!==!1,i=this._bins(e),r=i.start,s=i.step,o=e.as||["bin0","bin1"],a=o[0],u=o[1];let l;return e.modified()?(t=t.reflow(!0),l=t.SOURCE):l=t.modified(Fr(e.field))?t.ADD_MOD:t.ADD,t.visit(l,n?c=>{const f=i(c);c[a]=f,c[u]=f==null?null:r+s*(1+(f-r)/s)}:c=>c[a]=i(c)),t.modifies(n?o:a)},_bins(e){if(this.value&&!e.modified())return this.value;const t=e.field,n=LM(e),i=n.step;let r=n.start,s=r+Math.ceil((n.stop-r)/i)*i,o,a;(o=e.anchor)!=null&&(a=o-(r+i*Math.floor((o-r)/i)),r+=a,s+=a);const u=function(l){let c=TM(t(l));return c==null?null:c<r?-1/0:c>s?1/0:(c=Math.max(r,Math.min(c,s-i)),r+i*Math.floor(xW+(c-r)/i))};return u.start=r,u.stop=n.stop,u.step=i,this.value=Vi(u,Fr(t),e.name||"bin_"+Tn(t))}});function ZM(e,t,n){const i=e;let r=t||[],s=n||[],o={},a=0;return{add:u=>s.push(u),remove:u=>o[i(u)]=++a,size:()=>r.length,data:(u,l)=>(a&&(r=r.filter(c=>!o[i(c)]),o={},a=0),l&&u&&r.sort(u),s.length&&(r=u?Xq(u,r,s.sort(u)):r.concat(s),s=[]),r)}}function qA(e){N.call(this,[],e)}qA.Definition={type:"Collect",metadata:{source:!0},params:[{name:"sort",type:"compare"}]};de(qA,N,{transform(e,t){const n=t.fork(t.ALL),i=ZM(Z,this.value,n.materialize(n.ADD).add),r=e.sort,s=t.changed()||r&&(e.modified("sort")||t.modified(r.fields));return n.visit(n.REM,i.remove),this.modified(s),this.value=n.source=i.data(mu(r),s),t.source&&t.source.root&&(this.value.root=t.source.root),n}});function e8(e){Ie.call(this,null,vW,e)}de(e8,Ie);function vW(e){return this.value&&!e.modified()?this.value:jq(e.fields,e.orders)}function WA(e){N.call(this,null,e)}WA.Definition={type:"CountPattern",metadata:{generates:!0,changes:!0},params:[{name:"field",type:"field",required:!0},{name:"case",type:"enum",values:["upper","lower","mixed"],default:"mixed"},{name:"pattern",type:"string",default:'[\\w"]+'},{name:"stopwords",type:"string",default:""},{name:"as",type:"string",array:!0,length:2,default:["text","count"]}]};function AW(e,t,n){switch(t){case"upper":e=e.toUpperCase();break;case"lower":e=e.toLowerCase();break}return e.match(n)}de(WA,N,{transform(e,t){const n=f=>d=>{for(var h=AW(a(d),e.case,s)||[],g,p=0,m=h.length;p<m;++p)o.test(g=h[p])||f(g)},i=this._parameterCheck(e,t),r=this._counts,s=this._match,o=this._stop,a=e.field,u=e.as||["text","count"],l=n(f=>r[f]=1+(r[f]||0)),c=n(f=>r[f]-=1);return i?t.visit(t.SOURCE,l):(t.visit(t.ADD,l),t.visit(t.REM,c)),this._finish(t,u)},_parameterCheck(e,t){let n=!1;return(e.modified("stopwords")||!this._stop)&&(this._stop=new RegExp("^"+(e.stopwords||"")+"$","i"),n=!0),(e.modified("pattern")||!this._match)&&(this._match=new RegExp(e.pattern||"[\\w']+","g"),n=!0),(e.modified("field")||t.modified(e.field.fields))&&(n=!0),n&&(this._counts={}),n},_finish(e,t){const n=this._counts,i=this._tuples||(this._tuples={}),r=t[0],s=t[1],o=e.fork(e.NO_SOURCE|e.NO_FIELDS);let a,u,l;for(a in n)u=i[a],l=n[a]||0,!u&&l?(i[a]=u=De({}),u[r]=a,u[s]=l,o.add.push(u)):l===0?(u&&o.rem.push(u),n[a]=null,i[a]=null):u[s]!==l&&(u[s]=l,o.mod.push(u));return o.modifies(t)}});function GA(e){N.call(this,null,e)}GA.Definition={type:"Cross",metadata:{generates:!0},params:[{name:"filter",type:"expr"},{name:"as",type:"string",array:!0,length:2,default:["a","b"]}]};de(GA,N,{transform(e,t){const n=t.fork(t.NO_SOURCE),i=e.as||["a","b"],r=i[0],s=i[1],o=!this.value||t.changed(t.ADD_REM)||e.modified("as")||e.modified("filter");let a=this.value;return o?(a&&(n.rem=a),a=t.materialize(t.SOURCE).source,n.add=this.value=EW(a,r,s,e.filter||Iq)):n.mod=a,n.source=this.value,n.modifies(i)}});function EW(e,t,n,i){for(var r=[],s={},o=e.length,a=0,u,l;a<o;++a)for(s[t]=l=e[a],u=0;u<o;++u)s[n]=e[u],i(s)&&(r.push(De(s)),s={},s[t]=l);return r}const $S={kde:_A,mixture:UM,normal:DA,lognormal:jM,uniform:qM},wW="distributions",CS="function",$W="field";function t8(e,t){const n=e[CS];ch($S,n)||Bt("Unknown distribution function: "+n);const i=$S[n]();for(const r in e)r===$W?i.data((e.from||t()).map(e[r])):r===wW?i[r](e[r].map(s=>t8(s,t))):typeof i[r]===CS&&i[r](e[r]);return i}function HA(e){N.call(this,null,e)}const n8=[{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}]}],CW={key:{function:"mixture"},params:[{name:"distributions",type:"param",array:!0,params:n8},{name:"weights",type:"number",array:!0}]};HA.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:n8.concat(CW)},{name:"as",type:"string",array:!0,default:["value","density"]}]};de(HA,N,{transform(e,t){const n=t.fork(t.NO_SOURCE|t.NO_FIELDS);if(!this.value||t.changed()||e.modified()){const i=t8(e.distribution,FW(t)),r=e.steps||e.minsteps||25,s=e.steps||e.maxsteps||200;let o=e.method||"pdf";o!=="pdf"&&o!=="cdf"&&Bt("Invalid density method: "+o),!e.extent&&!i.data&&Bt("Missing density extent parameter."),o=i[o];const a=e.as||["value","density"],u=e.extent||bd(i.data()),l=qm(o,u,r,s).map(c=>{const f={};return f[a[0]]=c[0],f[a[1]]=c[1],De(f)});this.value&&(n.rem=this.value),this.value=n.add=n.source=l}return n}});function FW(e){return()=>e.materialize(e.SOURCE).source}function i8(e,t){return e?e.map((n,i)=>t[i]||Tn(n)):null}function VA(e,t,n){const i=[],r=f=>f(u);let s,o,a,u,l,c;if(t==null)i.push(e.map(n));else for(s={},o=0,a=e.length;o<a;++o)u=e[o],l=t.map(r),c=s[l],c||(s[l]=c=[],c.dims=l,i.push(c)),c.push(n(u));return i}const r8="bin";function YA(e){N.call(this,null,e)}YA.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:r8}]};const SW=(e,t)=>Kq(bd(e,t))/30;de(YA,N,{transform(e,t){if(this.value&&!(e.modified()||t.changed()))return t;const n=t.materialize(t.SOURCE).source,i=VA(t.source,e.groupby,MM),r=e.smooth||!1,s=e.field,o=e.step||SW(n,s),a=mu((g,p)=>s(g)-s(p)),u=e.as||r8,l=i.length;let c=1/0,f=-1/0,d=0,h;for(;d<l;++d){const g=i[d].sort(a);h=-1;for(const p of IM(g,o,r,s))p<c&&(c=p),p>f&&(f=p),g[++h][u]=p}return this.value={start:c,stop:f,step:o},t.reflow(!0).modifies(u)}});function s8(e){Ie.call(this,null,DW,e),this.modified(!0)}de(s8,Ie);function DW(e){const t=e.expr;return this.value&&!e.modified("expr")?this.value:Vi(n=>t(n,e),Fr(t),Tn(t))}function XA(e){N.call(this,[void 0,void 0],e)}XA.Definition={type:"Extent",metadata:{},params:[{name:"field",type:"field",required:!0}]};de(XA,N,{transform(e,t){const n=this.value,i=e.field,r=t.changed()||t.modified(i.fields)||e.modified("field");let s=n[0],o=n[1];if((r||s==null)&&(s=1/0,o=-1/0),t.visit(r?t.SOURCE:t.ADD,a=>{const u=TM(i(a));u!=null&&(u<s&&(s=u),u>o&&(o=u))}),!Number.isFinite(s)||!Number.isFinite(o)){let a=Tn(i);a&&(a=` for field "${a}"`),t.dataflow.warn(`Infinite extent${a}: [${s}, ${o}]`),s=o=void 0}this.value=[s,o]}});function KA(e,t){Ie.call(this,e),this.parent=t,this.count=0}de(KA,Ie,{connect(e){return this.detachSubflow=e.detachSubflow,this.targets().add(e),e.source=this},add(e){this.count+=1,this.value.add.push(e)},rem(e){this.count-=1,this.value.rem.push(e)},mod(e){this.value.mod.push(e)},init(e){this.value.init(e,e.NO_SOURCE)},evaluate(){return this.value}});function Wm(e){N.call(this,{},e),this._keys=wA();const t=this._targets=[];t.active=0,t.forEach=n=>{for(let i=0,r=t.active;i<r;++i)n(t[i],i,t)}}de(Wm,N,{activate(e){this._targets[this._targets.active++]=e},subflow(e,t,n,i){const r=this.value;let s=ch(r,e)&&r[e],o,a;return s?s.value.stamp<n.stamp&&(s.init(n),this.activate(s)):(a=i||(a=this._group[e])&&a.tuple,o=n.dataflow,s=new KA(n.fork(n.NO_SOURCE),this),o.add(s).connect(t(o,e,a)),r[e]=s,this.activate(s)),s},clean(){const e=this.value;let t=0;for(const n in e)if(e[n].count===0){const i=e[n].detachSubflow;i&&i(),delete e[n],++t}if(t){const n=this._targets.filter(i=>i&&i.count>0);this.initTargets(n)}},initTargets(e){const t=this._targets,n=t.length,i=e?e.length:0;let r=0;for(;r<i;++r)t[r]=e[r];for(;r<n&&t[r]!=null;++r)t[r]=null;t.active=i},transform(e,t){const n=t.dataflow,i=e.key,r=e.subflow,s=this._keys,o=e.modified("key"),a=u=>this.subflow(u,r,t);return this._group=e.group||{},this.initTargets(),t.visit(t.REM,u=>{const l=Z(u),c=s.get(l);c!==void 0&&(s.delete(l),a(c).rem(u))}),t.visit(t.ADD,u=>{const l=i(u);s.set(Z(u),l),a(l).add(u)}),o||t.modified(i.fields)?t.visit(t.MOD,u=>{const l=Z(u),c=s.get(l),f=i(u);c===f?a(f).mod(u):(s.set(l,f),a(c).rem(u),a(f).add(u))}):t.changed(t.MOD)&&t.visit(t.MOD,u=>{a(s.get(Z(u))).mod(u)}),o&&t.visit(t.REFLOW,u=>{const l=Z(u),c=s.get(l),f=i(u);c!==f&&(s.set(l,f),a(c).rem(u),a(f).add(u))}),t.clean()?n.runAfter(()=>{this.clean(),s.clean()}):s.empty>n.cleanThreshold&&n.runAfter(s.clean),t}});function o8(e){Ie.call(this,null,_W,e)}de(o8,Ie);function _W(e){return this.value&&!e.modified()?this.value:OM(e.name)?Dn(e.name).map(t=>yd(t)):yd(e.name,e.as)}function JA(e){N.call(this,wA(),e)}JA.Definition={type:"Filter",metadata:{changes:!0},params:[{name:"expr",type:"expr",required:!0}]};de(JA,N,{transform(e,t){const n=t.dataflow,i=this.value,r=t.fork(),s=r.add,o=r.rem,a=r.mod,u=e.expr;let l=!0;t.visit(t.REM,f=>{const d=Z(f);i.has(d)?i.delete(d):o.push(f)}),t.visit(t.ADD,f=>{u(f,e)?s.push(f):i.set(Z(f),1)});function c(f){const d=Z(f),h=u(f,e),g=i.get(d);h&&g?(i.delete(d),s.push(f)):!h&&!g?(i.set(d,1),o.push(f)):l&&h&&!g&&a.push(f)}return t.visit(t.MOD,c),e.modified()&&(l=!1,t.visit(t.REFLOW,c)),i.empty>n.cleanThreshold&&n.runAfter(i.clean),r}});function QA(e){N.call(this,[],e)}QA.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}]};de(QA,N,{transform(e,t){const n=t.fork(t.NO_SOURCE),i=e.fields,r=i8(i,e.as||[]),s=e.index||null,o=r.length;return n.rem=this.value,t.visit(t.SOURCE,a=>{const u=i.map(g=>g(a)),l=u.reduce((g,p)=>Math.max(g,p.length),0);let c=0,f,d,h;for(;c<l;++c){for(d=bA(a),f=0;f<o;++f)d[r[f]]=(h=u[f][c])==null?null:h;s&&(d[s]=c),n.add.push(d)}}),this.value=n.source=n.add,s&&n.modifies(s),n.modifies(r)}});function ZA(e){N.call(this,[],e)}ZA.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"]}]};de(ZA,N,{transform(e,t){const n=t.fork(t.NO_SOURCE),i=e.fields,r=i.map(Tn),s=e.as||["key","value"],o=s[0],a=s[1],u=i.length;return n.rem=this.value,t.visit(t.SOURCE,l=>{for(let c=0,f;c<u;++c)f=bA(l),f[o]=r[c],f[a]=i[c](l),n.add.push(f)}),this.value=n.source=n.add,n.modifies(s)}});function eE(e){N.call(this,null,e)}eE.Definition={type:"Formula",metadata:{modifies:!0},params:[{name:"expr",type:"expr",required:!0},{name:"as",type:"string",required:!0},{name:"initonly",type:"boolean"}]};de(eE,N,{transform(e,t){const n=e.expr,i=e.as,r=e.modified(),s=e.initonly?t.ADD:r?t.SOURCE:t.modified(n.fields)||t.modified(i)?t.ADD_MOD:t.ADD;return r&&(t=t.materialize().reflow(!0)),e.initonly||t.modifies(i),t.visit(s,o=>o[i]=n(o,e))}});function a8(e){N.call(this,[],e)}de(a8,N,{transform(e,t){const n=t.fork(t.ALL),i=e.generator;let r=this.value,s=e.size-r.length,o,a,u;if(s>0){for(o=[];--s>=0;)o.push(u=De(i(e))),r.push(u);n.add=n.add.length?n.materialize(n.ADD).add.concat(o):o}else a=r.slice(0,-s),n.rem=n.rem.length?n.materialize(n.REM).rem.concat(a):a,r=r.slice(-s);return n.source=this.value=r,n}});const f0={value:"value",median:C6,mean:Mz,min:N2,max:Ba},kW=[];function tE(e){N.call(this,[],e)}tE.Definition={type:"Impute",metadata:{changes:!0},params:[{name:"field",type:"field",required:!0},{name:"key",type:"field",required:!0},{name:"keyvals",array:!0},{name:"groupby",type:"field",array:!0},{name:"method",type:"enum",default:"value",values:["value","mean","median","max","min"]},{name:"value",default:0}]};function MW(e){var t=e.method||f0.value,n;if(f0[t]==null)Bt("Unrecognized imputation method: "+t);else return t===f0.value?(n=e.value!==void 0?e.value:0,()=>n):f0[t]}function OW(e){const t=e.field;return n=>n?t(n):NaN}de(tE,N,{transform(e,t){var n=t.fork(t.ALL),i=MW(e),r=OW(e),s=Tn(e.field),o=Tn(e.key),a=(e.groupby||[]).map(Tn),u=NW(t.source,e.groupby,e.key,e.keyvals),l=[],c=this.value,f=u.domain.length,d,h,g,p,m,y,b,x,v,A;for(m=0,x=u.length;m<x;++m)for(d=u[m],g=d.values,h=NaN,b=0;b<f;++b)if(d[b]==null){for(p=u.domain[b],A={_impute:!0},y=0,v=g.length;y<v;++y)A[a[y]]=g[y];A[o]=p,A[s]=Number.isNaN(h)?h=i(d,r):h,l.push(De(A))}return l.length&&(n.add=n.materialize(n.ADD).add.concat(l)),c.length&&(n.rem=n.materialize(n.REM).rem.concat(c)),this.value=l,n}});function NW(e,t,n,i){var r=y=>y(m),s=[],o=i?i.slice():[],a={},u={},l,c,f,d,h,g,p,m;for(o.forEach((y,b)=>a[y]=b+1),d=0,p=e.length;d<p;++d)m=e[d],g=n(m),h=a[g]||(a[g]=o.push(g)),c=(l=t?t.map(r):kW)+"",(f=u[c])||(f=u[c]=[],s.push(f),f.values=l),f[h-1]=m;return s.domain=o,s}function nE(e){bo.call(this,e)}nE.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:hh},{name:"as",type:"string",null:!0,array:!0},{name:"key",type:"field"}]};de(nE,bo,{transform(e,t){const n=this,i=e.modified();let r;return n.value&&(i||t.modified(n._inputs,!0))?(r=n.value=i?n.init(e):{},t.visit(t.SOURCE,s=>n.add(s))):(r=n.value=n.value||this.init(e),t.visit(t.REM,s=>n.rem(s)),t.visit(t.ADD,s=>n.add(s))),n.changes(),t.visit(t.SOURCE,s=>{EA(s,r[n.cellkey(s)].tuple)}),t.reflow(i).modifies(this._outputs)},changes(){const e=this._adds,t=this._mods;let n,i;for(n=0,i=this._alen;n<i;++n)this.celltuple(e[n]),e[n]=null;for(n=0,i=this._mlen;n<i;++n)this.celltuple(t[n]),t[n]=null;this._alen=this._mlen=0}});function iE(e){N.call(this,null,e)}iE.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"]}]};de(iE,N,{transform(e,t){const n=t.fork(t.NO_SOURCE|t.NO_FIELDS);if(!this.value||t.changed()||e.modified()){const i=t.materialize(t.SOURCE).source,r=VA(i,e.groupby,e.field),s=(e.groupby||[]).map(Tn),o=e.bandwidth,a=e.cumulative?"cdf":"pdf",u=e.as||["value","density"],l=[];let c=e.extent,f=e.steps||e.minsteps||25,d=e.steps||e.maxsteps||200;a!=="pdf"&&a!=="cdf"&&Bt("Invalid density method: "+a),e.resolve==="shared"&&(c||(c=bd(i,e.field)),f=d=e.steps||d),r.forEach(h=>{const g=_A(h,o)[a],p=e.counts?h.length:1,m=c||bd(h);qm(g,m,f,d).forEach(y=>{const b={};for(let x=0;x<s.length;++x)b[s[x]]=h.dims[x];b[u[0]]=y[0],b[u[1]]=y[1]*p,l.push(De(b))})}),this.value&&(n.rem=this.value),this.value=n.add=n.source=l}return n}});function u8(e){Ie.call(this,null,TW,e)}de(u8,Ie);function TW(e){return this.value&&!e.modified()?this.value:Yq(e.fields,e.flat)}function l8(e){N.call(this,[],e),this._pending=null}de(l8,N,{transform(e,t){const n=t.dataflow;return this._pending?Xy(this,t,this._pending):BW(e)?t.StopPropagation:e.values?Xy(this,t,n.parse(e.values,e.format)):e.async?{async:n.request(e.url,e.format).then(r=>(this._pending=Dn(r.data),s=>s.touch(this)))}:n.request(e.url,e.format).then(i=>Xy(this,t,Dn(i.data)))}});function BW(e){return e.modified("async")&&!(e.modified("values")||e.modified("url")||e.modified("format"))}function Xy(e,t,n){n.forEach(De);const i=t.fork(t.NO_FIELDS&t.NO_SOURCE);return i.rem=e.value,e.value=i.source=i.add=n,e._pending=null,i.rem.length&&i.clean(!0),i}function rE(e){N.call(this,{},e)}rE.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}]};de(rE,N,{transform(e,t){const n=e.fields,i=e.index,r=e.values,s=e.default==null?null:e.default,o=e.modified(),a=n.length;let u=o?t.SOURCE:t.ADD,l=t,c=e.as,f,d,h;return r?(d=r.length,a>1&&!c&&Bt('Multi-field lookup requires explicit "as" parameter.'),c&&c.length!==a*d&&Bt('The "as" parameter has too few output field names.'),c=c||r.map(Tn),f=function(g){for(var p=0,m=0,y,b;p<a;++p)if(b=i.get(n[p](g)),b==null)for(y=0;y<d;++y,++m)g[c[m]]=s;else for(y=0;y<d;++y,++m)g[c[m]]=r[y](b)}):(c||Bt("Missing output field names."),f=function(g){for(var p=0,m;p<a;++p)m=i.get(n[p](g)),g[c[p]]=m??s}),o?l=t.reflow(!0):(h=n.some(g=>t.modified(g.fields)),u|=h?t.MOD:0),t.visit(u,f),l.modifies(c)}});function c8(e){Ie.call(this,null,RW,e)}de(c8,Ie);function RW(e){if(this.value&&!e.modified())return this.value;const t=e.extents,n=t.length;let i=1/0,r=-1/0,s,o;for(s=0;s<n;++s)o=t[s],o[0]<i&&(i=o[0]),o[1]>r&&(r=o[1]);return[i,r]}function f8(e){Ie.call(this,null,LW,e)}de(f8,Ie);function LW(e){return this.value&&!e.modified()?this.value:e.values.reduce((t,n)=>t.concat(n),[])}function d8(e){N.call(this,null,e)}de(d8,N,{transform(e,t){return this.modified(e.modified()),this.value=e,t.fork(t.NO_SOURCE|t.NO_FIELDS)}});function sE(e){bo.call(this,e)}sE.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:hh,default:"sum"},{name:"limit",type:"number",default:0},{name:"key",type:"field"}]};de(sE,bo,{_transform:bo.prototype.transform,transform(e,t){return this._transform(PW(e,t),t)}});function PW(e,t){const n=e.field,i=e.value,r=(e.op==="count"?"__count__":e.op)||"sum",s=Fr(n).concat(Fr(i)),o=zW(n,e.limit||0,t);return t.changed()&&e.set("__pivot__",null,null,!0),{key:e.key,groupby:e.groupby,ops:o.map(()=>r),fields:o.map(a=>IW(a,n,i,s)),as:o.map(a=>a+""),modified:e.modified.bind(e)}}function IW(e,t,n,i){return Vi(r=>t(r)===e?n(r):NaN,i,e+"")}function zW(e,t,n){const i={},r=[];return n.visit(n.SOURCE,s=>{const o=e(s);i[o]||(i[o]=1,r.push(o))}),r.sort(AA),t?r.slice(0,t):r}function h8(e){Wm.call(this,e)}de(h8,Wm,{transform(e,t){const n=e.subflow,i=e.field,r=s=>this.subflow(Z(s),n,t,s);return(e.modified("field")||i&&t.modified(Fr(i)))&&Bt("PreFacet does not support field modification."),this.initTargets(),i?(t.visit(t.MOD,s=>{const o=r(s);i(s).forEach(a=>o.mod(a))}),t.visit(t.ADD,s=>{const o=r(s);i(s).forEach(a=>o.add(De(a)))}),t.visit(t.REM,s=>{const o=r(s);i(s).forEach(a=>o.rem(a))})):(t.visit(t.MOD,s=>r(s).mod(s)),t.visit(t.ADD,s=>r(s).add(s)),t.visit(t.REM,s=>r(s).rem(s))),t.clean()&&t.runAfter(()=>this.clean()),t}});function oE(e){N.call(this,null,e)}oE.Definition={type:"Project",metadata:{generates:!0,changes:!0},params:[{name:"fields",type:"field",array:!0},{name:"as",type:"string",null:!0,array:!0}]};de(oE,N,{transform(e,t){const n=t.fork(t.NO_SOURCE),i=e.fields,r=i8(e.fields,e.as||[]),s=i?(a,u)=>jW(a,u,i,r):Rm;let o;return this.value?o=this.value:(t=t.addAll(),o=this.value={}),t.visit(t.REM,a=>{const u=Z(a);n.rem.push(o[u]),o[u]=null}),t.visit(t.ADD,a=>{const u=s(a,De({}));o[Z(a)]=u,n.add.push(u)}),t.visit(t.MOD,a=>{n.mod.push(s(a,o[Z(a)]))}),n}});function jW(e,t,n,i){for(let r=0,s=n.length;r<s;++r)t[i[r]]=n[r](e);return t}function g8(e){N.call(this,null,e)}de(g8,N,{transform(e,t){return this.value=e.value,e.modified("value")?t.fork(t.NO_SOURCE|t.NO_FIELDS):t.StopPropagation}});function aE(e){N.call(this,null,e)}aE.Definition={type:"Quantile",metadata:{generates:!0,changes:!0},params:[{name:"groupby",type:"field",array:!0},{name:"field",type:"field",required:!0},{name:"probs",type:"number",array:!0},{name:"step",type:"number",default:.01},{name:"as",type:"string",array:!0,default:["prob","value"]}]};const UW=1e-14;de(aE,N,{transform(e,t){const n=t.fork(t.NO_SOURCE|t.NO_FIELDS),i=e.as||["prob","value"];if(this.value&&!e.modified()&&!t.changed())return n.source=this.value,n;const r=t.materialize(t.SOURCE).source,s=VA(r,e.groupby,e.field),o=(e.groupby||[]).map(Tn),a=[],u=e.step||.01,l=e.probs||Kn(u/2,1-UW,u),c=l.length;return s.forEach(f=>{const d=$A(f,l);for(let h=0;h<c;++h){const g={};for(let p=0;p<o.length;++p)g[o[p]]=f.dims[p];g[i[0]]=l[h],g[i[1]]=d[h],a.push(De(g))}}),this.value&&(n.rem=this.value),this.value=n.add=n.source=a,n}});function p8(e){N.call(this,null,e)}de(p8,N,{transform(e,t){let n,i;return this.value?i=this.value:(n=t=t.addAll(),i=this.value={}),e.derive&&(n=t.fork(t.NO_SOURCE),t.visit(t.REM,r=>{const s=Z(r);n.rem.push(i[s]),i[s]=null}),t.visit(t.ADD,r=>{const s=bA(r);i[Z(r)]=s,n.add.push(s)}),t.visit(t.MOD,r=>{const s=i[Z(r)];for(const o in r)s[o]=r[o],n.modifies(o);n.mod.push(s)})),n}});function uE(e){N.call(this,[],e),this.count=0}uE.Definition={type:"Sample",metadata:{},params:[{name:"size",type:"number",default:1e3}]};de(uE,N,{transform(e,t){const n=t.fork(t.NO_SOURCE),i=e.modified("size"),r=e.size,s=this.value.reduce((c,f)=>(c[Z(f)]=1,c),{});let o=this.value,a=this.count,u=0;function l(c){let f,d;o.length<r?o.push(c):(d=~~((a+1)*gi()),d<o.length&&d>=u&&(f=o[d],s[Z(f)]&&n.rem.push(f),o[d]=c)),++a}if(t.rem.length&&(t.visit(t.REM,c=>{const f=Z(c);s[f]&&(s[f]=-1,n.rem.push(c)),--a}),o=o.filter(c=>s[Z(c)]!==-1)),(t.rem.length||i)&&o.length<r&&t.source&&(u=a=o.length,t.visit(t.SOURCE,c=>{s[Z(c)]||l(c)}),u=-1),i&&o.length>r){const c=o.length-r;for(let f=0;f<c;++f)s[Z(o[f])]=-1,n.rem.push(o[f]);o=o.slice(c)}return t.mod.length&&t.visit(t.MOD,c=>{s[Z(c)]&&n.mod.push(c)}),t.add.length&&t.visit(t.ADD,l),(t.add.length||u<0)&&(n.add=o.filter(c=>!s[Z(c)])),this.count=a,this.value=n.source=o,n}});function lE(e){N.call(this,null,e)}lE.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"}]};de(lE,N,{transform(e,t){if(this.value&&!e.modified())return;const n=t.materialize().fork(t.MOD),i=e.as||"data";return n.rem=this.value?t.rem.concat(this.value):t.rem,this.value=Kn(e.start,e.stop,e.step||1).map(r=>{const s={};return s[i]=r,De(s)}),n.add=t.add.concat(this.value),n}});function m8(e){N.call(this,null,e),this.modified(!0)}de(m8,N,{transform(e,t){return this.value=t.source,t.changed()?t.fork(t.NO_SOURCE|t.NO_FIELDS):t.StopPropagation}});function cE(e){N.call(this,null,e)}const y8=["unit0","unit1"];cE.Definition={type:"TimeUnit",metadata:{modifies:!0},params:[{name:"field",type:"field",required:!0},{name:"interval",type:"boolean",default:!0},{name:"units",type:"enum",values:lA,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:y8}]};de(cE,N,{transform(e,t){const n=e.field,i=e.interval!==!1,r=e.timezone==="utc",s=this._floor(e,t),o=(r?ic:nc)(s.unit).offset,a=e.as||y8,u=a[0],l=a[1],c=s.step;let f=s.start||1/0,d=s.stop||-1/0,h=t.ADD;return(e.modified()||t.changed(t.REM)||t.modified(Fr(n)))&&(t=t.reflow(!0),h=t.SOURCE,f=1/0,d=-1/0),t.visit(h,g=>{const p=n(g);let m,y;p==null?(g[u]=null,i&&(g[l]=null)):(g[u]=m=y=s(p),i&&(g[l]=y=o(m,c)),m<f&&(f=m),y>d&&(d=y))}),s.start=f,s.stop=d,t.modifies(i?a:u)},_floor(e,t){const n=e.timezone==="utc",{units:i,step:r}=e.units?{units:e.units,step:e.step||1}:eM({extent:e.extent||bd(t.materialize(t.SOURCE).source,e.field),maxbins:e.maxbins}),s=cA(i),o=this.value||{},a=(n?G6:W6)(s,r);return a.unit=NM(s),a.units=s,a.step=r,a.start=o.start,a.stop=o.stop,this.value=a}});function b8(e){N.call(this,wA(),e)}de(b8,N,{transform(e,t){const n=t.dataflow,i=e.field,r=this.value,s=a=>r.set(i(a),a);let o=!0;return e.modified("field")||t.modified(i.fields)?(r.clear(),t.visit(t.SOURCE,s)):t.changed()?(t.visit(t.REM,a=>r.delete(i(a))),t.visit(t.ADD,s)):o=!1,this.modified(o),r.empty>n.cleanThreshold&&n.runAfter(r.clean),t.fork()}});function x8(e){N.call(this,null,e)}de(x8,N,{transform(e,t){(!this.value||e.modified("field")||e.modified("sort")||t.changed()||e.sort&&t.modified(e.sort.fields))&&(this.value=(e.sort?t.source.slice().sort(mu(e.sort)):t.source).map(e.field))}});function qW(e,t,n,i){const r=vd[e](t,n);return{init:r.init||Pq,update:function(s,o){o[i]=r.next(s)}}}const vd={row_number:function(){return{next:e=>e.index+1}},rank:function(){let e;return{init:()=>e=1,next:t=>{const n=t.index,i=t.data;return n&&t.compare(i[n-1],i[n])?e=n+1:e}}},dense_rank:function(){let e;return{init:()=>e=1,next:t=>{const n=t.index,i=t.data;return n&&t.compare(i[n-1],i[n])?++e:e}}},percent_rank:function(){const e=vd.rank(),t=e.next;return{init:e.init,next:n=>(t(n)-1)/(n.data.length-1)}},cume_dist:function(){let e;return{init:()=>e=0,next:t=>{const n=t.data,i=t.compare;let r=t.index;if(e<r){for(;r+1<n.length&&!i(n[r],n[r+1]);)++r;e=r}return(1+e)/n.length}}},ntile:function(e,t){t=+t,t>0||Bt("ntile num must be greater than zero.");const n=vd.cume_dist(),i=n.next;return{init:n.init,next:r=>Math.ceil(t*i(r))}},lag:function(e,t){return t=+t||1,{next:n=>{const i=n.index-t;return i>=0?e(n.data[i]):null}}},lead:function(e,t){return t=+t||1,{next:n=>{const i=n.index+t,r=n.data;return i<r.length?e(r[i]):null}}},first_value:function(e){return{next:t=>e(t.data[t.i0])}},last_value:function(e){return{next:t=>e(t.data[t.i1-1])}},nth_value:function(e,t){return t=+t,t>0||Bt("nth_value nth must be greater than zero."),{next:n=>{const i=n.i0+(t-1);return i<n.i1?e(n.data[i]):null}}},prev_value:function(e){let t;return{init:()=>t=null,next:n=>{const i=e(n.data[n.index]);return i!=null?t=i:t}}},next_value:function(e){let t,n;return{init:()=>(t=null,n=-1),next:i=>{const r=i.data;return i.index<=n?t:(n=WW(e,r,i.index))<0?(n=r.length,t=null):t=e(r[n])}}}};function WW(e,t,n){for(let i=t.length;n<i;++n)if(e(t[n])!=null)return n;return-1}const GW=Object.keys(vd);function v8(e){const t=Dn(e.ops),n=Dn(e.fields),i=Dn(e.params),r=Dn(e.as),s=this.outputs=[],o=this.windows=[],a={},u={},l=[],c=[];let f=!0;function d(h){Dn(Fr(h)).forEach(g=>a[g]=1)}d(e.sort),t.forEach((h,g)=>{const p=n[g],m=Tn(p),y=XM(h,m,r[g]);if(d(p),s.push(y),ch(vd,h))o.push(qW(h,n[g],i[g],y));else{if(p==null&&h!=="count"&&Bt("Null aggregate field specified."),h==="count"){l.push(y);return}f=!1;let b=u[m];b||(b=u[m]=[],b.field=p,c.push(b)),b.push(KM(h,y))}}),(l.length||c.length)&&(this.cell=HW(c,l,f)),this.inputs=Object.keys(a)}const A8=v8.prototype;A8.init=function(){this.windows.forEach(e=>e.init()),this.cell&&this.cell.init()};A8.update=function(e,t){const n=this.cell,i=this.windows,r=e.data,s=i&&i.length;let o;if(n){for(o=e.p0;o<e.i0;++o)n.rem(r[o]);for(o=e.p1;o<e.i1;++o)n.add(r[o]);n.set(t)}for(o=0;o<s;++o)i[o].update(e,t)};function HW(e,t,n){e=e.map(u=>QM(u,u.field));const i={num:0,agg:null,store:!1,count:t};if(!n)for(var r=e.length,s=i.agg=Array(r),o=0;o<r;++o)s[o]=new e[o](i);if(i.store)var a=i.data=new jA;return i.add=function(u){if(i.num+=1,!n){a&&a.add(u);for(let l=0;l<r;++l)s[l].add(s[l].get(u),u)}},i.rem=function(u){if(i.num-=1,!n){a&&a.rem(u);for(let l=0;l<r;++l)s[l].rem(s[l].get(u),u)}},i.set=function(u){let l,c;for(a&&a.values(),l=0,c=t.length;l<c;++l)u[t[l]]=i.num;if(!n)for(l=0,c=s.length;l<c;++l)s[l].set(u)},i.init=function(){i.num=0,a&&a.reset();for(let u=0;u<r;++u)s[u].init()},i}function fE(e){N.call(this,{},e),this._mlen=0,this._mods=[]}fE.Definition={type:"Window",metadata:{modifies:!0},params:[{name:"sort",type:"compare"},{name:"groupby",type:"field",array:!0},{name:"ops",type:"enum",array:!0,values:GW.concat(hh)},{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}]};de(fE,N,{transform(e,t){this.stamp=t.stamp;const n=e.modified(),i=mu(e.sort),r=W2(e.groupby),s=a=>this.group(r(a));let o=this.state;(!o||n)&&(o=this.state=new v8(e)),n||t.modified(o.inputs)?(this.value={},t.visit(t.SOURCE,a=>s(a).add(a))):(t.visit(t.REM,a=>s(a).remove(a)),t.visit(t.ADD,a=>s(a).add(a)));for(let a=0,u=this._mlen;a<u;++a)VW(this._mods[a],o,i,e);return this._mlen=0,this._mods=[],t.reflow(n).modifies(o.outputs)},group(e){let t=this.value[e];return t||(t=this.value[e]=ZM(Z),t.stamp=-1),t.stamp<this.stamp&&(t.stamp=this.stamp,this._mods[this._mlen++]=t),t}});function VW(e,t,n,i){const r=i.sort,s=r&&!i.ignorePeers,o=i.frame||[null,0],a=e.data(n),u=a.length,l=s?uh(r):null,c={i0:0,i1:0,p0:0,p1:0,index:0,data:a,compare:r||Gq(-1)};t.init();for(let f=0;f<u;++f)YW(c,o,f,u),s&&XW(c,l),t.update(c,a[f])}function YW(e,t,n,i){e.p0=e.i0,e.p1=e.i1,e.i0=t[0]==null?0:Math.max(0,n-Math.abs(t[0])),e.i1=t[1]==null?i:Math.min(i,n+Math.abs(t[1])+1),e.index=n}function XW(e,t){const n=e.i0,i=e.i1-1,r=e.compare,s=e.data,o=s.length-1;n>0&&!r(s[n],s[n-1])&&(e.i0=t.left(s,s[n])),i<o&&!r(s[i],s[i+1])&&(e.i1=t.right(s,s[i]))}const KW=Object.freeze(Object.defineProperty({__proto__:null,aggregate:bo,bin:UA,collect:qA,compare:e8,countpattern:WA,cross:GA,density:HA,dotbin:YA,expression:s8,extent:XA,facet:Wm,field:o8,filter:JA,flatten:QA,fold:ZA,formula:eE,generate:a8,impute:tE,joinaggregate:nE,kde:iE,key:u8,load:l8,lookup:rE,multiextent:c8,multivalues:f8,params:d8,pivot:sE,prefacet:h8,project:oE,proxy:g8,quantile:aE,relay:p8,sample:uE,sequence:lE,sieve:m8,subflow:KA,timeunit:cE,tupleindex:b8,values:x8,window:fE},Symbol.toStringTag,{value:"Module"}));function oc(e,t,n){return e.fields=t||[],e.fname=n,e}function JW(e){return e.length===1?QW(e[0]):ZW(e)}const QW=e=>function(t){return t[e]},ZW=e=>{const t=e.length;return function(n){for(let i=0;i<t;++i)n=n[e[i]];return n}};function qf(e){throw Error(e)}function eG(e){const t=[],n=e.length;let i=null,r=0,s="",o,a,u;e=e+"";function l(){t.push(s+e.substring(o,a)),s="",o=a+1}for(o=a=0;a<n;++a)if(u=e[a],u==="\\")s+=e.substring(o,a++),o=a;else if(u===i)l(),i=null,r=-1;else{if(i)continue;o===r&&u==='"'||o===r&&u==="'"?(o=a+1,i=u):u==="."&&!r?a>o?l():o=a+1:u==="["?(a>o&&l(),r=o=a+1):u==="]"&&(r||qf("Access path missing open bracket: "+e),r>0&&l(),r=0,o=a+1)}return r&&qf("Access path missing closing bracket: "+e),i&&qf("Access path missing closing quote: "+e),a>o&&(a++,l()),t}function tG(e,t,n){const i=eG(e);return e=i.length===1?i[0]:e,oc((n&&n.get||JW)(i),[e],t||e)}tG("id");oc(e=>e,[],"identity");oc(()=>0,[],"zero");oc(()=>1,[],"one");const E8=oc(()=>!0,[],"true");oc(()=>!1,[],"false");var Ro=Array.isArray;function FS(e){return e===Object(e)}function w8(e){return e[e.length-1]}function $8(e){return e!=null?Ro(e)?e:[e]:[]}function dE(e){return typeof e=="function"}function C8(e){for(let t,n,i=1,r=arguments.length;i<r;++i){t=arguments[i];for(n in t)e[n]=t[n]}return e}const nG=Object.prototype.hasOwnProperty;function us(e,t){return nG.call(e,t)}function ac(e,t,n){const i=e.prototype=Object.create(t.prototype);return Object.defineProperty(i,"constructor",{value:e,writable:!0,enumerable:!0,configurable:!0}),C8(i,n)}function SS(e){return typeof e=="number"}const iG=1e4;function rG(e){e=+e||iG;let t,n,i;const r=()=>{t={},n={},i=0},s=(o,a)=>(++i>e&&(n=t,t={},i=1),t[o]=a);return r(),{clear:r,has:o=>us(t,o)||us(n,o),get:o=>us(t,o)?t[o]:us(n,o)?s(o,n[o]):void 0,set:(o,a)=>us(t,o)?t[o]=a:s(o,a)}}function sG(e){const t={},n=e.length;for(let i=0;i<n;++i)t[e[i]]=!0;return t}function _e(e){return function(){return e}}const DS=Math.abs,Pt=Math.atan2,ra=Math.cos,oG=Math.max,Ky=Math.min,nr=Math.sin,Fa=Math.sqrt,zt=1e-12,El=Math.PI,zg=El/2,F8=2*El;function aG(e){return e>1?0:e<-1?El:Math.acos(e)}function _S(e){return e>=1?zg:e<=-1?-zg:Math.asin(e)}const G2=Math.PI,H2=2*G2,ba=1e-6,uG=H2-ba;function S8(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function lG(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return S8;const n=10**t;return function(i){this._+=i[0];for(let r=1,s=i.length;r<s;++r)this._+=Math.round(arguments[r]*n)/n+i[r]}}let hE=class{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?S8:lG(t)}moveTo(t,n){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,n){this._append`L${this._x1=+t},${this._y1=+n}`}quadraticCurveTo(t,n,i,r){this._append`Q${+t},${+n},${this._x1=+i},${this._y1=+r}`}bezierCurveTo(t,n,i,r,s,o){this._append`C${+t},${+n},${+i},${+r},${this._x1=+s},${this._y1=+o}`}arcTo(t,n,i,r,s){if(t=+t,n=+n,i=+i,r=+r,s=+s,s<0)throw new Error(`negative radius: ${s}`);let o=this._x1,a=this._y1,u=i-t,l=r-n,c=o-t,f=a-n,d=c*c+f*f;if(this._x1===null)this._append`M${this._x1=t},${this._y1=n}`;else if(d>ba)if(!(Math.abs(f*u-l*c)>ba)||!s)this._append`L${this._x1=t},${this._y1=n}`;else{let h=i-o,g=r-a,p=u*u+l*l,m=h*h+g*g,y=Math.sqrt(p),b=Math.sqrt(d),x=s*Math.tan((G2-Math.acos((p+d-m)/(2*y*b)))/2),v=x/b,A=x/y;Math.abs(v-1)>ba&&this._append`L${t+v*c},${n+v*f}`,this._append`A${s},${s},0,0,${+(f*h>c*g)},${this._x1=t+A*u},${this._y1=n+A*l}`}}arc(t,n,i,r,s,o){if(t=+t,n=+n,i=+i,o=!!o,i<0)throw new Error(`negative radius: ${i}`);let a=i*Math.cos(r),u=i*Math.sin(r),l=t+a,c=n+u,f=1^o,d=o?r-s:s-r;this._x1===null?this._append`M${l},${c}`:(Math.abs(this._x1-l)>ba||Math.abs(this._y1-c)>ba)&&this._append`L${l},${c}`,i&&(d<0&&(d=d%H2+H2),d>uG?this._append`A${i},${i},0,1,${f},${t-a},${n-u}A${i},${i},0,1,${f},${this._x1=l},${this._y1=c}`:d>ba&&this._append`A${i},${i},0,${+(d>=G2)},${f},${this._x1=t+i*Math.cos(s)},${this._y1=n+i*Math.sin(s)}`)}rect(t,n,i,r){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${i=+i}v${+r}h${-i}Z`}toString(){return this._}};function Gm(){return new hE}Gm.prototype=hE.prototype;function Hm(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{const i=Math.floor(n);if(!(i>=0))throw new RangeError(`invalid digits: ${n}`);t=i}return e},()=>new hE(t)}function cG(e){return e.innerRadius}function fG(e){return e.outerRadius}function dG(e){return e.startAngle}function hG(e){return e.endAngle}function gG(e){return e&&e.padAngle}function pG(e,t,n,i,r,s,o,a){var u=n-e,l=i-t,c=o-r,f=a-s,d=f*u-c*l;if(!(d*d<zt))return d=(c*(t-s)-f*(e-r))/d,[e+d*u,t+d*l]}function d0(e,t,n,i,r,s,o){var a=e-n,u=t-i,l=(o?s:-s)/Fa(a*a+u*u),c=l*u,f=-l*a,d=e+c,h=t+f,g=n+c,p=i+f,m=(d+g)/2,y=(h+p)/2,b=g-d,x=p-h,v=b*b+x*x,A=r-s,w=d*p-g*h,E=(x<0?-1:1)*Fa(oG(0,A*A*v-w*w)),$=(w*x-b*E)/v,k=(-w*b-x*E)/v,F=(w*x+b*E)/v,D=(-w*b+x*E)/v,T=$-m,C=k-y,_=F-m,S=D-y;return T*T+C*C>_*_+S*S&&($=F,k=D),{cx:$,cy:k,x01:-c,y01:-f,x11:$*(r/A-1),y11:k*(r/A-1)}}function mG(){var e=cG,t=fG,n=_e(0),i=null,r=dG,s=hG,o=gG,a=null,u=Hm(l);function l(){var c,f,d=+e.apply(this,arguments),h=+t.apply(this,arguments),g=r.apply(this,arguments)-zg,p=s.apply(this,arguments)-zg,m=DS(p-g),y=p>g;if(a||(a=c=u()),h<d&&(f=h,h=d,d=f),!(h>zt))a.moveTo(0,0);else if(m>F8-zt)a.moveTo(h*ra(g),h*nr(g)),a.arc(0,0,h,g,p,!y),d>zt&&(a.moveTo(d*ra(p),d*nr(p)),a.arc(0,0,d,p,g,y));else{var b=g,x=p,v=g,A=p,w=m,E=m,$=o.apply(this,arguments)/2,k=$>zt&&(i?+i.apply(this,arguments):Fa(d*d+h*h)),F=Ky(DS(h-d)/2,+n.apply(this,arguments)),D=F,T=F,C,_;if(k>zt){var S=_S(k/d*nr($)),M=_S(k/h*nr($));(w-=S*2)>zt?(S*=y?1:-1,v+=S,A-=S):(w=0,v=A=(g+p)/2),(E-=M*2)>zt?(M*=y?1:-1,b+=M,x-=M):(E=0,b=x=(g+p)/2)}var O=h*ra(b),B=h*nr(b),I=d*ra(A),G=d*nr(A);if(F>zt){var J=h*ra(x),oe=h*nr(x),be=d*ra(v),ve=d*nr(v),Pe;if(m<El)if(Pe=pG(O,B,be,ve,J,oe,I,G)){var ta=O-Pe[0],na=B-Pe[1],Us=J-Pe[0],H=oe-Pe[1],le=1/nr(aG((ta*Us+na*H)/(Fa(ta*ta+na*na)*Fa(Us*Us+H*H)))/2),ge=Fa(Pe[0]*Pe[0]+Pe[1]*Pe[1]);D=Ky(F,(d-ge)/(le-1)),T=Ky(F,(h-ge)/(le+1))}else D=T=0}E>zt?T>zt?(C=d0(be,ve,O,B,h,T,y),_=d0(J,oe,I,G,h,T,y),a.moveTo(C.cx+C.x01,C.cy+C.y01),T<F?a.arc(C.cx,C.cy,T,Pt(C.y01,C.x01),Pt(_.y01,_.x01),!y):(a.arc(C.cx,C.cy,T,Pt(C.y01,C.x01),Pt(C.y11,C.x11),!y),a.arc(0,0,h,Pt(C.cy+C.y11,C.cx+C.x11),Pt(_.cy+_.y11,_.cx+_.x11),!y),a.arc(_.cx,_.cy,T,Pt(_.y11,_.x11),Pt(_.y01,_.x01),!y))):(a.moveTo(O,B),a.arc(0,0,h,b,x,!y)):a.moveTo(O,B),!(d>zt)||!(w>zt)?a.lineTo(I,G):D>zt?(C=d0(I,G,J,oe,d,-D,y),_=d0(O,B,be,ve,d,-D,y),a.lineTo(C.cx+C.x01,C.cy+C.y01),D<F?a.arc(C.cx,C.cy,D,Pt(C.y01,C.x01),Pt(_.y01,_.x01),!y):(a.arc(C.cx,C.cy,D,Pt(C.y01,C.x01),Pt(C.y11,C.x11),!y),a.arc(0,0,d,Pt(C.cy+C.y11,C.cx+C.x11),Pt(_.cy+_.y11,_.cx+_.x11),y),a.arc(_.cx,_.cy,D,Pt(_.y11,_.x11),Pt(_.y01,_.x01),!y))):a.arc(0,0,d,A,v,y)}if(a.closePath(),c)return a=null,c+""||null}return l.centroid=function(){var c=(+e.apply(this,arguments)+ +t.apply(this,arguments))/2,f=(+r.apply(this,arguments)+ +s.apply(this,arguments))/2-El/2;return[ra(f)*c,nr(f)*c]},l.innerRadius=function(c){return arguments.length?(e=typeof c=="function"?c:_e(+c),l):e},l.outerRadius=function(c){return arguments.length?(t=typeof c=="function"?c:_e(+c),l):t},l.cornerRadius=function(c){return arguments.length?(n=typeof c=="function"?c:_e(+c),l):n},l.padRadius=function(c){return arguments.length?(i=c==null?null:typeof c=="function"?c:_e(+c),l):i},l.startAngle=function(c){return arguments.length?(r=typeof c=="function"?c:_e(+c),l):r},l.endAngle=function(c){return arguments.length?(s=typeof c=="function"?c:_e(+c),l):s},l.padAngle=function(c){return arguments.length?(o=typeof c=="function"?c:_e(+c),l):o},l.context=function(c){return arguments.length?(a=c??null,l):a},l}function D8(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function _8(e){this._context=e}_8.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function gE(e){return new _8(e)}function k8(e){return e[0]}function M8(e){return e[1]}function O8(e,t){var n=_e(!0),i=null,r=gE,s=null,o=Hm(a);e=typeof e=="function"?e:e===void 0?k8:_e(e),t=typeof t=="function"?t:t===void 0?M8:_e(t);function a(u){var l,c=(u=D8(u)).length,f,d=!1,h;for(i==null&&(s=r(h=o())),l=0;l<=c;++l)!(l<c&&n(f=u[l],l,u))===d&&((d=!d)?s.lineStart():s.lineEnd()),d&&s.point(+e(f,l,u),+t(f,l,u));if(h)return s=null,h+""||null}return a.x=function(u){return arguments.length?(e=typeof u=="function"?u:_e(+u),a):e},a.y=function(u){return arguments.length?(t=typeof u=="function"?u:_e(+u),a):t},a.defined=function(u){return arguments.length?(n=typeof u=="function"?u:_e(!!u),a):n},a.curve=function(u){return arguments.length?(r=u,i!=null&&(s=r(i)),a):r},a.context=function(u){return arguments.length?(u==null?i=s=null:s=r(i=u),a):i},a}function N8(e,t,n){var i=null,r=_e(!0),s=null,o=gE,a=null,u=Hm(l);e=typeof e=="function"?e:e===void 0?k8:_e(+e),t=typeof t=="function"?t:_e(t===void 0?0:+t),n=typeof n=="function"?n:n===void 0?M8:_e(+n);function l(f){var d,h,g,p=(f=D8(f)).length,m,y=!1,b,x=new Array(p),v=new Array(p);for(s==null&&(a=o(b=u())),d=0;d<=p;++d){if(!(d<p&&r(m=f[d],d,f))===y)if(y=!y)h=d,a.areaStart(),a.lineStart();else{for(a.lineEnd(),a.lineStart(),g=d-1;g>=h;--g)a.point(x[g],v[g]);a.lineEnd(),a.areaEnd()}y&&(x[d]=+e(m,d,f),v[d]=+t(m,d,f),a.point(i?+i(m,d,f):x[d],n?+n(m,d,f):v[d]))}if(b)return a=null,b+""||null}function c(){return O8().defined(r).curve(o).context(s)}return l.x=function(f){return arguments.length?(e=typeof f=="function"?f:_e(+f),i=null,l):e},l.x0=function(f){return arguments.length?(e=typeof f=="function"?f:_e(+f),l):e},l.x1=function(f){return arguments.length?(i=f==null?null:typeof f=="function"?f:_e(+f),l):i},l.y=function(f){return arguments.length?(t=typeof f=="function"?f:_e(+f),n=null,l):t},l.y0=function(f){return arguments.length?(t=typeof f=="function"?f:_e(+f),l):t},l.y1=function(f){return arguments.length?(n=f==null?null:typeof f=="function"?f:_e(+f),l):n},l.lineX0=l.lineY0=function(){return c().x(e).y(t)},l.lineY1=function(){return c().x(e).y(n)},l.lineX1=function(){return c().x(i).y(t)},l.defined=function(f){return arguments.length?(r=typeof f=="function"?f:_e(!!f),l):r},l.curve=function(f){return arguments.length?(o=f,s!=null&&(a=o(s)),l):o},l.context=function(f){return arguments.length?(f==null?s=a=null:a=o(s=f),l):s},l}const yG={draw(e,t){const n=Fa(t/El);e.moveTo(n,0),e.arc(0,0,n,0,F8)}};function bG(e,t){let n=null,i=Hm(r);e=typeof e=="function"?e:_e(e||yG),t=typeof t=="function"?t:_e(t===void 0?64:+t);function r(){let s;if(n||(n=s=i()),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),s)return n=null,s+""||null}return r.type=function(s){return arguments.length?(e=typeof s=="function"?s:_e(s),r):e},r.size=function(s){return arguments.length?(t=typeof s=="function"?s:_e(+s),r):t},r.context=function(s){return arguments.length?(n=s??null,r):n},r}function xo(){}function jg(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function Vm(e){this._context=e}Vm.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:jg(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:jg(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function xG(e){return new Vm(e)}function T8(e){this._context=e}T8.prototype={areaStart:xo,areaEnd:xo,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:jg(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function vG(e){return new T8(e)}function B8(e){this._context=e}B8.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+e)/6,i=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,i):this._context.moveTo(n,i);break;case 3:this._point=4;default:jg(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function AG(e){return new B8(e)}function R8(e,t){this._basis=new Vm(e),this._beta=t}R8.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var e=this._x,t=this._y,n=e.length-1;if(n>0)for(var i=e[0],r=t[0],s=e[n]-i,o=t[n]-r,a=-1,u;++a<=n;)u=a/n,this._basis.point(this._beta*e[a]+(1-this._beta)*(i+u*s),this._beta*t[a]+(1-this._beta)*(r+u*o));this._x=this._y=null,this._basis.lineEnd()},point:function(e,t){this._x.push(+e),this._y.push(+t)}};const EG=function e(t){function n(i){return t===1?new Vm(i):new R8(i,t)}return n.beta=function(i){return e(+i)},n}(.85);function Ug(e,t,n){e._context.bezierCurveTo(e._x1+e._k*(e._x2-e._x0),e._y1+e._k*(e._y2-e._y0),e._x2+e._k*(e._x1-t),e._y2+e._k*(e._y1-n),e._x2,e._y2)}function pE(e,t){this._context=e,this._k=(1-t)/6}pE.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:Ug(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2,this._x1=e,this._y1=t;break;case 2:this._point=3;default:Ug(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const wG=function e(t){function n(i){return new pE(i,t)}return n.tension=function(i){return e(+i)},n}(0);function mE(e,t){this._context=e,this._k=(1-t)/6}mE.prototype={areaStart:xo,areaEnd:xo,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:Ug(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const $G=function e(t){function n(i){return new mE(i,t)}return n.tension=function(i){return e(+i)},n}(0);function yE(e,t){this._context=e,this._k=(1-t)/6}yE.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:Ug(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const CG=function e(t){function n(i){return new yE(i,t)}return n.tension=function(i){return e(+i)},n}(0);function bE(e,t,n){var i=e._x1,r=e._y1,s=e._x2,o=e._y2;if(e._l01_a>zt){var a=2*e._l01_2a+3*e._l01_a*e._l12_a+e._l12_2a,u=3*e._l01_a*(e._l01_a+e._l12_a);i=(i*a-e._x0*e._l12_2a+e._x2*e._l01_2a)/u,r=(r*a-e._y0*e._l12_2a+e._y2*e._l01_2a)/u}if(e._l23_a>zt){var l=2*e._l23_2a+3*e._l23_a*e._l12_a+e._l12_2a,c=3*e._l23_a*(e._l23_a+e._l12_a);s=(s*l+e._x1*e._l23_2a-t*e._l12_2a)/c,o=(o*l+e._y1*e._l23_2a-n*e._l12_2a)/c}e._context.bezierCurveTo(i,r,s,o,e._x2,e._y2)}function L8(e,t){this._context=e,this._alpha=t}L8.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,i=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+i*i,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3;default:bE(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const FG=function e(t){function n(i){return t?new L8(i,t):new pE(i,0)}return n.alpha=function(i){return e(+i)},n}(.5);function P8(e,t){this._context=e,this._alpha=t}P8.prototype={areaStart:xo,areaEnd:xo,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,i=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+i*i,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:bE(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const SG=function e(t){function n(i){return t?new P8(i,t):new mE(i,0)}return n.alpha=function(i){return e(+i)},n}(.5);function I8(e,t){this._context=e,this._alpha=t}I8.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,i=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+i*i,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:bE(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const DG=function e(t){function n(i){return t?new I8(i,t):new yE(i,0)}return n.alpha=function(i){return e(+i)},n}(.5);function z8(e){this._context=e}z8.prototype={areaStart:xo,areaEnd:xo,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function _G(e){return new z8(e)}function kS(e){return e<0?-1:1}function MS(e,t,n){var i=e._x1-e._x0,r=t-e._x1,s=(e._y1-e._y0)/(i||r<0&&-0),o=(n-e._y1)/(r||i<0&&-0),a=(s*r+o*i)/(i+r);return(kS(s)+kS(o))*Math.min(Math.abs(s),Math.abs(o),.5*Math.abs(a))||0}function OS(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function Jy(e,t,n){var i=e._x0,r=e._y0,s=e._x1,o=e._y1,a=(s-i)/3;e._context.bezierCurveTo(i+a,r+a*t,s-a,o-a*n,s,o)}function qg(e){this._context=e}qg.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:Jy(this,this._t0,OS(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,Jy(this,OS(this,n=MS(this,e,t)),n);break;default:Jy(this,this._t0,n=MS(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function j8(e){this._context=new U8(e)}(j8.prototype=Object.create(qg.prototype)).point=function(e,t){qg.prototype.point.call(this,t,e)};function U8(e){this._context=e}U8.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,i,r,s){this._context.bezierCurveTo(t,e,i,n,s,r)}};function kG(e){return new qg(e)}function MG(e){return new j8(e)}function q8(e){this._context=e}q8.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),n===2)this._context.lineTo(e[1],t[1]);else for(var i=NS(e),r=NS(t),s=0,o=1;o<n;++s,++o)this._context.bezierCurveTo(i[0][s],r[0][s],i[1][s],r[1][s],e[o],t[o]);(this._line||this._line!==0&&n===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}};function NS(e){var t,n=e.length-1,i,r=new Array(n),s=new Array(n),o=new Array(n);for(r[0]=0,s[0]=2,o[0]=e[0]+2*e[1],t=1;t<n-1;++t)r[t]=1,s[t]=4,o[t]=4*e[t]+2*e[t+1];for(r[n-1]=2,s[n-1]=7,o[n-1]=8*e[n-1]+e[n],t=1;t<n;++t)i=r[t]/s[t-1],s[t]-=i,o[t]-=i*o[t-1];for(r[n-1]=o[n-1]/s[n-1],t=n-2;t>=0;--t)r[t]=(o[t]-r[t+1])/s[t];for(s[n-1]=(e[n]+r[n-1])/2,t=0;t<n-1;++t)s[t]=2*e[t+1]-r[t+1];return[r,s]}function OG(e){return new q8(e)}function Ym(e,t){this._context=e,this._t=t}Ym.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}break}}this._x=e,this._y=t}};function NG(e){return new Ym(e,.5)}function TG(e){return new Ym(e,0)}function BG(e){return new Ym(e,1)}function co(e,t){if(typeof document<"u"&&document.createElement){const n=document.createElement("canvas");if(n&&n.getContext)return n.width=e,n.height=t,n}return null}const RG=()=>typeof Image<"u"?Image:null;function uc(e,t,n){return e.fields=t||[],e.fname=n,e}function LG(e){return e.length===1?PG(e[0]):IG(e)}const PG=e=>function(t){return t[e]},IG=e=>{const t=e.length;return function(n){for(let i=0;i<t;++i)n=n[e[i]];return n}};function eg(e){throw Error(e)}function zG(e){const t=[],n=e.length;let i=null,r=0,s="",o,a,u;e=e+"";function l(){t.push(s+e.substring(o,a)),s="",o=a+1}for(o=a=0;a<n;++a)if(u=e[a],u==="\\")s+=e.substring(o,a++),o=a;else if(u===i)l(),i=null,r=-1;else{if(i)continue;o===r&&u==='"'||o===r&&u==="'"?(o=a+1,i=u):u==="."&&!r?a>o?l():o=a+1:u==="["?(a>o&&l(),r=o=a+1):u==="]"&&(r||eg("Access path missing open bracket: "+e),r>0&&l(),r=0,o=a+1)}return r&&eg("Access path missing closing bracket: "+e),i&&eg("Access path missing closing quote: "+e),a>o&&(a++,l()),t}function jG(e,t,n){const i=zG(e);return e=i.length===1?i[0]:e,uc((n&&n.get||LG)(i),[e],t||e)}jG("id");uc(e=>e,[],"identity");uc(()=>0,[],"zero");uc(()=>1,[],"one");uc(()=>!0,[],"true");uc(()=>!1,[],"false");var W8=Array.isArray;function UG(e){return e===Object(e)}function vo(e){return e[e.length-1]}function qG(e){return e==null||e===""?null:+e}function WG(e){return e!=null?W8(e)?e:[e]:[]}function GG(e){return typeof e=="function"}function HG(e){return GG(e)?e:()=>e}function VG(e){return typeof e=="number"}function G8(e){return typeof e=="string"}function YG(e){return e&&vo(e)-e[0]||0}function XG(e){const t={},n=e.length;for(let i=0;i<n;++i)t[e[i]]=!0;return t}function Nr(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function Lo(e,t){switch(arguments.length){case 0:break;case 1:{typeof e=="function"?this.interpolator(e):this.range(e);break}default:{this.domain(e),typeof t=="function"?this.interpolator(t):this.range(t);break}}return this}const V2=Symbol("implicit");function xE(){var e=new VF,t=[],n=[],i=V2;function r(s){let o=e.get(s);if(o===void 0){if(i!==V2)return i;e.set(s,o=t.push(s)-1)}return n[o%n.length]}return r.domain=function(s){if(!arguments.length)return t.slice();t=[],e=new VF;for(const o of s)e.has(o)||e.set(o,t.push(o)-1);return r},r.range=function(s){return arguments.length?(n=Array.from(s),r):n.slice()},r.unknown=function(s){return arguments.length?(i=s,r):i},r.copy=function(){return xE(t,n).unknown(i)},Nr.apply(r,arguments),r}function lc(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function gh(e,t){var n=Object.create(e.prototype);for(var i in t)n[i]=t[i];return n}function Po(){}var Va=.7,wl=1/Va,rl="\\s*([+-]?\\d+)\\s*",Ad="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",pr="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",KG=/^#([0-9a-f]{3,8})$/,JG=new RegExp(`^rgb\\(${rl},${rl},${rl}\\)$`),QG=new RegExp(`^rgb\\(${pr},${pr},${pr}\\)$`),ZG=new RegExp(`^rgba\\(${rl},${rl},${rl},${Ad}\\)$`),eH=new RegExp(`^rgba\\(${pr},${pr},${pr},${Ad}\\)$`),tH=new RegExp(`^hsl\\(${Ad},${pr},${pr}\\)$`),nH=new RegExp(`^hsla\\(${Ad},${pr},${pr},${Ad}\\)$`),TS={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};lc(Po,Ed,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:BS,formatHex:BS,formatHex8:iH,formatHsl:rH,formatRgb:RS,toString:RS});function BS(){return this.rgb().formatHex()}function iH(){return this.rgb().formatHex8()}function rH(){return H8(this).formatHsl()}function RS(){return this.rgb().formatRgb()}function Ed(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=KG.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?LS(t):n===3?new At(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?h0(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?h0(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=JG.exec(e))?new At(t[1],t[2],t[3],1):(t=QG.exec(e))?new At(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=ZG.exec(e))?h0(t[1],t[2],t[3],t[4]):(t=eH.exec(e))?h0(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=tH.exec(e))?zS(t[1],t[2]/100,t[3]/100,1):(t=nH.exec(e))?zS(t[1],t[2]/100,t[3]/100,t[4]):TS.hasOwnProperty(e)?LS(TS[e]):e==="transparent"?new At(NaN,NaN,NaN,0):null}function LS(e){return new At(e>>16&255,e>>8&255,e&255,1)}function h0(e,t,n,i){return i<=0&&(e=t=n=NaN),new At(e,t,n,i)}function vE(e){return e instanceof Po||(e=Ed(e)),e?(e=e.rgb(),new At(e.r,e.g,e.b,e.opacity)):new At}function Ao(e,t,n,i){return arguments.length===1?vE(e):new At(e,t,n,i??1)}function At(e,t,n,i){this.r=+e,this.g=+t,this.b=+n,this.opacity=+i}lc(At,Ao,gh(Po,{brighter(e){return e=e==null?wl:Math.pow(wl,e),new At(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Va:Math.pow(Va,e),new At(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new At(Ra(this.r),Ra(this.g),Ra(this.b),Wg(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:PS,formatHex:PS,formatHex8:sH,formatRgb:IS,toString:IS}));function PS(){return`#${Sa(this.r)}${Sa(this.g)}${Sa(this.b)}`}function sH(){return`#${Sa(this.r)}${Sa(this.g)}${Sa(this.b)}${Sa((isNaN(this.opacity)?1:this.opacity)*255)}`}function IS(){const e=Wg(this.opacity);return`${e===1?"rgb(":"rgba("}${Ra(this.r)}, ${Ra(this.g)}, ${Ra(this.b)}${e===1?")":`, ${e})`}`}function Wg(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Ra(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Sa(e){return e=Ra(e),(e<16?"0":"")+e.toString(16)}function zS(e,t,n,i){return i<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Mi(e,t,n,i)}function H8(e){if(e instanceof Mi)return new Mi(e.h,e.s,e.l,e.opacity);if(e instanceof Po||(e=Ed(e)),!e)return new Mi;if(e instanceof Mi)return e;e=e.rgb();var t=e.r/255,n=e.g/255,i=e.b/255,r=Math.min(t,n,i),s=Math.max(t,n,i),o=NaN,a=s-r,u=(s+r)/2;return a?(t===s?o=(n-i)/a+(n<i)*6:n===s?o=(i-t)/a+2:o=(t-n)/a+4,a/=u<.5?s+r:2-s-r,o*=60):a=u>0&&u<1?0:o,new Mi(o,a,u,e.opacity)}function Gg(e,t,n,i){return arguments.length===1?H8(e):new Mi(e,t,n,i??1)}function Mi(e,t,n,i){this.h=+e,this.s=+t,this.l=+n,this.opacity=+i}lc(Mi,Gg,gh(Po,{brighter(e){return e=e==null?wl:Math.pow(wl,e),new Mi(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Va:Math.pow(Va,e),new Mi(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,i=n+(n<.5?n:1-n)*t,r=2*n-i;return new At(Qy(e>=240?e-240:e+120,r,i),Qy(e,r,i),Qy(e<120?e+240:e-120,r,i),this.opacity)},clamp(){return new Mi(jS(this.h),g0(this.s),g0(this.l),Wg(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=Wg(this.opacity);return`${e===1?"hsl(":"hsla("}${jS(this.h)}, ${g0(this.s)*100}%, ${g0(this.l)*100}%${e===1?")":`, ${e})`}`}}));function jS(e){return e=(e||0)%360,e<0?e+360:e}function g0(e){return Math.max(0,Math.min(1,e||0))}function Qy(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const V8=Math.PI/180,Y8=180/Math.PI,Hg=18,X8=.96422,K8=1,J8=.82521,Q8=4/29,sl=6/29,Z8=3*sl*sl,oH=sl*sl*sl;function eO(e){if(e instanceof mr)return new mr(e.l,e.a,e.b,e.opacity);if(e instanceof hs)return tO(e);e instanceof At||(e=vE(e));var t=nb(e.r),n=nb(e.g),i=nb(e.b),r=Zy((.2225045*t+.7168786*n+.0606169*i)/K8),s,o;return t===n&&n===i?s=o=r:(s=Zy((.4360747*t+.3850649*n+.1430804*i)/X8),o=Zy((.0139322*t+.0971045*n+.7141733*i)/J8)),new mr(116*r-16,500*(s-r),200*(r-o),e.opacity)}function Vg(e,t,n,i){return arguments.length===1?eO(e):new mr(e,t,n,i??1)}function mr(e,t,n,i){this.l=+e,this.a=+t,this.b=+n,this.opacity=+i}lc(mr,Vg,gh(Po,{brighter(e){return new mr(this.l+Hg*(e??1),this.a,this.b,this.opacity)},darker(e){return new mr(this.l-Hg*(e??1),this.a,this.b,this.opacity)},rgb(){var e=(this.l+16)/116,t=isNaN(this.a)?e:e+this.a/500,n=isNaN(this.b)?e:e-this.b/200;return t=X8*eb(t),e=K8*eb(e),n=J8*eb(n),new At(tb(3.1338561*t-1.6168667*e-.4906146*n),tb(-.9787684*t+1.9161415*e+.033454*n),tb(.0719453*t-.2289914*e+1.4052427*n),this.opacity)}}));function Zy(e){return e>oH?Math.pow(e,1/3):e/Z8+Q8}function eb(e){return e>sl?e*e*e:Z8*(e-Q8)}function tb(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function nb(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function aH(e){if(e instanceof hs)return new hs(e.h,e.c,e.l,e.opacity);if(e instanceof mr||(e=eO(e)),e.a===0&&e.b===0)return new hs(NaN,0<e.l&&e.l<100?0:NaN,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*Y8;return new hs(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}function Yg(e,t,n,i){return arguments.length===1?aH(e):new hs(e,t,n,i??1)}function hs(e,t,n,i){this.h=+e,this.c=+t,this.l=+n,this.opacity=+i}function tO(e){if(isNaN(e.h))return new mr(e.l,0,0,e.opacity);var t=e.h*V8;return new mr(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}lc(hs,Yg,gh(Po,{brighter(e){return new hs(this.h,this.c,this.l+Hg*(e??1),this.opacity)},darker(e){return new hs(this.h,this.c,this.l-Hg*(e??1),this.opacity)},rgb(){return tO(this).rgb()}}));var nO=-.14861,AE=1.78277,EE=-.29227,Xm=-.90649,wd=1.97294,US=wd*Xm,qS=wd*AE,WS=AE*EE-Xm*nO;function uH(e){if(e instanceof La)return new La(e.h,e.s,e.l,e.opacity);e instanceof At||(e=vE(e));var t=e.r/255,n=e.g/255,i=e.b/255,r=(WS*i+US*t-qS*n)/(WS+US-qS),s=i-r,o=(wd*(n-r)-EE*s)/Xm,a=Math.sqrt(o*o+s*s)/(wd*r*(1-r)),u=a?Math.atan2(o,s)*Y8-120:NaN;return new La(u<0?u+360:u,a,r,e.opacity)}function Y2(e,t,n,i){return arguments.length===1?uH(e):new La(e,t,n,i??1)}function La(e,t,n,i){this.h=+e,this.s=+t,this.l=+n,this.opacity=+i}lc(La,Y2,gh(Po,{brighter(e){return e=e==null?wl:Math.pow(wl,e),new La(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Va:Math.pow(Va,e),new La(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=isNaN(this.h)?0:(this.h+120)*V8,t=+this.l,n=isNaN(this.s)?0:this.s*t*(1-t),i=Math.cos(e),r=Math.sin(e);return new At(255*(t+n*(nO*i+AE*r)),255*(t+n*(EE*i+Xm*r)),255*(t+n*(wd*i)),this.opacity)}}));function iO(e,t,n,i,r){var s=e*e,o=s*e;return((1-3*e+3*s-o)*t+(4-6*s+3*o)*n+(1+3*e+3*s-3*o)*i+o*r)/6}function rO(e){var t=e.length-1;return function(n){var i=n<=0?n=0:n>=1?(n=1,t-1):Math.floor(n*t),r=e[i],s=e[i+1],o=i>0?e[i-1]:2*r-s,a=i<t-1?e[i+2]:2*s-r;return iO((n-i/t)*t,o,r,s,a)}}function sO(e){var t=e.length;return function(n){var i=Math.floor(((n%=1)<0?++n:n)*t),r=e[(i+t-1)%t],s=e[i%t],o=e[(i+1)%t],a=e[(i+2)%t];return iO((n-i/t)*t,r,s,o,a)}}const Km=e=>()=>e;function oO(e,t){return function(n){return e+n*t}}function lH(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(i){return Math.pow(e+i*t,n)}}function Jm(e,t){var n=t-e;return n?oO(e,n>180||n<-180?n-360*Math.round(n/360):n):Km(isNaN(e)?t:e)}function cH(e){return(e=+e)==1?Et:function(t,n){return n-t?lH(t,n,e):Km(isNaN(t)?n:t)}}function Et(e,t){var n=t-e;return n?oO(e,n):Km(isNaN(e)?t:e)}const X2=function e(t){var n=cH(t);function i(r,s){var o=n((r=Ao(r)).r,(s=Ao(s)).r),a=n(r.g,s.g),u=n(r.b,s.b),l=Et(r.opacity,s.opacity);return function(c){return r.r=o(c),r.g=a(c),r.b=u(c),r.opacity=l(c),r+""}}return i.gamma=e,i}(1);function aO(e){return function(t){var n=t.length,i=new Array(n),r=new Array(n),s=new Array(n),o,a;for(o=0;o<n;++o)a=Ao(t[o]),i[o]=a.r||0,r[o]=a.g||0,s[o]=a.b||0;return i=e(i),r=e(r),s=e(s),a.opacity=1,function(u){return a.r=i(u),a.g=r(u),a.b=s(u),a+""}}}var fH=aO(rO),dH=aO(sO);function wE(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,i=t.slice(),r;return function(s){for(r=0;r<n;++r)i[r]=e[r]*(1-s)+t[r]*s;return i}}function uO(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function hH(e,t){return(uO(t)?wE:lO)(e,t)}function lO(e,t){var n=t?t.length:0,i=e?Math.min(n,e.length):0,r=new Array(i),s=new Array(n),o;for(o=0;o<i;++o)r[o]=Io(e[o],t[o]);for(;o<n;++o)s[o]=t[o];return function(a){for(o=0;o<i;++o)s[o]=r[o](a);return s}}function cO(e,t){var n=new Date;return e=+e,t=+t,function(i){return n.setTime(e*(1-i)+t*i),n}}function Di(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function fO(e,t){var n={},i={},r;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(r in t)r in e?n[r]=Io(e[r],t[r]):i[r]=t[r];return function(s){for(r in n)i[r]=n[r](s);return i}}var K2=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,ib=new RegExp(K2.source,"g");function gH(e){return function(){return e}}function pH(e){return function(t){return e(t)+""}}function dO(e,t){var n=K2.lastIndex=ib.lastIndex=0,i,r,s,o=-1,a=[],u=[];for(e=e+"",t=t+"";(i=K2.exec(e))&&(r=ib.exec(t));)(s=r.index)>n&&(s=t.slice(n,s),a[o]?a[o]+=s:a[++o]=s),(i=i[0])===(r=r[0])?a[o]?a[o]+=r:a[++o]=r:(a[++o]=null,u.push({i:o,x:Di(i,r)})),n=ib.lastIndex;return n<t.length&&(s=t.slice(n),a[o]?a[o]+=s:a[++o]=s),a.length<2?u[0]?pH(u[0].x):gH(t):(t=u.length,function(l){for(var c=0,f;c<t;++c)a[(f=u[c]).i]=f.x(l);return a.join("")})}function Io(e,t){var n=typeof t,i;return t==null||n==="boolean"?Km(t):(n==="number"?Di:n==="string"?(i=Ed(t))?(t=i,X2):dO:t instanceof Ed?X2:t instanceof Date?cO:uO(t)?wE:Array.isArray(t)?lO:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?fO:Di)(e,t)}function mH(e){var t=e.length;return function(n){return e[Math.max(0,Math.min(t-1,Math.floor(n*t)))]}}function yH(e,t){var n=Jm(+e,+t);return function(i){var r=n(i);return r-360*Math.floor(r/360)}}function ph(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}var GS=180/Math.PI,J2={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function hO(e,t,n,i,r,s){var o,a,u;return(o=Math.sqrt(e*e+t*t))&&(e/=o,t/=o),(u=e*n+t*i)&&(n-=e*u,i-=t*u),(a=Math.sqrt(n*n+i*i))&&(n/=a,i/=a,u/=a),e*i<t*n&&(e=-e,t=-t,u=-u,o=-o),{translateX:r,translateY:s,rotate:Math.atan2(t,e)*GS,skewX:Math.atan(u)*GS,scaleX:o,scaleY:a}}var p0;function bH(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?J2:hO(t.a,t.b,t.c,t.d,t.e,t.f)}function xH(e){return e==null||(p0||(p0=document.createElementNS("http://www.w3.org/2000/svg","g")),p0.setAttribute("transform",e),!(e=p0.transform.baseVal.consolidate()))?J2:(e=e.matrix,hO(e.a,e.b,e.c,e.d,e.e,e.f))}function gO(e,t,n,i){function r(l){return l.length?l.pop()+" ":""}function s(l,c,f,d,h,g){if(l!==f||c!==d){var p=h.push("translate(",null,t,null,n);g.push({i:p-4,x:Di(l,f)},{i:p-2,x:Di(c,d)})}else(f||d)&&h.push("translate("+f+t+d+n)}function o(l,c,f,d){l!==c?(l-c>180?c+=360:c-l>180&&(l+=360),d.push({i:f.push(r(f)+"rotate(",null,i)-2,x:Di(l,c)})):c&&f.push(r(f)+"rotate("+c+i)}function a(l,c,f,d){l!==c?d.push({i:f.push(r(f)+"skewX(",null,i)-2,x:Di(l,c)}):c&&f.push(r(f)+"skewX("+c+i)}function u(l,c,f,d,h,g){if(l!==f||c!==d){var p=h.push(r(h)+"scale(",null,",",null,")");g.push({i:p-4,x:Di(l,f)},{i:p-2,x:Di(c,d)})}else(f!==1||d!==1)&&h.push(r(h)+"scale("+f+","+d+")")}return function(l,c){var f=[],d=[];return l=e(l),c=e(c),s(l.translateX,l.translateY,c.translateX,c.translateY,f,d),o(l.rotate,c.rotate,f,d),a(l.skewX,c.skewX,f,d),u(l.scaleX,l.scaleY,c.scaleX,c.scaleY,f,d),l=c=null,function(h){for(var g=-1,p=d.length,m;++g<p;)f[(m=d[g]).i]=m.x(h);return f.join("")}}}var vH=gO(bH,"px, ","px)","deg)"),AH=gO(xH,", ",")",")"),EH=1e-12;function HS(e){return((e=Math.exp(e))+1/e)/2}function wH(e){return((e=Math.exp(e))-1/e)/2}function $H(e){return((e=Math.exp(2*e))-1)/(e+1)}const CH=function e(t,n,i){function r(s,o){var a=s[0],u=s[1],l=s[2],c=o[0],f=o[1],d=o[2],h=c-a,g=f-u,p=h*h+g*g,m,y;if(p<EH)y=Math.log(d/l)/t,m=function(E){return[a+E*h,u+E*g,l*Math.exp(t*E*y)]};else{var b=Math.sqrt(p),x=(d*d-l*l+i*p)/(2*l*n*b),v=(d*d-l*l-i*p)/(2*d*n*b),A=Math.log(Math.sqrt(x*x+1)-x),w=Math.log(Math.sqrt(v*v+1)-v);y=(w-A)/t,m=function(E){var $=E*y,k=HS(A),F=l/(n*b)*(k*$H(t*$+A)-wH(A));return[a+F*h,u+F*g,l*k/HS(t*$+A)]}}return m.duration=y*1e3*t/Math.SQRT2,m}return r.rho=function(s){var o=Math.max(.001,+s),a=o*o,u=a*a;return e(o,a,u)},r}(Math.SQRT2,2,4);function pO(e){return function(t,n){var i=e((t=Gg(t)).h,(n=Gg(n)).h),r=Et(t.s,n.s),s=Et(t.l,n.l),o=Et(t.opacity,n.opacity);return function(a){return t.h=i(a),t.s=r(a),t.l=s(a),t.opacity=o(a),t+""}}}const FH=pO(Jm);var SH=pO(Et);function DH(e,t){var n=Et((e=Vg(e)).l,(t=Vg(t)).l),i=Et(e.a,t.a),r=Et(e.b,t.b),s=Et(e.opacity,t.opacity);return function(o){return e.l=n(o),e.a=i(o),e.b=r(o),e.opacity=s(o),e+""}}function mO(e){return function(t,n){var i=e((t=Yg(t)).h,(n=Yg(n)).h),r=Et(t.c,n.c),s=Et(t.l,n.l),o=Et(t.opacity,n.opacity);return function(a){return t.h=i(a),t.c=r(a),t.l=s(a),t.opacity=o(a),t+""}}}const _H=mO(Jm);var kH=mO(Et);function yO(e){return function t(n){n=+n;function i(r,s){var o=e((r=Y2(r)).h,(s=Y2(s)).h),a=Et(r.s,s.s),u=Et(r.l,s.l),l=Et(r.opacity,s.opacity);return function(c){return r.h=o(c),r.s=a(c),r.l=u(Math.pow(c,n)),r.opacity=l(c),r+""}}return i.gamma=t,i}(1)}const MH=yO(Jm);var OH=yO(Et);function $E(e,t){t===void 0&&(t=e,e=Io);for(var n=0,i=t.length-1,r=t[0],s=new Array(i<0?0:i);n<i;)s[n]=e(r,r=t[++n]);return function(o){var a=Math.max(0,Math.min(i-1,Math.floor(o*=i)));return s[a](o-a)}}function NH(e,t){for(var n=new Array(t),i=0;i<t;++i)n[i]=e(i/(t-1));return n}const TH=Object.freeze(Object.defineProperty({__proto__:null,interpolate:Io,interpolateArray:hH,interpolateBasis:rO,interpolateBasisClosed:sO,interpolateCubehelix:MH,interpolateCubehelixLong:OH,interpolateDate:cO,interpolateDiscrete:mH,interpolateHcl:_H,interpolateHclLong:kH,interpolateHsl:FH,interpolateHslLong:SH,interpolateHue:yH,interpolateLab:DH,interpolateNumber:Di,interpolateNumberArray:wE,interpolateObject:fO,interpolateRgb:X2,interpolateRgbBasis:fH,interpolateRgbBasisClosed:dH,interpolateRound:ph,interpolateString:dO,interpolateTransformCss:vH,interpolateTransformSvg:AH,interpolateZoom:CH,piecewise:$E,quantize:NH},Symbol.toStringTag,{value:"Module"}));function BH(e){return function(){return e}}function Q2(e){return+e}var VS=[0,1];function Nn(e){return e}function Z2(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:BH(isNaN(t)?NaN:.5)}function RH(e,t){var n;return e>t&&(n=e,e=t,t=n),function(i){return Math.max(e,Math.min(t,i))}}function LH(e,t,n){var i=e[0],r=e[1],s=t[0],o=t[1];return r<i?(i=Z2(r,i),s=n(o,s)):(i=Z2(i,r),s=n(s,o)),function(a){return s(i(a))}}function PH(e,t,n){var i=Math.min(e.length,t.length)-1,r=new Array(i),s=new Array(i),o=-1;for(e[i]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++o<i;)r[o]=Z2(e[o],e[o+1]),s[o]=n(t[o],t[o+1]);return function(a){var u=lh(e,a,1,i)-1;return s[u](r[u](a))}}function mh(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function Qm(){var e=VS,t=VS,n=Io,i,r,s,o=Nn,a,u,l;function c(){var d=Math.min(e.length,t.length);return o!==Nn&&(o=RH(e[0],e[d-1])),a=d>2?PH:LH,u=l=null,f}function f(d){return d==null||isNaN(d=+d)?s:(u||(u=a(e.map(i),t,n)))(i(o(d)))}return f.invert=function(d){return o(r((l||(l=a(t,e.map(i),Di)))(d)))},f.domain=function(d){return arguments.length?(e=Array.from(d,Q2),c()):e.slice()},f.range=function(d){return arguments.length?(t=Array.from(d),c()):t.slice()},f.rangeRound=function(d){return t=Array.from(d),n=ph,c()},f.clamp=function(d){return arguments.length?(o=d?!0:Nn,c()):o!==Nn},f.interpolate=function(d){return arguments.length?(n=d,c()):n},f.unknown=function(d){return arguments.length?(s=d,f):s},function(d,h){return i=d,r=h,c()}}function bO(){return Qm()(Nn,Nn)}function xO(e,t,n,i){var r=yo(e,t,n),s;switch(i=Ha(i??",f"),i.type){case"s":{var o=Math.max(Math.abs(e),Math.abs(t));return i.precision==null&&!isNaN(s=M6(r,o))&&(i.precision=s),aA(i,o)}case"":case"e":case"g":case"p":case"r":{i.precision==null&&!isNaN(s=O6(r,Math.max(Math.abs(e),Math.abs(t))))&&(i.precision=s-(i.type==="e"));break}case"f":case"%":{i.precision==null&&!isNaN(s=k6(r))&&(i.precision=s-(i.type==="%")*2);break}}return Sm(i)}function bu(e){var t=e.domain;return e.ticks=function(n){var i=t();return M2(i[0],i[i.length-1],n??10)},e.tickFormat=function(n,i){var r=t();return xO(r[0],r[r.length-1],n??10,i)},e.nice=function(n){n==null&&(n=10);var i=t(),r=0,s=i.length-1,o=i[r],a=i[s],u,l,c=10;for(a<o&&(l=o,o=a,a=l,l=r,r=s,s=l);c-- >0;){if(l=O2(o,a,n),l===u)return i[r]=o,i[s]=a,t(i);if(l>0)o=Math.floor(o/l)*l,a=Math.ceil(a/l)*l;else if(l<0)o=Math.ceil(o*l)/l,a=Math.floor(a*l)/l;else break;u=l}return e},e}function vO(){var e=bO();return e.copy=function(){return mh(e,vO())},Nr.apply(e,arguments),bu(e)}function AO(e){var t;function n(i){return i==null||isNaN(i=+i)?t:i}return n.invert=n,n.domain=n.range=function(i){return arguments.length?(e=Array.from(i,Q2),n):e.slice()},n.unknown=function(i){return arguments.length?(t=i,n):t},n.copy=function(){return AO(e).unknown(t)},e=arguments.length?Array.from(e,Q2):[0,1],bu(n)}function EO(e,t){e=e.slice();var n=0,i=e.length-1,r=e[n],s=e[i],o;return s<r&&(o=n,n=i,i=o,o=r,r=s,s=o),e[n]=t.floor(r),e[i]=t.ceil(s),e}function YS(e){return Math.log(e)}function XS(e){return Math.exp(e)}function IH(e){return-Math.log(-e)}function zH(e){return-Math.exp(-e)}function jH(e){return isFinite(e)?+("1e"+e):e<0?0:e}function UH(e){return e===10?jH:e===Math.E?Math.exp:t=>Math.pow(e,t)}function qH(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function KS(e){return(t,n)=>-e(-t,n)}function CE(e){const t=e(YS,XS),n=t.domain;let i=10,r,s;function o(){return r=qH(i),s=UH(i),n()[0]<0?(r=KS(r),s=KS(s),e(IH,zH)):e(YS,XS),t}return t.base=function(a){return arguments.length?(i=+a,o()):i},t.domain=function(a){return arguments.length?(n(a),o()):n()},t.ticks=a=>{const u=n();let l=u[0],c=u[u.length-1];const f=c<l;f&&([l,c]=[c,l]);let d=r(l),h=r(c),g,p;const m=a==null?10:+a;let y=[];if(!(i%1)&&h-d<m){if(d=Math.floor(d),h=Math.ceil(h),l>0){for(;d<=h;++d)for(g=1;g<i;++g)if(p=d<0?g/s(-d):g*s(d),!(p<l)){if(p>c)break;y.push(p)}}else for(;d<=h;++d)for(g=i-1;g>=1;--g)if(p=d>0?g/s(-d):g*s(d),!(p<l)){if(p>c)break;y.push(p)}y.length*2<m&&(y=M2(l,c,m))}else y=M2(d,h,Math.min(h-d,m)).map(s);return f?y.reverse():y},t.tickFormat=(a,u)=>{if(a==null&&(a=10),u==null&&(u=i===10?"s":","),typeof u!="function"&&(!(i%1)&&(u=Ha(u)).precision==null&&(u.trim=!0),u=Sm(u)),a===1/0)return u;const l=Math.max(1,i*a/t.ticks().length);return c=>{let f=c/s(Math.round(r(c)));return f*i<i-.5&&(f*=i),f<=l?u(c):""}},t.nice=()=>n(EO(n(),{floor:a=>s(Math.floor(r(a))),ceil:a=>s(Math.ceil(r(a)))})),t}function wO(){const e=CE(Qm()).domain([1,10]);return e.copy=()=>mh(e,wO()).base(e.base()),Nr.apply(e,arguments),e}function JS(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function QS(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function FE(e){var t=1,n=e(JS(t),QS(t));return n.constant=function(i){return arguments.length?e(JS(t=+i),QS(t)):t},bu(n)}function $O(){var e=FE(Qm());return e.copy=function(){return mh(e,$O()).constant(e.constant())},Nr.apply(e,arguments)}function ZS(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function WH(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function GH(e){return e<0?-e*e:e*e}function SE(e){var t=e(Nn,Nn),n=1;function i(){return n===1?e(Nn,Nn):n===.5?e(WH,GH):e(ZS(n),ZS(1/n))}return t.exponent=function(r){return arguments.length?(n=+r,i()):n},bu(t)}function DE(){var e=SE(Qm());return e.copy=function(){return mh(e,DE()).exponent(e.exponent())},Nr.apply(e,arguments),e}function HH(){return DE.apply(null,arguments).exponent(.5)}function CO(){var e=[],t=[],n=[],i;function r(){var o=0,a=Math.max(1,t.length);for(n=new Array(a-1);++o<a;)n[o-1]=$6(e,o/a);return s}function s(o){return o==null||isNaN(o=+o)?i:t[lh(n,o)]}return s.invertExtent=function(o){var a=t.indexOf(o);return a<0?[NaN,NaN]:[a>0?n[a-1]:e[0],a<n.length?n[a]:e[e.length-1]]},s.domain=function(o){if(!arguments.length)return e.slice();e=[];for(let a of o)a!=null&&!isNaN(a=+a)&&e.push(a);return e.sort(ms),r()},s.range=function(o){return arguments.length?(t=Array.from(o),r()):t.slice()},s.unknown=function(o){return arguments.length?(i=o,s):i},s.quantiles=function(){return n.slice()},s.copy=function(){return CO().domain(e).range(t).unknown(i)},Nr.apply(s,arguments)}function FO(){var e=0,t=1,n=1,i=[.5],r=[0,1],s;function o(u){return u!=null&&u<=u?r[lh(i,u,0,n)]:s}function a(){var u=-1;for(i=new Array(n);++u<n;)i[u]=((u+1)*t-(u-n)*e)/(n+1);return o}return o.domain=function(u){return arguments.length?([e,t]=u,e=+e,t=+t,a()):[e,t]},o.range=function(u){return arguments.length?(n=(r=Array.from(u)).length-1,a()):r.slice()},o.invertExtent=function(u){var l=r.indexOf(u);return l<0?[NaN,NaN]:l<1?[e,i[0]]:l>=n?[i[n-1],t]:[i[l-1],i[l]]},o.unknown=function(u){return arguments.length&&(s=u),o},o.thresholds=function(){return i.slice()},o.copy=function(){return FO().domain([e,t]).range(r).unknown(s)},Nr.apply(bu(o),arguments)}function SO(){var e=[.5],t=[0,1],n,i=1;function r(s){return s!=null&&s<=s?t[lh(e,s,0,i)]:n}return r.domain=function(s){return arguments.length?(e=Array.from(s),i=Math.min(e.length,t.length-1),r):e.slice()},r.range=function(s){return arguments.length?(t=Array.from(s),i=Math.min(e.length,t.length-1),r):t.slice()},r.invertExtent=function(s){var o=t.indexOf(s);return[e[o-1],e[o]]},r.unknown=function(s){return arguments.length?(n=s,r):n},r.copy=function(){return SO().domain(e).range(t).unknown(n)},Nr.apply(r,arguments)}function VH(e){return new Date(e)}function YH(e){return e instanceof Date?+e:+new Date(+e)}function _E(e,t,n,i,r,s,o,a,u,l){var c=bO(),f=c.invert,d=c.domain,h=l(".%L"),g=l(":%S"),p=l("%I:%M"),m=l("%I %p"),y=l("%a %d"),b=l("%b %d"),x=l("%B"),v=l("%Y");function A(w){return(u(w)<w?h:a(w)<w?g:o(w)<w?p:s(w)<w?m:i(w)<w?r(w)<w?y:b:n(w)<w?x:v)(w)}return c.invert=function(w){return new Date(f(w))},c.domain=function(w){return arguments.length?d(Array.from(w,YH)):d().map(VH)},c.ticks=function(w){var E=d();return e(E[0],E[E.length-1],w??10)},c.tickFormat=function(w,E){return E==null?A:l(E)},c.nice=function(w){var E=d();return(!w||typeof w.range!="function")&&(w=t(E[0],E[E.length-1],w??10)),w?d(EO(E,w)):c},c.copy=function(){return mh(c,_E(e,t,n,i,r,s,o,a,u,l))},c}function XH(){return Nr.apply(_E(fj,dj,wr,gd,ec,ys,km,Dm,ds,dA).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function KH(){return Nr.apply(_E(lj,cj,$r,pd,tc,uo,Mm,_m,ds,hA).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function Zm(){var e=0,t=1,n,i,r,s,o=Nn,a=!1,u;function l(f){return f==null||isNaN(f=+f)?u:o(r===0?.5:(f=(s(f)-n)*r,a?Math.max(0,Math.min(1,f)):f))}l.domain=function(f){return arguments.length?([e,t]=f,n=s(e=+e),i=s(t=+t),r=n===i?0:1/(i-n),l):[e,t]},l.clamp=function(f){return arguments.length?(a=!!f,l):a},l.interpolator=function(f){return arguments.length?(o=f,l):o};function c(f){return function(d){var h,g;return arguments.length?([h,g]=d,o=f(h,g),l):[o(0),o(1)]}}return l.range=c(Io),l.rangeRound=c(ph),l.unknown=function(f){return arguments.length?(u=f,l):u},function(f){return s=f,n=f(e),i=f(t),r=n===i?0:1/(i-n),l}}function zo(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function kE(){var e=bu(Zm()(Nn));return e.copy=function(){return zo(e,kE())},Lo.apply(e,arguments)}function DO(){var e=CE(Zm()).domain([1,10]);return e.copy=function(){return zo(e,DO()).base(e.base())},Lo.apply(e,arguments)}function _O(){var e=FE(Zm());return e.copy=function(){return zo(e,_O()).constant(e.constant())},Lo.apply(e,arguments)}function ME(){var e=SE(Zm());return e.copy=function(){return zo(e,ME()).exponent(e.exponent())},Lo.apply(e,arguments)}function JH(){return ME.apply(null,arguments).exponent(.5)}function e1(){var e=0,t=.5,n=1,i=1,r,s,o,a,u,l=Nn,c,f=!1,d;function h(p){return isNaN(p=+p)?d:(p=.5+((p=+c(p))-s)*(i*p<i*s?a:u),l(f?Math.max(0,Math.min(1,p)):p))}h.domain=function(p){return arguments.length?([e,t,n]=p,r=c(e=+e),s=c(t=+t),o=c(n=+n),a=r===s?0:.5/(s-r),u=s===o?0:.5/(o-s),i=s<r?-1:1,h):[e,t,n]},h.clamp=function(p){return arguments.length?(f=!!p,h):f},h.interpolator=function(p){return arguments.length?(l=p,h):l};function g(p){return function(m){var y,b,x;return arguments.length?([y,b,x]=m,l=$E(p,[y,b,x]),h):[l(0),l(.5),l(1)]}}return h.range=g(Io),h.rangeRound=g(ph),h.unknown=function(p){return arguments.length?(d=p,h):d},function(p){return c=p,r=p(e),s=p(t),o=p(n),a=r===s?0:.5/(s-r),u=s===o?0:.5/(o-s),i=s<r?-1:1,h}}function kO(){var e=bu(e1()(Nn));return e.copy=function(){return zo(e,kO())},Lo.apply(e,arguments)}function MO(){var e=CE(e1()).domain([.1,1,10]);return e.copy=function(){return zo(e,MO()).base(e.base())},Lo.apply(e,arguments)}function OO(){var e=FE(e1());return e.copy=function(){return zo(e,OO()).constant(e.constant())},Lo.apply(e,arguments)}function OE(){var e=SE(e1());return e.copy=function(){return zo(e,OE()).exponent(e.exponent())},Lo.apply(e,arguments)}function QH(){return OE.apply(null,arguments).exponent(.5)}function NE(e,t,n){const i=e-t+n*2;return e?i>0?i:1:0}const ZH="identity",$l="linear",Cs="log",yh="pow",bh="sqrt",t1="symlog",Ya="time",Xa="utc",yr="sequential",cc="diverging",Cl="quantile",n1="quantize",i1="threshold",TE="ordinal",ex="point",NO="band",BE="bin-ordinal",bt="continuous",xh="discrete",vh="discretizing",vi="interpolating",RE="temporal";function eV(e){return function(t){let n=t[0],i=t[1],r;return i<n&&(r=n,n=i,i=r),[e.invert(n),e.invert(i)]}}function tV(e){return function(t){const n=e.range();let i=t[0],r=t[1],s=-1,o,a,u,l;for(r<i&&(a=i,i=r,r=a),u=0,l=n.length;u<l;++u)n[u]>=i&&n[u]<=r&&(s<0&&(s=u),o=u);if(!(s<0))return i=e.invertExtent(n[s]),r=e.invertExtent(n[o]),[i[0]===void 0?i[1]:i[0],r[1]===void 0?r[0]:r[1]]}}function LE(){const e=xE().unknown(void 0),t=e.domain,n=e.range;let i=[0,1],r,s,o=!1,a=0,u=0,l=.5;delete e.unknown;function c(){const f=t().length,d=i[1]<i[0],h=i[1-d],g=NE(f,a,u);let p=i[d-0];r=(h-p)/(g||1),o&&(r=Math.floor(r)),p+=(h-p-r*(f-a))*l,s=r*(1-a),o&&(p=Math.round(p),s=Math.round(s));const m=Kn(f).map(y=>p+r*y);return n(d?m.reverse():m)}return e.domain=function(f){return arguments.length?(t(f),c()):t()},e.range=function(f){return arguments.length?(i=[+f[0],+f[1]],c()):i.slice()},e.rangeRound=function(f){return i=[+f[0],+f[1]],o=!0,c()},e.bandwidth=function(){return s},e.step=function(){return r},e.round=function(f){return arguments.length?(o=!!f,c()):o},e.padding=function(f){return arguments.length?(u=Math.max(0,Math.min(1,f)),a=u,c()):a},e.paddingInner=function(f){return arguments.length?(a=Math.max(0,Math.min(1,f)),c()):a},e.paddingOuter=function(f){return arguments.length?(u=Math.max(0,Math.min(1,f)),c()):u},e.align=function(f){return arguments.length?(l=Math.max(0,Math.min(1,f)),c()):l},e.invertRange=function(f){if(f[0]==null||f[1]==null)return;const d=i[1]<i[0],h=d?n().reverse():n(),g=h.length-1;let p=+f[0],m=+f[1],y,b,x;if(!(p!==p||m!==m)&&(m<p&&(x=p,p=m,m=x),!(m<h[0]||p>i[1-d])))return y=Math.max(0,Og(h,p)-1),b=p===m?y:Og(h,m)-1,p-h[y]>s+1e-10&&++y,d&&(x=y,y=g-b,b=g-x),y>b?void 0:t().slice(y,b+1)},e.invert=function(f){const d=e.invertRange([f,f]);return d&&d[0]},e.copy=function(){return LE().domain(t()).range(i).round(o).paddingInner(a).paddingOuter(u).align(l)},c()}function TO(e){const t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,e.copy=function(){return TO(t())},e}function nV(){return TO(LE().paddingInner(1))}var iV=Array.prototype.map;function rV(e){return iV.call(e,qG)}const sV=Array.prototype.slice;function BO(){let e=[],t=[];function n(i){return i==null||i!==i?void 0:t[(lh(e,i)-1)%t.length]}return n.domain=function(i){return arguments.length?(e=rV(i),n):e.slice()},n.range=function(i){return arguments.length?(t=sV.call(i),n):t.slice()},n.tickFormat=function(i,r){return xO(e[0],vo(e),i??10,r)},n.copy=function(){return BO().domain(n.domain()).range(n.range())},n}const Xg=new Map,RO=Symbol("vega_scale");function LO(e){return e[RO]=!0,e}function oV(e){return e&&e[RO]===!0}function aV(e,t,n){const i=function(){const s=t();return s.invertRange||(s.invertRange=s.invert?eV(s):s.invertExtent?tV(s):void 0),s.type=e,LO(s)};return i.metadata=XG(WG(n)),i}function Fe(e,t,n){return arguments.length>1?(Xg.set(e,aV(e,t,n)),this):PO(e)?Xg.get(e):void 0}Fe(ZH,AO);Fe($l,vO,bt);Fe(Cs,wO,[bt,Cs]);Fe(yh,DE,bt);Fe(bh,HH,bt);Fe(t1,$O,bt);Fe(Ya,XH,[bt,RE]);Fe(Xa,KH,[bt,RE]);Fe(yr,kE,[bt,vi]);Fe(`${yr}-${$l}`,kE,[bt,vi]);Fe(`${yr}-${Cs}`,DO,[bt,vi,Cs]);Fe(`${yr}-${yh}`,ME,[bt,vi]);Fe(`${yr}-${bh}`,JH,[bt,vi]);Fe(`${yr}-${t1}`,_O,[bt,vi]);Fe(`${cc}-${$l}`,kO,[bt,vi]);Fe(`${cc}-${Cs}`,MO,[bt,vi,Cs]);Fe(`${cc}-${yh}`,OE,[bt,vi]);Fe(`${cc}-${bh}`,QH,[bt,vi]);Fe(`${cc}-${t1}`,OO,[bt,vi]);Fe(Cl,CO,[vh,Cl]);Fe(n1,FO,vh);Fe(i1,SO,vh);Fe(BE,BO,[xh,vh]);Fe(TE,xE,xh);Fe(NO,LE,xh);Fe(ex,nV,xh);function PO(e){return Xg.has(e)}function xu(e,t){const n=Xg.get(e);return n&&n.metadata[t]}function PE(e){return xu(e,bt)}function Fl(e){return xu(e,xh)}function tx(e){return xu(e,vh)}function IO(e){return xu(e,Cs)}function uV(e){return xu(e,RE)}function zO(e){return xu(e,vi)}function jO(e){return xu(e,Cl)}const lV=["clamp","base","constant","exponent"];function UO(e,t){const n=t[0],i=vo(t)-n;return function(r){return e(n+r*i)}}function r1(e,t,n){return $E(IE(t||"rgb",n),e)}function qO(e,t){const n=new Array(t),i=t+1;for(let r=0;r<t;)n[r]=e(++r/i);return n}function WO(e,t,n){const i=n-t;let r,s,o;return!i||!Number.isFinite(i)?HG(.5):(r=(s=e.type).indexOf("-"),s=r<0?s:s.slice(r+1),o=Fe(s)().domain([t,n]).range([0,1]),lV.forEach(a=>e[a]?o[a](e[a]()):0),o)}function IE(e,t){const n=TH[cV(e)];return t!=null&&n&&n.gamma?n.gamma(t):n}function cV(e){return"interpolate"+e.toLowerCase().split("-").map(t=>t[0].toUpperCase()+t.slice(1)).join("")}const fV={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"},dV={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"};function GO(e){const t=e.length/6|0,n=new Array(t);for(let i=0;i<t;)n[i]="#"+e.slice(i*6,++i*6);return n}function HO(e,t){for(const n in e)zE(n,t(e[n]))}const eD={};HO(dV,GO);HO(fV,e=>r1(GO(e)));function zE(e,t){return e=e&&e.toLowerCase(),arguments.length>1?(eD[e]=t,this):eD[e]}const tg="symbol",hV="discrete",gV="gradient",pV=e=>W8(e)?e.map(t=>String(t)):String(e),mV=(e,t)=>e[1]-t[1],yV=(e,t)=>t[1]-e[1];function jE(e,t,n){let i;return VG(t)&&(e.bins&&(t=Math.max(t,e.bins.length)),n!=null&&(t=Math.min(t,Math.floor(YG(e.domain())/n||1)))),UG(t)&&(i=t.step,t=t.interval),G8(t)&&(t=e.type===Ya?nc(t):e.type==Xa?ic(t):eg("Only time and utc scales accept interval strings."),i&&(t=t.every(i))),t}function VO(e,t,n){let i=e.range(),r=i[0],s=vo(i),o=mV;if(r>s&&(i=s,s=r,r=i,o=yV),r=Math.floor(r),s=Math.ceil(s),t=t.map(a=>[a,e(a)]).filter(a=>r<=a[1]&&a[1]<=s).sort(o).map(a=>a[0]),n>0&&t.length>1){const a=[t[0],vo(t)];for(;t.length>n&&t.length>=3;)t=t.filter((u,l)=>!(l%2));t.length<3&&(t=a)}return t}function UE(e,t){return e.bins?VO(e,e.bins):e.ticks?e.ticks(t):e.domain()}function YO(e,t,n,i,r,s){const o=t.type;let a=pV;if(o===Ya||r===Ya)a=e.timeFormat(i);else if(o===Xa||r===Xa)a=e.utcFormat(i);else if(IO(o)){const u=e.formatFloat(i);if(s||t.bins)a=u;else{const l=XO(t,n,!1);a=c=>l(c)?u(c):""}}else if(t.tickFormat){const u=t.domain();a=e.formatSpan(u[0],u[u.length-1],n,i)}else i&&(a=e.format(i));return a}function XO(e,t,n){const i=UE(e,t),r=e.base(),s=Math.log(r),o=Math.max(1,r*t/i.length),a=u=>{let l=u/Math.pow(r,Math.round(Math.log(u)/s));return l*r<r-.5&&(l*=r),l<=o};return n?i.filter(a):a}const nx={[Cl]:"quantiles",[n1]:"thresholds",[i1]:"domain"},KO={[Cl]:"quantiles",[n1]:"domain"};function JO(e,t){return e.bins?vV(e.bins):e.type===Cs?XO(e,t,!0):nx[e.type]?xV(e[nx[e.type]]()):UE(e,t)}function bV(e,t,n){const i=t[KO[t.type]](),r=i.length;let s=r>1?i[1]-i[0]:i[0],o;for(o=1;o<r;++o)s=Math.min(s,i[o]-i[o-1]);return e.formatSpan(0,s,3*10,n)}function xV(e){const t=[-1/0].concat(e);return t.max=1/0,t}function vV(e){const t=e.slice(0,-1);return t.max=vo(e),t}const AV=e=>nx[e.type]||e.bins;function QO(e,t,n,i,r,s,o){const a=KO[t.type]&&s!==Ya&&s!==Xa?bV(e,t,r):YO(e,t,n,r,s,o);return i===tg&&AV(t)?EV(a):i===hV?wV(a):$V(a)}const EV=e=>(t,n,i)=>{const r=tD(i[n+1],tD(i.max,1/0)),s=nD(t,e),o=nD(r,e);return s&&o?s+" "+o:o?"< "+o:"≥ "+s},tD=(e,t)=>e??t,wV=e=>(t,n)=>n?e(t):null,$V=e=>t=>e(t),nD=(e,t)=>Number.isFinite(e)?t(e):null;function CV(e){const t=e.domain(),n=t.length-1;let i=+t[0],r=+vo(t),s=r-i;if(e.type===i1){const o=n?s/n:.1;i-=o,r+=o,s=r-i}return o=>(o-i)/s}function FV(e,t,n,i){const r=i||t.type;return G8(n)&&uV(r)&&(n=n.replace(/%a/g,"%A").replace(/%b/g,"%B")),!n&&r===Ya?e.timeFormat("%A, %d %B %Y, %X"):!n&&r===Xa?e.utcFormat("%A, %d %B %Y, %X UTC"):QO(e,t,5,null,n,i,!0)}function ZO(e,t,n){n=n||{};const i=Math.max(3,n.maxlen||7),r=FV(e,t,n.format,n.formatType);if(tx(t.type)){const s=JO(t).slice(1).map(r),o=s.length;return`${o} boundar${o===1?"y":"ies"}: ${s.join(", ")}`}else if(Fl(t.type)){const s=t.domain(),o=s.length,a=o>i?s.slice(0,i-2).map(r).join(", ")+", ending with "+s.slice(-1).map(r):s.map(r).join(", ");return`${o} value${o===1?"":"s"}: ${a}`}else{const s=t.domain();return`values from ${r(s[0])} to ${r(vo(s))}`}}let e9=0;function SV(){e9=0}const Kg="p_";function qE(e){return e&&e.gradient}function t9(e,t,n){const i=e.gradient;let r=e.id,s=i==="radial"?Kg:"";return r||(r=e.id="gradient_"+e9++,i==="radial"?(e.x1=ir(e.x1,.5),e.y1=ir(e.y1,.5),e.r1=ir(e.r1,0),e.x2=ir(e.x2,.5),e.y2=ir(e.y2,.5),e.r2=ir(e.r2,.5),s=Kg):(e.x1=ir(e.x1,0),e.y1=ir(e.y1,0),e.x2=ir(e.x2,1),e.y2=ir(e.y2,0))),t[r]=e,"url("+(n||"")+"#"+s+r+")"}function ir(e,t){return e??t}function n9(e,t){var n=[],i;return i={gradient:"linear",x1:e?e[0]:0,y1:e?e[1]:0,x2:t?t[0]:1,y2:t?t[1]:0,stops:n,stop:function(r,s){return n.push({offset:r,color:s}),i}}}const iD={basis:{curve:xG},"basis-closed":{curve:vG},"basis-open":{curve:AG},bundle:{curve:EG,tension:"beta",value:.85},cardinal:{curve:wG,tension:"tension",value:0},"cardinal-open":{curve:CG,tension:"tension",value:0},"cardinal-closed":{curve:$G,tension:"tension",value:0},"catmull-rom":{curve:FG,tension:"alpha",value:.5},"catmull-rom-closed":{curve:SG,tension:"alpha",value:.5},"catmull-rom-open":{curve:DG,tension:"alpha",value:.5},linear:{curve:gE},"linear-closed":{curve:_G},monotone:{horizontal:MG,vertical:kG},natural:{curve:OG},step:{curve:NG},"step-after":{curve:BG},"step-before":{curve:TG}};function WE(e,t,n){var i=us(iD,e)&&iD[e],r=null;return i&&(r=i.curve||i[t||"vertical"],i.tension&&n!=null&&(r=r[i.tension](n))),r}const DV={m:2,l:2,h:1,v:1,z:0,c:6,s:4,q:4,t:2,a:7},_V=/[mlhvzcsqta]([^mlhvzcsqta]+|$)/gi,kV=/^[+-]?(([0-9]*\.[0-9]+)|([0-9]+\.)|([0-9]+))([eE][+-]?[0-9]+)?/,MV=/^((\s+,?\s*)|(,\s*))/,OV=/^[01]/;function Sl(e){const t=[];return(e.match(_V)||[]).forEach(i=>{let r=i[0];const s=r.toLowerCase(),o=DV[s],a=NV(s,o,i.slice(1).trim()),u=a.length;if(u<o||u&&u%o!==0)throw Error("Invalid SVG path, incorrect parameter count");if(t.push([r,...a.slice(0,o)]),u!==o){s==="m"&&(r=r==="M"?"L":"l");for(let l=o;l<u;l+=o)t.push([r,...a.slice(l,l+o)])}}),t}function NV(e,t,n){const i=[];for(let r=0;t&&r<n.length;)for(let s=0;s<t;++s){const o=e==="a"&&(s===3||s===4)?OV:kV,a=n.slice(r).match(o);if(a===null)throw Error("Invalid SVG path, incorrect parameter type");r+=a[0].length,i.push(+a[0]);const u=n.slice(r).match(MV);u!==null&&(r+=u[0].length)}return i}const Eo=Math.PI/180,TV=1e-14,Aa=Math.PI/2,ur=Math.PI*2,Ru=Math.sqrt(3)/2;var rb={},sb={},i9=[].join;function BV(e,t,n,i,r,s,o,a,u){const l=i9.call(arguments);if(rb[l])return rb[l];const c=o*Eo,f=Math.sin(c),d=Math.cos(c);n=Math.abs(n),i=Math.abs(i);const h=d*(a-e)*.5+f*(u-t)*.5,g=d*(u-t)*.5-f*(a-e)*.5;let p=h*h/(n*n)+g*g/(i*i);p>1&&(p=Math.sqrt(p),n*=p,i*=p);const m=d/n,y=f/n,b=-f/i,x=d/i,v=m*a+y*u,A=b*a+x*u,w=m*e+y*t,E=b*e+x*t;let k=1/((w-v)*(w-v)+(E-A)*(E-A))-.25;k<0&&(k=0);let F=Math.sqrt(k);s==r&&(F=-F);const D=.5*(v+w)-F*(E-A),T=.5*(A+E)+F*(w-v),C=Math.atan2(A-T,v-D);let S=Math.atan2(E-T,w-D)-C;S<0&&s===1?S+=ur:S>0&&s===0&&(S-=ur);const M=Math.ceil(Math.abs(S/(Aa+.001))),O=[];for(let B=0;B<M;++B){const I=C+B*S/M,G=C+(B+1)*S/M;O[B]=[D,T,I,G,n,i,f,d]}return rb[l]=O}function RV(e){const t=i9.call(e);if(sb[t])return sb[t];var n=e[0],i=e[1],r=e[2],s=e[3],o=e[4],a=e[5],u=e[6],l=e[7];const c=l*o,f=-u*a,d=u*o,h=l*a,g=Math.cos(r),p=Math.sin(r),m=Math.cos(s),y=Math.sin(s),b=.5*(s-r),x=Math.sin(b*.5),v=8/3*x*x/Math.sin(b),A=n+g-v*p,w=i+p+v*g,E=n+m,$=i+y,k=E+v*y,F=$-v*m;return sb[t]=[c*A+f*w,d*A+h*w,c*k+f*F,d*k+h*F,c*E+f*$,d*E+h*$]}const ri=["l",0,0,0,0,0,0,0];function LV(e,t,n){const i=ri[0]=e[0];if(i==="a"||i==="A")ri[1]=t*e[1],ri[2]=n*e[2],ri[3]=e[3],ri[4]=e[4],ri[5]=e[5],ri[6]=t*e[6],ri[7]=n*e[7];else if(i==="h"||i==="H")ri[1]=t*e[1];else if(i==="v"||i==="V")ri[1]=n*e[1];else for(var r=1,s=e.length;r<s;++r)ri[r]=(r%2==1?t:n)*e[r];return ri}function $d(e,t,n,i,r,s){var o,a=null,u=0,l=0,c=0,f=0,d,h,g,p,m=0,y=0;n==null&&(n=0),i==null&&(i=0),r==null&&(r=1),s==null&&(s=r),e.beginPath&&e.beginPath();for(var b=0,x=t.length;b<x;++b){switch(o=t[b],(r!==1||s!==1)&&(o=LV(o,r,s)),o[0]){case"l":u+=o[1],l+=o[2],e.lineTo(u+n,l+i);break;case"L":u=o[1],l=o[2],e.lineTo(u+n,l+i);break;case"h":u+=o[1],e.lineTo(u+n,l+i);break;case"H":u=o[1],e.lineTo(u+n,l+i);break;case"v":l+=o[1],e.lineTo(u+n,l+i);break;case"V":l=o[1],e.lineTo(u+n,l+i);break;case"m":u+=o[1],l+=o[2],m=u,y=l,e.moveTo(u+n,l+i);break;case"M":u=o[1],l=o[2],m=u,y=l,e.moveTo(u+n,l+i);break;case"c":d=u+o[5],h=l+o[6],c=u+o[3],f=l+o[4],e.bezierCurveTo(u+o[1]+n,l+o[2]+i,c+n,f+i,d+n,h+i),u=d,l=h;break;case"C":u=o[5],l=o[6],c=o[3],f=o[4],e.bezierCurveTo(o[1]+n,o[2]+i,c+n,f+i,u+n,l+i);break;case"s":d=u+o[3],h=l+o[4],c=2*u-c,f=2*l-f,e.bezierCurveTo(c+n,f+i,u+o[1]+n,l+o[2]+i,d+n,h+i),c=u+o[1],f=l+o[2],u=d,l=h;break;case"S":d=o[3],h=o[4],c=2*u-c,f=2*l-f,e.bezierCurveTo(c+n,f+i,o[1]+n,o[2]+i,d+n,h+i),u=d,l=h,c=o[1],f=o[2];break;case"q":d=u+o[3],h=l+o[4],c=u+o[1],f=l+o[2],e.quadraticCurveTo(c+n,f+i,d+n,h+i),u=d,l=h;break;case"Q":d=o[3],h=o[4],e.quadraticCurveTo(o[1]+n,o[2]+i,d+n,h+i),u=d,l=h,c=o[1],f=o[2];break;case"t":d=u+o[1],h=l+o[2],a[0].match(/[QqTt]/)===null?(c=u,f=l):a[0]==="t"?(c=2*u-g,f=2*l-p):a[0]==="q"&&(c=2*u-c,f=2*l-f),g=c,p=f,e.quadraticCurveTo(c+n,f+i,d+n,h+i),u=d,l=h,c=u+o[1],f=l+o[2];break;case"T":d=o[1],h=o[2],c=2*u-c,f=2*l-f,e.quadraticCurveTo(c+n,f+i,d+n,h+i),u=d,l=h;break;case"a":rD(e,u+n,l+i,[o[1],o[2],o[3],o[4],o[5],o[6]+u+n,o[7]+l+i]),u+=o[6],l+=o[7];break;case"A":rD(e,u+n,l+i,[o[1],o[2],o[3],o[4],o[5],o[6]+n,o[7]+i]),u=o[6],l=o[7];break;case"z":case"Z":u=m,l=y,e.closePath();break}a=o}}function rD(e,t,n,i){const r=BV(i[5],i[6],i[0],i[1],i[3],i[4],i[2],t,n);for(let s=0;s<r.length;++s){const o=RV(r[s]);e.bezierCurveTo(o[0],o[1],o[2],o[3],o[4],o[5])}}const sD=.5773502691896257,oD={circle:{draw:function(e,t){const n=Math.sqrt(t)/2;e.moveTo(n,0),e.arc(0,0,n,0,ur)}},cross:{draw:function(e,t){var n=Math.sqrt(t)/2,i=n/2.5;e.moveTo(-n,-i),e.lineTo(-n,i),e.lineTo(-i,i),e.lineTo(-i,n),e.lineTo(i,n),e.lineTo(i,i),e.lineTo(n,i),e.lineTo(n,-i),e.lineTo(i,-i),e.lineTo(i,-n),e.lineTo(-i,-n),e.lineTo(-i,-i),e.closePath()}},diamond:{draw:function(e,t){const n=Math.sqrt(t)/2;e.moveTo(-n,0),e.lineTo(0,-n),e.lineTo(n,0),e.lineTo(0,n),e.closePath()}},square:{draw:function(e,t){var n=Math.sqrt(t),i=-n/2;e.rect(i,i,n,n)}},arrow:{draw:function(e,t){var n=Math.sqrt(t)/2,i=n/7,r=n/2.5,s=n/8;e.moveTo(-i,n),e.lineTo(i,n),e.lineTo(i,-s),e.lineTo(r,-s),e.lineTo(0,-n),e.lineTo(-r,-s),e.lineTo(-i,-s),e.closePath()}},wedge:{draw:function(e,t){var n=Math.sqrt(t)/2,i=Ru*n,r=i-n*sD,s=n/4;e.moveTo(0,-i-r),e.lineTo(-s,i-r),e.lineTo(s,i-r),e.closePath()}},triangle:{draw:function(e,t){var n=Math.sqrt(t)/2,i=Ru*n,r=i-n*sD;e.moveTo(0,-i-r),e.lineTo(-n,i-r),e.lineTo(n,i-r),e.closePath()}},"triangle-up":{draw:function(e,t){var n=Math.sqrt(t)/2,i=Ru*n;e.moveTo(0,-i),e.lineTo(-n,i),e.lineTo(n,i),e.closePath()}},"triangle-down":{draw:function(e,t){var n=Math.sqrt(t)/2,i=Ru*n;e.moveTo(0,i),e.lineTo(-n,-i),e.lineTo(n,-i),e.closePath()}},"triangle-right":{draw:function(e,t){var n=Math.sqrt(t)/2,i=Ru*n;e.moveTo(i,0),e.lineTo(-i,-n),e.lineTo(-i,n),e.closePath()}},"triangle-left":{draw:function(e,t){var n=Math.sqrt(t)/2,i=Ru*n;e.moveTo(-i,0),e.lineTo(i,-n),e.lineTo(i,n),e.closePath()}},stroke:{draw:function(e,t){const n=Math.sqrt(t)/2;e.moveTo(-n,0),e.lineTo(n,0)}}};function r9(e){return us(oD,e)?oD[e]:PV(e)}var ob={};function PV(e){if(!us(ob,e)){const t=Sl(e);ob[e]={draw:function(n,i){$d(n,t,0,0,Math.sqrt(i)/2)}}}return ob[e]}const qs=.448084975506;function IV(e){return e.x}function zV(e){return e.y}function jV(e){return e.width}function UV(e){return e.height}function Kr(e){return typeof e=="function"?e:()=>+e}function m0(e,t,n){return Math.max(t,Math.min(e,n))}function s9(){var e=IV,t=zV,n=jV,i=UV,r=Kr(0),s=r,o=r,a=r,u=null;function l(c,f,d){var h,g=f??+e.call(this,c),p=d??+t.call(this,c),m=+n.call(this,c),y=+i.call(this,c),b=Math.min(m,y)/2,x=m0(+r.call(this,c),0,b),v=m0(+s.call(this,c),0,b),A=m0(+o.call(this,c),0,b),w=m0(+a.call(this,c),0,b);if(u||(u=h=Gm()),x<=0&&v<=0&&A<=0&&w<=0)u.rect(g,p,m,y);else{var E=g+m,$=p+y;u.moveTo(g+x,p),u.lineTo(E-v,p),u.bezierCurveTo(E-qs*v,p,E,p+qs*v,E,p+v),u.lineTo(E,$-w),u.bezierCurveTo(E,$-qs*w,E-qs*w,$,E-w,$),u.lineTo(g+A,$),u.bezierCurveTo(g+qs*A,$,g,$-qs*A,g,$-A),u.lineTo(g,p+x),u.bezierCurveTo(g,p+qs*x,g+qs*x,p,g+x,p),u.closePath()}if(h)return u=null,h+""||null}return l.x=function(c){return arguments.length?(e=Kr(c),l):e},l.y=function(c){return arguments.length?(t=Kr(c),l):t},l.width=function(c){return arguments.length?(n=Kr(c),l):n},l.height=function(c){return arguments.length?(i=Kr(c),l):i},l.cornerRadius=function(c,f,d,h){return arguments.length?(r=Kr(c),s=f!=null?Kr(f):r,a=d!=null?Kr(d):r,o=h!=null?Kr(h):s,l):r},l.context=function(c){return arguments.length?(u=c??null,l):u},l}function o9(){var e,t,n,i,r=null,s,o,a,u;function l(f,d,h){const g=h/2;if(s){var p=a-d,m=f-o;if(p||m){var y=Math.sqrt(p*p+m*m),b=(p/=y)*u,x=(m/=y)*u,v=Math.atan2(m,p);r.moveTo(o-b,a-x),r.lineTo(f-p*g,d-m*g),r.arc(f,d,g,v-Math.PI,v),r.lineTo(o+b,a+x),r.arc(o,a,u,v,v+Math.PI)}else r.arc(f,d,g,0,ur);r.closePath()}else s=1;o=f,a=d,u=g}function c(f){var d,h=f.length,g,p=!1,m;for(r==null&&(r=m=Gm()),d=0;d<=h;++d)!(d<h&&i(g=f[d],d,f))===p&&(p=!p)&&(s=0),p&&l(+e(g,d,f),+t(g,d,f),+n(g,d,f));if(m)return r=null,m+""||null}return c.x=function(f){return arguments.length?(e=f,c):e},c.y=function(f){return arguments.length?(t=f,c):t},c.size=function(f){return arguments.length?(n=f,c):n},c.defined=function(f){return arguments.length?(i=f,c):i},c.context=function(f){return arguments.length?(f==null?r=null:r=f,c):r},c}function Ah(e,t){return e??t}const Eh=e=>e.x||0,wh=e=>e.y||0,qV=e=>e.width||0,WV=e=>e.height||0,GV=e=>(e.x||0)+(e.width||0),HV=e=>(e.y||0)+(e.height||0),VV=e=>e.startAngle||0,YV=e=>e.endAngle||0,XV=e=>e.padAngle||0,KV=e=>e.innerRadius||0,JV=e=>e.outerRadius||0,QV=e=>e.cornerRadius||0,ZV=e=>Ah(e.cornerRadiusTopLeft,e.cornerRadius)||0,eY=e=>Ah(e.cornerRadiusTopRight,e.cornerRadius)||0,tY=e=>Ah(e.cornerRadiusBottomRight,e.cornerRadius)||0,nY=e=>Ah(e.cornerRadiusBottomLeft,e.cornerRadius)||0,iY=e=>Ah(e.size,64),rY=e=>e.size||1,s1=e=>e.defined!==!1,sY=e=>r9(e.shape||"circle"),oY=mG().startAngle(VV).endAngle(YV).padAngle(XV).innerRadius(KV).outerRadius(JV).cornerRadius(QV),aY=N8().x(Eh).y1(wh).y0(HV).defined(s1),uY=N8().y(wh).x1(Eh).x0(GV).defined(s1),lY=O8().x(Eh).y(wh).defined(s1),cY=s9().x(Eh).y(wh).width(qV).height(WV).cornerRadius(ZV,eY,tY,nY),fY=bG().type(sY).size(iY),dY=o9().x(Eh).y(wh).defined(s1).size(rY);function GE(e){return e.cornerRadius||e.cornerRadiusTopLeft||e.cornerRadiusTopRight||e.cornerRadiusBottomRight||e.cornerRadiusBottomLeft}function hY(e,t){return oY.context(e)(t)}function gY(e,t){const n=t[0],i=n.interpolate||"linear";return(n.orient==="horizontal"?uY:aY).curve(WE(i,n.orient,n.tension)).context(e)(t)}function pY(e,t){const n=t[0],i=n.interpolate||"linear";return lY.curve(WE(i,n.orient,n.tension)).context(e)(t)}function fc(e,t,n,i){return cY.context(e)(t,n,i)}function mY(e,t){return(t.mark.shape||t.shape).context(e)(t)}function yY(e,t){return fY.context(e)(t)}function bY(e,t){return dY.context(e)(t)}var a9=1;function u9(){a9=1}function HE(e,t,n){var i=t.clip,r=e._defs,s=t.clip_id||(t.clip_id="clip"+a9++),o=r.clipping[s]||(r.clipping[s]={id:s});return dE(i)?o.path=i(null):GE(n)?o.path=fc(null,n,0,0):(o.width=n.width||0,o.height=n.height||0),"url(#"+s+")"}function ot(e){this.clear(),e&&this.union(e)}ot.prototype={clone(){return new ot(this)},clear(){return this.x1=+Number.MAX_VALUE,this.y1=+Number.MAX_VALUE,this.x2=-Number.MAX_VALUE,this.y2=-Number.MAX_VALUE,this},empty(){return this.x1===+Number.MAX_VALUE&&this.y1===+Number.MAX_VALUE&&this.x2===-Number.MAX_VALUE&&this.y2===-Number.MAX_VALUE},equals(e){return this.x1===e.x1&&this.y1===e.y1&&this.x2===e.x2&&this.y2===e.y2},set(e,t,n,i){return n<e?(this.x2=e,this.x1=n):(this.x1=e,this.x2=n),i<t?(this.y2=t,this.y1=i):(this.y1=t,this.y2=i),this},add(e,t){return e<this.x1&&(this.x1=e),t<this.y1&&(this.y1=t),e>this.x2&&(this.x2=e),t>this.y2&&(this.y2=t),this},expand(e){return this.x1-=e,this.y1-=e,this.x2+=e,this.y2+=e,this},round(){return this.x1=Math.floor(this.x1),this.y1=Math.floor(this.y1),this.x2=Math.ceil(this.x2),this.y2=Math.ceil(this.y2),this},scale(e){return this.x1*=e,this.y1*=e,this.x2*=e,this.y2*=e,this},translate(e,t){return this.x1+=e,this.x2+=e,this.y1+=t,this.y2+=t,this},rotate(e,t,n){const i=this.rotatedPoints(e,t,n);return this.clear().add(i[0],i[1]).add(i[2],i[3]).add(i[4],i[5]).add(i[6],i[7])},rotatedPoints(e,t,n){var{x1:i,y1:r,x2:s,y2:o}=this,a=Math.cos(e),u=Math.sin(e),l=t-t*a+n*u,c=n-t*u-n*a;return[a*i-u*r+l,u*i+a*r+c,a*i-u*o+l,u*i+a*o+c,a*s-u*r+l,u*s+a*r+c,a*s-u*o+l,u*s+a*o+c]},union(e){return e.x1<this.x1&&(this.x1=e.x1),e.y1<this.y1&&(this.y1=e.y1),e.x2>this.x2&&(this.x2=e.x2),e.y2>this.y2&&(this.y2=e.y2),this},intersect(e){return e.x1>this.x1&&(this.x1=e.x1),e.y1>this.y1&&(this.y1=e.y1),e.x2<this.x2&&(this.x2=e.x2),e.y2<this.y2&&(this.y2=e.y2),this},encloses(e){return e&&this.x1<=e.x1&&this.x2>=e.x2&&this.y1<=e.y1&&this.y2>=e.y2},alignsWith(e){return e&&(this.x1==e.x1||this.x2==e.x2||this.y1==e.y1||this.y2==e.y2)},intersects(e){return e&&!(this.x2<e.x1||this.x1>e.x2||this.y2<e.y1||this.y1>e.y2)},contains(e,t){return!(e<this.x1||e>this.x2||t<this.y1||t>this.y2)},width(){return this.x2-this.x1},height(){return this.y2-this.y1}};function o1(e){this.mark=e,this.bounds=this.bounds||new ot}function a1(e){o1.call(this,e),this.items=this.items||[]}ac(a1,o1);function VE(e){this._pending=0,this._loader=e||Nm()}function aD(e){e._pending+=1}function Qc(e){e._pending-=1}VE.prototype={pending(){return this._pending},sanitizeURL(e){const t=this;return aD(t),t._loader.sanitize(e,{context:"href"}).then(n=>(Qc(t),n)).catch(()=>(Qc(t),null))},loadImage(e){const t=this,n=RG();return aD(t),t._loader.sanitize(e,{context:"image"}).then(i=>{const r=i.href;if(!r||!n)throw{url:r};const s=new n,o=us(i,"crossOrigin")?i.crossOrigin:"anonymous";return o!=null&&(s.crossOrigin=o),s.onload=()=>Qc(t),s.onerror=()=>Qc(t),s.src=r,s}).catch(i=>(Qc(t),{complete:!1,width:0,height:0,src:i&&i.url||""}))},ready(){const e=this;return new Promise(t=>{function n(i){e.pending()?setTimeout(()=>{n(!0)},10):t(i)}n(!1)})}};function Ms(e,t,n){if(t.stroke&&t.opacity!==0&&t.strokeOpacity!==0){const i=t.strokeWidth!=null?+t.strokeWidth:1;e.expand(i+(n?xY(t,i):0))}return e}function xY(e,t){return e.strokeJoin&&e.strokeJoin!=="miter"?0:t}const vY=ur-1e-8;let u1,ng,ig,Da,ix,rg,rx,sx;const Qs=(e,t)=>u1.add(e,t),sg=(e,t)=>Qs(ng=e,ig=t),uD=e=>Qs(e,u1.y1),lD=e=>Qs(u1.x1,e),Ea=(e,t)=>ix*e+rx*t,wa=(e,t)=>rg*e+sx*t,ab=(e,t)=>Qs(Ea(e,t),wa(e,t)),ub=(e,t)=>sg(Ea(e,t),wa(e,t));function $h(e,t){return u1=e,t?(Da=t*Eo,ix=sx=Math.cos(Da),rg=Math.sin(Da),rx=-rg):(ix=sx=1,Da=rg=rx=0),AY}const AY={beginPath(){},closePath(){},moveTo:ub,lineTo:ub,rect(e,t,n,i){Da?(ab(e+n,t),ab(e+n,t+i),ab(e,t+i),ub(e,t)):(Qs(e+n,t+i),sg(e,t))},quadraticCurveTo(e,t,n,i){const r=Ea(e,t),s=wa(e,t),o=Ea(n,i),a=wa(n,i);cD(ng,r,o,uD),cD(ig,s,a,lD),sg(o,a)},bezierCurveTo(e,t,n,i,r,s){const o=Ea(e,t),a=wa(e,t),u=Ea(n,i),l=wa(n,i),c=Ea(r,s),f=wa(r,s);fD(ng,o,u,c,uD),fD(ig,a,l,f,lD),sg(c,f)},arc(e,t,n,i,r,s){if(i+=Da,r+=Da,ng=n*Math.cos(r)+e,ig=n*Math.sin(r)+t,Math.abs(r-i)>vY)Qs(e-n,t-n),Qs(e+n,t+n);else{const o=l=>Qs(n*Math.cos(l)+e,n*Math.sin(l)+t);let a,u;if(o(i),o(r),r!==i)if(i=i%ur,i<0&&(i+=ur),r=r%ur,r<0&&(r+=ur),r<i&&(s=!s,a=i,i=r,r=a),s)for(r-=ur,a=i-i%Aa,u=0;u<4&&a>r;++u,a-=Aa)o(a);else for(a=i-i%Aa+Aa,u=0;u<4&&a<r;++u,a=a+Aa)o(a)}}};function cD(e,t,n,i){const r=(e-t)/(e+n-2*t);0<r&&r<1&&i(e+(t-e)*r)}function fD(e,t,n,i,r){const s=i-e+3*t-3*n,o=e+n-2*t,a=e-t;let u=0,l=0,c;Math.abs(s)>TV?(c=o*o+a*s,c>=0&&(c=Math.sqrt(c),u=(-o+c)/s,l=(-o-c)/s)):u=.5*a/o,0<u&&u<1&&r(dD(u,e,t,n,i)),0<l&&l<1&&r(dD(l,e,t,n,i))}function dD(e,t,n,i,r){const s=1-e,o=s*s,a=e*e;return o*s*t+3*o*e*n+3*s*a*i+a*e*r}var fo=(fo=co(1,1))?fo.getContext("2d"):null;const ox=new ot;function YE(e){return function(t,n){if(!fo)return!0;e(fo,t),ox.clear().union(t.bounds).intersect(n).round();const{x1:i,y1:r,x2:s,y2:o}=ox;for(let a=r;a<=o;++a)for(let u=i;u<=s;++u)if(fo.isPointInPath(u,a))return!0;return!1}}function XE(e,t){return t.contains(e.x||0,e.y||0)}function l9(e,t){const n=e.x||0,i=e.y||0,r=e.width||0,s=e.height||0;return t.intersects(ox.set(n,i,n+r,i+s))}function c9(e,t){const n=e.x||0,i=e.y||0,r=e.x2!=null?e.x2:n,s=e.y2!=null?e.y2:i;return Ku(t,n,i,r,s)}function Ku(e,t,n,i,r){const{x1:s,y1:o,x2:a,y2:u}=e,l=i-t,c=r-n;let f=0,d=1,h,g,p,m;for(m=0;m<4;++m){if(m===0&&(h=-l,g=-(s-t)),m===1&&(h=l,g=a-t),m===2&&(h=-c,g=-(o-n)),m===3&&(h=c,g=u-n),Math.abs(h)<1e-10&&g<0)return!1;if(p=g/h,h<0){if(p>d)return!1;p>f&&(f=p)}else if(h>0){if(p<f)return!1;p<d&&(d=p)}}return!0}function Dl(e,t){e.globalCompositeOperation=t.blend||"source-over"}function wi(e,t){return e??t}function hD(e,t){const n=t.length;for(let i=0;i<n;++i)e.addColorStop(t[i].offset,t[i].color);return e}function EY(e,t,n){const i=n.width(),r=n.height();let s;if(t.gradient==="radial")s=e.createRadialGradient(n.x1+wi(t.x1,.5)*i,n.y1+wi(t.y1,.5)*r,Math.max(i,r)*wi(t.r1,0),n.x1+wi(t.x2,.5)*i,n.y1+wi(t.y2,.5)*r,Math.max(i,r)*wi(t.r2,.5));else{const o=wi(t.x1,0),a=wi(t.y1,0),u=wi(t.x2,1),l=wi(t.y2,0);if(o===u||a===l||i===r)s=e.createLinearGradient(n.x1+o*i,n.y1+a*r,n.x1+u*i,n.y1+l*r);else{const c=co(Math.ceil(i),Math.ceil(r)),f=c.getContext("2d");return f.scale(i,r),f.fillStyle=hD(f.createLinearGradient(o,a,u,l),t.stops),f.fillRect(0,0,i,r),e.createPattern(c,"no-repeat")}}return hD(s,t.stops)}function f9(e,t,n){return qE(n)?EY(e,n,t.bounds):n}function Jg(e,t,n){return n*=t.fillOpacity==null?1:t.fillOpacity,n>0?(e.globalAlpha=n,e.fillStyle=f9(e,t,t.fill),!0):!1}var wY=[];function _l(e,t,n){var i=(i=t.strokeWidth)!=null?i:1;return i<=0?!1:(n*=t.strokeOpacity==null?1:t.strokeOpacity,n>0?(e.globalAlpha=n,e.strokeStyle=f9(e,t,t.stroke),e.lineWidth=i,e.lineCap=t.strokeCap||"butt",e.lineJoin=t.strokeJoin||"miter",e.miterLimit=t.strokeMiterLimit||10,e.setLineDash&&(e.setLineDash(t.strokeDash||wY),e.lineDashOffset=t.strokeDashOffset||0),!0):!1)}function $Y(e,t){return e.zindex-t.zindex||e.index-t.index}function KE(e){if(!e.zdirty)return e.zitems;var t=e.items,n=[],i,r,s;for(r=0,s=t.length;r<s;++r)i=t[r],i.index=r,i.zindex&&n.push(i);return e.zdirty=!1,e.zitems=n.sort($Y)}function Wi(e,t){var n=e.items,i,r;if(!n||!n.length)return;const s=KE(e);if(s&&s.length){for(i=0,r=n.length;i<r;++i)n[i].zindex||t(n[i]);n=s}for(i=0,r=n.length;i<r;++i)t(n[i])}function Qg(e,t){var n=e.items,i,r;if(!n||!n.length)return null;const s=KE(e);for(s&&s.length&&(n=s),r=n.length;--r>=0;)if(i=t(n[r]))return i;if(n===s){for(n=e.items,r=n.length;--r>=0;)if(!n[r].zindex&&(i=t(n[r])))return i}return null}function JE(e){return function(t,n,i){Wi(n,r=>{(!i||i.intersects(r.bounds))&&d9(e,t,r,r)})}}function CY(e){return function(t,n,i){n.items.length&&(!i||i.intersects(n.bounds))&&d9(e,t,n.items[0],n.items)}}function d9(e,t,n,i){var r=n.opacity==null?1:n.opacity;r!==0&&(e(t,i)||(Dl(t,n),n.fill&&Jg(t,n,r)&&t.fill(),n.stroke&&_l(t,n,r)&&t.stroke()))}function l1(e){return e=e||E8,function(t,n,i,r,s,o){return i*=t.pixelRatio,r*=t.pixelRatio,Qg(n,a=>{const u=a.bounds;if(!(u&&!u.contains(s,o)||!u)&&e(t,a,i,r,s,o))return a})}}function Ch(e,t){return function(n,i,r,s){var o=Array.isArray(i)?i[0]:i,a=t??o.fill,u=o.stroke&&n.isPointInStroke,l,c;return u&&(l=o.strokeWidth,c=o.strokeCap,n.lineWidth=l??1,n.lineCap=c??"butt"),e(n,i)?!1:a&&n.isPointInPath(r,s)||u&&n.isPointInStroke(r,s)}}function QE(e){return l1(Ch(e))}function Pa(e,t){return"translate("+e+","+t+")"}function ZE(e){return"rotate("+e+")"}function FY(e,t){return"scale("+e+","+t+")"}function h9(e){return Pa(e.x||0,e.y||0)}function SY(e){return Pa(e.x||0,e.y||0)+(e.angle?" "+ZE(e.angle):"")}function DY(e){return Pa(e.x||0,e.y||0)+(e.angle?" "+ZE(e.angle):"")+(e.scaleX||e.scaleY?" "+FY(e.scaleX||1,e.scaleY||1):"")}function ew(e,t,n){function i(o,a){o("transform",SY(a)),o("d",t(null,a))}function r(o,a){return t($h(o,a.angle),a),Ms(o,a).translate(a.x||0,a.y||0)}function s(o,a){var u=a.x||0,l=a.y||0,c=a.angle||0;o.translate(u,l),c&&o.rotate(c*=Eo),o.beginPath(),t(o,a),c&&o.rotate(-c),o.translate(-u,-l)}return{type:e,tag:"path",nested:!1,attr:i,bound:r,draw:JE(s),pick:QE(s),isect:n||YE(s)}}var _Y=ew("arc",hY);function kY(e,t){for(var n=e[0].orient==="horizontal"?t[1]:t[0],i=e[0].orient==="horizontal"?"y":"x",r=e.length,s=1/0,o,a;--r>=0;)e[r].defined!==!1&&(a=Math.abs(e[r][i]-n),a<s&&(s=a,o=e[r]));return o}function MY(e,t){for(var n=Math.pow(e[0].strokeWidth||1,2),i=e.length,r,s,o;--i>=0;)if(e[i].defined!==!1&&(r=e[i].x-t[0],s=e[i].y-t[1],o=r*r+s*s,o<n))return e[i];return null}function OY(e,t){for(var n=e.length,i,r,s;--n>=0;)if(e[n].defined!==!1&&(i=e[n].x-t[0],r=e[n].y-t[1],s=i*i+r*r,i=e[n].size||1,s<i*i))return e[n];return null}function tw(e,t,n){function i(u,l){var c=l.mark.items;c.length&&u("d",t(null,c))}function r(u,l){var c=l.items;return c.length===0?u:(t($h(u),c),Ms(u,c[0]))}function s(u,l){u.beginPath(),t(u,l)}const o=Ch(s);function a(u,l,c,f,d,h){var g=l.items,p=l.bounds;return!g||!g.length||p&&!p.contains(d,h)?null:(c*=u.pixelRatio,f*=u.pixelRatio,o(u,g,c,f)?g[0]:null)}return{type:e,tag:"path",nested:!0,attr:i,bound:r,draw:CY(s),pick:a,isect:XE,tip:n}}var NY=tw("area",gY,kY);function TY(e,t){var n=t.clip;e.save(),dE(n)?(e.beginPath(),n(e),e.clip()):g9(e,t.group)}function g9(e,t){e.beginPath(),GE(t)?fc(e,t,0,0):e.rect(0,0,t.width||0,t.height||0),e.clip()}function p9(e){const t=wi(e.strokeWidth,1);return e.strokeOffset!=null?e.strokeOffset:e.stroke&&t>.5&&t<1.5?.5-Math.abs(t-1):0}function BY(e,t){e("transform",h9(t))}function m9(e,t){const n=p9(t);e("d",fc(null,t,n,n))}function RY(e,t){e("class","background"),e("aria-hidden",!0),m9(e,t)}function LY(e,t){e("class","foreground"),e("aria-hidden",!0),t.strokeForeground?m9(e,t):e("d","")}function PY(e,t,n){const i=t.clip?HE(n,t,t):null;e("clip-path",i)}function IY(e,t){if(!t.clip&&t.items){const n=t.items,i=n.length;for(let r=0;r<i;++r)e.union(n[r].bounds)}return(t.clip||t.width||t.height)&&!t.noBound&&e.add(0,0).add(t.width||0,t.height||0),Ms(e,t),e.translate(t.x||0,t.y||0)}function Cd(e,t,n,i){const r=p9(t);e.beginPath(),fc(e,t,(n||0)+r,(i||0)+r)}const zY=Ch(Cd),jY=Ch(Cd,!1),UY=Ch(Cd,!0);function qY(e,t,n){Wi(t,i=>{const r=i.x||0,s=i.y||0,o=i.strokeForeground,a=i.opacity==null?1:i.opacity;(i.stroke||i.fill)&&a&&(Cd(e,i,r,s),Dl(e,i),i.fill&&Jg(e,i,a)&&e.fill(),i.stroke&&!o&&_l(e,i,a)&&e.stroke()),e.save(),e.translate(r,s),i.clip&&g9(e,i),n&&n.translate(-r,-s),Wi(i,u=>{this.draw(e,u,n)}),n&&n.translate(r,s),e.restore(),o&&i.stroke&&a&&(Cd(e,i,r,s),Dl(e,i),_l(e,i,a)&&e.stroke())})}function WY(e,t,n,i,r,s){if(t.bounds&&!t.bounds.contains(r,s)||!t.items)return null;const o=n*e.pixelRatio,a=i*e.pixelRatio;return Qg(t,u=>{let l,c,f;const d=u.bounds;if(d&&!d.contains(r,s))return;c=u.x||0,f=u.y||0;const h=c+(u.width||0),g=f+(u.height||0),p=u.clip;if(p&&(r<c||r>h||s<f||s>g))return;if(e.save(),e.translate(c,f),c=r-c,f=s-f,p&&GE(u)&&!UY(e,u,o,a))return e.restore(),null;const m=u.strokeForeground,y=t.interactive!==!1;return y&&m&&u.stroke&&jY(e,u,o,a)?(e.restore(),u):(l=Qg(u,b=>GY(b,c,f)?this.pick(b,n,i,c,f):null),!l&&y&&(u.fill||!m&&u.stroke)&&zY(e,u,o,a)&&(l=u),e.restore(),l||null)})}function GY(e,t,n){return(e.interactive!==!1||e.marktype==="group")&&e.bounds&&e.bounds.contains(t,n)}var HY={type:"group",tag:"g",nested:!1,attr:BY,bound:IY,draw:qY,pick:WY,isect:l9,content:PY,background:RY,foreground:LY},Fd={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",version:"1.1"};function nw(e,t){var n=e.image;return(!n||e.url&&e.url!==n.url)&&(n={complete:!1,width:0,height:0},t.loadImage(e.url).then(i=>{e.image=i,e.image.url=e.url})),n}function iw(e,t){return e.width!=null?e.width:!t||!t.width?0:e.aspect!==!1&&e.height?e.height*t.width/t.height:t.width}function rw(e,t){return e.height!=null?e.height:!t||!t.height?0:e.aspect!==!1&&e.width?e.width*t.height/t.width:t.height}function c1(e,t){return e==="center"?t/2:e==="right"?t:0}function f1(e,t){return e==="middle"?t/2:e==="bottom"?t:0}function VY(e,t,n){const i=nw(t,n),r=iw(t,i),s=rw(t,i),o=(t.x||0)-c1(t.align,r),a=(t.y||0)-f1(t.baseline,s),u=!i.src&&i.toDataURL?i.toDataURL():i.src||"";e("href",u,Fd["xmlns:xlink"],"xlink:href"),e("transform",Pa(o,a)),e("width",r),e("height",s),e("preserveAspectRatio",t.aspect===!1?"none":"xMidYMid")}function YY(e,t){const n=t.image,i=iw(t,n),r=rw(t,n),s=(t.x||0)-c1(t.align,i),o=(t.y||0)-f1(t.baseline,r);return e.set(s,o,s+i,o+r)}function XY(e,t,n){Wi(t,i=>{if(n&&!n.intersects(i.bounds))return;const r=nw(i,this);let s=iw(i,r),o=rw(i,r);if(s===0||o===0)return;let a=(i.x||0)-c1(i.align,s),u=(i.y||0)-f1(i.baseline,o),l,c,f,d;i.aspect!==!1&&(c=r.width/r.height,f=i.width/i.height,c===c&&f===f&&c!==f&&(f<c?(d=s/c,u+=(o-d)/2,o=d):(d=o*c,a+=(s-d)/2,s=d))),(r.complete||r.toDataURL)&&(Dl(e,i),e.globalAlpha=(l=i.opacity)!=null?l:1,e.imageSmoothingEnabled=i.smooth!==!1,e.drawImage(r,a,u,s,o))})}var KY={type:"image",tag:"image",nested:!1,attr:VY,bound:YY,draw:XY,pick:l1(),isect:E8,get:nw,xOffset:c1,yOffset:f1},JY=tw("line",pY,MY);function QY(e,t){var n=t.scaleX||1,i=t.scaleY||1;(n!==1||i!==1)&&e("vector-effect","non-scaling-stroke"),e("transform",DY(t)),e("d",t.path)}function og(e,t){var n=t.path;if(n==null)return!0;var i=t.x||0,r=t.y||0,s=t.scaleX||1,o=t.scaleY||1,a=(t.angle||0)*Eo,u=t.pathCache;(!u||u.path!==n)&&((t.pathCache=u=Sl(n)).path=n),a&&e.rotate&&e.translate?(e.translate(i,r),e.rotate(a),$d(e,u,0,0,s,o),e.rotate(-a),e.translate(-i,-r)):$d(e,u,i,r,s,o)}function ZY(e,t){return og($h(e,t.angle),t)?e.set(0,0,0,0):Ms(e,t,!0)}var eX={type:"path",tag:"path",nested:!1,attr:QY,bound:ZY,draw:JE(og),pick:QE(og),isect:YE(og)};function tX(e,t){e("d",fc(null,t))}function nX(e,t){var n,i;return Ms(e.set(n=t.x||0,i=t.y||0,n+t.width||0,i+t.height||0),t)}function gD(e,t){e.beginPath(),fc(e,t)}var iX={type:"rect",tag:"path",nested:!1,attr:tX,bound:nX,draw:JE(gD),pick:QE(gD),isect:l9};function rX(e,t){e("transform",h9(t)),e("x2",t.x2!=null?t.x2-(t.x||0):0),e("y2",t.y2!=null?t.y2-(t.y||0):0)}function sX(e,t){var n,i;return Ms(e.set(n=t.x||0,i=t.y||0,t.x2!=null?t.x2:n,t.y2!=null?t.y2:i),t)}function y9(e,t,n){var i,r,s,o;return t.stroke&&_l(e,t,n)?(i=t.x||0,r=t.y||0,s=t.x2!=null?t.x2:i,o=t.y2!=null?t.y2:r,e.beginPath(),e.moveTo(i,r),e.lineTo(s,o),!0):!1}function oX(e,t,n){Wi(t,i=>{if(!(n&&!n.intersects(i.bounds))){var r=i.opacity==null?1:i.opacity;r&&y9(e,i,r)&&(Dl(e,i),e.stroke())}})}function aX(e,t,n,i){return e.isPointInStroke?y9(e,t,1)&&e.isPointInStroke(n,i):!1}var uX={type:"rule",tag:"line",nested:!1,attr:rX,bound:sX,draw:oX,pick:l1(aX),isect:c9},lX=ew("shape",mY),cX=ew("symbol",yY,XE);const pD=rG();var Ii={height:Tr,measureWidth:sw,estimateWidth:ax,width:ax,canvas:b9};b9(!0);function b9(e){Ii.width=e&&fo?sw:ax}function ax(e,t){return x9($o(e,t),Tr(e))}function x9(e,t){return~~(.8*e.length*t)}function sw(e,t){return Tr(e)<=0||!(t=$o(e,t))?0:v9(t,d1(e))}function v9(e,t){const n=`(${t}) ${e}`;let i=pD.get(n);return i===void 0&&(fo.font=t,i=fo.measureText(e).width,pD.set(n,i)),i}function Tr(e){return e.fontSize!=null?+e.fontSize||0:11}function wo(e){return e.lineHeight!=null?e.lineHeight:Tr(e)+2}function fX(e){return Ro(e)?e.length>1?e:e[0]:e}function Fh(e){return fX(e.lineBreak&&e.text&&!Ro(e.text)?e.text.split(e.lineBreak):e.text)}function ow(e){const t=Fh(e);return(Ro(t)?t.length-1:0)*wo(e)}function $o(e,t){const n=t==null?"":(t+"").trim();return e.limit>0&&n.length?hX(e,n):n}function dX(e){if(Ii.width===sw){const t=d1(e);return n=>v9(n,t)}else{const t=Tr(e);return n=>x9(n,t)}}function hX(e,t){var n=+e.limit,i=dX(e);if(i(t)<n)return t;var r=e.ellipsis||"…",s=e.dir==="rtl",o=0,a=t.length,u;if(n-=i(r),s){for(;o<a;)u=o+a>>>1,i(t.slice(u))>n?o=u+1:a=u;return r+t.slice(o)}else{for(;o<a;)u=1+(o+a>>>1),i(t.slice(0,u))<n?o=u:a=u-1;return t.slice(0,o)+r}}function Sh(e,t){var n=e.font;return(t&&n?String(n).replace(/"/g,"'"):n)||"sans-serif"}function d1(e,t){return(e.fontStyle?e.fontStyle+" ":"")+(e.fontVariant?e.fontVariant+" ":"")+(e.fontWeight?e.fontWeight+" ":"")+Tr(e)+"px "+Sh(e,t)}function aw(e){var t=e.baseline,n=Tr(e);return Math.round(t==="top"?.79*n:t==="middle"?.3*n:t==="bottom"?-.21*n:t==="line-top"?.29*n+.5*wo(e):t==="line-bottom"?.29*n-.5*wo(e):0)}const gX={left:"start",center:"middle",right:"end"},Wf=new ot;function h1(e){var t=e.x||0,n=e.y||0,i=e.radius||0,r;return i&&(r=(e.theta||0)-Aa,t+=i*Math.cos(r),n+=i*Math.sin(r)),Wf.x1=t,Wf.y1=n,Wf}function pX(e,t){var n=t.dx||0,i=(t.dy||0)+aw(t),r=h1(t),s=r.x1,o=r.y1,a=t.angle||0,u;e("text-anchor",gX[t.align]||"start"),a?(u=Pa(s,o)+" "+ZE(a),(n||i)&&(u+=" "+Pa(n,i))):u=Pa(s+n,o+i),e("transform",u)}function uw(e,t,n){var i=Ii.height(t),r=t.align,s=h1(t),o=s.x1,a=s.y1,u=t.dx||0,l=(t.dy||0)+aw(t)-Math.round(.8*i),c=Fh(t),f;if(Ro(c)?(i+=wo(t)*(c.length-1),f=c.reduce((d,h)=>Math.max(d,Ii.width(t,h)),0)):f=Ii.width(t,c),r==="center"?u-=f/2:r==="right"&&(u-=f),e.set(u+=o,l+=a,u+f,l+i),t.angle&&!n)e.rotate(t.angle*Eo,o,a);else if(n===2)return e.rotatedPoints(t.angle*Eo,o,a);return e}function mX(e,t,n){Wi(t,i=>{var r=i.opacity==null?1:i.opacity,s,o,a,u,l,c,f;if(!(n&&!n.intersects(i.bounds)||r===0||i.fontSize<=0||i.text==null||i.text.length===0)){if(e.font=d1(i),e.textAlign=i.align||"left",s=h1(i),o=s.x1,a=s.y1,i.angle&&(e.save(),e.translate(o,a),e.rotate(i.angle*Eo),o=a=0),o+=i.dx||0,a+=(i.dy||0)+aw(i),c=Fh(i),Dl(e,i),Ro(c))for(l=wo(i),u=0;u<c.length;++u)f=$o(i,c[u]),i.fill&&Jg(e,i,r)&&e.fillText(f,o,a),i.stroke&&_l(e,i,r)&&e.strokeText(f,o,a),a+=l;else f=$o(i,c),i.fill&&Jg(e,i,r)&&e.fillText(f,o,a),i.stroke&&_l(e,i,r)&&e.strokeText(f,o,a);i.angle&&e.restore()}})}function yX(e,t,n,i,r,s){if(t.fontSize<=0)return!1;if(!t.angle)return!0;var o=h1(t),a=o.x1,u=o.y1,l=uw(Wf,t,1),c=-t.angle*Eo,f=Math.cos(c),d=Math.sin(c),h=f*r-d*s+(a-f*a+d*u),g=d*r+f*s+(u-d*a-f*u);return l.contains(h,g)}function bX(e,t){const n=uw(Wf,e,2);return Ku(t,n[0],n[1],n[2],n[3])||Ku(t,n[0],n[1],n[4],n[5])||Ku(t,n[4],n[5],n[6],n[7])||Ku(t,n[2],n[3],n[6],n[7])}var xX={type:"text",tag:"text",nested:!1,attr:pX,bound:uw,draw:mX,pick:l1(yX),isect:bX},vX=tw("trail",bY,OY),ti={arc:_Y,area:NY,group:HY,image:KY,line:JY,path:eX,rect:iX,rule:uX,shape:lX,symbol:cX,text:xX,trail:vX};function ux(e,t,n){var i=ti[e.mark.marktype],r=t||i.bound;return i.nested&&(e=e.mark),r(e.bounds||(e.bounds=new ot),e,n)}var mD={mark:null};function A9(e,t,n){var i=ti[e.marktype],r=i.bound,s=e.items,o=s&&s.length,a,u,l,c;if(i.nested)return o?l=s[0]:(mD.mark=e,l=mD),c=ux(l,r,n),t=t&&t.union(c)||c,t;if(t=t||e.bounds&&e.bounds.clear()||new ot,o)for(a=0,u=s.length;a<u;++a)t.union(ux(s[a],r,n));return e.bounds=t}const AX=["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 E9(e,t){return JSON.stringify(e,AX,t)}function w9(e){const t=typeof e=="string"?JSON.parse(e):e;return $9(t)}function $9(e){var t=e.marktype,n=e.items,i,r,s;if(n)for(r=0,s=n.length;r<s;++r)i=t?"mark":"group",n[r][i]=e,n[r].zindex&&(n[r][i].zdirty=!0),(t||i)==="group"&&$9(n[r]);return t&&A9(e),e}function lw(e){arguments.length?this.root=w9(e):(this.root=C9({marktype:"group",name:"root",role:"frame"}),this.root.items=[new a1(this.root)])}lw.prototype={toJSON(e){return E9(this.root,e||0)},mark(e,t,n){t=t||this.root.items[0];const i=C9(e,t);return t.items[n]=i,i.zindex&&(i.group.zdirty=!0),i}};function C9(e,t){const n={bounds:new ot,clip:!!e.clip,group:t,interactive:e.interactive!==!1,items:[],marktype:e.marktype,name:e.name||void 0,role:e.role||void 0,zindex:e.zindex||0};return e.aria!=null&&(n.aria=e.aria),e.description&&(n.description=e.description),n}function Zs(e,t,n){return!e&&typeof document<"u"&&document.createElement&&(e=document),e?n?e.createElementNS(n,t):e.createElement(t):null}function cw(e,t){t=t.toLowerCase();for(var n=e.childNodes,i=0,r=n.length;i<r;++i)if(n[i].tagName.toLowerCase()===t)return n[i]}function _n(e,t,n,i){var r=e.childNodes[t],s;return(!r||r.tagName.toLowerCase()!==n.toLowerCase())&&(s=r||null,r=Zs(e.ownerDocument,n,i),e.insertBefore(r,s)),r}function Oi(e,t){for(var n=e.childNodes,i=n.length;i>t;)e.removeChild(n[--i]);return e}function F9(e){return"mark-"+e.marktype+(e.role?" role-"+e.role:"")+(e.name?" "+e.name:"")}function g1(e,t){const n=t.getBoundingClientRect();return[e.clientX-n.left-(t.clientLeft||0),e.clientY-n.top-(t.clientTop||0)]}function EX(e,t,n,i){var r=e&&e.mark,s,o;if(r&&(s=ti[r.marktype]).tip){for(o=g1(t,n),o[0]-=i[0],o[1]-=i[1];e=e.mark.group;)o[0]-=e.x||0,o[1]-=e.y||0;e=s.tip(r.items,o)}return e}function Co(e,t){this._active=null,this._handlers={},this._loader=e||Nm(),this._tooltip=t||wX}function wX(e,t,n,i){e.element().setAttribute("title",i||"")}Co.prototype={initialize(e,t,n){return this._el=e,this._obj=n||null,this.origin(t)},element(){return this._el},canvas(){return this._el&&this._el.firstChild},origin(e){return arguments.length?(this._origin=e||[0,0],this):this._origin.slice()},scene(e){return arguments.length?(this._scene=e,this):this._scene},on(){},off(){},_handlerIndex(e,t,n){for(let i=e?e.length:0;--i>=0;)if(e[i].type===t&&(!n||e[i].handler===n))return i;return-1},handlers(e){const t=this._handlers,n=[];if(e)n.push(...t[this.eventName(e)]);else for(const i in t)n.push(...t[i]);return n},eventName(e){const t=e.indexOf(".");return t<0?e:e.slice(0,t)},handleHref(e,t,n){this._loader.sanitize(n,{context:"href"}).then(i=>{const r=new MouseEvent(e.type,e),s=Zs(null,"a");for(const o in i)s.setAttribute(o,i[o]);s.dispatchEvent(r)}).catch(()=>{})},handleTooltip(e,t,n){if(t&&t.tooltip!=null){t=EX(t,e,this.canvas(),this._origin);const i=n&&t&&t.tooltip||null;this._tooltip.call(this._obj,this,e,t,i)}},getItemBoundingClientRect(e){const t=this.canvas();if(!t)return;const n=t.getBoundingClientRect(),i=this._origin,r=e.bounds,s=r.width(),o=r.height();let a=r.x1+i[0]+n.left,u=r.y1+i[1]+n.top;for(;e.mark&&(e=e.mark.group);)a+=e.x||0,u+=e.y||0;return{x:a,y:u,width:s,height:o,left:a,top:u,right:a+s,bottom:u+o}}};function Br(e){this._el=null,this._bgcolor=null,this._loader=new VE(e)}Br.prototype={initialize(e,t,n,i,r){return this._el=e,this.resize(t,n,i,r)},element(){return this._el},canvas(){return this._el&&this._el.firstChild},background(e){return arguments.length===0?this._bgcolor:(this._bgcolor=e,this)},resize(e,t,n,i){return this._width=e,this._height=t,this._origin=n||[0,0],this._scale=i||1,this},dirty(){},render(e){const t=this;return t._call=function(){t._render(e)},t._call(),t._call=null,t},_render(){},renderAsync(e){const t=this.render(e);return this._ready?this._ready.then(()=>t):Promise.resolve(t)},_load(e,t){var n=this,i=n._loader[e](t);if(!n._ready){const r=n._call;n._ready=n._loader.ready().then(s=>{s&&r(),n._ready=null})}return i},sanitizeURL(e){return this._load("sanitizeURL",e)},loadImage(e){return this._load("loadImage",e)}};const $X="keydown",CX="keypress",FX="keyup",S9="dragenter",ag="dragleave",D9="dragover",lx="mousedown",SX="mouseup",Zg="mousemove",Gf="mouseout",_9="mouseover",ep="click",DX="dblclick",_X="wheel",k9="mousewheel",tp="touchstart",np="touchmove",ip="touchend",kX=[$X,CX,FX,S9,ag,D9,lx,SX,Zg,Gf,_9,ep,DX,_X,k9,tp,np,ip],cx=Zg,Sd=Gf,fx=ep;function Dh(e,t){Co.call(this,e,t),this._down=null,this._touch=null,this._first=!0,this._events={}}const MX=e=>e===tp||e===np||e===ip?[tp,np,ip]:[e];function yD(e,t){MX(t).forEach(n=>OX(e,n))}function OX(e,t){const n=e.canvas();n&&!e._events[t]&&(e._events[t]=1,n.addEventListener(t,e[t]?i=>e[t](i):i=>e.fire(t,i)))}function bD(e,t,n){return function(i){const r=this._active,s=this.pickEvent(i);s===r?this.fire(e,i):((!r||!r.exit)&&this.fire(n,i),this._active=s,this.fire(t,i),this.fire(e,i))}}function xD(e){return function(t){this.fire(e,t),this._active=null}}ac(Dh,Co,{initialize(e,t,n){return this._canvas=e&&cw(e,"canvas"),[ep,lx,Zg,Gf,ag].forEach(i=>yD(this,i)),Co.prototype.initialize.call(this,e,t,n)},canvas(){return this._canvas},context(){return this._canvas.getContext("2d")},events:kX,DOMMouseScroll(e){this.fire(k9,e)},mousemove:bD(Zg,_9,Gf),dragover:bD(D9,S9,ag),mouseout:xD(Gf),dragleave:xD(ag),mousedown(e){this._down=this._active,this.fire(lx,e)},click(e){this._down===this._active&&(this.fire(ep,e),this._down=null)},touchstart(e){this._touch=this.pickEvent(e.changedTouches[0]),this._first&&(this._active=this._touch,this._first=!1),this.fire(tp,e,!0)},touchmove(e){this.fire(np,e,!0)},touchend(e){this.fire(ip,e,!0),this._touch=null},fire(e,t,n){const i=n?this._touch:this._active,r=this._handlers[e];if(t.vegaType=e,e===fx&&i&&i.href?this.handleHref(t,i,i.href):(e===cx||e===Sd)&&this.handleTooltip(t,i,e!==Sd),r)for(let s=0,o=r.length;s<o;++s)r[s].handler.call(this._obj,t,i)},on(e,t){const n=this.eventName(e),i=this._handlers;return this._handlerIndex(i[n],e,t)<0&&(yD(this,e),(i[n]||(i[n]=[])).push({type:e,handler:t})),this},off(e,t){const n=this.eventName(e),i=this._handlers[n],r=this._handlerIndex(i,e,t);return r>=0&&i.splice(r,1),this},pickEvent(e){const t=g1(e,this._canvas),n=this._origin;return this.pick(this._scene,t[0],t[1],t[0]-n[0],t[1]-n[1])},pick(e,t,n,i,r){const s=this.context();return ti[e.marktype].pick.call(this,s,e,t,n,i,r)}});function NX(){return typeof window<"u"&&window.devicePixelRatio||1}var TX=NX();function BX(e,t,n,i,r,s){const o=typeof HTMLElement<"u"&&e instanceof HTMLElement&&e.parentNode!=null,a=e.getContext("2d"),u=o?TX:r;e.width=t*u,e.height=n*u;for(const l in s)a[l]=s[l];return o&&u!==1&&(e.style.width=t+"px",e.style.height=n+"px"),a.pixelRatio=u,a.setTransform(u,0,0,u,u*i[0],u*i[1]),e}function rp(e){Br.call(this,e),this._options={},this._redraw=!1,this._dirty=new ot,this._tempb=new ot}const vD=Br.prototype,RX=(e,t,n)=>new ot().set(0,0,t,n).translate(-e[0],-e[1]);function LX(e,t,n){return t.expand(1).round(),e.pixelRatio%1&&t.scale(e.pixelRatio).round().scale(1/e.pixelRatio),t.translate(-(n[0]%1),-(n[1]%1)),e.beginPath(),e.rect(t.x1,t.y1,t.width(),t.height()),e.clip(),t}ac(rp,Br,{initialize(e,t,n,i,r,s){return this._options=s||{},this._canvas=this._options.externalContext?null:co(1,1,this._options.type),e&&this._canvas&&(Oi(e,0).appendChild(this._canvas),this._canvas.setAttribute("class","marks")),vD.initialize.call(this,e,t,n,i,r)},resize(e,t,n,i){if(vD.resize.call(this,e,t,n,i),this._canvas)BX(this._canvas,this._width,this._height,this._origin,this._scale,this._options.context);else{const r=this._options.externalContext;r||qf("CanvasRenderer is missing a valid canvas or context"),r.scale(this._scale,this._scale),r.translate(this._origin[0],this._origin[1])}return this._redraw=!0,this},canvas(){return this._canvas},context(){return this._options.externalContext||(this._canvas?this._canvas.getContext("2d"):null)},dirty(e){const t=this._tempb.clear().union(e.bounds);let n=e.mark.group;for(;n;)t.translate(n.x||0,n.y||0),n=n.mark.group;this._dirty.union(t)},_render(e){const t=this.context(),n=this._origin,i=this._width,r=this._height,s=this._dirty,o=RX(n,i,r);t.save();const a=this._redraw||s.empty()?(this._redraw=!1,o.expand(1)):LX(t,o.intersect(s),n);return this.clear(-n[0],-n[1],i,r),this.draw(t,e,a),t.restore(),s.clear(),this},draw(e,t,n){const i=ti[t.marktype];t.clip&&TY(e,t),i.draw.call(this,e,t,n),t.clip&&e.restore()},clear(e,t,n,i){const r=this._options,s=this.context();r.type!=="pdf"&&!r.externalContext&&s.clearRect(e,t,n,i),this._bgcolor!=null&&(s.fillStyle=this._bgcolor,s.fillRect(e,t,n,i))}});function fw(e,t){Co.call(this,e,t);const n=this;n._hrefHandler=dx(n,(i,r)=>{r&&r.href&&n.handleHref(i,r,r.href)}),n._tooltipHandler=dx(n,(i,r)=>{n.handleTooltip(i,r,i.type!==Sd)})}const dx=(e,t)=>n=>{let i=n.target.__data__;i=Array.isArray(i)?i[0]:i,n.vegaType=n.type,t.call(e._obj,n,i)};ac(fw,Co,{initialize(e,t,n){let i=this._svg;return i&&(i.removeEventListener(fx,this._hrefHandler),i.removeEventListener(cx,this._tooltipHandler),i.removeEventListener(Sd,this._tooltipHandler)),this._svg=i=e&&cw(e,"svg"),i&&(i.addEventListener(fx,this._hrefHandler),i.addEventListener(cx,this._tooltipHandler),i.addEventListener(Sd,this._tooltipHandler)),Co.prototype.initialize.call(this,e,t,n)},canvas(){return this._svg},on(e,t){const n=this.eventName(e),i=this._handlers;if(this._handlerIndex(i[n],e,t)<0){const s={type:e,handler:t,listener:dx(this,t)};(i[n]||(i[n]=[])).push(s),this._svg&&this._svg.addEventListener(n,s.listener)}return this},off(e,t){const n=this.eventName(e),i=this._handlers[n],r=this._handlerIndex(i,e,t);return r>=0&&(this._svg&&this._svg.removeEventListener(n,i[r].listener),i.splice(r,1)),this}});const M9="aria-hidden",dw="aria-label",hw="role",gw="aria-roledescription",O9="graphics-object",pw="graphics-symbol",N9=(e,t,n)=>({[hw]:e,[gw]:t,[dw]:n||void 0}),PX=sG(["axis-domain","axis-grid","axis-label","axis-tick","axis-title","legend-band","legend-entry","legend-gradient","legend-label","legend-title","legend-symbol","title"]),AD={axis:{desc:"axis",caption:jX},legend:{desc:"legend",caption:UX},"title-text":{desc:"title",caption:e=>`Title text '${wD(e)}'`},"title-subtitle":{desc:"subtitle",caption:e=>`Subtitle text '${wD(e)}'`}},ED={ariaRole:hw,ariaRoleDescription:gw,description:dw};function T9(e,t){const n=t.aria===!1;if(e(M9,n||void 0),n||t.description==null)for(const i in ED)e(ED[i],void 0);else{const i=t.mark.marktype;e(dw,t.description),e(hw,t.ariaRole||(i==="group"?O9:pw)),e(gw,t.ariaRoleDescription||`${i} mark`)}}function B9(e){return e.aria===!1?{[M9]:!0}:PX[e.role]?null:AD[e.role]?zX(e,AD[e.role]):IX(e)}function IX(e){const t=e.marktype,n=t==="group"||t==="text"||e.items.some(i=>i.description!=null&&i.aria!==!1);return N9(n?O9:pw,`${t} mark container`,e.description)}function zX(e,t){try{const n=e.items[0],i=t.caption||(()=>"");return N9(t.role||pw,t.desc,n.description||i(n))}catch{return null}}function wD(e){return $8(e.text).join(" ")}function jX(e){const t=e.datum,n=e.orient,i=t.title?R9(e):null,r=e.context,s=r.scales[t.scale].value,o=r.dataflow.locale(),a=s.type;return`${n==="left"||n==="right"?"Y":"X"}-axis`+(i?` titled '${i}'`:"")+` for a ${Fl(a)?"discrete":a} scale with ${ZO(o,s,e)}`}function UX(e){const t=e.datum,n=t.title?R9(e):null,i=`${t.type||""} legend`.trim(),r=t.scales,s=Object.keys(r),o=e.context,a=o.scales[r[s[0]]].value,u=o.dataflow.locale();return WX(i)+(n?` titled '${n}'`:"")+` for ${qX(s)} with ${ZO(u,a,e)}`}function R9(e){try{return $8(w8(e.items).items[0].text).join(" ")}catch{return null}}function qX(e){return e=e.map(t=>t+(t==="fill"||t==="stroke"?" color":"")),e.length<2?e[0]:e.slice(0,-1).join(", ")+" and "+w8(e)}function WX(e){return e.length?e[0].toUpperCase()+e.slice(1):e}const L9=e=>(e+"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;"),GX=e=>L9(e).replace(/"/g,"&quot;").replace(/\t/g,"&#x9;").replace(/\n/g,"&#xA;").replace(/\r/g,"&#xD;");function mw(){let e="",t="",n="";const i=[],r=()=>t=n="",s=u=>{t&&(e+=`${t}>${n}`,r()),i.push(u)},o=(u,l)=>(l!=null&&(t+=` ${u}="${GX(l)}"`),a),a={open(u){s(u),t="<"+u;for(var l=arguments.length,c=new Array(l>1?l-1:0),f=1;f<l;f++)c[f-1]=arguments[f];for(const d of c)for(const h in d)o(h,d[h]);return a},close(){const u=i.pop();return t?e+=t+(n?`>${n}</${u}>`:"/>"):e+=`</${u}>`,r(),a},attr:o,text:u=>(n+=L9(u),a),toString:()=>e};return a}const P9=e=>I9(mw(),e)+"";function I9(e,t){if(e.open(t.tagName),t.hasAttributes()){const n=t.attributes,i=n.length;for(let r=0;r<i;++r)e.attr(n[r].name,n[r].value)}if(t.hasChildNodes()){const n=t.childNodes;for(const i of n)i.nodeType===3?e.text(i.nodeValue):I9(e,i)}return e.close()}const sp={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"},op={blend:"mix-blend-mode"},z9={fill:"none","stroke-miterlimit":10},Zc=0,$D="http://www.w3.org/2000/xmlns/",dt=Fd.xmlns;function yw(e){Br.call(this,e),this._dirtyID=0,this._dirty=[],this._svg=null,this._root=null,this._defs=null}const lb=Br.prototype;ac(yw,Br,{initialize(e,t,n,i,r){return this._defs={},this._clearDefs(),e&&(this._svg=_n(e,0,"svg",dt),this._svg.setAttributeNS($D,"xmlns",dt),this._svg.setAttributeNS($D,"xmlns:xlink",Fd["xmlns:xlink"]),this._svg.setAttribute("version",Fd.version),this._svg.setAttribute("class","marks"),Oi(e,1),this._root=_n(this._svg,Zc,"g",dt),eo(this._root,z9),Oi(this._svg,Zc+1)),this.background(this._bgcolor),lb.initialize.call(this,e,t,n,i,r)},background(e){return arguments.length&&this._svg&&this._svg.style.setProperty("background-color",e),lb.background.apply(this,arguments)},resize(e,t,n,i){return lb.resize.call(this,e,t,n,i),this._svg&&(eo(this._svg,{width:this._width*this._scale,height:this._height*this._scale,viewBox:`0 0 ${this._width} ${this._height}`}),this._root.setAttribute("transform",`translate(${this._origin})`)),this._dirty=[],this},canvas(){return this._svg},svg(){const e=this._svg,t=this._bgcolor;if(!e)return null;let n;t&&(e.removeAttribute("style"),n=_n(e,Zc,"rect",dt),eo(n,{width:this._width,height:this._height,fill:t}));const i=P9(e);return t&&(e.removeChild(n),this._svg.style.setProperty("background-color",t)),i},_render(e){return this._dirtyCheck()&&(this._dirtyAll&&this._clearDefs(),this.mark(this._root,e),Oi(this._root,1)),this.defs(),this._dirty=[],++this._dirtyID,this},dirty(e){e.dirty!==this._dirtyID&&(e.dirty=this._dirtyID,this._dirty.push(e))},isDirty(e){return this._dirtyAll||!e._svg||!e._svg.ownerSVGElement||e.dirty===this._dirtyID},_dirtyCheck(){this._dirtyAll=!0;const e=this._dirty;if(!e.length||!this._dirtyID)return!0;const t=++this._dirtyID;let n,i,r,s,o,a,u;for(o=0,a=e.length;o<a;++o)if(n=e[o],i=n.mark,i.marktype!==r&&(r=i.marktype,s=ti[r]),i.zdirty&&i.dirty!==t&&(this._dirtyAll=!1,CD(n,t),i.items.forEach(l=>{l.dirty=t})),!i.zdirty){if(n.exit){s.nested&&i.items.length?(u=i.items[0],u._svg&&this._update(s,u._svg,u)):n._svg&&(u=n._svg.parentNode,u&&u.removeChild(n._svg)),n._svg=null;continue}n=s.nested?i.items[0]:n,n._update!==t&&(!n._svg||!n._svg.ownerSVGElement?(this._dirtyAll=!1,CD(n,t)):this._update(s,n._svg,n),n._update=t)}return!this._dirtyAll},mark(e,t,n){if(!this.isDirty(t))return t._svg;const i=this._svg,r=ti[t.marktype],s=t.interactive===!1?"none":null,o=r.tag==="g",a=FD(t,e,n,"g",i);a.setAttribute("class",F9(t));const u=B9(t);for(const d in u)on(a,d,u[d]);o||on(a,"pointer-events",s),on(a,"clip-path",t.clip?HE(this,t,t.group):null);let l=null,c=0;const f=d=>{const h=this.isDirty(d),g=FD(d,a,l,r.tag,i);h&&(this._update(r,g,d),o&&YX(this,g,d)),l=g,++c};return r.nested?t.items.length&&f(t.items[0]):Wi(t,f),Oi(a,c),a},_update(e,t,n){gs=t,Ut=t.__values__,T9(Hf,n),e.attr(Hf,n,this);const i=KX[e.type];i&&i.call(this,e,t,n),gs&&this.style(gs,n)},style(e,t){if(t!=null){for(const n in sp){let i=n==="font"?Sh(t):t[n];if(i===Ut[n])continue;const r=sp[n];i==null?e.removeAttribute(r):(qE(i)&&(i=t9(i,this._defs.gradient,j9())),e.setAttribute(r,i+"")),Ut[n]=i}for(const n in op)ug(e,op[n],t[n])}},defs(){const e=this._svg,t=this._defs;let n=t.el,i=0;for(const r in t.gradient)n||(t.el=n=_n(e,Zc+1,"defs",dt)),i=HX(n,t.gradient[r],i);for(const r in t.clipping)n||(t.el=n=_n(e,Zc+1,"defs",dt)),i=VX(n,t.clipping[r],i);n&&(i===0?(e.removeChild(n),t.el=null):Oi(n,i))},_clearDefs(){const e=this._defs;e.gradient={},e.clipping={}}});function CD(e,t){for(;e&&e.dirty!==t;e=e.mark.group)if(e.dirty=t,e.mark&&e.mark.dirty!==t)e.mark.dirty=t;else return}function HX(e,t,n){let i,r,s;if(t.gradient==="radial"){let o=_n(e,n++,"pattern",dt);eo(o,{id:Kg+t.id,viewBox:"0,0,1,1",width:"100%",height:"100%",preserveAspectRatio:"xMidYMid slice"}),o=_n(o,0,"rect",dt),eo(o,{width:1,height:1,fill:`url(${j9()}#${t.id})`}),e=_n(e,n++,"radialGradient",dt),eo(e,{id:t.id,fx:t.x1,fy:t.y1,fr:t.r1,cx:t.x2,cy:t.y2,r:t.r2})}else e=_n(e,n++,"linearGradient",dt),eo(e,{id:t.id,x1:t.x1,x2:t.x2,y1:t.y1,y2:t.y2});for(i=0,r=t.stops.length;i<r;++i)s=_n(e,i,"stop",dt),s.setAttribute("offset",t.stops[i].offset),s.setAttribute("stop-color",t.stops[i].color);return Oi(e,i),n}function VX(e,t,n){let i;return e=_n(e,n,"clipPath",dt),e.setAttribute("id",t.id),t.path?(i=_n(e,0,"path",dt),i.setAttribute("d",t.path)):(i=_n(e,0,"rect",dt),eo(i,{x:0,y:0,width:t.width,height:t.height})),Oi(e,1),n+1}function YX(e,t,n){t=t.lastChild.previousSibling;let i,r=0;Wi(n,s=>{i=e.mark(t,s,i),++r}),Oi(t,1+r)}function FD(e,t,n,i,r){let s=e._svg,o;if(!s&&(o=t.ownerDocument,s=Zs(o,i,dt),e._svg=s,e.mark&&(s.__data__=e,s.__values__={fill:"default"},i==="g"))){const a=Zs(o,"path",dt);s.appendChild(a),a.__data__=e;const u=Zs(o,"g",dt);s.appendChild(u),u.__data__=e;const l=Zs(o,"path",dt);s.appendChild(l),l.__data__=e,l.__values__={fill:"default"}}return(s.ownerSVGElement!==r||XX(s,n))&&t.insertBefore(s,n?n.nextSibling:t.firstChild),s}function XX(e,t){return e.parentNode&&e.parentNode.childNodes.length>1&&e.previousSibling!=t}let gs=null,Ut=null;const KX={group(e,t,n){const i=gs=t.childNodes[2];Ut=i.__values__,e.foreground(Hf,n,this),Ut=t.__values__,gs=t.childNodes[1],e.content(Hf,n,this);const r=gs=t.childNodes[0];e.background(Hf,n,this);const s=n.mark.interactive===!1?"none":null;if(s!==Ut.events&&(on(i,"pointer-events",s),on(r,"pointer-events",s),Ut.events=s),n.strokeForeground&&n.stroke){const o=n.fill;on(i,"display",null),this.style(r,n),on(r,"stroke",null),o&&(n.fill=null),Ut=i.__values__,this.style(i,n),o&&(n.fill=o),gs=null}else on(i,"display","none")},image(e,t,n){n.smooth===!1?(ug(t,"image-rendering","optimizeSpeed"),ug(t,"image-rendering","pixelated")):ug(t,"image-rendering",null)},text(e,t,n){const i=Fh(n);let r,s,o,a;Ro(i)?(s=i.map(u=>$o(n,u)),r=s.join(`
`),r!==Ut.text&&(Oi(t,0),o=t.ownerDocument,a=wo(n),s.forEach((u,l)=>{const c=Zs(o,"tspan",dt);c.__data__=n,c.textContent=u,l&&(c.setAttribute("x",0),c.setAttribute("dy",a)),t.appendChild(c)}),Ut.text=r)):(s=$o(n,i),s!==Ut.text&&(t.textContent=s,Ut.text=s)),on(t,"font-family",Sh(n)),on(t,"font-size",Tr(n)+"px"),on(t,"font-style",n.fontStyle),on(t,"font-variant",n.fontVariant),on(t,"font-weight",n.fontWeight)}};function Hf(e,t,n){t!==Ut[e]&&(n?JX(gs,e,t,n):on(gs,e,t),Ut[e]=t)}function ug(e,t,n){n!==Ut[t]&&(n==null?e.style.removeProperty(t):e.style.setProperty(t,n+""),Ut[t]=n)}function eo(e,t){for(const n in t)on(e,n,t[n])}function on(e,t,n){n!=null?e.setAttribute(t,n):e.removeAttribute(t)}function JX(e,t,n,i){n!=null?e.setAttributeNS(i,t,n):e.removeAttributeNS(i,t)}function j9(){let e;return typeof window>"u"?"":(e=window.location).hash?e.href.slice(0,-e.hash.length):e.href}function bw(e){Br.call(this,e),this._text=null,this._defs={gradient:{},clipping:{}}}ac(bw,Br,{svg(){return this._text},_render(e){const t=mw();t.open("svg",C8({},Fd,{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&&n!=="transparent"&&n!=="none"&&t.open("rect",{width:this._width,height:this._height,fill:n}).close(),t.open("g",z9,{transform:"translate("+this._origin+")"}),this.mark(t,e),t.close(),this.defs(t),this._text=t.close()+"",this},mark(e,t){const n=ti[t.marktype],i=n.tag,r=[T9,n.attr];e.open("g",{class:F9(t),"clip-path":t.clip?HE(this,t,t.group):null},B9(t),{"pointer-events":i!=="g"&&t.interactive===!1?"none":null});const s=o=>{const a=this.href(o);if(a&&e.open("a",a),e.open(i,this.attr(t,o,r,i!=="g"?i:null)),i==="text"){const u=Fh(o);if(Ro(u)){const l={x:0,dy:wo(o)};for(let c=0;c<u.length;++c)e.open("tspan",c?l:null).text($o(o,u[c])).close()}else e.text($o(o,u))}else if(i==="g"){const u=o.strokeForeground,l=o.fill,c=o.stroke;u&&c&&(o.stroke=null),e.open("path",this.attr(t,o,n.background,"bgrect")).close(),e.open("g",this.attr(t,o,n.content)),Wi(o,f=>this.mark(e,f)),e.close(),u&&c?(l&&(o.fill=null),o.stroke=c,e.open("path",this.attr(t,o,n.foreground,"bgrect")).close(),l&&(o.fill=l)):e.open("path",this.attr(t,o,n.foreground,"bgfore")).close()}e.close(),a&&e.close()};return n.nested?t.items&&t.items.length&&s(t.items[0]):Wi(t,s),e.close()},href(e){const t=e.href;let n;if(t){if(n=this._hrefs&&this._hrefs[t])return n;this.sanitizeURL(t).then(i=>{i["xlink:href"]=i.href,i.href=null,(this._hrefs||(this._hrefs={}))[t]=i})}return null},attr(e,t,n,i){const r={},s=(o,a,u,l)=>{r[l||o]=a};return Array.isArray(n)?n.forEach(o=>o(s,t,this)):n(s,t,this),i&&QX(r,t,e,i,this._defs),r},defs(e){const t=this._defs.gradient,n=this._defs.clipping;if(Object.keys(t).length+Object.keys(n).length!==0){e.open("defs");for(const r in t){const s=t[r],o=s.stops;s.gradient==="radial"?(e.open("pattern",{id:Kg+r,viewBox:"0,0,1,1",width:"100%",height:"100%",preserveAspectRatio:"xMidYMid slice"}),e.open("rect",{width:"1",height:"1",fill:"url(#"+r+")"}).close(),e.close(),e.open("radialGradient",{id:r,fx:s.x1,fy:s.y1,fr:s.r1,cx:s.x2,cy:s.y2,r:s.r2})):e.open("linearGradient",{id:r,x1:s.x1,x2:s.x2,y1:s.y1,y2:s.y2});for(let a=0;a<o.length;++a)e.open("stop",{offset:o[a].offset,"stop-color":o[a].color}).close();e.close()}for(const r in n){const s=n[r];e.open("clipPath",{id:r}),s.path?e.open("path",{d:s.path}).close():e.open("rect",{x:0,y:0,width:s.width,height:s.height}).close(),e.close()}e.close()}}});function QX(e,t,n,i,r){let s;if(t==null||(i==="bgrect"&&n.interactive===!1&&(e["pointer-events"]="none"),i==="bgfore"&&(n.interactive===!1&&(e["pointer-events"]="none"),e.display="none",t.fill!==null)))return e;i==="image"&&t.smooth===!1&&(s=["image-rendering: optimizeSpeed;","image-rendering: pixelated;"]),i==="text"&&(e["font-family"]=Sh(t),e["font-size"]=Tr(t)+"px",e["font-style"]=t.fontStyle,e["font-variant"]=t.fontVariant,e["font-weight"]=t.fontWeight);for(const o in sp){let a=t[o];const u=sp[o];a==="transparent"&&(u==="fill"||u==="stroke")||a!=null&&(qE(a)&&(a=t9(a,r.gradient,"")),e[u]=a)}for(const o in op){const a=t[o];a!=null&&(s=s||[],s.push(`${op[o]}: ${a};`))}return s&&(e.style=s.join(" ")),e}const U9="canvas",q9="png",W9="svg",G9="none",to={Canvas:U9,PNG:q9,SVG:W9,None:G9},kl={};kl[U9]=kl[q9]={renderer:rp,headless:rp,handler:Dh};kl[W9]={renderer:yw,headless:bw,handler:fw};kl[G9]={};function p1(e,t){return e=String(e||"").toLowerCase(),arguments.length>1?(kl[e]=t,this):kl[e]}function H9(e,t,n){const i=[],r=new ot().union(t),s=e.marktype;return s?V9(e,r,n,i):s==="group"?Y9(e,r,n,i):qf("Intersect scene must be mark node or group item.")}function V9(e,t,n,i){if(ZX(e,t,n)){const r=e.items,s=e.marktype,o=r.length;let a=0;if(s==="group")for(;a<o;++a)Y9(r[a],t,n,i);else for(const u=ti[s].isect;a<o;++a){const l=r[a];X9(l,t,u)&&i.push(l)}}return i}function ZX(e,t,n){return e.bounds&&t.intersects(e.bounds)&&(e.marktype==="group"||e.interactive!==!1&&(!n||n(e)))}function Y9(e,t,n,i){n&&n(e.mark)&&X9(e,t,ti.group.isect)&&i.push(e);const r=e.items,s=r&&r.length;if(s){const o=e.x||0,a=e.y||0;t.translate(-o,-a);for(let u=0;u<s;++u)V9(r[u],t,n,i);t.translate(o,a)}return i}function X9(e,t,n){const i=e.bounds;return t.encloses(i)||t.intersects(i)&&n(e,t)}const cb=new ot;function K9(e){const t=e.clip;if(dE(t))t($h(cb.clear()));else if(t)cb.set(0,0,e.group.width,e.group.height);else return;e.bounds.intersect(cb)}const eK=1e-9;function xw(e,t,n){return e===t?!0:n==="path"?J9(e,t):e instanceof Date&&t instanceof Date?+e==+t:SS(e)&&SS(t)?Math.abs(e-t)<=eK:!e||!t||!FS(e)&&!FS(t)?e==t:tK(e,t)}function J9(e,t){return xw(Sl(e),Sl(t))}function tK(e,t){var n=Object.keys(e),i=Object.keys(t),r,s;if(n.length!==i.length)return!1;for(n.sort(),i.sort(),s=n.length-1;s>=0;s--)if(n[s]!=i[s])return!1;for(s=n.length-1;s>=0;s--)if(r=n[s],!xw(e[r],t[r],r))return!1;return typeof e==typeof t}function nK(){u9(),SV()}function dc(e,t,n){return e.fields=t||[],e.fname=n,e}function iK(e){return e.length===1?rK(e[0]):sK(e)}const rK=e=>function(t){return t[e]},sK=e=>{const t=e.length;return function(n){for(let i=0;i<t;++i)n=n[e[i]];return n}};function fb(e){throw Error(e)}function oK(e){const t=[],n=e.length;let i=null,r=0,s="",o,a,u;e=e+"";function l(){t.push(s+e.substring(o,a)),s="",o=a+1}for(o=a=0;a<n;++a)if(u=e[a],u==="\\")s+=e.substring(o,a++),o=a;else if(u===i)l(),i=null,r=-1;else{if(i)continue;o===r&&u==='"'||o===r&&u==="'"?(o=a+1,i=u):u==="."&&!r?a>o?l():o=a+1:u==="["?(a>o&&l(),r=o=a+1):u==="]"&&(r||fb("Access path missing open bracket: "+e),r>0&&l(),r=0,o=a+1)}return r&&fb("Access path missing closing bracket: "+e),i&&fb("Access path missing closing quote: "+e),a>o&&(a++,l()),t}function aK(e,t,n){const i=oK(e);return e=i.length===1?i[0]:e,dc((n&&n.get||iK)(i),[e],t||e)}aK("id");dc(e=>e,[],"identity");dc(()=>0,[],"zero");dc(()=>1,[],"one");dc(()=>!0,[],"true");dc(()=>!1,[],"false");function uK(e){return e===Object(e)}function db(e){return e[e.length-1]}function lK(e){for(let t,n,i=1,r=arguments.length;i<r;++i){t=arguments[i];for(n in t)e[n]=t[n]}return e}function hc(e,t,n){const i=e.prototype=Object.create(t.prototype);return Object.defineProperty(i,"constructor",{value:e,writable:!0,enumerable:!0,configurable:!0}),lK(i,n)}const Ml="top",Ni="left",Bi="right",Fo="bottom",cK="top-left",fK="top-right",dK="bottom-left",hK="bottom-right",vw="start",hx="middle",an="end",gK="x",pK="y",m1="group",Aw="axis",Ew="title",mK="frame",yK="scope",ww="legend",Q9="row-header",Z9="row-footer",e4="row-title",t4="column-header",n4="column-footer",i4="column-title",bK="padding",xK="symbol",r4="fit",s4="fit-x",o4="fit-y",vK="pad",$w="none",y0="all",gx="each",Cw="flush",no="column",io="row";function a4(e){N.call(this,null,e)}hc(a4,N,{transform(e,t){const n=t.dataflow,i=e.mark,r=i.marktype,s=ti[r],o=s.bound;let a=i.bounds,u;if(s.nested)i.items.length&&n.dirty(i.items[0]),a=b0(i,o),i.items.forEach(l=>{l.bounds.clear().union(a)});else if(r===m1||e.modified())switch(t.visit(t.MOD,l=>n.dirty(l)),a.clear(),i.items.forEach(l=>a.union(b0(l,o))),i.role){case Aw:case ww:case Ew:t.reflow()}else u=t.changed(t.REM),t.visit(t.ADD,l=>{a.union(b0(l,o))}),t.visit(t.MOD,l=>{u=u||a.alignsWith(l.bounds),n.dirty(l),a.union(b0(l,o))}),u&&(a.clear(),i.items.forEach(l=>a.union(l.bounds)));return K9(i),t.modifies("bounds")}});function b0(e,t,n){return t(e.bounds.clear(),e,n)}const SD=":vega_identifier:";function Fw(e){N.call(this,0,e)}Fw.Definition={type:"Identifier",metadata:{modifies:!0},params:[{name:"as",type:"string",required:!0}]};hc(Fw,N,{transform(e,t){const n=AK(t.dataflow),i=e.as;let r=n.value;return t.visit(t.ADD,s=>s[i]=s[i]||++r),n.set(this.value=r),t}});function AK(e){return e._signals[SD]||(e._signals[SD]=e.add(0))}function u4(e){N.call(this,null,e)}hc(u4,N,{transform(e,t){let n=this.value;n||(n=t.dataflow.scenegraph().mark(e.markdef,EK(e),e.index),n.group.context=e.context,e.context.group||(e.context.group=n.group),n.source=this.source,n.clip=e.clip,n.interactive=e.interactive,this.value=n);const i=n.marktype===m1?a1:o1;return t.visit(t.ADD,r=>i.call(r,n)),(e.modified("clip")||e.modified("interactive"))&&(n.clip=e.clip,n.interactive=!!e.interactive,n.zdirty=!0,t.reflow()),n.items=t.source,t}});function EK(e){const t=e.groups,n=e.parent;return t&&t.size===1?t.get(Object.keys(t.object)[0]):t&&n?t.lookup(n):null}function l4(e){N.call(this,null,e)}const DD={parity:e=>e.filter((t,n)=>n%2?t.opacity=0:1),greedy:(e,t)=>{let n;return e.filter((i,r)=>!r||!c4(n.bounds,i.bounds,t)?(n=i,1):i.opacity=0)}},c4=(e,t,n)=>n>Math.max(t.x1-e.x2,e.x1-t.x2,t.y1-e.y2,e.y1-t.y2),_D=(e,t)=>{for(var n=1,i=e.length,r=e[0].bounds,s;n<i;r=s,++n)if(c4(r,s=e[n].bounds,t))return!0},wK=e=>{const t=e.bounds;return t.width()>1&&t.height()>1},$K=(e,t,n)=>{var i=e.range(),r=new ot;return t===Ml||t===Fo?r.set(i[0],-1/0,i[1],1/0):r.set(-1/0,i[0],1/0,i[1]),r.expand(n||1),s=>r.encloses(s.bounds)},kD=e=>(e.forEach(t=>t.opacity=1),e),MD=(e,t)=>e.reflow(t.modified()).modifies("opacity");hc(l4,N,{transform(e,t){const n=DD[e.method]||DD.parity,i=e.separation||0;let r=t.materialize(t.SOURCE).source,s,o;if(!r||!r.length)return;if(!e.method)return e.modified("method")&&(kD(r),t=MD(t,e)),t;if(r=r.filter(wK),!r.length)return;if(e.sort&&(r=r.slice().sort(e.sort)),s=kD(r),t=MD(t,e),s.length>=3&&_D(s,i)){do s=n(s,i);while(s.length>=3&&_D(s,i));s.length<3&&!db(r).opacity&&(s.length>1&&(db(s).opacity=0),db(r).opacity=1)}e.boundScale&&e.boundTolerance>=0&&(o=$K(e.boundScale,e.boundOrient,+e.boundTolerance),r.forEach(u=>{o(u)||(u.opacity=0)}));const a=s[0].mark.bounds.clear();return r.forEach(u=>{u.opacity&&a.union(u.bounds)}),t}});function f4(e){N.call(this,null,e)}hc(f4,N,{transform(e,t){const n=t.dataflow;if(t.visit(t.ALL,i=>n.dirty(i)),t.fields&&t.fields.zindex){const i=t.source&&t.source[0];i&&(i.mark.zdirty=!0)}}});const jt=new ot;function Ju(e,t,n){return e[t]===n?0:(e[t]=n,1)}function CK(e){var t=e.items[0].orient;return t===Ni||t===Bi}function FK(e){let t=+e.grid;return[e.ticks?t++:-1,e.labels?t++:-1,t+ +e.domain]}function SK(e,t,n,i){var r=t.items[0],s=r.datum,o=r.translate!=null?r.translate:.5,a=r.orient,u=FK(s),l=r.range,c=r.offset,f=r.position,d=r.minExtent,h=r.maxExtent,g=s.title&&r.items[u[2]].items[0],p=r.titlePadding,m=r.bounds,y=g&&ow(g),b=0,x=0,v,A;switch(jt.clear().union(m),m.clear(),(v=u[0])>-1&&m.union(r.items[v].bounds),(v=u[1])>-1&&m.union(r.items[v].bounds),a){case Ml:b=f||0,x=-c,A=Math.max(d,Math.min(h,-m.y1)),m.add(0,-A).add(l,0),g&&x0(e,g,A,p,y,0,-1,m);break;case Ni:b=-c,x=f||0,A=Math.max(d,Math.min(h,-m.x1)),m.add(-A,0).add(0,l),g&&x0(e,g,A,p,y,1,-1,m);break;case Bi:b=n+c,x=f||0,A=Math.max(d,Math.min(h,m.x2)),m.add(0,0).add(A,l),g&&x0(e,g,A,p,y,1,1,m);break;case Fo:b=f||0,x=i+c,A=Math.max(d,Math.min(h,m.y2)),m.add(0,0).add(l,A),g&&x0(e,g,A,p,0,0,1,m);break;default:b=r.x,x=r.y}return Ms(m.translate(b,x),r),Ju(r,"x",b+o)|Ju(r,"y",x+o)&&(r.bounds=jt,e.dirty(r),r.bounds=m,e.dirty(r)),r.mark.bounds.clear().union(m)}function x0(e,t,n,i,r,s,o,a){const u=t.bounds;if(t.auto){const l=o*(n+r+i);let c=0,f=0;e.dirty(t),s?c=(t.x||0)-(t.x=l):f=(t.y||0)-(t.y=l),t.mark.bounds.clear().union(u.translate(-c,-f)),e.dirty(t)}a.union(u)}const OD=(e,t)=>Math.floor(Math.min(e,t)),ND=(e,t)=>Math.ceil(Math.max(e,t));function DK(e){var t=e.items,n=t.length,i=0,r,s;const o={marks:[],rowheaders:[],rowfooters:[],colheaders:[],colfooters:[],rowtitle:null,coltitle:null};for(;i<n;++i)if(r=t[i],s=r.items,r.marktype===m1)switch(r.role){case Aw:case ww:case Ew:break;case Q9:o.rowheaders.push(...s);break;case Z9:o.rowfooters.push(...s);break;case t4:o.colheaders.push(...s);break;case n4:o.colfooters.push(...s);break;case e4:o.rowtitle=s[0];break;case i4:o.coltitle=s[0];break;default:o.marks.push(...s)}return o}function _K(e){return new ot().set(0,0,e.width||0,e.height||0)}function kK(e){const t=e.bounds.clone();return t.empty()?t.set(0,0,0,0):t.translate(-(e.x||0),-(e.y||0))}function Ye(e,t,n){const i=uK(e)?e[t]:e;return i??(n!==void 0?n:0)}function TD(e){return e<0?Math.ceil(-e):0}function d4(e,t,n){var i=!n.nodirty,r=n.bounds===Cw?_K:kK,s=jt.set(0,0,0,0),o=Ye(n.align,no),a=Ye(n.align,io),u=Ye(n.padding,no),l=Ye(n.padding,io),c=n.columns||t.length,f=c<=0?1:Math.ceil(t.length/c),d=t.length,h=Array(d),g=Array(c),p=0,m=Array(d),y=Array(f),b=0,x=Array(d),v=Array(d),A=Array(d),w,E,$,k,F,D,T,C,_,S,M;for(E=0;E<c;++E)g[E]=0;for(E=0;E<f;++E)y[E]=0;for(E=0;E<d;++E)D=t[E],F=A[E]=r(D),D.x=D.x||0,x[E]=0,D.y=D.y||0,v[E]=0,$=E%c,k=~~(E/c),p=Math.max(p,T=Math.ceil(F.x2)),b=Math.max(b,C=Math.ceil(F.y2)),g[$]=Math.max(g[$],T),y[k]=Math.max(y[k],C),h[E]=u+TD(F.x1),m[E]=l+TD(F.y1),i&&e.dirty(t[E]);for(E=0;E<d;++E)E%c===0&&(h[E]=0),E<c&&(m[E]=0);if(o===gx)for($=1;$<c;++$){for(M=0,E=$;E<d;E+=c)M<h[E]&&(M=h[E]);for(E=$;E<d;E+=c)h[E]=M+g[$-1]}else if(o===y0){for(M=0,E=0;E<d;++E)E%c&&M<h[E]&&(M=h[E]);for(E=0;E<d;++E)E%c&&(h[E]=M+p)}else for(o=!1,$=1;$<c;++$)for(E=$;E<d;E+=c)h[E]+=g[$-1];if(a===gx)for(k=1;k<f;++k){for(M=0,E=k*c,w=E+c;E<w;++E)M<m[E]&&(M=m[E]);for(E=k*c;E<w;++E)m[E]=M+y[k-1]}else if(a===y0){for(M=0,E=c;E<d;++E)M<m[E]&&(M=m[E]);for(E=c;E<d;++E)m[E]=M+b}else for(a=!1,k=1;k<f;++k)for(E=k*c,w=E+c;E<w;++E)m[E]+=y[k-1];for(_=0,E=0;E<d;++E)_=h[E]+(E%c?_:0),x[E]+=_-t[E].x;for($=0;$<c;++$)for(S=0,E=$;E<d;E+=c)S+=m[E],v[E]+=S-t[E].y;if(o&&Ye(n.center,no)&&f>1)for(E=0;E<d;++E)F=o===y0?p:g[E%c],_=F-A[E].x2-t[E].x-x[E],_>0&&(x[E]+=_/2);if(a&&Ye(n.center,io)&&c!==1)for(E=0;E<d;++E)F=a===y0?b:y[~~(E/c)],S=F-A[E].y2-t[E].y-v[E],S>0&&(v[E]+=S/2);for(E=0;E<d;++E)s.union(A[E].translate(x[E],v[E]));switch(_=Ye(n.anchor,gK),S=Ye(n.anchor,pK),Ye(n.anchor,no)){case an:_-=s.width();break;case hx:_-=s.width()/2}switch(Ye(n.anchor,io)){case an:S-=s.height();break;case hx:S-=s.height()/2}for(_=Math.round(_),S=Math.round(S),s.clear(),E=0;E<d;++E)t[E].mark.bounds.clear();for(E=0;E<d;++E)D=t[E],D.x+=x[E]+=_,D.y+=v[E]+=S,s.union(D.mark.bounds.union(D.bounds.translate(x[E],v[E]))),i&&e.dirty(D);return s}function MK(e,t,n){var i=DK(t),r=i.marks,s=n.bounds===Cw?OK:NK,o=n.offset,a=n.columns||r.length,u=a<=0?1:Math.ceil(r.length/a),l=u*a,c,f,d,h,g,p,m;const y=d4(e,r,n);y.empty()&&y.set(0,0,0,0),i.rowheaders&&(p=Ye(n.headerBand,io,null),c=v0(e,i.rowheaders,r,a,u,-Ye(o,"rowHeader"),OD,0,s,"x1",0,a,1,p)),i.colheaders&&(p=Ye(n.headerBand,no,null),f=v0(e,i.colheaders,r,a,a,-Ye(o,"columnHeader"),OD,1,s,"y1",0,1,a,p)),i.rowfooters&&(p=Ye(n.footerBand,io,null),d=v0(e,i.rowfooters,r,a,u,Ye(o,"rowFooter"),ND,0,s,"x2",a-1,a,1,p)),i.colfooters&&(p=Ye(n.footerBand,no,null),h=v0(e,i.colfooters,r,a,a,Ye(o,"columnFooter"),ND,1,s,"y2",l-a,1,a,p)),i.rowtitle&&(g=Ye(n.titleAnchor,io),m=Ye(o,"rowTitle"),m=g===an?d+m:c-m,p=Ye(n.titleBand,io,.5),BD(e,i.rowtitle,m,0,y,p)),i.coltitle&&(g=Ye(n.titleAnchor,no),m=Ye(o,"columnTitle"),m=g===an?h+m:f-m,p=Ye(n.titleBand,no,.5),BD(e,i.coltitle,m,1,y,p))}function OK(e,t){return t==="x1"?e.x||0:t==="y1"?e.y||0:t==="x2"?(e.x||0)+(e.width||0):t==="y2"?(e.y||0)+(e.height||0):void 0}function NK(e,t){return e.bounds[t]}function v0(e,t,n,i,r,s,o,a,u,l,c,f,d,h){var g=n.length,p=0,m=0,y,b,x,v,A,w,E,$,k;if(!g)return p;for(y=c;y<g;y+=f)n[y]&&(p=o(p,u(n[y],l)));if(!t.length)return p;for(t.length>r&&(e.warn("Grid headers exceed limit: "+r),t=t.slice(0,r)),p+=s,b=0,v=t.length;b<v;++b)e.dirty(t[b]),t[b].mark.bounds.clear();for(y=c,b=0,v=t.length;b<v;++b,y+=f){for(w=t[b],A=w.mark.bounds,x=y;x>=0&&(E=n[x])==null;x-=d);a?($=h==null?E.x:Math.round(E.bounds.x1+h*E.bounds.width()),k=p):($=p,k=h==null?E.y:Math.round(E.bounds.y1+h*E.bounds.height())),A.union(w.bounds.translate($-(w.x||0),k-(w.y||0))),w.x=$,w.y=k,e.dirty(w),m=o(m,A[l])}return m}function BD(e,t,n,i,r,s){if(t){e.dirty(t);var o=n,a=n;i?o=Math.round(r.x1+s*r.width()):a=Math.round(r.y1+s*r.height()),t.bounds.translate(o-(t.x||0),a-(t.y||0)),t.mark.bounds.clear().union(t.bounds),t.x=o,t.y=a,e.dirty(t)}}function TK(e,t){const n=e[t]||{};return(i,r)=>n[i]!=null?n[i]:e[i]!=null?e[i]:r}function BK(e,t){let n=-1/0;return e.forEach(i=>{i.offset!=null&&(n=Math.max(n,i.offset))}),n>-1/0?n:t}function RK(e,t,n,i,r,s,o){const a=TK(n,t),u=BK(e,a("offset",0)),l=a("anchor",vw),c=l===an?1:l===hx?.5:0,f={align:gx,bounds:a("bounds",Cw),columns:a("direction")==="vertical"?1:e.length,padding:a("margin",8),center:a("center"),nodirty:!0};switch(t){case Ni:f.anchor={x:Math.floor(i.x1)-u,column:an,y:c*(o||i.height()+2*i.y1),row:l};break;case Bi:f.anchor={x:Math.ceil(i.x2)+u,y:c*(o||i.height()+2*i.y1),row:l};break;case Ml:f.anchor={y:Math.floor(r.y1)-u,row:an,x:c*(s||r.width()+2*r.x1),column:l};break;case Fo:f.anchor={y:Math.ceil(r.y2)+u,x:c*(s||r.width()+2*r.x1),column:l};break;case cK:f.anchor={x:u,y:u};break;case fK:f.anchor={x:s-u,y:u,column:an};break;case dK:f.anchor={x:u,y:o-u,row:an};break;case hK:f.anchor={x:s-u,y:o-u,column:an,row:an};break}return f}function LK(e,t){var n=t.items[0],i=n.datum,r=n.orient,s=n.bounds,o=n.x,a=n.y,u,l;return n._bounds?n._bounds.clear().union(s):n._bounds=s.clone(),s.clear(),IK(e,n,n.items[0].items[0]),s=PK(n,s),u=2*n.padding,l=2*n.padding,s.empty()||(u=Math.ceil(s.width()+u),l=Math.ceil(s.height()+l)),i.type===xK&&zK(n.items[0].items[0].items[0].items),r!==$w&&(n.x=o=0,n.y=a=0),n.width=u,n.height=l,Ms(s.set(o,a,o+u,a+l),n),n.mark.bounds.clear().union(s),n}function PK(e,t){return e.items.forEach(n=>t.union(n.bounds)),t.x1=e.padding,t.y1=e.padding,t}function IK(e,t,n){var i=t.padding,r=i-n.x,s=i-n.y;if(!t.datum.title)(r||s)&&ef(e,n,r,s);else{var o=t.items[1].items[0],a=o.anchor,u=t.titlePadding||0,l=i-o.x,c=i-o.y;switch(o.orient){case Ni:r+=Math.ceil(o.bounds.width())+u;break;case Bi:case Fo:break;default:s+=o.bounds.height()+u}switch((r||s)&&ef(e,n,r,s),o.orient){case Ni:c+=Lu(t,n,o,a,1,1);break;case Bi:l+=Lu(t,n,o,an,0,0)+u,c+=Lu(t,n,o,a,1,1);break;case Fo:l+=Lu(t,n,o,a,0,0),c+=Lu(t,n,o,an,-1,0,1)+u;break;default:l+=Lu(t,n,o,a,0,0)}(l||c)&&ef(e,o,l,c),(l=Math.round(o.bounds.x1-i))<0&&(ef(e,n,-l,0),ef(e,o,-l,0))}}function Lu(e,t,n,i,r,s,o){const a=e.datum.type!=="symbol",u=n.datum.vgrad,l=a&&(s||!u)&&!o?t.items[0]:t,c=l.bounds[r?"y2":"x2"]-e.padding,f=u&&s?c:0,d=u&&s?0:c,h=r<=0?0:ow(n);return Math.round(i===vw?f:i===an?d-h:.5*(c-h))}function ef(e,t,n,i){t.x+=n,t.y+=i,t.bounds.translate(n,i),t.mark.bounds.translate(n,i),e.dirty(t)}function zK(e){const t=e.reduce((n,i)=>(n[i.column]=Math.max(i.bounds.x2-i.x,n[i.column]||0),n),{});e.forEach(n=>{n.width=t[n.column],n.height=n.bounds.y2-n.y})}function jK(e,t,n,i,r){var s=t.items[0],o=s.frame,a=s.orient,u=s.anchor,l=s.offset,c=s.padding,f=s.items[0].items[0],d=s.items[1]&&s.items[1].items[0],h=a===Ni||a===Bi?i:n,g=0,p=0,m=0,y=0,b=0,x;if(o!==m1?a===Ni?(g=r.y2,h=r.y1):a===Bi?(g=r.y1,h=r.y2):(g=r.x1,h=r.x2):a===Ni&&(g=i,h=0),x=u===vw?g:u===an?h:(g+h)/2,d&&d.text){switch(a){case Ml:case Fo:b=f.bounds.height()+c;break;case Ni:y=f.bounds.width()+c;break;case Bi:y=-f.bounds.width()-c;break}jt.clear().union(d.bounds),jt.translate(y-(d.x||0),b-(d.y||0)),Ju(d,"x",y)|Ju(d,"y",b)&&(e.dirty(d),d.bounds.clear().union(jt),d.mark.bounds.clear().union(jt),e.dirty(d)),jt.clear().union(d.bounds)}else jt.clear();switch(jt.union(f.bounds),a){case Ml:p=x,m=r.y1-jt.height()-l;break;case Ni:p=r.x1-jt.width()-l,m=x;break;case Bi:p=r.x2+jt.width()+l,m=x;break;case Fo:p=x,m=r.y2+l;break;default:p=s.x,m=s.y}return Ju(s,"x",p)|Ju(s,"y",m)&&(jt.translate(p,m),e.dirty(s),s.bounds.clear().union(jt),t.bounds.clear().union(jt),e.dirty(s)),s.bounds}function h4(e){N.call(this,null,e)}hc(h4,N,{transform(e,t){const n=t.dataflow;return e.mark.items.forEach(i=>{e.layout&&MK(n,i,e.layout),qK(n,i,e)}),UK(e.mark.group)?t.reflow():t}});function UK(e){return e&&e.mark.role!=="legend-entry"}function qK(e,t,n){var i=t.items,r=Math.max(0,t.width||0),s=Math.max(0,t.height||0),o=new ot().set(0,0,r,s),a=o.clone(),u=o.clone(),l=[],c,f,d,h,g,p;for(g=0,p=i.length;g<p;++g)switch(f=i[g],f.role){case Aw:h=CK(f)?a:u,h.union(SK(e,f,r,s));break;case Ew:c=f;break;case ww:l.push(LK(e,f));break;case mK:case yK:case Q9:case Z9:case e4:case t4:case n4:case i4:a.union(f.bounds),u.union(f.bounds);break;default:o.union(f.bounds)}if(l.length){const m={};l.forEach(y=>{d=y.orient||Bi,d!==$w&&(m[d]||(m[d]=[])).push(y)});for(const y in m){const b=m[y];d4(e,b,RK(b,y,n.legends,a,u,r,s))}l.forEach(y=>{const b=y.bounds;if(b.equals(y._bounds)||(y.bounds=y._bounds,e.dirty(y),y.bounds=b,e.dirty(y)),n.autosize&&(n.autosize.type===r4||n.autosize.type===s4||n.autosize.type===o4))switch(y.orient){case Ni:case Bi:o.add(b.x1,0).add(b.x2,0);break;case Ml:case Fo:o.add(0,b.y1).add(0,b.y2)}else o.union(b)})}o.union(a).union(u),c&&o.union(jK(e,c,r,s,o)),t.clip&&o.set(0,0,t.width||0,t.height||0),WK(e,t,o,n)}function WK(e,t,n,i){const r=i.autosize||{},s=r.type;if(e._autosize<1||!s)return;let o=e._width,a=e._height,u=Math.max(0,t.width||0),l=Math.max(0,Math.ceil(-n.x1)),c=Math.max(0,t.height||0),f=Math.max(0,Math.ceil(-n.y1));const d=Math.max(0,Math.ceil(n.x2-u)),h=Math.max(0,Math.ceil(n.y2-c));if(r.contains===bK){const g=e.padding();o-=g.left+g.right,a-=g.top+g.bottom}s===$w?(l=0,f=0,u=o,c=a):s===r4?(u=Math.max(0,o-l-d),c=Math.max(0,a-f-h)):s===s4?(u=Math.max(0,o-l-d),a=c+f+h):s===o4?(o=u+l+d,c=Math.max(0,a-f-h)):s===vK&&(o=u+l+d,a=c+f+h),e._resizeView(o,a,u,c,[l,f],r.resize)}const GK=Object.freeze(Object.defineProperty({__proto__:null,bound:a4,identifier:Fw,mark:u4,overlap:l4,render:f4,viewlayout:h4},Symbol.toStringTag,{value:"Module"}));function gc(e,t,n){return e.fields=t||[],e.fname=n,e}function HK(e){return e.length===1?VK(e[0]):YK(e)}const VK=e=>function(t){return t[e]},YK=e=>{const t=e.length;return function(n){for(let i=0;i<t;++i)n=n[e[i]];return n}};function bs(e){throw Error(e)}function XK(e){const t=[],n=e.length;let i=null,r=0,s="",o,a,u;e=e+"";function l(){t.push(s+e.substring(o,a)),s="",o=a+1}for(o=a=0;a<n;++a)if(u=e[a],u==="\\")s+=e.substring(o,a++),o=a;else if(u===i)l(),i=null,r=-1;else{if(i)continue;o===r&&u==='"'||o===r&&u==="'"?(o=a+1,i=u):u==="."&&!r?a>o?l():o=a+1:u==="["?(a>o&&l(),r=o=a+1):u==="]"&&(r||bs("Access path missing open bracket: "+e),r>0&&l(),r=0,o=a+1)}return r&&bs("Access path missing closing bracket: "+e),i&&bs("Access path missing closing quote: "+e),a>o&&(a++,l()),t}function KK(e,t,n){const i=XK(e);return e=i.length===1?i[0]:e,gc((n&&n.get||HK)(i),[e],t||e)}KK("id");const JK=gc(e=>e,[],"identity");gc(()=>0,[],"zero");const g4=gc(()=>1,[],"one");gc(()=>!0,[],"true");const sa=gc(()=>!1,[],"false");var _h=Array.isArray;function QK(e){return e===Object(e)}function Ia(e){return e[e.length-1]}function ZK(e){return e==null||e===""?null:+e}const eJ=e=>t=>e*Math.exp(t),tJ=e=>t=>Math.log(e*t),nJ=e=>t=>Math.sign(t)*Math.log1p(Math.abs(t/e)),iJ=e=>t=>Math.sign(t)*Math.expm1(Math.abs(t))*e,RD=e=>t=>t<0?-Math.pow(-t,e):Math.pow(t,e);function y1(e,t,n,i,r){const s=i(e[0]),o=i(Ia(e)),a=t!=null?i(t):(s+o)/2;return[r(a+(s-a)*n),r(a+(o-a)*n)]}function rJ(e,t,n){return y1(e,t,n,ZK,JK)}function sJ(e,t,n){const i=Math.sign(e[0]);return y1(e,t,n,tJ(i),eJ(i))}function LD(e,t,n,i){return y1(e,t,n,RD(i),RD(1/i))}function oJ(e,t,n,i){return y1(e,t,n,nJ(i),iJ(i))}function ho(e){return typeof e=="function"}function aJ(e){return ho(e)?e:()=>e}function uJ(e){for(let t,n,i=1,r=arguments.length;i<r;++i){t=arguments[i];for(n in t)e[n]=t[n]}return e}const lJ=Object.prototype.hasOwnProperty;function cJ(e,t){return lJ.call(e,t)}const A0={};function p4(e){let t={},n;function i(s){return cJ(t,s)&&t[s]!==A0}const r={size:0,empty:0,object:t,has:i,get(s){return i(s)?t[s]:void 0},set(s,o){return i(s)||(++r.size,t[s]===A0&&--r.empty),t[s]=o,this},delete(s){return i(s)&&(--r.size,++r.empty,t[s]=A0),this},clear(){r.size=r.empty=0,r.object=t={}},test(s){return arguments.length?(n=s,r):n},clean(){const s={};let o=0;for(const a in t){const u=t[a];u!==A0&&(!n||!n(u))&&(s[a]=u,++o)}r.size=o,r.empty=0,r.object=t=s}};return e&&Object.keys(e).forEach(s=>{r.set(s,e[s])}),r}function Os(e,t,n){const i=e.prototype=Object.create(t.prototype);return Object.defineProperty(i,"constructor",{value:e,writable:!0,enumerable:!0,configurable:!0}),uJ(i,n)}function m4(e){return typeof e=="string"}function y4(e){return _h(e)?"["+e.map(y4)+"]":QK(e)||m4(e)?JSON.stringify(e).replace("\u2028","\\u2028").replace("\u2029","\\u2029"):e}function fJ(e){const t={},n=e.length;for(let i=0;i<n;++i)t[e[i]]=!0;return t}function b4(e){N.call(this,null,e)}Os(b4,N,{transform(e,t){if(this.value&&!e.modified())return t.StopPropagation;var n=t.dataflow.locale(),i=t.fork(t.NO_SOURCE|t.NO_FIELDS),r=this.value,s=e.scale,o=e.count==null?e.values?e.values.length:10:e.count,a=jE(s,o,e.minstep),u=e.format||YO(n,s,a,e.formatSpecifier,e.formatType,!!e.values),l=e.values?VO(s,e.values,a):UE(s,a);return r&&(i.rem=r),r=l.map((c,f)=>De({index:f/(l.length-1||1),value:c,label:u(c)})),e.extra&&r.length&&r.push(De({index:-1,extra:{value:r[0].value},label:""})),i.source=r,i.add=r,this.value=r,i}});function x4(e){N.call(this,null,e)}function dJ(){return De({})}function hJ(e){const t=p4().test(n=>n.exit);return t.lookup=n=>t.get(e(n)),t}Os(x4,N,{transform(e,t){var n=t.dataflow,i=t.fork(t.NO_SOURCE|t.NO_FIELDS),r=e.item||dJ,s=e.key||Z,o=this.value;return _h(i.encode)&&(i.encode=null),o&&(e.modified("key")||t.modified(s))&&bs("DataJoin does not support modified key function or fields."),o||(t=t.addAll(),this.value=o=hJ(s)),t.visit(t.ADD,a=>{const u=s(a);let l=o.get(u);l?l.exit?(o.empty--,i.add.push(l)):i.mod.push(l):(l=r(a),o.set(u,l),i.add.push(l)),l.datum=a,l.exit=!1}),t.visit(t.MOD,a=>{const u=s(a),l=o.get(u);l&&(l.datum=a,i.mod.push(l))}),t.visit(t.REM,a=>{const u=s(a),l=o.get(u);a===l.datum&&!l.exit&&(i.rem.push(l),l.exit=!0,++o.empty)}),t.changed(t.ADD_MOD)&&i.modifies("datum"),(t.clean()||e.clean&&o.empty>n.cleanThreshold)&&n.runAfter(o.clean),i}});function v4(e){N.call(this,null,e)}Os(v4,N,{transform(e,t){var n=t.fork(t.ADD_REM),i=e.mod||!1,r=e.encoders,s=t.encode;if(_h(s))if(n.changed()||s.every(f=>r[f]))s=s[0],n.encode=null;else return t.StopPropagation;var o=s==="enter",a=r.update||sa,u=r.enter||sa,l=r.exit||sa,c=(s&&!o?r[s]:a)||sa;if(t.changed(t.ADD)&&(t.visit(t.ADD,f=>{u(f,e),a(f,e)}),n.modifies(u.output),n.modifies(a.output),c!==sa&&c!==a&&(t.visit(t.ADD,f=>{c(f,e)}),n.modifies(c.output))),t.changed(t.REM)&&l!==sa&&(t.visit(t.REM,f=>{l(f,e)}),n.modifies(l.output)),o||c!==sa){const f=t.MOD|(e.modified()?t.REFLOW:0);o?(t.visit(f,d=>{const h=u(d,e)||i;(c(d,e)||h)&&n.mod.push(d)}),n.mod.length&&n.modifies(u.output)):t.visit(f,d=>{(c(d,e)||i)&&n.mod.push(d)}),n.mod.length&&n.modifies(c.output)}return n.changed()?n:t.StopPropagation}});function A4(e){N.call(this,[],e)}Os(A4,N,{transform(e,t){if(this.value!=null&&!e.modified())return t.StopPropagation;var n=t.dataflow.locale(),i=t.fork(t.NO_SOURCE|t.NO_FIELDS),r=this.value,s=e.type||tg,o=e.scale,a=+e.limit,u=jE(o,e.count==null?5:e.count,e.minstep),l=!!e.values||s===tg,c=e.format||QO(n,o,u,s,e.formatSpecifier,e.formatType,l),f=e.values||JO(o,u),d,h,g,p,m;return r&&(i.rem=r),s===tg?(a&&f.length>a?(t.dataflow.warn("Symbol legend count exceeds limit, filtering items."),r=f.slice(0,a-1),m=!0):r=f,ho(g=e.size)?(!e.values&&o(r[0])===0&&(r=r.slice(1)),p=r.reduce((y,b)=>Math.max(y,g(b,e)),0)):g=aJ(p=g||8),r=r.map((y,b)=>De({index:b,label:c(y,b,r),value:y,offset:p,size:g(y,e)})),m&&(m=f[r.length],r.push(De({index:r.length,label:`${f.length-r.length} entries`,value:m,offset:p,size:g(m,e)})))):s===gV?(d=o.domain(),h=WO(o,d[0],Ia(d)),f.length<3&&!e.values&&d[0]!==Ia(d)&&(f=[d[0],Ia(d)]),r=f.map((y,b)=>De({index:b,label:c(y,b,f),value:y,perc:h(y)}))):(g=f.length-1,h=CV(o),r=f.map((y,b)=>De({index:b,label:c(y,b,f),value:y,perc:b?h(y):0,perc2:b===g?1:h(f[b+1])}))),i.source=r,i.add=r,this.value=r,i}});const gJ=e=>e.source.x,pJ=e=>e.source.y,mJ=e=>e.target.x,yJ=e=>e.target.y;function Sw(e){N.call(this,{},e)}Sw.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"}]};Os(Sw,N,{transform(e,t){var n=e.sourceX||gJ,i=e.sourceY||pJ,r=e.targetX||mJ,s=e.targetY||yJ,o=e.as||"path",a=e.orient||"vertical",u=e.shape||"line",l=PD.get(u+"-"+a)||PD.get(u);return l||bs("LinkPath unsupported type: "+e.shape+(e.orient?"-"+e.orient:"")),t.visit(t.SOURCE,c=>{c[o]=l(n(c),i(c),r(c),s(c))}),t.reflow(e.modified()).modifies(o)}});const E4=(e,t,n,i)=>"M"+e+","+t+"L"+n+","+i,bJ=(e,t,n,i)=>E4(t*Math.cos(e),t*Math.sin(e),i*Math.cos(n),i*Math.sin(n)),w4=(e,t,n,i)=>{var r=n-e,s=i-t,o=Math.hypot(r,s)/2,a=180*Math.atan2(s,r)/Math.PI;return"M"+e+","+t+"A"+o+","+o+" "+a+" 0 1 "+n+","+i},xJ=(e,t,n,i)=>w4(t*Math.cos(e),t*Math.sin(e),i*Math.cos(n),i*Math.sin(n)),$4=(e,t,n,i)=>{const r=n-e,s=i-t,o=.2*(r+s),a=.2*(s-r);return"M"+e+","+t+"C"+(e+o)+","+(t+a)+" "+(n+a)+","+(i-o)+" "+n+","+i},vJ=(e,t,n,i)=>$4(t*Math.cos(e),t*Math.sin(e),i*Math.cos(n),i*Math.sin(n)),AJ=(e,t,n,i)=>"M"+e+","+t+"V"+i+"H"+n,EJ=(e,t,n,i)=>"M"+e+","+t+"H"+n+"V"+i,wJ=(e,t,n,i)=>{const r=Math.cos(e),s=Math.sin(e),o=Math.cos(n),a=Math.sin(n),u=Math.abs(n-e)>Math.PI?n<=e:n>e;return"M"+t*r+","+t*s+"A"+t+","+t+" 0 0,"+(u?1:0)+" "+t*o+","+t*a+"L"+i*o+","+i*a},$J=(e,t,n,i)=>{const r=(e+n)/2;return"M"+e+","+t+"C"+r+","+t+" "+r+","+i+" "+n+","+i},CJ=(e,t,n,i)=>{const r=(t+i)/2;return"M"+e+","+t+"C"+e+","+r+" "+n+","+r+" "+n+","+i},FJ=(e,t,n,i)=>{const r=Math.cos(e),s=Math.sin(e),o=Math.cos(n),a=Math.sin(n),u=(t+i)/2;return"M"+t*r+","+t*s+"C"+u*r+","+u*s+" "+u*o+","+u*a+" "+i*o+","+i*a},PD=p4({line:E4,"line-radial":bJ,arc:w4,"arc-radial":xJ,curve:$4,"curve-radial":vJ,"orthogonal-horizontal":AJ,"orthogonal-vertical":EJ,"orthogonal-radial":wJ,"diagonal-horizontal":$J,"diagonal-vertical":CJ,"diagonal-radial":FJ});function Dw(e){N.call(this,null,e)}Dw.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"]}]};Os(Dw,N,{transform(e,t){var n=e.as||["startAngle","endAngle"],i=n[0],r=n[1],s=e.field||g4,o=e.startAngle||0,a=e.endAngle!=null?e.endAngle:2*Math.PI,u=t.source,l=u.map(s),c=l.length,f=o,d=(a-o)/S6(l),h=Kn(c),g,p,m;for(e.sort&&h.sort((y,b)=>l[y]-l[b]),g=0;g<c;++g)m=l[h[g]],p=u[h[g]],p[i]=f,p[r]=f+=m*d;return this.value=l,t.reflow(e.modified()).modifies(n)}});const SJ=5;function DJ(e){const t=e.type;return!e.bins&&(t===$l||t===yh||t===bh)}function C4(e){return PE(e)&&e!==yr}const _J=fJ(["set","modified","clear","type","scheme","schemeExtent","schemeCount","domain","domainMin","domainMid","domainMax","domainRaw","domainImplicit","nice","zero","bins","range","rangeStep","round","reverse","interpolate","interpolateGamma"]);function F4(e){N.call(this,null,e),this.modified(!0)}Os(F4,N,{transform(e,t){var n=t.dataflow,i=this.value,r=kJ(e);(!i||r!==i.type)&&(this.value=i=Fe(r)());for(r in e)if(!_J[r]){if(r==="padding"&&C4(i.type))continue;ho(i[r])?i[r](e[r]):n.warn("Unsupported scale property: "+r)}return RJ(i,e,BJ(i,e,OJ(i,e,n))),t.fork(t.NO_SOURCE|t.NO_FIELDS)}});function kJ(e){var t=e.type,n="",i;return t===yr?yr+"-"+$l:(MJ(e)&&(i=e.rawDomain?e.rawDomain.length:e.domain?e.domain.length+ +(e.domainMid!=null):0,n=i===2?yr+"-":i===3?cc+"-":""),(n+t||$l).toLowerCase())}function MJ(e){const t=e.type;return PE(t)&&t!==Ya&&t!==Xa&&(e.scheme||e.range&&e.range.length&&e.range.every(m4))}function OJ(e,t,n){const i=NJ(e,t.domainRaw,n);if(i>-1)return i;var r=t.domain,s=e.type,o=t.zero||t.zero===void 0&&DJ(e),a,u;if(!r)return 0;if(C4(s)&&t.padding&&r[0]!==Ia(r)&&(r=TJ(s,r,t.range,t.padding,t.exponent,t.constant)),(o||t.domainMin!=null||t.domainMax!=null||t.domainMid!=null)&&(a=(r=r.slice()).length-1||1,o&&(r[0]>0&&(r[0]=0),r[a]<0&&(r[a]=0)),t.domainMin!=null&&(r[0]=t.domainMin),t.domainMax!=null&&(r[a]=t.domainMax),t.domainMid!=null)){u=t.domainMid;const l=u>r[a]?a+1:u<r[0]?0:a;l!==a&&n.warn("Scale domainMid exceeds domain min or max.",u),r.splice(l,0,u)}return e.domain(S4(s,r,n)),s===TE&&e.unknown(t.domainImplicit?V2:void 0),t.nice&&e.nice&&e.nice(t.nice!==!0&&jE(e,t.nice)||null),r.length}function NJ(e,t,n){return t?(e.domain(S4(e.type,t,n)),t.length):-1}function TJ(e,t,n,i,r,s){var o=Math.abs(Ia(n)-n[0]),a=o/(o-2*i),u=e===Cs?sJ(t,null,a):e===bh?LD(t,null,a,.5):e===yh?LD(t,null,a,r||1):e===t1?oJ(t,null,a,s||1):rJ(t,null,a);return t=t.slice(),t[0]=u[0],t[t.length-1]=u[1],t}function S4(e,t,n){if(IO(e)){var i=Math.abs(t.reduce((r,s)=>r+(s<0?-1:s>0?1:0),0));i!==t.length&&n.warn("Log scale domain includes zero: "+y4(t))}return t}function BJ(e,t,n){let i=t.bins;if(i&&!_h(i)){const r=e.domain(),s=r[0],o=Ia(r),a=i.step;let u=i.start==null?s:i.start,l=i.stop==null?o:i.stop;a||bs("Scale bins parameter missing step property."),u<s&&(u=a*Math.ceil(s/a)),l>o&&(l=a*Math.floor(o/a)),i=Kn(u,l+a/2,a)}return i?e.bins=i:e.bins&&delete e.bins,e.type===BE&&(i?!t.domain&&!t.domainRaw&&(e.domain(i),n=i.length):e.bins=e.domain()),n}function RJ(e,t,n){var i=e.type,r=t.round||!1,s=t.range;if(t.rangeStep!=null)s=LJ(i,t,n);else if(t.scheme&&(s=PJ(i,t,n),ho(s))){if(e.interpolator)return e.interpolator(s);bs(`Scale type ${i} does not support interpolating color schemes.`)}if(s&&zO(i))return e.interpolator(r1(px(s,t.reverse),t.interpolate,t.interpolateGamma));s&&t.interpolate&&e.interpolate?e.interpolate(IE(t.interpolate,t.interpolateGamma)):ho(e.round)?e.round(r):ho(e.rangeRound)&&e.interpolate(r?ph:Io),s&&e.range(px(s,t.reverse))}function LJ(e,t,n){e!==NO&&e!==ex&&bs("Only band and point scales support rangeStep.");var i=(t.paddingOuter!=null?t.paddingOuter:t.padding)||0,r=e===ex?1:(t.paddingInner!=null?t.paddingInner:t.padding)||0;return[0,t.rangeStep*NE(n,r,i)]}function PJ(e,t,n){var i=t.schemeExtent,r,s;return _h(t.scheme)?s=r1(t.scheme,t.interpolate,t.interpolateGamma):(r=t.scheme.toLowerCase(),s=zE(r),s||bs(`Unrecognized scheme name: ${t.scheme}`)),n=e===i1?n+1:e===BE?n-1:e===Cl||e===n1?+t.schemeCount||SJ:n,zO(e)?ID(s,i,t.reverse):ho(s)?qO(ID(s,i),n):e===TE?s:s.slice(0,n)}function ID(e,t,n){return ho(e)&&(t||n)?UO(e,px(t||[0,1],n)):e}function px(e,t){return t?e.slice().reverse():e}function D4(e){N.call(this,null,e)}Os(D4,N,{transform(e,t){const n=e.modified("sort")||t.changed(t.ADD)||t.modified(e.sort.fields)||t.modified("datum");return n&&t.source.sort(mu(e.sort)),this.modified(n),t}});const zD="zero",_4="center",k4="normalize",M4=["y0","y1"];function _w(e){N.call(this,null,e)}_w.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:zD,values:[zD,_4,k4]},{name:"as",type:"string",array:!0,length:2,default:M4}]};Os(_w,N,{transform(e,t){var n=e.as||M4,i=n[0],r=n[1],s=mu(e.sort),o=e.field||g4,a=e.offset===_4?IJ:e.offset===k4?zJ:jJ,u,l,c,f;for(u=UJ(t.source,e.groupby,s,o),l=0,c=u.length,f=u.max;l<c;++l)a(u[l],f,o,i,r);return t.reflow(e.modified()).modifies(n)}});function IJ(e,t,n,i,r){for(var s=(t-e.sum)/2,o=e.length,a=0,u;a<o;++a)u=e[a],u[i]=s,u[r]=s+=Math.abs(n(u))}function zJ(e,t,n,i,r){for(var s=1/e.sum,o=0,a=e.length,u=0,l=0,c;u<a;++u)c=e[u],c[i]=o,c[r]=o=s*(l+=Math.abs(n(c)))}function jJ(e,t,n,i,r){for(var s=0,o=0,a=e.length,u=0,l,c;u<a;++u)c=e[u],l=+n(c),l<0?(c[i]=o,c[r]=o+=l):(c[i]=s,c[r]=s+=l)}function UJ(e,t,n,i){var r=[],s=p=>p(c),o,a,u,l,c,f,d,h,g;if(t==null)r.push(e.slice());else for(o={},a=0,u=e.length;a<u;++a)c=e[a],f=t.map(s),d=o[f],d||(o[f]=d=[],r.push(d)),d.push(c);for(f=0,g=0,l=r.length;f<l;++f){for(d=r[f],a=0,h=0,u=d.length;a<u;++a)h+=Math.abs(i(d[a]));d.sum=h,h>g&&(g=h),n&&d.sort(n)}return r.max=g,r}const qJ=Object.freeze(Object.defineProperty({__proto__:null,axisticks:b4,datajoin:x4,encode:v4,legendentries:A4,linkpath:Sw,pie:Dw,scale:F4,sortitems:D4,stack:_w},Symbol.toStringTag,{value:"Module"}));function pc(e,t,n){return e.fields=t||[],e.fname=n,e}function WJ(e){return e==null?null:e.fname}function lg(e){return e==null?null:e.fields}function GJ(e){return e.length===1?HJ(e[0]):VJ(e)}const HJ=e=>function(t){return t[e]},VJ=e=>{const t=e.length;return function(n){for(let i=0;i<t;++i)n=n[e[i]];return n}};function go(e){throw Error(e)}function YJ(e){const t=[],n=e.length;let i=null,r=0,s="",o,a,u;e=e+"";function l(){t.push(s+e.substring(o,a)),s="",o=a+1}for(o=a=0;a<n;++a)if(u=e[a],u==="\\")s+=e.substring(o,a++),o=a;else if(u===i)l(),i=null,r=-1;else{if(i)continue;o===r&&u==='"'||o===r&&u==="'"?(o=a+1,i=u):u==="."&&!r?a>o?l():o=a+1:u==="["?(a>o&&l(),r=o=a+1):u==="]"&&(r||go("Access path missing open bracket: "+e),r>0&&l(),r=0,o=a+1)}return r&&go("Access path missing closing bracket: "+e),i&&go("Access path missing closing quote: "+e),a>o&&(a++,l()),t}function O4(e,t,n){const i=YJ(e);return e=i.length===1?i[0]:e,pc((n&&n.get||GJ)(i),[e],t||e)}O4("id");const Dd=pc(e=>e,[],"identity"),XJ=pc(()=>0,[],"zero"),KJ=pc(()=>1,[],"one");pc(()=>!0,[],"true");pc(()=>!1,[],"false");var kw=Array.isArray;function Mw(e){return e!=null?kw(e)?e:[e]:[]}function Fs(e){return typeof e=="function"}function _d(e){return Fs(e)?e:()=>e}function N4(e){for(let t,n,i=1,r=arguments.length;i<r;++i){t=arguments[i];for(n in t)e[n]=t[n]}return e}function JJ(e,t){let n=0,i,r,s,o;if(e&&(i=e.length))if(t==null){for(r=e[n];n<i&&(r==null||r!==r);r=e[++n]);for(s=o=r;n<i;++n)r=e[n],r!=null&&(r<s&&(s=r),r>o&&(o=r))}else{for(r=t(e[n]);n<i&&(r==null||r!==r);r=t(e[++n]));for(s=o=r;n<i;++n)r=t(e[n]),r!=null&&(r<s&&(s=r),r>o&&(o=r))}return[s,o]}function Rr(e,t,n){const i=e.prototype=Object.create(t.prototype);return Object.defineProperty(i,"constructor",{value:e,writable:!0,enumerable:!0,configurable:!0}),N4(i,n)}function jD(e){return typeof e=="number"}function QJ(e){const t={},n=e.length;for(let i=0;i<n;++i)t[e[i]]=!0;return t}var ne=1e-6,ap=1e-12,pe=Math.PI,nt=pe/2,up=pe/4,yn=pe*2,rt=180/pe,he=pe/180,me=Math.abs,mc=Math.atan,pi=Math.atan2,ie=Math.cos,E0=Math.ceil,T4=Math.exp,mx=Math.hypot,lp=Math.log,hb=Math.pow,ee=Math.sin,ui=Math.sign||function(e){return e>0?1:e<0?-1:0},bn=Math.sqrt,Ow=Math.tan;function B4(e){return e>1?0:e<-1?pe:Math.acos(e)}function In(e){return e>1?nt:e<-1?-nt:Math.asin(e)}function kt(){}function cp(e,t){e&&qD.hasOwnProperty(e.type)&&qD[e.type](e,t)}var UD={Feature:function(e,t){cp(e.geometry,t)},FeatureCollection:function(e,t){for(var n=e.features,i=-1,r=n.length;++i<r;)cp(n[i].geometry,t)}},qD={Sphere:function(e,t){t.sphere()},Point:function(e,t){e=e.coordinates,t.point(e[0],e[1],e[2])},MultiPoint:function(e,t){for(var n=e.coordinates,i=-1,r=n.length;++i<r;)e=n[i],t.point(e[0],e[1],e[2])},LineString:function(e,t){yx(e.coordinates,t,0)},MultiLineString:function(e,t){for(var n=e.coordinates,i=-1,r=n.length;++i<r;)yx(n[i],t,0)},Polygon:function(e,t){WD(e.coordinates,t)},MultiPolygon:function(e,t){for(var n=e.coordinates,i=-1,r=n.length;++i<r;)WD(n[i],t)},GeometryCollection:function(e,t){for(var n=e.geometries,i=-1,r=n.length;++i<r;)cp(n[i],t)}};function yx(e,t,n){var i=-1,r=e.length-n,s;for(t.lineStart();++i<r;)s=e[i],t.point(s[0],s[1],s[2]);t.lineEnd()}function WD(e,t){var n=-1,i=e.length;for(t.polygonStart();++n<i;)yx(e[n],t,1);t.polygonEnd()}function ls(e,t){e&&UD.hasOwnProperty(e.type)?UD[e.type](e,t):cp(e,t)}var fp=new gn,dp=new gn,R4,L4,bx,xx,vx,Sr={point:kt,lineStart:kt,lineEnd:kt,polygonStart:function(){fp=new gn,Sr.lineStart=ZJ,Sr.lineEnd=eQ},polygonEnd:function(){var e=+fp;dp.add(e<0?yn+e:e),this.lineStart=this.lineEnd=this.point=kt},sphere:function(){dp.add(yn)}};function ZJ(){Sr.point=tQ}function eQ(){P4(R4,L4)}function tQ(e,t){Sr.point=P4,R4=e,L4=t,e*=he,t*=he,bx=e,xx=ie(t=t/2+up),vx=ee(t)}function P4(e,t){e*=he,t*=he,t=t/2+up;var n=e-bx,i=n>=0?1:-1,r=i*n,s=ie(t),o=ee(t),a=vx*o,u=xx*s+a*ie(r),l=a*i*ee(r);fp.add(pi(l,u)),bx=e,xx=s,vx=o}function nQ(e){return dp=new gn,ls(e,Sr),dp*2}function hp(e){return[pi(e[1],e[0]),In(e[2])]}function Ka(e){var t=e[0],n=e[1],i=ie(n);return[i*ie(t),i*ee(t),ee(n)]}function w0(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function Ol(e,t){return[e[1]*t[2]-e[2]*t[1],e[2]*t[0]-e[0]*t[2],e[0]*t[1]-e[1]*t[0]]}function gb(e,t){e[0]+=t[0],e[1]+=t[1],e[2]+=t[2]}function $0(e,t){return[e[0]*t,e[1]*t,e[2]*t]}function gp(e){var t=bn(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]/=t,e[1]/=t,e[2]/=t}var Je,Fn,et,Hn,xa,I4,z4,ol,Vf,Vs,Ss,ns={point:Ax,lineStart:GD,lineEnd:HD,polygonStart:function(){ns.point=U4,ns.lineStart=iQ,ns.lineEnd=rQ,Vf=new gn,Sr.polygonStart()},polygonEnd:function(){Sr.polygonEnd(),ns.point=Ax,ns.lineStart=GD,ns.lineEnd=HD,fp<0?(Je=-(et=180),Fn=-(Hn=90)):Vf>ne?Hn=90:Vf<-ne&&(Fn=-90),Ss[0]=Je,Ss[1]=et},sphere:function(){Je=-(et=180),Fn=-(Hn=90)}};function Ax(e,t){Vs.push(Ss=[Je=e,et=e]),t<Fn&&(Fn=t),t>Hn&&(Hn=t)}function j4(e,t){var n=Ka([e*he,t*he]);if(ol){var i=Ol(ol,n),r=[i[1],-i[0],0],s=Ol(r,i);gp(s),s=hp(s);var o=e-xa,a=o>0?1:-1,u=s[0]*rt*a,l,c=me(o)>180;c^(a*xa<u&&u<a*e)?(l=s[1]*rt,l>Hn&&(Hn=l)):(u=(u+360)%360-180,c^(a*xa<u&&u<a*e)?(l=-s[1]*rt,l<Fn&&(Fn=l)):(t<Fn&&(Fn=t),t>Hn&&(Hn=t))),c?e<xa?Gn(Je,e)>Gn(Je,et)&&(et=e):Gn(e,et)>Gn(Je,et)&&(Je=e):et>=Je?(e<Je&&(Je=e),e>et&&(et=e)):e>xa?Gn(Je,e)>Gn(Je,et)&&(et=e):Gn(e,et)>Gn(Je,et)&&(Je=e)}else Vs.push(Ss=[Je=e,et=e]);t<Fn&&(Fn=t),t>Hn&&(Hn=t),ol=n,xa=e}function GD(){ns.point=j4}function HD(){Ss[0]=Je,Ss[1]=et,ns.point=Ax,ol=null}function U4(e,t){if(ol){var n=e-xa;Vf.add(me(n)>180?n+(n>0?360:-360):n)}else I4=e,z4=t;Sr.point(e,t),j4(e,t)}function iQ(){Sr.lineStart()}function rQ(){U4(I4,z4),Sr.lineEnd(),me(Vf)>ne&&(Je=-(et=180)),Ss[0]=Je,Ss[1]=et,ol=null}function Gn(e,t){return(t-=e)<0?t+360:t}function sQ(e,t){return e[0]-t[0]}function VD(e,t){return e[0]<=e[1]?e[0]<=t&&t<=e[1]:t<e[0]||e[1]<t}function oQ(e){var t,n,i,r,s,o,a;if(Hn=et=-(Je=Fn=1/0),Vs=[],ls(e,ns),n=Vs.length){for(Vs.sort(sQ),t=1,i=Vs[0],s=[i];t<n;++t)r=Vs[t],VD(i,r[0])||VD(i,r[1])?(Gn(i[0],r[1])>Gn(i[0],i[1])&&(i[1]=r[1]),Gn(r[0],i[1])>Gn(i[0],i[1])&&(i[0]=r[0])):s.push(i=r);for(o=-1/0,n=s.length-1,t=0,i=s[n];t<=n;i=r,++t)r=s[t],(a=Gn(i[1],r[0]))>o&&(o=a,Je=r[0],et=i[1])}return Vs=Ss=null,Je===1/0||Fn===1/0?[[NaN,NaN],[NaN,NaN]]:[[Je,Fn],[et,Hn]]}var $f,pp,mp,yp,bp,xp,vp,Ap,Ex,wx,$x,q4,W4,un,ln,cn,Ri={sphere:kt,point:Nw,lineStart:YD,lineEnd:XD,polygonStart:function(){Ri.lineStart=lQ,Ri.lineEnd=cQ},polygonEnd:function(){Ri.lineStart=YD,Ri.lineEnd=XD}};function Nw(e,t){e*=he,t*=he;var n=ie(t);kh(n*ie(e),n*ee(e),ee(t))}function kh(e,t,n){++$f,mp+=(e-mp)/$f,yp+=(t-yp)/$f,bp+=(n-bp)/$f}function YD(){Ri.point=aQ}function aQ(e,t){e*=he,t*=he;var n=ie(t);un=n*ie(e),ln=n*ee(e),cn=ee(t),Ri.point=uQ,kh(un,ln,cn)}function uQ(e,t){e*=he,t*=he;var n=ie(t),i=n*ie(e),r=n*ee(e),s=ee(t),o=pi(bn((o=ln*s-cn*r)*o+(o=cn*i-un*s)*o+(o=un*r-ln*i)*o),un*i+ln*r+cn*s);pp+=o,xp+=o*(un+(un=i)),vp+=o*(ln+(ln=r)),Ap+=o*(cn+(cn=s)),kh(un,ln,cn)}function XD(){Ri.point=Nw}function lQ(){Ri.point=fQ}function cQ(){G4(q4,W4),Ri.point=Nw}function fQ(e,t){q4=e,W4=t,e*=he,t*=he,Ri.point=G4;var n=ie(t);un=n*ie(e),ln=n*ee(e),cn=ee(t),kh(un,ln,cn)}function G4(e,t){e*=he,t*=he;var n=ie(t),i=n*ie(e),r=n*ee(e),s=ee(t),o=ln*s-cn*r,a=cn*i-un*s,u=un*r-ln*i,l=mx(o,a,u),c=In(l),f=l&&-c/l;Ex.add(f*o),wx.add(f*a),$x.add(f*u),pp+=c,xp+=c*(un+(un=i)),vp+=c*(ln+(ln=r)),Ap+=c*(cn+(cn=s)),kh(un,ln,cn)}function dQ(e){$f=pp=mp=yp=bp=xp=vp=Ap=0,Ex=new gn,wx=new gn,$x=new gn,ls(e,Ri);var t=+Ex,n=+wx,i=+$x,r=mx(t,n,i);return r<ap&&(t=xp,n=vp,i=Ap,pp<ne&&(t=mp,n=yp,i=bp),r=mx(t,n,i),r<ap)?[NaN,NaN]:[pi(n,t)*rt,In(i/r)*rt]}function Cx(e,t){function n(i,r){return i=e(i,r),t(i[0],i[1])}return e.invert&&t.invert&&(n.invert=function(i,r){return i=t.invert(i,r),i&&e.invert(i[0],i[1])}),n}function Fx(e,t){return me(e)>pe&&(e-=Math.round(e/yn)*yn),[e,t]}Fx.invert=Fx;function H4(e,t,n){return(e%=yn)?t||n?Cx(JD(e),QD(t,n)):JD(e):t||n?QD(t,n):Fx}function KD(e){return function(t,n){return t+=e,me(t)>pe&&(t-=Math.round(t/yn)*yn),[t,n]}}function JD(e){var t=KD(e);return t.invert=KD(-e),t}function QD(e,t){var n=ie(e),i=ee(e),r=ie(t),s=ee(t);function o(a,u){var l=ie(u),c=ie(a)*l,f=ee(a)*l,d=ee(u),h=d*n+c*i;return[pi(f*r-h*s,c*n-d*i),In(h*r+f*s)]}return o.invert=function(a,u){var l=ie(u),c=ie(a)*l,f=ee(a)*l,d=ee(u),h=d*r-f*s;return[pi(f*r+d*s,c*n+h*i),In(h*n-c*i)]},o}function hQ(e){e=H4(e[0]*he,e[1]*he,e.length>2?e[2]*he:0);function t(n){return n=e(n[0]*he,n[1]*he),n[0]*=rt,n[1]*=rt,n}return t.invert=function(n){return n=e.invert(n[0]*he,n[1]*he),n[0]*=rt,n[1]*=rt,n},t}function gQ(e,t,n,i,r,s){if(n){var o=ie(t),a=ee(t),u=i*n;r==null?(r=t+i*yn,s=t-u/2):(r=ZD(o,r),s=ZD(o,s),(i>0?r<s:r>s)&&(r+=i*yn));for(var l,c=r;i>0?c>s:c<s;c-=u)l=hp([o,-a*ie(c),-a*ee(c)]),e.point(l[0],l[1])}}function ZD(e,t){t=Ka(t),t[0]-=e,gp(t);var n=B4(-t[1]);return((-t[2]<0?-n:n)+yn-ne)%yn}function V4(){var e=[],t;return{point:function(n,i,r){t.push([n,i,r])},lineStart:function(){e.push(t=[])},lineEnd:kt,rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}}function cg(e,t){return me(e[0]-t[0])<ne&&me(e[1]-t[1])<ne}function C0(e,t,n,i){this.x=e,this.z=t,this.o=n,this.e=i,this.v=!1,this.n=this.p=null}function Y4(e,t,n,i,r){var s=[],o=[],a,u;if(e.forEach(function(g){if(!((p=g.length-1)<=0)){var p,m=g[0],y=g[p],b;if(cg(m,y)){if(!m[2]&&!y[2]){for(r.lineStart(),a=0;a<p;++a)r.point((m=g[a])[0],m[1]);r.lineEnd();return}y[0]+=2*ne}s.push(b=new C0(m,g,null,!0)),o.push(b.o=new C0(m,null,b,!1)),s.push(b=new C0(y,g,null,!1)),o.push(b.o=new C0(y,null,b,!0))}}),!!s.length){for(o.sort(t),e_(s),e_(o),a=0,u=o.length;a<u;++a)o[a].e=n=!n;for(var l=s[0],c,f;;){for(var d=l,h=!0;d.v;)if((d=d.n)===l)return;c=d.z,r.lineStart();do{if(d.v=d.o.v=!0,d.e){if(h)for(a=0,u=c.length;a<u;++a)r.point((f=c[a])[0],f[1]);else i(d.x,d.n.x,1,r);d=d.n}else{if(h)for(c=d.p.z,a=c.length-1;a>=0;--a)r.point((f=c[a])[0],f[1]);else i(d.x,d.p.x,-1,r);d=d.p}d=d.o,c=d.z,h=!h}while(!d.v);r.lineEnd()}}}function e_(e){if(t=e.length){for(var t,n=0,i=e[0],r;++n<t;)i.n=r=e[n],r.p=i,i=r;i.n=r=e[0],r.p=i}}function pb(e){return me(e[0])<=pe?e[0]:ui(e[0])*((me(e[0])+pe)%yn-pe)}function pQ(e,t){var n=pb(t),i=t[1],r=ee(i),s=[ee(n),-ie(n),0],o=0,a=0,u=new gn;r===1?i=nt+ne:r===-1&&(i=-nt-ne);for(var l=0,c=e.length;l<c;++l)if(d=(f=e[l]).length)for(var f,d,h=f[d-1],g=pb(h),p=h[1]/2+up,m=ee(p),y=ie(p),b=0;b<d;++b,g=v,m=w,y=E,h=x){var x=f[b],v=pb(x),A=x[1]/2+up,w=ee(A),E=ie(A),$=v-g,k=$>=0?1:-1,F=k*$,D=F>pe,T=m*w;if(u.add(pi(T*k*ee(F),y*E+T*ie(F))),o+=D?$+k*yn:$,D^g>=n^v>=n){var C=Ol(Ka(h),Ka(x));gp(C);var _=Ol(s,C);gp(_);var S=(D^$>=0?-1:1)*In(_[2]);(i>S||i===S&&(C[0]||C[1]))&&(a+=D^$>=0?1:-1)}}return(o<-ne||o<ne&&u<-ap)^a&1}function X4(e,t,n,i){return function(r){var s=t(r),o=V4(),a=t(o),u=!1,l,c,f,d={point:h,lineStart:p,lineEnd:m,polygonStart:function(){d.point=y,d.lineStart=b,d.lineEnd=x,c=[],l=[]},polygonEnd:function(){d.point=h,d.lineStart=p,d.lineEnd=m,c=F6(c);var v=pQ(l,i);c.length?(u||(r.polygonStart(),u=!0),Y4(c,yQ,v,n,r)):v&&(u||(r.polygonStart(),u=!0),r.lineStart(),n(null,null,1,r),r.lineEnd()),u&&(r.polygonEnd(),u=!1),c=l=null},sphere:function(){r.polygonStart(),r.lineStart(),n(null,null,1,r),r.lineEnd(),r.polygonEnd()}};function h(v,A){e(v,A)&&r.point(v,A)}function g(v,A){s.point(v,A)}function p(){d.point=g,s.lineStart()}function m(){d.point=h,s.lineEnd()}function y(v,A){f.push([v,A]),a.point(v,A)}function b(){a.lineStart(),f=[]}function x(){y(f[0][0],f[0][1]),a.lineEnd();var v=a.clean(),A=o.result(),w,E=A.length,$,k,F;if(f.pop(),l.push(f),f=null,!!E){if(v&1){if(k=A[0],($=k.length-1)>0){for(u||(r.polygonStart(),u=!0),r.lineStart(),w=0;w<$;++w)r.point((F=k[w])[0],F[1]);r.lineEnd()}return}E>1&&v&2&&A.push(A.pop().concat(A.shift())),c.push(A.filter(mQ))}}return d}}function mQ(e){return e.length>1}function yQ(e,t){return((e=e.x)[0]<0?e[1]-nt-ne:nt-e[1])-((t=t.x)[0]<0?t[1]-nt-ne:nt-t[1])}const t_=X4(function(){return!0},bQ,vQ,[-pe,-nt]);function bQ(e){var t=NaN,n=NaN,i=NaN,r;return{lineStart:function(){e.lineStart(),r=1},point:function(s,o){var a=s>0?pe:-pe,u=me(s-t);me(u-pe)<ne?(e.point(t,n=(n+o)/2>0?nt:-nt),e.point(i,n),e.lineEnd(),e.lineStart(),e.point(a,n),e.point(s,n),r=0):i!==a&&u>=pe&&(me(t-i)<ne&&(t-=i*ne),me(s-a)<ne&&(s-=a*ne),n=xQ(t,n,s,o),e.point(i,n),e.lineEnd(),e.lineStart(),e.point(a,n),r=0),e.point(t=s,n=o),i=a},lineEnd:function(){e.lineEnd(),t=n=NaN},clean:function(){return 2-r}}}function xQ(e,t,n,i){var r,s,o=ee(e-n);return me(o)>ne?mc((ee(t)*(s=ie(i))*ee(n)-ee(i)*(r=ie(t))*ee(e))/(r*s*o)):(t+i)/2}function vQ(e,t,n,i){var r;if(e==null)r=n*nt,i.point(-pe,r),i.point(0,r),i.point(pe,r),i.point(pe,0),i.point(pe,-r),i.point(0,-r),i.point(-pe,-r),i.point(-pe,0),i.point(-pe,r);else if(me(e[0]-t[0])>ne){var s=e[0]<t[0]?pe:-pe;r=n*s/2,i.point(-s,r),i.point(0,r),i.point(s,r)}else i.point(t[0],t[1])}function AQ(e){var t=ie(e),n=6*he,i=t>0,r=me(t)>ne;function s(c,f,d,h){gQ(h,e,n,d,c,f)}function o(c,f){return ie(c)*ie(f)>t}function a(c){var f,d,h,g,p;return{lineStart:function(){g=h=!1,p=1},point:function(m,y){var b=[m,y],x,v=o(m,y),A=i?v?0:l(m,y):v?l(m+(m<0?pe:-pe),y):0;if(!f&&(g=h=v)&&c.lineStart(),v!==h&&(x=u(f,b),(!x||cg(f,x)||cg(b,x))&&(b[2]=1)),v!==h)p=0,v?(c.lineStart(),x=u(b,f),c.point(x[0],x[1])):(x=u(f,b),c.point(x[0],x[1],2),c.lineEnd()),f=x;else if(r&&f&&i^v){var w;!(A&d)&&(w=u(b,f,!0))&&(p=0,i?(c.lineStart(),c.point(w[0][0],w[0][1]),c.point(w[1][0],w[1][1]),c.lineEnd()):(c.point(w[1][0],w[1][1]),c.lineEnd(),c.lineStart(),c.point(w[0][0],w[0][1],3)))}v&&(!f||!cg(f,b))&&c.point(b[0],b[1]),f=b,h=v,d=A},lineEnd:function(){h&&c.lineEnd(),f=null},clean:function(){return p|(g&&h)<<1}}}function u(c,f,d){var h=Ka(c),g=Ka(f),p=[1,0,0],m=Ol(h,g),y=w0(m,m),b=m[0],x=y-b*b;if(!x)return!d&&c;var v=t*y/x,A=-t*b/x,w=Ol(p,m),E=$0(p,v),$=$0(m,A);gb(E,$);var k=w,F=w0(E,k),D=w0(k,k),T=F*F-D*(w0(E,E)-1);if(!(T<0)){var C=bn(T),_=$0(k,(-F-C)/D);if(gb(_,E),_=hp(_),!d)return _;var S=c[0],M=f[0],O=c[1],B=f[1],I;M<S&&(I=S,S=M,M=I);var G=M-S,J=me(G-pe)<ne,oe=J||G<ne;if(!J&&B<O&&(I=O,O=B,B=I),oe?J?O+B>0^_[1]<(me(_[0]-S)<ne?O:B):O<=_[1]&&_[1]<=B:G>pe^(S<=_[0]&&_[0]<=M)){var be=$0(k,(-F+C)/D);return gb(be,E),[_,hp(be)]}}}function l(c,f){var d=i?e:pe-e,h=0;return c<-d?h|=1:c>d&&(h|=2),f<-d?h|=4:f>d&&(h|=8),h}return X4(o,a,s,i?[0,-e]:[-pe,e-pe])}function EQ(e,t,n,i,r,s){var o=e[0],a=e[1],u=t[0],l=t[1],c=0,f=1,d=u-o,h=l-a,g;if(g=n-o,!(!d&&g>0)){if(g/=d,d<0){if(g<c)return;g<f&&(f=g)}else if(d>0){if(g>f)return;g>c&&(c=g)}if(g=r-o,!(!d&&g<0)){if(g/=d,d<0){if(g>f)return;g>c&&(c=g)}else if(d>0){if(g<c)return;g<f&&(f=g)}if(g=i-a,!(!h&&g>0)){if(g/=h,h<0){if(g<c)return;g<f&&(f=g)}else if(h>0){if(g>f)return;g>c&&(c=g)}if(g=s-a,!(!h&&g<0)){if(g/=h,h<0){if(g>f)return;g>c&&(c=g)}else if(h>0){if(g<c)return;g<f&&(f=g)}return c>0&&(e[0]=o+c*d,e[1]=a+c*h),f<1&&(t[0]=o+f*d,t[1]=a+f*h),!0}}}}}var Cf=1e9,F0=-Cf;function K4(e,t,n,i){function r(l,c){return e<=l&&l<=n&&t<=c&&c<=i}function s(l,c,f,d){var h=0,g=0;if(l==null||(h=o(l,f))!==(g=o(c,f))||u(l,c)<0^f>0)do d.point(h===0||h===3?e:n,h>1?i:t);while((h=(h+f+4)%4)!==g);else d.point(c[0],c[1])}function o(l,c){return me(l[0]-e)<ne?c>0?0:3:me(l[0]-n)<ne?c>0?2:1:me(l[1]-t)<ne?c>0?1:0:c>0?3:2}function a(l,c){return u(l.x,c.x)}function u(l,c){var f=o(l,1),d=o(c,1);return f!==d?f-d:f===0?c[1]-l[1]:f===1?l[0]-c[0]:f===2?l[1]-c[1]:c[0]-l[0]}return function(l){var c=l,f=V4(),d,h,g,p,m,y,b,x,v,A,w,E={point:$,lineStart:T,lineEnd:C,polygonStart:F,polygonEnd:D};function $(S,M){r(S,M)&&c.point(S,M)}function k(){for(var S=0,M=0,O=h.length;M<O;++M)for(var B=h[M],I=1,G=B.length,J=B[0],oe,be,ve=J[0],Pe=J[1];I<G;++I)oe=ve,be=Pe,J=B[I],ve=J[0],Pe=J[1],be<=i?Pe>i&&(ve-oe)*(i-be)>(Pe-be)*(e-oe)&&++S:Pe<=i&&(ve-oe)*(i-be)<(Pe-be)*(e-oe)&&--S;return S}function F(){c=f,d=[],h=[],w=!0}function D(){var S=k(),M=w&&S,O=(d=F6(d)).length;(M||O)&&(l.polygonStart(),M&&(l.lineStart(),s(null,null,1,l),l.lineEnd()),O&&Y4(d,a,S,s,l),l.polygonEnd()),c=l,d=h=g=null}function T(){E.point=_,h&&h.push(g=[]),A=!0,v=!1,b=x=NaN}function C(){d&&(_(p,m),y&&v&&f.rejoin(),d.push(f.result())),E.point=$,v&&c.lineEnd()}function _(S,M){var O=r(S,M);if(h&&g.push([S,M]),A)p=S,m=M,y=O,A=!1,O&&(c.lineStart(),c.point(S,M));else if(O&&v)c.point(S,M);else{var B=[b=Math.max(F0,Math.min(Cf,b)),x=Math.max(F0,Math.min(Cf,x))],I=[S=Math.max(F0,Math.min(Cf,S)),M=Math.max(F0,Math.min(Cf,M))];EQ(B,I,e,t,n,i)?(v||(c.lineStart(),c.point(B[0],B[1])),c.point(I[0],I[1]),O||c.lineEnd(),w=!1):O&&(c.lineStart(),c.point(S,M),w=!1)}b=S,x=M,v=O}return E}}function n_(e,t,n){var i=Kn(e,t-ne,n).concat(t);return function(r){return i.map(function(s){return[r,s]})}}function i_(e,t,n){var i=Kn(e,t-ne,n).concat(t);return function(r){return i.map(function(s){return[s,r]})}}function wQ(){var e,t,n,i,r,s,o,a,u=10,l=u,c=90,f=360,d,h,g,p,m=2.5;function y(){return{type:"MultiLineString",coordinates:b()}}function b(){return Kn(E0(i/c)*c,n,c).map(g).concat(Kn(E0(a/f)*f,o,f).map(p)).concat(Kn(E0(t/u)*u,e,u).filter(function(x){return me(x%c)>ne}).map(d)).concat(Kn(E0(s/l)*l,r,l).filter(function(x){return me(x%f)>ne}).map(h))}return y.lines=function(){return b().map(function(x){return{type:"LineString",coordinates:x}})},y.outline=function(){return{type:"Polygon",coordinates:[g(i).concat(p(o).slice(1),g(n).reverse().slice(1),p(a).reverse().slice(1))]}},y.extent=function(x){return arguments.length?y.extentMajor(x).extentMinor(x):y.extentMinor()},y.extentMajor=function(x){return arguments.length?(i=+x[0][0],n=+x[1][0],a=+x[0][1],o=+x[1][1],i>n&&(x=i,i=n,n=x),a>o&&(x=a,a=o,o=x),y.precision(m)):[[i,a],[n,o]]},y.extentMinor=function(x){return arguments.length?(t=+x[0][0],e=+x[1][0],s=+x[0][1],r=+x[1][1],t>e&&(x=t,t=e,e=x),s>r&&(x=s,s=r,r=x),y.precision(m)):[[t,s],[e,r]]},y.step=function(x){return arguments.length?y.stepMajor(x).stepMinor(x):y.stepMinor()},y.stepMajor=function(x){return arguments.length?(c=+x[0],f=+x[1],y):[c,f]},y.stepMinor=function(x){return arguments.length?(u=+x[0],l=+x[1],y):[u,l]},y.precision=function(x){return arguments.length?(m=+x,d=n_(s,r,90),h=i_(t,e,m),g=n_(a,o,90),p=i_(i,n,m),y):m},y.extentMajor([[-180,-90+ne],[180,90-ne]]).extentMinor([[-180,-80-ne],[180,80+ne]])}const kd=e=>e;var mb=new gn,Sx=new gn,J4,Q4,Dx,_x,Js={point:kt,lineStart:kt,lineEnd:kt,polygonStart:function(){Js.lineStart=$Q,Js.lineEnd=FQ},polygonEnd:function(){Js.lineStart=Js.lineEnd=Js.point=kt,mb.add(me(Sx)),Sx=new gn},result:function(){var e=mb/2;return mb=new gn,e}};function $Q(){Js.point=CQ}function CQ(e,t){Js.point=Z4,J4=Dx=e,Q4=_x=t}function Z4(e,t){Sx.add(_x*e-Dx*t),Dx=e,_x=t}function FQ(){Z4(J4,Q4)}const r_=Js;var Nl=1/0,Ep=Nl,Md=-Nl,wp=Md,SQ={point:DQ,lineStart:kt,lineEnd:kt,polygonStart:kt,polygonEnd:kt,result:function(){var e=[[Nl,Ep],[Md,wp]];return Md=wp=-(Ep=Nl=1/0),e}};function DQ(e,t){e<Nl&&(Nl=e),e>Md&&(Md=e),t<Ep&&(Ep=t),t>wp&&(wp=t)}const $p=SQ;var kx=0,Mx=0,Ff=0,Cp=0,Fp=0,Qu=0,Ox=0,Nx=0,Sf=0,eN,tN,lr,cr,Ti={point:Ja,lineStart:s_,lineEnd:o_,polygonStart:function(){Ti.lineStart=MQ,Ti.lineEnd=OQ},polygonEnd:function(){Ti.point=Ja,Ti.lineStart=s_,Ti.lineEnd=o_},result:function(){var e=Sf?[Ox/Sf,Nx/Sf]:Qu?[Cp/Qu,Fp/Qu]:Ff?[kx/Ff,Mx/Ff]:[NaN,NaN];return kx=Mx=Ff=Cp=Fp=Qu=Ox=Nx=Sf=0,e}};function Ja(e,t){kx+=e,Mx+=t,++Ff}function s_(){Ti.point=_Q}function _Q(e,t){Ti.point=kQ,Ja(lr=e,cr=t)}function kQ(e,t){var n=e-lr,i=t-cr,r=bn(n*n+i*i);Cp+=r*(lr+e)/2,Fp+=r*(cr+t)/2,Qu+=r,Ja(lr=e,cr=t)}function o_(){Ti.point=Ja}function MQ(){Ti.point=NQ}function OQ(){nN(eN,tN)}function NQ(e,t){Ti.point=nN,Ja(eN=lr=e,tN=cr=t)}function nN(e,t){var n=e-lr,i=t-cr,r=bn(n*n+i*i);Cp+=r*(lr+e)/2,Fp+=r*(cr+t)/2,Qu+=r,r=cr*e-lr*t,Ox+=r*(lr+e),Nx+=r*(cr+t),Sf+=r*3,Ja(lr=e,cr=t)}const a_=Ti;function iN(e){this._context=e}iN.prototype={_radius:4.5,pointRadius:function(e){return this._radius=e,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){this._line===0&&this._context.closePath(),this._point=NaN},point:function(e,t){switch(this._point){case 0:{this._context.moveTo(e,t),this._point=1;break}case 1:{this._context.lineTo(e,t);break}default:{this._context.moveTo(e+this._radius,t),this._context.arc(e,t,this._radius,0,yn);break}}},result:kt};var Tx=new gn,yb,rN,sN,Df,_f,Sp={point:kt,lineStart:function(){Sp.point=TQ},lineEnd:function(){yb&&oN(rN,sN),Sp.point=kt},polygonStart:function(){yb=!0},polygonEnd:function(){yb=null},result:function(){var e=+Tx;return Tx=new gn,e}};function TQ(e,t){Sp.point=oN,rN=Df=e,sN=_f=t}function oN(e,t){Df-=e,_f-=t,Tx.add(bn(Df*Df+_f*_f)),Df=e,_f=t}const u_=Sp;let l_,Dp,c_,f_;class d_{constructor(t){this._append=t==null?aN:BQ(t),this._radius=4.5,this._=""}pointRadius(t){return this._radius=+t,this}polygonStart(){this._line=0}polygonEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){this._line===0&&(this._+="Z"),this._point=NaN}point(t,n){switch(this._point){case 0:{this._append`M${t},${n}`,this._point=1;break}case 1:{this._append`L${t},${n}`;break}default:{if(this._append`M${t},${n}`,this._radius!==c_||this._append!==Dp){const i=this._radius,r=this._;this._="",this._append`m0,${i}a${i},${i} 0 1,1 0,${-2*i}a${i},${i} 0 1,1 0,${2*i}z`,c_=i,Dp=this._append,f_=this._,this._=r}this._+=f_;break}}}result(){const t=this._;return this._="",t.length?t:null}}function aN(e){let t=1;this._+=e[0];for(const n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function BQ(e){const t=Math.floor(e);if(!(t>=0))throw new RangeError(`invalid digits: ${e}`);if(t>15)return aN;if(t!==l_){const n=10**t;l_=t,Dp=function(r){let s=1;this._+=r[0];for(const o=r.length;s<o;++s)this._+=Math.round(arguments[s]*n)/n+r[s]}}return Dp}function uN(e,t){let n=3,i=4.5,r,s;function o(a){return a&&(typeof i=="function"&&s.pointRadius(+i.apply(this,arguments)),ls(a,r(s))),s.result()}return o.area=function(a){return ls(a,r(r_)),r_.result()},o.measure=function(a){return ls(a,r(u_)),u_.result()},o.bounds=function(a){return ls(a,r($p)),$p.result()},o.centroid=function(a){return ls(a,r(a_)),a_.result()},o.projection=function(a){return arguments.length?(r=a==null?(e=null,kd):(e=a).stream,o):e},o.context=function(a){return arguments.length?(s=a==null?(t=null,new d_(n)):new iN(t=a),typeof i!="function"&&s.pointRadius(i),o):t},o.pointRadius=function(a){return arguments.length?(i=typeof a=="function"?a:(s.pointRadius(+a),+a),o):i},o.digits=function(a){if(!arguments.length)return n;if(a==null)n=null;else{const u=Math.floor(a);if(!(u>=0))throw new RangeError(`invalid digits: ${a}`);n=u}return t===null&&(s=new d_(n)),o},o.projection(e).digits(n).context(t)}function b1(e){return function(t){var n=new Bx;for(var i in e)n[i]=e[i];return n.stream=t,n}}function Bx(){}Bx.prototype={constructor:Bx,point:function(e,t){this.stream.point(e,t)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};function Tw(e,t,n){var i=e.clipExtent&&e.clipExtent();return e.scale(150).translate([0,0]),i!=null&&e.clipExtent(null),ls(n,e.stream($p)),t($p.result()),i!=null&&e.clipExtent(i),e}function x1(e,t,n){return Tw(e,function(i){var r=t[1][0]-t[0][0],s=t[1][1]-t[0][1],o=Math.min(r/(i[1][0]-i[0][0]),s/(i[1][1]-i[0][1])),a=+t[0][0]+(r-o*(i[1][0]+i[0][0]))/2,u=+t[0][1]+(s-o*(i[1][1]+i[0][1]))/2;e.scale(150*o).translate([a,u])},n)}function Bw(e,t,n){return x1(e,[[0,0],t],n)}function Rw(e,t,n){return Tw(e,function(i){var r=+t,s=r/(i[1][0]-i[0][0]),o=(r-s*(i[1][0]+i[0][0]))/2,a=-s*i[0][1];e.scale(150*s).translate([o,a])},n)}function Lw(e,t,n){return Tw(e,function(i){var r=+t,s=r/(i[1][1]-i[0][1]),o=-s*i[0][0],a=(r-s*(i[1][1]+i[0][1]))/2;e.scale(150*s).translate([o,a])},n)}var h_=16,RQ=ie(30*he);function g_(e,t){return+t?PQ(e,t):LQ(e)}function LQ(e){return b1({point:function(t,n){t=e(t,n),this.stream.point(t[0],t[1])}})}function PQ(e,t){function n(i,r,s,o,a,u,l,c,f,d,h,g,p,m){var y=l-i,b=c-r,x=y*y+b*b;if(x>4*t&&p--){var v=o+d,A=a+h,w=u+g,E=bn(v*v+A*A+w*w),$=In(w/=E),k=me(me(w)-1)<ne||me(s-f)<ne?(s+f)/2:pi(A,v),F=e(k,$),D=F[0],T=F[1],C=D-i,_=T-r,S=b*C-y*_;(S*S/x>t||me((y*C+b*_)/x-.5)>.3||o*d+a*h+u*g<RQ)&&(n(i,r,s,o,a,u,D,T,k,v/=E,A/=E,w,p,m),m.point(D,T),n(D,T,k,v,A,w,l,c,f,d,h,g,p,m))}}return function(i){var r,s,o,a,u,l,c,f,d,h,g,p,m={point:y,lineStart:b,lineEnd:v,polygonStart:function(){i.polygonStart(),m.lineStart=A},polygonEnd:function(){i.polygonEnd(),m.lineStart=b}};function y($,k){$=e($,k),i.point($[0],$[1])}function b(){f=NaN,m.point=x,i.lineStart()}function x($,k){var F=Ka([$,k]),D=e($,k);n(f,d,c,h,g,p,f=D[0],d=D[1],c=$,h=F[0],g=F[1],p=F[2],h_,i),i.point(f,d)}function v(){m.point=y,i.lineEnd()}function A(){b(),m.point=w,m.lineEnd=E}function w($,k){x(r=$,k),s=f,o=d,a=h,u=g,l=p,m.point=x}function E(){n(f,d,c,h,g,p,s,o,r,a,u,l,h_,i),m.lineEnd=v,v()}return m}}var IQ=b1({point:function(e,t){this.stream.point(e*he,t*he)}});function zQ(e){return b1({point:function(t,n){var i=e(t,n);return this.stream.point(i[0],i[1])}})}function jQ(e,t,n,i,r){function s(o,a){return o*=i,a*=r,[t+e*o,n-e*a]}return s.invert=function(o,a){return[(o-t)/e*i,(n-a)/e*r]},s}function p_(e,t,n,i,r,s){if(!s)return jQ(e,t,n,i,r);var o=ie(s),a=ee(s),u=o*e,l=a*e,c=o/e,f=a/e,d=(a*n-o*t)/e,h=(a*t+o*n)/e;function g(p,m){return p*=i,m*=r,[u*p-l*m+t,n-l*p-u*m]}return g.invert=function(p,m){return[i*(c*p-f*m+d),r*(h-f*p-c*m)]},g}function Lr(e){return lN(function(){return e})()}function lN(e){var t,n=150,i=480,r=250,s=0,o=0,a=0,u=0,l=0,c,f=0,d=1,h=1,g=null,p=t_,m=null,y,b,x,v=kd,A=.5,w,E,$,k,F;function D(S){return $(S[0]*he,S[1]*he)}function T(S){return S=$.invert(S[0],S[1]),S&&[S[0]*rt,S[1]*rt]}D.stream=function(S){return k&&F===S?k:k=IQ(zQ(c)(p(w(v(F=S)))))},D.preclip=function(S){return arguments.length?(p=S,g=void 0,_()):p},D.postclip=function(S){return arguments.length?(v=S,m=y=b=x=null,_()):v},D.clipAngle=function(S){return arguments.length?(p=+S?AQ(g=S*he):(g=null,t_),_()):g*rt},D.clipExtent=function(S){return arguments.length?(v=S==null?(m=y=b=x=null,kd):K4(m=+S[0][0],y=+S[0][1],b=+S[1][0],x=+S[1][1]),_()):m==null?null:[[m,y],[b,x]]},D.scale=function(S){return arguments.length?(n=+S,C()):n},D.translate=function(S){return arguments.length?(i=+S[0],r=+S[1],C()):[i,r]},D.center=function(S){return arguments.length?(s=S[0]%360*he,o=S[1]%360*he,C()):[s*rt,o*rt]},D.rotate=function(S){return arguments.length?(a=S[0]%360*he,u=S[1]%360*he,l=S.length>2?S[2]%360*he:0,C()):[a*rt,u*rt,l*rt]},D.angle=function(S){return arguments.length?(f=S%360*he,C()):f*rt},D.reflectX=function(S){return arguments.length?(d=S?-1:1,C()):d<0},D.reflectY=function(S){return arguments.length?(h=S?-1:1,C()):h<0},D.precision=function(S){return arguments.length?(w=g_(E,A=S*S),_()):bn(A)},D.fitExtent=function(S,M){return x1(D,S,M)},D.fitSize=function(S,M){return Bw(D,S,M)},D.fitWidth=function(S,M){return Rw(D,S,M)},D.fitHeight=function(S,M){return Lw(D,S,M)};function C(){var S=p_(n,0,0,d,h,f).apply(null,t(s,o)),M=p_(n,i-S[0],r-S[1],d,h,f);return c=H4(a,u,l),E=Cx(t,M),$=Cx(c,E),w=g_(E,A),_()}function _(){return k=F=null,D}return function(){return t=e.apply(this,arguments),D.invert=t.invert&&T,C()}}function Pw(e){var t=0,n=pe/3,i=lN(e),r=i(t,n);return r.parallels=function(s){return arguments.length?i(t=s[0]*he,n=s[1]*he):[t*rt,n*rt]},r}function UQ(e){var t=ie(e);function n(i,r){return[i*t,ee(r)/t]}return n.invert=function(i,r){return[i/t,In(r*t)]},n}function qQ(e,t){var n=ee(e),i=(n+ee(t))/2;if(me(i)<ne)return UQ(e);var r=1+n*(2*i-n),s=bn(r)/i;function o(a,u){var l=bn(r-2*i*ee(u))/i;return[l*ee(a*=i),s-l*ie(a)]}return o.invert=function(a,u){var l=s-u,c=pi(a,me(l))*ui(l);return l*i<0&&(c-=pe*ui(a)*ui(l)),[c/i,In((r-(a*a+l*l)*i*i)/(2*i))]},o}function _p(){return Pw(qQ).scale(155.424).center([0,33.6442])}function cN(){return _p().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])}function WQ(e){var t=e.length;return{point:function(n,i){for(var r=-1;++r<t;)e[r].point(n,i)},sphere:function(){for(var n=-1;++n<t;)e[n].sphere()},lineStart:function(){for(var n=-1;++n<t;)e[n].lineStart()},lineEnd:function(){for(var n=-1;++n<t;)e[n].lineEnd()},polygonStart:function(){for(var n=-1;++n<t;)e[n].polygonStart()},polygonEnd:function(){for(var n=-1;++n<t;)e[n].polygonEnd()}}}function GQ(){var e,t,n=cN(),i,r=_p().rotate([154,0]).center([-2,58.5]).parallels([55,65]),s,o=_p().rotate([157,0]).center([-3,19.9]).parallels([8,18]),a,u,l={point:function(d,h){u=[d,h]}};function c(d){var h=d[0],g=d[1];return u=null,i.point(h,g),u||(s.point(h,g),u)||(a.point(h,g),u)}c.invert=function(d){var h=n.scale(),g=n.translate(),p=(d[0]-g[0])/h,m=(d[1]-g[1])/h;return(m>=.12&&m<.234&&p>=-.425&&p<-.214?r:m>=.166&&m<.234&&p>=-.214&&p<-.115?o:n).invert(d)},c.stream=function(d){return e&&t===d?e:e=WQ([n.stream(t=d),r.stream(d),o.stream(d)])},c.precision=function(d){return arguments.length?(n.precision(d),r.precision(d),o.precision(d),f()):n.precision()},c.scale=function(d){return arguments.length?(n.scale(d),r.scale(d*.35),o.scale(d),c.translate(n.translate())):n.scale()},c.translate=function(d){if(!arguments.length)return n.translate();var h=n.scale(),g=+d[0],p=+d[1];return i=n.translate(d).clipExtent([[g-.455*h,p-.238*h],[g+.455*h,p+.238*h]]).stream(l),s=r.translate([g-.307*h,p+.201*h]).clipExtent([[g-.425*h+ne,p+.12*h+ne],[g-.214*h-ne,p+.234*h-ne]]).stream(l),a=o.translate([g-.205*h,p+.212*h]).clipExtent([[g-.214*h+ne,p+.166*h+ne],[g-.115*h-ne,p+.234*h-ne]]).stream(l),f()},c.fitExtent=function(d,h){return x1(c,d,h)},c.fitSize=function(d,h){return Bw(c,d,h)},c.fitWidth=function(d,h){return Rw(c,d,h)},c.fitHeight=function(d,h){return Lw(c,d,h)};function f(){return e=t=null,c}return c.scale(1070)}function fN(e){return function(t,n){var i=ie(t),r=ie(n),s=e(i*r);return s===1/0?[2,0]:[s*r*ee(t),s*ee(n)]}}function Mh(e){return function(t,n){var i=bn(t*t+n*n),r=e(i),s=ee(r),o=ie(r);return[pi(t*s,i*o),In(i&&n*s/i)]}}var dN=fN(function(e){return bn(2/(1+e))});dN.invert=Mh(function(e){return 2*In(e/2)});function HQ(){return Lr(dN).scale(124.75).clipAngle(180-.001)}var hN=fN(function(e){return(e=B4(e))&&e/ee(e)});hN.invert=Mh(function(e){return e});function VQ(){return Lr(hN).scale(79.4188).clipAngle(180-.001)}function v1(e,t){return[e,lp(Ow((nt+t)/2))]}v1.invert=function(e,t){return[e,2*mc(T4(t))-nt]};function YQ(){return gN(v1).scale(961/yn)}function gN(e){var t=Lr(e),n=t.center,i=t.scale,r=t.translate,s=t.clipExtent,o=null,a,u,l;t.scale=function(f){return arguments.length?(i(f),c()):i()},t.translate=function(f){return arguments.length?(r(f),c()):r()},t.center=function(f){return arguments.length?(n(f),c()):n()},t.clipExtent=function(f){return arguments.length?(f==null?o=a=u=l=null:(o=+f[0][0],a=+f[0][1],u=+f[1][0],l=+f[1][1]),c()):o==null?null:[[o,a],[u,l]]};function c(){var f=pe*i(),d=t(hQ(t.rotate()).invert([0,0]));return s(o==null?[[d[0]-f,d[1]-f],[d[0]+f,d[1]+f]]:e===v1?[[Math.max(d[0]-f,o),a],[Math.min(d[0]+f,u),l]]:[[o,Math.max(d[1]-f,a)],[u,Math.min(d[1]+f,l)]])}return c()}function S0(e){return Ow((nt+e)/2)}function XQ(e,t){var n=ie(e),i=e===t?ee(e):lp(n/ie(t))/lp(S0(t)/S0(e)),r=n*hb(S0(e),i)/i;if(!i)return v1;function s(o,a){r>0?a<-nt+ne&&(a=-nt+ne):a>nt-ne&&(a=nt-ne);var u=r/hb(S0(a),i);return[u*ee(i*o),r-u*ie(i*o)]}return s.invert=function(o,a){var u=r-a,l=ui(i)*bn(o*o+u*u),c=pi(o,me(u))*ui(u);return u*i<0&&(c-=pe*ui(o)*ui(u)),[c/i,2*mc(hb(r/l,1/i))-nt]},s}function KQ(){return Pw(XQ).scale(109.5).parallels([30,30])}function kp(e,t){return[e,t]}kp.invert=kp;function JQ(){return Lr(kp).scale(152.63)}function QQ(e,t){var n=ie(e),i=e===t?ee(e):(n-ie(t))/(t-e),r=n/i+e;if(me(i)<ne)return kp;function s(o,a){var u=r-a,l=i*o;return[u*ee(l),r-u*ie(l)]}return s.invert=function(o,a){var u=r-a,l=pi(o,me(u))*ui(u);return u*i<0&&(l-=pe*ui(o)*ui(u)),[l/i,r-ui(i)*bn(o*o+u*u)]},s}function ZQ(){return Pw(QQ).scale(131.154).center([0,13.9389])}var Yf=1.340264,Xf=-.081106,Kf=893e-6,Jf=.003796,Mp=bn(3)/2,eZ=12;function pN(e,t){var n=In(Mp*ee(t)),i=n*n,r=i*i*i;return[e*ie(n)/(Mp*(Yf+3*Xf*i+r*(7*Kf+9*Jf*i))),n*(Yf+Xf*i+r*(Kf+Jf*i))]}pN.invert=function(e,t){for(var n=t,i=n*n,r=i*i*i,s=0,o,a,u;s<eZ&&(a=n*(Yf+Xf*i+r*(Kf+Jf*i))-t,u=Yf+3*Xf*i+r*(7*Kf+9*Jf*i),n-=o=a/u,i=n*n,r=i*i*i,!(me(o)<ap));++s);return[Mp*e*(Yf+3*Xf*i+r*(7*Kf+9*Jf*i))/ie(n),In(ee(n)/Mp)]};function tZ(){return Lr(pN).scale(177.158)}function mN(e,t){var n=ie(t),i=ie(e)*n;return[n*ee(e)/i,ee(t)/i]}mN.invert=Mh(mc);function nZ(){return Lr(mN).scale(144.049).clipAngle(60)}function iZ(){var e=1,t=0,n=0,i=1,r=1,s=0,o,a,u=null,l,c,f,d=1,h=1,g=b1({point:function(v,A){var w=x([v,A]);this.stream.point(w[0],w[1])}}),p=kd,m,y;function b(){return d=e*i,h=e*r,m=y=null,x}function x(v){var A=v[0]*d,w=v[1]*h;if(s){var E=w*o-A*a;A=A*o+w*a,w=E}return[A+t,w+n]}return x.invert=function(v){var A=v[0]-t,w=v[1]-n;if(s){var E=w*o+A*a;A=A*o-w*a,w=E}return[A/d,w/h]},x.stream=function(v){return m&&y===v?m:m=g(p(y=v))},x.postclip=function(v){return arguments.length?(p=v,u=l=c=f=null,b()):p},x.clipExtent=function(v){return arguments.length?(p=v==null?(u=l=c=f=null,kd):K4(u=+v[0][0],l=+v[0][1],c=+v[1][0],f=+v[1][1]),b()):u==null?null:[[u,l],[c,f]]},x.scale=function(v){return arguments.length?(e=+v,b()):e},x.translate=function(v){return arguments.length?(t=+v[0],n=+v[1],b()):[t,n]},x.angle=function(v){return arguments.length?(s=v%360*he,a=ee(s),o=ie(s),b()):s*rt},x.reflectX=function(v){return arguments.length?(i=v?-1:1,b()):i<0},x.reflectY=function(v){return arguments.length?(r=v?-1:1,b()):r<0},x.fitExtent=function(v,A){return x1(x,v,A)},x.fitSize=function(v,A){return Bw(x,v,A)},x.fitWidth=function(v,A){return Rw(x,v,A)},x.fitHeight=function(v,A){return Lw(x,v,A)},x}function yN(e,t){var n=t*t,i=n*n;return[e*(.8707-.131979*n+i*(-.013791+i*(.003971*n-.001529*i))),t*(1.007226+n*(.015085+i*(-.044475+.028874*n-.005916*i)))]}yN.invert=function(e,t){var n=t,i=25,r;do{var s=n*n,o=s*s;n-=r=(n*(1.007226+s*(.015085+o*(-.044475+.028874*s-.005916*o)))-t)/(1.007226+s*(.015085*3+o*(-.044475*7+.028874*9*s-.005916*11*o)))}while(me(r)>ne&&--i>0);return[e/(.8707+(s=n*n)*(-.131979+s*(-.013791+s*s*s*(.003971-.001529*s)))),n]};function rZ(){return Lr(yN).scale(175.295)}function bN(e,t){return[ie(t)*ee(e),ee(t)]}bN.invert=Mh(In);function sZ(){return Lr(bN).scale(249.5).clipAngle(90+ne)}function xN(e,t){var n=ie(t),i=1+ie(e)*n;return[n*ee(e)/i,ee(t)/i]}xN.invert=Mh(function(e){return 2*mc(e)});function oZ(){return Lr(xN).scale(250).clipAngle(142)}function vN(e,t){return[lp(Ow((nt+t)/2)),-e]}vN.invert=function(e,t){return[-t,2*mc(T4(e))-nt]};function aZ(){var e=gN(vN),t=e.center,n=e.rotate;return e.center=function(i){return arguments.length?t([-i[1],i[0]]):(i=t(),[i[1],-i[0]])},e.rotate=function(i){return arguments.length?n([i[0],i[1],i.length>2?i[2]+90:90]):(i=n(),[i[0],i[1],i[2]-90])},n([0,0,90]).scale(159.155)}var uZ=Math.abs,Rx=Math.cos,Op=Math.sin,lZ=1e-6,AN=Math.PI,Lx=AN/2,m_=cZ(2);function y_(e){return e>1?Lx:e<-1?-Lx:Math.asin(e)}function cZ(e){return e>0?Math.sqrt(e):0}function fZ(e,t){var n=e*Op(t),i=30,r;do t-=r=(t+Op(t)-n)/(1+Rx(t));while(uZ(r)>lZ&&--i>0);return t/2}function dZ(e,t,n){function i(r,s){return[e*r*Rx(s=fZ(n,s)),t*Op(s)]}return i.invert=function(r,s){return s=y_(s/t),[r/(e*Rx(s)),y_((2*s+Op(2*s))/n)]},i}var hZ=dZ(m_/Lx,m_,AN);function gZ(){return Lr(hZ).scale(169.529)}const pZ=uN(),Px=["clipAngle","clipExtent","scale","translate","center","rotate","parallels","precision","reflectX","reflectY","coefficient","distance","fraction","lobes","parallel","radius","ratio","spacing","tilt"];function mZ(e,t){return function n(){const i=t();return i.type=e,i.path=uN().projection(i),i.copy=i.copy||function(){const r=n();return Px.forEach(s=>{i[s]&&r[s](i[s]())}),r.path.pointRadius(i.path.pointRadius()),r},LO(i)}}function Iw(e,t){if(!e||typeof e!="string")throw new Error("Projection type must be a name string.");return e=e.toLowerCase(),arguments.length>1?(Np[e]=mZ(e,t),this):Np[e]||null}function EN(e){return e&&e.path||pZ}const Np={albers:cN,albersusa:GQ,azimuthalequalarea:HQ,azimuthalequidistant:VQ,conicconformal:KQ,conicequalarea:_p,conicequidistant:ZQ,equalEarth:tZ,equirectangular:JQ,gnomonic:nZ,identity:iZ,mercator:YQ,mollweide:gZ,naturalEarth1:rZ,orthographic:sZ,stereographic:oZ,transversemercator:aZ};for(const e in Np)Iw(e,Np[e]);function yZ(){}const Jr=[[],[[[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 wN(){var e=1,t=1,n=a;function i(u,l){return l.map(c=>r(u,c))}function r(u,l){var c=[],f=[];return s(u,l,d=>{n(d,u,l),bZ(d)>0?c.push([d]):f.push(d)}),f.forEach(d=>{for(var h=0,g=c.length,p;h<g;++h)if(xZ((p=c[h])[0],d)!==-1){p.push(d);return}}),{type:"MultiPolygon",value:l,coordinates:c}}function s(u,l,c){var f=new Array,d=new Array,h,g,p,m,y,b;for(h=g=-1,m=u[0]>=l,Jr[m<<1].forEach(x);++h<e-1;)p=m,m=u[h+1]>=l,Jr[p|m<<1].forEach(x);for(Jr[m<<0].forEach(x);++g<t-1;){for(h=-1,m=u[g*e+e]>=l,y=u[g*e]>=l,Jr[m<<1|y<<2].forEach(x);++h<e-1;)p=m,m=u[g*e+e+h+1]>=l,b=y,y=u[g*e+h+1]>=l,Jr[p|m<<1|y<<2|b<<3].forEach(x);Jr[m|y<<3].forEach(x)}for(h=-1,y=u[g*e]>=l,Jr[y<<2].forEach(x);++h<e-1;)b=y,y=u[g*e+h+1]>=l,Jr[y<<2|b<<3].forEach(x);Jr[y<<3].forEach(x);function x(v){var A=[v[0][0]+h,v[0][1]+g],w=[v[1][0]+h,v[1][1]+g],E=o(A),$=o(w),k,F;(k=d[E])?(F=f[$])?(delete d[k.end],delete f[F.start],k===F?(k.ring.push(w),c(k.ring)):f[k.start]=d[F.end]={start:k.start,end:F.end,ring:k.ring.concat(F.ring)}):(delete d[k.end],k.ring.push(w),d[k.end=$]=k):(k=f[$])?(F=d[E])?(delete f[k.start],delete d[F.end],k===F?(k.ring.push(w),c(k.ring)):f[F.start]=d[k.end]={start:F.start,end:k.end,ring:F.ring.concat(k.ring)}):(delete f[k.start],k.ring.unshift(A),f[k.start=E]=k):f[E]=d[$]={start:E,end:$,ring:[A,w]}}}function o(u){return u[0]*2+u[1]*(e+1)*4}function a(u,l,c){u.forEach(f=>{var d=f[0],h=f[1],g=d|0,p=h|0,m,y=l[p*e+g];d>0&&d<e&&g===d&&(m=l[p*e+g-1],f[0]=d+(c-m)/(y-m)-.5),h>0&&h<t&&p===h&&(m=l[(p-1)*e+g],f[1]=h+(c-m)/(y-m)-.5)})}return i.contour=r,i.size=function(u){if(!arguments.length)return[e,t];var l=Math.floor(u[0]),c=Math.floor(u[1]);return l>=0&&c>=0||go("invalid size"),e=l,t=c,i},i.smooth=function(u){return arguments.length?(n=u?a:yZ,i):n===a},i}function bZ(e){for(var t=0,n=e.length,i=e[n-1][1]*e[0][0]-e[n-1][0]*e[0][1];++t<n;)i+=e[t-1][1]*e[t][0]-e[t-1][0]*e[t][1];return i}function xZ(e,t){for(var n=-1,i=t.length,r;++n<i;)if(r=vZ(e,t[n]))return r;return 0}function vZ(e,t){for(var n=t[0],i=t[1],r=-1,s=0,o=e.length,a=o-1;s<o;a=s++){var u=e[s],l=u[0],c=u[1],f=e[a],d=f[0],h=f[1];if(AZ(u,f,t))return 0;c>i!=h>i&&n<(d-l)*(i-c)/(h-c)+l&&(r=-r)}return r}function AZ(e,t,n){var i;return EZ(e,t,n)&&wZ(e[i=+(e[0]===t[0])],n[i],t[i])}function EZ(e,t,n){return(t[0]-e[0])*(n[1]-e[1])===(n[0]-e[0])*(t[1]-e[1])}function wZ(e,t,n){return e<=t&&t<=n||n<=t&&t<=e}function $N(e,t,n){return function(i){var r=JJ(i),s=n?Math.min(r[0],0):r[0],o=r[1],a=o-s,u=t?yo(s,o,e):a/(e+1);return Kn(s+u,o,u)}}function zw(e){N.call(this,null,e)}zw.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"}]};Rr(zw,N,{transform(e,t){if(this.value&&!t.changed()&&!e.modified())return t.StopPropagation;var n=t.fork(t.NO_SOURCE|t.NO_FIELDS),i=t.materialize(t.SOURCE).source,r=e.field||Dd,s=wN().smooth(e.smooth!==!1),o=e.thresholds||$Z(i,r,e),a=e.as===null?null:e.as||"contour",u=[];return i.forEach(l=>{const c=r(l),f=s.size([c.width,c.height])(c.values,kw(o)?o:o(c.values));CZ(f,c,l,e),f.forEach(d=>{u.push(Rm(l,De(a!=null?{[a]:d}:d)))})}),this.value&&(n.rem=this.value),this.value=n.source=n.add=u,n}});function $Z(e,t,n){const i=$N(n.levels||10,n.nice,n.zero!==!1);return n.resolve!=="shared"?i:i(e.map(r=>Ba(t(r).values)))}function CZ(e,t,n,i){let r=i.scale||t.scale,s=i.translate||t.translate;if(Fs(r)&&(r=r(n,i)),Fs(s)&&(s=s(n,i)),(r===1||r==null)&&!s)return;const o=(jD(r)?r:r[0])||1,a=(jD(r)?r:r[1])||1,u=s&&s[0]||0,l=s&&s[1]||0;e.forEach(CN(t,o,a,u,l))}function CN(e,t,n,i,r){const s=e.x1||0,o=e.y1||0,a=t*n<0;function u(f){f.forEach(l)}function l(f){a&&f.reverse(),f.forEach(c)}function c(f){f[0]=(f[0]-s)*t+i,f[1]=(f[1]-o)*n+r}return function(f){return f.coordinates.forEach(u),f}}function b_(e,t,n){const i=e>=0?e:FA(t,n);return Math.round((Math.sqrt(4*i*i+1)-1)/2)}function bb(e){return Fs(e)?e:_d(+e)}function FN(){var e=u=>u[0],t=u=>u[1],n=KJ,i=[-1,-1],r=960,s=500,o=2;function a(u,l){const c=b_(i[0],u,e)>>o,f=b_(i[1],u,t)>>o,d=c?c+2:0,h=f?f+2:0,g=2*d+(r>>o),p=2*h+(s>>o),m=new Float32Array(g*p),y=new Float32Array(g*p);let b=m;u.forEach(v=>{const A=d+(+e(v)>>o),w=h+(+t(v)>>o);A>=0&&A<g&&w>=0&&w<p&&(m[A+w*g]+=+n(v))}),c>0&&f>0?(Pu(g,p,m,y,c),Iu(g,p,y,m,f),Pu(g,p,m,y,c),Iu(g,p,y,m,f),Pu(g,p,m,y,c),Iu(g,p,y,m,f)):c>0?(Pu(g,p,m,y,c),Pu(g,p,y,m,c),Pu(g,p,m,y,c),b=y):f>0&&(Iu(g,p,m,y,f),Iu(g,p,y,m,f),Iu(g,p,m,y,f),b=y);const x=l?Math.pow(2,-2*o):1/S6(b);for(let v=0,A=g*p;v<A;++v)b[v]*=x;return{values:b,scale:1<<o,width:g,height:p,x1:d,y1:h,x2:d+(r>>o),y2:h+(s>>o)}}return a.x=function(u){return arguments.length?(e=bb(u),a):e},a.y=function(u){return arguments.length?(t=bb(u),a):t},a.weight=function(u){return arguments.length?(n=bb(u),a):n},a.size=function(u){if(!arguments.length)return[r,s];var l=+u[0],c=+u[1];return l>=0&&c>=0||go("invalid size"),r=l,s=c,a},a.cellSize=function(u){return arguments.length?((u=+u)>=1||go("invalid cell size"),o=Math.floor(Math.log(u)/Math.LN2),a):1<<o},a.bandwidth=function(u){return arguments.length?(u=Mw(u),u.length===1&&(u=[+u[0],+u[0]]),u.length!==2&&go("invalid bandwidth"),i=u,a):i},a}function Pu(e,t,n,i,r){const s=(r<<1)+1;for(let o=0;o<t;++o)for(let a=0,u=0;a<e+r;++a)a<e&&(u+=n[a+o*e]),a>=r&&(a>=s&&(u-=n[a-s+o*e]),i[a-r+o*e]=u/Math.min(a+1,e-1+s-a,s))}function Iu(e,t,n,i,r){const s=(r<<1)+1;for(let o=0;o<e;++o)for(let a=0,u=0;a<t+r;++a)a<t&&(u+=n[o+a*e]),a>=r&&(a>=s&&(u-=n[o+(a-s)*e]),i[o+(a-r)*e]=u/Math.min(a+1,t-1+s-a,s))}function jw(e){N.call(this,null,e)}jw.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 FZ=["x","y","weight","size","cellSize","bandwidth"];function SN(e,t){return FZ.forEach(n=>t[n]!=null?e[n](t[n]):0),e}Rr(jw,N,{transform(e,t){if(this.value&&!t.changed()&&!e.modified())return t.StopPropagation;var n=t.fork(t.NO_SOURCE|t.NO_FIELDS),i=t.materialize(t.SOURCE).source,r=SZ(i,e.groupby),s=(e.groupby||[]).map(WJ),o=SN(FN(),e),a=e.as||"grid",u=[];function l(c,f){for(let d=0;d<s.length;++d)c[s[d]]=f[d];return c}return u=r.map(c=>De(l({[a]:o(c,e.counts)},c.dims))),this.value&&(n.rem=this.value),this.value=n.source=n.add=u,n}});function SZ(e,t){var n=[],i=c=>c(a),r,s,o,a,u,l;if(t==null)n.push(e);else for(r={},s=0,o=e.length;s<o;++s)a=e[s],u=t.map(i),l=r[u],l||(r[u]=l=[],l.dims=u,n.push(l)),l.push(a);return n}function Uw(e){N.call(this,null,e)}Uw.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}]};Rr(Uw,N,{transform(e,t){if(this.value&&!t.changed()&&!e.modified())return t.StopPropagation;var n=t.fork(t.NO_SOURCE|t.NO_FIELDS),i=wN().smooth(e.smooth!==!1),r=e.values,s=e.thresholds||$N(e.count||10,e.nice,!!r),o=e.size,a,u;return r||(r=t.materialize(t.SOURCE).source,a=SN(FN(),e)(r,!0),u=CN(a,a.scale||1,a.scale||1,0,0),o=[a.width,a.height],r=a.values),s=kw(s)?s:s(r),r=i.size(o)(r,s),u&&r.forEach(u),this.value&&(n.rem=this.value),this.value=n.source=n.add=(r||[]).map(De),n}});const Ix="Feature",qw="FeatureCollection",DZ="MultiPoint";function Ww(e){N.call(this,null,e)}Ww.Definition={type:"GeoJSON",metadata:{},params:[{name:"fields",type:"field",array:!0,length:2},{name:"geojson",type:"field"}]};Rr(Ww,N,{transform(e,t){var n=this._features,i=this._points,r=e.fields,s=r&&r[0],o=r&&r[1],a=e.geojson||!r&&Dd,u=t.ADD,l;l=e.modified()||t.changed(t.REM)||t.modified(lg(a))||s&&t.modified(lg(s))||o&&t.modified(lg(o)),(!this.value||l)&&(u=t.SOURCE,this._features=n=[],this._points=i=[]),a&&t.visit(u,c=>n.push(a(c))),s&&o&&(t.visit(u,c=>{var f=s(c),d=o(c);f!=null&&d!=null&&(f=+f)===f&&(d=+d)===d&&i.push([f,d])}),n=n.concat({type:Ix,geometry:{type:DZ,coordinates:i}})),this.value={type:qw,features:n}}});function Gw(e){N.call(this,null,e)}Gw.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"}]};Rr(Gw,N,{transform(e,t){var n=t.fork(t.ALL),i=this.value,r=e.field||Dd,s=e.as||"path",o=n.SOURCE;!i||e.modified()?(this.value=i=EN(e.projection),n.materialize().reflow()):o=r===Dd||t.modified(r.fields)?n.ADD_MOD:n.ADD;const a=_Z(i,e.pointRadius);return n.visit(o,u=>u[s]=i(r(u))),i.pointRadius(a),n.modifies(s)}});function _Z(e,t){const n=e.pointRadius();return e.context(null),t!=null&&e.pointRadius(t),n}function Hw(e){N.call(this,null,e)}Hw.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"]}]};Rr(Hw,N,{transform(e,t){var n=e.projection,i=e.fields[0],r=e.fields[1],s=e.as||["x","y"],o=s[0],a=s[1],u;function l(c){const f=n([i(c),r(c)]);f?(c[o]=f[0],c[a]=f[1]):(c[o]=void 0,c[a]=void 0)}return e.modified()?t=t.materialize().reflow(!0).visit(t.SOURCE,l):(u=t.modified(i.fields)||t.modified(r.fields),t.visit(u?t.ADD_MOD:t.ADD,l)),t.modifies(s)}});function Vw(e){N.call(this,null,e)}Vw.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"}]};Rr(Vw,N,{transform(e,t){var n=t.fork(t.ALL),i=this.value,r=e.as||"shape",s=n.ADD;return(!i||e.modified())&&(this.value=i=kZ(EN(e.projection),e.field||O4("datum"),e.pointRadius),n.materialize().reflow(),s=n.SOURCE),n.visit(s,o=>o[r]=i),n.modifies(r)}});function kZ(e,t,n){const i=n==null?r=>e(t(r)):r=>{var s=e.pointRadius(),o=e.pointRadius(n)(t(r));return e.pointRadius(s),o};return i.context=r=>(e.context(r),i),i}function Yw(e){N.call(this,[],e),this.generator=wQ()}Yw.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}]};Rr(Yw,N,{transform(e,t){var n=this.value,i=this.generator,r;if(!n.length||e.modified())for(const s in e)Fs(i[s])&&i[s](e[s]);return r=i(),n.length?t.mod.push(wM(n[0],r)):t.add.push(De(r)),n[0]=r,t}});function Xw(e){N.call(this,null,e)}Xw.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"}]};Rr(Xw,N,{transform(e,t){if(!t.changed()&&!e.modified())return t.StopPropagation;var n=t.materialize(t.SOURCE).source,i=e.resolve==="shared",r=e.field||Dd,s=OZ(e.opacity,e),o=MZ(e.color,e),a=e.as||"image",u={$x:0,$y:0,$value:0,$max:i?Ba(n.map(l=>Ba(r(l).values))):0};return n.forEach(l=>{const c=r(l),f=N4({},l,u);i||(f.$max=Ba(c.values||[])),l[a]=NZ(c,f,o.dep?o:_d(o(f)),s.dep?s:_d(s(f)))}),t.reflow(!0).modifies(a)}});function MZ(e,t){let n;return Fs(e)?(n=i=>Ao(e(i,t)),n.dep=DN(e)):n=_d(Ao(e||"#888")),n}function OZ(e,t){let n;return Fs(e)?(n=i=>e(i,t),n.dep=DN(e)):e?n=_d(e):(n=i=>i.$value/i.$max||0,n.dep=!0),n}function DN(e){if(!Fs(e))return!1;const t=QJ(lg(e));return t.$x||t.$y||t.$value||t.$max}function NZ(e,t,n,i){const r=e.width,s=e.height,o=e.x1||0,a=e.y1||0,u=e.x2||r,l=e.y2||s,c=e.values,f=c?m=>c[m]:XJ,d=co(u-o,l-a),h=d.getContext("2d"),g=h.getImageData(0,0,u-o,l-a),p=g.data;for(let m=a,y=0;m<l;++m){t.$y=m-a;for(let b=o,x=m*r;b<u;++b,y+=4){t.$x=b-o,t.$value=f(b+x);const v=n(t);p[y+0]=v.r,p[y+1]=v.g,p[y+2]=v.b,p[y+3]=~~(255*i(t))}}return h.putImageData(g,0,0),d}function _N(e){N.call(this,null,e),this.modified(!0)}Rr(_N,N,{transform(e,t){let n=this.value;return!n||e.modified("type")?(this.value=n=BZ(e.type),Px.forEach(i=>{e[i]!=null&&x_(n,i,e[i])})):Px.forEach(i=>{e.modified(i)&&x_(n,i,e[i])}),e.pointRadius!=null&&n.path.pointRadius(e.pointRadius),e.fit&&TZ(n,e),t.fork(t.NO_SOURCE|t.NO_FIELDS)}});function TZ(e,t){const n=RZ(t.fit);t.extent?e.fitExtent(t.extent,n):t.size&&e.fitSize(t.size,n)}function BZ(e){const t=Iw((e||"mercator").toLowerCase());return t||go("Unrecognized projection type: "+e),t()}function x_(e,t,n){Fs(e[t])&&e[t](n)}function RZ(e){return e=Mw(e),e.length===1?e[0]:{type:qw,features:e.reduce((t,n)=>t.concat(LZ(n)),[])}}function LZ(e){return e.type===qw?e.features:Mw(e).filter(t=>t!=null).map(t=>t.type===Ix?t:{type:Ix,geometry:t})}const PZ=Object.freeze(Object.defineProperty({__proto__:null,contour:Uw,geojson:Ww,geopath:Gw,geopoint:Hw,geoshape:Vw,graticule:Yw,heatmap:Xw,isocontour:zw,kde2d:jw,projection:_N},Symbol.toStringTag,{value:"Module"}));function yc(e,t,n){return e.fields=t||[],e.fname=n,e}function IZ(e){return e==null?null:e.fields}function zZ(e){return e.length===1?jZ(e[0]):UZ(e)}const jZ=e=>function(t){return t[e]},UZ=e=>{const t=e.length;return function(n){for(let i=0;i<t;++i)n=n[e[i]];return n}};function fg(e){throw Error(e)}function qZ(e){const t=[],n=e.length;let i=null,r=0,s="",o,a,u;e=e+"";function l(){t.push(s+e.substring(o,a)),s="",o=a+1}for(o=a=0;a<n;++a)if(u=e[a],u==="\\")s+=e.substring(o,a++),o=a;else if(u===i)l(),i=null,r=-1;else{if(i)continue;o===r&&u==='"'||o===r&&u==="'"?(o=a+1,i=u):u==="."&&!r?a>o?l():o=a+1:u==="["?(a>o&&l(),r=o=a+1):u==="]"&&(r||fg("Access path missing open bracket: "+e),r>0&&l(),r=0,o=a+1)}return r&&fg("Access path missing closing bracket: "+e),i&&fg("Access path missing closing quote: "+e),a>o&&(a++,l()),t}function WZ(e,t,n){const i=qZ(e);return e=i.length===1?i[0]:e,yc((n&&n.get||zZ)(i),[e],t||e)}WZ("id");yc(e=>e,[],"identity");yc(()=>0,[],"zero");yc(()=>1,[],"one");yc(()=>!0,[],"true");yc(()=>!1,[],"false");var GZ=Array.isArray;function HZ(e){return e!=null?GZ(e)?e:[e]:[]}function Kw(e){return typeof e=="function"}function VZ(e){for(let t,n,i=1,r=arguments.length;i<r;++i){t=arguments[i];for(n in t)e[n]=t[n]}return e}const YZ=Object.prototype.hasOwnProperty;function XZ(e,t){return YZ.call(e,t)}function KZ(e,t,n){const i=e.prototype=Object.create(t.prototype);return Object.defineProperty(i,"constructor",{value:e,writable:!0,enumerable:!0,configurable:!0}),VZ(i,n)}function JZ(e,t){var n,i=1;e==null&&(e=0),t==null&&(t=0);function r(){var s,o=n.length,a,u=0,l=0;for(s=0;s<o;++s)a=n[s],u+=a.x,l+=a.y;for(u=(u/o-e)*i,l=(l/o-t)*i,s=0;s<o;++s)a=n[s],a.x-=u,a.y-=l}return r.initialize=function(s){n=s},r.x=function(s){return arguments.length?(e=+s,r):e},r.y=function(s){return arguments.length?(t=+s,r):t},r.strength=function(s){return arguments.length?(i=+s,r):i},r}function QZ(e){const t=+this._x.call(null,e),n=+this._y.call(null,e);return kN(this.cover(t,n),t,n,e)}function kN(e,t,n,i){if(isNaN(t)||isNaN(n))return e;var r,s=e._root,o={data:i},a=e._x0,u=e._y0,l=e._x1,c=e._y1,f,d,h,g,p,m,y,b;if(!s)return e._root=o,e;for(;s.length;)if((p=t>=(f=(a+l)/2))?a=f:l=f,(m=n>=(d=(u+c)/2))?u=d:c=d,r=s,!(s=s[y=m<<1|p]))return r[y]=o,e;if(h=+e._x.call(null,s.data),g=+e._y.call(null,s.data),t===h&&n===g)return o.next=s,r?r[y]=o:e._root=o,e;do r=r?r[y]=new Array(4):e._root=new Array(4),(p=t>=(f=(a+l)/2))?a=f:l=f,(m=n>=(d=(u+c)/2))?u=d:c=d;while((y=m<<1|p)===(b=(g>=d)<<1|h>=f));return r[b]=s,r[y]=o,e}function ZZ(e){var t,n,i=e.length,r,s,o=new Array(i),a=new Array(i),u=1/0,l=1/0,c=-1/0,f=-1/0;for(n=0;n<i;++n)isNaN(r=+this._x.call(null,t=e[n]))||isNaN(s=+this._y.call(null,t))||(o[n]=r,a[n]=s,r<u&&(u=r),r>c&&(c=r),s<l&&(l=s),s>f&&(f=s));if(u>c||l>f)return this;for(this.cover(u,l).cover(c,f),n=0;n<i;++n)kN(this,o[n],a[n],e[n]);return this}function eee(e,t){if(isNaN(e=+e)||isNaN(t=+t))return this;var n=this._x0,i=this._y0,r=this._x1,s=this._y1;if(isNaN(n))r=(n=Math.floor(e))+1,s=(i=Math.floor(t))+1;else{for(var o=r-n||1,a=this._root,u,l;n>e||e>=r||i>t||t>=s;)switch(l=(t<i)<<1|e<n,u=new Array(4),u[l]=a,a=u,o*=2,l){case 0:r=n+o,s=i+o;break;case 1:n=r-o,s=i+o;break;case 2:r=n+o,i=s-o;break;case 3:n=r-o,i=s-o;break}this._root&&this._root.length&&(this._root=a)}return this._x0=n,this._y0=i,this._x1=r,this._y1=s,this}function tee(){var e=[];return this.visit(function(t){if(!t.length)do e.push(t.data);while(t=t.next)}),e}function nee(e){return arguments.length?this.cover(+e[0][0],+e[0][1]).cover(+e[1][0],+e[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]}function dn(e,t,n,i,r){this.node=e,this.x0=t,this.y0=n,this.x1=i,this.y1=r}function iee(e,t,n){var i,r=this._x0,s=this._y0,o,a,u,l,c=this._x1,f=this._y1,d=[],h=this._root,g,p;for(h&&d.push(new dn(h,r,s,c,f)),n==null?n=1/0:(r=e-n,s=t-n,c=e+n,f=t+n,n*=n);g=d.pop();)if(!(!(h=g.node)||(o=g.x0)>c||(a=g.y0)>f||(u=g.x1)<r||(l=g.y1)<s))if(h.length){var m=(o+u)/2,y=(a+l)/2;d.push(new dn(h[3],m,y,u,l),new dn(h[2],o,y,m,l),new dn(h[1],m,a,u,y),new dn(h[0],o,a,m,y)),(p=(t>=y)<<1|e>=m)&&(g=d[d.length-1],d[d.length-1]=d[d.length-1-p],d[d.length-1-p]=g)}else{var b=e-+this._x.call(null,h.data),x=t-+this._y.call(null,h.data),v=b*b+x*x;if(v<n){var A=Math.sqrt(n=v);r=e-A,s=t-A,c=e+A,f=t+A,i=h.data}}return i}function ree(e){if(isNaN(c=+this._x.call(null,e))||isNaN(f=+this._y.call(null,e)))return this;var t,n=this._root,i,r,s,o=this._x0,a=this._y0,u=this._x1,l=this._y1,c,f,d,h,g,p,m,y;if(!n)return this;if(n.length)for(;;){if((g=c>=(d=(o+u)/2))?o=d:u=d,(p=f>=(h=(a+l)/2))?a=h:l=h,t=n,!(n=n[m=p<<1|g]))return this;if(!n.length)break;(t[m+1&3]||t[m+2&3]||t[m+3&3])&&(i=t,y=m)}for(;n.data!==e;)if(r=n,!(n=n.next))return this;return(s=n.next)&&delete n.next,r?(s?r.next=s:delete r.next,this):t?(s?t[m]=s:delete t[m],(n=t[0]||t[1]||t[2]||t[3])&&n===(t[3]||t[2]||t[1]||t[0])&&!n.length&&(i?i[y]=n:this._root=n),this):(this._root=s,this)}function see(e){for(var t=0,n=e.length;t<n;++t)this.remove(e[t]);return this}function oee(){return this._root}function aee(){var e=0;return this.visit(function(t){if(!t.length)do++e;while(t=t.next)}),e}function uee(e){var t=[],n,i=this._root,r,s,o,a,u;for(i&&t.push(new dn(i,this._x0,this._y0,this._x1,this._y1));n=t.pop();)if(!e(i=n.node,s=n.x0,o=n.y0,a=n.x1,u=n.y1)&&i.length){var l=(s+a)/2,c=(o+u)/2;(r=i[3])&&t.push(new dn(r,l,c,a,u)),(r=i[2])&&t.push(new dn(r,s,c,l,u)),(r=i[1])&&t.push(new dn(r,l,o,a,c)),(r=i[0])&&t.push(new dn(r,s,o,l,c))}return this}function lee(e){var t=[],n=[],i;for(this._root&&t.push(new dn(this._root,this._x0,this._y0,this._x1,this._y1));i=t.pop();){var r=i.node;if(r.length){var s,o=i.x0,a=i.y0,u=i.x1,l=i.y1,c=(o+u)/2,f=(a+l)/2;(s=r[0])&&t.push(new dn(s,o,a,c,f)),(s=r[1])&&t.push(new dn(s,c,a,u,f)),(s=r[2])&&t.push(new dn(s,o,f,c,l)),(s=r[3])&&t.push(new dn(s,c,f,u,l))}n.push(i)}for(;i=n.pop();)e(i.node,i.x0,i.y0,i.x1,i.y1);return this}function cee(e){return e[0]}function fee(e){return arguments.length?(this._x=e,this):this._x}function dee(e){return e[1]}function hee(e){return arguments.length?(this._y=e,this):this._y}function Jw(e,t,n){var i=new Qw(t??cee,n??dee,NaN,NaN,NaN,NaN);return e==null?i:i.addAll(e)}function Qw(e,t,n,i,r,s){this._x=e,this._y=t,this._x0=n,this._y0=i,this._x1=r,this._y1=s,this._root=void 0}function v_(e){for(var t={data:e.data},n=t;e=e.next;)n=n.next={data:e.data};return t}var vn=Jw.prototype=Qw.prototype;vn.copy=function(){var e=new Qw(this._x,this._y,this._x0,this._y0,this._x1,this._y1),t=this._root,n,i;if(!t)return e;if(!t.length)return e._root=v_(t),e;for(n=[{source:t,target:e._root=new Array(4)}];t=n.pop();)for(var r=0;r<4;++r)(i=t.source[r])&&(i.length?n.push({source:i,target:t.target[r]=new Array(4)}):t.target[r]=v_(i));return e};vn.add=QZ;vn.addAll=ZZ;vn.cover=eee;vn.data=tee;vn.extent=nee;vn.find=iee;vn.remove=ree;vn.removeAll=see;vn.root=oee;vn.size=aee;vn.visit=uee;vn.visitAfter=lee;vn.x=fee;vn.y=hee;function hn(e){return function(){return e}}function ro(e){return(e()-.5)*1e-6}function gee(e){return e.x+e.vx}function pee(e){return e.y+e.vy}function mee(e){var t,n,i,r=1,s=1;typeof e!="function"&&(e=hn(e==null?1:+e));function o(){for(var l,c=t.length,f,d,h,g,p,m,y=0;y<s;++y)for(f=Jw(t,gee,pee).visitAfter(a),l=0;l<c;++l)d=t[l],p=n[d.index],m=p*p,h=d.x+d.vx,g=d.y+d.vy,f.visit(b);function b(x,v,A,w,E){var $=x.data,k=x.r,F=p+k;if($){if($.index>d.index){var D=h-$.x-$.vx,T=g-$.y-$.vy,C=D*D+T*T;C<F*F&&(D===0&&(D=ro(i),C+=D*D),T===0&&(T=ro(i),C+=T*T),C=(F-(C=Math.sqrt(C)))/C*r,d.vx+=(D*=C)*(F=(k*=k)/(m+k)),d.vy+=(T*=C)*F,$.vx-=D*(F=1-F),$.vy-=T*F)}return}return v>h+F||w<h-F||A>g+F||E<g-F}}function a(l){if(l.data)return l.r=n[l.data.index];for(var c=l.r=0;c<4;++c)l[c]&&l[c].r>l.r&&(l.r=l[c].r)}function u(){if(t){var l,c=t.length,f;for(n=new Array(c),l=0;l<c;++l)f=t[l],n[f.index]=+e(f,l,t)}}return o.initialize=function(l,c){t=l,i=c,u()},o.iterations=function(l){return arguments.length?(s=+l,o):s},o.strength=function(l){return arguments.length?(r=+l,o):r},o.radius=function(l){return arguments.length?(e=typeof l=="function"?l:hn(+l),u(),o):e},o}function yee(e){return e.index}function A_(e,t){var n=e.get(t);if(!n)throw new Error("node not found: "+t);return n}function bee(e){var t=yee,n=f,i,r=hn(30),s,o,a,u,l,c=1;e==null&&(e=[]);function f(m){return 1/Math.min(a[m.source.index],a[m.target.index])}function d(m){for(var y=0,b=e.length;y<c;++y)for(var x=0,v,A,w,E,$,k,F;x<b;++x)v=e[x],A=v.source,w=v.target,E=w.x+w.vx-A.x-A.vx||ro(l),$=w.y+w.vy-A.y-A.vy||ro(l),k=Math.sqrt(E*E+$*$),k=(k-s[x])/k*m*i[x],E*=k,$*=k,w.vx-=E*(F=u[x]),w.vy-=$*F,A.vx+=E*(F=1-F),A.vy+=$*F}function h(){if(o){var m,y=o.length,b=e.length,x=new Map(o.map((A,w)=>[t(A,w,o),A])),v;for(m=0,a=new Array(y);m<b;++m)v=e[m],v.index=m,typeof v.source!="object"&&(v.source=A_(x,v.source)),typeof v.target!="object"&&(v.target=A_(x,v.target)),a[v.source.index]=(a[v.source.index]||0)+1,a[v.target.index]=(a[v.target.index]||0)+1;for(m=0,u=new Array(b);m<b;++m)v=e[m],u[m]=a[v.source.index]/(a[v.source.index]+a[v.target.index]);i=new Array(b),g(),s=new Array(b),p()}}function g(){if(o)for(var m=0,y=e.length;m<y;++m)i[m]=+n(e[m],m,e)}function p(){if(o)for(var m=0,y=e.length;m<y;++m)s[m]=+r(e[m],m,e)}return d.initialize=function(m,y){o=m,l=y,h()},d.links=function(m){return arguments.length?(e=m,h(),d):e},d.id=function(m){return arguments.length?(t=m,d):t},d.iterations=function(m){return arguments.length?(c=+m,d):c},d.strength=function(m){return arguments.length?(n=typeof m=="function"?m:hn(+m),g(),d):n},d.distance=function(m){return arguments.length?(r=typeof m=="function"?m:hn(+m),p(),d):r},d}var xee={value:()=>{}};function MN(){for(var e=0,t=arguments.length,n={},i;e<t;++e){if(!(i=arguments[e]+"")||i in n||/[\s.]/.test(i))throw new Error("illegal type: "+i);n[i]=[]}return new dg(n)}function dg(e){this._=e}function vee(e,t){return e.trim().split(/^|\s+/).map(function(n){var i="",r=n.indexOf(".");if(r>=0&&(i=n.slice(r+1),n=n.slice(0,r)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:i}})}dg.prototype=MN.prototype={constructor:dg,on:function(e,t){var n=this._,i=vee(e+"",n),r,s=-1,o=i.length;if(arguments.length<2){for(;++s<o;)if((r=(e=i[s]).type)&&(r=Aee(n[r],e.name)))return r;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++s<o;)if(r=(e=i[s]).type)n[r]=E_(n[r],e.name,t);else if(t==null)for(r in n)n[r]=E_(n[r],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new dg(e)},call:function(e,t){if((r=arguments.length-2)>0)for(var n=new Array(r),i=0,r,s;i<r;++i)n[i]=arguments[i+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(s=this._[e],i=0,r=s.length;i<r;++i)s[i].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var i=this._[e],r=0,s=i.length;r<s;++r)i[r].value.apply(t,n)}};function Aee(e,t){for(var n=0,i=e.length,r;n<i;++n)if((r=e[n]).name===t)return r.value}function E_(e,t,n){for(var i=0,r=e.length;i<r;++i)if(e[i].name===t){e[i]=xee,e=e.slice(0,i).concat(e.slice(i+1));break}return n!=null&&e.push({name:t,value:n}),e}var Tl=0,kf=0,tf=0,ON=1e3,Tp,Mf,Bp=0,Qa=0,A1=0,Od=typeof performance=="object"&&performance.now?performance:Date,NN=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Zw(){return Qa||(NN(Eee),Qa=Od.now()+A1)}function Eee(){Qa=0}function Rp(){this._call=this._time=this._next=null}Rp.prototype=TN.prototype={constructor:Rp,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?Zw():+n)+(t==null?0:+t),!this._next&&Mf!==this&&(Mf?Mf._next=this:Tp=this,Mf=this),this._call=e,this._time=n,zx()},stop:function(){this._call&&(this._call=null,this._time=1/0,zx())}};function TN(e,t,n){var i=new Rp;return i.restart(e,t,n),i}function wee(){Zw(),++Tl;for(var e=Tp,t;e;)(t=Qa-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Tl}function w_(){Qa=(Bp=Od.now())+A1,Tl=kf=0;try{wee()}finally{Tl=0,Cee(),Qa=0}}function $ee(){var e=Od.now(),t=e-Bp;t>ON&&(A1-=t,Bp=e)}function Cee(){for(var e,t=Tp,n,i=1/0;t;)t._call?(i>t._time&&(i=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:Tp=n);Mf=e,zx(i)}function zx(e){if(!Tl){kf&&(kf=clearTimeout(kf));var t=e-Qa;t>24?(e<1/0&&(kf=setTimeout(w_,e-Od.now()-A1)),tf&&(tf=clearInterval(tf))):(tf||(Bp=Od.now(),tf=setInterval($ee,ON)),Tl=1,NN(w_))}}function Fee(e,t,n){var i=new Rp,r=t;return t==null?(i.restart(e,t,n),i):(i._restart=i.restart,i.restart=function(s,o,a){o=+o,a=a==null?Zw():+a,i._restart(function u(l){l+=r,i._restart(u,r+=o,a),s(l)},o,a)},i.restart(e,t,n),i)}const See=1664525,Dee=1013904223,$_=4294967296;function _ee(){let e=1;return()=>(e=(See*e+Dee)%$_)/$_}function kee(e){return e.x}function Mee(e){return e.y}var Oee=10,Nee=Math.PI*(3-Math.sqrt(5));function Tee(e){var t,n=1,i=.001,r=1-Math.pow(i,1/300),s=0,o=.6,a=new Map,u=TN(f),l=MN("tick","end"),c=_ee();e==null&&(e=[]);function f(){d(),l.call("tick",t),n<i&&(u.stop(),l.call("end",t))}function d(p){var m,y=e.length,b;p===void 0&&(p=1);for(var x=0;x<p;++x)for(n+=(s-n)*r,a.forEach(function(v){v(n)}),m=0;m<y;++m)b=e[m],b.fx==null?b.x+=b.vx*=o:(b.x=b.fx,b.vx=0),b.fy==null?b.y+=b.vy*=o:(b.y=b.fy,b.vy=0);return t}function h(){for(var p=0,m=e.length,y;p<m;++p){if(y=e[p],y.index=p,y.fx!=null&&(y.x=y.fx),y.fy!=null&&(y.y=y.fy),isNaN(y.x)||isNaN(y.y)){var b=Oee*Math.sqrt(.5+p),x=p*Nee;y.x=b*Math.cos(x),y.y=b*Math.sin(x)}(isNaN(y.vx)||isNaN(y.vy))&&(y.vx=y.vy=0)}}function g(p){return p.initialize&&p.initialize(e,c),p}return h(),t={tick:d,restart:function(){return u.restart(f),t},stop:function(){return u.stop(),t},nodes:function(p){return arguments.length?(e=p,h(),a.forEach(g),t):e},alpha:function(p){return arguments.length?(n=+p,t):n},alphaMin:function(p){return arguments.length?(i=+p,t):i},alphaDecay:function(p){return arguments.length?(r=+p,t):+r},alphaTarget:function(p){return arguments.length?(s=+p,t):s},velocityDecay:function(p){return arguments.length?(o=1-p,t):1-o},randomSource:function(p){return arguments.length?(c=p,a.forEach(g),t):c},force:function(p,m){return arguments.length>1?(m==null?a.delete(p):a.set(p,g(m)),t):a.get(p)},find:function(p,m,y){var b=0,x=e.length,v,A,w,E,$;for(y==null?y=1/0:y*=y,b=0;b<x;++b)E=e[b],v=p-E.x,A=m-E.y,w=v*v+A*A,w<y&&($=E,y=w);return $},on:function(p,m){return arguments.length>1?(l.on(p,m),t):l.on(p)}}}function Bee(){var e,t,n,i,r=hn(-30),s,o=1,a=1/0,u=.81;function l(h){var g,p=e.length,m=Jw(e,kee,Mee).visitAfter(f);for(i=h,g=0;g<p;++g)t=e[g],m.visit(d)}function c(){if(e){var h,g=e.length,p;for(s=new Array(g),h=0;h<g;++h)p=e[h],s[p.index]=+r(p,h,e)}}function f(h){var g=0,p,m,y=0,b,x,v;if(h.length){for(b=x=v=0;v<4;++v)(p=h[v])&&(m=Math.abs(p.value))&&(g+=p.value,y+=m,b+=m*p.x,x+=m*p.y);h.x=b/y,h.y=x/y}else{p=h,p.x=p.data.x,p.y=p.data.y;do g+=s[p.data.index];while(p=p.next)}h.value=g}function d(h,g,p,m){if(!h.value)return!0;var y=h.x-t.x,b=h.y-t.y,x=m-g,v=y*y+b*b;if(x*x/u<v)return v<a&&(y===0&&(y=ro(n),v+=y*y),b===0&&(b=ro(n),v+=b*b),v<o&&(v=Math.sqrt(o*v)),t.vx+=y*h.value*i/v,t.vy+=b*h.value*i/v),!0;if(h.length||v>=a)return;(h.data!==t||h.next)&&(y===0&&(y=ro(n),v+=y*y),b===0&&(b=ro(n),v+=b*b),v<o&&(v=Math.sqrt(o*v)));do h.data!==t&&(x=s[h.data.index]*i/v,t.vx+=y*x,t.vy+=b*x);while(h=h.next)}return l.initialize=function(h,g){e=h,n=g,c()},l.strength=function(h){return arguments.length?(r=typeof h=="function"?h:hn(+h),c(),l):r},l.distanceMin=function(h){return arguments.length?(o=h*h,l):Math.sqrt(o)},l.distanceMax=function(h){return arguments.length?(a=h*h,l):Math.sqrt(a)},l.theta=function(h){return arguments.length?(u=h*h,l):Math.sqrt(u)},l}function Ree(e){var t=hn(.1),n,i,r;typeof e!="function"&&(e=hn(e==null?0:+e));function s(a){for(var u=0,l=n.length,c;u<l;++u)c=n[u],c.vx+=(r[u]-c.x)*i[u]*a}function o(){if(n){var a,u=n.length;for(i=new Array(u),r=new Array(u),a=0;a<u;++a)i[a]=isNaN(r[a]=+e(n[a],a,n))?0:+t(n[a],a,n)}}return s.initialize=function(a){n=a,o()},s.strength=function(a){return arguments.length?(t=typeof a=="function"?a:hn(+a),o(),s):t},s.x=function(a){return arguments.length?(e=typeof a=="function"?a:hn(+a),o(),s):e},s}function Lee(e){var t=hn(.1),n,i,r;typeof e!="function"&&(e=hn(e==null?0:+e));function s(a){for(var u=0,l=n.length,c;u<l;++u)c=n[u],c.vy+=(r[u]-c.y)*i[u]*a}function o(){if(n){var a,u=n.length;for(i=new Array(u),r=new Array(u),a=0;a<u;++a)i[a]=isNaN(r[a]=+e(n[a],a,n))?0:+t(n[a],a,n)}}return s.initialize=function(a){n=a,o()},s.strength=function(a){return arguments.length?(t=typeof a=="function"?a:hn(+a),o(),s):t},s.y=function(a){return arguments.length?(e=typeof a=="function"?a:hn(+a),o(),s):e},s}const C_={center:JZ,collide:mee,nbody:Bee,link:bee,x:Ree,y:Lee},Of="forces",jx=["alpha","alphaMin","alphaTarget","velocityDecay","forces"],Pee=["static","iterations"],BN=["x","y","vx","vy"];function e$(e){N.call(this,null,e)}e$.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:BN}]};KZ(e$,N,{transform(e,t){var n=this.value,i=t.changed(t.ADD_REM),r=e.modified(jx),s=e.iterations||300;if(n?(i&&(t.modifies("index"),n.nodes(t.source)),(r||t.changed(t.MOD))&&RN(n,e,0,t)):(this.value=n=zee(t.source,e),n.on("tick",Iee(t.dataflow,this)),e.static||(i=!0,n.tick()),t.modifies("index")),r||i||e.modified(Pee)||t.changed()&&e.restart){if(n.alpha(Math.max(n.alpha(),e.alpha||1)).alphaDecay(1-Math.pow(n.alphaMin(),1/s)),e.static)for(n.stop();--s>=0;)n.tick();else if(n.stopped()&&n.restart(),!i)return t.StopPropagation}return this.finish(e,t)},finish(e,t){const n=t.dataflow;for(let a=this._argops,u=0,l=a.length,c;u<l;++u)if(c=a[u],!(c.name!==Of||c.op._argval.force!=="link")){for(var i=c.op._argops,r=0,s=i.length,o;r<s;++r)if(i[r].name==="links"&&(o=i[r].op.source)){n.pulse(o,n.changeset().reflow());break}}return t.reflow(e.modified()).modifies(BN)}});function Iee(e,t){return()=>e.touch(t).run()}function zee(e,t){const n=Tee(e),i=n.stop,r=n.restart;let s=!1;return n.stopped=()=>s,n.restart=()=>(s=!1,r()),n.stop=()=>(s=!0,i()),RN(n,t,!0).on("end",()=>s=!0)}function RN(e,t,n,i){var r=HZ(t.forces),s,o,a,u;for(s=0,o=jx.length;s<o;++s)a=jx[s],a!==Of&&t.modified(a)&&e[a](t[a]);for(s=0,o=r.length;s<o;++s)u=Of+s,a=n||t.modified(Of,s)?Uee(r[s]):i&&jee(r[s],i)?e.force(u):null,a&&e.force(u,a);for(o=e.numForces||0;s<o;++s)e.force(Of+s,null);return e.numForces=r.length,e}function jee(e,t){var n,i;for(n in e)if(Kw(i=e[n])&&t.modified(IZ(i)))return 1;return 0}function Uee(e){var t,n;XZ(C_,e.force)||fg("Unrecognized force: "+e.force),t=C_[e.force]();for(n in e)Kw(t[n])&&qee(t[n],e[n],e);return t}function qee(e,t,n){e(Kw(t)?i=>t(i,n):t)}const Wee=Object.freeze(Object.defineProperty({__proto__:null,force:e$},Symbol.toStringTag,{value:"Module"}));function bc(e,t,n){return e.fields=t||[],e.fname=n,e}function Gee(e){return e.length===1?Hee(e[0]):Vee(e)}const Hee=e=>function(t){return t[e]},Vee=e=>{const t=e.length;return function(n){for(let i=0;i<t;++i)n=n[e[i]];return n}};function br(e){throw Error(e)}function Yee(e){const t=[],n=e.length;let i=null,r=0,s="",o,a,u;e=e+"";function l(){t.push(s+e.substring(o,a)),s="",o=a+1}for(o=a=0;a<n;++a)if(u=e[a],u==="\\")s+=e.substring(o,a++),o=a;else if(u===i)l(),i=null,r=-1;else{if(i)continue;o===r&&u==='"'||o===r&&u==="'"?(o=a+1,i=u):u==="."&&!r?a>o?l():o=a+1:u==="["?(a>o&&l(),r=o=a+1):u==="]"&&(r||br("Access path missing open bracket: "+e),r>0&&l(),r=0,o=a+1)}return r&&br("Access path missing closing bracket: "+e),i&&br("Access path missing closing quote: "+e),a>o&&(a++,l()),t}function Xee(e,t,n){const i=Yee(e);return e=i.length===1?i[0]:e,bc((n&&n.get||Gee)(i),[e],t||e)}Xee("id");bc(e=>e,[],"identity");bc(()=>0,[],"zero");const Kee=bc(()=>1,[],"one"),Jee=bc(()=>!0,[],"true");bc(()=>!1,[],"false");var Qee=Array.isArray;function Zee(e){return e!=null?Qee(e)?e:[e]:[]}function ete(e){for(let t,n,i=1,r=arguments.length;i<r;++i){t=arguments[i];for(n in t)e[n]=t[n]}return e}const tte=Object.prototype.hasOwnProperty;function LN(e,t){return tte.call(e,t)}function jo(e,t,n){const i=e.prototype=Object.create(t.prototype);return Object.defineProperty(i,"constructor",{value:e,writable:!0,enumerable:!0,configurable:!0}),ete(i,n)}function nte(e,t){return e.parent===t.parent?1:2}function ite(e){return e.reduce(rte,0)/e.length}function rte(e,t){return e+t.x}function ste(e){return 1+e.reduce(ote,0)}function ote(e,t){return Math.max(e,t.y)}function ate(e){for(var t;t=e.children;)e=t[0];return e}function ute(e){for(var t;t=e.children;)e=t[t.length-1];return e}function lte(){var e=nte,t=1,n=1,i=!1;function r(s){var o,a=0;s.eachAfter(function(d){var h=d.children;h?(d.x=ite(h),d.y=ste(h)):(d.x=o?a+=e(d,o):0,d.y=0,o=d)});var u=ate(s),l=ute(s),c=u.x-e(u,l)/2,f=l.x+e(l,u)/2;return s.eachAfter(i?function(d){d.x=(d.x-s.x)*t,d.y=(s.y-d.y)*n}:function(d){d.x=(d.x-c)/(f-c)*t,d.y=(1-(s.y?d.y/s.y:1))*n})}return r.separation=function(s){return arguments.length?(e=s,r):e},r.size=function(s){return arguments.length?(i=!1,t=+s[0],n=+s[1],r):i?null:[t,n]},r.nodeSize=function(s){return arguments.length?(i=!0,t=+s[0],n=+s[1],r):i?[t,n]:null},r}function cte(e){var t=0,n=e.children,i=n&&n.length;if(!i)t=1;else for(;--i>=0;)t+=n[i].value;e.value=t}function fte(){return this.eachAfter(cte)}function dte(e,t){let n=-1;for(const i of this)e.call(t,i,++n,this);return this}function hte(e,t){for(var n=this,i=[n],r,s,o=-1;n=i.pop();)if(e.call(t,n,++o,this),r=n.children)for(s=r.length-1;s>=0;--s)i.push(r[s]);return this}function gte(e,t){for(var n=this,i=[n],r=[],s,o,a,u=-1;n=i.pop();)if(r.push(n),s=n.children)for(o=0,a=s.length;o<a;++o)i.push(s[o]);for(;n=r.pop();)e.call(t,n,++u,this);return this}function pte(e,t){let n=-1;for(const i of this)if(e.call(t,i,++n,this))return i}function mte(e){return this.eachAfter(function(t){for(var n=+e(t.data)||0,i=t.children,r=i&&i.length;--r>=0;)n+=i[r].value;t.value=n})}function yte(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})}function bte(e){for(var t=this,n=xte(t,e),i=[t];t!==n;)t=t.parent,i.push(t);for(var r=i.length;e!==n;)i.splice(r,0,e),e=e.parent;return i}function xte(e,t){if(e===t)return e;var n=e.ancestors(),i=t.ancestors(),r=null;for(e=n.pop(),t=i.pop();e===t;)r=e,e=n.pop(),t=i.pop();return r}function vte(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t}function Ate(){return Array.from(this)}function Ete(){var e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e}function wte(){var e=this,t=[];return e.each(function(n){n!==e&&t.push({source:n.parent,target:n})}),t}function*$te(){var e=this,t,n=[e],i,r,s;do for(t=n.reverse(),n=[];e=t.pop();)if(yield e,i=e.children)for(r=0,s=i.length;r<s;++r)n.push(i[r]);while(n.length)}function t$(e,t){e instanceof Map?(e=[void 0,e],t===void 0&&(t=Ste)):t===void 0&&(t=Fte);for(var n=new Bl(e),i,r=[n],s,o,a,u;i=r.pop();)if((o=t(i.data))&&(u=(o=Array.from(o)).length))for(i.children=o,a=u-1;a>=0;--a)r.push(s=o[a]=new Bl(o[a])),s.parent=i,s.depth=i.depth+1;return n.eachBefore(PN)}function Cte(){return t$(this).eachBefore(Dte)}function Fte(e){return e.children}function Ste(e){return Array.isArray(e)?e[1]:null}function Dte(e){e.data.value!==void 0&&(e.value=e.data.value),e.data=e.data.data}function PN(e){var t=0;do e.height=t;while((e=e.parent)&&e.height<++t)}function Bl(e){this.data=e,this.depth=this.height=0,this.parent=null}Bl.prototype=t$.prototype={constructor:Bl,count:fte,each:dte,eachAfter:gte,eachBefore:hte,find:pte,sum:mte,sort:yte,path:bte,ancestors:vte,descendants:Ate,leaves:Ete,links:wte,copy:Cte,[Symbol.iterator]:$te};function hg(e){return e==null?null:IN(e)}function IN(e){if(typeof e!="function")throw new Error;return e}function $a(){return 0}function Vu(e){return function(){return e}}const _te=1664525,kte=1013904223,F_=4294967296;function Mte(){let e=1;return()=>(e=(_te*e+kte)%F_)/F_}function Ote(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Nte(e,t){let n=e.length,i,r;for(;n;)r=t()*n--|0,i=e[n],e[n]=e[r],e[r]=i;return e}function Tte(e,t){for(var n=0,i=(e=Nte(Array.from(e),t)).length,r=[],s,o;n<i;)s=e[n],o&&zN(o,s)?++n:(o=Rte(r=Bte(r,s)),n=0);return o}function Bte(e,t){var n,i;if(xb(t,e))return[t];for(n=0;n<e.length;++n)if(D0(t,e[n])&&xb(Nf(e[n],t),e))return[e[n],t];for(n=0;n<e.length-1;++n)for(i=n+1;i<e.length;++i)if(D0(Nf(e[n],e[i]),t)&&D0(Nf(e[n],t),e[i])&&D0(Nf(e[i],t),e[n])&&xb(jN(e[n],e[i],t),e))return[e[n],e[i],t];throw new Error}function D0(e,t){var n=e.r-t.r,i=t.x-e.x,r=t.y-e.y;return n<0||n*n<i*i+r*r}function zN(e,t){var n=e.r-t.r+Math.max(e.r,t.r,1)*1e-9,i=t.x-e.x,r=t.y-e.y;return n>0&&n*n>i*i+r*r}function xb(e,t){for(var n=0;n<t.length;++n)if(!zN(e,t[n]))return!1;return!0}function Rte(e){switch(e.length){case 1:return Lte(e[0]);case 2:return Nf(e[0],e[1]);case 3:return jN(e[0],e[1],e[2])}}function Lte(e){return{x:e.x,y:e.y,r:e.r}}function Nf(e,t){var n=e.x,i=e.y,r=e.r,s=t.x,o=t.y,a=t.r,u=s-n,l=o-i,c=a-r,f=Math.sqrt(u*u+l*l);return{x:(n+s+u/f*c)/2,y:(i+o+l/f*c)/2,r:(f+r+a)/2}}function jN(e,t,n){var i=e.x,r=e.y,s=e.r,o=t.x,a=t.y,u=t.r,l=n.x,c=n.y,f=n.r,d=i-o,h=i-l,g=r-a,p=r-c,m=u-s,y=f-s,b=i*i+r*r-s*s,x=b-o*o-a*a+u*u,v=b-l*l-c*c+f*f,A=h*g-d*p,w=(g*v-p*x)/(A*2)-i,E=(p*m-g*y)/A,$=(h*x-d*v)/(A*2)-r,k=(d*y-h*m)/A,F=E*E+k*k-1,D=2*(s+w*E+$*k),T=w*w+$*$-s*s,C=-(Math.abs(F)>1e-6?(D+Math.sqrt(D*D-4*F*T))/(2*F):T/D);return{x:i+w+E*C,y:r+$+k*C,r:C}}function S_(e,t,n){var i=e.x-t.x,r,s,o=e.y-t.y,a,u,l=i*i+o*o;l?(s=t.r+n.r,s*=s,u=e.r+n.r,u*=u,s>u?(r=(l+u-s)/(2*l),a=Math.sqrt(Math.max(0,u/l-r*r)),n.x=e.x-r*i-a*o,n.y=e.y-r*o+a*i):(r=(l+s-u)/(2*l),a=Math.sqrt(Math.max(0,s/l-r*r)),n.x=t.x+r*i-a*o,n.y=t.y+r*o+a*i)):(n.x=t.x+n.r,n.y=t.y)}function D_(e,t){var n=e.r+t.r-1e-6,i=t.x-e.x,r=t.y-e.y;return n>0&&n*n>i*i+r*r}function __(e){var t=e._,n=e.next._,i=t.r+n.r,r=(t.x*n.r+n.x*t.r)/i,s=(t.y*n.r+n.y*t.r)/i;return r*r+s*s}function _0(e){this._=e,this.next=null,this.previous=null}function Pte(e,t){if(!(s=(e=Ote(e)).length))return 0;var n,i,r,s,o,a,u,l,c,f,d;if(n=e[0],n.x=0,n.y=0,!(s>1))return n.r;if(i=e[1],n.x=-i.r,i.x=n.r,i.y=0,!(s>2))return n.r+i.r;S_(i,n,r=e[2]),n=new _0(n),i=new _0(i),r=new _0(r),n.next=r.previous=i,i.next=n.previous=r,r.next=i.previous=n;e:for(u=3;u<s;++u){S_(n._,i._,r=e[u]),r=new _0(r),l=i.next,c=n.previous,f=i._.r,d=n._.r;do if(f<=d){if(D_(l._,r._)){i=l,n.next=i,i.previous=n,--u;continue e}f+=l._.r,l=l.next}else{if(D_(c._,r._)){n=c,n.next=i,i.previous=n,--u;continue e}d+=c._.r,c=c.previous}while(l!==c.next);for(r.previous=n,r.next=i,n.next=i.previous=i=r,o=__(n);(r=r.next)!==i;)(a=__(r))<o&&(n=r,o=a);i=n.next}for(n=[i._],r=i;(r=r.next)!==i;)n.push(r._);for(r=Tte(n,t),u=0;u<s;++u)n=e[u],n.x-=r.x,n.y-=r.y;return r.r}function Ite(e){return Math.sqrt(e.value)}function zte(){var e=null,t=1,n=1,i=$a;function r(s){const o=Mte();return s.x=t/2,s.y=n/2,e?s.eachBefore(k_(e)).eachAfter(vb(i,.5,o)).eachBefore(M_(1)):s.eachBefore(k_(Ite)).eachAfter(vb($a,1,o)).eachAfter(vb(i,s.r/Math.min(t,n),o)).eachBefore(M_(Math.min(t,n)/(2*s.r))),s}return r.radius=function(s){return arguments.length?(e=hg(s),r):e},r.size=function(s){return arguments.length?(t=+s[0],n=+s[1],r):[t,n]},r.padding=function(s){return arguments.length?(i=typeof s=="function"?s:Vu(+s),r):i},r}function k_(e){return function(t){t.children||(t.r=Math.max(0,+e(t)||0))}}function vb(e,t,n){return function(i){if(r=i.children){var r,s,o=r.length,a=e(i)*t||0,u;if(a)for(s=0;s<o;++s)r[s].r+=a;if(u=Pte(r,n),a)for(s=0;s<o;++s)r[s].r-=a;i.r=u+a}}}function M_(e){return function(t){var n=t.parent;t.r*=e,n&&(t.x=n.x+e*t.x,t.y=n.y+e*t.y)}}function UN(e){e.x0=Math.round(e.x0),e.y0=Math.round(e.y0),e.x1=Math.round(e.x1),e.y1=Math.round(e.y1)}function Oh(e,t,n,i,r){for(var s=e.children,o,a=-1,u=s.length,l=e.value&&(i-t)/e.value;++a<u;)o=s[a],o.y0=n,o.y1=r,o.x0=t,o.x1=t+=o.value*l}function jte(){var e=1,t=1,n=0,i=!1;function r(o){var a=o.height+1;return o.x0=o.y0=n,o.x1=e,o.y1=t/a,o.eachBefore(s(t,a)),i&&o.eachBefore(UN),o}function s(o,a){return function(u){u.children&&Oh(u,u.x0,o*(u.depth+1)/a,u.x1,o*(u.depth+2)/a);var l=u.x0,c=u.y0,f=u.x1-n,d=u.y1-n;f<l&&(l=f=(l+f)/2),d<c&&(c=d=(c+d)/2),u.x0=l,u.y0=c,u.x1=f,u.y1=d}}return r.round=function(o){return arguments.length?(i=!!o,r):i},r.size=function(o){return arguments.length?(e=+o[0],t=+o[1],r):[e,t]},r.padding=function(o){return arguments.length?(n=+o,r):n},r}var Ute={depth:-1},O_={},Ab={};function qte(e){return e.id}function Wte(e){return e.parentId}function N_(){var e=qte,t=Wte,n;function i(r){var s=Array.from(r),o=e,a=t,u,l,c,f,d,h,g,p,m=new Map;if(n!=null){const y=s.map((v,A)=>Gte(n(v,A,r))),b=y.map(T_),x=new Set(y).add("");for(const v of b)x.has(v)||(x.add(v),y.push(v),b.push(T_(v)),s.push(Ab));o=(v,A)=>y[A],a=(v,A)=>b[A]}for(c=0,u=s.length;c<u;++c)l=s[c],h=s[c]=new Bl(l),(g=o(l,c,r))!=null&&(g+="")&&(p=h.id=g,m.set(p,m.has(p)?O_:h)),(g=a(l,c,r))!=null&&(g+="")&&(h.parent=g);for(c=0;c<u;++c)if(h=s[c],g=h.parent){if(d=m.get(g),!d)throw new Error("missing: "+g);if(d===O_)throw new Error("ambiguous: "+g);d.children?d.children.push(h):d.children=[h],h.parent=d}else{if(f)throw new Error("multiple roots");f=h}if(!f)throw new Error("no root");if(n!=null){for(;f.data===Ab&&f.children.length===1;)f=f.children[0],--u;for(let y=s.length-1;y>=0&&(h=s[y],h.data===Ab);--y)h.data=null}if(f.parent=Ute,f.eachBefore(function(y){y.depth=y.parent.depth+1,--u}).eachBefore(PN),f.parent=null,u>0)throw new Error("cycle");return f}return i.id=function(r){return arguments.length?(e=hg(r),i):e},i.parentId=function(r){return arguments.length?(t=hg(r),i):t},i.path=function(r){return arguments.length?(n=hg(r),i):n},i}function Gte(e){e=`${e}`;let t=e.length;return Ux(e,t-1)&&!Ux(e,t-2)&&(e=e.slice(0,-1)),e[0]==="/"?e:`/${e}`}function T_(e){let t=e.length;if(t<2)return"";for(;--t>1&&!Ux(e,t););return e.slice(0,t)}function Ux(e,t){if(e[t]==="/"){let n=0;for(;t>0&&e[--t]==="\\";)++n;if(!(n&1))return!0}return!1}function Hte(e,t){return e.parent===t.parent?1:2}function Eb(e){var t=e.children;return t?t[0]:e.t}function wb(e){var t=e.children;return t?t[t.length-1]:e.t}function Vte(e,t,n){var i=n/(t.i-e.i);t.c-=i,t.s+=n,e.c+=i,t.z+=n,t.m+=n}function Yte(e){for(var t=0,n=0,i=e.children,r=i.length,s;--r>=0;)s=i[r],s.z+=t,s.m+=t,t+=s.s+(n+=s.c)}function Xte(e,t,n){return e.a.parent===t.parent?e.a:n}function gg(e,t){this._=e,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=t}gg.prototype=Object.create(Bl.prototype);function Kte(e){for(var t=new gg(e,0),n,i=[t],r,s,o,a;n=i.pop();)if(s=n._.children)for(n.children=new Array(a=s.length),o=a-1;o>=0;--o)i.push(r=n.children[o]=new gg(s[o],o)),r.parent=n;return(t.parent=new gg(null,0)).children=[t],t}function Jte(){var e=Hte,t=1,n=1,i=null;function r(l){var c=Kte(l);if(c.eachAfter(s),c.parent.m=-c.z,c.eachBefore(o),i)l.eachBefore(u);else{var f=l,d=l,h=l;l.eachBefore(function(b){b.x<f.x&&(f=b),b.x>d.x&&(d=b),b.depth>h.depth&&(h=b)});var g=f===d?1:e(f,d)/2,p=g-f.x,m=t/(d.x+g+p),y=n/(h.depth||1);l.eachBefore(function(b){b.x=(b.x+p)*m,b.y=b.depth*y})}return l}function s(l){var c=l.children,f=l.parent.children,d=l.i?f[l.i-1]:null;if(c){Yte(l);var h=(c[0].z+c[c.length-1].z)/2;d?(l.z=d.z+e(l._,d._),l.m=l.z-h):l.z=h}else d&&(l.z=d.z+e(l._,d._));l.parent.A=a(l,d,l.parent.A||f[0])}function o(l){l._.x=l.z+l.parent.m,l.m+=l.parent.m}function a(l,c,f){if(c){for(var d=l,h=l,g=c,p=d.parent.children[0],m=d.m,y=h.m,b=g.m,x=p.m,v;g=wb(g),d=Eb(d),g&&d;)p=Eb(p),h=wb(h),h.a=l,v=g.z+b-d.z-m+e(g._,d._),v>0&&(Vte(Xte(g,l,f),l,v),m+=v,y+=v),b+=g.m,m+=d.m,x+=p.m,y+=h.m;g&&!wb(h)&&(h.t=g,h.m+=b-y),d&&!Eb(p)&&(p.t=d,p.m+=m-x,f=l)}return f}function u(l){l.x*=t,l.y=l.depth*n}return r.separation=function(l){return arguments.length?(e=l,r):e},r.size=function(l){return arguments.length?(i=!1,t=+l[0],n=+l[1],r):i?null:[t,n]},r.nodeSize=function(l){return arguments.length?(i=!0,t=+l[0],n=+l[1],r):i?[t,n]:null},r}function E1(e,t,n,i,r){for(var s=e.children,o,a=-1,u=s.length,l=e.value&&(r-n)/e.value;++a<u;)o=s[a],o.x0=t,o.x1=i,o.y0=n,o.y1=n+=o.value*l}var qN=(1+Math.sqrt(5))/2;function WN(e,t,n,i,r,s){for(var o=[],a=t.children,u,l,c=0,f=0,d=a.length,h,g,p=t.value,m,y,b,x,v,A,w;c<d;){h=r-n,g=s-i;do m=a[f++].value;while(!m&&f<d);for(y=b=m,A=Math.max(g/h,h/g)/(p*e),w=m*m*A,v=Math.max(b/w,w/y);f<d;++f){if(m+=l=a[f].value,l<y&&(y=l),l>b&&(b=l),w=m*m*A,x=Math.max(b/w,w/y),x>v){m-=l;break}v=x}o.push(u={value:m,dice:h<g,children:a.slice(c,f)}),u.dice?Oh(u,n,i,r,p?i+=g*m/p:s):E1(u,n,i,p?n+=h*m/p:r,s),p-=m,c=f}return o}const GN=function e(t){function n(i,r,s,o,a){WN(t,i,r,s,o,a)}return n.ratio=function(i){return e((i=+i)>1?i:1)},n}(qN);function Qte(){var e=GN,t=!1,n=1,i=1,r=[0],s=$a,o=$a,a=$a,u=$a,l=$a;function c(d){return d.x0=d.y0=0,d.x1=n,d.y1=i,d.eachBefore(f),r=[0],t&&d.eachBefore(UN),d}function f(d){var h=r[d.depth],g=d.x0+h,p=d.y0+h,m=d.x1-h,y=d.y1-h;m<g&&(g=m=(g+m)/2),y<p&&(p=y=(p+y)/2),d.x0=g,d.y0=p,d.x1=m,d.y1=y,d.children&&(h=r[d.depth+1]=s(d)/2,g+=l(d)-h,p+=o(d)-h,m-=a(d)-h,y-=u(d)-h,m<g&&(g=m=(g+m)/2),y<p&&(p=y=(p+y)/2),e(d,g,p,m,y))}return c.round=function(d){return arguments.length?(t=!!d,c):t},c.size=function(d){return arguments.length?(n=+d[0],i=+d[1],c):[n,i]},c.tile=function(d){return arguments.length?(e=IN(d),c):e},c.padding=function(d){return arguments.length?c.paddingInner(d).paddingOuter(d):c.paddingInner()},c.paddingInner=function(d){return arguments.length?(s=typeof d=="function"?d:Vu(+d),c):s},c.paddingOuter=function(d){return arguments.length?c.paddingTop(d).paddingRight(d).paddingBottom(d).paddingLeft(d):c.paddingTop()},c.paddingTop=function(d){return arguments.length?(o=typeof d=="function"?d:Vu(+d),c):o},c.paddingRight=function(d){return arguments.length?(a=typeof d=="function"?d:Vu(+d),c):a},c.paddingBottom=function(d){return arguments.length?(u=typeof d=="function"?d:Vu(+d),c):u},c.paddingLeft=function(d){return arguments.length?(l=typeof d=="function"?d:Vu(+d),c):l},c}function Zte(e,t,n,i,r){var s=e.children,o,a=s.length,u,l=new Array(a+1);for(l[0]=u=o=0;o<a;++o)l[o+1]=u+=s[o].value;c(0,a,e.value,t,n,i,r);function c(f,d,h,g,p,m,y){if(f>=d-1){var b=s[f];b.x0=g,b.y0=p,b.x1=m,b.y1=y;return}for(var x=l[f],v=h/2+x,A=f+1,w=d-1;A<w;){var E=A+w>>>1;l[E]<v?A=E+1:w=E}v-l[A-1]<l[A]-v&&f+1<A&&--A;var $=l[A]-x,k=h-$;if(m-g>y-p){var F=h?(g*k+m*$)/h:m;c(f,A,$,g,p,F,y),c(A,d,k,F,p,m,y)}else{var D=h?(p*k+y*$)/h:y;c(f,A,$,g,p,m,D),c(A,d,k,g,D,m,y)}}}function ene(e,t,n,i,r){(e.depth&1?E1:Oh)(e,t,n,i,r)}const tne=function e(t){function n(i,r,s,o,a){if((u=i._squarify)&&u.ratio===t)for(var u,l,c,f,d=-1,h,g=u.length,p=i.value;++d<g;){for(l=u[d],c=l.children,f=l.value=0,h=c.length;f<h;++f)l.value+=c[f].value;l.dice?Oh(l,r,s,o,p?s+=(a-s)*l.value/p:a):E1(l,r,s,p?r+=(o-r)*l.value/p:o,a),p-=l.value}else i._squarify=u=WN(t,i,r,s,o,a),u.ratio=t}return n.ratio=function(i){return e((i=+i)>1?i:1)},n}(qN);function qx(e,t,n){const i={};return e.each(r=>{const s=r.data;n(s)&&(i[t(s)]=r)}),e.lookup=i,e}function n$(e){N.call(this,null,e)}n$.Definition={type:"Nest",metadata:{treesource:!0,changes:!0},params:[{name:"keys",type:"field",array:!0},{name:"generate",type:"boolean"}]};const nne=e=>e.values;jo(n$,N,{transform(e,t){t.source||br("Nest transform requires an upstream data source.");var n=e.generate,i=e.modified(),r=t.clone(),s=this.value;return(!s||i||t.changed())&&(s&&s.each(o=>{o.children&&Bm(o.data)&&r.rem.push(o.data)}),this.value=s=t$({values:Zee(e.keys).reduce((o,a)=>(o.key(a),o),ine()).entries(r.source)},nne),n&&s.each(o=>{o.children&&(o=De(o.data),r.add.push(o),r.source.push(o))}),qx(s,Z,Z)),r.source.root=s,r}});function ine(){const e=[],t={entries:r=>i(n(r,0),0),key:r=>(e.push(r),t)};function n(r,s){if(s>=e.length)return r;const o=r.length,a=e[s++],u={},l={};let c=-1,f,d,h;for(;++c<o;)f=a(d=r[c])+"",(h=u[f])?h.push(d):u[f]=[d];for(f in u)l[f]=n(u[f],s);return l}function i(r,s){if(++s>e.length)return r;const o=[];for(const a in r)o.push({key:a,values:i(r[a],s)});return o}return t}function Ns(e){N.call(this,null,e)}const rne=(e,t)=>e.parent===t.parent?1:2;jo(Ns,N,{transform(e,t){(!t.source||!t.source.root)&&br(this.constructor.name+" transform requires a backing tree data source.");const n=this.layout(e.method),i=this.fields,r=t.source.root,s=e.as||i;e.field?r.sum(e.field):r.count(),e.sort&&r.sort(mu(e.sort,o=>o.data)),sne(n,this.params,e),n.separation&&n.separation(e.separation!==!1?rne:Kee);try{this.value=n(r)}catch(o){br(o)}return r.each(o=>one(o,i,s)),t.reflow(e.modified()).modifies(s).modifies("leaf")}});function sne(e,t,n){for(let i,r=0,s=t.length;r<s;++r)i=t[r],i in n&&e[i](n[i])}function one(e,t,n){const i=e.data,r=t.length-1;for(let s=0;s<r;++s)i[n[s]]=e[t[s]];i[n[r]]=e.children?e.children.length:0}const Wx=["x","y","r","depth","children"];function i$(e){Ns.call(this,e)}i$.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:Wx.length,default:Wx}]};jo(i$,Ns,{layout:zte,params:["radius","size","padding"],fields:Wx});const Gx=["x0","y0","x1","y1","depth","children"];function r$(e){Ns.call(this,e)}r$.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:Gx.length,default:Gx}]};jo(r$,Ns,{layout:jte,params:["size","round","padding"],fields:Gx});function s$(e){N.call(this,null,e)}s$.Definition={type:"Stratify",metadata:{treesource:!0},params:[{name:"key",type:"field",required:!0},{name:"parentKey",type:"field",required:!0}]};jo(s$,N,{transform(e,t){t.source||br("Stratify transform requires an upstream data source.");let n=this.value;const i=e.modified(),r=t.fork(t.ALL).materialize(t.SOURCE),s=!n||i||t.changed(t.ADD_REM)||t.modified(e.key.fields)||t.modified(e.parentKey.fields);return r.source=r.source.slice(),s&&(n=r.source.length?qx(N_().id(e.key).parentId(e.parentKey)(r.source),e.key,Jee):qx(N_()([{}]),e.key,e.key)),r.source.root=this.value=n,r}});const B_={tidy:Jte,cluster:lte},Hx=["x","y","depth","children"];function o$(e){Ns.call(this,e)}o$.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:Hx.length,default:Hx}]};jo(o$,Ns,{layout(e){const t=e||"tidy";if(LN(B_,t))return B_[t]();br("Unrecognized Tree layout method: "+t)},params:["size","nodeSize"],fields:Hx});function a$(e){N.call(this,[],e)}a$.Definition={type:"TreeLinks",metadata:{tree:!0,generates:!0,changes:!0},params:[]};jo(a$,N,{transform(e,t){const n=this.value,i=t.source&&t.source.root,r=t.fork(t.NO_SOURCE),s={};return i||br("TreeLinks transform requires a tree data source."),t.changed(t.ADD_REM)?(r.rem=n,t.visit(t.SOURCE,o=>s[Z(o)]=1),i.each(o=>{const a=o.data,u=o.parent&&o.parent.data;u&&s[Z(a)]&&s[Z(u)]&&r.add.push(De({source:u,target:a}))}),this.value=r.add):t.changed(t.MOD)&&(t.visit(t.MOD,o=>s[Z(o)]=1),n.forEach(o=>{(s[Z(o.source)]||s[Z(o.target)])&&r.mod.push(o)})),r}});const R_={binary:Zte,dice:Oh,slice:E1,slicedice:ene,squarify:GN,resquarify:tne},Vx=["x0","y0","x1","y1","depth","children"];function u$(e){Ns.call(this,e)}u$.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:Vx.length,default:Vx}]};jo(u$,Ns,{layout(){const e=Qte();return e.ratio=t=>{const n=e.tile();n.ratio&&e.tile(n.ratio(t))},e.method=t=>{LN(R_,t)?e.tile(R_[t]):br("Unrecognized Treemap layout method: "+t)},e},params:["method","ratio","size","round","padding","paddingInner","paddingOuter","paddingTop","paddingRight","paddingBottom","paddingLeft"],fields:Vx});const ane=Object.freeze(Object.defineProperty({__proto__:null,nest:n$,pack:i$,partition:r$,stratify:s$,tree:o$,treelinks:a$,treemap:u$},Symbol.toStringTag,{value:"Module"}));function xc(e,t,n){return e.fields=t||[],e.fname=n,e}function al(e){return e==null?null:e.fname}function une(e){return e.length===1?lne(e[0]):cne(e)}const lne=e=>function(t){return t[e]},cne=e=>{const t=e.length;return function(n){for(let i=0;i<t;++i)n=n[e[i]];return n}};function Qf(e){throw Error(e)}function vu(e){const t=[],n=e.length;let i=null,r=0,s="",o,a,u;e=e+"";function l(){t.push(s+e.substring(o,a)),s="",o=a+1}for(o=a=0;a<n;++a)if(u=e[a],u==="\\")s+=e.substring(o,a),s+=e.substring(++a,++a),o=a;else if(u===i)l(),i=null,r=-1;else{if(i)continue;o===r&&u==='"'||o===r&&u==="'"?(o=a+1,i=u):u==="."&&!r?a>o?l():o=a+1:u==="["?(a>o&&l(),r=o=a+1):u==="]"&&(r||Qf("Access path missing open bracket: "+e),r>0&&l(),r=0,o=a+1)}return r&&Qf("Access path missing closing bracket: "+e),i&&Qf("Access path missing closing quote: "+e),a>o&&(a++,l()),t}function fne(e,t,n){const i=vu(e);return e=i.length===1?i[0]:e,xc((n&&n.get||une)(i),[e],t||e)}fne("id");const dne=xc(e=>e,[],"identity");xc(()=>0,[],"zero");xc(()=>1,[],"one");xc(()=>!0,[],"true");xc(()=>!1,[],"false");function k0(e,t,n){const i=[t].concat([].slice.call(n));console[e].apply(console,i)}const hne=0,gne=1,HN=2,pne=3,mne=4;function yne(e,t){let n=e||hne;return{level(i){return arguments.length?(n=+i,this):n},error(){return n>=gne&&k0(t||"error","ERROR",arguments),this},warn(){return n>=HN&&k0(t||"warn","WARN",arguments),this},info(){return n>=pne&&k0(t||"log","INFO",arguments),this},debug(){return n>=mne&&k0(t||"log","DEBUG",arguments),this}}}var K=Array.isArray;function ze(e){return e===Object(e)}const L_=e=>e!=="__proto__";function VN(...e){return e.reduce((t,n)=>{for(const i in n)if(i==="signals")t.signals=bne(t.signals,n.signals);else{const r=i==="legend"?{layout:1}:i==="style"?!0:null;l$(t,i,n[i],r)}return t},{})}function l$(e,t,n,i){if(!L_(t))return;let r,s;if(ze(n)&&!K(n)){s=ze(e[t])?e[t]:e[t]={};for(r in n)i&&(i===!0||i[r])?l$(s,r,n[r]):L_(r)&&(s[r]=n[r])}else e[t]=n}function bne(e,t){if(e==null)return t;const n={},i=[];function r(s){n[s.name]||(n[s.name]=1,i.push(s))}return t.forEach(r),e.forEach(r),i}function Qe(e){return e!=null?K(e)?e:[e]:[]}function YN(e){return typeof e=="function"}function xne(e){for(let t,n,i=1,r=arguments.length;i<r;++i){t=arguments[i];for(n in t)e[n]=t[n]}return e}function vne(e,t){let n=0,i,r,s,o;if(e&&(i=e.length))if(t==null){for(r=e[n];n<i&&(r==null||r!==r);r=e[++n]);for(s=o=r;n<i;++n)r=e[n],r!=null&&(r<s&&(s=r),r>o&&(o=r))}else{for(r=t(e[n]);n<i&&(r==null||r!==r);r=t(e[++n]));for(s=o=r;n<i;++n)r=t(e[n]),r!=null&&(r<s&&(s=r),r>o&&(o=r))}return[s,o]}const Ane=Object.prototype.hasOwnProperty;function _a(e,t){return Ane.call(e,t)}function c$(e,t,n){const i=e.prototype=Object.create(t.prototype);return Object.defineProperty(i,"constructor",{value:e,writable:!0,enumerable:!0,configurable:!0}),xne(i,n)}function Nh(e){return typeof e=="boolean"}function at(e){return typeof e=="number"}function ue(e){return typeof e=="string"}function Ae(e){return K(e)?"["+e.map(Ae)+"]":ze(e)||ue(e)?JSON.stringify(e).replace("\u2028","\\u2028").replace("\u2029","\\u2029"):e}function Au(e){const t={},n=e.length;for(let i=0;i<n;++i)t[e[i]]=!0;return t}const $b=4278190080;function Ene(e,t){const n=e.bitmap();return(t||[]).forEach(i=>n.set(e(i.boundary[0]),e(i.boundary[3]))),[n,void 0]}function wne(e,t,n,i,r){const s=e.width,o=e.height,a=i||r,u=co(s,o).getContext("2d"),l=co(s,o).getContext("2d"),c=a&&co(s,o).getContext("2d");n.forEach($=>pg(u,$,!1)),pg(l,t,!1),a&&pg(c,t,!0);const f=Cb(u,s,o),d=Cb(l,s,o),h=a&&Cb(c,s,o),g=e.bitmap(),p=a&&e.bitmap();let m,y,b,x,v,A,w,E;for(y=0;y<o;++y)for(m=0;m<s;++m)v=y*s+m,A=f[v]&$b,E=d[v]&$b,w=a&&h[v]&$b,(A||w||E)&&(b=e(m),x=e(y),!r&&(A||E)&&g.set(b,x),a&&(A||w)&&p.set(b,x));return[g,p]}function Cb(e,t,n){return new Uint32Array(e.getImageData(0,0,t,n).data.buffer)}function pg(e,t,n){if(!t.length)return;const i=t[0].mark.marktype;i==="group"?t.forEach(r=>{r.items.forEach(s=>pg(e,s.items,n))}):ti[i].draw(e,{items:n?t.map($ne):t})}function $ne(e){const t=Rm(e,{});return t.stroke&&t.strokeOpacity!==0||t.fill&&t.fillOpacity!==0?{...t,strokeOpacity:1,stroke:"#000",fillOpacity:0}:t}const Qr=5,rn=31,Nd=32,Ys=new Uint32Array(Nd+1),_i=new Uint32Array(Nd+1);_i[0]=0;Ys[0]=~_i[0];for(let e=1;e<=Nd;++e)_i[e]=_i[e-1]<<1|1,Ys[e]=~_i[e];function Cne(e,t){const n=new Uint32Array(~~((e*t+Nd)/Nd));function i(s,o){n[s]|=o}function r(s,o){n[s]&=o}return{array:n,get:(s,o)=>{const a=o*e+s;return n[a>>>Qr]&1<<(a&rn)},set:(s,o)=>{const a=o*e+s;i(a>>>Qr,1<<(a&rn))},clear:(s,o)=>{const a=o*e+s;r(a>>>Qr,~(1<<(a&rn)))},getRange:(s,o,a,u)=>{let l=u,c,f,d,h;for(;l>=o;--l)if(c=l*e+s,f=l*e+a,d=c>>>Qr,h=f>>>Qr,d===h){if(n[d]&Ys[c&rn]&_i[(f&rn)+1])return!0}else{if(n[d]&Ys[c&rn]||n[h]&_i[(f&rn)+1])return!0;for(let g=d+1;g<h;++g)if(n[g])return!0}return!1},setRange:(s,o,a,u)=>{let l,c,f,d,h;for(;o<=u;++o)if(l=o*e+s,c=o*e+a,f=l>>>Qr,d=c>>>Qr,f===d)i(f,Ys[l&rn]&_i[(c&rn)+1]);else for(i(f,Ys[l&rn]),i(d,_i[(c&rn)+1]),h=f+1;h<d;++h)i(h,4294967295)},clearRange:(s,o,a,u)=>{let l,c,f,d,h;for(;o<=u;++o)if(l=o*e+s,c=o*e+a,f=l>>>Qr,d=c>>>Qr,f===d)r(f,_i[l&rn]|Ys[(c&rn)+1]);else for(r(f,_i[l&rn]),r(d,Ys[(c&rn)+1]),h=f+1;h<d;++h)r(h,0)},outOfBounds:(s,o,a,u)=>s<0||o<0||u>=t||a>=e}}function Fne(e,t,n){const i=Math.max(1,Math.sqrt(e*t/1e6)),r=~~((e+2*n+i)/i),s=~~((t+2*n+i)/i),o=a=>~~((a+n)/i);return o.invert=a=>a*i-n,o.bitmap=()=>Cne(r,s),o.ratio=i,o.padding=n,o.width=e,o.height=t,o}function Sne(e,t,n,i){const r=e.width,s=e.height;return function(o){const a=o.datum.datum.items[i].items,u=a.length,l=o.datum.fontSize,c=Ii.width(o.datum,o.datum.text);let f=0,d,h,g,p,m,y,b;for(let x=0;x<u;++x)d=a[x].x,g=a[x].y,h=a[x].x2===void 0?d:a[x].x2,p=a[x].y2===void 0?g:a[x].y2,m=(d+h)/2,y=(g+p)/2,b=Math.abs(h-d+p-g),b>=f&&(f=b,o.x=m,o.y=y);return m=c/2,y=l/2,d=o.x-m,h=o.x+m,g=o.y-y,p=o.y+y,o.align="center",d<0&&h<=r?o.align="left":0<=d&&r<h&&(o.align="right"),o.baseline="middle",g<0&&p<=s?o.baseline="top":0<=g&&s<p&&(o.baseline="bottom"),!0}}function Lp(e,t,n,i,r,s){let o=n/2;return e-o<0||e+o>r||t-(o=i/2)<0||t+o>s}function so(e,t,n,i,r,s,o,a){const u=r*s/(i*2),l=e(t-u),c=e(t+u),f=e(n-(s=s/2)),d=e(n+s);return o.outOfBounds(l,f,c,d)||o.getRange(l,f,c,d)||a&&a.getRange(l,f,c,d)}function Dne(e,t,n,i){const r=e.width,s=e.height,o=t[0],a=t[1];function u(l,c,f,d,h){const g=e.invert(l),p=e.invert(c);let m=f,y=s,b;if(!Lp(g,p,d,h,r,s)&&!so(e,g,p,h,d,m,o,a)&&!so(e,g,p,h,d,h,o,null)){for(;y-m>=1;)b=(m+y)/2,so(e,g,p,h,d,b,o,a)?y=b:m=b;if(m>f)return[g,p,m,!0]}}return function(l){const c=l.datum.datum.items[i].items,f=c.length,d=l.datum.fontSize,h=Ii.width(l.datum,l.datum.text);let g=n?d:0,p=!1,m=!1,y=0,b,x,v,A,w,E,$,k,F,D,T,C,_,S,M,O,B;for(let I=0;I<f;++I){for(b=c[I].x,v=c[I].y,x=c[I].x2===void 0?b:c[I].x2,A=c[I].y2===void 0?v:c[I].y2,b>x&&(B=b,b=x,x=B),v>A&&(B=v,v=A,A=B),F=e(b),T=e(x),D=~~((F+T)/2),C=e(v),S=e(A),_=~~((C+S)/2),$=D;$>=F;--$)for(k=_;k>=C;--k)O=u($,k,g,h,d),O&&([l.x,l.y,g,p]=O);for($=D;$<=T;++$)for(k=_;k<=S;++k)O=u($,k,g,h,d),O&&([l.x,l.y,g,p]=O);!p&&!n&&(M=Math.abs(x-b+A-v),w=(b+x)/2,E=(v+A)/2,M>=y&&!Lp(w,E,h,d,r,s)&&!so(e,w,E,d,h,d,o,null)&&(y=M,l.x=w,l.y=E,m=!0))}return p||m?(w=h/2,E=d/2,o.setRange(e(l.x-w),e(l.y-E),e(l.x+w),e(l.y+E)),l.align="center",l.baseline="middle",!0):!1}}const _ne=[-1,-1,1,1],kne=[-1,1,-1,1];function Mne(e,t,n,i){const r=e.width,s=e.height,o=t[0],a=t[1],u=e.bitmap();return function(l){const c=l.datum.datum.items[i].items,f=c.length,d=l.datum.fontSize,h=Ii.width(l.datum,l.datum.text),g=[];let p=n?d:0,m=!1,y=!1,b=0,x,v,A,w,E,$,k,F,D,T,C,_;for(let S=0;S<f;++S){for(x=c[S].x,A=c[S].y,v=c[S].x2===void 0?x:c[S].x2,w=c[S].y2===void 0?A:c[S].y2,g.push([e((x+v)/2),e((A+w)/2)]);g.length;)if([k,F]=g.pop(),!(o.get(k,F)||a.get(k,F)||u.get(k,F))){u.set(k,F);for(let M=0;M<4;++M)E=k+_ne[M],$=F+kne[M],u.outOfBounds(E,$,E,$)||g.push([E,$]);if(E=e.invert(k),$=e.invert(F),D=p,T=s,!Lp(E,$,h,d,r,s)&&!so(e,E,$,d,h,D,o,a)&&!so(e,E,$,d,h,d,o,null)){for(;T-D>=1;)C=(D+T)/2,so(e,E,$,d,h,C,o,a)?T=C:D=C;D>p&&(l.x=E,l.y=$,p=D,m=!0)}}!m&&!n&&(_=Math.abs(v-x+w-A),E=(x+v)/2,$=(A+w)/2,_>=b&&!Lp(E,$,h,d,r,s)&&!so(e,E,$,d,h,d,o,null)&&(b=_,l.x=E,l.y=$,y=!0))}return m||y?(E=h/2,$=d/2,o.setRange(e(l.x-E),e(l.y-$),e(l.x+E),e(l.y+$)),l.align="center",l.baseline="middle",!0):!1}}const One=["right","center","left"],Nne=["bottom","middle","top"];function Tne(e,t,n,i){const r=e.width,s=e.height,o=t[0],a=t[1],u=i.length;return function(l){const c=l.boundary,f=l.datum.fontSize;if(c[2]<0||c[5]<0||c[0]>r||c[3]>s)return!1;let d=l.textWidth??0,h,g,p,m,y,b,x,v,A,w,E,$,k,F,D;for(let T=0;T<u;++T){if(h=(n[T]&3)-1,g=(n[T]>>>2&3)-1,p=h===0&&g===0||i[T]<0,m=h&&g?Math.SQRT1_2:1,y=i[T]<0?-1:1,b=c[1+h]+i[T]*h*m,E=c[4+g]+y*f*g/2+i[T]*g*m,v=E-f/2,A=E+f/2,$=e(b),F=e(v),D=e(A),!d)if(P_($,$,F,D,o,a,b,b,v,A,c,p))d=Ii.width(l.datum,l.datum.text);else continue;if(w=b+y*d*h/2,b=w-d/2,x=w+d/2,$=e(b),k=e(x),P_($,k,F,D,o,a,b,x,v,A,c,p))return l.x=h?h*y<0?x:b:w,l.y=g?g*y<0?A:v:E,l.align=One[h*y+1],l.baseline=Nne[g*y+1],o.setRange($,F,k,D),!0}return!1}}function P_(e,t,n,i,r,s,o,a,u,l,c,f){return!(r.outOfBounds(e,n,t,i)||(f&&s||r).getRange(e,n,t,i))}const Fb=0,Sb=4,Db=8,_b=0,kb=1,Mb=2,Bne={"top-left":Fb+_b,top:Fb+kb,"top-right":Fb+Mb,left:Sb+_b,middle:Sb+kb,right:Sb+Mb,"bottom-left":Db+_b,bottom:Db+kb,"bottom-right":Db+Mb},Rne={naive:Sne,"reduced-search":Dne,floodfill:Mne};function Lne(e,t,n,i,r,s,o,a,u,l,c){if(!e.length)return e;const f=Math.max(i.length,r.length),d=Pne(i,f),h=Ine(r,f),g=zne(e[0].datum),p=g==="group"&&e[0].datum.items[u].marktype,m=p==="area",y=jne(g,p,a,u),b=l===null||l===1/0,x=m&&c==="naive";let v=-1,A=-1;const w=e.map(F=>{const D=b?Ii.width(F,F.text):void 0;return v=Math.max(v,D),A=Math.max(A,F.fontSize),{datum:F,opacity:0,x:void 0,y:void 0,align:void 0,baseline:void 0,boundary:y(F),textWidth:D}});l=l===null||l===1/0?Math.max(v,A)+Math.max(...i):l;const E=Fne(t[0],t[1],l);let $;if(!x){n&&w.sort((T,C)=>n(T.datum,C.datum));let F=!1;for(let T=0;T<h.length&&!F;++T)F=h[T]===5||d[T]<0;const D=(g&&o||m)&&e.map(T=>T.datum);$=s.length||D?wne(E,D||[],s,F,m):Ene(E,o&&w)}const k=m?Rne[c](E,$,o,u):Tne(E,$,h,d);return w.forEach(F=>F.opacity=+k(F)),w}function Pne(e,t){const n=new Float64Array(t),i=e.length;for(let r=0;r<i;++r)n[r]=e[r]||0;for(let r=i;r<t;++r)n[r]=n[i-1];return n}function Ine(e,t){const n=new Int8Array(t),i=e.length;for(let r=0;r<i;++r)n[r]|=Bne[e[r]];for(let r=i;r<t;++r)n[r]=n[i-1];return n}function zne(e){return e&&e.mark&&e.mark.marktype}function jne(e,t,n,i){const r=s=>[s.x,s.x,s.x,s.y,s.y,s.y];return e?e==="line"||e==="area"?s=>r(s.datum):t==="line"?s=>{const o=s.datum.items[i].items;return r(o.length?o[n==="start"?0:o.length-1]:{x:NaN,y:NaN})}:s=>{const o=s.datum.bounds;return[o.x1,(o.x1+o.x2)/2,o.x2,o.y1,(o.y1+o.y2)/2,o.y2]}:r}const Yx=["x","y","opacity","align","baseline"],XN=["top-left","left","bottom-left","top","bottom","top-right","right","bottom-right"];function f$(e){N.call(this,null,e)}f$.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:XN},{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:Yx.length,default:Yx}]};c$(f$,N,{transform(e,t){function n(s){const o=e[s];return YN(o)&&t.modified(o.fields)}const i=e.modified();if(!(i||t.changed(t.ADD_REM)||n("sort")))return;(!e.size||e.size.length!==2)&&Qf("Size parameter should be specified as a [width, height] array.");const r=e.as||Yx;return Lne(t.materialize(t.SOURCE).source||[],e.size,e.sort,Qe(e.offset==null?1:e.offset),Qe(e.anchor||XN),e.avoidMarks||[],e.avoidBaseMark!==!1,e.lineAnchor||"end",e.markIndex||0,e.padding===void 0?0:e.padding,e.method||"naive").forEach(s=>{const o=s.datum;o[r[0]]=s.x,o[r[1]]=s.y,o[r[2]]=s.opacity,o[r[3]]=s.align,o[r[4]]=s.baseline}),t.reflow(i).modifies(r)}});const Une=Object.freeze(Object.defineProperty({__proto__:null,label:f$},Symbol.toStringTag,{value:"Module"}));function KN(e,t){var n=[],i=function(c){return c(a)},r,s,o,a,u,l;if(t==null)n.push(e);else for(r={},s=0,o=e.length;s<o;++s)a=e[s],u=t.map(i),l=r[u],l||(r[u]=l=[],l.dims=u,n.push(l)),l.push(a);return n}function d$(e){N.call(this,null,e)}d$.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}]};c$(d$,N,{transform(e,t){const n=t.fork(t.NO_SOURCE|t.NO_FIELDS);if(!this.value||t.changed()||e.modified()){const i=t.materialize(t.SOURCE).source,r=KN(i,e.groupby),s=(e.groupby||[]).map(al),o=s.length,a=e.as||[al(e.x),al(e.y)],u=[];r.forEach(l=>{YM(l,e.x,e.y,e.bandwidth||.3).forEach(c=>{const f={};for(let d=0;d<o;++d)f[s[d]]=l.dims[d];f[a[0]]=c[0],f[a[1]]=c[1],u.push(De(f))})}),this.value&&(n.rem=this.value),this.value=n.add=n.source=u}return n}});const Xx={constant:PA,linear:IA,log:WM,exp:GM,pow:HM,quad:zA,poly:VM},qne=(e,t)=>e==="poly"?t:e==="quad"?2:1;function h$(e){N.call(this,null,e)}h$.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(Xx)},{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}]};c$(h$,N,{transform(e,t){const n=t.fork(t.NO_SOURCE|t.NO_FIELDS);if(!this.value||t.changed()||e.modified()){const i=t.materialize(t.SOURCE).source,r=KN(i,e.groupby),s=(e.groupby||[]).map(al),o=e.method||"linear",a=e.order==null?3:e.order,u=qne(o,a),l=e.as||[al(e.x),al(e.y)],c=Xx[o],f=[];let d=e.extent;_a(Xx,o)||Qf("Invalid regression method: "+o),d!=null&&o==="log"&&d[0]<=0&&(t.dataflow.warn("Ignoring extent with values <= 0 for log regression."),d=null),r.forEach(h=>{if(h.length<=u){t.dataflow.warn("Skipping regression with more parameters than data points.");return}const p=c(h,e.x,e.y,a);if(e.params){f.push(De({keys:h.dims,coef:p.coef,rSquared:p.rSquared}));return}const m=d||vne(h,e.x),y=b=>{const x={};for(let v=0;v<s.length;++v)x[s[v]]=h.dims[v];x[l[0]]=b[0],x[l[1]]=b[1],f.push(De(x))};o==="linear"||o==="constant"?m.forEach(b=>y([b,p.predict(b)])):qm(p.predict,m,25,200).forEach(y)}),this.value&&(n.rem=this.value),this.value=n.add=n.source=f}return n}});const Wne=Object.freeze(Object.defineProperty({__proto__:null,loess:d$,regression:h$},Symbol.toStringTag,{value:"Module"}));function vc(e,t,n){return e.fields=t||[],e.fname=n,e}function Gne(e){return e.length===1?Hne(e[0]):Vne(e)}const Hne=e=>function(t){return t[e]},Vne=e=>{const t=e.length;return function(n){for(let i=0;i<t;++i)n=n[e[i]];return n}};function Ob(e){throw Error(e)}function Yne(e){const t=[],n=e.length;let i=null,r=0,s="",o,a,u;e=e+"";function l(){t.push(s+e.substring(o,a)),s="",o=a+1}for(o=a=0;a<n;++a)if(u=e[a],u==="\\")s+=e.substring(o,a++),o=a;else if(u===i)l(),i=null,r=-1;else{if(i)continue;o===r&&u==='"'||o===r&&u==="'"?(o=a+1,i=u):u==="."&&!r?a>o?l():o=a+1:u==="["?(a>o&&l(),r=o=a+1):u==="]"&&(r||Ob("Access path missing open bracket: "+e),r>0&&l(),r=0,o=a+1)}return r&&Ob("Access path missing closing bracket: "+e),i&&Ob("Access path missing closing quote: "+e),a>o&&(a++,l()),t}function Xne(e,t,n){const i=Yne(e);return e=i.length===1?i[0]:e,vc((n&&n.get||Gne)(i),[e],t||e)}Xne("id");vc(e=>e,[],"identity");vc(()=>0,[],"zero");vc(()=>1,[],"one");vc(()=>!0,[],"true");vc(()=>!1,[],"false");function Kne(e){for(let t,n,i=1,r=arguments.length;i<r;++i){t=arguments[i];for(n in t)e[n]=t[n]}return e}function Jne(e,t,n){const i=e.prototype=Object.create(t.prototype);return Object.defineProperty(i,"constructor",{value:e,writable:!0,enumerable:!0,configurable:!0}),Kne(i,n)}const xs=11102230246251565e-32,It=134217729,Qne=(3+8*xs)*xs;function Nb(e,t,n,i,r){let s,o,a,u,l=t[0],c=i[0],f=0,d=0;c>l==c>-l?(s=l,l=t[++f]):(s=c,c=i[++d]);let h=0;if(f<e&&d<n)for(c>l==c>-l?(o=l+s,a=s-(o-l),l=t[++f]):(o=c+s,a=s-(o-c),c=i[++d]),s=o,a!==0&&(r[h++]=a);f<e&&d<n;)c>l==c>-l?(o=s+l,u=o-s,a=s-(o-u)+(l-u),l=t[++f]):(o=s+c,u=o-s,a=s-(o-u)+(c-u),c=i[++d]),s=o,a!==0&&(r[h++]=a);for(;f<e;)o=s+l,u=o-s,a=s-(o-u)+(l-u),l=t[++f],s=o,a!==0&&(r[h++]=a);for(;d<n;)o=s+c,u=o-s,a=s-(o-u)+(c-u),c=i[++d],s=o,a!==0&&(r[h++]=a);return(s!==0||h===0)&&(r[h++]=s),h}function Zne(e,t){let n=t[0];for(let i=1;i<e;i++)n+=t[i];return n}function Th(e){return new Float64Array(e)}const eie=(3+16*xs)*xs,tie=(2+12*xs)*xs,nie=(9+64*xs)*xs*xs,zu=Th(4),I_=Th(8),z_=Th(12),j_=Th(16),sn=Th(4);function iie(e,t,n,i,r,s,o){let a,u,l,c,f,d,h,g,p,m,y,b,x,v,A,w,E,$;const k=e-r,F=n-r,D=t-s,T=i-s;v=k*T,d=It*k,h=d-(d-k),g=k-h,d=It*T,p=d-(d-T),m=T-p,A=g*m-(v-h*p-g*p-h*m),w=D*F,d=It*D,h=d-(d-D),g=D-h,d=It*F,p=d-(d-F),m=F-p,E=g*m-(w-h*p-g*p-h*m),y=A-E,f=A-y,zu[0]=A-(y+f)+(f-E),b=v+y,f=b-v,x=v-(b-f)+(y-f),y=x-w,f=x-y,zu[1]=x-(y+f)+(f-w),$=b+y,f=$-b,zu[2]=b-($-f)+(y-f),zu[3]=$;let C=Zne(4,zu),_=tie*o;if(C>=_||-C>=_||(f=e-k,a=e-(k+f)+(f-r),f=n-F,l=n-(F+f)+(f-r),f=t-D,u=t-(D+f)+(f-s),f=i-T,c=i-(T+f)+(f-s),a===0&&u===0&&l===0&&c===0)||(_=nie*o+Qne*Math.abs(C),C+=k*c+T*a-(D*l+F*u),C>=_||-C>=_))return C;v=a*T,d=It*a,h=d-(d-a),g=a-h,d=It*T,p=d-(d-T),m=T-p,A=g*m-(v-h*p-g*p-h*m),w=u*F,d=It*u,h=d-(d-u),g=u-h,d=It*F,p=d-(d-F),m=F-p,E=g*m-(w-h*p-g*p-h*m),y=A-E,f=A-y,sn[0]=A-(y+f)+(f-E),b=v+y,f=b-v,x=v-(b-f)+(y-f),y=x-w,f=x-y,sn[1]=x-(y+f)+(f-w),$=b+y,f=$-b,sn[2]=b-($-f)+(y-f),sn[3]=$;const S=Nb(4,zu,4,sn,I_);v=k*c,d=It*k,h=d-(d-k),g=k-h,d=It*c,p=d-(d-c),m=c-p,A=g*m-(v-h*p-g*p-h*m),w=D*l,d=It*D,h=d-(d-D),g=D-h,d=It*l,p=d-(d-l),m=l-p,E=g*m-(w-h*p-g*p-h*m),y=A-E,f=A-y,sn[0]=A-(y+f)+(f-E),b=v+y,f=b-v,x=v-(b-f)+(y-f),y=x-w,f=x-y,sn[1]=x-(y+f)+(f-w),$=b+y,f=$-b,sn[2]=b-($-f)+(y-f),sn[3]=$;const M=Nb(S,I_,4,sn,z_);v=a*c,d=It*a,h=d-(d-a),g=a-h,d=It*c,p=d-(d-c),m=c-p,A=g*m-(v-h*p-g*p-h*m),w=u*l,d=It*u,h=d-(d-u),g=u-h,d=It*l,p=d-(d-l),m=l-p,E=g*m-(w-h*p-g*p-h*m),y=A-E,f=A-y,sn[0]=A-(y+f)+(f-E),b=v+y,f=b-v,x=v-(b-f)+(y-f),y=x-w,f=x-y,sn[1]=x-(y+f)+(f-w),$=b+y,f=$-b,sn[2]=b-($-f)+(y-f),sn[3]=$;const O=Nb(M,z_,4,sn,j_);return j_[O-1]}function M0(e,t,n,i,r,s){const o=(t-s)*(n-r),a=(e-r)*(i-s),u=o-a;if(o===0||a===0||o>0!=a>0)return u;const l=Math.abs(o+a);return Math.abs(u)>=eie*l?u:-iie(e,t,n,i,r,s,l)}const U_=Math.pow(2,-52),O0=new Uint32Array(512);class Pp{static from(t,n=uie,i=lie){const r=t.length,s=new Float64Array(r*2);for(let o=0;o<r;o++){const a=t[o];s[2*o]=n(a),s[2*o+1]=i(a)}return new Pp(s)}constructor(t){const n=t.length>>1;if(n>0&&typeof t[0]!="number")throw new Error("Expected coords to contain numbers.");this.coords=t;const i=Math.max(2*n-5,0);this._triangles=new Uint32Array(i*3),this._halfedges=new Int32Array(i*3),this._hashSize=Math.ceil(Math.sqrt(n)),this._hullPrev=new Uint32Array(n),this._hullNext=new Uint32Array(n),this._hullTri=new Uint32Array(n),this._hullHash=new Int32Array(this._hashSize).fill(-1),this._ids=new Uint32Array(n),this._dists=new Float64Array(n),this.update()}update(){const{coords:t,_hullPrev:n,_hullNext:i,_hullTri:r,_hullHash:s}=this,o=t.length>>1;let a=1/0,u=1/0,l=-1/0,c=-1/0;for(let F=0;F<o;F++){const D=t[2*F],T=t[2*F+1];D<a&&(a=D),T<u&&(u=T),D>l&&(l=D),T>c&&(c=T),this._ids[F]=F}const f=(a+l)/2,d=(u+c)/2;let h=1/0,g,p,m;for(let F=0;F<o;F++){const D=Tb(f,d,t[2*F],t[2*F+1]);D<h&&(g=F,h=D)}const y=t[2*g],b=t[2*g+1];h=1/0;for(let F=0;F<o;F++){if(F===g)continue;const D=Tb(y,b,t[2*F],t[2*F+1]);D<h&&D>0&&(p=F,h=D)}let x=t[2*p],v=t[2*p+1],A=1/0;for(let F=0;F<o;F++){if(F===g||F===p)continue;const D=oie(y,b,x,v,t[2*F],t[2*F+1]);D<A&&(m=F,A=D)}let w=t[2*m],E=t[2*m+1];if(A===1/0){for(let T=0;T<o;T++)this._dists[T]=t[2*T]-t[0]||t[2*T+1]-t[1];Zu(this._ids,this._dists,0,o-1);const F=new Uint32Array(o);let D=0;for(let T=0,C=-1/0;T<o;T++){const _=this._ids[T];this._dists[_]>C&&(F[D++]=_,C=this._dists[_])}this.hull=F.subarray(0,D),this.triangles=new Uint32Array(0),this.halfedges=new Uint32Array(0);return}if(M0(y,b,x,v,w,E)<0){const F=p,D=x,T=v;p=m,x=w,v=E,m=F,w=D,E=T}const $=aie(y,b,x,v,w,E);this._cx=$.x,this._cy=$.y;for(let F=0;F<o;F++)this._dists[F]=Tb(t[2*F],t[2*F+1],$.x,$.y);Zu(this._ids,this._dists,0,o-1),this._hullStart=g;let k=3;i[g]=n[m]=p,i[p]=n[g]=m,i[m]=n[p]=g,r[g]=0,r[p]=1,r[m]=2,s.fill(-1),s[this._hashKey(y,b)]=g,s[this._hashKey(x,v)]=p,s[this._hashKey(w,E)]=m,this.trianglesLen=0,this._addTriangle(g,p,m,-1,-1,-1);for(let F=0,D,T;F<this._ids.length;F++){const C=this._ids[F],_=t[2*C],S=t[2*C+1];if(F>0&&Math.abs(_-D)<=U_&&Math.abs(S-T)<=U_||(D=_,T=S,C===g||C===p||C===m))continue;let M=0;for(let J=0,oe=this._hashKey(_,S);J<this._hashSize&&(M=s[(oe+J)%this._hashSize],!(M!==-1&&M!==i[M]));J++);M=n[M];let O=M,B;for(;B=i[O],M0(_,S,t[2*O],t[2*O+1],t[2*B],t[2*B+1])>=0;)if(O=B,O===M){O=-1;break}if(O===-1)continue;let I=this._addTriangle(O,C,i[O],-1,-1,r[O]);r[C]=this._legalize(I+2),r[O]=I,k++;let G=i[O];for(;B=i[G],M0(_,S,t[2*G],t[2*G+1],t[2*B],t[2*B+1])<0;)I=this._addTriangle(G,C,B,r[C],-1,r[G]),r[C]=this._legalize(I+2),i[G]=G,k--,G=B;if(O===M)for(;B=n[O],M0(_,S,t[2*B],t[2*B+1],t[2*O],t[2*O+1])<0;)I=this._addTriangle(B,C,O,-1,r[O],r[B]),this._legalize(I+2),r[B]=I,i[O]=O,k--,O=B;this._hullStart=n[C]=O,i[O]=n[G]=C,i[C]=G,s[this._hashKey(_,S)]=C,s[this._hashKey(t[2*O],t[2*O+1])]=O}this.hull=new Uint32Array(k);for(let F=0,D=this._hullStart;F<k;F++)this.hull[F]=D,D=i[D];this.triangles=this._triangles.subarray(0,this.trianglesLen),this.halfedges=this._halfedges.subarray(0,this.trianglesLen)}_hashKey(t,n){return Math.floor(rie(t-this._cx,n-this._cy)*this._hashSize)%this._hashSize}_legalize(t){const{_triangles:n,_halfedges:i,coords:r}=this;let s=0,o=0;for(;;){const a=i[t],u=t-t%3;if(o=u+(t+2)%3,a===-1){if(s===0)break;t=O0[--s];continue}const l=a-a%3,c=u+(t+1)%3,f=l+(a+2)%3,d=n[o],h=n[t],g=n[c],p=n[f];if(sie(r[2*d],r[2*d+1],r[2*h],r[2*h+1],r[2*g],r[2*g+1],r[2*p],r[2*p+1])){n[t]=p,n[a]=d;const y=i[f];if(y===-1){let x=this._hullStart;do{if(this._hullTri[x]===f){this._hullTri[x]=t;break}x=this._hullPrev[x]}while(x!==this._hullStart)}this._link(t,y),this._link(a,i[o]),this._link(o,f);const b=l+(a+1)%3;s<O0.length&&(O0[s++]=b)}else{if(s===0)break;t=O0[--s]}}return o}_link(t,n){this._halfedges[t]=n,n!==-1&&(this._halfedges[n]=t)}_addTriangle(t,n,i,r,s,o){const a=this.trianglesLen;return this._triangles[a]=t,this._triangles[a+1]=n,this._triangles[a+2]=i,this._link(a,r),this._link(a+1,s),this._link(a+2,o),this.trianglesLen+=3,a}}function rie(e,t){const n=e/(Math.abs(e)+Math.abs(t));return(t>0?3-n:1+n)/4}function Tb(e,t,n,i){const r=e-n,s=t-i;return r*r+s*s}function sie(e,t,n,i,r,s,o,a){const u=e-o,l=t-a,c=n-o,f=i-a,d=r-o,h=s-a,g=u*u+l*l,p=c*c+f*f,m=d*d+h*h;return u*(f*m-p*h)-l*(c*m-p*d)+g*(c*h-f*d)<0}function oie(e,t,n,i,r,s){const o=n-e,a=i-t,u=r-e,l=s-t,c=o*o+a*a,f=u*u+l*l,d=.5/(o*l-a*u),h=(l*c-a*f)*d,g=(o*f-u*c)*d;return h*h+g*g}function aie(e,t,n,i,r,s){const o=n-e,a=i-t,u=r-e,l=s-t,c=o*o+a*a,f=u*u+l*l,d=.5/(o*l-a*u),h=e+(l*c-a*f)*d,g=t+(o*f-u*c)*d;return{x:h,y:g}}function Zu(e,t,n,i){if(i-n<=20)for(let r=n+1;r<=i;r++){const s=e[r],o=t[s];let a=r-1;for(;a>=n&&t[e[a]]>o;)e[a+1]=e[a--];e[a+1]=s}else{const r=n+i>>1;let s=n+1,o=i;nf(e,r,s),t[e[n]]>t[e[i]]&&nf(e,n,i),t[e[s]]>t[e[i]]&&nf(e,s,i),t[e[n]]>t[e[s]]&&nf(e,n,s);const a=e[s],u=t[a];for(;;){do s++;while(t[e[s]]<u);do o--;while(t[e[o]]>u);if(o<s)break;nf(e,s,o)}e[n+1]=e[o],e[o]=a,i-s+1>=o-n?(Zu(e,t,s,i),Zu(e,t,n,o-1)):(Zu(e,t,n,o-1),Zu(e,t,s,i))}}function nf(e,t,n){const i=e[t];e[t]=e[n],e[n]=i}function uie(e){return e[0]}function lie(e){return e[1]}const q_=1e-6;class ka{constructor(){this._x0=this._y0=this._x1=this._y1=null,this._=""}moveTo(t,n){this._+=`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")}lineTo(t,n){this._+=`L${this._x1=+t},${this._y1=+n}`}arc(t,n,i){t=+t,n=+n,i=+i;const r=t+i,s=n;if(i<0)throw new Error("negative radius");this._x1===null?this._+=`M${r},${s}`:(Math.abs(this._x1-r)>q_||Math.abs(this._y1-s)>q_)&&(this._+="L"+r+","+s),i&&(this._+=`A${i},${i},0,1,1,${t-i},${n}A${i},${i},0,1,1,${this._x1=r},${this._y1=s}`)}rect(t,n,i,r){this._+=`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${+i}v${+r}h${-i}Z`}value(){return this._||null}}class Kx{constructor(){this._=[]}moveTo(t,n){this._.push([t,n])}closePath(){this._.push(this._[0].slice())}lineTo(t,n){this._.push([t,n])}value(){return this._.length?this._:null}}let cie=class{constructor(t,[n,i,r,s]=[0,0,960,500]){if(!((r=+r)>=(n=+n))||!((s=+s)>=(i=+i)))throw new Error("invalid bounds");this.delaunay=t,this._circumcenters=new Float64Array(t.points.length*2),this.vectors=new Float64Array(t.points.length*2),this.xmax=r,this.xmin=n,this.ymax=s,this.ymin=i,this._init()}update(){return this.delaunay.update(),this._init(),this}_init(){const{delaunay:{points:t,hull:n,triangles:i},vectors:r}=this;let s,o;const a=this.circumcenters=this._circumcenters.subarray(0,i.length/3*2);for(let p=0,m=0,y=i.length,b,x;p<y;p+=3,m+=2){const v=i[p]*2,A=i[p+1]*2,w=i[p+2]*2,E=t[v],$=t[v+1],k=t[A],F=t[A+1],D=t[w],T=t[w+1],C=k-E,_=F-$,S=D-E,M=T-$,O=(C*M-_*S)*2;if(Math.abs(O)<1e-9){if(s===void 0){s=o=0;for(const I of n)s+=t[I*2],o+=t[I*2+1];s/=n.length,o/=n.length}const B=1e9*Math.sign((s-E)*M-(o-$)*S);b=(E+D)/2-B*M,x=($+T)/2+B*S}else{const B=1/O,I=C*C+_*_,G=S*S+M*M;b=E+(M*I-_*G)*B,x=$+(C*G-S*I)*B}a[m]=b,a[m+1]=x}let u=n[n.length-1],l,c=u*4,f,d=t[2*u],h,g=t[2*u+1];r.fill(0);for(let p=0;p<n.length;++p)u=n[p],l=c,f=d,h=g,c=u*4,d=t[2*u],g=t[2*u+1],r[l+2]=r[c]=h-g,r[l+3]=r[c+1]=d-f}render(t){const n=t==null?t=new ka:void 0,{delaunay:{halfedges:i,inedges:r,hull:s},circumcenters:o,vectors:a}=this;if(s.length<=1)return null;for(let c=0,f=i.length;c<f;++c){const d=i[c];if(d<c)continue;const h=Math.floor(c/3)*2,g=Math.floor(d/3)*2,p=o[h],m=o[h+1],y=o[g],b=o[g+1];this._renderSegment(p,m,y,b,t)}let u,l=s[s.length-1];for(let c=0;c<s.length;++c){u=l,l=s[c];const f=Math.floor(r[l]/3)*2,d=o[f],h=o[f+1],g=u*4,p=this._project(d,h,a[g+2],a[g+3]);p&&this._renderSegment(d,h,p[0],p[1],t)}return n&&n.value()}renderBounds(t){const n=t==null?t=new ka:void 0;return t.rect(this.xmin,this.ymin,this.xmax-this.xmin,this.ymax-this.ymin),n&&n.value()}renderCell(t,n){const i=n==null?n=new ka:void 0,r=this._clip(t);if(r===null||!r.length)return;n.moveTo(r[0],r[1]);let s=r.length;for(;r[0]===r[s-2]&&r[1]===r[s-1]&&s>1;)s-=2;for(let o=2;o<s;o+=2)(r[o]!==r[o-2]||r[o+1]!==r[o-1])&&n.lineTo(r[o],r[o+1]);return n.closePath(),i&&i.value()}*cellPolygons(){const{delaunay:{points:t}}=this;for(let n=0,i=t.length/2;n<i;++n){const r=this.cellPolygon(n);r&&(r.index=n,yield r)}}cellPolygon(t){const n=new Kx;return this.renderCell(t,n),n.value()}_renderSegment(t,n,i,r,s){let o;const a=this._regioncode(t,n),u=this._regioncode(i,r);a===0&&u===0?(s.moveTo(t,n),s.lineTo(i,r)):(o=this._clipSegment(t,n,i,r,a,u))&&(s.moveTo(o[0],o[1]),s.lineTo(o[2],o[3]))}contains(t,n,i){return n=+n,n!==n||(i=+i,i!==i)?!1:this.delaunay._step(t,n,i)===t}*neighbors(t){const n=this._clip(t);if(n)for(const i of this.delaunay.neighbors(t)){const r=this._clip(i);if(r){e:for(let s=0,o=n.length;s<o;s+=2)for(let a=0,u=r.length;a<u;a+=2)if(n[s]===r[a]&&n[s+1]===r[a+1]&&n[(s+2)%o]===r[(a+u-2)%u]&&n[(s+3)%o]===r[(a+u-1)%u]){yield i;break e}}}}_cell(t){const{circumcenters:n,delaunay:{inedges:i,halfedges:r,triangles:s}}=this,o=i[t];if(o===-1)return null;const a=[];let u=o;do{const l=Math.floor(u/3);if(a.push(n[l*2],n[l*2+1]),u=u%3===2?u-2:u+1,s[u]!==t)break;u=r[u]}while(u!==o&&u!==-1);return a}_clip(t){if(t===0&&this.delaunay.hull.length===1)return[this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax,this.xmin,this.ymin];const n=this._cell(t);if(n===null)return null;const{vectors:i}=this,r=t*4;return this._simplify(i[r]||i[r+1]?this._clipInfinite(t,n,i[r],i[r+1],i[r+2],i[r+3]):this._clipFinite(t,n))}_clipFinite(t,n){const i=n.length;let r=null,s,o,a=n[i-2],u=n[i-1],l,c=this._regioncode(a,u),f,d=0;for(let h=0;h<i;h+=2)if(s=a,o=u,a=n[h],u=n[h+1],l=c,c=this._regioncode(a,u),l===0&&c===0)f=d,d=0,r?r.push(a,u):r=[a,u];else{let g,p,m,y,b;if(l===0){if((g=this._clipSegment(s,o,a,u,l,c))===null)continue;[p,m,y,b]=g}else{if((g=this._clipSegment(a,u,s,o,c,l))===null)continue;[y,b,p,m]=g,f=d,d=this._edgecode(p,m),f&&d&&this._edge(t,f,d,r,r.length),r?r.push(p,m):r=[p,m]}f=d,d=this._edgecode(y,b),f&&d&&this._edge(t,f,d,r,r.length),r?r.push(y,b):r=[y,b]}if(r)f=d,d=this._edgecode(r[0],r[1]),f&&d&&this._edge(t,f,d,r,r.length);else if(this.contains(t,(this.xmin+this.xmax)/2,(this.ymin+this.ymax)/2))return[this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax,this.xmin,this.ymin];return r}_clipSegment(t,n,i,r,s,o){const a=s<o;for(a&&([t,n,i,r,s,o]=[i,r,t,n,o,s]);;){if(s===0&&o===0)return a?[i,r,t,n]:[t,n,i,r];if(s&o)return null;let u,l,c=s||o;c&8?(u=t+(i-t)*(this.ymax-n)/(r-n),l=this.ymax):c&4?(u=t+(i-t)*(this.ymin-n)/(r-n),l=this.ymin):c&2?(l=n+(r-n)*(this.xmax-t)/(i-t),u=this.xmax):(l=n+(r-n)*(this.xmin-t)/(i-t),u=this.xmin),s?(t=u,n=l,s=this._regioncode(t,n)):(i=u,r=l,o=this._regioncode(i,r))}}_clipInfinite(t,n,i,r,s,o){let a=Array.from(n),u;if((u=this._project(a[0],a[1],i,r))&&a.unshift(u[0],u[1]),(u=this._project(a[a.length-2],a[a.length-1],s,o))&&a.push(u[0],u[1]),a=this._clipFinite(t,a))for(let l=0,c=a.length,f,d=this._edgecode(a[c-2],a[c-1]);l<c;l+=2)f=d,d=this._edgecode(a[l],a[l+1]),f&&d&&(l=this._edge(t,f,d,a,l),c=a.length);else this.contains(t,(this.xmin+this.xmax)/2,(this.ymin+this.ymax)/2)&&(a=[this.xmin,this.ymin,this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax]);return a}_edge(t,n,i,r,s){for(;n!==i;){let o,a;switch(n){case 5:n=4;continue;case 4:n=6,o=this.xmax,a=this.ymin;break;case 6:n=2;continue;case 2:n=10,o=this.xmax,a=this.ymax;break;case 10:n=8;continue;case 8:n=9,o=this.xmin,a=this.ymax;break;case 9:n=1;continue;case 1:n=5,o=this.xmin,a=this.ymin;break}(r[s]!==o||r[s+1]!==a)&&this.contains(t,o,a)&&(r.splice(s,0,o,a),s+=2)}return s}_project(t,n,i,r){let s=1/0,o,a,u;if(r<0){if(n<=this.ymin)return null;(o=(this.ymin-n)/r)<s&&(u=this.ymin,a=t+(s=o)*i)}else if(r>0){if(n>=this.ymax)return null;(o=(this.ymax-n)/r)<s&&(u=this.ymax,a=t+(s=o)*i)}if(i>0){if(t>=this.xmax)return null;(o=(this.xmax-t)/i)<s&&(a=this.xmax,u=n+(s=o)*r)}else if(i<0){if(t<=this.xmin)return null;(o=(this.xmin-t)/i)<s&&(a=this.xmin,u=n+(s=o)*r)}return[a,u]}_edgecode(t,n){return(t===this.xmin?1:t===this.xmax?2:0)|(n===this.ymin?4:n===this.ymax?8:0)}_regioncode(t,n){return(t<this.xmin?1:t>this.xmax?2:0)|(n<this.ymin?4:n>this.ymax?8:0)}_simplify(t){if(t&&t.length>4){for(let n=0;n<t.length;n+=2){const i=(n+2)%t.length,r=(n+4)%t.length;(t[n]===t[i]&&t[i]===t[r]||t[n+1]===t[i+1]&&t[i+1]===t[r+1])&&(t.splice(i,2),n-=2)}t.length||(t=null)}return t}};const fie=2*Math.PI,ju=Math.pow;function die(e){return e[0]}function hie(e){return e[1]}function gie(e){const{triangles:t,coords:n}=e;for(let i=0;i<t.length;i+=3){const r=2*t[i],s=2*t[i+1],o=2*t[i+2];if((n[o]-n[r])*(n[s+1]-n[r+1])-(n[s]-n[r])*(n[o+1]-n[r+1])>1e-10)return!1}return!0}function pie(e,t,n){return[e+Math.sin(e+t)*n,t+Math.cos(e-t)*n]}class g${static from(t,n=die,i=hie,r){return new g$("length"in t?mie(t,n,i,r):Float64Array.from(yie(t,n,i,r)))}constructor(t){this._delaunator=new Pp(t),this.inedges=new Int32Array(t.length/2),this._hullIndex=new Int32Array(t.length/2),this.points=this._delaunator.coords,this._init()}update(){return this._delaunator.update(),this._init(),this}_init(){const t=this._delaunator,n=this.points;if(t.hull&&t.hull.length>2&&gie(t)){this.collinear=Int32Array.from({length:n.length/2},(d,h)=>h).sort((d,h)=>n[2*d]-n[2*h]||n[2*d+1]-n[2*h+1]);const u=this.collinear[0],l=this.collinear[this.collinear.length-1],c=[n[2*u],n[2*u+1],n[2*l],n[2*l+1]],f=1e-8*Math.hypot(c[3]-c[1],c[2]-c[0]);for(let d=0,h=n.length/2;d<h;++d){const g=pie(n[2*d],n[2*d+1],f);n[2*d]=g[0],n[2*d+1]=g[1]}this._delaunator=new Pp(n)}else delete this.collinear;const i=this.halfedges=this._delaunator.halfedges,r=this.hull=this._delaunator.hull,s=this.triangles=this._delaunator.triangles,o=this.inedges.fill(-1),a=this._hullIndex.fill(-1);for(let u=0,l=i.length;u<l;++u){const c=s[u%3===2?u-2:u+1];(i[u]===-1||o[c]===-1)&&(o[c]=u)}for(let u=0,l=r.length;u<l;++u)a[r[u]]=u;r.length<=2&&r.length>0&&(this.triangles=new Int32Array(3).fill(-1),this.halfedges=new Int32Array(3).fill(-1),this.triangles[0]=r[0],o[r[0]]=1,r.length===2&&(o[r[1]]=0,this.triangles[1]=r[1],this.triangles[2]=r[1]))}voronoi(t){return new cie(this,t)}*neighbors(t){const{inedges:n,hull:i,_hullIndex:r,halfedges:s,triangles:o,collinear:a}=this;if(a){const f=a.indexOf(t);f>0&&(yield a[f-1]),f<a.length-1&&(yield a[f+1]);return}const u=n[t];if(u===-1)return;let l=u,c=-1;do{if(yield c=o[l],l=l%3===2?l-2:l+1,o[l]!==t)return;if(l=s[l],l===-1){const f=i[(r[t]+1)%i.length];f!==c&&(yield f);return}}while(l!==u)}find(t,n,i=0){if(t=+t,t!==t||(n=+n,n!==n))return-1;const r=i;let s;for(;(s=this._step(i,t,n))>=0&&s!==i&&s!==r;)i=s;return s}_step(t,n,i){const{inedges:r,hull:s,_hullIndex:o,halfedges:a,triangles:u,points:l}=this;if(r[t]===-1||!l.length)return(t+1)%(l.length>>1);let c=t,f=ju(n-l[t*2],2)+ju(i-l[t*2+1],2);const d=r[t];let h=d;do{let g=u[h];const p=ju(n-l[g*2],2)+ju(i-l[g*2+1],2);if(p<f&&(f=p,c=g),h=h%3===2?h-2:h+1,u[h]!==t)break;if(h=a[h],h===-1){if(h=s[(o[t]+1)%s.length],h!==g&&ju(n-l[h*2],2)+ju(i-l[h*2+1],2)<f)return h;break}}while(h!==d);return c}render(t){const n=t==null?t=new ka:void 0,{points:i,halfedges:r,triangles:s}=this;for(let o=0,a=r.length;o<a;++o){const u=r[o];if(u<o)continue;const l=s[o]*2,c=s[u]*2;t.moveTo(i[l],i[l+1]),t.lineTo(i[c],i[c+1])}return this.renderHull(t),n&&n.value()}renderPoints(t,n){n===void 0&&(!t||typeof t.moveTo!="function")&&(n=t,t=null),n=n==null?2:+n;const i=t==null?t=new ka:void 0,{points:r}=this;for(let s=0,o=r.length;s<o;s+=2){const a=r[s],u=r[s+1];t.moveTo(a+n,u),t.arc(a,u,n,0,fie)}return i&&i.value()}renderHull(t){const n=t==null?t=new ka:void 0,{hull:i,points:r}=this,s=i[0]*2,o=i.length;t.moveTo(r[s],r[s+1]);for(let a=1;a<o;++a){const u=2*i[a];t.lineTo(r[u],r[u+1])}return t.closePath(),n&&n.value()}hullPolygon(){const t=new Kx;return this.renderHull(t),t.value()}renderTriangle(t,n){const i=n==null?n=new ka:void 0,{points:r,triangles:s}=this,o=s[t*=3]*2,a=s[t+1]*2,u=s[t+2]*2;return n.moveTo(r[o],r[o+1]),n.lineTo(r[a],r[a+1]),n.lineTo(r[u],r[u+1]),n.closePath(),i&&i.value()}*trianglePolygons(){const{triangles:t}=this;for(let n=0,i=t.length/3;n<i;++n)yield this.trianglePolygon(n)}trianglePolygon(t){const n=new Kx;return this.renderTriangle(t,n),n.value()}}function mie(e,t,n,i){const r=e.length,s=new Float64Array(r*2);for(let o=0;o<r;++o){const a=e[o];s[o*2]=t.call(i,a,o,e),s[o*2+1]=n.call(i,a,o,e)}return s}function*yie(e,t,n,i){let r=0;for(const s of e)yield t.call(i,s,r,e),yield n.call(i,s,r,e),++r}function p$(e){N.call(this,null,e)}p$.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 bie=[-1e5,-1e5,1e5,1e5];Jne(p$,N,{transform(e,t){const n=e.as||"path",i=t.source;if(!i||!i.length)return t;let r=e.size;r=r?[0,0,r[0],r[1]]:(r=e.extent)?[r[0][0],r[0][1],r[1][0],r[1][1]]:bie;const s=this.value=g$.from(i,e.x,e.y).voronoi(r);for(let o=0,a=i.length;o<a;++o){const u=s.cellPolygon(o);i[o][n]=u?xie(u):null}return t.reflow(e.modified()).modifies(n)}});function xie(e){const t=e[0][0],n=e[0][1];let i=e.length-1;for(;e[i][0]===t&&e[i][1]===n;--i);return"M"+e.slice(0,i+1).join("L")+"Z"}const vie=Object.freeze(Object.defineProperty({__proto__:null,voronoi:p$},Symbol.toStringTag,{value:"Module"}));function Ac(e,t,n){return e.fields=t||[],e.fname=n,e}function Aie(e){return e.length===1?Eie(e[0]):wie(e)}const Eie=e=>function(t){return t[e]},wie=e=>{const t=e.length;return function(n){for(let i=0;i<t;++i)n=n[e[i]];return n}};function mg(e){throw Error(e)}function $ie(e){const t=[],n=e.length;let i=null,r=0,s="",o,a,u;e=e+"";function l(){t.push(s+e.substring(o,a)),s="",o=a+1}for(o=a=0;a<n;++a)if(u=e[a],u==="\\")s+=e.substring(o,a++),o=a;else if(u===i)l(),i=null,r=-1;else{if(i)continue;o===r&&u==='"'||o===r&&u==="'"?(o=a+1,i=u):u==="."&&!r?a>o?l():o=a+1:u==="["?(a>o&&l(),r=o=a+1):u==="]"&&(r||mg("Access path missing open bracket: "+e),r>0&&l(),r=0,o=a+1)}return r&&mg("Access path missing closing bracket: "+e),i&&mg("Access path missing closing quote: "+e),a>o&&(a++,l()),t}function Cie(e,t,n){const i=$ie(e);return e=i.length===1?i[0]:e,Ac((n&&n.get||Aie)(i),[e],t||e)}Cie("id");Ac(e=>e,[],"identity");Ac(()=>0,[],"zero");Ac(()=>1,[],"one");Ac(()=>!0,[],"true");Ac(()=>!1,[],"false");function Jx(e){return typeof e=="function"}function Fie(e){return Jx(e)?e:()=>e}function Sie(e){for(let t,n,i=1,r=arguments.length;i<r;++i){t=arguments[i];for(n in t)e[n]=t[n]}return e}function Die(e,t){let n=0,i,r,s,o;if(e&&(i=e.length))if(t==null){for(r=e[n];n<i&&(r==null||r!==r);r=e[++n]);for(s=o=r;n<i;++n)r=e[n],r!=null&&(r<s&&(s=r),r>o&&(o=r))}else{for(r=t(e[n]);n<i&&(r==null||r!==r);r=t(e[++n]));for(s=o=r;n<i;++n)r=t(e[n]),r!=null&&(r<s&&(s=r),r>o&&(o=r))}return[s,o]}function _ie(e,t,n){const i=e.prototype=Object.create(t.prototype);return Object.defineProperty(i,"constructor",{value:e,writable:!0,enumerable:!0,configurable:!0}),Sie(i,n)}var Bb=Math.PI/180,Tf=1<<11>>5,yg=1<<11;function kie(){var e=[256,256],t,n,i,r,s,o,a,u=JN,l=[],c=Math.random,f={};f.layout=function(){for(var g=d(co()),p=Rie((e[0]>>5)*e[1]),m=null,y=l.length,b=-1,x=[],v=l.map(w=>({text:t(w),font:n(w),style:r(w),weight:s(w),rotate:o(w),size:~~(i(w)+1e-14),padding:a(w),xoff:0,yoff:0,x1:0,y1:0,x0:0,y0:0,hasText:!1,sprite:null,datum:w})).sort((w,E)=>E.size-w.size);++b<y;){var A=v[b];A.x=e[0]*(c()+.5)>>1,A.y=e[1]*(c()+.5)>>1,Mie(g,A,v,b),A.hasText&&h(p,A,m)&&(x.push(A),m?Nie(m,A):m=[{x:A.x+A.x0,y:A.y+A.y0},{x:A.x+A.x1,y:A.y+A.y1}],A.x-=e[0]>>1,A.y-=e[1]>>1)}return x};function d(g){g.width=g.height=1;var p=Math.sqrt(g.getContext("2d").getImageData(0,0,1,1).data.length>>2);g.width=(Tf<<5)/p,g.height=yg/p;var m=g.getContext("2d");return m.fillStyle=m.strokeStyle="red",m.textAlign="center",{context:m,ratio:p}}function h(g,p,m){for(var y=p.x,b=p.y,x=Math.sqrt(e[0]*e[0]+e[1]*e[1]),v=u(e),A=c()<.5?1:-1,w=-A,E,$,k;(E=v(w+=A))&&($=~~E[0],k=~~E[1],!(Math.min(Math.abs($),Math.abs(k))>=x));)if(p.x=y+$,p.y=b+k,!(p.x+p.x0<0||p.y+p.y0<0||p.x+p.x1>e[0]||p.y+p.y1>e[1])&&(!m||!Oie(p,g,e[0]))&&(!m||Tie(p,m))){for(var F=p.sprite,D=p.width>>5,T=e[0]>>5,C=p.x-(D<<4),_=C&127,S=32-_,M=p.y1-p.y0,O=(p.y+p.y0)*T+(C>>5),B,I=0;I<M;I++){B=0;for(var G=0;G<=D;G++)g[O+G]|=B<<S|(G<D?(B=F[I*D+G])>>>_:0);O+=T}return p.sprite=null,!0}return!1}return f.words=function(g){return arguments.length?(l=g,f):l},f.size=function(g){return arguments.length?(e=[+g[0],+g[1]],f):e},f.font=function(g){return arguments.length?(n=oa(g),f):n},f.fontStyle=function(g){return arguments.length?(r=oa(g),f):r},f.fontWeight=function(g){return arguments.length?(s=oa(g),f):s},f.rotate=function(g){return arguments.length?(o=oa(g),f):o},f.text=function(g){return arguments.length?(t=oa(g),f):t},f.spiral=function(g){return arguments.length?(u=Lie[g]||g,f):u},f.fontSize=function(g){return arguments.length?(i=oa(g),f):i},f.padding=function(g){return arguments.length?(a=oa(g),f):a},f.random=function(g){return arguments.length?(c=g,f):c},f}function Mie(e,t,n,i){if(!t.sprite){var r=e.context,s=e.ratio;r.clearRect(0,0,(Tf<<5)/s,yg/s);var o=0,a=0,u=0,l=n.length,c,f,d,h,g;for(--i;++i<l;){if(t=n[i],r.save(),r.font=t.style+" "+t.weight+" "+~~((t.size+1)/s)+"px "+t.font,c=r.measureText(t.text+"m").width*s,d=t.size<<1,t.rotate){var p=Math.sin(t.rotate*Bb),m=Math.cos(t.rotate*Bb),y=c*m,b=c*p,x=d*m,v=d*p;c=Math.max(Math.abs(y+v),Math.abs(y-v))+31>>5<<5,d=~~Math.max(Math.abs(b+x),Math.abs(b-x))}else c=c+31>>5<<5;if(d>u&&(u=d),o+c>=Tf<<5&&(o=0,a+=u,u=0),a+d>=yg)break;r.translate((o+(c>>1))/s,(a+(d>>1))/s),t.rotate&&r.rotate(t.rotate*Bb),r.fillText(t.text,0,0),t.padding&&(r.lineWidth=2*t.padding,r.strokeText(t.text,0,0)),r.restore(),t.width=c,t.height=d,t.xoff=o,t.yoff=a,t.x1=c>>1,t.y1=d>>1,t.x0=-t.x1,t.y0=-t.y1,t.hasText=!0,o+=c}for(var A=r.getImageData(0,0,(Tf<<5)/s,yg/s).data,w=[];--i>=0;)if(t=n[i],!!t.hasText){for(c=t.width,f=c>>5,d=t.y1-t.y0,h=0;h<d*f;h++)w[h]=0;if(o=t.xoff,o==null)return;a=t.yoff;var E=0,$=-1;for(g=0;g<d;g++){for(h=0;h<c;h++){var k=f*g+(h>>5),F=A[(a+g)*(Tf<<5)+(o+h)<<2]?1<<31-h%32:0;w[k]|=F,E|=F}E?$=g:(t.y0++,d--,g--,a++)}t.y1=t.y0+$,t.sprite=w.slice(0,(t.y1-t.y0)*f)}}}function Oie(e,t,n){n>>=5;for(var i=e.sprite,r=e.width>>5,s=e.x-(r<<4),o=s&127,a=32-o,u=e.y1-e.y0,l=(e.y+e.y0)*n+(s>>5),c,f=0;f<u;f++){c=0;for(var d=0;d<=r;d++)if((c<<a|(d<r?(c=i[f*r+d])>>>o:0))&t[l+d])return!0;l+=n}return!1}function Nie(e,t){var n=e[0],i=e[1];t.x+t.x0<n.x&&(n.x=t.x+t.x0),t.y+t.y0<n.y&&(n.y=t.y+t.y0),t.x+t.x1>i.x&&(i.x=t.x+t.x1),t.y+t.y1>i.y&&(i.y=t.y+t.y1)}function Tie(e,t){return e.x+e.x1>t[0].x&&e.x+e.x0<t[1].x&&e.y+e.y1>t[0].y&&e.y+e.y0<t[1].y}function JN(e){var t=e[0]/e[1];return function(n){return[t*(n*=.1)*Math.cos(n),n*Math.sin(n)]}}function Bie(e){var t=4,n=t*e[0]/e[1],i=0,r=0;return function(s){var o=s<0?-1:1;switch(Math.sqrt(1+4*o*s)-o&3){case 0:i+=n;break;case 1:r+=t;break;case 2:i-=n;break;default:r-=t;break}return[i,r]}}function Rie(e){for(var t=[],n=-1;++n<e;)t[n]=0;return t}function oa(e){return typeof e=="function"?e:function(){return e}}var Lie={archimedean:JN,rectangular:Bie};const QN=["x","y","font","fontSize","fontStyle","fontWeight","angle"],Pie=["text","font","rotate","fontSize","fontStyle","fontWeight"];function m$(e){N.call(this,kie(),e)}m$.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:QN}]};_ie(m$,N,{transform(e,t){e.size&&!(e.size[0]&&e.size[1])&&mg("Wordcloud size dimensions must be non-zero.");function n(g){const p=e[g];return Jx(p)&&t.modified(p.fields)}const i=e.modified();if(!(i||t.changed(t.ADD_REM)||Pie.some(n)))return;const r=t.materialize(t.SOURCE).source,s=this.value,o=e.as||QN;let a=e.fontSize||14,u;if(Jx(a)?u=e.fontSizeRange:a=Fie(a),u){const g=a,p=Fe("sqrt")().domain(Die(r,g)).range(u);a=m=>p(g(m))}r.forEach(g=>{g[o[0]]=NaN,g[o[1]]=NaN,g[o[3]]=0});const l=s.words(r).text(e.text).size(e.size||[500,500]).padding(e.padding||1).spiral(e.spiral||"archimedean").rotate(e.rotate||0).font(e.font||"sans-serif").fontStyle(e.fontStyle||"normal").fontWeight(e.fontWeight||"normal").fontSize(a).random(gi).layout(),c=s.size(),f=c[0]>>1,d=c[1]>>1,h=l.length;for(let g=0,p,m;g<h;++g)p=l[g],m=p.datum,m[o[0]]=p.x+f,m[o[1]]=p.y+d,m[o[2]]=p.font,m[o[3]]=p.size,m[o[4]]=p.style,m[o[5]]=p.weight,m[o[6]]=p.rotate;return t.reflow(i).modifies(o)}});const Iie=Object.freeze(Object.defineProperty({__proto__:null,wordcloud:m$},Symbol.toStringTag,{value:"Module"}));function Ec(e,t,n){return e.fields=t||[],e.fname=n,e}function zie(e){return e.length===1?jie(e[0]):Uie(e)}const jie=e=>function(t){return t[e]},Uie=e=>{const t=e.length;return function(n){for(let i=0;i<t;++i)n=n[e[i]];return n}};function Rb(e){throw Error(e)}function qie(e){const t=[],n=e.length;let i=null,r=0,s="",o,a,u;e=e+"";function l(){t.push(s+e.substring(o,a)),s="",o=a+1}for(o=a=0;a<n;++a)if(u=e[a],u==="\\")s+=e.substring(o,a++),o=a;else if(u===i)l(),i=null,r=-1;else{if(i)continue;o===r&&u==='"'||o===r&&u==="'"?(o=a+1,i=u):u==="."&&!r?a>o?l():o=a+1:u==="["?(a>o&&l(),r=o=a+1):u==="]"&&(r||Rb("Access path missing open bracket: "+e),r>0&&l(),r=0,o=a+1)}return r&&Rb("Access path missing closing bracket: "+e),i&&Rb("Access path missing closing quote: "+e),a>o&&(a++,l()),t}function Wie(e,t,n){const i=qie(e);return e=i.length===1?i[0]:e,Ec((n&&n.get||zie)(i),[e],t||e)}Wie("id");Ec(e=>e,[],"identity");Ec(()=>0,[],"zero");Ec(()=>1,[],"one");Ec(()=>!0,[],"true");Ec(()=>!1,[],"false");function Gie(e){for(let t,n,i=1,r=arguments.length;i<r;++i){t=arguments[i];for(n in t)e[n]=t[n]}return e}function ZN(e,t,n){const i=e.prototype=Object.create(t.prototype);return Object.defineProperty(i,"constructor",{value:e,writable:!0,enumerable:!0,configurable:!0}),Gie(i,n)}const Hie=e=>new Uint8Array(e),Vie=e=>new Uint16Array(e),Zf=e=>new Uint32Array(e);function Yie(){let e=8,t=[],n=Zf(0),i=N0(0,e),r=N0(0,e);return{data:()=>t,seen:()=>n=Xie(n,t.length),add(s){for(let o=0,a=t.length,u=s.length,l;o<u;++o)l=s[o],l._index=a++,t.push(l)},remove(s,o){const a=t.length,u=Array(a-s),l=t;let c,f,d;for(f=0;!o[f]&&f<a;++f)u[f]=t[f],l[f]=f;for(d=f;f<a;++f)c=t[f],o[f]?l[f]=-1:(l[f]=d,i[d]=i[f],r[d]=r[f],u[d]=c,c._index=d++),i[f]=0;return t=u,l},size:()=>t.length,curr:()=>i,prev:()=>r,reset:s=>r[s]=i[s],all:()=>e<257?255:e<65537?65535:4294967295,set(s,o){i[s]|=o},clear(s,o){i[s]&=~o},resize(s,o){const a=i.length;(s>a||o>e)&&(e=Math.max(o,e),i=N0(s,e,i),r=N0(s,e))}}}function Xie(e,t,n){return e.length>=t?e:(n=n||new e.constructor(t),n.set(e),n)}function N0(e,t,n){const i=(t<257?Hie:t<65537?Vie:Zf)(e);return n&&i.set(n),i}function W_(e,t,n){const i=1<<t;return{one:i,zero:~i,range:n.slice(),bisect:e.bisect,index:e.index,size:e.size,onAdd(r,s){const o=this,a=o.bisect(o.range,r.value),u=r.index,l=a[0],c=a[1],f=u.length;let d;for(d=0;d<l;++d)s[u[d]]|=i;for(d=c;d<f;++d)s[u[d]]|=i;return o}}}function G_(){let e=Zf(0),t=[],n=0;function i(a,u,l){if(!u.length)return[];const c=n,f=u.length,d=Zf(f);let h=Array(f),g,p,m;for(m=0;m<f;++m)h[m]=a(u[m]),d[m]=m;if(h=Kie(h,d),c)g=t,p=e,t=Array(c+f),e=Zf(c+f),Jie(l,g,p,c,h,d,f,t,e);else{if(l>0)for(m=0;m<f;++m)d[m]+=l;t=h,e=d}return n=c+f,{index:d,value:h}}function r(a,u){const l=n;let c,f,d;for(f=0;!u[e[f]]&&f<l;++f);for(d=f;f<l;++f)u[c=e[f]]||(e[d]=c,t[d]=t[f],++d);n=l-a}function s(a){for(let u=0,l=n;u<l;++u)e[u]=a[e[u]]}function o(a,u){let l;return u?l=u.length:(u=t,l=n),[wz(u,a[0],0,l),Og(u,a[1],0,l)]}return{insert:i,remove:r,bisect:o,reindex:s,index:()=>e,size:()=>n}}function Kie(e,t){return e.sort.call(t,(n,i)=>{const r=e[n],s=e[i];return r<s?-1:r>s?1:0}),Fz(e,t)}function Jie(e,t,n,i,r,s,o,a,u){let l=0,c=0,f;for(f=0;l<i&&c<o;++f)t[l]<r[c]?(a[f]=t[l],u[f]=n[l++]):(a[f]=r[c],u[f]=s[c++]+e);for(;l<i;++l,++f)a[f]=t[l],u[f]=n[l];for(;c<o;++c,++f)a[f]=r[c],u[f]=s[c]+e}function y$(e){N.call(this,Yie(),e),this._indices=null,this._dims=null}y$.Definition={type:"CrossFilter",metadata:{},params:[{name:"fields",type:"field",array:!0,required:!0},{name:"query",type:"array",array:!0,required:!0,content:{type:"number",array:!0,length:2}}]};ZN(y$,N,{transform(e,t){if(this._dims){var n=e.modified("fields")||e.fields.some(i=>t.modified(i.fields));return n?this.reinit(e,t):this.eval(e,t)}else return this.init(e,t)},init(e,t){const n=e.fields,i=e.query,r=this._indices={},s=this._dims=[],o=i.length;let a=0,u,l;for(;a<o;++a)u=n[a].fname,l=r[u]||(r[u]=G_()),s.push(W_(l,a,i[a]));return this.eval(e,t)},reinit(e,t){const n=t.materialize().fork(),i=e.fields,r=e.query,s=this._indices,o=this._dims,a=this.value,u=a.curr(),l=a.prev(),c=a.all(),f=n.rem=n.add,d=n.mod,h=r.length,g={};let p,m,y,b,x,v,A,w,E;if(l.set(u),t.rem.length&&(x=this.remove(e,t,n)),t.add.length&&a.add(t.add),t.mod.length)for(v={},b=t.mod,A=0,w=b.length;A<w;++A)v[b[A]._index]=1;for(A=0;A<h;++A)E=i[A],(!o[A]||e.modified("fields",A)||t.modified(E.fields))&&(y=E.fname,(p=g[y])||(s[y]=m=G_(),g[y]=p=m.insert(E,t.source,0)),o[A]=W_(m,A,r[A]).onAdd(p,u));for(A=0,w=a.data().length;A<w;++A)x[A]||(l[A]!==u[A]?f.push(A):v[A]&&u[A]!==c&&d.push(A));return a.mask=(1<<h)-1,n},eval(e,t){const n=t.materialize().fork(),i=this._dims.length;let r=0;return t.rem.length&&(this.remove(e,t,n),r|=(1<<i)-1),e.modified("query")&&!e.modified("fields")&&(r|=this.update(e,t,n)),t.add.length&&(this.insert(e,t,n),r|=(1<<i)-1),t.mod.length&&(this.modify(t,n),r|=(1<<i)-1),this.value.mask=r,n},insert(e,t,n){const i=t.add,r=this.value,s=this._dims,o=this._indices,a=e.fields,u={},l=n.add,c=r.size()+i.length,f=s.length;let d=r.size(),h,g,p;r.resize(c,f),r.add(i);const m=r.curr(),y=r.prev(),b=r.all();for(h=0;h<f;++h)g=a[h].fname,p=u[g]||(u[g]=o[g].insert(a[h],i,d)),s[h].onAdd(p,m);for(;d<c;++d)y[d]=b,m[d]!==b&&l.push(d)},modify(e,t){const n=t.mod,i=this.value,r=i.curr(),s=i.all(),o=e.mod;let a,u,l;for(a=0,u=o.length;a<u;++a)l=o[a]._index,r[l]!==s&&n.push(l)},remove(e,t,n){const i=this._indices,r=this.value,s=r.curr(),o=r.prev(),a=r.all(),u={},l=n.rem,c=t.rem;let f,d,h,g;for(f=0,d=c.length;f<d;++f)h=c[f]._index,u[h]=1,o[h]=g=s[h],s[h]=a,g!==a&&l.push(h);for(h in i)i[h].remove(d,u);return this.reindex(t,d,u),u},reindex(e,t,n){const i=this._indices,r=this.value;e.runAfter(()=>{const s=r.remove(t,n);for(const o in i)i[o].reindex(s)})},update(e,t,n){const i=this._dims,r=e.query,s=t.stamp,o=i.length;let a=0,u,l;for(n.filters=0,l=0;l<o;++l)e.modified("query",l)&&(u=l,++a);if(a===1)a=i[u].one,this.incrementOne(i[u],r[u],n.add,n.rem);else for(l=0,a=0;l<o;++l)e.modified("query",l)&&(a|=i[l].one,this.incrementAll(i[l],r[l],s,n.add),n.rem=n.add);return a},incrementAll(e,t,n,i){const r=this.value,s=r.seen(),o=r.curr(),a=r.prev(),u=e.index(),l=e.bisect(e.range),c=e.bisect(t),f=c[0],d=c[1],h=l[0],g=l[1],p=e.one;let m,y,b;if(f<h)for(m=f,y=Math.min(h,d);m<y;++m)b=u[m],s[b]!==n&&(a[b]=o[b],s[b]=n,i.push(b)),o[b]^=p;else if(f>h)for(m=h,y=Math.min(f,g);m<y;++m)b=u[m],s[b]!==n&&(a[b]=o[b],s[b]=n,i.push(b)),o[b]^=p;if(d>g)for(m=Math.max(f,g),y=d;m<y;++m)b=u[m],s[b]!==n&&(a[b]=o[b],s[b]=n,i.push(b)),o[b]^=p;else if(d<g)for(m=Math.max(h,d),y=g;m<y;++m)b=u[m],s[b]!==n&&(a[b]=o[b],s[b]=n,i.push(b)),o[b]^=p;e.range=t.slice()},incrementOne(e,t,n,i){const r=this.value,s=r.curr(),o=e.index(),a=e.bisect(e.range),u=e.bisect(t),l=u[0],c=u[1],f=a[0],d=a[1],h=e.one;let g,p,m;if(l<f)for(g=l,p=Math.min(f,c);g<p;++g)m=o[g],s[m]^=h,n.push(m);else if(l>f)for(g=f,p=Math.min(l,d);g<p;++g)m=o[g],s[m]^=h,i.push(m);if(c>d)for(g=Math.max(l,d),p=c;g<p;++g)m=o[g],s[m]^=h,n.push(m);else if(c<d)for(g=Math.max(f,c),p=d;g<p;++g)m=o[g],s[m]^=h,i.push(m);e.range=t.slice()}});function b$(e){N.call(this,null,e)}b$.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."}]};ZN(b$,N,{transform(e,t){const n=~(e.ignore||0),i=e.filter,r=i.mask;if(!(r&n))return t.StopPropagation;const s=t.fork(t.ALL),o=i.data(),a=i.curr(),u=i.prev(),l=c=>a[c]&n?null:o[c];return s.filter(s.MOD,l),r&r-1?(s.filter(s.ADD,c=>{const f=a[c]&n;return!f&&f^u[c]&n?o[c]:null}),s.filter(s.REM,c=>{const f=a[c]&n;return f&&!(f^(f^u[c]&n))?o[c]:null})):(s.filter(s.ADD,l),s.filter(s.REM,c=>(a[c]&n)===r?o[c]:null)),s.filter(s.SOURCE,c=>l(c._index))}});const Qie=Object.freeze(Object.defineProperty({__proto__:null,crossfilter:y$,resolvefilter:b$},Symbol.toStringTag,{value:"Module"}));function wc(e,t,n){return e.fields=t||[],e.fname=n,e}function Zie(e){return e.length===1?ere(e[0]):tre(e)}const ere=e=>function(t){return t[e]},tre=e=>{const t=e.length;return function(n){for(let i=0;i<t;++i)n=n[e[i]];return n}};function xr(e){throw Error(e)}function nre(e){const t=[],n=e.length;let i=null,r=0,s="",o,a,u;e=e+"";function l(){t.push(s+e.substring(o,a)),s="",o=a+1}for(o=a=0;a<n;++a)if(u=e[a],u==="\\")s+=e.substring(o,a++),o=a;else if(u===i)l(),i=null,r=-1;else{if(i)continue;o===r&&u==='"'||o===r&&u==="'"?(o=a+1,i=u):u==="."&&!r?a>o?l():o=a+1:u==="["?(a>o&&l(),r=o=a+1):u==="]"&&(r||xr("Access path missing open bracket: "+e),r>0&&l(),r=0,o=a+1)}return r&&xr("Access path missing closing bracket: "+e),i&&xr("Access path missing closing quote: "+e),a>o&&(a++,l()),t}function ire(e,t,n){const i=nre(e);return e=i.length===1?i[0]:e,wc((n&&n.get||Zie)(i),[e],t||e)}ire("id");wc(e=>e,[],"identity");wc(()=>0,[],"zero");wc(()=>1,[],"one");const rre=wc(()=>!0,[],"true");wc(()=>!1,[],"false");var Eu=Array.isArray;function Bh(e){return e===Object(e)}function sre(e){return e!=null?Eu(e)?e:[e]:[]}function ore(e){return typeof e=="function"}function H_(e){return ore(e)?e:()=>e}function are(e,t){let n;return i=>{n&&clearTimeout(n),n=setTimeout(()=>(t(i),n=null),e)}}function Ip(e){for(let t,n,i=1,r=arguments.length;i<r;++i){t=arguments[i];for(n in t)e[n]=t[n]}return e}const ure=Object.prototype.hasOwnProperty;function x$(e,t){return ure.call(e,t)}function lre(e,t,n){const i=e.prototype=Object.create(t.prototype);return Object.defineProperty(i,"constructor",{value:e,writable:!0,enumerable:!0,configurable:!0}),Ip(i,n)}function eT(e){return Object.prototype.toString.call(e)==="[object Date]"}function zp(e){return typeof e=="string"}function tT(e){return Eu(e)?"["+e.map(tT)+"]":Bh(e)||zp(e)?JSON.stringify(e).replace("\u2028","\\u2028").replace("\u2029","\\u2029"):e}function cre(e){const t={},n=e.length;for(let i=0;i<n;++i)t[e[i]]=!0;return t}function $c(e,t,n){return e.fields=t||[],e.fname=n,e}function fre(e){return e.length===1?dre(e[0]):hre(e)}const dre=e=>function(t){return t[e]},hre=e=>{const t=e.length;return function(n){for(let i=0;i<t;++i)n=n[e[i]];return n}};function Gt(e){throw Error(e)}function gre(e){const t=[],n=e.length;let i=null,r=0,s="",o,a,u;e=e+"";function l(){t.push(s+e.substring(o,a)),s="",o=a+1}for(o=a=0;a<n;++a)if(u=e[a],u==="\\")s+=e.substring(o,a++),o=a;else if(u===i)l(),i=null,r=-1;else{if(i)continue;o===r&&u==='"'||o===r&&u==="'"?(o=a+1,i=u):u==="."&&!r?a>o?l():o=a+1:u==="["?(a>o&&l(),r=o=a+1):u==="]"&&(r||Gt("Access path missing open bracket: "+e),r>0&&l(),r=0,o=a+1)}return r&&Gt("Access path missing closing bracket: "+e),i&&Gt("Access path missing closing quote: "+e),a>o&&(a++,l()),t}function nT(e,t,n){const i=gre(e);return e=i.length===1?i[0]:e,$c((n&&n.get||fre)(i),[e],t||e)}nT("id");const v$=$c(e=>e,[],"identity");$c(()=>0,[],"zero");$c(()=>1,[],"one");const iT=$c(()=>!0,[],"true");$c(()=>!1,[],"false");var Ds=Array.isArray;function jp(e){return e===Object(e)}function So(e){return e[e.length-1]}function A$(e){return e==null||e===""?null:+e}const rT=e=>t=>e*Math.exp(t),sT=e=>t=>Math.log(e*t),oT=e=>t=>Math.sign(t)*Math.log1p(Math.abs(t/e)),aT=e=>t=>Math.sign(t)*Math.expm1(Math.abs(t))*e,Up=e=>t=>t<0?-Math.pow(-t,e):Math.pow(t,e);function w1(e,t,n,i){const r=n(e[0]),s=n(So(e)),o=(s-r)*t;return[i(r-o),i(s-o)]}function pre(e,t){return w1(e,t,A$,v$)}function mre(e,t){var n=Math.sign(e[0]);return w1(e,t,sT(n),rT(n))}function yre(e,t,n){return w1(e,t,Up(n),Up(1/n))}function bre(e,t,n){return w1(e,t,oT(n),aT(n))}function $1(e,t,n,i,r){const s=i(e[0]),o=i(So(e)),a=t!=null?i(t):(s+o)/2;return[r(a+(s-a)*n),r(a+(o-a)*n)]}function xre(e,t,n){return $1(e,t,n,A$,v$)}function vre(e,t,n){const i=Math.sign(e[0]);return $1(e,t,n,sT(i),rT(i))}function Are(e,t,n,i){return $1(e,t,n,Up(i),Up(1/i))}function Ere(e,t,n,i){return $1(e,t,n,oT(i),aT(i))}function wre(e){return 1+~~(new Date(e).getMonth()/3)}function $re(e){return 1+~~(new Date(e).getUTCMonth()/3)}function qp(e){return e!=null?Ds(e)?e:[e]:[]}function Cre(e,t,n){let i=e[0],r=e[1],s;return r<i&&(s=r,r=i,i=s),s=r-i,s>=n-t?[t,n]:[i=Math.min(Math.max(i,t),n-s),i+s]}function Wp(e){return typeof e=="function"}function E$(e){for(let t,n,i=1,r=arguments.length;i<r;++i){t=arguments[i];for(n in t)e[n]=t[n]}return e}function Fre(e,t){let n=0,i,r,s,o;if(e&&(i=e.length))if(t==null){for(r=e[n];n<i&&(r==null||r!==r);r=e[++n]);for(s=o=r;n<i;++n)r=e[n],r!=null&&(r<s&&(s=r),r>o&&(o=r))}else{for(r=t(e[n]);n<i&&(r==null||r!==r);r=t(e[++n]));for(s=o=r;n<i;++n)r=t(e[n]),r!=null&&(r<s&&(s=r),r>o&&(o=r))}return[s,o]}const Sre=Object.prototype.hasOwnProperty;function oo(e,t){return Sre.call(e,t)}function Dre(e,t,n,i,r,s){if(!n&&n!==0)return s;const o=+n;let a=e[0],u=So(e),l;u<a&&(l=a,a=u,u=l),l=Math.abs(t-a);const c=Math.abs(u-t);return l<c&&l<=o?i:c<=o?r:s}function _re(e,t,n,i){let r=t[0],s=t[t.length-1],o;return r>s&&(o=r,r=s,s=o),n=n===void 0||n,i=i===void 0||i,(n?r<=e:r<e)&&(i?e<=s:e<s)}function kre(e){return typeof e=="boolean"}function uT(e){return Object.prototype.toString.call(e)==="[object Date]"}function lT(e){return typeof e=="number"}function Mre(e){return Object.prototype.toString.call(e)==="[object RegExp]"}function Cc(e){return typeof e=="string"}function Ore(e,t){const n=e[0],i=So(e),r=+t;return r?r===1?i:n+r*(i-n):n}function T0(e,t){let n="";for(;--t>=0;)n+=e;return n}function Nre(e,t,n,i){const r=n||" ",s=e+"",o=t-s.length;return o<=0?s:i==="left"?T0(r,o)+s:i==="center"?T0(r,~~(o/2))+s+T0(r,Math.ceil(o/2)):s+T0(r,o)}function Tre(e){return e&&So(e)-e[0]||0}function Td(e){return Ds(e)?"["+e.map(Td)+"]":jp(e)||Cc(e)?JSON.stringify(e).replace("\u2028","\\u2028").replace("\u2029","\\u2029"):e}function Bre(e){return e==null||e===""?null:!e||e==="false"||e==="0"?!1:!!e}const Rre=e=>lT(e)||uT(e)?e:Date.parse(e);function Lre(e,t){return t=t||Rre,e==null||e===""?null:t(e)}function Pre(e){return e==null||e===""?null:e+""}function V_(e){const t={},n=e.length;for(let i=0;i<n;++i)t[e[i]]=!0;return t}function Ire(e,t,n,i){const r=i??"…",s=e+"",o=s.length,a=Math.max(0,t-r.length);return o<=t?s:n==="left"?r+s.slice(o-a):n==="center"?s.slice(0,Math.ceil(a/2))+r+s.slice(o-~~(a/2)):s.slice(0,a)+r}const zre="RawCode",Rl="Literal",jre="Property",Ure="Identifier",qre="ArrayExpression",Wre="BinaryExpression",cT="CallExpression",Gre="ConditionalExpression",Hre="LogicalExpression",Vre="MemberExpression",Yre="ObjectExpression",Xre="UnaryExpression";function Yi(e){this.type=e}Yi.prototype.visit=function(e){let t,n,i;if(e(this))return 1;for(t=Kre(this),n=0,i=t.length;n<i;++n)if(t[n].visit(e))return 1};function Kre(e){switch(e.type){case qre:return e.elements;case Wre:case Hre:return[e.left,e.right];case cT:return[e.callee].concat(e.arguments);case Gre:return[e.test,e.consequent,e.alternate];case Vre:return[e.object,e.property];case Yre:return e.properties;case jre:return[e.key,e.value];case Xre:return[e.argument];case Ure:case Rl:case zre:default:return[]}}var Pr,V,R,Xt,Oe,C1=1,Rh=2,Za=3,Uo=4,F1=5,wu=6,wn=7,Lh=8,Jre=9;Pr={};Pr[C1]="Boolean";Pr[Rh]="<end>";Pr[Za]="Identifier";Pr[Uo]="Keyword";Pr[F1]="Null";Pr[wu]="Numeric";Pr[wn]="Punctuator";Pr[Lh]="String";Pr[Jre]="RegularExpression";var Qre="ArrayExpression",Zre="BinaryExpression",ese="CallExpression",tse="ConditionalExpression",fT="Identifier",nse="Literal",ise="LogicalExpression",rse="MemberExpression",sse="ObjectExpression",ose="Property",ase="UnaryExpression",wt="Unexpected token %0",use="Unexpected number",lse="Unexpected string",cse="Unexpected identifier",fse="Unexpected reserved word",dse="Unexpected end of input",Qx="Invalid regular expression",Lb="Invalid regular expression: missing /",dT="Octal literals are not allowed in strict mode.",hse="Duplicate data property in object literal not allowed in strict mode",Mt="ILLEGAL",Bd="Disabled.",gse=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]"),pse=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 S1(e,t){if(!e)throw new Error("ASSERT: "+t)}function is(e){return e>=48&&e<=57}function w$(e){return"0123456789abcdefABCDEF".indexOf(e)>=0}function ed(e){return"01234567".indexOf(e)>=0}function mse(e){return e===32||e===9||e===11||e===12||e===160||e>=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].indexOf(e)>=0}function Rd(e){return e===10||e===13||e===8232||e===8233}function Ph(e){return e===36||e===95||e>=65&&e<=90||e>=97&&e<=122||e===92||e>=128&&gse.test(String.fromCharCode(e))}function Gp(e){return e===36||e===95||e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||e===92||e>=128&&pse.test(String.fromCharCode(e))}const yse={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 hT(){for(;R<Xt;){const e=V.charCodeAt(R);if(mse(e)||Rd(e))++R;else break}}function Zx(e){var t,n,i,r=0;for(n=e==="u"?4:2,t=0;t<n;++t)R<Xt&&w$(V[R])?(i=V[R++],r=r*16+"0123456789abcdef".indexOf(i.toLowerCase())):Ee({},wt,Mt);return String.fromCharCode(r)}function bse(){var e,t,n,i;for(e=V[R],t=0,e==="}"&&Ee({},wt,Mt);R<Xt&&(e=V[R++],!!w$(e));)t=t*16+"0123456789abcdef".indexOf(e.toLowerCase());return(t>1114111||e!=="}")&&Ee({},wt,Mt),t<=65535?String.fromCharCode(t):(n=(t-65536>>10)+55296,i=(t-65536&1023)+56320,String.fromCharCode(n,i))}function gT(){var e,t;for(e=V.charCodeAt(R++),t=String.fromCharCode(e),e===92&&(V.charCodeAt(R)!==117&&Ee({},wt,Mt),++R,e=Zx("u"),(!e||e==="\\"||!Ph(e.charCodeAt(0)))&&Ee({},wt,Mt),t=e);R<Xt&&(e=V.charCodeAt(R),!!Gp(e));)++R,t+=String.fromCharCode(e),e===92&&(t=t.substr(0,t.length-1),V.charCodeAt(R)!==117&&Ee({},wt,Mt),++R,e=Zx("u"),(!e||e==="\\"||!Gp(e.charCodeAt(0)))&&Ee({},wt,Mt),t+=e);return t}function xse(){var e,t;for(e=R++;R<Xt;){if(t=V.charCodeAt(R),t===92)return R=e,gT();if(Gp(t))++R;else break}return V.slice(e,R)}function vse(){var e,t,n;return e=R,t=V.charCodeAt(R)===92?gT():xse(),t.length===1?n=Za:yse.hasOwnProperty(t)?n=Uo:t==="null"?n=F1:t==="true"||t==="false"?n=C1:n=Za,{type:n,value:t,start:e,end:R}}function Pb(){var e=R,t=V.charCodeAt(R),n,i=V[R],r,s,o;switch(t){case 46:case 40:case 41:case 59:case 44:case 123:case 125:case 91:case 93:case 58:case 63:case 126:return++R,{type:wn,value:String.fromCharCode(t),start:e,end:R};default:if(n=V.charCodeAt(R+1),n===61)switch(t){case 43:case 45:case 47:case 60:case 62:case 94:case 124:case 37:case 38:case 42:return R+=2,{type:wn,value:String.fromCharCode(t)+String.fromCharCode(n),start:e,end:R};case 33:case 61:return R+=2,V.charCodeAt(R)===61&&++R,{type:wn,value:V.slice(e,R),start:e,end:R}}}if(o=V.substr(R,4),o===">>>=")return R+=4,{type:wn,value:o,start:e,end:R};if(s=o.substr(0,3),s===">>>"||s==="<<="||s===">>=")return R+=3,{type:wn,value:s,start:e,end:R};if(r=s.substr(0,2),i===r[1]&&"+-<>&|".indexOf(i)>=0||r==="=>")return R+=2,{type:wn,value:r,start:e,end:R};if(r==="//"&&Ee({},wt,Mt),"<>=!+-*%&|^/".indexOf(i)>=0)return++R,{type:wn,value:i,start:e,end:R};Ee({},wt,Mt)}function Ase(e){let t="";for(;R<Xt&&w$(V[R]);)t+=V[R++];return t.length===0&&Ee({},wt,Mt),Ph(V.charCodeAt(R))&&Ee({},wt,Mt),{type:wu,value:parseInt("0x"+t,16),start:e,end:R}}function Ese(e){let t="0"+V[R++];for(;R<Xt&&ed(V[R]);)t+=V[R++];return(Ph(V.charCodeAt(R))||is(V.charCodeAt(R)))&&Ee({},wt,Mt),{type:wu,value:parseInt(t,8),octal:!0,start:e,end:R}}function Y_(){var e,t,n;if(n=V[R],S1(is(n.charCodeAt(0))||n===".","Numeric literal must start with a decimal digit or a decimal point"),t=R,e="",n!=="."){if(e=V[R++],n=V[R],e==="0"){if(n==="x"||n==="X")return++R,Ase(t);if(ed(n))return Ese(t);n&&is(n.charCodeAt(0))&&Ee({},wt,Mt)}for(;is(V.charCodeAt(R));)e+=V[R++];n=V[R]}if(n==="."){for(e+=V[R++];is(V.charCodeAt(R));)e+=V[R++];n=V[R]}if(n==="e"||n==="E")if(e+=V[R++],n=V[R],(n==="+"||n==="-")&&(e+=V[R++]),is(V.charCodeAt(R)))for(;is(V.charCodeAt(R));)e+=V[R++];else Ee({},wt,Mt);return Ph(V.charCodeAt(R))&&Ee({},wt,Mt),{type:wu,value:parseFloat(e),start:t,end:R}}function wse(){var e="",t,n,i,r,s=!1;for(t=V[R],S1(t==="'"||t==='"',"String literal must starts with a quote"),n=R,++R;R<Xt;)if(i=V[R++],i===t){t="";break}else if(i==="\\")if(i=V[R++],!i||!Rd(i.charCodeAt(0)))switch(i){case"u":case"x":V[R]==="{"?(++R,e+=bse()):e+=Zx(i);break;case"n":e+=`
`;break;case"r":e+="\r";break;case"t":e+=" ";break;case"b":e+="\b";break;case"f":e+="\f";break;case"v":e+="\v";break;default:ed(i)?(r="01234567".indexOf(i),r!==0&&(s=!0),R<Xt&&ed(V[R])&&(s=!0,r=r*8+"01234567".indexOf(V[R++]),"0123".indexOf(i)>=0&&R<Xt&&ed(V[R])&&(r=r*8+"01234567".indexOf(V[R++]))),e+=String.fromCharCode(r)):e+=i;break}else i==="\r"&&V[R]===`
`&&++R;else{if(Rd(i.charCodeAt(0)))break;e+=i}return t!==""&&Ee({},wt,Mt),{type:Lh,value:e,octal:s,start:n,end:R}}function $se(e,t){let n=e;t.indexOf("u")>=0&&(n=n.replace(/\\u\{([0-9a-fA-F]+)\}/g,(i,r)=>{if(parseInt(r,16)<=1114111)return"x";Ee({},Qx)}).replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"x"));try{new RegExp(n)}catch{Ee({},Qx)}try{return new RegExp(e,t)}catch{return null}}function Cse(){var e,t,n,i,r;for(e=V[R],S1(e==="/","Regular expression literal must start with a slash"),t=V[R++],n=!1,i=!1;R<Xt;)if(e=V[R++],t+=e,e==="\\")e=V[R++],Rd(e.charCodeAt(0))&&Ee({},Lb),t+=e;else if(Rd(e.charCodeAt(0)))Ee({},Lb);else if(n)e==="]"&&(n=!1);else if(e==="/"){i=!0;break}else e==="["&&(n=!0);return i||Ee({},Lb),r=t.substr(1,t.length-2),{value:r,literal:t}}function Fse(){var e,t,n;for(t="",n="";R<Xt&&(e=V[R],!!Gp(e.charCodeAt(0)));)++R,e==="\\"&&R<Xt?Ee({},wt,Mt):(n+=e,t+=e);return n.search(/[^gimuy]/g)>=0&&Ee({},Qx,n),{value:n,literal:t}}function Sse(){var e,t,n,i;return Oe=null,hT(),e=R,t=Cse(),n=Fse(),i=$se(t.value,n.value),{literal:t.literal+n.literal,value:i,regex:{pattern:t.value,flags:n.value},start:e,end:R}}function Dse(e){return e.type===Za||e.type===Uo||e.type===C1||e.type===F1}function pT(){if(hT(),R>=Xt)return{type:Rh,start:R,end:R};const e=V.charCodeAt(R);return Ph(e)?vse():e===40||e===41||e===59?Pb():e===39||e===34?wse():e===46?is(V.charCodeAt(R+1))?Y_():Pb():is(e)?Y_():Pb()}function kn(){const e=Oe;return R=e.end,Oe=pT(),R=e.end,e}function mT(){const e=R;Oe=pT(),R=e}function _se(e){const t=new Yi(Qre);return t.elements=e,t}function X_(e,t,n){const i=new Yi(e==="||"||e==="&&"?ise:Zre);return i.operator=e,i.left=t,i.right=n,i}function kse(e,t){const n=new Yi(ese);return n.callee=e,n.arguments=t,n}function Mse(e,t,n){const i=new Yi(tse);return i.test=e,i.consequent=t,i.alternate=n,i}function $$(e){const t=new Yi(fT);return t.name=e,t}function Bf(e){const t=new Yi(nse);return t.value=e.value,t.raw=V.slice(e.start,e.end),e.regex&&(t.raw==="//"&&(t.raw="/(?:)/"),t.regex=e.regex),t}function K_(e,t,n){const i=new Yi(rse);return i.computed=e==="[",i.object=t,i.property=n,i.computed||(n.member=!0),i}function Ose(e){const t=new Yi(sse);return t.properties=e,t}function J_(e,t,n){const i=new Yi(ose);return i.key=t,i.value=n,i.kind=e,i}function Nse(e,t){const n=new Yi(ase);return n.operator=e,n.argument=t,n.prefix=!0,n}function Ee(e,t){var n,i=Array.prototype.slice.call(arguments,2),r=t.replace(/%(\d)/g,(s,o)=>(S1(o<i.length,"Message reference must be in range"),i[o]));throw n=new Error(r),n.index=R,n.description=r,n}function D1(e){e.type===Rh&&Ee(e,dse),e.type===wu&&Ee(e,use),e.type===Lh&&Ee(e,lse),e.type===Za&&Ee(e,cse),e.type===Uo&&Ee(e,fse),Ee(e,wt,e.value)}function Kt(e){const t=kn();(t.type!==wn||t.value!==e)&&D1(t)}function Ge(e){return Oe.type===wn&&Oe.value===e}function Ib(e){return Oe.type===Uo&&Oe.value===e}function Tse(){const e=[];for(R=Oe.start,Kt("[");!Ge("]");)Ge(",")?(kn(),e.push(null)):(e.push(eu()),Ge("]")||Kt(","));return kn(),_se(e)}function Q_(){R=Oe.start;const e=kn();return e.type===Lh||e.type===wu?(e.octal&&Ee(e,dT),Bf(e)):$$(e.value)}function Bse(){var e,t,n,i;if(R=Oe.start,e=Oe,e.type===Za)return n=Q_(),Kt(":"),i=eu(),J_("init",n,i);if(e.type===Rh||e.type===wn)D1(e);else return t=Q_(),Kt(":"),i=eu(),J_("init",t,i)}function Rse(){var e=[],t,n,i,r={},s=String;for(R=Oe.start,Kt("{");!Ge("}");)t=Bse(),t.key.type===fT?n=t.key.name:n=s(t.key.value),i="$"+n,Object.prototype.hasOwnProperty.call(r,i)?Ee({},hse):r[i]=!0,e.push(t),Ge("}")||Kt(",");return Kt("}"),Ose(e)}function Lse(){Kt("(");const e=C$();return Kt(")"),e}const Pse={if:1};function Ise(){var e,t,n;if(Ge("("))return Lse();if(Ge("["))return Tse();if(Ge("{"))return Rse();if(e=Oe.type,R=Oe.start,e===Za||Pse[Oe.value])n=$$(kn().value);else if(e===Lh||e===wu)Oe.octal&&Ee(Oe,dT),n=Bf(kn());else{if(e===Uo)throw new Error(Bd);e===C1?(t=kn(),t.value=t.value==="true",n=Bf(t)):e===F1?(t=kn(),t.value=null,n=Bf(t)):Ge("/")||Ge("/=")?(n=Bf(Sse()),mT()):D1(kn())}return n}function zse(){const e=[];if(Kt("("),!Ge(")"))for(;R<Xt&&(e.push(eu()),!Ge(")"));)Kt(",");return Kt(")"),e}function jse(){R=Oe.start;const e=kn();return Dse(e)||D1(e),$$(e.value)}function Use(){return Kt("."),jse()}function qse(){Kt("[");const e=C$();return Kt("]"),e}function Wse(){var e,t,n;for(e=Ise();;)if(Ge("."))n=Use(),e=K_(".",e,n);else if(Ge("("))t=zse(),e=kse(e,t);else if(Ge("["))n=qse(),e=K_("[",e,n);else break;return e}function Z_(){const e=Wse();if(Oe.type===wn&&(Ge("++")||Ge("--")))throw new Error(Bd);return e}function bg(){var e,t;if(Oe.type!==wn&&Oe.type!==Uo)t=Z_();else{if(Ge("++")||Ge("--"))throw new Error(Bd);if(Ge("+")||Ge("-")||Ge("~")||Ge("!"))e=kn(),t=bg(),t=Nse(e.value,t);else{if(Ib("delete")||Ib("void")||Ib("typeof"))throw new Error(Bd);t=Z_()}}return t}function e3(e){let t=0;if(e.type!==wn&&e.type!==Uo)return 0;switch(e.value){case"||":t=1;break;case"&&":t=2;break;case"|":t=3;break;case"^":t=4;break;case"&":t=5;break;case"==":case"!=":case"===":case"!==":t=6;break;case"<":case">":case"<=":case">=":case"instanceof":case"in":t=7;break;case"<<":case">>":case">>>":t=8;break;case"+":case"-":t=9;break;case"*":case"/":case"%":t=11;break}return t}function Gse(){var e,t,n,i,r,s,o,a,u,l;if(e=Oe,u=bg(),i=Oe,r=e3(i),r===0)return u;for(i.prec=r,kn(),t=[e,Oe],o=bg(),s=[u,i,o];(r=e3(Oe))>0;){for(;s.length>2&&r<=s[s.length-2].prec;)o=s.pop(),a=s.pop().value,u=s.pop(),t.pop(),n=X_(a,u,o),s.push(n);i=kn(),i.prec=r,s.push(i),t.push(Oe),n=bg(),s.push(n)}for(l=s.length-1,n=s[l],t.pop();l>1;)t.pop(),n=X_(s[l-1].value,s[l-2],n),l-=2;return n}function eu(){var e,t,n;return e=Gse(),Ge("?")&&(kn(),t=eu(),Kt(":"),n=eu(),e=Mse(e,t,n)),e}function C$(){const e=eu();if(Ge(","))throw new Error(Bd);return e}function Hse(e){V=e,R=0,Xt=V.length,Oe=null,mT();const t=C$();if(Oe.type!==Rh)throw new Error("Unexpect token after expression.");return t}var yT={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 bT(e){function t(o,a,u,l){let c=e(a[0]);return u&&(c=u+"("+c+")",u.lastIndexOf("new ",0)===0&&(c="("+c+")")),c+"."+o+(l<0?"":l===0?"()":"("+a.slice(1).map(e).join(",")+")")}function n(o,a,u){return l=>t(o,l,a,u)}const i="new Date",r="String",s="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(o){o.length<3&&Gt("Missing arguments to clamp function."),o.length>3&&Gt("Too many arguments to clamp function.");const a=o.map(e);return"Math.max("+a[1]+", Math.min("+a[2]+","+a[0]+"))"},now:"Date.now",utc:"Date.UTC",datetime:i,date:n("getDate",i,0),day:n("getDay",i,0),year:n("getFullYear",i,0),month:n("getMonth",i,0),hours:n("getHours",i,0),minutes:n("getMinutes",i,0),seconds:n("getSeconds",i,0),milliseconds:n("getMilliseconds",i,0),time:n("getTime",i,0),timezoneoffset:n("getTimezoneOffset",i,0),utcdate:n("getUTCDate",i,0),utcday:n("getUTCDay",i,0),utcyear:n("getUTCFullYear",i,0),utcmonth:n("getUTCMonth",i,0),utchours:n("getUTCHours",i,0),utcminutes:n("getUTCMinutes",i,0),utcseconds:n("getUTCSeconds",i,0),utcmilliseconds:n("getUTCMilliseconds",i,0),length:n("length",null,-1),parseFloat:"parseFloat",parseInt:"parseInt",upper:n("toUpperCase",r,0),lower:n("toLowerCase",r,0),substring:n("substring",r),split:n("split",r),trim:n("trim",r,0),regexp:s,test:n("test",s),if:function(o){o.length<3&&Gt("Missing arguments to if function."),o.length>3&&Gt("Too many arguments to if function.");const a=o.map(e);return"("+a[0]+"?"+a[1]+":"+a[2]+")"}}}function Vse(e){const t=e&&e.length-1;return t&&(e[0]==='"'&&e[t]==='"'||e[0]==="'"&&e[t]==="'")?e.slice(1,-1):e}function Yse(e){e=e||{};const t=e.allowed?V_(e.allowed):{},n=e.forbidden?V_(e.forbidden):{},i=e.constants||yT,r=(e.functions||bT)(f),s=e.globalvar,o=e.fieldvar,a=Wp(s)?s:g=>`${s}["${g}"]`;let u={},l={},c=0;function f(g){if(Cc(g))return g;const p=d[g.type];return p==null&&Gt("Unsupported type: "+g.type),p(g)}const d={Literal:g=>g.raw,Identifier:g=>{const p=g.name;return c>0?p:oo(n,p)?Gt("Illegal identifier: "+p):oo(i,p)?i[p]:oo(t,p)?p:(u[p]=1,a(p))},MemberExpression:g=>{const p=!g.computed,m=f(g.object);p&&(c+=1);const y=f(g.property);return m===o&&(l[Vse(y)]=1),p&&(c-=1),m+(p?"."+y:"["+y+"]")},CallExpression:g=>{g.callee.type!=="Identifier"&&Gt("Illegal callee type: "+g.callee.type);const p=g.callee.name,m=g.arguments,y=oo(r,p)&&r[p];return y||Gt("Unrecognized function: "+p),Wp(y)?y(m):y+"("+m.map(f).join(",")+")"},ArrayExpression:g=>"["+g.elements.map(f).join(",")+"]",BinaryExpression:g=>"("+f(g.left)+" "+g.operator+" "+f(g.right)+")",UnaryExpression:g=>"("+g.operator+f(g.argument)+")",ConditionalExpression:g=>"("+f(g.test)+"?"+f(g.consequent)+":"+f(g.alternate)+")",LogicalExpression:g=>"("+f(g.left)+g.operator+f(g.right)+")",ObjectExpression:g=>"{"+g.properties.map(f).join(",")+"}",Property:g=>{c+=1;const p=f(g.key);return c-=1,p+":"+f(g.value)}};function h(g){const p={code:f(g),globals:Object.keys(u),fields:Object.keys(l)};return u={},l={},p}return h.functions=r,h.constants=i,h}function zb(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function Xse(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function Kse(e){let t,n,i;e.length!==2?(t=zb,n=(a,u)=>zb(e(a),u),i=(a,u)=>e(a)-u):(t=e===zb||e===Xse?e:Jse,n=e,i=e);function r(a,u,l=0,c=a.length){if(l<c){if(t(u,u)!==0)return c;do{const f=l+c>>>1;n(a[f],u)<0?l=f+1:c=f}while(l<c)}return l}function s(a,u,l=0,c=a.length){if(l<c){if(t(u,u)!==0)return c;do{const f=l+c>>>1;n(a[f],u)<=0?l=f+1:c=f}while(l<c)}return l}function o(a,u,l=0,c=a.length){const f=r(a,u,l,c-1);return f>l&&i(a[f-1],u)>-i(a[f],u)?f-1:f}return{left:r,center:o,right:s}}function Jse(){return 0}function Qse(e,...t){e=new Ng(e),t=t.map(Zse);e:for(const n of e)for(const i of t)if(!i.has(n)){e.delete(n);continue e}return e}function Zse(e){return e instanceof Ng?e:new Ng(e)}function eoe(...e){const t=new Ng;for(const n of e)for(const i of n)t.add(i);return t}function Fc(e,t,n){return e.fields=t||[],e.fname=n,e}function toe(e){return e.length===1?noe(e[0]):ioe(e)}const noe=e=>function(t){return t[e]},ioe=e=>{const t=e.length;return function(n){for(let i=0;i<t;++i)n=n[e[i]];return n}};function xg(e){throw Error(e)}function roe(e){const t=[],n=e.length;let i=null,r=0,s="",o,a,u;e=e+"";function l(){t.push(s+e.substring(o,a)),s="",o=a+1}for(o=a=0;a<n;++a)if(u=e[a],u==="\\")s+=e.substring(o,a++),o=a;else if(u===i)l(),i=null,r=-1;else{if(i)continue;o===r&&u==='"'||o===r&&u==="'"?(o=a+1,i=u):u==="."&&!r?a>o?l():o=a+1:u==="["?(a>o&&l(),r=o=a+1):u==="]"&&(r||xg("Access path missing open bracket: "+e),r>0&&l(),r=0,o=a+1)}return r&&xg("Access path missing closing bracket: "+e),i&&xg("Access path missing closing quote: "+e),a>o&&(a++,l()),t}function Ld(e,t,n){const i=roe(e);return e=i.length===1?i[0]:e,Fc((n&&n.get||toe)(i),[e],t||e)}Ld("id");Fc(e=>e,[],"identity");Fc(()=>0,[],"zero");Fc(()=>1,[],"one");Fc(()=>!0,[],"true");Fc(()=>!1,[],"false");var xT=Array.isArray;function soe(e){return e[e.length-1]}function Ma(e){return e==null||e===""?null:+e}function t3(e){return e!=null?xT(e)?e:[e]:[]}function ooe(e){for(let t,n,i=1,r=arguments.length;i<r;++i){t=arguments[i];for(n in t)e[n]=t[n]}return e}const aoe=Object.prototype.hasOwnProperty;function n3(e,t){return aoe.call(e,t)}function B0(e,t,n,i){let r=t[0],s=t[t.length-1],o;return r>s&&(o=r,r=s,s=o),n=n===void 0||n,i=i===void 0||i,(n?r<=e:r<e)&&(i?e<=s:e<s)}function jb(e){return Object.prototype.toString.call(e)==="[object Date]"}const uoe="Literal";var Ir,loe=1,coe=2,foe=3,doe=4,hoe=5,goe=6,poe=7,moe=8,yoe=9;Ir={};Ir[loe]="Boolean";Ir[coe]="<end>";Ir[foe]="Identifier";Ir[doe]="Keyword";Ir[hoe]="Null";Ir[goe]="Numeric";Ir[poe]="Punctuator";Ir[moe]="String";Ir[yoe]="RegularExpression";const F$="intersect",i3="union",boe="vlMulti",xoe="vlPoint",r3="or",voe="and",ar="_vgsid_",Pd=Ld(ar),Aoe="E",Eoe="R",woe="R-E",$oe="R-LE",Coe="R-RE",Hp="index:unit";function s3(e,t){for(var n=t.fields,i=t.values,r=n.length,s=0,o,a;s<r;++s)if(a=n[s],a.getter=Ld.getter||Ld(a.field),o=a.getter(e),jb(o)&&(o=Ma(o)),jb(i[s])&&(i[s]=Ma(i[s])),jb(i[s][0])&&(i[s]=i[s].map(Ma)),a.type===Aoe){if(xT(i[s])?i[s].indexOf(o)<0:o!==i[s])return!1}else if(a.type===Eoe){if(!B0(o,i[s]))return!1}else if(a.type===Coe){if(!B0(o,i[s],!0,!1))return!1}else if(a.type===woe){if(!B0(o,i[s],!1,!1))return!1}else if(a.type===$oe&&!B0(o,i[s],!1,!0))return!1;return!0}function Foe(e,t,n){for(var i=this.context.data[e],r=i?i.values.value:[],s=i?i[Hp]&&i[Hp].value:void 0,o=n===F$,a=r.length,u=0,l,c,f,d,h;u<a;++u)if(l=r[u],s&&o){if(c=c||{},f=c[d=l.unit]||0,f===-1)continue;if(h=s3(t,l),c[d]=h?-1:++f,h&&s.size===1)return!0;if(!h&&f===s.get(d).count)return!1}else if(h=s3(t,l),o^h)return h;return a&&o}const vT=Kse(Pd),Soe=vT.left,Doe=vT.right;function _oe(e,t,n){const i=this.context.data[e],r=i?i.values.value:[],s=i?i[Hp]&&i[Hp].value:void 0,o=n===F$,a=Pd(t),u=Soe(r,a);if(u===r.length||Pd(r[u])!==a)return!1;if(s&&o){if(s.size===1)return!0;if(Doe(r,a)-u<s.size)return!1}return!0}function koe(e,t){return e.map(n=>ooe(t.fields?{values:t.fields.map(i=>(i.getter||(i.getter=Ld(i.field)))(n.datum))}:{[ar]:Pd(n.datum)},t))}function Moe(e,t,n,i){for(var r=this.context.data[e],s=r?r.values.value:[],o={},a={},u={},l,c,f,d,h,g,p,m,y,b,x=s.length,v=0,A,w;v<x;++v)if(l=s[v],d=l.unit,c=l.fields,f=l.values,c&&f){for(A=0,w=c.length;A<w;++A)h=c[A],p=o[h.field]||(o[h.field]={}),m=p[d]||(p[d]=[]),u[h.field]=y=h.type.charAt(0),b=Ub[`${y}_union`],p[d]=b(m,t3(f[A]));n&&(m=a[d]||(a[d]=[]),m.push(t3(f).reduce((E,$,k)=>(E[c[k].field]=$,E),{})))}else h=ar,g=Pd(l),p=o[h]||(o[h]={}),m=p[d]||(p[d]=[]),m.push(g),n&&(m=a[d]||(a[d]=[]),m.push({[ar]:g}));if(t=t||i3,o[ar]?o[ar]=Ub[`${ar}_${t}`](...Object.values(o[ar])):Object.keys(o).forEach(E=>{o[E]=Object.keys(o[E]).map($=>o[E][$]).reduce(($,k)=>$===void 0?k:Ub[`${u[E]}_${t}`]($,k))}),s=Object.keys(a),n&&s.length){const E=i?xoe:boe;o[E]=t===i3?{[r3]:s.reduce(($,k)=>($.push(...a[k]),$),[])}:{[voe]:s.map($=>({[r3]:a[$]}))}}return o}var Ub={[`${ar}_union`]:eoe,[`${ar}_intersect`]:Qse,E_union:function(e,t){if(!e.length)return t;for(var n=0,i=t.length;n<i;++n)e.indexOf(t[n])<0&&e.push(t[n]);return e},E_intersect:function(e,t){return e.length?e.filter(n=>t.indexOf(n)>=0):t},R_union:function(e,t){var n=Ma(t[0]),i=Ma(t[1]);return n>i&&(n=t[1],i=t[0]),e.length?(e[0]>n&&(e[0]=n),e[1]<i&&(e[1]=i),e):[n,i]},R_intersect:function(e,t){var n=Ma(t[0]),i=Ma(t[1]);return n>i&&(n=t[1],i=t[0]),e.length?i<e[0]||e[1]<n?[]:(e[0]<n&&(e[0]=n),e[1]>i&&(e[1]=i),e):[n,i]}};const Ooe=":",Noe="@";function S$(e,t,n,i){t[0].type!==uoe&&xg("First argument to selection functions must be a string literal.");const r=t[0].value,s=t.length>=2&&soe(t).value,o="unit",a=Noe+o,u=Ooe+r;s===F$&&!n3(i,a)&&(i[a]=n.getData(r).indataRef(n,o)),n3(i,u)||(i[u]=n.getData(r).tuplesRef())}function AT(e){const t=this.context.data[e];return t?t.values.value:[]}function Toe(e,t,n){const i=this.context.data[e]["index:"+t],r=i?i.value.get(n):void 0;return r&&r.count}function Boe(e,t){const n=this.context.dataflow,i=this.context.data[e],r=i.input;return n.pulse(r,n.changeset().remove(iT).insert(t)),1}function Roe(e,t,n){if(e){const i=this.context.dataflow,r=e.mark.source;i.pulse(r,i.changeset().encode(e,t))}return n!==void 0?n:e}const Ih=e=>function(t,n){return this.context.dataflow.locale()[e](n)(t)},Loe=Ih("format"),ET=Ih("timeFormat"),Poe=Ih("utcFormat"),Ioe=Ih("timeParse"),zoe=Ih("utcParse"),R0=new Date(2e3,0,1);function _1(e,t,n){return!Number.isInteger(e)||!Number.isInteger(t)?"":(R0.setYear(2e3),R0.setMonth(e),R0.setDate(t),ET.call(this,R0,n))}function joe(e){return _1.call(this,e,1,"%B")}function Uoe(e){return _1.call(this,e,1,"%b")}function qoe(e){return _1.call(this,0,2+e,"%A")}function Woe(e){return _1.call(this,0,2+e,"%a")}const Goe=":",Hoe="@",ev="%",wT="$";function D$(e,t,n,i){t[0].type!==Rl&&Gt("First argument to data functions must be a string literal.");const r=t[0].value,s=Goe+r;if(!oo(s,i))try{i[s]=n.getData(r).tuplesRef()}catch{}}function Voe(e,t,n,i){t[0].type!==Rl&&Gt("First argument to indata must be a string literal."),t[1].type!==Rl&&Gt("Second argument to indata must be a string literal.");const r=t[0].value,s=t[1].value,o=Hoe+s;oo(o,i)||(i[o]=n.getData(r).indataRef(n,s))}function Bn(e,t,n,i){if(t[0].type===Rl)o3(n,i,t[0].value);else for(e in n.scales)o3(n,i,e)}function o3(e,t,n){const i=ev+n;if(!oo(t,i))try{t[i]=e.scaleRef(n)}catch{}}function Ts(e,t){if(Wp(e))return e;if(Cc(e)){const n=t.scales[e];return n&&oV(n.value)?n.value:void 0}}function Yoe(e,t,n){t.__bandwidth=r=>r&&r.bandwidth?r.bandwidth():0,n._bandwidth=Bn,n._range=Bn,n._scale=Bn;const i=r=>"_["+(r.type===Rl?Td(ev+r.value):Td(ev)+"+"+e(r))+"]";return{_bandwidth:r=>`this.__bandwidth(${i(r[0])})`,_range:r=>`${i(r[0])}.range()`,_scale:r=>`${i(r[0])}(${e(r[1])})`}}function _$(e,t){return function(n,i,r){if(n){const s=Ts(n,(r||this).context);return s&&s.path[e](i)}else return t(i)}}const Xoe=_$("area",nQ),Koe=_$("bounds",oQ),Joe=_$("centroid",dQ);function Qoe(e){const t=this.context.group;let n=!1;if(t)for(;e;){if(e===t){n=!0;break}e=e.mark.group}return n}function k$(e,t,n){try{e[t].apply(e,["EXPRESSION"].concat([].slice.call(n)))}catch(i){e.warn(i)}return n[n.length-1]}function Zoe(){return k$(this.context.dataflow,"warn",arguments)}function eae(){return k$(this.context.dataflow,"info",arguments)}function tae(){return k$(this.context.dataflow,"debug",arguments)}function qb(e){const t=e/255;return t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4)}function tv(e){const t=Ao(e),n=qb(t.r),i=qb(t.g),r=qb(t.b);return .2126*n+.7152*i+.0722*r}function nae(e,t){const n=tv(e),i=tv(t),r=Math.max(n,i),s=Math.min(n,i);return(r+.05)/(s+.05)}function iae(){const e=[].slice.call(arguments);return e.unshift({}),E$(...e)}function $T(e,t){return e===t||e!==e&&t!==t?!0:Ds(e)?Ds(t)&&e.length===t.length?rae(e,t):!1:jp(e)&&jp(t)?CT(e,t):!1}function rae(e,t){for(let n=0,i=e.length;n<i;++n)if(!$T(e[n],t[n]))return!1;return!0}function CT(e,t){for(const n in e)if(!$T(e[n],t[n]))return!1;return!0}function a3(e){return t=>CT(e,t)}function sae(e,t,n,i,r,s){const o=this.context.dataflow,a=this.context.data[e],u=a.input,l=o.stamp();let c=a.changes,f,d;if(o._trigger===!1||!(u.value.length||t||i))return 0;if((!c||c.stamp<l)&&(a.changes=c=o.changeset(),c.stamp=l,o.runAfter(()=>{a.modified=!0,o.pulse(u,c).run()},!0,1)),n&&(f=n===!0?iT:Ds(n)||Bm(n)?n:a3(n),c.remove(f)),t&&c.insert(t),i&&(f=a3(i),u.value.some(f)?c.remove(f):c.insert(i)),r)for(d in s)c.modify(r,d,s[d]);return 1}function oae(e){const t=e.touches,n=t[0].clientX-t[1].clientX,i=t[0].clientY-t[1].clientY;return Math.hypot(n,i)}function aae(e){const t=e.touches;return Math.atan2(t[0].clientY-t[1].clientY,t[0].clientX-t[1].clientX)}const u3={};function uae(e,t){const n=u3[t]||(u3[t]=nT(t));return Ds(e)?e.map(n):n(e)}function M$(e){return Ds(e)||ArrayBuffer.isView(e)?e:null}function O$(e){return M$(e)||(Cc(e)?e:null)}function lae(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return M$(e).join(...n)}function cae(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return O$(e).indexOf(...n)}function fae(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return O$(e).lastIndexOf(...n)}function dae(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return O$(e).slice(...n)}function hae(e,t,n){return Wp(n)&&Gt("Function argument passed to replace."),String(e).replace(t,n)}function gae(e){return M$(e).slice().reverse()}function pae(e,t,n){return NE(e||0,t||0,n||0)}function mae(e,t){const n=Ts(e,(t||this).context);return n&&n.bandwidth?n.bandwidth():0}function yae(e,t){const n=Ts(e,(t||this).context);return n?n.copy():void 0}function bae(e,t){const n=Ts(e,(t||this).context);return n?n.domain():[]}function xae(e,t,n){const i=Ts(e,(n||this).context);return i?Ds(t)?(i.invertRange||i.invert)(t):(i.invert||i.invertExtent)(t):void 0}function vae(e,t){const n=Ts(e,(t||this).context);return n&&n.range?n.range():[]}function Aae(e,t,n){const i=Ts(e,(n||this).context);return i?i(t):void 0}function Eae(e,t,n,i,r){e=Ts(e,(r||this).context);const s=n9(t,n);let o=e.domain(),a=o[0],u=So(o),l=v$;return u-a?l=WO(e,a,u):e=(e.interpolator?Fe("sequential")().interpolator(e.interpolator()):Fe("linear")().interpolate(e.interpolate()).range(e.range())).domain([a=0,u=1]),e.ticks&&(o=e.ticks(+i||15),a!==o[0]&&o.unshift(a),u!==So(o)&&o.push(u)),o.forEach(c=>s.stop(l(c),e(c))),s}function wae(e,t,n){const i=Ts(e,(n||this).context);return function(r){return i?i.path.context(r)(t):""}}function $ae(e){let t=null;return function(n){return n?$d(n,t=t||Sl(e)):e}}const FT=e=>e.data;function ST(e,t){const n=AT.call(t,e);return n.root&&n.root.lookup||{}}function Cae(e,t,n){const i=ST(e,this),r=i[t],s=i[n];return r&&s?r.path(s).map(FT):void 0}function Fae(e,t){const n=ST(e,this)[t];return n?n.ancestors().map(FT):void 0}const DT=()=>typeof window<"u"&&window||null;function Sae(){const e=DT();return e?e.screen:{}}function Dae(){const e=DT();return e?[e.innerWidth,e.innerHeight]:[void 0,void 0]}function _ae(){const e=this.context.dataflow,t=e.container&&e.container();return t?[t.clientWidth,t.clientHeight]:[void 0,void 0]}function _T(e,t,n){if(!e)return[];const[i,r]=e,s=new ot().set(i[0],i[1],r[0],r[1]),o=n||this.context.dataflow.scenegraph().root;return H9(o,s,kae(t))}function kae(e){let t=null;if(e){const n=qp(e.marktype),i=qp(e.markname);t=r=>(!n.length||n.some(s=>r.marktype===s))&&(!i.length||i.some(s=>r.name===s))}return t}function Mae(e,t,n){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:5;e=qp(e);const r=e[e.length-1];return r===void 0||Math.hypot(r[0]-t,r[1]-n)>i?[...e,[t,n]]:e}function Oae(e){return qp(e).reduce((t,n,i)=>{let[r,s]=n;return t+=i==0?`M ${r},${s} `:i===e.length-1?" Z":`L ${r},${s} `},"")}function Nae(e,t,n){const{x:i,y:r,mark:s}=n,o=new ot().set(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,Number.MIN_SAFE_INTEGER,Number.MIN_SAFE_INTEGER);for(const[u,l]of t)u<o.x1&&(o.x1=u),u>o.x2&&(o.x2=u),l<o.y1&&(o.y1=l),l>o.y2&&(o.y2=l);return o.translate(i,r),_T([[o.x1,o.y1],[o.x2,o.y2]],e,s).filter(u=>Tae(u.x,u.y,t))}function Tae(e,t,n){let i=0;for(let r=0,s=n.length-1;r<n.length;s=r++){const[o,a]=n[s],[u,l]=n[r];l>t!=a>t&&e<(o-u)*(t-l)/(a-l)+u&&i++}return i&1}const Id={random(){return gi()},cumulativeNormal:zm,cumulativeLogNormal:OA,cumulativeUniform:RA,densityNormal:SA,densityLogNormal:MA,densityUniform:BA,quantileNormal:jm,quantileLogNormal:NA,quantileUniform:LA,sampleNormal:Im,sampleLogNormal:kA,sampleUniform:TA,isArray:Ds,isBoolean:kre,isDate:uT,isDefined(e){return e!==void 0},isNumber:lT,isObject:jp,isRegExp:Mre,isString:Cc,isTuple:Bm,isValid(e){return e!=null&&e===e},toBoolean:Bre,toDate(e){return Lre(e)},toNumber:A$,toString:Pre,indexof:cae,join:lae,lastindexof:fae,replace:hae,reverse:gae,slice:dae,flush:Dre,lerp:Ore,merge:iae,pad:Nre,peek:So,pluck:uae,span:Tre,inrange:_re,truncate:Ire,rgb:Ao,lab:Vg,hcl:Yg,hsl:Gg,luminance:tv,contrast:nae,sequence:Kn,format:Loe,utcFormat:Poe,utcParse:zoe,utcOffset:Y6,utcSequence:J6,timeFormat:ET,timeParse:Ioe,timeOffset:V6,timeSequence:K6,timeUnitSpecifier:R6,monthFormat:joe,monthAbbrevFormat:Uoe,dayFormat:qoe,dayAbbrevFormat:Woe,quarter:wre,utcquarter:$re,week:P6,utcweek:j6,dayofyear:L6,utcdayofyear:z6,warn:Zoe,info:eae,debug:tae,extent(e){return Fre(e)},inScope:Qoe,intersect:_T,clampRange:Cre,pinchDistance:oae,pinchAngle:aae,screen:Sae,containerSize:_ae,windowSize:Dae,bandspace:pae,setdata:Boe,pathShape:$ae,panLinear:pre,panLog:mre,panPow:yre,panSymlog:bre,zoomLinear:xre,zoomLog:vre,zoomPow:Are,zoomSymlog:Ere,encode:Roe,modify:sae,lassoAppend:Mae,lassoPath:Oae,intersectLasso:Nae},Bae=["view","item","group","xy","x","y"],Rae="event.vega.",kT="this.",N$={},MT={forbidden:["_"],allowed:["datum","event","item"],fieldvar:"datum",globalvar:e=>`_[${Td(wT+e)}]`,functions:Lae,constants:yT,visitors:N$},nv=Yse(MT);function Lae(e){const t=bT(e);Bae.forEach(n=>t[n]=Rae+n);for(const n in Id)t[n]=kT+n;return E$(t,Yoe(e,Id,N$)),t}function lt(e,t,n){return arguments.length===1?Id[e]:(Id[e]=t,n&&(N$[e]=n),nv&&(nv.functions[e]=kT+e),this)}lt("bandwidth",mae,Bn);lt("copy",yae,Bn);lt("domain",bae,Bn);lt("range",vae,Bn);lt("invert",xae,Bn);lt("scale",Aae,Bn);lt("gradient",Eae,Bn);lt("geoArea",Xoe,Bn);lt("geoBounds",Koe,Bn);lt("geoCentroid",Joe,Bn);lt("geoShape",wae,Bn);lt("indata",Toe,Voe);lt("data",AT,D$);lt("treePath",Cae,D$);lt("treeAncestors",Fae,D$);lt("vlSelectionTest",Foe,S$);lt("vlSelectionIdTest",_oe,S$);lt("vlSelectionResolve",Moe,S$);lt("vlSelectionTuples",koe);function Dr(e,t){const n={};let i;try{e=Cc(e)?e:Td(e)+"",i=Hse(e)}catch{Gt("Expression parse error: "+e)}i.visit(s=>{if(s.type!==cT)return;const o=s.callee.name,a=MT.visitors[o];a&&a(o,s.arguments,t,n)});const r=nv(i);return r.globals.forEach(s=>{const o=wT+s;!oo(n,o)&&t.getSignal(s)&&(n[o]=t.signalRef(s))}),{$expr:E$({code:r.code},t.options.ast?{ast:i}:null),$fields:r.fields,$params:n}}function zr(e,t,n){return e.fields=t||[],e.fname=n,e}function Pae(e){return e==null?null:e.fields}function OT(e){return e.length===1?Iae(e[0]):zae(e)}const Iae=e=>function(t){return t[e]},zae=e=>{const t=e.length;return function(n){for(let i=0;i<t;++i)n=n[e[i]];return n}};function za(e){throw Error(e)}function NT(e){const t=[],n=e.length;let i=null,r=0,s="",o,a,u;e=e+"";function l(){t.push(s+e.substring(o,a)),s="",o=a+1}for(o=a=0;a<n;++a)if(u=e[a],u==="\\")s+=e.substring(o,a++),o=a;else if(u===i)l(),i=null,r=-1;else{if(i)continue;o===r&&u==='"'||o===r&&u==="'"?(o=a+1,i=u):u==="."&&!r?a>o?l():o=a+1:u==="["?(a>o&&l(),r=o=a+1):u==="]"&&(r||za("Access path missing open bracket: "+e),r>0&&l(),r=0,o=a+1)}return r&&za("Access path missing closing bracket: "+e),i&&za("Access path missing closing quote: "+e),a>o&&(a++,l()),t}function T$(e,t,n){const i=NT(e);return e=i.length===1?i[0]:e,zr((n&&n.get||OT)(i),[e],t||e)}T$("id");zr(e=>e,[],"identity");zr(()=>0,[],"zero");zr(()=>1,[],"one");const jae=zr(()=>!0,[],"true");zr(()=>!1,[],"false");var B$=Array.isArray;function R$(e){return e===Object(e)}function zd(e){return e!=null?B$(e)?e:[e]:[]}function Uae(e){return typeof e=="function"}const qae="descending";function Wae(e,t,n){n=n||{},t=zd(t)||[];const i=[],r=[],s={},o=n.comparator||Gae;return zd(e).forEach((a,u)=>{a!=null&&(i.push(t[u]===qae?-1:1),r.push(a=Uae(a)?a:T$(a,null,n)),(Pae(a)||[]).forEach(l=>s[l]=1))}),r.length===0?null:zr(o(r,i),Object.keys(s))}const TT=(e,t)=>(e<t||e==null)&&t!=null?-1:(e>t||t==null)&&e!=null?1:(t=t instanceof Date?+t:t,(e=e instanceof Date?+e:e)!==e&&t===t?-1:t!==t&&e===e?1:0),Gae=(e,t)=>e.length===1?Hae(e[0],t[0]):Vae(e,t,e.length),Hae=(e,t)=>function(n,i){return TT(e(n),e(i))*t},Vae=(e,t,n)=>(t.push(0),function(i,r){let s,o=0,a=-1;for(;o===0&&++a<n;)s=e[a],o=TT(s(i),s(r));return o*t[a]}),Yae=Object.prototype.hasOwnProperty;function Xae(e,t){return Yae.call(e,t)}function Kae(e){return typeof e=="string"}function Jae(e,t,n){e&&(e=t?zd(e).map(a=>a.replace(/\\(.)/g,"$1")):zd(e));const i=e&&e.length,r=n&&n.get||OT,s=a=>r(t?[a]:NT(a));let o;if(!i)o=function(){return""};else if(i===1){const a=s(e[0]);o=function(u){return""+a(u)}}else{const a=e.map(s);o=function(u){let l=""+a[0](u),c=0;for(;++c<i;)l+="|"+a[c](u);return l}}return zr(o,e,"key")}function iv(e){return B$(e)?"["+e.map(iv)+"]":R$(e)||Kae(e)?JSON.stringify(e).replace("\u2028","\\u2028").replace("\u2029","\\u2029"):e}function BT(e){const t={},n=e.length;for(let i=0;i<n;++i)t[e[i]]=!0;return t}function Qae(e){const t=this,n=e.operators||[];return e.background&&(t.background=e.background),e.eventConfig&&(t.eventConfig=e.eventConfig),e.locale&&(t.locale=e.locale),n.forEach(i=>t.parseOperator(i)),n.forEach(i=>t.parseOperatorParameters(i)),(e.streams||[]).forEach(i=>t.parseStream(i)),(e.updates||[]).forEach(i=>t.parseUpdate(i)),t.resolve()}const Zae=BT(["rule"]),l3=BT(["group","image","rect"]);function eue(e,t){let n="";return Zae[t]||(e.x2&&(e.x?(l3[t]&&(n+="if(o.x>o.x2)$=o.x,o.x=o.x2,o.x2=$;"),n+="o.width=o.x2-o.x;"):n+="o.x=o.x2-(o.width||0);"),e.xc&&(n+="o.x=o.xc-(o.width||0)/2;"),e.y2&&(e.y?(l3[t]&&(n+="if(o.y>o.y2)$=o.y,o.y=o.y2,o.y2=$;"),n+="o.height=o.y2-o.y;"):n+="o.y=o.y2-(o.height||0);"),e.yc&&(n+="o.y=o.yc-(o.height||0)/2;")),n}function L$(e){return(e+"").toLowerCase()}function tue(e){return L$(e)==="operator"}function nue(e){return L$(e)==="collect"}function rf(e,t,n){n.endsWith(";")||(n="return("+n+");");const i=Function(...t.concat(n));return e&&e.functions?i.bind(e.functions):i}function iue(e,t,n,i){return`((u = ${e}) < (v = ${t}) || u == null) && v != null ? ${n}
: (u > v || v == null) && u != null ? ${i}
: ((v = v instanceof Date ? +v : v), (u = u instanceof Date ? +u : u)) !== u && v === v ? ${n}
: v !== v && u === u ? ${i} : `}var rue={operator:(e,t)=>rf(e,["_"],t.code),parameter:(e,t)=>rf(e,["datum","_"],t.code),event:(e,t)=>rf(e,["event"],t.code),handler:(e,t)=>{const n=`var datum=event.item&&event.item.datum;return ${t.code};`;return rf(e,["_","event"],n)},encode:(e,t)=>{const{marktype:n,channels:i}=t;let r="var o=item,datum=o.datum,m=0,$;";for(const s in i){const o="o["+iv(s)+"]";r+=`$=${i[s].code};if(${o}!==$)${o}=$,m=1;`}return r+=eue(i,n),r+="return m;",rf(e,["item","_"],r)},codegen:{get(e){const t=`[${e.map(iv).join("][")}]`,n=Function("_",`return _${t};`);return n.path=t,n},comparator(e,t){let n;const i=(s,o)=>{const a=t[o];let u,l;return s.path?(u=`a${s.path}`,l=`b${s.path}`):((n=n||{})["f"+o]=s,u=`this.f${o}(a)`,l=`this.f${o}(b)`),iue(u,l,-a,a)},r=Function("a","b","var u, v; return "+e.map(i).join("")+"0;");return n?r.bind(n):r}}};function sue(e){const t=this;tue(e.type)||!e.type?t.operator(e,e.update?t.operatorExpression(e.update):null):t.transform(e,e.type)}function oue(e){const t=this;if(e.params){const n=t.get(e.id);n||za("Invalid operator id: "+e.id),t.dataflow.connect(n,n.parameters(t.parseParameters(e.params),e.react,e.initonly))}}function aue(e,t){t=t||{};const n=this;for(const i in e){const r=e[i];t[i]=B$(r)?r.map(s=>c3(s,n,t)):c3(r,n,t)}return t}function c3(e,t,n){if(!e||!R$(e))return e;for(let i=0,r=f3.length,s;i<r;++i)if(s=f3[i],Xae(e,s.key))return s.parse(e,t,n);return e}var f3=[{key:"$ref",parse:uue},{key:"$key",parse:cue},{key:"$expr",parse:lue},{key:"$field",parse:fue},{key:"$encode",parse:hue},{key:"$compare",parse:due},{key:"$context",parse:gue},{key:"$subflow",parse:pue},{key:"$tupleid",parse:mue}];function uue(e,t){return t.get(e.$ref)||za("Operator not defined: "+e.$ref)}function lue(e,t,n){e.$params&&t.parseParameters(e.$params,n);const i="e:"+e.$expr.code;return t.fn[i]||(t.fn[i]=zr(t.parameterExpression(e.$expr),e.$fields))}function cue(e,t){const n="k:"+e.$key+"_"+!!e.$flat;return t.fn[n]||(t.fn[n]=Jae(e.$key,e.$flat,t.expr.codegen))}function fue(e,t){if(!e.$field)return null;const n="f:"+e.$field+"_"+e.$name;return t.fn[n]||(t.fn[n]=T$(e.$field,e.$name,t.expr.codegen))}function due(e,t){const n="c:"+e.$compare+"_"+e.$order,i=zd(e.$compare).map(r=>r&&r.$tupleid?Z:r);return t.fn[n]||(t.fn[n]=Wae(i,e.$order,t.expr.codegen))}function hue(e,t){const n=e.$encode,i={};for(const r in n){const s=n[r];i[r]=zr(t.encodeExpression(s.$expr),s.$fields),i[r].output=s.$output}return i}function gue(e,t){return t}function pue(e,t){const n=e.$subflow;return function(i,r,s){const o=t.fork().parse(n),a=o.get(n.operators[0].id),u=o.signals.parent;return u&&u.set(s),a.detachSubflow=()=>t.detach(o),a}}function mue(){return Z}function yue(e){var t=this,n=e.filter!=null?t.eventExpression(e.filter):void 0,i=e.stream!=null?t.get(e.stream):void 0,r;e.source?i=t.events(e.source,e.type,n):e.merge&&(r=e.merge.map(s=>t.get(s)),i=r[0].merge.apply(r[0],r.slice(1))),e.between&&(r=e.between.map(s=>t.get(s)),i=i.between(r[0],r[1])),e.filter&&(i=i.filter(n)),e.throttle!=null&&(i=i.throttle(+e.throttle)),e.debounce!=null&&(i=i.debounce(+e.debounce)),i==null&&za("Invalid stream definition: "+JSON.stringify(e)),e.consume&&i.consume(!0),t.stream(e,i)}function bue(e){var t=this,n=R$(n=e.source)?n.$ref:n,i=t.get(n),r=null,s=e.update,o=void 0;i||za("Source not defined: "+e.source),r=e.target&&e.target.$expr?t.eventExpression(e.target.$expr):t.get(e.target),s&&s.$expr&&(s.$params&&(o=t.parseParameters(s.$params)),s=t.handlerExpression(s.$expr)),t.update(e,i,r,s,o)}const xue={skip:!0};function vue(e){var t=this,n={};if(e.signals){var i=n.signals={};Object.keys(t.signals).forEach(s=>{const o=t.signals[s];e.signals(s,o)&&(i[s]=o.value)})}if(e.data){var r=n.data={};Object.keys(t.data).forEach(s=>{const o=t.data[s];e.data(s,o)&&(r[s]=o.input.value)})}return t.subcontext&&e.recurse!==!1&&(n.subcontext=t.subcontext.map(s=>s.getState(e))),n}function Aue(e){var t=this,n=t.dataflow,i=e.data,r=e.signals;Object.keys(r||{}).forEach(s=>{n.update(t.signals[s],r[s],xue)}),Object.keys(i||{}).forEach(s=>{n.pulse(t.data[s].input,n.changeset().remove(jae).insert(i[s]))}),(e.subcontext||[]).forEach((s,o)=>{const a=t.subcontext[o];a&&a.setState(s)})}function RT(e,t,n,i){return new LT(e,t,n,i)}function LT(e,t,n,i){this.dataflow=e,this.transforms=t,this.events=e.events.bind(e),this.expr=i||rue,this.signals={},this.scales={},this.nodes={},this.data={},this.fn={},n&&(this.functions=Object.create(n),this.functions.context=this)}function d3(e){this.dataflow=e.dataflow,this.transforms=e.transforms,this.events=e.events,this.expr=e.expr,this.signals=Object.create(e.signals),this.scales=Object.create(e.scales),this.nodes=Object.create(e.nodes),this.data=Object.create(e.data),this.fn=Object.create(e.fn),e.functions&&(this.functions=Object.create(e.functions),this.functions.context=this)}LT.prototype=d3.prototype={fork(){const e=new d3(this);return(this.subcontext||(this.subcontext=[])).push(e),e},detach(e){this.subcontext=this.subcontext.filter(n=>n!==e);const t=Object.keys(e.nodes);for(const n of t)e.nodes[n]._targets=null;for(const n of t)e.nodes[n].detach();e.nodes=null},get(e){return this.nodes[e]},set(e,t){return this.nodes[e]=t},add(e,t){const n=this,i=n.dataflow,r=e.value;if(n.set(e.id,t),nue(e.type)&&r&&(r.$ingest?i.ingest(t,r.$ingest,r.$format):r.$request?i.preload(t,r.$request,r.$format):i.pulse(t,i.changeset().insert(r))),e.root&&(n.root=t),e.parent){let s=n.get(e.parent.$ref);s?(i.connect(s,[t]),t.targets().add(s)):(n.unresolved=n.unresolved||[]).push(()=>{s=n.get(e.parent.$ref),i.connect(s,[t]),t.targets().add(s)})}if(e.signal&&(n.signals[e.signal]=t),e.scale&&(n.scales[e.scale]=t),e.data)for(const s in e.data){const o=n.data[s]||(n.data[s]={});e.data[s].forEach(a=>o[a]=t)}},resolve(){return(this.unresolved||[]).forEach(e=>e()),delete this.unresolved,this},operator(e,t){this.add(e,this.dataflow.add(e.value,t))},transform(e,t){this.add(e,this.dataflow.add(this.transforms[L$(t)]))},stream(e,t){this.set(e.id,t)},update(e,t,n,i,r){this.dataflow.on(t,n,i,r,e.options)},operatorExpression(e){return this.expr.operator(this,e)},parameterExpression(e){return this.expr.parameter(this,e)},eventExpression(e){return this.expr.event(this,e)},handlerExpression(e){return this.expr.handler(this,e)},encodeExpression(e){return this.expr.encode(this,e)},parse:Qae,parseOperator:sue,parseOperatorParameters:oue,parseParameters:aue,parseStream:yue,parseUpdate:bue,getState:vue,setState:Aue};function Eue(e){const t=e.container();t&&(t.setAttribute("role","graphics-document"),t.setAttribute("aria-roleDescription","visualization"),PT(t,e.description()))}function PT(e,t){e&&(t==null?e.removeAttribute("aria-label"):e.setAttribute("aria-label",t))}function wue(e){e.add(null,t=>(e._background=t.bg,e._resize=1,t.bg),{bg:e._signals.background})}const Wb="default";function $ue(e){const t=e._signals.cursor||(e._signals.cursor=e.add({user:Wb,item:null}));e.on(e.events("view","mousemove"),t,(n,i)=>{const r=t.value,s=r?zp(r)?r:r.user:Wb,o=i.item&&i.item.cursor||null;return r&&s===r.user&&o==r.item?r:{user:s,item:o}}),e.add(null,function(n){let i=n.cursor,r=this.value;return zp(i)||(r=i.item,i=i.user),rv(e,i&&i!==Wb?i:r||i),r},{cursor:t})}function rv(e,t){const n=e.globalCursor()?typeof document<"u"&&document.body:e.container();if(n)return t==null?n.style.removeProperty("cursor"):n.style.cursor=t}function Vp(e,t){var n=e._runtime.data;return x$(n,t)||xr("Unrecognized data set: "+t),n[t]}function Cue(e,t){return arguments.length<2?Vp(this,e).values.value:k1.call(this,e,yu().remove(rre).insert(t))}function k1(e,t){$M(t)||xr("Second argument to changes must be a changeset.");const n=Vp(this,e);return n.modified=!0,this.pulse(n.input,t)}function Fue(e,t){return k1.call(this,e,yu().insert(t))}function Sue(e,t){return k1.call(this,e,yu().remove(t))}function IT(e){var t=e.padding();return Math.max(0,e._viewWidth+t.left+t.right)}function zT(e){var t=e.padding();return Math.max(0,e._viewHeight+t.top+t.bottom)}function M1(e){var t=e.padding(),n=e._origin;return[t.left+n[0],t.top+n[1]]}function Due(e){var t=M1(e),n=IT(e),i=zT(e);e._renderer.background(e.background()),e._renderer.resize(n,i,t),e._handler.origin(t),e._resizeListeners.forEach(r=>{try{r(n,i)}catch(s){e.error(s)}})}function _ue(e,t,n){var i=e._renderer,r=i&&i.canvas(),s,o,a;return r&&(a=M1(e),o=t.changedTouches?t.changedTouches[0]:t,s=g1(o,r),s[0]-=a[0],s[1]-=a[1]),t.dataflow=e,t.item=n,t.vega=kue(e,n,s),t}function kue(e,t,n){const i=t?t.mark.marktype==="group"?t:t.mark.group:null;function r(o){var a=i,u;if(o){for(u=t;u;u=u.mark.group)if(u.mark.name===o){a=u;break}}return a&&a.mark&&a.mark.interactive?a:{}}function s(o){if(!o)return n;zp(o)&&(o=r(o));const a=n.slice();for(;o;)a[0]-=o.x||0,a[1]-=o.y||0,o=o.mark&&o.mark.group;return a}return{view:H_(e),item:H_(t||{}),group:r,xy:s,x:o=>s(o)[0],y:o=>s(o)[1]}}const h3="view",Mue="timer",Oue="window",Nue={trap:!1};function Tue(e){const t=Ip({defaults:{}},e),n=(i,r)=>{r.forEach(s=>{Eu(i[s])&&(i[s]=cre(i[s]))})};return n(t.defaults,["prevent","allow"]),n(t,["view","window","selector"]),t}function jT(e,t,n,i){e._eventListeners.push({type:n,sources:sre(t),handler:i})}function Bue(e,t){var n=e._eventConfig.defaults,i=n.prevent,r=n.allow;return i===!1||r===!0?!1:i===!0||r===!1?!0:i?i[t]:r?!r[t]:e.preventDefault()}function L0(e,t,n){const i=e._eventConfig&&e._eventConfig[t];return i===!1||Bh(i)&&!i[n]?(e.warn(`Blocked ${t} ${n} event listener.`),!1):!0}function Rue(e,t,n){var i=this,r=new Pm(n),s=function(l,c){i.runAsync(null,()=>{e===h3&&Bue(i,t)&&l.preventDefault(),r.receive(_ue(i,l,c))})},o;if(e===Mue)L0(i,"timer",t)&&i.timer(s,t);else if(e===h3)L0(i,"view",t)&&i.addEventListener(t,s,Nue);else if(e===Oue?L0(i,"window",t)&&typeof window<"u"&&(o=[window]):typeof document<"u"&&L0(i,"selector",t)&&(o=Array.from(document.querySelectorAll(e))),!o)i.warn("Can not resolve event source: "+e);else{for(var a=0,u=o.length;a<u;++a)o[a].addEventListener(t,s);jT(i,o,t,s)}return r}function g3(e){return e.item}function p3(e){return e.item.mark.source}function m3(e){return function(t,n){return n.vega.view().changeset().encode(n.item,e)}}function Lue(e,t){return e=[e||"hover"],t=[t||"update",e[0]],this.on(this.events("view","mouseover",g3),p3,m3(e)),this.on(this.events("view","mouseout",g3),p3,m3(t)),this}function Pue(){var e=this._tooltip,t=this._timers,n=this._eventListeners,i,r,s;for(i=t.length;--i>=0;)t[i].stop();for(i=n.length;--i>=0;)for(s=n[i],r=s.sources.length;--r>=0;)s.sources[r].removeEventListener(s.type,s.handler);return e&&e.call(this,this._handler,null,null,null),this}function Jn(e,t,n){const i=document.createElement(e);for(const r in t)i.setAttribute(r,t[r]);return n!=null&&(i.textContent=n),i}const Iue="vega-bind",zue="vega-bind-name",jue="vega-bind-radio";function Uue(e,t,n){if(!t)return;const i=n.param;let r=n.state;return r||(r=n.state={elements:null,active:!1,set:null,update:o=>{o!=e.signal(i.signal)&&e.runAsync(null,()=>{r.source=!0,e.signal(i.signal,o)})}},i.debounce&&(r.update=are(i.debounce,r.update))),(i.input==null&&i.element?que:Gue)(r,t,i,e),r.active||(e.on(e._signals[i.signal],null,()=>{r.source?r.source=!1:r.set(e.signal(i.signal))}),r.active=!0),r}function que(e,t,n,i){const r=n.event||"input",s=()=>e.update(t.value);i.signal(n.signal,t.value),t.addEventListener(r,s),jT(i,t,r,s),e.set=o=>{t.value=o,t.dispatchEvent(Wue(r))}}function Wue(e){return typeof Event<"u"?new Event(e):{type:e}}function Gue(e,t,n,i){const r=i.signal(n.signal),s=Jn("div",{class:Iue}),o=n.input==="radio"?s:s.appendChild(Jn("label"));o.appendChild(Jn("span",{class:zue},n.name||n.signal)),t.appendChild(s);let a=Hue;switch(n.input){case"checkbox":a=Vue;break;case"select":a=Yue;break;case"radio":a=Xue;break;case"range":a=Kue;break}a(e,o,n,r)}function Hue(e,t,n,i){const r=Jn("input");for(const s in n)s!=="signal"&&s!=="element"&&r.setAttribute(s==="input"?"type":s,n[s]);r.setAttribute("name",n.signal),r.value=i,t.appendChild(r),r.addEventListener("input",()=>e.update(r.value)),e.elements=[r],e.set=s=>r.value=s}function Vue(e,t,n,i){const r={type:"checkbox",name:n.signal};i&&(r.checked=!0);const s=Jn("input",r);t.appendChild(s),s.addEventListener("change",()=>e.update(s.checked)),e.elements=[s],e.set=o=>s.checked=!!o||null}function Yue(e,t,n,i){const r=Jn("select",{name:n.signal}),s=n.labels||[];n.options.forEach((o,a)=>{const u={value:o};Yp(o,i)&&(u.selected=!0),r.appendChild(Jn("option",u,(s[a]||o)+""))}),t.appendChild(r),r.addEventListener("change",()=>{e.update(n.options[r.selectedIndex])}),e.elements=[r],e.set=o=>{for(let a=0,u=n.options.length;a<u;++a)if(Yp(n.options[a],o)){r.selectedIndex=a;return}}}function Xue(e,t,n,i){const r=Jn("span",{class:jue}),s=n.labels||[];t.appendChild(r),e.elements=n.options.map((o,a)=>{const u={type:"radio",name:n.signal,value:o};Yp(o,i)&&(u.checked=!0);const l=Jn("input",u);l.addEventListener("change",()=>e.update(o));const c=Jn("label",{},(s[a]||o)+"");return c.prepend(l),r.appendChild(c),l}),e.set=o=>{const a=e.elements,u=a.length;for(let l=0;l<u;++l)Yp(a[l].value,o)&&(a[l].checked=!0)}}function Kue(e,t,n,i){i=i!==void 0?i:(+n.max+ +n.min)/2;const r=n.max!=null?n.max:Math.max(100,+i)||100,s=n.min||Math.min(0,r,+i)||0,o=n.step||yo(s,r,100),a=Jn("input",{type:"range",name:n.signal,min:s,max:r,step:o});a.value=i;const u=Jn("span",{},+i);t.appendChild(a),t.appendChild(u);const l=()=>{u.textContent=a.value,e.update(+a.value)};a.addEventListener("input",l),a.addEventListener("change",l),e.elements=[a],e.set=c=>{a.value=c,u.textContent=c}}function Yp(e,t){return e===t||e+""==t+""}function UT(e,t,n,i,r,s){return t=t||new i(e.loader()),t.initialize(n,IT(e),zT(e),M1(e),r,s).background(e.background())}function P$(e,t){return t?function(){try{t.apply(this,arguments)}catch(n){e.error(n)}}:null}function Jue(e,t,n,i){const r=new i(e.loader(),P$(e,e.tooltip())).scene(e.scenegraph().root).initialize(n,M1(e),e);return t&&t.handlers().forEach(s=>{r.on(s.type,s.handler)}),r}function Que(e,t){const n=this,i=n._renderType,r=n._eventConfig.bind,s=p1(i);e=n._el=e?Gb(n,e,!0):null,Eue(n),s||n.error("Unrecognized renderer type: "+i);const o=s.handler||Dh,a=e?s.renderer:s.headless;return n._renderer=a?UT(n,n._renderer,e,a):null,n._handler=Jue(n,n._handler,e,o),n._redraw=!0,e&&r!=="none"&&(t=t?n._elBind=Gb(n,t,!0):e.appendChild(Jn("form",{class:"vega-bindings"})),n._bind.forEach(u=>{u.param.element&&r!=="container"&&(u.element=Gb(n,u.param.element,!!u.param.input))}),n._bind.forEach(u=>{Uue(n,u.element||t,u)})),n}function Gb(e,t,n){if(typeof t=="string")if(typeof document<"u"){if(t=document.querySelector(t),!t)return e.error("Signal bind element not found: "+t),null}else return e.error("DOM document instance not found."),null;if(t&&n)try{t.textContent=""}catch(i){t=null,e.error(i)}return t}const sf=e=>+e||0,Zue=e=>({top:e,bottom:e,left:e,right:e});function y3(e){return Bh(e)?{top:sf(e.top),bottom:sf(e.bottom),left:sf(e.left),right:sf(e.right)}:Zue(sf(e))}async function I$(e,t,n,i){const r=p1(t),s=r&&r.headless;return s||xr("Unrecognized renderer type: "+t),await e.runAsync(),UT(e,null,null,s,n,i).renderAsync(e._scenegraph.root)}async function ele(e,t){e!==to.Canvas&&e!==to.SVG&&e!==to.PNG&&xr("Unrecognized image type: "+e);const n=await I$(this,e,t);return e===to.SVG?tle(n.svg(),"image/svg+xml"):n.canvas().toDataURL("image/png")}function tle(e,t){const n=new Blob([e],{type:t});return window.URL.createObjectURL(n)}async function nle(e,t){return(await I$(this,to.Canvas,e,t)).canvas()}async function ile(e){return(await I$(this,to.SVG,e)).svg()}function rle(e,t,n){return RT(e,Al,Id,n).parse(t)}function sle(e){var t=this._runtime.scales;return x$(t,e)||xr("Unrecognized scale or projection: "+e),t[e].value}var qT="width",WT="height",z$="padding",b3={skip:!0};function GT(e,t){var n=e.autosize(),i=e.padding();return t-(n&&n.contains===z$?i.left+i.right:0)}function HT(e,t){var n=e.autosize(),i=e.padding();return t-(n&&n.contains===z$?i.top+i.bottom:0)}function ole(e){var t=e._signals,n=t[qT],i=t[WT],r=t[z$];function s(){e._autosize=e._resize=1}e._resizeWidth=e.add(null,a=>{e._width=a.size,e._viewWidth=GT(e,a.size),s()},{size:n}),e._resizeHeight=e.add(null,a=>{e._height=a.size,e._viewHeight=HT(e,a.size),s()},{size:i});const o=e.add(null,s,{pad:r});e._resizeWidth.rank=n.rank+1,e._resizeHeight.rank=i.rank+1,o.rank=r.rank+1}function ale(e,t,n,i,r,s){this.runAfter(o=>{let a=0;o._autosize=0,o.width()!==n&&(a=1,o.signal(qT,n,b3),o._resizeWidth.skip(!0)),o.height()!==i&&(a=1,o.signal(WT,i,b3),o._resizeHeight.skip(!0)),o._viewWidth!==e&&(o._resize=1,o._viewWidth=e),o._viewHeight!==t&&(o._resize=1,o._viewHeight=t),(o._origin[0]!==r[0]||o._origin[1]!==r[1])&&(o._resize=1,o._origin=r),a&&o.run("enter"),s&&o.runAfter(u=>u.resize())},!1,1)}function ule(e){return this._runtime.getState(e||{data:lle,signals:cle,recurse:!0})}function lle(e,t){return t.modified&&Eu(t.input.value)&&e.indexOf("_:vega:_")}function cle(e,t){return!(e==="parent"||t instanceof Al.proxy)}function fle(e){return this.runAsync(null,t=>{t._trigger=!1,t._runtime.setState(e)},t=>{t._trigger=!0}),this}function dle(e,t){function n(i){e({timestamp:Date.now(),elapsed:i})}this._timers.push(Fee(n,t))}function hle(e,t,n,i){const r=e.element();r&&r.setAttribute("title",gle(i))}function gle(e){return e==null?"":Eu(e)?VT(e):Bh(e)&&!eT(e)?ple(e):e+""}function ple(e){return Object.keys(e).map(t=>{const n=e[t];return t+": "+(Eu(n)?VT(n):YT(n))}).join(`
`)}function VT(e){return"["+e.map(YT).join(", ")+"]"}function YT(e){return Eu(e)?"[…]":Bh(e)&&!eT(e)?"{…}":e}function XT(e,t){const n=this;if(t=t||{},il.call(n),t.loader&&n.loader(t.loader),t.logger&&n.logger(t.logger),t.logLevel!=null&&n.logLevel(t.logLevel),t.locale||e.locale){const s=Ip({},e.locale,t.locale);n.locale(gM(s.number,s.time))}n._el=null,n._elBind=null,n._renderType=t.renderer||to.Canvas,n._scenegraph=new lw;const i=n._scenegraph.root;n._renderer=null,n._tooltip=t.tooltip||hle,n._redraw=!0,n._handler=new Dh().scene(i),n._globalCursor=!1,n._preventDefault=!1,n._timers=[],n._eventListeners=[],n._resizeListeners=[],n._eventConfig=Tue(e.eventConfig),n.globalCursor(n._eventConfig.globalCursor);const r=rle(n,e,t.expr);n._runtime=r,n._signals=r.signals,n._bind=(e.bindings||[]).map(s=>({state:null,param:Ip({},s)})),r.root&&r.root.set(i),i.source=r.data.root.input,n.pulse(r.data.root.input,n.changeset().insert(i.items)),n._width=n.width(),n._height=n.height(),n._viewWidth=GT(n,n._width),n._viewHeight=HT(n,n._height),n._origin=[0,0],n._resize=0,n._autosize=1,ole(n),wue(n),$ue(n),n.description(e.description),t.hover&&n.hover(),t.container&&n.initialize(t.container,t.bind)}function P0(e,t){return x$(e._signals,t)?e._signals[t]:xr("Unrecognized signal name: "+tT(t))}function KT(e,t){const n=(e._targets||[]).filter(i=>i._update&&i._update.handler===t);return n.length?n[0]:null}function x3(e,t,n,i){let r=KT(n,i);return r||(r=P$(e,()=>i(t,n.value)),r.handler=i,e.on(n,null,r)),e}function v3(e,t,n){const i=KT(t,n);return i&&t._targets.remove(i),e}lre(XT,il,{async evaluate(e,t,n){if(await il.prototype.evaluate.call(this,e,t),this._redraw||this._resize)try{this._renderer&&(this._resize&&(this._resize=0,Due(this)),await this._renderer.renderAsync(this._scenegraph.root)),this._redraw=!1}catch(i){this.error(i)}return n&&Q0(this,n),this},dirty(e){this._redraw=!0,this._renderer&&this._renderer.dirty(e)},description(e){if(arguments.length){const t=e!=null?e+"":null;return t!==this._desc&&PT(this._el,this._desc=t),this}return this._desc},container(){return this._el},scenegraph(){return this._scenegraph},origin(){return this._origin.slice()},signal(e,t,n){const i=P0(this,e);return arguments.length===1?i.value:this.update(i,t,n)},width(e){return arguments.length?this.signal("width",e):this.signal("width")},height(e){return arguments.length?this.signal("height",e):this.signal("height")},padding(e){return arguments.length?this.signal("padding",y3(e)):y3(this.signal("padding"))},autosize(e){return arguments.length?this.signal("autosize",e):this.signal("autosize")},background(e){return arguments.length?this.signal("background",e):this.signal("background")},renderer(e){return arguments.length?(p1(e)||xr("Unrecognized renderer type: "+e),e!==this._renderType&&(this._renderType=e,this._resetRenderer()),this):this._renderType},tooltip(e){return arguments.length?(e!==this._tooltip&&(this._tooltip=e,this._resetRenderer()),this):this._tooltip},loader(e){return arguments.length?(e!==this._loader&&(il.prototype.loader.call(this,e),this._resetRenderer()),this):this._loader},resize(){return this._autosize=1,this.touch(P0(this,"autosize"))},_resetRenderer(){this._renderer&&(this._renderer=null,this.initialize(this._el,this._elBind))},_resizeView:ale,addEventListener(e,t,n){let i=t;return n&&n.trap===!1||(i=P$(this,t),i.raw=t),this._handler.on(e,i),this},removeEventListener(e,t){for(var n=this._handler.handlers(e),i=n.length,r,s;--i>=0;)if(s=n[i].type,r=n[i].handler,e===s&&(t===r||t===r.raw)){this._handler.off(s,r);break}return this},addResizeListener(e){const t=this._resizeListeners;return t.indexOf(e)<0&&t.push(e),this},removeResizeListener(e){var t=this._resizeListeners,n=t.indexOf(e);return n>=0&&t.splice(n,1),this},addSignalListener(e,t){return x3(this,e,P0(this,e),t)},removeSignalListener(e,t){return v3(this,P0(this,e),t)},addDataListener(e,t){return x3(this,e,Vp(this,e).values,t)},removeDataListener(e,t){return v3(this,Vp(this,e).values,t)},globalCursor(e){if(arguments.length){if(this._globalCursor!==!!e){const t=rv(this,null);this._globalCursor=!!e,t&&rv(this,t)}return this}else return this._globalCursor},preventDefault(e){return arguments.length?(this._preventDefault=e,this):this._preventDefault},timer:dle,events:Rue,finalize:Pue,hover:Lue,data:Cue,change:k1,insert:Fue,remove:Sue,scale:sle,initialize:Que,toImageURL:ele,toCanvas:nle,toSVG:ile,getState:ule,setState:fle});function Sc(e,t,n){return e.fields=t||[],e.fname=n,e}function mle(e){return e.length===1?yle(e[0]):ble(e)}const yle=e=>function(t){return t[e]},ble=e=>{const t=e.length;return function(n){for(let i=0;i<t;++i)n=n[e[i]];return n}};function ae(e){throw Error(e)}function JT(e){const t=[],n=e.length;let i=null,r=0,s="",o,a,u;e=e+"";function l(){t.push(s+e.substring(o,a)),s="",o=a+1}for(o=a=0;a<n;++a)if(u=e[a],u==="\\")s+=e.substring(o,a++),o=a;else if(u===i)l(),i=null,r=-1;else{if(i)continue;o===r&&u==='"'||o===r&&u==="'"?(o=a+1,i=u):u==="."&&!r?a>o?l():o=a+1:u==="["?(a>o&&l(),r=o=a+1):u==="]"&&(r||ae("Access path missing open bracket: "+e),r>0&&l(),r=0,o=a+1)}return r&&ae("Access path missing closing bracket: "+e),i&&ae("Access path missing closing quote: "+e),a>o&&(a++,l()),t}function xle(e,t,n){const i=JT(e);return e=i.length===1?i[0]:e,Sc((n&&n.get||mle)(i),[e],t||e)}xle("id");Sc(e=>e,[],"identity");Sc(()=>0,[],"zero");Sc(()=>1,[],"one");Sc(()=>!0,[],"true");Sc(()=>!1,[],"false");var $t=Array.isArray;function qe(e){return e===Object(e)}const A3=e=>e!=="__proto__";function vle(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.reduce((i,r)=>{for(const s in r)if(s==="signals")i.signals=Ale(i.signals,r.signals);else{const o=s==="legend"?{layout:1}:s==="style"?!0:null;QT(i,s,r[s],o)}return i},{})}function QT(e,t,n,i){if(!A3(t))return;let r,s;if(qe(n)&&!$t(n)){s=qe(e[t])?e[t]:e[t]={};for(r in n)i&&(i===!0||i[r])?QT(s,r,n[r]):A3(r)&&(s[r]=n[r])}else e[t]=n}function Ale(e,t){if(e==null)return t;const n={},i=[];function r(s){n[s.name]||(n[s.name]=1,i.push(s))}return t.forEach(r),e.forEach(r),i}function td(e){return e[e.length-1]}function qt(e){return e!=null?$t(e)?e:[e]:[]}function it(e){for(let t,n,i=1,r=arguments.length;i<r;++i){t=arguments[i];for(n in t)e[n]=t[n]}return e}const Ele=Object.prototype.hasOwnProperty;function Vn(e,t){return Ele.call(e,t)}function Gi(e){return typeof e=="string"}function se(e){return $t(e)?"["+e.map(se)+"]":qe(e)||Gi(e)?JSON.stringify(e).replace("\u2028","\\u2028").replace("\u2029","\\u2029"):e}const wle="view",Xp="[",Kp="]",ZT="{",eB="}",$le=":",tB=",",Cle="@",Fle=">",Sle=/[[\]{}]/,Dle={"*":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 nB,iB;function _le(e,t,n){return nB=t||wle,iB=n||Dle,rB(e.trim()).map(sv)}function kle(e){return iB[e]}function nd(e,t,n,i,r){const s=e.length;let o=0,a;for(;t<s;++t){if(a=e[t],!o&&a===n)return t;r&&r.indexOf(a)>=0?--o:i&&i.indexOf(a)>=0&&++o}return t}function rB(e){const t=[],n=e.length;let i=0,r=0;for(;r<n;)r=nd(e,r,tB,Xp+ZT,Kp+eB),t.push(e.substring(i,r).trim()),i=++r;if(t.length===0)throw"Empty event selector: "+e;return t}function sv(e){return e[0]==="["?Mle(e):Ole(e)}function Mle(e){const t=e.length;let n=1,i;if(n=nd(e,n,Kp,Xp,Kp),n===t)throw"Empty between selector: "+e;if(i=rB(e.substring(1,n)),i.length!==2)throw"Between selector must have two elements: "+e;if(e=e.slice(n+1).trim(),e[0]!==Fle)throw"Expected '>' after between selector: "+e;i=i.map(sv);const r=sv(e.slice(1).trim());return r.between?{between:i,stream:r}:(r.between=i,r)}function Ole(e){const t={source:nB},n=[];let i=[0,0],r=0,s=0,o=e.length,a=0,u,l;if(e[o-1]===eB){if(a=e.lastIndexOf(ZT),a>=0){try{i=Nle(e.substring(a+1,o-1))}catch{throw"Invalid throttle specification: "+e}e=e.slice(0,a).trim(),o=e.length}else throw"Unmatched right brace: "+e;a=0}if(!o)throw e;if(e[0]===Cle&&(r=++a),u=nd(e,a,$le),u<o&&(n.push(e.substring(s,u).trim()),s=a=++u),a=nd(e,a,Xp),a===o)n.push(e.substring(s,o).trim());else if(n.push(e.substring(s,a).trim()),l=[],s=++a,s===o)throw"Unmatched left bracket: "+e;for(;a<o;){if(a=nd(e,a,Kp),a===o)throw"Unmatched left bracket: "+e;if(l.push(e.substring(s,a).trim()),a<o-1&&e[++a]!==Xp)throw"Expected left bracket: "+e;s=++a}if(!(o=n.length)||Sle.test(n[o-1]))throw"Invalid event selector: "+e;return o>1?(t.type=n[1],r?t.markname=n[0].slice(1):kle(n[0])?t.marktype=n[0]:t.source=n[0]):t.type=n[0],t.type.slice(-1)==="!"&&(t.consume=!0,t.type=t.type.slice(0,-1)),l!=null&&(t.filter=l),i[0]&&(t.throttle=i[0]),i[1]&&(t.debounce=i[1]),t}function Nle(e){const t=e.split(tB);if(!e.length||t.length>2)throw e;return t.map(n=>{const i=+n;if(i!==i)throw e;return i})}function Tle(e){return qe(e)?e:{type:e||"pad"}}const of=e=>+e||0,Ble=e=>({top:e,bottom:e,left:e,right:e});function Rle(e){return qe(e)?e.signal?e:{top:of(e.top),bottom:of(e.bottom),left:of(e.left),right:of(e.right)}:Ble(of(e))}const Ct=e=>qe(e)&&!$t(e)?it({},e):{value:e};function E3(e,t,n,i){return n!=null?(qe(n)&&!$t(n)||$t(n)&&n.length&&qe(n[0])?e.update[t]=n:e[i||"enter"][t]={value:n},1):0}function Rt(e,t,n){for(const i in t)E3(e,i,t[i]);for(const i in n)E3(e,i,n[i],"update")}function Dc(e,t,n){for(const i in t)n&&Vn(n,i)||(e[i]=it(e[i]||{},t[i]));return e}function Yu(e,t){return t&&(t.enter&&t.enter[e]||t.update&&t.update[e])}const j$="mark",U$="frame",q$="scope",Lle="axis",Ple="axis-domain",Ile="axis-grid",zle="axis-label",jle="axis-tick",Ule="axis-title",qle="legend",Wle="legend-band",Gle="legend-entry",Hle="legend-gradient",sB="legend-label",Vle="legend-symbol",Yle="legend-title",Xle="title",Kle="title-text",Jle="title-subtitle";function Qle(e,t,n,i,r){const s={},o={};let a,u,l,c;u="lineBreak",t==="text"&&r[u]!=null&&!Yu(u,e)&&Hb(s,u,r[u]),(n=="legend"||String(n).startsWith("axis"))&&(n=null),c=n===U$?r.group:n===j$?it({},r.mark,r[t]):null;for(u in c)l=Yu(u,e)||(u==="fill"||u==="stroke")&&(Yu("fill",e)||Yu("stroke",e)),l||Hb(s,u,c[u]);qt(i).forEach(f=>{const d=r.style&&r.style[f];for(const h in d)Yu(h,e)||Hb(s,h,d[h])}),e=it({},e);for(u in s)c=s[u],c.signal?(a=a||{})[u]=c:o[u]=c;return e.enter=it(o,e.enter),a&&(e.update=it(a,e.update)),e}function Hb(e,t,n){e[t]=n&&n.signal?{signal:n.signal}:{value:n}}const oB=e=>Gi(e)?se(e):e.signal?`(${e.signal})`:aB(e);function O1(e){if(e.gradient!=null)return ece(e);let t=e.signal?`(${e.signal})`:e.color?Zle(e.color):e.field!=null?aB(e.field):e.value!==void 0?se(e.value):void 0;return e.scale!=null&&(t=tce(e,t)),t===void 0&&(t=null),e.exponent!=null&&(t=`pow(${t},${vg(e.exponent)})`),e.mult!=null&&(t+=`*${vg(e.mult)}`),e.offset!=null&&(t+=`+${vg(e.offset)}`),e.round&&(t=`round(${t})`),t}const I0=(e,t,n,i)=>`(${e}(${[t,n,i].map(O1).join(",")})+'')`;function Zle(e){return e.c?I0("hcl",e.h,e.c,e.l):e.h||e.s?I0("hsl",e.h,e.s,e.l):e.l||e.a?I0("lab",e.l,e.a,e.b):e.r||e.g||e.b?I0("rgb",e.r,e.g,e.b):null}function ece(e){const t=[e.start,e.stop,e.count].map(n=>n==null?null:se(n));for(;t.length&&td(t)==null;)t.pop();return t.unshift(oB(e.gradient)),`gradient(${t.join(",")})`}function vg(e){return qe(e)?"("+O1(e)+")":e}function aB(e){return uB(qe(e)?e:{datum:e})}function uB(e){let t,n,i;if(e.signal)t="datum",i=e.signal;else if(e.group||e.parent){for(n=Math.max(1,e.level||1),t="item";n-- >0;)t+=".mark.group";e.parent?(i=e.parent,t+=".datum"):i=e.group}else e.datum?(t="datum",i=e.datum):ae("Invalid field reference: "+se(e));return e.signal||(i=Gi(i)?JT(i).map(se).join("]["):uB(i)),t+"["+i+"]"}function tce(e,t){const n=oB(e.scale);return e.range!=null?t=`lerp(_range(${n}), ${+e.range})`:(t!==void 0&&(t=`_scale(${n}, ${t})`),e.band&&(t=(t?t+"+":"")+`_bandwidth(${n})`+(+e.band==1?"":"*"+vg(e.band)),e.extra&&(t=`(datum.extra ? _scale(${n}, datum.extra.value) : ${t})`)),t==null&&(t="0")),t}function nce(e){let t="";return e.forEach(n=>{const i=O1(n);t+=n.test?`(${n.test})?${i}:`:i}),td(t)===":"&&(t+="null"),t}function lB(e,t,n,i,r,s){const o={};s=s||{},s.encoders={$encode:o},e=Qle(e,t,n,i,r.config);for(const a in e)o[a]=ice(e[a],t,s,r);return s}function ice(e,t,n,i){const r={},s={};for(const o in e)e[o]!=null&&(r[o]=sce(rce(e[o]),i,n,s));return{$expr:{marktype:t,channels:r},$fields:Object.keys(s),$output:Object.keys(e)}}function rce(e){return $t(e)?nce(e):O1(e)}function sce(e,t,n,i){const r=Dr(e,t);return r.$fields.forEach(s=>i[s]=1),it(n,r.$params),r.$expr}const oce="outer",ace=["value","update","init","react","bind"];function w3(e,t){ae(e+' for "outer" push: '+se(t))}function cB(e,t){const n=e.name;if(e.push===oce)t.signals[n]||w3("No prior signal definition",n),ace.forEach(i=>{e[i]!==void 0&&w3("Invalid property ",i)});else{const i=t.addSignal(n,e.value);e.react===!1&&(i.react=!1),e.bind&&t.addBinding(n,e.bind)}}function ov(e,t,n,i){this.id=-1,this.type=e,this.value=t,this.params=n,i&&(this.parent=i)}function N1(e,t,n,i){return new ov(e,t,n,i)}function Jp(e,t){return N1("operator",e,t)}function Q(e){const t={$ref:e.id};return e.id<0&&(e.refs=e.refs||[]).push(t),t}function jd(e,t){return t?{$field:e,$name:t}:{$field:e}}const av=jd("key");function $3(e,t){return{$compare:e,$order:t}}function uce(e,t){const n={$key:e};return t&&(n.$flat=!0),n}const lce="ascending",cce="descending";function fce(e){return qe(e)?(e.order===cce?"-":"+")+T1(e.op,e.field):""}function T1(e,t){return(e&&e.signal?"$"+e.signal:e||"")+(e&&t?"_":"")+(t&&t.signal?"$"+t.signal:t||"")}const W$="scope",uv="view";function pt(e){return e&&e.signal}function dce(e){return e&&e.expr}function Ag(e){if(pt(e))return!0;if(qe(e)){for(const t in e)if(Ag(e[t]))return!0}return!1}function Si(e,t){return e??t}function ja(e){return e&&e.signal||e}const C3="timer";function Ud(e,t){return(e.merge?gce:e.stream?pce:e.type?mce:ae("Invalid stream specification: "+se(e)))(e,t)}function hce(e){return e===W$?uv:e||uv}function gce(e,t){const n=e.merge.map(r=>Ud(r,t)),i=G$({merge:n},e,t);return t.addStream(i).id}function pce(e,t){const n=Ud(e.stream,t),i=G$({stream:n},e,t);return t.addStream(i).id}function mce(e,t){let n;e.type===C3?(n=t.event(C3,e.throttle),e={between:e.between,filter:e.filter}):n=t.event(hce(e.source),e.type);const i=G$({stream:n},e,t);return Object.keys(i).length===1?n:t.addStream(i).id}function G$(e,t,n){let i=t.between;return i&&(i.length!==2&&ae('Stream "between" parameter must have 2 entries: '+se(t)),e.between=[Ud(i[0],n),Ud(i[1],n)]),i=t.filter?[].concat(t.filter):[],(t.marktype||t.markname||t.markrole)&&i.push(yce(t.marktype,t.markname,t.markrole)),t.source===W$&&i.push("inScope(event.item)"),i.length&&(e.filter=Dr("("+i.join(")&&(")+")",n).$expr),(i=t.throttle)!=null&&(e.throttle=+i),(i=t.debounce)!=null&&(e.debounce=+i),t.consume&&(e.consume=!0),e}function yce(e,t,n){const i="event.item";return i+(e&&e!=="*"?"&&"+i+".mark.marktype==='"+e+"'":"")+(n?"&&"+i+".mark.role==='"+n+"'":"")+(t?"&&"+i+".mark.name==='"+t+"'":"")}const bce={code:"_.$value",ast:{type:"Identifier",value:"value"}};function xce(e,t,n){const i=e.encode,r={target:n};let s=e.events,o=e.update,a=[];s||ae("Signal update missing events specification."),Gi(s)&&(s=_le(s,t.isSubscope()?W$:uv)),s=qt(s).filter(u=>u.signal||u.scale?(a.push(u),0):1),a.length>1&&(a=[Ace(a)]),s.length&&a.push(s.length>1?{merge:s}:s[0]),i!=null&&(o&&ae("Signal encode and update are mutually exclusive."),o="encode(item(),"+se(i)+")"),r.update=Gi(o)?Dr(o,t):o.expr!=null?Dr(o.expr,t):o.value!=null?o.value:o.signal!=null?{$expr:bce,$params:{$value:t.signalRef(o.signal)}}:ae("Invalid signal update specification."),e.force&&(r.options={force:!0}),a.forEach(u=>t.addUpdate(it(vce(u,t),r)))}function vce(e,t){return{source:e.signal?t.signalRef(e.signal):e.scale?t.scaleRef(e.scale):Ud(e,t)}}function Ace(e){return{signal:"["+e.map(t=>t.scale?'scale("'+t.scale+'")':t.signal)+"]"}}function Ece(e,t){const n=t.getSignal(e.name);let i=e.update;e.init&&(i?ae("Signals can not include both init and update expressions."):(i=e.init,n.initonly=!0)),i&&(i=Dr(i,t),n.update=i.$expr,n.params=i.$params),e.on&&e.on.forEach(r=>xce(r,t,n.id))}const Re=e=>(t,n,i)=>N1(e,n,t||void 0,i),fB=Re("aggregate"),wce=Re("axisticks"),dB=Re("bound"),Xi=Re("collect"),F3=Re("compare"),$ce=Re("datajoin"),hB=Re("encode"),Cce=Re("expression"),Fce=Re("facet"),Sce=Re("field"),Dce=Re("key"),_ce=Re("legendentries"),kce=Re("load"),Mce=Re("mark"),Oce=Re("multiextent"),Nce=Re("multivalues"),Tce=Re("overlap"),Bce=Re("params"),gB=Re("prefacet"),Rce=Re("projection"),Lce=Re("proxy"),Pce=Re("relay"),pB=Re("render"),Ice=Re("scale"),$u=Re("sieve"),zce=Re("sortitems"),mB=Re("viewlayout"),jce=Re("values");let Uce=0;const yB={min:"min",max:"max",count:"sum"};function qce(e,t){const n=e.type||"linear";PO(n)||ae("Unrecognized scale type: "+se(n)),t.addScale(e.name,{type:n,domain:void 0})}function Wce(e,t){const n=t.getScale(e.name).params;let i;n.domain=bB(e.domain,e,t),e.range!=null&&(n.range=vB(e,t,n)),e.interpolate!=null&&efe(e.interpolate,n),e.nice!=null&&(n.nice=Zce(e.nice)),e.bins!=null&&(n.bins=Qce(e.bins,t));for(i in e)Vn(n,i)||i==="name"||(n[i]=li(e[i],t))}function li(e,t){return qe(e)?e.signal?t.signalRef(e.signal):ae("Unsupported object: "+se(e)):e}function Eg(e,t){return e.signal?t.signalRef(e.signal):e.map(n=>li(n,t))}function B1(e){ae("Can not find data set: "+se(e))}function bB(e,t,n){if(!e){(t.domainMin!=null||t.domainMax!=null)&&ae("No scale domain defined for domainMin/domainMax to override.");return}return e.signal?n.signalRef(e.signal):($t(e)?Gce:e.fields?Vce:Hce)(e,t,n)}function Gce(e,t,n){return e.map(i=>li(i,n))}function Hce(e,t,n){const i=n.getData(e.data);return i||B1(e.data),Fl(t.type)?i.valuesRef(n,e.field,xB(e.sort,!1)):jO(t.type)?i.domainRef(n,e.field):i.extentRef(n,e.field)}function Vce(e,t,n){const i=e.data,r=e.fields.reduce((s,o)=>(o=Gi(o)?{data:i,field:o}:$t(o)||o.signal?Yce(o,n):o,s.push(o),s),[]);return(Fl(t.type)?Xce:jO(t.type)?Kce:Jce)(e,n,r)}function Yce(e,t){const n="_:vega:_"+Uce++,i=Xi({});if($t(e))i.value={$ingest:e};else if(e.signal){const r="setdata("+se(n)+","+e.signal+")";i.params.input=t.signalRef(r)}return t.addDataPipeline(n,[i,$u({})]),{data:n,field:"data"}}function Xce(e,t,n){const i=xB(e.sort,!0);let r,s;const o=n.map(l=>{const c=t.getData(l.data);return c||B1(l.data),c.countsRef(t,l.field,i)}),a={groupby:av,pulse:o};i&&(r=i.op||"count",s=i.field?T1(r,i.field):"count",a.ops=[yB[r]],a.fields=[t.fieldRef(s)],a.as=[s]),r=t.add(fB(a));const u=t.add(Xi({pulse:Q(r)}));return s=t.add(jce({field:av,sort:t.sortRef(i),pulse:Q(u)})),Q(s)}function xB(e,t){return e&&(!e.field&&!e.op?qe(e)?e.field="key":e={field:"key"}:!e.field&&e.op!=="count"?ae("No field provided for sort aggregate op: "+e.op):t&&e.field&&e.op&&!yB[e.op]&&ae("Multiple domain scales can not be sorted using "+e.op)),e}function Kce(e,t,n){const i=n.map(r=>{const s=t.getData(r.data);return s||B1(r.data),s.domainRef(t,r.field)});return Q(t.add(Nce({values:i})))}function Jce(e,t,n){const i=n.map(r=>{const s=t.getData(r.data);return s||B1(r.data),s.extentRef(t,r.field)});return Q(t.add(Oce({extents:i})))}function Qce(e,t){return e.signal||$t(e)?Eg(e,t):t.objectProperty(e)}function Zce(e){return qe(e)?{interval:li(e.interval),step:li(e.step)}:li(e)}function efe(e,t){t.interpolate=li(e.type||e),e.gamma!=null&&(t.interpolateGamma=li(e.gamma))}function vB(e,t,n){const i=t.config.range;let r=e.range;if(r.signal)return t.signalRef(r.signal);if(Gi(r)){if(i&&Vn(i,r))return e=it({},e,{range:i[r]}),vB(e,t,n);r==="width"?r=[0,{signal:"width"}]:r==="height"?r=Fl(e.type)?[0,{signal:"height"}]:[{signal:"height"},0]:ae("Unrecognized scale range value: "+se(r))}else if(r.scheme){n.scheme=$t(r.scheme)?Eg(r.scheme,t):li(r.scheme,t),r.extent&&(n.schemeExtent=Eg(r.extent,t)),r.count&&(n.schemeCount=li(r.count,t));return}else if(r.step){n.rangeStep=li(r.step,t);return}else{if(Fl(e.type)&&!$t(r))return bB(r,e,t);$t(r)||ae("Unsupported range type: "+se(r))}return r.map(s=>($t(s)?Eg:li)(s,t))}function tfe(e,t){const n=t.config.projection||{},i={};for(const r in e)r!=="name"&&(i[r]=lv(e[r],r,t));for(const r in n)i[r]==null&&(i[r]=lv(n[r],r,t));t.addProjection(e.name,i)}function lv(e,t,n){return $t(e)?e.map(i=>lv(i,t,n)):qe(e)?e.signal?n.signalRef(e.signal):t==="fit"?e:ae("Unsupported parameter object: "+se(e)):e}const Ki="top",_c="left",kc="right",Do="bottom",AB="center",nfe="vertical",ife="start",rfe="middle",sfe="end",cv="index",H$="label",ofe="offset",Ll="perc",afe="perc2",fi="value",zh="guide-label",V$="guide-title",ufe="group-title",lfe="group-subtitle",S3="symbol",wg="gradient",fv="discrete",dv="size",cfe="shape",ffe="fill",dfe="stroke",hfe="strokeWidth",gfe="strokeDash",pfe="opacity",Y$=[dv,cfe,ffe,dfe,hfe,gfe,pfe],jh={name:1,style:1,interactive:1},xe={value:0},di={value:1},R1="group",EB="rect",X$="rule",mfe="symbol",Cu="text";function qd(e){return e.type=R1,e.interactive=e.interactive||!1,e}function Un(e,t){const n=(i,r)=>Si(e[i],Si(t[i],r));return n.isVertical=i=>nfe===Si(e.direction,t.direction||(i?t.symbolDirection:t.gradientDirection)),n.gradientLength=()=>Si(e.gradientLength,t.gradientLength||t.gradientWidth),n.gradientThickness=()=>Si(e.gradientThickness,t.gradientThickness||t.gradientHeight),n.entryColumns=()=>Si(e.columns,Si(t.columns,+n.isVertical(!0))),n}function wB(e,t){const n=t&&(t.update&&t.update[e]||t.enter&&t.enter[e]);return n&&n.signal?n:n?n.value:null}function yfe(e,t,n){const i=t.config.style[n];return i&&i[e]}function L1(e,t,n){return`item.anchor === '${ife}' ? ${e} : item.anchor === '${sfe}' ? ${t} : ${n}`}const K$=L1(se(_c),se(kc),se(AB));function bfe(e){const t=e("tickBand");let n=e("tickOffset"),i,r;return t?t.signal?(i={signal:`(${t.signal}) === 'extent' ? 1 : 0.5`},r={signal:`(${t.signal}) === 'extent'`},qe(n)||(n={signal:`(${t.signal}) === 'extent' ? 0 : ${n}`})):t==="extent"?(i=1,r=!0,n=0):(i=.5,r=!1):(i=e("bandPosition"),r=e("tickExtra")),{extra:r,band:i,offset:n}}function $B(e,t){return t?e?qe(e)?Object.assign({},e,{offset:$B(e.offset,t)}):{value:e,offset:t}:t:e}function ni(e,t){return t?(e.name=t.name,e.style=t.style||e.style,e.interactive=!!t.interactive,e.encode=Dc(e.encode,t,jh)):e.interactive=!1,e}function xfe(e,t,n,i){const r=Un(e,n),s=r.isVertical(),o=r.gradientThickness(),a=r.gradientLength();let u,l,c,f,d;s?(l=[0,1],c=[0,0],f=o,d=a):(l=[0,0],c=[1,0],f=a,d=o);const h={enter:u={opacity:xe,x:xe,y:xe,width:Ct(f),height:Ct(d)},update:it({},u,{opacity:di,fill:{gradient:t,start:l,stop:c}}),exit:{opacity:xe}};return Rt(h,{stroke:r("gradientStrokeColor"),strokeWidth:r("gradientStrokeWidth")},{opacity:r("gradientOpacity")}),ni({type:EB,role:Hle,encode:h},i)}function vfe(e,t,n,i,r){const s=Un(e,n),o=s.isVertical(),a=s.gradientThickness(),u=s.gradientLength();let l,c,f,d,h="";o?(l="y",f="y2",c="x",d="width",h="1-"):(l="x",f="x2",c="y",d="height");const g={opacity:xe,fill:{scale:t,field:fi}};g[l]={signal:h+"datum."+Ll,mult:u},g[c]=xe,g[f]={signal:h+"datum."+afe,mult:u},g[d]=Ct(a);const p={enter:g,update:it({},g,{opacity:di}),exit:{opacity:xe}};return Rt(p,{stroke:s("gradientStrokeColor"),strokeWidth:s("gradientStrokeWidth")},{opacity:s("gradientOpacity")}),ni({type:EB,role:Wle,key:fi,from:r,encode:p},i)}const Afe=`datum.${Ll}<=0?"${_c}":datum.${Ll}>=1?"${kc}":"${AB}"`,Efe=`datum.${Ll}<=0?"${Do}":datum.${Ll}>=1?"${Ki}":"${rfe}"`;function D3(e,t,n,i){const r=Un(e,t),s=r.isVertical(),o=Ct(r.gradientThickness()),a=r.gradientLength();let u=r("labelOverlap"),l,c,f,d,h="";const g={enter:l={opacity:xe},update:c={opacity:di,text:{field:H$}},exit:{opacity:xe}};return Rt(g,{fill:r("labelColor"),fillOpacity:r("labelOpacity"),font:r("labelFont"),fontSize:r("labelFontSize"),fontStyle:r("labelFontStyle"),fontWeight:r("labelFontWeight"),limit:Si(e.labelLimit,t.gradientLabelLimit)}),s?(l.align={value:"left"},l.baseline=c.baseline={signal:Efe},f="y",d="x",h="1-"):(l.align=c.align={signal:Afe},l.baseline={value:"top"},f="x",d="y"),l[f]=c[f]={signal:h+"datum."+Ll,mult:a},l[d]=c[d]=o,o.offset=Si(e.labelOffset,t.gradientLabelOffset)||0,u=u?{separation:r("labelSeparation"),method:u,order:"datum."+cv}:void 0,ni({type:Cu,role:sB,style:zh,key:fi,from:i,encode:g,overlap:u},n)}function wfe(e,t,n,i,r){const s=Un(e,t),o=n.entries,a=!!(o&&o.interactive),u=o?o.name:void 0,l=s("clipHeight"),c=s("symbolOffset"),f={data:"value"},d=`(${r}) ? datum.${ofe} : datum.${dv}`,h=l?Ct(l):{field:dv},g=`datum.${cv}`,p=`max(1, ${r})`;let m,y,b,x,v;h.mult=.5,m={enter:y={opacity:xe,x:{signal:d,mult:.5,offset:c},y:h},update:b={opacity:di,x:y.x,y:y.y},exit:{opacity:xe}};let A=null,w=null;e.fill||(A=t.symbolBaseFillColor,w=t.symbolBaseStrokeColor),Rt(m,{fill:s("symbolFillColor",A),shape:s("symbolType"),size:s("symbolSize"),stroke:s("symbolStrokeColor",w),strokeDash:s("symbolDash"),strokeDashOffset:s("symbolDashOffset"),strokeWidth:s("symbolStrokeWidth")},{opacity:s("symbolOpacity")}),Y$.forEach(F=>{e[F]&&(b[F]=y[F]={scale:e[F],field:fi})});const E=ni({type:mfe,role:Vle,key:fi,from:f,clip:l?!0:void 0,encode:m},n.symbols),$=Ct(c);$.offset=s("labelOffset"),m={enter:y={opacity:xe,x:{signal:d,offset:$},y:h},update:b={opacity:di,text:{field:H$},x:y.x,y:y.y},exit:{opacity:xe}},Rt(m,{align:s("labelAlign"),baseline:s("labelBaseline"),fill:s("labelColor"),fillOpacity:s("labelOpacity"),font:s("labelFont"),fontSize:s("labelFontSize"),fontStyle:s("labelFontStyle"),fontWeight:s("labelFontWeight"),limit:s("labelLimit")});const k=ni({type:Cu,role:sB,style:zh,key:fi,from:f,encode:m},n.labels);return m={enter:{noBound:{value:!l},width:xe,height:l?Ct(l):xe,opacity:xe},exit:{opacity:xe},update:b={opacity:di,row:{signal:null},column:{signal:null}}},s.isVertical(!0)?(x=`ceil(item.mark.items.length / ${p})`,b.row.signal=`${g}%${x}`,b.column.signal=`floor(${g} / ${x})`,v={field:["row",g]}):(b.row.signal=`floor(${g} / ${p})`,b.column.signal=`${g} % ${p}`,v={field:g}),b.column.signal=`(${r})?${b.column.signal}:${g}`,i={facet:{data:i,name:"value",groupby:cv}},qd({role:q$,from:i,encode:Dc(m,o,jh),marks:[E,k],name:u,interactive:a,sort:v})}function $fe(e,t){const n=Un(e,t);return{align:n("gridAlign"),columns:n.entryColumns(),center:{row:!0,column:!1},padding:{row:n("rowPadding"),column:n("columnPadding")}}}const J$='item.orient === "left"',Q$='item.orient === "right"',P1=`(${J$} || ${Q$})`,Cfe=`datum.vgrad && ${P1}`,Ffe=L1('"top"','"bottom"','"middle"'),Sfe=L1('"right"','"left"','"center"'),Dfe=`datum.vgrad && ${Q$} ? (${Sfe}) : (${P1} && !(datum.vgrad && ${J$})) ? "left" : ${K$}`,_fe=`item._anchor || (${P1} ? "middle" : "start")`,kfe=`${Cfe} ? (${J$} ? -90 : 90) : 0`,Mfe=`${P1} ? (datum.vgrad ? (${Q$} ? "bottom" : "top") : ${Ffe}) : "top"`;function Ofe(e,t,n,i){const r=Un(e,t),s={enter:{opacity:xe},update:{opacity:di,x:{field:{group:"padding"}},y:{field:{group:"padding"}}},exit:{opacity:xe}};return Rt(s,{orient:r("titleOrient"),_anchor:r("titleAnchor"),anchor:{signal:_fe},angle:{signal:kfe},align:{signal:Dfe},baseline:{signal:Mfe},text:e.title,fill:r("titleColor"),fillOpacity:r("titleOpacity"),font:r("titleFont"),fontSize:r("titleFontSize"),fontStyle:r("titleFontStyle"),fontWeight:r("titleFontWeight"),limit:r("titleLimit"),lineHeight:r("titleLineHeight")},{align:r("titleAlign"),baseline:r("titleBaseline")}),ni({type:Cu,role:Yle,style:V$,from:i,encode:s},n)}function Nfe(e,t){let n;return qe(e)&&(e.signal?n=e.signal:e.path?n="pathShape("+_3(e.path)+")":e.sphere&&(n="geoShape("+_3(e.sphere)+', {type: "Sphere"})')),n?t.signalRef(n):!!e}function _3(e){return qe(e)&&e.signal?e.signal:se(e)}function CB(e){const t=e.role||"";return!t.indexOf("axis")||!t.indexOf("legend")||!t.indexOf("title")?t:e.type===R1?q$:t||j$}function Tfe(e){return{marktype:e.type,name:e.name||void 0,role:e.role||CB(e),zindex:+e.zindex||void 0,aria:e.aria,description:e.description}}function Bfe(e,t){return e&&e.signal?t.signalRef(e.signal):e!==!1}function Z$(e,t){const n=SM(e.type);n||ae("Unrecognized transform type: "+se(e.type));const i=N1(n.type.toLowerCase(),null,FB(n,e,t));return e.signal&&t.addSignal(e.signal,t.proxy(i)),i.metadata=n.metadata||{},i}function FB(e,t,n){const i={},r=e.params.length;for(let s=0;s<r;++s){const o=e.params[s];i[o.name]=Rfe(o,t,n)}return i}function Rfe(e,t,n){const i=e.type,r=t[e.name];if(i==="index")return Lfe(e,t,n);if(r===void 0){e.required&&ae("Missing required "+se(t.type)+" parameter: "+se(e.name));return}else{if(i==="param")return Pfe(e,t,n);if(i==="projection")return n.projectionRef(t[e.name])}return e.array&&!pt(r)?r.map(s=>k3(e,s,n)):k3(e,r,n)}function k3(e,t,n){const i=e.type;if(pt(t))return O3(i)?ae("Expression references can not be signals."):Vb(i)?n.fieldRef(t):N3(i)?n.compareRef(t):n.signalRef(t.signal);{const r=e.expr||Vb(i);return r&&Ife(t)?n.exprRef(t.expr,t.as):r&&zfe(t)?jd(t.field,t.as):O3(i)?Dr(t,n):jfe(i)?Q(n.getData(t).values):Vb(i)?jd(t):N3(i)?n.compareRef(t):t}}function Lfe(e,t,n){return Gi(t.from)||ae('Lookup "from" parameter must be a string literal.'),n.getData(t.from).lookupRef(n,t.key)}function Pfe(e,t,n){const i=t[e.name];return e.array?($t(i)||ae("Expected an array of sub-parameters. Instead: "+se(i)),i.map(r=>M3(e,r,n))):M3(e,i,n)}function M3(e,t,n){const i=e.params.length;let r;for(let o=0;o<i;++o){r=e.params[o];for(const a in r.key)if(r.key[a]!==t[a]){r=null;break}if(r)break}r||ae("Unsupported parameter: "+se(t));const s=it(FB(r,t,n),r.key);return Q(n.add(Bce(s)))}const Ife=e=>e&&e.expr,zfe=e=>e&&e.field,jfe=e=>e==="data",O3=e=>e==="expr",Vb=e=>e==="field",N3=e=>e==="compare";function Ufe(e,t,n){let i,r,s,o,a;return e?(i=e.facet)&&(t||ae("Only group marks can be faceted."),i.field!=null?o=a=$g(i,n):(e.data?a=Q(n.getData(e.data).aggregate):(s=Z$(it({type:"aggregate",groupby:qt(i.groupby)},i.aggregate),n),s.params.key=n.keyRef(i.groupby),s.params.pulse=$g(i,n),o=a=Q(n.add(s))),r=n.keyRef(i.groupby,!0))):o=Q(n.add(Xi(null,[{}]))),o||(o=$g(e,n)),{key:r,pulse:o,parent:a}}function $g(e,t){return e.$ref?e:e.data&&e.data.$ref?e.data:Q(t.getData(e.data).output)}function tu(e,t,n,i,r){this.scope=e,this.input=t,this.output=n,this.values=i,this.aggregate=r,this.index={}}tu.fromEntries=function(e,t){const n=t.length,i=t[n-1],r=t[n-2];let s=t[0],o=null,a=1;for(s&&s.type==="load"&&(s=t[1]),e.add(t[0]);a<n;++a)t[a].params.pulse=Q(t[a-1]),e.add(t[a]),t[a].type==="aggregate"&&(o=t[a]);return new tu(e,s,r,i,o)};function SB(e){return Gi(e)?e:null}function T3(e,t,n){const i=T1(n.op,n.field);let r;if(t.ops){for(let s=0,o=t.as.length;s<o;++s)if(t.as[s]===i)return}else t.ops=["count"],t.fields=[null],t.as=["count"];n.op&&(t.ops.push((r=n.op.signal)?e.signalRef(r):n.op),t.fields.push(e.fieldRef(n.field)),t.as.push(i))}function af(e,t,n,i,r,s,o){const a=t[n]||(t[n]={}),u=fce(s);let l=SB(r),c,f;if(l!=null&&(e=t.scope,l=l+(u?"|"+u:""),c=a[l]),!c){const d=s?{field:av,pulse:t.countsRef(e,r,s)}:{field:e.fieldRef(r),pulse:Q(t.output)};u&&(d.sort=e.sortRef(s)),f=e.add(N1(i,void 0,d)),o&&(t.index[r]=f),c=Q(f),l!=null&&(a[l]=c)}return c}tu.prototype={countsRef(e,t,n){const i=this,r=i.counts||(i.counts={}),s=SB(t);let o,a,u;return s!=null&&(e=i.scope,o=r[s]),o?n&&n.field&&T3(e,o.agg.params,n):(u={groupby:e.fieldRef(t,"key"),pulse:Q(i.output)},n&&n.field&&T3(e,u,n),a=e.add(fB(u)),o=e.add(Xi({pulse:Q(a)})),o={agg:a,ref:Q(o)},s!=null&&(r[s]=o)),o.ref},tuplesRef(){return Q(this.values)},extentRef(e,t){return af(e,this,"extent","extent",t,!1)},domainRef(e,t){return af(e,this,"domain","values",t,!1)},valuesRef(e,t,n){return af(e,this,"vals","values",t,n||!0)},lookupRef(e,t){return af(e,this,"lookup","tupleindex",t,!1)},indataRef(e,t){return af(e,this,"indata","tupleindex",t,!0,!0)}};function qfe(e,t,n){const i=e.from.facet,r=i.name,s=$g(i,t);let o;i.name||ae("Facet must have a name: "+se(i)),i.data||ae("Facet must reference a data set: "+se(i)),i.field?o=t.add(gB({field:t.fieldRef(i.field),pulse:s})):i.groupby?o=t.add(Fce({key:t.keyRef(i.groupby),group:Q(t.proxy(n.parent)),pulse:s})):ae("Facet must specify groupby or field: "+se(i));const a=t.fork(),u=a.add(Xi()),l=a.add($u({pulse:Q(u)}));a.addData(r,new tu(a,u,u,l)),a.addSignal("parent",null),o.params.subflow={$subflow:a.parse(e).toRuntime()}}function Wfe(e,t,n){const i=t.add(gB({pulse:n.pulse})),r=t.fork();r.add($u()),r.addSignal("parent",null),i.params.subflow={$subflow:r.parse(e).toRuntime()}}function DB(e,t,n){const i=e.remove,r=e.insert,s=e.toggle,o=e.modify,a=e.values,u=t.add(Jp()),l="if("+e.trigger+',modify("'+n+'",'+[r,i,s,o,a].map(f=>f??"null").join(",")+"),0)",c=Dr(l,t);u.update=c.$expr,u.params=c.$params}function I1(e,t){const n=CB(e),i=e.type===R1,r=e.from&&e.from.facet,s=e.overlap;let o=e.layout||n===q$||n===U$,a,u,l,c,f,d,h;const g=n===j$||o||r,p=Ufe(e.from,i,t);u=t.add($ce({key:p.key||(e.key?jd(e.key):void 0),pulse:p.pulse,clean:!i}));const m=Q(u);u=l=t.add(Xi({pulse:m})),u=t.add(Mce({markdef:Tfe(e),interactive:Bfe(e.interactive,t),clip:Nfe(e.clip,t),context:{$context:!0},groups:t.lookup(),parent:t.signals.parent?t.signalRef("parent"):null,index:t.markpath(),pulse:Q(u)}));const y=Q(u);u=c=t.add(hB(lB(e.encode,e.type,n,e.style,t,{mod:!1,pulse:y}))),u.params.parent=t.encode(),e.transform&&e.transform.forEach(w=>{const E=Z$(w,t),$=E.metadata;($.generates||$.changes)&&ae("Mark transforms should not generate new data."),$.nomod||(c.params.mod=!0),E.params.pulse=Q(u),t.add(u=E)}),e.sort&&(u=t.add(zce({sort:t.compareRef(e.sort),pulse:Q(u)})));const b=Q(u);(r||o)&&(o=t.add(mB({layout:t.objectProperty(e.layout),legends:t.legends,mark:y,pulse:b})),d=Q(o));const x=t.add(dB({mark:y,pulse:d||b}));h=Q(x),i&&(g&&(a=t.operators,a.pop(),o&&a.pop()),t.pushState(b,d||h,m),r?qfe(e,t,p):g?Wfe(e,t,p):t.parse(e),t.popState(),g&&(o&&a.push(o),a.push(x))),s&&(h=Gfe(s,h,t));const v=t.add(pB({pulse:h})),A=t.add($u({pulse:Q(v)},void 0,t.parent()));e.name!=null&&(f=e.name,t.addData(f,new tu(t,l,v,A)),e.on&&e.on.forEach(w=>{(w.insert||w.remove||w.toggle)&&ae("Marks only support modify triggers."),DB(w,t,f)}))}function Gfe(e,t,n){const i=e.method,r=e.bound,s=e.separation,o={separation:pt(s)?n.signalRef(s.signal):s,method:pt(i)?n.signalRef(i.signal):i,pulse:t};if(e.order&&(o.sort=n.compareRef({field:e.order})),r){const a=r.tolerance;o.boundTolerance=pt(a)?n.signalRef(a.signal):+a,o.boundScale=n.scaleRef(r.scale),o.boundOrient=r.orient}return Q(n.add(Tce(o)))}function Hfe(e,t){const n=t.config.legend,i=e.encode||{},r=Un(e,n),s=i.legend||{},o=s.name||void 0,a=s.interactive,u=s.style,l={};let c=0,f,d,h;Y$.forEach(x=>e[x]?(l[x]=e[x],c=c||e[x]):0),c||ae("Missing valid scale for legend.");const g=Vfe(e,t.scaleType(c)),p={title:e.title!=null,scales:l,type:g,vgrad:g!=="symbol"&&r.isVertical()},m=Q(t.add(Xi(null,[p]))),y={enter:{x:{value:0},y:{value:0}}},b=Q(t.add(_ce(d={type:g,scale:t.scaleRef(c),count:t.objectProperty(r("tickCount")),limit:t.property(r("symbolLimit")),values:t.objectProperty(e.values),minstep:t.property(e.tickMinStep),formatType:t.property(e.formatType),formatSpecifier:t.property(e.format)})));return g===wg?(h=[xfe(e,c,n,i.gradient),D3(e,n,i.labels,b)],d.count=d.count||t.signalRef(`max(2,2*floor((${ja(r.gradientLength())})/100))`)):g===fv?h=[vfe(e,c,n,i.gradient,b),D3(e,n,i.labels,b)]:(f=$fe(e,n),h=[wfe(e,n,i,b,ja(f.columns))],d.size=Kfe(e,t,h[0].marks)),h=[qd({role:Gle,from:m,encode:y,marks:h,layout:f,interactive:a})],p.title&&h.push(Ofe(e,n,i.title,m)),I1(qd({role:qle,from:m,encode:Dc(Xfe(r,e,n),s,jh),marks:h,aria:r("aria"),description:r("description"),zindex:r("zindex"),name:o,interactive:a,style:u}),t)}function Vfe(e,t){let n=e.type||S3;return!e.type&&Yfe(e)===1&&(e.fill||e.stroke)&&(n=PE(t)?wg:tx(t)?fv:S3),n!==wg?n:tx(t)?fv:wg}function Yfe(e){return Y$.reduce((t,n)=>t+(e[n]?1:0),0)}function Xfe(e,t,n){const i={enter:{},update:{}};return Rt(i,{orient:e("orient"),offset:e("offset"),padding:e("padding"),titlePadding:e("titlePadding"),cornerRadius:e("cornerRadius"),fill:e("fillColor"),stroke:e("strokeColor"),strokeWidth:n.strokeWidth,strokeDash:n.strokeDash,x:e("legendX"),y:e("legendY"),format:t.format,formatType:t.formatType}),i}function Kfe(e,t,n){const i=ja(B3("size",e,n)),r=ja(B3("strokeWidth",e,n)),s=ja(Jfe(n[1].encode,t,zh));return Dr(`max(ceil(sqrt(${i})+${r}),${s})`,t)}function B3(e,t,n){return t[e]?`scale("${t[e]}",datum)`:wB(e,n[0].encode)}function Jfe(e,t,n){return wB("fontSize",e)||yfe("fontSize",t,n)}const Qfe=`item.orient==="${_c}"?-90:item.orient==="${kc}"?90:0`;function Zfe(e,t){e=Gi(e)?{text:e}:e;const n=Un(e,t.config.title),i=e.encode||{},r=i.group||{},s=r.name||void 0,o=r.interactive,a=r.style,u=[],l={},c=Q(t.add(Xi(null,[l])));return u.push(nde(e,n,ede(e),c)),e.subtitle&&u.push(ide(e,n,i.subtitle,c)),I1(qd({role:Xle,from:c,encode:tde(n,r),marks:u,aria:n("aria"),description:n("description"),zindex:n("zindex"),name:s,interactive:o,style:a}),t)}function ede(e){const t=e.encode;return t&&t.title||it({name:e.name,interactive:e.interactive,style:e.style},t)}function tde(e,t){const n={enter:{},update:{}};return Rt(n,{orient:e("orient"),anchor:e("anchor"),align:{signal:K$},angle:{signal:Qfe},limit:e("limit"),frame:e("frame"),offset:e("offset")||0,padding:e("subtitlePadding")}),Dc(n,t,jh)}function nde(e,t,n,i){const r={value:0},s=e.text,o={enter:{opacity:r},update:{opacity:{value:1}},exit:{opacity:r}};return Rt(o,{text:s,align:{signal:"item.mark.group.align"},angle:{signal:"item.mark.group.angle"},limit:{signal:"item.mark.group.limit"},baseline:"top",dx:t("dx"),dy:t("dy"),fill:t("color"),font:t("font"),fontSize:t("fontSize"),fontStyle:t("fontStyle"),fontWeight:t("fontWeight"),lineHeight:t("lineHeight")},{align:t("align"),angle:t("angle"),baseline:t("baseline")}),ni({type:Cu,role:Kle,style:ufe,from:i,encode:o},n)}function ide(e,t,n,i){const r={value:0},s=e.subtitle,o={enter:{opacity:r},update:{opacity:{value:1}},exit:{opacity:r}};return Rt(o,{text:s,align:{signal:"item.mark.group.align"},angle:{signal:"item.mark.group.angle"},limit:{signal:"item.mark.group.limit"},baseline:"top",dx:t("dx"),dy:t("dy"),fill:t("subtitleColor"),font:t("subtitleFont"),fontSize:t("subtitleFontSize"),fontStyle:t("subtitleFontStyle"),fontWeight:t("subtitleFontWeight"),lineHeight:t("subtitleLineHeight")},{align:t("align"),angle:t("angle"),baseline:t("baseline")}),ni({type:Cu,role:Jle,style:lfe,from:i,encode:o},n)}function rde(e,t){const n=[];e.transform&&e.transform.forEach(i=>{n.push(Z$(i,t))}),e.on&&e.on.forEach(i=>{DB(i,t,e.name)}),t.addDataPipeline(e.name,sde(e,t,n))}function sde(e,t,n){const i=[];let r=null,s=!1,o=!1,a,u,l,c,f;for(e.values?pt(e.values)||Ag(e.format)?(i.push(R3(t,e)),i.push(r=aa())):i.push(r=aa({$ingest:e.values,$format:e.format})):e.url?Ag(e.url)||Ag(e.format)?(i.push(R3(t,e)),i.push(r=aa())):i.push(r=aa({$request:e.url,$format:e.format})):e.source&&(r=a=qt(e.source).map(d=>Q(t.getData(d).output)),i.push(null)),u=0,l=n.length;u<l;++u)c=n[u],f=c.metadata,!r&&!f.source&&i.push(r=aa()),i.push(c),f.generates&&(o=!0),f.modifies&&!o&&(s=!0),f.source?r=c:f.changes&&(r=null);return a&&(l=a.length-1,i[0]=Pce({derive:s,pulse:l?a:a[0]}),(s||l)&&i.splice(1,0,aa())),r||i.push(aa()),i.push($u({})),i}function aa(e){const t=Xi({},e);return t.metadata={source:!0},t}function R3(e,t){return kce({url:t.url?e.property(t.url):void 0,async:t.async?e.property(t.async):void 0,values:t.values?e.property(t.values):void 0,format:e.objectProperty(t.format)})}const _B=e=>e===Do||e===Ki,z1=(e,t,n)=>pt(e)?lde(e.signal,t,n):e===_c||e===Ki?t:n,Ft=(e,t,n)=>pt(e)?ade(e.signal,t,n):_B(e)?t:n,zi=(e,t,n)=>pt(e)?ude(e.signal,t,n):_B(e)?n:t,kB=(e,t,n)=>pt(e)?cde(e.signal,t,n):e===Ki?{value:t}:{value:n},ode=(e,t,n)=>pt(e)?fde(e.signal,t,n):e===kc?{value:t}:{value:n},ade=(e,t,n)=>MB(`${e} === '${Ki}' || ${e} === '${Do}'`,t,n),ude=(e,t,n)=>MB(`${e} !== '${Ki}' && ${e} !== '${Do}'`,t,n),lde=(e,t,n)=>eC(`${e} === '${_c}' || ${e} === '${Ki}'`,t,n),cde=(e,t,n)=>eC(`${e} === '${Ki}'`,t,n),fde=(e,t,n)=>eC(`${e} === '${kc}'`,t,n),MB=(e,t,n)=>(t=t!=null?Ct(t):t,n=n!=null?Ct(n):n,L3(t)&&L3(n)?(t=t?t.signal||se(t.value):null,n=n?n.signal||se(n.value):null,{signal:`${e} ? (${t}) : (${n})`}):[it({test:e},t)].concat(n||[])),L3=e=>e==null||Object.keys(e).length===1,eC=(e,t,n)=>({signal:`${e} ? (${el(t)}) : (${el(n)})`}),dde=(e,t,n,i,r)=>({signal:(i!=null?`${e} === '${_c}' ? (${el(i)}) : `:"")+(n!=null?`${e} === '${Do}' ? (${el(n)}) : `:"")+(r!=null?`${e} === '${kc}' ? (${el(r)}) : `:"")+(t!=null?`${e} === '${Ki}' ? (${el(t)}) : `:"")+"(null)"}),el=e=>pt(e)?e.signal:e==null?null:se(e),hde=(e,t)=>t===0?0:pt(e)?{signal:`(${e.signal}) * ${t}`}:{value:e*t},ul=(e,t)=>{const n=e.signal;return n&&n.endsWith("(null)")?{signal:n.slice(0,-6)+t.signal}:e};function Uu(e,t,n,i){let r;if(t&&Vn(t,e))return t[e];if(Vn(n,e))return n[e];if(e.startsWith("title")){switch(e){case"titleColor":r="fill";break;case"titleFont":case"titleFontSize":case"titleFontWeight":r=e[5].toLowerCase()+e.slice(6)}return i[V$][r]}else if(e.startsWith("label")){switch(e){case"labelColor":r="fill";break;case"labelFont":case"labelFontSize":r=e[5].toLowerCase()+e.slice(6)}return i[zh][r]}return null}function P3(e){const t={};for(const n of e)if(n)for(const i in n)t[i]=1;return Object.keys(t)}function gde(e,t){var n=t.config,i=n.style,r=n.axis,s=t.scaleType(e.scale)==="band"&&n.axisBand,o=e.orient,a,u,l;if(pt(o)){const f=P3([n.axisX,n.axisY]),d=P3([n.axisTop,n.axisBottom,n.axisLeft,n.axisRight]);a={};for(l of f)a[l]=Ft(o,Uu(l,n.axisX,r,i),Uu(l,n.axisY,r,i));u={};for(l of d)u[l]=dde(o.signal,Uu(l,n.axisTop,r,i),Uu(l,n.axisBottom,r,i),Uu(l,n.axisLeft,r,i),Uu(l,n.axisRight,r,i))}else a=o===Ki||o===Do?n.axisX:n.axisY,u=n["axis"+o[0].toUpperCase()+o.slice(1)];return a||u||s?it({},r,a,u,s):r}function pde(e,t,n,i){const r=Un(e,t),s=e.orient;let o,a;const u={enter:o={opacity:xe},update:a={opacity:di},exit:{opacity:xe}};Rt(u,{stroke:r("domainColor"),strokeCap:r("domainCap"),strokeDash:r("domainDash"),strokeDashOffset:r("domainDashOffset"),strokeWidth:r("domainWidth"),strokeOpacity:r("domainOpacity")});const l=I3(e,0),c=I3(e,1);return o.x=a.x=Ft(s,l,xe),o.x2=a.x2=Ft(s,c),o.y=a.y=zi(s,l,xe),o.y2=a.y2=zi(s,c),ni({type:X$,role:Ple,from:i,encode:u},n)}function I3(e,t){return{scale:e.scale,range:t}}function mde(e,t,n,i,r){const s=Un(e,t),o=e.orient,a=e.gridScale,u=z1(o,1,-1),l=yde(e.offset,u);let c,f,d;const h={enter:c={opacity:xe},update:d={opacity:di},exit:f={opacity:xe}};Rt(h,{stroke:s("gridColor"),strokeCap:s("gridCap"),strokeDash:s("gridDash"),strokeDashOffset:s("gridDashOffset"),strokeOpacity:s("gridOpacity"),strokeWidth:s("gridWidth")});const g={scale:e.scale,field:fi,band:r.band,extra:r.extra,offset:r.offset,round:s("tickRound")},p=Ft(o,{signal:"height"},{signal:"width"}),m=a?{scale:a,range:0,mult:u,offset:l}:{value:0,offset:l},y=a?{scale:a,range:1,mult:u,offset:l}:it(p,{mult:u,offset:l});return c.x=d.x=Ft(o,g,m),c.y=d.y=zi(o,g,m),c.x2=d.x2=zi(o,y),c.y2=d.y2=Ft(o,y),f.x=Ft(o,g),f.y=zi(o,g),ni({type:X$,role:Ile,key:fi,from:i,encode:h},n)}function yde(e,t){if(t!==1)if(!qe(e))e=pt(t)?{signal:`(${t.signal}) * (${e||0})`}:t*(e||0);else{let n=e=it({},e);for(;n.mult!=null;)if(qe(n.mult))n=n.mult=it({},n.mult);else return n.mult=pt(t)?{signal:`(${n.mult}) * (${t.signal})`}:n.mult*t,e;n.mult=t}return e}function bde(e,t,n,i,r,s){const o=Un(e,t),a=e.orient,u=z1(a,-1,1);let l,c,f;const d={enter:l={opacity:xe},update:f={opacity:di},exit:c={opacity:xe}};Rt(d,{stroke:o("tickColor"),strokeCap:o("tickCap"),strokeDash:o("tickDash"),strokeDashOffset:o("tickDashOffset"),strokeOpacity:o("tickOpacity"),strokeWidth:o("tickWidth")});const h=Ct(r);h.mult=u;const g={scale:e.scale,field:fi,band:s.band,extra:s.extra,offset:s.offset,round:o("tickRound")};return f.y=l.y=Ft(a,xe,g),f.y2=l.y2=Ft(a,h),c.x=Ft(a,g),f.x=l.x=zi(a,xe,g),f.x2=l.x2=zi(a,h),c.y=zi(a,g),ni({type:X$,role:jle,key:fi,from:i,encode:d},n)}function Yb(e,t,n,i,r){return{signal:'flush(range("'+e+'"), scale("'+e+'", datum.value), '+t+","+n+","+i+","+r+")"}}function xde(e,t,n,i,r,s){const o=Un(e,t),a=e.orient,u=e.scale,l=z1(a,-1,1),c=ja(o("labelFlush")),f=ja(o("labelFlushOffset")),d=o("labelAlign"),h=o("labelBaseline");let g=c===0||!!c,p;const m=Ct(r);m.mult=l,m.offset=Ct(o("labelPadding")||0),m.offset.mult=l;const y={scale:u,field:fi,band:.5,offset:$B(s.offset,o("labelOffset"))},b=Ft(a,g?Yb(u,c,'"left"','"right"','"center"'):{value:"center"},ode(a,"left","right")),x=Ft(a,kB(a,"bottom","top"),g?Yb(u,c,'"top"','"bottom"','"middle"'):{value:"middle"}),v=Yb(u,c,`-(${f})`,f,0);g=g&&f;const A={opacity:xe,x:Ft(a,y,m),y:zi(a,y,m)},w={enter:A,update:p={opacity:di,text:{field:H$},x:A.x,y:A.y,align:b,baseline:x},exit:{opacity:xe,x:A.x,y:A.y}};Rt(w,{dx:!d&&g?Ft(a,v):null,dy:!h&&g?zi(a,v):null}),Rt(w,{angle:o("labelAngle"),fill:o("labelColor"),fillOpacity:o("labelOpacity"),font:o("labelFont"),fontSize:o("labelFontSize"),fontWeight:o("labelFontWeight"),fontStyle:o("labelFontStyle"),limit:o("labelLimit"),lineHeight:o("labelLineHeight")},{align:d,baseline:h});const E=o("labelBound");let $=o("labelOverlap");return $=$||E?{separation:o("labelSeparation"),method:$,order:"datum.index",bound:E?{scale:u,orient:a,tolerance:E}:null}:void 0,p.align!==b&&(p.align=ul(p.align,b)),p.baseline!==x&&(p.baseline=ul(p.baseline,x)),ni({type:Cu,role:zle,style:zh,key:fi,from:i,encode:w,overlap:$},n)}function vde(e,t,n,i){const r=Un(e,t),s=e.orient,o=z1(s,-1,1);let a,u;const l={enter:a={opacity:xe,anchor:Ct(r("titleAnchor",null)),align:{signal:K$}},update:u=it({},a,{opacity:di,text:Ct(e.title)}),exit:{opacity:xe}},c={signal:`lerp(range("${e.scale}"), ${L1(0,1,.5)})`};return u.x=Ft(s,c),u.y=zi(s,c),a.angle=Ft(s,xe,hde(o,90)),a.baseline=Ft(s,kB(s,Do,Ki),{value:Do}),u.angle=a.angle,u.baseline=a.baseline,Rt(l,{fill:r("titleColor"),fillOpacity:r("titleOpacity"),font:r("titleFont"),fontSize:r("titleFontSize"),fontStyle:r("titleFontStyle"),fontWeight:r("titleFontWeight"),limit:r("titleLimit"),lineHeight:r("titleLineHeight")},{align:r("titleAlign"),angle:r("titleAngle"),baseline:r("titleBaseline")}),Ade(r,s,l,n),l.update.align=ul(l.update.align,a.align),l.update.angle=ul(l.update.angle,a.angle),l.update.baseline=ul(l.update.baseline,a.baseline),ni({type:Cu,role:Ule,style:V$,from:i,encode:l},n)}function Ade(e,t,n,i){const r=(a,u)=>a!=null?(n.update[u]=ul(Ct(a),n.update[u]),!1):!Yu(u,i),s=r(e("titleX"),"x"),o=r(e("titleY"),"y");n.enter.auto=o===s?Ct(o):Ft(t,Ct(o),Ct(s))}function Ede(e,t){const n=gde(e,t),i=e.encode||{},r=i.axis||{},s=r.name||void 0,o=r.interactive,a=r.style,u=Un(e,n),l=bfe(u),c={scale:e.scale,ticks:!!u("ticks"),labels:!!u("labels"),grid:!!u("grid"),domain:!!u("domain"),title:e.title!=null},f=Q(t.add(Xi({},[c]))),d=Q(t.add(wce({scale:t.scaleRef(e.scale),extra:t.property(l.extra),count:t.objectProperty(e.tickCount),values:t.objectProperty(e.values),minstep:t.property(e.tickMinStep),formatType:t.property(e.formatType),formatSpecifier:t.property(e.format)}))),h=[];let g;return c.grid&&h.push(mde(e,n,i.grid,d,l)),c.ticks&&(g=u("tickSize"),h.push(bde(e,n,i.ticks,d,g,l))),c.labels&&(g=c.ticks?g:0,h.push(xde(e,n,i.labels,d,g,l))),c.domain&&h.push(pde(e,n,i.domain,f)),c.title&&h.push(vde(e,n,i.title,f)),I1(qd({role:Lle,from:f,encode:Dc(wde(u,e),r,jh),marks:h,aria:u("aria"),description:u("description"),zindex:u("zindex"),name:s,interactive:o,style:a}),t)}function wde(e,t){const n={enter:{},update:{}};return Rt(n,{orient:e("orient"),offset:e("offset")||0,position:Si(t.position,0),titlePadding:e("titlePadding"),minExtent:e("minExtent"),maxExtent:e("maxExtent"),range:{signal:`abs(span(range("${t.scale}")))`},translate:e("translate"),format:t.format,formatType:t.formatType}),n}function OB(e,t,n){const i=qt(e.signals),r=qt(e.scales);return n||i.forEach(s=>cB(s,t)),qt(e.projections).forEach(s=>tfe(s,t)),r.forEach(s=>qce(s,t)),qt(e.data).forEach(s=>rde(s,t)),r.forEach(s=>Wce(s,t)),(n||i).forEach(s=>Ece(s,t)),qt(e.axes).forEach(s=>Ede(s,t)),qt(e.marks).forEach(s=>I1(s,t)),qt(e.legends).forEach(s=>Hfe(s,t)),e.title&&Zfe(e.title,t),t.parseLambdas(),t}const $de=e=>Dc({enter:{x:{value:0},y:{value:0}},update:{width:{signal:"width"},height:{signal:"height"}}},e);function Cde(e,t){const n=t.config,i=Q(t.root=t.add(Jp())),r=Fde(e,n);r.forEach(l=>cB(l,t)),t.description=e.description||n.description,t.eventConfig=n.events,t.legends=t.objectProperty(n.legend&&n.legend.layout),t.locale=n.locale;const s=t.add(Xi()),o=t.add(hB(lB($de(e.encode),R1,U$,e.style,t,{pulse:Q(s)}))),a=t.add(mB({layout:t.objectProperty(e.layout),legends:t.legends,autosize:t.signalRef("autosize"),mark:i,pulse:Q(o)}));t.operators.pop(),t.pushState(Q(o),Q(a),null),OB(e,t,r),t.operators.push(a);let u=t.add(dB({mark:i,pulse:Q(a)}));return u=t.add(pB({pulse:Q(u)})),u=t.add($u({pulse:Q(u)})),t.addData("root",new tu(t,s,s,u)),t}function uf(e,t){return t&&t.signal?{name:e,update:t.signal}:{name:e,value:t}}function Fde(e,t){const n=o=>Si(e[o],t[o]),i=[uf("background",n("background")),uf("autosize",Tle(n("autosize"))),uf("padding",Rle(n("padding"))),uf("width",n("width")||0),uf("height",n("height")||0)],r=i.reduce((o,a)=>(o[a.name]=a,o),{}),s={};return qt(e.signals).forEach(o=>{Vn(r,o.name)?o=it(r[o.name],o):i.push(o),s[o.name]=o}),qt(t.signals).forEach(o=>{!Vn(s,o.name)&&!Vn(r,o.name)&&i.push(o)}),i}function NB(e,t){this.config=e||{},this.options=t||{},this.bindings=[],this.field={},this.signals={},this.lambdas={},this.scales={},this.events={},this.data={},this.streams=[],this.updates=[],this.operators=[],this.eventConfig=null,this.locale=null,this._id=0,this._subid=0,this._nextsub=[0],this._parent=[],this._encode=[],this._lookup=[],this._markpath=[]}function z3(e){this.config=e.config,this.options=e.options,this.legends=e.legends,this.field=Object.create(e.field),this.signals=Object.create(e.signals),this.lambdas=Object.create(e.lambdas),this.scales=Object.create(e.scales),this.events=Object.create(e.events),this.data=Object.create(e.data),this.streams=[],this.updates=[],this.operators=[],this._id=0,this._subid=++e._nextsub[0],this._nextsub=e._nextsub,this._parent=e._parent.slice(),this._encode=e._encode.slice(),this._lookup=e._lookup.slice(),this._markpath=e._markpath}NB.prototype=z3.prototype={parse(e){return OB(e,this)},fork(){return new z3(this)},isSubscope(){return this._subid>0},toRuntime(){return this.finish(),{description:this.description,operators:this.operators,streams:this.streams,updates:this.updates,bindings:this.bindings,eventConfig:this.eventConfig,locale:this.locale}},id(){return(this._subid?this._subid+":":0)+this._id++},add(e){return this.operators.push(e),e.id=this.id(),e.refs&&(e.refs.forEach(t=>{t.$ref=e.id}),e.refs=null),e},proxy(e){const t=e instanceof ov?Q(e):e;return this.add(Lce({value:t}))},addStream(e){return this.streams.push(e),e.id=this.id(),e},addUpdate(e){return this.updates.push(e),e},finish(){let e,t;this.root&&(this.root.root=!0);for(e in this.signals)this.signals[e].signal=e;for(e in this.scales)this.scales[e].scale=e;function n(i,r,s){let o,a;i&&(o=i.data||(i.data={}),a=o[r]||(o[r]=[]),a.push(s))}for(e in this.data){t=this.data[e],n(t.input,e,"input"),n(t.output,e,"output"),n(t.values,e,"values");for(const i in t.index)n(t.index[i],e,"index:"+i)}return this},pushState(e,t,n){this._encode.push(Q(this.add($u({pulse:e})))),this._parent.push(t),this._lookup.push(n?Q(this.proxy(n)):null),this._markpath.push(-1)},popState(){this._encode.pop(),this._parent.pop(),this._lookup.pop(),this._markpath.pop()},parent(){return td(this._parent)},encode(){return td(this._encode)},lookup(){return td(this._lookup)},markpath(){const e=this._markpath;return++e[e.length-1]},fieldRef(e,t){if(Gi(e))return jd(e,t);e.signal||ae("Unsupported field reference: "+se(e));const n=e.signal;let i=this.field[n];if(!i){const r={name:this.signalRef(n)};t&&(r.as=t),this.field[n]=i=Q(this.add(Sce(r)))}return i},compareRef(e){let t=!1;const n=s=>pt(s)?(t=!0,this.signalRef(s.signal)):dce(s)?(t=!0,this.exprRef(s.expr)):s,i=qt(e.field).map(n),r=qt(e.order).map(n);return t?Q(this.add(F3({fields:i,orders:r}))):$3(i,r)},keyRef(e,t){let n=!1;const i=s=>pt(s)?(n=!0,Q(r[s.signal])):s,r=this.signals;return e=qt(e).map(i),n?Q(this.add(Dce({fields:e,flat:t}))):uce(e,t)},sortRef(e){if(!e)return e;const t=T1(e.op,e.field),n=e.order||lce;return n.signal?Q(this.add(F3({fields:t,orders:this.signalRef(n.signal)}))):$3(t,n)},event(e,t){const n=e+":"+t;if(!this.events[n]){const i=this.id();this.streams.push({id:i,source:e,type:t}),this.events[n]=i}return this.events[n]},hasOwnSignal(e){return Vn(this.signals,e)},addSignal(e,t){this.hasOwnSignal(e)&&ae("Duplicate signal name: "+se(e));const n=t instanceof ov?t:this.add(Jp(t));return this.signals[e]=n},getSignal(e){return this.signals[e]||ae("Unrecognized signal name: "+se(e)),this.signals[e]},signalRef(e){return this.signals[e]?Q(this.signals[e]):(Vn(this.lambdas,e)||(this.lambdas[e]=this.add(Jp(null))),Q(this.lambdas[e]))},parseLambdas(){const e=Object.keys(this.lambdas);for(let t=0,n=e.length;t<n;++t){const i=e[t],r=Dr(i,this),s=this.lambdas[i];s.params=r.$params,s.update=r.$expr}},property(e){return e&&e.signal?this.signalRef(e.signal):e},objectProperty(e){return!e||!qe(e)?e:this.signalRef(e.signal||tC(e))},exprRef(e,t){const n={expr:Dr(e,this)};return t&&(n.expr.$name=t),Q(this.add(Cce(n)))},addBinding(e,t){this.bindings||ae("Nested signals do not support binding: "+se(e)),this.bindings.push(it({signal:e},t))},addScaleProj(e,t){Vn(this.scales,e)&&ae("Duplicate scale or projection name: "+se(e)),this.scales[e]=this.add(t)},addScale(e,t){this.addScaleProj(e,Ice(t))},addProjection(e,t){this.addScaleProj(e,Rce(t))},getScale(e){return this.scales[e]||ae("Unrecognized scale name: "+se(e)),this.scales[e]},scaleRef(e){return Q(this.getScale(e))},scaleType(e){return this.getScale(e).params.type},projectionRef(e){return this.scaleRef(e)},projectionType(e){return this.scaleType(e)},addData(e,t){return Vn(this.data,e)&&ae("Duplicate data set name: "+se(e)),this.data[e]=t},getData(e){return this.data[e]||ae("Undefined data set name: "+se(e)),this.data[e]},addDataPipeline(e,t){return Vn(this.data,e)&&ae("Duplicate data set name: "+se(e)),this.addData(e,tu.fromEntries(this,t))}};function tC(e){return($t(e)?Sde:Dde)(e)}function Sde(e){const t=e.length;let n="[";for(let i=0;i<t;++i){const r=e[i];n+=(i>0?",":"")+(qe(r)?r.signal||tC(r):se(r))}return n+"]"}function Dde(e){let t="{",n=0,i,r;for(i in e)r=e[i],t+=(++n>1?",":"")+se(i)+":"+(qe(r)?r.signal||tC(r):se(r));return t+"}"}function _de(){const e="sans-serif",i="#4c78a8",r="#000",s="#888",o="#ddd";return{description:"Vega visualization",padding:0,autosize:"pad",background:null,events:{defaults:{allow:["wheel"]}},group:null,mark:null,arc:{fill:i},area:{fill:i},image:null,line:{stroke:i,strokeWidth:2},path:{stroke:i},rect:{fill:i},rule:{stroke:r},shape:{stroke:i},symbol:{fill:i,size:64},text:{fill:r,font:e,fontSize:11},trail:{fill:i,size:2},style:{"guide-label":{fill:r,font:e,fontSize:10},"guide-title":{fill:r,font:e,fontSize:11,fontWeight:"bold"},"group-title":{fill:r,font:e,fontSize:13,fontWeight:"bold"},"group-subtitle":{fill:r,font:e,fontSize:12},point:{size:30,strokeWidth:2,shape:"circle"},circle:{size:30,strokeWidth:2},square:{size:30,strokeWidth:2,shape:"square"},cell:{fill:"transparent",stroke:o},view:{fill:"transparent"}},title:{orient:"top",anchor:"middle",offset:4,subtitlePadding:3},axis:{minExtent:0,maxExtent:200,bandPosition:.5,domain:!0,domainWidth:1,domainColor:s,grid:!1,gridWidth:1,gridColor:o,labels:!0,labelAngle:0,labelLimit:180,labelOffset:0,labelPadding:2,ticks:!0,tickColor:s,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:o,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:s,titleLimit:180,titleOrient:"top",titlePadding:5,layout:{offset:18,direction:"horizontal",left:{direction:"vertical"},right:{direction:"vertical"}}},range:{category:{scheme:"tableau10"},ordinal:{scheme:"blues"},heatmap:{scheme:"yellowgreenblue"},ramp:{scheme:"blues"},diverging:{scheme:"blueorange",extent:[1,0]},symbol:["circle","square","triangle-up","cross","diamond","triangle-right","triangle-down","triangle-left"]}}}function kde(e,t,n){return qe(e)||ae("Input Vega specification must be an object."),t=vle(_de(),t,e.config),Cde(e,new NB(t,n)).toRuntime()}const Mde="RawCode",Ode="Literal",Nde="Property",Tde="Identifier",Bde="ArrayExpression",Rde="BinaryExpression",Lde="CallExpression",Pde="ConditionalExpression",Ide="LogicalExpression",zde="MemberExpression",jde="ObjectExpression",Ude="UnaryExpression";function Ji(e){this.type=e}Ji.prototype.visit=function(e){let t,n,i;if(e(this))return 1;for(t=qde(this),n=0,i=t.length;n<i;++n)if(t[n].visit(e))return 1};function qde(e){switch(e.type){case Bde:return e.elements;case Rde:case Ide:return[e.left,e.right];case Lde:return[e.callee].concat(e.arguments);case Pde:return[e.test,e.consequent,e.alternate];case zde:return[e.object,e.property];case jde:return e.properties;case Nde:return[e.key,e.value];case Ude:return[e.argument];case Tde:case Ode:case Mde:default:return[]}}var jr,Y,L,Jt,Ne,j1=1,Uh=2,nu=3,qo=4,U1=5,Fu=6,$n=7,qh=8,Wde=9;jr={};jr[j1]="Boolean";jr[Uh]="<end>";jr[nu]="Identifier";jr[qo]="Keyword";jr[U1]="Null";jr[Fu]="Numeric";jr[$n]="Punctuator";jr[qh]="String";jr[Wde]="RegularExpression";var Gde="ArrayExpression",Hde="BinaryExpression",Vde="CallExpression",Yde="ConditionalExpression",TB="Identifier",Xde="Literal",Kde="LogicalExpression",Jde="MemberExpression",Qde="ObjectExpression",Zde="Property",ehe="UnaryExpression",St="Unexpected token %0",the="Unexpected number",nhe="Unexpected string",ihe="Unexpected identifier",rhe="Unexpected reserved word",she="Unexpected end of input",hv="Invalid regular expression",Xb="Invalid regular expression: missing /",BB="Octal literals are not allowed in strict mode.",ohe="Duplicate data property in object literal not allowed in strict mode",Ot="ILLEGAL",Wd="Disabled.",ahe=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]"),uhe=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 q1(e,t){if(!e)throw new Error("ASSERT: "+t)}function rs(e){return e>=48&&e<=57}function nC(e){return"0123456789abcdefABCDEF".indexOf(e)>=0}function id(e){return"01234567".indexOf(e)>=0}function lhe(e){return e===32||e===9||e===11||e===12||e===160||e>=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].indexOf(e)>=0}function Gd(e){return e===10||e===13||e===8232||e===8233}function Wh(e){return e===36||e===95||e>=65&&e<=90||e>=97&&e<=122||e===92||e>=128&&ahe.test(String.fromCharCode(e))}function Qp(e){return e===36||e===95||e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||e===92||e>=128&&uhe.test(String.fromCharCode(e))}const che={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 RB(){for(;L<Jt;){const e=Y.charCodeAt(L);if(lhe(e)||Gd(e))++L;else break}}function gv(e){var t,n,i,r=0;for(n=e==="u"?4:2,t=0;t<n;++t)L<Jt&&nC(Y[L])?(i=Y[L++],r=r*16+"0123456789abcdef".indexOf(i.toLowerCase())):we({},St,Ot);return String.fromCharCode(r)}function fhe(){var e,t,n,i;for(e=Y[L],t=0,e==="}"&&we({},St,Ot);L<Jt&&(e=Y[L++],!!nC(e));)t=t*16+"0123456789abcdef".indexOf(e.toLowerCase());return(t>1114111||e!=="}")&&we({},St,Ot),t<=65535?String.fromCharCode(t):(n=(t-65536>>10)+55296,i=(t-65536&1023)+56320,String.fromCharCode(n,i))}function LB(){var e,t;for(e=Y.charCodeAt(L++),t=String.fromCharCode(e),e===92&&(Y.charCodeAt(L)!==117&&we({},St,Ot),++L,e=gv("u"),(!e||e==="\\"||!Wh(e.charCodeAt(0)))&&we({},St,Ot),t=e);L<Jt&&(e=Y.charCodeAt(L),!!Qp(e));)++L,t+=String.fromCharCode(e),e===92&&(t=t.substr(0,t.length-1),Y.charCodeAt(L)!==117&&we({},St,Ot),++L,e=gv("u"),(!e||e==="\\"||!Qp(e.charCodeAt(0)))&&we({},St,Ot),t+=e);return t}function dhe(){var e,t;for(e=L++;L<Jt;){if(t=Y.charCodeAt(L),t===92)return L=e,LB();if(Qp(t))++L;else break}return Y.slice(e,L)}function hhe(){var e,t,n;return e=L,t=Y.charCodeAt(L)===92?LB():dhe(),t.length===1?n=nu:che.hasOwnProperty(t)?n=qo:t==="null"?n=U1:t==="true"||t==="false"?n=j1:n=nu,{type:n,value:t,start:e,end:L}}function Kb(){var e=L,t=Y.charCodeAt(L),n,i=Y[L],r,s,o;switch(t){case 46:case 40:case 41:case 59:case 44:case 123:case 125:case 91:case 93:case 58:case 63:case 126:return++L,{type:$n,value:String.fromCharCode(t),start:e,end:L};default:if(n=Y.charCodeAt(L+1),n===61)switch(t){case 43:case 45:case 47:case 60:case 62:case 94:case 124:case 37:case 38:case 42:return L+=2,{type:$n,value:String.fromCharCode(t)+String.fromCharCode(n),start:e,end:L};case 33:case 61:return L+=2,Y.charCodeAt(L)===61&&++L,{type:$n,value:Y.slice(e,L),start:e,end:L}}}if(o=Y.substr(L,4),o===">>>=")return L+=4,{type:$n,value:o,start:e,end:L};if(s=o.substr(0,3),s===">>>"||s==="<<="||s===">>=")return L+=3,{type:$n,value:s,start:e,end:L};if(r=s.substr(0,2),i===r[1]&&"+-<>&|".indexOf(i)>=0||r==="=>")return L+=2,{type:$n,value:r,start:e,end:L};if(r==="//"&&we({},St,Ot),"<>=!+-*%&|^/".indexOf(i)>=0)return++L,{type:$n,value:i,start:e,end:L};we({},St,Ot)}function ghe(e){let t="";for(;L<Jt&&nC(Y[L]);)t+=Y[L++];return t.length===0&&we({},St,Ot),Wh(Y.charCodeAt(L))&&we({},St,Ot),{type:Fu,value:parseInt("0x"+t,16),start:e,end:L}}function phe(e){let t="0"+Y[L++];for(;L<Jt&&id(Y[L]);)t+=Y[L++];return(Wh(Y.charCodeAt(L))||rs(Y.charCodeAt(L)))&&we({},St,Ot),{type:Fu,value:parseInt(t,8),octal:!0,start:e,end:L}}function j3(){var e,t,n;if(n=Y[L],q1(rs(n.charCodeAt(0))||n===".","Numeric literal must start with a decimal digit or a decimal point"),t=L,e="",n!=="."){if(e=Y[L++],n=Y[L],e==="0"){if(n==="x"||n==="X")return++L,ghe(t);if(id(n))return phe(t);n&&rs(n.charCodeAt(0))&&we({},St,Ot)}for(;rs(Y.charCodeAt(L));)e+=Y[L++];n=Y[L]}if(n==="."){for(e+=Y[L++];rs(Y.charCodeAt(L));)e+=Y[L++];n=Y[L]}if(n==="e"||n==="E")if(e+=Y[L++],n=Y[L],(n==="+"||n==="-")&&(e+=Y[L++]),rs(Y.charCodeAt(L)))for(;rs(Y.charCodeAt(L));)e+=Y[L++];else we({},St,Ot);return Wh(Y.charCodeAt(L))&&we({},St,Ot),{type:Fu,value:parseFloat(e),start:t,end:L}}function mhe(){var e="",t,n,i,r,s=!1;for(t=Y[L],q1(t==="'"||t==='"',"String literal must starts with a quote"),n=L,++L;L<Jt;)if(i=Y[L++],i===t){t="";break}else if(i==="\\")if(i=Y[L++],!i||!Gd(i.charCodeAt(0)))switch(i){case"u":case"x":Y[L]==="{"?(++L,e+=fhe()):e+=gv(i);break;case"n":e+=`
`;break;case"r":e+="\r";break;case"t":e+=" ";break;case"b":e+="\b";break;case"f":e+="\f";break;case"v":e+="\v";break;default:id(i)?(r="01234567".indexOf(i),r!==0&&(s=!0),L<Jt&&id(Y[L])&&(s=!0,r=r*8+"01234567".indexOf(Y[L++]),"0123".indexOf(i)>=0&&L<Jt&&id(Y[L])&&(r=r*8+"01234567".indexOf(Y[L++]))),e+=String.fromCharCode(r)):e+=i;break}else i==="\r"&&Y[L]===`
`&&++L;else{if(Gd(i.charCodeAt(0)))break;e+=i}return t!==""&&we({},St,Ot),{type:qh,value:e,octal:s,start:n,end:L}}function yhe(e,t){let n=e;t.indexOf("u")>=0&&(n=n.replace(/\\u\{([0-9a-fA-F]+)\}/g,(i,r)=>{if(parseInt(r,16)<=1114111)return"x";we({},hv)}).replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"x"));try{new RegExp(n)}catch{we({},hv)}try{return new RegExp(e,t)}catch{return null}}function bhe(){var e,t,n,i,r;for(e=Y[L],q1(e==="/","Regular expression literal must start with a slash"),t=Y[L++],n=!1,i=!1;L<Jt;)if(e=Y[L++],t+=e,e==="\\")e=Y[L++],Gd(e.charCodeAt(0))&&we({},Xb),t+=e;else if(Gd(e.charCodeAt(0)))we({},Xb);else if(n)e==="]"&&(n=!1);else if(e==="/"){i=!0;break}else e==="["&&(n=!0);return i||we({},Xb),r=t.substr(1,t.length-2),{value:r,literal:t}}function xhe(){var e,t,n;for(t="",n="";L<Jt&&(e=Y[L],!!Qp(e.charCodeAt(0)));)++L,e==="\\"&&L<Jt?we({},St,Ot):(n+=e,t+=e);return n.search(/[^gimuy]/g)>=0&&we({},hv,n),{value:n,literal:t}}function vhe(){var e,t,n,i;return Ne=null,RB(),e=L,t=bhe(),n=xhe(),i=yhe(t.value,n.value),{literal:t.literal+n.literal,value:i,regex:{pattern:t.value,flags:n.value},start:e,end:L}}function Ahe(e){return e.type===nu||e.type===qo||e.type===j1||e.type===U1}function PB(){if(RB(),L>=Jt)return{type:Uh,start:L,end:L};const e=Y.charCodeAt(L);return Wh(e)?hhe():e===40||e===41||e===59?Kb():e===39||e===34?mhe():e===46?rs(Y.charCodeAt(L+1))?j3():Kb():rs(e)?j3():Kb()}function Mn(){const e=Ne;return L=e.end,Ne=PB(),L=e.end,e}function IB(){const e=L;Ne=PB(),L=e}function Ehe(e){const t=new Ji(Gde);return t.elements=e,t}function U3(e,t,n){const i=new Ji(e==="||"||e==="&&"?Kde:Hde);return i.operator=e,i.left=t,i.right=n,i}function whe(e,t){const n=new Ji(Vde);return n.callee=e,n.arguments=t,n}function $he(e,t,n){const i=new Ji(Yde);return i.test=e,i.consequent=t,i.alternate=n,i}function iC(e){const t=new Ji(TB);return t.name=e,t}function Rf(e){const t=new Ji(Xde);return t.value=e.value,t.raw=Y.slice(e.start,e.end),e.regex&&(t.raw==="//"&&(t.raw="/(?:)/"),t.regex=e.regex),t}function q3(e,t,n){const i=new Ji(Jde);return i.computed=e==="[",i.object=t,i.property=n,i.computed||(n.member=!0),i}function Che(e){const t=new Ji(Qde);return t.properties=e,t}function W3(e,t,n){const i=new Ji(Zde);return i.key=t,i.value=n,i.kind=e,i}function Fhe(e,t){const n=new Ji(ehe);return n.operator=e,n.argument=t,n.prefix=!0,n}function we(e,t){var n,i=Array.prototype.slice.call(arguments,2),r=t.replace(/%(\d)/g,(s,o)=>(q1(o<i.length,"Message reference must be in range"),i[o]));throw n=new Error(r),n.index=L,n.description=r,n}function W1(e){e.type===Uh&&we(e,she),e.type===Fu&&we(e,the),e.type===qh&&we(e,nhe),e.type===nu&&we(e,ihe),e.type===qo&&we(e,rhe),we(e,St,e.value)}function Qt(e){const t=Mn();(t.type!==$n||t.value!==e)&&W1(t)}function He(e){return Ne.type===$n&&Ne.value===e}function Jb(e){return Ne.type===qo&&Ne.value===e}function She(){const e=[];for(L=Ne.start,Qt("[");!He("]");)He(",")?(Mn(),e.push(null)):(e.push(iu()),He("]")||Qt(","));return Mn(),Ehe(e)}function G3(){L=Ne.start;const e=Mn();return e.type===qh||e.type===Fu?(e.octal&&we(e,BB),Rf(e)):iC(e.value)}function Dhe(){var e,t,n,i;if(L=Ne.start,e=Ne,e.type===nu)return n=G3(),Qt(":"),i=iu(),W3("init",n,i);if(e.type===Uh||e.type===$n)W1(e);else return t=G3(),Qt(":"),i=iu(),W3("init",t,i)}function _he(){var e=[],t,n,i,r={},s=String;for(L=Ne.start,Qt("{");!He("}");)t=Dhe(),t.key.type===TB?n=t.key.name:n=s(t.key.value),i="$"+n,Object.prototype.hasOwnProperty.call(r,i)?we({},ohe):r[i]=!0,e.push(t),He("}")||Qt(",");return Qt("}"),Che(e)}function khe(){Qt("(");const e=rC();return Qt(")"),e}const Mhe={if:1};function Ohe(){var e,t,n;if(He("("))return khe();if(He("["))return She();if(He("{"))return _he();if(e=Ne.type,L=Ne.start,e===nu||Mhe[Ne.value])n=iC(Mn().value);else if(e===qh||e===Fu)Ne.octal&&we(Ne,BB),n=Rf(Mn());else{if(e===qo)throw new Error(Wd);e===j1?(t=Mn(),t.value=t.value==="true",n=Rf(t)):e===U1?(t=Mn(),t.value=null,n=Rf(t)):He("/")||He("/=")?(n=Rf(vhe()),IB()):W1(Mn())}return n}function Nhe(){const e=[];if(Qt("("),!He(")"))for(;L<Jt&&(e.push(iu()),!He(")"));)Qt(",");return Qt(")"),e}function The(){L=Ne.start;const e=Mn();return Ahe(e)||W1(e),iC(e.value)}function Bhe(){return Qt("."),The()}function Rhe(){Qt("[");const e=rC();return Qt("]"),e}function Lhe(){var e,t,n;for(e=Ohe();;)if(He("."))n=Bhe(),e=q3(".",e,n);else if(He("("))t=Nhe(),e=whe(e,t);else if(He("["))n=Rhe(),e=q3("[",e,n);else break;return e}function H3(){const e=Lhe();if(Ne.type===$n&&(He("++")||He("--")))throw new Error(Wd);return e}function Cg(){var e,t;if(Ne.type!==$n&&Ne.type!==qo)t=H3();else{if(He("++")||He("--"))throw new Error(Wd);if(He("+")||He("-")||He("~")||He("!"))e=Mn(),t=Cg(),t=Fhe(e.value,t);else{if(Jb("delete")||Jb("void")||Jb("typeof"))throw new Error(Wd);t=H3()}}return t}function V3(e){let t=0;if(e.type!==$n&&e.type!==qo)return 0;switch(e.value){case"||":t=1;break;case"&&":t=2;break;case"|":t=3;break;case"^":t=4;break;case"&":t=5;break;case"==":case"!=":case"===":case"!==":t=6;break;case"<":case">":case"<=":case">=":case"instanceof":case"in":t=7;break;case"<<":case">>":case">>>":t=8;break;case"+":case"-":t=9;break;case"*":case"/":case"%":t=11;break}return t}function Phe(){var e,t,n,i,r,s,o,a,u,l;if(e=Ne,u=Cg(),i=Ne,r=V3(i),r===0)return u;for(i.prec=r,Mn(),t=[e,Ne],o=Cg(),s=[u,i,o];(r=V3(Ne))>0;){for(;s.length>2&&r<=s[s.length-2].prec;)o=s.pop(),a=s.pop().value,u=s.pop(),t.pop(),n=U3(a,u,o),s.push(n);i=Mn(),i.prec=r,s.push(i),t.push(Ne),n=Cg(),s.push(n)}for(l=s.length-1,n=s[l],t.pop();l>1;)t.pop(),n=U3(s[l-1].value,s[l-2],n),l-=2;return n}function iu(){var e,t,n;return e=Phe(),He("?")&&(Mn(),t=iu(),Qt(":"),n=iu(),e=$he(e,t,n)),e}function rC(){const e=iu();if(He(","))throw new Error(Wd);return e}function Ihe(e){Y=e,L=0,Jt=Y.length,Ne=null,IB();const t=rC();if(Ne.type!==Uh)throw new Error("Unexpect token after expression.");return t}var zhe={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 jhe(e){function t(o,a,u,l){let c=e(a[0]);return u&&(c=u+"("+c+")",u.lastIndexOf("new ",0)===0&&(c="("+c+")")),c+"."+o+(l<0?"":l===0?"()":"("+a.slice(1).map(e).join(",")+")")}function n(o,a,u){return l=>t(o,l,a,u)}const i="new Date",r="String",s="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(o){o.length<3&&oi("Missing arguments to clamp function."),o.length>3&&oi("Too many arguments to clamp function.");const a=o.map(e);return"Math.max("+a[1]+", Math.min("+a[2]+","+a[0]+"))"},now:"Date.now",utc:"Date.UTC",datetime:i,date:n("getDate",i,0),day:n("getDay",i,0),year:n("getFullYear",i,0),month:n("getMonth",i,0),hours:n("getHours",i,0),minutes:n("getMinutes",i,0),seconds:n("getSeconds",i,0),milliseconds:n("getMilliseconds",i,0),time:n("getTime",i,0),timezoneoffset:n("getTimezoneOffset",i,0),utcdate:n("getUTCDate",i,0),utcday:n("getUTCDay",i,0),utcyear:n("getUTCFullYear",i,0),utcmonth:n("getUTCMonth",i,0),utchours:n("getUTCHours",i,0),utcminutes:n("getUTCMinutes",i,0),utcseconds:n("getUTCSeconds",i,0),utcmilliseconds:n("getUTCMilliseconds",i,0),length:n("length",null,-1),parseFloat:"parseFloat",parseInt:"parseInt",upper:n("toUpperCase",r,0),lower:n("toLowerCase",r,0),substring:n("substring",r),split:n("split",r),trim:n("trim",r,0),regexp:s,test:n("test",s),if:function(o){o.length<3&&oi("Missing arguments to if function."),o.length>3&&oi("Too many arguments to if function.");const a=o.map(e);return"("+a[0]+"?"+a[1]+":"+a[2]+")"}}}function Uhe(e){const t=e&&e.length-1;return t&&(e[0]==='"'&&e[t]==='"'||e[0]==="'"&&e[t]==="'")?e.slice(1,-1):e}function qhe(e){e=e||{};const t=e.allowed?D2(e.allowed):{},n=e.forbidden?D2(e.forbidden):{},i=e.constants||zhe,r=(e.functions||jhe)(f),s=e.globalvar,o=e.fieldvar,a=pl(s)?s:g=>`${s}["${g}"]`;let u={},l={},c=0;function f(g){if(Pi(g))return g;const p=d[g.type];return p==null&&oi("Unsupported type: "+g.type),p(g)}const d={Literal:g=>g.raw,Identifier:g=>{const p=g.name;return c>0?p:ki(n,p)?oi("Illegal identifier: "+p):ki(i,p)?i[p]:ki(t,p)?p:(u[p]=1,a(p))},MemberExpression:g=>{const p=!g.computed,m=f(g.object);p&&(c+=1);const y=f(g.property);return m===o&&(l[Uhe(y)]=1),p&&(c-=1),m+(p?"."+y:"["+y+"]")},CallExpression:g=>{g.callee.type!=="Identifier"&&oi("Illegal callee type: "+g.callee.type);const p=g.callee.name,m=g.arguments,y=ki(r,p)&&r[p];return y||oi("Unrecognized function: "+p),pl(y)?y(m):y+"("+m.map(f).join(",")+")"},ArrayExpression:g=>"["+g.elements.map(f).join(",")+"]",BinaryExpression:g=>"("+f(g.left)+" "+g.operator+" "+f(g.right)+")",UnaryExpression:g=>"("+g.operator+f(g.argument)+")",ConditionalExpression:g=>"("+f(g.test)+"?"+f(g.consequent)+":"+f(g.alternate)+")",LogicalExpression:g=>"("+f(g.left)+g.operator+f(g.right)+")",ObjectExpression:g=>"{"+g.properties.map(f).join(",")+"}",Property:g=>{c+=1;const p=f(g.key);return c-=1,p+":"+f(g.value)}};function h(g){const p={code:f(g),globals:Object.keys(u),fields:Object.keys(l)};return u={},l={},p}return h.functions=r,h.constants=i,h}const Whe="view",Zp="[",em="]",zB="{",jB="}",Ghe=":",UB=",",Hhe="@",Vhe=">",Yhe=/[[\]{}]/,Xhe={"*":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 qB,WB;function Khe(e,t,n){return qB=t||Whe,WB=n||Xhe,GB(e.trim()).map(pv)}function Jhe(e){return WB[e]}function rd(e,t,n,i,r){const s=e.length;let o=0,a;for(;t<s;++t){if(a=e[t],!o&&a===n)return t;r&&r.indexOf(a)>=0?--o:i&&i.indexOf(a)>=0&&++o}return t}function GB(e){const t=[],n=e.length;let i=0,r=0;for(;r<n;)r=rd(e,r,UB,Zp+zB,em+jB),t.push(e.substring(i,r).trim()),i=++r;if(t.length===0)throw"Empty event selector: "+e;return t}function pv(e){return e[0]==="["?Qhe(e):Zhe(e)}function Qhe(e){const t=e.length;let n=1,i;if(n=rd(e,n,em,Zp,em),n===t)throw"Empty between selector: "+e;if(i=GB(e.substring(1,n)),i.length!==2)throw"Between selector must have two elements: "+e;if(e=e.slice(n+1).trim(),e[0]!==Vhe)throw"Expected '>' after between selector: "+e;i=i.map(pv);const r=pv(e.slice(1).trim());return r.between?{between:i,stream:r}:(r.between=i,r)}function Zhe(e){const t={source:qB},n=[];let i=[0,0],r=0,s=0,o=e.length,a=0,u,l;if(e[o-1]===jB){if(a=e.lastIndexOf(zB),a>=0){try{i=e0e(e.substring(a+1,o-1))}catch{throw"Invalid throttle specification: "+e}e=e.slice(0,a).trim(),o=e.length}else throw"Unmatched right brace: "+e;a=0}if(!o)throw e;if(e[0]===Hhe&&(r=++a),u=rd(e,a,Ghe),u<o&&(n.push(e.substring(s,u).trim()),s=a=++u),a=rd(e,a,Zp),a===o)n.push(e.substring(s,o).trim());else if(n.push(e.substring(s,a).trim()),l=[],s=++a,s===o)throw"Unmatched left bracket: "+e;for(;a<o;){if(a=rd(e,a,em),a===o)throw"Unmatched left bracket: "+e;if(l.push(e.substring(s,a).trim()),a<o-1&&e[++a]!==Zp)throw"Expected left bracket: "+e;s=++a}if(!(o=n.length)||Yhe.test(n[o-1]))throw"Invalid event selector: "+e;return o>1?(t.type=n[1],r?t.markname=n[0].slice(1):Jhe(n[0])?t.marktype=n[0]:t.source=n[0]):t.type=n[0],t.type.slice(-1)==="!"&&(t.consume=!0,t.type=t.type.slice(0,-1)),l!=null&&(t.filter=l),i[0]&&(t.throttle=i[0]),i[1]&&(t.debounce=i[1]),t}function e0e(e){const t=e.split(UB);if(!e.length||t.length>2)throw e;return t.map(n=>{const i=+n;if(i!==i)throw e;return i})}var t0e="5.25.0";tA(Al,KW,GK,qJ,PZ,Wee,Une,ane,Wne,vie,Iie,Qie);const n0e=Object.freeze(Object.defineProperty({__proto__:null,Bounds:ot,CanvasHandler:Dh,CanvasRenderer:rp,DATE:Pn,DAY:Wt,DAYOFYEAR:Cr,Dataflow:il,Debug:J5,Error:Y5,EventStream:Pm,Gradient:n9,GroupItem:a1,HOURS:Zn,Handler:Co,Info:K5,Item:o1,MILLISECONDS:qi,MINUTES:ei,MONTH:Yt,Marks:ti,MultiPulse:xA,None:V5,Operator:Ie,Parameters:Lm,Pulse:lo,QUARTER:Ln,RenderType:to,Renderer:Br,ResourceLoader:VE,SECONDS:hi,SVGHandler:fw,SVGRenderer:yw,SVGStringRenderer:bw,Scenegraph:lw,TIME_UNITS:lA,Transform:N,View:XT,WEEK:ht,Warn:X5,YEAR:Tt,accessor:ks,accessorFields:G5,accessorName:PP,array:hd,ascending:eA,bandwidthNRD:FA,bin:LM,bootstrapCI:PM,boundClip:K9,boundContext:$h,boundItem:ux,boundMark:A9,boundStroke:Ms,changeset:yu,clampRange:sI,codegenExpression:qhe,compare:aI,constant:fI,cumulativeLogNormal:OA,cumulativeNormal:zm,cumulativeUniform:RA,dayofyear:L6,debounce:dI,defaultLocale:gA,definition:SM,densityLogNormal:MA,densityNormal:SA,densityUniform:BA,domChild:_n,domClear:Oi,domCreate:Zs,domFind:cw,dotbin:IM,error:oi,expressionFunction:lt,extend:tA,extent:hI,extentIndex:gI,falsy:GP,fastmap:mI,field:Kv,flush:yI,font:d1,fontFamily:Sh,fontSize:Tr,format:J0,formatLocale:Pg,formats:yA,hasOwnProperty:ki,id:jP,identity:Jv,inferType:mM,inferTypes:yM,ingest:De,inherits:bI,inrange:xI,interpolate:IE,interpolateColors:r1,interpolateRange:UO,intersect:H9,intersectBoxLine:Ku,intersectPath:YE,intersectPoint:XE,intersectRule:c9,isArray:Xl,isBoolean:n6,isDate:i6,isFunction:pl,isIterable:vI,isNumber:r6,isObject:gl,isRegExp:AI,isString:Pi,isTuple:Bm,key:EI,lerp:wI,lineHeight:wo,loader:Nm,locale:gM,logger:VP,lruCache:CI,markup:mw,merge:FI,mergeConfig:Qv,multiLineOffset:ow,one:qP,pad:SI,panLinear:XP,panLog:KP,panPow:JP,panSymlog:QP,parse:kde,parseExpression:Ihe,parseSelector:Khe,path:Gm,pathCurves:WE,pathEqual:J9,pathParse:Sl,pathRectangle:s9,pathRender:$d,pathSymbols:r9,pathTrail:o9,peek:Kl,point:g1,projection:Iw,quantileLogNormal:NA,quantileNormal:jm,quantileUniform:LA,quantiles:$A,quantizeInterpolator:qO,quarter:iI,quartiles:CA,get random(){return gi},randomInteger:eW,randomKDE:_A,randomLCG:Zq,randomLogNormal:jM,randomMixture:UM,randomNormal:DA,randomUniform:qM,read:vM,regressionConstant:PA,regressionExp:GM,regressionLinear:IA,regressionLoess:YM,regressionLog:WM,regressionPoly:VM,regressionPow:HM,regressionQuad:zA,renderModule:p1,repeat:mf,resetDefaultLocale:BU,resetSVGClipId:u9,resetSVGDefIds:nK,responseType:xM,runtimeContext:RT,sampleCurve:qm,sampleLogNormal:kA,sampleNormal:Im,sampleUniform:TA,scale:Fe,sceneEqual:xw,sceneFromJSON:w9,scenePickVisit:Qg,sceneToJSON:E9,sceneVisit:Wi,sceneZOrder:KE,scheme:zE,serializeXML:P9,setRandom:Jq,span:DI,splitAccessPath:Xv,stringValue:s6,textMetrics:Ii,timeBin:eM,timeFloor:W6,timeFormatLocale:md,timeInterval:nc,timeOffset:V6,timeSequence:K6,timeUnitSpecifier:R6,timeUnits:cA,toBoolean:_I,toDate:MI,toNumber:Zv,toSet:D2,toString:OI,transform:DM,transforms:Al,truncate:NI,truthy:WP,tupleid:Z,typeParsers:q2,utcFloor:G6,utcInterval:ic,utcOffset:Y6,utcSequence:J6,utcdayofyear:z6,utcquarter:rI,utcweek:j6,version:t0e,visitArray:TI,week:P6,writeConfig:wm,zero:UP,zoomLinear:ZP,zoomLog:eI,zoomPow:tI,zoomSymlog:nI},Symbol.toStringTag,{value:"Module"}));function i0e(e,t,n){let i;t.x2&&(t.x?(n&&e.x>e.x2&&(i=e.x,e.x=e.x2,e.x2=i),e.width=e.x2-e.x):e.x=e.x2-(e.width||0)),t.xc&&(e.x=e.xc-(e.width||0)/2),t.y2&&(t.y?(n&&e.y>e.y2&&(i=e.y,e.y=e.y2,e.y2=i),e.height=e.y2-e.y):e.y=e.y2-(e.height||0)),t.yc&&(e.y=e.yc-(e.height||0)/2)}var r0e={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},s0e={"*":(e,t)=>e*t,"+":(e,t)=>e+t,"-":(e,t)=>e-t,"/":(e,t)=>e/t,"%":(e,t)=>e%t,">":(e,t)=>e>t,"<":(e,t)=>e<t,"<=":(e,t)=>e<=t,">=":(e,t)=>e>=t,"==":(e,t)=>e==t,"!=":(e,t)=>e!=t,"===":(e,t)=>e===t,"!==":(e,t)=>e!==t,"&":(e,t)=>e&t,"|":(e,t)=>e|t,"^":(e,t)=>e^t,"<<":(e,t)=>e<<t,">>":(e,t)=>e>>t,">>>":(e,t)=>e>>>t},o0e={"+":e=>+e,"-":e=>-e,"~":e=>~e,"!":e=>!e};const a0e=Array.prototype.slice,ua=(e,t,n)=>{const i=n?n(t[0]):t[0];return i[e].apply(i,a0e.call(t,1))},u0e=(e,t,n,i,r,s,o)=>new Date(e,t||0,n??1,i||0,r||0,s||0,o||0);var l0e={isNaN:Number.isNaN,isFinite:Number.isFinite,abs:Math.abs,acos:Math.acos,asin:Math.asin,atan:Math.atan,atan2:Math.atan2,ceil:Math.ceil,cos:Math.cos,exp:Math.exp,floor:Math.floor,log:Math.log,max:Math.max,min:Math.min,pow:Math.pow,random:Math.random,round:Math.round,sin:Math.sin,sqrt:Math.sqrt,tan:Math.tan,clamp:(e,t,n)=>Math.max(t,Math.min(n,e)),now:Date.now,utc:Date.UTC,datetime:u0e,date:e=>new Date(e).getDate(),day:e=>new Date(e).getDay(),year:e=>new Date(e).getFullYear(),month:e=>new Date(e).getMonth(),hours:e=>new Date(e).getHours(),minutes:e=>new Date(e).getMinutes(),seconds:e=>new Date(e).getSeconds(),milliseconds:e=>new Date(e).getMilliseconds(),time:e=>new Date(e).getTime(),timezoneoffset:e=>new Date(e).getTimezoneOffset(),utcdate:e=>new Date(e).getUTCDate(),utcday:e=>new Date(e).getUTCDay(),utcyear:e=>new Date(e).getUTCFullYear(),utcmonth:e=>new Date(e).getUTCMonth(),utchours:e=>new Date(e).getUTCHours(),utcminutes:e=>new Date(e).getUTCMinutes(),utcseconds:e=>new Date(e).getUTCSeconds(),utcmilliseconds:e=>new Date(e).getUTCMilliseconds(),length:e=>e.length,join:function(){return ua("join",arguments)},indexof:function(){return ua("indexOf",arguments)},lastindexof:function(){return ua("lastIndexOf",arguments)},slice:function(){return ua("slice",arguments)},reverse:e=>e.slice().reverse(),parseFloat,parseInt,upper:e=>String(e).toUpperCase(),lower:e=>String(e).toLowerCase(),substring:function(){return ua("substring",arguments,String)},split:function(){return ua("split",arguments,String)},replace:function(){return ua("replace",arguments,String)},trim:e=>String(e).trim(),regexp:RegExp,test:(e,t)=>RegExp(e).test(t)};const c0e=["view","item","group","xy","x","y"],mv=new Set([Function,eval,setTimeout,setInterval]);typeof setImmediate=="function"&&mv.add(setImmediate);const f0e={Literal:(e,t)=>t.value,Identifier:(e,t)=>{const n=t.name;return e.memberDepth>0?n:n==="datum"?e.datum:n==="event"?e.event:n==="item"?e.item:r0e[n]||e.params["$"+n]},MemberExpression:(e,t)=>{const n=!t.computed,i=e(t.object);n&&(e.memberDepth+=1);const r=e(t.property);if(n&&(e.memberDepth-=1),mv.has(i[r])){console.error(`Prevented interpretation of member "${r}" which could lead to insecure code execution`);return}return i[r]},CallExpression:(e,t)=>{const n=t.arguments;let i=t.callee.name;return i.startsWith("_")&&(i=i.slice(1)),i==="if"?e(n[0])?e(n[1]):e(n[2]):(e.fn[i]||l0e[i]).apply(e.fn,n.map(e))},ArrayExpression:(e,t)=>t.elements.map(e),BinaryExpression:(e,t)=>s0e[t.operator](e(t.left),e(t.right)),UnaryExpression:(e,t)=>o0e[t.operator](e(t.argument)),ConditionalExpression:(e,t)=>e(t.test)?e(t.consequent):e(t.alternate),LogicalExpression:(e,t)=>t.operator==="&&"?e(t.left)&&e(t.right):e(t.left)||e(t.right),ObjectExpression:(e,t)=>t.properties.reduce((n,i)=>{e.memberDepth+=1;const r=e(i.key);return e.memberDepth-=1,mv.has(e(i.value))?console.error(`Prevented interpretation of property "${r}" which could lead to insecure code execution`):n[r]=e(i.value),n},{})};function lf(e,t,n,i,r,s){const o=a=>f0e[a.type](o,a);return o.memberDepth=0,o.fn=Object.create(t),o.params=n,o.datum=i,o.event=r,o.item=s,c0e.forEach(a=>o.fn[a]=function(){return r.vega[a](...arguments)}),o(e)}var d0e={operator(e,t){const n=t.ast,i=e.functions;return r=>lf(n,i,r)},parameter(e,t){const n=t.ast,i=e.functions;return(r,s)=>lf(n,i,s,r)},event(e,t){const n=t.ast,i=e.functions;return r=>lf(n,i,void 0,void 0,r)},handler(e,t){const n=t.ast,i=e.functions;return(r,s)=>{const o=s.item&&s.item.datum;return lf(n,i,r,o,s)}},encode(e,t){const{marktype:n,channels:i}=t,r=e.functions,s=n==="group"||n==="image"||n==="rect";return(o,a)=>{const u=o.datum;let l=0,c;for(const f in i)c=lf(i[f].ast,r,a,u,void 0,o),o[f]!==c&&(o[f]=c,l=1);return n!=="rule"&&i0e(o,i,s),l}}};const h0e="vega-lite",g0e='Dominik Moritz, Kanit "Ham" Wongsuphasawat, Arvind Satyanarayan, Jeffrey Heer',p0e="5.1.0",m0e=["Kanit Wongsuphasawat (http://kanitw.yellowpigz.com)","Dominik Moritz (https://www.domoritz.de)","Arvind Satyanarayan (https://arvindsatya.com)","Jeffrey Heer (https://jheer.org)"],y0e="https://vega.github.io/vega-lite/",b0e="Vega-Lite is a concise high-level language for interactive visualization.",x0e="build/vega-lite.js",v0e="build/vega-lite.min.js",A0e="build/vega-lite.min.js",E0e="build/src/index",w0e="build/src/index.d.ts",$0e={vl2png:"./bin/vl2png",vl2svg:"./bin/vl2svg",vl2pdf:"./bin/vl2pdf",vl2vg:"./bin/vl2vg"},C0e={test:"test"},F0e=["bin","build","src","vega-lite*","tsconfig.json"],S0e={changelog:"conventional-changelog -p angular -r 2",prebuild:"yarn clean:build",build:"yarn build:only","build:only":"tsc -p tsconfig.build.json && rollup -c","prebuild:examples":"yarn build:only","build:examples":"yarn data && TZ=America/Los_Angeles scripts/build-examples.sh","prebuild:examples-full":"yarn build:only","build:examples-full":"TZ=America/Los_Angeles scripts/build-examples.sh 1","build:example":"TZ=America/Los_Angeles scripts/build-example.sh","build:toc":"yarn build:jekyll && scripts/generate-toc","build:site":"rollup -c site/rollup.config.js","build:jekyll":"pushd site && bundle exec jekyll build -q && popd","build:versions":"scripts/update-version.sh",clean:"yarn clean:build && del-cli 'site/data/*' 'examples/compiled/*.png' && find site/examples ! -name 'index.md' ! -name 'data' -type f -delete","clean:build":"del-cli 'build/*' !build/vega-lite-schema.json","predeploy:site":"yarn presite","deploy:site":"gh-pages -d site",data:"rsync -r node_modules/vega-datasets/data/* site/data",schema:"mkdir -p build && ts-json-schema-generator -f tsconfig.json -p src/index.ts -t TopLevelSpec --no-type-check --no-ref-encode > build/vega-lite-schema.json && yarn renameschema && cp build/vega-lite-schema.json site/_data/",renameschema:"scripts/rename-schema.sh",presite:"yarn data && yarn schema && yarn build:site && yarn build:versions && scripts/create-example-pages.sh",site:"yarn site:only","site:only":"pushd site && bundle exec jekyll serve -I -l && popd",prettierbase:"prettier '**/*.{md,css,yml}'",eslintbase:"eslint .",format:"yarn eslintbase --fix && yarn prettierbase --write",lint:"yarn eslintbase && yarn prettierbase --check",test:"jest test/ && yarn lint && yarn schema && jest examples/ && yarn test:runtime","test:cover":"jest --collectCoverage test/","test:inspect":"node --inspect-brk ./node_modules/.bin/jest --runInBand test","test:runtime":"TZ=America/Los_Angeles jest test-runtime/ --config test-runtime/jest-config.json","test:runtime:generate":"yarn build:only && del-cli test-runtime/resources && VL_GENERATE_TESTS=true yarn test:runtime",watch:"tsc -p tsconfig.build.json -w","watch:site":"yarn build:site -w","watch:test":"jest --watch test/"},D0e={type:"git",url:"https://github.com/vega/vega-lite.git"},_0e="BSD-3-Clause",k0e={url:"https://github.com/vega/vega-lite/issues"},M0e={"@babel/core":"^7.13.15","@babel/preset-env":"^7.13.15","@babel/preset-typescript":"^7.13.0","@rollup/plugin-babel":"^5.3.0","@rollup/plugin-commonjs":"^18.0.0","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^11.2.1","@types/chai":"^4.2.16","@types/d3":"^6.3.0","@types/jest":"^26.0.22","@types/mkdirp":"^1.0.1","@types/pako":"^1.0.1","@typescript-eslint/eslint-plugin":"^4.22.0","@typescript-eslint/parser":"^4.22.0",ajv:"^8.1.0","ajv-formats":"^2.0.2",chai:"^4.3.4",cheerio:"^1.0.0-rc.6","conventional-changelog-cli":"^2.1.1",d3:"^6.7.0","del-cli":"^3.0.1",eslint:"^7.24.0","eslint-config-prettier":"^8.2.0","eslint-plugin-jest":"^24.3.5","eslint-plugin-prettier":"^3.4.0","gh-pages":"^3.1.0","highlight.js":"^10.7.2",jest:"^26.6.3","jest-dev-server":"^5.0.0",mkdirp:"^1.0.4",pako:"^2.0.3",prettier:"^2.2.1",puppeteer:"^8.0.0",rollup:"^2.45.2","rollup-plugin-bundle-size":"^1.0.3","rollup-plugin-sourcemaps":"^0.6.3","rollup-plugin-terser":"^7.0.2",serve:"^11.3.2",terser:"^5.6.1","ts-json-schema-generator":"^0.90.0",typescript:"~4.2.4","vega-cli":"^5.20.2","vega-datasets":"~2.2.0","vega-embed":"^6.17.0","vega-tooltip":"^0.25.1","yaml-front-matter":"^4.1.1"},O0e={"@types/clone":"~2.1.0","@types/fast-json-stable-stringify":"^2.0.0","array-flat-polyfill":"^1.0.1",clone:"~2.1.2","fast-deep-equal":"~3.1.3","fast-json-stable-stringify":"~2.1.0","json-stringify-pretty-compact":"~3.0.0",tslib:"~2.2.0","vega-event-selector":"~2.0.6","vega-expression":"~4.0.1","vega-util":"~1.16.1",yargs:"~16.2.0"},N0e={vega:"^5.20.0"},T0e={testPathIgnorePatterns:["<rootDir>/node_modules","<rootDir>/build","<rootDir>/_site","<rootDir>/src"],coverageDirectory:"./coverage/",collectCoverage:!1,setupFiles:["./test/jest.overrides.ts"]},B0e={name:h0e,author:g0e,version:p0e,collaborators:m0e,homepage:y0e,description:b0e,main:x0e,unpkg:v0e,jsdelivr:A0e,module:E0e,types:w0e,bin:$0e,directories:C0e,files:F0e,scripts:S0e,repository:D0e,license:_0e,bugs:k0e,devDependencies:M0e,dependencies:O0e,peerDependencies:N0e,jest:T0e};Array.prototype.flat||Object.defineProperty(Array.prototype,"flat",{configurable:!0,value:function e(){var t=isNaN(arguments[0])?1:Number(arguments[0]);return t?Array.prototype.reduce.call(this,function(n,i){return Array.isArray(i)?n.push.apply(n,e.call(i,t-1)):n.push(i),n},[]):Array.prototype.slice.call(this)},writable:!0}),Array.prototype.flatMap||Object.defineProperty(Array.prototype,"flatMap",{configurable:!0,value:function(e){return Array.prototype.map.apply(this,arguments).flat()},writable:!0});var HB={exports:{}};(function(e){var t=function(){function n(d,h){return h!=null&&d instanceof h}var i;try{i=Map}catch{i=function(){}}var r;try{r=Set}catch{r=function(){}}var s;try{s=Promise}catch{s=function(){}}function o(d,h,g,p,m){typeof h=="object"&&(g=h.depth,p=h.prototype,m=h.includeNonEnumerable,h=h.circular);var y=[],b=[],x=typeof Buffer<"u";typeof h>"u"&&(h=!0),typeof g>"u"&&(g=1/0);function v(A,w){if(A===null)return null;if(w===0)return A;var E,$;if(typeof A!="object")return A;if(n(A,i))E=new i;else if(n(A,r))E=new r;else if(n(A,s))E=new s(function(O,B){A.then(function(I){O(v(I,w-1))},function(I){B(v(I,w-1))})});else if(o.__isArray(A))E=[];else if(o.__isRegExp(A))E=new RegExp(A.source,f(A)),A.lastIndex&&(E.lastIndex=A.lastIndex);else if(o.__isDate(A))E=new Date(A.getTime());else{if(x&&Buffer.isBuffer(A))return Buffer.allocUnsafe?E=Buffer.allocUnsafe(A.length):E=new Buffer(A.length),A.copy(E),E;n(A,Error)?E=Object.create(A):typeof p>"u"?($=Object.getPrototypeOf(A),E=Object.create($)):(E=Object.create(p),$=p)}if(h){var k=y.indexOf(A);if(k!=-1)return b[k];y.push(A),b.push(E)}n(A,i)&&A.forEach(function(O,B){var I=v(B,w-1),G=v(O,w-1);E.set(I,G)}),n(A,r)&&A.forEach(function(O){var B=v(O,w-1);E.add(B)});for(var F in A){var D;$&&(D=Object.getOwnPropertyDescriptor($,F)),!(D&&D.set==null)&&(E[F]=v(A[F],w-1))}if(Object.getOwnPropertySymbols)for(var T=Object.getOwnPropertySymbols(A),F=0;F<T.length;F++){var C=T[F],_=Object.getOwnPropertyDescriptor(A,C);_&&!_.enumerable&&!m||(E[C]=v(A[C],w-1),_.enumerable||Object.defineProperty(E,C,{enumerable:!1}))}if(m)for(var S=Object.getOwnPropertyNames(A),F=0;F<S.length;F++){var M=S[F],_=Object.getOwnPropertyDescriptor(A,M);_&&_.enumerable||(E[M]=v(A[M],w-1),Object.defineProperty(E,M,{enumerable:!1}))}return E}return v(d,g)}o.clonePrototype=function(h){if(h===null)return null;var g=function(){};return g.prototype=h,new g};function a(d){return Object.prototype.toString.call(d)}o.__objToStr=a;function u(d){return typeof d=="object"&&a(d)==="[object Date]"}o.__isDate=u;function l(d){return typeof d=="object"&&a(d)==="[object Array]"}o.__isArray=l;function c(d){return typeof d=="object"&&a(d)==="[object RegExp]"}o.__isRegExp=c;function f(d){var h="";return d.global&&(h+="g"),d.ignoreCase&&(h+="i"),d.multiline&&(h+="m"),h}return o.__getRegExpFlags=f,o}();e.exports&&(e.exports=t)})(HB);var R0e=HB.exports;const L0e=Am(R0e);var P0e=function e(t,n){if(t===n)return!0;if(t&&n&&typeof t=="object"&&typeof n=="object"){if(t.constructor!==n.constructor)return!1;var i,r,s;if(Array.isArray(t)){if(i=t.length,i!=n.length)return!1;for(r=i;r--!==0;)if(!e(t[r],n[r]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if(s=Object.keys(t),i=s.length,i!==Object.keys(n).length)return!1;for(r=i;r--!==0;)if(!Object.prototype.hasOwnProperty.call(n,s[r]))return!1;for(r=i;r--!==0;){var o=s[r];if(!e(t[o],n[o]))return!1}return!0}return t!==t&&n!==n};const VB=Am(P0e);var I0e=function(e,t){t||(t={}),typeof t=="function"&&(t={cmp:t});var n=typeof t.cycles=="boolean"?t.cycles:!1,i=t.cmp&&function(s){return function(o){return function(a,u){var l={key:a,value:o[a]},c={key:u,value:o[u]};return s(l,c)}}}(t.cmp),r=[];return function s(o){if(o&&o.toJSON&&typeof o.toJSON=="function"&&(o=o.toJSON()),o!==void 0){if(typeof o=="number")return isFinite(o)?""+o:"null";if(typeof o!="object")return JSON.stringify(o);var a,u;if(Array.isArray(o)){for(u="[",a=0;a<o.length;a++)a&&(u+=","),u+=s(o[a])||"null";return u+"]"}if(o===null)return"null";if(r.indexOf(o)!==-1){if(n)return JSON.stringify("__cycle__");throw new TypeError("Converting circular structure to JSON")}var l=r.push(o)-1,c=Object.keys(o).sort(i&&i(o));for(u="",a=0;a<c.length;a++){var f=c[a],d=s(o[f]);d&&(u&&(u+=","),u+=JSON.stringify(f)+":"+d)}return r.splice(l,1),"{"+u+"}"}}(e)};const sC=Am(I0e);function oC(e){return!!e.or}function aC(e){return!!e.and}function uC(e){return!!e.not}function Fg(e,t){if(uC(e))Fg(e.not,t);else if(aC(e))for(const n of e.and)Fg(n,t);else if(oC(e))for(const n of e.or)Fg(n,t);else t(e)}function ll(e,t){return uC(e)?{not:ll(e.not,t)}:aC(e)?{and:e.and.map(n=>ll(n,t))}:oC(e)?{or:e.or.map(n=>ll(n,t))}:t(e)}const fr=VB,ce=L0e;function Pl(e,t){const n={};for(const i of t)_a(e,i)&&(n[i]=e[i]);return n}function Qn(e,t){const n={...e};for(const i of t)delete n[i];return n}Set.prototype.toJSON=function(){return`Set(${[...this].map(e=>sC(e)).join(",")})`};const Ue=sC;function ye(e){if(at(e))return e;const t=ue(e)?e:sC(e);if(t.length<250)return t;let n=0;for(let i=0;i<t.length;i++){const r=t.charCodeAt(i);n=(n<<5)-n+r,n=n&n}return n}function yv(e){return e===!1||e===null}function fe(e,t){return e.includes(t)}function Il(e,t){let n=0;for(const[i,r]of e.entries())if(t(r,i,n++))return!0;return!1}function lC(e,t){let n=0;for(const[i,r]of e.entries())if(!t(r,i,n++))return!1;return!0}function YB(e,...t){for(const n of t)z0e(e,n??{});return e}function z0e(e,t){for(const n of z(t))l$(e,n,t[n],!0)}function dr(e,t){const n=[],i={};let r;for(const s of e)r=t(s),!(r in i)&&(i[r]=1,n.push(s));return n}function j0e(e,t){const n=z(e),i=z(t);if(n.length!==i.length)return!1;for(const r of n)if(e[r]!==t[r])return!1;return!0}function XB(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function cC(e,t){for(const n of e)if(t.has(n))return!0;return!1}function bv(e){const t=new Set;for(const n of e){const r=vu(n).map((o,a)=>a===0?o:`[${o}]`),s=r.map((o,a)=>r.slice(0,a+1).join(""));for(const o of s)t.add(o)}return t}function fC(e,t){return e===void 0||t===void 0?!0:cC(bv(e),bv(t))}function Be(e){return z(e).length===0}const z=Object.keys,pn=Object.values,_o=Object.entries;function Hd(e){return e===!0||e===!1}function Ke(e){const t=e.replace(/\W/g,"_");return(e.match(/^\d+/)?"_":"")+t}function sd(e,t){return uC(e)?`!(${sd(e.not,t)})`:aC(e)?`(${e.and.map(n=>sd(n,t)).join(") && (")})`:oC(e)?`(${e.or.map(n=>sd(n,t)).join(") || (")})`:t(e)}function tm(e,t){if(t.length===0)return!0;const n=t.shift();return n in e&&tm(e[n],t)&&delete e[n],Be(e)}function Gh(e){return e.charAt(0).toUpperCase()+e.substr(1)}function dC(e,t="datum"){const n=vu(e),i=[];for(let r=1;r<=n.length;r++){const s=`[${n.slice(0,r).map(Ae).join("][")}]`;i.push(`${t}${s}`)}return i.join(" && ")}function KB(e,t="datum"){return`${t}[${Ae(vu(e).join("."))}]`}function U0e(e){return e.replace(/(\[|\]|\.|'|")/g,"\\$1")}function mi(e){return`${vu(e).map(U0e).join("\\.")}`}function ru(e,t,n){return e.replace(new RegExp(t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),"g"),n)}function hC(e){return`${vu(e).join(".")}`}function zl(e){return e?vu(e).length:0}function ut(...e){for(const t of e)if(t!==void 0)return t}let JB=42;function QB(e){const t=++JB;return e?String(e)+t:t}function q0e(){JB=42}function ZB(e){return e7(e)?e:`__${e}`}function e7(e){return e.startsWith("__")}function Vd(e){if(e!==void 0)return(e%360+360)%360}function G1(e){return at(e)?!0:!isNaN(e)&&!isNaN(parseFloat(e))}const vs="row",As="column",H1="facet",Ze="x",mt="y",Qi="x2",Ur="y2",qr="radius",Bs="radius2",Zi="theta",Rs="theta2",Wr="latitude",Gr="longitude",er="latitude2",yi="longitude2",zn="color",Hr="fill",Vr="stroke",jn="shape",Ls="size",Su="angle",Ps="opacity",Wo="fillOpacity",Go="strokeOpacity",Ho="strokeWidth",Vo="strokeDash",Hh="text",Vh="order",Yh="detail",V1="key",su="tooltip",Y1="href",X1="url",K1="description",W0e={x:1,y:1,x2:1,y2:1},t7={theta:1,theta2:1,radius:1,radius2:1};function n7(e){return e in t7}const gC={longitude:1,longitude2:1,latitude:1,latitude2:1};function G0e(e){switch(e){case Wr:return"y";case er:return"y2";case Gr:return"x";case yi:return"x2"}}function H0e(e){return e in gC}const V0e=z(gC),i7={...W0e,...t7,...gC,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 cl(e){return e===zn||e===Hr||e===Vr}const r7={row:1,column:1,facet:1},ci=z(r7),pC={...i7,...r7},Y0e=z(pC),{order:y$e,detail:b$e,tooltip:x$e,...X0e}=pC,{row:v$e,column:A$e,facet:E$e,...K0e}=X0e;function J0e(e){return!!K0e[e]}function s7(e){return!!pC[e]}const Q0e=[Qi,Ur,er,yi,Rs,Bs];function o7(e){return Du(e)!==e}function Du(e){switch(e){case Qi:return Ze;case Ur:return mt;case er:return Wr;case yi:return Gr;case Rs:return Zi;case Bs:return qr}return e}function ko(e){if(n7(e))switch(e){case Zi:return"startAngle";case Rs:return"endAngle";case qr:return"outerRadius";case Bs:return"innerRadius"}return e}function Is(e){switch(e){case Ze:return Qi;case mt:return Ur;case Wr:return er;case Gr:return yi;case Zi:return Rs;case qr:return Bs}}function bi(e){switch(e){case Ze:case Qi:return"width";case mt:case Ur:return"height"}}function Z0e(e){switch(e){case Ze:return"xOffset";case mt:return"yOffset";case Qi:return"x2Offset";case Ur:return"y2Offset";case Zi:return"thetaOffset";case qr:return"radiusOffset";case Rs:return"theta2Offset";case Bs:return"radius2Offset"}}const{x:w$e,y:$$e,x2:C$e,y2:F$e,latitude:S$e,longitude:D$e,latitude2:_$e,longitude2:k$e,theta:M$e,theta2:O$e,radius:N$e,radius2:T$e,...mC}=i7,ege=z(mC),Yo={x:1,y:1},Yr=z(Yo);function _r(e){return e in Yo}const yC={theta:1,radius:1},tge=z(yC);function J1(e){return e==="width"?Ze:mt}const{text:B$e,tooltip:R$e,href:L$e,url:P$e,description:I$e,detail:z$e,key:j$e,order:U$e,...a7}=mC,nge=z(a7);function ige(e){return!!mC[e]}function rge(e){switch(e){case zn:case Hr:case Vr:case Ls:case jn:case Ps:case Ho:case Vo:return!0;case Wo:case Go:case Su:return!1}}const u7={...Yo,...yC,...a7},Q1=z(u7);function Xo(e){return!!u7[e]}function sge(e,t){return age(e)[t]}const l7={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:q$e,...oge}=l7;function age(e){switch(e){case zn:case Hr:case Vr:case K1:case Yh:case V1:case su:case Y1:case Vh:case Ps:case Wo:case Go:case Ho:case H1:case vs:case As:return l7;case Ze:case mt:case Wr:case Gr:return oge;case Qi:case Ur:case er:case yi:return{area:"always",bar:"always",image:"always",rect:"always",rule:"always",circle:"binned",point:"binned",square:"binned",tick:"binned",line:"binned",trail:"binned"};case Ls:return{point:"always",tick:"always",rule:"always",circle:"always",square:"always",bar:"always",text:"always",line:"always",trail:"always"};case Vo:return{line:"always",point:"always",tick:"always",rule:"always",circle:"always",square:"always",bar:"always",geoshape:"always"};case jn:return{point:"always",geoshape:"always"};case Hh:return{text:"always"};case Su:return{point:"always",square:"always",text:"always"};case X1:return{image:"always"};case Zi:return{text:"always",arc:"always"};case qr:return{text:"always",arc:"always"};case Rs:case Bs:return{arc:"always"}}}function Qb(e){switch(e){case Ze:case mt:case Zi:case qr:case Ls:case Su:case Ho:case Ps:case Wo:case Go:case Qi:case Ur:case Rs:case Bs:return;case H1:case vs:case As:case jn:case Vo:case Hh:case su:case Y1:case X1:case K1:return"discrete";case zn:case Hr:case Vr:return"flexible";case Wr:case Gr:case er:case yi:case Yh:case V1:case Vh:return}}const uge={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},lge={count:1,min:1,max:1};function _s(e){return!!e&&!!e.argmin}function Ko(e){return!!e&&!!e.argmax}function bC(e){return ue(e)&&!!uge[e]}const cge=["count","valid","missing","distinct"];function c7(e){return ue(e)&&fe(cge,e)}function fge(e){return ue(e)&&fe(["min","max"],e)}const dge=["count","sum","distinct","valid","missing"],hge=["mean","average","median","q1","q3","min","max"],gge=Au(hge);function f7(e){return Nh(e)&&(e=fy(e,void 0)),"bin"+z(e).map(t=>Z1(e[t])?Ke(`_${t}_${_o(e[t])}`):Ke(`_${t}_${e[t]}`)).join("")}function We(e){return e===!0||_u(e)&&!e.binned}function fn(e){return e==="binned"||_u(e)&&e.binned===!0}function _u(e){return ze(e)}function Z1(e){return e==null?void 0:e.param}function Y3(e){switch(e){case vs:case As:case Ls:case zn:case Hr:case Vr:case Ho:case Ps:case Wo:case Go:case jn:return 6;case Vo:return 4;default:return 10}}function Xh(e){return e&&!!e.expr}function Sn(e){const t=z(e||{}),n={};for(const i of t)n[i]=Yn(e[i]);return n}function d7(e){const{anchor:t,frame:n,offset:i,orient:r,color:s,subtitleColor:o,subtitleFont:a,subtitleFontSize:u,subtitleFontStyle:l,subtitleFontWeight:c,subtitleLineHeight:f,subtitlePadding:d,...h}=e,g={...h,...s?{fill:s}:{}},p={...t?{anchor:t}:{},...n?{frame:n}:{},...i?{offset:i}:{},...r?{orient:r}:{}},m={...o?{subtitleColor:o}:{},...a?{subtitleFont:a}:{},...u?{subtitleFontSize:u}:{},...l?{subtitleFontStyle:l}:{},...c?{subtitleFontWeight:c}:{},...f?{subtitleLineHeight:f}:{},...d?{subtitlePadding:d}:{}},y=Pl(g,["align","baseline","dx","dy","limit"]);return{titleMarkConfig:g,subtitleMarkConfig:y,nonMark:p,subtitle:m}}function Xs(e){return ue(e)||K(e)&&ue(e[0])}function te(e){return e&&!!e.signal}function Jo(e){return!!e.step}function pge(e){return K(e)?!1:"fields"in e&&!("data"in e)}function mge(e){return K(e)?!1:"fields"in e&&"data"in e}function ps(e){return K(e)?!1:"field"in e&&"data"in e}const yge={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},bge=z(yge),xge={arc:1,area:1,group:1,image:1,line:1,path:1,rect:1,rule:1,shape:1,symbol:1,text:1,trail:1},xv=["cornerRadius","cornerRadiusTopLeft","cornerRadiusTopRight","cornerRadiusBottomLeft","cornerRadiusBottomRight"];function h7(e){const t=K(e.condition)?e.condition.map(X3):X3(e.condition);return{...Yn(e),condition:t}}function Yn(e){if(Xh(e)){const{expr:t,...n}=e;return{signal:t,...n}}return e}function X3(e){if(Xh(e)){const{expr:t,...n}=e;return{signal:t,...n}}return e}function Xe(e){if(Xh(e)){const{expr:t,...n}=e;return{signal:t,...n}}return te(e)?e:e!==void 0?{value:e}:void 0}function K3(e){return te(e)?e.signal:Ae(e.value)}function Es(e){return te(e)?e.signal:e==null?null:Ae(e)}function vge(e,t,n){for(const i of n){const r=ou(i,t.markDef,t.config);r!==void 0&&(e[i]=Xe(r))}return e}function g7(e){return[].concat(e.type,e.style??[])}function ke(e,t,n,i={}){const{vgChannel:r,ignoreVgConfig:s}=i;return r&&t[r]!==void 0?t[r]:t[e]!==void 0?t[e]:s&&(!r||r===e)?void 0:ou(e,t,n,i)}function ou(e,t,n,{vgChannel:i}={}){return ut(i?nm(e,t,n.style):void 0,nm(e,t,n.style),i?n[t.type][i]:void 0,n[t.type][e],i?n.mark[i]:n.mark[e])}function nm(e,t,n){return p7(e,g7(t),n)}function p7(e,t,n){t=Qe(t);let i;for(const r of t){const s=n[r];s&&s[e]!==void 0&&(i=s[e])}return i}function m7(e,t){return Qe(e).reduce((n,i)=>(n.field.push(q(i,t)),n.order.push(i.sort??"ascending"),n),{field:[],order:[]})}function y7(e,t){const n=[...e];return t.forEach(i=>{for(const r of n)if(fr(r,i))return;n.push(i)}),n}function b7(e,t){return fr(e,t)||!t?e:e?[...Qe(e),...Qe(t)].join(", "):t}function x7(e,t){const n=e.value,i=t.value;if(n==null||i===null)return{explicit:e.explicit,value:null};if((Xs(n)||te(n))&&(Xs(i)||te(i)))return{explicit:e.explicit,value:b7(n,i)};if(Xs(n)||te(n))return{explicit:e.explicit,value:n};if(Xs(i)||te(i))return{explicit:e.explicit,value:i};if(!Xs(n)&&!te(n)&&!Xs(i)&&!te(i))return{explicit:e.explicit,value:y7(n,i)};throw new Error("It should never reach here")}function xC(e){return`Invalid specification ${Ue(e)}. Make sure the specification includes at least one of the following properties: "mark", "layer", "facet", "hconcat", "vconcat", "concat", or "repeat".`}const Age='Autosize "fit" only works for single views and layered views.';function J3(e){return`${e=="width"?"Width":"Height"} "container" only works for single views and layered views.`}function Q3(e){const t=e=="width"?"Width":"Height",n=e=="width"?"x":"y";return`${t} "container" only works well with autosize "fit" or "fit-${n}".`}function Z3(e){return e?`Dropping "fit-${e}" because spec has discrete ${bi(e)}.`:'Dropping "fit" because spec has discrete size.'}function vC(e){return`Unknown field for ${e}. Cannot calculate view size.`}function ek(e){return`Cannot project a selection on encoding channel "${e}", which has no field.`}function Ege(e,t){return`Cannot project a selection on encoding channel "${e}" as it uses an aggregate function ("${t}").`}function wge(e){return`The "nearest" transform is not supported for ${e} marks.`}function v7(e){return`Selection not supported for ${e} yet.`}function $ge(e){return`Cannot find a selection named "${e}".`}const Cge="Scale bindings are currently only supported for scales with unbinned, continuous domains.",Fge="Legend bindings are only supported for selections over an individual field or encoding channel.";function Sge(e){return`Lookups can only be performed on selection parameters. "${e}" is a variable parameter.`}function Dge(e){return`Cannot define and lookup the "${e}" selection in the same view. Try moving the lookup into a second, layered view?`}const _ge="The same selection must be used to override scale domains in a layered view.",kge='Interval selections should be initialized using "x" and/or "y" keys.';function Mge(e){return`Unknown repeated value "${e}".`}function tk(e){return`The "columns" property cannot be used when "${e}" has nested row/column.`}const Oge="Axes cannot be shared in concatenated or repeated views yet (https://github.com/vega/vega-lite/issues/2415).";function Nge(e){return`Unrecognized parse "${e}".`}function nk(e,t,n){return`An ancestor parsed field "${e}" as ${n} but a child wants to parse the field as ${t}.`}const Tge="Attempt to add the same child twice.";function Bge(e){return`Ignoring an invalid transform: ${Ue(e)}.`}const Rge='If "from.fields" is not specified, "as" has to be a string that specifies the key to be used for the data from the secondary source.';function ik(e){return`Config.customFormatTypes is not true, thus custom format type and format for channel ${e} are dropped.`}function Lge(e){const{parentProjection:t,projection:n}=e;return`Layer's shared projection ${Ue(t)} is overridden by a child projection ${Ue(n)}.`}const Pge="Arc marks uses theta channel rather than angle, replacing angle with theta.";function Ige(e,t,n){return`Channel ${e} is a ${t}. Converted to {value: ${Ue(n)}}.`}function A7(e){return`Invalid field type "${e}".`}function zge(e,t){return`Invalid field type "${e}" for aggregate: "${t}", using "quantitative" instead.`}function jge(e){return`Invalid aggregation operator "${e}".`}function E7(e,t){const{fill:n,stroke:i}=t;return`Dropping color ${e} as the plot also has ${n&&i?"fill and stroke":n?"fill":"stroke"}.`}function Uge(e){return`Position range does not support relative band size for ${e}.`}function vv(e,t){return`Dropping ${Ue(e)} from channel "${t}" since it does not contain any data field, datum, value, or signal.`}const qge="Line marks cannot encode size with a non-groupby field. You may want to use trail marks instead.";function ey(e,t,n){return`${e} dropped as it is incompatible with "${t}"${n?` when ${n}`:""}.`}function Wge(e){return`${e}-encoding is dropped as ${e} is not a valid encoding channel.`}function Gge(e){return`${e} encoding should be discrete (ordinal / nominal / binned).`}function Hge(e){return`${e} encoding should be discrete (ordinal / nominal / binned) or use a discretizing scale (e.g. threshold).`}function Vge(e){return`Facet encoding dropped as ${e.join(" and ")} ${e.length>1?"are":"is"} also specified.`}function Zb(e,t){return`Using discrete channel "${e}" to encode "${t}" field can be misleading as it does not encode ${t==="ordinal"?"order":"magnitude"}.`}function Yge(e){return`The ${e} for range marks cannot be an expression`}function Xge(e,t){return`Line mark is for continuous lines and thus cannot be used with ${e&&t?"x2 and y2":e?"x2":"y2"}. We will use the rule mark (line segments) instead.`}function Kge(e,t){return`Specified orient "${e}" overridden with "${t}".`}function Jge(e){return`Cannot use the scale property "${e}" with non-color channel.`}function Qge(e){return`Cannot use the relative band size with ${e} scale.`}function Zge(e){return`Using unaggregated domain with raw field has no effect (${Ue(e)}).`}function epe(e){return`Unaggregated domain not applicable for "${e}" since it produces values outside the origin domain of the source data.`}function tpe(e){return`Unaggregated domain is currently unsupported for log scale (${Ue(e)}).`}function npe(e){return`Cannot apply size to non-oriented mark "${e}".`}function ipe(e,t,n){return`Channel "${e}" does not work with "${t}" scale. We are using "${n}" scale instead.`}function rpe(e,t){return`FieldDef does not work with "${e}" scale. We are using "${t}" scale instead.`}function w7(e,t,n){return`${n}-scale's "${t}" is dropped as it does not work with ${e} scale.`}function $7(e){return`The step for "${e}" is dropped because the ${e==="width"?"x":"y"} is continuous.`}function spe(e,t,n,i){return`Conflicting ${t.toString()} property "${e.toString()}" (${Ue(n)} and ${Ue(i)}). Using ${Ue(n)}.`}function ope(e,t,n,i){return`Conflicting ${t.toString()} property "${e.toString()}" (${Ue(n)} and ${Ue(i)}). Using the union of the two domains.`}function ape(e){return`Setting the scale to be independent for "${e}" means we also have to set the guide (axis or legend) to be independent.`}function upe(e){return`Dropping sort property ${Ue(e)} as unioned domains only support boolean or op "count", "min", and "max".`}const rk="Domains that should be unioned has conflicting sort properties. Sort will be set to true.",lpe="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.",cpe="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.",fpe="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 dpe(e){return`Cannot stack "${e}" if there is already "${e}2".`}function hpe(e){return`Cannot stack non-linear scale (${e}).`}function gpe(e){return`Stacking is applied even though the aggregate function is non-summative ("${e}").`}function im(e,t){return`Invalid ${e}: ${Ue(t)}.`}function ppe(e){return`Dropping day from datetime ${Ue(e)} as day cannot be combined with other units.`}function mpe(e,t){return`${t?"extent ":""}${t&&e?"and ":""}${e?"center ":""}${t&&e?"are ":"is "}not needed when data are aggregated.`}function ype(e,t,n){return`${e} is not usually used with ${t} for ${n}.`}function bpe(e,t){return`Continuous axis should not have customized aggregation function ${e}; ${t} already agregates the axis.`}function sk(e){return`1D error band does not support ${e}.`}function C7(e){return`Channel ${e} is required for "binned" bin.`}function xpe(e){return`Channel ${e} should not be used with "binned" bin.`}function vpe(e){return`Domain for ${e} is required for threshold scale.`}globalThis&&globalThis.__classPrivateFieldSet;globalThis&&globalThis.__classPrivateFieldGet;const F7=yne(HN);let jl=F7;function Ape(e){return jl=e,jl}function Epe(){return jl=F7,jl}function j(...e){jl.warn(...e)}function wpe(...e){jl.debug(...e)}function ku(e){if(e&&ze(e)){for(const t of EC)if(t in e)return!0}return!1}const S7=["january","february","march","april","may","june","july","august","september","october","november","december"],$pe=S7.map(e=>e.substr(0,3)),D7=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"],Cpe=D7.map(e=>e.substr(0,3));function Fpe(e){if(G1(e)&&(e=+e),at(e))return e>4&&j(im("quarter",e)),e-1;throw new Error(im("quarter",e))}function Spe(e){if(G1(e)&&(e=+e),at(e))return e-1;{const t=e.toLowerCase(),n=S7.indexOf(t);if(n!==-1)return n;const i=t.substr(0,3),r=$pe.indexOf(i);if(r!==-1)return r;throw new Error(im("month",e))}}function Dpe(e){if(G1(e)&&(e=+e),at(e))return e%7;{const t=e.toLowerCase(),n=D7.indexOf(t);if(n!==-1)return n;const i=t.substr(0,3),r=Cpe.indexOf(i);if(r!==-1)return r;throw new Error(im("day",e))}}function AC(e,t){const n=[];if(t&&e.day!==void 0&&z(e).length>1&&(j(ppe(e)),e=ce(e),delete e.day),e.year!==void 0?n.push(e.year):n.push(2012),e.month!==void 0){const i=t?Spe(e.month):e.month;n.push(i)}else if(e.quarter!==void 0){const i=t?Fpe(e.quarter):e.quarter;n.push(at(i)?i*3:`${i}*3`)}else n.push(0);if(e.date!==void 0)n.push(e.date);else if(e.day!==void 0){const i=t?Dpe(e.day):e.day;n.push(at(i)?i+1:`${i}+1`)}else n.push(1);for(const i of["hours","minutes","seconds","milliseconds"]){const r=e[i];n.push(typeof r>"u"?0:r)}return n}function Yd(e){const n=AC(e,!0).join(", ");return e.utc?`utc(${n})`:`datetime(${n})`}function _pe(e){const n=AC(e,!1).join(", ");return e.utc?`utc(${n})`:`datetime(${n})`}function kpe(e){const t=AC(e,!0);return e.utc?+new Date(Date.UTC(...t)):+new Date(...t)}const _7={year:1,quarter:1,month:1,week:1,day:1,dayofyear:1,date:1,hours:1,minutes:1,seconds:1,milliseconds:1},EC=z(_7);function Mpe(e){return!!_7[e]}function wC(e){return e.startsWith("utc")}function Ope(e){return e.substr(3)}const Npe={"year-month":"%b %Y ","year-month-date":"%b %d, %Y "};function $C(e){return EC.filter(t=>k7(e,t))}function k7(e,t){const n=e.indexOf(t);return!(n<0||n>0&&t==="seconds"&&e.charAt(n-1)==="i"||e.length>n+3&&t==="day"&&e.charAt(n+3)==="o"||n>0&&t==="year"&&e.charAt(n-1)==="f")}function Tpe(e,t,{end:n}={end:!1}){const i=dC(t),r=wC(e)?"utc":"";function s(u){return u==="quarter"?`(${r}quarter(${i})-1)`:`${r}${u}(${i})`}let o;const a={};for(const u of EC)k7(e,u)&&(a[u]=s(u),o=u);return n&&(a[o]+="+1"),_pe(a)}function M7(e){if(!e)return;const t=$C(e);return`timeUnitSpecifier(${Ue(t)}, ${Ue(Npe)})`}function Bpe(e,t,n){if(!e)return;const i=M7(e);return`${n||wC(e)?"utc":"time"}Format(${t}, ${i})`}function xn(e){if(!e)return;let t;return ue(e)?t={unit:e}:ze(e)&&(t={...e,...e.unit?{unit:e.unit}:{}}),wC(t.unit)&&(t.utc=!0,t.unit=Ope(t.unit)),t}function Rpe(e){const{utc:t,...n}=xn(e);return n.unit?(t?"utc":"")+z(n).map(i=>Ke(`${i==="unit"?"":`_${i}_`}${n[i]}`)).join(""):(t?"utc":"")+"timeunit"+z(n).map(i=>Ke(`_${i}_${n[i]}`)).join("")}function Lpe(e){return e==null?void 0:e.param}function CC(e){return e&&!!e.field&&e.equal!==void 0}function FC(e){return e&&!!e.field&&e.lt!==void 0}function SC(e){return e&&!!e.field&&e.lte!==void 0}function DC(e){return e&&!!e.field&&e.gt!==void 0}function _C(e){return e&&!!e.field&&e.gte!==void 0}function kC(e){if(e&&e.field){if(K(e.range)&&e.range.length===2)return!0;if(te(e.range))return!0}return!1}function MC(e){return e&&!!e.field&&(K(e.oneOf)||K(e.in))}function Ppe(e){return e&&!!e.field&&e.valid!==void 0}function O7(e){return MC(e)||CC(e)||kC(e)||FC(e)||DC(e)||SC(e)||_C(e)}function rr(e,t){return dy(e,{timeUnit:t,wrapTime:!0})}function Ipe(e,t){return e.map(n=>rr(n,t))}function N7(e,t=!0){var s;const{field:n}=e,i=(s=xn(e.timeUnit))==null?void 0:s.unit,r=i?`time(${Tpe(i,n)})`:q(e,{expr:"datum"});if(CC(e))return`${r}===${rr(e.equal,i)}`;if(FC(e)){const o=e.lt;return`${r}<${rr(o,i)}`}else if(DC(e)){const o=e.gt;return`${r}>${rr(o,i)}`}else if(SC(e)){const o=e.lte;return`${r}<=${rr(o,i)}`}else if(_C(e)){const o=e.gte;return`${r}>=${rr(o,i)}`}else{if(MC(e))return`indexof([${Ipe(e.oneOf,i).join(",")}], ${r}) !== -1`;if(Ppe(e))return OC(r,e.valid);if(kC(e)){const{range:o}=e,a=te(o)?{signal:`${o.signal}[0]`}:o[0],u=te(o)?{signal:`${o.signal}[1]`}:o[1];if(a!==null&&u!==null&&t)return"inrange("+r+", ["+rr(a,i)+", "+rr(u,i)+"])";const l=[];return a!==null&&l.push(`${r} >= ${rr(a,i)}`),u!==null&&l.push(`${r} <= ${rr(u,i)}`),l.length>0?l.join(" && "):"true"}}throw new Error(`Invalid field predicate: ${Ue(e)}`)}function OC(e,t=!0){return t?`isValid(${e}) && isFinite(+${e})`:`!isValid(${e}) || !isFinite(+${e})`}function zpe(e){var t;return O7(e)&&e.timeUnit?{...e,timeUnit:(t=xn(e.timeUnit))==null?void 0:t.unit}:e}const Kh={quantitative:"quantitative",ordinal:"ordinal",temporal:"temporal",nominal:"nominal",geojson:"geojson"},au=Kh.quantitative,NC=Kh.ordinal,Ul=Kh.temporal,TC=Kh.nominal,Mc=Kh.geojson;function jpe(e){if(e)switch(e=e.toLowerCase(),e){case"q":case au:return"quantitative";case"t":case Ul:return"temporal";case"o":case NC:return"ordinal";case"n":case TC:return"nominal";case Mc:return"geojson"}}const ft={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"},Av={linear:"numeric",log:"numeric",pow:"numeric",sqrt:"numeric",symlog:"numeric",identity:"numeric",sequential:"numeric",time:"time",utc:"time",ordinal:"ordinal","bin-ordinal":"bin-ordinal",point:"ordinal-position",band:"ordinal-position",quantile:"discretizing",quantize:"discretizing",threshold:"discretizing"};function Upe(e,t){const n=Av[e],i=Av[t];return n===i||n==="ordinal-position"&&i==="time"||i==="ordinal-position"&&n==="time"}const qpe={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 ok(e){return qpe[e]}const T7=["linear","log","pow","sqrt","symlog","time","utc"],Wpe=Au(T7),Gpe=["linear","log","pow","sqrt","symlog"],Hpe=Au(Gpe);function Vpe(e){return e in Hpe}const Ype=["quantile","quantize","threshold"],Xpe=Au(Ype),Kpe=T7.concat(["quantile","quantize","threshold","sequential","identity"]),Jpe=Au(Kpe),Qpe=["ordinal","bin-ordinal","point","band"],Zpe=Au(Qpe);function tn(e){return e in Zpe}function ii(e){return e in Jpe}function Li(e){return e in Wpe}function Xd(e){return e in Xpe}const eme={pointPadding:.5,barBandPaddingInner:.1,rectBandPaddingInner:0,minBandSize:2,minFontSize:8,maxFontSize:40,minOpacity:.3,maxOpacity:.8,minSize:9,minStrokeWidth:1,maxStrokeWidth:4,quantileCount:4,quantizeCount:4};function tme(e){return!ue(e)&&!!e.name}function B7(e){return e==null?void 0:e.param}function nme(e){return e&&e.unionWith}const ime={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:W$e,domain:G$e,range:H$e,rangeMax:V$e,rangeMin:Y$e,scheme:X$e,...rme}=ime,sme=z(rme);function Ev(e,t){switch(t){case"type":case"domain":case"reverse":case"range":return!0;case"scheme":case"interpolate":return!["point","band","identity"].includes(e);case"bins":return!["point","band","identity","ordinal"].includes(e);case"round":return Li(e)||e==="band"||e==="point";case"padding":case"rangeMin":case"rangeMax":return Li(e)||["point","band"].includes(e);case"paddingOuter":case"align":return["point","band"].includes(e);case"paddingInner":return e==="band";case"domainMax":case"domainMid":case"domainMin":case"clamp":return Li(e);case"nice":return Li(e)||e==="quantize"||e==="threshold";case"exponent":return e==="pow";case"base":return e==="log";case"constant":return e==="symlog";case"zero":return ii(e)&&!fe(["log","time","utc","threshold","quantile"],e)}}function R7(e,t){switch(t){case"interpolate":case"scheme":case"domainMid":return cl(e)?void 0:Jge(e);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}}function ome(e,t){return fe([NC,TC],t)?e===void 0||tn(e):t===Ul?fe([ft.TIME,ft.UTC,void 0],e):t===au?fe([ft.LOG,ft.POW,ft.SQRT,ft.SYMLOG,ft.QUANTILE,ft.QUANTIZE,ft.THRESHOLD,ft.LINEAR,void 0],e):!0}function ame(e,t){if(!Xo(e))return!1;switch(e){case Ze:case mt:case Zi:case qr:return Li(t)||fe(["band","point"],t);case Ls:case Ho:case Ps:case Wo:case Go:case Su:return Li(t)||Xd(t)||fe(["band","point","ordinal"],t);case zn:case Hr:case Vr:return t!=="band";case Vo:case jn:return t==="ordinal"||Xd(t)}}const An={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"},L7=An.arc,ty=An.area,ny=An.bar,ume=An.image,iy=An.line,ry=An.point,lme=An.rect,rm=An.rule,P7=An.text,BC=An.tick,cme=An.trail,RC=An.circle,LC=An.square,I7=An.geoshape;function Qo(e){return["line","area","trail"].includes(e)}function z7(e){return["rect","bar","image","arc"].includes(e)}const j7=z(An);function kr(e){return e.type}Au(j7);const fme=["stroke","strokeWidth","strokeDash","strokeDashOffset","strokeOpacity","strokeJoin","strokeMiterLimit"],dme=["fill","fillOpacity"],hme=[...fme,...dme],gme={color:1,filled:1,invalid:1,order:1,radius2:1,theta2:1,timeUnitBandSize:1,timeUnitBandPosition:1},ak=z(gme),pme={area:["line","point"],bar:["binSpacing","continuousBandSize","discreteBandSize"],rect:["binSpacing","continuousBandSize","discreteBandSize"],line:["point"],tick:["bandSize","thickness"]},mme={color:"#4c78a8",invalid:"filter",timeUnitBandSize:1},yme={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},U7=z(yme);function Oc(e){return e&&e.band!=null}const bme={horizontal:["cornerRadiusTopRight","cornerRadiusBottomRight"],vertical:["cornerRadiusTopLeft","cornerRadiusTopRight"]},q7=5,xme={binSpacing:1,continuousBandSize:q7,timeUnitBandPosition:.5},vme={binSpacing:0,continuousBandSize:q7,timeUnitBandPosition:.5},Ame={thickness:1};function Eme(e){return kr(e)?e.type:e}function PC(e){const{channel:t,channelDef:n,markDef:i,scale:r,config:s}=e,o=G7(e);return W(n)&&!c7(n.aggregate)&&r&&Li(r.get("type"))&&r.get("zero")===!1?W7({fieldDef:n,channel:t,markDef:i,ref:o,config:s}):o}function W7({fieldDef:e,channel:t,markDef:n,ref:i,config:r}){return Qo(n.type)||ke("invalid",n,r)===null?i:[wme(e,t),i]}function wme(e,t){const n=IC(e,!0),r=Du(t)==="y"?{field:{group:"height"}}:{value:0};return{test:n,...r}}function IC(e,t=!0){return OC(ue(e)?e:q(e,{expr:"datum"}),!t)}function $me(e){const{datum:t}=e;return ku(t)?Yd(t):`${Ue(t)}`}function Ua(e,t,n,i){const r={};if(t&&(r.scale=t),Zo(e)){const{datum:s}=e;ku(s)?r.signal=Yd(s):te(s)?r.signal=s.signal:Xh(s)?r.signal=s.expr:r.value=s}else r.field=q(e,n);if(i){const{offset:s,band:o}=i;s&&(r.offset=s),o&&(r.band=o)}return r}function sm({scaleName:e,fieldOrDatumDef:t,fieldOrDatumDef2:n,offset:i,startSuffix:r,bandPosition:s=.5}){const o=0<s&&s<1?"datum":void 0,a=q(t,{expr:o,suffix:r}),u=n!==void 0?q(n,{expr:o}):q(t,{suffix:"end",expr:o}),l={};if(s===0||s===1){l.scale=e;const c=s===0?a:u;l.field=c}else{const c=te(s)?`${s.signal} * ${a} + (1-${s.signal}) * ${u}`:`${s} * ${a} + ${1-s} * ${u}`;l.signal=`scale("${e}", ${c})`}return i&&(l.offset=i),l}function G7({channel:e,channelDef:t,channel2Def:n,markDef:i,config:r,scaleName:s,scale:o,stack:a,offset:u,defaultRef:l,bandPosition:c}){if(t){if(re(t)){if(xi(t)){c??(c=eR({fieldDef:t,fieldDef2:n,markDef:i,config:r}));const{bin:d,timeUnit:h,type:g}=t;if(We(d)||c&&h&&g===Ul)return a&&a.impute?Ua(t,s,{binSuffix:"mid"},{offset:u}):c?sm({scaleName:s,fieldOrDatumDef:t,bandPosition:c,offset:u}):Ua(t,s,Qh(t,e)?{binSuffix:"range"}:{},{offset:u});if(fn(d)){if(W(n))return sm({scaleName:s,fieldOrDatumDef:t,fieldOrDatumDef2:n,bandPosition:c,offset:u});j(C7(e===Ze?Qi:Ur))}}const f=o==null?void 0:o.get("type");return Ua(t,s,tn(f)?{binSuffix:"range"}:{},{offset:u,band:f==="band"?c??t.bandPosition??.5:void 0})}else if(Hi(t)){const f=t.value,d=u?{offset:u}:{};return{...od(e,f),...d}}}return YN(l)&&(l=l()),l&&{...l,...u?{offset:u}:{}}}function od(e,t){return fe(["x","x2"],e)&&t==="width"?{field:{group:"width"}}:fe(["y","y2"],e)&&t==="height"?{field:{group:"height"}}:Xe(t)}function uu(e){return e&&e!=="number"&&e!=="time"}function H7(e,t,n){return`${e}(${t}${n?`, ${Ue(n)}`:""})`}const Cme=" ";function zC({fieldOrDatumDef:e,format:t,formatType:n,expr:i,normalizeStack:r,config:s}){var a,u;if(uu(n))return jC({fieldOrDatumDef:e,format:t,formatType:n,expr:i,config:s});const o=V7(e,i,r);if(ql(e)){const l=Sme(o,W(e)?(a=xn(e.timeUnit))==null?void 0:a.unit:void 0,t,s.timeFormat,Nc(e)&&((u=e.scale)==null?void 0:u.type)===ft.UTC);return l?{signal:l}:void 0}if(t=K7(Ks(e),t,s),W(e)&&We(e.bin)){const l=q(e,{expr:i,binSuffix:"end"});return{signal:sy(o,l,t,n,s)}}else return t||Ks(e)==="quantitative"?{signal:`${J7(o,t)}`}:{signal:`isValid(${o}) ? ${o} : ""+${o}`}}function V7(e,t,n){return W(e)?n?`${q(e,{expr:t,suffix:"end"})}-${q(e,{expr:t,suffix:"start"})}`:q(e,{expr:t}):$me(e)}function jC({fieldOrDatumDef:e,format:t,formatType:n,expr:i,normalizeStack:r,config:s,field:o}){if(o??(o=V7(e,i,r)),W(e)&&We(e.bin)){const a=q(e,{expr:i,binSuffix:"end"});return{signal:sy(o,a,t,n,s)}}return{signal:H7(n,o,t)}}function Y7(e,t,n,i,r,s){var o;if(!uu(i)){if(ql(e)){const a=W(e)?(o=xn(e.timeUnit))==null?void 0:o.unit:void 0;return Fme(n,a,r,s)}return K7(t,n,r)}}function X7(e,t,n){if(e&&(te(e)||e==="number"||e==="time"))return e;if(ql(t)&&n!=="time"&&n!=="utc")return"time"}function K7(e,t,n){if(ue(t))return t;if(e===au)return n.numberFormat}function Fme(e,t,n,i){return e||(t?{signal:M7(t)}:i?void 0:n.timeFormat)}function J7(e,t){return`format(${e}, "${t||""}")`}function uk(e,t,n,i){return uu(n)?H7(n,e,t):J7(e,(ue(t)?t:void 0)??i.numberFormat)}function sy(e,t,n,i,r){const s=uk(e,n,i,r),o=uk(t,n,i,r);return`${OC(e,!1)} ? "null" : ${s} + "${Cme}" + ${o}`}function Sme(e,t,n,i,r){return!t||n?(n=ue(n)?n:i,`${r?"utc":"time"}Format(${e}, '${n}')`):Bpe(t,e,r)}const oy="min",Dme={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 lk(e){return e in Dme}function Q7(e){return!!e&&!!e.encoding}function vr(e){return!!e&&(e.op==="count"||!!e.field)}function Z7(e){return!!e&&K(e)}function Jh(e){return"row"in e||"column"in e}function UC(e){return!!e&&"header"in e}function ay(e){return"facet"in e}function _me(e){return e.param}function kme(e){return e&&!ue(e)&&"repeat"in e}function ck(e){const{field:t,timeUnit:n,bin:i,aggregate:r}=e;return{...n?{timeUnit:n}:{},...i?{bin:i}:{},...r?{aggregate:r}:{},field:t}}function qC(e){return"sort"in e}function eR({fieldDef:e,fieldDef2:t,markDef:n,config:i}){if(re(e)&&e.bandPosition!==void 0)return e.bandPosition;if(W(e)){const{timeUnit:r,bin:s}=e;if(r&&!t)return z7(n.type)?0:ou("timeUnitBandPosition",n,i);if(We(s))return .5}}function tR({channel:e,fieldDef:t,fieldDef2:n,markDef:i,config:r,scaleType:s,useVlSizeChannel:o}){var l,c,f;const a=bi(e),u=ke(o?"size":a,i,r,{vgChannel:a});if(u!==void 0)return u;if(W(t)){const{timeUnit:d,bin:h}=t;if(d&&!n)return{band:ou("timeUnitBandSize",i,r)};if(We(h)&&!tn(s))return{band:1}}if(z7(i.type))return s?tn(s)?((l=r[i.type])==null?void 0:l.discreteBandSize)||{band:1}:(c=r[i.type])==null?void 0:c.continuousBandSize:(f=r[i.type])==null?void 0:f.discreteBandSize}function nR(e,t,n,i){return We(e.bin)||e.timeUnit&&xi(e)&&e.type==="temporal"?eR({fieldDef:e,fieldDef2:t,markDef:n,config:i})!==void 0:!1}function uy(e){return!!e&&"condition"in e}function ly(e){const t=e&&e.condition;return!!t&&!K(t)&&W(t)}function cy(e){const t=e&&e.condition;return!!t&&!K(t)&&re(t)}function Mme(e){const t=e&&e.condition;return!!t&&(K(t)||Hi(t))}function W(e){return!!e&&(!!e.field||e.aggregate==="count")}function Ks(e){return e&&e.type}function Zo(e){return!!e&&"datum"in e}function hr(e){return xi(e)&&!om(e)||wv(e)}function wv(e){return Zo(e)&&at(e.datum)}function re(e){return W(e)||Zo(e)}function xi(e){return!!e&&("field"in e||e.aggregate==="count")&&"type"in e}function Hi(e){return e&&"value"in e&&"value"in e}function Nc(e){return!!e&&("scale"in e||"sort"in e)}function WC(e){return e&&("axis"in e||"stack"in e||"impute"in e)}function iR(e){return!!e&&"legend"in e}function rR(e){return!!e&&("format"in e||"formatType"in e)}function Ome(e){return Qn(e,["legend","axis","header","scale"])}function Nme(e){return"op"in e}function q(e,t={}){let n=e.field;const i=t.prefix;let r=t.suffix,s="";if(Bme(e))n=ZB("count");else{let o;if(!t.nofn)if(Nme(e))o=e.op;else{const{bin:a,aggregate:u,timeUnit:l}=e;We(a)?(o=f7(a),r=(t.binSuffix??"")+(t.suffix??"")):u?Ko(u)?(s=`["${n}"]`,n=`argmax_${u.argmax}`):_s(u)?(s=`["${n}"]`,n=`argmin_${u.argmin}`):o=String(u):l&&(o=Rpe(l),r=(!["range","mid"].includes(t.binSuffix)&&t.binSuffix||"")+(t.suffix??""))}o&&(n=n?`${o}_${n}`:o)}return r&&(n=`${n}_${r}`),i&&(n=`${i}_${n}`),t.forAs?hC(n):t.expr?KB(n,t.expr)+s:mi(n)+s}function om(e){switch(e.type){case"nominal":case"ordinal":case"geojson":return!0;case"quantitative":return W(e)&&!!e.bin;case"temporal":return!1}throw new Error(A7(e.type))}function Tme(e){var t;return Nc(e)&&Xd((t=e.scale)==null?void 0:t.type)}function Bme(e){return e.aggregate==="count"}function Rme(e,t){var o;const{field:n,bin:i,timeUnit:r,aggregate:s}=e;if(s==="count")return t.countTitle;if(We(i))return`${n} (binned)`;if(r){const a=(o=xn(r))==null?void 0:o.unit;if(a)return`${n} (${$C(a).join("-")})`}else if(s)return Ko(s)?`${n} for max ${s.argmax}`:_s(s)?`${n} for min ${s.argmin}`:`${Gh(s)} of ${n}`;return n}function Lme(e){const{aggregate:t,bin:n,timeUnit:i,field:r}=e;if(Ko(t))return`${r} for argmax(${t.argmax})`;if(_s(t))return`${r} for argmin(${t.argmin})`;const s=xn(i),o=t||(s==null?void 0:s.unit)||(s==null?void 0:s.maxbins)&&"timeunit"||We(n)&&"bin";return o?`${o.toUpperCase()}(${r})`:r}const sR=(e,t)=>{switch(t.fieldTitle){case"plain":return e.field;case"functional":return Lme(e);default:return Rme(e,t)}};let oR=sR;function aR(e){oR=e}function Pme(){aR(sR)}function fl(e,t,{allowDisabling:n,includeDefault:i=!0}){var a;const r=(a=GC(e))==null?void 0:a.title;if(!W(e))return r;const s=e,o=i?HC(s,t):void 0;return n?ut(r,s.title,o):r??s.title??o}function GC(e){if(WC(e)&&e.axis)return e.axis;if(iR(e)&&e.legend)return e.legend;if(UC(e)&&e.header)return e.header}function HC(e,t){return oR(e,t)}function am(e){if(rR(e)){const{format:t,formatType:n}=e;return{format:t,formatType:n}}else{const t=GC(e)??{},{format:n,formatType:i}=t;return{format:n,formatType:i}}}function Ime(e,t){var s;switch(t){case"latitude":case"longitude":return"quantitative";case"row":case"column":case"facet":case"shape":case"strokeDash":return"nominal";case"order":return"ordinal"}if(qC(e)&&K(e.sort))return"ordinal";const{aggregate:n,bin:i,timeUnit:r}=e;if(r)return"temporal";if(i||n&&!Ko(n)&&!_s(n))return"quantitative";if(Nc(e)&&((s=e.scale)!=null&&s.type))switch(Av[e.scale.type]){case"numeric":case"discretizing":return"quantitative";case"time":return"temporal"}return"nominal"}function Mr(e){if(W(e))return e;if(ly(e))return e.condition}function gt(e){if(re(e))return e;if(cy(e))return e.condition}function uR(e,t,n,i={}){if(ue(e)||at(e)||Nh(e)){const r=ue(e)?"string":at(e)?"number":"boolean";return j(Ige(t,r,e)),{value:e}}return re(e)?um(e,t,n,i):cy(e)?{...e,condition:um(e.condition,t,n,i)}:e}function um(e,t,n,i){if(rR(e)){const{format:r,formatType:s,...o}=e;if(uu(s)&&!n.customFormatTypes)return j(ik(t)),um(o,t,n,i)}else{const r=WC(e)?"axis":iR(e)?"legend":UC(e)?"header":null;if(r&&e[r]){const{format:s,formatType:o,...a}=e[r];if(uu(o)&&!n.customFormatTypes)return j(ik(t)),um({...e,[r]:a},t,n,i)}}return W(e)?VC(e,t,i):zme(e)}function zme(e){let t=e.type;if(t)return e;const{datum:n}=e;return t=at(n)?"quantitative":ue(n)?"nominal":ku(n)?"temporal":void 0,{...e,type:t}}function VC(e,t,{compositeMark:n=!1}={}){const{aggregate:i,timeUnit:r,bin:s,field:o}=e,a={...e};if(!n&&i&&!bC(i)&&!Ko(i)&&!_s(i)&&(j(jge(i)),delete a.aggregate),r&&(a.timeUnit=xn(r)),o&&(a.field=`${o}`),We(s)&&(a.bin=fy(s,t)),fn(s)&&!_r(t)&&j(xpe(t)),xi(a)){const{type:u}=a,l=jpe(u);u!==l&&(a.type=l),u!=="quantitative"&&c7(i)&&(j(zge(u,i)),a.type="quantitative")}else if(!o7(t)){const u=Ime(a,t);a.type=u}if(xi(a)){const{compatible:u,warning:l}=jme(a,t)||{};u===!1&&j(l)}if(qC(a)&&ue(a.sort)){const{sort:u}=a;if(lk(u))return{...a,sort:{encoding:u}};const l=u.substr(1);if(u.charAt(0)==="-"&&lk(l))return{...a,sort:{encoding:l,order:"descending"}}}if(UC(a)){const{header:u}=a;if(u){const{orient:l,...c}=u;if(l)return{...a,header:{...c,labelOrient:u.labelOrient||l,titleOrient:u.titleOrient||l}}}}return a}function fy(e,t){return Nh(e)?{maxbins:Y3(t)}:e==="binned"?{binned:!0}:!e.maxbins&&!e.step?{...e,maxbins:Y3(t)}:e}const qu={compatible:!0};function jme(e,t){const n=e.type;if(n==="geojson"&&t!=="shape")return{compatible:!1,warning:`Channel ${t} should not be used with a geojson data.`};switch(t){case vs:case As:case H1:return om(e)?qu:{compatible:!1,warning:Gge(t)};case Ze:case mt:case zn:case Hr:case Vr:case Hh:case Yh:case V1:case su:case Y1:case X1:case Su:case Zi:case qr:case K1:return qu;case Gr:case yi:case Wr:case er:return n!==au?{compatible:!1,warning:`Channel ${t} should be used with a quantitative field only, not ${e.type} field.`}:qu;case Ps:case Wo:case Go:case Ho:case Ls:case Rs:case Bs:case Qi:case Ur:return n==="nominal"&&!e.sort?{compatible:!1,warning:`Channel ${t} should not be used with an unsorted discrete field.`}:qu;case jn:case Vo:return!om(e)&&!Tme(e)?{compatible:!1,warning:Hge(t)}:qu;case Vh:return e.type==="nominal"&&!("sort"in e)?{compatible:!1,warning:"Channel order is inappropriate for nominal field, which has no inherent order."}:qu}}function ql(e){const{formatType:t}=am(e);return t==="time"||!t&&Ume(e)}function Ume(e){return e&&(e.type==="temporal"||W(e)&&!!e.timeUnit)}function dy(e,{timeUnit:t,type:n,wrapTime:i,undefinedIfExprNotRequired:r}){var u;const s=t&&((u=xn(t))==null?void 0:u.unit);let o=s||n==="temporal",a;return Xh(e)?a=e.expr:te(e)?a=e.signal:ku(e)?(o=!0,a=Yd(e)):(ue(e)||at(e))&&o&&(a=`datetime(${Ue(e)})`,Mpe(s)&&(at(e)&&e<1e4||ue(e)&&isNaN(Date.parse(e)))&&(a=Yd({[s]:e}))),a?i&&o?`time(${a})`:a:r?void 0:Ue(e)}function lR(e,t){const{type:n}=e;return t.map(i=>{const r=dy(i,{timeUnit:W(e)?e.timeUnit:void 0,type:n,undefinedIfExprNotRequired:!0});return r!==void 0?{signal:r}:i})}function Qh(e,t){return We(e.bin)?Xo(t)&&["ordinal","nominal"].includes(e.type):(console.warn("Only call this method for binned field defs."),!1)}const fk={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 Zh(e){return e&&e.condition}const cR=["domain","grid","labels","ticks","title"],qme={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"},fR={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},Wme={...fR,style:1,labelExpr:1,encoding:1};function dk(e){return!!Wme[e]}const Gme={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},dR=z(Gme);function zs(e){return"mark"in e}class hy{constructor(t,n){this.name=t,this.run=n}hasMatchingType(t){return zs(t)?Eme(t.mark)===this.name:!1}}function qa(e,t){const n=e&&e[t];return n?K(n)?Il(n,i=>!!i.field):W(n)||ly(n):!1}function YC(e){return Il(Y0e,t=>{if(qa(e,t)){const n=e[t];if(K(n))return Il(n,i=>!!i.aggregate);{const i=Mr(n);return i&&!!i.aggregate}}return!1})}function hR(e,t){const n=[],i=[],r=[],s=[],o={};return XC(e,(a,u)=>{if(W(a)){const{field:l,aggregate:c,bin:f,timeUnit:d,...h}=a;if(c||d||f){const g=GC(a),p=g&&g.title;let m=q(a,{forAs:!0});const y={...p?[]:{title:fl(a,t,{allowDisabling:!0})},...h,field:m};if(c){let b;if(Ko(c)?(b="argmax",m=q({op:"argmax",field:c.argmax},{forAs:!0}),y.field=`${m}.${l}`):_s(c)?(b="argmin",m=q({op:"argmin",field:c.argmin},{forAs:!0}),y.field=`${m}.${l}`):c!=="boxplot"&&c!=="errorbar"&&c!=="errorband"&&(b=c),b){const x={op:b,as:m};l&&(x.field=l),s.push(x)}}else if(n.push(m),xi(a)&&We(f)){if(i.push({bin:f,field:l,as:m}),n.push(q(a,{binSuffix:"end"})),Qh(a,u)&&n.push(q(a,{binSuffix:"range"})),_r(u)){const b={field:`${m}_end`};o[`${u}2`]=b}y.bin="binned",o7(u)||(y.type=au)}else if(d){r.push({timeUnit:d,field:l,as:m});const b=xi(a)&&a.type!==Ul&&"time";b&&(u===Hh||u===su?y.formatType=b:ige(u)?y.legend={formatType:b,...y.legend}:_r(u)&&(y.axis={formatType:b,...y.axis}))}o[u]=y}else n.push(l),o[u]=e[u]}else o[u]=e[u]}),{bins:i,timeUnits:r,aggregate:s,groupby:n,encoding:o}}function Hme(e,t,n){const i=sge(t,n);if(i){if(i==="binned"){const r=e[t===Qi?Ze:mt];return!!(W(r)&&W(e[t])&&fn(r.bin))}}else return!1;return!0}function Vme(e,t,n,i){return z(e).reduce((r,s)=>{if(!s7(s))return j(Wge(s)),r;const o=e[s];if(s==="angle"&&t==="arc"&&!e.theta&&(j(Pge),s=Zi),!Hme(e,s,t))return j(ey(s,t)),r;if(s===Ls&&t==="line"){const a=Mr(e[s]);if(a!=null&&a.aggregate)return j(qge),r}if(s===zn&&(n?"fill"in e:"stroke"in e))return j(E7("encoding",{fill:"fill"in e,stroke:"stroke"in e})),r;if(s===Yh||s===Vh&&!K(o)&&!Hi(o)||s===su&&K(o))o&&(r[s]=Qe(o).reduce((a,u)=>(W(u)?a.push(VC(u,s)):j(vv(u,s)),a),[]));else{if(s===su&&o===null)r[s]=null;else if(!W(o)&&!Zo(o)&&!Hi(o)&&!uy(o)&&!te(o))return j(vv(o,s)),r;r[s]=uR(o,s,i)}return r},{})}function gy(e,t){const n={};for(const i of z(e)){const r=uR(e[i],i,t,{compositeMark:!0});n[i]=r}return n}function Yme(e){const t=[];for(const n of z(e))if(qa(e,n)){const i=e[n],r=Qe(i);for(const s of r)W(s)?t.push(s):ly(s)&&t.push(s.condition)}return t}function XC(e,t,n){if(e)for(const i of z(e)){const r=e[i];if(K(r))for(const s of r)t.call(n,s,i);else t.call(n,r,i)}}function Xme(e,t,n,i){return e?z(e).reduce((r,s)=>{const o=e[s];return K(o)?o.reduce((a,u)=>t.call(i,a,u,s),r):t.call(i,r,o,s)},n):n}function gR(e,t){return z(t).reduce((n,i)=>{switch(i){case Ze:case mt:case Y1:case K1:case X1:case Qi:case Ur:case Zi:case Rs:case qr:case Bs:case Wr:case Gr:case er:case yi:case Hh:case jn:case Su:case su:return n;case Vh:if(e==="line"||e==="trail")return n;case Yh:case V1:{const r=t[i];if(K(r)||W(r))for(const s of Qe(r))s.aggregate||n.push(q(s,{}));return n}case Ls:if(e==="trail")return n;case zn:case Hr:case Vr:case Ps:case Wo:case Go:case Vo:case Ho:{const r=Mr(t[i]);return r&&!r.aggregate&&n.push(q(r,{})),n}}},[])}function Kme(e){const{tooltip:t,...n}=e;if(!t)return{filteredEncoding:n};let i,r;if(K(t)){for(const s of t)s.aggregate?(i||(i=[]),i.push(s)):(r||(r=[]),r.push(s));i&&(n.tooltip=i)}else t.aggregate?n.tooltip=t:r=t;return K(r)&&r.length===1&&(r=r[0]),{customTooltipWithoutAggregatedField:r,filteredEncoding:n}}function $v(e,t,n,i=!0){if("tooltip"in n)return{tooltip:n.tooltip};const r=e.map(({fieldPrefix:o,titlePrefix:a})=>{const u=i?` of ${KC(t)}`:"";return{field:o+t.field,type:t.type,title:te(a)?{signal:`${a}"${escape(u)}"`}:a+u}}),s=Yme(n).map(Ome);return{tooltip:[...r,...dr(s,ye)]}}function KC(e){const{title:t,field:n}=e;return ut(t,n)}function JC(e,t,n,i,r){const{scale:s,axis:o}=n;return({partName:a,mark:u,positionPrefix:l,endPositionPrefix:c=void 0,extraEncoding:f={}})=>{const d=KC(n);return pR(e,a,r,{mark:u,encoding:{[t]:{field:`${l}_${n.field}`,type:n.type,...d!==void 0?{title:d}:{},...s!==void 0?{scale:s}:{},...o!==void 0?{axis:o}:{}},...ue(c)?{[`${t}2`]:{field:`${c}_${n.field}`}}:{},...i,...f}})}}function pR(e,t,n,i){const{clip:r,color:s,opacity:o}=e,a=e.type;return e[t]||e[t]===void 0&&n[t]?[{...i,mark:{...n[t],...r?{clip:r}:{},...s?{color:s}:{},...o?{opacity:o}:{},...kr(i.mark)?i.mark:{type:i.mark},style:`${a}-${t}`,...Nh(e[t])?{}:e[t]}}]:[]}function mR(e,t,n){const{encoding:i}=e,r=t==="vertical"?"y":"x",s=i[r],o=i[`${r}2`],a=i[`${r}Error`],u=i[`${r}Error2`];return{continuousAxisChannelDef:z0(s,n),continuousAxisChannelDef2:z0(o,n),continuousAxisChannelDefError:z0(a,n),continuousAxisChannelDefError2:z0(u,n),continuousAxis:r}}function z0(e,t){if(e&&e.aggregate){const{aggregate:n,...i}=e;return n!==t&&j(bpe(n,t)),i}else return e}function yR(e,t){const{mark:n,encoding:i}=e,{x:r,y:s}=i;if(kr(n)&&n.orient)return n.orient;if(hr(r)){if(hr(s)){const o=W(r)&&r.aggregate,a=W(s)&&s.aggregate;if(!o&&a===t)return"vertical";if(!a&&o===t)return"horizontal";if(o===t&&a===t)throw new Error("Both x and y cannot have aggregate");return ql(s)&&!ql(r)?"horizontal":"vertical"}return"horizontal"}else{if(hr(s))return"vertical";throw new Error(`Need a valid continuous axis for ${t}s`)}}const lm="boxplot",Jme=["box","median","outliers","rule","ticks"],Qme=new hy(lm,xR);function bR(e){return at(e)?"tukey":e}function xR(e,{config:t}){e={...e,encoding:gy(e.encoding,t)};const{mark:n,encoding:i,params:r,projection:s,...o}=e,a=kr(n)?n:{type:n};r&&j(v7("boxplot"));const u=a.extent??t.boxplot.extent,l=ke("size",a,t),c=bR(u),{bins:f,timeUnits:d,transform:h,continuousAxisChannelDef:g,continuousAxis:p,groupby:m,aggregate:y,encodingWithoutContinuousAxis:b,ticksOrient:x,boxOrient:v,customTooltipWithoutAggregatedField:A}=Zme(e,u,t),{color:w,size:E,...$}=b,k=nn=>JC(a,p,g,nn,t.boxplot),F=k($),D=k(b),T=k({...$,...E?{size:E}:{}}),C=$v([{fieldPrefix:c==="min-max"?"upper_whisker_":"max_",titlePrefix:"Max"},{fieldPrefix:"upper_box_",titlePrefix:"Q3"},{fieldPrefix:"mid_box_",titlePrefix:"Median"},{fieldPrefix:"lower_box_",titlePrefix:"Q1"},{fieldPrefix:c==="min-max"?"lower_whisker_":"min_",titlePrefix:"Min"}],g,b),_={type:"tick",color:"black",opacity:1,orient:x,invalid:null,aria:!1},S=c==="min-max"?C:$v([{fieldPrefix:"upper_whisker_",titlePrefix:"Upper Whisker"},{fieldPrefix:"lower_whisker_",titlePrefix:"Lower Whisker"}],g,b),M=[...F({partName:"rule",mark:{type:"rule",invalid:null,aria:!1},positionPrefix:"lower_whisker",endPositionPrefix:"lower_box",extraEncoding:S}),...F({partName:"rule",mark:{type:"rule",invalid:null,aria:!1},positionPrefix:"upper_box",endPositionPrefix:"upper_whisker",extraEncoding:S}),...F({partName:"ticks",mark:_,positionPrefix:"lower_whisker",extraEncoding:S}),...F({partName:"ticks",mark:_,positionPrefix:"upper_whisker",extraEncoding:S})],O=[...c!=="tukey"?M:[],...D({partName:"box",mark:{type:"bar",...l?{size:l}:{},orient:v,invalid:null,ariaRoleDescription:"box"},positionPrefix:"lower_box",endPositionPrefix:"upper_box",extraEncoding:C}),...T({partName:"median",mark:{type:"tick",invalid:null,...ze(t.boxplot.median)&&t.boxplot.median.color?{color:t.boxplot.median.color}:{},...l?{size:l}:{},orient:x,aria:!1},positionPrefix:"mid_box",extraEncoding:C})];if(c==="min-max")return{...o,transform:(o.transform??[]).concat(h),layer:O};const B=`datum["lower_box_${g.field}"]`,I=`datum["upper_box_${g.field}"]`,G=`(${I} - ${B})`,J=`${B} - ${u} * ${G}`,oe=`${I} + ${u} * ${G}`,be=`datum["${g.field}"]`,ve={joinaggregate:vR(g.field),groupby:m},Pe={transform:[{filter:`(${J} <= ${be}) && (${be} <= ${oe})`},{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}`},...y],groupby:m}],layer:M},{tooltip:ta,...na}=$,{scale:Us,axis:H}=g,le=KC(g),ge=Qn(H,["title"]),U=pR(a,"outliers",t.boxplot,{transform:[{filter:`(${be} < ${J}) || (${be} > ${oe})`}],mark:"point",encoding:{[p]:{field:g.field,type:g.type,...le!==void 0?{title:le}:{},...Us!==void 0?{scale:Us}:{},...Be(ge)?{}:{axis:ge}},...na,...w?{color:w}:{},...A?{tooltip:A}:{}}})[0];let ct;const Me=[...f,...d,ve];return U?ct={transform:Me,layer:[U,Pe]}:(ct=Pe,ct.transform.unshift(...Me)),{...o,layer:[ct,{transform:h,layer:O}]}}function vR(e){return[{op:"q1",field:e,as:`lower_box_${e}`},{op:"q3",field:e,as:`upper_box_${e}`}]}function Zme(e,t,n){const i=yR(e,lm),{continuousAxisChannelDef:r,continuousAxis:s}=mR(e,i,lm),o=r.field,a=bR(t),u=[...vR(o),{op:"median",field:o,as:`mid_box_${o}`},{op:"min",field:o,as:(a==="min-max"?"lower_whisker_":"min_")+o},{op:"max",field:o,as:(a==="min-max"?"upper_whisker_":"max_")+o}],l=a==="min-max"||a==="tukey"?[]:[{calculate:`datum["upper_box_${o}"] - datum["lower_box_${o}"]`,as:`iqr_${o}`},{calculate:`min(datum["upper_box_${o}"] + datum["iqr_${o}"] * ${t}, datum["max_${o}"])`,as:`upper_whisker_${o}`},{calculate:`max(datum["lower_box_${o}"] - datum["iqr_${o}"] * ${t}, datum["min_${o}"])`,as:`lower_whisker_${o}`}],{[s]:c,...f}=e.encoding,{customTooltipWithoutAggregatedField:d,filteredEncoding:h}=Kme(f),{bins:g,timeUnits:p,aggregate:m,groupby:y,encoding:b}=hR(h,n),x=i==="vertical"?"horizontal":"vertical",v=i,A=[...g,...p,{aggregate:[...m,...u],groupby:y},...l];return{bins:g,timeUnits:p,transform:A,groupby:y,aggregate:m,continuousAxisChannelDef:r,continuousAxis:s,encodingWithoutContinuousAxis:b,ticksOrient:x,boxOrient:v,customTooltipWithoutAggregatedField:d}}const QC="errorbar",e1e=["ticks","rule"],t1e=new hy(QC,AR);function AR(e,{config:t}){e={...e,encoding:gy(e.encoding,t)};const{transform:n,continuousAxisChannelDef:i,continuousAxis:r,encodingWithoutContinuousAxis:s,ticksOrient:o,markDef:a,outerSpec:u,tooltipEncoding:l}=ER(e,QC,t);delete s.size;const c=JC(a,r,i,s,t.errorbar),f=a.thickness,d=a.size,h={type:"tick",orient:o,aria:!1,...f!==void 0?{thickness:f}:{},...d!==void 0?{size:d}:{}},g=[...c({partName:"ticks",mark:h,positionPrefix:"lower",extraEncoding:l}),...c({partName:"ticks",mark:h,positionPrefix:"upper",extraEncoding:l}),...c({partName:"rule",mark:{type:"rule",ariaRoleDescription:"errorbar",...f!==void 0?{size:f}:{}},positionPrefix:"lower",endPositionPrefix:"upper",extraEncoding:l})];return{...u,transform:n,...g.length>1?{layer:g}:{...g[0]}}}function n1e(e,t){const{encoding:n}=e;if(i1e(n))return{orient:yR(e,t),inputType:"raw"};const i=r1e(n),r=s1e(n),s=n.x,o=n.y;if(i){if(r)throw new Error(`${t} cannot be both type aggregated-upper-lower and aggregated-error`);const a=n.x2,u=n.y2;if(re(a)&&re(u))throw new Error(`${t} cannot have both x2 and y2`);if(re(a)){if(hr(s))return{orient:"horizontal",inputType:"aggregated-upper-lower"};throw new Error(`Both x and x2 have to be quantitative in ${t}`)}else if(re(u)){if(hr(o))return{orient:"vertical",inputType:"aggregated-upper-lower"};throw new Error(`Both y and y2 have to be quantitative in ${t}`)}throw new Error("No ranged axis")}else{const a=n.xError,u=n.xError2,l=n.yError,c=n.yError2;if(re(u)&&!re(a))throw new Error(`${t} cannot have xError2 without xError`);if(re(c)&&!re(l))throw new Error(`${t} cannot have yError2 without yError`);if(re(a)&&re(l))throw new Error(`${t} cannot have both xError and yError with both are quantiative`);if(re(a)){if(hr(s))return{orient:"horizontal",inputType:"aggregated-error"};throw new Error("All x, xError, and xError2 (if exist) have to be quantitative")}else if(re(l)){if(hr(o))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 i1e(e){return(re(e.x)||re(e.y))&&!re(e.x2)&&!re(e.y2)&&!re(e.xError)&&!re(e.xError2)&&!re(e.yError)&&!re(e.yError2)}function r1e(e){return re(e.x2)||re(e.y2)}function s1e(e){return re(e.xError)||re(e.xError2)||re(e.yError)||re(e.yError2)}function ER(e,t,n){const{mark:i,encoding:r,params:s,projection:o,...a}=e,u=kr(i)?i:{type:i};s&&j(v7(t));const{orient:l,inputType:c}=n1e(e,t),{continuousAxisChannelDef:f,continuousAxisChannelDef2:d,continuousAxisChannelDefError:h,continuousAxisChannelDefError2:g,continuousAxis:p}=mR(e,l,t),{errorBarSpecificAggregate:m,postAggregateCalculates:y,tooltipSummary:b,tooltipTitleWithFieldName:x}=o1e(u,f,d,h,g,c,t,n),{[p]:v,[p==="x"?"x2":"y2"]:A,[p==="x"?"xError":"yError"]:w,[p==="x"?"xError2":"yError2"]:E,...$}=r,{bins:k,timeUnits:F,aggregate:D,groupby:T,encoding:C}=hR($,n),_=[...D,...m],S=c!=="raw"?[]:T,M=$v(b,f,C,x);return{transform:[...a.transform??[],...k,...F,..._.length===0?[]:[{aggregate:_,groupby:S}],...y],groupby:S,continuousAxisChannelDef:f,continuousAxis:p,encodingWithoutContinuousAxis:C,ticksOrient:l==="vertical"?"horizontal":"vertical",markDef:u,outerSpec:a,tooltipEncoding:M}}function o1e(e,t,n,i,r,s,o,a){let u=[],l=[];const c=t.field;let f,d=!1;if(s==="raw"){const h=e.center?e.center:e.extent?e.extent==="iqr"?"median":"mean":a.errorbar.center,g=e.extent?e.extent:h==="mean"?"stderr":"iqr";if(h==="median"!=(g==="iqr")&&j(ype(h,g,o)),g==="stderr"||g==="stdev")u=[{op:g,field:c,as:`extent_${c}`},{op:h,field:c,as:`center_${c}`}],l=[{calculate:`datum["center_${c}"] + datum["extent_${c}"]`,as:`upper_${c}`},{calculate:`datum["center_${c}"] - datum["extent_${c}"]`,as:`lower_${c}`}],f=[{fieldPrefix:"center_",titlePrefix:Gh(h)},{fieldPrefix:"upper_",titlePrefix:hk(h,g,"+")},{fieldPrefix:"lower_",titlePrefix:hk(h,g,"-")}],d=!0;else{let p,m,y;g==="ci"?(p="mean",m="ci0",y="ci1"):(p="median",m="q1",y="q3"),u=[{op:m,field:c,as:`lower_${c}`},{op:y,field:c,as:`upper_${c}`},{op:p,field:c,as:`center_${c}`}],f=[{fieldPrefix:"upper_",titlePrefix:fl({field:c,aggregate:y,type:"quantitative"},a,{allowDisabling:!1})},{fieldPrefix:"lower_",titlePrefix:fl({field:c,aggregate:m,type:"quantitative"},a,{allowDisabling:!1})},{fieldPrefix:"center_",titlePrefix:fl({field:c,aggregate:p,type:"quantitative"},a,{allowDisabling:!1})}]}}else{(e.center||e.extent)&&j(mpe(e.center,e.extent)),s==="aggregated-upper-lower"?(f=[],l=[{calculate:`datum["${n.field}"]`,as:`upper_${c}`},{calculate:`datum["${c}"]`,as:`lower_${c}`}]):s==="aggregated-error"&&(f=[{fieldPrefix:"",titlePrefix:c}],l=[{calculate:`datum["${c}"] + datum["${i.field}"]`,as:`upper_${c}`}],r?l.push({calculate:`datum["${c}"] + datum["${r.field}"]`,as:`lower_${c}`}):l.push({calculate:`datum["${c}"] - datum["${i.field}"]`,as:`lower_${c}`}));for(const h of l)f.push({fieldPrefix:h.as.substring(0,6),titlePrefix:ru(ru(h.calculate,'datum["',""),'"]',"")})}return{postAggregateCalculates:l,errorBarSpecificAggregate:u,tooltipSummary:f,tooltipTitleWithFieldName:d}}function hk(e,t,n){return`${Gh(e)} ${n} ${t}`}const ZC="errorband",a1e=["band","borders"],u1e=new hy(ZC,wR);function wR(e,{config:t}){e={...e,encoding:gy(e.encoding,t)};const{transform:n,continuousAxisChannelDef:i,continuousAxis:r,encodingWithoutContinuousAxis:s,markDef:o,outerSpec:a,tooltipEncoding:u}=ER(e,ZC,t),l=o,c=JC(l,r,i,s,t.errorband),f=e.encoding.x!==void 0&&e.encoding.y!==void 0;let d={type:f?"area":"rect"},h={type:f?"line":"rule"};const g={...l.interpolate?{interpolate:l.interpolate}:{},...l.tension&&l.interpolate?{tension:l.tension}:{}};return f?(d={...d,...g,ariaRoleDescription:"errorband"},h={...h,...g,aria:!1}):l.interpolate?j(sk("interpolate")):l.tension&&j(sk("tension")),{...a,transform:n,layer:[...c({partName:"band",mark:d,positionPrefix:"lower",endPositionPrefix:"upper",extraEncoding:u}),...c({partName:"borders",mark:h,positionPrefix:"lower",extraEncoding:u}),...c({partName:"borders",mark:h,positionPrefix:"upper",extraEncoding:u})]}}const $R={};function eF(e,t,n){const i=new hy(e,t);$R[e]={normalizer:i,parts:n}}function l1e(){return z($R)}eF(lm,xR,Jme);eF(QC,AR,e1e);eF(ZC,wR,a1e);const c1e=["gradientHorizontalMaxLength","gradientHorizontalMinLength","gradientVerticalMaxLength","gradientVerticalMinLength","unselectedOpacity"],CR={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"},FR={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"},f1e=z(CR),d1e=z(FR),h1e={header:1,headerRow:1,headerColumn:1,headerFacet:1},SR=z(h1e),DR=["size","shape","fill","stroke","strokeDash","strokeWidth","opacity"],g1e={gradientHorizontalMaxLength:200,gradientHorizontalMinLength:100,gradientVerticalMaxLength:200,gradientVerticalMinLength:64,unselectedOpacity:.35},p1e={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},Kd="_vgsid_",m1e={point:{on:"click",fields:[Kd],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 tF(e){return!!e&&(e==="legend"||!!e.legend)}function e2(e){return tF(e)&&ze(e)}function nF(e){return!!e.select}function _R(e){const t=[];for(const n of e||[]){if(nF(n))continue;const{expr:i,bind:r,...s}=n;if(r&&i){const o={...s,bind:r,init:i};t.push(o)}else{const o={...s,...i?{update:i}:{},...r?{bind:r}:{}};t.push(o)}}return t}function y1e(e){return py(e)||rF(e)||iF(e)}function iF(e){return"concat"in e}function py(e){return"vconcat"in e}function rF(e){return"hconcat"in e}function Or(e){return ze(e)&&e.step!==void 0}function gk(e){return e.view||e.width||e.height}const pk=20,b1e={align:1,bounds:1,center:1,columns:1,spacing:1},x1e=z(b1e);function v1e(e,t,n){const i=n[t],r={},{spacing:s,columns:o}=i;s!==void 0&&(r.spacing=s),o!==void 0&&(ay(e)&&!Jh(e.facet)||iF(e))&&(r.columns=o),py(e)&&(r.columns=1);for(const a of x1e)if(e[a]!==void 0)if(a==="spacing"){const u=e[a];r[a]=at(u)?u:{row:u.row??s,column:u.column??s}}else r[a]=e[a];return r}function Cv(e,t){return e[t]??e[t==="width"?"continuousWidth":"continuousHeight"]}function cm(e,t){const n=Jd(e,t);return Or(n)?n.step:kR}function Jd(e,t){const n=e[t]??e[t==="width"?"discreteWidth":"discreteHeight"];return ut(n,{step:e.step})}const kR=20,A1e={continuousWidth:200,continuousHeight:200,step:kR},E1e={background:"white",padding:5,timeFormat:"%b %d, %Y",countTitle:"Count of Records",view:A1e,mark:mme,arc:{},area:{},bar:xme,circle:{},geoshape:{},image:{},line:{},point:{},rect:vme,rule:{color:"black"},square:{},text:{color:"black"},tick:Ame,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:eme,projection:{},legend:g1e,header:{titlePadding:10,labelPadding:10},headerColumn:{},headerRow:{},headerFacet:{},selection:m1e,style:{},title:{},facet:{spacing:pk},concat:{spacing:pk}},Zr=["#4c78a8","#f58518","#e45756","#72b7b2","#54a24b","#eeca3b","#b279a2","#ff9da6","#9d755d","#bab0ac"],mk={text:11,guideLabel:10,guideTitle:11,groupTitle:13,groupSubtitle:12},yk={blue:Zr[0],orange:Zr[1],red:Zr[2],teal:Zr[3],green:Zr[4],yellow:Zr[5],purple:Zr[6],pink:Zr[7],brown:Zr[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 w1e(e={}){return{signals:[{name:"color",value:ze(e)?{...yk,...e}:yk}],mark:{color:{signal:"color.blue"}},rule:{color:{signal:"color.gray0"}},text:{color:{signal:"color.gray0"}},style:{"guide-label":{fill:{signal:"color.gray0"}},"guide-title":{fill:{signal:"color.gray0"}},"group-title":{fill:{signal:"color.gray0"}},"group-subtitle":{fill:{signal:"color.gray0"}},cell:{stroke:{signal:"color.gray8"}}},axis:{domainColor:{signal:"color.gray13"},gridColor:{signal:"color.gray8"},tickColor:{signal:"color.gray13"}},range:{category:[{signal:"color.blue"},{signal:"color.orange"},{signal:"color.red"},{signal:"color.teal"},{signal:"color.green"},{signal:"color.yellow"},{signal:"color.purple"},{signal:"color.pink"},{signal:"color.brown"},{signal:"color.grey8"}]}}}function $1e(e){return{signals:[{name:"fontSize",value:ze(e)?{...mk,...e}:mk}],text:{fontSize:{signal:"fontSize.text"}},style:{"guide-label":{fontSize:{signal:"fontSize.guideLabel"}},"guide-title":{fontSize:{signal:"fontSize.guideTitle"}},"group-title":{fontSize:{signal:"fontSize.groupTitle"}},"group-subtitle":{fontSize:{signal:"fontSize.groupSubtitle"}}}}}function C1e(e){return{text:{font:e},style:{"guide-label":{font:e},"guide-title":{font:e},"group-title":{font:e},"group-subtitle":{font:e}}}}function MR(e){const t=z(e||{}),n={};for(const i of t){const r=e[i];n[i]=Zh(r)?h7(r):Yn(r)}return n}function F1e(e){const t=z(e),n={};for(const i of t)n[i]=MR(e[i]);return n}const S1e=[...U7,...dR,...SR,"background","padding","legend","lineBreak","scale","style","title","view"];function OR(e={}){const{color:t,font:n,fontSize:i,...r}=e,s=VN({},E1e,n?C1e(n):{},t?w1e(t):{},i?$1e(i):{},r||{}),o=Qn(s,S1e);for(const a of["background","lineBreak","padding"])s[a]&&(o[a]=Yn(s[a]));for(const a of U7)s[a]&&(o[a]=Sn(s[a]));for(const a of dR)s[a]&&(o[a]=MR(s[a]));for(const a of SR)s[a]&&(o[a]=Sn(s[a]));return s.legend&&(o.legend=Sn(s.legend)),s.scale&&(o.scale=Sn(s.scale)),s.style&&(o.style=F1e(s.style)),s.title&&(o.title=Sn(s.title)),s.view&&(o.view=Sn(s.view)),o}const D1e=["view",...j7],_1e=["color","fontSize","background","padding","facet","concat","numberFormat","timeFormat","countTitle","header","axisQuantitative","axisTemporal","axisDiscrete","axisPoint","axisXBand","axisXPoint","axisXDiscrete","axisXQuantitative","axisXTemporal","axisYBand","axisYPoint","axisYDiscrete","axisYQuantitative","axisYTemporal","scale","selection","overlay"],k1e={view:["continuousWidth","continuousHeight","discreteWidth","discreteHeight","step"],...pme};function M1e(e){e=ce(e);for(const t of _1e)delete e[t];if(e.axis)for(const t in e.axis)Zh(e.axis[t])&&delete e.axis[t];if(e.legend)for(const t of c1e)delete e.legend[t];if(e.mark){for(const t of ak)delete e.mark[t];e.mark.tooltip&&ze(e.mark.tooltip)&&delete e.mark.tooltip}e.params&&(e.signals=(e.signals||[]).concat(_R(e.params)),delete e.params);for(const t of D1e){for(const i of ak)delete e[t][i];const n=k1e[t];if(n)for(const i of n)delete e[t][i];N1e(e,t)}for(const t of l1e())delete e[t];O1e(e);for(const t in e)ze(e[t])&&Be(e[t])&&delete e[t];return Be(e)?void 0:e}function O1e(e){const{titleMarkConfig:t,subtitleMarkConfig:n,subtitle:i}=d7(e.title);Be(t)||(e.style["group-title"]={...e.style["group-title"],...t}),Be(n)||(e.style["group-subtitle"]={...e.style["group-subtitle"],...n}),Be(i)?delete e.title:e.title=i}function N1e(e,t,n,i){const r=i?e[t][i]:e[t];t==="view"&&(n="cell");const s={...r,...e.style[n??t]};Be(s)||(e.style[n??t]=s),i||delete e[t]}function my(e){return"layer"in e}function T1e(e){return"repeat"in e}function B1e(e){return!K(e.repeat)&&e.repeat.layer}class sF{map(t,n){return ay(t)?this.mapFacet(t,n):T1e(t)?this.mapRepeat(t,n):rF(t)?this.mapHConcat(t,n):py(t)?this.mapVConcat(t,n):iF(t)?this.mapConcat(t,n):this.mapLayerOrUnit(t,n)}mapLayerOrUnit(t,n){if(my(t))return this.mapLayer(t,n);if(zs(t))return this.mapUnit(t,n);throw new Error(xC(t))}mapLayer(t,n){return{...t,layer:t.layer.map(i=>this.mapLayerOrUnit(i,n))}}mapHConcat(t,n){return{...t,hconcat:t.hconcat.map(i=>this.map(i,n))}}mapVConcat(t,n){return{...t,vconcat:t.vconcat.map(i=>this.map(i,n))}}mapConcat(t,n){const{concat:i,...r}=t;return{...r,concat:i.map(s=>this.map(s,n))}}mapFacet(t,n){return{...t,spec:this.map(t.spec,n)}}mapRepeat(t,n){return{...t,spec:this.map(t.spec,n)}}}const R1e={zero:1,center:1,normalize:1};function L1e(e){return e in R1e}const P1e=new Set([L7,ny,ty,rm,ry,RC,LC,iy,P7,BC]),I1e=new Set([ny,ty,L7]);function bk(e,t){var s,o;const n=t==="x"?"y":"radius",i=e[t],r=e[n];if(W(i)&&W(r))if(Ks(i)==="quantitative"&&Ks(r)==="quantitative"){if(i.stack)return t;if(r.stack)return n;const a=W(i)&&!!i.aggregate,u=W(r)&&!!r.aggregate;if(a!==u)return a?t:n;{const l=(s=i.scale)==null?void 0:s.type,c=(o=r.scale)==null?void 0:o.type;if(l&&l!=="linear")return n;if(c&&c!=="linear")return t}}else{if(Ks(i)==="quantitative")return t;if(Ks(r)==="quantitative")return n}else{if(Ks(i)==="quantitative")return t;if(Ks(r)==="quantitative")return n}}function z1e(e){switch(e){case"x":return"y";case"y":return"x";case"theta":return"radius";case"radius":return"theta"}}function NR(e,t,n={}){var d,h;const i=kr(e)?e.type:e;if(!P1e.has(i))return null;const r=bk(t,"x")||bk(t,"theta");if(!r)return null;const s=t[r],o=W(s)?q(s,{}):void 0;let a=z1e(r),u=t[a],l=W(u)?q(u,{}):void 0;l===o&&(l=void 0,u=void 0,a=void 0);const c=ege.reduce((g,p)=>{if(p!=="tooltip"&&qa(t,p)){const m=t[p];for(const y of Qe(m)){const b=Mr(y);if(b.aggregate)continue;const x=q(b,{});(!x||x!==l)&&g.push({channel:p,fieldDef:b})}}return g},[]);let f;if(s.stack!==void 0?Nh(s.stack)?f=s.stack?"zero":null:f=s.stack:I1e.has(i)&&(f="zero"),!f||!L1e(f)||YC(t)&&c.length===0)return null;if((d=s==null?void 0:s.scale)!=null&&d.type&&((h=s==null?void 0:s.scale)==null?void 0:h.type)!==ft.LINEAR){if(n.disallowNonLinearStack)return null;j(hpe(s.scale.type))}return re(t[Is(r)])?(s.stack!==void 0&&j(dpe(r)),null):(W(s)&&s.aggregate&&!fe(dge,s.aggregate)&&j(gpe(s.aggregate)),{groupbyChannel:u?a:void 0,groupbyField:l,fieldChannel:r,impute:s.impute===null?!1:Qo(i),stackBy:c,offset:f})}function j1e(e){const{point:t,line:n,...i}=e;return z(i).length>1?i:i.type}function U1e(e){for(const t of["line","area","rule","trail"])e[t]&&(e={...e,[t]:Qn(e[t],["point","line"])});return e}function t2(e,t={},n){return e.point==="transparent"?{opacity:0}:e.point?ze(e.point)?e.point:{}:e.point!==void 0?null:t.point||n.shape?ze(t.point)?t.point:{}:void 0}function xk(e,t={}){return e.line?e.line===!0?{}:e.line:e.line!==void 0?null:t.line?t.line===!0?{}:t.line:void 0}class q1e{constructor(){this.name="path-overlay"}hasMatchingType(t,n){if(zs(t)){const{mark:i,encoding:r}=t,s=kr(i)?i:{type:i};switch(s.type){case"line":case"rule":case"trail":return!!t2(s,n[s.type],r);case"area":return!!t2(s,n[s.type],r)||!!xk(s,n[s.type])}}return!1}run(t,n,i){const{config:r}=n,{params:s,projection:o,mark:a,encoding:u,...l}=t,c=gy(u,r),f=kr(a)?a:{type:a},d=t2(f,r[f.type],c),h=f.type==="area"&&xk(f,r[f.type]),g=[{...s?{params:s}:{},mark:j1e({...f.type==="area"&&f.opacity===void 0&&f.fillOpacity===void 0?{opacity:.7}:{},...f}),encoding:Qn(c,["shape"])}],p=NR(f,c);let m=c;if(p){const{fieldChannel:y,offset:b}=p;m={...c,[y]:{...c[y],...b?{stack:b}:{}}}}return h&&g.push({...o?{projection:o}:{},mark:{type:"line",...Pl(f,["clip","interpolate","tension","tooltip"]),...h},encoding:m}),d&&g.push({...o?{projection:o}:{},mark:{type:"point",opacity:1,filled:!0,...Pl(f,["clip","tooltip"]),...d},encoding:m}),i({...l,layer:g},{...n,config:U1e(r)})}}function W1e(e,t){return t?Jh(e)?BR(e,t):TR(e,t):e}function n2(e,t){return t?BR(e,t):e}function Fv(e,t,n){const i=t[e];if(kme(i)){if(i.repeat in n)return{...t,[e]:n[i.repeat]};j(Mge(i.repeat));return}return t}function TR(e,t){if(e=Fv("field",e,t),e!==void 0){if(e===null)return null;if(qC(e)&&vr(e.sort)){const n=Fv("field",e.sort,t);e={...e,...n?{sort:n}:{}}}return e}}function vk(e,t){if(W(e))return TR(e,t);{const n=Fv("datum",e,t);return n!==e&&!n.type&&(n.type="nominal"),n}}function Ak(e,t){if(re(e)){const n=vk(e,t);if(n)return n;if(uy(e))return{condition:e.condition}}else{if(cy(e)){const n=vk(e.condition,t);if(n)return{...e,condition:n};{const{condition:i,...r}=e;return r}}return e}}function BR(e,t){const n={};for(const i in e)if(_a(e,i)){const r=e[i];if(K(r))n[i]=r.map(s=>Ak(s,t)).filter(s=>s);else{const s=Ak(r,t);s!==void 0&&(n[i]=s)}}return n}class G1e{constructor(){this.name="RuleForRangedLine"}hasMatchingType(t){if(zs(t)){const{encoding:n,mark:i}=t;if(i==="line"||kr(i)&&i.type==="line")for(const r of Q0e){const s=Du(r),o=n[s];if(n[r]&&(W(o)&&!fn(o.bin)||Zo(o)))return!0}}return!1}run(t,n,i){const{encoding:r,mark:s}=t;return j(Xge(!!r.x2,!!r.y2)),console.log(s),i({...t,mark:ze(s)?{...s,type:"rule"}:"rule"},n)}}class H1e extends sF{constructor(){super(...arguments),this.nonFacetUnitNormalizers=[Qme,t1e,u1e,new q1e,new G1e]}map(t,n){if(zs(t)){const i=qa(t.encoding,vs),r=qa(t.encoding,As),s=qa(t.encoding,H1);if(i||r||s)return this.mapFacetedUnit(t,n)}return super.map(t,n)}mapUnit(t,n){const{parentEncoding:i,parentProjection:r}=n,s=n2(t.encoding,n.repeater),o={...t,...s?{encoding:s}:{}};if(i||r)return this.mapUnitWithParentEncodingOrProjection(o,n);const a=this.mapLayerOrUnit.bind(this);for(const u of this.nonFacetUnitNormalizers)if(u.hasMatchingType(o,n.config))return u.run(o,n,a);return o}mapRepeat(t,n){return B1e(t)?this.mapLayerRepeat(t,n):this.mapNonLayerRepeat(t,n)}mapLayerRepeat(t,n){const{repeat:i,spec:r,...s}=t,{row:o,column:a,layer:u}=i,{repeater:l={},repeaterPrefix:c=""}=n;return o||a?this.mapRepeat({...t,repeat:{...o?{row:o}:{},...a?{column:a}:{}},spec:{repeat:{layer:u},spec:r}},n):{...s,layer:u.map(f=>{const d={...l,layer:f},h=`${(r.name||"")+c}child__layer_${Ke(f)}`,g=this.mapLayerOrUnit(r,{...n,repeater:d,repeaterPrefix:h});return g.name=h,g})}}mapNonLayerRepeat(t,n){const{repeat:i,spec:r,data:s,...o}=t;!K(i)&&t.columns&&(t=Qn(t,["columns"]),j(tk("repeat")));const a=[],{repeater:u={},repeaterPrefix:l=""}=n,c=!K(i)&&i.row||[u?u.row:null],f=!K(i)&&i.column||[u?u.column:null],d=K(i)&&i||[u?u.repeat:null];for(const g of d)for(const p of c)for(const m of f){const y={repeat:g,row:p,column:m,layer:u.layer},b=(r.name||"")+l+"child__"+(K(i)?`${Ke(g)}`:(i.row?`row_${Ke(p)}`:"")+(i.column?`column_${Ke(m)}`:"")),x=this.map(r,{...n,repeater:y,repeaterPrefix:b});x.name=b,a.push(Qn(x,["data"]))}const h=K(i)?t.columns:i.column?i.column.length:1;return{data:r.data??s,align:"all",...o,columns:h,concat:a}}mapFacet(t,n){const{facet:i}=t;return Jh(i)&&t.columns&&(t=Qn(t,["columns"]),j(tk("facet"))),super.mapFacet(t,n)}mapUnitWithParentEncodingOrProjection(t,n){const{encoding:i,projection:r}=t,{parentEncoding:s,parentProjection:o,config:a}=n,u=wk({parentProjection:o,projection:r}),l=Ek({parentEncoding:s,encoding:n2(i,n.repeater)});return this.mapUnit({...t,...u?{projection:u}:{},...l?{encoding:l}:{}},{config:a})}mapFacetedUnit(t,n){const{row:i,column:r,facet:s,...o}=t.encoding,{mark:a,width:u,projection:l,height:c,view:f,params:d,encoding:h,...g}=t,{facetMapping:p,layout:m}=this.getFacetMappingAndLayout({row:i,column:r,facet:s},n),y=n2(o,n.repeater);return this.mapFacet({...g,...m,facet:p,spec:{...u?{width:u}:{},...c?{height:c}:{},...f?{view:f}:{},...l?{projection:l}:{},mark:a,encoding:y,...d?{params:d}:{}}},n)}getFacetMappingAndLayout(t,n){const{row:i,column:r,facet:s}=t;if(i||r){s&&j(Vge([...i?[vs]:[],...r?[As]:[]]));const o={},a={};for(const u of[vs,As]){const l=t[u];if(l){const{align:c,center:f,spacing:d,columns:h,...g}=l;o[u]=g;for(const p of["align","center","spacing"])l[p]!==void 0&&(a[p]??(a[p]={}),a[p][u]=l[p])}}return{facetMapping:o,layout:a}}else{const{align:o,center:a,spacing:u,columns:l,...c}=s;return{facetMapping:W1e(c,n.repeater),layout:{...o?{align:o}:{},...a?{center:a}:{},...u?{spacing:u}:{},...l?{columns:l}:{}}}}}mapLayer(t,{parentEncoding:n,parentProjection:i,...r}){const{encoding:s,projection:o,...a}=t,u={...r,parentEncoding:Ek({parentEncoding:n,encoding:s,layer:!0}),parentProjection:wk({parentProjection:i,projection:o})};return super.mapLayer(a,u)}}function Ek({parentEncoding:e,encoding:t={},layer:n}){let i={};if(e){const r=new Set([...z(e),...z(t)]);for(const s of r){const o=t[s],a=e[s];if(re(o)){const u={...a,...o};i[s]=u}else cy(o)?i[s]={...o,condition:{...a,...o.condition}}:o||o===null?i[s]=o:(n||Hi(a)||te(a)||re(a)||K(a))&&(i[s]=a)}}else i=t;return!i||Be(i)?void 0:i}function wk(e){const{parentProjection:t,projection:n}=e;return t&&n&&j(Lge({parentProjection:t,projection:n})),n??t}function oF(e){return"filter"in e}function V1e(e){return(e==null?void 0:e.stop)!==void 0}function RR(e){return"lookup"in e}function Y1e(e){return"data"in e}function X1e(e){return"param"in e}function K1e(e){return"pivot"in e}function J1e(e){return"density"in e}function Q1e(e){return"quantile"in e}function Z1e(e){return"regression"in e}function eye(e){return"loess"in e}function tye(e){return"sample"in e}function nye(e){return"window"in e}function iye(e){return"joinaggregate"in e}function rye(e){return"flatten"in e}function sye(e){return"calculate"in e}function LR(e){return"bin"in e}function oye(e){return"impute"in e}function aye(e){return"timeUnit"in e}function uye(e){return"aggregate"in e}function lye(e){return"stack"in e}function cye(e){return"fold"in e}function fye(e){return e.map(t=>oF(t)?{filter:ll(t.filter,zpe)}:t)}class dye extends sF{map(t,n){return n.emptySelections??(n.emptySelections={}),n.selectionPredicates??(n.selectionPredicates={}),t=$k(t,n),super.map(t,n)}mapLayerOrUnit(t,n){if(t=$k(t,n),t.encoding){const i={};for(const[r,s]of _o(t.encoding))i[r]=PR(s,n);t={...t,encoding:i}}return super.mapLayerOrUnit(t,n)}mapUnit(t,n){const{selection:i,...r}=t;return i?{...r,params:_o(i).map(([s,o])=>{const{init:a,bind:u,empty:l,...c}=o;c.type==="single"?(c.type="point",c.toggle=!1):c.type==="multi"&&(c.type="point"),n.emptySelections[s]=l!=="none";for(const f of pn(n.selectionPredicates[s]??{}))f.empty=l!=="none";return{name:s,value:a,select:c,bind:u}})}:t}}function $k(e,t){const{transform:n,...i}=e;if(n){const r=n.map(s=>{if(oF(s))return{filter:Sv(s,t)};if(LR(s)&&_u(s.bin))return{...s,bin:IR(s.bin)};if(RR(s)){const{selection:o,...a}=s.from;return o?{...s,from:{param:o,...a}}:s}return s});return{...i,transform:r}}return e}function PR(e,t){var i,r;const n=ce(e);if(W(n)&&_u(n.bin)&&(n.bin=IR(n.bin)),Nc(n)&&((r=(i=n.scale)==null?void 0:i.domain)!=null&&r.selection)){const{selection:s,...o}=n.scale.domain;n.scale.domain={...o,...s?{param:s}:{}}}if(uy(n))if(Xl(n.condition))n.condition=n.condition.map(s=>{const{selection:o,param:a,test:u,...l}=s;return a?s:{...l,test:Sv(s,t)}});else{const{selection:s,param:o,test:a,...u}=PR(n.condition,t);n.condition=o?n.condition:{...u,test:Sv(n.condition,t)}}return n}function IR(e){const t=e.extent;if(t!=null&&t.selection){const{selection:n,...i}=t;return{...e,extent:{...i,param:n}}}return e}function Sv(e,t){const n=i=>ll(i,r=>{var s;const o=t.emptySelections[r]??!0,a={param:r,empty:o};return(s=t.selectionPredicates)[r]??(s[r]=[]),t.selectionPredicates[r].push(a),a});return e.selection?n(e.selection):ll(e.test||e.filter,i=>i.selection?n(i.selection):i)}class Dv extends sF{map(t,n){const i=n.selections??[];if(t.params&&!zs(t)){const r=[];for(const s of t.params)nF(s)?i.push(s):r.push(s);t.params=r}return n.selections=i,super.map(t,zR(t,n))}mapUnit(t,n){const i=n.selections;if(!i||!i.length)return t;const r=(n.path??[]).concat(t.name),s=[];for(const o of i)if(!o.views||!o.views.length)s.push(o);else for(const a of o.views)(Pi(a)&&(a===t.name||r.indexOf(a)>=0)||Xl(a)&&a.map(u=>r.indexOf(u)).every((u,l,c)=>u!==-1&&(l===0||u>c[l-1])))&&s.push(o);return s.length&&(t.params=s),t}}for(const e of["mapFacet","mapRepeat","mapHConcat","mapVConcat","mapLayer"]){const t=Dv.prototype[e];Dv.prototype[e]=function(n,i){return t.call(this,n,zR(n,i))}}function zR(e,t){return e.name?{...t,path:(t.path??[]).concat(e.name)}:t}function jR(e,t){t===void 0&&(t=OR(e.config));const n=mye(e,t),{width:i,height:r}=e,s=yye(n,{width:i,height:r,autosize:e.autosize},t);return{...n,...s?{autosize:s}:{}}}const hye=new H1e,gye=new dye,pye=new Dv;function mye(e,t={}){const n={config:t};return pye.map(hye.map(gye.map(e,n),n),n)}function Ck(e){return ue(e)?{type:e}:e??{}}function yye(e,t,n){let{width:i,height:r}=t;const s=zs(e)||my(e),o={};s?i=="container"&&r=="container"?(o.type="fit",o.contains="padding"):i=="container"?(o.type="fit-x",o.contains="padding"):r=="container"&&(o.type="fit-y",o.contains="padding"):(i=="container"&&(j(J3("width")),i=void 0),r=="container"&&(j(J3("height")),r=void 0));const a={type:"pad",...o,...n?Ck(n.autosize):{},...Ck(e.autosize)};if(a.type==="fit"&&!s&&(j(Age),a.type="pad"),i=="container"&&!(a.type=="fit"||a.type=="fit-x")&&j(Q3("width")),r=="container"&&!(a.type=="fit"||a.type=="fit-y")&&j(Q3("height")),!fr(a,{type:"pad"}))return a}function bye(e){return e==="fit"||e==="fit-x"||e==="fit-y"}function xye(e){return e?`fit-${J1(e)}`:"fit"}const vye=["background","padding"];function Fk(e,t){const n={};for(const i of vye)e&&e[i]!==void 0&&(n[i]=Yn(e[i]));return t&&(n.params=e.params),n}class js{constructor(t={},n={}){this.explicit=t,this.implicit=n}clone(){return new js(ce(this.explicit),ce(this.implicit))}combine(){return{...this.explicit,...this.implicit}}get(t){return ut(this.explicit[t],this.implicit[t])}getWithExplicit(t){return this.explicit[t]!==void 0?{explicit:!0,value:this.explicit[t]}:this.implicit[t]!==void 0?{explicit:!1,value:this.implicit[t]}:{explicit:!1,value:void 0}}setWithExplicit(t,{value:n,explicit:i}){n!==void 0&&this.set(t,n,i)}set(t,n,i){return delete this[i?"implicit":"explicit"][t],this[i?"explicit":"implicit"][t]=n,this}copyKeyFromSplit(t,{explicit:n,implicit:i}){n[t]!==void 0?this.set(t,n[t],!0):i[t]!==void 0&&this.set(t,i[t],!1)}copyKeyFromObject(t,n){n[t]!==void 0&&this.set(t,n[t],!0)}copyAll(t){for(const n of z(t.combine())){const i=t.getWithExplicit(n);this.setWithExplicit(n,i)}}}function ss(e){return{explicit:!0,value:e}}function Wn(e){return{explicit:!1,value:e}}function UR(e){return(t,n,i,r)=>{const s=e(t.value,n.value);return s>0?t:s<0?n:yy(t,n,i,r)}}function yy(e,t,n,i){return e.explicit&&t.explicit&&j(spe(n,i,e.value,t.value)),e}function Mo(e,t,n,i,r=yy){return e===void 0||e.value===void 0?t:e.explicit&&!t.explicit?e:t.explicit&&!e.explicit?t:fr(e.value,t.value)?e:r(e,t,n,i)}class Aye extends js{constructor(t={},n={},i=!1){super(t,n),this.explicit=t,this.implicit=n,this.parseNothing=i}clone(){const t=super.clone();return t.parseNothing=this.parseNothing,t}}function Qd(e){return"url"in e}function fm(e){return"values"in e}function qR(e){return"name"in e&&!Qd(e)&&!fm(e)&&!Wa(e)}function Wa(e){return e&&(WR(e)||GR(e)||aF(e))}function WR(e){return"sequence"in e}function GR(e){return"sphere"in e}function aF(e){return"graticule"in e}var je;(function(e){e[e.Raw=0]="Raw",e[e.Main=1]="Main",e[e.Row=2]="Row",e[e.Column=3]="Column",e[e.Lookup=4]="Lookup"})(je||(je={}));const Eye="view",dm="[",hm="]",HR="{",VR="}",wye=":",YR=",",$ye="@",Cye=">",Fye=/[[\]{}]/,Sye={"*":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 XR,KR;function Tc(e,t,n){return XR=t||Eye,KR=n||Sye,JR(e.trim()).map(_v)}function Dye(e){return KR[e]}function ad(e,t,n,i,r){const s=e.length;let o=0,a;for(;t<s;++t){if(a=e[t],!o&&a===n)return t;r&&r.indexOf(a)>=0?--o:i&&i.indexOf(a)>=0&&++o}return t}function JR(e){const t=[],n=e.length;let i=0,r=0;for(;r<n;)r=ad(e,r,YR,dm+HR,hm+VR),t.push(e.substring(i,r).trim()),i=++r;if(t.length===0)throw"Empty event selector: "+e;return t}function _v(e){return e[0]==="["?_ye(e):kye(e)}function _ye(e){const t=e.length;let n=1,i;if(n=ad(e,n,hm,dm,hm),n===t)throw"Empty between selector: "+e;if(i=JR(e.substring(1,n)),i.length!==2)throw"Between selector must have two elements: "+e;if(e=e.slice(n+1).trim(),e[0]!==Cye)throw"Expected '>' after between selector: "+e;i=i.map(_v);const r=_v(e.slice(1).trim());return r.between?{between:i,stream:r}:(r.between=i,r)}function kye(e){const t={source:XR},n=[];let i=[0,0],r=0,s=0,o=e.length,a=0,u,l;if(e[o-1]===VR){if(a=e.lastIndexOf(HR),a>=0){try{i=Mye(e.substring(a+1,o-1))}catch{throw"Invalid throttle specification: "+e}e=e.slice(0,a).trim(),o=e.length}else throw"Unmatched right brace: "+e;a=0}if(!o)throw e;if(e[0]===$ye&&(r=++a),u=ad(e,a,wye),u<o&&(n.push(e.substring(s,u).trim()),s=a=++u),a=ad(e,a,dm),a===o)n.push(e.substring(s,o).trim());else if(n.push(e.substring(s,a).trim()),l=[],s=++a,s===o)throw"Unmatched left bracket: "+e;for(;a<o;){if(a=ad(e,a,hm),a===o)throw"Unmatched left bracket: "+e;if(l.push(e.substring(s,a).trim()),a<o-1&&e[++a]!==dm)throw"Expected left bracket: "+e;s=++a}if(!(o=n.length)||Fye.test(n[o-1]))throw"Invalid event selector: "+e;return o>1?(t.type=n[1],r?t.markname=n[0].slice(1):Dye(n[0])?t.marktype=n[0]:t.source=n[0]):t.type=n[0],t.type.slice(-1)==="!"&&(t.consume=!0,t.type=t.type.slice(0,-1)),l!=null&&(t.filter=l),i[0]&&(t.throttle=i[0]),i[1]&&(t.debounce=i[1]),t}function Mye(e){const t=e.split(YR);if(!e.length||t.length>2)throw e;return t.map(n=>{const i=+n;if(i!==i)throw e;return i})}function Wl(e,t=!0,n=dne){if(K(e)){const i=e.map(r=>Wl(r,t,n));return t?`[${i.join(", ")}]`:i}else if(ku(e))return n(t?Yd(e):kpe(e));return t?n(Ue(e)):e}function Oye(e,t){for(const n of pn(e.component.selection??{})){const i=n.name;let r=`${i}${To}, ${n.resolve==="global"?"true":`{unit: ${Gl(e)}}`}`;for(const s of xy)s.defined(n)&&(s.signals&&(t=s.signals(e,n,t)),s.modifyExpr&&(r=s.modifyExpr(e,n,r)));t.push({name:i+lbe,on:[{events:{signal:n.name+To},update:`modify(${Ae(n.name+lu)}, ${r})`}]})}return uF(t)}function Nye(e,t){if(e.component.selection&&z(e.component.selection).length){const n=Ae(e.getName("cell"));t.unshift({name:"facet",value:{},on:[{events:Tc("mousemove","scope"),update:`isTuple(facet) ? facet : group(${n}).datum`}]})}return uF(t)}function Tye(e,t){let n=!1;for(const i of pn(e.component.selection??{})){const r=i.name,s=Ae(r+lu);if(t.filter(a=>a.name===r).length===0){const a=i.resolve==="global"?"union":i.resolve,u=i.type==="point"?", true, true)":")";t.push({name:i.name,update:`${hL}(${s}, ${Ae(a)}${u}`})}n=!0;for(const a of xy)a.defined(i)&&a.topLevelSignals&&(t=a.topLevelSignals(e,i,t))}return n&&t.filter(r=>r.name==="unit").length===0&&t.unshift({name:"unit",value:{},on:[{events:"mousemove",update:"isTuple(group()) ? group() : unit"}]}),uF(t)}function Bye(e,t){const n=[...t];for(const i of pn(e.component.selection??{})){const r={name:i.name+lu};if(i.init){const o=i.project.items.map(a=>{const{signals:u,...l}=a;return l});r.values=i.init.map(a=>({unit:Gl(e,{escape:!1}),fields:o,values:Wl(a,!1)}))}n.filter(o=>o.name===i.name+lu).length||n.push(r)}return n}function QR(e,t){for(const n of pn(e.component.selection??{}))for(const i of xy)i.defined(n)&&i.marks&&(t=i.marks(e,n,t));return t}function Rye(e,t){for(const n of e.children)st(n)&&(t=QR(n,t));return t}function Lye(e,t,n,i){const r=$L(e,t.param,t);return{signal:ii(n.get("type"))&&K(i)&&i[0]>i[1]?`isValid(${r}) && reverse(${r})`:r}}function uF(e){return e.map(t=>(t.on&&!t.on.length&&delete t.on,t))}class Le{constructor(t,n){this.debugName=n,this._children=[],this._parent=null,t&&(this.parent=t)}clone(){throw new Error("Cannot clone node")}get parent(){return this._parent}set parent(t){this._parent=t,t&&t.addChild(this)}get children(){return this._children}numChildren(){return this._children.length}addChild(t,n){if(this._children.includes(t)){j(Tge);return}n!==void 0?this._children.splice(n,0,t):this._children.push(t)}removeChild(t){const n=this._children.indexOf(t);return this._children.splice(n,1),n}remove(){let t=this._parent.removeChild(this);for(const n of this._children)n._parent=this._parent,this._parent.addChild(n,t++)}insertAsParentOf(t){const n=t.parent;n.removeChild(this),this.parent=n,t.parent=this}swapWithParent(){const t=this._parent,n=t.parent;for(const i of this._children)i.parent=t;this._children=[],t.removeChild(this),t.parent.removeChild(t),this.parent=n,t.parent=this}}class mn extends Le{constructor(t,n,i,r){super(t,n),this.type=i,this.refCounts=r,this._source=this._name=n,this.refCounts&&!(this._name in this.refCounts)&&(this.refCounts[this._name]=0)}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}dependentFields(){return new Set}producedFields(){return new Set}hash(){return this._hash===void 0&&(this._hash=`Output ${QB()}`),this._hash}getSource(){return this.refCounts[this._name]++,this._source}isRequired(){return!!this.refCounts[this._name]}setSource(t){this._source=t}}class Ar extends Le{constructor(t,n){super(t),this.formula=n}clone(){return new Ar(null,ce(this.formula))}static makeFromEncoding(t,n){const i=n.reduceFieldDef((r,s)=>{const{field:o,timeUnit:a}=s;if(a){const u=q(s,{forAs:!0});r[ye({as:u,field:o,timeUnit:a})]={as:u,field:o,timeUnit:a}}return r},{});return Be(i)?null:new Ar(t,i)}static makeFromTransform(t,n){const{timeUnit:i,...r}={...n},s=xn(i),o={...r,timeUnit:s};return new Ar(t,{[ye(o)]:o})}merge(t){this.formula={...this.formula};for(const n in t.formula)this.formula[n]||(this.formula[n]=t.formula[n]);for(const n of t.children)t.removeChild(n),n.parent=this;t.remove()}removeFormulas(t){const n={};for(const[i,r]of _o(this.formula))t.has(r.as)||(n[i]=r);this.formula=n}producedFields(){return new Set(pn(this.formula).map(t=>t.as))}dependentFields(){return new Set(pn(this.formula).map(t=>t.field))}hash(){return`TimeUnit ${ye(this.formula)}`}assemble(){const t=[];for(const n of pn(this.formula)){const{field:i,as:r,timeUnit:s}=n,{unit:o,utc:a,...u}=xn(s);t.push({field:mi(i),type:"timeunit",...o?{units:$C(o)}:{},...a?{timezone:"utc"}:{},...u,as:[r,`${r}_end`]})}return t}}const e0="_tuple_fields";class Pye{constructor(...t){this.items=t,this.hasChannel={},this.hasField={}}}const Iye={defined:()=>!0,parse:(e,t,n)=>{const i=t.name,r=t.project??(t.project=new Pye),s={},o={},a=new Set,u=(g,p)=>{const m=p==="visual"?g.channel:g.field;let y=Ke(`${i}_${m}`);for(let b=1;a.has(y);b++)y=Ke(`${i}_${m}_${b}`);return a.add(y),{[p]:y}},l=t.type,c=e.config.selection[l],f=n.value!==void 0?Qe(n.value):null;let{fields:d,encodings:h}=ze(n.select)?n.select:{};if(!d&&!h&&f){for(const g of f)if(ze(g))for(const p of z(g))J0e(p)?(h||(h=[])).push(p):l==="interval"?(j(kge),h=c.encodings):(d||(d=[])).push(p)}!d&&!h&&(h=c.encodings,d=c.fields);for(const g of h??[]){const p=e.fieldDef(g);if(p){let m=p.field;if(p.aggregate){j(Ege(g,p.aggregate));continue}else if(!m){j(ek(g));continue}if(p.timeUnit){m=e.vgField(g);const y={timeUnit:p.timeUnit,as:m,field:p.field};o[ye(y)]=y}if(!s[m]){let y="E";if(l==="interval"){const x=e.getScaleComponent(g).get("type");ii(x)&&(y="R")}else p.bin&&(y="R-RE");const b={field:m,channel:g,type:y};b.signals={...u(b,"data"),...u(b,"visual")},r.items.push(s[m]=b),r.hasField[m]=r.hasChannel[g]=s[m]}}else j(ek(g))}for(const g of d??[]){if(r.hasField[g])continue;const p={type:"E",field:g};p.signals={...u(p,"data")},r.items.push(p),r.hasField[g]=p}f&&(t.init=f.map(g=>r.items.map(p=>ze(g)?g[p.channel]!==void 0?g[p.channel]:g[p.field]:g))),Be(o)||(r.timeUnit=new Ar(null,o))},signals:(e,t,n)=>{const i=t.name+e0;return n.filter(s=>s.name===i).length>0?n:n.concat({name:i,value:t.project.items.map(s=>{const{signals:o,hasLegend:a,...u}=s;return u.field=mi(u.field),u})})}},Oo={defined:e=>e.type==="interval"&&e.resolve==="global"&&e.bind&&e.bind==="scales",parse:(e,t)=>{const n=t.scales=[];for(const i of t.project.items){const r=i.channel;if(!Xo(r))continue;const s=e.getScaleComponent(r),o=s?s.get("type"):void 0;if(!s||!ii(o)){j(Cge);continue}s.set("selectionExtent",{param:t.name,field:i.field},!0),n.push(i)}},topLevelSignals:(e,t,n)=>{const i=t.scales.filter(o=>n.filter(a=>a.name===o.signals.data).length===0);if(!e.parent||Sk(e)||i.length===0)return n;const r=n.filter(o=>o.name===t.name)[0];let s=r.update;if(s.indexOf(hL)>=0)r.update=`{${i.map(o=>`${Ae(mi(o.field))}: ${o.signals.data}`).join(", ")}}`;else{for(const o of i){const a=`${Ae(mi(o.field))}: ${o.signals.data}`;s.includes(a)||(s=`${s.substring(0,s.length-1)}, ${a}}`)}r.update=s}return n.concat(i.map(o=>({name:o.signals.data})))},signals:(e,t,n)=>{if(e.parent&&!Sk(e))for(const i of t.scales){const r=n.filter(s=>s.name===i.signals.data)[0];r.push="outer",delete r.value,delete r.update}return n}};function kv(e,t){return`domain(${Ae(e.scaleName(t))})`}function Sk(e){return e.parent&&Ic(e.parent)&&!e.parent.parent}const ud="_brush",Mv="_scale_trigger",zye={defined:e=>e.type==="interval",signals:(e,t,n)=>{const i=t.name,r=i+e0,s=Oo.defined(t),o=t.init?t.init[0]:null,a=[],u=[];if(t.translate&&!s){const c=`!event.item || event.item.mark.name !== ${Ae(i+ud)}`;ZR(t,(f,d)=>{var h;const g=Qe((h=d.between[0]).filter??(h.filter=[]));return g.includes(c)||g.push(c),f})}t.project.items.forEach((c,f)=>{const d=c.channel;if(d!==Ze&&d!==mt){j("Interval selections only support x and y encoding channels.");return}const h=o?o[f]:null,g=jye(e,t,c,h),p=c.signals.data,m=c.signals.visual,y=Ae(e.scaleName(d)),b=e.getScaleComponent(d).get("type"),x=ii(b)?"+":"";n.push(...g),a.push(p),u.push({scaleName:e.scaleName(d),expr:`(!isArray(${p}) || (${x}invert(${y}, ${m})[0] === ${x}${p}[0] && ${x}invert(${y}, ${m})[1] === ${x}${p}[1]))`})}),s||n.push({name:i+Mv,value:{},on:[{events:u.map(c=>({scale:c.scaleName})),update:`${u.map(c=>c.expr).join(" && ")} ? ${i+Mv} : {}`}]});const l=`unit: ${Gl(e)}, fields: ${r}, values`;return n.concat({name:i+To,...o?{init:`{${l}: ${Wl(o)}}`}:{},on:[{events:[{signal:a.join(" || ")}],update:`${a.join(" && ")} ? {${l}: [${a}]} : null`}]})},marks:(e,t,n)=>{const i=t.name,{x:r,y:s}=t.project.hasChannel,o=r&&r.signals.visual,a=s&&s.signals.visual,u=`data(${Ae(t.name+lu)})`;if(Oo.defined(t))return n;const l={x:r!==void 0?{signal:`${o}[0]`}:{value:0},y:s!==void 0?{signal:`${a}[0]`}:{value:0},x2:r!==void 0?{signal:`${o}[1]`}:{field:{group:"width"}},y2:s!==void 0?{signal:`${a}[1]`}:{field:{group:"height"}}};if(t.resolve==="global")for(const p of z(l))l[p]=[{test:`${u}.length && ${u}[0].unit === ${Gl(e)}`,...l[p]},{value:0}];const{fill:c,fillOpacity:f,cursor:d,...h}=t.mark,g=z(h).reduce((p,m)=>(p[m]=[{test:[r!==void 0&&`${o}[0] !== ${o}[1]`,s!==void 0&&`${a}[0] !== ${a}[1]`].filter(y=>y).join(" && "),value:h[m]},{value:null}],p),{});return[{name:`${i+ud}_bg`,type:"rect",clip:!0,encode:{enter:{fill:{value:c},fillOpacity:{value:f}},update:l}},...n,{name:i+ud,type:"rect",clip:!0,encode:{enter:{...d?{cursor:{value:d}}:{},fill:{value:"transparent"}},update:{...l,...g}}}]}};function jye(e,t,n,i){const r=n.channel,s=n.signals.visual,o=n.signals.data,a=Oo.defined(t),u=Ae(e.scaleName(r)),l=e.getScaleComponent(r),c=l?l.get("type"):void 0,f=p=>`scale(${u}, ${p})`,d=e.getSizeSignalRef(r===Ze?"width":"height").signal,h=`${r}(unit)`,g=ZR(t,(p,m)=>[...p,{events:m.between[0],update:`[${h}, ${h}]`},{events:m,update:`[${s}[0], clamp(${h}, 0, ${d})]`}]);return g.push({events:{signal:t.name+Mv},update:ii(c)?`[${f(`${o}[0]`)}, ${f(`${o}[1]`)}]`:"[0, 0]"}),a?[{name:o,on:[]}]:[{name:s,...i?{init:Wl(i,!0,f)}:{value:[]},on:g},{name:o,...i?{init:Wl(i)}:{},on:[{events:{signal:s},update:`${s}[0] === ${s}[1] ? null : invert(${u}, ${s})`}]}]}function ZR(e,t){return e.events.reduce((n,i)=>i.between?t(n,i):(j(`${i} is not an ordered event stream for interval selections.`),n),[])}const Uye={defined:e=>e.type==="point",signals:(e,t,n)=>{const i=t.name,r=i+e0,s=t.project,o="(item().isVoronoi ? datum.datum : datum)",a=s.items.map(c=>{const f=e.fieldDef(c.channel);return f&&f.bin?`[${o}[${Ae(e.vgField(c.channel,{}))}], ${o}[${Ae(e.vgField(c.channel,{binSuffix:"end"}))}]]`:`${o}[${Ae(c.field)}]`}).join(", "),u=`unit: ${Gl(e)}, fields: ${r}, values`,l=t.events;return n.concat([{name:i+To,on:l?[{events:l,update:`datum && item().mark.marktype !== 'group' ? {${u}: [${a}]} : null`,force:!0}]:[]}])}};function Bc(e,t,n,i){const r=uy(t)&&t.condition,s=i(t);if(r){const a=Qe(r).map(u=>{const l=i(u);if(_me(u)){const{param:c,empty:f}=u;return{test:wL(e,{param:c,empty:f}),...l}}else return{test:ym(e,u.test),...l}});return{[n]:[...a,...s!==void 0?[s]:[]]}}else return s!==void 0?{[n]:s}:{}}function lF(e,t="text"){const n=e.encoding[t];return Bc(e,n,t,i=>by(i,e.config))}function by(e,t,n="datum"){if(e){if(Hi(e))return Xe(e.value);if(re(e)){const{format:i,formatType:r}=am(e);return zC({fieldOrDatumDef:e,format:i,formatType:r,expr:n,config:t})}}}function eL(e,t={}){const{encoding:n,markDef:i,config:r,stack:s}=e,o=n.tooltip;if(K(o))return{tooltip:Dk({tooltip:o},s,r,t)};{const a=t.reactiveGeom?"datum.datum":"datum";return Bc(e,o,"tooltip",u=>{const l=by(u,r,a);if(l)return l;if(u===null)return;let c=ke("tooltip",i,r);if(c===!0&&(c={content:"encoding"}),ue(c))return{value:c};if(ze(c))return te(c)?c:c.content==="encoding"?Dk(n,s,r,t):{signal:a}})}}function tL(e,t,n,{reactiveGeom:i}={}){const r={},s=i?"datum.datum":"datum",o=[];function a(l,c){const f=Du(c),d=xi(l)?l:{...l,type:e[f].type},h=d.title||HC(d,n),g=Qe(h).join(", ");let p;if(_r(c)){const m=c==="x"?"x2":"y2",y=Mr(e[m]);if(fn(d.bin)&&y){const b=q(d,{expr:s}),x=q(y,{expr:s}),{format:v,formatType:A}=am(d);p=sy(b,x,v,A,n),r[m]=!0}else if(t&&t.fieldChannel===c&&t.offset==="normalize"){const{format:b,formatType:x}=am(d);p=zC({fieldOrDatumDef:d,format:b,formatType:x,expr:s,config:n,normalizeStack:!0}).signal}}p??(p=by(d,n,s).signal),o.push({channel:c,key:g,value:p})}XC(e,(l,c)=>{W(l)?a(l,c):ly(l)&&a(l.condition,c)});const u={};for(const{channel:l,key:c,value:f}of o)!r[l]&&!u[c]&&(u[c]=f);return u}function Dk(e,t,n,{reactiveGeom:i}={}){const r=tL(e,t,n,{reactiveGeom:i}),s=_o(r).map(([o,a])=>`"${o}": ${a}`);return s.length>0?{signal:`{${s.join(", ")}}`}:void 0}function qye(e){const{markDef:t,config:n}=e,i=ke("aria",t,n);return i===!1?{}:{...i?{aria:i}:{},...Wye(e),...Gye(e)}}function Wye(e){const{mark:t,markDef:n,config:i}=e;if(i.aria===!1)return{};const r=ke("ariaRoleDescription",n,i);return r!=null?{ariaRoleDescription:{value:r}}:t in xge?{}:{ariaRoleDescription:{value:t}}}function Gye(e){const{encoding:t,markDef:n,config:i,stack:r}=e,s=t.description;if(s)return Bc(e,s,"description",u=>by(u,e.config));const o=ke("description",n,i);if(o!=null)return{description:Xe(o)};if(i.aria===!1)return{};const a=tL(t,r,i);if(!Be(a))return{description:{signal:_o(a).map(([u,l],c)=>`"${c>0?"; ":""}${u}: " + (${l})`).join(" + ")}}}function vt(e,t,n={}){const{markDef:i,encoding:r,config:s}=t,{vgChannel:o}=n;let{defaultRef:a,defaultValue:u}=n;a===void 0&&(u??(u=ke(e,i,s,{vgChannel:o,ignoreVgConfig:!0})),u!==void 0&&(a=Xe(u)));const l=r[e];return Bc(t,l,o??e,c=>G7({channel:e,channelDef:c,markDef:i,config:s,scaleName:t.scaleName(e),scale:t.getScaleComponent(e),stack:null,defaultRef:a}))}function nL(e,t={filled:void 0}){const{markDef:n,encoding:i,config:r}=e,{type:s}=n,o=t.filled??ke("filled",n,r),a=fe(["bar","point","circle","square","geoshape"],s)?"transparent":void 0,u=ke(o===!0?"color":void 0,n,r,{vgChannel:"fill"})??r.mark[o===!0&&"color"]??a,l=ke(o===!1?"color":void 0,n,r,{vgChannel:"stroke"})??r.mark[o===!1&&"color"],c=o?"fill":"stroke",f={...u?{fill:Xe(u)}:{},...l?{stroke:Xe(l)}:{}};return n.color&&(o?n.fill:n.stroke)&&j(E7("property",{fill:"fill"in n,stroke:"stroke"in n})),{...f,...vt("color",e,{vgChannel:c,defaultValue:o?u:l}),...vt("fill",e,{defaultValue:i.fill?u:void 0}),...vt("stroke",e,{defaultValue:i.stroke?l:void 0})}}function Hye(e){const{encoding:t,mark:n}=e,i=t.order;return!Qo(n)&&Hi(i)?Bc(e,i,"zindex",r=>Xe(r.value)):{}}function Zd(e,t){const n=Z0e(e),i=t[n];if(i)return i}function Ht(e,t,{defaultPos:n,vgChannel:i}){const{encoding:r,markDef:s,config:o,stack:a}=t,u=r[e],l=r[Is(e)],c=t.scaleName(e),f=t.getScaleComponent(e),d=Zd(e,s),h=cF({model:t,defaultPos:n,channel:e,scaleName:c,scale:f}),g=!u&&_r(e)&&(r.latitude||r.longitude)?{field:t.getName(e)}:Vye({channel:e,channelDef:u,channel2Def:l,markDef:s,config:o,scaleName:c,scale:f,stack:a,offset:d,defaultRef:h});return g?{[i||e]:g}:void 0}function Vye(e){const{channel:t,channelDef:n,scaleName:i,stack:r,offset:s,markDef:o}=e;if(re(n)&&r&&t===r.fieldChannel){if(W(n)){let a=n.bandPosition;if(a===void 0&&o.type==="text"&&(t==="radius"||t==="theta")&&(a=.5),a!==void 0)return sm({scaleName:i,fieldOrDatumDef:n,startSuffix:"start",bandPosition:a,offset:s})}return Ua(n,i,{suffix:"end"},{offset:s})}return PC(e)}function cF({model:e,defaultPos:t,channel:n,scaleName:i,scale:r}){const{markDef:s,config:o}=e;return()=>{const a=Du(n),u=ko(n),l=ke(n,s,o,{vgChannel:u});if(l!==void 0)return od(n,l);switch(t){case"zeroOrMin":case"zeroOrMax":if(i){const c=r.get("type");if(!fe([ft.LOG,ft.TIME,ft.UTC],c)){if(r.domainDefinitelyIncludesZero())return{scale:i,value:0}}}if(t==="zeroOrMin")return a==="y"?{field:{group:"height"}}:{value:0};switch(a){case"radius":return{signal:`min(${e.width.signal},${e.height.signal})/2`};case"theta":return{signal:"2*PI"};case"x":return{field:{group:"width"}};case"y":return{value:0}}break;case"mid":return{...e[bi(n)],mult:.5}}}}const Yye={left:"x",center:"xc",right:"x2"},Xye={top:"y",middle:"yc",bottom:"y2"};function iL(e,t,n,i="middle"){if(e==="radius"||e==="theta")return ko(e);const r=e==="x"?"align":"baseline",s=ke(r,t,n);let o;return te(s)?(j(Yge(r)),o=void 0):o=s,e==="x"?Yye[o||(i==="top"?"left":"center")]:Xye[o||i]}function gm(e,t,{defaultPos:n,defaultPos2:i,range:r}){return r?rL(e,t,{defaultPos:n,defaultPos2:i}):Ht(e,t,{defaultPos:n})}function rL(e,t,{defaultPos:n,defaultPos2:i}){const{markDef:r,config:s}=t,o=Is(e),a=bi(e),u=Kye(t,i,o),l=u[a]?iL(e,r,s):ko(e);return{...Ht(e,t,{defaultPos:n,vgChannel:l}),...u}}function Kye(e,t,n){const{encoding:i,mark:r,markDef:s,stack:o,config:a}=e,u=Du(n),l=bi(n),c=ko(n),f=i[u],d=e.scaleName(u),h=e.getScaleComponent(u),g=n in i||n in s?Zd(n,e.markDef):Zd(u,e.markDef);if(!f&&(n==="x2"||n==="y2")&&(i.latitude||i.longitude)){const m=bi(n),y=e.markDef[m];return y!=null?{[m]:{value:y}}:{[c]:{field:e.getName(n)}}}const p=Jye({channel:n,channelDef:f,channel2Def:i[n],markDef:s,config:a,scaleName:d,scale:h,stack:o,offset:g,defaultRef:void 0});return p!==void 0?{[c]:p}:j0(n,s)||j0(n,{[n]:nm(n,s,a.style),[l]:nm(l,s,a.style)})||j0(n,a[r])||j0(n,a.mark)||{[c]:cF({model:e,defaultPos:t,channel:n,scaleName:d,scale:h})()}}function Jye({channel:e,channelDef:t,channel2Def:n,markDef:i,config:r,scaleName:s,scale:o,stack:a,offset:u,defaultRef:l}){return re(t)&&a&&e.charAt(0)===a.fieldChannel.charAt(0)?Ua(t,s,{suffix:"start"},{offset:u}):PC({channel:e,channelDef:n,scaleName:s,scale:o,stack:a,markDef:i,config:r,offset:u,defaultRef:l})}function j0(e,t){const n=bi(e),i=ko(e);if(t[i]!==void 0)return{[i]:od(e,t[i])};if(t[e]!==void 0)return{[i]:od(e,t[e])};if(t[n]){const r=t[n];if(Oc(r))j(Uge(n));else return{[n]:od(e,r)}}}function No(e,t,n){var m;const{config:i,encoding:r,markDef:s}=e,o=Is(t),a=bi(t),u=r[t],l=r[o],c=e.getScaleComponent(t),f=c?c.get("type"):void 0,d=e.scaleName(t),h=s.orient,g=r[a]??r.size??ke("size",s,i,{vgChannel:a}),p=n==="bar"&&(t==="x"?h==="vertical":h==="horizontal");if(W(u)&&(We(u.bin)||fn(u.bin)||u.timeUnit&&!l)&&!(g&&!Oc(g))&&!tn(f)){const y=tR({channel:t,fieldDef:u,markDef:s,config:i,scaleType:f}),b=(m=e.component.axes[t])==null?void 0:m[0],x=(b==null?void 0:b.get("translate"))??.5;return ebe({fieldDef:u,fieldDef2:l,channel:t,markDef:s,scaleName:d,bandSize:y,axisTranslate:x,spacing:_r(t)?ke("binSpacing",s,i):void 0,reverse:c.get("reverse"),config:i})}else return(re(u)&&tn(f)||p)&&!l?Zye(u,t,e):rL(t,e,{defaultPos:"zeroOrMax",defaultPos2:"zeroOrMin"})}function Qye(e,t,n,i,r){if(Oc(r))if(n){const o=n.get("type");if(o==="band")return{scale:t,band:r.band};r.band!==1&&(j(Qge(o)),r=void 0)}else return{mult:r.band,field:{group:e}};else{if(te(r))return r;if(r)return{value:r}}if(n){const o=n.get("range");if(Jo(o)&&at(o.step))return{value:o.step-2}}return{value:cm(i.view,e)-2}}function Zye(e,t,n){const{markDef:i,encoding:r,config:s,stack:o}=n,a=i.orient,u=n.scaleName(t),l=n.getScaleComponent(t),c=bi(t),f=Is(t),d=a==="horizontal"&&t==="y"||a==="vertical"&&t==="x";let h;(r.size||i.size)&&(d?h=vt("size",n,{vgChannel:c,defaultRef:Xe(i.size)}):j(npe(i.type)));const g=tR({channel:t,fieldDef:e,markDef:i,config:s,scaleType:l==null?void 0:l.get("type"),useVlSizeChannel:d});h=h||{[c]:Qye(c,u,l,s,g)};const p=(l==null?void 0:l.get("type"))!=="band"||!("band"in h[c])?"middle":"top",m=iL(t,i,s,p),y=m==="xc"||m==="yc",b=Zd(t,i),x=PC({channel:t,channelDef:e,markDef:i,config:s,scaleName:u,scale:l,stack:o,offset:b,defaultRef:cF({model:n,defaultPos:"mid",channel:t,scaleName:u,scale:l}),bandPosition:y?.5:te(g)?{signal:`(1-${g})/2`}:Oc(g)?(1-g.band)/2:0});if(c)return{[m]:x,...h};{const v=ko(f),A=h[c],w=b?{...A,offset:b}:A;return{[m]:x,[v]:K(x)?[x[0],{...x[1],offset:w}]:{...x,offset:w}}}}function cf(e,t,n,i,r){if(n7(e))return 0;const s=e==="x"||e==="y2"?-t/2:t/2;if(te(n)||te(r)||te(i)){const o=Es(n),a=Es(r),u=Es(i),l=u?`${u} + `:"",c=o?`(${o} ? -1 : 1) * `:"",f=a?`(${a} + ${s})`:s;return{signal:l+c+f}}else return r=r||0,i+(n?-r-s:+r+s)}function ebe({fieldDef:e,fieldDef2:t,channel:n,bandSize:i,scaleName:r,markDef:s,spacing:o=0,axisTranslate:a,reverse:u,config:l}){const c=Is(n),f=ko(n),d=ko(c),h=Zd(n,s),g=te(i)?{signal:`(1-${i.signal})/2`}:Oc(i)?(1-i.band)/2:.5;if(We(e.bin)||e.timeUnit)return{[d]:_k({channel:n,fieldDef:e,scaleName:r,markDef:s,bandPosition:g,offset:cf(c,o,u,a,h),config:l}),[f]:_k({channel:n,fieldDef:e,scaleName:r,markDef:s,bandPosition:te(g)?{signal:`1-${g.signal}`}:1-g,offset:cf(n,o,u,a,h),config:l})};if(fn(e.bin)){const p=Ua(e,r,{},{offset:cf(c,o,u,a,h)});if(W(t))return{[d]:p,[f]:Ua(t,r,{},{offset:cf(n,o,u,a,h)})};if(_u(e.bin)&&e.bin.step)return{[d]:p,[f]:{signal:`scale("${r}", ${q(e,{expr:"datum"})} + ${e.bin.step})`,offset:cf(n,o,u,a,h)}}}j(C7(c))}function _k({channel:e,fieldDef:t,scaleName:n,markDef:i,bandPosition:r,offset:s,config:o}){const a=sm({scaleName:n,fieldOrDatumDef:t,bandPosition:r,offset:s});return W7({fieldDef:t,channel:e,markDef:i,ref:a,config:o})}const tbe=new Set(["aria","width","height"]);function Ai(e,t){const{fill:n=void 0,stroke:i=void 0}=t.color==="include"?nL(e):{};return{...nbe(e.markDef,t),...kk(e,"fill",n),...kk(e,"stroke",i),...vt("opacity",e),...vt("fillOpacity",e),...vt("strokeOpacity",e),...vt("strokeWidth",e),...vt("strokeDash",e),...Hye(e),...eL(e),...lF(e,"href"),...qye(e)}}function kk(e,t,n){const{config:i,mark:r,markDef:s}=e;if(ke("invalid",s,i)==="hide"&&n&&!Qo(r)){const a=ibe(e,{invalid:!0,channels:Q1});if(a)return{[t]:[{test:a,value:null},...Qe(n)]}}return n?{[t]:n}:{}}function nbe(e,t){return bge.reduce((n,i)=>(!tbe.has(i)&&e[i]!==void 0&&t[i]!=="ignore"&&(n[i]=Xe(e[i])),n),{})}function ibe(e,{invalid:t=!1,channels:n}){const i=n.reduce((s,o)=>{const a=e.getScaleComponent(o);if(a){const u=a.get("type"),l=e.vgField(o,{expr:"datum"});l&&ii(u)&&(s[l]=!0)}return s},{}),r=z(i);if(r.length>0){const s=t?"||":"&&";return r.map(o=>IC(o,t)).join(` ${s} `)}}function fF(e){const{config:t,markDef:n}=e;if(ke("invalid",n,t)){const r=rbe(e,{channels:Yr});if(r)return{defined:{signal:r}}}return{}}function rbe(e,{invalid:t=!1,channels:n}){const i=n.reduce((s,o)=>{const a=e.getScaleComponent(o);if(a){const u=a.get("type"),l=e.vgField(o,{expr:"datum"});l&&ii(u)&&(s[l]=!0)}return s},{}),r=z(i);if(r.length>0){const s=t?"||":"&&";return r.map(o=>IC(o,t)).join(` ${s} `)}}function Mk(e,t){if(t!==void 0)return{[e]:Xe(t)}}const i2="voronoi",sL={defined:e=>e.type==="point"&&e.nearest,parse:(e,t)=>{if(t.events)for(const n of t.events)n.markname=e.getName(i2)},marks:(e,t,n)=>{const{x:i,y:r}=t.project.hasChannel,s=e.mark;if(Qo(s))return j(wge(s)),n;const o={name:e.getName(i2),type:"path",interactive:!0,from:{data:e.getName("marks")},encode:{update:{fill:{value:"transparent"},strokeWidth:{value:.35},stroke:{value:"transparent"},isVoronoi:{value:!0},...eL(e,{reactiveGeom:!0})}},transform:[{type:"voronoi",x:{expr:i||!r?"datum.datum.x || 0":"0"},y:{expr:r||!i?"datum.datum.y || 0":"0"},size:[e.getSizeSignalRef("width"),e.getSizeSignalRef("height")]}]};let a=0,u=!1;return n.forEach((l,c)=>{const f=l.name??"";f===e.component.mark[0].name?a=c:f.indexOf(i2)>=0&&(u=!0)}),u||n.splice(a+1,0,o),n}},oL={defined:e=>e.type==="point"&&e.resolve==="global"&&e.bind&&e.bind!=="scales"&&!tF(e.bind),parse:(e,t,n)=>gL(t,n),topLevelSignals:(e,t,n)=>{const i=t.name,r=t.project,s=t.bind,o=t.init&&t.init[0],a=sL.defined(t)?"(item().isVoronoi ? datum.datum : datum)":"datum";return r.items.forEach((u,l)=>{const c=Ke(`${i}_${u.field}`);n.filter(d=>d.name===c).length||n.unshift({name:c,...o?{init:Wl(o[l])}:{value:null},on:t.events?[{events:t.events,update:`datum && item().mark.marktype !== 'group' ? ${a}[${Ae(u.field)}] : null`}]:[],bind:s[u.field]??s[u.channel]??s})}),n},signals:(e,t,n)=>{const i=t.name,r=t.project,s=n.filter(l=>l.name===i+To)[0],o=i+e0,a=r.items.map(l=>Ke(`${i}_${l.field}`)),u=a.map(l=>`${l} !== null`).join(" && ");return a.length&&(s.update=`${u} ? {fields: ${o}, values: [${a.join(", ")}]} : null`),delete s.value,delete s.on,n}},pm="_toggle",aL={defined:e=>e.type==="point"&&!!e.toggle,signals:(e,t,n)=>n.concat({name:t.name+pm,value:!1,on:[{events:t.events,update:t.toggle}]}),modifyExpr:(e,t)=>{const n=t.name+To,i=t.name+pm;return`${i} ? null : ${n}, `+(t.resolve==="global"?`${i} ? null : true, `:`${i} ? null : {unit: ${Gl(e)}}, `)+`${i} ? ${n} : null`}},sbe={defined:e=>e.clear!==void 0&&e.clear!==!1,parse:(e,t)=>{t.clear&&(t.clear=ue(t.clear)?Tc(t.clear,"view"):t.clear)},topLevelSignals:(e,t,n)=>{if(oL.defined(t))for(const i of t.project.items){const r=n.findIndex(s=>s.name===Ke(`${t.name}_${i.field}`));r!==-1&&n[r].on.push({events:t.clear,update:"null"})}return n},signals:(e,t,n)=>{function i(r,s){r!==-1&&n[r].on&&n[r].on.push({events:t.clear,update:s})}if(t.type==="interval")for(const r of t.project.items){const s=n.findIndex(o=>o.name===r.signals.visual);if(i(s,"[0, 0]"),s===-1){const o=n.findIndex(a=>a.name===r.signals.data);i(o,"null")}}else{let r=n.findIndex(s=>s.name===t.name+To);i(r,"null"),aL.defined(t)&&(r=n.findIndex(s=>s.name===t.name+pm),i(r,"false"))}return n}},uL={defined:e=>{const t=e.resolve==="global"&&e.bind&&tF(e.bind),n=e.project.items.length===1&&e.project.items[0].field!==Kd;return t&&!n&&j(Fge),t&&n},parse:(e,t,n)=>{const i=ce(n);if(i.select=ue(i.select)?{type:i.select,toggle:t.toggle}:{...i.select,toggle:t.toggle},gL(t,i),gl(n.select)&&(n.select.on||n.select.clear)){const o='event.item && indexof(event.item.mark.role, "legend") < 0';for(const a of t.events)a.filter=Qe(a.filter??[]),a.filter.includes(o)||a.filter.push(o)}const r=e2(t.bind)?t.bind.legend:"click",s=ue(r)?Tc(r,"view"):Qe(r);t.bind={legend:{merge:s}}},topLevelSignals:(e,t,n)=>{const i=t.name,r=e2(t.bind)&&t.bind.legend,s=o=>a=>{const u=ce(a);return u.markname=o,u};for(const o of t.project.items){if(!o.hasLegend)continue;const a=`${Ke(o.field)}_legend`,u=`${i}_${a}`;if(n.filter(c=>c.name===u).length===0){const c=r.merge.map(s(`${a}_symbols`)).concat(r.merge.map(s(`${a}_labels`))).concat(r.merge.map(s(`${a}_entries`)));n.unshift({name:u,...t.init?{}:{value:null},on:[{events:c,update:"datum.value || item().items[0].items[0].datum.value",force:!0},{events:r.merge,update:`!event.item || !datum ? null : ${u}`,force:!0}]})}}return n},signals:(e,t,n)=>{const i=t.name,r=t.project,s=n.find(d=>d.name===i+To),o=i+e0,a=r.items.filter(d=>d.hasLegend).map(d=>Ke(`${i}_${Ke(d.field)}_legend`)),l=`${a.map(d=>`${d} !== null`).join(" && ")} ? {fields: ${o}, values: [${a.join(", ")}]} : null`;t.events&&a.length>0?s.on.push({events:a.map(d=>({signal:d})),update:l}):a.length>0&&(s.update=l,delete s.value,delete s.on);const c=n.find(d=>d.name===i+pm),f=e2(t.bind)&&t.bind.legend;return c&&(t.events?c.on.push({...c.on[0],events:f}):c.on[0].events=f),n}};function obe(e,t,n){var r;const i=(r=e.fieldDef(t))==null?void 0:r.field;for(const s of pn(e.component.selection??{})){const o=s.project.hasField[i]??s.project.hasChannel[t];if(o&&uL.defined(s)){const a=n.get("selections")??[];a.push(s.name),n.set("selections",a,!1),o.hasLegend=!0}}}const lL="_translate_anchor",cL="_translate_delta",abe={defined:e=>e.type==="interval"&&e.translate,signals:(e,t,n)=>{const i=t.name,r=Oo.defined(t),s=i+lL,{x:o,y:a}=t.project.hasChannel;let u=Tc(t.translate,"scope");return r||(u=u.map(l=>(l.between[0].markname=i+ud,l))),n.push({name:s,value:{},on:[{events:u.map(l=>l.between[0]),update:"{x: x(unit), y: y(unit)"+(o!==void 0?`, extent_x: ${r?kv(e,Ze):`slice(${o.signals.visual})`}`:"")+(a!==void 0?`, extent_y: ${r?kv(e,mt):`slice(${a.signals.visual})`}`:"")+"}"}]},{name:i+cL,value:{},on:[{events:u,update:`{x: ${s}.x - x(unit), y: ${s}.y - y(unit)}`}]}),o!==void 0&&Ok(e,t,o,"width",n),a!==void 0&&Ok(e,t,a,"height",n),n}};function Ok(e,t,n,i,r){const s=t.name,o=s+lL,a=s+cL,u=n.channel,l=Oo.defined(t),c=r.filter(A=>A.name===n.signals[l?"data":"visual"])[0],f=e.getSizeSignalRef(i).signal,d=e.getScaleComponent(u),h=d.get("type"),g=d.get("reverse"),p=l?u===Ze?g?"":"-":g?"-":"":"",m=`${o}.extent_${u}`,y=`${p}${a}.${u} / ${l?`${f}`:`span(${m})`}`,b=l?h==="log"?"panLog":h==="symlog"?"panSymlog":h==="pow"?"panPow":"panLinear":"panLinear",x=l?h==="pow"?`, ${d.get("exponent")??1}`:h==="symlog"?`, ${d.get("constant")??1}`:"":"",v=`${b}(${m}, ${y}${x})`;c.on.push({events:{signal:a},update:l?v:`clampRange(${v}, 0, ${f})`})}const fL="_zoom_anchor",dL="_zoom_delta",ube={defined:e=>e.type==="interval"&&e.zoom,signals:(e,t,n)=>{const i=t.name,r=Oo.defined(t),s=i+dL,{x:o,y:a}=t.project.hasChannel,u=Ae(e.scaleName(Ze)),l=Ae(e.scaleName(mt));let c=Tc(t.zoom,"scope");return r||(c=c.map(f=>(f.markname=i+ud,f))),n.push({name:i+fL,on:[{events:c,update:r?"{"+[u?`x: invert(${u}, x(unit))`:"",l?`y: invert(${l}, y(unit))`:""].filter(f=>!!f).join(", ")+"}":"{x: x(unit), y: y(unit)}"}]},{name:s,on:[{events:c,force:!0,update:"pow(1.001, event.deltaY * pow(16, event.deltaMode))"}]}),o!==void 0&&Nk(e,t,o,"width",n),a!==void 0&&Nk(e,t,a,"height",n),n}};function Nk(e,t,n,i,r){const s=t.name,o=n.channel,a=Oo.defined(t),u=r.filter(b=>b.name===n.signals[a?"data":"visual"])[0],l=e.getSizeSignalRef(i).signal,c=e.getScaleComponent(o),f=c.get("type"),d=a?kv(e,o):u.name,h=s+dL,g=`${s}${fL}.${o}`,p=a?f==="log"?"zoomLog":f==="symlog"?"zoomSymlog":f==="pow"?"zoomPow":"zoomLinear":"zoomLinear",m=a?f==="pow"?`, ${c.get("exponent")??1}`:f==="symlog"?`, ${c.get("constant")??1}`:"":"",y=`${p}(${d}, ${g}, ${h}${m})`;u.on.push({events:{signal:h},update:a?y:`clampRange(${y}, 0, ${l})`})}const lu="_store",To="_tuple",lbe="_modify",hL="vlSelectionResolve",xy=[Uye,zye,Iye,aL,oL,Oo,uL,sbe,abe,ube,sL];function cbe(e){let t=e.parent;for(;t&&!Ui(t);)t=t.parent;return t}function Gl(e,{escape:t}={escape:!0}){let n=t?Ae(e.name):e.name;const i=cbe(e);if(i){const{facet:r}=i;for(const s of ci)r[s]&&(n+=` + '__facet_${s}_' + (facet[${Ae(i.vgField(s))}])`)}return n}function dF(e){return pn(e.component.selection??{}).reduce((t,n)=>t||n.project.items.some(i=>i.field===Kd),!1)}function gL(e,t){(Pi(t.select)||!t.select.on)&&delete e.events,(Pi(t.select)||!t.select.clear)&&delete e.clear,(Pi(t.select)||!t.select.toggle)&&delete e.toggle}const fbe="RawCode",dbe="Literal",hbe="Property",gbe="Identifier",pbe="ArrayExpression",mbe="BinaryExpression",ybe="CallExpression",bbe="ConditionalExpression",xbe="LogicalExpression",vbe="MemberExpression",Abe="ObjectExpression",Ebe="UnaryExpression";function tr(e){this.type=e}tr.prototype.visit=function(e){let t,n,i;if(e(this))return 1;for(t=wbe(this),n=0,i=t.length;n<i;++n)if(t[n].visit(e))return 1};function wbe(e){switch(e.type){case pbe:return e.elements;case mbe:case xbe:return[e.left,e.right];case ybe:return[e.callee].concat(e.arguments);case bbe:return[e.test,e.consequent,e.alternate];case vbe:return[e.object,e.property];case Abe:return e.properties;case hbe:return[e.key,e.value];case Ebe:return[e.argument];case gbe:case dbe:case fbe:default:return[]}}var Xr,X,P,Zt,Te,vy=1,t0=2,cu=3,ea=4,Ay=5,Mu=6,Cn=7,n0=8,$be=9;Xr={};Xr[vy]="Boolean";Xr[t0]="<end>";Xr[cu]="Identifier";Xr[ea]="Keyword";Xr[Ay]="Null";Xr[Mu]="Numeric";Xr[Cn]="Punctuator";Xr[n0]="String";Xr[$be]="RegularExpression";var Cbe="ArrayExpression",Fbe="BinaryExpression",Sbe="CallExpression",Dbe="ConditionalExpression",pL="Identifier",_be="Literal",kbe="LogicalExpression",Mbe="MemberExpression",Obe="ObjectExpression",Nbe="Property",Tbe="UnaryExpression",Dt="Unexpected token %0",Bbe="Unexpected number",Rbe="Unexpected string",Lbe="Unexpected identifier",Pbe="Unexpected reserved word",Ibe="Unexpected end of input",Ov="Invalid regular expression",r2="Invalid regular expression: missing /",mL="Octal literals are not allowed in strict mode.",zbe="Duplicate data property in object literal not allowed in strict mode",Nt="ILLEGAL",eh="Disabled.",jbe=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]"),Ube=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 Ey(e,t){if(!e)throw new Error("ASSERT: "+t)}function os(e){return e>=48&&e<=57}function hF(e){return"0123456789abcdefABCDEF".indexOf(e)>=0}function ld(e){return"01234567".indexOf(e)>=0}function qbe(e){return e===32||e===9||e===11||e===12||e===160||e>=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].indexOf(e)>=0}function th(e){return e===10||e===13||e===8232||e===8233}function i0(e){return e===36||e===95||e>=65&&e<=90||e>=97&&e<=122||e===92||e>=128&&jbe.test(String.fromCharCode(e))}function mm(e){return e===36||e===95||e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||e===92||e>=128&&Ube.test(String.fromCharCode(e))}const Wbe={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 yL(){for(;P<Zt;){const e=X.charCodeAt(P);if(qbe(e)||th(e))++P;else break}}function Nv(e){var t,n,i,r=0;for(n=e==="u"?4:2,t=0;t<n;++t)P<Zt&&hF(X[P])?(i=X[P++],r=r*16+"0123456789abcdef".indexOf(i.toLowerCase())):$e({},Dt,Nt);return String.fromCharCode(r)}function Gbe(){var e,t,n,i;for(e=X[P],t=0,e==="}"&&$e({},Dt,Nt);P<Zt&&(e=X[P++],!!hF(e));)t=t*16+"0123456789abcdef".indexOf(e.toLowerCase());return(t>1114111||e!=="}")&&$e({},Dt,Nt),t<=65535?String.fromCharCode(t):(n=(t-65536>>10)+55296,i=(t-65536&1023)+56320,String.fromCharCode(n,i))}function bL(){var e,t;for(e=X.charCodeAt(P++),t=String.fromCharCode(e),e===92&&(X.charCodeAt(P)!==117&&$e({},Dt,Nt),++P,e=Nv("u"),(!e||e==="\\"||!i0(e.charCodeAt(0)))&&$e({},Dt,Nt),t=e);P<Zt&&(e=X.charCodeAt(P),!!mm(e));)++P,t+=String.fromCharCode(e),e===92&&(t=t.substr(0,t.length-1),X.charCodeAt(P)!==117&&$e({},Dt,Nt),++P,e=Nv("u"),(!e||e==="\\"||!mm(e.charCodeAt(0)))&&$e({},Dt,Nt),t+=e);return t}function Hbe(){var e,t;for(e=P++;P<Zt;){if(t=X.charCodeAt(P),t===92)return P=e,bL();if(mm(t))++P;else break}return X.slice(e,P)}function Vbe(){var e,t,n;return e=P,t=X.charCodeAt(P)===92?bL():Hbe(),t.length===1?n=cu:Wbe.hasOwnProperty(t)?n=ea:t==="null"?n=Ay:t==="true"||t==="false"?n=vy:n=cu,{type:n,value:t,start:e,end:P}}function s2(){var e=P,t=X.charCodeAt(P),n,i=X[P],r,s,o;switch(t){case 46:case 40:case 41:case 59:case 44:case 123:case 125:case 91:case 93:case 58:case 63:case 126:return++P,{type:Cn,value:String.fromCharCode(t),start:e,end:P};default:if(n=X.charCodeAt(P+1),n===61)switch(t){case 43:case 45:case 47:case 60:case 62:case 94:case 124:case 37:case 38:case 42:return P+=2,{type:Cn,value:String.fromCharCode(t)+String.fromCharCode(n),start:e,end:P};case 33:case 61:return P+=2,X.charCodeAt(P)===61&&++P,{type:Cn,value:X.slice(e,P),start:e,end:P}}}if(o=X.substr(P,4),o===">>>=")return P+=4,{type:Cn,value:o,start:e,end:P};if(s=o.substr(0,3),s===">>>"||s==="<<="||s===">>=")return P+=3,{type:Cn,value:s,start:e,end:P};if(r=s.substr(0,2),i===r[1]&&"+-<>&|".indexOf(i)>=0||r==="=>")return P+=2,{type:Cn,value:r,start:e,end:P};if(r==="//"&&$e({},Dt,Nt),"<>=!+-*%&|^/".indexOf(i)>=0)return++P,{type:Cn,value:i,start:e,end:P};$e({},Dt,Nt)}function Ybe(e){let t="";for(;P<Zt&&hF(X[P]);)t+=X[P++];return t.length===0&&$e({},Dt,Nt),i0(X.charCodeAt(P))&&$e({},Dt,Nt),{type:Mu,value:parseInt("0x"+t,16),start:e,end:P}}function Xbe(e){let t="0"+X[P++];for(;P<Zt&&ld(X[P]);)t+=X[P++];return(i0(X.charCodeAt(P))||os(X.charCodeAt(P)))&&$e({},Dt,Nt),{type:Mu,value:parseInt(t,8),octal:!0,start:e,end:P}}function Tk(){var e,t,n;if(n=X[P],Ey(os(n.charCodeAt(0))||n===".","Numeric literal must start with a decimal digit or a decimal point"),t=P,e="",n!=="."){if(e=X[P++],n=X[P],e==="0"){if(n==="x"||n==="X")return++P,Ybe(t);if(ld(n))return Xbe(t);n&&os(n.charCodeAt(0))&&$e({},Dt,Nt)}for(;os(X.charCodeAt(P));)e+=X[P++];n=X[P]}if(n==="."){for(e+=X[P++];os(X.charCodeAt(P));)e+=X[P++];n=X[P]}if(n==="e"||n==="E")if(e+=X[P++],n=X[P],(n==="+"||n==="-")&&(e+=X[P++]),os(X.charCodeAt(P)))for(;os(X.charCodeAt(P));)e+=X[P++];else $e({},Dt,Nt);return i0(X.charCodeAt(P))&&$e({},Dt,Nt),{type:Mu,value:parseFloat(e),start:t,end:P}}function Kbe(){var e="",t,n,i,r,s=!1;for(t=X[P],Ey(t==="'"||t==='"',"String literal must starts with a quote"),n=P,++P;P<Zt;)if(i=X[P++],i===t){t="";break}else if(i==="\\")if(i=X[P++],!i||!th(i.charCodeAt(0)))switch(i){case"u":case"x":X[P]==="{"?(++P,e+=Gbe()):e+=Nv(i);break;case"n":e+=`
`;break;case"r":e+="\r";break;case"t":e+=" ";break;case"b":e+="\b";break;case"f":e+="\f";break;case"v":e+="\v";break;default:ld(i)?(r="01234567".indexOf(i),r!==0&&(s=!0),P<Zt&&ld(X[P])&&(s=!0,r=r*8+"01234567".indexOf(X[P++]),"0123".indexOf(i)>=0&&P<Zt&&ld(X[P])&&(r=r*8+"01234567".indexOf(X[P++]))),e+=String.fromCharCode(r)):e+=i;break}else i==="\r"&&X[P]===`
`&&++P;else{if(th(i.charCodeAt(0)))break;e+=i}return t!==""&&$e({},Dt,Nt),{type:n0,value:e,octal:s,start:n,end:P}}function Jbe(e,t){let n=e;t.indexOf("u")>=0&&(n=n.replace(/\\u\{([0-9a-fA-F]+)\}/g,(i,r)=>{if(parseInt(r,16)<=1114111)return"x";$e({},Ov)}).replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"x"));try{new RegExp(n)}catch{$e({},Ov)}try{return new RegExp(e,t)}catch{return null}}function Qbe(){var e,t,n,i,r;for(e=X[P],Ey(e==="/","Regular expression literal must start with a slash"),t=X[P++],n=!1,i=!1;P<Zt;)if(e=X[P++],t+=e,e==="\\")e=X[P++],th(e.charCodeAt(0))&&$e({},r2),t+=e;else if(th(e.charCodeAt(0)))$e({},r2);else if(n)e==="]"&&(n=!1);else if(e==="/"){i=!0;break}else e==="["&&(n=!0);return i||$e({},r2),r=t.substr(1,t.length-2),{value:r,literal:t}}function Zbe(){var e,t,n;for(t="",n="";P<Zt&&(e=X[P],!!mm(e.charCodeAt(0)));)++P,e==="\\"&&P<Zt?$e({},Dt,Nt):(n+=e,t+=e);return n.search(/[^gimuy]/g)>=0&&$e({},Ov,n),{value:n,literal:t}}function e2e(){var e,t,n,i;return Te=null,yL(),e=P,t=Qbe(),n=Zbe(),i=Jbe(t.value,n.value),{literal:t.literal+n.literal,value:i,regex:{pattern:t.value,flags:n.value},start:e,end:P}}function t2e(e){return e.type===cu||e.type===ea||e.type===vy||e.type===Ay}function xL(){if(yL(),P>=Zt)return{type:t0,start:P,end:P};const e=X.charCodeAt(P);return i0(e)?Vbe():e===40||e===41||e===59?s2():e===39||e===34?Kbe():e===46?os(X.charCodeAt(P+1))?Tk():s2():os(e)?Tk():s2()}function On(){const e=Te;return P=e.end,Te=xL(),P=e.end,e}function vL(){const e=P;Te=xL(),P=e}function n2e(e){const t=new tr(Cbe);return t.elements=e,t}function Bk(e,t,n){const i=new tr(e==="||"||e==="&&"?kbe:Fbe);return i.operator=e,i.left=t,i.right=n,i}function i2e(e,t){const n=new tr(Sbe);return n.callee=e,n.arguments=t,n}function r2e(e,t,n){const i=new tr(Dbe);return i.test=e,i.consequent=t,i.alternate=n,i}function gF(e){const t=new tr(pL);return t.name=e,t}function Lf(e){const t=new tr(_be);return t.value=e.value,t.raw=X.slice(e.start,e.end),e.regex&&(t.raw==="//"&&(t.raw="/(?:)/"),t.regex=e.regex),t}function Rk(e,t,n){const i=new tr(Mbe);return i.computed=e==="[",i.object=t,i.property=n,i.computed||(n.member=!0),i}function s2e(e){const t=new tr(Obe);return t.properties=e,t}function Lk(e,t,n){const i=new tr(Nbe);return i.key=t,i.value=n,i.kind=e,i}function o2e(e,t){const n=new tr(Tbe);return n.operator=e,n.argument=t,n.prefix=!0,n}function $e(e,t){var n,i=Array.prototype.slice.call(arguments,2),r=t.replace(/%(\d)/g,(s,o)=>(Ey(o<i.length,"Message reference must be in range"),i[o]));throw n=new Error(r),n.index=P,n.description=r,n}function wy(e){e.type===t0&&$e(e,Ibe),e.type===Mu&&$e(e,Bbe),e.type===n0&&$e(e,Rbe),e.type===cu&&$e(e,Lbe),e.type===ea&&$e(e,Pbe),$e(e,Dt,e.value)}function en(e){const t=On();(t.type!==Cn||t.value!==e)&&wy(t)}function Ve(e){return Te.type===Cn&&Te.value===e}function o2(e){return Te.type===ea&&Te.value===e}function a2e(){const e=[];for(P=Te.start,en("[");!Ve("]");)Ve(",")?(On(),e.push(null)):(e.push(fu()),Ve("]")||en(","));return On(),n2e(e)}function Pk(){P=Te.start;const e=On();return e.type===n0||e.type===Mu?(e.octal&&$e(e,mL),Lf(e)):gF(e.value)}function u2e(){var e,t,n,i;if(P=Te.start,e=Te,e.type===cu)return n=Pk(),en(":"),i=fu(),Lk("init",n,i);if(e.type===t0||e.type===Cn)wy(e);else return t=Pk(),en(":"),i=fu(),Lk("init",t,i)}function l2e(){var e=[],t,n,i,r={},s=String;for(P=Te.start,en("{");!Ve("}");)t=u2e(),t.key.type===pL?n=t.key.name:n=s(t.key.value),i="$"+n,Object.prototype.hasOwnProperty.call(r,i)?$e({},zbe):r[i]=!0,e.push(t),Ve("}")||en(",");return en("}"),s2e(e)}function c2e(){en("(");const e=pF();return en(")"),e}const f2e={if:1};function d2e(){var e,t,n;if(Ve("("))return c2e();if(Ve("["))return a2e();if(Ve("{"))return l2e();if(e=Te.type,P=Te.start,e===cu||f2e[Te.value])n=gF(On().value);else if(e===n0||e===Mu)Te.octal&&$e(Te,mL),n=Lf(On());else{if(e===ea)throw new Error(eh);e===vy?(t=On(),t.value=t.value==="true",n=Lf(t)):e===Ay?(t=On(),t.value=null,n=Lf(t)):Ve("/")||Ve("/=")?(n=Lf(e2e()),vL()):wy(On())}return n}function h2e(){const e=[];if(en("("),!Ve(")"))for(;P<Zt&&(e.push(fu()),!Ve(")"));)en(",");return en(")"),e}function g2e(){P=Te.start;const e=On();return t2e(e)||wy(e),gF(e.value)}function p2e(){return en("."),g2e()}function m2e(){en("[");const e=pF();return en("]"),e}function y2e(){var e,t,n;for(e=d2e();;)if(Ve("."))n=p2e(),e=Rk(".",e,n);else if(Ve("("))t=h2e(),e=i2e(e,t);else if(Ve("["))n=m2e(),e=Rk("[",e,n);else break;return e}function Ik(){const e=y2e();if(Te.type===Cn&&(Ve("++")||Ve("--")))throw new Error(eh);return e}function Sg(){var e,t;if(Te.type!==Cn&&Te.type!==ea)t=Ik();else{if(Ve("++")||Ve("--"))throw new Error(eh);if(Ve("+")||Ve("-")||Ve("~")||Ve("!"))e=On(),t=Sg(),t=o2e(e.value,t);else{if(o2("delete")||o2("void")||o2("typeof"))throw new Error(eh);t=Ik()}}return t}function zk(e){let t=0;if(e.type!==Cn&&e.type!==ea)return 0;switch(e.value){case"||":t=1;break;case"&&":t=2;break;case"|":t=3;break;case"^":t=4;break;case"&":t=5;break;case"==":case"!=":case"===":case"!==":t=6;break;case"<":case">":case"<=":case">=":case"instanceof":case"in":t=7;break;case"<<":case">>":case">>>":t=8;break;case"+":case"-":t=9;break;case"*":case"/":case"%":t=11;break}return t}function b2e(){var e,t,n,i,r,s,o,a,u,l;if(e=Te,u=Sg(),i=Te,r=zk(i),r===0)return u;for(i.prec=r,On(),t=[e,Te],o=Sg(),s=[u,i,o];(r=zk(Te))>0;){for(;s.length>2&&r<=s[s.length-2].prec;)o=s.pop(),a=s.pop().value,u=s.pop(),t.pop(),n=Bk(a,u,o),s.push(n);i=On(),i.prec=r,s.push(i),t.push(Te),n=Sg(),s.push(n)}for(l=s.length-1,n=s[l],t.pop();l>1;)t.pop(),n=Bk(s[l-1].value,s[l-2],n),l-=2;return n}function fu(){var e,t,n;return e=b2e(),Ve("?")&&(On(),t=fu(),en(":"),n=fu(),e=r2e(e,t,n)),e}function pF(){const e=fu();if(Ve(","))throw new Error(eh);return e}function x2e(e){X=e,P=0,Zt=X.length,Te=null,vL();const t=pF();if(Te.type!==t0)throw new Error("Unexpect token after expression.");return t}function Tv(e){const t=[];return e.type==="Identifier"?[e.name]:e.type==="Literal"?[e.value]:(e.type==="MemberExpression"&&(t.push(...Tv(e.object)),t.push(...Tv(e.property))),t)}function AL(e){return e.object.type==="MemberExpression"?AL(e.object):e.object.name==="datum"}function EL(e){const t=x2e(e),n=new Set;return t.visit(i=>{i.type==="MemberExpression"&&AL(i)&&n.add(Tv(i).slice(1).join("."))}),n}class Rc extends Le{constructor(t,n,i){super(t),this.model=n,this.filter=i,this.expr=ym(this.model,this.filter,this),this._dependentFields=EL(this.expr)}clone(){return new Rc(null,this.model,ce(this.filter))}dependentFields(){return this._dependentFields}producedFields(){return new Set}assemble(){return{type:"filter",expr:this.expr}}hash(){return`Filter ${this.expr}`}}function v2e(e,t){const n={},i=e.config.selection;if(!t||!t.length)return n;for(const r of t){const s=Ke(r.name),o=r.select,a=ue(o)?o:o.type,u=ze(o)?ce(o):{type:a},{fields:l,encodings:c,...f}=i[a];for(const h in f)h==="mark"&&(u[h]={...f[h],...u[h]}),(u[h]===void 0||u[h]===!0)&&(u[h]=f[h]??u[h]);const d=n[s]={...u,name:s,type:a,init:r.value,bind:r.bind,events:ue(u.on)?Tc(u.on,"scope"):Qe(ce(u.on))};for(const h of xy)h.defined(d)&&h.parse&&h.parse(e,d,r)}return n}function wL(e,t,n,i="datum"){const r=ue(t)?t:t.param,s=Ke(r),o=Ae(s+lu);let a;try{a=e.getSelectionComponent(s,r)}catch{return`!!${s}`}if(a.project.timeUnit){const c=n??e.component.data.raw,f=a.project.timeUnit.clone();c.parent?f.insertAsParentOf(c):c.parent=f}const u=`vlSelectionTest(${o}, ${i}${a.resolve==="global"?")":`, ${Ae(a.resolve)})`}`,l=`length(data(${o}))`;return t.empty===!1?`${l} && ${u}`:`!${l} || ${u}`}function $L(e,t,n){const i=Ke(t),r=n.encoding;let s=n.field,o;try{o=e.getSelectionComponent(i,t)}catch{return i}if(!r&&!s)s=o.project.items[0].field,o.project.items.length>1&&j(`A "field" or "encoding" must be specified when using a selection as a scale domain. Using "field": ${Ae(s)}.`);else if(r&&!s){const a=o.project.items.filter(u=>u.channel===r);!a.length||a.length>1?(s=o.project.items[0].field,j((a.length?"Multiple ":"No ")+`matching ${Ae(r)} encoding found for selection ${Ae(n.param)}. Using "field": ${Ae(s)}.`)):s=a[0].field}return`${o.name}[${Ae(mi(s))}]`}function A2e(e,t){for(const[n,i]of _o(e.component.selection??{})){const r=e.getName(`lookup_${n}`);e.component.data.outputNodes[r]=i.materialized=new mn(new Rc(t,e,{param:n}),r,je.Lookup,e.component.data.outputNodeRefCounts)}}function ym(e,t,n){return sd(t,i=>ue(i)?i:Lpe(i)?wL(e,i,n):N7(i))}function E2e(e,t){if(e)return K(e)&&!Xs(e)?e.map(n=>HC(n,t)).join(", "):e}function a2(e,t,n,i){var r,s;e.encode??(e.encode={}),(r=e.encode)[t]??(r[t]={}),(s=e.encode[t]).update??(s.update={}),e.encode[t].update[n]=i}function Pf(e,t,n,i={header:!1}){var f,d;const{disable:r,orient:s,scale:o,labelExpr:a,title:u,zindex:l,...c}=e.combine();if(!r){for(const h in c){const g=qme[h],p=c[h];if(g&&g!==t&&g!=="both")delete c[h];else if(Zh(p)){const{condition:m,...y}=p,b=Qe(m),x=fk[h];if(x){const{vgProp:v,part:A}=x,w=[...b.map(E=>{const{test:$,...k}=E;return{test:ym(null,$),...k}}),y];a2(c,A,v,w),delete c[h]}else if(x===null){const v={signal:b.map(A=>{const{test:w,...E}=A;return`${ym(null,w)} ? ${K3(E)} : `}).join("")+K3(y)};c[h]=v}}else if(te(p)){const m=fk[h];if(m){const{vgProp:y,part:b}=m;a2(c,b,y,p),delete c[h]}}fe(["labelAlign","labelBaseline"],h)&&c[h]===null&&delete c[h]}if(t==="grid"){if(!c.grid)return;if(c.encode){const{grid:h}=c.encode;c.encode={...h?{grid:h}:{}},Be(c.encode)&&delete c.encode}return{scale:o,orient:s,...c,domain:!1,labels:!1,aria:!1,maxExtent:0,minExtent:0,ticks:!1,zindex:ut(l,0)}}else{if(!i.header&&e.mainExtracted)return;if(a!==void 0){let g=a;(d=(f=c.encode)==null?void 0:f.labels)!=null&&d.update&&te(c.encode.labels.update.text)&&(g=ru(a,"datum.label",c.encode.labels.update.text.signal)),a2(c,"labels","text",{signal:g})}if(c.labelAlign===null&&delete c.labelAlign,c.encode){for(const g of cR)e.hasAxisPart(g)||delete c.encode[g];Be(c.encode)&&delete c.encode}const h=E2e(u,n);return{scale:o,orient:s,grid:!1,...h?{title:h}:{},...c,...n.aria===!1?{aria:!1}:{},zindex:ut(l,0)}}}}function CL(e){const{axes:t}=e.component,n=[];for(const i of Yr)if(t[i]){for(const r of t[i])if(!r.get("disable")&&!r.get("gridScale")){const s=i==="x"?"height":"width",o=e.getSizeSignalRef(s).signal;s!==o&&n.push({name:s,update:o})}}return n}function w2e(e,t){const{x:n=[],y:i=[]}=e;return[...n.map(r=>Pf(r,"grid",t)),...i.map(r=>Pf(r,"grid",t)),...n.map(r=>Pf(r,"main",t)),...i.map(r=>Pf(r,"main",t))].filter(r=>r)}function jk(e,t,n,i){return Object.assign.apply(null,[{},...e.map(r=>{if(r==="axisOrient"){const s=n==="x"?"bottom":"left",o=t[n==="x"?"axisBottom":"axisLeft"]||{},a=t[n==="x"?"axisTop":"axisRight"]||{},u=new Set([...z(o),...z(a)]),l={};for(const c of u.values())l[c]={signal:`${i.signal} === "${s}" ? ${Es(o[c])} : ${Es(a[c])}`};return l}return t[r]})])}function $2e(e,t,n,i){const r=t==="band"?["axisDiscrete","axisBand"]:t==="point"?["axisDiscrete","axisPoint"]:Vpe(t)?["axisQuantitative"]:t==="time"||t==="utc"?["axisTemporal"]:[],s=e==="x"?"axisX":"axisY",o=te(n)?"axisOrient":`axis${Gh(n)}`,a=[...r,...r.map(l=>s+l.substr(4))],u=["axis",o,s];return{vlOnlyAxisConfig:jk(a,i,e,n),vgAxisConfig:jk(u,i,e,n),axisConfigStyle:C2e([...u,...a],i)}}function C2e(e,t){var i;const n=[{}];for(const r of e){let s=(i=t[r])==null?void 0:i.style;if(s){s=Qe(s);for(const o of s)n.push(t.style[o])}}return Object.assign.apply(null,n)}function Bv(e,t,n,i={}){var s;const r=p7(e,n,t);if(r!==void 0)return{configFrom:"style",configValue:r};for(const o of["vlOnlyAxisConfig","vgAxisConfig","axisConfigStyle"])if(((s=i[o])==null?void 0:s[e])!==void 0)return{configFrom:o,configValue:i[o][e]};return{}}const Uk={scale:({model:e,channel:t})=>e.scaleName(t),format:({fieldOrDatumDef:e,config:t,axis:n})=>{const{format:i,formatType:r}=n;return Y7(e,e.type,i,r,t,!0)},formatType:({axis:e,fieldOrDatumDef:t,scaleType:n})=>{const{formatType:i}=e;return X7(i,t,n)},grid:({fieldOrDatumDef:e,axis:t,scaleType:n})=>t.grid??F2e(n,e),gridScale:({model:e,channel:t})=>S2e(e,t),labelAlign:({axis:e,labelAngle:t,orient:n,channel:i})=>e.labelAlign||SL(t,n,i),labelAngle:({labelAngle:e})=>e,labelBaseline:({axis:e,labelAngle:t,orient:n,channel:i})=>e.labelBaseline||FL(t,n,i),labelFlush:({axis:e,fieldOrDatumDef:t,channel:n})=>e.labelFlush??_2e(t.type,n),labelOverlap:({axis:e,fieldOrDatumDef:t,scaleType:n})=>e.labelOverlap??k2e(t.type,n,W(t)&&!!t.timeUnit,W(t)?t.sort:void 0),orient:({orient:e})=>e,tickCount:({channel:e,model:t,axis:n,fieldOrDatumDef:i,scaleType:r})=>{const s=e==="x"?"width":e==="y"?"height":void 0,o=s?t.getSizeSignalRef(s):void 0;return n.tickCount??O2e({fieldOrDatumDef:i,scaleType:r,size:o,values:n.values})},title:({axis:e,model:t,channel:n})=>{if(e.title!==void 0)return e.title;const i=DL(t,n);if(i!==void 0)return i;const r=t.typedFieldDef(n),s=n==="x"?"x2":"y2",o=t.fieldDef(s);return y7(r?[ck(r)]:[],W(o)?[ck(o)]:[])},values:({axis:e,fieldOrDatumDef:t})=>N2e(e,t),zindex:({axis:e,fieldOrDatumDef:t,mark:n})=>e.zindex??T2e(n,t)};function F2e(e,t){return!tn(e)&&W(t)&&!We(t==null?void 0:t.bin)&&!fn(t==null?void 0:t.bin)}function S2e(e,t){const n=t==="x"?"y":"x";if(e.getScaleComponent(n))return e.scaleName(n)}function D2e(e,t,n,i,r){const s=t==null?void 0:t.labelAngle;if(s!==void 0)return te(s)?s:Vd(s);{const{configValue:o}=Bv("labelAngle",i,t==null?void 0:t.style,r);return o!==void 0?Vd(o):n===Ze&&fe([TC,NC],e.type)&&!(W(e)&&e.timeUnit)?270:void 0}}function Rv(e){return`(((${e.signal} % 360) + 360) % 360)`}function FL(e,t,n,i){if(e!==void 0)if(n==="x"){if(te(e)){const r=Rv(e),s=te(t)?`(${t.signal} === "top")`:t==="top";return{signal:`(45 < ${r} && ${r} < 135) || (225 < ${r} && ${r} < 315) ? "middle" :(${r} <= 45 || 315 <= ${r}) === ${s} ? "bottom" : "top"`}}if(45<e&&e<135||225<e&&e<315)return"middle";if(te(t)){const r=e<=45||315<=e?"===":"!==";return{signal:`${t.signal} ${r} "top" ? "bottom" : "top"`}}return(e<=45||315<=e)==(t==="top")?"bottom":"top"}else{if(te(e)){const r=Rv(e),s=te(t)?`(${t.signal} === "left")`:t==="left";return{signal:`${r} <= 45 || 315 <= ${r} || (135 <= ${r} && ${r} <= 225) ? ${i?'"middle"':"null"} : (45 <= ${r} && ${r} <= 135) === ${s} ? "top" : "bottom"`}}if(e<=45||315<=e||135<=e&&e<=225)return i?"middle":null;if(te(t)){const r=45<=e&&e<=135?"===":"!==";return{signal:`${t.signal} ${r} "left" ? "top" : "bottom"`}}return(45<=e&&e<=135)==(t==="left")?"top":"bottom"}}function SL(e,t,n){if(e===void 0)return;const i=n==="x",r=i?0:90,s=i?"bottom":"left";if(te(e)){const o=Rv(e),a=te(t)?`(${t.signal} === "${s}")`:t===s;return{signal:`(${r?`(${o} + 90)`:o} % 180 === 0) ? ${i?null:'"center"'} :(${r} < ${o} && ${o} < ${180+r}) === ${a} ? "left" : "right"`}}if((e+r)%180===0)return i?null:"center";if(te(t)){const o=r<e&&e<180+r?"===":"!==";return{signal:`${`${t.signal} ${o} "${s}"`} ? "left" : "right"`}}return(r<e&&e<180+r)==(t===s)?"left":"right"}function _2e(e,t){if(t==="x"&&fe(["quantitative","temporal"],e))return!0}function k2e(e,t,n,i){if(n&&!ze(i)||e!=="nominal"&&e!=="ordinal")return t==="log"||t==="symlog"?"greedy":!0}function M2e(e){return e==="x"?"bottom":"left"}function O2e({fieldOrDatumDef:e,scaleType:t,size:n,values:i}){var r;if(!i&&!tn(t)&&t!=="log"){if(W(e)){if(We(e.bin))return{signal:`ceil(${n.signal}/10)`};if(e.timeUnit&&fe(["month","hours","day","quarter"],(r=xn(e.timeUnit))==null?void 0:r.unit))return}return{signal:`ceil(${n.signal}/40)`}}}function DL(e,t){const n=t==="x"?"x2":"y2",i=e.fieldDef(t),r=e.fieldDef(n),s=i?i.title:void 0,o=r?r.title:void 0;if(s&&o)return b7(s,o);if(s)return s;if(o)return o;if(s!==void 0)return s;if(o!==void 0)return o}function N2e(e,t){const n=e.values;if(K(n))return lR(t,n);if(te(n))return n}function T2e(e,t){return e==="rect"&&om(t)?1:0}class Hl extends Le{constructor(t,n){super(t),this.transform=n,this._dependentFields=EL(this.transform.calculate)}clone(){return new Hl(null,ce(this.transform))}static parseAllForSortIndex(t,n){return n.forEachFieldDef((i,r)=>{if(Nc(i)&&Z7(i.sort)){const{field:s,timeUnit:o}=i,a=i.sort,u=a.map((l,c)=>`${N7({field:s,timeUnit:o,equal:l})} ? ${c} : `).join("")+a.length;t=new Hl(t,{calculate:u,as:Vl(i,r,{forAs:!0})})}}),t}producedFields(){return new Set([this.transform.as])}dependentFields(){return this._dependentFields}assemble(){return{type:"formula",expr:this.transform.calculate,as:this.transform.as}}hash(){return`Calculate ${ye(this.transform)}`}}function Vl(e,t,n){return q(e,{prefix:t,suffix:"sort_index",...n??{}})}function $y(e,t){return fe(["top","bottom"],t)?"column":fe(["left","right"],t)||e==="row"?"row":"column"}function Yl(e,t,n,i){const r=i==="row"?n.headerRow:i==="column"?n.headerColumn:n.headerFacet;return ut((t||{})[e],r[e],n.header[e])}function Cy(e,t,n,i){const r={};for(const s of e){const o=Yl(s,t||{},n,i);o!==void 0&&(r[s]=o)}return r}const mF=["row","column"],yF=["header","footer"];function B2e(e,t){const n=e.component.layoutHeaders[t].title,i=e.config?e.config:void 0,r=e.component.layoutHeaders[t].facetFieldDef?e.component.layoutHeaders[t].facetFieldDef:void 0,{titleAnchor:s,titleAngle:o,titleOrient:a}=Cy(["titleAnchor","titleAngle","titleOrient"],r.header,i,t),u=$y(t,a),l=Vd(o);return{name:`${t}-title`,type:"group",role:`${u}-title`,title:{text:n,...t==="row"?{orient:"left"}:{},style:"guide-title",...kL(l,u),..._L(u,l,s),...ML(i,r,t,f1e,CR)}}}function _L(e,t,n="middle"){switch(n){case"start":return{align:"left"};case"end":return{align:"right"}}const i=SL(t,e==="row"?"left":"top",e==="row"?"y":"x");return i?{align:i}:{}}function kL(e,t){const n=FL(e,t==="row"?"left":"top",t==="row"?"y":"x",!0);return n?{baseline:n}:{}}function R2e(e,t){const n=e.component.layoutHeaders[t],i=[];for(const r of yF)if(n[r])for(const s of n[r]){const o=P2e(e,t,r,n,s);o!=null&&i.push(o)}return i}function L2e(e,t){const{sort:n}=e;return vr(n)?{field:q(n,{expr:"datum"}),order:n.order??"ascending"}:K(n)?{field:Vl(e,t,{expr:"datum"}),order:"ascending"}:{field:q(e,{expr:"datum"}),order:n??"ascending"}}function Lv(e,t,n){const{format:i,formatType:r,labelAngle:s,labelAnchor:o,labelOrient:a,labelExpr:u}=Cy(["format","formatType","labelAngle","labelAnchor","labelOrient","labelExpr"],e.header,n,t),l=zC({fieldOrDatumDef:e,format:i,formatType:r,expr:"parent",config:n}).signal,c=$y(t,a);return{text:{signal:u?ru(ru(u,"datum.label",l),"datum.value",q(e,{expr:"parent"})):l},...t==="row"?{orient:"left"}:{},style:"guide-label",frame:"group",...kL(s,c),..._L(c,s,o),...ML(n,e,t,d1e,FR)}}function P2e(e,t,n,i,r){if(r){let s=null;const{facetFieldDef:o}=i,a=e.config?e.config:void 0;if(o&&r.labels){const{labelOrient:f}=Cy(["labelOrient"],o.header,a,t);(t==="row"&&!fe(["top","bottom"],f)||t==="column"&&!fe(["left","right"],f))&&(s=Lv(o,t,a))}const u=Ui(e)&&!Jh(e.facet),l=r.axes,c=(l==null?void 0:l.length)>0;if(s||c){const f=t==="row"?"height":"width";return{name:e.getName(`${t}_${n}`),type:"group",role:`${t}-${n}`,...i.facetFieldDef?{from:{data:e.getName(`${t}_domain`)},sort:L2e(o,t)}:{},...c&&u?{from:{data:e.getName(`facet_domain_${t}`)}}:{},...s?{title:s}:{},...r.sizeSignal?{encode:{update:{[f]:r.sizeSignal}}}:{},...c?{axes:l}:{}}}}return null}const I2e={column:{start:0,end:1},row:{start:1,end:0}};function z2e(e,t){return I2e[t][e]}function j2e(e,t){const n={};for(const i of ci){const r=e[i];if(r!=null&&r.facetFieldDef){const{titleAnchor:s,titleOrient:o}=Cy(["titleAnchor","titleOrient"],r.facetFieldDef.header,t,i),a=$y(i,o),u=z2e(s,a);u!==void 0&&(n[a]=u)}}return Be(n)?void 0:n}function ML(e,t,n,i,r){const s={};for(const o of i){if(!r[o])continue;const a=Yl(o,t==null?void 0:t.header,e,n);a!==void 0&&(s[r[o]]=a)}return s}function bF(e){return[...U0(e,"width"),...U0(e,"height"),...U0(e,"childWidth"),...U0(e,"childHeight")]}function U0(e,t){const n=t==="width"?"x":"y",i=e.component.layoutSize.get(t);if(!i||i==="merged")return[];const r=e.getSizeSignalRef(t).signal;if(i==="step"){const s=e.getScaleComponent(n);if(s){const o=s.get("type"),a=s.get("range");if(tn(o)&&Jo(a)){const u=e.scaleName(n);return Ui(e.parent)&&e.parent.component.resolve.scale[n]==="independent"?[qk(u,a)]:[qk(u,a),{name:r,update:OL(u,s,`domain('${u}').length`)}]}}throw new Error("layout size is step although width/height is not step.")}else if(i=="container"){const s=r.endsWith("width"),o=s?"containerSize()[0]":"containerSize()[1]",a=Cv(e.config.view,s?"width":"height"),u=`isFinite(${o}) ? ${o} : ${a}`;return[{name:r,init:u,on:[{update:u,events:"window:resize"}]}]}else return[{name:r,value:i}]}function qk(e,t){return{name:`${e}_step`,value:t.step}}function OL(e,t,n){const i=t.get("type"),r=t.get("padding"),s=ut(t.get("paddingOuter"),r);let o=t.get("paddingInner");return o=i==="band"?o!==void 0?o:r:1,`bandspace(${n}, ${Es(o)}, ${Es(s)}) * ${e}_step`}function NL(e){return e==="childWidth"?"width":e==="childHeight"?"height":e}function TL(e,t){return z(e).reduce((n,i)=>{const r=e[i];return{...n,...Bc(t,r,i,s=>Xe(s.value))}},{})}function BL(e,t){if(Ic(t)||Ui(t))return"shared";if(CF(t))return _r(e)?"independent":"shared";throw new Error("invalid model type for resolve")}function xF(e,t){const n=e.scale[t],i=_r(t)?"axis":"legend";return n==="independent"?(e[i][t]==="shared"&&j(ape(t)),"independent"):e[i][t]||"shared"}const U2e={...p1e,disable:1,labelExpr:1,selections:1,opacity:1,shape:1,stroke:1,fill:1,size:1,strokeWidth:1,strokeDash:1,encode:1},RL=z(U2e);class q2e extends js{}const Wk={symbols:W2e,gradient:G2e,labels:H2e,entries:V2e};function W2e(e,{fieldOrDatumDef:t,model:n,channel:i,legendCmpt:r,legendType:s}){if(s!=="symbol")return;const{markDef:o,encoding:a,config:u,mark:l}=n,c=o.filled&&l!=="trail";let f={...vge({},n,hme),...nL(n,{filled:c})};const d=r.get("symbolOpacity")??u.legend.symbolOpacity,h=r.get("symbolFillColor")??u.legend.symbolFillColor,g=r.get("symbolStrokeColor")??u.legend.symbolStrokeColor,p=d===void 0?LL(a.opacity)??o.opacity:void 0;if(f.fill){if(i==="fill"||c&&i===zn)delete f.fill;else if(f.fill.field)h?delete f.fill:(f.fill=Xe(u.legend.symbolBaseFillColor??"black"),f.fillOpacity=Xe(p??1));else if(K(f.fill)){const m=Pv(a.fill??a.color)??o.fill??(c&&o.color);m&&(f.fill=Xe(m))}}if(f.stroke){if(i==="stroke"||!c&&i===zn)delete f.stroke;else if(f.stroke.field||g)delete f.stroke;else if(K(f.stroke)){const m=ut(Pv(a.stroke||a.color),o.stroke,c?o.color:void 0);m&&(f.stroke={value:m})}}if(i!==Ps){const m=W(t)&&IL(n,r,t);m?f.opacity=[{test:m,...Xe(p??1)},Xe(u.legend.unselectedOpacity)]:p&&(f.opacity=Xe(p))}return f={...f,...e},Be(f)?void 0:f}function G2e(e,{model:t,legendType:n,legendCmpt:i}){if(n!=="gradient")return;const{config:r,markDef:s,encoding:o}=t;let a={};const l=(i.get("gradientOpacity")??r.legend.gradientOpacity)===void 0?LL(o.opacity)||s.opacity:void 0;return l&&(a.opacity=Xe(l)),a={...a,...e},Be(a)?void 0:a}function H2e(e,{fieldOrDatumDef:t,model:n,channel:i,legendCmpt:r}){const s=n.legend(i)||{},o=n.config,a=W(t)?IL(n,r,t):void 0,u=a?[{test:a,value:1},{value:o.legend.unselectedOpacity}]:void 0,{format:l,formatType:c}=s,f=uu(c)?jC({fieldOrDatumDef:t,field:"datum.value",format:l,formatType:c,config:o}):void 0,d={...u?{opacity:u}:{},...f?{text:f}:{},...e};return Be(d)?void 0:d}function V2e(e,{legendCmpt:t}){const n=t.get("selections");return n!=null&&n.length?{...e,fill:{value:"transparent"}}:e}function LL(e){return PL(e,(t,n)=>Math.max(t,n.value))}function Pv(e){return PL(e,(t,n)=>ut(t,n.value))}function PL(e,t){if(Mme(e))return Qe(e.condition).reduce(t,e.value);if(Hi(e))return e.value}function IL(e,t,n){const i=t.get("selections");if(!(i!=null&&i.length))return;const r=Ae(n.field);return i.map(s=>`(!length(data(${Ae(Ke(s)+lu)})) || (${s}[${r}] && indexof(${s}[${r}], datum.value) >= 0))`).join(" || ")}const Gk={direction:({direction:e})=>e,format:({fieldOrDatumDef:e,legend:t,config:n})=>{const{format:i,formatType:r}=t;return Y7(e,e.type,i,r,n,!1)},formatType:({legend:e,fieldOrDatumDef:t,scaleType:n})=>{const{formatType:i}=e;return X7(i,t,n)},gradientLength:e=>{const{legend:t,legendConfig:n}=e;return t.gradientLength??n.gradientLength??exe(e)},labelOverlap:({legend:e,legendConfig:t,scaleType:n})=>e.labelOverlap??t.labelOverlap??txe(n),symbolType:({legend:e,markDef:t,channel:n,encoding:i})=>e.symbolType??X2e(t.type,n,i.shape,t.shape),title:({fieldOrDatumDef:e,config:t})=>fl(e,t,{allowDisabling:!0}),type:({legendType:e,scaleType:t,channel:n})=>{if(cl(n)&&Li(t)){if(e==="gradient")return}else if(e==="symbol")return;return e},values:({fieldOrDatumDef:e,legend:t})=>Y2e(t,e)};function Y2e(e,t){const n=e.values;if(K(n))return lR(t,n);if(te(n))return n}function X2e(e,t,n,i){if(t!=="shape"){const r=Pv(n)??i;if(r)return r}switch(e){case"bar":case"rect":case"image":case"square":return"square";case"line":case"trail":case"rule":return"stroke";case"arc":case"point":case"circle":case"tick":case"geoshape":case"area":case"text":return"circle"}}function K2e(e){const{legend:t}=e;return ut(t.type,J2e(e))}function J2e({channel:e,timeUnit:t,scaleType:n}){if(cl(e)){if(fe(["quarter","month","day"],t))return"symbol";if(Li(n))return"gradient"}return"symbol"}function Q2e({legendConfig:e,legendType:t,orient:n,legend:i}){return i.direction??e[t?"gradientDirection":"symbolDirection"]??Z2e(n,t)}function Z2e(e,t){switch(e){case"top":case"bottom":return"horizontal";case"left":case"right":case"none":case void 0:return;default:return t==="gradient"?"horizontal":void 0}}function exe({legendConfig:e,model:t,direction:n,orient:i,scaleType:r}){const{gradientHorizontalMaxLength:s,gradientHorizontalMinLength:o,gradientVerticalMaxLength:a,gradientVerticalMinLength:u}=e;if(Li(r))return n==="horizontal"?i==="top"||i==="bottom"?Hk(t,"width",o,s):o:Hk(t,"height",u,a)}function Hk(e,t,n,i){return{signal:`clamp(${e.getSizeSignalRef(t).signal}, ${n}, ${i})`}}function txe(e){if(fe(["quantile","threshold","log","symlog"],e))return"greedy"}function zL(e){const t=st(e)?nxe(e):oxe(e);return e.component.legends=t,t}function nxe(e){const{encoding:t}=e,n={};for(const i of[zn,...DR]){const r=gt(t[i]);!r||!e.getScaleComponent(i)||i===jn&&W(r)&&r.type===Mc||(n[i]=sxe(e,i))}return n}function ixe(e,t){const n=e.scaleName(t);if(e.mark==="trail"){if(t==="color")return{stroke:n};if(t==="size")return{strokeWidth:n}}return t==="color"?e.markDef.filled?{fill:n}:{stroke:n}:{[t]:n}}function rxe(e,t,n,i){switch(t){case"disable":return n!==void 0;case"values":return!!(n!=null&&n.values);case"title":if(t==="title"&&e===(i==null?void 0:i.title))return!0}return e===(n||{})[t]}function sxe(e,t){var v;let n=e.legend(t);const{markDef:i,encoding:r,config:s}=e,o=s.legend,a=new q2e({},ixe(e,t));obe(e,t,a);const u=n!==void 0?!n:o.disable;if(a.set("disable",u,n!==void 0),u)return a;n=n||{};const l=e.getScaleComponent(t).get("type"),c=gt(r[t]),f=W(c)?(v=xn(c.timeUnit))==null?void 0:v.unit:void 0,d=n.orient||s.legend.orient||"right",h=K2e({legend:n,channel:t,timeUnit:f,scaleType:l}),g=Q2e({legend:n,legendType:h,orient:d,legendConfig:o}),p={legend:n,channel:t,model:e,markDef:i,encoding:r,fieldOrDatumDef:c,legendConfig:o,config:s,scaleType:l,orient:d,legendType:h,direction:g};for(const A of RL){if(h==="gradient"&&A.startsWith("symbol")||h==="symbol"&&A.startsWith("gradient"))continue;const w=A in Gk?Gk[A](p):n[A];if(w!==void 0){const E=rxe(w,A,n,e.fieldDef(t));(E||s.legend[A]===void 0)&&a.set(A,w,E)}}const m=(n==null?void 0:n.encoding)??{},y=a.get("selections"),b={},x={fieldOrDatumDef:c,model:e,channel:t,legendCmpt:a,legendType:h};for(const A of["labels","legend","title","symbols","gradient","entries"]){const w=TL(m[A]??{},e),E=A in Wk?Wk[A](w,x):w;E!==void 0&&!Be(E)&&(b[A]={...y!=null&&y.length&&W(c)?{name:`${Ke(c.field)}_legend_${A}`}:{},...y!=null&&y.length?{interactive:!!y}:{},update:E})}return Be(b)||a.set("encode",b,!!(n!=null&&n.encoding)),a}function oxe(e){const{legends:t,resolve:n}=e.component;for(const i of e.children){zL(i);for(const r of z(i.component.legends))n.legend[r]=xF(e.component.resolve,r),n.legend[r]==="shared"&&(t[r]=jL(t[r],i.component.legends[r]),t[r]||(n.legend[r]="independent",delete t[r]))}for(const i of z(t))for(const r of e.children)r.component.legends[i]&&n.legend[i]==="shared"&&delete r.component.legends[i];return t}function jL(e,t){var s,o,a,u;if(!e)return t.clone();const n=e.getWithExplicit("orient"),i=t.getWithExplicit("orient");if(n.explicit&&i.explicit&&n.value!==i.value)return;let r=!1;for(const l of RL){const c=Mo(e.getWithExplicit(l),t.getWithExplicit(l),l,"legend",(f,d)=>{switch(l){case"symbolType":return axe(f,d);case"title":return x7(f,d);case"type":return r=!0,Wn("symbol")}return yy(f,d,l,"legend")});e.setWithExplicit(l,c)}return r&&((o=(s=e.implicit)==null?void 0:s.encode)!=null&&o.gradient&&tm(e.implicit,["encode","gradient"]),(u=(a=e.explicit)==null?void 0:a.encode)!=null&&u.gradient&&tm(e.explicit,["encode","gradient"])),e}function axe(e,t){return t.value==="circle"?t:e}function uxe(e,t,n,i){var r,s;e.encode??(e.encode={}),(r=e.encode)[t]??(r[t]={}),(s=e.encode[t]).update??(s.update={}),e.encode[t].update[n]=i}function UL(e){const t=e.component.legends,n={};for(const r of z(t)){const s=e.getScaleComponent(r),o=Ue(s.get("domains"));if(n[o])for(const a of n[o])jL(a,t[r])||n[o].push(t[r]);else n[o]=[t[r].clone()]}return pn(n).flat().map(r=>lxe(r,e.config)).filter(r=>r!==void 0)}function lxe(e,t){var o,a,u;const{disable:n,labelExpr:i,selections:r,...s}=e.combine();if(!n){if(t.aria===!1&&s.aria==null&&(s.aria=!1),(o=s.encode)!=null&&o.symbols){const l=s.encode.symbols.update;l.fill&&l.fill.value!=="transparent"&&!l.stroke&&!s.stroke&&(l.stroke={value:"transparent"});for(const c of DR)s[c]&&delete l[c]}if(s.title||delete s.title,i!==void 0){let l=i;(u=(a=s.encode)==null?void 0:a.labels)!=null&&u.update&&te(s.encode.labels.update.text)&&(l=ru(i,"datum.label",s.encode.labels.update.text.signal)),uxe(s,"labels","text",{signal:l})}return s}}function cxe(e){return Ic(e)||CF(e)?fxe(e):qL(e)}function fxe(e){return e.children.reduce((t,n)=>t.concat(n.assembleProjections()),qL(e))}function qL(e){const t=e.component.projection;if(!t||t.merged)return[];const n=t.combine(),{name:i}=n;if(t.data){const r={signal:`[${t.size.map(o=>o.signal).join(", ")}]`},s=t.data.reduce((o,a)=>{const u=te(a)?a.signal:`data('${e.lookupDataSource(a)}')`;return fe(o,u)||o.push(u),o},[]);if(s.length<=0)throw new Error("Projection's fit didn't find any data sources");return[{name:i,size:r,fit:{signal:s.length>1?`[${s.join(", ")}]`:s[0]},...n}]}else return[{name:i,translate:{signal:"[width / 2, height / 2]"},...n}]}const dxe=["type","clipAngle","clipExtent","center","rotate","precision","reflectX","reflectY","coefficient","distance","fraction","lobes","parallel","radius","ratio","spacing","tilt"];class WL extends js{constructor(t,n,i,r){super({...n},{name:t}),this.specifiedProjection=n,this.size=i,this.data=r,this.merged=!1}get isFit(){return!!this.data}}function GL(e){e.component.projection=st(e)?hxe(e):mxe(e)}function hxe(e){if(e.hasProjection){const t=Sn(e.specifiedProjection),n=!(t&&(t.scale!=null||t.translate!=null)),i=n?[e.getSizeSignalRef("width"),e.getSizeSignalRef("height")]:void 0,r=n?gxe(e):void 0,s=new WL(e.projectionName(!0),{...Sn(e.config.projection)??{},...t??{}},i,r);return s.get("type")||s.set("type","equalEarth",!1),s}}function gxe(e){const t=[],{encoding:n}=e;for(const i of[[Gr,Wr],[yi,er]])(gt(n[i[0]])||gt(n[i[1]]))&&t.push({signal:e.getName(`geojson_${t.length}`)});return e.channelHasField(jn)&&e.typedFieldDef(jn).type===Mc&&t.push({signal:e.getName(`geojson_${t.length}`)}),t.length===0&&t.push(e.requestDataName(je.Main)),t}function pxe(e,t){const n=lC(dxe,r=>!!(!_a(e.explicit,r)&&!_a(t.explicit,r)||_a(e.explicit,r)&&_a(t.explicit,r)&&fr(e.get(r),t.get(r))));if(fr(e.size,t.size)){if(n)return e;if(fr(e.explicit,{}))return t;if(fr(t.explicit,{}))return e}return null}function mxe(e){if(e.children.length===0)return;let t;for(const i of e.children)GL(i);const n=lC(e.children,i=>{const r=i.component.projection;if(r)if(t){const s=pxe(t,r);return s&&(t=s),!!s}else return t=r,!0;else return!0});if(t&&n){const i=e.projectionName(!0),r=new WL(i,t.specifiedProjection,t.size,ce(t.data));for(const s of e.children){const o=s.component.projection;o&&(o.isFit&&r.data.push(...s.component.projection.data),s.renameProjection(o.get("name"),i),o.merged=!0)}return r}}function yxe(e,t,n,i){if(Qh(t,n)){const r=st(e)?e.axis(n)??e.legend(n)??{}:{},s=q(t,{expr:"datum"}),o=q(t,{expr:"datum",binSuffix:"end"});return{formulaAs:q(t,{binSuffix:"range",forAs:!0}),formula:sy(s,o,r.format,r.formatType,i)}}return{}}function HL(e,t){return`${f7(e)}_${t}`}function bxe(e,t){return{signal:e.getName(`${t}_bins`),extentSignal:e.getName(`${t}_extent`)}}function vF(e,t,n){const i=fy(n,void 0)??{},r=HL(i,t);return e.getName(`${r}_bins`)}function xxe(e){return"as"in e}function Vk(e,t,n){let i,r;xxe(e)?i=ue(e.as)?[e.as,`${e.as}_end`]:[e.as[0],e.as[1]]:i=[q(e,{forAs:!0}),q(e,{binSuffix:"end",forAs:!0})];const s={...fy(t,void 0)},o=HL(s,e.field),{signal:a,extentSignal:u}=bxe(n,o);if(Z1(s.extent)){const c=s.extent;r=$L(n,c.param,c),delete s.extent}const l={bin:s,field:e.field,as:[i],...a?{signal:a}:{},...u?{extentSignal:u}:{},...r?{span:r}:{}};return{key:o,binComponent:l}}class Er extends Le{constructor(t,n){super(t),this.bins=n}clone(){return new Er(null,ce(this.bins))}static makeFromEncoding(t,n){const i=n.reduceFieldDef((r,s,o)=>{if(xi(s)&&We(s.bin)){const{key:a,binComponent:u}=Vk(s,s.bin,n);r[a]={...u,...r[a],...yxe(n,s,o,n.config)}}return r},{});return Be(i)?null:new Er(t,i)}static makeFromTransform(t,n,i){const{key:r,binComponent:s}=Vk(n,n.bin,i);return new Er(t,{[r]:s})}merge(t,n){for(const i of z(t.bins))i in this.bins?(n(t.bins[i].signal,this.bins[i].signal),this.bins[i].as=dr([...this.bins[i].as,...t.bins[i].as],ye)):this.bins[i]=t.bins[i];for(const i of t.children)t.removeChild(i),i.parent=this;t.remove()}producedFields(){return new Set(pn(this.bins).map(t=>t.as).flat(2))}dependentFields(){return new Set(pn(this.bins).map(t=>t.field))}hash(){return`Bin ${ye(this.bins)}`}assemble(){return pn(this.bins).flatMap(t=>{const n=[],[i,...r]=t.as,{extent:s,...o}=t.bin,a={type:"bin",field:mi(t.field),as:i,signal:t.signal,...Z1(s)?{extent:null}:{extent:s},...t.span?{span:{signal:`span(${t.span})`}}:{},...o};!s&&t.extentSignal&&(n.push({type:"extent",field:mi(t.field),signal:t.extentSignal}),a.extent={signal:t.extentSignal}),n.push(a);for(const u of r)for(let l=0;l<2;l++)n.push({type:"formula",expr:q({field:i[l]},{expr:"datum"}),as:u[l]});return t.formula&&n.push({type:"formula",expr:t.formula,as:t.formulaAs}),n})}}function vxe(e,t,n,i){const r=st(i)?i.encoding[Is(t)]:void 0;if(xi(n)&&st(i)&&nR(n,r,i.markDef,i.config))e.add(q(n,{})),e.add(q(n,{suffix:"end"})),n.bin&&Qh(n,t)&&e.add(q(n,{binSuffix:"range"}));else if(H0e(t)){const s=G0e(t);e.add(i.getName(s))}else e.add(q(n));return e}function Axe(e,t){for(const n of z(t)){const i=t[n];for(const r of z(i))n in e?e[n][r]=new Set([...e[n][r]??[],...i[r]]):e[n]={[r]:i[r]}}}class ji extends Le{constructor(t,n,i){super(t),this.dimensions=n,this.measures=i}clone(){return new ji(null,new Set(this.dimensions),ce(this.measures))}get groupBy(){return this.dimensions}static makeFromEncoding(t,n){let i=!1;n.forEachFieldDef(o=>{o.aggregate&&(i=!0)});const r={},s=new Set;return!i||(n.forEachFieldDef((o,a)=>{const{aggregate:u,field:l}=o;if(u)if(u==="count")r["*"]??(r["*"]={}),r["*"].count=new Set([q(o,{forAs:!0})]);else{if(_s(u)||Ko(u)){const c=_s(u)?"argmin":"argmax",f=u[c];r[f]??(r[f]={}),r[f][c]=new Set([q({op:c,field:f},{forAs:!0})])}else r[l]??(r[l]={}),r[l][u]=new Set([q(o,{forAs:!0})]);Xo(a)&&n.scaleDomain(a)==="unaggregated"&&(r[l]??(r[l]={}),r[l].min=new Set([q({field:l,aggregate:"min"},{forAs:!0})]),r[l].max=new Set([q({field:l,aggregate:"max"},{forAs:!0})]))}else vxe(s,a,o,n)}),s.size+z(r).length===0)?null:new ji(t,s,r)}static makeFromTransform(t,n){const i=new Set,r={};for(const s of n.aggregate){const{op:o,field:a,as:u}=s;o&&(o==="count"?(r["*"]??(r["*"]={}),r["*"].count=new Set([u||q(s,{forAs:!0})])):(r[a]??(r[a]={}),r[a][o]=new Set([u||q(s,{forAs:!0})])))}for(const s of n.groupby??[])i.add(s);return i.size+z(r).length===0?null:new ji(t,i,r)}merge(t){return XB(this.dimensions,t.dimensions)?(Axe(this.measures,t.measures),!0):(wpe("different dimensions, cannot merge"),!1)}addDimensions(t){t.forEach(this.dimensions.add,this.dimensions)}dependentFields(){return new Set([...this.dimensions,...z(this.measures)])}producedFields(){const t=new Set;for(const n of z(this.measures))for(const i of z(this.measures[n])){const r=this.measures[n][i];r.size===0?t.add(`${i}_${n}`):r.forEach(t.add,t)}return t}hash(){return`Aggregate ${ye({dimensions:this.dimensions,measures:this.measures})}`}assemble(){const t=[],n=[],i=[];for(const s of z(this.measures))for(const o of z(this.measures[s]))for(const a of this.measures[s][o])i.push(a),t.push(o),n.push(s==="*"?null:mi(s));return{type:"aggregate",groupby:[...this.dimensions].map(mi),ops:t,fields:n,as:i}}}class Lc extends Le{constructor(t,n,i,r){super(t),this.model=n,this.name=i,this.data=r;for(const s of ci){const o=n.facet[s];if(o){const{bin:a,sort:u}=o;this[s]={name:n.getName(`${s}_domain`),fields:[q(o),...We(a)?[q(o,{binSuffix:"end"})]:[]],...vr(u)?{sortField:u}:K(u)?{sortIndexField:Vl(o,s)}:{}}}}this.childModel=n.child}hash(){let t="Facet";for(const n of ci)this[n]&&(t+=` ${n.charAt(0)}:${ye(this[n])}`);return t}get fields(){var n;const t=[];for(const i of ci)(n=this[i])!=null&&n.fields&&t.push(...this[i].fields);return t}dependentFields(){const t=new Set(this.fields);for(const n of ci)this[n]&&(this[n].sortField&&t.add(this[n].sortField.field),this[n].sortIndexField&&t.add(this[n].sortIndexField));return t}producedFields(){return new Set}getSource(){return this.name}getChildIndependentFieldsWithStep(){const t={};for(const n of Yr){const i=this.childModel.component.scales[n];if(i&&!i.merged){const r=i.get("type"),s=i.get("range");if(tn(r)&&Jo(s)){const o=Fy(this.childModel,n),a=$F(o);a?t[n]=a:j(vC(n))}}}return t}assembleRowColumnHeaderData(t,n,i){const r={row:"y",column:"x",facet:void 0}[t],s=[],o=[],a=[];r&&i&&i[r]&&(n?(s.push(`distinct_${i[r]}`),o.push("max")):(s.push(i[r]),o.push("distinct")),a.push(`distinct_${i[r]}`));const{sortField:u,sortIndexField:l}=this[t];if(u){const{op:c=oy,field:f}=u;s.push(f),o.push(c),a.push(q(u,{forAs:!0}))}else l&&(s.push(l),o.push("max"),a.push(l));return{name:this[t].name,source:n??this.data,transform:[{type:"aggregate",groupby:this[t].fields,...s.length?{fields:s,ops:o,as:a}:{}}]}}assembleFacetHeaderData(t){var u;const{columns:n}=this.model.layout,{layoutHeaders:i}=this.model.component,r=[],s={};for(const l of mF){for(const c of yF){const f=(i[l]&&i[l][c])??[];for(const d of f)if(((u=d.axes)==null?void 0:u.length)>0){s[l]=!0;break}}if(s[l]){const c=`length(data("${this.facet.name}"))`,f=l==="row"?n?{signal:`ceil(${c} / ${n})`}:1:n?{signal:`min(${c}, ${n})`}:{signal:c};r.push({name:`${this.facet.name}_${l}`,transform:[{type:"sequence",start:0,stop:f}]})}}const{row:o,column:a}=s;return(o||a)&&r.unshift(this.assembleRowColumnHeaderData("facet",null,t)),r}assemble(){const t=[];let n=null;const i=this.getChildIndependentFieldsWithStep(),{column:r,row:s,facet:o}=this;if(r&&s&&(i.x||i.y)){n=`cross_${this.column.name}_${this.row.name}`;const a=[].concat(i.x??[],i.y??[]),u=a.map(()=>"distinct");t.push({name:n,source:this.data,transform:[{type:"aggregate",groupby:this.fields,fields:a,ops:u}]})}for(const a of[As,vs])this[a]&&t.push(this.assembleRowColumnHeaderData(a,n,i));if(o){const a=this.assembleFacetHeaderData(i);a&&t.push(...a)}return t}}function Yk(e){return e[0]==="'"&&e[e.length-1]==="'"||e[0]==='"'&&e[e.length-1]==='"'?e.slice(1,-1):e}function Exe(e,t){const n=dC(e);if(t==="number")return`toNumber(${n})`;if(t==="boolean")return`toBoolean(${n})`;if(t==="string")return`toString(${n})`;if(t==="date")return`toDate(${n})`;if(t==="flatten")return n;if(t.startsWith("date:")){const i=Yk(t.slice(5,t.length));return`timeParse(${n},'${i}')`}else if(t.startsWith("utc:")){const i=Yk(t.slice(4,t.length));return`utcParse(${n},'${i}')`}else return j(Nge(t)),null}function wxe(e){const t={};return Fg(e.filter,n=>{if(O7(n)){let i=null;CC(n)?i=Yn(n.equal):SC(n)?i=Yn(n.lte):FC(n)?i=Yn(n.lt):DC(n)?i=Yn(n.gt):_C(n)?i=Yn(n.gte):kC(n)?i=n.range[0]:MC(n)&&(i=(n.oneOf??n.in)[0]),i&&(ku(i)?t[n.field]="date":at(i)?t[n.field]="number":ue(i)&&(t[n.field]="string")),n.timeUnit&&(t[n.field]="date")}}),t}function $xe(e){const t={};function n(i){ql(i)?t[i.field]="date":i.type==="quantitative"&&fge(i.aggregate)?t[i.field]="number":zl(i.field)>1?i.field in t||(t[i.field]="flatten"):Nc(i)&&vr(i.sort)&&zl(i.sort.field)>1&&(i.sort.field in t||(t[i.sort.field]="flatten"))}if((st(e)||Ui(e))&&e.forEachFieldDef((i,r)=>{if(xi(i))n(i);else{const s=Du(r),o=e.fieldDef(s);n({...i,type:o.type})}}),st(e)){const{mark:i,markDef:r,encoding:s}=e;if(Qo(i)&&!e.encoding.order){const o=r.orient==="horizontal"?"y":"x",a=s[o];W(a)&&a.type==="quantitative"&&!(a.field in t)&&(t[a.field]="number")}}return t}function Cxe(e){const t={};if(st(e)&&e.component.selection)for(const n of z(e.component.selection)){const i=e.component.selection[n];for(const r of i.project.items)!r.channel&&zl(r.field)>1&&(t[r.field]="flatten")}return t}class Vt extends Le{constructor(t,n){super(t),this._parse=n}clone(){return new Vt(null,ce(this._parse))}hash(){return`Parse ${ye(this._parse)}`}static makeExplicit(t,n,i){let r={};const s=n.data;return!Wa(s)&&s&&s.format&&s.format.parse&&(r=s.format.parse),this.makeWithAncestors(t,r,{},i)}static makeWithAncestors(t,n,i,r){for(const a of z(i)){const u=r.getWithExplicit(a);u.value!==void 0&&(u.explicit||u.value===i[a]||u.value==="derived"||i[a]==="flatten"?delete i[a]:j(nk(a,i[a],u.value)))}for(const a of z(n)){const u=r.get(a);u!==void 0&&(u===n[a]?delete n[a]:j(nk(a,n[a],u)))}const s=new js(n,i);r.copyAll(s);const o={};for(const a of z(s.combine())){const u=s.get(a);u!==null&&(o[a]=u)}return z(o).length===0||r.parseNothing?null:new Vt(t,o)}get parse(){return this._parse}merge(t){this._parse={...this._parse,...t.parse},t.remove()}assembleFormatParse(){const t={};for(const n of z(this._parse)){const i=this._parse[n];zl(n)===1&&(t[n]=i)}return t}producedFields(){return new Set(z(this._parse))}dependentFields(){return new Set(z(this._parse))}assembleTransforms(t=!1){return z(this._parse).filter(n=>t?zl(n)>1:!0).map(n=>{const i=Exe(n,this._parse[n]);return i?{type:"formula",expr:i,as:hC(n)}:null}).filter(n=>n!==null)}}class Bo extends Le{clone(){return new Bo(null)}constructor(t){super(t)}dependentFields(){return new Set}producedFields(){return new Set([Kd])}hash(){return"Identifier"}assemble(){return{type:"identifier",as:Kd}}}class r0 extends Le{constructor(t,n){super(t),this.params=n}clone(){return new r0(null,this.params)}dependentFields(){return new Set}producedFields(){}hash(){return`Graticule ${ye(this.params)}`}assemble(){return{type:"graticule",...this.params===!0?{}:this.params}}}class s0 extends Le{constructor(t,n){super(t),this.params=n}clone(){return new s0(null,this.params)}dependentFields(){return new Set}producedFields(){return new Set([this.params.as??"data"])}hash(){return`Hash ${ye(this.params)}`}assemble(){return{type:"sequence",...this.params}}}class du extends Le{constructor(t){super(null),t??(t={name:"source"});let n;if(Wa(t)||(n=t.format?{...Qn(t.format,["parse"])}:{}),fm(t))this._data={values:t.values};else if(Qd(t)){if(this._data={url:t.url},!n.type){let i=/(?:\.([^.]+))?$/.exec(t.url)[1];fe(["json","csv","tsv","dsv","topojson"],i)||(i="json"),n.type=i}}else GR(t)?this._data={values:[{type:"Sphere"}]}:(qR(t)||Wa(t))&&(this._data={});this._generator=Wa(t),t.name&&(this._name=t.name),n&&!Be(n)&&(this._data.format=n)}dependentFields(){return new Set}producedFields(){}get data(){return this._data}hasName(){return!!this._name}get isGenerator(){return this._generator}get dataName(){return this._name}set dataName(t){this._name=t}set parent(t){throw new Error("Source nodes have to be roots.")}remove(){throw new Error("Source nodes are roots and cannot be removed.")}hash(){throw new Error("Cannot hash sources")}assemble(){return{name:this._name,...this._data,transform:[]}}}var Xk=globalThis&&globalThis.__classPrivateFieldSet||function(e,t,n){if(!t.has(e))throw new TypeError("attempted to set private field on non-instance");return t.set(e,n),n},Fxe=globalThis&&globalThis.__classPrivateFieldGet||function(e,t){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return t.get(e)},If;function AF(e){return e instanceof du||e instanceof r0||e instanceof s0}class EF{constructor(){If.set(this,void 0),Xk(this,If,!1)}setModified(){Xk(this,If,!0)}get modifiedFlag(){return Fxe(this,If)}}If=new WeakMap;class Ou extends EF{getNodeDepths(t,n,i){i.set(t,n);for(const r of t.children)this.getNodeDepths(r,n+1,i);return i}optimize(t){const i=[...this.getNodeDepths(t,0,new Map).entries()].sort((r,s)=>s[1]-r[1]);for(const r of i)this.run(r[0]);return this.modifiedFlag}}class wF extends EF{optimize(t){this.run(t);for(const n of t.children)this.optimize(n);return this.modifiedFlag}}class Sxe extends wF{mergeNodes(t,n){const i=n.shift();for(const r of n)t.removeChild(r),r.parent=i,r.remove()}run(t){const n=t.children.map(r=>r.hash()),i={};for(let r=0;r<n.length;r++)i[n[r]]===void 0?i[n[r]]=[t.children[r]]:i[n[r]].push(t.children[r]);for(const r of z(i))i[r].length>1&&(this.setModified(),this.mergeNodes(t,i[r]))}}class Dxe extends wF{constructor(t){super(),this.requiresSelectionId=t&&dF(t)}run(t){t instanceof Bo&&(this.requiresSelectionId&&(AF(t.parent)||t.parent instanceof ji||t.parent instanceof Vt)||(this.setModified(),t.remove()))}}class _xe extends EF{optimize(t){return this.run(t,new Set),this.modifiedFlag}run(t,n){let i=new Set;t instanceof Ar&&(i=t.producedFields(),cC(i,n)&&(this.setModified(),t.removeFormulas(n),t.producedFields.length===0&&t.remove()));for(const r of t.children)this.run(r,new Set([...n,...i]))}}class kxe extends wF{constructor(){super()}run(t){t instanceof mn&&!t.isRequired()&&(this.setModified(),t.remove())}}class Mxe extends Ou{run(t){if(!AF(t)&&!(t.numChildren()>1)){for(const n of t.children)if(n instanceof Vt)if(t instanceof Vt)this.setModified(),t.merge(n);else{if(fC(t.producedFields(),n.dependentFields()))continue;this.setModified(),n.swapWithParent()}}}}class Oxe extends Ou{run(t){const n=[...t.children],i=t.children.filter(r=>r instanceof Vt);if(t.numChildren()>1&&i.length>=1){const r={},s=new Set;for(const o of i){const a=o.parse;for(const u of z(a))u in r?r[u]!==a[u]&&s.add(u):r[u]=a[u]}for(const o of s)delete r[o];if(!Be(r)){this.setModified();const o=new Vt(t,r);for(const a of n){if(a instanceof Vt)for(const u of z(r))delete a.parse[u];t.removeChild(a),a.parent=o,a instanceof Vt&&z(a.parse).length===0&&a.remove()}}}}}class Nxe extends Ou{run(t){t instanceof mn||t.numChildren()>0||t instanceof Lc||t instanceof du||(this.setModified(),t.remove())}}class Txe extends Ou{run(t){const n=t.children.filter(r=>r instanceof Ar),i=n.pop();for(const r of n)this.setModified(),i.merge(r)}}class Bxe extends Ou{run(t){const n=t.children.filter(r=>r instanceof ji),i={};for(const r of n){const s=ye(r.groupBy);s in i||(i[s]=[]),i[s].push(r)}for(const r of z(i)){const s=i[r];if(s.length>1){const o=s.pop();for(const a of s)o.merge(a)&&(t.removeChild(a),a.parent=o,a.remove(),this.setModified())}}}}class Rxe extends Ou{constructor(t){super(),this.model=t}run(t){const n=!(AF(t)||t instanceof Rc||t instanceof Vt||t instanceof Bo),i=[],r=[];for(const s of t.children)s instanceof Er&&(n&&!fC(t.producedFields(),s.dependentFields())?i.push(s):r.push(s));if(i.length>0){const s=i.pop();for(const o of i)s.merge(o,this.model.renameSignal.bind(this.model));this.setModified(),t instanceof Er?t.merge(s,this.model.renameSignal.bind(this.model)):s.swapWithParent()}if(r.length>1){const s=r.pop();for(const o of r)s.merge(o,this.model.renameSignal.bind(this.model));this.setModified()}}}class Lxe extends Ou{run(t){const n=[...t.children];if(!Il(n,o=>o instanceof mn)||t.numChildren()<=1)return;const r=[];let s;for(const o of n)if(o instanceof mn){let a=o;for(;a.numChildren()===1;){const[u]=a.children;if(u instanceof mn)a=u;else break}r.push(...a.children),s?(t.removeChild(o),o.parent=s.parent,s.parent.removeChild(s),s.parent=a,this.setModified()):s=a}else r.push(o);if(r.length){this.setModified();for(const o of r)o.parent.removeChild(o),o.parent=s}}}class Nu extends Le{constructor(t,n){super(t),this.transform=n}clone(){return new Nu(null,ce(this.transform))}addDimensions(t){this.transform.groupby=dr(this.transform.groupby.concat(t),n=>n)}dependentFields(){const t=new Set;return this.transform.groupby&&this.transform.groupby.forEach(t.add,t),this.transform.joinaggregate.map(n=>n.field).filter(n=>n!==void 0).forEach(t.add,t),t}producedFields(){return new Set(this.transform.joinaggregate.map(this.getDefaultName))}getDefaultName(t){return t.as??q(t)}hash(){return`JoinAggregateTransform ${ye(this.transform)}`}assemble(){const t=[],n=[],i=[];for(const s of this.transform.joinaggregate)n.push(s.op),i.push(this.getDefaultName(s)),t.push(s.field===void 0?null:s.field);const r=this.transform.groupby;return{type:"joinaggregate",as:i,ops:n,fields:t,...r!==void 0?{groupby:r}:{}}}}function Pxe(e){return e.stack.stackBy.reduce((t,n)=>{const i=n.fieldDef,r=q(i);return r&&t.push(r),t},[])}function Ixe(e){return K(e)&&e.every(t=>ue(t))&&e.length>1}class ws extends Le{constructor(t,n){super(t),this._stack=n}clone(){return new ws(null,ce(this._stack))}static makeFromTransform(t,n){const{stack:i,groupby:r,as:s,offset:o="zero"}=n,a=[],u=[];if(n.sort!==void 0)for(const f of n.sort)a.push(f.field),u.push(ut(f.order,"ascending"));const l={field:a,order:u};let c;return Ixe(s)?c=s:ue(s)?c=[s,`${s}_end`]:c=[`${n.stack}_start`,`${n.stack}_end`],new ws(t,{stackField:i,groupby:r,offset:o,sort:l,facetby:[],as:c})}static makeFromEncoding(t,n){const i=n.stack,{encoding:r}=n;if(!i)return null;const{groupbyChannel:s,fieldChannel:o,offset:a,impute:u}=i;let l;if(s){const h=r[s];l=Mr(h)}const c=Pxe(n),f=n.encoding.order;let d;return K(f)||W(f)?d=m7(f):d=c.reduce((h,g)=>(h.field.push(g),h.order.push(o==="y"?"descending":"ascending"),h),{field:[],order:[]}),new ws(t,{dimensionFieldDef:l,stackField:n.vgField(o),facetby:[],stackby:c,sort:d,offset:a,impute:u,as:[n.vgField(o,{suffix:"start",forAs:!0}),n.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 ${ye(this._stack)}`}getGroupbyFields(){const{dimensionFieldDef:t,impute:n,groupby:i}=this._stack;return t?t.bin?n?[q(t,{binSuffix:"mid"})]:[q(t,{}),q(t,{binSuffix:"end"})]:[q(t)]:i??[]}assemble(){const t=[],{facetby:n,dimensionFieldDef:i,stackField:r,stackby:s,sort:o,offset:a,impute:u,as:l}=this._stack;if(u&&i){const{bandPosition:c=.5,bin:f}=i;f&&t.push({type:"formula",expr:`${c}*`+q(i,{expr:"datum"})+`+${1-c}*`+q(i,{expr:"datum",binSuffix:"end"}),as:q(i,{binSuffix:"mid",forAs:!0})}),t.push({type:"impute",field:r,groupby:[...s,...n],key:q(i,{binSuffix:"mid"}),method:"value",value:0})}return t.push({type:"stack",groupby:[...this.getGroupbyFields(),...n],field:r,sort:o,as:l,offset:a}),t}}class Pc extends Le{constructor(t,n){super(t),this.transform=n}clone(){return new Pc(null,ce(this.transform))}addDimensions(t){this.transform.groupby=dr(this.transform.groupby.concat(t),n=>n)}dependentFields(){const t=new Set;return(this.transform.groupby??[]).forEach(t.add,t),(this.transform.sort??[]).forEach(n=>t.add(n.field)),this.transform.window.map(n=>n.field).filter(n=>n!==void 0).forEach(t.add,t),t}producedFields(){return new Set(this.transform.window.map(this.getDefaultName))}getDefaultName(t){return t.as??q(t)}hash(){return`WindowTransform ${ye(this.transform)}`}assemble(){const t=[],n=[],i=[],r=[];for(const f of this.transform.window)n.push(f.op),i.push(this.getDefaultName(f)),r.push(f.param===void 0?null:f.param),t.push(f.field===void 0?null:f.field);const s=this.transform.frame,o=this.transform.groupby;if(s&&s[0]===null&&s[1]===null&&n.every(f=>bC(f)))return{type:"joinaggregate",as:i,ops:n,fields:t,...o!==void 0?{groupby:o}:{}};const a=[],u=[];if(this.transform.sort!==void 0)for(const f of this.transform.sort)a.push(f.field),u.push(f.order??"ascending");const l={field:a,order:u},c=this.transform.ignorePeers;return{type:"window",params:r,as:i,ops:n,fields:t,sort:l,...c!==void 0?{ignorePeers:c}:{},...o!==void 0?{groupby:o}:{},...s!==void 0?{frame:s}:{}}}}function zxe(e){function t(n){if(!(n instanceof Lc)){const i=n.clone();if(i instanceof mn){const r=zv+i.getSource();i.setSource(r),e.model.component.data.outputNodes[r]=i}else(i instanceof ji||i instanceof ws||i instanceof Pc||i instanceof Nu)&&i.addDimensions(e.fields);for(const r of n.children.flatMap(t))r.parent=i;return[i]}return n.children.flatMap(t)}return t}function Iv(e){if(e instanceof Lc)if(e.numChildren()===1&&!(e.children[0]instanceof mn)){const t=e.children[0];(t instanceof ji||t instanceof ws||t instanceof Pc||t instanceof Nu)&&t.addDimensions(e.fields),t.swapWithParent(),Iv(e)}else{const t=e.model.component.data.main;VL(t);const n=zxe(e),i=e.children.map(n).flat();for(const r of i)r.parent=t}else e.children.map(Iv)}function VL(e){if(e instanceof mn&&e.type===je.Main&&e.numChildren()===1){const t=e.children[0];t instanceof Lc||(t.swapWithParent(),VL(e))}}const zv="scale_",q0=5;function jv(e){for(const t of e){for(const n of t.children)if(n.parent!==t)return!1;if(!jv(t.children))return!1}return!0}function Ei(e,t){let n=!1;for(const i of t)n=e.optimize(i)||n;return n}function Kk(e,t,n){let i=e.sources,r=!1;return r=Ei(new kxe,i)||r,r=Ei(new Dxe(t),i)||r,i=i.filter(s=>s.numChildren()>0),r=Ei(new Nxe,i)||r,i=i.filter(s=>s.numChildren()>0),n||(r=Ei(new Mxe,i)||r,r=Ei(new Rxe(t),i)||r,r=Ei(new _xe,i)||r,r=Ei(new Oxe,i)||r,r=Ei(new Bxe,i)||r,r=Ei(new Txe,i)||r,r=Ei(new Sxe,i)||r,r=Ei(new Lxe,i)||r),e.sources=i,r}function jxe(e,t){jv(e.sources);let n=0,i=0;for(let r=0;r<q0&&Kk(e,t,!0);r++)n++;e.sources.map(Iv);for(let r=0;r<q0&&Kk(e,t,!1);r++)i++;jv(e.sources),Math.max(n,i)===q0&&j(`Maximum optimization runs(${q0}) reached.`)}class Rn{constructor(t){Object.defineProperty(this,"signal",{enumerable:!0,get:t})}static fromName(t,n){return new Rn(()=>t(n))}}function YL(e){st(e)?Uxe(e):qxe(e)}function Uxe(e){const t=e.component.scales;for(const n of z(t)){const i=Gxe(e,n);if(t[n].setWithExplicit("domains",i),Vxe(e,n),e.component.data.isFaceted){let s=e;for(;!Ui(s)&&s.parent;)s=s.parent;if(s.component.resolve.scale[n]==="shared")for(const a of i.value)ps(a)&&(a.data=zv+a.data.replace(zv,""))}}}function qxe(e){for(const n of e.children)YL(n);const t=e.component.scales;for(const n of z(t)){let i,r=null;for(const s of e.children){const o=s.component.scales[n];if(o){i===void 0?i=o.getWithExplicit("domains"):i=Mo(i,o.getWithExplicit("domains"),"domains","scale",Uv);const a=o.get("selectionExtent");r&&a&&r.param!==a.param&&j(_ge),r=a}}t[n].setWithExplicit("domains",i),r&&t[n].set("selectionExtent",r,!0)}}function Wxe(e,t,n,i){if(e==="unaggregated"){const{valid:r,reason:s}=Jk(t,n);if(!r){j(s);return}}else if(e===void 0&&i.useUnaggregatedDomain){const{valid:r}=Jk(t,n);if(r)return"unaggregated"}return e}function Gxe(e,t){const n=e.getScaleComponent(t).get("type"),{encoding:i}=e,r=Wxe(e.scaleDomain(t),e.typedFieldDef(t),n,e.config.scale);return r!==e.scaleDomain(t)&&(e.specifiedScales[t]={...e.specifiedScales[t],domain:r}),t==="x"&&gt(i.x2)?gt(i.x)?Mo(Gs(n,r,e,"x"),Gs(n,r,e,"x2"),"domain","scale",Uv):Gs(n,r,e,"x2"):t==="y"&&gt(i.y2)?gt(i.y)?Mo(Gs(n,r,e,"y"),Gs(n,r,e,"y2"),"domain","scale",Uv):Gs(n,r,e,"y2"):Gs(n,r,e,t)}function Hxe(e,t,n){return e.map(i=>({signal:`{data: ${dy(i,{timeUnit:n,type:t})}}`}))}function u2(e,t,n){var r;const i=(r=xn(n))==null?void 0:r.unit;return t==="temporal"||i?Hxe(e,t,i):[e]}function Gs(e,t,n,i){const{encoding:r}=n,s=gt(r[i]),{type:o}=s,a=s.timeUnit;if(nme(t)){const f=Gs(e,void 0,n,i),d=u2(t.unionWith,o,a);return ss([...f.value,...d])}else{if(te(t))return ss([t]);if(t&&t!=="unaggregated"&&!B7(t))return ss(u2(t,o,a))}const u=n.stack;if(u&&i===u.fieldChannel){if(u.offset==="normalize")return Wn([[0,1]]);const f=n.requestDataName(je.Main);return Wn([{data:f,field:n.vgField(i,{suffix:"start"})},{data:f,field:n.vgField(i,{suffix:"end"})}])}const l=Xo(i)&&W(s)?Yxe(n,i,e):void 0;if(Zo(s)){const f=u2([s.datum],o,a);return Wn(f)}const c=s;if(t==="unaggregated"){const f=n.requestDataName(je.Main),{field:d}=s;return Wn([{data:f,field:q({field:d,aggregate:"min"})},{data:f,field:q({field:d,aggregate:"max"})}])}else if(We(c.bin)){if(tn(e))return Wn(e==="bin-ordinal"?[]:[{data:Hd(l)?n.requestDataName(je.Main):n.requestDataName(je.Raw),field:n.vgField(i,Qh(c,i)?{binSuffix:"range"}:{}),sort:l===!0||!ze(l)?{field:n.vgField(i,{}),op:"min"}:l}]);{const{bin:f}=c;if(We(f)){const d=vF(n,c.field,f);return Wn([new Rn(()=>{const h=n.getSignalName(d);return`[${h}.start, ${h}.stop]`})])}else return Wn([{data:n.requestDataName(je.Main),field:n.vgField(i,{})}])}}else if(c.timeUnit&&fe(["time","utc"],e)&&nR(c,st(n)?n.encoding[Is(i)]:void 0,n.markDef,n.config)){const f=n.requestDataName(je.Main);return Wn([{data:f,field:n.vgField(i)},{data:f,field:n.vgField(i,{suffix:"end"})}])}else return Wn(l?[{data:Hd(l)?n.requestDataName(je.Main):n.requestDataName(je.Raw),field:n.vgField(i),sort:l}]:[{data:n.requestDataName(je.Main),field:n.vgField(i)}])}function l2(e,t){const{op:n,field:i,order:r}=e;return{op:n??(t?"sum":oy),...i?{field:mi(i)}:{},...r?{order:r}:{}}}function Vxe(e,t){var a;const n=e.component.scales[t],i=e.specifiedScales[t].domain,r=(a=e.fieldDef(t))==null?void 0:a.bin,s=B7(i)&&i,o=_u(r)&&Z1(r.extent)&&r.extent;(s||o)&&n.set("selectionExtent",s??o,!0)}function Yxe(e,t,n){if(!tn(n))return;const i=e.fieldDef(t),r=i.sort;if(Z7(r))return{op:"min",field:Vl(i,t),order:"ascending"};const{stack:s}=e,o=s?[...s.groupbyField?[s.groupbyField]:[],...s.stackBy.map(a=>a.fieldDef.field)]:void 0;if(vr(r)){const a=s&&!fe(o,r.field);return l2(r,a)}else if(Q7(r)){const{encoding:a,order:u}=r,l=e.fieldDef(a),{aggregate:c,field:f}=l,d=s&&!fe(o,f);if(_s(c)||Ko(c))return l2({field:q(l),order:u},d);if(bC(c)||!c)return l2({op:c,field:f,order:u},d)}else{if(r==="descending")return{op:"min",field:e.vgField(t),order:"descending"};if(fe(["ascending",void 0],r))return!0}}function Jk(e,t){const{aggregate:n,type:i}=e;return n?ue(n)&&!gge[n]?{valid:!1,reason:epe(n)}:i==="quantitative"&&t==="log"?{valid:!1,reason:tpe(e)}:{valid:!0}:{valid:!1,reason:Zge(e)}}function Uv(e,t,n,i){return e.explicit&&t.explicit&&j(ope(n,i,e.value,t.value)),{explicit:e.explicit,value:[...e.value,...t.value]}}function Xxe(e){const t=dr(e.map(o=>{if(ps(o)){const{sort:a,...u}=o;return u}return o}),ye),n=dr(e.map(o=>{if(ps(o)){const a=o.sort;return a!==void 0&&!Hd(a)&&("op"in a&&a.op==="count"&&delete a.field,a.order==="ascending"&&delete a.order),a}}).filter(o=>o!==void 0),ye);if(t.length===0)return;if(t.length===1){const o=e[0];if(ps(o)&&n.length>0){let a=n[0];if(n.length>1)j(rk),a=!0;else if(ze(a)&&"field"in a){const u=a.field;o.field===u&&(a=a.order?{order:a.order}:!0)}return{...o,sort:a}}return o}const i=dr(n.map(o=>Hd(o)||!("op"in o)||ue(o.op)&&o.op in lge?o:(j(upe(o)),!0)),ye);let r;i.length===1?r=i[0]:i.length>1&&(j(rk),r=!0);const s=dr(e.map(o=>ps(o)?o.data:null),o=>o);return s.length===1&&s[0]!==null?{data:s[0],fields:t.map(a=>a.field),...r?{sort:r}:{}}:{fields:t,...r?{sort:r}:{}}}function $F(e){if(ps(e)&&ue(e.field))return e.field;if(pge(e)){let t;for(const n of e.fields)if(ps(n)&&ue(n.field)){if(!t)t=n.field;else if(t!==n.field)return j(lpe),t}return j(cpe),t}else if(mge(e)){j(fpe);const t=e.fields[0];return ue(t)?t:void 0}}function Fy(e,t){const i=e.component.scales[t].get("domains").map(r=>(ps(r)&&(r.data=e.lookupDataSource(r.data)),r));return Xxe(i)}function XL(e){return Ic(e)||CF(e)?e.children.reduce((t,n)=>t.concat(XL(n)),Qk(e)):Qk(e)}function Qk(e){return z(e.component.scales).reduce((t,n)=>{const i=e.component.scales[n];if(i.merged)return t;const r=i.combine(),{name:s,type:o,selectionExtent:a,domains:u,range:l,reverse:c,...f}=r,d=Kxe(r.range,s,n,e),h=Fy(e,n),g=a?Lye(e,a,i,h):null;return t.push({name:s,type:o,...h?{domain:h}:{},...g?{domainRaw:g}:{},range:d,...c!==void 0?{reverse:c}:{},...f}),t},[])}function Kxe(e,t,n,i){if(_r(n)){if(Jo(e))return{step:{signal:`${t}_step`}}}else if(ze(e)&&ps(e))return{...e,data:i.lookupDataSource(e.data)};return e}class KL extends js{constructor(t,n){super({},{name:t}),this.merged=!1,this.setWithExplicit("type",n)}domainDefinitelyIncludesZero(){return this.get("zero")!==!1?!0:Il(this.get("domains"),t=>K(t)&&t.length===2&&t[0]<=0&&t[1]>=0)}}const Jxe=["range","scheme"];function JL(e){return e==="x"?"width":e==="y"?"height":void 0}function Qxe(e){const t=e.component.scales;for(const n of Q1){const i=t[n];if(!i)continue;const r=Zxe(n,e);i.setWithExplicit("range",r)}}function Zk(e,t){const n=e.fieldDef(t);if(n!=null&&n.bin){const{bin:i,field:r}=n,s=JL(t),o=e.getName(s);if(ze(i)&&i.binned&&i.step!==void 0)return new Rn(()=>{const a=e.scaleName(t),u=`(domain("${a}")[1] - domain("${a}")[0]) / ${i.step}`;return`${e.getSignalName(o)} / (${u})`});if(We(i)){const a=vF(e,r,i);return new Rn(()=>{const u=e.getSignalName(a),l=`(${u}.stop - ${u}.start) / ${u}.step`;return`${e.getSignalName(o)} / (${l})`})}}}function Zxe(e,t){const n=t.specifiedScales[e],{size:i}=t,s=t.getScaleComponent(e).get("type");for(const l of Jxe)if(n[l]!==void 0){const c=Ev(s,l),f=R7(e,l);if(!c)j(w7(s,l,e));else if(f)j(f);else switch(l){case"range":{const d=n.range;if(K(d)){if(_r(e))return ss(d.map(h=>{if(h==="width"||h==="height"){const g=t.getName(h),p=t.getSignalName.bind(t);return Rn.fromName(p,g)}return h}))}else if(ze(d))return ss({data:t.requestDataName(je.Main),field:d.field,sort:{op:"min",field:t.vgField(e)}});return ss(d)}case"scheme":return ss(eve(n[l]))}}if(e===Ze||e===mt){const l=e===Ze?"width":"height",c=i[l];if(Or(c)){if(tn(s))return ss({step:c.step});j($7(l))}}const{rangeMin:o,rangeMax:a}=n,u=tve(e,t);return(o!==void 0||a!==void 0)&&Ev(s,"rangeMin")&&K(u)&&u.length===2?ss([o??u[0],a??u[1]]):Wn(u)}function eve(e){return tme(e)?{scheme:e.name,...Qn(e,["name"])}:{scheme:e}}function tve(e,t){const{size:n,config:i,mark:r,encoding:s}=t,o=t.getSignalName.bind(t),{type:a}=gt(s[e]),l=t.getScaleComponent(e).get("type"),{domain:c,domainMid:f}=t.specifiedScales[e];switch(e){case Ze:case mt:{if(fe(["point","band"],l)){if(e===Ze&&!n.width){const g=Jd(i.view,"width");if(Or(g))return g}else if(e===mt&&!n.height){const g=Jd(i.view,"height");if(Or(g))return g}}const d=JL(e),h=t.getName(d);return e===mt&&ii(l)?[Rn.fromName(o,h),0]:[0,Rn.fromName(o,h)]}case Ls:{const d=t.component.scales[e].get("zero"),h=QL(r,d,i),g=rve(r,n,t,i);return Xd(l)?ive(h,g,nve(l,i,c,e)):[h,g]}case Zi:return[0,Math.PI*2];case Su:return[0,360];case qr:return[0,new Rn(()=>{const d=t.getSignalName("width"),h=t.getSignalName("height");return`min(${d},${h})/2`})];case Ho:return[i.scale.minStrokeWidth,i.scale.maxStrokeWidth];case Vo:return[[1,0],[4,2],[2,1],[1,1],[1,2,4,2]];case jn:return"symbol";case zn:case Hr:case Vr:return l==="ordinal"?a==="nominal"?"category":"ordinal":f!==void 0?"diverging":r==="rect"||r==="geoshape"?"heatmap":"ramp";case Ps:case Wo:case Go:return[i.scale.minOpacity,i.scale.maxOpacity]}throw new Error(`Scale range undefined for channel ${e}`)}function nve(e,t,n,i){switch(e){case"quantile":return t.scale.quantileCount;case"quantize":return t.scale.quantizeCount;case"threshold":return n!==void 0&&K(n)?n.length+1:(j(vpe(i)),3)}}function ive(e,t,n){const i=()=>{const r=Es(t),s=Es(e),o=`(${r} - ${s}) / (${n} - 1)`;return`sequence(${s}, ${r} + ${o}, ${o})`};return te(t)?new Rn(i):{signal:i()}}function QL(e,t,n){if(t)return te(t)?{signal:`${t.signal} ? 0 : ${QL(e,!1,n)}`}:0;switch(e){case"bar":case"tick":return n.scale.minBandSize;case"line":case"trail":case"rule":return n.scale.minStrokeWidth;case"text":return n.scale.minFontSize;case"point":case"square":case"circle":return n.scale.minSize}throw new Error(ey("size",e))}const e5=.95;function rve(e,t,n,i){const r={x:Zk(n,"x"),y:Zk(n,"y")};switch(e){case"bar":case"tick":{if(i.scale.maxBandSize!==void 0)return i.scale.maxBandSize;const s=t5(t,r,i.view);return at(s)?s-1:new Rn(()=>`${s.signal} - 1`)}case"line":case"trail":case"rule":return i.scale.maxStrokeWidth;case"text":return i.scale.maxFontSize;case"point":case"square":case"circle":{if(i.scale.maxSize)return i.scale.maxSize;const s=t5(t,r,i.view);return at(s)?Math.pow(e5*s,2):new Rn(()=>`pow(${e5} * ${s.signal}, 2)`)}}throw new Error(ey("size",e))}function t5(e,t,n){const i=Or(e.width)?e.width.step:cm(n,"width"),r=Or(e.height)?e.height.step:cm(n,"height");return t.x||t.y?new Rn(()=>`min(${[t.x?t.x.signal:i,t.y?t.y.signal:r].join(", ")})`):Math.min(i,r)}function ZL(e,t){st(e)?sve(e,t):tP(e,t)}function sve(e,t){const n=e.component.scales,{config:i,encoding:r,markDef:s,specifiedScales:o}=e;for(const a of z(n)){const u=o[a],l=n[a],c=e.getScaleComponent(a),f=gt(r[a]),d=u[t],h=c.get("type"),g=c.get("padding"),p=c.get("paddingInner"),m=Ev(h,t),y=R7(a,t);if(d!==void 0&&(m?y&&j(y):j(w7(h,t,a))),m&&y===void 0)if(d!==void 0){const b=f.timeUnit,x=f.type;switch(t){case"domainMax":case"domainMin":ku(u[t])||x==="temporal"||b?l.set(t,{signal:dy(u[t],{type:x,timeUnit:b})},!0):l.set(t,u[t],!0);break;default:l.copyKeyFromObject(t,u)}}else{const b=t in n5?n5[t]({model:e,channel:a,fieldOrDatumDef:f,scaleType:h,scalePadding:g,scalePaddingInner:p,domain:u.domain,markDef:s,config:i}):i.scale[t];b!==void 0&&l.set(t,b,!1)}}}const n5={bins:({model:e,fieldOrDatumDef:t})=>W(t)?ove(e,t):void 0,interpolate:({channel:e,fieldOrDatumDef:t})=>ave(e,t.type),nice:({scaleType:e,channel:t,domain:n,fieldOrDatumDef:i})=>uve(e,t,n,i),padding:({channel:e,scaleType:t,fieldOrDatumDef:n,markDef:i,config:r})=>lve(e,t,r.scale,n,i,r.bar),paddingInner:({scalePadding:e,channel:t,markDef:n,config:i})=>cve(e,t,n.type,i.scale),paddingOuter:({scalePadding:e,channel:t,scaleType:n,markDef:i,scalePaddingInner:r,config:s})=>fve(e,t,n,i.type,r,s.scale),reverse:({fieldOrDatumDef:e,scaleType:t,channel:n,config:i})=>{const r=W(e)?e.sort:void 0;return dve(t,r,n,i.scale)},zero:({channel:e,fieldOrDatumDef:t,domain:n,markDef:i,scaleType:r})=>hve(e,t,n,i,r)};function eP(e){st(e)?Qxe(e):tP(e,"range")}function tP(e,t){const n=e.component.scales;for(const i of e.children)t==="range"?eP(i):ZL(i,t);for(const i of z(n)){let r;for(const s of e.children){const o=s.component.scales[i];if(o){const a=o.getWithExplicit(t);r=Mo(r,a,t,"scale",UR((u,l)=>{switch(t){case"range":return u.step&&l.step?u.step-l.step:0}return 0}))}}n[i].setWithExplicit(t,r)}}function ove(e,t){const n=t.bin;if(We(n)){const i=vF(e,t.field,n);return new Rn(()=>e.getSignalName(i))}else if(fn(n)&&_u(n)&&n.step!==void 0)return{step:n.step}}function ave(e,t){if(fe([zn,Hr,Vr],e)&&t!=="nominal")return"hcl"}function uve(e,t,n,i){var r;if(!((r=Mr(i))!=null&&r.bin||K(n)||fe([ft.TIME,ft.UTC],e)))return t in Yo?!0:void 0}function lve(e,t,n,i,r,s){if(e in Yo){if(Li(t)){if(n.continuousPadding!==void 0)return n.continuousPadding;const{type:o,orient:a}=r;if(o==="bar"&&!(W(i)&&(i.bin||i.timeUnit))&&(a==="vertical"&&e==="x"||a==="horizontal"&&e==="y"))return s.continuousBandSize}if(t===ft.POINT)return n.pointPadding}}function cve(e,t,n,i){if(e===void 0&&t in Yo){const{bandPaddingInner:r,barBandPaddingInner:s,rectBandPaddingInner:o}=i;return ut(r,n==="bar"?s:o)}}function fve(e,t,n,i,r,s){if(e===void 0&&t in Yo&&n===ft.BAND){const{bandPaddingOuter:o}=s;return ut(o,te(r)?{signal:`${r.signal}/2`}:r/2)}}function dve(e,t,n,i){if(n==="x"&&i.xReverse!==void 0)return ii(e)&&t==="descending"?te(i.xReverse)?{signal:`!${i.xReverse.signal}`}:!i.xReverse:i.xReverse;if(ii(e)&&t==="descending")return!0}function hve(e,t,n,i,r){if(!!n&&n!=="unaggregated"&&ii(r)){if(K(n)){const o=n[0],a=n[n.length-1];if(o<=0&&a>=0)return!0}return!1}if(e==="size"&&t.type==="quantitative"&&!Xd(r))return!0;if(!(W(t)&&t.bin)&&fe([...Yr,...tge],e)){const{orient:o,type:a}=i;return!(fe(["bar","area","line","trail"],a)&&(o==="horizontal"&&e==="y"||o==="vertical"&&e==="x"))}return!1}function gve(e,t,n,i){const r=pve(t,n,i),{type:s}=e;return Xo(t)?s!==void 0?ame(t,s)?W(n)&&!ome(s,n.type)?(j(rpe(s,r)),r):s:(j(ipe(t,s,r)),r):r:null}function pve(e,t,n){var i;switch(t.type){case"nominal":case"ordinal":{if(cl(e)||Qb(e)==="discrete")return e==="shape"&&t.type==="ordinal"&&j(Zb(e,"ordinal")),"ordinal";if(e in Yo){if(fe(["rect","bar","image","rule"],n.type))return"band"}else if(n.type==="arc"&&e in yC)return"band";const r=n[bi(e)];return Oc(r)||WC(t)&&((i=t.axis)!=null&&i.tickBand)?"band":"point"}case"temporal":return cl(e)?"time":Qb(e)==="discrete"?(j(Zb(e,"temporal")),"ordinal"):W(t)&&t.timeUnit&&xn(t.timeUnit).utc?"utc":"time";case"quantitative":return cl(e)?W(t)&&We(t.bin)?"bin-ordinal":"linear":Qb(e)==="discrete"?(j(Zb(e,"quantitative")),"ordinal"):"linear";case"geojson":return}throw new Error(A7(t.type))}function mve(e,{ignoreRange:t}={}){nP(e),YL(e);for(const n of sme)ZL(e,n);t||eP(e)}function nP(e){st(e)?e.component.scales=yve(e):e.component.scales=xve(e)}function yve(e){const{encoding:t,mark:n,markDef:i}=e;return Q1.reduce((r,s)=>{const o=gt(t[s]);if(o&&n===I7&&s===jn&&o.type===Mc)return r;let a=o&&o.scale;if(o&&a!==null&&a!==!1){a??(a={});const u=gve(a,s,o,i);r[s]=new KL(e.scaleName(`${s}`,!0),{value:u,explicit:a.type===u})}return r},{})}const bve=UR((e,t)=>ok(e)-ok(t));function xve(e){var t;const n=e.component.scales={},i={},r=e.component.resolve;for(const s of e.children){nP(s);for(const o of z(s.component.scales))if((t=r.scale)[o]??(t[o]=BL(o,e)),r.scale[o]==="shared"){const a=i[o],u=s.component.scales[o].getWithExplicit("type");a?Upe(a.value,u.value)?i[o]=Mo(a,u,"type","scale",bve):(r.scale[o]="independent",delete i[o]):i[o]=u}}for(const s of z(i)){const o=e.scaleName(s,!0),a=i[s];n[s]=new KL(o,a);for(const u of e.children){const l=u.component.scales[s];l&&(u.renameScale(l.get("name"),o),l.merged=!0)}}return n}class c2{constructor(){this.nameMap={}}rename(t,n){this.nameMap[t]=n}has(t){return this.nameMap[t]!==void 0}get(t){for(;this.nameMap[t]&&t!==this.nameMap[t];)t=this.nameMap[t];return t}}function st(e){return(e==null?void 0:e.type)==="unit"}function Ui(e){return(e==null?void 0:e.type)==="facet"}function CF(e){return(e==null?void 0:e.type)==="concat"}function Ic(e){return(e==null?void 0:e.type)==="layer"}class FF{constructor(t,n,i,r,s,o,a){this.type=n,this.parent=i,this.config=s,this.correctDataNames=u=>(u.from&&u.from.data&&(u.from.data=this.lookupDataSource(u.from.data)),u.from&&u.from.facet&&u.from.facet.data&&(u.from.facet.data=this.lookupDataSource(u.from.facet.data)),u),this.parent=i,this.config=s,this.view=Sn(a),this.name=t.name??r,this.title=Xs(t.title)?{text:t.title}:t.title?Sn(t.title):void 0,this.scaleNameMap=i?i.scaleNameMap:new c2,this.projectionNameMap=i?i.projectionNameMap:new c2,this.signalNameMap=i?i.signalNameMap:new c2,this.data=t.data,this.description=t.description,this.transforms=fye(t.transform??[]),this.layout=n==="layer"||n==="unit"?{}:v1e(t,n,s),this.component={data:{sources:i?i.component.data.sources:[],outputNodes:i?i.component.data.outputNodes:{},outputNodeRefCounts:i?i.component.data.outputNodeRefCounts:{},isFaceted:ay(t)||i&&i.component.data.isFaceted&&t.data===void 0},layoutSize:new js,layoutHeaders:{row:{},column:{},facet:{}},mark:null,resolve:{scale:{},axis:{},legend:{},...o?ce(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(){mve(this)}parseProjection(){GL(this)}renameTopLevelLayoutSizeSignal(){this.getName("width")!=="width"&&this.renameSignal(this.getName("width"),"width"),this.getName("height")!=="height"&&this.renameSignal(this.getName("height"),"height")}parseLegends(){zL(this)}assembleGroupStyle(){var t;if(this.type==="unit"||this.type==="layer")return((t=this.view)==null?void 0:t.style)??"cell"}assembleEncodeFromView(t){const{style:n,...i}=t,r={};for(const s of z(i)){const o=i[s];o!==void 0&&(r[s]=Xe(o))}return r}assembleGroupEncodeEntry(t){let n={};return this.view&&(n=this.assembleEncodeFromView(this.view)),!t&&(this.description&&(n.description=Xe(this.description)),this.type==="unit"||this.type==="layer")?{width:this.getSizeSignalRef("width"),height:this.getSizeSignalRef("height"),...n??{}}:Be(n)?void 0:n}assembleLayout(){if(!this.layout)return;const{spacing:t,...n}=this.layout,{component:i,config:r}=this,s=j2e(i.layoutHeaders,r);return{padding:t,...this.assembleDefaultLayout(),...n,...s?{titleBand:s}:{}}}assembleDefaultLayout(){return{}}assembleHeaderMarks(){const{layoutHeaders:t}=this.component;let n=[];for(const i of ci)t[i].title&&n.push(B2e(this,i));for(const i of mF)n=n.concat(R2e(this,i));return n}assembleAxes(){return w2e(this.component.axes,this.config)}assembleLegends(){return UL(this)}assembleProjections(){return cxe(this)}assembleTitle(){const{encoding:t,...n}=this.title??{},i={...d7(this.config.title).nonMark,...n,...t?{encode:{update:t}}:{}};if(i.text)return fe(["unit","layer"],this.type)?fe(["middle",void 0],i.anchor)&&(i.frame??(i.frame="group")):i.anchor??(i.anchor="start"),Be(i)?void 0:i}assembleGroup(t=[]){const n={};t=t.concat(this.assembleSignals()),t.length>0&&(n.signals=t);const i=this.assembleLayout();i&&(n.layout=i),n.marks=[].concat(this.assembleHeaderMarks(),this.assembleMarks());const r=!this.parent||Ui(this.parent)?XL(this):[];r.length>0&&(n.scales=r);const s=this.assembleAxes();s.length>0&&(n.axes=s);const o=this.assembleLegends();return o.length>0&&(n.legends=o),n}getName(t){return Ke((this.name?`${this.name}_`:"")+t)}getDataName(t){return this.getName(je[t].toLowerCase())}requestDataName(t){const n=this.getDataName(t),i=this.component.data.outputNodeRefCounts;return i[n]=(i[n]||0)+1,n}getSizeSignalRef(t){if(Ui(this.parent)){const n=NL(t),i=J1(n),r=this.component.scales[i];if(r&&!r.merged){const s=r.get("type"),o=r.get("range");if(tn(s)&&Jo(o)){const a=r.get("name"),u=Fy(this,i),l=$F(u);if(l){const c=q({aggregate:"distinct",field:l},{expr:"datum"});return{signal:OL(a,r,c)}}else return j(vC(i)),null}}}return{signal:this.signalNameMap.get(this.getName(t))}}lookupDataSource(t){const n=this.component.data.outputNodes[t];return n?n.getSource():t}getSignalName(t){return this.signalNameMap.get(t)}renameSignal(t,n){this.signalNameMap.rename(t,n)}renameScale(t,n){this.scaleNameMap.rename(t,n)}renameProjection(t,n){this.projectionNameMap.rename(t,n)}scaleName(t,n){if(n)return this.getName(t);if(s7(t)&&Xo(t)&&this.component.scales[t]||this.scaleNameMap.has(this.getName(t)))return this.scaleNameMap.get(this.getName(t))}projectionName(t){if(t)return this.getName("projection");if(this.component.projection&&!this.component.projection.merged||this.projectionNameMap.has(this.getName("projection")))return this.projectionNameMap.get(this.getName("projection"))}getScaleComponent(t){if(!this.component.scales)throw new Error("getScaleComponent cannot be called before parseScale(). Make sure you have called parseScale or use parseUnitModelWithScale().");const n=this.component.scales[t];return n&&!n.merged?n:this.parent?this.parent.getScaleComponent(t):void 0}getSelectionComponent(t,n){let i=this.component.selection[t];if(!i&&this.parent&&(i=this.parent.getSelectionComponent(t,n)),!i)throw new Error($ge(n));return i}hasAxisOrientSignalRef(){var t,n;return((t=this.component.axes.x)==null?void 0:t.some(i=>i.hasOrientSignalRef()))||((n=this.component.axes.y)==null?void 0:n.some(i=>i.hasOrientSignalRef()))}}class iP extends FF{vgField(t,n={}){const i=this.fieldDef(t);if(i)return q(i,n)}reduceFieldDef(t,n){return Xme(this.getMapping(),(i,r,s)=>{const o=Mr(r);return o?t(i,o,s):i},n)}forEachFieldDef(t,n){XC(this.getMapping(),(i,r)=>{const s=Mr(i);s&&t(s,r)},n)}}class Sy extends Le{constructor(t,n){super(t),this.transform=n,this.transform=ce(n);const i=this.transform.as??[void 0,void 0];this.transform.as=[i[0]??"value",i[1]??"density"]}clone(){return new Sy(null,ce(this.transform))}dependentFields(){return new Set([this.transform.density,...this.transform.groupby??[]])}producedFields(){return new Set(this.transform.as)}hash(){return`DensityTransform ${ye(this.transform)}`}assemble(){const{density:t,...n}=this.transform;return{type:"kde",field:t,...n}}}class nh extends Le{constructor(t,n){super(t),this.filter=n}clone(){return new nh(null,{...this.filter})}static make(t,n){const{config:i,mark:r,markDef:s}=n;if(ke("invalid",s,i)!=="filter")return null;const a=n.reduceFieldDef((u,l,c)=>{const f=Xo(c)&&n.getScaleComponent(c);if(f){const d=f.get("type");ii(d)&&l.aggregate!=="count"&&!Qo(r)&&(u[l.field]=l)}return u},{});return z(a).length?new nh(t,a):null}dependentFields(){return new Set(z(this.filter))}producedFields(){return new Set}hash(){return`FilterInvalid ${ye(this.filter)}`}assemble(){const t=z(this.filter).reduce((n,i)=>{const r=this.filter[i],s=q(r,{expr:"datum"});return r!==null&&(r.type==="temporal"?n.push(`(isDate(${s}) || (isValid(${s}) && isFinite(+${s})))`):r.type==="quantitative"&&(n.push(`isValid(${s})`),n.push(`isFinite(+${s})`))),n},[]);return t.length>0?{type:"filter",expr:t.join(" && ")}:null}}class Dy extends Le{constructor(t,n){super(t),this.transform=n,this.transform=ce(n);const{flatten:i,as:r=[]}=this.transform;this.transform.as=i.map((s,o)=>r[o]??s)}clone(){return new Dy(this.parent,ce(this.transform))}dependentFields(){return new Set(this.transform.flatten)}producedFields(){return new Set(this.transform.as)}hash(){return`FlattenTransform ${ye(this.transform)}`}assemble(){const{flatten:t,as:n}=this.transform;return{type:"flatten",fields:t,as:n}}}class _y extends Le{constructor(t,n){super(t),this.transform=n,this.transform=ce(n);const i=this.transform.as??[void 0,void 0];this.transform.as=[i[0]??"key",i[1]??"value"]}clone(){return new _y(null,ce(this.transform))}dependentFields(){return new Set(this.transform.fold)}producedFields(){return new Set(this.transform.as)}hash(){return`FoldTransform ${ye(this.transform)}`}assemble(){const{fold:t,as:n}=this.transform;return{type:"fold",fields:t,as:n}}}class dl extends Le{constructor(t,n,i,r){super(t),this.fields=n,this.geojson=i,this.signal=r}clone(){return new dl(null,ce(this.fields),this.geojson,this.signal)}static parseAll(t,n){if(n.component.projection&&!n.component.projection.isFit)return t;let i=0;for(const r of[[Gr,Wr],[yi,er]]){const s=r.map(o=>{const a=gt(n.encoding[o]);return W(a)?a.field:Zo(a)?{expr:`${a.datum}`}:Hi(a)?{expr:`${a.value}`}:void 0});(s[0]||s[1])&&(t=new dl(t,s,null,n.getName(`geojson_${i++}`)))}if(n.channelHasField(jn)){const r=n.typedFieldDef(jn);r.type===Mc&&(t=new dl(t,null,r.field,n.getName(`geojson_${i++}`)))}return t}dependentFields(){const t=(this.fields??[]).filter(ue);return new Set([...this.geojson?[this.geojson]:[],...t])}producedFields(){return new Set}hash(){return`GeoJSON ${this.geojson} ${this.signal} ${ye(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 ih extends Le{constructor(t,n,i,r){super(t),this.projection=n,this.fields=i,this.as=r}clone(){return new ih(null,this.projection,ce(this.fields),ce(this.as))}static parseAll(t,n){if(!n.projectionName())return t;for(const i of[[Gr,Wr],[yi,er]]){const r=i.map(o=>{const a=gt(n.encoding[o]);return W(a)?a.field:Zo(a)?{expr:`${a.datum}`}:Hi(a)?{expr:`${a.value}`}:void 0}),s=i[0]===yi?"2":"";(r[0]||r[1])&&(t=new ih(t,n.projectionName(),r,[n.getName(`x${s}`),n.getName(`y${s}`)]))}return t}dependentFields(){return new Set(this.fields.filter(ue))}producedFields(){return new Set(this.as)}hash(){return`Geopoint ${this.projection} ${ye(this.fields)} ${ye(this.as)}`}assemble(){return{type:"geopoint",projection:this.projection,fields:this.fields,as:this.as}}}class Ga extends Le{constructor(t,n){super(t),this.transform=n}clone(){return new Ga(null,ce(this.transform))}dependentFields(){return new Set([this.transform.impute,this.transform.key,...this.transform.groupby??[]])}producedFields(){return new Set([this.transform.impute])}processSequence(t){const{start:n=0,stop:i,step:r}=t;return{signal:`sequence(${[n,i,...r?[r]:[]].join(",")})`}}static makeFromTransform(t,n){return new Ga(t,n)}static makeFromEncoding(t,n){const i=n.encoding,r=i.x,s=i.y;if(W(r)&&W(s)){const o=r.impute?r:s.impute?s:void 0;if(o===void 0)return;const a=r.impute?s:s.impute?r:void 0,{method:u,value:l,frame:c,keyvals:f}=o.impute,d=gR(n.mark,i);return new Ga(t,{impute:o.field,key:a.field,...u?{method:u}:{},...l!==void 0?{value:l}:{},...c?{frame:c}:{},...f!==void 0?{keyvals:f}:{},...d.length?{groupby:d}:{}})}return null}hash(){return`Impute ${ye(this.transform)}`}assemble(){const{impute:t,key:n,keyvals:i,method:r,groupby:s,value:o,frame:a=[null,null]}=this.transform,u={type:"impute",field:t,key:n,...i?{keyvals:V1e(i)?this.processSequence(i):i}:{},method:"value",...s?{groupby:s}:{},value:!r||r==="value"?o:null};if(r&&r!=="value"){const l={type:"window",as:[`imputed_${t}_value`],ops:[r],fields:[t],frame:a,ignorePeers:!1,...s?{groupby:s}:{}},c={type:"formula",expr:`datum.${t} === null ? datum.imputed_${t}_value : datum.${t}`,as:t};return[u,l,c]}else return[u]}}class ky extends Le{constructor(t,n){super(t),this.transform=n,this.transform=ce(n);const i=this.transform.as??[void 0,void 0];this.transform.as=[i[0]??n.on,i[1]??n.loess]}clone(){return new ky(null,ce(this.transform))}dependentFields(){return new Set([this.transform.loess,this.transform.on,...this.transform.groupby??[]])}producedFields(){return new Set(this.transform.as)}hash(){return`LoessTransform ${ye(this.transform)}`}assemble(){const{loess:t,on:n,...i}=this.transform;return{type:"loess",x:n,y:t,...i}}}class rh extends Le{constructor(t,n,i){super(t),this.transform=n,this.secondary=i}clone(){return new rh(null,ce(this.transform),this.secondary)}static make(t,n,i,r){const s=n.component.data.sources,{from:o}=i;let a=null;if(Y1e(o)){let u=oP(o.data,s);u||(u=new du(o.data),s.push(u));const l=n.getName(`lookup_${r}`);a=new mn(u,l,je.Lookup,n.component.data.outputNodeRefCounts),n.component.data.outputNodes[l]=a}else if(X1e(o)){const u=o.param;i={as:u,...i};let l;try{l=n.getSelectionComponent(Ke(u),u)}catch{throw new Error(Sge(u))}if(a=l.materialized,!a)throw new Error(Dge(u))}return new rh(t,i,a.getSource())}dependentFields(){return new Set([this.transform.lookup])}producedFields(){return new Set(this.transform.as?Qe(this.transform.as):this.transform.from.fields)}hash(){return`Lookup ${ye({transform:this.transform,secondary:this.secondary})}`}assemble(){let t;if(this.transform.from.fields)t={values:this.transform.from.fields,...this.transform.as?{as:Qe(this.transform.as)}:{}};else{let n=this.transform.as;ue(n)||(j(Rge),n="_lookup"),t={as:[n]}}return{type:"lookup",from:this.secondary,key:this.transform.from.key,fields:[this.transform.lookup],...t,...this.transform.default?{default:this.transform.default}:{}}}}class My extends Le{constructor(t,n){super(t),this.transform=n,this.transform=ce(n);const i=this.transform.as??[void 0,void 0];this.transform.as=[i[0]??"prob",i[1]??"value"]}clone(){return new My(null,ce(this.transform))}dependentFields(){return new Set([this.transform.quantile,...this.transform.groupby??[]])}producedFields(){return new Set(this.transform.as)}hash(){return`QuantileTransform ${ye(this.transform)}`}assemble(){const{quantile:t,...n}=this.transform;return{type:"quantile",field:t,...n}}}class Oy extends Le{constructor(t,n){super(t),this.transform=n,this.transform=ce(n);const i=this.transform.as??[void 0,void 0];this.transform.as=[i[0]??n.on,i[1]??n.regression]}clone(){return new Oy(null,ce(this.transform))}dependentFields(){return new Set([this.transform.regression,this.transform.on,...this.transform.groupby??[]])}producedFields(){return new Set(this.transform.as)}hash(){return`RegressionTransform ${ye(this.transform)}`}assemble(){const{regression:t,on:n,...i}=this.transform;return{type:"regression",x:n,y:t,...i}}}class Ny extends Le{constructor(t,n){super(t),this.transform=n}clone(){return new Ny(null,ce(this.transform))}addDimensions(t){this.transform.groupby=dr((this.transform.groupby??[]).concat(t),n=>n)}producedFields(){}dependentFields(){return new Set([this.transform.pivot,this.transform.value,...this.transform.groupby??[]])}hash(){return`PivotTransform ${ye(this.transform)}`}assemble(){const{pivot:t,value:n,groupby:i,limit:r,op:s}=this.transform;return{type:"pivot",field:t,value:n,...r!==void 0?{limit:r}:{},...s!==void 0?{op:s}:{},...i!==void 0?{groupby:i}:{}}}}class Ty extends Le{constructor(t,n){super(t),this.transform=n}clone(){return new Ty(null,ce(this.transform))}dependentFields(){return new Set}producedFields(){return new Set}hash(){return`SampleTransform ${ye(this.transform)}`}assemble(){return{type:"sample",size:this.transform.sample}}}function rP(e){let t=0;function n(i,r){if(i instanceof du&&!i.isGenerator&&!Qd(i.data)&&(e.push(r),r={name:null,source:r.name,transform:[]}),i instanceof Vt&&(i.parent instanceof du&&!r.source?(r.format={...r.format??{},parse:i.assembleFormatParse()},r.transform.push(...i.assembleTransforms(!0))):r.transform.push(...i.assembleTransforms())),i instanceof Lc){r.name||(r.name=`data_${t++}`),!r.source||r.transform.length>0?(e.push(r),i.data=r.name):i.data=r.source,e.push(...i.assemble());return}switch((i instanceof r0||i instanceof s0||i instanceof nh||i instanceof Rc||i instanceof Hl||i instanceof ih||i instanceof ji||i instanceof rh||i instanceof Pc||i instanceof Nu||i instanceof _y||i instanceof Dy||i instanceof Sy||i instanceof ky||i instanceof My||i instanceof Oy||i instanceof Bo||i instanceof Ty||i instanceof Ny)&&r.transform.push(i.assemble()),(i instanceof Er||i instanceof Ar||i instanceof Ga||i instanceof ws||i instanceof dl)&&r.transform.push(...i.assemble()),i instanceof mn&&(r.source&&r.transform.length===0?i.setSource(r.source):i.parent instanceof mn?i.setSource(r.name):(r.name||(r.name=`data_${t++}`),i.setSource(r.name),i.numChildren()===1&&(e.push(r),r={name:null,source:r.name,transform:[]}))),i.numChildren()){case 0:i instanceof mn&&(!r.source||r.transform.length>0)&&e.push(r);break;case 1:n(i.children[0],r);break;default:{r.name||(r.name=`data_${t++}`);let s=r.name;!r.source||r.transform.length>0?e.push(r):s=r.source;for(const o of i.children)n(o,{name:null,source:s,transform:[]});break}}}return n}function vve(e){const t=[],n=rP(t);for(const i of e.children)n(i,{source:e.name,name:null,transform:[]});return t}function Ave(e,t){const n=[],i=rP(n);let r=0;for(const o of e.sources){o.hasName()||(o.dataName=`source_${r++}`);const a=o.assemble();i(o,a)}for(const o of n)o.transform.length===0&&delete o.transform;let s=0;for(const[o,a]of n.entries())(a.transform??[]).length===0&&!a.source&&n.splice(s++,0,n.splice(o,1)[0]);for(const o of n)for(const a of o.transform??[])a.type==="lookup"&&(a.from=e.outputNodes[a.from].getSource());for(const o of n)o.name in t&&(o.values=t[o.name]);return n}function Eve(e){return e==="top"||e==="left"||te(e)?"header":"footer"}function wve(e){for(const t of ci)$ve(e,t);i5(e,"x"),i5(e,"y")}function $ve(e,t){var o;const{facet:n,config:i,child:r,component:s}=e;if(e.channelHasField(t)){const a=n[t],u=Yl("title",null,i,t);let l=fl(a,i,{allowDisabling:!0,includeDefault:u===void 0||!!u});r.component.layoutHeaders[t].title&&(l=K(l)?l.join(", "):l,l+=` / ${r.component.layoutHeaders[t].title}`,r.component.layoutHeaders[t].title=null);const c=Yl("labelOrient",a.header,i,t),f=a.header!==null?ut((o=a.header)==null?void 0:o.labels,i.header.labels,!0):!1,d=fe(["bottom","right"],c)?"footer":"header";s.layoutHeaders[t]={title:a.header!==null?l:null,facetFieldDef:a,[d]:t==="facet"?[]:[sP(e,t,f)]}}}function sP(e,t,n){const i=t==="row"?"height":"width";return{labels:n,sizeSignal:e.child.component.layoutSize.get(i)?e.child.getSizeSignalRef(i):void 0,axes:[]}}function i5(e,t){const{child:n}=e;if(n.component.axes[t]){const{layoutHeaders:i,resolve:r}=e.component;if(r.axis[t]=xF(r,t),r.axis[t]==="shared"){const s=t==="x"?"column":"row",o=i[s];for(const a of n.component.axes[t]){const u=Eve(a.get("orient"));o[u]??(o[u]=[sP(e,s,!1)]);const l=Pf(a,"main",e.config,{header:!0});l&&o[u][0].axes.push(l),a.mainExtracted=!0}}}}function Cve(e){SF(e),bm(e,"width"),bm(e,"height")}function Fve(e){SF(e);const t=e.layout.columns===1?"width":"childWidth",n=e.layout.columns===void 0?"height":"childHeight";bm(e,t),bm(e,n)}function SF(e){for(const t of e.children)t.parseLayoutSize()}function bm(e,t){const n=NL(t),i=J1(n),r=e.component.resolve,s=e.component.layoutSize;let o;for(const a of e.children){const u=a.component.layoutSize.getWithExplicit(n),l=r.scale[i]??BL(i,e);if(l==="independent"&&u.value==="step"){o=void 0;break}if(o){if(l==="independent"&&o.value!==u.value){o=void 0;break}o=Mo(o,u,n,"")}else o=u}if(o){for(const a of e.children)e.renameSignal(a.getName(n),e.getName(t)),a.component.layoutSize.set(n,"merged",!1);s.setWithExplicit(t,o)}else s.setWithExplicit(t,{explicit:!1,value:void 0})}function Sve(e){const{size:t,component:n}=e;for(const i of Yr){const r=bi(i);if(t[r]){const s=t[r];n.layoutSize.set(r,Or(s)?"step":s,!0)}else{const s=Dve(e,r);n.layoutSize.set(r,s,!1)}}}function Dve(e,t){const n=t==="width"?"x":"y",i=e.config,r=e.getScaleComponent(n);if(r){const s=r.get("type"),o=r.get("range");if(tn(s)){const a=Jd(i.view,t);return Jo(o)||Or(a)?"step":a}else return Cv(i.view,t)}else{if(e.hasProjection||e.mark==="arc")return Cv(i.view,t);{const s=Jd(i.view,t);return Or(s)?s.step:s}}}function qv(e,t,n){return q(t,{suffix:`by_${q(e)}`,...n??{}})}class cd extends iP{constructor(t,n,i,r){super(t,"facet",n,i,r,t.resolve),this.child=OF(t.spec,this,this.getName("child"),void 0,r),this.children=[this.child],this.facet=this.initFacet(t.facet)}initFacet(t){if(!Jh(t))return{facet:this.initFacetFieldDef(t,"facet")};const n=z(t),i={};for(const r of n){if(![vs,As].includes(r)){j(ey(r,"facet"));break}const s=t[r];if(s.field===void 0){j(vv(s,r));break}i[r]=this.initFacetFieldDef(s,r)}return i}initFacetFieldDef(t,n){const i=VC(t,n);return i.header?i.header=Sn(i.header):i.header===null&&(i.header=null),i}channelHasField(t){return!!this.facet[t]}fieldDef(t){return this.facet[t]}parseData(){this.component.data=By(this),this.child.parseData()}parseLayoutSize(){SF(this)}parseSelections(){this.child.parseSelections(),this.component.selection=this.child.component.selection}parseMarkGroup(){this.child.parseMarkGroup()}parseAxesAndHeaders(){this.child.parseAxesAndHeaders(),wve(this)}assembleSelectionTopLevelSignals(t){return this.child.assembleSelectionTopLevelSignals(t)}assembleSignals(){return this.child.assembleSignals(),[]}assembleSelectionData(t){return this.child.assembleSelectionData(t)}getHeaderLayoutMixins(){const t={};for(const n of ci)for(const i of yF){const r=this.component.layoutHeaders[n],s=r[i],{facetFieldDef:o}=r;if(o){const a=Yl("titleOrient",o.header,this.config,n);if(["right","bottom"].includes(a)){const u=$y(n,a);t.titleAnchor??(t.titleAnchor={}),t.titleAnchor[u]="end"}}if(s!=null&&s[0]){const a=n==="row"?"height":"width",u=i==="header"?"headerBand":"footerBand";n!=="facet"&&!this.child.component.layoutSize.get(a)&&(t[u]??(t[u]={}),t[u][n]=.5),r.title&&(t.offset??(t.offset={}),t.offset[n==="row"?"rowTitle":"columnTitle"]=10)}}return t}assembleDefaultLayout(){const{column:t,row:n}=this.facet,i=t?this.columnDistinctSignal():n?1:void 0;let r="all";return(!n&&this.component.resolve.scale.x==="independent"||!t&&this.component.resolve.scale.y==="independent")&&(r="none"),{...this.getHeaderLayoutMixins(),...i?{columns:i}:{},bounds:"full",align:r}}assembleLayoutSignals(){return this.child.assembleLayoutSignals()}columnDistinctSignal(){if(!(this.parent&&this.parent instanceof cd))return{signal:`length(data('${this.getName("column_domain")}'))`}}assembleGroup(t){return this.parent&&this.parent instanceof cd?{...this.channelHasField("column")?{encode:{update:{columns:{field:q(this.facet.column,{prefix:"distinct"})}}}}:{},...super.assembleGroup(t)}:super.assembleGroup(t)}getCardinalityAggregateForChild(){const t=[],n=[],i=[];if(this.child instanceof cd){if(this.child.channelHasField("column")){const r=q(this.child.facet.column);t.push(r),n.push("distinct"),i.push(`distinct_${r}`)}}else for(const r of Yr){const s=this.child.component.scales[r];if(s&&!s.merged){const o=s.get("type"),a=s.get("range");if(tn(o)&&Jo(a)){const u=Fy(this.child,r),l=$F(u);l?(t.push(l),n.push("distinct"),i.push(`distinct_${l}`)):j(vC(r))}}}return{fields:t,ops:n,as:i}}assembleFacet(){const{name:t,data:n}=this.component.data.facetRoot,{row:i,column:r}=this.facet,{fields:s,ops:o,as:a}=this.getCardinalityAggregateForChild(),u=[];for(const c of ci){const f=this.facet[c];if(f){u.push(q(f));const{bin:d,sort:h}=f;if(We(d)&&u.push(q(f,{binSuffix:"end"})),vr(h)){const{field:g,op:p=oy}=h,m=qv(f,h);i&&r?(s.push(m),o.push("max"),a.push(m)):(s.push(g),o.push(p),a.push(m))}else if(K(h)){const g=Vl(f,c);s.push(g),o.push("max"),a.push(g)}}}const l=!!i&&!!r;return{name:t,data:n,groupby:u,...l||s.length>0?{aggregate:{...l?{cross:l}:{},...s.length?{fields:s,ops:o,as:a}:{}}}:{}}}facetSortFields(t){const{facet:n}=this,i=n[t];return i?vr(i.sort)?[qv(i,i.sort,{expr:"datum"})]:K(i.sort)?[Vl(i,t,{expr:"datum"})]:[q(i,{expr:"datum"})]:[]}facetSortOrder(t){const{facet:n}=this,i=n[t];if(i){const{sort:r}=i;return[(vr(r)?r.order:!K(r)&&r)||"ascending"]}return[]}assembleLabelTitle(){var r;const{facet:t,config:n}=this;if(t.facet)return Lv(t.facet,"facet",n);const i={row:["top","bottom"],column:["left","right"]};for(const s of mF)if(t[s]){const o=Yl("labelOrient",(r=t[s])==null?void 0:r.header,n,s);if(i[s].includes(o))return Lv(t[s],s,n)}}assembleMarks(){const{child:t}=this,n=this.component.data.facetRoot,i=vve(n),r=t.assembleGroupEncodeEntry(!1),s=this.assembleLabelTitle()||t.assembleTitle(),o=t.assembleGroupStyle();return[{name:this.getName("cell"),type:"group",...s?{title:s}:{},...o?{style:o}:{},from:{facet:this.assembleFacet()},sort:{field:ci.map(u=>this.facetSortFields(u)).flat(),order:ci.map(u=>this.facetSortOrder(u)).flat()},...i.length>0?{data:i}:{},...r?{encode:{update:r}}:{},...t.assembleGroup(Nye(this,[]))}]}getMapping(){return this.facet}}function _ve(e,t){const{row:n,column:i}=t;if(n&&i){let r=null;for(const s of[n,i])if(vr(s.sort)){const{field:o,op:a=oy}=s.sort;e=r=new Nu(e,{joinaggregate:[{op:a,field:o,as:qv(s,s.sort,{forAs:!0})}],groupby:[q(s)]})}return r}return null}function oP(e,t){var n,i,r,s;for(const o of t){const a=o.data;if(e.name&&o.hasName()&&e.name!==o.dataName)continue;const u=(n=e.format)==null?void 0:n.mesh,l=(i=a.format)==null?void 0:i.feature;if(u&&l)continue;const c=(r=e.format)==null?void 0:r.feature;if((c||l)&&c!==l)continue;const f=(s=a.format)==null?void 0:s.mesh;if(!((u||f)&&u!==f)){if(fm(e)&&fm(a)){if(fr(e.values,a.values))return o}else if(Qd(e)&&Qd(a)){if(e.url===a.url)return o}else if(qR(e)&&e.name===o.dataName)return o}}return null}function kve(e,t){if(e.data||!e.parent){if(e.data===null){const i=new du({values:[]});return t.push(i),i}const n=oP(e.data,t);if(n)return Wa(e.data)||(n.data.format=YB({},e.data.format,n.data.format)),!n.hasName()&&e.data.name&&(n.dataName=e.data.name),n;{const i=new du(e.data);return t.push(i),i}}else return e.parent.component.data.facetRoot?e.parent.component.data.facetRoot:e.parent.component.data.main}function Mve(e,t,n){let i=0;for(const r of t.transforms){let s,o;if(sye(r))o=e=new Hl(e,r),s="derived";else if(oF(r)){const a=wxe(r);o=e=Vt.makeWithAncestors(e,{},a,n)??e,e=new Rc(e,t,r.filter)}else if(LR(r))o=e=Er.makeFromTransform(e,r,t),s="number";else if(aye(r))s="date",n.getWithExplicit(r.field).value===void 0&&(e=new Vt(e,{[r.field]:s}),n.set(r.field,s,!1)),o=e=Ar.makeFromTransform(e,r);else if(uye(r))o=e=ji.makeFromTransform(e,r),s="number",dF(t)&&(e=new Bo(e));else if(RR(r))o=e=rh.make(e,t,r,i++),s="derived";else if(nye(r))o=e=new Pc(e,r),s="number";else if(iye(r))o=e=new Nu(e,r),s="number";else if(lye(r))o=e=ws.makeFromTransform(e,r),s="derived";else if(cye(r))o=e=new _y(e,r),s="derived";else if(rye(r))o=e=new Dy(e,r),s="derived";else if(K1e(r))o=e=new Ny(e,r),s="derived";else if(tye(r))e=new Ty(e,r);else if(oye(r))o=e=Ga.makeFromTransform(e,r),s="derived";else if(J1e(r))o=e=new Sy(e,r),s="derived";else if(Q1e(r))o=e=new My(e,r),s="derived";else if(Z1e(r))o=e=new Oy(e,r),s="derived";else if(eye(r))o=e=new ky(e,r),s="derived";else{j(Bge(r));continue}if(o&&s!==void 0)for(const a of o.producedFields()??[])n.set(a,s,!1)}return e}function By(e){var g;let t=kve(e,e.component.data.sources);const{outputNodes:n,outputNodeRefCounts:i}=e.component.data,r=e.parent?e.parent.component.data.ancestorParse.clone():new Aye,s=e.data;Wa(s)?(WR(s)?t=new s0(t,s.sequence):aF(s)&&(t=new r0(t,s.graticule)),r.parseNothing=!0):((g=s==null?void 0:s.format)==null?void 0:g.parse)===null&&(r.parseNothing=!0),t=Vt.makeExplicit(t,e,r)??t,t=new Bo(t);const o=e.parent&&Ic(e.parent);(st(e)||Ui(e))&&o&&(t=Er.makeFromEncoding(t,e)??t),e.transforms.length>0&&(t=Mve(t,e,r));const a=Cxe(e),u=$xe(e);t=Vt.makeWithAncestors(t,{},{...a,...u},r)??t,st(e)&&(t=dl.parseAll(t,e),t=ih.parseAll(t,e)),(st(e)||Ui(e))&&(o||(t=Er.makeFromEncoding(t,e)??t),t=Ar.makeFromEncoding(t,e)??t,t=Hl.parseAllForSortIndex(t,e));const l=e.getDataName(je.Raw),c=new mn(t,l,je.Raw,i);if(n[l]=c,t=c,st(e)){const p=ji.makeFromEncoding(t,e);p&&(t=p,dF(e)&&(t=new Bo(t))),t=Ga.makeFromEncoding(t,e)??t,t=ws.makeFromEncoding(t,e)??t}st(e)&&(t=nh.make(t,e)??t);const f=e.getDataName(je.Main),d=new mn(t,f,je.Main,i);n[f]=d,t=d,st(e)&&A2e(e,d);let h=null;if(Ui(e)){const p=e.getName("facet");t=_ve(t,e.facet)??t,h=new Lc(t,e,p,d.getSource()),n[p]=h}return{...e.component.data,outputNodes:n,outputNodeRefCounts:i,raw:c,main:d,facetRoot:h,ancestorParse:r}}class Ove extends FF{constructor(t,n,i,r){var s,o,a,u;super(t,"concat",n,i,r,t.resolve),(((o=(s=t.resolve)==null?void 0:s.axis)==null?void 0:o.x)==="shared"||((u=(a=t.resolve)==null?void 0:a.axis)==null?void 0:u.y)==="shared")&&j(Oge),this.children=this.getChildren(t).map((l,c)=>OF(l,this,this.getName(`concat_${c}`),void 0,r))}parseData(){this.component.data=By(this);for(const t of this.children)t.parseData()}parseSelections(){this.component.selection={};for(const t of this.children){t.parseSelections();for(const n of z(t.component.selection))this.component.selection[n]=t.component.selection[n]}}parseMarkGroup(){for(const t of this.children)t.parseMarkGroup()}parseAxesAndHeaders(){for(const t of this.children)t.parseAxesAndHeaders()}getChildren(t){return py(t)?t.vconcat:rF(t)?t.hconcat:t.concat}parseLayoutSize(){Fve(this)}parseAxisGroup(){return null}assembleSelectionTopLevelSignals(t){return this.children.reduce((n,i)=>i.assembleSelectionTopLevelSignals(n),t)}assembleSignals(){return this.children.forEach(t=>t.assembleSignals()),[]}assembleLayoutSignals(){const t=bF(this);for(const n of this.children)t.push(...n.assembleLayoutSignals());return t}assembleSelectionData(t){return this.children.reduce((n,i)=>i.assembleSelectionData(n),t)}assembleMarks(){return this.children.map(t=>{const n=t.assembleTitle(),i=t.assembleGroupStyle(),r=t.assembleGroupEncodeEntry(!1);return{type:"group",name:t.getName("group"),...n?{title:n}:{},...i?{style:i}:{},...r?{encode:{update:r}}:{},...t.assembleGroup()}})}assembleDefaultLayout(){const t=this.layout.columns;return{...t!=null?{columns:t}:{},bounds:"full",align:"each"}}}function Nve(e){return e===!1||e===null}const Tve={disable:1,gridScale:1,scale:1,...fR,labelExpr:1,encode:1},aP=z(Tve);class DF extends js{constructor(t={},n={},i=!1){super(),this.explicit=t,this.implicit=n,this.mainExtracted=i}clone(){return new DF(ce(this.explicit),ce(this.implicit),this.mainExtracted)}hasAxisPart(t){return t==="axis"?!0:t==="grid"||t==="title"?!!this.get(t):!Nve(this.get(t))}hasOrientSignalRef(){return te(this.explicit.orient)}}function Bve(e,t,n){const{encoding:i,config:r}=e,s=gt(i[t])??gt(i[Is(t)]),o=e.axis(t)||{},{format:a,formatType:u}=o;return uu(u)?{text:jC({fieldOrDatumDef:s,field:"datum.value",format:a,formatType:u,config:r}),...n}:n}function Rve(e){return Yr.reduce((t,n)=>(e.component.scales[n]&&(t[n]=[qve(n,e)]),t),{})}const Lve={bottom:"top",top:"bottom",left:"right",right:"left"};function Pve(e){const{axes:t,resolve:n}=e.component,i={top:0,bottom:0,right:0,left:0};for(const r of e.children){r.parseAxesAndHeaders();for(const s of z(r.component.axes))n.axis[s]=xF(e.component.resolve,s),n.axis[s]==="shared"&&(t[s]=Ive(t[s],r.component.axes[s]),t[s]||(n.axis[s]="independent",delete t[s]))}for(const r of Yr){for(const s of e.children)if(s.component.axes[r]){if(n.axis[r]==="independent"){t[r]=(t[r]??[]).concat(s.component.axes[r]);for(const o of s.component.axes[r]){const{value:a,explicit:u}=o.getWithExplicit("orient");if(!te(a)){if(i[a]>0&&!u){const l=Lve[a];i[a]>i[l]&&o.set("orient",l,!1)}i[a]++}}}delete s.component.axes[r]}if(n.axis[r]==="independent"&&t[r]&&t[r].length>1)for(const s of t[r])s.get("grid")&&!s.explicit.grid&&(s.implicit.grid=!1)}}function Ive(e,t){if(e){if(e.length!==t.length)return;const n=e.length;for(let i=0;i<n;i++){const r=e[i],s=t[i];if(!!r!=!!s)return;if(r&&s){const o=r.getWithExplicit("orient"),a=s.getWithExplicit("orient");if(o.explicit&&a.explicit&&o.value!==a.value)return;e[i]=zve(r,s)}}}else return t.map(n=>n.clone());return e}function zve(e,t){for(const n of aP){const i=Mo(e.getWithExplicit(n),t.getWithExplicit(n),n,"axis",(r,s)=>{switch(n){case"title":return x7(r,s);case"gridScale":return{explicit:r.explicit,value:ut(r.value,s.value)}}return yy(r,s,n,"axis")});e.setWithExplicit(n,i)}return e}function jve(e,t,n,i,r){if(t==="disable")return n!==void 0;switch(n=n||{},t){case"titleAngle":case"labelAngle":return e===(te(n.labelAngle)?n.labelAngle:Vd(n.labelAngle));case"values":return!!n.values;case"encode":return!!n.encoding||!!n.labelAngle;case"title":if(e===DL(i,r))return!0}return e===n[t]}const Uve=new Set(["grid","translate","format","formatType","orient","labelExpr","tickCount","position","tickMinStep"]);function qve(e,t){var p,m;let n=t.axis(e);const i=new DF,r=gt(t.encoding[e]),{mark:s,config:o}=t,a=(n==null?void 0:n.orient)||((p=o[e==="x"?"axisX":"axisY"])==null?void 0:p.orient)||((m=o.axis)==null?void 0:m.orient)||M2e(e),u=t.getScaleComponent(e).get("type"),l=$2e(e,u,a,t.config),c=n!==void 0?!n:Bv("disable",o.style,n==null?void 0:n.style,l).configValue;if(i.set("disable",c,n!==void 0),c)return i;n=n||{};const f=D2e(r,n,e,o.style,l),d={fieldOrDatumDef:r,axis:n,channel:e,model:t,scaleType:u,orient:a,labelAngle:f,mark:s,config:o};for(const y of aP){const b=y in Uk?Uk[y](d):dk(y)?n[y]:void 0,x=b!==void 0,v=jve(b,y,n,t,e);if(x&&v)i.set(y,b,v);else{const{configValue:A=void 0,configFrom:w=void 0}=dk(y)&&y!=="values"?Bv(y,o.style,n.style,l):{},E=A!==void 0;x&&!E?i.set(y,b,v):(w!=="vgAxisConfig"||Uve.has(y)&&E||Zh(A)||te(A))&&i.set(y,A,!1)}}const h=n.encoding??{},g=cR.reduce((y,b)=>{if(!i.hasAxisPart(b))return y;const x=TL(h[b]??{},t),v=b==="labels"?Bve(t,e,x):x;return v!==void 0&&!Be(v)&&(y[b]={update:v}),y},{});return Be(g)||i.set("encode",g,!!n.encoding||n.labelAngle!==void 0),i}function Wve({encoding:e,size:t}){for(const n of Yr){const i=bi(n);Or(t[i])&&hr(e[n])&&(delete t[i],j($7(i)))}return t}function Gve(e,t,n){const i=Sn(e),r=ke("orient",i,n);if(i.orient=Xve(i.type,t,r),r!==void 0&&r!==i.orient&&j(Kge(i.orient,r)),i.type==="bar"&&i.orient){const a=ke("cornerRadiusEnd",i,n);if(a!==void 0){const u=i.orient==="horizontal"&&t.x2||i.orient==="vertical"&&t.y2?["cornerRadius"]:bme[i.orient];for(const l of u)i[l]=a;i.cornerRadiusEnd!==void 0&&delete i.cornerRadiusEnd}}return ke("opacity",i,n)===void 0&&(i.opacity=Vve(i.type,t)),ke("cursor",i,n)===void 0&&(i.cursor=Hve(i,t,n)),i}function Hve(e,t,n){return t.href||e.href||ke("href",e,n)?"pointer":e.cursor}function Vve(e,t){if(fe([ry,BC,RC,LC],e)&&!YC(t))return .7}function Yve(e,t,{graticule:n}){if(n)return!1;const i=ou("filled",e,t),r=e.type;return ut(i,r!==ry&&r!==iy&&r!==rm)}function Xve(e,t,n){switch(e){case ry:case RC:case LC:case P7:case lme:case ume:return}const{x:i,y:r,x2:s,y2:o}=t;switch(e){case ny:if(W(i)&&(fn(i.bin)||W(r)&&r.aggregate&&!i.aggregate))return"vertical";if(W(r)&&(fn(r.bin)||W(i)&&i.aggregate&&!r.aggregate))return"horizontal";if(o||s){if(n)return n;if(!s&&(W(i)&&i.type===au&&!We(i.bin)||wv(i)))return"horizontal";if(!o&&(W(r)&&r.type===au&&!We(r.bin)||wv(r)))return"vertical"}case rm:if(s&&!(W(i)&&fn(i.bin))&&o&&!(W(r)&&fn(r.bin)))return;case ty:if(o)return W(r)&&fn(r.bin)?"horizontal":"vertical";if(s)return W(i)&&fn(i.bin)?"vertical":"horizontal";if(e===rm){if(i&&!r)return"vertical";if(r&&!i)return"horizontal"}case iy:case BC:{const a=hr(i),u=hr(r);if(n)return n;if(a&&!u)return e!=="tick"?"horizontal":"vertical";if(!a&&u)return e!=="tick"?"vertical":"horizontal";if(a&&u){const l=i,c=r,f=l.type===Ul,d=c.type===Ul;return f&&!d?e!=="tick"?"vertical":"horizontal":!f&&d?e!=="tick"?"horizontal":"vertical":!l.aggregate&&c.aggregate?e!=="tick"?"vertical":"horizontal":l.aggregate&&!c.aggregate&&e!=="tick"?"horizontal":"vertical"}else return}}return"vertical"}const Kve={vgMark:"arc",encodeEntry:e=>({...Ai(e,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore",theta:"ignore"}),...Ht("x",e,{defaultPos:"mid"}),...Ht("y",e,{defaultPos:"mid"}),...No(e,"radius","arc"),...No(e,"theta","arc")})},Jve={vgMark:"area",encodeEntry:e=>({...Ai(e,{align:"ignore",baseline:"ignore",color:"include",orient:"include",size:"ignore",theta:"ignore"}),...gm("x",e,{defaultPos:"zeroOrMin",defaultPos2:"zeroOrMin",range:e.markDef.orient==="horizontal"}),...gm("y",e,{defaultPos:"zeroOrMin",defaultPos2:"zeroOrMin",range:e.markDef.orient==="vertical"}),...fF(e)})},Qve={vgMark:"rect",encodeEntry:e=>({...Ai(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...No(e,"x","bar"),...No(e,"y","bar")})},Zve={vgMark:"shape",encodeEntry:e=>({...Ai(e,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore",theta:"ignore"})}),postEncodingTransform:e=>{const{encoding:t}=e,n=t.shape;return[{type:"geoshape",projection:e.projectionName(),...n&&W(n)&&n.type===Mc?{field:q(n,{expr:"datum"})}:{}}]}},eAe={vgMark:"image",encodeEntry:e=>({...Ai(e,{align:"ignore",baseline:"ignore",color:"ignore",orient:"ignore",size:"ignore",theta:"ignore"}),...No(e,"x","image"),...No(e,"y","image"),...lF(e,"url")})},tAe={vgMark:"line",encodeEntry:e=>({...Ai(e,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore",theta:"ignore"}),...Ht("x",e,{defaultPos:"mid"}),...Ht("y",e,{defaultPos:"mid"}),...vt("size",e,{vgChannel:"strokeWidth"}),...fF(e)})},nAe={vgMark:"trail",encodeEntry:e=>({...Ai(e,{align:"ignore",baseline:"ignore",color:"include",size:"include",orient:"ignore",theta:"ignore"}),...Ht("x",e,{defaultPos:"mid"}),...Ht("y",e,{defaultPos:"mid"}),...vt("size",e),...fF(e)})};function _F(e,t){const{config:n}=e;return{...Ai(e,{align:"ignore",baseline:"ignore",color:"include",size:"include",orient:"ignore",theta:"ignore"}),...Ht("x",e,{defaultPos:"mid"}),...Ht("y",e,{defaultPos:"mid"}),...vt("size",e),...vt("angle",e),...iAe(e,n,t)}}function iAe(e,t,n){return n?{shape:{value:n}}:vt("shape",e)}const rAe={vgMark:"symbol",encodeEntry:e=>_F(e)},sAe={vgMark:"symbol",encodeEntry:e=>_F(e,"circle")},oAe={vgMark:"symbol",encodeEntry:e=>_F(e,"square")},aAe={vgMark:"rect",encodeEntry:e=>({...Ai(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...No(e,"x","rect"),...No(e,"y","rect")})},uAe={vgMark:"rule",encodeEntry:e=>{const{markDef:t}=e,n=t.orient;return!e.encoding.x&&!e.encoding.y&&!e.encoding.latitude&&!e.encoding.longitude?{}:{...Ai(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...gm("x",e,{defaultPos:n==="horizontal"?"zeroOrMax":"mid",defaultPos2:"zeroOrMin",range:n!=="vertical"}),...gm("y",e,{defaultPos:n==="vertical"?"zeroOrMax":"mid",defaultPos2:"zeroOrMin",range:n!=="horizontal"}),...vt("size",e,{vgChannel:"strokeWidth"})}}},lAe={vgMark:"text",encodeEntry:e=>{const{config:t,encoding:n}=e;return{...Ai(e,{align:"include",baseline:"include",color:"include",size:"ignore",orient:"ignore",theta:"include"}),...Ht("x",e,{defaultPos:"mid"}),...Ht("y",e,{defaultPos:"mid"}),...lF(e),...vt("size",e,{vgChannel:"fontSize"}),...vt("angle",e),...Mk("align",cAe(e.markDef,n,t)),...Mk("baseline",fAe(e.markDef,n,t)),...Ht("radius",e,{defaultPos:null}),...Ht("theta",e,{defaultPos:null})}}};function cAe(e,t,n){if(ke("align",e,n)===void 0)return"center"}function fAe(e,t,n){if(ke("baseline",e,n)===void 0)return"middle"}const dAe={vgMark:"rect",encodeEntry:e=>{const{config:t,markDef:n}=e,i=n.orient,r=i==="horizontal"?"width":"height",s=i==="horizontal"?"height":"width";return{...Ai(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...Ht("x",e,{defaultPos:"mid",vgChannel:"xc"}),...Ht("y",e,{defaultPos:"mid",vgChannel:"yc"}),...vt("size",e,{defaultValue:hAe(e),vgChannel:r}),[s]:Xe(ke("thickness",n,t))}}};function hAe(e){const{config:t,markDef:n}=e,{orient:i}=n,r=i==="horizontal"?"width":"height",s=e.getScaleComponent(i==="horizontal"?"x":"y"),o=ke("size",n,t,{vgChannel:r})??t.tick.bandSize;if(o!==void 0)return o;{const a=s?s.get("range"):void 0;return a&&Jo(a)&&at(a.step)?a.step*3/4:cm(t.view,r)*3/4}}const W0={arc:Kve,area:Jve,bar:Qve,circle:sAe,geoshape:Zve,image:eAe,line:tAe,point:rAe,rect:aAe,rule:uAe,square:oAe,text:lAe,tick:dAe,trail:nAe};function gAe(e){if(fe([iy,ty,cme],e.mark)){const t=gR(e.mark,e.encoding);if(t.length>0)return pAe(e,t)}else if(e.mark===ny){const t=xv.some(n=>ke(n,e.markDef,e.config));if(e.stack&&!e.fieldDef("size")&&t)return mAe(e)}return kF(e)}const r5="faceted_path_";function pAe(e,t){return[{name:e.getName("pathgroup"),type:"group",from:{facet:{name:r5+e.requestDataName(je.Main),data:e.requestDataName(je.Main),groupby:t}},encode:{update:{width:{field:{group:"width"}},height:{field:{group:"height"}}}},marks:kF(e,{fromPrefix:r5})}]}const s5="stack_group_";function mAe(e){const[t]=kF(e,{fromPrefix:s5}),n=e.scaleName(e.stack.fieldChannel),i=(l={})=>e.vgField(e.stack.fieldChannel,l),r=(l,c)=>{const f=[i({prefix:"min",suffix:"start",expr:c}),i({prefix:"max",suffix:"start",expr:c}),i({prefix:"min",suffix:"end",expr:c}),i({prefix:"max",suffix:"end",expr:c})];return`${l}(${f.map(d=>`scale('${n}',${d})`).join(",")})`};let s,o;e.stack.fieldChannel==="x"?(s={...Pl(t.encode.update,["y","yc","y2","height",...xv]),x:{signal:r("min","datum")},x2:{signal:r("max","datum")},clip:{value:!0}},o={x:{field:{group:"x"},mult:-1},height:{field:{group:"height"}}},t.encode.update={...Qn(t.encode.update,["y","yc","y2"]),height:{field:{group:"height"}}}):(s={...Pl(t.encode.update,["x","xc","x2","width"]),y:{signal:r("min","datum")},y2:{signal:r("max","datum")},clip:{value:!0}},o={y:{field:{group:"y"},mult:-1},width:{field:{group:"width"}}},t.encode.update={...Qn(t.encode.update,["x","xc","x2"]),width:{field:{group:"width"}}});for(const l of xv){const c=ou(l,e.markDef,e.config);t.encode.update[l]?(s[l]=t.encode.update[l],delete t.encode.update[l]):c&&(s[l]=Xe(c)),c&&(t.encode.update[l]={value:0})}const a=[];if(e.stack.groupbyChannel){const l=e.fieldDef(e.stack.groupbyChannel),c=q(l);c&&a.push(c),(l!=null&&l.bin||l!=null&&l.timeUnit)&&a.push(q(l,{binSuffix:"end"}))}return s=["stroke","strokeWidth","strokeJoin","strokeCap","strokeDash","strokeDashOffset","strokeMiterLimit","strokeOpacity"].reduce((l,c)=>{if(t.encode.update[c])return{...l,[c]:t.encode.update[c]};{const f=ou(c,e.markDef,e.config);return f!==void 0?{...l,[c]:Xe(f)}:l}},s),s.stroke&&(s.strokeForeground={value:!0},s.strokeOffset={value:0}),[{type:"group",from:{facet:{data:e.requestDataName(je.Main),name:s5+e.requestDataName(je.Main),groupby:a,aggregate:{fields:[i({suffix:"start"}),i({suffix:"start"}),i({suffix:"end"}),i({suffix:"end"})],ops:["min","max","min","max"]}}},encode:{update:s},marks:[{type:"group",encode:{update:o},marks:[t]}]}]}function yAe(e){const{encoding:t,stack:n,mark:i,markDef:r,config:s}=e,o=t.order;if(!(!K(o)&&Hi(o)&&yv(o.value)||!o&&yv(ke("order",r,s)))){if((K(o)||W(o))&&!n)return m7(o,{expr:"datum"});if(Qo(i)){const a=r.orient==="horizontal"?"y":"x",u=t[a];if(W(u)){const l=u.sort;if(K(l))return{field:q(u,{prefix:a,suffix:"sort_index",expr:"datum"})};if(vr(l))return{field:q({aggregate:YC(e.encoding)?l.op:void 0,field:l.field},{expr:"datum"})};if(Q7(l)){const c=e.fieldDef(l.encoding);return{field:q(c,{expr:"datum"}),order:l.order}}else return l===null?void 0:{field:q(u,{binSuffix:e.stack&&e.stack.impute?"mid":void 0,expr:"datum"})}}return}}}function kF(e,t={fromPrefix:""}){const{mark:n,markDef:i,encoding:r,config:s}=e,o=ut(i.clip,bAe(e),xAe(e)),a=g7(i),u=r.key,l=yAe(e),c=vAe(e),f=ke("aria",i,s),d=W0[n].postEncodingTransform?W0[n].postEncodingTransform(e):null;return[{name:e.getName("marks"),type:W0[n].vgMark,...o?{clip:!0}:{},...a?{style:a}:{},...u?{key:u.field}:{},...l?{sort:l}:{},...c||{},...f===!1?{aria:f}:{},from:{data:t.fromPrefix+e.requestDataName(je.Main)},encode:{update:W0[n].encodeEntry(e)},...d?{transform:d}:{}}]}function bAe(e){const t=e.getScaleComponent("x"),n=e.getScaleComponent("y");return t&&t.get("selectionExtent")||n&&n.get("selectionExtent")?!0:void 0}function xAe(e){const t=e.component.projection;return t&&!t.isFit?!0:void 0}function vAe(e){if(!e.component.selection)return null;const t=z(e.component.selection).length;let n=t,i=e.parent;for(;i&&n===0;)n=z(i.component.selection).length,i=i.parent;return n?{interactive:t>0||!!e.encoding.tooltip}:null}class uP extends iP{constructor(t,n,i,r={},s){super(t,"unit",n,i,s,void 0,gk(t)?t.view:void 0),this.specifiedScales={},this.specifiedAxes={},this.specifiedLegends={},this.specifiedProjection={},this.selection=[],this.children=[];const o=kr(t.mark)?{...t.mark}:{type:t.mark},a=o.type;o.filled===void 0&&(o.filled=Yve(o,s,{graticule:t.data&&aF(t.data)}));const u=this.encoding=Vme(t.encoding||{},a,o.filled,s);this.markDef=Gve(o,u,s),this.size=Wve({encoding:u,size:gk(t)?{...r,...t.width?{width:t.width}:{},...t.height?{height:t.height}:{}}:r}),this.stack=NR(a,u),this.specifiedScales=this.initScales(a,u),this.specifiedAxes=this.initAxes(u),this.specifiedLegends=this.initLegends(u),this.specifiedProjection=t.projection,this.selection=(t.params??[]).filter(l=>nF(l))}get hasProjection(){const{encoding:t}=this,n=this.mark===I7,i=t&&V0e.some(r=>re(t[r]));return n||i}scaleDomain(t){const n=this.specifiedScales[t];return n?n.domain:void 0}axis(t){return this.specifiedAxes[t]}legend(t){return this.specifiedLegends[t]}initScales(t,n){return Q1.reduce((i,r)=>{const s=gt(n[r]);return s&&(i[r]=this.initScale(s.scale??{})),i},{})}initScale(t){const{domain:n,range:i}=t,r=Sn(t);return K(n)&&(r.domain=n.map(Yn)),K(i)&&(r.range=i.map(Yn)),r}initAxes(t){return Yr.reduce((n,i)=>{const r=t[i];if(re(r)||i===Ze&&re(t.x2)||i===mt&&re(t.y2)){const s=re(r)?r.axis:void 0;n[i]=s&&this.initAxis({...s})}return n},{})}initAxis(t){const n=z(t),i={};for(const r of n){const s=t[r];i[r]=Zh(s)?h7(s):Yn(s)}return i}initLegends(t){return nge.reduce((n,i)=>{const r=gt(t[i]);if(r&&rge(i)){const s=r.legend;n[i]=s&&Sn(s)}return n},{})}parseData(){this.component.data=By(this)}parseLayoutSize(){Sve(this)}parseSelections(){this.component.selection=v2e(this,this.selection)}parseMarkGroup(){this.component.mark=gAe(this)}parseAxesAndHeaders(){this.component.axes=Rve(this)}assembleSelectionTopLevelSignals(t){return Tye(this,t)}assembleSignals(){return[...CL(this),...Oye(this,[])]}assembleSelectionData(t){return Bye(this,t)}assembleLayout(){return null}assembleLayoutSignals(){return bF(this)}assembleMarks(){let t=this.component.mark??[];return(!this.parent||!Ic(this.parent))&&(t=QR(this,t)),t.map(this.correctDataNames)}getMapping(){return this.encoding}get mark(){return this.markDef.type}channelHasField(t){return qa(this.encoding,t)}fieldDef(t){const n=this.encoding[t];return Mr(n)}typedFieldDef(t){const n=this.fieldDef(t);return xi(n)?n:null}}class MF extends FF{constructor(t,n,i,r,s){super(t,"layer",n,i,s,t.resolve,t.view);const o={...r,...t.width?{width:t.width}:{},...t.height?{height:t.height}:{}};this.children=t.layer.map((a,u)=>{if(my(a))return new MF(a,this,this.getName(`layer_${u}`),o,s);if(zs(a))return new uP(a,this,this.getName(`layer_${u}`),o,s);throw new Error(xC(a))})}parseData(){this.component.data=By(this);for(const t of this.children)t.parseData()}parseLayoutSize(){Cve(this)}parseSelections(){this.component.selection={};for(const t of this.children){t.parseSelections();for(const n of z(t.component.selection))this.component.selection[n]=t.component.selection[n]}}parseMarkGroup(){for(const t of this.children)t.parseMarkGroup()}parseAxesAndHeaders(){Pve(this)}assembleSelectionTopLevelSignals(t){return this.children.reduce((n,i)=>i.assembleSelectionTopLevelSignals(n),t)}assembleSignals(){return this.children.reduce((t,n)=>t.concat(n.assembleSignals()),CL(this))}assembleLayoutSignals(){return this.children.reduce((t,n)=>t.concat(n.assembleLayoutSignals()),bF(this))}assembleSelectionData(t){return this.children.reduce((n,i)=>i.assembleSelectionData(n),t)}assembleTitle(){let t=super.assembleTitle();if(t)return t;for(const n of this.children)if(t=n.assembleTitle(),t)return t}assembleLayout(){return null}assembleMarks(){return Rye(this,this.children.flatMap(t=>t.assembleMarks()))}assembleLegends(){return this.children.reduce((t,n)=>t.concat(n.assembleLegends()),UL(this))}}function OF(e,t,n,i,r){if(ay(e))return new cd(e,t,n,r);if(my(e))return new MF(e,t,n,i,r);if(zs(e))return new uP(e,t,n,i,r);if(y1e(e))return new Ove(e,t,n,r);throw new Error(xC(e))}function AAe(e,t={}){t.logger&&Ape(t.logger),t.fieldTitle&&aR(t.fieldTitle);try{const n=OR(VN(t.config,e.config)),i=jR(e,n),r=OF(i,null,"",void 0,n);return r.parse(),jxe(r.component.data,r),{spec:wAe(r,EAe(e,i.autosize,n,r),e.datasets,e.usermeta),normalized:i}}finally{t.logger&&Epe(),t.fieldTitle&&Pme()}}function EAe(e,t,n,i){const r=i.component.layoutSize.get("width"),s=i.component.layoutSize.get("height");if(t===void 0?(t={type:"pad"},i.hasAxisOrientSignalRef()&&(t.resize=!0)):ue(t)&&(t={type:t}),r&&s&&bye(t.type)){if(r==="step"&&s==="step")j(Z3()),t.type="pad";else if(r==="step"||s==="step"){const o=r==="step"?"width":"height";j(Z3(J1(o)));const a=o==="width"?"height":"width";t.type=xye(a)}}return{...z(t).length===1&&t.type?t.type==="pad"?{}:{autosize:t.type}:{autosize:t},...Fk(n,!1),...Fk(e,!0)}}function wAe(e,t,n={},i){const r=e.config?M1e(e.config):void 0,s=[].concat(e.assembleSelectionData([]),Ave(e.component.data,n)),o=e.assembleProjections(),a=e.assembleTitle(),u=e.assembleGroupStyle(),l=e.assembleGroupEncodeEntry(!0);let c=e.assembleLayoutSignals();c=c.filter(h=>(h.name==="width"||h.name==="height")&&h.value!==void 0?(t[h.name]=+h.value,!1):!0);const{params:f,...d}=t;return{$schema:"https://vega.github.io/schema/vega/v5.json",...e.description?{description:e.description}:{},...d,...a?{title:a}:{},...u?{style:u}:{},...l?{encode:{update:l}}:{},data:s,...o.length>0?{projections:o}:{},...e.assembleGroup([...c,...e.assembleSelectionTopLevelSignals([]),..._R(f)]),...r?{config:r}:{},...i?{usermeta:i}:{}}}const $Ae=B0e.version,CAe=Object.freeze(Object.defineProperty({__proto__:null,accessPathDepth:zl,accessPathWithDatum:dC,compile:AAe,contains:fe,deepEqual:fr,deleteNestedProperty:tm,duplicate:ce,entries:_o,every:lC,fieldIntersection:fC,flatAccessWithDatum:KB,getFirstDefined:ut,hasIntersection:cC,hash:ye,internalField:ZB,isBoolean:Hd,isEmpty:Be,isEqual:j0e,isInternalField:e7,isNullOrFalse:yv,isNumeric:G1,keys:z,logicalExpr:sd,mergeDeep:YB,normalize:jR,normalizeAngle:Vd,omit:Qn,pick:Pl,prefixGenerator:bv,removePathFromField:hC,replaceAll:ru,replacePathInField:mi,resetIdCounter:q0e,setEqual:XB,some:Il,stringify:Ue,titleCase:Gh,unique:dr,uniqueId:QB,vals:pn,varName:Ke,version:$Ae},Symbol.toStringTag,{value:"Module"}));function lP(e){const[t,n]=/schema\/([\w-]+)\/([\w\.\-]+)\.json$/g.exec(e).slice(1,3);return{library:t,version:n}}var FAe="vega-themes",SAe="2.13.0",DAe="Themes for stylized Vega and Vega-Lite visualizations.",_Ae=["vega","vega-lite","themes","style"],kAe="BSD-3-Clause",MAe={name:"UW Interactive Data Lab",url:"https://idl.cs.washington.edu"},OAe=[{name:"Emily Gu",url:"https://github.com/emilygu"},{name:"Arvind Satyanarayan",url:"http://arvindsatya.com"},{name:"Jeffrey Heer",url:"https://idl.cs.washington.edu"},{name:"Dominik Moritz",url:"https://www.domoritz.de"}],NAe="build/vega-themes.js",TAe="build/vega-themes.module.js",BAe="build/vega-themes.min.js",RAe="build/vega-themes.min.js",LAe="build/vega-themes.module.d.ts",PAe={type:"git",url:"https://github.com/vega/vega-themes.git"},IAe=["src","build"],zAe={prebuild:"yarn clean",build:"rollup -c",clean:"rimraf build && rimraf examples/build","copy:data":"rsync -r node_modules/vega-datasets/data/* examples/data","copy:build":"rsync -r build/* examples/build","deploy:gh":"yarn build && mkdir -p examples/build && rsync -r build/* examples/build && gh-pages -d examples",preversion:"yarn lint",serve:"browser-sync start -s -f build examples --serveStatic examples",start:"yarn build && concurrently --kill-others -n Server,Rollup 'yarn serve' 'rollup -c -w'",format:"eslint . --fix",lint:"eslint .",release:"release-it"},jAe={"@babel/core":"^7.21.4","@babel/plugin-transform-runtime":"^7.21.4","@babel/preset-env":"^7.21.4","@babel/preset-typescript":"^7.21.4","@release-it/conventional-changelog":"^5.1.1","@rollup/plugin-json":"^6.0.0","@rollup/plugin-node-resolve":"^15.0.2","@rollup/plugin-terser":"^0.4.1","@typescript-eslint/eslint-plugin":"^5.59.0","@typescript-eslint/parser":"^5.59.0","browser-sync":"^2.29.1",concurrently:"^8.0.1",eslint:"^8.38.0","eslint-config-prettier":"^8.8.0","eslint-plugin-prettier":"^4.2.1","gh-pages":"^5.0.0",prettier:"^2.8.7","release-it":"^15.10.1",rollup:"^3.20.6","rollup-plugin-bundle-size":"^1.0.3","rollup-plugin-ts":"^3.2.0",typescript:"^5.0.4",vega:"^5.24.0","vega-lite":"^5.7.1"},UAe={vega:"*","vega-lite":"*"},qAe={},WAe={name:FAe,version:SAe,description:DAe,keywords:_Ae,license:kAe,author:MAe,contributors:OAe,main:NAe,module:TAe,unpkg:BAe,jsdelivr:RAe,types:LAe,repository:PAe,files:IAe,scripts:zAe,devDependencies:jAe,peerDependencies:UAe,dependencies:qAe};const Wu="#fff",o5="#888",GAe={background:"#333",view:{stroke:o5},title:{color:Wu,subtitleColor:Wu},style:{"guide-label":{fill:Wu},"guide-title":{fill:Wu}},axis:{domainColor:Wu,gridColor:o5,tickColor:Wu}},la="#4572a7",HAe={background:"#fff",arc:{fill:la},area:{fill:la},line:{stroke:la,strokeWidth:2},path:{stroke:la},rect:{fill:la},shape:{stroke:la},symbol:{fill:la,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"]}},ca="#30a2da",f2="#cbcbcb",VAe="#999",YAe="#333",a5="#f0f0f0",u5="#333",XAe={arc:{fill:ca},area:{fill:ca},axis:{domainColor:f2,grid:!0,gridColor:f2,gridWidth:1,labelColor:VAe,labelFontSize:10,titleColor:YAe,tickColor:f2,tickSize:10,titleFontSize:14,titlePadding:10,labelPadding:4},axisBand:{grid:!1},background:a5,group:{fill:a5},legend:{labelColor:u5,labelFontSize:11,padding:1,symbolSize:30,symbolType:"square",titleColor:u5,titleFontSize:14,titlePadding:10},line:{stroke:ca,strokeWidth:2},path:{stroke:ca,strokeWidth:.5},rect:{fill:ca},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:ca},bar:{binSpacing:2,fill:ca,stroke:null},title:{anchor:"start",fontSize:24,fontWeight:600,offset:20}},fa="#000",KAe={group:{fill:"#e5e5e5"},arc:{fill:fa},area:{fill:fa},line:{stroke:fa},path:{stroke:fa},rect:{fill:fa},shape:{stroke:fa},symbol:{fill:fa,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"]}},JAe=22,QAe="normal",l5="Benton Gothic, sans-serif",c5=11.5,ZAe="normal",da="#82c6df",d2="Benton Gothic Bold, sans-serif",f5="normal",d5=13,ff={"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"]},eEe={background:"#ffffff",title:{anchor:"start",color:"#000000",font:d2,fontSize:JAe,fontWeight:QAe},arc:{fill:da},area:{fill:da},line:{stroke:da,strokeWidth:2},path:{stroke:da},rect:{fill:da},shape:{stroke:da},symbol:{fill:da,size:30},axis:{labelFont:l5,labelFontSize:c5,labelFontWeight:ZAe,titleFont:d2,titleFontSize:d5,titleFontWeight:f5},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:l5,labelFontSize:c5,symbolType:"square",titleFont:d2,titleFontSize:d5,titleFontWeight:f5},range:{category:ff["category-6"],diverging:ff["fireandice-6"],heatmap:ff["fire-7"],ordinal:ff["fire-7"],ramp:ff["fire-7"]}},ha="#ab5787",G0="#979797",tEe={background:"#f9f9f9",arc:{fill:ha},area:{fill:ha},line:{stroke:ha},path:{stroke:ha},rect:{fill:ha},shape:{stroke:ha},symbol:{fill:ha,size:30},axis:{domainColor:G0,domainWidth:.5,gridWidth:.2,labelColor:G0,tickColor:G0,tickWidth:.2,titleColor:G0},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"]}},ga="#3e5c69",nEe={background:"#fff",arc:{fill:ga},area:{fill:ga},line:{stroke:ga},path:{stroke:ga},rect:{fill:ga},shape:{stroke:ga},symbol:{fill:ga},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"]}},si="#1696d2",h5="#000000",iEe="#FFFFFF",H0="Lato",h2="Lato",rEe="Lato",sEe="#DEDDDD",oEe=18,df={"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"]},aEe={background:iEe,title:{anchor:"start",fontSize:oEe,font:H0},axisX:{domain:!0,domainColor:h5,domainWidth:1,grid:!1,labelFontSize:12,labelFont:h2,labelAngle:0,tickColor:h5,tickSize:5,titleFontSize:12,titlePadding:10,titleFont:H0},axisY:{domain:!1,domainWidth:1,grid:!0,gridColor:sEe,gridWidth:1,labelFontSize:12,labelFont:h2,labelPadding:8,ticks:!1,titleFontSize:12,titlePadding:10,titleFont:H0,titleAngle:0,titleY:-10,titleX:18},legend:{labelFontSize:12,labelFont:h2,symbolSize:100,titleFontSize:12,titlePadding:10,titleFont:H0,orient:"right",offset:10},view:{stroke:"transparent"},range:{category:df["six-groups-cat-1"],diverging:df["diverging-colors"],heatmap:df["diverging-colors"],ordinal:df["six-groups-seq"],ramp:df["shades-blue"]},area:{fill:si},rect:{fill:si},line:{color:si,stroke:si,strokeWidth:5},trail:{color:si,stroke:si,strokeWidth:0,size:1},path:{stroke:si,strokeWidth:.5},point:{filled:!0},text:{font:rEe,color:si,fontSize:11,align:"center",fontWeight:400,size:11},style:{bar:{fill:si,stroke:null}},arc:{fill:si},shape:{stroke:si},symbol:{fill:si,size:30}},pa="#3366CC",g5="#ccc",V0="Arial, sans-serif",uEe={arc:{fill:pa},area:{fill:pa},path:{stroke:pa},rect:{fill:pa},shape:{stroke:pa},symbol:{stroke:pa},circle:{fill:pa},background:"#fff",padding:{top:10,right:10,bottom:10,left:10},style:{"guide-label":{font:V0,fontSize:12},"guide-title":{font:V0,fontSize:12},"group-title":{font:V0,fontSize:12}},title:{font:V0,fontSize:14,fontWeight:"bold",dy:-3,anchor:"start"},axis:{gridColor:g5,tickColor:g5,domain:!1,grid:!0},range:{category:["#4285F4","#DB4437","#F4B400","#0F9D58","#AB47BC","#00ACC1","#FF7043","#9E9D24","#5C6BC0","#F06292","#00796B","#C2185B"],heatmap:["#c6dafc","#5e97f6","#2a56c6"]}},NF=e=>e*(1/3+1),p5=NF(9),m5=NF(10),y5=NF(12),hf="Segoe UI",b5="wf_standard-font, helvetica, arial, sans-serif",x5="#252423",gf="#605E5C",v5="transparent",lEe="#C8C6C4",$i="#118DFF",cEe="#12239E",fEe="#E66C37",dEe="#6B007B",hEe="#E044A7",gEe="#744EC2",pEe="#D9B300",mEe="#D64550",cP=$i,fP="#DEEFFF",A5=[fP,cP],yEe=[fP,"#c7e4ff","#b0d9ff","#9aceff","#83c3ff","#6cb9ff","#55aeff","#3fa3ff","#2898ff",cP],bEe={view:{stroke:v5},background:v5,font:hf,header:{titleFont:b5,titleFontSize:y5,titleColor:x5,labelFont:hf,labelFontSize:m5,labelColor:gf},axis:{ticks:!1,grid:!1,domain:!1,labelColor:gf,labelFontSize:p5,titleFont:b5,titleColor:x5,titleFontSize:y5,titleFontWeight:"normal"},axisQuantitative:{tickCount:3,grid:!0,gridColor:lEe,gridDash:[1,5],labelFlush:!1},axisBand:{tickExtra:!0},axisX:{labelPadding:5},axisY:{labelPadding:10},bar:{fill:$i},line:{stroke:$i,strokeWidth:3,strokeCap:"round",strokeJoin:"round"},text:{font:hf,fontSize:p5,fill:gf},arc:{fill:$i},area:{fill:$i,line:!0,opacity:.6},path:{stroke:$i},rect:{fill:$i},point:{fill:$i,filled:!0,size:75},shape:{stroke:$i},symbol:{fill:$i,strokeWidth:1.5,size:50},legend:{titleFont:hf,titleFontWeight:"bold",titleColor:gf,labelFont:hf,labelFontSize:m5,labelColor:gf,symbolType:"circle",symbolSize:75},range:{category:[$i,cEe,fEe,dEe,hEe,gEe,pEe,mEe],diverging:A5,heatmap:A5,ordinal:yEe}},xEe=WAe.version,vEe=Object.freeze(Object.defineProperty({__proto__:null,dark:GAe,excel:HAe,fivethirtyeight:XAe,ggplot2:KAe,googlecharts:uEe,latimes:eEe,powerbi:bEe,quartz:tEe,urbaninstitute:aEe,version:xEe,vox:nEe},Symbol.toStringTag,{value:"Module"}));function zc(e,t,n){return e.fields=t||[],e.fname=n,e}function AEe(e){return e.length===1?EEe(e[0]):wEe(e)}const EEe=e=>function(t){return t[e]},wEe=e=>{const t=e.length;return function(n){for(let i=0;i<t;++i)n=n[e[i]];return n}};function g2(e){throw Error(e)}function $Ee(e){const t=[],n=e.length;let i=null,r=0,s="",o,a,u;e=e+"";function l(){t.push(s+e.substring(o,a)),s="",o=a+1}for(o=a=0;a<n;++a)if(u=e[a],u==="\\")s+=e.substring(o,a++),o=a;else if(u===i)l(),i=null,r=-1;else{if(i)continue;o===r&&u==='"'||o===r&&u==="'"?(o=a+1,i=u):u==="."&&!r?a>o?l():o=a+1:u==="["?(a>o&&l(),r=o=a+1):u==="]"&&(r||g2("Access path missing open bracket: "+e),r>0&&l(),r=0,o=a+1)}return r&&g2("Access path missing closing bracket: "+e),i&&g2("Access path missing closing quote: "+e),a>o&&(a++,l()),t}function CEe(e,t,n){const i=$Ee(e);return e=i.length===1?i[0]:e,zc((n&&n.get||AEe)(i),[e],t||e)}CEe("id");zc(e=>e,[],"identity");zc(()=>0,[],"zero");zc(()=>1,[],"one");zc(()=>!0,[],"true");zc(()=>!1,[],"false");var FEe=Array.isArray;function E5(e){return e===Object(e)}function SEe(e){return typeof e=="string"}function sh(e){return sh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},sh(e)}function DEe(e,t){if(sh(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var i=n.call(e,t||"default");if(sh(i)!=="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function _Ee(e){var t=DEe(e,"string");return sh(t)==="symbol"?t:String(t)}function kEe(e,t,n){return t=_Ee(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function MEe(e,t){if(e==null)return{};var n={},i=Object.keys(e),r,s;for(s=0;s<i.length;s++)r=i[s],!(t.indexOf(r)>=0)&&(n[r]=e[r]);return n}function OEe(e,t){if(e==null)return{};var n=MEe(e,t),i,r;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r<s.length;r++)i=s[r],!(t.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(n[i]=e[i])}return n}const NEe=["title","image"];function TEe(e,t,n){if(FEe(e))return`[${e.map(i=>t(SEe(i)?i:w5(i,n))).join(", ")}]`;if(E5(e)){let i="";const r=e,{title:s,image:o}=r,a=OEe(r,NEe);s&&(i+=`<h2>${t(s)}</h2>`),o&&(i+=`<img src="${t(o)}">`);const u=Object.keys(a);if(u.length>0){i+="<table>";for(const l of u){let c=a[l];c!==void 0&&(E5(c)&&(c=w5(c,n)),i+=`<tr><td class="key">${t(l)}:</td><td class="value">${t(c)}</td></tr>`)}i+="</table>"}return i||"{}"}return t(e)}function BEe(e){const t=[];return function(n,i){if(typeof i!="object"||i===null)return i;const r=t.indexOf(this)+1;return t.length=r,t.length>e?"[Object]":t.indexOf(i)>=0?"[Circular]":(t.push(i),i)}}function w5(e,t){return JSON.stringify(e,BEe(t))}var REe=`#vg-tooltip-element {
visibility: hidden;
padding: 8px;
position: fixed;
z-index: 1000;
font-family: sans-serif;
font-size: 11px;
border-radius: 3px;
box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
/* The default theme is the light theme. */
background-color: rgba(255, 255, 255, 0.95);
border: 1px solid #d9d9d9;
color: black;
}
#vg-tooltip-element.visible {
visibility: visible;
}
#vg-tooltip-element h2 {
margin-top: 0;
margin-bottom: 10px;
font-size: 13px;
}
#vg-tooltip-element table {
border-spacing: 0;
}
#vg-tooltip-element table tr {
border: none;
}
#vg-tooltip-element table tr td {
overflow: hidden;
text-overflow: ellipsis;
padding-top: 2px;
padding-bottom: 2px;
}
#vg-tooltip-element table tr td.key {
color: #808080;
max-width: 150px;
text-align: right;
padding-right: 4px;
}
#vg-tooltip-element table tr td.value {
display: block;
max-width: 300px;
max-height: 7em;
text-align: left;
}
#vg-tooltip-element.dark-theme {
background-color: rgba(32, 32, 32, 0.9);
border: 1px solid #f5f5f5;
color: white;
}
#vg-tooltip-element.dark-theme td.key {
color: #bfbfbf;
}
`;const dP="vg-tooltip-element",LEe={offsetX:10,offsetY:10,id:dP,styleId:"vega-tooltip-style",theme:"light",disableDefaultStyle:!1,sanitize:PEe,maxDepth:2,formatTooltip:TEe};function PEe(e){return String(e).replace(/&/g,"&amp;").replace(/</g,"&lt;")}function IEe(e){if(!/^[A-Za-z]+[-:.\w]*$/.test(e))throw new Error("Invalid HTML ID");return REe.toString().replace(dP,e)}function zEe(e,t,n,i){let r=e.clientX+n;r+t.width>window.innerWidth&&(r=+e.clientX-n-t.width);let s=e.clientY+i;return s+t.height>window.innerHeight&&(s=+e.clientY-i-t.height),{x:r,y:s}}function $5(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),n.push.apply(n,i)}return n}function C5(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?$5(Object(n),!0).forEach(function(i){kEe(e,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$5(Object(n)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(n,i))})}return e}class jEe{constructor(t){this.options=C5(C5({},LEe),t);const n=this.options.id;if(this.el=null,this.call=this.tooltipHandler.bind(this),!this.options.disableDefaultStyle&&!document.getElementById(this.options.styleId)){const i=document.createElement("style");i.setAttribute("id",this.options.styleId),i.innerHTML=IEe(n);const r=document.head;r.childNodes.length>0?r.insertBefore(i,r.childNodes[0]):r.appendChild(i)}}tooltipHandler(t,n,i,r){if(this.el=document.getElementById(this.options.id),this.el||(this.el=document.createElement("div"),this.el.setAttribute("id",this.options.id),this.el.classList.add("vg-tooltip"),(document.fullscreenElement??document.body).appendChild(this.el)),r==null||r===""){this.el.classList.remove("visible",`${this.options.theme}-theme`);return}this.el.innerHTML=this.options.formatTooltip(r,this.options.sanitize,this.options.maxDepth),this.el.classList.add("visible",`${this.options.theme}-theme`);const{x:s,y:o}=zEe(n,this.el.getBoundingClientRect(),this.options.offsetX,this.options.offsetY);this.el.style.top=`${o}px`,this.el.style.left=`${s}px`}}function oh(e){return oh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},oh(e)}function UEe(e,t){if(oh(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var i=n.call(e,t||"default");if(oh(i)!=="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function qEe(e){var t=UEe(e,"string");return oh(t)==="symbol"?t:String(t)}function WEe(e,t,n){return t=qEe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function GEe(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var p2,F5;function HEe(){return F5||(F5=1,p2=function(e){e.prototype[Symbol.iterator]=function*(){for(let t=this.head;t;t=t.next)yield t.value}}),p2}var VEe=Se;Se.Node=hu;Se.create=Se;function Se(e){var t=this;if(t instanceof Se||(t=new Se),t.tail=null,t.head=null,t.length=0,e&&typeof e.forEach=="function")e.forEach(function(r){t.push(r)});else if(arguments.length>0)for(var n=0,i=arguments.length;n<i;n++)t.push(arguments[n]);return t}Se.prototype.removeNode=function(e){if(e.list!==this)throw new Error("removing node which does not belong to this list");var t=e.next,n=e.prev;return t&&(t.prev=n),n&&(n.next=t),e===this.head&&(this.head=t),e===this.tail&&(this.tail=n),e.list.length--,e.next=null,e.prev=null,e.list=null,t};Se.prototype.unshiftNode=function(e){if(e!==this.head){e.list&&e.list.removeNode(e);var t=this.head;e.list=this,e.next=t,t&&(t.prev=e),this.head=e,this.tail||(this.tail=e),this.length++}};Se.prototype.pushNode=function(e){if(e!==this.tail){e.list&&e.list.removeNode(e);var t=this.tail;e.list=this,e.prev=t,t&&(t.next=e),this.tail=e,this.head||(this.head=e),this.length++}};Se.prototype.push=function(){for(var e=0,t=arguments.length;e<t;e++)XEe(this,arguments[e]);return this.length};Se.prototype.unshift=function(){for(var e=0,t=arguments.length;e<t;e++)KEe(this,arguments[e]);return this.length};Se.prototype.pop=function(){if(this.tail){var e=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,e}};Se.prototype.shift=function(){if(this.head){var e=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,e}};Se.prototype.forEach=function(e,t){t=t||this;for(var n=this.head,i=0;n!==null;i++)e.call(t,n.value,i,this),n=n.next};Se.prototype.forEachReverse=function(e,t){t=t||this;for(var n=this.tail,i=this.length-1;n!==null;i--)e.call(t,n.value,i,this),n=n.prev};Se.prototype.get=function(e){for(var t=0,n=this.head;n!==null&&t<e;t++)n=n.next;if(t===e&&n!==null)return n.value};Se.prototype.getReverse=function(e){for(var t=0,n=this.tail;n!==null&&t<e;t++)n=n.prev;if(t===e&&n!==null)return n.value};Se.prototype.map=function(e,t){t=t||this;for(var n=new Se,i=this.head;i!==null;)n.push(e.call(t,i.value,this)),i=i.next;return n};Se.prototype.mapReverse=function(e,t){t=t||this;for(var n=new Se,i=this.tail;i!==null;)n.push(e.call(t,i.value,this)),i=i.prev;return n};Se.prototype.reduce=function(e,t){var n,i=this.head;if(arguments.length>1)n=t;else if(this.head)i=this.head.next,n=this.head.value;else throw new TypeError("Reduce of empty list with no initial value");for(var r=0;i!==null;r++)n=e(n,i.value,r),i=i.next;return n};Se.prototype.reduceReverse=function(e,t){var n,i=this.tail;if(arguments.length>1)n=t;else if(this.tail)i=this.tail.prev,n=this.tail.value;else throw new TypeError("Reduce of empty list with no initial value");for(var r=this.length-1;i!==null;r--)n=e(n,i.value,r),i=i.prev;return n};Se.prototype.toArray=function(){for(var e=new Array(this.length),t=0,n=this.head;n!==null;t++)e[t]=n.value,n=n.next;return e};Se.prototype.toArrayReverse=function(){for(var e=new Array(this.length),t=0,n=this.tail;n!==null;t++)e[t]=n.value,n=n.prev;return e};Se.prototype.slice=function(e,t){t=t||this.length,t<0&&(t+=this.length),e=e||0,e<0&&(e+=this.length);var n=new Se;if(t<e||t<0)return n;e<0&&(e=0),t>this.length&&(t=this.length);for(var i=0,r=this.head;r!==null&&i<e;i++)r=r.next;for(;r!==null&&i<t;i++,r=r.next)n.push(r.value);return n};Se.prototype.sliceReverse=function(e,t){t=t||this.length,t<0&&(t+=this.length),e=e||0,e<0&&(e+=this.length);var n=new Se;if(t<e||t<0)return n;e<0&&(e=0),t>this.length&&(t=this.length);for(var i=this.length,r=this.tail;r!==null&&i>t;i--)r=r.prev;for(;r!==null&&i>e;i--,r=r.prev)n.push(r.value);return n};Se.prototype.splice=function(e,t,...n){e>this.length&&(e=this.length-1),e<0&&(e=this.length+e);for(var i=0,r=this.head;r!==null&&i<e;i++)r=r.next;for(var s=[],i=0;r&&i<t;i++)s.push(r.value),r=this.removeNode(r);r===null&&(r=this.tail),r!==this.head&&r!==this.tail&&(r=r.prev);for(var i=0;i<n.length;i++)r=YEe(this,r,n[i]);return s};Se.prototype.reverse=function(){for(var e=this.head,t=this.tail,n=e;n!==null;n=n.prev){var i=n.prev;n.prev=n.next,n.next=i}return this.head=t,this.tail=e,this};function YEe(e,t,n){var i=t===e.head?new hu(n,null,t,e):new hu(n,t,t.next,e);return i.next===null&&(e.tail=i),i.prev===null&&(e.head=i),e.length++,i}function XEe(e,t){e.tail=new hu(t,e.tail,null,e),e.head||(e.head=e.tail),e.length++}function KEe(e,t){e.head=new hu(t,null,e.head,e),e.tail||(e.tail=e.head),e.length++}function hu(e,t,n,i){if(!(this instanceof hu))return new hu(e,t,n,i);this.list=i,this.value=e,t?(t.next=this,this.prev=t):this.prev=null,n?(n.prev=this,this.next=n):this.next=null}try{HEe()(Se)}catch{}const JEe=VEe,Ca=Symbol("max"),as=Symbol("length"),Gu=Symbol("lengthCalculator"),fd=Symbol("allowStale"),Oa=Symbol("maxAge"),ts=Symbol("dispose"),S5=Symbol("noDisposeOnSet"),xt=Symbol("lruList"),Ci=Symbol("cache"),hP=Symbol("updateAgeOnGet"),m2=()=>1;class QEe{constructor(t){if(typeof t=="number"&&(t={max:t}),t||(t={}),t.max&&(typeof t.max!="number"||t.max<0))throw new TypeError("max must be a non-negative number");this[Ca]=t.max||1/0;const n=t.length||m2;if(this[Gu]=typeof n!="function"?m2:n,this[fd]=t.stale||!1,t.maxAge&&typeof t.maxAge!="number")throw new TypeError("maxAge must be a number");this[Oa]=t.maxAge||0,this[ts]=t.dispose,this[S5]=t.noDisposeOnSet||!1,this[hP]=t.updateAgeOnGet||!1,this.reset()}set max(t){if(typeof t!="number"||t<0)throw new TypeError("max must be a non-negative number");this[Ca]=t||1/0,pf(this)}get max(){return this[Ca]}set allowStale(t){this[fd]=!!t}get allowStale(){return this[fd]}set maxAge(t){if(typeof t!="number")throw new TypeError("maxAge must be a non-negative number");this[Oa]=t,pf(this)}get maxAge(){return this[Oa]}set lengthCalculator(t){typeof t!="function"&&(t=m2),t!==this[Gu]&&(this[Gu]=t,this[as]=0,this[xt].forEach(n=>{n.length=this[Gu](n.value,n.key),this[as]+=n.length})),pf(this)}get lengthCalculator(){return this[Gu]}get length(){return this[as]}get itemCount(){return this[xt].length}rforEach(t,n){n=n||this;for(let i=this[xt].tail;i!==null;){const r=i.prev;D5(this,t,i,n),i=r}}forEach(t,n){n=n||this;for(let i=this[xt].head;i!==null;){const r=i.next;D5(this,t,i,n),i=r}}keys(){return this[xt].toArray().map(t=>t.key)}values(){return this[xt].toArray().map(t=>t.value)}reset(){this[ts]&&this[xt]&&this[xt].length&&this[xt].forEach(t=>this[ts](t.key,t.value)),this[Ci]=new Map,this[xt]=new JEe,this[as]=0}dump(){return this[xt].map(t=>xm(this,t)?!1:{k:t.key,v:t.value,e:t.now+(t.maxAge||0)}).toArray().filter(t=>t)}dumpLru(){return this[xt]}set(t,n,i){if(i=i||this[Oa],i&&typeof i!="number")throw new TypeError("maxAge must be a number");const r=i?Date.now():0,s=this[Gu](n,t);if(this[Ci].has(t)){if(s>this[Ca])return hl(this,this[Ci].get(t)),!1;const u=this[Ci].get(t).value;return this[ts]&&(this[S5]||this[ts](t,u.value)),u.now=r,u.maxAge=i,u.value=n,this[as]+=s-u.length,u.length=s,this.get(t),pf(this),!0}const o=new ZEe(t,n,s,r,i);return o.length>this[Ca]?(this[ts]&&this[ts](t,n),!1):(this[as]+=o.length,this[xt].unshift(o),this[Ci].set(t,this[xt].head),pf(this),!0)}has(t){if(!this[Ci].has(t))return!1;const n=this[Ci].get(t).value;return!xm(this,n)}get(t){return y2(this,t,!0)}peek(t){return y2(this,t,!1)}pop(){const t=this[xt].tail;return t?(hl(this,t),t.value):null}del(t){hl(this,this[Ci].get(t))}load(t){this.reset();const n=Date.now();for(let i=t.length-1;i>=0;i--){const r=t[i],s=r.e||0;if(s===0)this.set(r.k,r.v);else{const o=s-n;o>0&&this.set(r.k,r.v,o)}}}prune(){this[Ci].forEach((t,n)=>y2(this,n,!1))}}const y2=(e,t,n)=>{const i=e[Ci].get(t);if(i){const r=i.value;if(xm(e,r)){if(hl(e,i),!e[fd])return}else n&&(e[hP]&&(i.value.now=Date.now()),e[xt].unshiftNode(i));return r.value}},xm=(e,t)=>{if(!t||!t.maxAge&&!e[Oa])return!1;const n=Date.now()-t.now;return t.maxAge?n>t.maxAge:e[Oa]&&n>e[Oa]},pf=e=>{if(e[as]>e[Ca])for(let t=e[xt].tail;e[as]>e[Ca]&&t!==null;){const n=t.prev;hl(e,t),t=n}},hl=(e,t)=>{if(t){const n=t.value;e[ts]&&e[ts](n.key,n.value),e[as]-=n.length,e[Ci].delete(n.key),e[xt].removeNode(t)}};class ZEe{constructor(t,n,i,r,s){this.key=t,this.value=n,this.length=i,this.now=r,this.maxAge=s||0}}const D5=(e,t,n,i)=>{let r=n.value;xm(e,r)&&(hl(e,n),e[fd]||(r=void 0)),r&&t.call(i,r.value,r.key,e)};var ewe=QEe;const twe=Object.freeze({loose:!0}),nwe=Object.freeze({}),iwe=e=>e?typeof e!="object"?twe:e:nwe;var TF=iwe,Wv={exports:{}};const rwe="2.0.0",swe=256,owe=Number.MAX_SAFE_INTEGER||9007199254740991,awe=16,uwe=["major","premajor","minor","preminor","patch","prepatch","prerelease"];var BF={MAX_LENGTH:swe,MAX_SAFE_COMPONENT_LENGTH:awe,MAX_SAFE_INTEGER:owe,RELEASE_TYPES:uwe,SEMVER_SPEC_VERSION:rwe,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2};const lwe=typeof process=="object"&&process.env&&{}.NODE_DEBUG&&/\bsemver\b/i.test({}.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};var Ry=lwe;(function(e,t){const{MAX_SAFE_COMPONENT_LENGTH:n}=BF,i=Ry;t=e.exports={};const r=t.re=[],s=t.src=[],o=t.t={};let a=0;const u=(l,c,f)=>{const d=a++;i(l,d,c),o[l]=d,s[d]=c,r[d]=new RegExp(c,f?"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",`(${s[o.NUMERICIDENTIFIER]})\\.(${s[o.NUMERICIDENTIFIER]})\\.(${s[o.NUMERICIDENTIFIER]})`),u("MAINVERSIONLOOSE",`(${s[o.NUMERICIDENTIFIERLOOSE]})\\.(${s[o.NUMERICIDENTIFIERLOOSE]})\\.(${s[o.NUMERICIDENTIFIERLOOSE]})`),u("PRERELEASEIDENTIFIER",`(?:${s[o.NUMERICIDENTIFIER]}|${s[o.NONNUMERICIDENTIFIER]})`),u("PRERELEASEIDENTIFIERLOOSE",`(?:${s[o.NUMERICIDENTIFIERLOOSE]}|${s[o.NONNUMERICIDENTIFIER]})`),u("PRERELEASE",`(?:-(${s[o.PRERELEASEIDENTIFIER]}(?:\\.${s[o.PRERELEASEIDENTIFIER]})*))`),u("PRERELEASELOOSE",`(?:-?(${s[o.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${s[o.PRERELEASEIDENTIFIERLOOSE]})*))`),u("BUILDIDENTIFIER","[0-9A-Za-z-]+"),u("BUILD",`(?:\\+(${s[o.BUILDIDENTIFIER]}(?:\\.${s[o.BUILDIDENTIFIER]})*))`),u("FULLPLAIN",`v?${s[o.MAINVERSION]}${s[o.PRERELEASE]}?${s[o.BUILD]}?`),u("FULL",`^${s[o.FULLPLAIN]}$`),u("LOOSEPLAIN",`[v=\\s]*${s[o.MAINVERSIONLOOSE]}${s[o.PRERELEASELOOSE]}?${s[o.BUILD]}?`),u("LOOSE",`^${s[o.LOOSEPLAIN]}$`),u("GTLT","((?:<|>)?=?)"),u("XRANGEIDENTIFIERLOOSE",`${s[o.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),u("XRANGEIDENTIFIER",`${s[o.NUMERICIDENTIFIER]}|x|X|\\*`),u("XRANGEPLAIN",`[v=\\s]*(${s[o.XRANGEIDENTIFIER]})(?:\\.(${s[o.XRANGEIDENTIFIER]})(?:\\.(${s[o.XRANGEIDENTIFIER]})(?:${s[o.PRERELEASE]})?${s[o.BUILD]}?)?)?`),u("XRANGEPLAINLOOSE",`[v=\\s]*(${s[o.XRANGEIDENTIFIERLOOSE]})(?:\\.(${s[o.XRANGEIDENTIFIERLOOSE]})(?:\\.(${s[o.XRANGEIDENTIFIERLOOSE]})(?:${s[o.PRERELEASELOOSE]})?${s[o.BUILD]}?)?)?`),u("XRANGE",`^${s[o.GTLT]}\\s*${s[o.XRANGEPLAIN]}$`),u("XRANGELOOSE",`^${s[o.GTLT]}\\s*${s[o.XRANGEPLAINLOOSE]}$`),u("COERCE",`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?(?:$|[^\\d])`),u("COERCERTL",s[o.COERCE],!0),u("LONETILDE","(?:~>?)"),u("TILDETRIM",`(\\s*)${s[o.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",u("TILDE",`^${s[o.LONETILDE]}${s[o.XRANGEPLAIN]}$`),u("TILDELOOSE",`^${s[o.LONETILDE]}${s[o.XRANGEPLAINLOOSE]}$`),u("LONECARET","(?:\\^)"),u("CARETTRIM",`(\\s*)${s[o.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",u("CARET",`^${s[o.LONECARET]}${s[o.XRANGEPLAIN]}$`),u("CARETLOOSE",`^${s[o.LONECARET]}${s[o.XRANGEPLAINLOOSE]}$`),u("COMPARATORLOOSE",`^${s[o.GTLT]}\\s*(${s[o.LOOSEPLAIN]})$|^$`),u("COMPARATOR",`^${s[o.GTLT]}\\s*(${s[o.FULLPLAIN]})$|^$`),u("COMPARATORTRIM",`(\\s*)${s[o.GTLT]}\\s*(${s[o.LOOSEPLAIN]}|${s[o.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",u("HYPHENRANGE",`^\\s*(${s[o.XRANGEPLAIN]})\\s+-\\s+(${s[o.XRANGEPLAIN]})\\s*$`),u("HYPHENRANGELOOSE",`^\\s*(${s[o.XRANGEPLAINLOOSE]})\\s+-\\s+(${s[o.XRANGEPLAINLOOSE]})\\s*$`),u("STAR","(<|>)?=?\\s*\\*"),u("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),u("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")})(Wv,Wv.exports);var RF=Wv.exports;const _5=/^[0-9]+$/,gP=(e,t)=>{const n=_5.test(e),i=_5.test(t);return n&&i&&(e=+e,t=+t),e===t?0:n&&!i?-1:i&&!n?1:e<t?-1:1},cwe=(e,t)=>gP(t,e);var fwe={compareIdentifiers:gP,rcompareIdentifiers:cwe};const Y0=Ry,{MAX_LENGTH:k5,MAX_SAFE_INTEGER:X0}=BF,{re:M5,t:O5}=RF,dwe=TF,{compareIdentifiers:Hu}=fwe;let hwe=class sr{constructor(t,n){if(n=dwe(n),t instanceof sr){if(t.loose===!!n.loose&&t.includePrerelease===!!n.includePrerelease)return t;t=t.version}else if(typeof t!="string")throw new TypeError(`Invalid Version: ${t}`);if(t.length>k5)throw new TypeError(`version is longer than ${k5} characters`);Y0("SemVer",t,n),this.options=n,this.loose=!!n.loose,this.includePrerelease=!!n.includePrerelease;const i=t.trim().match(n.loose?M5[O5.LOOSE]:M5[O5.FULL]);if(!i)throw new TypeError(`Invalid Version: ${t}`);if(this.raw=t,this.major=+i[1],this.minor=+i[2],this.patch=+i[3],this.major>X0||this.major<0)throw new TypeError("Invalid major version");if(this.minor>X0||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>X0||this.patch<0)throw new TypeError("Invalid patch version");i[4]?this.prerelease=i[4].split(".").map(r=>{if(/^[0-9]+$/.test(r)){const s=+r;if(s>=0&&s<X0)return s}return r}):this.prerelease=[],this.build=i[5]?i[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(t){if(Y0("SemVer.compare",this.version,this.options,t),!(t instanceof sr)){if(typeof t=="string"&&t===this.version)return 0;t=new sr(t,this.options)}return t.version===this.version?0:this.compareMain(t)||this.comparePre(t)}compareMain(t){return t instanceof sr||(t=new sr(t,this.options)),Hu(this.major,t.major)||Hu(this.minor,t.minor)||Hu(this.patch,t.patch)}comparePre(t){if(t instanceof sr||(t=new sr(t,this.options)),this.prerelease.length&&!t.prerelease.length)return-1;if(!this.prerelease.length&&t.prerelease.length)return 1;if(!this.prerelease.length&&!t.prerelease.length)return 0;let n=0;do{const i=this.prerelease[n],r=t.prerelease[n];if(Y0("prerelease compare",n,i,r),i===void 0&&r===void 0)return 0;if(r===void 0)return 1;if(i===void 0)return-1;if(i===r)continue;return Hu(i,r)}while(++n)}compareBuild(t){t instanceof sr||(t=new sr(t,this.options));let n=0;do{const i=this.build[n],r=t.build[n];if(Y0("prerelease compare",n,i,r),i===void 0&&r===void 0)return 0;if(r===void 0)return 1;if(i===void 0)return-1;if(i===r)continue;return Hu(i,r)}while(++n)}inc(t,n,i){switch(t){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",n,i);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",n,i);break;case"prepatch":this.prerelease.length=0,this.inc("patch",n,i),this.inc("pre",n,i);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",n,i),this.inc("pre",n,i);break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":if(this.prerelease.length===0)this.prerelease=[0];else{let r=this.prerelease.length;for(;--r>=0;)typeof this.prerelease[r]=="number"&&(this.prerelease[r]++,r=-2);r===-1&&this.prerelease.push(0)}if(n){const r=Number(i)?1:0;Hu(this.prerelease[0],n)===0?isNaN(this.prerelease[1])&&(this.prerelease=[n,r]):this.prerelease=[n,r]}break;default:throw new Error(`invalid increment argument: ${t}`)}return this.format(),this.raw=this.version,this}};var LF=hwe;const N5=LF,gwe=(e,t,n)=>new N5(e,n).compare(new N5(t,n));var jc=gwe;const pwe=jc,mwe=(e,t,n)=>pwe(e,t,n)===0;var ywe=mwe;const bwe=jc,xwe=(e,t,n)=>bwe(e,t,n)!==0;var vwe=xwe;const Awe=jc,Ewe=(e,t,n)=>Awe(e,t,n)>0;var wwe=Ewe;const $we=jc,Cwe=(e,t,n)=>$we(e,t,n)>=0;var Fwe=Cwe;const Swe=jc,Dwe=(e,t,n)=>Swe(e,t,n)<0;var _we=Dwe;const kwe=jc,Mwe=(e,t,n)=>kwe(e,t,n)<=0;var Owe=Mwe;const Nwe=ywe,Twe=vwe,Bwe=wwe,Rwe=Fwe,Lwe=_we,Pwe=Owe,Iwe=(e,t,n,i)=>{switch(t){case"===":return typeof e=="object"&&(e=e.version),typeof n=="object"&&(n=n.version),e===n;case"!==":return typeof e=="object"&&(e=e.version),typeof n=="object"&&(n=n.version),e!==n;case"":case"=":case"==":return Nwe(e,n,i);case"!=":return Twe(e,n,i);case">":return Bwe(e,n,i);case">=":return Rwe(e,n,i);case"<":return Lwe(e,n,i);case"<=":return Pwe(e,n,i);default:throw new TypeError(`Invalid operator: ${t}`)}};var zwe=Iwe,b2,T5;function jwe(){if(T5)return b2;T5=1;const e=Symbol("SemVer ANY");class t{static get ANY(){return e}constructor(c,f){if(f=n(f),c instanceof t){if(c.loose===!!f.loose)return c;c=c.value}o("comparator",c,f),this.options=f,this.loose=!!f.loose,this.parse(c),this.semver===e?this.value="":this.value=this.operator+this.semver.version,o("comp",this)}parse(c){const f=this.options.loose?i[r.COMPARATORLOOSE]:i[r.COMPARATOR],d=c.match(f);if(!d)throw new TypeError(`Invalid comparator: ${c}`);this.operator=d[1]!==void 0?d[1]:"",this.operator==="="&&(this.operator=""),d[2]?this.semver=new a(d[2],this.options.loose):this.semver=e}toString(){return this.value}test(c){if(o("Comparator.test",c,this.options.loose),this.semver===e||c===e)return!0;if(typeof c=="string")try{c=new a(c,this.options)}catch{return!1}return s(c,this.operator,this.semver,this.options)}intersects(c,f){if(!(c instanceof t))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new u(c.value,f).test(this.value):c.operator===""?c.value===""?!0:new u(this.value,f).test(c.semver):(f=n(f),f.includePrerelease&&(this.value==="<0.0.0-0"||c.value==="<0.0.0-0")||!f.includePrerelease&&(this.value.startsWith("<0.0.0")||c.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&c.operator.startsWith(">")||this.operator.startsWith("<")&&c.operator.startsWith("<")||this.semver.version===c.semver.version&&this.operator.includes("=")&&c.operator.includes("=")||s(this.semver,"<",c.semver,f)&&this.operator.startsWith(">")&&c.operator.startsWith("<")||s(this.semver,">",c.semver,f)&&this.operator.startsWith("<")&&c.operator.startsWith(">")))}}b2=t;const n=TF,{re:i,t:r}=RF,s=zwe,o=Ry,a=LF,u=pP();return b2}var x2,B5;function pP(){if(B5)return x2;B5=1;class e{constructor(_,S){if(S=i(S),_ instanceof e)return _.loose===!!S.loose&&_.includePrerelease===!!S.includePrerelease?_:new e(_.raw,S);if(_ instanceof r)return this.raw=_.value,this.set=[[_]],this.format(),this;if(this.options=S,this.loose=!!S.loose,this.includePrerelease=!!S.includePrerelease,this.raw=_,this.set=_.split("||").map(M=>this.parseRange(M.trim())).filter(M=>M.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${_}`);if(this.set.length>1){const M=this.set[0];if(this.set=this.set.filter(O=>!g(O[0])),this.set.length===0)this.set=[M];else if(this.set.length>1){for(const O of this.set)if(O.length===1&&p(O[0])){this.set=[O];break}}}this.format()}format(){return this.range=this.set.map(_=>_.join(" ").trim()).join("||").trim(),this.range}toString(){return this.range}parseRange(_){_=_.trim();const M=((this.options.includePrerelease&&d)|(this.options.loose&&h))+":"+_,O=n.get(M);if(O)return O;const B=this.options.loose,I=B?a[u.HYPHENRANGELOOSE]:a[u.HYPHENRANGE];_=_.replace(I,D(this.options.includePrerelease)),s("hyphen replace",_),_=_.replace(a[u.COMPARATORTRIM],l),s("comparator trim",_),_=_.replace(a[u.TILDETRIM],c),_=_.replace(a[u.CARETTRIM],f),_=_.split(/\s+/).join(" ");let G=_.split(" ").map(ve=>y(ve,this.options)).join(" ").split(/\s+/).map(ve=>F(ve,this.options));B&&(G=G.filter(ve=>(s("loose invalid filter",ve,this.options),!!ve.match(a[u.COMPARATORLOOSE])))),s("range list",G);const J=new Map,oe=G.map(ve=>new r(ve,this.options));for(const ve of oe){if(g(ve))return[ve];J.set(ve.value,ve)}J.size>1&&J.has("")&&J.delete("");const be=[...J.values()];return n.set(M,be),be}intersects(_,S){if(!(_ instanceof e))throw new TypeError("a Range is required");return this.set.some(M=>m(M,S)&&_.set.some(O=>m(O,S)&&M.every(B=>O.every(I=>B.intersects(I,S)))))}test(_){if(!_)return!1;if(typeof _=="string")try{_=new o(_,this.options)}catch{return!1}for(let S=0;S<this.set.length;S++)if(T(this.set[S],_,this.options))return!0;return!1}}x2=e;const t=ewe,n=new t({max:1e3}),i=TF,r=jwe(),s=Ry,o=LF,{re:a,t:u,comparatorTrimReplace:l,tildeTrimReplace:c,caretTrimReplace:f}=RF,{FLAG_INCLUDE_PRERELEASE:d,FLAG_LOOSE:h}=BF,g=C=>C.value==="<0.0.0-0",p=C=>C.value==="",m=(C,_)=>{let S=!0;const M=C.slice();let O=M.pop();for(;S&&M.length;)S=M.every(B=>O.intersects(B,_)),O=M.pop();return S},y=(C,_)=>(s("comp",C,_),C=A(C,_),s("caret",C),C=x(C,_),s("tildes",C),C=E(C,_),s("xrange",C),C=k(C,_),s("stars",C),C),b=C=>!C||C.toLowerCase()==="x"||C==="*",x=(C,_)=>C.trim().split(/\s+/).map(S=>v(S,_)).join(" "),v=(C,_)=>{const S=_.loose?a[u.TILDELOOSE]:a[u.TILDE];return C.replace(S,(M,O,B,I,G)=>{s("tilde",C,M,O,B,I,G);let J;return b(O)?J="":b(B)?J=`>=${O}.0.0 <${+O+1}.0.0-0`:b(I)?J=`>=${O}.${B}.0 <${O}.${+B+1}.0-0`:G?(s("replaceTilde pr",G),J=`>=${O}.${B}.${I}-${G} <${O}.${+B+1}.0-0`):J=`>=${O}.${B}.${I} <${O}.${+B+1}.0-0`,s("tilde return",J),J})},A=(C,_)=>C.trim().split(/\s+/).map(S=>w(S,_)).join(" "),w=(C,_)=>{s("caret",C,_);const S=_.loose?a[u.CARETLOOSE]:a[u.CARET],M=_.includePrerelease?"-0":"";return C.replace(S,(O,B,I,G,J)=>{s("caret",C,O,B,I,G,J);let oe;return b(B)?oe="":b(I)?oe=`>=${B}.0.0${M} <${+B+1}.0.0-0`:b(G)?B==="0"?oe=`>=${B}.${I}.0${M} <${B}.${+I+1}.0-0`:oe=`>=${B}.${I}.0${M} <${+B+1}.0.0-0`:J?(s("replaceCaret pr",J),B==="0"?I==="0"?oe=`>=${B}.${I}.${G}-${J} <${B}.${I}.${+G+1}-0`:oe=`>=${B}.${I}.${G}-${J} <${B}.${+I+1}.0-0`:oe=`>=${B}.${I}.${G}-${J} <${+B+1}.0.0-0`):(s("no pr"),B==="0"?I==="0"?oe=`>=${B}.${I}.${G}${M} <${B}.${I}.${+G+1}-0`:oe=`>=${B}.${I}.${G}${M} <${B}.${+I+1}.0-0`:oe=`>=${B}.${I}.${G} <${+B+1}.0.0-0`),s("caret return",oe),oe})},E=(C,_)=>(s("replaceXRanges",C,_),C.split(/\s+/).map(S=>$(S,_)).join(" ")),$=(C,_)=>{C=C.trim();const S=_.loose?a[u.XRANGELOOSE]:a[u.XRANGE];return C.replace(S,(M,O,B,I,G,J)=>{s("xRange",C,M,O,B,I,G,J);const oe=b(B),be=oe||b(I),ve=be||b(G),Pe=ve;return O==="="&&Pe&&(O=""),J=_.includePrerelease?"-0":"",oe?O===">"||O==="<"?M="<0.0.0-0":M="*":O&&Pe?(be&&(I=0),G=0,O===">"?(O=">=",be?(B=+B+1,I=0,G=0):(I=+I+1,G=0)):O==="<="&&(O="<",be?B=+B+1:I=+I+1),O==="<"&&(J="-0"),M=`${O+B}.${I}.${G}${J}`):be?M=`>=${B}.0.0${J} <${+B+1}.0.0-0`:ve&&(M=`>=${B}.${I}.0${J} <${B}.${+I+1}.0-0`),s("xRange return",M),M})},k=(C,_)=>(s("replaceStars",C,_),C.trim().replace(a[u.STAR],"")),F=(C,_)=>(s("replaceGTE0",C,_),C.trim().replace(a[_.includePrerelease?u.GTE0PRE:u.GTE0],"")),D=C=>(_,S,M,O,B,I,G,J,oe,be,ve,Pe,ta)=>(b(M)?S="":b(O)?S=`>=${M}.0.0${C?"-0":""}`:b(B)?S=`>=${M}.${O}.0${C?"-0":""}`:I?S=`>=${S}`:S=`>=${S}${C?"-0":""}`,b(oe)?J="":b(be)?J=`<${+oe+1}.0.0-0`:b(ve)?J=`<${oe}.${+be+1}.0-0`:Pe?J=`<=${oe}.${be}.${ve}-${Pe}`:C?J=`<${oe}.${be}.${+ve+1}-0`:J=`<=${J}`,`${S} ${J}`.trim()),T=(C,_,S)=>{for(let M=0;M<C.length;M++)if(!C[M].test(_))return!1;if(_.prerelease.length&&!S.includePrerelease){for(let M=0;M<C.length;M++)if(s(C[M].semver),C[M].semver!==r.ANY&&C[M].semver.prerelease.length>0){const O=C[M].semver;if(O.major===_.major&&O.minor===_.minor&&O.patch===_.patch)return!0}return!1}return!0};return x2}const Uwe=pP(),qwe=(e,t,n)=>{try{t=new Uwe(t,n)}catch{return!1}return t.test(e)};var Wwe=qwe,mP=GEe(Wwe);function Gwe(e,t,n){const i=e.open(t),r=1e4,s=250,{origin:o}=new URL(t);let a=~~(r/s);function u(c){c.source===i&&(a=0,e.removeEventListener("message",u,!1))}e.addEventListener("message",u,!1);function l(){a<=0||(i.postMessage(n,o),setTimeout(l,s),a-=1)}setTimeout(l,s)}var Hwe=`.vega-embed {
position: relative;
display: inline-block;
box-sizing: border-box;
}
.vega-embed.has-actions {
padding-right: 38px;
}
.vega-embed details:not([open]) > :not(summary) {
display: none !important;
}
.vega-embed summary {
list-style: none;
position: absolute;
top: 0;
right: 0;
padding: 6px;
z-index: 1000;
background: white;
box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.1);
color: #1b1e23;
border: 1px solid #aaa;
border-radius: 999px;
opacity: 0.2;
transition: opacity 0.4s ease-in;
cursor: pointer;
line-height: 0px;
}
.vega-embed summary::-webkit-details-marker {
display: none;
}
.vega-embed summary:active {
box-shadow: #aaa 0px 0px 0px 1px inset;
}
.vega-embed summary svg {
width: 14px;
height: 14px;
}
.vega-embed details[open] summary {
opacity: 0.7;
}
.vega-embed:hover summary, .vega-embed:focus-within summary {
opacity: 1 !important;
transition: opacity 0.2s ease;
}
.vega-embed .vega-actions {
position: absolute;
z-index: 1001;
top: 35px;
right: -9px;
display: flex;
flex-direction: column;
padding-bottom: 8px;
padding-top: 8px;
border-radius: 4px;
box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.2);
border: 1px solid #d9d9d9;
background: white;
animation-duration: 0.15s;
animation-name: scale-in;
animation-timing-function: cubic-bezier(0.2, 0, 0.13, 1.5);
text-align: left;
}
.vega-embed .vega-actions a {
padding: 8px 16px;
font-family: sans-serif;
font-size: 14px;
font-weight: 600;
white-space: nowrap;
color: #434a56;
text-decoration: none;
}
.vega-embed .vega-actions a:hover, .vega-embed .vega-actions a:focus {
background-color: #f7f7f9;
color: black;
}
.vega-embed .vega-actions::before, .vega-embed .vega-actions::after {
content: "";
display: inline-block;
position: absolute;
}
.vega-embed .vega-actions::before {
left: auto;
right: 14px;
top: -16px;
border: 8px solid rgba(0, 0, 0, 0);
border-bottom-color: #d9d9d9;
}
.vega-embed .vega-actions::after {
left: auto;
right: 15px;
top: -14px;
border: 7px solid rgba(0, 0, 0, 0);
border-bottom-color: #fff;
}
.vega-embed .chart-wrapper.fit-x {
width: 100%;
}
.vega-embed .chart-wrapper.fit-y {
height: 100%;
}
.vega-embed-wrapper {
max-width: 100%;
overflow: auto;
padding-right: 14px;
}
@keyframes scale-in {
from {
opacity: 0;
transform: scale(0.6);
}
to {
opacity: 1;
transform: scale(1);
}
}
`;function yP(e,...t){for(const n of t)Vwe(e,n);return e}function Vwe(e,t){for(const n of Object.keys(t))wm(e,n,t[n],!0)}function R5(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),n.push.apply(n,i)}return n}function po(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?R5(Object(n),!0).forEach(function(i){WEe(e,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):R5(Object(n)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(n,i))})}return e}const Fi=n0e;let ah=CAe;const K0=typeof window<"u"?window:void 0;var j5;ah===void 0&&((j5=K0==null?void 0:K0.vl)!=null&&j5.compile)&&(ah=K0.vl);const Ywe={export:{svg:!0,png:!0},source:!0,compiled:!0,editor:!0},Xwe={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"},zf={vega:"Vega","vega-lite":"Vega-Lite"},vm={vega:Fi.version,"vega-lite":ah?ah.version:"not available"},Kwe={vega:e=>e,"vega-lite":(e,t)=>ah.compile(e,{config:t}).spec},Jwe=`
<svg viewBox="0 0 16 16" fill="currentColor" stroke="none" stroke-width="1" stroke-linecap="round" stroke-linejoin="round">
<circle r="2" cy="8" cx="2"></circle>
<circle r="2" cy="8" cx="8"></circle>
<circle r="2" cy="8" cx="14"></circle>
</svg>`,Qwe="chart-wrapper";function Zwe(e){return typeof e=="function"}function L5(e,t,n,i){const r=`<html><head>${t}</head><body><pre><code class="json">`,s=`</code></pre>${n}</body></html>`,o=window.open("");o.document.write(r+e+s),o.document.title=`${zf[i]} JSON Source`}function e$e(e,t){if(e.$schema){const n=lP(e.$schema);t&&t!==n.library&&console.warn(`The given visualization spec is written in ${zf[n.library]}, but mode argument sets ${zf[t]??t}.`);const i=n.library;return mP(vm[i],`^${n.version.slice(1)}`)||console.warn(`The input spec uses ${zf[i]} ${n.version}, but the current version of ${zf[i]} is v${vm[i]}.`),i}return"mark"in e||"encoding"in e||"layer"in e||"hconcat"in e||"vconcat"in e||"facet"in e||"repeat"in e?"vega-lite":"marks"in e||"signals"in e||"scales"in e||"axes"in e?"vega":t??"vega"}function t$e(e){return!!(e&&"load"in e)}function P5(e){return t$e(e)?e:Fi.loader(e)}function n$e(e){var n;const t=((n=e.usermeta)==null?void 0:n.embedOptions)??{};return Pi(t.defaultStyle)&&(t.defaultStyle=!1),t}async function i$e(e,t,n={}){let i,r;Pi(t)?(r=P5(n.loader),i=JSON.parse(await r.load(t))):i=t;const s=n$e(i),o=s.loader;(!r||o)&&(r=P5(n.loader??o));const a=await I5(s,r),u=await I5(n,r),l=po(po({},yP(u,a)),{},{config:Qv(u.config??{},a.config??{})});return await s$e(e,i,l,r)}async function I5(e,t){const n=Pi(e.config)?JSON.parse(await t.load(e.config)):e.config??{},i=Pi(e.patch)?JSON.parse(await t.load(e.patch)):e.patch;return po(po(po({},e),i?{patch:i}:{}),n?{config:n}:{})}function r$e(e){const t=e.getRootNode?e.getRootNode():document;return t instanceof ShadowRoot?{root:t,rootContainer:t}:{root:document,rootContainer:document.head??document.body}}async function s$e(e,t,n={},i){const r=n.theme?Qv(vEe[n.theme],n.config??{}):n.config,s=n6(n.actions)?n.actions:yP({},Ywe,n.actions??{}),o=po(po({},Xwe),n.i18n),a=n.renderer??"canvas",u=n.logLevel??Fi.Warn,l=n.downloadFileName??"visualization",c=typeof e=="string"?document.querySelector(e):e;if(!c)throw new Error(`${e} does not exist`);if(n.defaultStyle!==!1){const A="vega-embed-style",{root:w,rootContainer:E}=r$e(c);if(!w.getElementById(A)){const $=document.createElement("style");$.id=A,$.innerHTML=n.defaultStyle===void 0||n.defaultStyle===!0?Hwe.toString():n.defaultStyle,E.appendChild($)}}const f=e$e(t,n.mode);let d=Kwe[f](t,r);if(f==="vega-lite"&&d.$schema){const A=lP(d.$schema);mP(vm.vega,`^${A.version.slice(1)}`)||console.warn(`The compiled spec uses Vega ${A.version}, but current version is v${vm.vega}.`)}c.classList.add("vega-embed"),s&&c.classList.add("has-actions"),c.innerHTML="";let h=c;if(s){const A=document.createElement("div");A.classList.add(Qwe),c.appendChild(A),h=A}const g=n.patch;if(g&&(d=g instanceof Function?g(d):Em(d,g,!0,!1).newDocument),n.formatLocale&&Fi.formatLocale(n.formatLocale),n.timeFormatLocale&&Fi.timeFormatLocale(n.timeFormatLocale),n.expressionFunctions)for(const A in n.expressionFunctions){const w=n.expressionFunctions[A];"fn"in w?Fi.expressionFunction(A,w.fn,w.visitor):w instanceof Function&&Fi.expressionFunction(A,w)}const{ast:p}=n,m=Fi.parse(d,f==="vega-lite"?{}:r,{ast:p}),y=new(n.viewClass||Fi.View)(m,po({loader:i,logLevel:u,renderer:a},p?{expr:Fi.expressionInterpreter??n.expr??d0e}:{}));if(y.addSignalListener("autosize",(A,w)=>{const{type:E}=w;E=="fit-x"?(h.classList.add("fit-x"),h.classList.remove("fit-y")):E=="fit-y"?(h.classList.remove("fit-x"),h.classList.add("fit-y")):E=="fit"?h.classList.add("fit-x","fit-y"):h.classList.remove("fit-x","fit-y")}),n.tooltip!==!1){const A=Zwe(n.tooltip)?n.tooltip:new jEe(n.tooltip===!0?{}:n.tooltip).call;y.tooltip(A)}let{hover:b}=n;if(b===void 0&&(b=f==="vega"),b){const{hoverSet:A,updateSet:w}=typeof b=="boolean"?{}:b;y.hover(A,w)}n&&(n.width!=null&&y.width(n.width),n.height!=null&&y.height(n.height),n.padding!=null&&y.padding(n.padding)),await y.initialize(h,n.bind).runAsync();let x;if(s!==!1){let A=c;if(n.defaultStyle!==!1){const E=document.createElement("details");E.title=o.CLICK_TO_VIEW_ACTIONS,c.append(E),A=E;const $=document.createElement("summary");$.innerHTML=Jwe,E.append($),x=k=>{E.contains(k.target)||E.removeAttribute("open")},document.addEventListener("click",x)}const w=document.createElement("div");if(A.append(w),w.classList.add("vega-actions"),s===!0||s.export!==!1){for(const E of["svg","png"])if(s===!0||s.export===!0||s.export[E]){const $=o[`${E.toUpperCase()}_ACTION`],k=document.createElement("a"),F=gl(n.scaleFactor)?n.scaleFactor[E]:n.scaleFactor;k.text=$,k.href="#",k.target="_blank",k.download=`${l}.${E}`,k.addEventListener("mousedown",async function(D){D.preventDefault();const T=await y.toImageURL(E,F);this.href=T}),w.append(k)}}if(s===!0||s.source!==!1){const E=document.createElement("a");E.text=o.SOURCE_ACTION,E.href="#",E.addEventListener("click",function($){L5(Ly(t),n.sourceHeader??"",n.sourceFooter??"",f),$.preventDefault()}),w.append(E)}if(f==="vega-lite"&&(s===!0||s.compiled!==!1)){const E=document.createElement("a");E.text=o.COMPILED_ACTION,E.href="#",E.addEventListener("click",function($){L5(Ly(d),n.sourceHeader??"",n.sourceFooter??"","vega"),$.preventDefault()}),w.append(E)}if(s===!0||s.editor!==!1){const E=n.editorUrl??"https://vega.github.io/editor/",$=document.createElement("a");$.text=o.EDITOR_ACTION,$.href="#",$.addEventListener("click",function(k){Gwe(window,E,{config:r,mode:f,renderer:a,spec:Ly(t)}),k.preventDefault()}),w.append($)}}function v(){x&&document.removeEventListener("click",x),y.finalize()}return{view:y,spec:t,vgSpec:d,finalize:v,embedOptions:n}}function o$e(e){return!!e&&{}.toString.call(e)==="[object Function]"}function a$e(e,t,n){n&&(o$e(n)?n(e.data(t)):e.change(t,Fi.changeset().remove(()=>!0).insert(n)))}function u$e(e,t){Object.keys(t).forEach(n=>{a$e(e,n,t[n])})}function bP(e){const t=new Set;return e.forEach(n=>{Object.keys(n).forEach(i=>{t.add(i)})}),t}const xP=()=>{};function v2(e,t){const n=Object.keys(t);return n.forEach(i=>{try{e.addSignalListener(i,t[i])}catch(r){console.warn("Cannot add invalid signal listener.",r)}}),n.length>0}function l$e(e,t){if(e===t)return!1;const n={width:!1,height:!1,isExpensive:!1},i=bP([e,t]);return i.has("width")&&(!("width"in e)||!("width"in t)||e.width!==t.width)&&("width"in e&&typeof e.width=="number"?n.width=e.width:n.isExpensive=!0),i.has("height")&&(!("height"in e)||!("height"in t)||e.height!==t.height)&&("height"in e&&typeof e.height=="number"?n.height=e.height:n.isExpensive=!0),i.delete("width"),i.delete("height"),[...i].some(r=>!(r in e)||!(r in t)||!VB(e[r],t[r]))&&(n.isExpensive=!0),n.width!==!1||n.height!==!1||n.isExpensive?n:!1}function z5(e,t){const n=Object.keys(t);return n.forEach(i=>{try{e.removeSignalListener(i,t[i])}catch(r){console.warn("Cannot remove invalid signal listener.",r)}}),n.length>0}function A2(e){const{spec:t,width:n,height:i}=e;return typeof n<"u"&&typeof i<"u"?{...t,width:n,height:i}:typeof n<"u"?{...t,width:n}:typeof i<"u"?{...t,height:i}:t}function jf(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class vP extends tl.PureComponent{constructor(){super(...arguments),jf(this,"containerRef",tl.createRef()),jf(this,"resultPromise",void 0),jf(this,"handleError",t=>{const{onError:n=xP}=this.props;n(t,this.containerRef.current),console.warn(t)}),jf(this,"modifyView",t=>{this.resultPromise&&this.resultPromise.then(n=>(n&&t(n.view),!0)).catch(this.handleError)})}componentDidMount(){this.createView()}componentDidUpdate(t){const n=bP([this.props,t]);if(n.delete("className"),n.delete("signalListeners"),n.delete("spec"),n.delete("style"),n.delete("width"),n.delete("height"),Array.from(n).some(i=>this.props[i]!==t[i]))this.clearView(),this.createView();else{const i=l$e(A2(this.props),A2(t)),{signalListeners:r}=this.props,{signalListeners:s}=t;if(i)if(i.isExpensive)this.clearView(),this.createView();else{const o=!E2(r,s);this.modifyView(a=>{i.width!==!1&&a.width(i.width),i.height!==!1&&a.height(i.height),o&&(s&&z5(a,s),r&&v2(a,r)),a.run()})}else E2(r,s)||this.modifyView(o=>{s&&z5(o,s),r&&v2(o,r),o.run()})}}componentWillUnmount(){this.clearView()}createView(){const{spec:t,onNewView:n,signalListeners:i={},width:r,height:s,...o}=this.props;if(this.containerRef.current){const a=A2(this.props);this.resultPromise=i$e(this.containerRef.current,a,o).then(u=>{if(u){const{view:l}=u;v2(l,i)&&l.run()}return u}).catch(this.handleError),n&&this.modifyView(n)}}clearView(){return this.resultPromise&&this.resultPromise.then(t=>{t&&t.finalize()}).catch(this.handleError),this.resultPromise=void 0,this}render(){const{className:t,style:n}=this.props;return tl.createElement("div",{ref:this.containerRef,className:t,style:n})}}jf(vP,"propTypes",{className:IF.string,onError:IF.func});function Gv(){return Gv=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},Gv.apply(this,arguments)}function Hv(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const c$e={};class f$e extends tl.PureComponent{constructor(){super(...arguments),Hv(this,"vegaEmbed",tl.createRef()),Hv(this,"handleNewView",t=>{this.update();const{onNewView:n=xP}=this.props;n(t)})}componentDidMount(){this.update()}componentDidUpdate(t){E2(this.props.data,t.data)||this.update()}update(){const{data:t}=this.props;this.vegaEmbed.current&&t&&Object.keys(t).length>0&&this.vegaEmbed.current.modifyView(n=>{u$e(n,t),n.resize().run()})}render(){const{data:t,...n}=this.props;return tl.createElement(vP,Gv({ref:this.vegaEmbed},n,{onNewView:this.handleNewView}))}}Hv(f$e,"defaultProps",{data:c$e});export{f$e as V};
//# sourceMappingURL=Vega-d925c94f.js.map