@antv/g2 5.3.4-alpha.0 → 5.3.4-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -64,4 +64,4 @@ function JS(t,e){var n=e.cx,r=void 0===n?0:n,i=e.cy,a=void 0===i?0:i,o=e.r;t.arc
64
64
  * @date 5/9/2025, 8:22:49 AM
65
65
  * @author AntVis
66
66
  * @docs https://g.antv.antgroup.com/
67
- */d_.tag="Dragndrop";var p_=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return sl(this,e),(t=vl(this,e)).name="dragndrop",t.options=n,t}return yl(e,t),ll(e,[{key:"init",value:function(){this.addRenderingPlugin(new d_(ol({overlap:"pointer",isDocumentDraggable:!1,isDocumentDroppable:!1,dragstartDistanceThreshold:0,dragstartTimeThreshold:0},this.options)))}},{key:"destroy",value:function(){this.removeAllRenderingPlugins()}},{key:"setOptions",value:function(t){Object.assign(this.plugins[0].dragndropPluginOptions,t)}}])}(Zl),g_=function(){function t(){this._events={}}return t.prototype.on=function(t,e,n){return this._events[t]||(this._events[t]=[]),this._events[t].push({callback:e,once:!!n}),this},t.prototype.once=function(t,e){return this.on(t,e,!0)},t.prototype.emit=function(t){for(var e=this,n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];var i=this._events[t]||[],a=this._events["*"]||[],o=function(r){for(var i=r.length,a=0;a<i;a++)if(r[a]){var o=r[a],s=o.callback;o.once&&(r.splice(a,1),0===r.length&&delete e._events[t],i--,a--),s.apply(e,n)}};o(i),o(a)},t.prototype.off=function(t,e){if(t)if(e){for(var n=this._events[t]||[],r=n.length,i=0;i<r;i++)n[i].callback===e&&(n.splice(i,1),r--,i--);0===n.length&&delete this._events[t]}else delete this._events[t];else this._events={};return this},t.prototype.getEvents=function(){return this._events},t}(),v_=g_;const m_={BEFORE_RENDER:"beforerender",AFTER_RENDER:"afterrender",BEFORE_PAINT:"beforepaint",AFTER_PAINT:"afterpaint",BEFORE_CHANGE_DATA:"beforechangedata",AFTER_CHANGE_DATA:"afterchangedata",BEFORE_CLEAR:"beforeclear",AFTER_CLEAR:"afterclear",BEFORE_DESTROY:"beforedestroy",AFTER_DESTROY:"afterdestroy",BEFORE_CHANGE_SIZE:"beforechangesize",AFTER_CHANGE_SIZE:"afterchangesize",POINTER_TAP:"pointertap",POINTER_DOWN:"pointerdown",POINTER_UP:"pointerup",POINTER_OVER:"pointerover",POINTER_OUT:"pointerout",POINTER_MOVE:"pointermove",POINTER_ENTER:"pointerenter",POINTER_LEAVE:"pointerleave",POINTER_UPOUTSIDE:"pointerupoutside",DRAG_START:"dragstart",DRAG:"drag",DRAG_END:"dragend",DRAG_ENTER:"dragenter",DRAG_LEAVE:"dragleave",DRAG_OVER:"dragover",DROP:"DROP",CLICK:"click",DBLCLICK:"dblclick"},y_={abs:Math.abs,ceil:Math.ceil,floor:Math.floor,max:Math.max,min:Math.min,round:Math.round,sqrt:Math.sqrt,pow:Math.pow};class b_ extends Error{constructor(t,e,n){super(t),this.position=e,this.token=n,this.name="ExpressionError"}}var x_;!function(t){t[t.STRING=0]="STRING",t[t.NUMBER=1]="NUMBER",t[t.BOOLEAN=2]="BOOLEAN",t[t.NULL=3]="NULL",t[t.IDENTIFIER=4]="IDENTIFIER",t[t.OPERATOR=5]="OPERATOR",t[t.FUNCTION=6]="FUNCTION",t[t.DOT=7]="DOT",t[t.BRACKET_LEFT=8]="BRACKET_LEFT",t[t.BRACKET_RIGHT=9]="BRACKET_RIGHT",t[t.PAREN_LEFT=10]="PAREN_LEFT",t[t.PAREN_RIGHT=11]="PAREN_RIGHT",t[t.COMMA=12]="COMMA",t[t.QUESTION=13]="QUESTION",t[t.COLON=14]="COLON",t[t.DOLLAR=15]="DOLLAR"}(x_||(x_={}));const w_=new Set([32,9,10,13]),k_=new Set([43,45,42,47,37,33,38,124,61,60,62]),E_=new Map([["true",x_.BOOLEAN],["false",x_.BOOLEAN],["null",x_.NULL]]),M_=new Map([["===",!0],["!==",!0],["<=",!0],[">=",!0],["&&",!0],["||",!0],["+",!0],["-",!0],["*",!0],["/",!0],["%",!0],["!",!0],["<",!0],[">",!0]]),O_=new Map([[46,x_.DOT],[91,x_.BRACKET_LEFT],[93,x_.BRACKET_RIGHT],[40,x_.PAREN_LEFT],[41,x_.PAREN_RIGHT],[44,x_.COMMA],[63,x_.QUESTION],[58,x_.COLON],[36,x_.DOLLAR]]),S_=new Map;for(const[t,e]of O_.entries())S_.set(t,{type:e,value:String.fromCharCode(t)});function A_(t){return t>=48&&t<=57}function __(t){return t>=97&&t<=122||t>=65&&t<=90||95===t}function T_(t){return __(t)||A_(t)}function P_(t){return k_.has(t)}var C_;!function(t){t[t.Program=0]="Program",t[t.Literal=1]="Literal",t[t.Identifier=2]="Identifier",t[t.MemberExpression=3]="MemberExpression",t[t.CallExpression=4]="CallExpression",t[t.BinaryExpression=5]="BinaryExpression",t[t.UnaryExpression=6]="UnaryExpression",t[t.ConditionalExpression=7]="ConditionalExpression"}(C_||(C_={}));const N_=new Map([["||",2],["&&",3],["===",4],["!==",4],[">",5],[">=",5],["<",5],["<=",5],["+",6],["-",6],["*",7],["/",7],["%",7],["!",8]]),L_={type:C_.Literal,value:null},j_={type:C_.Literal,value:!0},R_={type:C_.Literal,value:!1},I_=t=>{let e=0;const n=t.length,r=()=>e>=n?null:t[e],i=()=>t[e++],a=t=>{const e=r();return null!==e&&e.type===t},o=t=>t.type===x_.OPERATOR?N_.get(t.value)||-1:t.type===x_.DOT||t.type===x_.BRACKET_LEFT?9:t.type===x_.QUESTION?1:-1,s=t=>{let n,o;if(i().type===x_.DOT){if(!a(x_.IDENTIFIER)){const t=r();throw new b_("Expected property name",e,t?t.value:"<end of input>")}const t=i();n={type:C_.Identifier,name:t.value},o=!1}else{if(n=l(0),!a(x_.BRACKET_RIGHT)){const t=r();throw new b_("Expected closing bracket",e,t?t.value:"<end of input>")}i(),o=!0}return{type:C_.MemberExpression,object:t,property:n,computed:o}},c=()=>{const t=r();if(!t)throw new b_("Unexpected end of input",e,"<end of input>");if(t.type===x_.OPERATOR&&("!"===t.value||"-"===t.value)){i();const e=c();return{type:C_.UnaryExpression,operator:t.value,argument:e,prefix:!0}}switch(t.type){case x_.NUMBER:return i(),{type:C_.Literal,value:Number(t.value)};case x_.STRING:return i(),{type:C_.Literal,value:t.value};case x_.BOOLEAN:return i(),"true"===t.value?j_:R_;case x_.NULL:return i(),L_;case x_.IDENTIFIER:return i(),{type:C_.Identifier,name:t.value};case x_.FUNCTION:return(()=>{const t=i(),n=[];if(!a(x_.PAREN_LEFT)){const t=r();throw new b_("Expected opening parenthesis after function name",e,t?t.value:"<end of input>")}for(i();;){if(a(x_.PAREN_RIGHT)){i();break}if(!r()){const t=r();throw new b_("Expected closing parenthesis",e,t?t.value:"<end of input>")}if(n.length>0){if(!a(x_.COMMA)){const t=r();throw new b_("Expected comma between function arguments",e,t?t.value:"<end of input>")}i()}const t=l(0);n.push(t)}return{type:C_.CallExpression,callee:{type:C_.Identifier,name:t.value},arguments:n}})();case x_.PAREN_LEFT:{i();const t=l(0);if(!a(x_.PAREN_RIGHT)){const t=r();throw new b_("Expected closing parenthesis",e,t?t.value:"<end of input>")}return i(),t}default:throw new b_(`Unexpected token: ${t.type}`,e,t.value)}},l=(u=0)=>{let f=c();for(;e<n;){const n=t[e],c=o(n);if(c<=u)break;if(n.type!==x_.QUESTION)if(n.type!==x_.OPERATOR){if(n.type!==x_.DOT&&n.type!==x_.BRACKET_LEFT)break;f=s(f)}else{i();const t=l(c);f={type:C_.BinaryExpression,operator:n.value,left:f,right:t}}else{i();const t=l(0);if(!a(x_.COLON)){const t=r();throw new b_("Expected : in conditional expression",e,t?t.value:"<end of input>")}i();const n=l(0);f={type:C_.ConditionalExpression,test:f,consequent:t,alternate:n}}}return f},u=l();return{type:C_.Program,body:u}},D_=(t,e,n)=>{let r=e;n&&(r={...e,context:{...e.context,...n}});const i=t=>{switch(t.type){case C_.Literal:return(t=>t.value)(t);case C_.Identifier:return(t=>{if(!(t.name in r.context))throw new b_(`Undefined variable: ${t.name}`);return r.context[t.name]})(t);case C_.MemberExpression:return(t=>{const e=i(t.object);if(null==e)throw new b_("Cannot access property of null or undefined");return e[t.computed?i(t.property):t.property.name]})(t);case C_.CallExpression:return(t=>{const e=r.functions[t.callee.name];if(!e)throw new b_(`Undefined function: ${t.callee.name}`);return e(...t.arguments.map((t=>i(t))))})(t);case C_.BinaryExpression:return(t=>{if("&&"===t.operator){const e=i(t.left);return e?i(t.right):e}if("||"===t.operator)return i(t.left)||i(t.right);const e=i(t.left),n=i(t.right);switch(t.operator){case"+":return e+n;case"-":return e-n;case"*":return e*n;case"/":return e/n;case"%":return e%n;case"===":return e===n;case"!==":return e!==n;case">":return e>n;case">=":return e>=n;case"<":return e<n;case"<=":return e<=n;default:throw new b_(`Unknown operator: ${t.operator}`)}})(t);case C_.UnaryExpression:return(t=>{const e=i(t.argument);if(t.prefix)switch(t.operator){case"!":return!e;case"-":if("number"!=typeof e)throw new b_(`Cannot apply unary - to non-number: ${e}`);return-e;default:throw new b_(`Unknown operator: ${t.operator}`)}throw new b_(`Postfix operators are not supported: ${t.operator}`)})(t);case C_.ConditionalExpression:return(t=>{const e=i(t.test);return i(e?t.consequent:t.alternate)})(t);default:throw new b_(`Evaluation error: Unsupported node type: ${t.type}`)}};return i(t.body)};const B_=["style","encode","labels","children"],F_=sE((t=>{const e=function(t){const e=(t=>{const e=t,n=e.length,r=new Array(Math.ceil(n/3));let i=0,a=0;function o(t){const r=a+1;a++;let i="",o=!1;for(;a<n;){const n=e.charCodeAt(a);if(n===t)return o||(i=e.substring(r,a)),a++,{type:x_.STRING,value:i};92===n?(o||(i=e.substring(r,a),o=!0),a++,i+=e[a]):o&&(i+=e[a]),a++}throw new b_(`Unterminated string starting with ${String.fromCharCode(t)}`,a,e.substring(Math.max(0,a-10),a))}function s(){const t=a;for(45===e.charCodeAt(a)&&a++;a<n&&A_(e.charCodeAt(a));)a++;if(a<n&&46===e.charCodeAt(a))for(a++;a<n&&A_(e.charCodeAt(a));)a++;const r=e.slice(t,a);return{type:x_.NUMBER,value:r}}function c(){a++;const t=a;if(a<n&&__(e.charCodeAt(a)))for(a++;a<n&&T_(e.charCodeAt(a));)a++;const r=e.slice(t,a);return{type:x_.FUNCTION,value:r}}function l(){const t=a++;for(;a<n&&T_(e.charCodeAt(a));)a++;const r=e.slice(t,a),i=E_.get(r);return i?{type:i,value:r}:{type:x_.IDENTIFIER,value:r}}function u(){if(a+2<n){const t=e.substring(a,a+3);if(M_.has(t))return a+=3,{type:x_.OPERATOR,value:t}}if(a+1<n){const t=e.substring(a,a+2);if(M_.has(t))return a+=2,{type:x_.OPERATOR,value:t}}const t=e[a];if(M_.has(t))return a++,{type:x_.OPERATOR,value:t};throw new b_(`Unknown operator at position ${a}: ${e.substring(a,a+1)}`,a,e.substring(Math.max(0,a-10),a))}for(;a<n;){const t=e.charCodeAt(a);if(f=t,w_.has(f)){a++;continue}const h=S_.get(t);if(h)r[i++]=h,a++;else if(34!==t&&39!==t)if(A_(t)||45===t&&a+1<n&&A_(e.charCodeAt(a+1)))r[i++]=s();else if(64!==t)if(__(t))r[i++]=l();else{if(!P_(t))throw new b_(`Unexpected character: ${e[a]}`,a,e.substring(Math.max(0,a-10),a));r[i++]=u()}else r[i++]=c();else r[i++]=o(t)}var f;return i===r.length?r:r.slice(0,i)})(t),n=I_(e),r=((t={},e={})=>({context:t,functions:e}))({},y_);return(t={})=>D_(n,r,t)}(t);return(...t)=>{const n=Array.from({length:t.length},((t,e)=>String.fromCharCode(97+e))),r=Object.fromEntries(t.map(((t,e)=>[n[e],t])));return e(Object.assign(Object.assign({},r),{global:Object.assign({},r)}))}}),(t=>t),128);function z_(t,e=!0){if(Array.isArray(t))return t.map(((n,r)=>z_(t[r],e)));if("object"==typeof t&&t)return function(t,e){void 0===e&&(e=nt);var n={};return w(t)&&!b(t)&&Object.keys(t).forEach((function(r){n[r]=e(t[r],r)})),n}(t,((t,n)=>e&&B_.includes(n)?z_(t,"children"===n):e?t:z_(t,!1)));if("string"==typeof t){const e=t.trim();if(e.startsWith("{")&&e.endsWith("}"))return F_(e.slice(1,-1))}return t}const G_=[["legendCategory",[[["color","discrete"],["opacity","discrete"],["shape","discrete"],["size","constant"]],[["color","discrete"],["opacity","constant"],["shape","discrete"],["size","constant"]],[["color","discrete"],["opacity","discrete"],["shape","constant"],["size","constant"]],[["color","discrete"],["opacity","constant"],["shape","constant"],["size","constant"]],[["color","constant"],["opacity","discrete"],["shape","discrete"],["size","constant"]],[["color","constant"],["opacity","constant"],["shape","discrete"],["size","constant"]],[["color","constant"],["opacity","discrete"],["shape","constant"],["size","constant"]],[["color","discrete"],["shape","discrete"],["size","constant"]],[["color","discrete"],["opacity","discrete"],["shape","discrete"]],[["color","discrete"],["opacity","discrete"],["size","constant"]],[["color","discrete"],["opacity","constant"],["shape","discrete"]],[["color","discrete"],["opacity","constant"],["size","constant"]],[["color","discrete"],["shape","constant"],["size","constant"]],[["color","discrete"],["opacity","discrete"],["shape","constant"]],[["color","discrete"],["opacity","constant"],["shape","constant"]],[["color","constant"],["shape","discrete"],["size","constant"]],[["color","constant"],["opacity","discrete"],["shape","discrete"]],[["color","constant"],["opacity","discrete"],["size","constant"]],[["color","constant"],["opacity","constant"],["shape","discrete"]],[["color","constant"],["opacity","discrete"],["shape","constant"]],[["color","discrete"],["shape","discrete"]],[["color","discrete"],["size","constant"]],[["color","discrete"],["opacity","discrete"]],[["color","discrete"],["opacity","constant"]],[["color","discrete"],["shape","constant"]],[["color","constant"],["shape","discrete"]],[["color","constant"],["size","constant"]],[["color","constant"],["opacity","discrete"]],[["color","discrete"]]]],["legendContinuousSize",[[["color","continuous"],["opacity","continuous"],["size","continuous"]],[["color","constant"],["opacity","continuous"],["size","continuous"]],[["color","continuous"],["size","continuous"]],[["color","constant"],["size","continuous"]],[["size","continuous"],["opacity","continuous"]],[["size","continuous"]]]],["legendContinuousBlockSize",[[["color","distribution"],["opacity","distribution"],["size","distribution"]],[["color","distribution"],["size","distribution"]]]],["legendContinuousBlock",[[["color","distribution"],["opacity","continuous"]],[["color","distribution"]]]],["legendContinuous",[[["color","continuous"],["opacity","continuous"]],[["color","continuous"]],[["opacity","continuous"]]]]];var W_={}.toString,$_=function(t,e){return W_.call(t)==="[object "+e+"]"},H_=function(t){return Array.isArray?Array.isArray(t):$_(t,"Array")},Y_=function(t){return"object"==typeof t&&null!==t},V_=function(t){if(!Y_(t)||!$_(t,"Object"))return!1;if(null===Object.getPrototypeOf(t))return!0;for(var e=t;null!==Object.getPrototypeOf(e);)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e};function U_(t,e,n,r){for(var i in n=n||0,r=r||5,e)if(e.hasOwnProperty(i)){var a=e[i];null!==a&&V_(a)?(V_(t[i])||(t[i]={}),n<r?U_(t[i],a,n+1,r):t[i]=e[i]):H_(a)?(t[i]=[],t[i]=t[i].concat(a)):void 0!==a&&(t[i]=a)}}var q_=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var r=0;r<e.length;r+=1)U_(t,e[r]);return t},X_=function(t){return t};function K_(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return t?e.reduce((function(t,e){return function(n){return e(t(n))}}),t):X_}function Z_(t){return t instanceof Float32Array||t instanceof Array}var Q_=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,a=n.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o},J_=window&&window.__spreadArray||function(t,e,n){if(n||2===arguments.length)for(var r,i=0,a=e.length;i<a;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))};function tT(t,e,n){for(;t<e;)t+=2*Math.PI;for(;t>n;)t-=2*Math.PI;return t}var eT=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,a=n.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o},nT=function(t,e,n,r,i){var a,o,s=eT(t,2),c=s[0],l=s[1],u=ht();return o=[c,l],(a=u)[0]=1,a[1]=0,a[2]=0,a[3]=0,a[4]=1,a[5]=0,a[6]=o[0],a[7]=o[1],a[8]=1,a},rT=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,a=n.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o},iT=function(t,e,n,r,i){var a=new ca({range:[e,e+r]}),o=new ca({range:[n,n+i]});return{transform:function(t){var e=rT(t,2),n=e[0],r=e[1];return[a.map(n),o.map(r)]},untransform:function(t){var e=rT(t,2),n=e[0],r=e[1];return[a.invert(n),o.invert(r)]}}},aT=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,a=n.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o},oT=function(t,e,n,r,i){return(0,aT(t,1)[0])(e,n,r,i)},sT=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,a=n.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o},cT=function(t,e,n,r,i){return sT(t,1)[0]},lT=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,a=n.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o},uT=function(t,e,n,r,i){var a=lT(t,4),o=a[0],s=a[1],c=a[2],l=a[3],u=new ca({range:[c,l]}),f=new ca({range:[o,s]}),h=i/r,d=h>1?1:h,p=h>1?1/h:1;return{transform:function(t){var e=lT(t,2),n=e[0],r=e[1],i=f.map(n),a=u.map(r);return[.5*(a*Math.cos(i)*d)+.5,.5*(a*Math.sin(i)*p)+.5]},untransform:function(t){var e=lT(t,2),n=e[0],r=e[1],i=2*(n-.5)/d,a=2*(r-.5)/p,c=Math.sqrt(Math.pow(i,2)+Math.pow(a,2)),l=tT(Math.atan2(a,i),o,s);return[f.invert(l),u.invert(c)]}}},fT=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,a=n.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o},hT=function(t,e,n,r,i){return{transform:function(t){var e=fT(t,2),n=e[0];return[e[1],n]},untransform:function(t){var e=fT(t,2),n=e[0];return[e[1],n]}}},dT=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,a=n.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o},pT=function(t,e,n,r,i){var a,o,s=dT(t,2),c=s[0],l=s[1],u=ht();return o=[c,l],(a=u)[0]=o[0],a[1]=0,a[2]=0,a[3]=0,a[4]=o[1],a[5]=0,a[6]=0,a[7]=0,a[8]=1,a},gT=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,a=n.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o},vT=window&&window.__spreadArray||function(t,e,n){if(n||2===arguments.length)for(var r,i=0,a=e.length;i<a;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))},mT=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return pT.apply(void 0,vT([[-1,-1]],gT(e),!1))},yT=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return pT.apply(void 0,vT([[-1,1]],gT(e),!1))},bT=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return pT.apply(void 0,vT([[1,-1]],gT(e),!1))},xT=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,a=n.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o},wT=function(t,e,n,r,i){var a=xT(t,1)[0];return function(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=n,t[2]=0,t[3]=-n,t[4]=r,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}(ht(),a)},kT=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,a=n.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o},ET=function(t,e,n,r,i){var a=kT(t,4),o=a[0],s=a[1],c=a[2],l=(a[3]-c)/((s-0)/(2*Math.PI)+1),u=l/(2*Math.PI),f=new ca({range:[c,c+.99*l]}),h=new ca({range:[o,s]}),d=i/r,p=d>1?1:d,g=d>1?1/d:1;return{transform:function(t){var e=kT(t,2),n=e[0],r=e[1],i=h.map(n),a=f.map(r);return[.5*(Math.cos(i)*(u*i+a)*p)+.5,.5*(Math.sin(i)*(u*i+a)*g)+.5]},untransform:function(t){var e=kT(t,2),n=e[0],r=e[1],i=2*(n-.5)/p,a=2*(r-.5)/g,c=Math.sqrt(Math.pow(i,2)+Math.pow(a,2)),d=tT(Math.atan2(a,i)+Math.floor(c/l)*Math.PI*2,o,s),v=c-u*d;return[h.invert(d),f.invert(v)]}}},MT=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,a=n.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o},OT=function(t,e,n,r,i){var a=MT(t,4),o=a[0],s=a[1],c=a[2],l=a[3],u=new ca({range:[c,l]});return{transform:function(t){for(var e=[],n=t.length,r=new la({domain:new Array(n).fill(0).map((function(t,e){return e})),range:[o,s]}),i=0;i<n;i++){var a=t[i],c=r.map(i),l=u.map(a);e.push(c,l)}return e},untransform:function(t){for(var e=[],n=0;n<t.length;n+=2){var r=t[n+1];e.push(u.invert(r))}return e}}},ST=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,a=n.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o};function AT(t){return 1/Math.tan(t)}var _T=function(t,e,n,r,i){var a=AT(ST(t,1)[0]);return{transform:function(t){var e=ST(t,2),n=e[0],r=e[1];return[n+r*a,r]},untransform:function(t){var e=ST(t,2),n=e[0],r=e[1];return[n-r*a,r]}}},TT=function(t,e,n,r,i){var a=AT(ST(t,1)[0]);return{transform:function(t){var e=ST(t,2),n=e[0];return[n,e[1]+n*a]},untransform:function(t){var e=ST(t,2),n=e[0];return[n,e[1]-n*a]}}},PT=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,a=n.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o};function CT(t,e,n,r,i){var a=t<e,o=(a?e-r:i-e)||i-r,s=a?-1:1;return s*o*(n+1)/(n+o/((t-e)*s))+e}function NT(t,e,n,r,i){var a=t<e,o=(a?e-r:i-e)||i-r;return o/(o*(n+1)/(t-e)-n*(a?-1:1))+e}function LT(t,e,n){return n?new ca({range:[0,1],domain:[0,e]}).map(t):t}var jT=function(t,e,n,r,i){var a=PT(t,3),o=a[0],s=a[1],c=a[2],l=LT(o,r,void 0!==c&&c);return{transform:function(t){var e=PT(t,2),n=e[0],r=e[1];return[CT(n,l,s,0,1),r]},untransform:function(t){var e=PT(t,2),n=e[0],r=e[1];return[NT(n,l,s,0,1),r]}}},RT=function(t,e,n,r,i){var a=PT(t,3),o=a[0],s=a[1],c=a[2],l=LT(o,i,void 0!==c&&c);return{transform:function(t){var e=PT(t,2);return[e[0],CT(e[1],l,s,0,1)]},untransform:function(t){var e=PT(t,2);return[e[0],NT(e[1],l,s,0,1)]}}},IT=function(t,e,n,r,i){var a=PT(t,5),o=a[0],s=a[1],c=a[2],l=a[3],u=a[4],f=void 0!==u&&u,h=LT(o,r,f),d=LT(s,i,f);return{transform:function(t){var e=PT(t,2),n=e[0],r=e[1];return[CT(n,h,c,0,1),CT(r,d,l,0,1)]},untransform:function(t){var e=PT(t,2),n=e[0],r=e[1];return[NT(n,h,c,0,1),NT(r,d,l,0,1)]}}},DT=function(t,e,n,r,i){var a=PT(t,5),o=a[0],s=a[1],c=a[2],l=a[3],u=a[4],f=void 0!==u&&u,h=new ca({range:[0,r]}),d=new ca({range:[0,i]}),p=f?o:h.map(o),g=f?s:d.map(s);return{transform:function(t){var e=PT(t,2),n=e[0],r=e[1],i=h.map(n)-p,a=d.map(r)-g,o=Math.sqrt(i*i+a*a);if(o>c)return[n,r];var s=CT(o,0,l,0,c),u=Math.atan2(a,i),f=p+s*Math.cos(u),v=g+s*Math.sin(u);return[h.invert(f),d.invert(v)]},untransform:function(t){var e=PT(t,2),n=e[0],r=e[1],i=h.map(n)-p,a=d.map(r)-g,o=Math.sqrt(i*i+a*a);if(o>c)return[n,r];var s=NT(o,0,l,0,c),u=Math.atan2(a,i),f=p+s*Math.cos(u),v=g+s*Math.sin(u);return[h.invert(f),d.invert(v)]}}},BT=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,a=n.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o},FT=function(t,e,n,r,i,a,o){var s=new ca({range:[e,e+i]}),c=new ca({range:[n,n+a]}),l=new ca({range:[r,r+o]});return{transform:function(t){var e=BT(t,3),n=e[0],r=e[1],i=e[2];return[s.map(n),c.map(r),l.map(i)]},untransform:function(t){var e=BT(t,3),n=e[0],r=e[1],i=e[2];return[s.invert(n),c.invert(r),l.invert(i)]}}},zT=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,a=n.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o},GT=function(t,e,n,r,i,a,o){var s=zT(t,3),c=s[0],l=s[1],u=s[2];return _t(pt(),[c,l,u])},WT=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,a=n.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o},$T=function(t,e,n,r,i,a,o){return{transform:function(t){var e=WT(t,3),n=e[0];return[e[1],n,e[2]]},untransform:function(t){var e=WT(t,3),n=e[0];return[e[1],n,e[2]]}}},HT=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,a=n.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o},YT=function(t,e,n,r,i,a,o){var s=HT(t,3),c=s[0],l=s[1],u=s[2];return Tt(pt(),[c,l,u])},VT=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,a=n.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o},UT=window&&window.__spreadArray||function(t,e,n){if(n||2===arguments.length)for(var r,i=0,a=e.length;i<a;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))},qT=window&&window.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},XT=function(){function t(t){this.options={x:0,y:0,width:300,height:150,transformations:[]},this.transformers={cartesian:iT,translate:nT,custom:oT,matrix:cT,polar:uT,transpose:hT,scale:pT,"shear.x":_T,"shear.y":TT,reflect:mT,"reflect.x":yT,"reflect.y":bT,rotate:wT,helix:ET,parallel:OT,fisheye:IT,"fisheye.x":jT,"fisheye.y":RT,"fisheye.circular":DT},this.update(t)}return t.prototype.update=function(t){this.options=q_({},this.options,t),this.recoordinate()},t.prototype.clone=function(){return new t(this.options)},t.prototype.getOptions=function(){return this.options},t.prototype.clear=function(){this.update({transformations:[]})},t.prototype.getSize=function(){var t=this.options;return[t.width,t.height]},t.prototype.getCenter=function(){var t=this.options,e=t.x,n=t.y;return[(2*e+t.width)/2,(2*n+t.height)/2]},t.prototype.transform=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=this.options.transformations;return this.update({transformations:UT(UT([],VT(n),!1),[UT([],VT(t),!1)],!1)}),this},t.prototype.map=function(t){return this.output(t)},t.prototype.invert=function(t){return this.input(t)},t.prototype.recoordinate=function(){this.output=this.compose(),this.input=this.compose(!0)},t.prototype.compose=function(t){var e,n;void 0===t&&(t=!1);var r=t?UT([],VT(this.options.transformations),!1).reverse():this.options.transformations,i=t?function(t){return t.untransform}:function(t){return t.transform},a=[],o=[],s=function(t,e){return void 0===e&&(e=!0),o.push(e?function(t){return function(e){for(var n=[],r=0;r<e.length-1;r+=2){var i=[e[r],e[r+1]],a=t(i);n.push.apply(n,J_([],Q_(a),!1))}return n}}(t):t)};try{for(var c=qT(r),l=c.next();!l.done;l=c.next()){var u=VT(l.value),f=u[0],h=u.slice(1),d=this.transformers[f];if(d){var p=this.options,g=p.x,v=p.y,m=p.width,y=p.height,b=d(UT([],VT(h),!1),g,v,m,y);if(Z_(b))a.push(b);else{if(a.length)s(this.createMatrixTransform(a,t)),a.splice(0,a.length);s(i(b)||X_,"parallel"!==f)}}}}catch(t){e={error:t}}finally{try{l&&!l.done&&(n=c.return)&&n.call(c)}finally{if(e)throw e.error}}a.length&&s(this.createMatrixTransform(a,t));return K_.apply(void 0,UT([],VT(o),!1))},t.prototype.createMatrixTransform=function(t,e){var n=ht();return e&&t.reverse(),t.forEach((function(t){return dt(n,n,t)})),e&&function(t,e){var n=e[0],r=e[1],i=e[2],a=e[3],o=e[4],s=e[5],c=e[6],l=e[7],u=e[8],f=u*o-s*l,h=-u*a+s*c,d=l*a-o*c,p=n*f+r*h+i*d;p&&(p=1/p,t[0]=f*p,t[1]=(-u*r+i*l)*p,t[2]=(s*r-i*o)*p,t[3]=h*p,t[4]=(u*n-i*c)*p,t[5]=(-s*n+i*a)*p,t[6]=d*p,t[7]=(-l*n+r*c)*p,t[8]=(o*n-r*a)*p)}(n,function(t){var e=new ft(9);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}(n)),function(t){var e=[t[0],t[1],1];return fe(e,e,n),[e[0],e[1]]}},t}(),KT=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,a=n.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o},ZT=window&&window.__spreadArray||function(t,e,n){if(n||2===arguments.length)for(var r,i=0,a=e.length;i<a;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))},QT=window&&window.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},JT=function(){function t(t){this.options={x:0,y:0,z:0,width:300,height:150,depth:150,transformations:[]},this.transformers={cartesian3D:FT,translate3D:GT,scale3D:YT,transpose3D:$T},this.update(t)}return t.prototype.update=function(t){this.options=q_({},this.options,t),this.recoordinate()},t.prototype.clone=function(){return new t(this.options)},t.prototype.getOptions=function(){return this.options},t.prototype.clear=function(){this.update({transformations:[]})},t.prototype.getSize=function(){var t=this.options;return[t.width,t.height,t.depth]},t.prototype.getCenter=function(){var t=this.options,e=t.x,n=t.y,r=t.z;return[(2*e+t.width)/2,(2*n+t.height)/2,(2*r+t.depth)/2]},t.prototype.transform=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=this.options.transformations;return this.update({transformations:ZT(ZT([],KT(n),!1),[ZT([],KT(t),!1)],!1)}),this},t.prototype.map=function(t){return this.output(t)},t.prototype.invert=function(t){return this.input(t)},t.prototype.recoordinate=function(){this.output=this.compose(),this.input=this.compose(!0)},t.prototype.compose=function(t){var e,n;void 0===t&&(t=!1);var r=t?ZT([],KT(this.options.transformations),!1).reverse():this.options.transformations,i=t?function(t){return t.untransform}:function(t){return t.transform},a=[],o=[],s=function(t,e){return void 0===e&&(e=!0),o.push(e?function(t){return function(e){for(var n=[],r=0;r<e.length-1;r+=3){var i=[e[r],e[r+1],e[r+2]],a=t(i);n.push.apply(n,J_([],Q_(a),!1))}return n}}(t):t)};try{for(var c=QT(r),l=c.next();!l.done;l=c.next()){var u=KT(l.value),f=u[0],h=u.slice(1),d=this.transformers[f];if(d){var p=this.options,g=p.x,v=p.y,m=p.z,y=p.width,b=p.height,x=p.depth,w=d(ZT([],KT(h),!1),g,v,m,y,b,x);if(Z_(w))a.push(w);else{if(a.length)s(this.createMatrixTransform(a,t)),a.splice(0,a.length);s(i(w)||X_,!0)}}}}catch(t){e={error:t}}finally{try{l&&!l.done&&(n=c.return)&&n.call(c)}finally{if(e)throw e.error}}a.length&&s(this.createMatrixTransform(a,t));return K_.apply(void 0,ZT([],KT(o),!1))},t.prototype.createMatrixTransform=function(t,e){var n=pt();return e&&t.reverse(),t.forEach((function(t){return qt(n,n,t)})),e&&wt(n,gt(n)),function(t){var e=[t[0],t[1],t[2],1];return ye(e,e,n),[e[0],e[1],e[2]]}},t}();function tP(t){return(e,...n)=>Q({},t(e,...n),e)}function eP(t){return(e,...n)=>Q({},e,t(e,...n))}function nP(t,e){if(!t)return e;if(Array.isArray(t))return t;if(function(t){return!(t instanceof Date)&&"object"==typeof t}(t)){const{value:n=e}=t,r=Le(t,["value"]);return Object.assign(Object.assign({},r),{value:n})}return t}const rP=()=>t=>{const{children:e}=t;if(!Array.isArray(e))return[];const{x:n=0,y:r=0,width:i,height:a,data:o}=t;return e.map((t=>{var{data:e,x:s,y:c,width:l,height:u}=t,f=Le(t,["data","x","y","width","height"]);return Object.assign(Object.assign({},f),{data:nP(e,o),x:null!=s?s:n,y:null!=c?c:r,width:null!=l?l:i,height:null!=u?u:a})}))};rP.props={};const iP=()=>t=>{const{children:e}=t;if(!Array.isArray(e))return[];const{direction:n="row",ratio:r=e.map((()=>1)),padding:i=0,data:a}=t,[o,s,c,l]="col"===n?["y","height","width","x"]:["x","width","height","y"],u=r.reduce(((t,e)=>t+e)),f=t[s]-i*(e.length-1),h=r.map((t=>f*(t/u))),d=[];let p=t[o]||0;for(let n=0;n<h.length;n+=1){const r=e[n],{data:u}=r,f=Le(r,["data"]),g=nP(u,a);d.push(Object.assign({[o]:p,[s]:h[n],[l]:t[l]||0,[c]:t[c],data:g},f)),p+=h[n]+i}return d};iP.props={};const aP=()=>t=>{const{children:e}=t,n=Le(t,["children"]);if(!Array.isArray(e))return[];const{data:r,scale:i={},axis:a={},legend:o={},encode:s={},transform:c=[]}=n,l=Le(n,["data","scale","axis","legend","encode","transform"]),u=e.map((t=>{var{data:e,scale:n={},axis:l={},legend:u={},encode:f={},transform:h=[]}=t,d=Le(t,["data","scale","axis","legend","encode","transform"]);return Object.assign({data:nP(e,r),scale:Q({},i,n),encode:Q({},s,f),transform:[...c,...h],axis:!(!l||!a)&&Q({},a,l),legend:!(!u||!o)&&Q({},o,u)},d)}));return[Object.assign(Object.assign({},l),{marks:u,type:"standardView"})]};aP.props={};const oP=({static:t=!1}={})=>e=>{const{width:n,height:r,depth:i,paddingLeft:a,paddingRight:o,paddingTop:s,paddingBottom:c,padding:l,inset:u,insetLeft:f,insetTop:h,insetRight:d,insetBottom:p,margin:g,marginLeft:v,marginBottom:m,marginTop:y,marginRight:b,data:x,coordinate:w,theme:k,component:E,interaction:M,x:O,y:S,z:A,key:_,frame:T,labelTransform:P,parentKey:C,clip:N,viewStyle:L,title:j}=e,R=Le(e,["width","height","depth","paddingLeft","paddingRight","paddingTop","paddingBottom","padding","inset","insetLeft","insetTop","insetRight","insetBottom","margin","marginLeft","marginBottom","marginTop","marginRight","data","coordinate","theme","component","interaction","x","y","z","key","frame","labelTransform","parentKey","clip","viewStyle","title"]);return[Object.assign(Object.assign({type:"standardView",x:O,y:S,z:A,key:_,width:n,height:r,depth:i,padding:l,paddingLeft:a,paddingRight:o,paddingTop:s,inset:u,insetLeft:f,insetTop:h,insetRight:d,insetBottom:p,paddingBottom:c,theme:k,coordinate:w,component:E,interaction:M,frame:T,labelTransform:P,margin:g,marginLeft:v,marginBottom:m,marginTop:y,marginRight:b,parentKey:C,clip:N,style:L},!t&&{title:j}),{marks:[Object.assign(Object.assign(Object.assign({},R),{key:`${_}-0`,data:x}),t&&{title:j})]})]};oP.props={};class sP{constructor(t){this.$value=t}static of(t){return new sP(t)}call(t,...e){return this.$value=t(this.$value,...e),this}value(){return this.$value}}const cP=tP((t=>{const{encode:e,data:n,scale:r,shareSize:i=!1}=t,{x:a,y:o}=e,s=(t,e)=>{var a;if(void 0===t||!i)return{};const o=Qn(n,(e=>e[t])),s=(null===(a=null==r?void 0:r[e])||void 0===a?void 0:a.domain)||Array.from(o.keys()),c=s.map((t=>o.has(t)?o.get(t).length:1));return{domain:s,flex:c}};return{scale:{x:Object.assign(Object.assign({paddingOuter:0,paddingInner:.1,guide:void 0===a?null:{position:"top"}},void 0===a&&{paddingInner:0}),s(a,"x")),y:Object.assign(Object.assign({range:[0,1],paddingOuter:0,paddingInner:.1,guide:void 0===o?null:{position:"right"}},void 0===o&&{paddingInner:0}),s(o,"y"))}}})),lP=eP((t=>{const{data:e,scale:n,legend:r}=t,i=[t];let a,o,s;for(;i.length;){const t=i.shift(),{children:e,encode:n={},scale:r={},legend:c={}}=t,{color:l}=n,{color:u}=r,{color:f}=c;void 0!==l&&(a=l),void 0!==u&&(o=u),void 0!==f&&(s=f),Array.isArray(e)&&i.push(...e)}const c="string"==typeof a?a:"",[l,u]=(()=>{var t;const r=null===(t=null==n?void 0:n.color)||void 0===t?void 0:t.domain;if(void 0!==r)return[r];if(void 0===a)return[void 0];const i="function"==typeof a?a:t=>t[a],o=e.map(i);return o.some((t=>"number"==typeof t))?[Un(o)]:[Array.from(new Set(o)),"ordinal"]})();return Object.assign({encode:{color:{type:"column",value:null!=l?l:[]}},scale:{color:Q({},o,{domain:l,type:u})}},void 0===r&&{legend:{color:Q({title:c},s)}})})),uP=tP((()=>({animate:{enterType:"fadeIn"}}))),fP=eP((()=>({frame:!1,encode:{shape:"hollow"},style:{lineWidth:0}}))),hP=eP((()=>({type:"cell"}))),dP=eP((t=>{const{data:e}=t,n={type:"custom",callback:()=>{const{data:e,encode:n}=t,{x:r,y:i}=n,a=r?Array.from(new Set(e.map((t=>t[r])))):[],o=i?Array.from(new Set(e.map((t=>t[i])))):[];return(()=>{if(a.length&&o.length){const t=[];for(const e of a)for(const n of o)t.push({[r]:e,[i]:n});return t}return a.length?a.map((t=>({[r]:t}))):o.length?o.map((t=>({[i]:t}))):void 0})()}};return{data:{type:"inline",value:e,transform:[n]}}})),pP=eP(((t,e=gP,n=mP,r=yP,i={})=>{const{data:a,encode:o,children:s,scale:c,x:l=0,y:u=0,shareData:f=!1,key:h}=t,{value:d}=a,{x:p,y:g}=o,{color:v}=c,{domain:m}=v;return{children:(t,a,o)=>{const{x:c,y:v}=a,{paddingLeft:y,paddingTop:b,marginLeft:x,marginTop:w}=o,{domain:k}=c.getOptions(),{domain:E}=v.getOptions(),M=to(t),O=t.map(e),S=t.map((({x:t,y:e})=>[c.invert(t),v.invert(e)])),A=S.map((([t,e])=>n=>{const{[p]:r,[g]:i}=n;return(void 0===p||r===t)&&(void 0===g||i===e)})),_=A.map((t=>d.filter(t))),T=f?gr(_,(t=>t.length)):void 0,P=S.map((([t,e])=>({columnField:p,columnIndex:k.indexOf(t),columnValue:t,columnValuesLength:k.length,rowField:g,rowIndex:E.indexOf(e),rowValue:e,rowValuesLength:E.length}))),C=P.map((t=>Array.isArray(s)?s:[s(t)].flat(1)));return M.flatMap((t=>{const[e,a,o,s]=O[t],c=P[t],f=_[t];return C[t].map((v=>{var k,E,{scale:M,key:O,facet:S=!0,axis:A={},legend:_={}}=v,P=Le(v,["scale","key","facet","axis","legend"]);const C=(null===(k=null==M?void 0:M.y)||void 0===k?void 0:k.guide)||A.y,N=(null===(E=null==M?void 0:M.x)||void 0===E?void 0:E.guide)||A.x,L={x:{tickCount:p?5:void 0},y:{tickCount:g?5:void 0}},j=S?f:0===f.length?[]:d,R={color:{domain:m}},I={x:bP(N,n)(c,j),y:bP(C,r)(c,j)};return Object.assign(Object.assign({key:`${O}-${t}`,data:j,margin:0,x:e+y+l+x,y:a+b+u+w,parentKey:h,width:o,height:s,paddingLeft:0,paddingRight:0,paddingTop:0,paddingBottom:0,frame:!!j.length,dataDomain:T,scale:Q(L,M,R),axis:Q({},A,I),legend:!1},P),i)}))}))}}}));function gP(t){const{points:e}=t;return As(e)}function vP(t,e){return e.length?Q({title:!1,tick:null,label:null},t):Q({title:!1,tick:null,label:null,grid:null},t)}function mP(t){return(e,n)=>{const{rowIndex:r,rowValuesLength:i,columnIndex:a,columnValuesLength:o}=e;if(r!==i-1)return vP(t,n);const s=a===o-1&&void 0,c=n.length?void 0:null;return Q({title:s,grid:c},t)}}function yP(t){return(e,n)=>{const{rowIndex:r,columnIndex:i}=e;if(0!==i)return vP(t,n);const a=0===r&&void 0,o=n.length?void 0:null;return Q({title:a,grid:o},t)}}function bP(t,e){return"function"==typeof t?t:null===t||!1===t?()=>null:e(t)}const xP=()=>t=>[sP.of(t).call(hP).call(lP).call(uP).call(cP).call(fP).call(dP).call(pP).value()];xP.props={};const wP=tP((t=>({scale:{x:{guide:null,paddingOuter:0,paddingInner:.1},y:{guide:null,range:[0,1],paddingOuter:0,paddingInner:.1}}}))),kP=eP((t=>{const{data:e,children:n,x:r=0,y:i=0,key:a}=t;return{children:(t,o,s)=>{const{x:c,y:l}=o,{paddingLeft:u,paddingTop:f,marginLeft:h,marginTop:d}=s,{domain:p}=c.getOptions(),{domain:g}=l.getOptions(),v=to(t),m=t.map((({points:t})=>As(t))),y=t.map((({x:t,y:e})=>[c.invert(t),l.invert(e)])),b=y.map((([t,e])=>({columnField:t,columnIndex:p.indexOf(t),columnValue:t,columnValuesLength:p.length,rowField:e,rowIndex:g.indexOf(e),rowValue:e,rowValuesLength:g.length}))),x=b.map((t=>Array.isArray(n)?n:[n(t)].flat(1)));return v.flatMap((t=>{const[n,o,s,c]=m[t],[l,p]=y[t],g=b[t];return x[t].map((v=>{var m,y;const{scale:b,key:x,encode:w,axis:k,interaction:E}=v,M=Le(v,["scale","key","encode","axis","interaction"]),O=null===(m=null==b?void 0:b.y)||void 0===m?void 0:m.guide,S={x:MP(null===(y=null==b?void 0:b.x)||void 0===y?void 0:y.guide)(g,e),y:OP(O)(g,e)};return Object.assign({data:e,parentKey:a,key:`${x}-${t}`,x:n+u+r+h,y:o+f+i+d,width:s,height:c,margin:0,paddingLeft:0,paddingRight:0,paddingTop:0,paddingBottom:0,frame:!0,scale:Q({x:{facet:!1},y:{facet:!1}},b),axis:Q({x:{tickCount:5},y:{tickCount:5}},k,S),legend:!1,encode:Q({},w,{x:l,y:p}),interaction:Q({},E,{legendFilter:!1})},M)}))}))}}})),EP=eP((t=>{const{encode:e}=t,n=Le(t,["encode"]),{position:r=[],x:i=r,y:a=[...r].reverse()}=e,o=Le(e,["position","x","y"]),s=[];for(const t of[i].flat(1))for(const e of[a].flat(1))s.push({$x:t,$y:e});return Object.assign(Object.assign({},n),{data:s,encode:Object.assign(Object.assign({},o),{x:"$x",y:"$y"}),scale:Object.assign(Object.assign({},1===[i].flat(1).length&&{x:{paddingInner:0}}),1===[a].flat(1).length&&{y:{paddingInner:0}})})}));function MP(t){return"function"==typeof t?t:null===t?()=>null:(e,n)=>{const{rowIndex:r,rowValuesLength:i}=e;if(r!==i-1)return vP(t,n)}}function OP(t){return"function"==typeof t?t:null===t?()=>null:(e,n)=>{const{columnIndex:r}=e;if(0!==r)return vP(t,n)}}const SP=()=>t=>[sP.of(t).call(hP).call(lP).call(kP).call(EP).call(uP).call(fP).call(wP).value()],AP=tP((t=>({scale:{x:{guide:{type:"axisArc"},paddingOuter:0,paddingInner:.1},y:{guide:null,range:[0,1],paddingOuter:0,paddingInner:.1}}}))),_P=tP((t=>({coordinate:{type:"polar"}}))),TP=t=>{const{encode:e}=t,n=Le(t,["encode"]),{position:r}=e;return Object.assign(Object.assign({},n),{encode:{x:r}})};function PP(t){return t=>null}function CP(t){const{points:e}=t,[n,r,i,a]=e,o=Es(n,a),s=ws(n,a),c=Ss(s,ws(r,i)),l=1/Math.sin(c/2),u=o/(1+l),f=u*Math.sqrt(2),[h,d]=i,p=Os(s)+c/2,g=u*l;return[h+g*Math.sin(p)-f/2,d-g*Math.cos(p)-f/2,f,f]}const NP=()=>t=>[sP.of(t).call(hP).call(TP).call(lP).call(_P).call(dP).call(pP,CP,PP,PP,{frame:!1}).call(uP).call(fP).call(AP).value()];function LP(t,e,n){const r=[0,n],i=[1-n,1];return"normal"===t?r:"reverse"===t?i:"alternate"===t?e%2==0?r:i:"reverse-alternate"===t?e%2==0?i:r:void 0}const jP=()=>t=>{const{children:e=[],duration:n=1e3,iterationCount:r=1,direction:i="normal",easing:a="ease-in-out-sine"}=t,o=e.length;if(!Array.isArray(e)||0===o)return[];const{key:s}=e[0],c=e.map((t=>Object.assign(Object.assign({},t),{key:s}))).map((t=>function(t,e,n){const r=[t];for(;r.length;){const t=r.pop();t.animate=Q({enter:{duration:e},update:{duration:e,easing:n,type:"morphing",fill:"both"},exit:{type:"fadeOut",duration:e}},t.animate||{});const{children:i}=t;Array.isArray(i)&&r.push(...i)}return t}(t,n,a)));return function*(){let t,e=0;for(;"infinite"===r||e<r;){const[n,r]=LP(i,e,o);for(let e=n;e<r;e+=1){const n=Math.abs(e);t!==n&&(yield c[n]),t=n}e++}}};function RP(t,e,n,r=t=>!0){return i=>{if(!r(i))return;n.emit(`plot:${t}`,i);const{target:a}=i;if(!a)return;const{className:o}=a;if("plot"===o)return;const s=zR(a,(t=>"element"===t.className));const c=function(t){return zR(t,(t=>"component"===t.className))}(a),l=function(t){return zR(t,(t=>"label"===t.className))}(a),u=s||c||l;if(!u)return;const{className:f,markType:h}=u,d=Object.assign(Object.assign({},i),{nativeEvent:!0});"element"===f?(d.data={data:Da(u,e)},n.emit(`element:${t}`,d),n.emit(`${h}:${t}`,d)):"label"===f?(d.data={data:u.attributes.datum},n.emit(`label:${t}`,d),n.emit(`${o}:${t}`,d)):(n.emit(`component:${t}`,d),n.emit(`${o}:${t}`,d))}}function IP(){return(t,e,n)=>{const{container:r,view:i}=t,a=RP(m_.CLICK,i,n,(t=>1===t.detail)),o=RP(m_.DBLCLICK,i,n,(t=>2===t.detail)),s=RP(m_.POINTER_TAP,i,n),c=RP(m_.POINTER_DOWN,i,n),l=RP(m_.POINTER_UP,i,n),u=RP(m_.POINTER_OVER,i,n),f=RP(m_.POINTER_OUT,i,n),h=RP(m_.POINTER_MOVE,i,n),d=RP(m_.POINTER_ENTER,i,n),p=RP(m_.POINTER_LEAVE,i,n),g=RP(m_.POINTER_UPOUTSIDE,i,n),v=RP(m_.DRAG_START,i,n),m=RP(m_.DRAG,i,n),y=RP(m_.DRAG_END,i,n),b=RP(m_.DRAG_ENTER,i,n),x=RP(m_.DRAG_LEAVE,i,n),w=RP(m_.DRAG_OVER,i,n),k=RP(m_.DROP,i,n);return r.addEventListener("click",a),r.addEventListener("click",o),r.addEventListener("pointertap",s),r.addEventListener("pointerdown",c),r.addEventListener("pointerup",l),r.addEventListener("pointerover",u),r.addEventListener("pointerout",f),r.addEventListener("pointermove",h),r.addEventListener("pointerenter",d),r.addEventListener("pointerleave",p),r.addEventListener("pointerupoutside",g),r.addEventListener("dragstart",v),r.addEventListener("drag",m),r.addEventListener("dragend",y),r.addEventListener("dragenter",b),r.addEventListener("dragleave",x),r.addEventListener("dragover",w),r.addEventListener("drop",k),()=>{r.removeEventListener("click",a),r.removeEventListener("click",o),r.removeEventListener("pointertap",s),r.removeEventListener("pointerdown",c),r.removeEventListener("pointerup",l),r.removeEventListener("pointerover",u),r.removeEventListener("pointerout",f),r.removeEventListener("pointermove",h),r.removeEventListener("pointerenter",d),r.removeEventListener("pointerleave",p),r.removeEventListener("pointerupoutside",g),r.removeEventListener("dragstart",v),r.removeEventListener("drag",m),r.removeEventListener("dragend",y),r.removeEventListener("dragenter",b),r.removeEventListener("dragleave",x),r.removeEventListener("dragover",w),r.removeEventListener("drop",k)}}}function DP(t,e){const n=Object.assign(Object.assign({},{"component.axisRadar":HO,"component.axisLinear":FO,"component.axisArc":zO,"component.legendContinuousBlock":tS,"component.legendContinuousBlockSize":nS,"component.legendContinuousSize":eS,"interaction.event":IP,"composition.mark":oP,"composition.view":aP,"shape.label.label":eE}),e),r=e=>{if("string"!=typeof e)return e;const r=`${t}.${e}`;return n[r]||Wa(`Unknown Component: ${r}`)};return[(t,e)=>{const{type:n}=t,i=Le(t,["type"]);n||Wa("Plot type is required!");const a=r(n);return null==a?void 0:a(i,e)},r]}function BP(t){const{canvas:e,group:n}=t;return(null==e?void 0:e.document)||(null==n?void 0:n.ownerDocument)||Wa("Cannot find library document")}function FP(t,e){const{coordinate:n={},coordinates:r}=t,i=Le(t,["coordinate","coordinates"]);if(r)return t;const{type:a,transform:o=[]}=n,s=Le(n,["type","transform"]);if(!a)return Object.assign(Object.assign({},i),{coordinates:o});const[,c]=DP("coordinate",e),{transform:l=!1}=c(a).props||{};if(l)throw new Error(`Unknown coordinate: ${a}.`);return Object.assign(Object.assign({},i),{coordinates:[Object.assign({type:a},s),...o]})}function zP(t,e){return t.filter((t=>t.type===e))}function GP(t){return zP(t,"polar").length>0}function WP(t){return zP(t,"transpose").length%2==1}function $P(t){return zP(t,"theta").length>0}function HP(t){return zP(t,"radial").length>0}function YP(t){return zP(t,"radar").length>0}function VP(t){for(var e=t.length/6|0,n=new Array(e),r=0;r<e;)n[r]="#"+t.slice(6*r,6*++r);return n}jP.props={},IP.props={reapplyWhenUpdate:!0};var UP=VP("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf"),qP=VP("7fc97fbeaed4fdc086ffff99386cb0f0027fbf5b17666666"),XP=VP("1b9e77d95f027570b3e7298a66a61ee6ab02a6761d666666"),KP=VP("4269d0efb118ff725c6cc5b03ca951ff8ab7a463f297bbf59c6b4e9498a0"),ZP=VP("a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928"),QP=VP("fbb4aeb3cde3ccebc5decbe4fed9a6ffffcce5d8bdfddaecf2f2f2"),JP=VP("b3e2cdfdcdaccbd5e8f4cae4e6f5c9fff2aef1e2cccccccc"),tC=VP("e41a1c377eb84daf4a984ea3ff7f00ffff33a65628f781bf999999"),eC=VP("66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3"),nC=VP("8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f"),rC=VP("4e79a7f28e2ce1575976b7b259a14fedc949af7aa1ff9da79c755fbab0ab");function iC(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function aC(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function oC(){}var sC=.7,cC=1/sC,lC="\\s*([+-]?\\d+)\\s*",uC="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",fC="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",hC=/^#([0-9a-f]{3,8})$/,dC=new RegExp(`^rgb\\(${lC},${lC},${lC}\\)$`),pC=new RegExp(`^rgb\\(${fC},${fC},${fC}\\)$`),gC=new RegExp(`^rgba\\(${lC},${lC},${lC},${uC}\\)$`),vC=new RegExp(`^rgba\\(${fC},${fC},${fC},${uC}\\)$`),mC=new RegExp(`^hsl\\(${uC},${fC},${fC}\\)$`),yC=new RegExp(`^hsla\\(${uC},${fC},${fC},${uC}\\)$`),bC={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function xC(){return this.rgb().formatHex()}function wC(){return this.rgb().formatRgb()}function kC(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=hC.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?EC(e):3===n?new AC(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?MC(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?MC(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=dC.exec(t))?new AC(e[1],e[2],e[3],1):(e=pC.exec(t))?new AC(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=gC.exec(t))?MC(e[1],e[2],e[3],e[4]):(e=vC.exec(t))?MC(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=mC.exec(t))?LC(e[1],e[2]/100,e[3]/100,1):(e=yC.exec(t))?LC(e[1],e[2]/100,e[3]/100,e[4]):bC.hasOwnProperty(t)?EC(bC[t]):"transparent"===t?new AC(NaN,NaN,NaN,0):null}function EC(t){return new AC(t>>16&255,t>>8&255,255&t,1)}function MC(t,e,n,r){return r<=0&&(t=e=n=NaN),new AC(t,e,n,r)}function OC(t){return t instanceof oC||(t=kC(t)),t?new AC((t=t.rgb()).r,t.g,t.b,t.opacity):new AC}function SC(t,e,n,r){return 1===arguments.length?OC(t):new AC(t,e,n,null==r?1:r)}function AC(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function _C(){return`#${NC(this.r)}${NC(this.g)}${NC(this.b)}`}function TC(){const t=PC(this.opacity);return`${1===t?"rgb(":"rgba("}${CC(this.r)}, ${CC(this.g)}, ${CC(this.b)}${1===t?")":`, ${t})`}`}function PC(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function CC(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function NC(t){return((t=CC(t))<16?"0":"")+t.toString(16)}function LC(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new RC(t,e,n,r)}function jC(t){if(t instanceof RC)return new RC(t.h,t.s,t.l,t.opacity);if(t instanceof oC||(t=kC(t)),!t)return new RC;if(t instanceof RC)return t;var e=(t=t.rgb()).r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),a=Math.max(e,n,r),o=NaN,s=a-i,c=(a+i)/2;return s?(o=e===a?(n-r)/s+6*(n<r):n===a?(r-e)/s+2:(e-n)/s+4,s/=c<.5?a+i:2-a-i,o*=60):s=c>0&&c<1?0:o,new RC(o,s,c,t.opacity)}function RC(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function IC(t){return(t=(t||0)%360)<0?t+360:t}function DC(t){return Math.max(0,Math.min(1,t||0))}function BC(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}iC(oC,kC,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:xC,formatHex:xC,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return jC(this).formatHsl()},formatRgb:wC,toString:wC}),iC(AC,SC,aC(oC,{brighter(t){return t=null==t?cC:Math.pow(cC,t),new AC(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=null==t?sC:Math.pow(sC,t),new AC(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new AC(CC(this.r),CC(this.g),CC(this.b),PC(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:_C,formatHex:_C,formatHex8:function(){return`#${NC(this.r)}${NC(this.g)}${NC(this.b)}${NC(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:TC,toString:TC})),iC(RC,(function(t,e,n,r){return 1===arguments.length?jC(t):new RC(t,e,n,null==r?1:r)}),aC(oC,{brighter(t){return t=null==t?cC:Math.pow(cC,t),new RC(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?sC:Math.pow(sC,t),new RC(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*e,i=2*n-r;return new AC(BC(t>=240?t-240:t+120,i,r),BC(t,i,r),BC(t<120?t+240:t-120,i,r),this.opacity)},clamp(){return new RC(IC(this.h),DC(this.s),DC(this.l),PC(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 t=PC(this.opacity);return`${1===t?"hsl(":"hsla("}${IC(this.h)}, ${100*DC(this.s)}%, ${100*DC(this.l)}%${1===t?")":`, ${t})`}`}}));const FC=Math.PI/180,zC=180/Math.PI;var GC=-.14861,WC=1.78277,$C=-.29227,HC=-.90649,YC=1.97294,VC=YC*HC,UC=YC*WC,qC=WC*$C-HC*GC;function XC(t,e,n,r){return 1===arguments.length?function(t){if(t instanceof KC)return new KC(t.h,t.s,t.l,t.opacity);t instanceof AC||(t=OC(t));var e=t.r/255,n=t.g/255,r=t.b/255,i=(qC*r+VC*e-UC*n)/(qC+VC-UC),a=r-i,o=(YC*(n-i)-$C*a)/HC,s=Math.sqrt(o*o+a*a)/(YC*i*(1-i)),c=s?Math.atan2(o,a)*zC-120:NaN;return new KC(c<0?c+360:c,s,i,t.opacity)}(t):new KC(t,e,n,null==r?1:r)}function KC(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}iC(KC,XC,aC(oC,{brighter(t){return t=null==t?cC:Math.pow(cC,t),new KC(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?sC:Math.pow(sC,t),new KC(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=isNaN(this.h)?0:(this.h+120)*FC,e=+this.l,n=isNaN(this.s)?0:this.s*e*(1-e),r=Math.cos(t),i=Math.sin(t);return new AC(255*(e+n*(GC*r+WC*i)),255*(e+n*($C*r+HC*i)),255*(e+n*(YC*r)),this.opacity)}}));var ZC=t=>()=>t;function QC(t,e){return function(n){return t+n*e}}function JC(t){return 1===(t=+t)?tN:function(e,n){return n-e?function(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(r){return Math.pow(t+r*e,n)}}(e,n,t):ZC(isNaN(e)?n:e)}}function tN(t,e){var n=e-t;return n?QC(t,n):ZC(isNaN(t)?e:t)}!function t(e){var n=JC(e);function r(t,e){var r=n((t=SC(t)).r,(e=SC(e)).r),i=n(t.g,e.g),a=n(t.b,e.b),o=tN(t.opacity,e.opacity);return function(e){return t.r=r(e),t.g=i(e),t.b=a(e),t.opacity=o(e),t+""}}return r.gamma=t,r}(1);var eN,nN=(eN=function(t){var e=t.length-1;return function(n){var r=n<=0?n=0:n>=1?(n=1,e-1):Math.floor(n*e),i=t[r],a=t[r+1],o=r>0?t[r-1]:2*i-a,s=r<e-1?t[r+2]:2*a-i;return function(t,e,n,r,i){var a=t*t,o=a*t;return((1-3*t+3*a-o)*e+(4-6*a+3*o)*n+(1+3*t+3*a-3*o)*r+o*i)/6}((n-r/e)*e,o,i,a,s)}},function(t){var e,n,r=t.length,i=new Array(r),a=new Array(r),o=new Array(r);for(e=0;e<r;++e)n=SC(t[e]),i[e]=n.r||0,a[e]=n.g||0,o[e]=n.b||0;return i=eN(i),a=eN(a),o=eN(o),n.opacity=1,function(t){return n.r=i(t),n.g=a(t),n.b=o(t),n+""}});function rN(t){return function e(n){function r(e,r){var i=t((e=XC(e)).h,(r=XC(r)).h),a=tN(e.s,r.s),o=tN(e.l,r.l),s=tN(e.opacity,r.opacity);return function(t){return e.h=i(t),e.s=a(t),e.l=o(Math.pow(t,n)),e.opacity=s(t),e+""}}return n=+n,r.gamma=e,r}(1)}rN((function(t,e){var n=e-t;return n?QC(t,n>180||n<-180?n-360*Math.round(n/360):n):ZC(isNaN(t)?e:t)}));var iN=rN(tN),aN=t=>nN(t[t.length-1]),oN=new Array(3).concat("d8b365f5f5f55ab4ac","a6611adfc27d80cdc1018571","a6611adfc27df5f5f580cdc1018571","8c510ad8b365f6e8c3c7eae55ab4ac01665e","8c510ad8b365f6e8c3f5f5f5c7eae55ab4ac01665e","8c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e","8c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e","5430058c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e003c30","5430058c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e003c30").map(VP),sN=aN(oN),cN=new Array(3).concat("af8dc3f7f7f77fbf7b","7b3294c2a5cfa6dba0008837","7b3294c2a5cff7f7f7a6dba0008837","762a83af8dc3e7d4e8d9f0d37fbf7b1b7837","762a83af8dc3e7d4e8f7f7f7d9f0d37fbf7b1b7837","762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b7837","762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b7837","40004b762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b783700441b","40004b762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b783700441b").map(VP),lN=aN(cN),uN=new Array(3).concat("e9a3c9f7f7f7a1d76a","d01c8bf1b6dab8e1864dac26","d01c8bf1b6daf7f7f7b8e1864dac26","c51b7de9a3c9fde0efe6f5d0a1d76a4d9221","c51b7de9a3c9fde0eff7f7f7e6f5d0a1d76a4d9221","c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221","c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221","8e0152c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221276419","8e0152c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221276419").map(VP),fN=aN(uN),hN=new Array(3).concat("998ec3f7f7f7f1a340","5e3c99b2abd2fdb863e66101","5e3c99b2abd2f7f7f7fdb863e66101","542788998ec3d8daebfee0b6f1a340b35806","542788998ec3d8daebf7f7f7fee0b6f1a340b35806","5427888073acb2abd2d8daebfee0b6fdb863e08214b35806","5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b35806","2d004b5427888073acb2abd2d8daebfee0b6fdb863e08214b358067f3b08","2d004b5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b358067f3b08").map(VP),dN=aN(hN),pN=new Array(3).concat("ef8a62f7f7f767a9cf","ca0020f4a58292c5de0571b0","ca0020f4a582f7f7f792c5de0571b0","b2182bef8a62fddbc7d1e5f067a9cf2166ac","b2182bef8a62fddbc7f7f7f7d1e5f067a9cf2166ac","b2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac","b2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac","67001fb2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac053061","67001fb2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac053061").map(VP),gN=aN(pN),vN=new Array(3).concat("ef8a62ffffff999999","ca0020f4a582bababa404040","ca0020f4a582ffffffbababa404040","b2182bef8a62fddbc7e0e0e09999994d4d4d","b2182bef8a62fddbc7ffffffe0e0e09999994d4d4d","b2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d","b2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d","67001fb2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d1a1a1a","67001fb2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d1a1a1a").map(VP),mN=aN(vN),yN=new Array(3).concat("fc8d59ffffbf91bfdb","d7191cfdae61abd9e92c7bb6","d7191cfdae61ffffbfabd9e92c7bb6","d73027fc8d59fee090e0f3f891bfdb4575b4","d73027fc8d59fee090ffffbfe0f3f891bfdb4575b4","d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4","d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4","a50026d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4313695","a50026d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4313695").map(VP),bN=aN(yN),xN=new Array(3).concat("fc8d59ffffbf91cf60","d7191cfdae61a6d96a1a9641","d7191cfdae61ffffbfa6d96a1a9641","d73027fc8d59fee08bd9ef8b91cf601a9850","d73027fc8d59fee08bffffbfd9ef8b91cf601a9850","d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850","d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850","a50026d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850006837","a50026d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850006837").map(VP),wN=aN(xN),kN=new Array(3).concat("fc8d59ffffbf99d594","d7191cfdae61abdda42b83ba","d7191cfdae61ffffbfabdda42b83ba","d53e4ffc8d59fee08be6f59899d5943288bd","d53e4ffc8d59fee08bffffbfe6f59899d5943288bd","d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd","d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd","9e0142d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd5e4fa2","9e0142d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd5e4fa2").map(VP),EN=aN(kN),MN=new Array(3).concat("e5f5f999d8c92ca25f","edf8fbb2e2e266c2a4238b45","edf8fbb2e2e266c2a42ca25f006d2c","edf8fbccece699d8c966c2a42ca25f006d2c","edf8fbccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45006d2c00441b").map(VP),ON=aN(MN),SN=new Array(3).concat("e0ecf49ebcda8856a7","edf8fbb3cde38c96c688419d","edf8fbb3cde38c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d810f7c4d004b").map(VP),AN=aN(SN),_N=new Array(3).concat("e0f3dba8ddb543a2ca","f0f9e8bae4bc7bccc42b8cbe","f0f9e8bae4bc7bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe0868ac084081").map(VP),TN=aN(_N),PN=new Array(3).concat("fee8c8fdbb84e34a33","fef0d9fdcc8afc8d59d7301f","fef0d9fdcc8afc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301fb300007f0000").map(VP),CN=aN(PN),NN=new Array(3).concat("ece2f0a6bddb1c9099","f6eff7bdc9e167a9cf02818a","f6eff7bdc9e167a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016c59014636").map(VP),LN=aN(NN),jN=new Array(3).concat("ece7f2a6bddb2b8cbe","f1eef6bdc9e174a9cf0570b0","f1eef6bdc9e174a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0045a8d023858").map(VP),RN=aN(jN),IN=new Array(3).concat("e7e1efc994c7dd1c77","f1eef6d7b5d8df65b0ce1256","f1eef6d7b5d8df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125698004367001f").map(VP),DN=aN(IN),BN=new Array(3).concat("fde0ddfa9fb5c51b8a","feebe2fbb4b9f768a1ae017e","feebe2fbb4b9f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a017749006a").map(VP),FN=aN(BN),zN=new Array(3).concat("edf8b17fcdbb2c7fb8","ffffcca1dab441b6c4225ea8","ffffcca1dab441b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea8253494081d58").map(VP),GN=aN(zN),WN=new Array(3).concat("f7fcb9addd8e31a354","ffffccc2e69978c679238443","ffffccc2e69978c67931a354006837","ffffccd9f0a3addd8e78c67931a354006837","ffffccd9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443006837004529").map(VP),$N=aN(WN),HN=new Array(3).concat("fff7bcfec44fd95f0e","ffffd4fed98efe9929cc4c02","ffffd4fed98efe9929d95f0e993404","ffffd4fee391fec44ffe9929d95f0e993404","ffffd4fee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c02993404662506").map(VP),YN=aN(HN),VN=new Array(3).concat("ffeda0feb24cf03b20","ffffb2fecc5cfd8d3ce31a1c","ffffb2fecc5cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cbd0026800026").map(VP),UN=aN(VN),qN=new Array(3).concat("deebf79ecae13182bd","eff3ffbdd7e76baed62171b5","eff3ffbdd7e76baed63182bd08519c","eff3ffc6dbef9ecae16baed63182bd08519c","eff3ffc6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b508519c08306b").map(VP),XN=aN(qN),KN=new Array(3).concat("e5f5e0a1d99b31a354","edf8e9bae4b374c476238b45","edf8e9bae4b374c47631a354006d2c","edf8e9c7e9c0a1d99b74c47631a354006d2c","edf8e9c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45006d2c00441b").map(VP),ZN=aN(KN),QN=new Array(3).concat("f0f0f0bdbdbd636363","f7f7f7cccccc969696525252","f7f7f7cccccc969696636363252525","f7f7f7d9d9d9bdbdbd969696636363252525","f7f7f7d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525000000").map(VP),JN=aN(QN),tL=new Array(3).concat("efedf5bcbddc756bb1","f2f0f7cbc9e29e9ac86a51a3","f2f0f7cbc9e29e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a354278f3f007d").map(VP),eL=aN(tL),nL=new Array(3).concat("fee0d2fc9272de2d26","fee5d9fcae91fb6a4acb181d","fee5d9fcae91fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181da50f1567000d").map(VP),rL=aN(nL),iL=new Array(3).concat("fee6cefdae6be6550d","feeddefdbe85fd8d3cd94701","feeddefdbe85fd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d94801a636037f2704").map(VP),aL=aN(iL);var oL=iN(XC(300,.5,0),XC(-240,.5,1)),sL=iN(XC(-100,.75,.35),XC(80,1.5,.8)),cL=iN(XC(260,.75,.35),XC(80,1.5,.8)),lL=XC();var uL=SC(),fL=Math.PI/3,hL=2*Math.PI/3;function dL(t){var e=t.length;return function(n){return t[Math.max(0,Math.min(e-1,Math.floor(n*e)))]}}var pL=dL(VP("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725")),gL=dL(VP("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf")),vL=dL(VP("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4")),mL=dL(VP("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921")),yL=Object.freeze({__proto__:null,schemeCategory10:UP,schemeAccent:qP,schemeDark2:XP,schemeObservable10:KP,schemePaired:ZP,schemePastel1:QP,schemePastel2:JP,schemeSet1:tC,schemeSet2:eC,schemeSet3:nC,schemeTableau10:rC,interpolateBrBG:sN,schemeBrBG:oN,interpolatePRGn:lN,schemePRGn:cN,interpolatePiYG:fN,schemePiYG:uN,interpolatePuOr:dN,schemePuOr:hN,interpolateRdBu:gN,schemeRdBu:pN,interpolateRdGy:mN,schemeRdGy:vN,interpolateRdYlBu:bN,schemeRdYlBu:yN,interpolateRdYlGn:wN,schemeRdYlGn:xN,interpolateSpectral:EN,schemeSpectral:kN,interpolateBuGn:ON,schemeBuGn:MN,interpolateBuPu:AN,schemeBuPu:SN,interpolateGnBu:TN,schemeGnBu:_N,interpolateOrRd:CN,schemeOrRd:PN,interpolatePuBuGn:LN,schemePuBuGn:NN,interpolatePuBu:RN,schemePuBu:jN,interpolatePuRd:DN,schemePuRd:IN,interpolateRdPu:FN,schemeRdPu:BN,interpolateYlGnBu:GN,schemeYlGnBu:zN,interpolateYlGn:$N,schemeYlGn:WN,interpolateYlOrBr:YN,schemeYlOrBr:HN,interpolateYlOrRd:UN,schemeYlOrRd:VN,interpolateBlues:XN,schemeBlues:qN,interpolateGreens:ZN,schemeGreens:KN,interpolateGreys:JN,schemeGreys:QN,interpolatePurples:eL,schemePurples:tL,interpolateReds:rL,schemeReds:nL,interpolateOranges:aL,schemeOranges:iL,interpolateCividis:function(t){return t=Math.max(0,Math.min(1,t)),"rgb("+Math.max(0,Math.min(255,Math.round(-4.54-t*(35.34-t*(2381.73-t*(6402.7-t*(7024.72-2710.57*t)))))))+", "+Math.max(0,Math.min(255,Math.round(32.49+t*(170.73+t*(52.82-t*(131.46-t*(176.58-67.37*t)))))))+", "+Math.max(0,Math.min(255,Math.round(81.24+t*(442.36-t*(2482.43-t*(6167.24-t*(6614.94-2475.67*t)))))))+")"},interpolateCubehelixDefault:oL,interpolateRainbow:function(t){(t<0||t>1)&&(t-=Math.floor(t));var e=Math.abs(t-.5);return lL.h=360*t-100,lL.s=1.5-1.5*e,lL.l=.8-.9*e,lL+""},interpolateWarm:sL,interpolateCool:cL,interpolateSinebow:function(t){var e;return t=(.5-t)*Math.PI,uL.r=255*(e=Math.sin(t))*e,uL.g=255*(e=Math.sin(t+fL))*e,uL.b=255*(e=Math.sin(t+hL))*e,uL+""},interpolateTurbo:function(t){return t=Math.max(0,Math.min(1,t)),"rgb("+Math.max(0,Math.min(255,Math.round(34.61+t*(1172.33-t*(10793.56-t*(33300.12-t*(38394.49-14825.05*t)))))))+", "+Math.max(0,Math.min(255,Math.round(23.31+t*(557.33+t*(1225.33-t*(3574.96-t*(1073.77+707.56*t)))))))+", "+Math.max(0,Math.min(255,Math.round(27.2+t*(3211.1-t*(15327.97-t*(27814-t*(22569.18-6838.66*t)))))))+")"},interpolateViridis:pL,interpolateMagma:gL,interpolateInferno:vL,interpolatePlasma:mL});function bL(t,e,n,r,i,a){const{guide:o={}}=n,s=function(t,e,n){const{type:r,domain:i,range:a,quantitative:o,ordinal:s}=n;if(void 0!==r)return r;if(function(t){return RL(t,Ka)}(e))return"identity";if("string"==typeof a)return"linear";if((i||a||[]).length>2)return PL(t,s);if(void 0!==i)return LL([i])?PL(t,s):jL(e)?"time":CL(t,a,o);return LL(e)?PL(t,s):jL(e)?"time":CL(t,a,o)}(t,e,n);if("string"!=typeof s)return n;const c=function(t,e,n,r){const{domain:i}=r;if(void 0!==i)return i;switch(t){case"linear":case"time":case"log":case"pow":case"sqrt":case"quantize":case"threshold":return NL(function(t,e){const{zero:n=!1}=e;let r=1/0,i=-1/0;for(const e of t)for(const t of e)Ha(t)&&(r=Math.min(r,+t),i=Math.max(i,+t));return r===1/0?[]:n?[Math.min(0,r),i]:[r,i]}(n,r),r);case"band":case"ordinal":case"point":return function(t){return Array.from(new Set(t.flat()))}(n);case"quantile":return function(t){return t.flat().sort()}(n);case"sequential":return NL(function(t){let e=1/0,n=-1/0;for(const r of t)for(const t of r)Ha(t)&&(e=Math.min(e,+t),n=Math.max(n,+t));return e===1/0?[]:[e<0?-n:e,n]}(n),r);default:return[]}}(s,0,e,n),l=function(t,e,n){const{ratio:r}=n;if(null==r)return e;if(SL({type:t}))return function(t,e,n){const r=t.map(Number),i=new ca({domain:r,range:[r[0],r[0]+(r[r.length-1]-r[0])*e]});return"time"===n?t.map((t=>new Date(i.map(t)))):t.map((t=>i.map(t)))}(e,r,t);return AL({type:t})?function(t,e){const n=Math.round(t.length*e);return t.slice(0,n)}(e,r):e}(s,c,n);return Object.assign(Object.assign(Object.assign({},n),function(t,e,n,r,i){switch(t){case"linear":case"time":case"log":case"pow":case"sqrt":return function(t,e){const{interpolate:n=Ci,nice:r=!1,tickCount:i=5}=e;return Object.assign(Object.assign({},e),{interpolate:n,nice:r,tickCount:i})}(0,r);case"band":case"point":return function(t,e,n,r){if(void 0!==r.padding||void 0!==r.paddingInner||void 0!==r.paddingOuter)return Object.assign(Object.assign({},r),{unknown:NaN});const i=function(t,e,n){return"enterDelay"===e||"enterDuration"===e||"size"===e?0:"band"===t?$P(n)?0:.1:"point"===t?.5:0}(t,e,n),{paddingInner:a=i,paddingOuter:o=i}=r;return Object.assign(Object.assign({},r),{paddingInner:a,paddingOuter:o,padding:i,unknown:NaN})}(t,e,i,r);case"sequential":return function(t){const{palette:e="ylGnBu",offset:n}=t,r=$(e),i=yL[`interpolate${r}`];if(!i)throw new Error(`Unknown palette: ${r}`);return{interpolator:n?t=>i(n(t)):i}}(r);default:return r}}(s,t,0,n,r)),{domain:l,range:_L(s,t,e,n,l,i,a),expectedDomain:c,guide:o,name:t,type:s})}function xL(t,e){const n={};for(const r of t){const{values:t,name:i}=r,a=e[i];for(const e of t){const{name:t,value:r}=e;n[t]=r.map((t=>a.map(t)))}}return n}function wL(t,e){const n=Object.keys(t);for(const r of Object.values(e)){const{name:e}=r.getOptions();if(e in t){const i=n.filter((t=>t.startsWith(e))).map((t=>+(t.replace(e,"")||0))),a=gr(i)+1,o=`${e}${a}`;t[o]=r,r.getOptions().key=o}else t[e]=r}return t}function kL(t,e){const[n]=DP("scale",e),{relations:r}=t,[i]=function(t){if(!t||!Array.isArray(t))return[Fa,Fa];let e,n;return[r=>{var i;e=r.map.bind(r),n=null===(i=r.invert)||void 0===i?void 0:i.bind(r);const a=t.filter((([t])=>"function"==typeof t)),o=t.filter((([t])=>"function"!=typeof t)),s=new Map(o);if(r.map=t=>{for(const[e,n]of a)if(e(t))return n;return s.has(t)?s.get(t):e(t)},!n)return r;const c=new Map(o.map((([t,e])=>[e,t]))),l=new Map(a.map((([t,e])=>[e,t])));return r.invert=t=>l.has(t)?t:c.has(t)?c.get(t):n(t),r},t=>(null!==e&&(t.map=e),null!==n&&(t.invert=n),t)]}(r);return i(n(t))}function EL(t){const e=t.flatMap((t=>Array.from(t.values()))).flatMap((t=>t.channels.map((t=>t.scale))));OL(e,"x"),OL(e,"y")}function ML(t){const{channels:e=[],type:n,scale:r={}}=t,i=["shape","color","opacity","size"];return 0!==e.length?e:"axisX"===n?["x"]:"axisY"===n?["y"]:"legends"===n?Object.keys(r).filter((t=>i.includes(t))):[]}function OL(t,e){const n=t.filter((({name:t,facet:n=!0})=>n&&t===e)),r=n.flatMap((t=>t.domain)),i=n.every(SL)?Un(r):n.every(AL)?Array.from(new Set(r)):null;if(null!==i)for(const t of n)t.domain=i}function SL(t){const{type:e}=t;if("string"!=typeof e)return!1;return["linear","log","pow","time"].includes(e)}function AL(t){const{type:e}=t;if("string"!=typeof e)return!1;return["band","point","ordinal"].includes(e)}function _L(t,e,n,r,i,a,o){const{range:s}=r;if("string"==typeof s)return function(t){return t.split("-")}(s);if(void 0!==s)return s;const{rangeMin:c,rangeMax:l}=r;switch(t){case"linear":case"time":case"log":case"pow":case"sqrt":{const t=TL(n,r,i,a,o),[s,u]=function(t,e){return"enterDelay"===t?[0,1e3]:"enterDuration"==t?[300,1e3]:t.startsWith("y")||t.startsWith("position")?[1,0]:"color"===t?[eo(e),no(e)]:"opacity"===t?[0,1]:"size"===t?[1,10]:[0,1]}(e,t);return[null!=c?c:s,null!=l?l:u]}case"band":case"point":return[null!=c?c:"size"===e?5:0,null!=l?l:"size"===e?10:1];case"ordinal":return TL(n,r,i,a,o);case"sequential":return;case"constant":return[n[0][0]];default:return[]}}function TL(t,e,n,r,i){const[a]=DP("palette",i),{category10:o,category20:s}=r,c=function(t){return Array.from(new Set(t))}(n).length<=o.length?o:s,{palette:l=c,offset:u}=e;if(Array.isArray(l))return l;try{return a({type:l})}catch(t){const e=function(t,e,n=t=>t){if(!t)return null;const r=$(t),i=yL[`scheme${r}`],a=yL[`interpolate${r}`];if(!i&&!a)return null;if(i){if(!i.some(Array.isArray))return i;const t=i[e.length];if(t)return t}return e.map(((t,r)=>a(n(r/e.length))))}(l,n,u);if(e)return e;throw new Error(`Unknown Component: ${l} `)}}function PL(t,e){return e||(function(t){return t.startsWith("x")||t.startsWith("y")||t.startsWith("position")||t.startsWith("size")}(t)?"point":"ordinal")}function CL(t,e,n){return n||("color"!==t||e?"linear":"sequential")}function NL(t,e){if(0===t.length)return t;const{domainMin:n,domainMax:r}=e,[i,a]=t;return[null!=n?n:i,null!=r?r:a]}function LL(t){return RL(t,(t=>{const e=typeof t;return"string"===e||"boolean"===e}))}function jL(t){return RL(t,(t=>t instanceof Date))}function RL(t,e){for(const n of t)if(n.some(e))return!0;return!1}const IL={linear:"linear",identity:"identity",log:"log",pow:"pow",sqrt:"sqrt",sequential:"sequential"},DL={threshold:"threshold",quantize:"quantize",quantile:"quantile"},BL={ordinal:"ordinal",band:"band",point:"point"},FL={constant:"constant"};function zL(t,e,n){const{coordinates:r=[],title:i}=e,[,a]=DP("component",n),o=t.filter((({guide:t})=>null!==t)),s=[],c=function(t,e,n){const[,r]=DP("component",n),{coordinates:i}=t;function a(t,e,n,a){const o=function(t,e,n=[]){return"x"===t?WP(n)?`${e}Y`:`${e}X`:"y"===t?WP(n)?`${e}X`:`${e}Y`:null}(e,t,i);if(!a||!o)return;const{props:s}=r(o),{defaultPosition:c,defaultSize:l,defaultOrder:u,defaultCrossPadding:[f]}=s;return Object.assign(Object.assign({position:c,defaultSize:l,order:u,type:o,crossPadding:f},a),{scales:[n]})}return e.filter((t=>t.slider||t.scrollbar)).flatMap((t=>{const{slider:e,scrollbar:n,name:r}=t;return[a("slider",r,t,e),a("scrollbar",r,t,n)]})).filter((t=>!!t))}(e,t,n);if(s.push(...c),i){const{props:t}=a("title"),{defaultPosition:e,defaultOrientation:n,defaultOrder:r,defaultSize:o,defaultCrossPadding:c}=t,l="string"==typeof i?{title:i}:i;s.push(Object.assign({type:"title",position:e,orientation:n,order:r,crossPadding:c[0],defaultSize:o},l))}const l=function(t,e){const n=t.filter((t=>function(t){if(!t||!t.type)return!1;if("function"==typeof t.type)return!0;const{type:e,domain:n,range:r,interpolator:i}=t,a=n&&n.length>0,o=r&&r.length>0;return!!(["linear","sqrt","log","time","pow","threshold","quantize","quantile","ordinal","band","point"].includes(e)&&a&&o)||!(!["sequential"].includes(e)||!a||!o&&!i)||!(!["constant","identity"].includes(e)||!o)}(t)));return[...$L(n),...YL(n,e)]}(o,r);return l.forEach((([t,e])=>{const{props:n}=a(t),{defaultPosition:i,defaultPlane:c="xy",defaultOrientation:l,defaultSize:u,defaultOrder:f,defaultLength:h,defaultPadding:d=[0,0],defaultCrossPadding:p=[0,0]}=n,g=Q({},...e),{guide:v,field:m}=g,y=Array.isArray(v)?v:[v];for(const n of y){const[a,g]=qL(t,i,l,n,e,o,r);if(!a&&!g)continue;const v="left"===a||"right"===a,y=v?d[1]:d[0],b=v?p[1]:p[0],{size:x,order:w=f,length:k=h,padding:E=y,crossPadding:M=b}=n;s.push(Object.assign(Object.assign({title:m},n),{defaultSize:u,length:k,position:a,plane:c,orientation:g,padding:E,order:w,crossPadding:M,size:x,type:t,scales:e}))}})),s}function GL(t,e,n,r,i){const[a]=DP("component",r),{scaleInstances:o,scale:s,bbox:c}=t,l={bbox:c,library:r};return a(Le(t,["scaleInstances","scale","bbox"]))({coordinate:e,library:r,markState:i,scales:o,theme:n,value:l,scale:s})}function WL(t,e){const n=["left","right","bottom","top"],r=Jn(t,(({type:t,position:e,group:r})=>n.includes(e)?void 0===r?t.startsWith("legend")?`legend-${e}`:Symbol("independent"):"independent"===r?Symbol("independent"):r:Symbol("independent")));return r.flatMap((([,t])=>{if(1===t.length)return t[0];if(void 0!==e){const n=t.filter((t=>void 0!==t.length)).map((t=>t.length)),r=Mr(n);if(r>e)return t.forEach((t=>t.group=Symbol("independent"))),t;const i=(e-r)/(t.length-n.length);t.forEach((t=>{void 0===t.length&&(t.length=i)}))}const n=gr(t,(t=>t.size)),r=gr(t,(t=>t.order)),i=gr(t,(t=>t.crossPadding));return{type:"group",size:n,order:r,position:t[0].position,children:t,crossPadding:i}}))}function $L(t,e){const n=["shape","size","color","opacity"],r=t.filter((({type:t,name:e})=>"string"==typeof t&&n.includes(e)&&!((t,e)=>"constant"===t&&"size"===e)(t,e))),i=r.filter((({type:t})=>"constant"===t)),a=Jn(r.filter((({type:t})=>"constant"!==t)),(t=>t.field?t.field:Symbol("independent"))).map((([t,e])=>[t,[...e,...i]])).filter((([,t])=>t.some((t=>"constant"!==t.type)))),o=new Map(a);if(0===o.size)return[];const s=t=>t.sort((([t],[e])=>t.localeCompare(e))),c=Array.from(o).map((([,t])=>{const e=function(t){if(1===t.length)return[t];const e=[];for(let n=1;n<=t.length;n++)e.push(...io(t,n));return e}(t).sort(((t,e)=>e.length-t.length)),n=e.map((t=>({combination:t,option:t.map((t=>[t.name,HL(t)]))})));for(const{option:t,combination:e}of n)if(!t.every((t=>"constant"===t[1]))&&t.every((t=>"discrete"===t[1]||"constant"===t[1])))return["legendCategory",e];for(const[t,e]of G_)for(const{option:r,combination:i}of n)if(e.some((t=>et(s(t),s(r)))))return[t,i];return null})).filter(Ha);return c}function HL(t){const{type:e}=t;return"string"!=typeof e?null:e in IL?"continuous":e in BL?"discrete":e in DL?"distribution":e in FL?"constant":null}function YL(t,e){return t.map((t=>{const{name:n}=t;if(function(t){return zP(t,"helix").length>0}(e)||$P(e))return null;if(WP(e)&&(GP(e)||HP(e)))return null;if(n.startsWith("x"))return GP(e)?["axisArc",[t]]:HP(e)?["axisLinear",[t]]:[WP(e)?"axisY":"axisX",[t]];if(n.startsWith("y"))return GP(e)?["axisLinear",[t]]:HP(e)?["axisArc",[t]]:[WP(e)?"axisX":"axisY",[t]];if(n.startsWith("z"))return["axisZ",[t]];if(n.startsWith("position")){if(YP(e))return["axisRadar",[t]];if(!GP(e))return["axisY",[t]]}return null})).filter(Ha)}function VL(t){const e=zP(t,"polar");if(e.length){const t=e[e.length-1],{startAngle:r,endAngle:i}=n(t);return[r,i]}const r=zP(t,"radial");if(r.length){const t=r[r.length-1],{startAngle:e,endAngle:n}=s(t);return[e,n]}return[-Math.PI/2,Math.PI/2*3]}function UL(t,e,n,r,i){const{name:a}=n[0];if("axisRadar"===t){const t=r.filter((t=>t.name.startsWith("position"))),e=function(t){const e=/position(\d*)/g.exec(t);return e?+e[1]:null}(a);if(null===e)return[null,null];const[n,o]=VL(i);return["center",(o-n)/(YP(i)?t.length:t.length-1)*e+n]}if("axisY"===t&&function(t){return zP(t,"parallel").length>0}(i))return WP(i)?["center","horizontal"]:["center","vertical"];if("axisLinear"===t){const[t]=VL(i);return["center",t]}return"axisArc"===t?"inner"===e[0]?["inner",null]:["outer",null]:GP(i)||HP(i)?["center",null]:"axisX"===t&&function(t){return zP(t,"reflect").length>0}(i)||"axisX"===t&&function(t){return zP(t,"reflectY").length>0}(i)?["top",null]:e}function qL(t,e,n,r,i,a,o){const[s]=VL(o),c=[r.position||e,null!=s?s:n];return"string"==typeof t&&t.startsWith("axis")?UL(t,c,i,a,o):"string"==typeof t&&t.startsWith("legend")&&GP(o)&&"center"===r.position?["center","vertical"]:c}function XL(t,e,n,r,i,a){const{type:o}=t;if(!["left","right","bottom","top"].includes(r))return;if("string"!=typeof o)return;const s=o;return(s.startsWith("axis")?tj:s.startsWith("group")?KL:s.startsWith("legendContinuous")?ej:"legendCategory"===s?nj:s.startsWith("slider")?JL:"title"===s?QL:s.startsWith("scrollbar")?ZL:()=>{})(t,e,n,r,i,a)}function KL(t,e,n,r,i,a){const{children:o}=t,s=gr(o,(t=>t.crossPadding));o.forEach((t=>t.crossPadding=s)),o.forEach((t=>XL(t,e,n,r,i,a)));const c=gr(o,(t=>t.size));t.size=c,o.forEach((t=>t.size=c))}function ZL(t,e,n,r,i,a){const{trackSize:o=6}=Q({},i.scrollbar,t);t.size=o}function QL(t,e,n,r,i,a){const o=Q({},i.title,t),{title:s,subtitle:c,spacing:l=0}=o,u=Le(o,["title","subtitle","spacing"]);if(s){const e=cj(s,Va(u,"title"));t.size=e.height}if(c){const e=cj(c,Va(u,"subtitle"));t.size+=l+e.height}}function JL(t,e,n,r,i,a){const{trackSize:o,handleIconSize:s}=(()=>{const{slider:e}=i;return Q({},e,t)})(),c=Math.max(o,2.4*s);t.size=c}function tj(t,e,n,r,i,a){var o;t.transform=t.transform||[{type:"hide"}];const s="left"===r||"right"===r,c=oj(t,r,i),{tickLength:l=0,labelSpacing:u=0,titleSpacing:f=0,labelAutoRotate:h}=c,d=Le(c,["tickLength","labelSpacing","titleSpacing","labelAutoRotate"]),p=rj(t,a),g=ij(d,p),v=l+u;if(g&&g.length){const r=gr(g,(t=>t.width)),i=gr(g,(t=>t.height));if(s)t.size=r+v;else{const{tickFilter:a,labelTransform:s}=t;!function(t,e,n,r,i){const a=Mr(e,(t=>t.width));if(a>n)return!0;const o=t.clone();o.update({range:[0,n]});const s=sj(t,i),c=s.map((t=>o.map(t)+function(t,e){if(!t.getBandWidth)return 0;const n=t.getBandWidth(e)/2;return n}(o,t))),l=s.map(((t,e)=>e)),u=-r[0],f=n+r[1],h=(t,e)=>{const{width:n}=e;return[t-n/2,t+n/2]};for(let t=0;t<l.length;t++){const n=c[t],[r,i]=h(n,e[t]);if(r<u||i>f)return!0;const a=c[t+1];if(a){const[n]=h(a,e[t+1]);if(i>n)return!0}}return!1}(p,g,e,n,a)||s||!1===h||null===h?(t.labelTransform=null!==(o=t.labelTransform)&&void 0!==o?o:"rotate(0)",t.size=i+v):(t.labelTransform="rotate(90)",t.size=r+v)}}else t.size=l;const m=aj(d);m&&(t.size+=s?f+m.width:f+m.height)}function ej(t,e,n,r,i,a){const o=(()=>{const{legendContinuous:e}=i;return Q({},e,t)})(),{labelSpacing:s=0,titleSpacing:c=0}=o,l=Le(o,["labelSpacing","titleSpacing"]),u="left"===r||"right"===r,f=Va(l,"ribbon"),{size:h}=f,d=Va(l,"handleIcon"),{size:p}=d,g=Math.max(h,2.4*p);t.size=g;const v=ij(l,rj(t,a));if(v){const e=u?"width":"height",n=gr(v,(t=>t[e]));t.size+=n+s}const m=aj(l);m&&(u?t.size=Math.max(t.size,m.width):t.size+=c+m.height)}function nj(t,e,n,r,i,a){const o=(()=>{const{legendCategory:e}=i,{title:n}=t,[r,a]=Array.isArray(n)?[n,void 0]:[void 0,n];return Q({title:r},e,Object.assign(Object.assign({},t),{title:a}))})(),{itemSpacing:s,itemMarkerSize:c,titleSpacing:l,rowPadding:u,colPadding:f,maxCols:h=1/0,maxRows:d=1/0}=o,p=Le(o,["itemSpacing","itemMarkerSize","titleSpacing","rowPadding","colPadding","maxCols","maxRows"]),{cols:g,length:v}=t,m=t=>Math.min(t,d),y=t=>Math.min(t,h),b="left"===r||"right"===r,x=void 0===v?e+(b?0:n[0]+n[1]):v,w=aj(p),k=ij(p,rj(t,a),"itemLabel"),E=Math.max(k[0].height,c)+u,M=(t,e=0)=>c+t+s[0]+e;b?(()=>{let e=-1/0,n=0,r=1,i=0,a=-1/0,o=-1/0;const s=w?w.height:0,c=x-s;for(const{width:t}of k){const s=M(t,f);e=Math.max(e,s),n+E>c?(r++,a=Math.max(a,i),o=Math.max(o,n),i=1,n=E):(n+=E,i++)}r<=1&&(a=i,o=n),t.size=e*y(r),t.length=o+s,Q(t,{cols:y(r),gridRow:a})})():"number"==typeof g?(()=>{const e=Math.ceil(k.length/g),n=gr(k,(t=>M(t.width)))*g;t.size=E*m(e)-u,t.length=Math.min(n,x)})():(()=>{let e=1,n=0,r=-1/0;for(const{width:t}of k){const i=M(t,f);n+i>x?(r=Math.max(r,n),n=i,e++):n+=i}1===e&&(r=n),t.size=E*m(e)-u,t.length=r})(),w&&(b?t.size=Math.max(t.size,w.width):t.size+=l+w.height)}function rj(t,e){const[n]=DP("scale",e),{scales:r,tickCount:i,tickMethod:a}=t,o=r.find((t=>"constant"!==t.type&&"identity"!==t.type));return void 0!==i&&(o.tickCount=i),void 0!==a&&(o.tickMethod=a),n(o)}function ij(t,e,n="label"){const{labelFormatter:r,tickFilter:i,label:a=!0}=t,o=Le(t,["labelFormatter","tickFilter","label"]);if(!a)return null;const s=function(t,e,n){const r=sj(t,n),i=r.map((t=>"number"==typeof t?cm(t):t)),a=e?"string"==typeof e?bO(e):e:t.getFormatter?t.getFormatter():t=>`${t}`;return i.map(a)}(e,r,i),c=Va(o,n),l=s.map(((t,e)=>Object.fromEntries(Object.entries(c).map((([n,r])=>[n,"function"==typeof r?r(t,e):r]))))),u=s.map(((t,e)=>cj(t,l[e]))),f=l.some((t=>t.transform));if(!f){const e=s.map(((t,e)=>e));t.indexBBox=new Map(e.map((t=>[t,[s[t],u[t]]])))}return u}function aj(t){const{title:e}=t,n=Le(t,["title"]);if((t=>!1===t||null===t)(e)||void 0===e)return null;const r=Va(n,"title"),{direction:i,transform:a}=r,o=Array.isArray(e)?e.join(","):e;if("string"!=typeof o)return null;return cj(o,Object.assign(Object.assign({},r),{transform:a||("vertical"===i?"rotate(-90)":"")}))}function oj(t,e,n){const{title:r}=t,[i,a]=Array.isArray(r)?[r,void 0]:[void 0,r],{axis:o,[`axis${Ga(e)}`]:s}=n;return Q({title:i},o,s,Object.assign(Object.assign({},t),{title:a}))}function sj(t,e){const n=t.getTicks?t.getTicks():t.getOptions().domain;return e?n.filter(e):n}function cj(t,e){const n=function(t){return t instanceof Sg?t:new Yg({style:{text:`${t}`}})}(t),r=Le(e,["filter"]);n.attr(Object.assign(Object.assign({},r),{visibility:"none"}));return n.getBBox()}function lj(t,e,n,r){var i,a;const{width:o,height:s,depth:c,x:l=0,y:u=0,z:f=0,inset:h=(null!==(i=n.inset)&&void 0!==i?i:0),insetLeft:d=h,insetTop:p=h,insetBottom:g=h,insetRight:v=h,margin:m=(null!==(a=n.margin)&&void 0!==a?a:0),marginLeft:y=m,marginBottom:b=m,marginTop:x=m,marginRight:w=m,padding:k=n.padding,paddingBottom:E=k,paddingLeft:M=k,paddingRight:O=k,paddingTop:S=k}=function(t,e,n,r){const{coordinates:i}=e;if(!GP(i)&&!HP(i))return e;const a=t.filter((t=>"string"==typeof t.type&&t.type.startsWith("axis")));if(0===a.length)return e;const o=a.map((t=>oj(t,"axisArc"===t.type?"arc":"linear",n))),s=gr(o,(t=>{var e;return null!==(e=t.labelSpacing)&&void 0!==e?e:0})),c=a.flatMap(((t,e)=>ij(o[e],rj(t,r)))).filter(Ha),l=gr(c,(t=>t.height))+s,u=a.flatMap(((t,e)=>aj(o[e]))).filter((t=>null!==t)),f=0===u.length?0:gr(u,(t=>t.height)),{inset:h=l,insetLeft:d=h,insetBottom:p=h,insetTop:g=h+f,insetRight:v=h}=e;return Object.assign(Object.assign({},e),{insetLeft:d,insetBottom:p,insetTop:g,insetRight:v})}(t,e,n,r),A=(t,n,r,i,a)=>{const{marks:o}=e;if(0===o.length)return[i,a];if(t-i-a-.25*t>0)return[i,a];const s=.75*t;return["auto"===n?s*i/(i+a):i,"auto"===r?s*a/(i+a):a]},_=t=>"auto"===t?20:null!=t?t:20,T=_(S),P=_(E),C=uj(t,s-T-P,[T+x,P+b],["left","right"],e,n,r),{paddingLeft:N,paddingRight:L}=C,j=o-y-w,[R,I]=A(j,M,O,N,L),D=j-R-I,B=uj(t,D,[R+y,I+w],["bottom","top"],e,n,r),{paddingTop:F,paddingBottom:z}=B,G=s-b-x,[W,$]=A(G,E,S,z,F);return{width:o,height:s,depth:c,insetLeft:d,insetTop:p,insetBottom:g,insetRight:v,innerWidth:D,innerHeight:G-W-$,paddingLeft:R,paddingRight:I,paddingTop:$,paddingBottom:W,marginLeft:y,marginBottom:b,marginTop:x,marginRight:w,x:l,y:u,z:f}}function uj(t,e,n,r,i,a,o){const s=Qn(t,(t=>t.position)),{padding:c=a.padding,paddingLeft:l=c,paddingRight:u=c,paddingBottom:f=c,paddingTop:h=c}=i,d={paddingBottom:f,paddingLeft:l,paddingTop:h,paddingRight:u};for(const t of r){const r=`padding${Ga(ly(t))}`,i=s.get(t)||[],c=d[r],l=t=>{void 0===t.size&&(t.size=t.defaultSize)},u=t=>{"group"===t.type?(t.children.forEach(l),t.size=gr(t.children,(t=>t.size))):t.size=t.defaultSize},f=r=>{r.size||("auto"!==c?u(r):(XL(r,e,n,t,a,o),l(r)))},h=t=>{t.type.startsWith("axis")&&void 0===t.labelAutoHide&&(t.labelAutoHide=!0)},p="bottom"===t||"top"===t,g=mr(i,(t=>t.order)),v=i.filter((t=>t.type.startsWith("axis")&&t.order==g));if(v.length&&(v[0].crossPadding=0),"number"==typeof c)i.forEach(l),i.forEach(h);else if(0===i.length)d[r]=0;else{const t=WL(i,p?e+n[0]+n[1]:e);t.forEach(f);const a=t.reduce(((t,{size:e,crossPadding:n=12})=>t+e+n),0);d[r]=a}}return d}function fj({width:t,height:e,paddingLeft:n,paddingRight:r,paddingTop:i,paddingBottom:a,marginLeft:o,marginTop:s,marginBottom:c,marginRight:l,innerHeight:u,innerWidth:f,insetBottom:h,insetLeft:d,insetRight:p,insetTop:g}){const v=n+o,m=i+s,y=r+l,b=a+c,x=t-o-l,w=[v+d,m+g,f-d-p,u-g-h,"center",null,null];return{top:[v,0,f,m,"vertical",!0,Rn,o,x],right:[t-y,m,y,u,"horizontal",!1,Rn],bottom:[v,e-b,f,b,"vertical",!1,Rn,o,x],left:[0,m,v,u,"horizontal",!0,Rn],"top-left":[v,0,f,m,"vertical",!0,Rn],"top-right":[v,0,f,m,"vertical",!0,Rn],"bottom-left":[v,e-b,f,b,"vertical",!1,Rn],"bottom-right":[v,e-b,f,b,"vertical",!1,Rn],center:w,inner:w,outer:w}}function hj(t,e,n,r){const[i,a]=ro(t,(t=>!("string"!=typeof t.type||!t.type.startsWith("axis"))));!function(t,e,n,r){"center"===r?function(t){return Kc(t)&&Uc(t)}(e)?function(t,e,n){const[r,i,a,o]=n;for(const e of t)e.bbox={x:r,y:i,width:a,height:o},e.radar={index:t.indexOf(e),count:t.length}}(t,0,n):Uc(e)?function(t,e,n){const[r,i,a,o]=n;for(const e of t)e.bbox={x:r,y:i,width:a,height:o}}(t,0,n):Kc(e)&&function(t,e,n,r){"horizontal"===r?function(t,e,n){const[r,i,a]=n,o=new Array(t.length).fill(0),s=e.map(o),c=s.filter(((t,e)=>e%2==1)).map((t=>t+i));for(let e=0;e<t.length;e++){const n=t[e],i=c[e],o=c[e+1]-i;n.bbox={x:r,y:i,width:a,height:o}}}(t,e,n):"vertical"===r&&function(t,e,n){const[r,i,,a]=n,o=new Array(t.length).fill(0),s=e.map(o),c=s.filter(((t,e)=>e%2==0)).map((t=>t+r));for(let e=0;e<t.length;e++){const n=t[e],r=c[e],o=c[e+1]-r;n.bbox={x:r,y:i,width:o,height:a}}}(t,e,n)}(t,e,n,t[0].orientation):"inner"===r?function(t,e,n){const[r,i,,a]=n,[o,s]=e.getCenter(),[c]=Jc(e),l=a/2,u=c*l,f=o-u,h=s-u;for(let e=0;e<t.length;e++){t[e].bbox={x:r+f,y:i+h,width:2*u,height:2*u}}}(t,e,n):"outer"===r&&function(t,e,n){const[r,i,a,o]=n;for(const e of t)e.bbox={x:r,y:i,width:a,height:o}}(t,0,n)}(i,e,n,r),function(t,e,n){if(0===t.length)return;const[r,i,a,o]=n,[s]=Jc(e),c=o/2*s/Math.sqrt(2),l=r+a/2,u=i+o/2;for(let e=0;e<t.length;e++){t[e].bbox={x:l-c,y:u-c,width:2*c,height:2*c}}}(a,e,n)}function dj(t,e,n){const[r,i,a,o,s,c,l,u,f]=n,[h,d,p,g,v,m,y,b]="vertical"===s?["y",i,"x",r,"height",o,"width",a]:["x",r,"y",i,"width",a,"height",o];t.sort(((t,e)=>null==l?void 0:l(t.order,e.order)));const x=t=>"title"===t||"group"===t||t.startsWith("legend"),w=(t,e,n)=>void 0===n?e:x(t)?n:e,k=(t,e,n)=>void 0===n?e:x(t)?n:e;for(let e=0,n=c?d+m:d;e<t.length;e++){const r=t[e],{crossPadding:i=0,type:a}=r,{size:o}=r;r.bbox={[h]:c?n-o-i:n+i,[p]:k(a,g,u),[v]:o,[y]:w(a,b,f)},n+=(o+i)*(c?-1:1)}const E=t.filter((t=>"group"===t.type));for(const t of E){const{bbox:e,children:n}=t,r=e[y],i=r/n.length,a=n.reduce(((t,e)=>{var n;const r=null===(n=e.layout)||void 0===n?void 0:n.justifyContent;return r||t}),"flex-start"),o=n.map(((t,e)=>{const{length:r=i,padding:a=0}=t;return r+(e===n.length-1?0:a)})),s=r-Mr(o),c="flex-start"===a?0:"center"===a?s/2:s;for(let t=0,r=e[p]+c;t<n.length;t++){const i=n[t],{padding:s=0}=i,c=t===n.length-1?0:s;i.bbox={[v]:e[v],[h]:e[h],[p]:r,[y]:o[t]-c},Q(i,{layout:{justifyContent:a}}),r+=o[t]}}}const pj=Symbol("CALLBACK_ITEM");function gj(t,e,n){const{encode:r={},scale:i={},transform:a=[]}=e,o=Le(e,["encode","scale","transform"]);return[t,Object.assign(Object.assign({},o),{encode:r,scale:i,transform:a})]}function vj(t,e,n){return Re(this,void 0,void 0,(function*(){const{library:t}=n,{data:r}=e,[i]=DP("data",t),a=function(t){if(I(t))return{type:"inline",value:t};if(!t)return{type:"inline",value:null};if(Array.isArray(t))return{type:"inline",value:t};const{type:e="inline"}=t,n=Le(t,["type"]);return Object.assign(Object.assign({},n),{type:e})}(r),{transform:o=[]}=a,s=[Le(a,["transform"]),...o].map((t=>i(t,n))),c=yield function(t){return t.reduce(((t,e)=>n=>Re(this,void 0,void 0,(function*(){const r=yield t(n);return e(r)}))),Fa)}(s)(r),l=!r||Array.isArray(r)||Array.isArray(c)?c:{value:c};return[Array.isArray(c)?to(c):[],Object.assign(Object.assign({},e),{data:l})]}))}function mj(t,e,n){const{encode:r}=e;if(!r)return[t,e];const i={};for(const[t,e]of Object.entries(r))if(Array.isArray(e))for(let n=0;n<e.length;n++){i[`${t}${0===n?"":n}`]=e[n]}else i[t]=e;return[t,Object.assign(Object.assign({},e),{encode:i})]}function yj(t,e,n){const{encode:r,data:i}=e;if(!r)return[t,e];const a=Ja(r,(t=>{if(function(t){if("object"!=typeof t||t instanceof Date||null===t)return!1;const{type:e}=t;return Ha(e)}(t))return t;const e=function(t,e){return"function"==typeof e?"transform":"string"==typeof e&&function(t,e){return!!Array.isArray(t)&&t.some((t=>void 0!==t[e]))}(t,e)?"field":"constant"}(i,t);return{type:e,value:t}}));return[t,Object.assign(Object.assign({},e),{encode:a})]}function bj(t,e,n){const{encode:r}=e;if(!r)return[t,e];const i=Ja(r,((t,e)=>{const{type:n}=t;return"constant"!==n||function(t){return t.startsWith("x")||t.startsWith("y")||t.startsWith("position")||"enterDelay"===t||"enterDuration"===t||"updateDelay"===t||"updateDuration"===t||"exitDelay"===t||"exitDuration"===t}(e)?t:Object.assign(Object.assign({},t),{constant:!0})}));return[t,Object.assign(Object.assign({},e),{encode:i})]}function xj(t,e,n){const{encode:r,data:i}=e;if(!r)return[t,e];const{library:a}=n,o=function(t){const[e]=DP("encode",t);return(t,n)=>void 0===n||void 0===t?null:Object.assign(Object.assign({},n),{type:"column",value:e(n)(t),field:Aj(n)})}(a),s=Ja(r,(t=>o(i,t)));return[t,Object.assign(Object.assign({},e),{encode:s})]}function wj(t,e,n){const{tooltip:r={}}=e;return Za(r)?[t,e]:Array.isArray(r)?[t,Object.assign(Object.assign({},e),{tooltip:{items:r}})]:Ka(r)&&function(t){if(0===Object.keys(t).length)return!0;const{title:e,items:n}=t;return void 0!==e||void 0!==n}(r)?[t,Object.assign(Object.assign({},e),{tooltip:r})]:[t,Object.assign(Object.assign({},e),{tooltip:{items:[r]}})]}function kj(t,e,n){const{data:r,encode:i,tooltip:a={}}=e;if(Za(a))return[t,e];const o=e=>{if(!e)return e;if("string"==typeof e)return t.map((t=>({name:e,value:r[t][e]})));if(Ka(e)){const{field:n,channel:a,color:o,name:s=n,valueFormatter:c=t=>t}=e,l="string"==typeof c?bO(c):c,u=a&&i[a],f=u&&i[a].field,h=s||f||a,d=[];for(const e of t){const t=n?r[e][n]:u?i[a].value[e]:null;d[e]={name:h,color:o,value:l(t)}}return d}if("function"==typeof e){const n=[];for(const a of t){const t=e(r[a],a,r,i);Ka(t)?n[a]=Object.assign(Object.assign({},t),{[pj]:!0}):n[a]={value:t}}return n}return e},{title:s,items:c=[]}=a,l=Le(a,["title","items"]),u=Object.assign({title:o(s),items:Array.isArray(c)?c.map(o):[]},l);return[t,Object.assign(Object.assign({},e),{tooltip:u})]}function Ej(t,e,n){const{encode:r}=e,i=Le(e,["encode"]);if(!r)return[t,e];const a=Object.entries(r),o=a.filter((([,t])=>{const{value:e}=t;return Array.isArray(e[0])})).flatMap((([e,n])=>{const r=[[e,new Array(t.length).fill(void 0)]],{value:i}=n,a=Le(n,["value"]);for(let n=0;n<i.length;n++){const a=i[n];if(Array.isArray(a))for(let i=0;i<a.length;i++){const o=r[i]||[`${e}${i}`,new Array(t).fill(void 0)];o[1][n]=a[i],r[i]=o}}return r.map((([t,e])=>[t,Object.assign({type:"column",value:e},a)]))})),s=Object.fromEntries([...a,...o]);return[t,Object.assign(Object.assign({},i),{encode:s})]}function Mj(t,e,n){const{axis:r={},legend:i={},slider:a={},scrollbar:o={}}=e,s=(t,e)=>{if("boolean"==typeof t)return t?{}:null;const n=t[e];return void 0===n||n?n:null},c="object"==typeof r?Array.from(new Set(["x","y","z",...Object.keys(r)])):["x","y","z"];return Q(e,{scale:Object.assign(Object.assign({},Object.fromEntries(c.map((t=>{const e=s(o,t);return[t,Object.assign({guide:s(r,t),slider:s(a,t),scrollbar:e},e&&{ratio:void 0===e.ratio?.5:e.ratio})]})))),{color:{guide:s(i,"color")},size:{guide:s(i,"size")},shape:{guide:s(i,"shape")},opacity:{guide:s(i,"opacity")}})}),[t,e]}function Oj(t,e,n){const{animate:r}=e;return r||void 0===r||Q(e,{animate:{enter:{type:null},exit:{type:null},update:{type:null}}}),[t,e]}function Sj(t,e,n){return Re(this,void 0,void 0,(function*(){const[r,i]=yield function(t,e,n){return Re(this,void 0,void 0,(function*(){const{library:r}=n,[i]=DP("transform",r),{preInference:a=[],postInference:o=[]}=e,{transform:s=[]}=t,c=[gj,vj,mj,yj,bj,xj,Ej,Oj,Mj,wj,...a.map(i),...s.map(i),...o.map(i),kj];let l=[],u=t;for(const t of c)[l,u]=yield t(l,u,n);return[l,u]}))}(t,e,n),{encode:a,scale:o,data:s,tooltip:c}=i;if(!1===Array.isArray(s))return null;const{channels:l}=e,u=er(Object.entries(a).filter((([,t])=>Ha(t))),(t=>t.map((([t,e])=>Object.assign({name:t},e)))),(([t])=>{var e;const n=null===(e=/([^\d]+)\d*$/.exec(t))||void 0===e?void 0:e[1],r=l.find((t=>t.name===n));return(null==r?void 0:r.independent)?t:n})),f=l.filter((t=>{const{name:e,required:n}=t;if(u.find((([t])=>t===e)))return!0;if(n)throw new Error(`Missing encoding for channel: ${e}.`);return!1})).flatMap((t=>{const{name:e,scale:n,scaleKey:r,range:i,quantitative:a,ordinal:s}=t;return u.filter((([t])=>t.startsWith(e))).map((([t,e],c)=>{const l=e.some((t=>t.visual)),u=e.some((t=>t.constant)),f=o[t]||{},{independent:h=!1,key:d=r||t,type:p=(u?"constant":l?"identity":n)}=f,g=Le(f,["independent","key","type"]),v="constant"===p,m=v?void 0:i;return{name:t,values:e,scaleKey:h||v?Symbol("independent"):d,scale:Object.assign(Object.assign({type:p,range:m},g),{quantitative:a,ordinal:s})}}))}));return[i,Object.assign(Object.assign({},e),{index:r,channels:f,tooltip:c})]}))}function Aj(t){const{type:e,value:n}=t;return"field"===e&&"string"==typeof n?n:null}function _j(t,e,n){var r;return Re(this,void 0,void 0,(function*(){const{library:i}=n,[a]=DP("composition",i),[o]=DP("interaction",i),s=new Set(Object.keys(i).map((t=>{var e;return null===(e=/mark\.(.*)/.exec(t))||void 0===e?void 0:e[1]})).filter(Ha)),c=new Set(Object.keys(i).map((t=>{var e;return null===(e=/component\.(.*)/.exec(t))||void 0===e?void 0:e[1]})).filter(Ha)),l=t=>{const{type:e}=t;if("function"==typeof e){const{props:t={}}=e,{composite:n=!0}=t;if(n)return"mark"}return"string"!=typeof e?e:s.has(e)||c.has(e)?"mark":e},u=t=>"mark"===l(t),f=t=>"standardView"===l(t),h=t=>{const{type:e}=t;return"string"==typeof e&&!!c.has(e)},d=t=>{if(f(t))return[t];const e=l(t);return a({type:e,static:h(t)})(t)},p=[],g=new Map,v=new Map,m=[t],y=[];for(;m.length;){const t=m.shift();if(f(t)){const e=v.get(t),[r,a]=e?jj(e,t,i):yield Cj(t,n);g.set(r,t),p.push(r);const o=a.flatMap(d).map((t=>FP(t,i)));if(m.push(...o),o.every(f)){const t=yield Promise.all(o.map((t=>Nj(t,n))));EL(t);for(let e=0;e<o.length;e++){const n=o[e],r=t[e];v.set(n,r)}}}else{const e=d(u(t)?t:yield Xj(t,n));Array.isArray(e)?m.push(...e):"function"==typeof e&&y.push(e())}}n.emitter.emit(m_.BEFORE_PAINT);const b=new Map,w=new Map,k=[];e.selectAll(Jj(qS)).data(p,(t=>t.key)).join((t=>t.append("g").attr("className",qS).attr("id",(t=>t.key)).call(Tj).each((function(t,e,r){Rj(t,am(r),k,n),b.set(t,r)}))),(t=>t.call(Tj).each((function(t,e,r){Rj(t,am(r),k,n),w.set(t,r)}))),(t=>t.each((function(t,e,n){const r=n.nameInteraction.values();for(const t of r)t.destroy()})).remove()));const E=(t,e,r)=>Array.from(t.entries()).map((([i,a])=>{const o=r||new Map,s=g.get(i),c=function(t,e,n){const{library:r}=n,i=function(t){const[,e]=DP("interaction",t);return t=>{const[n,r]=t;try{return[n,e(n)]}catch(t){return[n,r.type]}}}(r),a=t=>t[1]&&t[1].props&&t[1].props.reapplyWhenUpdate,o=qj(e),s=o.map(i).filter(a).map((t=>t[0]));return(e,r,i)=>Re(this,void 0,void 0,(function*(){const a=[],[o,c]=yield Cj(e,n);Rj(o,t,a,n);for(const i of s.filter((t=>t!==r)))Pj(i,t,e,o,n);for(const e of c)_j(e,t,n);return i(),{options:e,view:o}}))}(am(a),s,n);return{view:i,container:a,options:s,setState:(t,e=t=>t)=>o.set(t,e),update:(n,r)=>Re(this,void 0,void 0,(function*(){const i=za(Array.from(o.values()))(s);return yield c(i,n,(()=>{x(r)&&e(t,r,o)}))}))}})),M=(t=w,e,r)=>{var i;const a=E(t,M,r);for(const t of a){const{options:r,container:s}=t,c=s.nameInteraction;let l=qj(r);e&&(l=l.filter((t=>e.includes(t[0]))));for(const e of l){const[r,s]=e,l=c.get(r);if(l&&(null===(i=l.destroy)||void 0===i||i.call(l)),s){const e=Lj(t.view,r,s,o)(t,a,n.emitter);c.set(r,{destroy:e})}}}},O=E(b,M);for(const t of O){const{options:e}=t,r=new Map;t.container.nameInteraction=r;for(const i of qj(e)){const[e,a]=i;if(a){const i=Lj(t.view,e,a,o)(t,O,n.emitter);r.set(e,{destroy:i})}}}M();const{width:S,height:A}=t,_=[];for(const t of y){const r=new Promise((r=>Re(this,void 0,void 0,(function*(){for(const r of t){const t=Object.assign({width:S,height:A},r);yield _j(t,e,n)}r()}))));_.push(r)}n.views=p,null===(r=n.animations)||void 0===r||r.forEach((t=>null==t?void 0:t.cancel())),n.animations=k,n.emitter.emit(m_.AFTER_PAINT);const T=k.filter(Ha).map(Hj).map((t=>t.finished));return Promise.all([...T,..._])}))}function Tj(t){t.style("transform",(t=>`translate(${t.layout.x}, ${t.layout.y})`))}function Pj(t,e,n,r,i){var a;const{library:o}=i,[s]=DP("interaction",o),c=e.node().nameInteraction,l=qj(n).find((([e])=>e===t)),u=c.get(t);if(!u)return;if(null===(a=u.destroy)||void 0===a||a.call(u),!l[1])return;const f=Lj(r,t,l[1],s),h={options:n,view:r,container:e.node(),update:t=>Promise.resolve(t)},d=f(h,[],i.emitter);c.set(t,{destroy:d})}function Cj(t,e){return Re(this,void 0,void 0,(function*(){const{library:n}=e,r=yield function(t,e){return Re(this,void 0,void 0,(function*(){const{library:n}=e,[r,i]=DP("mark",n),a=new Set(Object.keys(n).map((t=>{var e;return null===(e=/component\.(.*)/.exec(t))||void 0===e?void 0:e[1]})).filter(Ha)),{marks:o}=t,s=[],c=[],l=[...o],{width:u,height:f}=function(t){const{height:e,width:n,padding:r=0,paddingLeft:i=r,paddingRight:a=r,paddingTop:o=r,paddingBottom:s=r,margin:c=16,marginLeft:l=c,marginRight:u=c,marginTop:f=c,marginBottom:h=c,inset:d=0,insetLeft:p=d,insetRight:g=d,insetTop:v=d,insetBottom:m=d}=t,y=t=>"auto"===t?20:t;return{width:n-y(i)-y(a)-l-u-p-g,height:e-y(o)-y(s)-f-h-v-m}}(t),h={options:t,width:u,height:f};for(;l.length;){const[t]=l.splice(0,1),n=yield Xj(t,e),{type:o=Wa("G2Mark type is required."),key:u}=n;if(a.has(o))c.push(n);else{const{props:t={}}=i(o),{composite:e=!0}=t;if(e){const{data:t}=n,e=Object.assign(Object.assign({},n),{data:t?Array.isArray(t)?t:t.value:t}),i=yield r(e,h),a=Array.isArray(i)?i:[i];l.unshift(...a.map(((t,e)=>Object.assign(Object.assign({},t),{key:`${u}-${e}`}))))}else s.push(n)}}return Object.assign(Object.assign({},t),{marks:s,components:c})}))}(t,e),i=function(t){const{coordinate:e={},interaction:n={},style:r={},marks:i}=t,a=Le(t,["coordinate","interaction","style","marks"]),o=i.map((t=>t.coordinate||{})),s=i.map((t=>t.interaction||{})),c=i.map((t=>t.viewStyle||{})),l=[...o,e].reduceRight(((t,e)=>Q(t,e)),{}),u=[n,...s].reduce(((t,e)=>Q(t,e)),{}),f=[...c,r].reduce(((t,e)=>Q(t,e)),{});return Object.assign(Object.assign({},a),{marks:i,coordinate:l,interaction:u,style:f})}(r);t.interaction=i.interaction,t.coordinate=i.coordinate,t.marks=[...i.marks,...i.components];const a=FP(i,n);return jj(yield Nj(a,e),a,n)}))}function Nj(t,e){return Re(this,void 0,void 0,(function*(){const{library:n}=e,[r]=DP("theme",n),[,i]=DP("mark",n),{theme:a,marks:o,coordinates:s=[]}=t,c=r(Uj(a)),l=new Map;for(const t of o){const{type:n}=t,{props:r={}}=i(n),a=yield Sj(t,r,e);if(a){const[t,e]=a;l.set(t,e)}}const u=Qn(Array.from(l.values()).flatMap((t=>t.channels)),(({scaleKey:t})=>t));for(const t of u.values()){const e=t.reduce(((t,{scale:e})=>Q(t,e)),{}),{scaleKey:r}=t[0],{values:i}=t[0],a=Array.from(new Set(i.map((t=>t.field)).filter(Ha))),o=Q({guide:{title:0===a.length?void 0:a},field:a[0]},e),{name:l}=t[0],u=t.flatMap((({values:t})=>t.map((t=>t.value)))),f=Object.assign(Object.assign({},bL(l,u,o,s,c,n)),{uid:Symbol("scale"),key:r});t.forEach((t=>t.scale=f))}return l}))}function Lj(t,e,n,r){const i=t.theme,a="string"==typeof e&&i[e]||{};return r(Q(a,Object.assign({type:e},n)))}function jj(t,e,n){var r;const[i]=DP("mark",n),[a]=DP("theme",n),[o]=DP("labelTransform",n),{key:s,frame:c=!1,theme:l,clip:u,style:f={},labelTransform:h=[]}=e,d=a(Uj(l)),p=Array.from(t.values()),g=function(t,e){var n;const{components:r=[]}=e,i=["scale","encode","axis","legend","data","transform"],a=Array.from(new Set(t.flatMap((t=>t.channels.map((t=>t.scale)))))),o=new Map(a.map((t=>[t.name,t])));for(const t of r){const e=ML(t);for(const r of e){const e=o.get(r),s=(null===(n=t.scale)||void 0===n?void 0:n[r])||{},{independent:c=!1}=s;if(e&&!c){const{guide:n}=e,r="boolean"==typeof n?{}:n;e.guide=Q({},r,t),Object.assign(e,s)}else{const e=Object.assign(Object.assign({},s),{expectedDomain:s.domain,name:r,guide:at(t,i)});a.push(e)}}}return a}(p,e),v=function(t){return t.map((t=>{const e=Q(t,t.style);return delete e.style,e}))}(zL(function(t,e,n){var r;for(const[e]of n.entries())if("cell"===e.type)return t.filter((t=>"shape"!==t.name));if(1!==e.length||t.some((t=>"shape"===t.name)))return t;const{defaultShape:i}=e[0];if(!["point","line","rect","hollow"].includes(i))return t;const a={point:"point",line:"hyphen",rect:"square",hollow:"hollow"},o=(null===(r=t.find((t=>"color"===t.name)))||void 0===r?void 0:r.field)||null,s={field:o,name:"shape",type:"constant",domain:[],range:[a[i]]};return[...t,s]}(Array.from(g),p,t),e,n)),m=lj(v,e,d,n),y=function(t,e,n){const[r]=DP("coordinate",n),{innerHeight:i,innerWidth:a,insetLeft:o,insetTop:s,insetRight:c,insetBottom:l}=t,{coordinates:u=[]}=e,f=(h=u).find((t=>"cartesian"===t.type||"cartesian3D"===t.type))?h:[...h,{type:"cartesian"}];var h;const d="cartesian3D"===f[0].type,p=Object.assign(Object.assign({},t),{x:o,y:s,width:a-o-c,height:i-l-s,transformations:f.flatMap(r)});return d?new JT(p):new XT(p)}(m,e,n),b=c?Q({mainLineWidth:1,mainStroke:"#000"},f):f;!function(t,e,n){const r=Qn(t,(t=>`${t.plane||"xy"}-${t.position}`)),{paddingLeft:i,paddingRight:a,paddingTop:o,paddingBottom:s,marginLeft:c,marginTop:l,marginBottom:u,marginRight:f,innerHeight:h,innerWidth:d,insetBottom:p,insetLeft:g,insetRight:v,insetTop:m,height:y,width:b,depth:x}=n,w={xy:fj({width:b,height:y,paddingLeft:i,paddingRight:a,paddingTop:o,paddingBottom:s,marginLeft:c,marginTop:l,marginBottom:u,marginRight:f,innerHeight:h,innerWidth:d,insetBottom:p,insetLeft:g,insetRight:v,insetTop:m}),yz:fj({width:x,height:y,paddingLeft:0,paddingRight:0,paddingTop:0,paddingBottom:0,marginLeft:0,marginTop:0,marginBottom:0,marginRight:0,innerWidth:x,innerHeight:y,insetBottom:0,insetLeft:0,insetRight:0,insetTop:0}),xz:fj({width:b,height:x,paddingLeft:0,paddingRight:0,paddingTop:0,paddingBottom:0,marginLeft:0,marginTop:0,marginBottom:0,marginRight:0,innerWidth:b,innerHeight:x,insetBottom:0,insetLeft:0,insetRight:0,insetTop:0})};for(const[t,n]of r.entries()){const[r,i]=t.split("-"),a=w[r][i],[o,s]=ro(n,(t=>"string"==typeof t.type&&("center"===i||!(!t.type.startsWith("axis")||!["inner","outer"].includes(i)))));o.length&&hj(o,e,a,i),s.length&&dj(n,0,a)}}(WL(v),y,m),function(t){const e=t.find((({type:t})=>"axisX"===t)),n=t.find((({type:t})=>"axisY"===t)),r=t.find((({type:t})=>"axisZ"===t));e&&n&&r&&(e.plane="xy",n.plane="xy",r.plane="yz",r.origin=[e.bbox.x,e.bbox.y,0],r.eulerAngles=[0,-90,0],r.bbox.x=e.bbox.x,r.bbox.y=e.bbox.y,t.push(Object.assign(Object.assign({},e),{plane:"xz",showLabel:!1,showTitle:!1,origin:[e.bbox.x,e.bbox.y,0],eulerAngles:[-90,0,0]})),t.push(Object.assign(Object.assign({},n),{plane:"yz",showLabel:!1,showTitle:!1,origin:[n.bbox.x+n.bbox.width,n.bbox.y,0],eulerAngles:[0,-90,0]})),t.push(Object.assign(Object.assign({},r),{plane:"xz",actualPosition:"left",showLabel:!1,showTitle:!1,eulerAngles:[90,-90,0]})))}(v);const x=new Map(Array.from(t.values()).flatMap((t=>{const{channels:e}=t;return e.map((({scale:t})=>[t.uid,kL(t,n)]))})));!function(t,e){const n=Array.from(t.values()).flatMap((t=>t.channels)),r=er(n,(t=>t.map((t=>e.get(t.scale.uid)))),(t=>t.name)).filter((([,t])=>t.some((t=>"function"==typeof t.getOptions().groupTransform))&&t.every((t=>t.getTicks)))).map((t=>t[1]));r.forEach((t=>{const e=t.map((t=>t.getOptions().groupTransform))[0];e(t)}))}(t,x);const w={};for(const t of v){const{scales:e=[]}=t,i=[];for(const t of e){const{name:e,uid:a}=t,o=null!==(r=x.get(a))&&void 0!==r?r:kL(t,n);i.push(o),"y"===e&&o.update(Object.assign(Object.assign({},o.getOptions()),{xScale:w.x})),wL(w,{[e]:o})}t.scaleInstances=i}const k=[],E=new Map;for(const[e,n]of t.entries()){const{children:t,dataDomain:r,modifier:a,key:o,data:c}=e;E.set(o,c);const{index:l,channels:u,tooltip:f}=n,h=Object.fromEntries(u.map((({name:t,scale:e})=>[t,e]))),d=Ja(h,(({uid:t})=>x.get(t)));wL(w,d);const p=xL(u,d),g=i(e),[v,b,M]=Ij(g(l,d,p,y)),O=r||v.length,S=a?a(b,O,m):[],A=t=>{var e,n;return null===(n=null===(e=f.title)||void 0===e?void 0:e[t])||void 0===n?void 0:n.value},_=t=>f.items.map((e=>e[t])),T=v.map(((t,e)=>{const n=Object.assign({points:b[e],transform:S[e],index:t,markKey:o,viewKey:s,data:c[t]},f&&{title:A(t),items:_(t)});for(const[r,i]of Object.entries(p))n[r]=i[t],M&&(n[`series${$(r)}`]=M[e].map((t=>i[t])));return M&&(n.seriesIndex=M[e]),M&&f&&(n.seriesItems=M[e].map((t=>_(t))),n.seriesTitle=M[e].map((t=>A(t)))),n}));n.data=T,n.index=v;const P=null==t?void 0:t(T,d,m);k.push(...P||[])}return[{layout:m,theme:d,coordinate:y,markState:t,key:s,clip:u,scale:w,style:b,components:v,data:E,labelTransform:za(h.map(o))},k]}function Rj(t,e,n,r){return Re(this,void 0,void 0,(function*(){const{library:i}=r,{components:a,theme:o,layout:s,markState:c,coordinate:l,key:u,style:f,clip:h,scale:d}=t,{x:p,y:g,width:v,height:m}=s,y=Le(s,["x","y","width","height"]),b=["view","plot","main","content"],x=b.map(((t,e)=>e)),w=b.map((t=>Ua(Object.assign({},o.view,f),t))),k=["a","margin","padding","inset"].map((t=>Va(y,t))),E=t=>t.style("x",(t=>_[t].x)).style("y",(t=>_[t].y)).style("width",(t=>_[t].width)).style("height",(t=>_[t].height)).each((function(t,e,n){!function(t,e){for(const[n,r]of Object.entries(e))t.style(n,r)}(am(n),w[t])}));let M=0,O=0,S=v,A=m;const _=x.map((t=>{const e=k[t],{left:n=0,top:r=0,bottom:i=0,right:a=0}=e;return M+=n,O+=r,S-=n+a,A-=r+i,{x:M,y:O,width:S,height:A}}));e.selectAll(Jj(QS)).data(x.filter((t=>Ha(w[t]))),(t=>b[t])).join((t=>t.append("rect").attr("className",QS).style("zIndex",-2).call(E)),(t=>t.call(E)),(t=>t.remove()));const T=function(t){let e=-1/0,n=1/0;for(const[r,i]of t){const{animate:t={}}=r,{data:a}=i,{enter:o={},update:s={},exit:c={}}=t,{type:l,duration:u=300,delay:f=0}=s,{type:h,duration:d=300,delay:p=0}=o,{type:g,duration:v=300,delay:m=0}=c;for(const t of a){const{updateType:r=l,updateDuration:i=u,updateDelay:a=f,enterType:o=h,enterDuration:s=d,enterDelay:c=p,exitDuration:y=v,exitDelay:b=m,exitType:x=g}=t;(void 0===r||r)&&(e=Math.max(e,i+a),n=Math.min(n,a)),(void 0===x||x)&&(e=Math.max(e,y+b),n=Math.min(n,b)),(void 0===o||o)&&(e=Math.max(e,s+c),n=Math.min(n,c))}}return e===-1/0?null:[n,e-n]}(c),P=!!T&&{duration:T[1]};for(const[,t]of Jn(a,(t=>`${t.type}-${t.position}`)))t.forEach(((t,e)=>t.index=e));const C=e.selectAll(Jj(KS)).data(a,(t=>`${t.type}-${t.position}-${t.index}`)).join((t=>t.append("g").style("zIndex",(({zIndex:t})=>t||-1)).attr("className",KS).append((t=>GL(Q({animate:P,scale:d},t),l,o,i,c)))),(t=>t.transition((function(t,e,n){const{preserve:r=!1}=t;if(r)return;const a=GL(Q({animate:P,scale:d},t),l,o,i,c),{attributes:s}=a,[u]=n.childNodes;return u.update(s,!1)})))).transitions();n.push(...C.flat().filter(Ha));const N=e.selectAll(Jj(XS)).data([s],(()=>u)).join((t=>t.append("rect").style("zIndex",0).style("fill","transparent").attr("className",XS).call(Kj).call(Qj,Array.from(c.keys())).call(tR,h)),(t=>t.call(Qj,Array.from(c.keys())).call((t=>T?function(t,e){const[n,r]=e;t.transition((function(t,e,i){const{transform:a,width:o,height:s}=i.style,{paddingLeft:c,paddingTop:l,innerWidth:u,innerHeight:f,marginLeft:h,marginTop:d}=t,p=[{transform:a,width:o,height:s},{transform:`translate(${c+h}, ${l+d})`,width:u,height:f}];return i.animate(p,{delay:n,duration:r,fill:"both"})}))}(t,T):Kj(t))).call(tR,h))).transitions();n.push(...N.flat());for(const[a,o]of c.entries()){const{data:s}=o,{key:c,class:l,type:u}=a,f=e.select(`#${c}`),h=zj(a,o,t,r),d=$j(a,o,t,i),p=Yj(a,o,t,i),g=Vj(a,o,t,i),v=Bj(e,f,l,"element"),m=f.selectAll(Jj(US)).selectFacetAll(v).data(s,(t=>t.key),(t=>t.groupKey)).join((t=>t.append(h).attr("className",US).attr("markType",u).transition((function(t,e,n){return d(t,[n])}))),(t=>t.call((t=>{const e=t.parent(),n=Ya((t=>{const[e,n]=t.getBounds().min;return[e,n]}));t.transition((function(t,r,i){Fj(i,e,n);const a=h(t,r),o=p(t,[i],[a]);return(null==o?void 0:o.length)||(i.nodeName===a.nodeName&&"g"!==a.nodeName?$a(i,a):(i.parentNode.replaceChild(a,i),a.className=US,a.markType=u,a.__data__=i.__data__)),o})).attr("markType",u).attr("className",US)}))),(t=>t.each((function(t,e,n){n.__removed__=!0})).transition((function(t,e,n){return g(t,[n])})).remove()),(t=>t.append(h).attr("className",US).attr("markType",u).transition((function(t,e,n){const{__fromElements__:r}=n,i=p(t,r,[n]);return new om(r,null,n.parentNode).transition(i).remove(),i}))),(t=>t.transition((function(t,e,n){const r=new om([],n.__toData__,n.parentNode).append(h).attr("className",US).attr("markType",u).nodes();return p(t,[n],r)})).remove())).transitions();n.push(...m.flat())}!function(t,e,n,r,i){const[a]=DP("labelTransform",r),{markState:o,labelTransform:s}=t,c=e.select(Jj(VS)).node(),l=new Map,u=new Map,f=Array.from(o.entries()).flatMap((([n,a])=>{const{labels:o=[],key:s}=n,c=function(t,e,n,r,i){const[a]=DP("shape",r),{data:o,encode:s}=t,{data:c,defaultLabelShape:l}=e,u=c.map((t=>t.points)),f=Ja(s,(t=>t.value)),{theme:h,coordinate:d}=n,p=Object.assign(Object.assign({},i),{document:BP(i),theme:h,coordinate:d});return t=>{const{index:e,points:n}=t,r=o[e],{formatter:i=t=>`${t}`,transform:s,style:c,render:d,selector:g,element:v}=t,m=Le(t,["formatter","transform","style","render","selector","element"]),y=Ja(Object.assign(Object.assign({},m),c),(t=>Dj(t,r,e,o,{channel:f,element:v}))),{shape:b=l,text:x}=y,w=Le(y,["shape","text"]),k="string"==typeof i?bO(i):i,E=Object.assign(Object.assign({},w),{text:k(x,r,e,o),datum:r}),M=Object.assign({type:`label.${b}`,render:d},w);return a(M,p)(n,E,Gj(h,"label",b,"label"),u)}}(n,a,t,r,i),f=e.select(`#${s}`).selectAll(Jj(US)).nodes().filter((t=>!t.__removed__));return o.flatMap(((t,e)=>{const n=Le(t,["transform"]);return f.flatMap((r=>{const i=function(t,e,n){const{seriesIndex:r,seriesKey:i,points:a,key:o,index:s}=n.__data__,c=function(t){const e=t.cloneNode(!0),n=t.getAnimations();e.style.visibility="hidden",n.forEach((t=>{const n=t.effect.getKeyframes();e.attr(n[n.length-1])})),t.parentNode.appendChild(e);const r=e.getLocalBounds();e.destroy();const{min:i,max:a}=r;return[i,a]}(n);if(!r)return[Object.assign(Object.assign({},t),{key:`${o}-${e}`,bounds:c,index:s,points:a,dependentElement:n})];const l=function(t){const{selector:e}=t;if(!e)return null;if("function"==typeof e)return e;if("first"===e)return t=>[t[0]];if("last"===e)return t=>[t[t.length-1]];throw new Error(`Unknown selector: ${e}`)}(t),u=r.map(((r,o)=>Object.assign(Object.assign({},t),{key:`${i[o]}-${e}`,bounds:[a[o]],index:r,points:a,dependentElement:n})));return l?l(u):u}(n,e,r);return i.forEach((e=>{l.set(e,(t=>c(Object.assign(Object.assign({},t),{element:r})))),u.set(e,t)})),i}))}))})),h=am(c).selectAll(Jj(ZS)).data(f,(t=>t.key)).join((t=>t.append((t=>l.get(t)(t))).attr("className",ZS)),(t=>t.each((function(t,e,n){$a(n,l.get(t)(t))}))),(t=>t.remove())).nodes(),d=Qn(h,(t=>u.get(t.__data__))),{coordinate:p,layout:g}=t,v={canvas:i.canvas,coordinate:p,layout:g};for(const[t,e]of d){const{transform:n=[]}=t;za(n.map(a))(e,v)}s&&s(h,v)}(t,e,0,i,r)}))}function Ij([t,e,n]){if(n)return[t,e,n];const r=[],i=[];for(let n=0;n<t.length;n++){const a=t[n],o=e[n];o.every((([t,e])=>Ha(t)&&Ha(e)))&&(r.push(a),i.push(o))}return[r,i]}function Dj(t,e,n,r,i){return"function"==typeof t?t(e,n,r,i):"string"!=typeof t?t:Ka(e)&&void 0!==e[t]?e[t]:t}function Bj(t,e,n,r){const i=t.node().parentElement;return i&&"function"==typeof i.findAll?i.findAll((t=>void 0!==t.style.facet&&t.style.facet===n&&t!==e.node())).flatMap((t=>t.getElementsByClassName(r))):[]}function Fj(t,e,n){if(!t.__facet__)return;const r=t.parentNode.parentNode,i=e.parentNode,[a,o]=n(r),[s,c]=n(i);!function(t,e){const{transform:n}=t.style,r=(t=>"none"===t||void 0===t)(n)?"":n;t.style.transform=`${r} ${e}`.trimStart()}(t,`translate(${a-s}, ${o-c})`),e.append(t)}function zj(t,e,n,r){const{library:i}=r,[a]=DP("shape",i),{data:o,encode:s}=t,{defaultShape:c,data:l,shape:u}=e,f=Ja(s,(t=>t.value)),h=l.map((t=>t.points)),{theme:d,coordinate:p}=n,{type:g,style:v={}}=t,m=Object.assign(Object.assign({},r),{document:BP(r),coordinate:p,theme:d});return e=>{const{shape:n=c}=v,{shape:r=n,points:i,seriesIndex:s,index:l}=e,p=Le(e,["shape","points","seriesIndex","index"]),y=Object.assign(Object.assign({},p),{index:l}),b=s?s.map((t=>o[t])):o[l],x=s||l,w=Ja(v,(t=>Dj(t,b,x,o,{channel:f})));return(u[r]?u[r](w,m):a(Object.assign(Object.assign({},w),{type:Zj(t,r)}),m))(i,y,Gj(d,g,r,c),h)}}function Gj(t,e,n,r){if("string"!=typeof e)return;const{color:i}=t,a=t[e]||{},o=a[n]||a[r];return Object.assign({color:i},o)}function Wj(t,e,n,r,i){var a,o;const[,s]=DP("shape",i),[c]=DP("animation",i),{defaultShape:l,shape:u}=n,{theme:f,coordinate:h}=r,d=`default${$(t)}Animation`,{[d]:p}=(null===(a=u[l])||void 0===a?void 0:a.props)||s(Zj(e,l)).props,{[t]:g={}}=f,v=(null===(o=e.animate)||void 0===o?void 0:o[t])||{},m={coordinate:h};return(e,n,r)=>{const{[`${t}Type`]:i,[`${t}Delay`]:a,[`${t}Duration`]:o,[`${t}Easing`]:s}=e,l=Object.assign({type:i||p},v);if(!l.type)return null;const u=c(l,m)(n,r,Q(g,{delay:a,duration:o,easing:s}));let f=[];return f=Array.isArray(u)?u:[u],f.filter(Boolean)}}function $j(t,e,n,r){return Wj("enter",t,e,n,r)}function Hj(t){return t.finished.then((()=>{t.cancel()})),t}function Yj(t,e,n,r){return Wj("update",t,e,n,r)}function Vj(t,e,n,r){return Wj("exit",t,e,n,r)}function Uj(t={}){if("string"==typeof t)return{type:t};const{type:e="light"}=t,n=Le(t,["type"]);return Object.assign(Object.assign({},n),{type:e})}function qj(t){const{interaction:e={}}=t;return Object.entries(Q({event:!0,tooltip:!0,sliderFilter:!0,legendFilter:!0,scrollbarFilter:!0},e)).reverse()}function Xj(t,e){return Re(this,void 0,void 0,(function*(){const{data:n}=t,r=Le(t,["data"]);if(null==n)return t;const[,{data:i}]=yield vj(0,{data:n},e);return Object.assign({data:i},r)}))}function Kj(t){t.style("transform",(t=>`translate(${t.paddingLeft+t.marginLeft}, ${t.paddingTop+t.marginTop})`)).style("width",(t=>t.innerWidth)).style("height",(t=>t.innerHeight))}function Zj(t,e){const{type:n}=t;return"string"==typeof e?`${n}.${e}`:e}function Qj(t,e){const n=t=>void 0!==t.class?`${t.class}`:"";if(0===t.nodes().length)return;t.selectAll(Jj(YS)).data(e,(t=>t.key)).join((t=>t.append("g").attr("className",YS).attr("id",(t=>t.key)).style("facet",n).style("fill","transparent").style("zIndex",(t=>{var e;return null!==(e=t.zIndex)&&void 0!==e?e:0}))),(t=>t.style("facet",n).style("fill","transparent").style("zIndex",(t=>{var e;return null!==(e=t.zIndex)&&void 0!==e?e:0}))),(t=>t.remove()));t.select(Jj(VS)).node()||t.append("g").attr("className",VS).style("zIndex",0)}function Jj(...t){return t.map((t=>`.${t}`)).join("")}function tR(t,e){t.node()&&t.style("clipPath",(t=>{if(!e)return null;const{paddingTop:n,paddingLeft:r,marginLeft:i,marginTop:a,innerWidth:o,innerHeight:s}=t;return new $g({style:{x:r+i,y:n+a,width:o,height:s}})}))}function eR(t){const{style:e,scale:n,type:r}=t,i={},a=rt(e,"columnWidthRatio");return a&&"interval"===r&&(i.x=Object.assign(Object.assign({},null==n?void 0:n.x),{padding:1-a})),Object.assign(Object.assign({},t),{scale:Object.assign(Object.assign({},n),i)})}function nR(t){const e=function(t){return function(...t){return e=>t.reduce(((t,e)=>e(t)),e)}(eR)(t)}(t);return e.children&&Array.isArray(e.children)&&(e.children=e.children.map((t=>nR(t)))),e}function rR(t){const e=Q({},t),n=new Map([[e,null]]),r=new Map([[null,-1]]),i=[e];for(;i.length;){const t=i.shift();if(void 0===t.key){const e=n.get(t),i=r.get(t),a=null===e?"0":`${e.key}-${i}`;t.key=a}const{children:e=[]}=t;if(Array.isArray(e))for(let a=0;a<e.length;a++){const o=Q({},e[a]);e[a]=o,n.set(o,t),r.set(o,a),i.push(o)}}return e}function iR(t,e){const n=new h_;return n.registerPlugin(new p_),new ov({width:t,height:e,container:document.createElement("div"),renderer:n})}function aR(t,e={},n=()=>{},r=t=>{throw t}){const i=z_(t),{width:a=640,height:o=480,depth:s=0}=i,c=rR(nR(i)),{canvas:l=iR(a,o),emitter:u=new v_,library:f}=e;e.canvas=l,e.emitter=u;const{width:h,height:d}=l.getConfig();h===a&&d===o||l.resize(a,o),u.emit(m_.BEFORE_RENDER);const p=am(l.document.documentElement);return l.ready.then((()=>_j(Object.assign(Object.assign({},c),{width:a,height:o,depth:s}),p,e))).then((()=>{if(s){const[t,e]=l.document.documentElement.getPosition();l.document.documentElement.setPosition(t,e,-s/2)}l.requestAnimationFrame((()=>{l.requestAnimationFrame((()=>{u.emit(m_.AFTER_RENDER),null==n||n()}))}))})).catch((t=>{null==r||r(t)})),"string"==typeof(g=l.getConfig().container)?document.getElementById(g):g;var g}function oR(t,e={},n=!1,r=!0){const{canvas:i,emitter:a}=e;i&&(!function(t){const e=t.getRoot().querySelectorAll(`.${qS}`);null==e||e.forEach((t=>{const{nameInteraction:e=new Map}=t;(null==e?void 0:e.size)>0&&Array.from(null==e?void 0:e.values()).forEach((t=>{null==t||t.destroy()}))}))}(i),n?i.destroy():i.destroyChildren()),r&&a.off()}function sR(t,e){if(e(t))return!0;if("g"===t.tagName){const{childNodes:n=[]}=t;for(const t of n)if(sR(t,e))return!0}return!1}const cR={visibility:"visible",opacity:1,fillOpacity:1,strokeOpacity:1};function lR(t,e){let n;return sR(t,(t=>{var r;return"g"!==t.tagName&&void 0!==(null===(r=t.style)||void 0===r?void 0:r[e])&&(n=t.style[e],!0)})),null!=n?n:cR[e]}function uR(t,e,n,r){t.style[e]=n,r&&t.children.forEach((t=>uR(t,e,n,r)))}function fR(t){uR(t,"visibility","hidden",!0)}function hR(t){uR(t,"visibility","visible",!0)}function dR(t){return am(t).selectAll(`.${US}`).nodes().filter((t=>!t.__removed__))}function pR(t,e){return gR(t,e).flatMap((({container:t})=>dR(t)))}function gR(t,e){return e.filter((e=>e!==t&&e.options.parentKey===t.options.key))}function vR(t){return am(t).select(`.${XS}`).node()}function mR(t){if("g"===t.tagName)return t.getRenderBounds();const e=t.getGeometryBounds(),n=new au;return n.setFromTransformedAABB(e,t.getWorldTransform()),n}function yR(t,e){const{offsetX:n,offsetY:r}=e,i=mR(t),{min:[a,o],max:[s,c]}=i;return n<a||n>s||(r<o||r>c)?null:[n-a,r-o]}function bR(t,e){const{offsetX:n,offsetY:r}=e,[i,a,o,s]=function(t){const e=t.getRenderBounds(),{min:[n,r],max:[i,a]}=e;return[n,r,i,a]}(t);return[Math.min(o,Math.max(i,n))-i,Math.min(s,Math.max(a,r))-a]}function xR(t){return t=>t.__data__.color}function wR(t){return t=>t.__data__.x}function kR(t){const e=Array.isArray(t)?t:[t],n=new Map(e.flatMap((t=>Array.from(t.markState.keys()).map((e=>[_R(t.key,e.key),e.data])))));return t=>{const{index:e,markKey:r,viewKey:i}=t.__data__;return n.get(_R(i,r))[e]}}const ER={selected:3,unselected:3,active:2,inactive:2,default:1},MR={selection:["selected","unselected"],highlight:["active","inactive"]},OR=(t,e,n)=>{sR(t,(t=>{"setAttribute"in t&&"function"==typeof t.setAttribute&&t.setAttribute(e,n)}))};function SR(t,e){return e.forEach((e=>{const n=e.__interactionStyle__;e.__interactionStyle__=n?Object.assign(Object.assign({},n),t):t})),(t=(t,e)=>t,e=OR)=>AR(void 0,t,e)}function AR(t,e=(t,e)=>t,n=OR){const r="__states__",i="__ordinal__",a=t=>ER[t]||ER.default,o=t=>{var e;return null===(e=Object.entries(MR).find((([e,n])=>n.includes(t))))||void 0===e?void 0:e[0]},s=o=>{var s;const{[r]:c=[],[i]:l={}}=o,u=[...c].sort(((t,e)=>a(e)-a(t))),f=new Map;for(const e of u){const n=(null===(s=null!=t?t:o.__interactionStyle__)||void 0===s?void 0:s[e])||{};for(const[t,e]of Object.entries(n))f.has(t)||f.set(t,e)}const h=Object.assign({},l);for(const[t,e]of f.entries())h[t]=e;if(0!==Object.keys(h).length){for(const[t,r]of Object.entries(h)){const i=lR(o,t),a=e(r,o);n(o,t,a),t in l||(l[t]=i)}o[i]=l}},c=t=>{t[r]||(t[r]=[])};return{setState:(t,...e)=>{c(t),t[r]=[...e],s(t)},updateState:(t,...e)=>{c(t);const n=t[r],i=new Set(e.map((t=>o(t))).filter((t=>void 0!==t))),a=n.filter((t=>!i.has(o(t))));t[r]=[...a,...e],s(t)},removeState:(t,...e)=>{c(t);for(const n of e){const e=t[r].indexOf(n);-1!==e&&t[r].splice(e,1)}s(t)},hasState:(t,e)=>(c(t),-1!==t[r].indexOf(e))}}function _R(t,e){return`${t},${e}`}function TR(t,e){const n=(Array.isArray(t)?t:[t]).flatMap((t=>t.marks.map((e=>[_R(t.key,e.key),e.state])))),r={};for(const t of e){const[e,i]=Array.isArray(t)?t:[t,{}];r[e]=n.reduce(((t,n)=>{const[r,a={}]=n,o=void 0===(s=a[e])||"object"==typeof s&&0===Object.keys(s).length?i:a[e];var s;for(const[e,n]of Object.entries(o)){const i=t[e],a=(t,e,a,o)=>{const s=_R(o.__data__.viewKey,o.__data__.markKey);return r!==s?null==i?void 0:i(t,e,a,o):"function"!=typeof n?n:n(t,e,a,o)};t[e]=a}return t}),{})}return r}function PR(t,e){const n=new Map(t.map(((t,e)=>[t,e]))),r=e?t.map(e):t;return(t,i)=>{if("function"!=typeof t)return t;const a=n.get(i);return t(e?e(i):i,a,r,i)}}function CR(t){var{link:e=!1,valueof:n=(t,e)=>t,coordinate:r}=t,i=Le(t,["link","valueof","coordinate"]);if(!e)return[()=>{},()=>{}];const a=t=>t.__data__.points,o=(t,e)=>{const[,n,r]=t,[i,,,a]=e;return[n,i,a,r]};return[t=>{var e;if(t.length<=1)return;const r=rr(t,((t,e)=>{const{x:n}=t.__data__,{x:r}=e.__data__;return n-r}));for(let t=1;t<r.length;t++){const s=rc(),c=r[t-1],l=r[t],[u,f,h,d]=o(a(c),a(l));s.moveTo(...u),s.lineTo(...f),s.lineTo(...h),s.lineTo(...d),s.closePath();const p=Ja(i,(t=>n(t,c))),{fill:g=c.getAttribute("fill")}=p,v=Le(p,["fill"]),m=new Bg({className:"element-link",style:Object.assign({d:s.toString(),fill:g,zIndex:-2},v)});null===(e=c.link)||void 0===e||e.remove(),c.parentNode.appendChild(m),c.link=m}},t=>{var e;null===(e=t.link)||void 0===e||e.remove(),t.link=null}]}function NR(t,e,n){const r=e=>{const{transform:n}=t.style;return n?`${n} ${e}`:e};if(Uc(n)){const{points:i}=t.__data__,[a,o]=Vc(n)?hm(i):i,s=n.getCenter(),c=ws(a,s),l=ws(o,s),u=Ms(c)+Ss(c,l)/2;return r(`translate(${e*Math.cos(u)}, ${e*Math.sin(u)})`)}return Vc(n)?r(`translate(${e}, 0)`):r(`translate(0, ${-e})`)}function LR(t){var{document:e,background:n,scale:r,coordinate:i,valueof:a}=t,o=Le(t,["document","background","scale","coordinate","valueof"]);const s="element-background";if(!n)return[()=>{},()=>{}];const c=(t,e,n)=>{const r=t.invert(e),i=e+t.getBandWidth(r)/2,a=t.getStep(r)/2,o=a*n;return[i-a+o,i+a-o]},l=(t,n)=>{const{padding:a}=n,[o,s]=((t,e)=>{const{x:n}=r;if(!sS(n))return[0,1];const{__data__:i}=t,{x:a}=i,[o,s]=c(n,a,e);return[o,s]})(t,a),[l,u]=((t,e)=>{const{y:n}=r;if(!sS(n))return[0,1];const{__data__:i}=t,{y:a}=i,[o,s]=c(n,a,e);return[o,s]})(t,a),f=[[o,l],[s,l],[s,u],[o,u]].map((t=>i.map(t))),{__data__:h}=t,{y:d,y1:p}=h;return mm(e,f,{y:d,y1:p},i,n)},u=(t,e)=>{const{transform:n="scale(1.2, 1.2)",transformOrigin:r="center center",stroke:i=""}=e,a=Le(e,["transform","transformOrigin","stroke"]),o=Object.assign({transform:n,transformOrigin:r,stroke:i},a),s=t.cloneNode(!0);for(const[t,e]of Object.entries(o))s.style[t]=e;return s};return[t=>{t.background&&t.background.remove();const e=Ja(o,(e=>a(e,t))),{fill:n="#CCD6EC",fillOpacity:i=.3,zIndex:c=-2,padding:f=.001,lineWidth:h=0}=e,d=Le(e,["fill","fillOpacity","zIndex","padding","lineWidth"]),p=Object.assign(Object.assign({},d),{fill:n,fillOpacity:i,zIndex:c,padding:f,lineWidth:h}),g=(()=>{const{x:t,y:e}=r;return[t,e].some(sS)})()?l:u,v=g(t,p);v.className=s,t.parentNode.parentNode.appendChild(v),t.background=v},t=>{var e;null===(e=t.background)||void 0===e||e.remove(),t.background=null},t=>t.className===s]}function jR(t,e){const n=t.getRootNode().defaultView.getContextService().getDomElement();(null==n?void 0:n.style)&&(t.cursor=n.style.cursor,n.style.cursor=e)}function RR(t){jR(t,t.cursor)}function IR(t,e,n){return t.find((t=>Object.entries(e).every((([e,r])=>n(t)[e]===r))))}function DR(t,e){return Math.sqrt(Math.pow(t[0]-e[0],2)+Math.pow(t[1]-e[1],2))}function BR(t,e=!1){const n=m(t,(t=>!!t)).map(((t,e)=>[0===e?"M":"L",...t]));return e&&n.push(["Z"]),n}function FR(t){return t.querySelectorAll(".element")}function zR(t,e){if(e(t))return t;let n=t.parent;for(;n&&!e(n);)n=n.parent;return n}const GR=["interval","point","density"];function WR({elementsof:t,root:e,coordinate:n,scale:r,validFindByXMarks:i=GR}){var a,o;let s=t(e);const c=t=>i.includes(t.markType);if(s.find(c)){s=s.filter(c);const t=r.x,i=r.series,l=null!==(o=null===(a=null==t?void 0:t.getBandWidth)||void 0===a?void 0:a.call(t))&&void 0!==o?o:0,u=i?t=>{const e=Math.round(1/i.valueBandWidth);return t.__data__.x+t.__data__.series*l+l/(2*e)}:t=>t.__data__.x+l/2;return s.sort(((t,e)=>u(t)-u(e))),t=>{const r=yR(e,t);if(!r)return;const[i]=n.invert(r),a=(0,Dn(u).center)(s,i);return s[a]}}return t=>{const{target:e}=t;return zR(e,(t=>!!t.classList&&t.classList.includes("element")))}}function $R(t){var{delay:e,createGroup:n,createRegionGroup:r,background:i=!1,link:a=!1}=t,o=Le(t,["delay","createGroup","createRegionGroup","background","link"]);return(t,s,c)=>{const{container:l,view:u,options:f}=t,{scale:h,coordinate:d}=u;return function(t,{elements:e,datum:n,groupKey:r=t=>t,regionGroupKey:i=t=>t,link:a=!1,background:o=!1,delay:s=60,scale:c,coordinate:l,emitter:u,state:f={},region:h=!1,regionEleFilter:d=t=>GR.includes(t.markType)}){var p,g;const v=null!==(p=e(t))&&void 0!==p?p:[],m=h?v.filter(d):v,y=new Set(m),b=h?i:r,x=Qn(m,b),w=WR({elementsof:e,root:t,coordinate:l,scale:c}),k=PR(m,n),[E,M]=CR(Object.assign({elements:m,valueof:k,link:a,coordinate:l},Va(f.active,"link"))),[O,S,A]=LR(Object.assign({document:t.ownerDocument,scale:c,coordinate:l,background:o,valueof:k},Va(f.active,"background"))),_=Q(f,{active:Object.assign({},(null===(g=f.active)||void 0===g?void 0:g.offset)&&{transform:(...t)=>{const e=f.active.offset(...t),[,n]=t;return NR(m[n],e,l)}})}),T=SR(_,m),{updateState:P,removeState:C,hasState:N}=T(k);let L;const j=t=>{const{nativeEvent:e=!0}=t;let r=t.target;if(h&&(r=w(t)),!y.has(r))return;L&&clearTimeout(L);const i=b(r),a=x.get(i),o=new Set(a);for(const t of m)o.has(t)?N(t,"active")||P(t,"active"):(P(t,"inactive"),M(t)),t!==r&&S(t);O(r),E(a),e&&u.emit("element:highlight",{nativeEvent:e,data:{data:n(r),group:a.map(n)}})},R=()=>{L&&clearTimeout(L),L=setTimeout((()=>{I(),L=null}),s)},I=(t=!0)=>{for(const t of m)C(t,"active","inactive"),S(t),M(t);t&&u.emit("element:unhighlight",{nativeEvent:t})},D=t=>{let e=t.target;h&&(e=w(t)),e?o&&!A(e)||(o||y.has(e))&&(s>0?R():I()):s>0?R():I()},B=()=>{I()};t.addEventListener("pointerover",j),t.addEventListener("pointermove",j),t.addEventListener("pointerout",D),t.addEventListener("pointerleave",B);const F=t=>{const{nativeEvent:e}=t;e||I(!1)},z=t=>{const{nativeEvent:e}=t;if(e)return;const{data:r}=t.data,i=IR(m,r,n);i&&j({target:i,nativeEvent:!1})};return u.on("element:highlight",z),u.on("element:unhighlight",F),()=>{t.removeEventListener("pointerover",j),t.removeEventListener("pointermove",j),t.removeEventListener("pointerout",D),t.removeEventListener("pointerleave",B),u.off("element:highlight",z),u.off("element:unhighlight",F);for(const t of m)S(t),M(t)}}(vR(l),Object.assign({elements:dR,datum:kR(u),groupKey:n?n(u):void 0,regionGroupKey:r?r(u):t=>t.__data__.x,coordinate:d,scale:h,state:TR(f,[["active",i?{}:{lineWidth:"1",stroke:"#000"}],"inactive"]),background:i,link:a,delay:e,emitter:c},o))}}function HR(t){return $R(Object.assign(Object.assign({},t),{createGroup:wR}))}function YR(t){return $R(Object.assign(Object.assign({},t),{createGroup:xR}))}function VR(t,{elements:e,datum:n,groupKey:r=t=>t,regionGroupKey:i=t=>t,link:a=!1,single:o=!1,multipleSelectHotkey:s,coordinate:c,background:l=!1,scale:u,emitter:f,state:h={},region:d=!1,regionEleFilter:p=t=>GR.includes(t.markType)}){var g;const v=e(t),m=new Set(v),y=WR({elementsof:e,root:t,coordinate:c,scale:u}),b=Qn(v,r),x=Qn(v,i),w=PR(v,n),[k,E]=CR(Object.assign({link:a,elements:v,valueof:w,coordinate:c},Va(h.selected,"link"))),[M,O]=LR(Object.assign({document:t.ownerDocument,background:l,coordinate:c,scale:u,valueof:w},Va(h.selected,"background"))),S=Q(h,{selected:Object.assign({},(null===(g=h.selected)||void 0===g?void 0:g.offset)&&{transform:(...t)=>{const e=h.selected.offset(...t),[,n]=t;return NR(v[n],e,c)}})}),A=SR(S,v),{updateState:_,removeState:T,hasState:P}=A(w);let C=!o,N=null;const L=(t=!0)=>{for(const t of v)T(t,"selected","unselected"),E(t),O(t);t&&f.emit("element:unselect",{nativeEvent:!0})},j=({event:t,element:e,nativeEvent:i=!0,filter:a=t=>!0,groupBy:o=r,groupMap:s=b})=>{const c=v.filter(a);if(P(e,"selected"))L();else{const r=o(e),a=s.get(r),l=new Set(a);for(const t of c)l.has(t)?_(t,"selected"):(_(t,"unselected"),E(t)),t!==e&&O(t);if(k(a),M(e),!i)return;f.emit("element:select",Object.assign(Object.assign({},t),{nativeEvent:i,data:{data:[n(e),...a.map(n)]}}))}},R=({event:t,element:e,nativeEvent:i=!0,filter:o=t=>!0,groupBy:s=r,groupMap:c=b})=>{const l=s(e),u=c.get(l),h=new Set(u),d=v.filter(o);if(P(e,"selected")){const t=v.some((t=>!h.has(t)&&P(t,"selected")));if(!t)return L();for(const t of u)_(t,"unselected"),E(t),O(t)}else{const t=u.some((t=>P(t,"selected")));for(const t of d)h.has(t)?_(t,"selected"):P(t,"selected")||_(t,"unselected");!t&&a&&k(u),M(e)}i&&f.emit("element:select",Object.assign(Object.assign({},t),{nativeEvent:i,data:{data:v.filter((t=>P(t,"selected"))).map(n)}}))},I=t=>{if(m.has(t))return t;for(const e of m){let n=null;if(sR(e,(r=>{r===t&&(n=e)})),n)return n}return t},D=t=>{const{target:e,nativeEvent:n=!0}=t,a=C?R:j;let o=e;const s=(t=>{if(m.has(t))return!0;for(const e of m)if(sR(e,(e=>e===t)))return!0;return!1})(e);return!d||s?s?a({event:t,element:I(o),nativeEvent:n,groupBy:r}):L():(o=y(t),m.has(o)?a({event:t,element:o,nativeEvent:n,filter:p,groupBy:i,groupMap:x}):L())},B=Array.isArray(s)?s:[s],F=t=>{B.includes(t.code)&&!N&&(N=t.code,C=!0)},z=t=>{t.code===N&&(N=null,C=!1)};t.addEventListener("click",D),s&&(C=!1,document.addEventListener("keydown",F),document.addEventListener("keyup",z));const G=t=>{const{nativeEvent:e,data:r}=t;if(e)return;const i=C?r.data:r.data.slice(0,1);for(const t of i){const e=IR(v,t,n);D({target:e,nativeEvent:!1})}},W=()=>{L(!1)};return f.on("element:select",G),f.on("element:unselect",W),()=>{for(const t of v)E(t);t.removeEventListener("click",D),s&&(document.removeEventListener("keydown",F),document.removeEventListener("keyup",z)),f.off("element:select",G),f.off("element:unselect",W)}}function UR(t){var{createGroup:e,createRegionGroup:n,background:r=!1,link:i=!1}=t,a=Le(t,["createGroup","createRegionGroup","background","link"]);return(t,o,s)=>{const{container:c,view:l,options:u}=t,{coordinate:f,scale:h}=l;return VR(vR(c),Object.assign({elements:dR,datum:kR(l),groupKey:e?e(l):void 0,regionGroupKey:n?n(l):t=>t.__data__.x,coordinate:f,scale:h,state:TR(u,[["selected",r?{}:{lineWidth:"1",stroke:"#000"}],"unselected"]),background:r,link:i,emitter:s},a))}}function qR(t){return UR(Object.assign(Object.assign({},t),{createGroup:wR}))}function XR(t){return UR(Object.assign(Object.assign({},t),{createGroup:xR}))}function KR(t){var{wait:e=20,leading:n,trailing:r=!1,labelFormatter:i=t=>`${t}`}=t,a=Le(t,["wait","leading","trailing","labelFormatter"]);return t=>{const{view:o,container:s,update:c,setState:l}=t,{markState:u,scale:f,coordinate:h}=o,d=function(t,e,n){const[r]=Array.from(t.entries()).filter((([t])=>t.type===e)).map((([t])=>{const{encode:e}=t;return Object.fromEntries(n.map((t=>{const n=e[t];return[t,n?n.value:void 0]})))}));return r}(u,"line",["x","y","series"]);if(!d)return;const{y:p,x:g,series:v=[]}=d,m=p.map(((t,e)=>e)),y=rr(m.map((t=>g[t]))),b=vR(s),x=s.getElementsByClassName(US),w=Qn(s.getElementsByClassName(ZS),(t=>t.__data__.key.split("-")[0])),k=new Ig({style:Object.assign({x1:0,y1:0,x2:0,y2:b.getAttribute("height"),stroke:"black",lineWidth:1},Va(a,"rule"))}),E=new Yg({style:Object.assign({x:0,y:b.getAttribute("height"),text:"",fontSize:10},Va(a,"label"))});k.append(E),b.appendChild(k);const M=(t,e,n)=>{const[r]=t.invert(n),i=e.invert(r);return y[$n(y,i)]},O=(t,e)=>{k.setAttribute("x1",t[0]),k.setAttribute("x2",t[0]),E.setAttribute("text",i(e))};let S;const A=ot((t=>{const e=yR(b,t);e&&(t=>{const{scale:e,coordinate:n}=S,{x:r,y:i}=e,a=M(n,r,t);O(t,a);for(const t of x){const{seriesIndex:e,key:r}=t.__data__,o=e[Dn((t=>g[+t])).center(e,a)],s=[0,i.map(1)],c=[0,i.map(p[o]/p[e[0]])],[,l]=n.map(s),[,u]=n.map(c),f=l-u;t.setAttribute("transform",`translate(0, ${f})`);const h=w.get(r)||[];for(const t of h)t.setAttribute("dy",f)}})(e)}),e,{leading:n,trailing:r});return(t=>{Re(this,void 0,void 0,(function*(){const{x:e}=f,n=M(h,e,t);O(t,n),l("chartIndex",(t=>{const e=Q({},t),r=e.marks.find((t=>"line"===t.type)),i=gr(tr(m,(t=>gr(t,(t=>+p[t]))/mr(t,(t=>+p[t]))),(t=>v[t])).values());Q(r,{scale:{y:{domain:[1/i,i]}}});const a=function(t){const{transform:e=[]}=t,n=e.find((t=>"normalizeY"===t.type));if(n)return n;const r={type:"normalizeY"};return e.push(r),t.transform=e,r}(r);a.groupBy="color",a.basis=(t,e)=>e[t[Dn((t=>g[+t])).center(t,n)]];for(const t of e.marks)t.animate=!1;return e}));const r=yield c("chartIndex");S=r.view}))})([0,0]),b.addEventListener("pointerenter",A),b.addEventListener("pointermove",A),b.addEventListener("pointerleave",A),()=>{k.remove(),b.removeEventListener("pointerenter",A),b.removeEventListener("pointermove",A),b.removeEventListener("pointerleave",A)}}}function ZR({wait:t=30,leading:e,trailing:n=!1}){return r=>{const{options:i,update:a,setState:o,container:s}=r,c=vR(s),l=ot((t=>{const e=yR(c,t);if(!e)return o("fisheye"),void a();o("fisheye",(t=>{const n=Q({},t,{interaction:{tooltip:{preserve:!0}}});for(const t of n.marks)t.animate=!1;const[r,i]=e,a=function(t){const{coordinate:e={}}=t,{transform:n=[]}=e,r=n.find((t=>"fisheye"===t.type));if(r)return r;const i={type:"fisheye"};return n.push(i),e.transform=n,t.coordinate=e,i}(n);return a.focusX=r,a.focusY=i,a.visual=!0,n})),a()}),t,{leading:e,trailing:n});return c.addEventListener("pointerenter",l),c.addEventListener("pointermove",l),c.addEventListener("pointerleave",l),()=>{c.removeEventListener("pointerenter",l),c.removeEventListener("pointermove",l),c.removeEventListener("pointerleave",l)}}}function QR(t,e){var n;if(e)return"string"==typeof e?document.querySelector(e):e;const r=null===(n=t.ownerDocument)||void 0===n?void 0:n.defaultView;if(!r)return;return r.getContextService().getDomElement().parentElement}function JR(t,e,n,r,i,a,o,s={},c=[10,10]){const l=new Zw({className:"tooltip",style:{x:e,y:n,container:o,data:[],bounding:a,position:r,enterable:i,title:"",offset:c,template:{prefixCls:"g2-"},style:Q({".g2-tooltip":{},".g2-tooltip-title":{overflow:"hidden","white-space":"nowrap","text-overflow":"ellipsis"}},s)}});return t.appendChild(l.HTMLTooltipElement),l}function tI({root:t,data:e,x:n,y:r,render:i,event:a,single:o,position:s="right-bottom",enterable:c=!1,css:l,mount:u,bounding:f,offset:h}){const d=QR(t,u),p=QR(t),g=o?p:t,v=f||function(t){const e=t.getRenderBounds(),{min:[n,r],max:[i,a]}=e;return{x:n,y:r,width:i-n,height:a-r}}(t),m=function(t,e){const n=t.getBoundingClientRect(),r=e.getBoundingClientRect();return{x:n.x-r.x,y:n.y-r.y}}(p,d),{tooltipElement:y=JR(d,n,r,s,c,v,m,l,h)}=g,{items:b,title:x=""}=e;y.update(Object.assign({x:n,y:r,data:b,title:x,position:s,enterable:c,container:m},void 0!==i&&{content:i(a,{items:b,title:x})})),g.tooltipElement=y}function eI({root:t,single:e,emitter:n,nativeEvent:r=!0,event:i=null}){r&&n.emit("tooltip:hide",{nativeEvent:r});const a=QR(t),o=e?a:t,{tooltipElement:s}=o;s&&s.hide(null==i?void 0:i.clientX,null==i?void 0:i.clientY),lI(t),uI(t),fI(t)}function nI({root:t,single:e}){const n=QR(t),r=e?n:t;if(!r)return;const{tooltipElement:i}=r;i&&(i.destroy(),r.tooltipElement=void 0),lI(t),uI(t),fI(t)}function rI(t){const{value:e}=t;return Object.assign(Object.assign({},t),{value:void 0===e?"undefined":e})}function iI(t){const e=t.getAttribute("fill"),n=t.getAttribute("stroke"),{__data__:r}=t,{color:i=(e&&"transparent"!==e?e:n)}=r;return i}function aI(t,e=t=>t){const n=new Map(t.map((t=>[e(t),t])));return Array.from(n.values())}function oI(t,e,n,r=t.map((t=>t.__data__)),i={}){const a=t=>t instanceof Date?+t:t,o=aI(r.map((t=>t.title)),a).filter(Ha),s=r.flatMap(((r,a)=>{const o=t[a],{items:s=[],title:c}=r,l=s.filter(Ha),u=void 0!==n?n:s.length<=1;return l.map((t=>{var{color:n=iI(o)||i.color,name:a}=t,s=Le(t,["color","name"]);const l=Ba(e,r),f=u&&!(pj in s)?l||a:a||l;return Object.assign(Object.assign({},s),{color:n,name:f||c})}))})).map(rI);return Object.assign(Object.assign({},o.length>0&&{title:o.join(",")}),{items:aI(s,(t=>`(${a(t.name)}, ${a(t.value)}, ${a(t.color)})`))})}function sI(t,e,n,r){var{plotWidth:i,plotHeight:a,mainWidth:o,mainHeight:s,startX:c,startY:l,transposed:u,polar:f,insetLeft:h,insetTop:d}=r,p=Le(r,["plotWidth","plotHeight","mainWidth","mainHeight","startX","startY","transposed","polar","insetLeft","insetTop"]);const g=Object.assign({lineWidth:1,stroke:"#1b1e23",strokeOpacity:.5},p),v=((t,e)=>{if(1===e.length)return e[0];const n=e.map((e=>Es(e,t))),r=yr(n,(t=>t));return e[r]})(n,e);if(f){const[e,n,r]=(()=>{const t=c+h+o/2,e=l+d+s/2;return[t,e,Es([t,e],v)]})(),i=t.ruleX||((e,n,r)=>{const i=new Ag({style:Object.assign({cx:e,cy:n,r:r},g)});return t.appendChild(i),i})(e,n,r);i.style.cx=e,i.style.cy=n,i.style.r=r,t.ruleX=i}else{const[e,n,r,o]=u?[c+v[0],c+v[0],l,l+a]:[c,c+i,v[1]+l,v[1]+l],s=t.ruleX||((e,n,r,i)=>{const a=new Ig({style:Object.assign({x1:e,x2:n,y1:r,y2:i},g)});return t.appendChild(a),a})(e,n,r,o);s.style.x1=e,s.style.x2=n,s.style.y1=r,s.style.y2=o,t.ruleX=s}}function cI(t,e,n){var{plotWidth:r,plotHeight:i,mainWidth:a,mainHeight:o,startX:s,startY:c,transposed:l,polar:u,insetLeft:f,insetTop:h}=n,d=Le(n,["plotWidth","plotHeight","mainWidth","mainHeight","startX","startY","transposed","polar","insetLeft","insetTop"]);const p=Object.assign({lineWidth:1,stroke:"#1b1e23",strokeOpacity:.5},d),g=e.map((t=>t[1])),v=e.map((t=>t[0])),m=kr(g),y=kr(v),[b,x,w,k]=(()=>{if(u){const t=Math.min(a,o)/2,e=s+f+a/2,n=c+h+o/2,r=Ms(ws([y,m],[e,n]));return[e,e+t*Math.cos(r),n,n+t*Math.sin(r)]}return l?[s,s+r,m+c,m+c]:[y+s,y+s,c,c+i]})();if(v.length>0){const e=t.ruleY||(()=>{const e=new Ig({style:Object.assign({x1:b,x2:x,y1:w,y2:k},p)});return t.appendChild(e),e})();e.style.x1=b,e.style.x2=x,e.style.y1=w,e.style.y2=k,t.ruleY=e}}function lI(t){t.ruleY&&(t.ruleY.remove(),t.ruleY=void 0)}function uI(t){t.ruleX&&(t.ruleX.remove(),t.ruleX=void 0)}function fI(t){t.markers&&(t.markers.forEach((t=>t.remove())),t.markers=[])}function hI(t,e){return Array.from(t.values()).some((t=>{var n;return null===(n=t.interaction)||void 0===n?void 0:n[e]}))}function dI(t,e){return void 0===t?e:t}function pI(t){const{title:e,items:n}=t;return 0===n.length&&void 0===e}function gI({root:t,event:e,elements:n,coordinate:r,scale:i,shared:a}){var o,s;const c=n.every((t=>"interval"===t.markType))&&!Uc(r),l=i.x,u=i.series,f=null!==(s=null===(o=null==l?void 0:l.getBandWidth)||void 0===o?void 0:o.call(l))&&void 0!==s?s:0,h=u?t=>{const e=Math.round(1/u.valueBandWidth);return t.__data__.x+t.__data__.series*f+f/(2*e)}:t=>t.__data__.x+f/2;c&&n.sort(((t,e)=>h(t)-h(e)));const d=t=>{const{target:e}=t;return zR(e,(t=>!!t.classList&&t.classList.includes("element")))},p=c?e=>{const i=yR(t,e);if(!i)return;const[o]=r.invert(i),s=(0,Dn(h).center)(n,o),c=n[s];if(!a){const t=n.find((t=>t!==c&&h(t)===h(c)));if(t)return d(e)}return c}:d;return p(e)}function vI({root:t,event:e,elements:n,coordinate:r,scale:i,startX:a,startY:o}){const s=Vc(r),c=[],l=[];for(const t of n){const{__data__:e}=t,{seriesX:n,title:r,items:i}=e;n?c.push(t):(r||i)&&l.push(t)}const u=l.length&&l.every((t=>"interval"===t.markType))&&!Uc(r),f=t=>t.__data__.x,h=!!i.x.getBandWidth&&l.length>0;c.sort(((t,e)=>{const n=s?0:1,r=t=>t.getBounds().min[n];return s?r(e)-r(t):r(t)-r(e)}));const d=t=>{const e=s?1:0,{min:n,max:r}=t.getLocalBounds();return rr([n[e],r[e]])};u?n.sort(((t,e)=>f(t)-f(e))):l.sort(((t,e)=>{const[n,r]=d(t),[i,a]=d(e),o=(n+r)/2,c=(i+a)/2;return s?c-o:o-c}));const p=new Map(c.map((t=>{const{__data__:e}=t,{seriesX:n}=e,r=n.map(((t,e)=>e)),i=rr(r,(t=>n[+t]));return[t,[i,n]]}))),{x:g}=i,v=(null==g?void 0:g.getBandWidth)?g.getBandWidth()/2:0,m=t=>{const[e]=r.invert(t);return e-v},y=(t,e,n,r)=>{const{_x:i}=t,a=void 0!==i?g.map(i):m(e),o=r.filter(Ha),[s,c]=rr([o[0],o[o.length-1]]);if(!h&&(a<s||a>c)&&!(s===c))return null;const l=Dn((t=>r[+t])).center;return n[l(n,a)]},b=u?(t,e)=>{const n=e[(0,Dn(f).center)(e,m(t))];return Qn(e,f).get(f(n))}:(t,e)=>{const n=t[s?1:0],r=e.filter((t=>{const[e,r]=d(t);return n>=e&&n<=r}));if(!h||r.length>0)return r;const i=Dn((t=>{const[e,n]=d(t);return(e+n)/2})).center;return[e[i(e,n)]].filter(Ha)},x=(t,e)=>{const{__data__:n}=t;return Object.fromEntries(Object.entries(n).filter((([t])=>t.startsWith("series")&&"series"!==t)).map((([t,n])=>{const r=n[e];return[W(t.replace("series","")),r]})))},w=yR(t,e);if(!w)return;const k=[w[0]-a,w[1]-o];if(!k)return;const E=b(k,l),M=[],O=[];for(const t of c){const[n,i]=p.get(t),a=y(e,k,n,i);if(null!==a){M.push(t);const e=x(t,a),{x:n,y:i}=e,o=r.map([(n||0)+v,i||0]);O.push([Object.assign(Object.assign({},e),{element:t}),o])}}const S=Array.from(new Set(O.map((t=>t[0].x)))),A=S[yr(S,(t=>Math.abs(t-m(k))))],_=O.filter((t=>t[0].x===A)),T=[..._.map((t=>t[0])),...E.map((t=>t.__data__))];return{selectedElements:[...M,...E],selectedData:T,filteredSeriesData:_,abstractX:m}}function mI(t,e){var{elements:n,sort:r,filter:i,scale:a,coordinate:o,crosshairs:s,crosshairsX:c,crosshairsY:l,render:u,groupName:f,emitter:h,wait:d=50,leading:p=!0,trailing:g=!1,startX:v=0,startY:m=0,body:y=!0,single:b=!0,position:x,enterable:w,mount:k,bounding:E,theme:M,offset:O,disableNative:S=!1,marker:A=!0,preserve:_=!1,style:T={},css:P={}}=e,C=Le(e,["elements","sort","filter","scale","coordinate","crosshairs","crosshairsX","crosshairsY","render","groupName","emitter","wait","leading","trailing","startX","startY","body","single","position","enterable","mount","bounding","theme","offset","disableNative","marker","preserve","style","css"]);const N=n(t),L=Q(T,C),j=Uc(o),R=Vc(o),{innerWidth:I,innerHeight:D,width:B,height:F,insetLeft:z,insetTop:G}=o.getOptions(),W=ot((e=>{var n;const d=yR(t,e);if(!d)return;const p=mR(t),g=p.min[0],S=p.min[1],{selectedElements:_,selectedData:T,filteredSeriesData:C,abstractX:W}=vI({root:t,event:e,elements:N,coordinate:o,scale:a,startX:v,startY:m}),H=oI(_,a,f,T,M);if(r&&H.items.sort(((t,e)=>r(t)-r(e))),i&&(H.items=H.items.filter(i)),0===_.length||pI(H))return void $(e);if(y&&tI({root:t,data:H,x:d[0]+g,y:d[1]+S,render:u,event:e,single:b,position:x,enterable:w,mount:k,bounding:E,css:P,offset:O}),s||c||l){const e=Va(L,"crosshairs"),n=Object.assign(Object.assign({},e),Va(L,"crosshairsX")),r=Object.assign(Object.assign({},e),Va(L,"crosshairsY")),i=C.map((t=>t[1]));c&&sI(t,i,d,Object.assign(Object.assign({},n),{plotWidth:I,plotHeight:D,mainWidth:B,mainHeight:F,insetLeft:z,insetTop:G,startX:v,startY:m,transposed:R,polar:j})),l&&cI(t,i,Object.assign(Object.assign({},r),{plotWidth:I,plotHeight:D,mainWidth:B,mainHeight:F,insetLeft:z,insetTop:G,startX:v,startY:m,transposed:R,polar:j}))}if(A){const e=Va(L,"marker");!function(t,{data:e,style:n,theme:r}){t.markers&&t.markers.forEach((t=>t.remove()));const{type:i=""}=n,a=e.filter((t=>{const[{x:e,y:n}]=t;return Ha(e)&&Ha(n)})).map((t=>{const[{color:e,element:a},o]=t,s=e||a.style.fill||a.style.stroke||r.color,c="hollow"===i?"transparent":s,l="hollow"===i?s:"#fff";return new Ag({className:"g2-tooltip-marker",style:Object.assign({cx:o[0],cy:o[1],fill:c,r:4,stroke:l,lineWidth:2,pointerEvents:"none"},n)})}));for(const e of a)t.appendChild(e);t.markers=a}(t,{data:C,style:e,theme:M})}const Y=null===(n=C[0])||void 0===n?void 0:n[0].x,V=null!=Y?Y:W(focus);h.emit("tooltip:show",Object.assign(Object.assign({},e),{nativeEvent:!0,data:Object.assign(Object.assign({},H),{data:{x:cS(a.x,V,!0)}})}))}),d,{leading:p,trailing:g}),$=e=>{eI({root:t,single:b,emitter:h,event:e})},H=()=>{nI({root:t,single:b})},Y=e=>{var n,{nativeEvent:r,data:i,offsetX:s,offsetY:c}=e,l=Le(e,["nativeEvent","data","offsetX","offsetY"]);if(r)return;const u=null===(n=null==i?void 0:i.data)||void 0===n?void 0:n.x,f=a.x.map(u),[h,d]=o.map([f,.5]),p=t.getRenderBounds(),g=p.min[0],v=p.min[1];W(Object.assign(Object.assign({},l),{offsetX:void 0!==s?s:g+h,offsetY:void 0!==c?c:v+d,_x:u}))},V=()=>{eI({root:t,single:b,emitter:h,nativeEvent:!1})},U=()=>{K(),H()},q=()=>{X()},X=()=>{S||(t.addEventListener("pointerdown",W),t.addEventListener("pointerenter",W),t.addEventListener("pointermove",W),t.addEventListener("pointerleave",(e=>{yR(t,e)||$(e)})),t.addEventListener("pointerup",$))},K=()=>{S||(t.removeEventListener("pointerdown",W),t.removeEventListener("pointerenter",W),t.removeEventListener("pointermove",W),t.removeEventListener("pointerleave",$),t.removeEventListener("pointerup",$))};return X(),h.on("tooltip:show",Y),h.on("tooltip:hide",V),h.on("tooltip:disable",U),h.on("tooltip:enable",q),()=>{K(),h.off("tooltip:show",Y),h.off("tooltip:hide",V),h.off("tooltip:disable",U),h.off("tooltip:enable",q),_?eI({root:t,single:b,emitter:h,nativeEvent:!1}):H()}}function yI(t,{elements:e,coordinate:n,scale:r,render:i,groupName:a,sort:o,filter:s,emitter:c,wait:l=50,leading:u=!0,trailing:f=!1,groupKey:h=t=>t,single:d=!0,position:p,enterable:g,datum:v,view:m,mount:y,bounding:b,theme:x,offset:w,shared:k=!1,body:E=!0,disableNative:M=!1,preserve:O=!1,css:S={}}){const A=e(t),_=Qn(A,h),T=ot((e=>{const l=gI({root:t,event:e,elements:A,coordinate:n,scale:r,shared:k});if(!l)return void eI({root:t,single:d,emitter:c,event:e});const u=h(l),f=_.get(u);if(!f)return;const v=1!==f.length||k?oI(f,r,a,void 0,x):function(t){const{__data__:e}=t,{title:n,items:r=[]}=e,i=r.filter(Ha).map((e=>{var{color:n=iI(t)}=e,r=Le(e,["color"]);return Object.assign(Object.assign({},r),{color:n})})).map(rI);return Object.assign(Object.assign({},n&&{title:n}),{items:i})}(f[0]);if(o&&v.items.sort(((t,e)=>o(t)-o(e))),s&&(v.items=v.items.filter(s)),pI(v))return void eI({root:t,single:d,emitter:c,event:e});const{offsetX:M,offsetY:O}=e;E&&tI({root:t,data:v,x:M,y:O,render:i,event:e,single:d,position:p,enterable:g,mount:y,bounding:b,css:S,offset:w}),c.emit("tooltip:show",Object.assign(Object.assign({},e),{nativeEvent:!0,data:Object.assign(Object.assign({},v),{data:Da(l,m)})}))}),l,{leading:u,trailing:f}),P=e=>{eI({root:t,single:d,emitter:c,event:e})},C=()=>{M||(t.addEventListener("pointerdown",T),t.addEventListener("pointermove",T),t.addEventListener("pointerleave",P),t.addEventListener("pointerup",P))},N=()=>{M||(t.removeEventListener("pointerdown",T),t.removeEventListener("pointermove",T),t.removeEventListener("pointerleave",P),t.removeEventListener("pointerup",P))},L=({nativeEvent:e,offsetX:n,offsetY:r,data:i})=>{if(e)return;const{data:a}=i,o=IR(A,a,v);if(!o)return;const s=o.getBBox(),{x:c,y:l,width:u,height:f}=s,h=t.getBBox();T({target:o,offsetX:void 0!==n?n+h.x:c+u/2,offsetY:void 0!==r?r+h.y:l+f/2})},j=({nativeEvent:e}={})=>{e||eI({root:t,single:d,emitter:c,nativeEvent:!1})};return c.on("tooltip:show",L),c.on("tooltip:hide",j),c.on("tooltip:enable",(()=>{C()})),c.on("tooltip:disable",(()=>{N(),nI({root:t,single:d})})),C(),()=>{N(),c.off("tooltip:show",L),c.off("tooltip:hide",j),O?eI({root:t,single:d,emitter:c,nativeEvent:!1}):nI({root:t,single:d})}}function bI(t){const{shared:e,crosshairs:n,crosshairsX:r,crosshairsY:i,series:a,name:o,item:s=()=>({}),facet:c=!1}=t,l=Le(t,["shared","crosshairs","crosshairsX","crosshairsY","series","name","item","facet"]);return(t,o,u)=>{const{container:f,view:h}=t,{scale:d,markState:p,coordinate:g,theme:v}=h,m=hI(p,"seriesTooltip"),y=hI(p,"crosshairs"),b=vR(f),x=dI(a,m),w=dI(n,y);if(x&&function(t){return Array.from(t.values()).some((t=>{var e;return(null===(e=t.interaction)||void 0===e?void 0:e.seriesTooltip)&&t.tooltip}))}(p)&&!c)return mI(b,Object.assign(Object.assign({},l),{theme:v,elements:dR,scale:d,coordinate:g,crosshairs:w,crosshairsX:dI(dI(r,n),!1),crosshairsY:dI(i,w),item:s,emitter:u}));if(x&&c){const e=o.filter((e=>e!==t&&e.options.parentKey===t.options.key)),a=pR(t,o),c=e[0].view.scale,f=b.getBounds(),h=f.min[0],d=f.min[1];return Object.assign(c,{facet:!0}),mI(b.parentNode.parentNode,Object.assign(Object.assign({},l),{theme:v,elements:()=>a,scale:c,coordinate:g,crosshairs:dI(n,y),crosshairsX:dI(dI(r,n),!1),crosshairsY:dI(i,w),item:s,startX:h,startY:d,emitter:u}))}return yI(b,Object.assign(Object.assign({},l),{datum:kR(h),elements:dR,scale:d,coordinate:g,groupKey:e?t=>t.__data__.x:void 0,item:s,emitter:u,view:h,theme:v,shared:e}))}}$R.props={reapplyWhenUpdate:!0},HR.props={reapplyWhenUpdate:!0},YR.props={reapplyWhenUpdate:!0},UR.props={reapplyWhenUpdate:!0},qR.props={reapplyWhenUpdate:!0},XR.props={reapplyWhenUpdate:!0},KR.props={reapplyWhenUpdate:!0},bI.props={reapplyWhenUpdate:!0};const xI="legend-category";function wI(t){return t.getElementsByClassName("legend-category-item-marker")[0]}function kI(t){return t.getElementsByClassName("legend-category-item-label")[0]}function EI(t){return t.getElementsByClassName("items-item")}function MI(t){return t.getElementsByClassName(xI)}function OI(t){return t.getElementsByClassName("legend-continuous")}function SI(t){let e=t.parentNode;for(;e&&!e.__data__;)e=e.parentNode;return e.__data__}function AI(t,{legend:e,channel:n,value:r,ordinal:i,channels:a,allChannels:o,facet:s=!1}){return Re(this,void 0,void 0,(function*(){const{view:c,update:l,setState:u}=t;u(e,(t=>{const{marks:e}=t,l=e.map((t=>{if("legends"===t.type)return t;const{transform:e=[],data:l=[]}=t,u=e.findIndex((({type:t})=>t.startsWith("group")||t.startsWith("bin"))),f=[...e];l.length&&f.splice(u+1,0,{type:"filter",[n]:{value:r,ordinal:i}});const h=Object.fromEntries(a.map((t=>[t,{domain:c.scale[t].getOptions().domain}])));return Q({},t,Object.assign(Object.assign({transform:f,scale:h},!i&&{animate:!1}),{legend:!s&&Object.fromEntries(o.map((t=>[t,{preserve:!0}])))}))}));return Object.assign(Object.assign({},t),{marks:l})})),yield l()}))}function _I(t,e){for(const n of t)AI(n,Object.assign(Object.assign({},e),{facet:!0}))}function TI(){return(t,e,n)=>{const{container:r}=t,i=e.filter((e=>e!==t)),a=i.length>0,o=t=>SI(t).scales.map((t=>t.name)),s=[...MI(r),...OI(r)],c=s.flatMap(o),l=ot(a?_I:AI,50,{trailing:!0}),u=s.map((e=>{const{name:s,domain:u}=SI(e).scales[0],f={legend:e,channel:s,channels:o(e),allChannels:c};return e.className===xI?function(t,{legends:e,marker:n,label:r,datum:i,filter:a,emitter:o,channel:s,state:c={}}){const l=new Map,u=new Map,f=new Map,{unselected:h={markerStroke:"#aaa",markerFill:"#aaa",labelFill:"#aaa"}}=c,d={unselected:Va(h,"marker")},p={unselected:Va(h,"label")},{setState:g,removeState:v}=AR(d,void 0),{setState:m,removeState:y}=AR(p,void 0),b=Array.from(e(t));let x=b.map(i);const w=()=>{for(const t of b){const e=i(t),a=n(t),o=r(t);x.includes(e)?(v(a,"unselected"),y(o,"unselected")):(g(a,"unselected"),m(o,"unselected"))}};for(const e of b){const n=()=>{jR(t,"pointer")},r=()=>{RR(t)},c=t=>Re(this,void 0,void 0,(function*(){const n=i(e),r=x.indexOf(n);-1===r?x.push(n):x.splice(r,1),yield a(x),w();const{nativeEvent:c=!0}=t;c&&(x.length===b.length?o.emit("legend:reset",{nativeEvent:c}):o.emit("legend:filter",Object.assign(Object.assign({},t),{nativeEvent:c,data:{channel:s,values:x}})))}));e.addEventListener("click",c),e.addEventListener("pointerenter",n),e.addEventListener("pointerout",r),l.set(e,c),u.set(e,n),f.set(e,r)}const k=t=>Re(this,void 0,void 0,(function*(){const{nativeEvent:e}=t;if(e)return;const{data:n}=t,{channel:r,values:i}=n;r===s&&(x=i,yield a(x),w())})),E=t=>Re(this,void 0,void 0,(function*(){const{nativeEvent:e}=t;e||(x=b.map(i),yield a(x),w())}));return o.on("legend:filter",k),o.on("legend:reset",E),()=>{for(const t of b)t.removeEventListener("click",l.get(t)),t.removeEventListener("pointerenter",u.get(t)),t.removeEventListener("pointerout",f.get(t)),o.off("legend:filter",k),o.off("legend:reset",E)}}(r,{legends:EI,marker:wI,label:kI,datum:t=>{const{__data__:e}=t,{index:n}=e;return u[n]},filter:e=>{const n=Object.assign(Object.assign({},f),{value:e,ordinal:!0});l(a?i:t,n)},state:e.attributes.state,channel:s,emitter:n}):function(t,{legend:e,filter:n,emitter:r,channel:i}){const a=({detail:{value:t}})=>{n(t),r.emit({nativeEvent:!0,data:{channel:i,values:t}})};return e.addEventListener("valuechange",a),()=>{e.removeEventListener("valuechange",a)}}(0,{legend:e,filter:e=>{const n=Object.assign(Object.assign({},f),{value:e,ordinal:!1});l(a?i:t,n)},emitter:n,channel:s})}));return()=>{u.forEach((t=>t()))}}}function PI(){return(t,e,n)=>{const{container:r,view:i,options:a}=t,o=MI(r),s=dR(r),c=t=>SI(t).scales[0].name,l=t=>{const{scale:{[t]:e}}=i;return e},u=TR(a,["active","inactive"]),f=PR(s,kR(i)),h=[];for(const t of o){const e=e=>{const{data:n}=t.attributes,{__data__:r}=e,{index:i}=r;return n[i].label},r=c(t),i=EI(t),a=l(r),o=Qn(s,(t=>a.invert(t.__data__[r]))),{state:d={}}=t.attributes,{inactive:p={}}=d,{setState:g,removeState:v}=AR(u,f),m={inactive:Va(p,"marker")},y={inactive:Va(p,"label")},{setState:b,removeState:x}=AR(m),{setState:w,removeState:k}=AR(y),E=t=>{for(const e of i){const n=wI(e),r=kI(e);e===t||null===t?(x(n,"inactive"),k(r,"inactive")):(b(n,"inactive"),w(r,"inactive"))}},M=(t,i)=>{const a=e(i),c=new Set(o.get(a));for(const t of s)c.has(t)?g(t,"active"):g(t,"inactive");E(i);const{nativeEvent:l=!0}=t;l&&n.emit("legend:highlight",Object.assign(Object.assign({},t),{nativeEvent:l,data:{channel:r,value:a}}))},O=new Map;for(const t of i){const e=e=>{M(e,t)};t.addEventListener("pointerover",e),O.set(t,e)}const S=t=>{for(const t of s)v(t,"inactive","active");E(null);const{nativeEvent:e=!0}=t;e&&n.emit("legend:unhighlight",{nativeEvent:e})},A=t=>{const{nativeEvent:n,data:a}=t;if(n)return;const{channel:o,value:s}=a;if(o!==r)return;const c=i.find((t=>e(t)===s));c&&M({nativeEvent:!1},c)},_=t=>{const{nativeEvent:e}=t;e||S({nativeEvent:!1})};t.addEventListener("pointerleave",S),n.on("legend:highlight",A),n.on("legend:unhighlight",_);const T=()=>{t.removeEventListener(S),n.off("legend:highlight",A),n.off("legend:unhighlight",_);for(const[t,e]of O)t.removeEventListener(e)};h.push(T)}return()=>h.forEach((t=>t()))}}function CI(t,e){const[n,r,i,a]=t,[o,s,c,l]=e;return!(o>i||c<n||s>a||l<r)}function NI(t){const{width:e,height:n}=t.getBBox();return[0,0,e,n]}function LI(t,e){for(const[n,r]of Object.entries(e))t.style(n,r)}const jI=Om((t=>{const e=t.attributes,{x:n,y:r,width:i,height:a,class:o,renders:s={},handleSize:c=10,document:l}=e,u=Le(e,["x","y","width","height","class","renders","handleSize","document"]);if(!l||void 0===i||void 0===a||void 0===n||void 0===r)return;const f=c/2,h=(t,e,n)=>{t.handle||(t.handle=n.createElement("rect"),t.append(t.handle));const{handle:r}=t;return r.attr(e),r},d=Va(qa(u,"handleNW","handleNE"),"handleN"),{render:p=h}=d,g=Le(d,["render"]),v=Va(u,"handleE"),{render:m=h}=v,y=Le(v,["render"]),b=Va(qa(u,"handleSE","handleSW"),"handleS"),{render:x=h}=b,w=Le(b,["render"]),k=Va(u,"handleW"),{render:E=h}=k,M=Le(k,["render"]),O=Va(u,"handleNW"),{render:S=h}=O,A=Le(O,["render"]),_=Va(u,"handleNE"),{render:T=h}=_,P=Le(_,["render"]),C=Va(u,"handleSE"),{render:N=h}=C,L=Le(C,["render"]),j=Va(u,"handleSW"),{render:R=h}=j,I=Le(j,["render"]),D=t=>()=>{const e=Om((e=>((t,e)=>{const{id:n}=t,r=e(t,t.attributes,l);r.id=n,r.style.draggable=!0})(e,t)));return new e({})},B=am(t).attr("className",o).style("transform",`translate(${n}, ${r})`).style("draggable",!0);B.maybeAppend("selection","rect").style("draggable",!0).style("fill","transparent").call(LI,Object.assign(Object.assign({width:i,height:a},qa(u,"handle")),{transform:void 0})),B.maybeAppend("handle-n",D(p)).style("x",f).style("y",-f).style("width",i-c).style("height",c).style("fill","transparent").call(LI,g),B.maybeAppend("handle-e",D(m)).style("x",i-f).style("y",f).style("width",c).style("height",a-c).style("fill","transparent").call(LI,y),B.maybeAppend("handle-s",D(x)).style("x",f).style("y",a-f).style("width",i-c).style("height",c).style("fill","transparent").call(LI,w),B.maybeAppend("handle-w",D(E)).style("x",-f).style("y",f).style("width",c).style("height",a-c).style("fill","transparent").call(LI,M),B.maybeAppend("handle-nw",D(S)).style("x",-f).style("y",-f).style("width",c).style("height",c).style("fill","transparent").call(LI,A),B.maybeAppend("handle-ne",D(T)).style("x",i-f).style("y",-f).style("width",c).style("height",c).style("fill","transparent").call(LI,P),B.maybeAppend("handle-se",D(N)).style("x",i-f).style("y",a-f).style("width",c).style("height",c).style("fill","transparent").call(LI,L),B.maybeAppend("handle-sw",D(R)).style("x",-f).style("y",a-f).style("width",c).style("height",c).style("fill","transparent").call(LI,I)}));function RI(t,e){var{brushed:n=()=>{},brushended:r=()=>{},brushcreated:i=()=>{},brushstarted:a=()=>{},brushupdated:o=()=>{},extent:s=NI(t),brushRegion:c=(t,e,n,r,i)=>[t,e,n,r],reverse:l=!1,fill:u="#777",fillOpacity:f="0.3",stroke:h="#fff",selectedHandles:d=["handle-n","handle-e","handle-s","handle-w","handle-nw","handle-ne","handle-se","handle-sw"]}=e,p=Le(e,["brushed","brushended","brushcreated","brushstarted","brushupdated","extent","brushRegion","reverse","fill","fillOpacity","stroke","selectedHandles"]);let g=null,v=null,m=null,y=null,b=null,x=!1;const[w,k,E,M]=s;jR(t,"crosshair"),t.style.draggable=!0;const O=(t,e,n)=>{if(a(n),y&&y.remove(),b&&b.remove(),g=[t,e],l)return S();A()},S=()=>{b=new Bg({style:Object.assign(Object.assign({},p),{fill:u,fillOpacity:f,stroke:h,pointerEvents:"none"})}),y=new jI({style:{x:0,y:0,width:0,height:0,draggable:!0,document:t.ownerDocument},className:"mask"}),t.appendChild(b),t.appendChild(y)},A=()=>{y=new jI({style:Object.assign(Object.assign({document:t.ownerDocument,x:0,y:0},p),{fill:u,fillOpacity:f,stroke:h,draggable:!0}),className:"mask"}),t.appendChild(y)},_=(t=!0)=>{y&&y.remove(),b&&b.remove(),g=null,v=null,m=null,x=!1,y=null,b=null,r(t)},T=(t,e,r=!0)=>{const[i,a,o,u]=function(t,e,n,r,i){const[a,o,s,c]=i;return[Math.max(a,Math.min(t,n)),Math.max(o,Math.min(e,r)),Math.min(s,Math.max(t,n)),Math.min(c,Math.max(e,r))]}(t[0],t[1],e[0],e[1],s),[f,h,d,p]=c(i,a,o,u,s);return l?C(f,h,d,p):P(f,h,d,p),n(f,h,d,p,r),[f,h,d,p]},P=(t,e,n,r)=>{y.style.x=t,y.style.y=e,y.style.width=n-t,y.style.height=r-e},C=(t,e,n,r)=>{b.style.d=`\n M${w},${k}L${E},${k}L${E},${M}L${w},${M}Z\n M${t},${e}L${t},${r}L${n},${r}L${n},${e}Z\n `,y.style.x=t,y.style.y=e,y.style.width=n-t,y.style.height=r-e},N={"handle-n":{vector:[0,1,0,0],cursor:"ns-resize"},"handle-e":{vector:[0,0,1,0],cursor:"ew-resize"},"handle-s":{vector:[0,0,0,1],cursor:"ns-resize"},"handle-w":{vector:[1,0,0,0],cursor:"ew-resize"},"handle-nw":{vector:[1,1,0,0],cursor:"nwse-resize"},"handle-ne":{vector:[0,1,1,0],cursor:"nesw-resize"},"handle-se":{vector:[0,0,1,1],cursor:"nwse-resize"},"handle-sw":{vector:[1,0,0,1],cursor:"nesw-resize"}},L=t=>R(t)||j(t),j=t=>{const{id:e}=t;return-1!==d.indexOf(e)&&new Set(Object.keys(N)).has(e)},R=t=>t===y.getElementById("selection"),I=e=>{const{target:n}=e,[r,i]=bR(t,e);if(!y||!L(n))return O(r,i,e),void(x=!0);L(n)&&(m=[r,i])},D=e=>{const{target:n}=e,r=bR(t,e);if(!g)return;if(!m)return T(g,r);if(R(n))return(t=>{const e=(t,e,n,r,i)=>t+e<r?r-e:t+n>i?i-n:t,n=t[0]-m[0],r=t[1]-m[1],i=e(n,g[0],v[0],w,E),a=e(r,g[1],v[1],k,M),o=[g[0]+i,g[1]+a],s=[v[0]+i,v[1]+a];T(o,s)})(r);const[i,a]=[r[0]-m[0],r[1]-m[1]],{id:o}=n;if(N[o]){const[t,e,n,r]=N[o].vector;return T([g[0]+i*t,g[1]+a*e],[v[0]+i*n,v[1]+a*r])}},B=e=>{if(m){m=null;const{x:t,y:n,width:r,height:i}=y.style;return g=[t,n],v=[t+r,n+i],void o(t,n,t+r,n+i,e)}v=bR(t,e);const[n,r,a,s]=T(g,v);x=!1,i(n,r,a,s,e)},F=t=>{const{target:e}=t;y&&!L(e)&&_()},z=e=>{const{target:n}=e;y&&L(n)&&!x?R(n)?jR(t,"move"):j(n)&&jR(t,N[n.id].cursor):jR(t,"crosshair")},G=()=>{jR(t,"default")};return t.addEventListener("dragstart",I),t.addEventListener("drag",D),t.addEventListener("dragend",B),t.addEventListener("click",F),t.addEventListener("pointermove",z),t.addEventListener("pointerleave",G),{mask:y,move(t,e,n,r,i=!0){y||O(t,e,{}),g=[t,e],v=[n,r],T([t,e],[n,r],i)},remove(t=!0){y&&_(t)},destroy(){y&&_(!1),jR(t,"default"),t.removeEventListener("dragstart",I),t.removeEventListener("drag",D),t.removeEventListener("dragend",B),t.removeEventListener("click",F),t.removeEventListener("pointermove",z),t.removeEventListener("pointerleave",G)}}}function II(t,e,n){return e.filter((e=>{if(e===t)return!1;const{interaction:r={}}=e.options;return Object.values(r).find((t=>t.brushKey===n))}))}function DI(t,e,n){return II(t,e,n).map((t=>t.options))}function BI(t,e){var{elements:n,selectedHandles:r,siblings:i=t=>[],datum:a,brushRegion:o,extent:s,reverse:c,scale:l,coordinate:u,series:f=!1,key:h=t=>t,bboxOf:d=t=>{const{x:e,y:n,width:r,height:i}=t.style;return{x:e,y:n,width:r,height:i}},state:p={},emitter:g}=e,v=Le(e,["elements","selectedHandles","siblings","datum","brushRegion","extent","reverse","scale","coordinate","series","key","bboxOf","state","emitter"]);const m=n(t),y=i(t),b=y.flatMap(n),x=PR(m,a),w=Va(v,"mask"),{setState:k,removeState:E}=AR(p,x),M=new Map,{width:O,height:S,x:A=0,y:_=0}=d(t),T=s||[0,0,O,S],P=()=>{for(const t of[...m,...b])E(t,"active","inactive")},C=(t,e,n,r)=>{var i;for(const t of y)null===(i=t.brush)||void 0===i||i.remove();const a=new Set;for(const i of m){const{min:o,max:s}=i.getLocalBounds(),[c,l]=o,[u,f]=s;CI([c,l,u,f],[t,e,n,r])?(k(i,"active"),a.add(h(i))):k(i,"inactive")}for(const t of b)a.has(h(t))?k(t,"active"):k(t,"inactive")},N=()=>{for(const t of m)E(t,"inactive");for(const t of M.values())t.remove();M.clear()},L=(e,n,r,i)=>{const a=t=>{const e=t.cloneNode();return e.__data__=t.__data__,t.parentNode.appendChild(e),M.set(t,e),e},o=new $g({style:{x:e+A,y:n+_,width:r-e,height:i-n}});t.appendChild(o);for(const t of m){const e=M.get(t)||a(t);e.style.clipPath=o,k(t,"inactive"),k(e,"active")}},j=RI(t,Object.assign(Object.assign({},w),{extent:T,brushRegion:o,reverse:c,selectedHandles:r,brushended:t=>{const e=f?N:P;t&&g.emit("brush:remove",{nativeEvent:!0}),e()},brushed:(t,e,n,r,i)=>{const a=uS(t,e,n,r,l,u);i&&g.emit("brush:highlight",{nativeEvent:!0,data:{selection:a}});(f?L:C)(t,e,n,r)},brushcreated:(t,e,n,r,i)=>{const a=uS(t,e,n,r,l,u);g.emit("brush:end",Object.assign(Object.assign({},i),{nativeEvent:!0,data:{selection:a}}))},brushupdated:(t,e,n,r,i)=>{const a=uS(t,e,n,r,l,u);g.emit("brush:end",Object.assign(Object.assign({},i),{nativeEvent:!0,data:{selection:a}}))},brushstarted:t=>{g.emit("brush:start",t)}})),R=({nativeEvent:t,data:e})=>{if(t)return;const{selection:n}=e,[r,i,a,o]=function(t,e,n){const{x:r,y:i}=e,[a,o]=t,s=fS(a,r),c=fS(o,i),l=[s[0],c[0]],u=[s[1],c[1]],[f,h]=n.map(l),[d,p]=n.map(u);return[f,h,d,p]}(n,l,u);j.move(r,i,a,o,!1)};g.on("brush:highlight",R);const I=({nativeEvent:t}={})=>{t||j.remove(!1)};g.on("brush:remove",I);const D=j.destroy.bind(j);return j.destroy=()=>{g.off("brush:highlight",R),g.off("brush:remove",I),D()},j}function FI(t){var{facet:e,brushKey:n}=t,r=Le(t,["facet","brushKey"]);return(t,i,a)=>{const{container:o,view:s,options:c}=t,l=vR(o),u={maskFill:"#777",maskFillOpacity:"0.3",maskStroke:"#fff",reverse:!1},f=["active",["inactive",{opacity:.5}]],{scale:h,coordinate:d}=s;if(e){const e=l.getBounds(),n=e.min[0],o=e.min[1],s=e.max[0],c=e.max[1];return BI(l.parentNode.parentNode,Object.assign(Object.assign({elements:()=>pR(t,i),datum:kR(gR(t,i).map((t=>t.view))),brushRegion:(t,e,n,r)=>[t,e,n,r],extent:[n,o,s,c],state:TR(gR(t,i).map((t=>t.options)),f),emitter:a,scale:h,coordinate:d,selectedHandles:void 0},u),r))}const p=BI(l,Object.assign(Object.assign({elements:dR,key:t=>t.__data__.key,siblings:()=>function(t,e,n){return II(t,e,n).map((t=>vR(t.container)))}(t,i,n),datum:kR([s,...II(t,i,n).map((t=>t.view))]),brushRegion:(t,e,n,r)=>[t,e,n,r],extent:void 0,state:TR([c,...DI(t,i,n)],f),emitter:a,scale:h,coordinate:d,selectedHandles:void 0},u),r));return l.brush=p,()=>p.destroy()}}function zI(t,e,n,r,i){const[,a,,o]=i;return[t,a,n,o]}function GI(t){return FI(Object.assign(Object.assign({},t),{brushRegion:zI,selectedHandles:["handle-e","handle-w"]}))}function WI(t,e,n,r,i){const[a,,o]=i;return[a,e,o,r]}function $I(t){return FI(Object.assign(Object.assign({},t),{brushRegion:WI,selectedHandles:["handle-n","handle-s"]}))}const HI="axis-hot-area";function YI(t){return t.getElementsByClassName("axis")}function VI(t){return t.getElementsByClassName("axis-line")[0]}function UI(t){return function(t){return t.getElementsByClassName("axis-main-group")[0]}(t).getLocalBounds()}function qI(t,e){var{cross:n,offsetX:r,offsetY:i}=e,a=Le(e,["cross","offsetX","offsetY"]);const o=UI(t),s=VI(t),[c]=s.getLocalBounds().min,[l,u]=o.min,[f,h]=o.max,d=2*(f-l);return{brushRegion:WI,hotZone:new $g({className:HI,style:Object.assign({width:n?d/2:d,transform:`translate(${(n?l:c-d/2).toFixed(2)}, ${u})`,height:h-u},a)}),extent:n?(t,e,n,r)=>[-1/0,e,1/0,r]:(t,e,n,i)=>[Math.floor(l-r),e,Math.ceil(f-r),i]}}function XI(t,e){var{offsetY:n,offsetX:r,cross:i=!1}=e,a=Le(e,["offsetY","offsetX","cross"]);const o=UI(t),s=VI(t),[,c]=s.getLocalBounds().min,[l,u]=o.min,[f,h]=o.max,d=h-u;return{brushRegion:zI,hotZone:new $g({className:HI,style:Object.assign({width:f-l,height:i?d:2*d,transform:`translate(${l}, ${i?u:c-d})`},a)}),extent:i?(t,e,n,r)=>[t,-1/0,n,1/0]:(t,e,r,i)=>[t,Math.floor(u-n),r,Math.ceil(h-n)]}}function KI(t){return(e,n,r)=>{const{container:i,view:a,options:o}=e,s=vR(i),{x:c,y:l}=s.getBBox(),{coordinate:u}=a;return function(t,e){var{axes:n,elements:r,points:i,horizontal:a,datum:o,offsetY:s,offsetX:c,reverse:l=!1,state:u={},emitter:f,coordinate:h}=e,d=Le(e,["axes","elements","points","horizontal","datum","offsetY","offsetX","reverse","state","emitter","coordinate"]);const p=r(t),g=n(t),v=PR(p,o),{setState:m,removeState:y}=AR(u,v),b=new Map,x=Va(d,"mask"),w=t=>Array.from(b.values()).every((([e,n,r,i])=>t.some((([t,a])=>t>=e&&t<=r&&a>=n&&a<=i)))),k=g.map((t=>t.attributes.scale)),E=t=>t.length>2?[t[0],t[t.length-1]]:t,M=new Map,O=()=>{M.clear();for(let t=0;t<g.length;t++){const e=k[t],{domain:n}=e.getOptions();M.set(t,E(n))}};O();const S=(t,e)=>{const n=[];for(const t of p){const e=i(t);w(e)?(m(t,"active"),n.push(t)):m(t,"inactive")}M.set(t,_(n,t)),e&&f.emit("brushAxis:highlight",{nativeEvent:!0,data:{selection:(()=>{if(!T)return Array.from(M.values());const t=[];for(const[e,n]of M){const r=k[e],{name:i}=r.getOptions();"x"===i?t[0]=n:t[1]=n}return t})()}})},A=t=>{for(const t of p)y(t,"active","inactive");O(),t&&f.emit("brushAxis:remove",{nativeEvent:!0})},_=(t,e)=>{const n=k[e],{name:r}=n.getOptions(),i=t.map((t=>{const e=t.__data__;return n.invert(e[r])}));return E(lS(n,i))},T=g.some(a)&&g.some((t=>!a(t))),P=[];for(let t=0;t<g.length;t++){const e=g[t],n=a(e)?XI:qI,{hotZone:r,brushRegion:i,extent:o}=n(e,{offsetY:s,offsetX:c,cross:T,zIndex:999,fill:"transparent"});e.parentNode.appendChild(r);const u=RI(r,Object.assign(Object.assign({},x),{reverse:l,brushRegion:i,brushended(n){b.delete(e),0===Array.from(b.entries()).length?A(n):S(t,n)},brushed(n,r,i,a,s){b.set(e,o(n,r,i,a)),S(t,s)}}));P.push(u)}const C=(t={})=>{const{nativeEvent:e}=t;e||P.forEach((t=>t.remove(!1)))},N=(t,e,n)=>{const[r,i]=t,o=L(r,e,n),s=L(i,e,n)+(t=>t.getStep?t.getStep():0)(e);return a(n)?[o,-1/0,s,1/0]:[-1/0,o,1/0,s]},L=(t,e,n)=>{const{height:r,width:i}=h.getOptions(),o=e.clone();return a(n)?o.update({range:[0,i]}):o.update({range:[r,0]}),o.map(t)},j=t=>{const{nativeEvent:e}=t;if(e)return;const{selection:n}=t.data;for(let t=0;t<P.length;t++){const e=n[t],r=P[t],i=g[t];if(e){const n=k[t];r.move(...N(e,n,i),!1)}else r.remove(!1)}};return f.on("brushAxis:remove",C),f.on("brushAxis:highlight",j),()=>{P.forEach((t=>t.destroy())),f.off("brushAxis:remove",C),f.off("brushAxis:highlight",j)}}(i,Object.assign({elements:dR,axes:YI,offsetY:l,offsetX:c,points:t=>t.__data__.points,horizontal:t=>{const{startPos:[e,n],endPos:[r,i]}=t.attributes;return e!==r&&n===i},datum:kR(a),state:TR(o,["active",["inactive",{opacity:.5}]]),coordinate:u,emitter:r},t))}}function ZI(t){var{hideX:e=!0,hideY:n=!0}=t,r=Le(t,["hideX","hideY"]);return(t,i,a)=>{const{container:o,view:s,options:c,update:l,setState:u}=t,f=vR(o);let h=!1,d=!1,p=s;const{scale:g,coordinate:v}=s;return function(t,e){var{filter:n,reset:r,brushRegion:i,extent:a,reverse:o,emitter:s,scale:c,coordinate:l,selection:u,series:f=!1}=e;const h=Va(Le(e,["filter","reset","brushRegion","extent","reverse","emitter","scale","coordinate","selection","series"]),"mask"),{width:d,height:p}=t.getBBox(),g=a||[0,0,d,p],v=function(t=300){let e=null;return n=>{const{timeStamp:r}=n;return null!==e&&r-e<t?(e=r,!0):(e=r,!1)}}(),m=RI(t,Object.assign(Object.assign({},h),{extent:g,brushRegion:i,reverse:o,brushcreated:function(t,e,r,i,a){t===r&&e===i||(a.nativeEvent=!0,n(u(t,e,r,i),a),m.remove())}}));function y(t){v(t)&&(t.nativeEvent=!0,r(t))}t.addEventListener("click",y);const b=({nativeEvent:t,data:e})=>{if(t)return;const{selection:r}=e;n(r,{nativeEvent:!1})};return s.on("brush:filter",b),()=>{m.destroy(),s.off("brush:filter",b),t.removeEventListener("click",y)}}(f,Object.assign(Object.assign({brushRegion:(t,e,n,r)=>[t,e,n,r],selection:(t,e,n,r)=>{const{scale:i,coordinate:a}=p;return uS(t,e,n,r,i,a)},filter:(t,r)=>Re(this,void 0,void 0,(function*(){if(d)return;d=!0;const[i,o]=t;u("brushFilter",(t=>{const{marks:r}=t,a=r.map((t=>Q({axis:Object.assign(Object.assign({},e&&{x:{transform:[{type:"hide"}]}}),n&&{y:{transform:[{type:"hide"}]}})},t,{scale:{x:{domain:i,nice:!1},y:{domain:o,nice:!1}}})));return Object.assign(Object.assign({},c),{marks:a,clip:!0})})),a.emit("brush:filter",Object.assign(Object.assign({},r),{data:{selection:[i,o]}}));const s=yield l();p=s.view,d=!1,h=!0})),reset:t=>{if(d||!h)return;const{scale:e}=s,{x:n,y:r}=e,i=n.getOptions().domain,o=r.getOptions().domain;a.emit("brush:filter",Object.assign(Object.assign({},t),{data:{selection:[i,o]}})),h=!1,p=s,u("brushFilter"),l()},extent:void 0,emitter:a,scale:g,coordinate:v},{maskFill:"#777",maskFillOpacity:"0.3",maskStroke:"#fff",unhighlightedOpacity:.5,reverse:!1}),r))}}function QI(t){return ZI(Object.assign(Object.assign({hideX:!0},t),{brushRegion:zI}))}function JI(t){return ZI(Object.assign(Object.assign({hideY:!0},t),{brushRegion:WI}))}function tD(t,e,n,r=!1,i="x",a="y"){const{marks:o}=t,s=o.map((t=>{var o,s;return Q({axis:{x:{transform:[{type:"hide"}]},y:{transform:[{type:"hide"}]}}},t,{scale:e,[n]:Object.assign(Object.assign({},(null===(o=t[n])||void 0===o?void 0:o[i])&&{[i]:Object.assign({preserve:!0},r&&{ratio:null})}),(null===(s=t[n])||void 0===s?void 0:s[a])&&{[a]:{preserve:!0}}),animate:!1})}));return Object.assign(Object.assign({},t),{marks:s,clip:!0,animate:!1})}function eD(t,e,n){const[r,i]=t,a=n?t=>1-t:t=>t;return lS(e,[cS(e,a(r),!0),cS(e,a(i),!1)])}function nD(t){return[t[0],t[t.length-1]]}function rD({initDomain:t={},className:e="slider",prefix:n="slider",setValue:r=(t,e)=>t.setValues(e),hasState:i=!1,wait:a=50,leading:o=!0,trailing:s=!1,getInitValues:c=t=>{var e;const n=null===(e=null==t?void 0:t.attributes)||void 0===e?void 0:e.values;if(0!==n[0]||1!==n[1])return n}}){return(l,u,f)=>{const{container:h,view:d,update:p,setState:g}=l,v=h.getElementsByClassName(e);if(!v.length)return()=>{};let m=!1;const{scale:y,coordinate:b,layout:x}=d,{paddingLeft:w,paddingTop:k,paddingBottom:E,paddingRight:M}=x,{x:O,y:S}=y,A=Vc(b),_=t=>{const e="vertical"===t?"y":"x",n="vertical"===t?"x":"y";return A?[n,e]:[e,n]},T=new Map,P=new Set,C={x:t.x||O.getOptions().domain,y:t.y||S.getOptions().domain};for(const t of v){const{orientation:e}=t.attributes,[l,u]=_(e),h=`${n}${$(l)}:filter`,d="x"===l,{ratio:v}=O.getOptions(),{ratio:b}=S.getOptions(),x=t=>{if(t.data){const{selection:e}=t.data,[n=nD(C.x),r=nD(C.y)]=e;return d?[lS(O,n,v),lS(S,r,b)]:[lS(S,r,b),lS(O,n,v)]}const{value:n}=t.detail;return[eD(n,y[l],A&&"horizontal"===e),C[u]]},N=ot((e=>Re(this,void 0,void 0,(function*(){const{initValue:r=!1}=e;if(m&&!r)return;m=!0;const{nativeEvent:a=!0}=e,[o,s]=x(e);if(C[l]=o,C[u]=s,a){const t=d?o:s,n=d?s:o;f.emit(h,Object.assign(Object.assign({},e),{nativeEvent:a,data:{selection:[nD(t),nD(n)]}}))}g(t,(t=>Object.assign(Object.assign({},tD(t,{[l]:{domain:o,nice:!1}},n,i,l,u)),{paddingLeft:w,paddingTop:k,paddingBottom:E,paddingRight:M}))),yield p(),m=!1}))),a,{leading:o,trailing:s}),L=e=>{const{nativeEvent:n}=e;if(n)return;const{data:i}=e,{selection:a}=i,[o,s]=a;t.dispatchEvent(new Sp("valuechange",{data:i,nativeEvent:!1}));const c=d?fS(o,O):fS(s,S);r(t,c)};f.on(h,L),t.addEventListener("valuechange",N),T.set(t,N),P.add([h,L]);const j=c(t);j&&t.dispatchEvent(new Sp("valuechange",{detail:{value:j},nativeEvent:!1,initValue:!0}))}return()=>{for(const[t,e]of T)t.removeEventListener("valuechange",e);for(const[t,e]of P)f.off(t,e)}}}const iD="g2-scrollbar";function aD(t={}){return(e,n,r)=>{const{view:i,container:a}=e;if(!a.getElementsByClassName(iD).length)return()=>{};const{scale:o}=i,{x:s,y:c}=o,l={x:[...s.getOptions().domain],y:[...c.getOptions().domain]};s.update({domain:s.getOptions().expectedDomain}),c.update({domain:c.getOptions().expectedDomain});return rD(Object.assign(Object.assign({},t),{initDomain:l,className:iD,prefix:"scrollbar",hasState:!0,setValue:(t,e)=>t.setValue(e[0]),getInitValues:t=>{const e=t.slider.attributes.values;if(0!==e[0])return e}}))(e,n,r)}}function oD(t,e,n){return`<${t} style="${Object.entries(n).map((([t,e])=>`${function(t){return t.replace(/([A-Z])/g,"-$1").toLowerCase()}(t)}:${e}`)).join(";")}">${e}</${t}>`}const sD={backgroundColor:"rgba(0,0,0,0.75)",color:"#fff",width:"max-content",padding:"1px 4px",fontSize:"12px",borderRadius:"2.5px",boxShadow:"0 3px 6px -4px rgba(0,0,0,0.12), 0 6px 16px 0 rgba(0,0,0,0.08), 0 9px 28px 8px rgba(0,0,0,0.05)"};function cD(t){return"text"===t.nodeName&&!!t.isOverflowing()}function lD(t){var{offsetX:e=8,offsetY:n=8}=t,r=Le(t,["offsetX","offsetY"]);return t=>{const{container:i}=t,[a,o]=i.getBounds().min,s=Va(r,"tip"),c=new Set,l=t=>{const{target:r}=t;if(!cD(r))return void t.stopPropagation();const{offsetX:l,offsetY:u}=t,f=l+e-a,h=u+n-o;if(r.tip)return r.tip.style.x=f,void(r.tip.style.y=h);const{text:d}=r.style,p=new Lg({className:"poptip",style:{innerHTML:oD("div",d,Object.assign(Object.assign({},sD),s)),x:f,y:h}});i.appendChild(p),r.tip=p,c.add(p)},u=t=>{const{target:e}=t;cD(e)?e.tip&&(e.tip.remove(),e.tip=null,c.delete(e.tip)):t.stopPropagation()};return i.addEventListener("pointerover",l),i.addEventListener("pointerout",u),()=>{i.removeEventListener("pointerover",l),i.removeEventListener("pointerout",u),c.forEach((t=>t.remove()))}}}lD.props={reapplyWhenUpdate:!0};const uD={breadCrumbFill:"rgba(0, 0, 0, 0.85)",breadCrumbFontSize:12,breadCrumbY:12,activeFill:"rgba(0, 0, 0, 0.5)"};function fD(t={}){const{originData:e=[],layout:n}=t,r=Le(t,["originData","layout"]),i=Q({},uD,r),a=Va(i,"breadCrumb"),o=Va(i,"active");return t=>{const{update:r,setState:i,container:s,options:c}=t,l=function(t){return am(t).select(`.${XS}`).node()}(s),u=c.marks[0],{state:f}=u,h=new Cg;l.appendChild(h);const d=(t,c)=>Re(this,void 0,void 0,(function*(){if(h.removeChildren(),c){let e="",n=a.y,r=0;const i=[],s=l.getBBox().width,c=t.map(((o,c)=>{e=`${e}${o}/`,i.push(o);const l=new Yg({name:e.replace(/\/$/,""),style:Object.assign(Object.assign({text:o,x:r,path:[...i],depth:c},a),{y:n})});h.appendChild(l),r+=l.getBBox().width;const u=new Yg({style:Object.assign(Object.assign({x:r,text:" / "},a),{y:n})});return h.appendChild(u),r+=u.getBBox().width,r>s&&(n=h.getBBox().height+a.y,r=0,l.attr({x:r,y:n}),r+=l.getBBox().width,u.attr({x:r,y:n}),r+=u.getBBox().width),c===lt(t)-1&&u.remove(),l}));c.forEach(((t,e)=>{if(e===lt(c)-1)return;const n=Object.assign({},t.attributes);t.attr("cursor","pointer"),t.addEventListener("mouseenter",(()=>{t.attr(o)})),t.addEventListener("mouseleave",(()=>{t.attr(n)})),t.addEventListener("click",(()=>{d(rt(t,["style","path"]),rt(t,["style","depth"]))}))}))}!function(t,e){[...MI(t),...OI(t)].forEach((t=>{e(t,(t=>t))}))}(s,i),i("treemapDrillDown",(r=>{const{marks:i}=r,a=t.join("/"),o=i.map((t=>{if("rect"!==t.type)return t;let r=e;if(c){const t=e.filter((t=>{const e=rt(t,["id"]);return e&&(e.match(`${a}/`)||a.match(e))})).map((t=>({value:0===t.height?rt(t,["value"]):void 0,name:rt(t,["id"])}))),{paddingLeft:i,paddingBottom:o,paddingRight:s}=n,l=Object.assign(Object.assign({},n),{paddingTop:(n.paddingTop||h.getBBox().height+10)/(c+1),paddingLeft:i/(c+1),paddingBottom:o/(c+1),paddingRight:s/(c+1),path:t=>t.name,layer:t=>t.depth===c+1});r=NM(t,l,{value:"value"})[0]}else r=e.filter((t=>1===t.depth));const i=[];return r.forEach((({path:t})=>{i.push(j(t))})),Q({},t,{data:r,scale:{color:{domain:i}}})}));return Object.assign(Object.assign({},r),{marks:o})})),yield r(void 0,["legendFilter"])})),p=t=>{const n=t.target,{markType:r,nodeName:i,attributes:a}=n||{};if("rect"!==r&&i!==Xl.TEXT)return;const o=i===Xl.TEXT&&!0===rt(a,"isTreemapLabel")?(t=>t.attributes.key.split("-")[0])(n):(t=>rt(t,["__data__","key"]))(n),s=_(e,(t=>t.id===o));rt(s,"height")&&d(rt(s,"path"),rt(s,"depth"))};l.addEventListener("click",p);const g=E(Object.assign(Object.assign({},f.active),f.inactive)),v=()=>{FR(l).forEach((t=>{const n=rt(t,["style","cursor"]),r=_(e,(e=>e.id===rt(t,["__data__","key"])));if("pointer"!==n&&(null==r?void 0:r.height)){t.style.cursor="pointer";const e=function(t,e){if(null===t||!A(t))return{};var n={};return k(e,(function(e){it.call(t,e)&&(n[e]=t[e])})),n}(t.attributes,g);t.addEventListener("mouseenter",(()=>{t.attr(f.active)})),t.addEventListener("mouseleave",(()=>{t.attr(Q(e,f.inactive))}))}}))};return v(),l.addEventListener("mousemove",v),()=>{h.remove(),l.removeEventListener("click",p),l.removeEventListener("mousemove",v)}}}const hD={pointR:6,pointStrokeWidth:1,pointStroke:"#888",pointActiveStroke:"#f5f5f5",pathStroke:"#888",pathLineDash:[3,4],labelFontSize:12,labelFill:"#888",labelStroke:"#fff",labelLineWidth:1,labelY:-6,labelX:2},dD="movePoint",pD=t=>{const e=t.target,{markType:n}=e;"line"===n&&(e.attr("_lineWidth",e.attr("lineWidth")||1),e.attr("lineWidth",e.attr("_lineWidth")+3)),"interval"===n&&(e.attr("_opacity",e.attr("opacity")||1),e.attr("opacity",.7*e.attr("_opacity")))},gD=t=>{const e=t.target,{markType:n}=e;"line"===n&&e.attr("lineWidth",e.attr("_lineWidth")),"interval"===n&&e.attr("opacity",e.attr("_opacity"))},vD=(t,e,n)=>{t.forEach(((t,r)=>{t.attr("stroke",e[1]===r?n.activeStroke:n.stroke)}))},mD=(t,e,n,r)=>{const i=new Bg({style:n}),a=new Yg({style:r});return e.appendChild(a),t.appendChild(i),[i,a]},yD=(t,e)=>{if(!rt(t,["options","range","indexOf"]))return;const n=t.options.range.indexOf(e);return t.sortedDomain[n]},bD=(t,e,n)=>{const r=DR(t,e),i=DR(t,n)/r;return[t[0]+(e[0]-t[0])*i,t[1]+(e[1]-t[1])*i]};function xD(t={}){const{selection:e=[],precision:n=2}=t,r=Le(t,["selection","precision"]),i=Object.assign(Object.assign({},hD),r||{}),a=Va(i,"path"),o=Va(i,"label"),s=Va(i,"point");return(t,r,i)=>{const{update:c,setState:l,container:u,view:f,options:{marks:h,coordinate:d}}=t,p=vR(u);let g,v=FR(p),m=e;const{transform:y=[],type:b}=d,x=!!_(y,(({type:t})=>"transpose"===t)),w="polar"===b,k="theta"===b,E=!!_(v,(({markType:t})=>"area"===t));E&&(v=v.filter((({markType:t})=>"area"===t)));const M=new Cg({style:{zIndex:2}});p.appendChild(M);const O=()=>{i.emit("element-point:select",{nativeEvent:!0,data:{selection:m}})},S=t=>{const e=t.target;m=[e.parentNode.childNodes.indexOf(e)],O(),T(e)},A=t=>{const{data:{selection:e},nativeEvent:n}=t;if(n)return;m=e;const r=rt(v,[null==m?void 0:m[0]]);r&&T(r)},T=t=>{const{attributes:e,markType:r,__data__:d}=t,{stroke:p}=e,{points:v,seriesTitle:y,color:b,title:S,seriesX:A,y1:P}=d;if(x&&"interval"!==r)return;const{scale:C,coordinate:N}=(null==g?void 0:g.view)||f,{color:L,y:j,x:R}=C,I=N.getCenter();let D;M.removeChildren();const B=(t,e,n,r)=>Re(this,void 0,void 0,(function*(){return l("elementPointMove",(a=>{var o;const s=((null===(o=null==g?void 0:g.options)||void 0===o?void 0:o.marks)||h).map((a=>{if(!r.includes(a.type))return a;const{data:o,encode:s}=a,c=Object.keys(s).reduce(((r,i)=>{const a=s[i];return"x"===i&&(r[a]=t),"y"===i&&(r[a]=e),"color"===i&&(r[a]=n),r}),{}),l=((t,e,n)=>e.map((e=>{const r=["x","color"].reduce(((r,i)=>{const a=n[i];return a?e[a]===t[a]&&r:r}),!0);return r?Object.assign(Object.assign({},e),t):e})))(c,o,s);return((t,e)=>{i.emit("element-point:moved",{nativeEvent:!0,data:{changeData:t,data:e}})})(c,l),Q({},a,{data:l,animate:!1})}));return Object.assign(Object.assign({},a),{marks:s})})),yield c("elementPointMove")}));if(["line","area"].includes(r))v.forEach(((e,r)=>{const i=R.invert(A[r]);if(!i)return;const c=new Ag({name:dD,style:Object.assign({cx:e[0],cy:e[1],fill:p},s)}),l=((t,e)=>{const n=rt(t,["__data__","seriesItems",e,"0","value"]),r=rt(t,["__data__","seriesIndex",e]),{__data__:{data:i,encode:a,transform:o}}=t.parentNode,s=_(o,(({type:t})=>"normalizeY"===t)),c=rt(a,["y","field"]),l=i[r][c];return t=>s?1===n?t:t/(1-t)/(n/(1-n))*l:t})(t,r);c.addEventListener("mousedown",(f=>{const h=N.output([A[r],0]),d=null==y?void 0:y.length;u.attr("cursor","move"),m[1]!==r&&(m[1]=r,O()),vD(M.childNodes,m,s);const[p,x]=mD(M,c,a,o),k=t=>{const i=e[1]+t.clientY-D[1];if(E)if(w){const a=e[0]+t.clientX-D[0],[o,s]=bD(I,h,[a,i]),[,u]=N.output([1,j.output(0)]),[,f]=N.invert([o,u-(v[r+d][1]-s)]),g=(r+1)%d,m=BR([v[(r-1+d)%d],[o,s],y[g]&&v[g]]);x.attr("text",l(j.invert(f)).toFixed(n)),p.attr("d",m),c.attr("cx",o),c.attr("cy",s)}else{const[,t]=N.output([1,j.output(0)]),[,a]=N.invert([e[0],t-(v[r+d][1]-i)]),o=BR([v[r-1],[e[0],i],y[r+1]&&v[r+1]]);x.attr("text",l(j.invert(a)).toFixed(n)),p.attr("d",o),c.attr("cy",i)}else{const[,t]=N.invert([e[0],i]),a=BR([v[r-1],[e[0],i],v[r+1]]);x.attr("text",j.invert(t).toFixed(n)),p.attr("d",a),c.attr("cy",i)}};D=[f.clientX,f.clientY],window.addEventListener("mousemove",k);const S=()=>Re(this,void 0,void 0,(function*(){if(u.attr("cursor","default"),window.removeEventListener("mousemove",k),u.removeEventListener("mouseup",S),Y(x.attr("text")))return;const e=Number(x.attr("text")),n=yD(L,b);g=yield B(i,e,n,["line","area"]),x.remove(),p.remove(),T(t)}));u.addEventListener("mouseup",S)})),M.appendChild(c)})),vD(M.childNodes,m,s);else if("interval"===r){let e=[(v[0][0]+v[1][0])/2,v[0][1]];x?e=[v[0][0],(v[0][1]+v[1][1])/2]:k&&(e=v[0]);const i=(t=>{const e=rt(t,["__data__","y"]),n=rt(t,["__data__","y1"])-e,{__data__:{data:r,encode:i,transform:a},childNodes:o}=t.parentNode,s=_(a,(({type:t})=>"normalizeY"===t)),c=rt(i,["y","field"]),l=r[o.indexOf(t)][c];return(t,e=!1)=>s||e?t/(1-t)/(n/(1-n))*l:t})(t),c=new Ag({name:dD,style:Object.assign(Object.assign({cx:e[0],cy:e[1],fill:p},s),{stroke:s.activeStroke})});c.addEventListener("mousedown",(s=>{u.attr("cursor","move");const l=yD(L,b),[f,h]=mD(M,c,a,o),d=t=>{if(x){const r=e[0]+t.clientX-D[0],[a]=N.output([j.output(0),j.output(0)]),[,o]=N.invert([a+(r-v[2][0]),e[1]]),s=BR([[r,v[0][1]],[r,v[1][1]],v[2],v[3]],!0);h.attr("text",i(j.invert(o)).toFixed(n)),f.attr("d",s),c.attr("cx",r)}else if(k){const r=e[1]+t.clientY-D[1],a=e[0]+t.clientX-D[0],[o,s]=bD(I,[a,r],e),[l,u]=bD(I,[a,r],v[1]),d=N.invert([o,s])[1],p=P-d;if(p<0)return;const g=function(t,e,n=0){const r=[["M",...e[1]]],i=DR(t,e[1]),a=DR(t,e[0]);return 0===i?r.push(["L",...e[3]],["A",a,a,0,n,1,...e[0]],["Z"]):r.push(["A",i,i,0,n,0,...e[2]],["L",...e[3]],["A",a,a,0,n,1,...e[0]],["Z"]),r}(I,[[o,s],[l,u],v[2],v[3]],p>.5?1:0);h.attr("text",i(p,!0).toFixed(n)),f.attr("d",g),c.attr("cx",o),c.attr("cy",s)}else{const r=e[1]+t.clientY-D[1],[,a]=N.output([1,j.output(0)]),[,o]=N.invert([e[0],a-(v[2][1]-r)]),s=BR([[v[0][0],r],[v[1][0],r],v[2],v[3]],!0);h.attr("text",i(j.invert(o)).toFixed(n)),f.attr("d",s),c.attr("cy",r)}};D=[s.clientX,s.clientY],window.addEventListener("mousemove",d);const p=()=>Re(this,void 0,void 0,(function*(){if(u.attr("cursor","default"),u.removeEventListener("mouseup",p),window.removeEventListener("mousemove",d),Y(h.attr("text")))return;const e=Number(h.attr("text"));g=yield B(S,e,l,[r]),h.remove(),f.remove(),T(t)}));u.addEventListener("mouseup",p)})),M.appendChild(c)}};v.forEach(((t,e)=>{m[0]===e&&T(t),t.addEventListener("click",S),t.addEventListener("mouseenter",pD),t.addEventListener("mouseleave",gD)}));const P=t=>{const e=null==t?void 0:t.target;e&&(e.name===dD||v.includes(e))||(m=[],O(),M.removeChildren())};return i.on("element-point:select",A),i.on("element-point:unselect",P),u.addEventListener("mousedown",P),()=>{M.remove(),i.off("element-point:select",A),i.off("element-point:unselect",P),u.removeEventListener("mousedown",P),v.forEach((t=>{t.removeEventListener("click",S),t.removeEventListener("mouseenter",pD),t.removeEventListener("mouseleave",gD)}))}}}var wD={},kD={};function ED(t){return new Function("d","return {"+t.map((function(t,e){return JSON.stringify(t)+": d["+e+'] || ""'})).join(",")+"}")}function MD(t){var e=Object.create(null),n=[];return t.forEach((function(t){for(var r in t)r in e||n.push(e[r]=r)})),n}function OD(t,e){var n=t+"",r=n.length;return r<e?new Array(e-r+1).join(0)+n:n}function SD(t){var e=t.getUTCHours(),n=t.getUTCMinutes(),r=t.getUTCSeconds(),i=t.getUTCMilliseconds();return isNaN(t)?"Invalid Date":function(t){return t<0?"-"+OD(-t,6):t>9999?"+"+OD(t,6):OD(t,4)}(t.getUTCFullYear())+"-"+OD(t.getUTCMonth()+1,2)+"-"+OD(t.getUTCDate(),2)+(i?"T"+OD(e,2)+":"+OD(n,2)+":"+OD(r,2)+"."+OD(i,3)+"Z":r?"T"+OD(e,2)+":"+OD(n,2)+":"+OD(r,2)+"Z":n||e?"T"+OD(e,2)+":"+OD(n,2)+"Z":"")}function AD(t){var e=new RegExp('["'+t+"\n\r]"),n=t.charCodeAt(0);function r(t,e){var r,i=[],a=t.length,o=0,s=0,c=a<=0,l=!1;function u(){if(c)return kD;if(l)return l=!1,wD;var e,r,i=o;if(34===t.charCodeAt(i)){for(;o++<a&&34!==t.charCodeAt(o)||34===t.charCodeAt(++o););return(e=o)>=a?c=!0:10===(r=t.charCodeAt(o++))?l=!0:13===r&&(l=!0,10===t.charCodeAt(o)&&++o),t.slice(i+1,e-1).replace(/""/g,'"')}for(;o<a;){if(10===(r=t.charCodeAt(e=o++)))l=!0;else if(13===r)l=!0,10===t.charCodeAt(o)&&++o;else if(r!==n)continue;return t.slice(i,e)}return c=!0,t.slice(i,a)}for(10===t.charCodeAt(a-1)&&--a,13===t.charCodeAt(a-1)&&--a;(r=u())!==kD;){for(var f=[];r!==wD&&r!==kD;)f.push(r),r=u();e&&null==(f=e(f,s++))||i.push(f)}return i}function i(e,n){return e.map((function(e){return n.map((function(t){return o(e[t])})).join(t)}))}function a(e){return e.map(o).join(t)}function o(t){return null==t?"":t instanceof Date?SD(t):e.test(t+="")?'"'+t.replace(/"/g,'""')+'"':t}return{parse:function(t,e){var n,i,a=r(t,(function(t,r){if(n)return n(t,r-1);i=t,n=e?function(t,e){var n=ED(t);return function(r,i){return e(n(r),i,t)}}(t,e):ED(t)}));return a.columns=i||[],a},parseRows:r,format:function(e,n){return null==n&&(n=MD(e)),[n.map(o).join(t)].concat(i(e,n)).join("\n")},formatBody:function(t,e){return null==e&&(e=MD(t)),i(t,e).join("\n")},formatRows:function(t){return t.map(a).join("\n")},formatRow:a,formatValue:o}}function _D(t){for(var e in t){var n,r,i=t[e].trim();if(i)if("true"===i)i=!0;else if("false"===i)i=!1;else if("NaN"===i)i=NaN;else if(isNaN(n=+i)){if(!(r=i.match(/^([-+]\d{2})?\d{4}(-\d{2}(-\d{2})?)?(T\d{2}:\d{2}(:\d{2}(\.\d{3})?)?(Z|[-+]\d{2}:\d{2})?)?$/)))continue;TD&&r[4]&&!r[7]&&(i=i.replace(/-/g,"/").replace(/T/," ")),i=new Date(i)}else i=n;else i=null;t[e]=i}return t}const TD=new Date("2019-01-01T00:00").getHours()||new Date("2019-07-01T00:00").getHours(),PD=t=>{const{value:e,format:n=e.split(".").pop(),delimiter:r=",",autoType:i=!0}=t;return()=>Re(void 0,void 0,void 0,(function*(){const t=yield fetch(e);if("csv"===n){const e=yield t.text();return AD(r).parse(e,i?_D:Fa)}if("json"===n)return yield t.json();throw new Error(`Unknown format: ${n}.`)}))};PD.props={};const CD=t=>{const{fields:e,key:n="key",value:r="value"}=t;return t=>{return(i=e)&&0!==Object.keys(i).length?t.flatMap((t=>e.map((e=>Object.assign(Object.assign({},t),{[n]:e,[r]:t[e]}))))):t;var i}};function ND(t){return null!=t&&!Number.isNaN(t)}CD.props={};const LD=t=>{const{callback:e=ND}=t;return t=>t.filter(e)};LD.props={};const jD=t=>{const{callback:e}=t;return t=>Array.isArray(t)?[...t].sort(e):t};jD.props={};const RD=t=>{const{fields:e}=t;return t=>t.map((t=>function(t,e=[]){return e.reduce(((e,n)=>(n in t&&(e[n]=t[n]),e)),{})}(t,e)))};RD.props={};const ID=t=>e=>{if(!t||(n=t,0===Object.keys(n).length))return e;var n;return e.map((e=>Object.entries(e).reduce(((e,[n,r])=>(e[t[n]||n]=r,e)),{})))};ID.props={};const DD=t=>{const{fields:e=[]}=t,n=(r=!0,e.map((t=>{if(Array.isArray(t)){const[e,n=r]=t;return[e,n]}return[t,r]})));var r;return t=>[...t].sort(((t,e)=>n.reduce(((n,[r,i=!0])=>0!==n?n:i?t[r]<e[r]?-1:+(t[r]!==e[r]):t[r]>e[r]?-1:+(t[r]!==e[r])),0)))};DD.props={};const BD=t=>{const{value:e}=t;return()=>e};BD.props={};const FD=t=>{const{callback:e=Fa}=t;return t=>e(t)};FD.props={};const zD=t=>{const{callback:e=Fa}=t;return t=>Array.isArray(t)?t.map(e):t};zD.props={};const GD=Math.PI/180,WD=2048;function $D(t){return t.text}function HD(){return"serif"}function YD(){return"normal"}function VD(t){return t.value}function UD(){return 90*~~(2*Math.random())}function qD(){return 1}function XD(){}function KD(t,e,n,r){if(e.sprite)return;const i=t.context,a=t.ratio;i.clearRect(0,0,2048/a,WD/a);let o=0,s=0,c=0;const l=n.length;for(--r;++r<l;){e=n[r],i.save(),i.font=e.style+" "+e.weight+" "+~~((e.size+1)/a)+"px "+e.font;let t=i.measureText(e.text+"m").width*a,l=e.size<<1;if(e.rotate){const n=Math.sin(e.rotate*GD),r=Math.cos(e.rotate*GD),i=t*r,a=t*n,o=l*r,s=l*n;t=Math.max(Math.abs(i+s),Math.abs(i-s))+31>>5<<5,l=~~Math.max(Math.abs(a+o),Math.abs(a-o))}else t=t+31>>5<<5;if(l>c&&(c=l),o+t>=2048&&(o=0,s+=c,c=0),s+l>=WD)break;i.translate((o+(t>>1))/a,(s+(l>>1))/a),e.rotate&&i.rotate(e.rotate*GD),i.fillText(e.text,0,0),e.padding&&(i.lineWidth=2*e.padding,i.strokeText(e.text,0,0)),i.restore(),e.width=t,e.height=l,e.xoff=o,e.yoff=s,e.x1=t>>1,e.y1=l>>1,e.x0=-e.x1,e.y0=-e.y1,e.hasText=!0,o+=t}const u=i.getImageData(0,0,2048/a,WD/a).data,f=[];for(;--r>=0;){if(!(e=n[r]).hasText)continue;const t=e.width,i=t>>5;let a=e.y1-e.y0;for(let t=0;t<a*i;t++)f[t]=0;if(o=e.xoff,null==o)return;s=e.yoff;let c=0,l=-1;for(let n=0;n<a;n++){for(let e=0;e<t;e++){const t=i*n+(e>>5),r=u[2048*(s+n)+(o+e)<<2]?1<<31-e%32:0;f[t]|=r,c|=r}c?l=n:(e.y0++,a--,n--,s++)}e.y1=e.y0+l,e.sprite=f.slice(0,(e.y1-e.y0)*i)}}function ZD(t,e,n){n>>=5;const r=t.sprite,i=t.width>>5,a=t.x-(i<<4),o=127&a,s=32-o,c=t.y1-t.y0;let l,u=(t.y+t.y0)*n+(a>>5);for(let t=0;t<c;t++){l=0;for(let n=0;n<=i;n++)if((l<<s|(n<i?(l=r[t*i+n])>>>o:0))&e[u+n])return!0;u+=n}return!1}function QD(t,e){const n=t[0],r=t[1];e.x+e.x0<n.x&&(n.x=e.x+e.x0),e.y+e.y0<n.y&&(n.y=e.y+e.y0),e.x+e.x1>r.x&&(r.x=e.x+e.x1),e.y+e.y1>r.y&&(r.y=e.y+e.y1)}function JD(t,e){return t.x+t.x1>e[0].x&&t.x+t.x0<e[1].x&&t.y+t.y1>e[0].y&&t.y+t.y0<e[1].y}function tB(t){const e=t[0]/t[1];return function(t){return[e*(t*=.1)*Math.cos(t),t*Math.sin(t)]}}function eB(t){const e=[];let n=-1;for(;++n<t;)e[n]=0;return e}function nB(){return document.createElement("canvas")}function rB(t){return"function"==typeof t?t:function(){return t}}const iB={archimedean:tB,rectangular:function(t){const e=4*t[0]/t[1];let n=0,r=0;return function(t){const i=t<0?-1:1;switch(Math.sqrt(1+4*i*t)-i&3){case 0:n+=e;break;case 1:r+=4;break;case 2:n-=e;break;default:r-=4}return[n,r]}}};function aB(){let t=[256,256],e=$D,n=HD,r=VD,i=YD,a=UD,o=qD,s=tB,c=Math.random,l=XD,u=[],f=null,h=1/0,d=nB;const p=YD,g={};function v(e,n,r){const i=n.x,a=n.y,o=Math.sqrt(t[0]*t[0]+t[1]*t[1]),l=s(t),u=c()<.5?1:-1;let f,h,d,p=-u;for(;(f=l(p+=u))&&(h=~~f[0],d=~~f[1],!(Math.min(Math.abs(h),Math.abs(d))>=o));)if(n.x=i+h,n.y=a+d,!(n.x+n.x0<0||n.y+n.y0<0||n.x+n.x1>t[0]||n.y+n.y1>t[1])&&(!r||!ZD(n,e,t[0]))&&(!r||JD(n,r))){const r=n.sprite,i=n.width>>5,a=t[0]>>5,o=n.x-(i<<4),s=127&o,c=32-s,l=n.y1-n.y0;let u,f=(n.y+n.y0)*a+(o>>5);for(let t=0;t<l;t++){u=0;for(let n=0;n<=i;n++)e[f+n]|=u<<c|(n<i?(u=r[t*i+n])>>>s:0);f+=a}return delete n.sprite,!0}return!1}return g.start=function(){const[s,m]=t,y=function(t){t.width=t.height=1;const e=Math.sqrt(t.getContext("2d").getImageData(0,0,1,1).data.length>>2);t.width=2048/e,t.height=WD/e;const n=t.getContext("2d");return n.fillStyle=n.strokeStyle="red",n.textAlign="center",n.textBaseline="middle",{context:n,ratio:e}}(d()),b=g.board?g.board:eB((t[0]>>5)*t[1]),x=u.length,w=[],k=u.map((function(t,s,c){return t.text=e.call(this,t,s,c),t.font=n.call(this,t,s,c),t.style=p.call(this,t,s,c),t.weight=i.call(this,t,s,c),t.rotate=a.call(this,t,s,c),t.size=~~r.call(this,t,s,c),t.padding=o.call(this,t,s,c),t})).sort((function(t,e){return e.size-t.size}));let E=-1,M=g.board?[{x:0,y:0},{x:s,y:m}]:void 0;function O(){const e=Date.now();for(;Date.now()-e<h&&++E<x;){const e=k[E];e.x=s*(c()+.5)>>1,e.y=m*(c()+.5)>>1,KD(y,e,k,E),e.hasText&&v(b,e,M)&&(l.call(null,"word",{cloud:g,word:e}),w.push(e),M?g.hasImage||QD(M,e):M=[{x:e.x+e.x0,y:e.y+e.y0},{x:e.x+e.x1,y:e.y+e.y1}],e.x-=t[0]>>1,e.y-=t[1]>>1)}g._tags=w,g._bounds=M,E>=x&&(g.stop(),l.call(null,"end",{cloud:g,words:w,bounds:M}))}return f&&clearInterval(f),f=setInterval(O,0),O(),g},g.stop=function(){return f&&(clearInterval(f),f=null),g},g.createMask=e=>{const n=document.createElement("canvas"),[r,i]=t;if(!r||!i)return;const a=r>>5,o=eB((r>>5)*i);n.width=r,n.height=i;const s=n.getContext("2d");s.drawImage(e,0,0,e.width,e.height,0,0,r,i);const c=s.getImageData(0,0,r,i).data;for(let t=0;t<i;t++)for(let e=0;e<r;e++){const n=a*t+(e>>5),i=t*r+e<<2,s=c[i]>=250&&c[i+1]>=250&&c[i+2]>=250?1<<31-e%32:0;o[n]|=s}g.board=o,g.hasImage=!0},g.timeInterval=function(t){h=null==t?1/0:t},g.words=function(t){u=t},g.size=function(e=[]){t=[+e[0],+e[1]]},g.text=function(t){e=rB(t)},g.font=function(t){n=rB(t)},g.fontWeight=function(t){i=rB(t)},g.rotate=function(t){a=rB(t)},g.canvas=function(t){d=rB(t)},g.spiral=function(t){s=iB[t]||t},g.fontSize=function(t){r=rB(t)},g.padding=function(t){o=rB(t)},g.random=function(t){c=rB(t)},g.on=function(t){l=rB(t)},g}const oB={fontSize:[20,60],font:"Impact",padding:2,rotate:function(){return 30*(~~(6*Math.random())-3)}};function sB(t){return new Promise(((e,n)=>{if(t instanceof HTMLImageElement)e(t);else{if("string"==typeof t){const r=new Image;return r.crossOrigin="anonymous",r.src=t,r.onload=()=>e(r),void(r.onerror=()=>{console.error(`'image ${t} load failed !!!'`),n()})}n()}}))}const cB=(t,e)=>n=>Re(void 0,void 0,void 0,(function*(){const r=Object.assign({},oB,t,{canvas:e.createCanvas}),i=aB();var a,o;yield(a=i,o=r,{set(t,e,n){if(void 0===o[t])return this;const r=e?e.call(null,o[t]):o[t];return n?n.call(null,r):"function"==typeof a[t]?a[t](r):a[t]=r,this},setAsync(t,e,n){return Re(this,void 0,void 0,(function*(){if(void 0===o[t])return this;const r=e?yield e.call(null,o[t]):o[t];return n?n.call(null,r):"function"==typeof a[t]?a[t](r):a[t]=r,this}))}}).set("fontSize",(t=>{const e=n.map((t=>t.value));return function(t,e){if("function"==typeof t)return t;if(Array.isArray(t)){const[n,r]=t;if(!e)return()=>(r+n)/2;const[i,a]=e;return a===i?()=>(r+n)/2:({value:t})=>(r-n)/(a-i)*(t-i)+n}return()=>t}(t,[mr(e),gr(e)])})).set("font").set("fontStyle").set("fontWeight").set("padding").set("rotate").set("size").set("spiral").set("timeInterval").set("random").set("text").set("on").set("canvas").setAsync("imageMask",sB,i.createMask),i.words([...n]);const s=i.start(),[c,l]=r.size,u=[{x:0,y:0},{x:c,y:l}],{_bounds:f=u,_tags:h,hasImage:d}=s,p=h.map((t=>{var{x:e,y:n,font:r}=t,i=Le(t,["x","y","font"]);return Object.assign(Object.assign({},i),{x:e+c/2,y:n+l/2,fontFamily:r})})),[{x:g,y:v},{x:m,y:y}]=f,b={text:"",value:0,opacity:0,fontSize:0};return p.push(Object.assign(Object.assign({},b),{x:d?0:g,y:d?0:v}),Object.assign(Object.assign({},b),{x:d?c:m,y:d?l:y})),p}));function lB(t){return"string"==typeof t?e=>e[t]:t}cB.props={};const uB=t=>{const{join:e,on:n,select:r=[],as:i=r,unknown:a=NaN}=t,[o,s]=n,c=lB(s),l=lB(o),u=tr(e,(([t])=>t),(t=>c(t)));return t=>t.map((t=>{const e=u.get(l(t));return Object.assign(Object.assign({},t),r.reduce(((t,n,r)=>(t[i[r]]=e?e[n]:a,t)),{}))}))};uB.props={};const fB=t=>{const{start:e,end:n}=t;return t=>t.slice(e,n)};fB.props={};var hB={exports:{}},dB={exports:{}};!function(t){var e=t.exports;t.exports.isNumber=function(t){return"number"==typeof t},t.exports.findMin=function(t){if(0===t.length)return 1/0;for(var e=t[0],n=1;n<t.length;n++)e=Math.min(e,t[n]);return e},t.exports.findMax=function(t){if(0===t.length)return-1/0;for(var e=t[0],n=1;n<t.length;n++)e=Math.max(e,t[n]);return e},t.exports.findMinMulti=function(t){for(var n=e.findMin(t[0]),r=1;r<t.length;r++)n=Math.min(n,e.findMin(t[r]));return n},t.exports.findMaxMulti=function(t){for(var n=e.findMax(t[0]),r=1;r<t.length;r++)n=Math.max(n,e.findMax(t[r]));return n},t.exports.inside=function(t,e,n){return t<=n&&n<=e}}(dB),function(t){var e=Math.log(2),n=t.exports,r=dB.exports;function i(t){return 1-Math.abs(t)}t.exports.getUnifiedMinMax=function(t,e){return n.getUnifiedMinMaxMulti([t],e)},t.exports.getUnifiedMinMaxMulti=function(t,e){e=e||{};var n=!1,i=!1,a=r.isNumber(e.width)?e.width:2,o=r.isNumber(e.size)?e.size:50,s=r.isNumber(e.min)?e.min:(n=!0,r.findMinMulti(t)),c=r.isNumber(e.max)?e.max:(i=!0,r.findMaxMulti(t)),l=(c-s)/(o-1);return n&&(s-=2*a*l),i&&(c+=2*a*l),{min:s,max:c}},t.exports.create=function(t,e){if(e=e||{},!t||0===t.length)return[];var a=r.isNumber(e.size)?e.size:50,o=r.isNumber(e.width)?e.width:2,s=n.getUnifiedMinMax(t,{size:a,width:o,min:e.min,max:e.max}),c=s.min,l=s.max-c,u=l/(a-1);if(0===l)return[{x:c,y:1}];for(var f=[],h=0;h<a;h++)f.push({x:c+h*u,y:0});var d=function(t,e){for(var n={},r=0,i=-e;i<=e;i++)r+=t(i/e),n[i]=r;return n}(i,o),p=d[o],g=d[o-1]-d[o-2],v=0;t.forEach((function(t){var e=function(t){return Math.floor((t-c)/u)}(t);if(!(e+o<0||e-o>=f.length)){var n=Math.max(e-o,0),i=e,a=Math.min(e+o,f.length-1),s=n-(e-o),l=e+o-a,h=d[-o-1+s]||0,m=d[-o-1+l]||0,y=p/(p-h-m);s>0&&(v+=y*(s-1)*g);var b=Math.max(0,e-o+1);r.inside(0,f.length-1,b)&&(f[b].y+=1*y*g),r.inside(0,f.length-1,i+1)&&(f[i+1].y-=2*y*g),r.inside(0,f.length-1,a+1)&&(f[a+1].y+=1*y*g)}}));var m=v,y=0,b=0;return f.forEach((function(t){y+=t.y,m+=y,t.y=m,b+=m})),b>0&&f.forEach((function(t){t.y/=b})),f},t.exports.getExpectedValueFromPdf=function(t){if(t&&0!==t.length){var e=0;return t.forEach((function(t){e+=t.x*t.y})),e}},t.exports.getXWithLeftTailArea=function(t,e){if(t&&0!==t.length){for(var n=0,r=0,i=0;i<t.length&&(r=i,!((n+=t[i].y)>=e));i++);return t[r].x}},t.exports.getPerplexity=function(t){if(t&&0!==t.length){var n=0;return t.forEach((function(t){var e=Math.log(t.y);isFinite(e)&&(n+=t.y*e)})),n=-n/e,Math.pow(2,n)}}}(hB);var pB=hB.exports;const gB=t=>{const{field:e,groupBy:n,as:r=["y","size"],min:i,max:a,size:o=10,width:s}=t,[c,l]=r;return t=>{const r=Array.from(Qn(t,(t=>n.map((e=>t[e])).join("-"))).values());return r.map((t=>{const n=pB.create(t.map((t=>t[e])),{min:i,max:a,size:o,width:s}),r=n.map((t=>t.x)),u=n.map((t=>t.y));return Object.assign(Object.assign({},t[0]),{[c]:r,[l]:u})}))}};gB.props={};const vB=()=>t=>(console.log("G2 data section:",t),t);vB.props={};const mB=t=>{const{field:e="y",alpha:n=.6,as:r=e}=t;return t=>{const i=t.map((t=>t[e])),a=function(t,e){if(e<0||e>1)throw new Error("alpha must be between 0 and 1.");if(0===t.length)return[];let n=t[0];const r=[];for(const i of t){if(null==i){r.push(i),console.warn("EMA:The value is null or undefined",t);continue}null==n&&(n=i);const a=n*e+(1-e)*i;r.push(a),n=a}return r}(i,n);return t.map(((t,e)=>Object.assign(Object.assign({},t),{[r]:a[e]})))}};mB.props={};function yB(t){const{min:e,max:n}=t;return[[e[0],e[1]],[n[0],n[1]]]}function bB(t,e,n=.01){const[r,i]=t,[a,o]=e;return r>=a[0]-n&&r<=o[0]+n&&i>=a[1]-n&&i<=o[1]+n}const xB=t=>{const{priority:e}=t;return t=>{const n=[];return e&&t.sort(e),t.forEach((t=>{hR(t);const e=t.getLocalBounds(),r=n.some((t=>function(t,e){const[n,r]=t,[i,a]=e;return n[0]<a[0]&&r[0]>i[0]&&n[1]<a[1]&&r[1]>i[1]}(yB(e),yB(t.getLocalBounds()))));r?fR(t):n.push(t)})),t}};function wB([t,e],[n,r]){return r>t&&e>n}function kB(){const t=new Map;return[e=>t.get(e),(e,n)=>t.set(e,n)]}function EB(t){const e=t.cloneNode(!0),n=e.getElementById("connector");n&&e.removeChild(n);const{min:r,max:i}=e.getRenderBounds();return e.destroy(),{min:r,max:i}}const MB=t=>{const{maxIterations:e=10,maxError:n=.1,padding:r=1}=t;return t=>{const i=t.length;if(i<=1)return t;const[a,o]=kB(),[s,c]=kB(),[l,u]=kB(),[f,h]=kB();for(const e of t){const{min:t,max:n}=EB(e),[r,i]=t,[a,s]=n;o(e,i),c(e,i),u(e,s-i),h(e,[r,a])}for(let a=0;a<e;a++){t.sort(((t,e)=>Rn(s(t),s(e))));let e=0;for(let n=0;n<i-1;n++){const i=t[n];let a,o=n+1;for(;(a=t[o])&&!wB(f(i),f(a));)o+=1;if(a){const t=s(i),n=l(i),o=s(a),u=o-(t+n);if(u<r){const n=(r-u)/2;e=Math.max(e,n),c(i,t-n),c(a,o+n)}}}if(e<n)break}for(const e of t)e.style.y+=s(e)-a(e);return t}};function OB(t){let e=t/255;return e=e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4),e}function SB(t,e,n){return.2126*OB(t)+.7152*OB(e)+.0722*OB(n)}function AB(t,e){if(!t||!e||t===e)return 1;const{r:n,g:r,b:i}=t,{r:a,g:o,b:s}=e,c=SB(n,r,i),l=SB(a,o,s);return(Math.max(c,l)+.05)/(Math.min(c,l)+.05)}function _B(t,e){const n=vr(e,(e=>AB(t,function(t){return"object"==typeof t?t:ih(t)}(e))));return e[n]}const TB=t=>{const{threshold:e=4.5,palette:n=["#000","#fff"]}=t;return t=>(t.forEach((t=>{const r=t.attr("dependentElement").parsedStyle.fill;AB(t.parsedStyle.fill,r)<e&&t.attr("fill",_B(r,n))})),t)},PB=()=>t=>(t.forEach((t=>{hR(t);const e=t.attr("bounds"),n=function(t,e,n=.01){const[r,i]=t;return!(bB(r,e,n)&&bB(i,e,n))}(yB(t.getLocalBounds()),e);n&&fR(t)})),t),CB=()=>(t,{canvas:e,layout:n})=>(t.forEach((t=>{hR(t);const{max:e,min:r}=t.getRenderBounds(),[i,a]=e,[o,s]=r,c=((t,e)=>{const[[n,r],[i,a]]=e,[[o,s],[c,l]]=t;let u=0,f=0;return o<n?u=n-o:c>i&&(u=i-c),s<r?f=r-s:l>a&&(f=a-l),[u,f]})([[o,s],[i,a]],[[n.x,n.y],[n.x+n.width,n.y+n.height]]);t.style.connector&&t.style.connectorPoints&&(t.style.connectorPoints[0][0]-=c[0],t.style.connectorPoints[0][1]-=c[1]),t.style.x+=c[0],t.style.y+=c[1]})),t);function NB(){return{"data.fetch":PD,"data.inline":BD,"data.sortBy":DD,"data.sort":jD,"data.filter":LD,"data.pick":RD,"data.rename":ID,"data.fold":CD,"data.slice":fB,"data.custom":FD,"data.map":zD,"data.join":uB,"data.kde":gB,"data.log":vB,"data.wordCloud":cB,"data.ema":mB,"transform.stackY":go,"transform.binX":js,"transform.bin":Ls,"transform.dodgeX":Fo,"transform.jitter":Ho,"transform.jitterX":Yo,"transform.jitterY":Vo,"transform.symmetryY":Uo,"transform.diffY":qo,"transform.stackEnter":zo,"transform.normalizeY":Go,"transform.select":Jo,"transform.selectX":ts,"transform.selectY":es,"transform.groupX":ds,"transform.groupY":ps,"transform.groupColor":gs,"transform.group":hs,"transform.sortX":ms,"transform.sortY":bs,"transform.sortColor":ys,"transform.flexX":xs,"transform.pack":Ps,"transform.sample":Is,"transform.filter":Ds,"coordinate.cartesian":e,"coordinate.polar":r,"coordinate.transpose":a,"coordinate.theta":o,"coordinate.parallel":l,"coordinate.fisheye":u,"coordinate.radial":c,"coordinate.radar":f,"coordinate.helix":i,"encode.constant":h,"encode.field":p,"encode.transform":d,"encode.column":g,"mark.interval":gE,"mark.rect":mE,"mark.line":wE,"mark.point":EE,"mark.text":OE,"mark.cell":AE,"mark.area":TE,"mark.link":CE,"mark.image":LE,"mark.polygon":RE,"mark.box":DE,"mark.vector":FE,"mark.lineX":$E,"mark.lineY":GE,"mark.connector":YE,"mark.range":XE,"mark.rangeX":ZE,"mark.rangeY":JE,"mark.path":eM,"mark.shape":LM,"mark.density":IM,"mark.heatmap":BM,"mark.wordCloud":jM,"palette.category10":FM,"palette.category20":zM,"scale.linear":WM,"scale.ordinal":$M,"scale.band":GM,"scale.identity":HM,"scale.point":YM,"scale.time":VM,"scale.log":UM,"scale.pow":qM,"scale.sqrt":QM,"scale.threshold":XM,"scale.quantile":KM,"scale.quantize":ZM,"scale.sequential":JM,"scale.constant":tO,"theme.classic":iO,"theme.classicDark":sO,"theme.academy":lO,"theme.light":rO,"theme.dark":oO,"component.axisX":GO,"component.axisY":WO,"component.legendCategory":qO,"component.legendContinuous":JO,"component.legends":bS,"component.title":oS,"component.sliderX":pS,"component.sliderY":gS,"component.scrollbarX":mS,"component.scrollbarY":yS,"animation.scaleInX":xS,"animation.scaleOutX":wS,"animation.scaleInY":kS,"animation.scaleOutY":ES,"animation.waveIn":FS,"animation.fadeIn":MS,"animation.fadeOut":OS,"animation.zoomIn":zS,"animation.zoomOut":GS,"animation.pathIn":WS,"animation.morphing":BS,"animation.growInX":$S,"animation.growInY":HS,"interaction.elementHighlight":$R,"interaction.elementHighlightByX":HR,"interaction.elementHighlightByColor":YR,"interaction.elementSelect":UR,"interaction.elementSelectByX":qR,"interaction.elementSelectByColor":XR,"interaction.fisheye":ZR,"interaction.chartIndex":KR,"interaction.tooltip":bI,"interaction.legendFilter":TI,"interaction.legendHighlight":PI,"interaction.brushHighlight":FI,"interaction.brushXHighlight":GI,"interaction.brushYHighlight":$I,"interaction.brushAxisHighlight":KI,"interaction.brushFilter":ZI,"interaction.brushXFilter":QI,"interaction.brushYFilter":JI,"interaction.sliderFilter":rD,"interaction.scrollbarFilter":aD,"interaction.poptip":lD,"interaction.treemapDrillDown":fD,"interaction.elementPointMove":xD,"composition.spaceLayer":rP,"composition.spaceFlex":iP,"composition.facetRect":xP,"composition.repeatMatrix":SP,"composition.facetCircle":NP,"composition.timingKeyframe":jP,"labelTransform.overlapHide":xB,"labelTransform.overlapDodgeY":MB,"labelTransform.overflowHide":PB,"labelTransform.contrastReverse":TB,"labelTransform.exceedAdjust":CB}}function LB(t,e){return class extends t{constructor(t){super(Object.assign(Object.assign({},t),{lib:e}))}}}const jB={};const RB=t=>t?parseInt(t):0;function IB(t,e){const n=[t];for(;n.length;){const t=n.shift();e&&e(t);const r=t.children||[];for(const t of r)n.push(t)}}class DB{constructor(t={},e){this.parentNode=null,this.children=[],this.index=0,this.type=e,this.value=t}map(t=t=>t){const e=t(this.value);return this.value=e,this}attr(t,e){return 1===arguments.length?this.value[t]:this.map((n=>(n[t]=e,n)))}append(t){const e=new t({});return e.children=[],this.push(e),e}push(t){return t.parentNode=this,t.index=this.children.length,this.children.push(t),this}remove(){const t=this.parentNode;if(t){const{children:e}=t,n=e.findIndex((t=>t===this));e.splice(n,1)}return this}getNodeByKey(t){let e=null;return IB(this,(n=>{t===n.attr("key")&&(e=n)})),e}getNodesByType(t){const e=[];return IB(this,(n=>{t===n.type&&e.push(n)})),e}getNodeByType(t){let e=null;return IB(this,(n=>{e||t===n.type&&(e=n)})),e}call(t,...e){return t(this.map(),...e),this}getRoot(){let t=this;for(;t&&t.parentNode;)t=t.parentNode;return t}}const BB=["width","height","depth","padding","paddingLeft","paddingRight","paddingBottom","paddingTop","inset","insetLeft","insetRight","insetTop","insetBottom","margin","marginLeft","marginRight","marginTop","marginBottom","autoFit","theme","title","interaction"],FB="__remove__",zB="__callback__";function GB(t){return Object.assign(Object.assign({},t.value),{type:t.type})}function WB(t,e){const{width:n,height:r,autoFit:i,depth:a=0}=t;let o=640,s=480;if(i){const{width:t,height:n}=function(t){const e=getComputedStyle(t),n=t.clientWidth||RB(e.width),r=t.clientHeight||RB(e.height);return{width:n-(RB(e.paddingLeft)+RB(e.paddingRight)),height:r-(RB(e.paddingTop)+RB(e.paddingBottom))}}(e);o=t||o,s=n||s}return o=n||o,s=r||s,{width:Math.max(I(o)?o:1,1),height:Math.max(I(s)?s:1,1),depth:a}}function $B(t){const e=function(t){if(null!==t.type)return t;const e=t.children[t.children.length-1];for(const n of BB)e.attr(n,t.attr(n));return e}(t),n=[e],r=new Map;for(r.set(e,GB(e));n.length;){const t=n.pop(),e=r.get(t),{children:i=[]}=t;for(const t of i)if(t.type===zB)e.children=t.value;else{const i=GB(t),{children:a=[]}=e;a.push(i),n.push(t),r.set(t,i),e.children=a}}return r.get(e)}function HB(t,e,n,r,i){const{type:a}=t,{type:o=n||a}=e;if(function(t,e){return"function"!=typeof t&&new Set(Object.keys(e)).has(t)}(o,i)){for(const n of BB)void 0!==t.attr(n)&&void 0===e[n]&&(e[n]=t.attr(n));return e}if(function(t,e){return"function"==typeof t||new Set(Object.keys(e)).has(t)}(o,r)){const t={type:"view"},n=Object.assign({},e);for(const e of BB)void 0!==n[e]&&(t[e]=n[e],delete n[e]);return Object.assign(Object.assign({},t),{children:[n]})}return e}function YB(t,e,n){if("function"==typeof t){const e=new DB;return e.value=t,e.type=zB,e}const{type:r,children:i}=t,a=Le(t,["type","children"]),o=function(t,e,n){if("function"==typeof t)return e.mark;const r=Object.assign(Object.assign({},e),n)[t];if(!r)throw new Error(`Unknown mark: ${t}.`);return r}(r,e,n),s=new o;return s.value=a,s.type=r,s}function VB(t,e){const{type:n,children:r}=e,i=Le(e,["type","children"]);t.type===n||void 0===n?Qa(t.value,i):"string"==typeof n&&(t.type=n,t.value=i)}function UB(t,e,n,r){if(!t)return;const i=[[t,e]];for(;i.length;){const[t,e]=i.shift(),a=YB(e,n,r);Array.isArray(t.children)&&t.push(a);const{children:o}=e;if(Array.isArray(o))for(const t of o)i.push([a,t]);else"function"==typeof o&&i.push([a,o])}}function qB(t,e,{key:n=e}){t.prototype[e]=function(t){return 0===arguments.length?this.attr(n):this.attr(n,t)}}function XB(t,e,{key:n=e}){t.prototype[e]=function(t){if(0===arguments.length)return this.attr(n);if(Array.isArray(t))return this.attr(n,t);const e=[...this.attr(n)||[],t];return this.attr(n,e)}}function KB(t,e,{key:n=e}){t.prototype[e]=function(t,e){if(0===arguments.length)return this.attr(n);if(1===arguments.length&&"string"!=typeof t)return this.attr(n,t);const r=this.attr(n)||{};return r[t]=1===arguments.length||e,this.attr(n,r)}}function ZB(t,e,n){t.prototype[e]=function(t){if(0===arguments.length)return this.attr(e);if(Array.isArray(t))return this.attr(e,{items:t});if(Ka(t)&&(void 0!==t.title||void 0!==t.items))return this.attr(e,t);if(null===t||!1===t)return this.attr(e,t);const n=this.attr(e)||{},{items:r=[]}=n;return r.push(t),n.items=r,this.attr(e,n)}}function QB(t,e,{ctor:n}){t.prototype[e]=function(t){const r=this.append(n);return"mark"===e&&(r.type=t),r}}function JB(t,e,{ctor:n}){t.prototype[e]=function(){return this.type=null,this.append(n)}}function tF(t){return e=>{for(const[n,r]of Object.entries(t)){const{type:t}=r;"value"===t?qB(e,n,r):"array"===t?XB(e,n,r):"object"===t?KB(e,n,r):"node"===t?QB(e,n,r):"container"===t?JB(e,n,r):"mix"===t&&ZB(e,n)}return e}}function eF(t){return Object.fromEntries(Object.entries(t).map((([t,e])=>[t,{type:"node",ctor:e}])))}const nF={encode:{type:"object"},scale:{type:"object"},data:{type:"value"},transform:{type:"array"},style:{type:"object"},animate:{type:"object"},coordinate:{type:"object"},interaction:{type:"object"},label:{type:"array",key:"labels"},axis:{type:"object"},legend:{type:"object"},slider:{type:"object"},scrollbar:{type:"object"},state:{type:"object"},layout:{type:"object"},theme:{type:"object"},title:{type:"value"}},rF=Object.assign(Object.assign({},nF),{tooltip:{type:"mix"},viewStyle:{type:"object"}}),iF=Object.assign(Object.assign({},nF),{labelTransform:{type:"array"}});let aF=class extends DB{changeData(t){var e;const n=this.getRoot();if(n)return this.attr("data",t),(null===(e=this.children)||void 0===e?void 0:e.length)&&this.children.forEach((e=>{e.attr("data",t)})),null==n?void 0:n.render()}getView(){const t=this.getRoot(),{views:e}=t.getContext();if(null==e?void 0:e.length)return e.find((t=>t.key===this._key))}getScale(){var t;return null===(t=this.getView())||void 0===t?void 0:t.scale}getScaleByChannel(t){const e=this.getScale();if(e)return e[t]}getCoordinate(){var t;return null===(t=this.getView())||void 0===t?void 0:t.coordinate}getTheme(){var t;return null===(t=this.getView())||void 0===t?void 0:t.theme}getGroup(){const t=this._key;if(!t)return;return this.getRoot().getContext().canvas.getRoot().getElementById(t)}show(){const t=this.getGroup();t&&!t.isVisible()&&hR(t)}hide(){const t=this.getGroup();t&&t.isVisible()&&fR(t)}};aF=je([tF(iF)],aF);let oF=class extends DB{changeData(t){const e=this.getRoot();if(e)return this.attr("data",t),null==e?void 0:e.render()}getMark(){var t;const e=null===(t=this.getRoot())||void 0===t?void 0:t.getView();if(!e)return;const{markState:n}=e,r=Array.from(n.keys()).find((t=>t.key===this.attr("key")));return n.get(r)}getScale(){var t;const e=null===(t=this.getRoot())||void 0===t?void 0:t.getView();if(e)return null==e?void 0:e.scale}getScaleByChannel(t){var e,n;const r=null===(e=this.getRoot())||void 0===e?void 0:e.getView();if(r)return null===(n=null==r?void 0:r.scale)||void 0===n?void 0:n[t]}getGroup(){const t=this.attr("key");if(!t)return;return this.getRoot().getContext().canvas.getRoot().getElementById(t)}};oF=je([tF(rF)],oF);const sF="G2_CHART_KEY";class cF extends aF{constructor(t){const{container:e,canvas:n,renderer:r,plugins:i,lib:a,createCanvas:o}=t;super(Le(t,["container","canvas","renderer","plugins","lib","createCanvas"]),"view"),this._hasBindAutoFit=!1,this._rendering=!1,this._trailingClear=null,this._trailing=!1,this._trailingResolve=null,this._trailingReject=null,this._previousDefinedType=null,this._onResize=q((()=>{this.forceFit()}),300),this._renderer=r||new h_,this._plugins=i||[],this._container=function(t){if(void 0===t){const t=document.createElement("div");return t[FB]=!0,t}if("string"==typeof t)return document.getElementById(t);return t}(e),this._emitter=new v_,this._context={library:Object.assign(Object.assign({},a),jB),emitter:this._emitter,canvas:n,createCanvas:o},this._create()}render(){if(this._rendering)return this._addToTrailing();this._context.canvas||this._createCanvas(),this._bindAutoFit(),this._rendering=!0;const t=new Promise(((t,e)=>aR(this._computedOptions(),this._context,this._createResolve(t),this._createReject(e)))),[e,n,r]=function(){let t,e;return[new Promise(((n,r)=>{e=n,t=r})),e,t]}();return t.then(n).then((()=>{if(this._trailingClear){const t=this.options();this._trailingClear(),this._trailing&&this.options(t)}})).catch(r).then((()=>{this._trailingClear=null,this._renderTrailing()})),e}options(t){if(0===arguments.length)return $B(this);const{type:e}=t;return e&&(this._previousDefinedType=e),function(t,e,n,r,i){const a=[[null,t,HB(t,e,n,r,i)]];for(;a.length;){const[t,e,n]=a.shift();if(e)if(n){VB(e,n);const{children:t}=n,{children:r}=e;if(Array.isArray(t)&&Array.isArray(r)){const n=Math.max(t.length,r.length);for(let i=0;i<n;i++){const n=t[i],o=r[i];a.push([e,o,n])}}else"function"==typeof t&&a.push([e,null,t])}else e.remove();else UB(t,n,r,i)}}(this,t,this._previousDefinedType,this._marks,this._compositions),this}getContainer(){return this._container}getContext(){return this._context}on(t,e,n){return this._emitter.on(t,e,n),this}once(t,e){return this._emitter.once(t,e),this}emit(t,...e){return this._emitter.emit(t,...e),this}off(t,e){return this._emitter.off(t,e),this}clear(t=!0){if(this._rendering)return this._trailingClear=()=>{this.clear(t)},void this._reset();this.options();this.emit(m_.BEFORE_CLEAR),this._reset(),oR(0,this._context,!1,t),this.emit(m_.AFTER_CLEAR)}destroy(){this.options();this.emit(m_.BEFORE_DESTROY),this._unbindAutoFit(),this._reset(),oR(0,this._context,!0),this._container[FB]&&function(t){const e=t.parentNode;e&&e.removeChild(t)}(this._container),this.emit(m_.AFTER_DESTROY)}forceFit(){this.options.autoFit=!0;const{width:t,height:e}=WB(this.options(),this._container);if(t===this._width&&e===this._height)return Promise.resolve(this);this.emit(m_.BEFORE_CHANGE_SIZE);const n=this.render();return n.then((()=>{this.emit(m_.AFTER_CHANGE_SIZE)})),n}changeSize(t,e){if(t===this._width&&e===this._height)return Promise.resolve(this);this.emit(m_.BEFORE_CHANGE_SIZE),this.attr("width",t),this.attr("height",e);const n=this.render();return n.then((()=>{this.emit(m_.AFTER_CHANGE_SIZE)})),n}getDataByXY(t,e={}){const{shared:n=!1,series:r,facet:i=!1,startX:a=0,startY:o=0}=e,{canvas:s,views:c}=this._context,{document:l}=s,{x:u,y:f}=t,{coordinate:h,scale:d,markState:p,data:g,key:v}=c[0],m=l.getElementsByClassName(US),y=n?t=>t.__data__.x:t=>t,b=Qn(m,y),x=vR(l.getElementsByClassName(qS)[0]),w=t=>Array.from(t.values()).some((t=>{var e,n;return(null===(e=t.interaction)||void 0===e?void 0:e.seriesTooltip)||(null===(n=t.channels)||void 0===n?void 0:n.some((t=>"series"===t.name&&void 0!==t.values)))})),k=dI(r,w(p)),E=t=>rt(t,"__data__.data",null);try{if(k&&w(p)&&!i){const{selectedData:t}=vI({root:x,event:{offsetX:u,offsetY:f},elements:m,coordinate:h,scale:d,startX:a,startY:o}),e=g.get(`${v}-0`);return t.map((({index:t})=>e[t]))}const t=y(gI({root:x,event:{offsetX:u,offsetY:f},elements:m,coordinate:h,scale:d,shared:n})),e=b.get(t);return e?e.map(E):[]}catch(t){const e=s.document.elementFromPointSync(u,f);return e?E(e):[]}}_create(){const{library:t}=this._context,e=["mark.mark",...Object.keys(t).filter((t=>t.startsWith("mark.")||"component.axisX"===t||"component.axisY"===t||"component.legends"===t))];this._marks={};for(const t of e){const e=t.split(".").pop();class n extends oF{constructor(){super({},e)}}this._marks[e]=n,this[e]=function(t){const r=this.append(n);return"mark"===e&&(r.type=t),r}}const n=["composition.view",...Object.keys(t).filter((t=>t.startsWith("composition.")&&"composition.mark"!==t))];this._compositions=Object.fromEntries(n.map((t=>{const e=t.split(".").pop();let n=class extends aF{constructor(){super({},e)}};return n=je([tF(eF(this._marks))],n),[e,n]})));for(const t of Object.values(this._compositions))tF(eF(this._compositions))(t);for(const t of n){const e=t.split(".").pop();this[e]=function(){const t=this._compositions[e];return this.type=null,this.append(t)}}}_reset(){const t=["theme","type","width","height","autoFit"];this.type="view",this.value=Object.fromEntries(Object.entries(this.value).filter((([e])=>e.startsWith("margin")||e.startsWith("padding")||e.startsWith("inset")||t.includes(e)))),this.children=[]}_renderTrailing(){this._trailing&&(this._trailing=!1,this.render().then((()=>{const t=this._trailingResolve.bind(this);this._trailingResolve=null,t(this)})).catch((t=>{const e=this._trailingReject.bind(this);this._trailingReject=null,e(t)})))}_createResolve(t){return()=>{this._rendering=!1,t(this)}}_createReject(t){return e=>{this._rendering=!1,t(e)}}_computedOptions(){const t=this.options(),{key:e=sF}=t,{width:n,height:r,depth:i}=WB(t,this._container);return this._width=n,this._height=r,this._key=e,Object.assign(Object.assign({key:this._key},t),{width:n,height:r,depth:i})}_createCanvas(){const{width:t,height:e}=WB(this.options(),this._container);this._plugins.push(new p_),this._plugins.forEach((t=>this._renderer.registerPlugin(t))),this._context.canvas=new ov({container:this._container,width:t,height:e,renderer:this._renderer})}_addToTrailing(){var t;null===(t=this._trailingResolve)||void 0===t||t.call(this,this),this._trailing=!0;return new Promise(((t,e)=>{this._trailingResolve=t,this._trailingReject=e}))}_bindAutoFit(){const t=this.options(),{autoFit:e}=t;this._hasBindAutoFit?e||this._unbindAutoFit():e&&(this._hasBindAutoFit=!0,window.addEventListener("resize",this._onResize))}_unbindAutoFit(){this._hasBindAutoFit&&(this._hasBindAutoFit=!1,window.removeEventListener("resize",this._onResize))}}const lF=LB(cF,Object.assign({},NB()));t.AREA_CLASS_NAME=QS,t.Academy=lO,t.Bin=Ls,t.BinX=js,t.COMPONENT_CLASS_NAME=KS,t.Chart=lF,t.ChartEvent=m_,t.Classic=iO,t.ClassicDark=sO,t.Dark=oO,t.DiffY=qo,t.DodgeX=Fo,t.ELEMENT_CLASS_NAME=US,t.Filter=Ds,t.FlexX=xs,t.Group=hs,t.GroupColor=gs,t.GroupX=ds,t.GroupY=ps,t.Jitter=Ho,t.JitterX=Yo,t.JitterY=Vo,t.LABEL_CLASS_NAME=ZS,t.LABEL_LAYER_CLASS_NAME=VS,t.Light=rO,t.LinearAxis=FO,t.MAIN_LAYER_CLASS_NAME=YS,t.MASK_CLASS_NAME="mask",t.MaybeDefaultX=Co,t.MaybeDefaultY=No,t.MaybeFunctionAttribute=Io,t.MaybeGradient=Bo,t.MaybeIdentityX=Po,t.MaybeIdentityY=To,t.MaybeKey=Oo,t.MaybeSeries=So,t.MaybeSize=Mo,t.MaybeStackY=mo,t.MaybeTitle=xo,t.MaybeTooltip=Lo,t.MaybeTuple=Do,t.MaybeTupleX=_o,t.MaybeTupleY=Ao,t.MaybeVisualPosition=Ro,t.MaybeZeroPadding=jo,t.MaybeZeroX=wo,t.MaybeZeroY=ko,t.MaybeZeroY1=jn,t.MaybeZeroZ=Eo,t.NormalizeY=Go,t.PLOT_CLASS_NAME=XS,t.Pack=Ps,t.Runtime=cF,t.Sample=Is,t.Select=Jo,t.SelectX=ts,t.SelectY=es,t.Selection=om,t.SortColor=ys,t.SortX=ms,t.SortY=bs,t.StackEnter=zo,t.StackY=go,t.SymmetryY=Uo,t.VIEW_CLASS_NAME=qS,t.corelib=NB,t.dataOf=Da,t.extend=LB,t.register=function(t,e){var n,r;t.startsWith("symbol.")?(n=t.split(".").pop(),r=e,cy.set(n,r)):Object.assign(jB,{[t]:e})},t.render=aR,t.renderToMountedElement=function(t,e={},n=()=>{},r=t=>{throw t}){var i;const{width:a=640,height:o=480}=t,s=rR(t),{group:c=new Cg,emitter:l=new v_,library:u}=e;(null==c?void 0:c.parentElement)||Wa("renderToMountedElement can't render chart to unmounted group.");const f=am(c);return e.group=c,e.emitter=l,e.canvas=e.canvas||(null===(i=null==c?void 0:c.ownerDocument)||void 0===i?void 0:i.defaultView),l.emit(m_.BEFORE_RENDER),_j(Object.assign(Object.assign({},s),{width:a,height:o}),f,e).then((()=>{var t;null===(t=e.canvas)||void 0===t||t.requestAnimationFrame((()=>{l.emit(m_.AFTER_RENDER),null==n||n()}))})).catch((t=>{null==r||r(t)})),c},t.select=am,t.selectG2Elements=dR,t.selectPlotArea=vR,t.seriesOf=function(t){const e=Ia(t).__data__,{scale:n}=e;return Ba(n,t.__data__)},Object.defineProperty(t,"__esModule",{value:!0})}));
67
+ */d_.tag="Dragndrop";var p_=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return sl(this,e),(t=vl(this,e)).name="dragndrop",t.options=n,t}return yl(e,t),ll(e,[{key:"init",value:function(){this.addRenderingPlugin(new d_(ol({overlap:"pointer",isDocumentDraggable:!1,isDocumentDroppable:!1,dragstartDistanceThreshold:0,dragstartTimeThreshold:0},this.options)))}},{key:"destroy",value:function(){this.removeAllRenderingPlugins()}},{key:"setOptions",value:function(t){Object.assign(this.plugins[0].dragndropPluginOptions,t)}}])}(Zl),g_=function(){function t(){this._events={}}return t.prototype.on=function(t,e,n){return this._events[t]||(this._events[t]=[]),this._events[t].push({callback:e,once:!!n}),this},t.prototype.once=function(t,e){return this.on(t,e,!0)},t.prototype.emit=function(t){for(var e=this,n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];var i=this._events[t]||[],a=this._events["*"]||[],o=function(r){for(var i=r.length,a=0;a<i;a++)if(r[a]){var o=r[a],s=o.callback;o.once&&(r.splice(a,1),0===r.length&&delete e._events[t],i--,a--),s.apply(e,n)}};o(i),o(a)},t.prototype.off=function(t,e){if(t)if(e){for(var n=this._events[t]||[],r=n.length,i=0;i<r;i++)n[i].callback===e&&(n.splice(i,1),r--,i--);0===n.length&&delete this._events[t]}else delete this._events[t];else this._events={};return this},t.prototype.getEvents=function(){return this._events},t}(),v_=g_;const m_={BEFORE_RENDER:"beforerender",AFTER_RENDER:"afterrender",BEFORE_PAINT:"beforepaint",AFTER_PAINT:"afterpaint",BEFORE_CHANGE_DATA:"beforechangedata",AFTER_CHANGE_DATA:"afterchangedata",BEFORE_CLEAR:"beforeclear",AFTER_CLEAR:"afterclear",BEFORE_DESTROY:"beforedestroy",AFTER_DESTROY:"afterdestroy",BEFORE_CHANGE_SIZE:"beforechangesize",AFTER_CHANGE_SIZE:"afterchangesize",POINTER_TAP:"pointertap",POINTER_DOWN:"pointerdown",POINTER_UP:"pointerup",POINTER_OVER:"pointerover",POINTER_OUT:"pointerout",POINTER_MOVE:"pointermove",POINTER_ENTER:"pointerenter",POINTER_LEAVE:"pointerleave",POINTER_UPOUTSIDE:"pointerupoutside",DRAG_START:"dragstart",DRAG:"drag",DRAG_END:"dragend",DRAG_ENTER:"dragenter",DRAG_LEAVE:"dragleave",DRAG_OVER:"dragover",DROP:"DROP",CLICK:"click",DBLCLICK:"dblclick"},y_={abs:Math.abs,ceil:Math.ceil,floor:Math.floor,max:Math.max,min:Math.min,round:Math.round,sqrt:Math.sqrt,pow:Math.pow};class b_ extends Error{constructor(t,e,n){super(t),this.position=e,this.token=n,this.name="ExpressionError"}}var x_;!function(t){t[t.STRING=0]="STRING",t[t.NUMBER=1]="NUMBER",t[t.BOOLEAN=2]="BOOLEAN",t[t.NULL=3]="NULL",t[t.IDENTIFIER=4]="IDENTIFIER",t[t.OPERATOR=5]="OPERATOR",t[t.FUNCTION=6]="FUNCTION",t[t.DOT=7]="DOT",t[t.BRACKET_LEFT=8]="BRACKET_LEFT",t[t.BRACKET_RIGHT=9]="BRACKET_RIGHT",t[t.PAREN_LEFT=10]="PAREN_LEFT",t[t.PAREN_RIGHT=11]="PAREN_RIGHT",t[t.COMMA=12]="COMMA",t[t.QUESTION=13]="QUESTION",t[t.COLON=14]="COLON",t[t.DOLLAR=15]="DOLLAR"}(x_||(x_={}));const w_=new Set([32,9,10,13]),k_=new Set([43,45,42,47,37,33,38,124,61,60,62]),E_=new Map([["true",x_.BOOLEAN],["false",x_.BOOLEAN],["null",x_.NULL]]),M_=new Map([["===",!0],["!==",!0],["<=",!0],[">=",!0],["&&",!0],["||",!0],["+",!0],["-",!0],["*",!0],["/",!0],["%",!0],["!",!0],["<",!0],[">",!0]]),O_=new Map([[46,x_.DOT],[91,x_.BRACKET_LEFT],[93,x_.BRACKET_RIGHT],[40,x_.PAREN_LEFT],[41,x_.PAREN_RIGHT],[44,x_.COMMA],[63,x_.QUESTION],[58,x_.COLON],[36,x_.DOLLAR]]),S_=new Map;for(const[t,e]of O_.entries())S_.set(t,{type:e,value:String.fromCharCode(t)});function A_(t){return t>=48&&t<=57}function __(t){return t>=97&&t<=122||t>=65&&t<=90||95===t}function T_(t){return __(t)||A_(t)}function P_(t){return k_.has(t)}var C_;!function(t){t[t.Program=0]="Program",t[t.Literal=1]="Literal",t[t.Identifier=2]="Identifier",t[t.MemberExpression=3]="MemberExpression",t[t.CallExpression=4]="CallExpression",t[t.BinaryExpression=5]="BinaryExpression",t[t.UnaryExpression=6]="UnaryExpression",t[t.ConditionalExpression=7]="ConditionalExpression"}(C_||(C_={}));const N_=new Map([["||",2],["&&",3],["===",4],["!==",4],[">",5],[">=",5],["<",5],["<=",5],["+",6],["-",6],["*",7],["/",7],["%",7],["!",8]]),L_={type:C_.Literal,value:null},j_={type:C_.Literal,value:!0},R_={type:C_.Literal,value:!1},I_=t=>{let e=0;const n=t.length,r=()=>e>=n?null:t[e],i=()=>t[e++],a=t=>{const e=r();return null!==e&&e.type===t},o=t=>t.type===x_.OPERATOR?N_.get(t.value)||-1:t.type===x_.DOT||t.type===x_.BRACKET_LEFT?9:t.type===x_.QUESTION?1:-1,s=t=>{let n,o;if(i().type===x_.DOT){if(!a(x_.IDENTIFIER)){const t=r();throw new b_("Expected property name",e,t?t.value:"<end of input>")}const t=i();n={type:C_.Identifier,name:t.value},o=!1}else{if(n=l(0),!a(x_.BRACKET_RIGHT)){const t=r();throw new b_("Expected closing bracket",e,t?t.value:"<end of input>")}i(),o=!0}return{type:C_.MemberExpression,object:t,property:n,computed:o}},c=()=>{const t=r();if(!t)throw new b_("Unexpected end of input",e,"<end of input>");if(t.type===x_.OPERATOR&&("!"===t.value||"-"===t.value)){i();const e=c();return{type:C_.UnaryExpression,operator:t.value,argument:e,prefix:!0}}switch(t.type){case x_.NUMBER:return i(),{type:C_.Literal,value:Number(t.value)};case x_.STRING:return i(),{type:C_.Literal,value:t.value};case x_.BOOLEAN:return i(),"true"===t.value?j_:R_;case x_.NULL:return i(),L_;case x_.IDENTIFIER:return i(),{type:C_.Identifier,name:t.value};case x_.FUNCTION:return(()=>{const t=i(),n=[];if(!a(x_.PAREN_LEFT)){const t=r();throw new b_("Expected opening parenthesis after function name",e,t?t.value:"<end of input>")}for(i();;){if(a(x_.PAREN_RIGHT)){i();break}if(!r()){const t=r();throw new b_("Expected closing parenthesis",e,t?t.value:"<end of input>")}if(n.length>0){if(!a(x_.COMMA)){const t=r();throw new b_("Expected comma between function arguments",e,t?t.value:"<end of input>")}i()}const t=l(0);n.push(t)}return{type:C_.CallExpression,callee:{type:C_.Identifier,name:t.value},arguments:n}})();case x_.PAREN_LEFT:{i();const t=l(0);if(!a(x_.PAREN_RIGHT)){const t=r();throw new b_("Expected closing parenthesis",e,t?t.value:"<end of input>")}return i(),t}default:throw new b_(`Unexpected token: ${t.type}`,e,t.value)}},l=(u=0)=>{let f=c();for(;e<n;){const n=t[e],c=o(n);if(c<=u)break;if(n.type!==x_.QUESTION)if(n.type!==x_.OPERATOR){if(n.type!==x_.DOT&&n.type!==x_.BRACKET_LEFT)break;f=s(f)}else{i();const t=l(c);f={type:C_.BinaryExpression,operator:n.value,left:f,right:t}}else{i();const t=l(0);if(!a(x_.COLON)){const t=r();throw new b_("Expected : in conditional expression",e,t?t.value:"<end of input>")}i();const n=l(0);f={type:C_.ConditionalExpression,test:f,consequent:t,alternate:n}}}return f},u=l();return{type:C_.Program,body:u}},D_=(t,e,n)=>{let r=e;n&&(r={...e,context:{...e.context,...n}});const i=t=>{switch(t.type){case C_.Literal:return(t=>t.value)(t);case C_.Identifier:return(t=>{if(!(t.name in r.context))throw new b_(`Undefined variable: ${t.name}`);return r.context[t.name]})(t);case C_.MemberExpression:return(t=>{const e=i(t.object);if(null==e)throw new b_("Cannot access property of null or undefined");return e[t.computed?i(t.property):t.property.name]})(t);case C_.CallExpression:return(t=>{const e=r.functions[t.callee.name];if(!e)throw new b_(`Undefined function: ${t.callee.name}`);return e(...t.arguments.map((t=>i(t))))})(t);case C_.BinaryExpression:return(t=>{if("&&"===t.operator){const e=i(t.left);return e?i(t.right):e}if("||"===t.operator)return i(t.left)||i(t.right);const e=i(t.left),n=i(t.right);switch(t.operator){case"+":return e+n;case"-":return e-n;case"*":return e*n;case"/":return e/n;case"%":return e%n;case"===":return e===n;case"!==":return e!==n;case">":return e>n;case">=":return e>=n;case"<":return e<n;case"<=":return e<=n;default:throw new b_(`Unknown operator: ${t.operator}`)}})(t);case C_.UnaryExpression:return(t=>{const e=i(t.argument);if(t.prefix)switch(t.operator){case"!":return!e;case"-":if("number"!=typeof e)throw new b_(`Cannot apply unary - to non-number: ${e}`);return-e;default:throw new b_(`Unknown operator: ${t.operator}`)}throw new b_(`Postfix operators are not supported: ${t.operator}`)})(t);case C_.ConditionalExpression:return(t=>{const e=i(t.test);return i(e?t.consequent:t.alternate)})(t);default:throw new b_(`Evaluation error: Unsupported node type: ${t.type}`)}};return i(t.body)};const B_=["style","encode","labels","children"],F_=sE((t=>{const e=function(t){const e=(t=>{const e=t,n=e.length,r=new Array(Math.ceil(n/3));let i=0,a=0;function o(t){const r=a+1;a++;let i="",o=!1;for(;a<n;){const n=e.charCodeAt(a);if(n===t)return o||(i=e.substring(r,a)),a++,{type:x_.STRING,value:i};92===n?(o||(i=e.substring(r,a),o=!0),a++,i+=e[a]):o&&(i+=e[a]),a++}throw new b_(`Unterminated string starting with ${String.fromCharCode(t)}`,a,e.substring(Math.max(0,a-10),a))}function s(){const t=a;for(45===e.charCodeAt(a)&&a++;a<n&&A_(e.charCodeAt(a));)a++;if(a<n&&46===e.charCodeAt(a))for(a++;a<n&&A_(e.charCodeAt(a));)a++;const r=e.slice(t,a);return{type:x_.NUMBER,value:r}}function c(){a++;const t=a;if(a<n&&__(e.charCodeAt(a)))for(a++;a<n&&T_(e.charCodeAt(a));)a++;const r=e.slice(t,a);return{type:x_.FUNCTION,value:r}}function l(){const t=a++;for(;a<n&&T_(e.charCodeAt(a));)a++;const r=e.slice(t,a),i=E_.get(r);return i?{type:i,value:r}:{type:x_.IDENTIFIER,value:r}}function u(){if(a+2<n){const t=e.substring(a,a+3);if(M_.has(t))return a+=3,{type:x_.OPERATOR,value:t}}if(a+1<n){const t=e.substring(a,a+2);if(M_.has(t))return a+=2,{type:x_.OPERATOR,value:t}}const t=e[a];if(M_.has(t))return a++,{type:x_.OPERATOR,value:t};throw new b_(`Unknown operator at position ${a}: ${e.substring(a,a+1)}`,a,e.substring(Math.max(0,a-10),a))}for(;a<n;){const t=e.charCodeAt(a);if(f=t,w_.has(f)){a++;continue}const h=S_.get(t);if(h)r[i++]=h,a++;else if(34!==t&&39!==t)if(A_(t)||45===t&&a+1<n&&A_(e.charCodeAt(a+1)))r[i++]=s();else if(64!==t)if(__(t))r[i++]=l();else{if(!P_(t))throw new b_(`Unexpected character: ${e[a]}`,a,e.substring(Math.max(0,a-10),a));r[i++]=u()}else r[i++]=c();else r[i++]=o(t)}var f;return i===r.length?r:r.slice(0,i)})(t),n=I_(e),r=((t={},e={})=>({context:t,functions:e}))({},y_);return(t={})=>D_(n,r,t)}(t);return(...t)=>{const n=Array.from({length:t.length},((t,e)=>String.fromCharCode(97+e))),r=Object.fromEntries(t.map(((t,e)=>[n[e],t])));return e(Object.assign(Object.assign({},r),{global:Object.assign({},r)}))}}),(t=>t),128);function z_(t,e=!0){if(Array.isArray(t))return t.map(((n,r)=>z_(t[r],e)));if("object"==typeof t&&t)return function(t,e){void 0===e&&(e=nt);var n={};return w(t)&&!b(t)&&Object.keys(t).forEach((function(r){n[r]=e(t[r],r)})),n}(t,((t,n)=>e&&B_.includes(n)?z_(t,"children"===n):e?t:z_(t,!1)));if("string"==typeof t){const e=t.trim();if(e.startsWith("{")&&e.endsWith("}"))return F_(e.slice(1,-1))}return t}const G_=[["legendCategory",[[["color","discrete"],["opacity","discrete"],["shape","discrete"],["size","constant"]],[["color","discrete"],["opacity","constant"],["shape","discrete"],["size","constant"]],[["color","discrete"],["opacity","discrete"],["shape","constant"],["size","constant"]],[["color","discrete"],["opacity","constant"],["shape","constant"],["size","constant"]],[["color","constant"],["opacity","discrete"],["shape","discrete"],["size","constant"]],[["color","constant"],["opacity","constant"],["shape","discrete"],["size","constant"]],[["color","constant"],["opacity","discrete"],["shape","constant"],["size","constant"]],[["color","discrete"],["shape","discrete"],["size","constant"]],[["color","discrete"],["opacity","discrete"],["shape","discrete"]],[["color","discrete"],["opacity","discrete"],["size","constant"]],[["color","discrete"],["opacity","constant"],["shape","discrete"]],[["color","discrete"],["opacity","constant"],["size","constant"]],[["color","discrete"],["shape","constant"],["size","constant"]],[["color","discrete"],["opacity","discrete"],["shape","constant"]],[["color","discrete"],["opacity","constant"],["shape","constant"]],[["color","constant"],["shape","discrete"],["size","constant"]],[["color","constant"],["opacity","discrete"],["shape","discrete"]],[["color","constant"],["opacity","discrete"],["size","constant"]],[["color","constant"],["opacity","constant"],["shape","discrete"]],[["color","constant"],["opacity","discrete"],["shape","constant"]],[["color","discrete"],["shape","discrete"]],[["color","discrete"],["size","constant"]],[["color","discrete"],["opacity","discrete"]],[["color","discrete"],["opacity","constant"]],[["color","discrete"],["shape","constant"]],[["color","constant"],["shape","discrete"]],[["color","constant"],["size","constant"]],[["color","constant"],["opacity","discrete"]],[["color","discrete"]]]],["legendContinuousSize",[[["color","continuous"],["opacity","continuous"],["size","continuous"]],[["color","constant"],["opacity","continuous"],["size","continuous"]],[["color","continuous"],["size","continuous"]],[["color","constant"],["size","continuous"]],[["size","continuous"],["opacity","continuous"]],[["size","continuous"]]]],["legendContinuousBlockSize",[[["color","distribution"],["opacity","distribution"],["size","distribution"]],[["color","distribution"],["size","distribution"]]]],["legendContinuousBlock",[[["color","distribution"],["opacity","continuous"]],[["color","distribution"]]]],["legendContinuous",[[["color","continuous"],["opacity","continuous"]],[["color","continuous"]],[["opacity","continuous"]]]]];var W_={}.toString,$_=function(t,e){return W_.call(t)==="[object "+e+"]"},H_=function(t){return Array.isArray?Array.isArray(t):$_(t,"Array")},Y_=function(t){return"object"==typeof t&&null!==t},V_=function(t){if(!Y_(t)||!$_(t,"Object"))return!1;if(null===Object.getPrototypeOf(t))return!0;for(var e=t;null!==Object.getPrototypeOf(e);)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e};function U_(t,e,n,r){for(var i in n=n||0,r=r||5,e)if(e.hasOwnProperty(i)){var a=e[i];null!==a&&V_(a)?(V_(t[i])||(t[i]={}),n<r?U_(t[i],a,n+1,r):t[i]=e[i]):H_(a)?(t[i]=[],t[i]=t[i].concat(a)):void 0!==a&&(t[i]=a)}}var q_=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var r=0;r<e.length;r+=1)U_(t,e[r]);return t},X_=function(t){return t};function K_(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return t?e.reduce((function(t,e){return function(n){return e(t(n))}}),t):X_}function Z_(t){return t instanceof Float32Array||t instanceof Array}var Q_=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,a=n.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o},J_=window&&window.__spreadArray||function(t,e,n){if(n||2===arguments.length)for(var r,i=0,a=e.length;i<a;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))};function tT(t,e,n){for(;t<e;)t+=2*Math.PI;for(;t>n;)t-=2*Math.PI;return t}var eT=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,a=n.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o},nT=function(t,e,n,r,i){var a,o,s=eT(t,2),c=s[0],l=s[1],u=ht();return o=[c,l],(a=u)[0]=1,a[1]=0,a[2]=0,a[3]=0,a[4]=1,a[5]=0,a[6]=o[0],a[7]=o[1],a[8]=1,a},rT=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,a=n.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o},iT=function(t,e,n,r,i){var a=new ca({range:[e,e+r]}),o=new ca({range:[n,n+i]});return{transform:function(t){var e=rT(t,2),n=e[0],r=e[1];return[a.map(n),o.map(r)]},untransform:function(t){var e=rT(t,2),n=e[0],r=e[1];return[a.invert(n),o.invert(r)]}}},aT=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,a=n.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o},oT=function(t,e,n,r,i){return(0,aT(t,1)[0])(e,n,r,i)},sT=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,a=n.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o},cT=function(t,e,n,r,i){return sT(t,1)[0]},lT=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,a=n.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o},uT=function(t,e,n,r,i){var a=lT(t,4),o=a[0],s=a[1],c=a[2],l=a[3],u=new ca({range:[c,l]}),f=new ca({range:[o,s]}),h=i/r,d=h>1?1:h,p=h>1?1/h:1;return{transform:function(t){var e=lT(t,2),n=e[0],r=e[1],i=f.map(n),a=u.map(r);return[.5*(a*Math.cos(i)*d)+.5,.5*(a*Math.sin(i)*p)+.5]},untransform:function(t){var e=lT(t,2),n=e[0],r=e[1],i=2*(n-.5)/d,a=2*(r-.5)/p,c=Math.sqrt(Math.pow(i,2)+Math.pow(a,2)),l=tT(Math.atan2(a,i),o,s);return[f.invert(l),u.invert(c)]}}},fT=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,a=n.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o},hT=function(t,e,n,r,i){return{transform:function(t){var e=fT(t,2),n=e[0];return[e[1],n]},untransform:function(t){var e=fT(t,2),n=e[0];return[e[1],n]}}},dT=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,a=n.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o},pT=function(t,e,n,r,i){var a,o,s=dT(t,2),c=s[0],l=s[1],u=ht();return o=[c,l],(a=u)[0]=o[0],a[1]=0,a[2]=0,a[3]=0,a[4]=o[1],a[5]=0,a[6]=0,a[7]=0,a[8]=1,a},gT=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,a=n.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o},vT=window&&window.__spreadArray||function(t,e,n){if(n||2===arguments.length)for(var r,i=0,a=e.length;i<a;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))},mT=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return pT.apply(void 0,vT([[-1,-1]],gT(e),!1))},yT=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return pT.apply(void 0,vT([[-1,1]],gT(e),!1))},bT=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return pT.apply(void 0,vT([[1,-1]],gT(e),!1))},xT=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,a=n.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o},wT=function(t,e,n,r,i){var a=xT(t,1)[0];return function(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=n,t[2]=0,t[3]=-n,t[4]=r,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}(ht(),a)},kT=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,a=n.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o},ET=function(t,e,n,r,i){var a=kT(t,4),o=a[0],s=a[1],c=a[2],l=(a[3]-c)/((s-0)/(2*Math.PI)+1),u=l/(2*Math.PI),f=new ca({range:[c,c+.99*l]}),h=new ca({range:[o,s]}),d=i/r,p=d>1?1:d,g=d>1?1/d:1;return{transform:function(t){var e=kT(t,2),n=e[0],r=e[1],i=h.map(n),a=f.map(r);return[.5*(Math.cos(i)*(u*i+a)*p)+.5,.5*(Math.sin(i)*(u*i+a)*g)+.5]},untransform:function(t){var e=kT(t,2),n=e[0],r=e[1],i=2*(n-.5)/p,a=2*(r-.5)/g,c=Math.sqrt(Math.pow(i,2)+Math.pow(a,2)),d=tT(Math.atan2(a,i)+Math.floor(c/l)*Math.PI*2,o,s),v=c-u*d;return[h.invert(d),f.invert(v)]}}},MT=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,a=n.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o},OT=function(t,e,n,r,i){var a=MT(t,4),o=a[0],s=a[1],c=a[2],l=a[3],u=new ca({range:[c,l]});return{transform:function(t){for(var e=[],n=t.length,r=new la({domain:new Array(n).fill(0).map((function(t,e){return e})),range:[o,s]}),i=0;i<n;i++){var a=t[i],c=r.map(i),l=u.map(a);e.push(c,l)}return e},untransform:function(t){for(var e=[],n=0;n<t.length;n+=2){var r=t[n+1];e.push(u.invert(r))}return e}}},ST=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,a=n.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o};function AT(t){return 1/Math.tan(t)}var _T=function(t,e,n,r,i){var a=AT(ST(t,1)[0]);return{transform:function(t){var e=ST(t,2),n=e[0],r=e[1];return[n+r*a,r]},untransform:function(t){var e=ST(t,2),n=e[0],r=e[1];return[n-r*a,r]}}},TT=function(t,e,n,r,i){var a=AT(ST(t,1)[0]);return{transform:function(t){var e=ST(t,2),n=e[0];return[n,e[1]+n*a]},untransform:function(t){var e=ST(t,2),n=e[0];return[n,e[1]-n*a]}}},PT=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,a=n.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o};function CT(t,e,n,r,i){var a=t<e,o=(a?e-r:i-e)||i-r,s=a?-1:1;return s*o*(n+1)/(n+o/((t-e)*s))+e}function NT(t,e,n,r,i){var a=t<e,o=(a?e-r:i-e)||i-r;return o/(o*(n+1)/(t-e)-n*(a?-1:1))+e}function LT(t,e,n){return n?new ca({range:[0,1],domain:[0,e]}).map(t):t}var jT=function(t,e,n,r,i){var a=PT(t,3),o=a[0],s=a[1],c=a[2],l=LT(o,r,void 0!==c&&c);return{transform:function(t){var e=PT(t,2),n=e[0],r=e[1];return[CT(n,l,s,0,1),r]},untransform:function(t){var e=PT(t,2),n=e[0],r=e[1];return[NT(n,l,s,0,1),r]}}},RT=function(t,e,n,r,i){var a=PT(t,3),o=a[0],s=a[1],c=a[2],l=LT(o,i,void 0!==c&&c);return{transform:function(t){var e=PT(t,2);return[e[0],CT(e[1],l,s,0,1)]},untransform:function(t){var e=PT(t,2);return[e[0],NT(e[1],l,s,0,1)]}}},IT=function(t,e,n,r,i){var a=PT(t,5),o=a[0],s=a[1],c=a[2],l=a[3],u=a[4],f=void 0!==u&&u,h=LT(o,r,f),d=LT(s,i,f);return{transform:function(t){var e=PT(t,2),n=e[0],r=e[1];return[CT(n,h,c,0,1),CT(r,d,l,0,1)]},untransform:function(t){var e=PT(t,2),n=e[0],r=e[1];return[NT(n,h,c,0,1),NT(r,d,l,0,1)]}}},DT=function(t,e,n,r,i){var a=PT(t,5),o=a[0],s=a[1],c=a[2],l=a[3],u=a[4],f=void 0!==u&&u,h=new ca({range:[0,r]}),d=new ca({range:[0,i]}),p=f?o:h.map(o),g=f?s:d.map(s);return{transform:function(t){var e=PT(t,2),n=e[0],r=e[1],i=h.map(n)-p,a=d.map(r)-g,o=Math.sqrt(i*i+a*a);if(o>c)return[n,r];var s=CT(o,0,l,0,c),u=Math.atan2(a,i),f=p+s*Math.cos(u),v=g+s*Math.sin(u);return[h.invert(f),d.invert(v)]},untransform:function(t){var e=PT(t,2),n=e[0],r=e[1],i=h.map(n)-p,a=d.map(r)-g,o=Math.sqrt(i*i+a*a);if(o>c)return[n,r];var s=NT(o,0,l,0,c),u=Math.atan2(a,i),f=p+s*Math.cos(u),v=g+s*Math.sin(u);return[h.invert(f),d.invert(v)]}}},BT=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,a=n.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o},FT=function(t,e,n,r,i,a,o){var s=new ca({range:[e,e+i]}),c=new ca({range:[n,n+a]}),l=new ca({range:[r,r+o]});return{transform:function(t){var e=BT(t,3),n=e[0],r=e[1],i=e[2];return[s.map(n),c.map(r),l.map(i)]},untransform:function(t){var e=BT(t,3),n=e[0],r=e[1],i=e[2];return[s.invert(n),c.invert(r),l.invert(i)]}}},zT=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,a=n.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o},GT=function(t,e,n,r,i,a,o){var s=zT(t,3),c=s[0],l=s[1],u=s[2];return _t(pt(),[c,l,u])},WT=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,a=n.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o},$T=function(t,e,n,r,i,a,o){return{transform:function(t){var e=WT(t,3),n=e[0];return[e[1],n,e[2]]},untransform:function(t){var e=WT(t,3),n=e[0];return[e[1],n,e[2]]}}},HT=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,a=n.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o},YT=function(t,e,n,r,i,a,o){var s=HT(t,3),c=s[0],l=s[1],u=s[2];return Tt(pt(),[c,l,u])},VT=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,a=n.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o},UT=window&&window.__spreadArray||function(t,e,n){if(n||2===arguments.length)for(var r,i=0,a=e.length;i<a;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))},qT=window&&window.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},XT=function(){function t(t){this.options={x:0,y:0,width:300,height:150,transformations:[]},this.transformers={cartesian:iT,translate:nT,custom:oT,matrix:cT,polar:uT,transpose:hT,scale:pT,"shear.x":_T,"shear.y":TT,reflect:mT,"reflect.x":yT,"reflect.y":bT,rotate:wT,helix:ET,parallel:OT,fisheye:IT,"fisheye.x":jT,"fisheye.y":RT,"fisheye.circular":DT},this.update(t)}return t.prototype.update=function(t){this.options=q_({},this.options,t),this.recoordinate()},t.prototype.clone=function(){return new t(this.options)},t.prototype.getOptions=function(){return this.options},t.prototype.clear=function(){this.update({transformations:[]})},t.prototype.getSize=function(){var t=this.options;return[t.width,t.height]},t.prototype.getCenter=function(){var t=this.options,e=t.x,n=t.y;return[(2*e+t.width)/2,(2*n+t.height)/2]},t.prototype.transform=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=this.options.transformations;return this.update({transformations:UT(UT([],VT(n),!1),[UT([],VT(t),!1)],!1)}),this},t.prototype.map=function(t){return this.output(t)},t.prototype.invert=function(t){return this.input(t)},t.prototype.recoordinate=function(){this.output=this.compose(),this.input=this.compose(!0)},t.prototype.compose=function(t){var e,n;void 0===t&&(t=!1);var r=t?UT([],VT(this.options.transformations),!1).reverse():this.options.transformations,i=t?function(t){return t.untransform}:function(t){return t.transform},a=[],o=[],s=function(t,e){return void 0===e&&(e=!0),o.push(e?function(t){return function(e){for(var n=[],r=0;r<e.length-1;r+=2){var i=[e[r],e[r+1]],a=t(i);n.push.apply(n,J_([],Q_(a),!1))}return n}}(t):t)};try{for(var c=qT(r),l=c.next();!l.done;l=c.next()){var u=VT(l.value),f=u[0],h=u.slice(1),d=this.transformers[f];if(d){var p=this.options,g=p.x,v=p.y,m=p.width,y=p.height,b=d(UT([],VT(h),!1),g,v,m,y);if(Z_(b))a.push(b);else{if(a.length)s(this.createMatrixTransform(a,t)),a.splice(0,a.length);s(i(b)||X_,"parallel"!==f)}}}}catch(t){e={error:t}}finally{try{l&&!l.done&&(n=c.return)&&n.call(c)}finally{if(e)throw e.error}}a.length&&s(this.createMatrixTransform(a,t));return K_.apply(void 0,UT([],VT(o),!1))},t.prototype.createMatrixTransform=function(t,e){var n=ht();return e&&t.reverse(),t.forEach((function(t){return dt(n,n,t)})),e&&function(t,e){var n=e[0],r=e[1],i=e[2],a=e[3],o=e[4],s=e[5],c=e[6],l=e[7],u=e[8],f=u*o-s*l,h=-u*a+s*c,d=l*a-o*c,p=n*f+r*h+i*d;p&&(p=1/p,t[0]=f*p,t[1]=(-u*r+i*l)*p,t[2]=(s*r-i*o)*p,t[3]=h*p,t[4]=(u*n-i*c)*p,t[5]=(-s*n+i*a)*p,t[6]=d*p,t[7]=(-l*n+r*c)*p,t[8]=(o*n-r*a)*p)}(n,function(t){var e=new ft(9);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}(n)),function(t){var e=[t[0],t[1],1];return fe(e,e,n),[e[0],e[1]]}},t}(),KT=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,a=n.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o},ZT=window&&window.__spreadArray||function(t,e,n){if(n||2===arguments.length)for(var r,i=0,a=e.length;i<a;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))},QT=window&&window.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},JT=function(){function t(t){this.options={x:0,y:0,z:0,width:300,height:150,depth:150,transformations:[]},this.transformers={cartesian3D:FT,translate3D:GT,scale3D:YT,transpose3D:$T},this.update(t)}return t.prototype.update=function(t){this.options=q_({},this.options,t),this.recoordinate()},t.prototype.clone=function(){return new t(this.options)},t.prototype.getOptions=function(){return this.options},t.prototype.clear=function(){this.update({transformations:[]})},t.prototype.getSize=function(){var t=this.options;return[t.width,t.height,t.depth]},t.prototype.getCenter=function(){var t=this.options,e=t.x,n=t.y,r=t.z;return[(2*e+t.width)/2,(2*n+t.height)/2,(2*r+t.depth)/2]},t.prototype.transform=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=this.options.transformations;return this.update({transformations:ZT(ZT([],KT(n),!1),[ZT([],KT(t),!1)],!1)}),this},t.prototype.map=function(t){return this.output(t)},t.prototype.invert=function(t){return this.input(t)},t.prototype.recoordinate=function(){this.output=this.compose(),this.input=this.compose(!0)},t.prototype.compose=function(t){var e,n;void 0===t&&(t=!1);var r=t?ZT([],KT(this.options.transformations),!1).reverse():this.options.transformations,i=t?function(t){return t.untransform}:function(t){return t.transform},a=[],o=[],s=function(t,e){return void 0===e&&(e=!0),o.push(e?function(t){return function(e){for(var n=[],r=0;r<e.length-1;r+=3){var i=[e[r],e[r+1],e[r+2]],a=t(i);n.push.apply(n,J_([],Q_(a),!1))}return n}}(t):t)};try{for(var c=QT(r),l=c.next();!l.done;l=c.next()){var u=KT(l.value),f=u[0],h=u.slice(1),d=this.transformers[f];if(d){var p=this.options,g=p.x,v=p.y,m=p.z,y=p.width,b=p.height,x=p.depth,w=d(ZT([],KT(h),!1),g,v,m,y,b,x);if(Z_(w))a.push(w);else{if(a.length)s(this.createMatrixTransform(a,t)),a.splice(0,a.length);s(i(w)||X_,!0)}}}}catch(t){e={error:t}}finally{try{l&&!l.done&&(n=c.return)&&n.call(c)}finally{if(e)throw e.error}}a.length&&s(this.createMatrixTransform(a,t));return K_.apply(void 0,ZT([],KT(o),!1))},t.prototype.createMatrixTransform=function(t,e){var n=pt();return e&&t.reverse(),t.forEach((function(t){return qt(n,n,t)})),e&&wt(n,gt(n)),function(t){var e=[t[0],t[1],t[2],1];return ye(e,e,n),[e[0],e[1],e[2]]}},t}();function tP(t){return(e,...n)=>Q({},t(e,...n),e)}function eP(t){return(e,...n)=>Q({},e,t(e,...n))}function nP(t,e){if(!t)return e;if(Array.isArray(t))return t;if(function(t){return!(t instanceof Date)&&"object"==typeof t}(t)){const{value:n=e}=t,r=Le(t,["value"]);return Object.assign(Object.assign({},r),{value:n})}return t}const rP=()=>t=>{const{children:e}=t;if(!Array.isArray(e))return[];const{x:n=0,y:r=0,width:i,height:a,data:o}=t;return e.map((t=>{var{data:e,x:s,y:c,width:l,height:u}=t,f=Le(t,["data","x","y","width","height"]);return Object.assign(Object.assign({},f),{data:nP(e,o),x:null!=s?s:n,y:null!=c?c:r,width:null!=l?l:i,height:null!=u?u:a})}))};rP.props={};const iP=()=>t=>{const{children:e}=t;if(!Array.isArray(e))return[];const{direction:n="row",ratio:r=e.map((()=>1)),padding:i=0,data:a}=t,[o,s,c,l]="col"===n?["y","height","width","x"]:["x","width","height","y"],u=r.reduce(((t,e)=>t+e)),f=t[s]-i*(e.length-1),h=r.map((t=>f*(t/u))),d=[];let p=t[o]||0;for(let n=0;n<h.length;n+=1){const r=e[n],{data:u}=r,f=Le(r,["data"]),g=nP(u,a);d.push(Object.assign({[o]:p,[s]:h[n],[l]:t[l]||0,[c]:t[c],data:g},f)),p+=h[n]+i}return d};iP.props={};const aP=()=>t=>{const{children:e}=t,n=Le(t,["children"]);if(!Array.isArray(e))return[];const{data:r,scale:i={},axis:a={},legend:o={},encode:s={},transform:c=[]}=n,l=Le(n,["data","scale","axis","legend","encode","transform"]),u=e.map((t=>{var{data:e,scale:n={},axis:l={},legend:u={},encode:f={},transform:h=[]}=t,d=Le(t,["data","scale","axis","legend","encode","transform"]);return Object.assign({data:nP(e,r),scale:Q({},i,n),encode:Q({},s,f),transform:[...c,...h],axis:!(!l||!a)&&Q({},a,l),legend:!(!u||!o)&&Q({},o,u)},d)}));return[Object.assign(Object.assign({},l),{marks:u,type:"standardView"})]};aP.props={};const oP=({static:t=!1}={})=>e=>{const{width:n,height:r,depth:i,paddingLeft:a,paddingRight:o,paddingTop:s,paddingBottom:c,padding:l,inset:u,insetLeft:f,insetTop:h,insetRight:d,insetBottom:p,margin:g,marginLeft:v,marginBottom:m,marginTop:y,marginRight:b,data:x,coordinate:w,theme:k,component:E,interaction:M,x:O,y:S,z:A,key:_,frame:T,labelTransform:P,parentKey:C,clip:N,viewStyle:L,title:j}=e,R=Le(e,["width","height","depth","paddingLeft","paddingRight","paddingTop","paddingBottom","padding","inset","insetLeft","insetTop","insetRight","insetBottom","margin","marginLeft","marginBottom","marginTop","marginRight","data","coordinate","theme","component","interaction","x","y","z","key","frame","labelTransform","parentKey","clip","viewStyle","title"]);return[Object.assign(Object.assign({type:"standardView",x:O,y:S,z:A,key:_,width:n,height:r,depth:i,padding:l,paddingLeft:a,paddingRight:o,paddingTop:s,inset:u,insetLeft:f,insetTop:h,insetRight:d,insetBottom:p,paddingBottom:c,theme:k,coordinate:w,component:E,interaction:M,frame:T,labelTransform:P,margin:g,marginLeft:v,marginBottom:m,marginTop:y,marginRight:b,parentKey:C,clip:N,style:L},!t&&{title:j}),{marks:[Object.assign(Object.assign(Object.assign({},R),{key:`${_}-0`,data:x}),t&&{title:j})]})]};oP.props={};class sP{constructor(t){this.$value=t}static of(t){return new sP(t)}call(t,...e){return this.$value=t(this.$value,...e),this}value(){return this.$value}}const cP=tP((t=>{const{encode:e,data:n,scale:r,shareSize:i=!1}=t,{x:a,y:o}=e,s=(t,e)=>{var a;if(void 0===t||!i)return{};const o=Qn(n,(e=>e[t])),s=(null===(a=null==r?void 0:r[e])||void 0===a?void 0:a.domain)||Array.from(o.keys()),c=s.map((t=>o.has(t)?o.get(t).length:1));return{domain:s,flex:c}};return{scale:{x:Object.assign(Object.assign({paddingOuter:0,paddingInner:.1,guide:void 0===a?null:{position:"top"}},void 0===a&&{paddingInner:0}),s(a,"x")),y:Object.assign(Object.assign({range:[0,1],paddingOuter:0,paddingInner:.1,guide:void 0===o?null:{position:"right"}},void 0===o&&{paddingInner:0}),s(o,"y"))}}})),lP=eP((t=>{const{data:e,scale:n,legend:r}=t,i=[t];let a,o,s;for(;i.length;){const t=i.shift(),{children:e,encode:n={},scale:r={},legend:c={}}=t,{color:l}=n,{color:u}=r,{color:f}=c;void 0!==l&&(a=l),void 0!==u&&(o=u),void 0!==f&&(s=f),Array.isArray(e)&&i.push(...e)}const c="string"==typeof a?a:"",[l,u]=(()=>{var t;const r=null===(t=null==n?void 0:n.color)||void 0===t?void 0:t.domain;if(void 0!==r)return[r];if(void 0===a)return[void 0];const i="function"==typeof a?a:t=>t[a],o=e.map(i);return o.some((t=>"number"==typeof t))?[Un(o)]:[Array.from(new Set(o)),"ordinal"]})();return Object.assign({encode:{color:{type:"column",value:null!=l?l:[]}},scale:{color:Q({},o,{domain:l,type:u})}},void 0===r&&{legend:{color:Q({title:c},s)}})})),uP=tP((()=>({animate:{enterType:"fadeIn"}}))),fP=eP((()=>({frame:!1,encode:{shape:"hollow"},style:{lineWidth:0}}))),hP=eP((()=>({type:"cell"}))),dP=eP((t=>{const{data:e}=t,n={type:"custom",callback:()=>{const{data:e,encode:n}=t,{x:r,y:i}=n,a=r?Array.from(new Set(e.map((t=>t[r])))):[],o=i?Array.from(new Set(e.map((t=>t[i])))):[];return(()=>{if(a.length&&o.length){const t=[];for(const e of a)for(const n of o)t.push({[r]:e,[i]:n});return t}return a.length?a.map((t=>({[r]:t}))):o.length?o.map((t=>({[i]:t}))):void 0})()}};return{data:{type:"inline",value:e,transform:[n]}}})),pP=eP(((t,e=gP,n=mP,r=yP,i={})=>{const{data:a,encode:o,children:s,scale:c,x:l=0,y:u=0,shareData:f=!1,key:h}=t,{value:d}=a,{x:p,y:g}=o,{color:v}=c,{domain:m}=v;return{children:(t,a,o)=>{const{x:c,y:v}=a,{paddingLeft:y,paddingTop:b,marginLeft:x,marginTop:w}=o,{domain:k}=c.getOptions(),{domain:E}=v.getOptions(),M=to(t),O=t.map(e),S=t.map((({x:t,y:e})=>[c.invert(t),v.invert(e)])),A=S.map((([t,e])=>n=>{const{[p]:r,[g]:i}=n;return(void 0===p||r===t)&&(void 0===g||i===e)})),_=A.map((t=>d.filter(t))),T=f?gr(_,(t=>t.length)):void 0,P=S.map((([t,e])=>({columnField:p,columnIndex:k.indexOf(t),columnValue:t,columnValuesLength:k.length,rowField:g,rowIndex:E.indexOf(e),rowValue:e,rowValuesLength:E.length}))),C=P.map((t=>Array.isArray(s)?s:[s(t)].flat(1)));return M.flatMap((t=>{const[e,a,o,s]=O[t],c=P[t],f=_[t];return C[t].map((v=>{var k,E,{scale:M,key:O,facet:S=!0,axis:A={},legend:_={}}=v,P=Le(v,["scale","key","facet","axis","legend"]);const C=(null===(k=null==M?void 0:M.y)||void 0===k?void 0:k.guide)||A.y,N=(null===(E=null==M?void 0:M.x)||void 0===E?void 0:E.guide)||A.x,L={x:{tickCount:p?5:void 0},y:{tickCount:g?5:void 0}},j=S?f:0===f.length?[]:d,R={color:{domain:m}},I={x:bP(N,n)(c,j),y:bP(C,r)(c,j)};return Object.assign(Object.assign({key:`${O}-${t}`,data:j,margin:0,x:e+y+l+x,y:a+b+u+w,parentKey:h,width:o,height:s,paddingLeft:0,paddingRight:0,paddingTop:0,paddingBottom:0,frame:!!j.length,dataDomain:T,scale:Q(L,M,R),axis:Q({},A,I),legend:!1},P),i)}))}))}}}));function gP(t){const{points:e}=t;return As(e)}function vP(t,e){return e.length?Q({title:!1,tick:null,label:null},t):Q({title:!1,tick:null,label:null,grid:null},t)}function mP(t){return(e,n)=>{const{rowIndex:r,rowValuesLength:i,columnIndex:a,columnValuesLength:o}=e;if(r!==i-1)return vP(t,n);const s=a===o-1&&void 0,c=n.length?void 0:null;return Q({title:s,grid:c},t)}}function yP(t){return(e,n)=>{const{rowIndex:r,columnIndex:i}=e;if(0!==i)return vP(t,n);const a=0===r&&void 0,o=n.length?void 0:null;return Q({title:a,grid:o},t)}}function bP(t,e){return"function"==typeof t?t:null===t||!1===t?()=>null:e(t)}const xP=()=>t=>[sP.of(t).call(hP).call(lP).call(uP).call(cP).call(fP).call(dP).call(pP).value()];xP.props={};const wP=tP((t=>({scale:{x:{guide:null,paddingOuter:0,paddingInner:.1},y:{guide:null,range:[0,1],paddingOuter:0,paddingInner:.1}}}))),kP=eP((t=>{const{data:e,children:n,x:r=0,y:i=0,key:a}=t;return{children:(t,o,s)=>{const{x:c,y:l}=o,{paddingLeft:u,paddingTop:f,marginLeft:h,marginTop:d}=s,{domain:p}=c.getOptions(),{domain:g}=l.getOptions(),v=to(t),m=t.map((({points:t})=>As(t))),y=t.map((({x:t,y:e})=>[c.invert(t),l.invert(e)])),b=y.map((([t,e])=>({columnField:t,columnIndex:p.indexOf(t),columnValue:t,columnValuesLength:p.length,rowField:e,rowIndex:g.indexOf(e),rowValue:e,rowValuesLength:g.length}))),x=b.map((t=>Array.isArray(n)?n:[n(t)].flat(1)));return v.flatMap((t=>{const[n,o,s,c]=m[t],[l,p]=y[t],g=b[t];return x[t].map((v=>{var m,y;const{scale:b,key:x,encode:w,axis:k,interaction:E}=v,M=Le(v,["scale","key","encode","axis","interaction"]),O=null===(m=null==b?void 0:b.y)||void 0===m?void 0:m.guide,S={x:MP(null===(y=null==b?void 0:b.x)||void 0===y?void 0:y.guide)(g,e),y:OP(O)(g,e)};return Object.assign({data:e,parentKey:a,key:`${x}-${t}`,x:n+u+r+h,y:o+f+i+d,width:s,height:c,margin:0,paddingLeft:0,paddingRight:0,paddingTop:0,paddingBottom:0,frame:!0,scale:Q({x:{facet:!1},y:{facet:!1}},b),axis:Q({x:{tickCount:5},y:{tickCount:5}},k,S),legend:!1,encode:Q({},w,{x:l,y:p}),interaction:Q({},E,{legendFilter:!1})},M)}))}))}}})),EP=eP((t=>{const{encode:e}=t,n=Le(t,["encode"]),{position:r=[],x:i=r,y:a=[...r].reverse()}=e,o=Le(e,["position","x","y"]),s=[];for(const t of[i].flat(1))for(const e of[a].flat(1))s.push({$x:t,$y:e});return Object.assign(Object.assign({},n),{data:s,encode:Object.assign(Object.assign({},o),{x:"$x",y:"$y"}),scale:Object.assign(Object.assign({},1===[i].flat(1).length&&{x:{paddingInner:0}}),1===[a].flat(1).length&&{y:{paddingInner:0}})})}));function MP(t){return"function"==typeof t?t:null===t?()=>null:(e,n)=>{const{rowIndex:r,rowValuesLength:i}=e;if(r!==i-1)return vP(t,n)}}function OP(t){return"function"==typeof t?t:null===t?()=>null:(e,n)=>{const{columnIndex:r}=e;if(0!==r)return vP(t,n)}}const SP=()=>t=>[sP.of(t).call(hP).call(lP).call(kP).call(EP).call(uP).call(fP).call(wP).value()],AP=tP((t=>({scale:{x:{guide:{type:"axisArc"},paddingOuter:0,paddingInner:.1},y:{guide:null,range:[0,1],paddingOuter:0,paddingInner:.1}}}))),_P=tP((t=>({coordinate:{type:"polar"}}))),TP=t=>{const{encode:e}=t,n=Le(t,["encode"]),{position:r}=e;return Object.assign(Object.assign({},n),{encode:{x:r}})};function PP(t){return t=>null}function CP(t){const{points:e}=t,[n,r,i,a]=e,o=Es(n,a),s=ws(n,a),c=Ss(s,ws(r,i)),l=1/Math.sin(c/2),u=o/(1+l),f=u*Math.sqrt(2),[h,d]=i,p=Os(s)+c/2,g=u*l;return[h+g*Math.sin(p)-f/2,d-g*Math.cos(p)-f/2,f,f]}const NP=()=>t=>[sP.of(t).call(hP).call(TP).call(lP).call(_P).call(dP).call(pP,CP,PP,PP,{frame:!1}).call(uP).call(fP).call(AP).value()];function LP(t,e,n){const r=[0,n],i=[1-n,1];return"normal"===t?r:"reverse"===t?i:"alternate"===t?e%2==0?r:i:"reverse-alternate"===t?e%2==0?i:r:void 0}const jP=()=>t=>{const{children:e=[],duration:n=1e3,iterationCount:r=1,direction:i="normal",easing:a="ease-in-out-sine"}=t,o=e.length;if(!Array.isArray(e)||0===o)return[];const{key:s}=e[0],c=e.map((t=>Object.assign(Object.assign({},t),{key:s}))).map((t=>function(t,e,n){const r=[t];for(;r.length;){const t=r.pop();t.animate=Q({enter:{duration:e},update:{duration:e,easing:n,type:"morphing",fill:"both"},exit:{type:"fadeOut",duration:e}},t.animate||{});const{children:i}=t;Array.isArray(i)&&r.push(...i)}return t}(t,n,a)));return function*(){let t,e=0;for(;"infinite"===r||e<r;){const[n,r]=LP(i,e,o);for(let e=n;e<r;e+=1){const n=Math.abs(e);t!==n&&(yield c[n]),t=n}e++}}};function RP(t,e,n,r=t=>!0){return i=>{if(!r(i))return;n.emit(`plot:${t}`,i);const{target:a}=i;if(!a)return;const{className:o}=a;if("plot"===o)return;const s=zR(a,(t=>"element"===t.className));const c=function(t){return zR(t,(t=>"component"===t.className))}(a),l=function(t){return zR(t,(t=>"label"===t.className))}(a),u=s||c||l;if(!u)return;const{className:f,markType:h}=u,d=Object.assign(Object.assign({},i),{nativeEvent:!0});"element"===f?(d.data={data:Da(u,e)},n.emit(`element:${t}`,d),n.emit(`${h}:${t}`,d)):"label"===f?(d.data={data:u.attributes.datum},n.emit(`label:${t}`,d),n.emit(`${o}:${t}`,d)):(n.emit(`component:${t}`,d),n.emit(`${o}:${t}`,d))}}function IP(){return(t,e,n)=>{const{container:r,view:i}=t,a=RP(m_.CLICK,i,n,(t=>1===t.detail)),o=RP(m_.DBLCLICK,i,n,(t=>2===t.detail)),s=RP(m_.POINTER_TAP,i,n),c=RP(m_.POINTER_DOWN,i,n),l=RP(m_.POINTER_UP,i,n),u=RP(m_.POINTER_OVER,i,n),f=RP(m_.POINTER_OUT,i,n),h=RP(m_.POINTER_MOVE,i,n),d=RP(m_.POINTER_ENTER,i,n),p=RP(m_.POINTER_LEAVE,i,n),g=RP(m_.POINTER_UPOUTSIDE,i,n),v=RP(m_.DRAG_START,i,n),m=RP(m_.DRAG,i,n),y=RP(m_.DRAG_END,i,n),b=RP(m_.DRAG_ENTER,i,n),x=RP(m_.DRAG_LEAVE,i,n),w=RP(m_.DRAG_OVER,i,n),k=RP(m_.DROP,i,n);return r.addEventListener("click",a),r.addEventListener("click",o),r.addEventListener("pointertap",s),r.addEventListener("pointerdown",c),r.addEventListener("pointerup",l),r.addEventListener("pointerover",u),r.addEventListener("pointerout",f),r.addEventListener("pointermove",h),r.addEventListener("pointerenter",d),r.addEventListener("pointerleave",p),r.addEventListener("pointerupoutside",g),r.addEventListener("dragstart",v),r.addEventListener("drag",m),r.addEventListener("dragend",y),r.addEventListener("dragenter",b),r.addEventListener("dragleave",x),r.addEventListener("dragover",w),r.addEventListener("drop",k),()=>{r.removeEventListener("click",a),r.removeEventListener("click",o),r.removeEventListener("pointertap",s),r.removeEventListener("pointerdown",c),r.removeEventListener("pointerup",l),r.removeEventListener("pointerover",u),r.removeEventListener("pointerout",f),r.removeEventListener("pointermove",h),r.removeEventListener("pointerenter",d),r.removeEventListener("pointerleave",p),r.removeEventListener("pointerupoutside",g),r.removeEventListener("dragstart",v),r.removeEventListener("drag",m),r.removeEventListener("dragend",y),r.removeEventListener("dragenter",b),r.removeEventListener("dragleave",x),r.removeEventListener("dragover",w),r.removeEventListener("drop",k)}}}function DP(t,e){const n=Object.assign(Object.assign({},{"component.axisRadar":HO,"component.axisLinear":FO,"component.axisArc":zO,"component.legendContinuousBlock":tS,"component.legendContinuousBlockSize":nS,"component.legendContinuousSize":eS,"interaction.event":IP,"composition.mark":oP,"composition.view":aP,"shape.label.label":eE}),e),r=e=>{if("string"!=typeof e)return e;const r=`${t}.${e}`;return n[r]||Wa(`Unknown Component: ${r}`)};return[(t,e)=>{const{type:n}=t,i=Le(t,["type"]);n||Wa("Plot type is required!");const a=r(n);return null==a?void 0:a(i,e)},r]}function BP(t){const{canvas:e,group:n}=t;return(null==e?void 0:e.document)||(null==n?void 0:n.ownerDocument)||Wa("Cannot find library document")}function FP(t,e){const{coordinate:n={},coordinates:r}=t,i=Le(t,["coordinate","coordinates"]);if(r)return t;const{type:a,transform:o=[]}=n,s=Le(n,["type","transform"]);if(!a)return Object.assign(Object.assign({},i),{coordinates:o});const[,c]=DP("coordinate",e),{transform:l=!1}=c(a).props||{};if(l)throw new Error(`Unknown coordinate: ${a}.`);return Object.assign(Object.assign({},i),{coordinates:[Object.assign({type:a},s),...o]})}function zP(t,e){return t.filter((t=>t.type===e))}function GP(t){return zP(t,"polar").length>0}function WP(t){return zP(t,"transpose").length%2==1}function $P(t){return zP(t,"theta").length>0}function HP(t){return zP(t,"radial").length>0}function YP(t){return zP(t,"radar").length>0}function VP(t){for(var e=t.length/6|0,n=new Array(e),r=0;r<e;)n[r]="#"+t.slice(6*r,6*++r);return n}jP.props={},IP.props={reapplyWhenUpdate:!0};var UP=VP("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf"),qP=VP("7fc97fbeaed4fdc086ffff99386cb0f0027fbf5b17666666"),XP=VP("1b9e77d95f027570b3e7298a66a61ee6ab02a6761d666666"),KP=VP("4269d0efb118ff725c6cc5b03ca951ff8ab7a463f297bbf59c6b4e9498a0"),ZP=VP("a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928"),QP=VP("fbb4aeb3cde3ccebc5decbe4fed9a6ffffcce5d8bdfddaecf2f2f2"),JP=VP("b3e2cdfdcdaccbd5e8f4cae4e6f5c9fff2aef1e2cccccccc"),tC=VP("e41a1c377eb84daf4a984ea3ff7f00ffff33a65628f781bf999999"),eC=VP("66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3"),nC=VP("8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f"),rC=VP("4e79a7f28e2ce1575976b7b259a14fedc949af7aa1ff9da79c755fbab0ab");function iC(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function aC(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function oC(){}var sC=.7,cC=1/sC,lC="\\s*([+-]?\\d+)\\s*",uC="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",fC="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",hC=/^#([0-9a-f]{3,8})$/,dC=new RegExp(`^rgb\\(${lC},${lC},${lC}\\)$`),pC=new RegExp(`^rgb\\(${fC},${fC},${fC}\\)$`),gC=new RegExp(`^rgba\\(${lC},${lC},${lC},${uC}\\)$`),vC=new RegExp(`^rgba\\(${fC},${fC},${fC},${uC}\\)$`),mC=new RegExp(`^hsl\\(${uC},${fC},${fC}\\)$`),yC=new RegExp(`^hsla\\(${uC},${fC},${fC},${uC}\\)$`),bC={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function xC(){return this.rgb().formatHex()}function wC(){return this.rgb().formatRgb()}function kC(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=hC.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?EC(e):3===n?new AC(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?MC(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?MC(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=dC.exec(t))?new AC(e[1],e[2],e[3],1):(e=pC.exec(t))?new AC(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=gC.exec(t))?MC(e[1],e[2],e[3],e[4]):(e=vC.exec(t))?MC(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=mC.exec(t))?LC(e[1],e[2]/100,e[3]/100,1):(e=yC.exec(t))?LC(e[1],e[2]/100,e[3]/100,e[4]):bC.hasOwnProperty(t)?EC(bC[t]):"transparent"===t?new AC(NaN,NaN,NaN,0):null}function EC(t){return new AC(t>>16&255,t>>8&255,255&t,1)}function MC(t,e,n,r){return r<=0&&(t=e=n=NaN),new AC(t,e,n,r)}function OC(t){return t instanceof oC||(t=kC(t)),t?new AC((t=t.rgb()).r,t.g,t.b,t.opacity):new AC}function SC(t,e,n,r){return 1===arguments.length?OC(t):new AC(t,e,n,null==r?1:r)}function AC(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function _C(){return`#${NC(this.r)}${NC(this.g)}${NC(this.b)}`}function TC(){const t=PC(this.opacity);return`${1===t?"rgb(":"rgba("}${CC(this.r)}, ${CC(this.g)}, ${CC(this.b)}${1===t?")":`, ${t})`}`}function PC(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function CC(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function NC(t){return((t=CC(t))<16?"0":"")+t.toString(16)}function LC(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new RC(t,e,n,r)}function jC(t){if(t instanceof RC)return new RC(t.h,t.s,t.l,t.opacity);if(t instanceof oC||(t=kC(t)),!t)return new RC;if(t instanceof RC)return t;var e=(t=t.rgb()).r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),a=Math.max(e,n,r),o=NaN,s=a-i,c=(a+i)/2;return s?(o=e===a?(n-r)/s+6*(n<r):n===a?(r-e)/s+2:(e-n)/s+4,s/=c<.5?a+i:2-a-i,o*=60):s=c>0&&c<1?0:o,new RC(o,s,c,t.opacity)}function RC(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function IC(t){return(t=(t||0)%360)<0?t+360:t}function DC(t){return Math.max(0,Math.min(1,t||0))}function BC(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}iC(oC,kC,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:xC,formatHex:xC,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return jC(this).formatHsl()},formatRgb:wC,toString:wC}),iC(AC,SC,aC(oC,{brighter(t){return t=null==t?cC:Math.pow(cC,t),new AC(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=null==t?sC:Math.pow(sC,t),new AC(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new AC(CC(this.r),CC(this.g),CC(this.b),PC(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:_C,formatHex:_C,formatHex8:function(){return`#${NC(this.r)}${NC(this.g)}${NC(this.b)}${NC(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:TC,toString:TC})),iC(RC,(function(t,e,n,r){return 1===arguments.length?jC(t):new RC(t,e,n,null==r?1:r)}),aC(oC,{brighter(t){return t=null==t?cC:Math.pow(cC,t),new RC(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?sC:Math.pow(sC,t),new RC(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*e,i=2*n-r;return new AC(BC(t>=240?t-240:t+120,i,r),BC(t,i,r),BC(t<120?t+240:t-120,i,r),this.opacity)},clamp(){return new RC(IC(this.h),DC(this.s),DC(this.l),PC(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 t=PC(this.opacity);return`${1===t?"hsl(":"hsla("}${IC(this.h)}, ${100*DC(this.s)}%, ${100*DC(this.l)}%${1===t?")":`, ${t})`}`}}));const FC=Math.PI/180,zC=180/Math.PI;var GC=-.14861,WC=1.78277,$C=-.29227,HC=-.90649,YC=1.97294,VC=YC*HC,UC=YC*WC,qC=WC*$C-HC*GC;function XC(t,e,n,r){return 1===arguments.length?function(t){if(t instanceof KC)return new KC(t.h,t.s,t.l,t.opacity);t instanceof AC||(t=OC(t));var e=t.r/255,n=t.g/255,r=t.b/255,i=(qC*r+VC*e-UC*n)/(qC+VC-UC),a=r-i,o=(YC*(n-i)-$C*a)/HC,s=Math.sqrt(o*o+a*a)/(YC*i*(1-i)),c=s?Math.atan2(o,a)*zC-120:NaN;return new KC(c<0?c+360:c,s,i,t.opacity)}(t):new KC(t,e,n,null==r?1:r)}function KC(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}iC(KC,XC,aC(oC,{brighter(t){return t=null==t?cC:Math.pow(cC,t),new KC(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?sC:Math.pow(sC,t),new KC(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=isNaN(this.h)?0:(this.h+120)*FC,e=+this.l,n=isNaN(this.s)?0:this.s*e*(1-e),r=Math.cos(t),i=Math.sin(t);return new AC(255*(e+n*(GC*r+WC*i)),255*(e+n*($C*r+HC*i)),255*(e+n*(YC*r)),this.opacity)}}));var ZC=t=>()=>t;function QC(t,e){return function(n){return t+n*e}}function JC(t){return 1===(t=+t)?tN:function(e,n){return n-e?function(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(r){return Math.pow(t+r*e,n)}}(e,n,t):ZC(isNaN(e)?n:e)}}function tN(t,e){var n=e-t;return n?QC(t,n):ZC(isNaN(t)?e:t)}!function t(e){var n=JC(e);function r(t,e){var r=n((t=SC(t)).r,(e=SC(e)).r),i=n(t.g,e.g),a=n(t.b,e.b),o=tN(t.opacity,e.opacity);return function(e){return t.r=r(e),t.g=i(e),t.b=a(e),t.opacity=o(e),t+""}}return r.gamma=t,r}(1);var eN,nN=(eN=function(t){var e=t.length-1;return function(n){var r=n<=0?n=0:n>=1?(n=1,e-1):Math.floor(n*e),i=t[r],a=t[r+1],o=r>0?t[r-1]:2*i-a,s=r<e-1?t[r+2]:2*a-i;return function(t,e,n,r,i){var a=t*t,o=a*t;return((1-3*t+3*a-o)*e+(4-6*a+3*o)*n+(1+3*t+3*a-3*o)*r+o*i)/6}((n-r/e)*e,o,i,a,s)}},function(t){var e,n,r=t.length,i=new Array(r),a=new Array(r),o=new Array(r);for(e=0;e<r;++e)n=SC(t[e]),i[e]=n.r||0,a[e]=n.g||0,o[e]=n.b||0;return i=eN(i),a=eN(a),o=eN(o),n.opacity=1,function(t){return n.r=i(t),n.g=a(t),n.b=o(t),n+""}});function rN(t){return function e(n){function r(e,r){var i=t((e=XC(e)).h,(r=XC(r)).h),a=tN(e.s,r.s),o=tN(e.l,r.l),s=tN(e.opacity,r.opacity);return function(t){return e.h=i(t),e.s=a(t),e.l=o(Math.pow(t,n)),e.opacity=s(t),e+""}}return n=+n,r.gamma=e,r}(1)}rN((function(t,e){var n=e-t;return n?QC(t,n>180||n<-180?n-360*Math.round(n/360):n):ZC(isNaN(t)?e:t)}));var iN=rN(tN),aN=t=>nN(t[t.length-1]),oN=new Array(3).concat("d8b365f5f5f55ab4ac","a6611adfc27d80cdc1018571","a6611adfc27df5f5f580cdc1018571","8c510ad8b365f6e8c3c7eae55ab4ac01665e","8c510ad8b365f6e8c3f5f5f5c7eae55ab4ac01665e","8c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e","8c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e","5430058c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e003c30","5430058c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e003c30").map(VP),sN=aN(oN),cN=new Array(3).concat("af8dc3f7f7f77fbf7b","7b3294c2a5cfa6dba0008837","7b3294c2a5cff7f7f7a6dba0008837","762a83af8dc3e7d4e8d9f0d37fbf7b1b7837","762a83af8dc3e7d4e8f7f7f7d9f0d37fbf7b1b7837","762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b7837","762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b7837","40004b762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b783700441b","40004b762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b783700441b").map(VP),lN=aN(cN),uN=new Array(3).concat("e9a3c9f7f7f7a1d76a","d01c8bf1b6dab8e1864dac26","d01c8bf1b6daf7f7f7b8e1864dac26","c51b7de9a3c9fde0efe6f5d0a1d76a4d9221","c51b7de9a3c9fde0eff7f7f7e6f5d0a1d76a4d9221","c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221","c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221","8e0152c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221276419","8e0152c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221276419").map(VP),fN=aN(uN),hN=new Array(3).concat("998ec3f7f7f7f1a340","5e3c99b2abd2fdb863e66101","5e3c99b2abd2f7f7f7fdb863e66101","542788998ec3d8daebfee0b6f1a340b35806","542788998ec3d8daebf7f7f7fee0b6f1a340b35806","5427888073acb2abd2d8daebfee0b6fdb863e08214b35806","5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b35806","2d004b5427888073acb2abd2d8daebfee0b6fdb863e08214b358067f3b08","2d004b5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b358067f3b08").map(VP),dN=aN(hN),pN=new Array(3).concat("ef8a62f7f7f767a9cf","ca0020f4a58292c5de0571b0","ca0020f4a582f7f7f792c5de0571b0","b2182bef8a62fddbc7d1e5f067a9cf2166ac","b2182bef8a62fddbc7f7f7f7d1e5f067a9cf2166ac","b2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac","b2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac","67001fb2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac053061","67001fb2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac053061").map(VP),gN=aN(pN),vN=new Array(3).concat("ef8a62ffffff999999","ca0020f4a582bababa404040","ca0020f4a582ffffffbababa404040","b2182bef8a62fddbc7e0e0e09999994d4d4d","b2182bef8a62fddbc7ffffffe0e0e09999994d4d4d","b2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d","b2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d","67001fb2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d1a1a1a","67001fb2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d1a1a1a").map(VP),mN=aN(vN),yN=new Array(3).concat("fc8d59ffffbf91bfdb","d7191cfdae61abd9e92c7bb6","d7191cfdae61ffffbfabd9e92c7bb6","d73027fc8d59fee090e0f3f891bfdb4575b4","d73027fc8d59fee090ffffbfe0f3f891bfdb4575b4","d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4","d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4","a50026d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4313695","a50026d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4313695").map(VP),bN=aN(yN),xN=new Array(3).concat("fc8d59ffffbf91cf60","d7191cfdae61a6d96a1a9641","d7191cfdae61ffffbfa6d96a1a9641","d73027fc8d59fee08bd9ef8b91cf601a9850","d73027fc8d59fee08bffffbfd9ef8b91cf601a9850","d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850","d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850","a50026d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850006837","a50026d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850006837").map(VP),wN=aN(xN),kN=new Array(3).concat("fc8d59ffffbf99d594","d7191cfdae61abdda42b83ba","d7191cfdae61ffffbfabdda42b83ba","d53e4ffc8d59fee08be6f59899d5943288bd","d53e4ffc8d59fee08bffffbfe6f59899d5943288bd","d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd","d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd","9e0142d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd5e4fa2","9e0142d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd5e4fa2").map(VP),EN=aN(kN),MN=new Array(3).concat("e5f5f999d8c92ca25f","edf8fbb2e2e266c2a4238b45","edf8fbb2e2e266c2a42ca25f006d2c","edf8fbccece699d8c966c2a42ca25f006d2c","edf8fbccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45006d2c00441b").map(VP),ON=aN(MN),SN=new Array(3).concat("e0ecf49ebcda8856a7","edf8fbb3cde38c96c688419d","edf8fbb3cde38c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d810f7c4d004b").map(VP),AN=aN(SN),_N=new Array(3).concat("e0f3dba8ddb543a2ca","f0f9e8bae4bc7bccc42b8cbe","f0f9e8bae4bc7bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe0868ac084081").map(VP),TN=aN(_N),PN=new Array(3).concat("fee8c8fdbb84e34a33","fef0d9fdcc8afc8d59d7301f","fef0d9fdcc8afc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301fb300007f0000").map(VP),CN=aN(PN),NN=new Array(3).concat("ece2f0a6bddb1c9099","f6eff7bdc9e167a9cf02818a","f6eff7bdc9e167a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016c59014636").map(VP),LN=aN(NN),jN=new Array(3).concat("ece7f2a6bddb2b8cbe","f1eef6bdc9e174a9cf0570b0","f1eef6bdc9e174a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0045a8d023858").map(VP),RN=aN(jN),IN=new Array(3).concat("e7e1efc994c7dd1c77","f1eef6d7b5d8df65b0ce1256","f1eef6d7b5d8df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125698004367001f").map(VP),DN=aN(IN),BN=new Array(3).concat("fde0ddfa9fb5c51b8a","feebe2fbb4b9f768a1ae017e","feebe2fbb4b9f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a017749006a").map(VP),FN=aN(BN),zN=new Array(3).concat("edf8b17fcdbb2c7fb8","ffffcca1dab441b6c4225ea8","ffffcca1dab441b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea8253494081d58").map(VP),GN=aN(zN),WN=new Array(3).concat("f7fcb9addd8e31a354","ffffccc2e69978c679238443","ffffccc2e69978c67931a354006837","ffffccd9f0a3addd8e78c67931a354006837","ffffccd9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443006837004529").map(VP),$N=aN(WN),HN=new Array(3).concat("fff7bcfec44fd95f0e","ffffd4fed98efe9929cc4c02","ffffd4fed98efe9929d95f0e993404","ffffd4fee391fec44ffe9929d95f0e993404","ffffd4fee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c02993404662506").map(VP),YN=aN(HN),VN=new Array(3).concat("ffeda0feb24cf03b20","ffffb2fecc5cfd8d3ce31a1c","ffffb2fecc5cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cbd0026800026").map(VP),UN=aN(VN),qN=new Array(3).concat("deebf79ecae13182bd","eff3ffbdd7e76baed62171b5","eff3ffbdd7e76baed63182bd08519c","eff3ffc6dbef9ecae16baed63182bd08519c","eff3ffc6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b508519c08306b").map(VP),XN=aN(qN),KN=new Array(3).concat("e5f5e0a1d99b31a354","edf8e9bae4b374c476238b45","edf8e9bae4b374c47631a354006d2c","edf8e9c7e9c0a1d99b74c47631a354006d2c","edf8e9c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45006d2c00441b").map(VP),ZN=aN(KN),QN=new Array(3).concat("f0f0f0bdbdbd636363","f7f7f7cccccc969696525252","f7f7f7cccccc969696636363252525","f7f7f7d9d9d9bdbdbd969696636363252525","f7f7f7d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525000000").map(VP),JN=aN(QN),tL=new Array(3).concat("efedf5bcbddc756bb1","f2f0f7cbc9e29e9ac86a51a3","f2f0f7cbc9e29e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a354278f3f007d").map(VP),eL=aN(tL),nL=new Array(3).concat("fee0d2fc9272de2d26","fee5d9fcae91fb6a4acb181d","fee5d9fcae91fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181da50f1567000d").map(VP),rL=aN(nL),iL=new Array(3).concat("fee6cefdae6be6550d","feeddefdbe85fd8d3cd94701","feeddefdbe85fd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d94801a636037f2704").map(VP),aL=aN(iL);var oL=iN(XC(300,.5,0),XC(-240,.5,1)),sL=iN(XC(-100,.75,.35),XC(80,1.5,.8)),cL=iN(XC(260,.75,.35),XC(80,1.5,.8)),lL=XC();var uL=SC(),fL=Math.PI/3,hL=2*Math.PI/3;function dL(t){var e=t.length;return function(n){return t[Math.max(0,Math.min(e-1,Math.floor(n*e)))]}}var pL=dL(VP("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725")),gL=dL(VP("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf")),vL=dL(VP("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4")),mL=dL(VP("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921")),yL=Object.freeze({__proto__:null,schemeCategory10:UP,schemeAccent:qP,schemeDark2:XP,schemeObservable10:KP,schemePaired:ZP,schemePastel1:QP,schemePastel2:JP,schemeSet1:tC,schemeSet2:eC,schemeSet3:nC,schemeTableau10:rC,interpolateBrBG:sN,schemeBrBG:oN,interpolatePRGn:lN,schemePRGn:cN,interpolatePiYG:fN,schemePiYG:uN,interpolatePuOr:dN,schemePuOr:hN,interpolateRdBu:gN,schemeRdBu:pN,interpolateRdGy:mN,schemeRdGy:vN,interpolateRdYlBu:bN,schemeRdYlBu:yN,interpolateRdYlGn:wN,schemeRdYlGn:xN,interpolateSpectral:EN,schemeSpectral:kN,interpolateBuGn:ON,schemeBuGn:MN,interpolateBuPu:AN,schemeBuPu:SN,interpolateGnBu:TN,schemeGnBu:_N,interpolateOrRd:CN,schemeOrRd:PN,interpolatePuBuGn:LN,schemePuBuGn:NN,interpolatePuBu:RN,schemePuBu:jN,interpolatePuRd:DN,schemePuRd:IN,interpolateRdPu:FN,schemeRdPu:BN,interpolateYlGnBu:GN,schemeYlGnBu:zN,interpolateYlGn:$N,schemeYlGn:WN,interpolateYlOrBr:YN,schemeYlOrBr:HN,interpolateYlOrRd:UN,schemeYlOrRd:VN,interpolateBlues:XN,schemeBlues:qN,interpolateGreens:ZN,schemeGreens:KN,interpolateGreys:JN,schemeGreys:QN,interpolatePurples:eL,schemePurples:tL,interpolateReds:rL,schemeReds:nL,interpolateOranges:aL,schemeOranges:iL,interpolateCividis:function(t){return t=Math.max(0,Math.min(1,t)),"rgb("+Math.max(0,Math.min(255,Math.round(-4.54-t*(35.34-t*(2381.73-t*(6402.7-t*(7024.72-2710.57*t)))))))+", "+Math.max(0,Math.min(255,Math.round(32.49+t*(170.73+t*(52.82-t*(131.46-t*(176.58-67.37*t)))))))+", "+Math.max(0,Math.min(255,Math.round(81.24+t*(442.36-t*(2482.43-t*(6167.24-t*(6614.94-2475.67*t)))))))+")"},interpolateCubehelixDefault:oL,interpolateRainbow:function(t){(t<0||t>1)&&(t-=Math.floor(t));var e=Math.abs(t-.5);return lL.h=360*t-100,lL.s=1.5-1.5*e,lL.l=.8-.9*e,lL+""},interpolateWarm:sL,interpolateCool:cL,interpolateSinebow:function(t){var e;return t=(.5-t)*Math.PI,uL.r=255*(e=Math.sin(t))*e,uL.g=255*(e=Math.sin(t+fL))*e,uL.b=255*(e=Math.sin(t+hL))*e,uL+""},interpolateTurbo:function(t){return t=Math.max(0,Math.min(1,t)),"rgb("+Math.max(0,Math.min(255,Math.round(34.61+t*(1172.33-t*(10793.56-t*(33300.12-t*(38394.49-14825.05*t)))))))+", "+Math.max(0,Math.min(255,Math.round(23.31+t*(557.33+t*(1225.33-t*(3574.96-t*(1073.77+707.56*t)))))))+", "+Math.max(0,Math.min(255,Math.round(27.2+t*(3211.1-t*(15327.97-t*(27814-t*(22569.18-6838.66*t)))))))+")"},interpolateViridis:pL,interpolateMagma:gL,interpolateInferno:vL,interpolatePlasma:mL});function bL(t,e,n,r,i,a){const{guide:o={}}=n,s=function(t,e,n){const{type:r,domain:i,range:a,quantitative:o,ordinal:s}=n;if(void 0!==r)return r;if(function(t){return RL(t,Ka)}(e))return"identity";if("string"==typeof a)return"linear";if((i||a||[]).length>2)return PL(t,s);if(void 0!==i)return LL([i])?PL(t,s):jL(e)?"time":CL(t,a,o);return LL(e)?PL(t,s):jL(e)?"time":CL(t,a,o)}(t,e,n);if("string"!=typeof s)return n;const c=function(t,e,n,r){const{domain:i}=r;if(void 0!==i)return i;switch(t){case"linear":case"time":case"log":case"pow":case"sqrt":case"quantize":case"threshold":return NL(function(t,e){const{zero:n=!1}=e;let r=1/0,i=-1/0;for(const e of t)for(const t of e)Ha(t)&&(r=Math.min(r,+t),i=Math.max(i,+t));return r===1/0?[]:n?[Math.min(0,r),i]:[r,i]}(n,r),r);case"band":case"ordinal":case"point":return function(t){return Array.from(new Set(t.flat()))}(n);case"quantile":return function(t){return t.flat().sort()}(n);case"sequential":return NL(function(t){let e=1/0,n=-1/0;for(const r of t)for(const t of r)Ha(t)&&(e=Math.min(e,+t),n=Math.max(n,+t));return e===1/0?[]:[e<0?-n:e,n]}(n),r);default:return[]}}(s,0,e,n),l=function(t,e,n){const{ratio:r}=n;if(null==r)return e;if(SL({type:t}))return function(t,e,n){const r=t.map(Number),i=new ca({domain:r,range:[r[0],r[0]+(r[r.length-1]-r[0])*e]});return"time"===n?t.map((t=>new Date(i.map(t)))):t.map((t=>i.map(t)))}(e,r,t);return AL({type:t})?function(t,e){const n=Math.round(t.length*e);return t.slice(0,n)}(e,r):e}(s,c,n);return Object.assign(Object.assign(Object.assign({},n),function(t,e,n,r,i){switch(t){case"linear":case"time":case"log":case"pow":case"sqrt":return function(t,e){const{interpolate:n=Ci,nice:r=!1,tickCount:i=5}=e;return Object.assign(Object.assign({},e),{interpolate:n,nice:r,tickCount:i})}(0,r);case"band":case"point":return function(t,e,n,r){if(void 0!==r.padding||void 0!==r.paddingInner||void 0!==r.paddingOuter)return Object.assign(Object.assign({},r),{unknown:NaN});const i=function(t,e,n){return"enterDelay"===e||"enterDuration"===e||"size"===e?0:"band"===t?$P(n)?0:.1:"point"===t?.5:0}(t,e,n),{paddingInner:a=i,paddingOuter:o=i}=r;return Object.assign(Object.assign({},r),{paddingInner:a,paddingOuter:o,padding:i,unknown:NaN})}(t,e,i,r);case"sequential":return function(t){const{palette:e="ylGnBu",offset:n}=t,r=$(e),i=yL[`interpolate${r}`];if(!i)throw new Error(`Unknown palette: ${r}`);return{interpolator:n?t=>i(n(t)):i}}(r);default:return r}}(s,t,0,n,r)),{domain:l,range:_L(s,t,e,n,l,i,a),expectedDomain:c,guide:o,name:t,type:s})}function xL(t,e){const n={};for(const r of t){const{values:t,name:i}=r,a=e[i];for(const e of t){const{name:t,value:r}=e;n[t]=r.map((t=>a.map(t)))}}return n}function wL(t,e){const n=Object.keys(t);for(const r of Object.values(e)){const{name:e}=r.getOptions();if(e in t){const i=n.filter((t=>t.startsWith(e))).map((t=>+(t.replace(e,"")||0))),a=gr(i)+1,o=`${e}${a}`;t[o]=r,r.getOptions().key=o}else t[e]=r}return t}function kL(t,e){const[n]=DP("scale",e),{relations:r}=t,[i]=function(t){if(!t||!Array.isArray(t))return[Fa,Fa];let e,n;return[r=>{var i;e=r.map.bind(r),n=null===(i=r.invert)||void 0===i?void 0:i.bind(r);const a=t.filter((([t])=>"function"==typeof t)),o=t.filter((([t])=>"function"!=typeof t)),s=new Map(o);if(r.map=t=>{for(const[e,n]of a)if(e(t))return n;return s.has(t)?s.get(t):e(t)},!n)return r;const c=new Map(o.map((([t,e])=>[e,t]))),l=new Map(a.map((([t,e])=>[e,t])));return r.invert=t=>l.has(t)?t:c.has(t)?c.get(t):n(t),r},t=>(null!==e&&(t.map=e),null!==n&&(t.invert=n),t)]}(r);return i(n(t))}function EL(t){const e=t.flatMap((t=>Array.from(t.values()))).flatMap((t=>t.channels.map((t=>t.scale))));OL(e,"x"),OL(e,"y")}function ML(t){const{channels:e=[],type:n,scale:r={}}=t,i=["shape","color","opacity","size"];return 0!==e.length?e:"axisX"===n?["x"]:"axisY"===n?["y"]:"legends"===n?Object.keys(r).filter((t=>i.includes(t))):[]}function OL(t,e){const n=t.filter((({name:t,facet:n=!0})=>n&&t===e)),r=n.flatMap((t=>t.domain)),i=n.every(SL)?Un(r):n.every(AL)?Array.from(new Set(r)):null;if(null!==i)for(const t of n)t.domain=i}function SL(t){const{type:e}=t;if("string"!=typeof e)return!1;return["linear","log","pow","time"].includes(e)}function AL(t){const{type:e}=t;if("string"!=typeof e)return!1;return["band","point","ordinal"].includes(e)}function _L(t,e,n,r,i,a,o){const{range:s}=r;if("string"==typeof s)return function(t){return t.split("-")}(s);if(void 0!==s)return s;const{rangeMin:c,rangeMax:l}=r;switch(t){case"linear":case"time":case"log":case"pow":case"sqrt":{const t=TL(n,r,i,a,o),[s,u]=function(t,e){return"enterDelay"===t?[0,1e3]:"enterDuration"==t?[300,1e3]:t.startsWith("y")||t.startsWith("position")?[1,0]:"color"===t?[eo(e),no(e)]:"opacity"===t?[0,1]:"size"===t?[1,10]:[0,1]}(e,t);return[null!=c?c:s,null!=l?l:u]}case"band":case"point":return[null!=c?c:"size"===e?5:0,null!=l?l:"size"===e?10:1];case"ordinal":return TL(n,r,i,a,o);case"sequential":return;case"constant":return[n[0][0]];default:return[]}}function TL(t,e,n,r,i){const[a]=DP("palette",i),{category10:o,category20:s}=r,c=function(t){return Array.from(new Set(t))}(n).length<=o.length?o:s,{palette:l=c,offset:u}=e;if(Array.isArray(l))return l;try{return a({type:l})}catch(t){const e=function(t,e,n=t=>t){if(!t)return null;const r=$(t),i=yL[`scheme${r}`],a=yL[`interpolate${r}`];if(!i&&!a)return null;if(i){if(!i.some(Array.isArray))return i;const t=i[e.length];if(t)return t}return e.map(((t,r)=>a(n(r/e.length))))}(l,n,u);if(e)return e;throw new Error(`Unknown Component: ${l} `)}}function PL(t,e){return e||(function(t){return t.startsWith("x")||t.startsWith("y")||t.startsWith("position")||t.startsWith("size")}(t)?"point":"ordinal")}function CL(t,e,n){return n||("color"!==t||e?"linear":"sequential")}function NL(t,e){if(0===t.length)return t;const{domainMin:n,domainMax:r}=e,[i,a]=t;return[null!=n?n:i,null!=r?r:a]}function LL(t){return RL(t,(t=>{const e=typeof t;return"string"===e||"boolean"===e}))}function jL(t){return RL(t,(t=>t instanceof Date))}function RL(t,e){for(const n of t)if(n.some(e))return!0;return!1}const IL={linear:"linear",identity:"identity",log:"log",pow:"pow",sqrt:"sqrt",sequential:"sequential"},DL={threshold:"threshold",quantize:"quantize",quantile:"quantile"},BL={ordinal:"ordinal",band:"band",point:"point"},FL={constant:"constant"};function zL(t,e,n){const{coordinates:r=[],title:i}=e,[,a]=DP("component",n),o=t.filter((({guide:t})=>null!==t)),s=[],c=function(t,e,n){const[,r]=DP("component",n),{coordinates:i}=t;function a(t,e,n,a){const o=function(t,e,n=[]){return"x"===t?WP(n)?`${e}Y`:`${e}X`:"y"===t?WP(n)?`${e}X`:`${e}Y`:null}(e,t,i);if(!a||!o)return;const{props:s}=r(o),{defaultPosition:c,defaultSize:l,defaultOrder:u,defaultCrossPadding:[f]}=s;return Object.assign(Object.assign({position:c,defaultSize:l,order:u,type:o,crossPadding:f},a),{scales:[n]})}return e.filter((t=>t.slider||t.scrollbar)).flatMap((t=>{const{slider:e,scrollbar:n,name:r}=t;return[a("slider",r,t,e),a("scrollbar",r,t,n)]})).filter((t=>!!t))}(e,t,n);if(s.push(...c),i){const{props:t}=a("title"),{defaultPosition:e,defaultOrientation:n,defaultOrder:r,defaultSize:o,defaultCrossPadding:c}=t,l="string"==typeof i?{title:i}:i;s.push(Object.assign({type:"title",position:e,orientation:n,order:r,crossPadding:c[0],defaultSize:o},l))}const l=function(t,e){const n=t.filter((t=>function(t){if(!t||!t.type)return!1;if("function"==typeof t.type)return!0;const{type:e,domain:n,range:r,interpolator:i}=t,a=n&&n.length>0,o=r&&r.length>0;return!!(["linear","sqrt","log","time","pow","threshold","quantize","quantile","ordinal","band","point"].includes(e)&&a&&o)||!(!["sequential"].includes(e)||!a||!o&&!i)||!(!["constant","identity"].includes(e)||!o)}(t)));return[...$L(n),...YL(n,e)]}(o,r);return l.forEach((([t,e])=>{const{props:n}=a(t),{defaultPosition:i,defaultPlane:c="xy",defaultOrientation:l,defaultSize:u,defaultOrder:f,defaultLength:h,defaultPadding:d=[0,0],defaultCrossPadding:p=[0,0]}=n,g=Q({},...e),{guide:v,field:m}=g,y=Array.isArray(v)?v:[v];for(const n of y){const[a,g]=qL(t,i,l,n,e,o,r);if(!a&&!g)continue;const v="left"===a||"right"===a,y=v?d[1]:d[0],b=v?p[1]:p[0],{size:x,order:w=f,length:k=h,padding:E=y,crossPadding:M=b}=n;s.push(Object.assign(Object.assign({title:m},n),{defaultSize:u,length:k,position:a,plane:c,orientation:g,padding:E,order:w,crossPadding:M,size:x,type:t,scales:e}))}})),s}function GL(t,e,n,r,i){const[a]=DP("component",r),{scaleInstances:o,scale:s,bbox:c}=t,l={bbox:c,library:r};return a(Le(t,["scaleInstances","scale","bbox"]))({coordinate:e,library:r,markState:i,scales:o,theme:n,value:l,scale:s})}function WL(t,e){const n=["left","right","bottom","top"],r=Jn(t,(({type:t,position:e,group:r})=>n.includes(e)?void 0===r?t.startsWith("legend")?`legend-${e}`:Symbol("independent"):"independent"===r?Symbol("independent"):r:Symbol("independent")));return r.flatMap((([,t])=>{if(1===t.length)return t[0];if(void 0!==e){const n=t.filter((t=>void 0!==t.length)).map((t=>t.length)),r=Mr(n);if(r>e)return t.forEach((t=>t.group=Symbol("independent"))),t;const i=(e-r)/(t.length-n.length);t.forEach((t=>{void 0===t.length&&(t.length=i)}))}const n=gr(t,(t=>t.size)),r=gr(t,(t=>t.order)),i=gr(t,(t=>t.crossPadding));return{type:"group",size:n,order:r,position:t[0].position,children:t,crossPadding:i}}))}function $L(t,e){const n=["shape","size","color","opacity"],r=t.filter((({type:t,name:e})=>"string"==typeof t&&n.includes(e)&&!((t,e)=>"constant"===t&&"size"===e)(t,e))),i=r.filter((({type:t})=>"constant"===t)),a=Jn(r.filter((({type:t})=>"constant"!==t)),(t=>t.field?t.field:Symbol("independent"))).map((([t,e])=>[t,[...e,...i]])).filter((([,t])=>t.some((t=>"constant"!==t.type)))),o=new Map(a);if(0===o.size)return[];const s=t=>t.sort((([t],[e])=>t.localeCompare(e))),c=Array.from(o).map((([,t])=>{const e=function(t){if(1===t.length)return[t];const e=[];for(let n=1;n<=t.length;n++)e.push(...io(t,n));return e}(t).sort(((t,e)=>e.length-t.length)),n=e.map((t=>({combination:t,option:t.map((t=>[t.name,HL(t)]))})));for(const{option:t,combination:e}of n)if(!t.every((t=>"constant"===t[1]))&&t.every((t=>"discrete"===t[1]||"constant"===t[1])))return["legendCategory",e];for(const[t,e]of G_)for(const{option:r,combination:i}of n)if(e.some((t=>et(s(t),s(r)))))return[t,i];return null})).filter(Ha);return c}function HL(t){const{type:e}=t;return"string"!=typeof e?null:e in IL?"continuous":e in BL?"discrete":e in DL?"distribution":e in FL?"constant":null}function YL(t,e){return t.map((t=>{const{name:n}=t;if(function(t){return zP(t,"helix").length>0}(e)||$P(e))return null;if(WP(e)&&(GP(e)||HP(e)))return null;if(n.startsWith("x"))return GP(e)?["axisArc",[t]]:HP(e)?["axisLinear",[t]]:[WP(e)?"axisY":"axisX",[t]];if(n.startsWith("y"))return GP(e)?["axisLinear",[t]]:HP(e)?["axisArc",[t]]:[WP(e)?"axisX":"axisY",[t]];if(n.startsWith("z"))return["axisZ",[t]];if(n.startsWith("position")){if(YP(e))return["axisRadar",[t]];if(!GP(e))return["axisY",[t]]}return null})).filter(Ha)}function VL(t){const e=zP(t,"polar");if(e.length){const t=e[e.length-1],{startAngle:r,endAngle:i}=n(t);return[r,i]}const r=zP(t,"radial");if(r.length){const t=r[r.length-1],{startAngle:e,endAngle:n}=s(t);return[e,n]}return[-Math.PI/2,Math.PI/2*3]}function UL(t,e,n,r,i){const{name:a}=n[0];if("axisRadar"===t){const t=r.filter((t=>t.name.startsWith("position"))),e=function(t){const e=/position(\d*)/g.exec(t);return e?+e[1]:null}(a);if(null===e)return[null,null];const[n,o]=VL(i);return["center",(o-n)/(YP(i)?t.length:t.length-1)*e+n]}if("axisY"===t&&function(t){return zP(t,"parallel").length>0}(i))return WP(i)?["center","horizontal"]:["center","vertical"];if("axisLinear"===t){const[t]=VL(i);return["center",t]}return"axisArc"===t?"inner"===e[0]?["inner",null]:["outer",null]:GP(i)||HP(i)?["center",null]:"axisX"===t&&function(t){return zP(t,"reflect").length>0}(i)||"axisX"===t&&function(t){return zP(t,"reflectY").length>0}(i)?["top",null]:e}function qL(t,e,n,r,i,a,o){const[s]=VL(o),c=[r.position||e,null!=s?s:n];return"string"==typeof t&&t.startsWith("axis")?UL(t,c,i,a,o):"string"==typeof t&&t.startsWith("legend")&&GP(o)&&"center"===r.position?["center","vertical"]:c}function XL(t,e,n,r,i,a){const{type:o}=t;if(!["left","right","bottom","top"].includes(r))return;if("string"!=typeof o)return;const s=o;return(s.startsWith("axis")?tj:s.startsWith("group")?KL:s.startsWith("legendContinuous")?ej:"legendCategory"===s?nj:s.startsWith("slider")?JL:"title"===s?QL:s.startsWith("scrollbar")?ZL:()=>{})(t,e,n,r,i,a)}function KL(t,e,n,r,i,a){const{children:o}=t,s=gr(o,(t=>t.crossPadding));o.forEach((t=>t.crossPadding=s)),o.forEach((t=>XL(t,e,n,r,i,a)));const c=gr(o,(t=>t.size));t.size=c,o.forEach((t=>t.size=c))}function ZL(t,e,n,r,i,a){const{trackSize:o=6}=Q({},i.scrollbar,t);t.size=o}function QL(t,e,n,r,i,a){const o=Q({},i.title,t),{title:s,subtitle:c,spacing:l=0}=o,u=Le(o,["title","subtitle","spacing"]);if(s){const e=cj(s,Va(u,"title"));t.size=e.height}if(c){const e=cj(c,Va(u,"subtitle"));t.size+=l+e.height}}function JL(t,e,n,r,i,a){const{trackSize:o,handleIconSize:s}=(()=>{const{slider:e}=i;return Q({},e,t)})(),c=Math.max(o,2.4*s);t.size=c}function tj(t,e,n,r,i,a){var o;t.transform=t.transform||[{type:"hide"}];const s="left"===r||"right"===r,c=oj(t,r,i),{tickLength:l=0,labelSpacing:u=0,titleSpacing:f=0,labelAutoRotate:h}=c,d=Le(c,["tickLength","labelSpacing","titleSpacing","labelAutoRotate"]),p=rj(t,a),g=ij(d,p),v=l+u;if(g&&g.length){const r=gr(g,(t=>t.width)),i=gr(g,(t=>t.height));if(s)t.size=r+v;else{const{tickFilter:a,labelTransform:s}=t;!function(t,e,n,r,i){const a=Mr(e,(t=>t.width));if(a>n)return!0;const o=t.clone();o.update({range:[0,n]});const s=sj(t,i),c=s.map((t=>o.map(t)+function(t,e){if(!t.getBandWidth)return 0;const n=t.getBandWidth(e)/2;return n}(o,t))),l=s.map(((t,e)=>e)),u=-r[0],f=n+r[1],h=(t,e)=>{const{width:n}=e;return[t-n/2,t+n/2]};for(let t=0;t<l.length;t++){const n=c[t],[r,i]=h(n,e[t]);if(r<u||i>f)return!0;const a=c[t+1];if(a){const[n]=h(a,e[t+1]);if(i>n)return!0}}return!1}(p,g,e,n,a)||s||!1===h||null===h?(t.labelTransform=null!==(o=t.labelTransform)&&void 0!==o?o:"rotate(0)",t.size=i+v):(t.labelTransform="rotate(90)",t.size=r+v)}}else t.size=l;const m=aj(d);m&&(t.size+=s?f+m.width:f+m.height)}function ej(t,e,n,r,i,a){const o=(()=>{const{legendContinuous:e}=i;return Q({},e,t)})(),{labelSpacing:s=0,titleSpacing:c=0}=o,l=Le(o,["labelSpacing","titleSpacing"]),u="left"===r||"right"===r,f=Va(l,"ribbon"),{size:h}=f,d=Va(l,"handleIcon"),{size:p}=d,g=Math.max(h,2.4*p);t.size=g;const v=ij(l,rj(t,a));if(v){const e=u?"width":"height",n=gr(v,(t=>t[e]));t.size+=n+s}const m=aj(l);m&&(u?t.size=Math.max(t.size,m.width):t.size+=c+m.height)}function nj(t,e,n,r,i,a){const o=(()=>{const{legendCategory:e}=i,{title:n}=t,[r,a]=Array.isArray(n)?[n,void 0]:[void 0,n];return Q({title:r},e,Object.assign(Object.assign({},t),{title:a}))})(),{itemSpacing:s,itemMarkerSize:c,titleSpacing:l,rowPadding:u,colPadding:f,maxCols:h=1/0,maxRows:d=1/0}=o,p=Le(o,["itemSpacing","itemMarkerSize","titleSpacing","rowPadding","colPadding","maxCols","maxRows"]),{cols:g,length:v}=t,m=t=>Math.min(t,d),y=t=>Math.min(t,h),b="left"===r||"right"===r,x=void 0===v?e+(b?0:n[0]+n[1]):v,w=aj(p),k=ij(p,rj(t,a),"itemLabel"),E=Math.max(k[0].height,c)+u,M=(t,e=0)=>c+t+s[0]+e;b?(()=>{let e=-1/0,n=0,r=1,i=0,a=-1/0,o=-1/0;const s=w?w.height:0,c=x-s;for(const{width:t}of k){const s=M(t,f);e=Math.max(e,s),n+E>c?(r++,a=Math.max(a,i),o=Math.max(o,n),i=1,n=E):(n+=E,i++)}r<=1&&(a=i,o=n),t.size=e*y(r),t.length=o+s,Q(t,{cols:y(r),gridRow:a})})():"number"==typeof g?(()=>{const e=Math.ceil(k.length/g),n=gr(k,(t=>M(t.width)))*g;t.size=E*m(e)-u,t.length=Math.min(n,x)})():(()=>{let e=1,n=0,r=-1/0;for(const{width:t}of k){const i=M(t,f);n+i>x?(r=Math.max(r,n),n=i,e++):n+=i}1===e&&(r=n),t.size=E*m(e)-u,t.length=r})(),w&&(b?t.size=Math.max(t.size,w.width):t.size+=l+w.height)}function rj(t,e){const[n]=DP("scale",e),{scales:r,tickCount:i,tickMethod:a}=t,o=r.find((t=>"constant"!==t.type&&"identity"!==t.type));return void 0!==i&&(o.tickCount=i),void 0!==a&&(o.tickMethod=a),n(o)}function ij(t,e,n="label"){const{labelFormatter:r,tickFilter:i,label:a=!0}=t,o=Le(t,["labelFormatter","tickFilter","label"]);if(!a)return null;const s=function(t,e,n){const r=sj(t,n),i=r.map((t=>"number"==typeof t?cm(t):t)),a=e?"string"==typeof e?bO(e):e:t.getFormatter?t.getFormatter():t=>`${t}`;return i.map(a)}(e,r,i),c=Va(o,n),l=s.map(((t,e)=>Object.fromEntries(Object.entries(c).map((([n,r])=>[n,"function"==typeof r?r(t,e):r]))))),u=s.map(((t,e)=>cj(t,l[e]))),f=l.some((t=>t.transform));if(!f){const e=s.map(((t,e)=>e));t.indexBBox=new Map(e.map((t=>[t,[s[t],u[t]]])))}return u}function aj(t){const{title:e}=t,n=Le(t,["title"]);if((t=>!1===t||null===t)(e)||void 0===e)return null;const r=Va(n,"title"),{direction:i,transform:a}=r,o=Array.isArray(e)?e.join(","):e;if("string"!=typeof o)return null;return cj(o,Object.assign(Object.assign({},r),{transform:a||("vertical"===i?"rotate(-90)":"")}))}function oj(t,e,n){const{title:r}=t,[i,a]=Array.isArray(r)?[r,void 0]:[void 0,r],{axis:o,[`axis${Ga(e)}`]:s}=n;return Q({title:i},o,s,Object.assign(Object.assign({},t),{title:a}))}function sj(t,e){const n=t.getTicks?t.getTicks():t.getOptions().domain;return e?n.filter(e):n}function cj(t,e){const n=function(t){return t instanceof Sg?t:new Yg({style:{text:`${t}`}})}(t),r=Le(e,["filter"]);n.attr(Object.assign(Object.assign({},r),{visibility:"none"}));return n.getBBox()}function lj(t,e,n,r){var i,a;const{width:o,height:s,depth:c,x:l=0,y:u=0,z:f=0,inset:h=(null!==(i=n.inset)&&void 0!==i?i:0),insetLeft:d=h,insetTop:p=h,insetBottom:g=h,insetRight:v=h,margin:m=(null!==(a=n.margin)&&void 0!==a?a:0),marginLeft:y=m,marginBottom:b=m,marginTop:x=m,marginRight:w=m,padding:k=n.padding,paddingBottom:E=k,paddingLeft:M=k,paddingRight:O=k,paddingTop:S=k}=function(t,e,n,r){const{coordinates:i}=e;if(!GP(i)&&!HP(i))return e;const a=t.filter((t=>"string"==typeof t.type&&t.type.startsWith("axis")));if(0===a.length)return e;const o=a.map((t=>oj(t,"axisArc"===t.type?"arc":"linear",n))),s=gr(o,(t=>{var e;return null!==(e=t.labelSpacing)&&void 0!==e?e:0})),c=a.flatMap(((t,e)=>ij(o[e],rj(t,r)))).filter(Ha),l=gr(c,(t=>t.height))+s,u=a.flatMap(((t,e)=>aj(o[e]))).filter((t=>null!==t)),f=0===u.length?0:gr(u,(t=>t.height)),{inset:h=l,insetLeft:d=h,insetBottom:p=h,insetTop:g=h+f,insetRight:v=h}=e;return Object.assign(Object.assign({},e),{insetLeft:d,insetBottom:p,insetTop:g,insetRight:v})}(t,e,n,r),A=(t,n,r,i,a)=>{const{marks:o}=e;if(0===o.length)return[i,a];if(t-i-a-.25*t>0)return[i,a];const s=.75*t;return["auto"===n?s*i/(i+a):i,"auto"===r?s*a/(i+a):a]},_=t=>"auto"===t?20:null!=t?t:20,T=_(S),P=_(E),C=uj(t,s-T-P,[T+x,P+b],["left","right"],e,n,r),{paddingLeft:N,paddingRight:L}=C,j=o-y-w,[R,I]=A(j,M,O,N,L),D=j-R-I,B=uj(t,D,[R+y,I+w],["bottom","top"],e,n,r),{paddingTop:F,paddingBottom:z}=B,G=s-b-x,[W,$]=A(G,E,S,z,F);return{width:o,height:s,depth:c,insetLeft:d,insetTop:p,insetBottom:g,insetRight:v,innerWidth:D,innerHeight:G-W-$,paddingLeft:R,paddingRight:I,paddingTop:$,paddingBottom:W,marginLeft:y,marginBottom:b,marginTop:x,marginRight:w,x:l,y:u,z:f}}function uj(t,e,n,r,i,a,o){const s=Qn(t,(t=>t.position)),{padding:c=a.padding,paddingLeft:l=c,paddingRight:u=c,paddingBottom:f=c,paddingTop:h=c}=i,d={paddingBottom:f,paddingLeft:l,paddingTop:h,paddingRight:u};for(const t of r){const r=`padding${Ga(ly(t))}`,i=s.get(t)||[],c=d[r],l=t=>{void 0===t.size&&(t.size=t.defaultSize)},u=t=>{"group"===t.type?(t.children.forEach(l),t.size=gr(t.children,(t=>t.size))):t.size=t.defaultSize},f=r=>{r.size||("auto"!==c?u(r):(XL(r,e,n,t,a,o),l(r)))},h=t=>{t.type.startsWith("axis")&&void 0===t.labelAutoHide&&(t.labelAutoHide=!0)},p="bottom"===t||"top"===t,g=mr(i,(t=>t.order)),v=i.filter((t=>t.type.startsWith("axis")&&t.order==g));if(v.length&&(v[0].crossPadding=0),"number"==typeof c)i.forEach(l),i.forEach(h);else if(0===i.length)d[r]=0;else{const t=WL(i,p?e+n[0]+n[1]:e);t.forEach(f);const a=t.reduce(((t,{size:e,crossPadding:n=12})=>t+e+n),0);d[r]=a}}return d}function fj({width:t,height:e,paddingLeft:n,paddingRight:r,paddingTop:i,paddingBottom:a,marginLeft:o,marginTop:s,marginBottom:c,marginRight:l,innerHeight:u,innerWidth:f,insetBottom:h,insetLeft:d,insetRight:p,insetTop:g}){const v=n+o,m=i+s,y=r+l,b=a+c,x=t-o-l,w=[v+d,m+g,f-d-p,u-g-h,"center",null,null];return{top:[v,0,f,m,"vertical",!0,Rn,o,x],right:[t-y,m,y,u,"horizontal",!1,Rn],bottom:[v,e-b,f,b,"vertical",!1,Rn,o,x],left:[0,m,v,u,"horizontal",!0,Rn],"top-left":[v,0,f,m,"vertical",!0,Rn],"top-right":[v,0,f,m,"vertical",!0,Rn],"bottom-left":[v,e-b,f,b,"vertical",!1,Rn],"bottom-right":[v,e-b,f,b,"vertical",!1,Rn],center:w,inner:w,outer:w}}function hj(t,e,n,r){const[i,a]=ro(t,(t=>!("string"!=typeof t.type||!t.type.startsWith("axis"))));!function(t,e,n,r){"center"===r?function(t){return Kc(t)&&Uc(t)}(e)?function(t,e,n){const[r,i,a,o]=n;for(const e of t)e.bbox={x:r,y:i,width:a,height:o},e.radar={index:t.indexOf(e),count:t.length}}(t,0,n):Uc(e)?function(t,e,n){const[r,i,a,o]=n;for(const e of t)e.bbox={x:r,y:i,width:a,height:o}}(t,0,n):Kc(e)&&function(t,e,n,r){"horizontal"===r?function(t,e,n){const[r,i,a]=n,o=new Array(t.length).fill(0),s=e.map(o),c=s.filter(((t,e)=>e%2==1)).map((t=>t+i));for(let e=0;e<t.length;e++){const n=t[e],i=c[e],o=c[e+1]-i;n.bbox={x:r,y:i,width:a,height:o}}}(t,e,n):"vertical"===r&&function(t,e,n){const[r,i,,a]=n,o=new Array(t.length).fill(0),s=e.map(o),c=s.filter(((t,e)=>e%2==0)).map((t=>t+r));for(let e=0;e<t.length;e++){const n=t[e],r=c[e],o=c[e+1]-r;n.bbox={x:r,y:i,width:o,height:a}}}(t,e,n)}(t,e,n,t[0].orientation):"inner"===r?function(t,e,n){const[r,i,,a]=n,[o,s]=e.getCenter(),[c]=Jc(e),l=a/2,u=c*l,f=o-u,h=s-u;for(let e=0;e<t.length;e++){t[e].bbox={x:r+f,y:i+h,width:2*u,height:2*u}}}(t,e,n):"outer"===r&&function(t,e,n){const[r,i,a,o]=n;for(const e of t)e.bbox={x:r,y:i,width:a,height:o}}(t,0,n)}(i,e,n,r),function(t,e,n){if(0===t.length)return;const[r,i,a,o]=n,[s]=Jc(e),c=o/2*s/Math.sqrt(2),l=r+a/2,u=i+o/2;for(let e=0;e<t.length;e++){t[e].bbox={x:l-c,y:u-c,width:2*c,height:2*c}}}(a,e,n)}function dj(t,e,n){const[r,i,a,o,s,c,l,u,f]=n,[h,d,p,g,v,m,y,b]="vertical"===s?["y",i,"x",r,"height",o,"width",a]:["x",r,"y",i,"width",a,"height",o];t.sort(((t,e)=>null==l?void 0:l(t.order,e.order)));const x=t=>"title"===t||"group"===t||t.startsWith("legend"),w=(t,e,n)=>void 0===n?e:x(t)?n:e,k=(t,e,n)=>void 0===n?e:x(t)?n:e;for(let e=0,n=c?d+m:d;e<t.length;e++){const r=t[e],{crossPadding:i=0,type:a}=r,{size:o}=r;r.bbox={[h]:c?n-o-i:n+i,[p]:k(a,g,u),[v]:o,[y]:w(a,b,f)},n+=(o+i)*(c?-1:1)}const E=t.filter((t=>"group"===t.type));for(const t of E){const{bbox:e,children:n}=t,r=e[y],i=r/n.length,a=n.reduce(((t,e)=>{var n;const r=null===(n=e.layout)||void 0===n?void 0:n.justifyContent;return r||t}),"flex-start"),o=n.map(((t,e)=>{const{length:r=i,padding:a=0}=t;return r+(e===n.length-1?0:a)})),s=r-Mr(o),c="flex-start"===a?0:"center"===a?s/2:s;for(let t=0,r=e[p]+c;t<n.length;t++){const i=n[t],{padding:s=0}=i,c=t===n.length-1?0:s;i.bbox={[v]:e[v],[h]:e[h],[p]:r,[y]:o[t]-c},Q(i,{layout:{justifyContent:a}}),r+=o[t]}}}const pj=Symbol("CALLBACK_ITEM");function gj(t,e,n){const{encode:r={},scale:i={},transform:a=[]}=e,o=Le(e,["encode","scale","transform"]);return[t,Object.assign(Object.assign({},o),{encode:r,scale:i,transform:a})]}function vj(t,e,n){return Re(this,void 0,void 0,(function*(){const{library:t}=n,{data:r}=e,[i]=DP("data",t),a=function(t){if(I(t))return{type:"inline",value:t};if(!t)return{type:"inline",value:null};if(Array.isArray(t))return{type:"inline",value:t};const{type:e="inline"}=t,n=Le(t,["type"]);return Object.assign(Object.assign({},n),{type:e})}(r),{transform:o=[]}=a,s=[Le(a,["transform"]),...o].map((t=>i(t,n))),c=yield function(t){return t.reduce(((t,e)=>n=>Re(this,void 0,void 0,(function*(){const r=yield t(n);return e(r)}))),Fa)}(s)(r),l=!r||Array.isArray(r)||Array.isArray(c)?c:{value:c};return[Array.isArray(c)?to(c):[],Object.assign(Object.assign({},e),{data:l})]}))}function mj(t,e,n){const{encode:r}=e;if(!r)return[t,e];const i={};for(const[t,e]of Object.entries(r))if(Array.isArray(e))for(let n=0;n<e.length;n++){i[`${t}${0===n?"":n}`]=e[n]}else i[t]=e;return[t,Object.assign(Object.assign({},e),{encode:i})]}function yj(t,e,n){const{encode:r,data:i}=e;if(!r)return[t,e];const a=Ja(r,(t=>{if(function(t){if("object"!=typeof t||t instanceof Date||null===t)return!1;const{type:e}=t;return Ha(e)}(t))return t;const e=function(t,e){return"function"==typeof e?"transform":"string"==typeof e&&function(t,e){return!!Array.isArray(t)&&t.some((t=>void 0!==t[e]))}(t,e)?"field":"constant"}(i,t);return{type:e,value:t}}));return[t,Object.assign(Object.assign({},e),{encode:a})]}function bj(t,e,n){const{encode:r}=e;if(!r)return[t,e];const i=Ja(r,((t,e)=>{const{type:n}=t;return"constant"!==n||function(t){return t.startsWith("x")||t.startsWith("y")||t.startsWith("position")||"enterDelay"===t||"enterDuration"===t||"updateDelay"===t||"updateDuration"===t||"exitDelay"===t||"exitDuration"===t}(e)?t:Object.assign(Object.assign({},t),{constant:!0})}));return[t,Object.assign(Object.assign({},e),{encode:i})]}function xj(t,e,n){const{encode:r,data:i}=e;if(!r)return[t,e];const{library:a}=n,o=function(t){const[e]=DP("encode",t);return(t,n)=>void 0===n||void 0===t?null:Object.assign(Object.assign({},n),{type:"column",value:e(n)(t),field:Aj(n)})}(a),s=Ja(r,(t=>o(i,t)));return[t,Object.assign(Object.assign({},e),{encode:s})]}function wj(t,e,n){const{tooltip:r={}}=e;return Za(r)?[t,e]:Array.isArray(r)?[t,Object.assign(Object.assign({},e),{tooltip:{items:r}})]:Ka(r)&&function(t){if(0===Object.keys(t).length)return!0;const{title:e,items:n}=t;return void 0!==e||void 0!==n}(r)?[t,Object.assign(Object.assign({},e),{tooltip:r})]:[t,Object.assign(Object.assign({},e),{tooltip:{items:[r]}})]}function kj(t,e,n){const{data:r,encode:i,tooltip:a={}}=e;if(Za(a))return[t,e];const o=e=>{if(!e)return e;if("string"==typeof e)return t.map((t=>({name:e,value:r[t][e]})));if(Ka(e)){const{field:n,channel:a,color:o,name:s=n,valueFormatter:c=t=>t}=e,l="string"==typeof c?bO(c):c,u=a&&i[a],f=u&&i[a].field,h=s||f||a,d=[];for(const e of t){const t=n?r[e][n]:u?i[a].value[e]:null;d[e]={name:h,color:o,value:l(t)}}return d}if("function"==typeof e){const n=[];for(const a of t){const t=e(r[a],a,r,i);Ka(t)?n[a]=Object.assign(Object.assign({},t),{[pj]:!0}):n[a]={value:t}}return n}return e},{title:s,items:c=[]}=a,l=Le(a,["title","items"]),u=Object.assign({title:o(s),items:Array.isArray(c)?c.map(o):[]},l);return[t,Object.assign(Object.assign({},e),{tooltip:u})]}function Ej(t,e,n){const{encode:r}=e,i=Le(e,["encode"]);if(!r)return[t,e];const a=Object.entries(r),o=a.filter((([,t])=>{const{value:e}=t;return Array.isArray(e[0])})).flatMap((([e,n])=>{const r=[[e,new Array(t.length).fill(void 0)]],{value:i}=n,a=Le(n,["value"]);for(let n=0;n<i.length;n++){const a=i[n];if(Array.isArray(a))for(let i=0;i<a.length;i++){const o=r[i]||[`${e}${i}`,new Array(t).fill(void 0)];o[1][n]=a[i],r[i]=o}}return r.map((([t,e])=>[t,Object.assign({type:"column",value:e},a)]))})),s=Object.fromEntries([...a,...o]);return[t,Object.assign(Object.assign({},i),{encode:s})]}function Mj(t,e,n){const{axis:r={},legend:i={},slider:a={},scrollbar:o={}}=e,s=(t,e)=>{if("boolean"==typeof t)return t?{}:null;const n=t[e];return void 0===n||n?n:null},c="object"==typeof r?Array.from(new Set(["x","y","z",...Object.keys(r)])):["x","y","z"];return Q(e,{scale:Object.assign(Object.assign({},Object.fromEntries(c.map((t=>{const e=s(o,t);return[t,Object.assign({guide:s(r,t),slider:s(a,t),scrollbar:e},e&&{ratio:void 0===e.ratio?.5:e.ratio})]})))),{color:{guide:s(i,"color")},size:{guide:s(i,"size")},shape:{guide:s(i,"shape")},opacity:{guide:s(i,"opacity")}})}),[t,e]}function Oj(t,e,n){const{animate:r}=e;return r||void 0===r||Q(e,{animate:{enter:{type:null},exit:{type:null},update:{type:null}}}),[t,e]}function Sj(t,e,n){return Re(this,void 0,void 0,(function*(){const[r,i]=yield function(t,e,n){return Re(this,void 0,void 0,(function*(){const{library:r}=n,[i]=DP("transform",r),{preInference:a=[],postInference:o=[]}=e,{transform:s=[]}=t,c=[gj,vj,mj,yj,bj,xj,Ej,Oj,Mj,wj,...a.map(i),...s.map(i),...o.map(i),kj];let l=[],u=t;for(const t of c)[l,u]=yield t(l,u,n);return[l,u]}))}(t,e,n),{encode:a,scale:o,data:s,tooltip:c}=i;if(!1===Array.isArray(s))return null;const{channels:l}=e,u=er(Object.entries(a).filter((([,t])=>Ha(t))),(t=>t.map((([t,e])=>Object.assign({name:t},e)))),(([t])=>{var e;const n=null===(e=/([^\d]+)\d*$/.exec(t))||void 0===e?void 0:e[1],r=l.find((t=>t.name===n));return(null==r?void 0:r.independent)?t:n})),f=l.filter((t=>{const{name:e,required:n}=t;if(u.find((([t])=>t===e)))return!0;if(n)throw new Error(`Missing encoding for channel: ${e}.`);return!1})).flatMap((t=>{const{name:e,scale:n,scaleKey:r,range:i,quantitative:a,ordinal:s}=t;return u.filter((([t])=>t.startsWith(e))).map((([t,e],c)=>{const l=e.some((t=>t.visual)),u=e.some((t=>t.constant)),f=o[t]||{},{independent:h=!1,key:d=r||t,type:p=(u?"constant":l?"identity":n)}=f,g=Le(f,["independent","key","type"]),v="constant"===p,m=v?void 0:i;return{name:t,values:e,scaleKey:h||v?Symbol("independent"):d,scale:Object.assign(Object.assign({type:p,range:m},g),{quantitative:a,ordinal:s})}}))}));return[i,Object.assign(Object.assign({},e),{index:r,channels:f,tooltip:c})]}))}function Aj(t){const{type:e,value:n}=t;return"field"===e&&"string"==typeof n?n:null}function _j(t,e,n){var r;return Re(this,void 0,void 0,(function*(){const{library:i}=n,[a]=DP("composition",i),[o]=DP("interaction",i),s=new Set(Object.keys(i).map((t=>{var e;return null===(e=/mark\.(.*)/.exec(t))||void 0===e?void 0:e[1]})).filter(Ha)),c=new Set(Object.keys(i).map((t=>{var e;return null===(e=/component\.(.*)/.exec(t))||void 0===e?void 0:e[1]})).filter(Ha)),l=t=>{const{type:e}=t;if("function"==typeof e){const{props:t={}}=e,{composite:n=!0}=t;if(n)return"mark"}return"string"!=typeof e?e:s.has(e)||c.has(e)?"mark":e},u=t=>"mark"===l(t),f=t=>"standardView"===l(t),h=t=>{const{type:e}=t;return"string"==typeof e&&!!c.has(e)},d=t=>{if(f(t))return[t];const e=l(t);return a({type:e,static:h(t)})(t)},p=[],g=new Map,v=new Map,m=[t],y=[];for(;m.length;){const t=m.shift();if(f(t)){const e=v.get(t),[r,a]=e?jj(e,t,i):yield Cj(t,n);g.set(r,t),p.push(r);const o=a.flatMap(d).map((t=>FP(t,i)));if(m.push(...o),o.every(f)){const t=yield Promise.all(o.map((t=>Nj(t,n))));EL(t);for(let e=0;e<o.length;e++){const n=o[e],r=t[e];v.set(n,r)}}}else{const e=d(u(t)?t:yield Xj(t,n));Array.isArray(e)?m.push(...e):"function"==typeof e&&y.push(e())}}n.emitter.emit(m_.BEFORE_PAINT);const b=new Map,w=new Map,k=[];e.selectAll(Jj(qS)).data(p,(t=>t.key)).join((t=>t.append("g").attr("className",qS).attr("id",(t=>t.key)).call(Tj).each((function(t,e,r){Rj(t,am(r),k,n),b.set(t,r)}))),(t=>t.call(Tj).each((function(t,e,r){Rj(t,am(r),k,n),w.set(t,r)}))),(t=>t.each((function(t,e,n){const r=n.nameInteraction.values();for(const t of r)t.destroy()})).remove()));const E=(t,e,r)=>Array.from(t.entries()).map((([i,a])=>{const o=r||new Map,s=g.get(i),c=function(t,e,n){const{library:r}=n,i=function(t){const[,e]=DP("interaction",t);return t=>{const[n,r]=t;try{return[n,e(n)]}catch(t){return[n,r.type]}}}(r),a=t=>t[1]&&t[1].props&&t[1].props.reapplyWhenUpdate,o=qj(e),s=o.map(i).filter(a).map((t=>t[0]));return(e,r,i)=>Re(this,void 0,void 0,(function*(){const a=[],[o,c]=yield Cj(e,n);Rj(o,t,a,n);for(const i of s.filter((t=>t!==r)))Pj(i,t,e,o,n);for(const e of c)_j(e,t,n);return i(),{options:e,view:o}}))}(am(a),s,n);return{view:i,container:a,options:s,setState:(t,e=t=>t)=>o.set(t,e),update:(n,r)=>Re(this,void 0,void 0,(function*(){const i=za(Array.from(o.values()))(s);return yield c(i,n,(()=>{x(r)&&e(t,r,o)}))}))}})),M=(t=w,e,r)=>{var i;const a=E(t,M,r);for(const t of a){const{options:r,container:s}=t,c=s.nameInteraction;let l=qj(r);e&&(l=l.filter((t=>e.includes(t[0]))));for(const e of l){const[r,s]=e,l=c.get(r);if(l&&(null===(i=l.destroy)||void 0===i||i.call(l)),s){const e=Lj(t.view,r,s,o)(t,a,n.emitter);c.set(r,{destroy:e})}}}},O=E(b,M);for(const t of O){const{options:e}=t,r=new Map;t.container.nameInteraction=r;for(const i of qj(e)){const[e,a]=i;if(a){const i=Lj(t.view,e,a,o)(t,O,n.emitter);r.set(e,{destroy:i})}}}M();const{width:S,height:A}=t,_=[];for(const t of y){const r=new Promise((r=>Re(this,void 0,void 0,(function*(){for(const r of t){const t=Object.assign({width:S,height:A},r);yield _j(t,e,n)}r()}))));_.push(r)}n.views=p,null===(r=n.animations)||void 0===r||r.forEach((t=>null==t?void 0:t.cancel())),n.animations=k,n.emitter.emit(m_.AFTER_PAINT);const T=k.filter(Ha).map(Hj).map((t=>t.finished));return Promise.all([...T,..._])}))}function Tj(t){t.style("transform",(t=>`translate(${t.layout.x}, ${t.layout.y})`))}function Pj(t,e,n,r,i){var a;const{library:o}=i,[s]=DP("interaction",o),c=e.node().nameInteraction,l=qj(n).find((([e])=>e===t)),u=c.get(t);if(!u)return;if(null===(a=u.destroy)||void 0===a||a.call(u),!l[1])return;const f=Lj(r,t,l[1],s),h={options:n,view:r,container:e.node(),update:t=>Promise.resolve(t)},d=f(h,[],i.emitter);c.set(t,{destroy:d})}function Cj(t,e){return Re(this,void 0,void 0,(function*(){const{library:n}=e,r=yield function(t,e){return Re(this,void 0,void 0,(function*(){const{library:n}=e,[r,i]=DP("mark",n),a=new Set(Object.keys(n).map((t=>{var e;return null===(e=/component\.(.*)/.exec(t))||void 0===e?void 0:e[1]})).filter(Ha)),{marks:o}=t,s=[],c=[],l=[...o],{width:u,height:f}=function(t){const{height:e,width:n,padding:r=0,paddingLeft:i=r,paddingRight:a=r,paddingTop:o=r,paddingBottom:s=r,margin:c=16,marginLeft:l=c,marginRight:u=c,marginTop:f=c,marginBottom:h=c,inset:d=0,insetLeft:p=d,insetRight:g=d,insetTop:v=d,insetBottom:m=d}=t,y=t=>"auto"===t?20:t;return{width:n-y(i)-y(a)-l-u-p-g,height:e-y(o)-y(s)-f-h-v-m}}(t),h={options:t,width:u,height:f};for(;l.length;){const[t]=l.splice(0,1),n=yield Xj(t,e),{type:o=Wa("G2Mark type is required."),key:u}=n;if(a.has(o))c.push(n);else{const{props:t={}}=i(o),{composite:e=!0}=t;if(e){const{data:t}=n,e=Object.assign(Object.assign({},n),{data:t?Array.isArray(t)?t:t.value:t}),i=yield r(e,h),a=Array.isArray(i)?i:[i];l.unshift(...a.map(((t,e)=>Object.assign(Object.assign({},t),{key:`${u}-${e}`}))))}else s.push(n)}}return Object.assign(Object.assign({},t),{marks:s,components:c})}))}(t,e),i=function(t){const{coordinate:e={},interaction:n={},style:r={},marks:i}=t,a=Le(t,["coordinate","interaction","style","marks"]),o=i.map((t=>t.coordinate||{})),s=i.map((t=>t.interaction||{})),c=i.map((t=>t.viewStyle||{})),l=[...o,e].reduceRight(((t,e)=>Q(t,e)),{}),u=[n,...s].reduce(((t,e)=>Q(t,e)),{}),f=[...c,r].reduce(((t,e)=>Q(t,e)),{});return Object.assign(Object.assign({},a),{marks:i,coordinate:l,interaction:u,style:f})}(r);t.interaction=i.interaction,t.coordinate=i.coordinate,t.marks=[...i.marks,...i.components];const a=FP(i,n);return jj(yield Nj(a,e),a,n)}))}function Nj(t,e){return Re(this,void 0,void 0,(function*(){const{library:n}=e,[r]=DP("theme",n),[,i]=DP("mark",n),{theme:a,marks:o,coordinates:s=[]}=t,c=r(Uj(a)),l=new Map;for(const t of o){const{type:n}=t,{props:r={}}=i(n),a=yield Sj(t,r,e);if(a){const[t,e]=a;l.set(t,e)}}const u=Qn(Array.from(l.values()).flatMap((t=>t.channels)),(({scaleKey:t})=>t));for(const t of u.values()){const e=t.reduce(((t,{scale:e})=>Q(t,e)),{}),{scaleKey:r}=t[0],{values:i}=t[0],a=Array.from(new Set(i.map((t=>t.field)).filter(Ha))),o=Q({guide:{title:0===a.length?void 0:a},field:a[0]},e),{name:l}=t[0],u=t.flatMap((({values:t})=>t.map((t=>t.value)))),f=Object.assign(Object.assign({},bL(l,u,o,s,c,n)),{uid:Symbol("scale"),key:r});t.forEach((t=>t.scale=f))}return l}))}function Lj(t,e,n,r){const i=t.theme,a="string"==typeof e&&i[e]||{};return r(Q(a,Object.assign({type:e},n)))}function jj(t,e,n){var r;const[i]=DP("mark",n),[a]=DP("theme",n),[o]=DP("labelTransform",n),{key:s,frame:c=!1,theme:l,clip:u,style:f={},labelTransform:h=[]}=e,d=a(Uj(l)),p=Array.from(t.values()),g=function(t,e){var n;const{components:r=[]}=e,i=["scale","encode","axis","legend","data","transform"],a=Array.from(new Set(t.flatMap((t=>t.channels.map((t=>t.scale)))))),o=new Map(a.map((t=>[t.name,t])));for(const t of r){const e=ML(t);for(const r of e){const e=o.get(r),s=(null===(n=t.scale)||void 0===n?void 0:n[r])||{},{independent:c=!1}=s;if(e&&!c){const{guide:n}=e,r="boolean"==typeof n?{}:n;e.guide=Q({},r,t),Object.assign(e,s)}else{const e=Object.assign(Object.assign({},s),{expectedDomain:s.domain,name:r,guide:at(t,i)});a.push(e)}}}return a}(p,e),v=function(t){return t.map((t=>{const e=Q(t,t.style);return delete e.style,e}))}(zL(function(t,e,n){var r;for(const[e]of n.entries())if("cell"===e.type)return t.filter((t=>"shape"!==t.name));if(1!==e.length||t.some((t=>"shape"===t.name)))return t;const{defaultShape:i}=e[0];if(!["point","line","rect","hollow"].includes(i))return t;const a={point:"point",line:"hyphen",rect:"square",hollow:"hollow"},o=(null===(r=t.find((t=>"color"===t.name)))||void 0===r?void 0:r.field)||null,s={field:o,name:"shape",type:"constant",domain:[],range:[a[i]]};return[...t,s]}(Array.from(g),p,t),e,n)),m=lj(v,e,d,n),y=function(t,e,n){const[r]=DP("coordinate",n),{innerHeight:i,innerWidth:a,insetLeft:o,insetTop:s,insetRight:c,insetBottom:l}=t,{coordinates:u=[]}=e,f=(h=u).find((t=>"cartesian"===t.type||"cartesian3D"===t.type))?h:[...h,{type:"cartesian"}];var h;const d="cartesian3D"===f[0].type,p=Object.assign(Object.assign({},t),{x:o,y:s,width:a-o-c,height:i-l-s,transformations:f.flatMap(r)});return d?new JT(p):new XT(p)}(m,e,n),b=c?Q({mainLineWidth:1,mainStroke:"#000"},f):f;!function(t,e,n){const r=Qn(t,(t=>`${t.plane||"xy"}-${t.position}`)),{paddingLeft:i,paddingRight:a,paddingTop:o,paddingBottom:s,marginLeft:c,marginTop:l,marginBottom:u,marginRight:f,innerHeight:h,innerWidth:d,insetBottom:p,insetLeft:g,insetRight:v,insetTop:m,height:y,width:b,depth:x}=n,w={xy:fj({width:b,height:y,paddingLeft:i,paddingRight:a,paddingTop:o,paddingBottom:s,marginLeft:c,marginTop:l,marginBottom:u,marginRight:f,innerHeight:h,innerWidth:d,insetBottom:p,insetLeft:g,insetRight:v,insetTop:m}),yz:fj({width:x,height:y,paddingLeft:0,paddingRight:0,paddingTop:0,paddingBottom:0,marginLeft:0,marginTop:0,marginBottom:0,marginRight:0,innerWidth:x,innerHeight:y,insetBottom:0,insetLeft:0,insetRight:0,insetTop:0}),xz:fj({width:b,height:x,paddingLeft:0,paddingRight:0,paddingTop:0,paddingBottom:0,marginLeft:0,marginTop:0,marginBottom:0,marginRight:0,innerWidth:b,innerHeight:x,insetBottom:0,insetLeft:0,insetRight:0,insetTop:0})};for(const[t,n]of r.entries()){const[r,i]=t.split("-"),a=w[r][i],[o,s]=ro(n,(t=>"string"==typeof t.type&&("center"===i||!(!t.type.startsWith("axis")||!["inner","outer"].includes(i)))));o.length&&hj(o,e,a,i),s.length&&dj(n,0,a)}}(WL(v),y,m),function(t){const e=t.find((({type:t})=>"axisX"===t)),n=t.find((({type:t})=>"axisY"===t)),r=t.find((({type:t})=>"axisZ"===t));e&&n&&r&&(e.plane="xy",n.plane="xy",r.plane="yz",r.origin=[e.bbox.x,e.bbox.y,0],r.eulerAngles=[0,-90,0],r.bbox.x=e.bbox.x,r.bbox.y=e.bbox.y,t.push(Object.assign(Object.assign({},e),{plane:"xz",showLabel:!1,showTitle:!1,origin:[e.bbox.x,e.bbox.y,0],eulerAngles:[-90,0,0]})),t.push(Object.assign(Object.assign({},n),{plane:"yz",showLabel:!1,showTitle:!1,origin:[n.bbox.x+n.bbox.width,n.bbox.y,0],eulerAngles:[0,-90,0]})),t.push(Object.assign(Object.assign({},r),{plane:"xz",actualPosition:"left",showLabel:!1,showTitle:!1,eulerAngles:[90,-90,0]})))}(v);const x=new Map(Array.from(t.values()).flatMap((t=>{const{channels:e}=t;return e.map((({scale:t})=>[t.uid,kL(t,n)]))})));!function(t,e){const n=Array.from(t.values()).flatMap((t=>t.channels)),r=er(n,(t=>t.map((t=>e.get(t.scale.uid)))),(t=>t.name)).filter((([,t])=>t.some((t=>"function"==typeof t.getOptions().groupTransform))&&t.every((t=>t.getTicks)))).map((t=>t[1]));r.forEach((t=>{const e=t.map((t=>t.getOptions().groupTransform))[0];e(t)}))}(t,x);const w={};for(const t of v){const{scales:e=[]}=t,i=[];for(const t of e){const{name:e,uid:a}=t,o=null!==(r=x.get(a))&&void 0!==r?r:kL(t,n);i.push(o),"y"===e&&o.update(Object.assign(Object.assign({},o.getOptions()),{xScale:w.x})),wL(w,{[e]:o})}t.scaleInstances=i}const k=[],E=new Map;for(const[e,n]of t.entries()){const{children:t,dataDomain:r,modifier:a,key:o,data:c}=e;E.set(o,c);const{index:l,channels:u,tooltip:f}=n,h=Object.fromEntries(u.map((({name:t,scale:e})=>[t,e]))),d=Ja(h,(({uid:t})=>x.get(t)));wL(w,d);const p=xL(u,d),g=i(e),[v,b,M]=Ij(g(l,d,p,y)),O=r||v.length,S=a?a(b,O,m):[],A=t=>{var e,n;return null===(n=null===(e=f.title)||void 0===e?void 0:e[t])||void 0===n?void 0:n.value},_=t=>f.items.map((e=>e[t])),T=v.map(((t,e)=>{const n=Object.assign({points:b[e],transform:S[e],index:t,markKey:o,viewKey:s,data:c[t]},f&&{title:A(t),items:_(t)});for(const[r,i]of Object.entries(p))n[r]=i[t],M&&(n[`series${$(r)}`]=M[e].map((t=>i[t])));return M&&(n.seriesIndex=M[e]),M&&f&&(n.seriesItems=M[e].map((t=>_(t))),n.seriesTitle=M[e].map((t=>A(t)))),n}));n.data=T,n.index=v;const P=null==t?void 0:t(T,d,m);k.push(...P||[])}return[{layout:m,theme:d,coordinate:y,markState:t,key:s,clip:u,scale:w,style:b,components:v,data:E,labelTransform:za(h.map(o))},k]}function Rj(t,e,n,r){return Re(this,void 0,void 0,(function*(){const{library:i}=r,{components:a,theme:o,layout:s,markState:c,coordinate:l,key:u,style:f,clip:h,scale:d}=t,{x:p,y:g,width:v,height:m}=s,y=Le(s,["x","y","width","height"]),b=["view","plot","main","content"],x=b.map(((t,e)=>e)),w=b.map((t=>Ua(Object.assign({},o.view,f),t))),k=["a","margin","padding","inset"].map((t=>Va(y,t))),E=t=>t.style("x",(t=>_[t].x)).style("y",(t=>_[t].y)).style("width",(t=>_[t].width)).style("height",(t=>_[t].height)).each((function(t,e,n){!function(t,e){for(const[n,r]of Object.entries(e))t.style(n,r)}(am(n),w[t])}));let M=0,O=0,S=v,A=m;const _=x.map((t=>{const e=k[t],{left:n=0,top:r=0,bottom:i=0,right:a=0}=e;return M+=n,O+=r,S-=n+a,A-=r+i,{x:M,y:O,width:S,height:A}}));e.selectAll(Jj(QS)).data(x.filter((t=>Ha(w[t]))),(t=>b[t])).join((t=>t.append("rect").attr("className",QS).style("zIndex",-2).call(E)),(t=>t.call(E)),(t=>t.remove()));const T=function(t){let e=-1/0,n=1/0;for(const[r,i]of t){const{animate:t={}}=r,{data:a}=i,{enter:o={},update:s={},exit:c={}}=t,{type:l,duration:u=300,delay:f=0}=s,{type:h,duration:d=300,delay:p=0}=o,{type:g,duration:v=300,delay:m=0}=c;for(const t of a){const{updateType:r=l,updateDuration:i=u,updateDelay:a=f,enterType:o=h,enterDuration:s=d,enterDelay:c=p,exitDuration:y=v,exitDelay:b=m,exitType:x=g}=t;(void 0===r||r)&&(e=Math.max(e,i+a),n=Math.min(n,a)),(void 0===x||x)&&(e=Math.max(e,y+b),n=Math.min(n,b)),(void 0===o||o)&&(e=Math.max(e,s+c),n=Math.min(n,c))}}return e===-1/0?null:[n,e-n]}(c),P=!!T&&{duration:T[1]};for(const[,t]of Jn(a,(t=>`${t.type}-${t.position}`)))t.forEach(((t,e)=>t.index=e));const C=e.selectAll(Jj(KS)).data(a,(t=>`${t.type}-${t.position}-${t.index}`)).join((t=>t.append("g").style("zIndex",(({zIndex:t})=>t||-1)).attr("className",KS).append((t=>GL(Q({animate:P,scale:d},t),l,o,i,c)))),(t=>t.transition((function(t,e,n){const{preserve:r=!1}=t;if(r)return;const a=GL(Q({animate:P,scale:d},t),l,o,i,c),{attributes:s}=a,[u]=n.childNodes;return u.update(s,!1)})))).transitions();n.push(...C.flat().filter(Ha));const N=e.selectAll(Jj(XS)).data([s],(()=>u)).join((t=>t.append("rect").style("zIndex",0).style("fill","transparent").attr("className",XS).call(Kj).call(Qj,Array.from(c.keys())).call(tR,h)),(t=>t.call(Qj,Array.from(c.keys())).call((t=>T?function(t,e){const[n,r]=e;t.transition((function(t,e,i){const{transform:a,width:o,height:s}=i.style,{paddingLeft:c,paddingTop:l,innerWidth:u,innerHeight:f,marginLeft:h,marginTop:d}=t,p=[{transform:a,width:o,height:s},{transform:`translate(${c+h}, ${l+d})`,width:u,height:f}];return i.animate(p,{delay:n,duration:r,fill:"both"})}))}(t,T):Kj(t))).call(tR,h))).transitions();n.push(...N.flat());for(const[a,o]of c.entries()){const{data:s}=o,{key:c,class:l,type:u}=a,f=e.select(`#${c}`),h=zj(a,o,t,r),d=$j(a,o,t,i),p=Yj(a,o,t,i),g=Vj(a,o,t,i),v=Bj(e,f,l,"element"),m=f.selectAll(Jj(US)).selectFacetAll(v).data(s,(t=>t.key),(t=>t.groupKey)).join((t=>t.append(h).attr("className",US).attr("markType",u).transition((function(t,e,n){return d(t,[n])}))),(t=>t.call((t=>{const e=t.parent(),n=Ya((t=>{const[e,n]=t.getBounds().min;return[e,n]}));t.transition((function(t,r,i){Fj(i,e,n);const a=h(t,r),o=p(t,[i],[a]);return(null==o?void 0:o.length)||(i.nodeName===a.nodeName&&"g"!==a.nodeName?$a(i,a):(i.parentNode.replaceChild(a,i),a.className=US,a.markType=u,a.__data__=i.__data__)),o})).attr("markType",u).attr("className",US)}))),(t=>t.each((function(t,e,n){n.__removed__=!0})).transition((function(t,e,n){return g(t,[n])})).remove()),(t=>t.append(h).attr("className",US).attr("markType",u).transition((function(t,e,n){const{__fromElements__:r}=n,i=p(t,r,[n]);return new om(r,null,n.parentNode).transition(i).remove(),i}))),(t=>t.transition((function(t,e,n){const r=new om([],n.__toData__,n.parentNode).append(h).attr("className",US).attr("markType",u).nodes();return p(t,[n],r)})).remove())).transitions();n.push(...m.flat())}!function(t,e,n,r,i){const[a]=DP("labelTransform",r),{markState:o,labelTransform:s}=t,c=e.select(Jj(VS)).node(),l=new Map,u=new Map,f=Array.from(o.entries()).flatMap((([n,a])=>{const{labels:o=[],key:s}=n,c=function(t,e,n,r,i){const[a]=DP("shape",r),{data:o,encode:s}=t,{data:c,defaultLabelShape:l}=e,u=c.map((t=>t.points)),f=Ja(s,(t=>t.value)),{theme:h,coordinate:d}=n,p=Object.assign(Object.assign({},i),{document:BP(i),theme:h,coordinate:d});return t=>{const{index:e,points:n}=t,r=o[e],{formatter:i=t=>`${t}`,transform:s,style:c,render:d,selector:g,element:v}=t,m=Le(t,["formatter","transform","style","render","selector","element"]),y=Ja(Object.assign(Object.assign({},m),c),(t=>Dj(t,r,e,o,{channel:f,element:v}))),{shape:b=l,text:x}=y,w=Le(y,["shape","text"]),k="string"==typeof i?bO(i):i,E=Object.assign(Object.assign({},w),{text:k(x,r,e,o),datum:r}),M=Object.assign({type:`label.${b}`,render:d},w);return a(M,p)(n,E,Gj(h,"label",b,"label"),u)}}(n,a,t,r,i),f=e.select(`#${s}`).selectAll(Jj(US)).nodes().filter((t=>!t.__removed__));return o.flatMap(((t,e)=>{const n=Le(t,["transform"]);return f.flatMap((r=>{const i=function(t,e,n){const{seriesIndex:r,seriesKey:i,points:a,key:o,index:s}=n.__data__,c=function(t){const e=t.cloneNode(!0),n=t.getAnimations();e.style.visibility="hidden",n.forEach((t=>{const n=t.effect.getKeyframes();e.attr(n[n.length-1])})),t.parentNode.appendChild(e);const r=e.getLocalBounds();e.destroy();const{min:i,max:a}=r;return[i,a]}(n);if(!r)return[Object.assign(Object.assign({},t),{key:`${o}-${e}`,bounds:c,index:s,points:a,dependentElement:n})];const l=function(t){const{selector:e}=t;if(!e)return null;if("function"==typeof e)return e;if("first"===e)return t=>[t[0]];if("last"===e)return t=>[t[t.length-1]];throw new Error(`Unknown selector: ${e}`)}(t),u=r.map(((r,o)=>Object.assign(Object.assign({},t),{key:`${i[o]}-${e}`,bounds:[a[o]],index:r,points:a,dependentElement:n})));return l?l(u):u}(n,e,r);return i.forEach((e=>{l.set(e,(t=>c(Object.assign(Object.assign({},t),{element:r})))),u.set(e,t)})),i}))}))})),h=am(c).selectAll(Jj(ZS)).data(f,(t=>t.key)).join((t=>t.append((t=>l.get(t)(t))).attr("className",ZS)),(t=>t.each((function(t,e,n){$a(n,l.get(t)(t))}))),(t=>t.remove())).nodes(),d=Qn(h,(t=>u.get(t.__data__))),{coordinate:p,layout:g}=t,v={canvas:i.canvas,coordinate:p,layout:g};for(const[t,e]of d){const{transform:n=[]}=t;za(n.map(a))(e,v)}s&&s(h,v)}(t,e,0,i,r)}))}function Ij([t,e,n]){if(n)return[t,e,n];const r=[],i=[];for(let n=0;n<t.length;n++){const a=t[n],o=e[n];o.every((([t,e])=>Ha(t)&&Ha(e)))&&(r.push(a),i.push(o))}return[r,i]}function Dj(t,e,n,r,i){return"function"==typeof t?t(e,n,r,i):"string"!=typeof t?t:Ka(e)&&void 0!==e[t]?e[t]:t}function Bj(t,e,n,r){const i=t.node().parentElement;return i&&"function"==typeof i.findAll?i.findAll((t=>void 0!==t.style.facet&&t.style.facet===n&&t!==e.node())).flatMap((t=>t.getElementsByClassName(r))):[]}function Fj(t,e,n){if(!t.__facet__)return;const r=t.parentNode.parentNode,i=e.parentNode,[a,o]=n(r),[s,c]=n(i);!function(t,e){const{transform:n}=t.style,r=(t=>"none"===t||void 0===t)(n)?"":n;t.style.transform=`${r} ${e}`.trimStart()}(t,`translate(${a-s}, ${o-c})`),e.append(t)}function zj(t,e,n,r){const{library:i}=r,[a]=DP("shape",i),{data:o,encode:s}=t,{defaultShape:c,data:l,shape:u}=e,f=Ja(s,(t=>t.value)),h=l.map((t=>t.points)),{theme:d,coordinate:p}=n,{type:g,style:v={}}=t,m=Object.assign(Object.assign({},r),{document:BP(r),coordinate:p,theme:d});return e=>{const{shape:n=c}=v,{shape:r=n,points:i,seriesIndex:s,index:l}=e,p=Le(e,["shape","points","seriesIndex","index"]),y=Object.assign(Object.assign({},p),{index:l}),b=s?s.map((t=>o[t])):o[l],x=s||l,w=Ja(v,(t=>Dj(t,b,x,o,{channel:f})));return(u[r]?u[r](w,m):a(Object.assign(Object.assign({},w),{type:Zj(t,r)}),m))(i,y,Gj(d,g,r,c),h)}}function Gj(t,e,n,r){if("string"!=typeof e)return;const{color:i}=t,a=t[e]||{},o=a[n]||a[r];return Object.assign({color:i},o)}function Wj(t,e,n,r,i){var a,o;const[,s]=DP("shape",i),[c]=DP("animation",i),{defaultShape:l,shape:u}=n,{theme:f,coordinate:h}=r,d=`default${$(t)}Animation`,{[d]:p}=(null===(a=u[l])||void 0===a?void 0:a.props)||s(Zj(e,l)).props,{[t]:g={}}=f,v=(null===(o=e.animate)||void 0===o?void 0:o[t])||{},m={coordinate:h};return(e,n,r)=>{const{[`${t}Type`]:i,[`${t}Delay`]:a,[`${t}Duration`]:o,[`${t}Easing`]:s}=e,l=Object.assign({type:i||p},v);if(!l.type)return null;const u=c(l,m)(n,r,Q(g,{delay:a,duration:o,easing:s}));let f=[];return f=Array.isArray(u)?u:[u],f.filter(Boolean)}}function $j(t,e,n,r){return Wj("enter",t,e,n,r)}function Hj(t){return t.finished.then((()=>{t.cancel()})),t}function Yj(t,e,n,r){return Wj("update",t,e,n,r)}function Vj(t,e,n,r){return Wj("exit",t,e,n,r)}function Uj(t={}){if("string"==typeof t)return{type:t};const{type:e="light"}=t,n=Le(t,["type"]);return Object.assign(Object.assign({},n),{type:e})}function qj(t){const{interaction:e={}}=t;return Object.entries(Q({event:!0,tooltip:!0,sliderFilter:!0,legendFilter:!0,scrollbarFilter:!0},e)).reverse()}function Xj(t,e){return Re(this,void 0,void 0,(function*(){const{data:n}=t,r=Le(t,["data"]);if(null==n)return t;const[,{data:i}]=yield vj(0,{data:n},e);return Object.assign({data:i},r)}))}function Kj(t){t.style("transform",(t=>`translate(${t.paddingLeft+t.marginLeft}, ${t.paddingTop+t.marginTop})`)).style("width",(t=>t.innerWidth)).style("height",(t=>t.innerHeight))}function Zj(t,e){const{type:n}=t;return"string"==typeof e?`${n}.${e}`:e}function Qj(t,e){const n=t=>void 0!==t.class?`${t.class}`:"";if(0===t.nodes().length)return;t.selectAll(Jj(YS)).data(e,(t=>t.key)).join((t=>t.append("g").attr("className",YS).attr("id",(t=>t.key)).style("facet",n).style("fill","transparent").style("zIndex",(t=>{var e;return null!==(e=t.zIndex)&&void 0!==e?e:0}))),(t=>t.style("facet",n).style("fill","transparent").style("zIndex",(t=>{var e;return null!==(e=t.zIndex)&&void 0!==e?e:0}))),(t=>t.remove()));t.select(Jj(VS)).node()||t.append("g").attr("className",VS).style("zIndex",0)}function Jj(...t){return t.map((t=>`.${t}`)).join("")}function tR(t,e){t.node()&&t.style("clipPath",(t=>{if(!e)return null;const{paddingTop:n,paddingLeft:r,marginLeft:i,marginTop:a,innerWidth:o,innerHeight:s}=t;return new $g({style:{x:r+i,y:n+a,width:o,height:s}})}))}function eR(t){const{style:e,scale:n,type:r}=t,i={},a=rt(e,"columnWidthRatio");return a&&"interval"===r&&(i.x=Object.assign(Object.assign({},null==n?void 0:n.x),{padding:1-a})),Object.assign(Object.assign({},t),{scale:Object.assign(Object.assign({},n),i)})}function nR(t){const e=function(t){return function(...t){return e=>t.reduce(((t,e)=>e(t)),e)}(eR)(t)}(t);return e.children&&Array.isArray(e.children)&&(e.children=e.children.map((t=>nR(t)))),e}function rR(t){const e=Q({},t),n=new Map([[e,null]]),r=new Map([[null,-1]]),i=[e];for(;i.length;){const t=i.shift();if(void 0===t.key){const e=n.get(t),i=r.get(t),a=null===e?"0":`${e.key}-${i}`;t.key=a}const{children:e=[]}=t;if(Array.isArray(e))for(let a=0;a<e.length;a++){const o=Q({},e[a]);e[a]=o,n.set(o,t),r.set(o,a),i.push(o)}}return e}function iR(t,e){const n=new h_;return n.registerPlugin(new p_),new ov({width:t,height:e,container:document.createElement("div"),renderer:n})}function aR(t,e={},n=()=>{},r=t=>{throw t}){const i=z_(t),{width:a=640,height:o=480,depth:s=0}=i,c=rR(nR(i)),{canvas:l=iR(a,o),emitter:u=new v_,library:f}=e;e.canvas=l,e.emitter=u;const{width:h,height:d}=l.getConfig();h===a&&d===o||l.resize(a,o),u.emit(m_.BEFORE_RENDER);const p=am(l.document.documentElement);return l.ready.then((()=>_j(Object.assign(Object.assign({},c),{width:a,height:o,depth:s}),p,e))).then((()=>{if(s){const[t,e]=l.document.documentElement.getPosition();l.document.documentElement.setPosition(t,e,-s/2)}l.requestAnimationFrame((()=>{l.requestAnimationFrame((()=>{u.emit(m_.AFTER_RENDER),null==n||n()}))}))})).catch((t=>{null==r||r(t)})),"string"==typeof(g=l.getConfig().container)?document.getElementById(g):g;var g}function oR(t,e={},n=!1,r=!0){const{canvas:i,emitter:a}=e;i&&(!function(t){const e=t.getRoot().querySelectorAll(`.${qS}`);null==e||e.forEach((t=>{const{nameInteraction:e=new Map}=t;(null==e?void 0:e.size)>0&&Array.from(null==e?void 0:e.values()).forEach((t=>{null==t||t.destroy()}))}))}(i),n?i.destroy():i.destroyChildren()),r&&a.off()}function sR(t,e){if(e(t))return!0;if("g"===t.tagName){const{childNodes:n=[]}=t;for(const t of n)if(sR(t,e))return!0}return!1}const cR={visibility:"visible",opacity:1,fillOpacity:1,strokeOpacity:1};function lR(t,e){let n;return sR(t,(t=>{var r;return"g"!==t.tagName&&void 0!==(null===(r=t.style)||void 0===r?void 0:r[e])&&(n=t.style[e],!0)})),null!=n?n:cR[e]}function uR(t,e,n,r){t.style[e]=n,r&&t.children.forEach((t=>uR(t,e,n,r)))}function fR(t){uR(t,"visibility","hidden",!0)}function hR(t){uR(t,"visibility","visible",!0)}function dR(t){return am(t).selectAll(`.${US}`).nodes().filter((t=>!t.__removed__))}function pR(t,e){return gR(t,e).flatMap((({container:t})=>dR(t)))}function gR(t,e){return e.filter((e=>e!==t&&e.options.parentKey===t.options.key))}function vR(t){return am(t).select(`.${XS}`).node()}function mR(t){if("g"===t.tagName)return t.getRenderBounds();const e=t.getGeometryBounds(),n=new au;return n.setFromTransformedAABB(e,t.getWorldTransform()),n}function yR(t,e){const{offsetX:n,offsetY:r}=e,i=mR(t),{min:[a,o],max:[s,c]}=i;return n<a||n>s||(r<o||r>c)?null:[n-a,r-o]}function bR(t,e){const{offsetX:n,offsetY:r}=e,[i,a,o,s]=function(t){const e=t.getRenderBounds(),{min:[n,r],max:[i,a]}=e;return[n,r,i,a]}(t);return[Math.min(o,Math.max(i,n))-i,Math.min(s,Math.max(a,r))-a]}function xR(t){return t=>t.__data__.color}function wR(t){return t=>t.__data__.x}function kR(t){const e=Array.isArray(t)?t:[t],n=new Map(e.flatMap((t=>Array.from(t.markState.keys()).map((e=>[_R(t.key,e.key),e.data])))));return t=>{const{index:e,markKey:r,viewKey:i}=t.__data__;return n.get(_R(i,r))[e]}}const ER={selected:3,unselected:3,active:2,inactive:2,default:1},MR={selection:["selected","unselected"],highlight:["active","inactive"]},OR=(t,e,n)=>{sR(t,(t=>{"setAttribute"in t&&"function"==typeof t.setAttribute&&t.setAttribute(e,n)}))};function SR(t,e){return e.forEach((e=>{const n=e.__interactionStyle__;e.__interactionStyle__=n?Object.assign(Object.assign({},n),t):t})),(t=(t,e)=>t,e=OR)=>AR(void 0,t,e)}function AR(t,e=(t,e)=>t,n=OR){const r="__states__",i="__ordinal__",a=t=>ER[t]||ER.default,o=t=>{var e;return null===(e=Object.entries(MR).find((([e,n])=>n.includes(t))))||void 0===e?void 0:e[0]},s=o=>{var s;const{[r]:c=[],[i]:l={}}=o,u=[...c].sort(((t,e)=>a(e)-a(t))),f=new Map;for(const e of u){const n=(null===(s=null!=t?t:o.__interactionStyle__)||void 0===s?void 0:s[e])||{};for(const[t,e]of Object.entries(n))f.has(t)||f.set(t,e)}const h=Object.assign({},l);for(const[t,e]of f.entries())h[t]=e;if(0!==Object.keys(h).length){for(const[t,r]of Object.entries(h)){const i=lR(o,t),a=e(r,o);n(o,t,a),t in l||(l[t]=i)}o[i]=l}},c=t=>{t[r]||(t[r]=[])};return{setState:(t,...e)=>{c(t),t[r]=[...e],s(t)},updateState:(t,...e)=>{c(t);const n=t[r],i=new Set(e.map((t=>o(t))).filter((t=>void 0!==t))),a=n.filter((t=>!i.has(o(t))));t[r]=[...a,...e],s(t)},removeState:(t,...e)=>{c(t);for(const n of e){const e=t[r].indexOf(n);-1!==e&&t[r].splice(e,1)}s(t)},hasState:(t,e)=>(c(t),-1!==t[r].indexOf(e))}}function _R(t,e){return`${t},${e}`}function TR(t,e){const n=(Array.isArray(t)?t:[t]).flatMap((t=>t.marks.map((e=>[_R(t.key,e.key),e.state])))),r={};for(const t of e){const[e,i]=Array.isArray(t)?t:[t,{}];r[e]=n.reduce(((t,n)=>{const[r,a={}]=n,o=void 0===(s=a[e])||"object"==typeof s&&0===Object.keys(s).length?i:a[e];var s;for(const[e,n]of Object.entries(o)){const i=t[e],a=(t,e,a,o)=>{const s=_R(o.__data__.viewKey,o.__data__.markKey);return r!==s?null==i?void 0:i(t,e,a,o):"function"!=typeof n?n:n(t,e,a,o)};t[e]=a}return t}),{})}return r}function PR(t,e){const n=new Map(t.map(((t,e)=>[t,e]))),r=e?t.map(e):t;return(t,i)=>{if("function"!=typeof t)return t;const a=n.get(i);return t(e?e(i):i,a,r,i)}}function CR(t){var{link:e=!1,valueof:n=(t,e)=>t,coordinate:r}=t,i=Le(t,["link","valueof","coordinate"]);if(!e)return[()=>{},()=>{}];const a=t=>t.__data__.points,o=(t,e)=>{const[,n,r]=t,[i,,,a]=e;return[n,i,a,r]};return[t=>{var e;if(t.length<=1)return;const r=rr(t,((t,e)=>{const{x:n}=t.__data__,{x:r}=e.__data__;return n-r}));for(let t=1;t<r.length;t++){const s=rc(),c=r[t-1],l=r[t],[u,f,h,d]=o(a(c),a(l));s.moveTo(...u),s.lineTo(...f),s.lineTo(...h),s.lineTo(...d),s.closePath();const p=Ja(i,(t=>n(t,c))),{fill:g=c.getAttribute("fill")}=p,v=Le(p,["fill"]),m=new Bg({className:"element-link",style:Object.assign({d:s.toString(),fill:g,zIndex:-2},v)});null===(e=c.link)||void 0===e||e.remove(),c.parentNode.appendChild(m),c.link=m}},t=>{var e;null===(e=t.link)||void 0===e||e.remove(),t.link=null}]}function NR(t,e,n){const r=e=>{const{transform:n}=t.style;return n?`${n} ${e}`:e};if(Uc(n)){const{points:i}=t.__data__,[a,o]=Vc(n)?hm(i):i,s=n.getCenter(),c=ws(a,s),l=ws(o,s),u=Ms(c)+Ss(c,l)/2;return r(`translate(${e*Math.cos(u)}, ${e*Math.sin(u)})`)}return Vc(n)?r(`translate(${e}, 0)`):r(`translate(0, ${-e})`)}function LR(t){var{document:e,background:n,scale:r,coordinate:i,valueof:a}=t,o=Le(t,["document","background","scale","coordinate","valueof"]);const s="element-background";if(!n)return[()=>{},()=>{}];const c=(t,e,n)=>{const r=t.invert(e),i=e+t.getBandWidth(r)/2,a=t.getStep(r)/2,o=a*n;return[i-a+o,i+a-o]},l=(t,n)=>{const{padding:a}=n,[o,s]=((t,e)=>{const{x:n}=r;if(!sS(n))return[0,1];const{__data__:i}=t,{x:a}=i,[o,s]=c(n,a,e);return[o,s]})(t,a),[l,u]=((t,e)=>{const{y:n}=r;if(!sS(n))return[0,1];const{__data__:i}=t,{y:a}=i,[o,s]=c(n,a,e);return[o,s]})(t,a),f=[[o,l],[s,l],[s,u],[o,u]].map((t=>i.map(t))),{__data__:h}=t,{y:d,y1:p}=h;return mm(e,f,{y:d,y1:p},i,n)},u=(t,e)=>{const{transform:n="scale(1.2, 1.2)",transformOrigin:r="center center",stroke:i=""}=e,a=Le(e,["transform","transformOrigin","stroke"]),o=Object.assign({transform:n,transformOrigin:r,stroke:i},a),s=t.cloneNode(!0);for(const[t,e]of Object.entries(o))s.style[t]=e;return s};return[t=>{t.background&&t.background.remove();const e=Ja(o,(e=>a(e,t))),{fill:n="#CCD6EC",fillOpacity:i=.3,zIndex:c=-2,padding:f=.001,lineWidth:h=0}=e,d=Le(e,["fill","fillOpacity","zIndex","padding","lineWidth"]),p=Object.assign(Object.assign({},d),{fill:n,fillOpacity:i,zIndex:c,padding:f,lineWidth:h}),g=(()=>{const{x:t,y:e}=r;return[t,e].some(sS)})()?l:u,v=g(t,p);v.className=s,t.parentNode.parentNode.appendChild(v),t.background=v},t=>{var e;null===(e=t.background)||void 0===e||e.remove(),t.background=null},t=>t.className===s]}function jR(t,e){const n=t.getRootNode().defaultView.getContextService().getDomElement();(null==n?void 0:n.style)&&(t.cursor=n.style.cursor,n.style.cursor=e)}function RR(t){jR(t,t.cursor)}function IR(t,e,n){return t.find((t=>Object.entries(e).every((([e,r])=>n(t)[e]===r))))}function DR(t,e){return Math.sqrt(Math.pow(t[0]-e[0],2)+Math.pow(t[1]-e[1],2))}function BR(t,e=!1){const n=m(t,(t=>!!t)).map(((t,e)=>[0===e?"M":"L",...t]));return e&&n.push(["Z"]),n}function FR(t){return t.querySelectorAll(".element")}function zR(t,e){if(e(t))return t;let n=t.parent;for(;n&&!e(n);)n=n.parent;return n}const GR=["interval","point","density"];function WR({elementsof:t,root:e,coordinate:n,scale:r,validFindByXMarks:i=GR}){var a,o;let s=t(e);const c=t=>i.includes(t.markType);if(s.find(c)){s=s.filter(c);const t=r.x,i=r.series,l=null!==(o=null===(a=null==t?void 0:t.getBandWidth)||void 0===a?void 0:a.call(t))&&void 0!==o?o:0,u=i?t=>{var e,n;const r=Math.round(1/(null!==(e=i.valueBandWidth)&&void 0!==e?e:1));return t.__data__.x+(null!==(n=t.__data__.series)&&void 0!==n?n:0)*l+l/(2*r)}:t=>t.__data__.x+l/2;return s.sort(((t,e)=>u(t)-u(e))),t=>{const r=yR(e,t);if(!r)return;const[i]=n.invert(r),a=(0,Dn(u).center)(s,i);return s[a]}}return t=>{const{target:e}=t;return zR(e,(t=>!!t.classList&&t.classList.includes("element")))}}function $R(t){var{delay:e,createGroup:n,createRegionGroup:r,background:i=!1,link:a=!1}=t,o=Le(t,["delay","createGroup","createRegionGroup","background","link"]);return(t,s,c)=>{const{container:l,view:u,options:f}=t,{scale:h,coordinate:d}=u;return function(t,{elements:e,datum:n,groupKey:r=t=>t,regionGroupKey:i=t=>t,link:a=!1,background:o=!1,delay:s=60,scale:c,coordinate:l,emitter:u,state:f={},region:h=!1,regionEleFilter:d=t=>GR.includes(t.markType)}){var p,g;const v=null!==(p=e(t))&&void 0!==p?p:[],m=h?v.filter(d):v,y=new Set(m),b=h?i:r,x=Qn(m,b),w=WR({elementsof:e,root:t,coordinate:l,scale:c}),k=PR(m,n),[E,M]=CR(Object.assign({elements:m,valueof:k,link:a,coordinate:l},Va(f.active,"link"))),[O,S,A]=LR(Object.assign({document:t.ownerDocument,scale:c,coordinate:l,background:o,valueof:k},Va(f.active,"background"))),_=Q(f,{active:Object.assign({},(null===(g=f.active)||void 0===g?void 0:g.offset)&&{transform:(...t)=>{const e=f.active.offset(...t),[,n]=t;return NR(m[n],e,l)}})}),T=SR(_,m),{updateState:P,removeState:C,hasState:N}=T(k);let L;const j=t=>{const{nativeEvent:e=!0}=t;let r=t.target;if(h&&(r=w(t)),!y.has(r))return;L&&clearTimeout(L);const i=b(r),a=x.get(i),o=new Set(a);for(const t of m)o.has(t)?N(t,"active")||P(t,"active"):(P(t,"inactive"),M(t)),t!==r&&S(t);O(r),E(a),e&&u.emit("element:highlight",{nativeEvent:e,data:{data:n(r),group:a.map(n)}})},R=()=>{L&&clearTimeout(L),L=setTimeout((()=>{I(),L=null}),s)},I=(t=!0)=>{for(const t of m)C(t,"active","inactive"),S(t),M(t);t&&u.emit("element:unhighlight",{nativeEvent:t})},D=t=>{let e=t.target;h&&(e=w(t)),e?o&&!A(e)||(o||y.has(e))&&(s>0?R():I()):s>0?R():I()},B=()=>{I()};t.addEventListener("pointerover",j),t.addEventListener("pointermove",j),t.addEventListener("pointerout",D),t.addEventListener("pointerleave",B);const F=t=>{const{nativeEvent:e}=t;e||I(!1)},z=t=>{const{nativeEvent:e}=t;if(e)return;const{data:r}=t.data,i=IR(m,r,n);i&&j({target:i,nativeEvent:!1})};return u.on("element:highlight",z),u.on("element:unhighlight",F),()=>{t.removeEventListener("pointerover",j),t.removeEventListener("pointermove",j),t.removeEventListener("pointerout",D),t.removeEventListener("pointerleave",B),u.off("element:highlight",z),u.off("element:unhighlight",F);for(const t of m)S(t),M(t)}}(vR(l),Object.assign({elements:dR,datum:kR(u),groupKey:n?n(u):void 0,regionGroupKey:r?r(u):t=>t.__data__.x,coordinate:d,scale:h,state:TR(f,[["active",i?{}:{lineWidth:"1",stroke:"#000"}],"inactive"]),background:i,link:a,delay:e,emitter:c},o))}}function HR(t){return $R(Object.assign(Object.assign({},t),{createGroup:wR}))}function YR(t){return $R(Object.assign(Object.assign({},t),{createGroup:xR}))}function VR(t,{elements:e,datum:n,groupKey:r=t=>t,regionGroupKey:i=t=>t,link:a=!1,single:o=!1,multipleSelectHotkey:s,coordinate:c,background:l=!1,scale:u,emitter:f,state:h={},region:d=!1,regionEleFilter:p=t=>GR.includes(t.markType)}){var g;const v=e(t),m=new Set(v),y=WR({elementsof:e,root:t,coordinate:c,scale:u}),b=Qn(v,r),x=Qn(v,i),w=PR(v,n),[k,E]=CR(Object.assign({link:a,elements:v,valueof:w,coordinate:c},Va(h.selected,"link"))),[M,O]=LR(Object.assign({document:t.ownerDocument,background:l,coordinate:c,scale:u,valueof:w},Va(h.selected,"background"))),S=Q(h,{selected:Object.assign({},(null===(g=h.selected)||void 0===g?void 0:g.offset)&&{transform:(...t)=>{const e=h.selected.offset(...t),[,n]=t;return NR(v[n],e,c)}})}),A=SR(S,v),{updateState:_,removeState:T,hasState:P}=A(w);let C=!o,N=null;const L=(t=!0)=>{for(const t of v)T(t,"selected","unselected"),E(t),O(t);t&&f.emit("element:unselect",{nativeEvent:!0})},j=({event:t,element:e,nativeEvent:i=!0,filter:a=t=>!0,groupBy:o=r,groupMap:s=b})=>{const c=v.filter(a);if(P(e,"selected"))L();else{const r=o(e),a=s.get(r),l=new Set(a);for(const t of c)l.has(t)?_(t,"selected"):(_(t,"unselected"),E(t)),t!==e&&O(t);if(k(a),M(e),!i)return;f.emit("element:select",Object.assign(Object.assign({},t),{nativeEvent:i,data:{data:[n(e),...a.map(n)]}}))}},R=({event:t,element:e,nativeEvent:i=!0,filter:o=t=>!0,groupBy:s=r,groupMap:c=b})=>{const l=s(e),u=c.get(l),h=new Set(u),d=v.filter(o);if(P(e,"selected")){const t=v.some((t=>!h.has(t)&&P(t,"selected")));if(!t)return L();for(const t of u)_(t,"unselected"),E(t),O(t)}else{const t=u.some((t=>P(t,"selected")));for(const t of d)h.has(t)?_(t,"selected"):P(t,"selected")||_(t,"unselected");!t&&a&&k(u),M(e)}i&&f.emit("element:select",Object.assign(Object.assign({},t),{nativeEvent:i,data:{data:v.filter((t=>P(t,"selected"))).map(n)}}))},I=t=>{if(m.has(t))return t;for(const e of m){let n=null;if(sR(e,(r=>{r===t&&(n=e)})),n)return n}return t},D=t=>{const{target:e,nativeEvent:n=!0}=t,a=C?R:j;let o=e;const s=(t=>{if(m.has(t))return!0;for(const e of m)if(sR(e,(e=>e===t)))return!0;return!1})(e);return!d||s?s?a({event:t,element:I(o),nativeEvent:n,groupBy:r}):L():(o=y(t),m.has(o)?a({event:t,element:o,nativeEvent:n,filter:p,groupBy:i,groupMap:x}):L())},B=Array.isArray(s)?s:[s],F=t=>{B.includes(t.code)&&!N&&(N=t.code,C=!0)},z=t=>{t.code===N&&(N=null,C=!1)};t.addEventListener("click",D),s&&(C=!1,document.addEventListener("keydown",F),document.addEventListener("keyup",z));const G=t=>{const{nativeEvent:e,data:r}=t;if(e)return;const i=C?r.data:r.data.slice(0,1);for(const t of i){const e=IR(v,t,n);D({target:e,nativeEvent:!1})}},W=()=>{L(!1)};return f.on("element:select",G),f.on("element:unselect",W),()=>{for(const t of v)E(t);t.removeEventListener("click",D),s&&(document.removeEventListener("keydown",F),document.removeEventListener("keyup",z)),f.off("element:select",G),f.off("element:unselect",W)}}function UR(t){var{createGroup:e,createRegionGroup:n,background:r=!1,link:i=!1}=t,a=Le(t,["createGroup","createRegionGroup","background","link"]);return(t,o,s)=>{const{container:c,view:l,options:u}=t,{coordinate:f,scale:h}=l;return VR(vR(c),Object.assign({elements:dR,datum:kR(l),groupKey:e?e(l):void 0,regionGroupKey:n?n(l):t=>t.__data__.x,coordinate:f,scale:h,state:TR(u,[["selected",r?{}:{lineWidth:"1",stroke:"#000"}],"unselected"]),background:r,link:i,emitter:s},a))}}function qR(t){return UR(Object.assign(Object.assign({},t),{createGroup:wR}))}function XR(t){return UR(Object.assign(Object.assign({},t),{createGroup:xR}))}function KR(t){var{wait:e=20,leading:n,trailing:r=!1,labelFormatter:i=t=>`${t}`}=t,a=Le(t,["wait","leading","trailing","labelFormatter"]);return t=>{const{view:o,container:s,update:c,setState:l}=t,{markState:u,scale:f,coordinate:h}=o,d=function(t,e,n){const[r]=Array.from(t.entries()).filter((([t])=>t.type===e)).map((([t])=>{const{encode:e}=t;return Object.fromEntries(n.map((t=>{const n=e[t];return[t,n?n.value:void 0]})))}));return r}(u,"line",["x","y","series"]);if(!d)return;const{y:p,x:g,series:v=[]}=d,m=p.map(((t,e)=>e)),y=rr(m.map((t=>g[t]))),b=vR(s),x=s.getElementsByClassName(US),w=Qn(s.getElementsByClassName(ZS),(t=>t.__data__.key.split("-")[0])),k=new Ig({style:Object.assign({x1:0,y1:0,x2:0,y2:b.getAttribute("height"),stroke:"black",lineWidth:1},Va(a,"rule"))}),E=new Yg({style:Object.assign({x:0,y:b.getAttribute("height"),text:"",fontSize:10},Va(a,"label"))});k.append(E),b.appendChild(k);const M=(t,e,n)=>{const[r]=t.invert(n),i=e.invert(r);return y[$n(y,i)]},O=(t,e)=>{k.setAttribute("x1",t[0]),k.setAttribute("x2",t[0]),E.setAttribute("text",i(e))};let S;const A=ot((t=>{const e=yR(b,t);e&&(t=>{const{scale:e,coordinate:n}=S,{x:r,y:i}=e,a=M(n,r,t);O(t,a);for(const t of x){const{seriesIndex:e,key:r}=t.__data__,o=e[Dn((t=>g[+t])).center(e,a)],s=[0,i.map(1)],c=[0,i.map(p[o]/p[e[0]])],[,l]=n.map(s),[,u]=n.map(c),f=l-u;t.setAttribute("transform",`translate(0, ${f})`);const h=w.get(r)||[];for(const t of h)t.setAttribute("dy",f)}})(e)}),e,{leading:n,trailing:r});return(t=>{Re(this,void 0,void 0,(function*(){const{x:e}=f,n=M(h,e,t);O(t,n),l("chartIndex",(t=>{const e=Q({},t),r=e.marks.find((t=>"line"===t.type)),i=gr(tr(m,(t=>gr(t,(t=>+p[t]))/mr(t,(t=>+p[t]))),(t=>v[t])).values());Q(r,{scale:{y:{domain:[1/i,i]}}});const a=function(t){const{transform:e=[]}=t,n=e.find((t=>"normalizeY"===t.type));if(n)return n;const r={type:"normalizeY"};return e.push(r),t.transform=e,r}(r);a.groupBy="color",a.basis=(t,e)=>e[t[Dn((t=>g[+t])).center(t,n)]];for(const t of e.marks)t.animate=!1;return e}));const r=yield c("chartIndex");S=r.view}))})([0,0]),b.addEventListener("pointerenter",A),b.addEventListener("pointermove",A),b.addEventListener("pointerleave",A),()=>{k.remove(),b.removeEventListener("pointerenter",A),b.removeEventListener("pointermove",A),b.removeEventListener("pointerleave",A)}}}function ZR({wait:t=30,leading:e,trailing:n=!1}){return r=>{const{options:i,update:a,setState:o,container:s}=r,c=vR(s),l=ot((t=>{const e=yR(c,t);if(!e)return o("fisheye"),void a();o("fisheye",(t=>{const n=Q({},t,{interaction:{tooltip:{preserve:!0}}});for(const t of n.marks)t.animate=!1;const[r,i]=e,a=function(t){const{coordinate:e={}}=t,{transform:n=[]}=e,r=n.find((t=>"fisheye"===t.type));if(r)return r;const i={type:"fisheye"};return n.push(i),e.transform=n,t.coordinate=e,i}(n);return a.focusX=r,a.focusY=i,a.visual=!0,n})),a()}),t,{leading:e,trailing:n});return c.addEventListener("pointerenter",l),c.addEventListener("pointermove",l),c.addEventListener("pointerleave",l),()=>{c.removeEventListener("pointerenter",l),c.removeEventListener("pointermove",l),c.removeEventListener("pointerleave",l)}}}function QR(t,e){var n;if(e)return"string"==typeof e?document.querySelector(e):e;const r=null===(n=t.ownerDocument)||void 0===n?void 0:n.defaultView;if(!r)return;return r.getContextService().getDomElement().parentElement}function JR(t,e,n,r,i,a,o,s={},c=[10,10]){const l=new Zw({className:"tooltip",style:{x:e,y:n,container:o,data:[],bounding:a,position:r,enterable:i,title:"",offset:c,template:{prefixCls:"g2-"},style:Q({".g2-tooltip":{},".g2-tooltip-title":{overflow:"hidden","white-space":"nowrap","text-overflow":"ellipsis"}},s)}});return t.appendChild(l.HTMLTooltipElement),l}function tI({root:t,data:e,x:n,y:r,render:i,event:a,single:o,position:s="right-bottom",enterable:c=!1,css:l,mount:u,bounding:f,offset:h}){const d=QR(t,u),p=QR(t),g=o?p:t,v=f||function(t){const e=t.getRenderBounds(),{min:[n,r],max:[i,a]}=e;return{x:n,y:r,width:i-n,height:a-r}}(t),m=function(t,e){const n=t.getBoundingClientRect(),r=e.getBoundingClientRect();return{x:n.x-r.x,y:n.y-r.y}}(p,d),{tooltipElement:y=JR(d,n,r,s,c,v,m,l,h)}=g,{items:b,title:x=""}=e;y.update(Object.assign({x:n,y:r,data:b,title:x,position:s,enterable:c,container:m},void 0!==i&&{content:i(a,{items:b,title:x})})),g.tooltipElement=y}function eI({root:t,single:e,emitter:n,nativeEvent:r=!0,event:i=null}){r&&n.emit("tooltip:hide",{nativeEvent:r});const a=QR(t),o=e?a:t,{tooltipElement:s}=o;s&&s.hide(null==i?void 0:i.clientX,null==i?void 0:i.clientY),lI(t),uI(t),fI(t)}function nI({root:t,single:e}){const n=QR(t),r=e?n:t;if(!r)return;const{tooltipElement:i}=r;i&&(i.destroy(),r.tooltipElement=void 0),lI(t),uI(t),fI(t)}function rI(t){const{value:e}=t;return Object.assign(Object.assign({},t),{value:void 0===e?"undefined":e})}function iI(t){const e=t.getAttribute("fill"),n=t.getAttribute("stroke"),{__data__:r}=t,{color:i=(e&&"transparent"!==e?e:n)}=r;return i}function aI(t,e=t=>t){const n=new Map(t.map((t=>[e(t),t])));return Array.from(n.values())}function oI(t,e,n,r=t.map((t=>t.__data__)),i={}){const a=t=>t instanceof Date?+t:t,o=aI(r.map((t=>t.title)),a).filter(Ha),s=r.flatMap(((r,a)=>{const o=t[a],{items:s=[],title:c}=r,l=s.filter(Ha),u=void 0!==n?n:s.length<=1;return l.map((t=>{var{color:n=iI(o)||i.color,name:a}=t,s=Le(t,["color","name"]);const l=Ba(e,r),f=u&&!(pj in s)?l||a:a||l;return Object.assign(Object.assign({},s),{color:n,name:f||c})}))})).map(rI);return Object.assign(Object.assign({},o.length>0&&{title:o.join(",")}),{items:aI(s,(t=>`(${a(t.name)}, ${a(t.value)}, ${a(t.color)})`))})}function sI(t,e,n,r){var{plotWidth:i,plotHeight:a,mainWidth:o,mainHeight:s,startX:c,startY:l,transposed:u,polar:f,insetLeft:h,insetTop:d}=r,p=Le(r,["plotWidth","plotHeight","mainWidth","mainHeight","startX","startY","transposed","polar","insetLeft","insetTop"]);const g=Object.assign({lineWidth:1,stroke:"#1b1e23",strokeOpacity:.5},p),v=((t,e)=>{if(1===e.length)return e[0];const n=e.map((e=>Es(e,t))),r=yr(n,(t=>t));return e[r]})(n,e);if(f){const[e,n,r]=(()=>{const t=c+h+o/2,e=l+d+s/2;return[t,e,Es([t,e],v)]})(),i=t.ruleX||((e,n,r)=>{const i=new Ag({style:Object.assign({cx:e,cy:n,r:r},g)});return t.appendChild(i),i})(e,n,r);i.style.cx=e,i.style.cy=n,i.style.r=r,t.ruleX=i}else{const[e,n,r,o]=u?[c+v[0],c+v[0],l,l+a]:[c,c+i,v[1]+l,v[1]+l],s=t.ruleX||((e,n,r,i)=>{const a=new Ig({style:Object.assign({x1:e,x2:n,y1:r,y2:i},g)});return t.appendChild(a),a})(e,n,r,o);s.style.x1=e,s.style.x2=n,s.style.y1=r,s.style.y2=o,t.ruleX=s}}function cI(t,e,n){var{plotWidth:r,plotHeight:i,mainWidth:a,mainHeight:o,startX:s,startY:c,transposed:l,polar:u,insetLeft:f,insetTop:h}=n,d=Le(n,["plotWidth","plotHeight","mainWidth","mainHeight","startX","startY","transposed","polar","insetLeft","insetTop"]);const p=Object.assign({lineWidth:1,stroke:"#1b1e23",strokeOpacity:.5},d),g=e.map((t=>t[1])),v=e.map((t=>t[0])),m=kr(g),y=kr(v),[b,x,w,k]=(()=>{if(u){const t=Math.min(a,o)/2,e=s+f+a/2,n=c+h+o/2,r=Ms(ws([y,m],[e,n]));return[e,e+t*Math.cos(r),n,n+t*Math.sin(r)]}return l?[s,s+r,m+c,m+c]:[y+s,y+s,c,c+i]})();if(v.length>0){const e=t.ruleY||(()=>{const e=new Ig({style:Object.assign({x1:b,x2:x,y1:w,y2:k},p)});return t.appendChild(e),e})();e.style.x1=b,e.style.x2=x,e.style.y1=w,e.style.y2=k,t.ruleY=e}}function lI(t){t.ruleY&&(t.ruleY.remove(),t.ruleY=void 0)}function uI(t){t.ruleX&&(t.ruleX.remove(),t.ruleX=void 0)}function fI(t){t.markers&&(t.markers.forEach((t=>t.remove())),t.markers=[])}function hI(t,e){return Array.from(t.values()).some((t=>{var n;return null===(n=t.interaction)||void 0===n?void 0:n[e]}))}function dI(t,e){return void 0===t?e:t}function pI(t){const{title:e,items:n}=t;return 0===n.length&&void 0===e}function gI({root:t,event:e,elements:n,coordinate:r,scale:i,shared:a}){var o,s;const c=n.every((t=>"interval"===t.markType))&&!Uc(r),l=i.x,u=i.series,f=null!==(s=null===(o=null==l?void 0:l.getBandWidth)||void 0===o?void 0:o.call(l))&&void 0!==s?s:0,h=u?t=>{const e=Math.round(1/u.valueBandWidth);return t.__data__.x+t.__data__.series*f+f/(2*e)}:t=>t.__data__.x+f/2;c&&n.sort(((t,e)=>h(t)-h(e)));const d=t=>{const{target:e}=t;return zR(e,(t=>!!t.classList&&t.classList.includes("element")))},p=c?e=>{const i=yR(t,e);if(!i)return;const[o]=r.invert(i),s=(0,Dn(h).center)(n,o),c=n[s];if(!a){const t=n.find((t=>t!==c&&h(t)===h(c)));if(t)return d(e)}return c}:d;return p(e)}function vI({root:t,event:e,elements:n,coordinate:r,scale:i,startX:a,startY:o}){const s=Vc(r),c=[],l=[];for(const t of n){const{__data__:e}=t,{seriesX:n,title:r,items:i}=e;n?c.push(t):(r||i)&&l.push(t)}const u=l.length&&l.every((t=>"interval"===t.markType))&&!Uc(r),f=t=>t.__data__.x,h=!!i.x.getBandWidth&&l.length>0;c.sort(((t,e)=>{const n=s?0:1,r=t=>t.getBounds().min[n];return s?r(e)-r(t):r(t)-r(e)}));const d=t=>{const e=s?1:0,{min:n,max:r}=t.getLocalBounds();return rr([n[e],r[e]])};u?n.sort(((t,e)=>f(t)-f(e))):l.sort(((t,e)=>{const[n,r]=d(t),[i,a]=d(e),o=(n+r)/2,c=(i+a)/2;return s?c-o:o-c}));const p=new Map(c.map((t=>{const{__data__:e}=t,{seriesX:n}=e,r=n.map(((t,e)=>e)),i=rr(r,(t=>n[+t]));return[t,[i,n]]}))),{x:g}=i,v=(null==g?void 0:g.getBandWidth)?g.getBandWidth()/2:0,m=t=>{const[e]=r.invert(t);return e-v},y=(t,e,n,r)=>{const{_x:i}=t,a=void 0!==i?g.map(i):m(e),o=r.filter(Ha),[s,c]=rr([o[0],o[o.length-1]]);if(!h&&(a<s||a>c)&&!(s===c))return null;const l=Dn((t=>r[+t])).center;return n[l(n,a)]},b=u?(t,e)=>{const n=e[(0,Dn(f).center)(e,m(t))];return Qn(e,f).get(f(n))}:(t,e)=>{const n=t[s?1:0],r=e.filter((t=>{const[e,r]=d(t);return n>=e&&n<=r}));if(!h||r.length>0)return r;const i=Dn((t=>{const[e,n]=d(t);return(e+n)/2})).center;return[e[i(e,n)]].filter(Ha)},x=(t,e)=>{const{__data__:n}=t;return Object.fromEntries(Object.entries(n).filter((([t])=>t.startsWith("series")&&"series"!==t)).map((([t,n])=>{const r=n[e];return[W(t.replace("series","")),r]})))},w=yR(t,e);if(!w)return;const k=[w[0]-a,w[1]-o];if(!k)return;const E=b(k,l),M=[],O=[];for(const t of c){const[n,i]=p.get(t),a=y(e,k,n,i);if(null!==a){M.push(t);const e=x(t,a),{x:n,y:i}=e,o=r.map([(n||0)+v,i||0]);O.push([Object.assign(Object.assign({},e),{element:t}),o])}}const S=Array.from(new Set(O.map((t=>t[0].x)))),A=S[yr(S,(t=>Math.abs(t-m(k))))],_=O.filter((t=>t[0].x===A)),T=[..._.map((t=>t[0])),...E.map((t=>t.__data__))];return{selectedElements:[...M,...E],selectedData:T,filteredSeriesData:_,abstractX:m}}function mI(t,e){var{elements:n,sort:r,filter:i,scale:a,coordinate:o,crosshairs:s,crosshairsX:c,crosshairsY:l,render:u,groupName:f,emitter:h,wait:d=50,leading:p=!0,trailing:g=!1,startX:v=0,startY:m=0,body:y=!0,single:b=!0,position:x,enterable:w,mount:k,bounding:E,theme:M,offset:O,disableNative:S=!1,marker:A=!0,preserve:_=!1,style:T={},css:P={}}=e,C=Le(e,["elements","sort","filter","scale","coordinate","crosshairs","crosshairsX","crosshairsY","render","groupName","emitter","wait","leading","trailing","startX","startY","body","single","position","enterable","mount","bounding","theme","offset","disableNative","marker","preserve","style","css"]);const N=n(t),L=Q(T,C),j=Uc(o),R=Vc(o),{innerWidth:I,innerHeight:D,width:B,height:F,insetLeft:z,insetTop:G}=o.getOptions(),W=ot((e=>{var n;const d=yR(t,e);if(!d)return;const p=mR(t),g=p.min[0],S=p.min[1],{selectedElements:_,selectedData:T,filteredSeriesData:C,abstractX:W}=vI({root:t,event:e,elements:N,coordinate:o,scale:a,startX:v,startY:m}),H=oI(_,a,f,T,M);if(r&&H.items.sort(((t,e)=>r(t)-r(e))),i&&(H.items=H.items.filter(i)),0===_.length||pI(H))return void $(e);if(y&&tI({root:t,data:H,x:d[0]+g,y:d[1]+S,render:u,event:e,single:b,position:x,enterable:w,mount:k,bounding:E,css:P,offset:O}),s||c||l){const e=Va(L,"crosshairs"),n=Object.assign(Object.assign({},e),Va(L,"crosshairsX")),r=Object.assign(Object.assign({},e),Va(L,"crosshairsY")),i=C.map((t=>t[1]));c&&sI(t,i,d,Object.assign(Object.assign({},n),{plotWidth:I,plotHeight:D,mainWidth:B,mainHeight:F,insetLeft:z,insetTop:G,startX:v,startY:m,transposed:R,polar:j})),l&&cI(t,i,Object.assign(Object.assign({},r),{plotWidth:I,plotHeight:D,mainWidth:B,mainHeight:F,insetLeft:z,insetTop:G,startX:v,startY:m,transposed:R,polar:j}))}if(A){const e=Va(L,"marker");!function(t,{data:e,style:n,theme:r}){t.markers&&t.markers.forEach((t=>t.remove()));const{type:i=""}=n,a=e.filter((t=>{const[{x:e,y:n}]=t;return Ha(e)&&Ha(n)})).map((t=>{const[{color:e,element:a},o]=t,s=e||a.style.fill||a.style.stroke||r.color,c="hollow"===i?"transparent":s,l="hollow"===i?s:"#fff";return new Ag({className:"g2-tooltip-marker",style:Object.assign({cx:o[0],cy:o[1],fill:c,r:4,stroke:l,lineWidth:2,pointerEvents:"none"},n)})}));for(const e of a)t.appendChild(e);t.markers=a}(t,{data:C,style:e,theme:M})}const Y=null===(n=C[0])||void 0===n?void 0:n[0].x,V=null!=Y?Y:W(focus);h.emit("tooltip:show",Object.assign(Object.assign({},e),{nativeEvent:!0,data:Object.assign(Object.assign({},H),{data:{x:cS(a.x,V,!0)}})}))}),d,{leading:p,trailing:g}),$=e=>{eI({root:t,single:b,emitter:h,event:e})},H=()=>{nI({root:t,single:b})},Y=e=>{var n,{nativeEvent:r,data:i,offsetX:s,offsetY:c}=e,l=Le(e,["nativeEvent","data","offsetX","offsetY"]);if(r)return;const u=null===(n=null==i?void 0:i.data)||void 0===n?void 0:n.x,f=a.x.map(u),[h,d]=o.map([f,.5]),p=t.getRenderBounds(),g=p.min[0],v=p.min[1];W(Object.assign(Object.assign({},l),{offsetX:void 0!==s?s:g+h,offsetY:void 0!==c?c:v+d,_x:u}))},V=()=>{eI({root:t,single:b,emitter:h,nativeEvent:!1})},U=()=>{K(),H()},q=()=>{X()},X=()=>{S||(t.addEventListener("pointerdown",W),t.addEventListener("pointerenter",W),t.addEventListener("pointermove",W),t.addEventListener("pointerleave",(e=>{yR(t,e)||$(e)})),t.addEventListener("pointerup",$))},K=()=>{S||(t.removeEventListener("pointerdown",W),t.removeEventListener("pointerenter",W),t.removeEventListener("pointermove",W),t.removeEventListener("pointerleave",$),t.removeEventListener("pointerup",$))};return X(),h.on("tooltip:show",Y),h.on("tooltip:hide",V),h.on("tooltip:disable",U),h.on("tooltip:enable",q),()=>{K(),h.off("tooltip:show",Y),h.off("tooltip:hide",V),h.off("tooltip:disable",U),h.off("tooltip:enable",q),_?eI({root:t,single:b,emitter:h,nativeEvent:!1}):H()}}function yI(t,{elements:e,coordinate:n,scale:r,render:i,groupName:a,sort:o,filter:s,emitter:c,wait:l=50,leading:u=!0,trailing:f=!1,groupKey:h=t=>t,single:d=!0,position:p,enterable:g,datum:v,view:m,mount:y,bounding:b,theme:x,offset:w,shared:k=!1,body:E=!0,disableNative:M=!1,preserve:O=!1,css:S={}}){const A=e(t),_=Qn(A,h),T=ot((e=>{const l=gI({root:t,event:e,elements:A,coordinate:n,scale:r,shared:k});if(!l)return void eI({root:t,single:d,emitter:c,event:e});const u=h(l),f=_.get(u);if(!f)return;const v=1!==f.length||k?oI(f,r,a,void 0,x):function(t){const{__data__:e}=t,{title:n,items:r=[]}=e,i=r.filter(Ha).map((e=>{var{color:n=iI(t)}=e,r=Le(e,["color"]);return Object.assign(Object.assign({},r),{color:n})})).map(rI);return Object.assign(Object.assign({},n&&{title:n}),{items:i})}(f[0]);if(o&&v.items.sort(((t,e)=>o(t)-o(e))),s&&(v.items=v.items.filter(s)),pI(v))return void eI({root:t,single:d,emitter:c,event:e});const{offsetX:M,offsetY:O}=e;E&&tI({root:t,data:v,x:M,y:O,render:i,event:e,single:d,position:p,enterable:g,mount:y,bounding:b,css:S,offset:w}),c.emit("tooltip:show",Object.assign(Object.assign({},e),{nativeEvent:!0,data:Object.assign(Object.assign({},v),{data:Da(l,m)})}))}),l,{leading:u,trailing:f}),P=e=>{eI({root:t,single:d,emitter:c,event:e})},C=()=>{M||(t.addEventListener("pointerdown",T),t.addEventListener("pointermove",T),t.addEventListener("pointerleave",P),t.addEventListener("pointerup",P))},N=()=>{M||(t.removeEventListener("pointerdown",T),t.removeEventListener("pointermove",T),t.removeEventListener("pointerleave",P),t.removeEventListener("pointerup",P))},L=({nativeEvent:e,offsetX:n,offsetY:r,data:i})=>{if(e)return;const{data:a}=i,o=IR(A,a,v);if(!o)return;const s=o.getBBox(),{x:c,y:l,width:u,height:f}=s,h=t.getBBox();T({target:o,offsetX:void 0!==n?n+h.x:c+u/2,offsetY:void 0!==r?r+h.y:l+f/2})},j=({nativeEvent:e}={})=>{e||eI({root:t,single:d,emitter:c,nativeEvent:!1})};return c.on("tooltip:show",L),c.on("tooltip:hide",j),c.on("tooltip:enable",(()=>{C()})),c.on("tooltip:disable",(()=>{N(),nI({root:t,single:d})})),C(),()=>{N(),c.off("tooltip:show",L),c.off("tooltip:hide",j),O?eI({root:t,single:d,emitter:c,nativeEvent:!1}):nI({root:t,single:d})}}function bI(t){const{shared:e,crosshairs:n,crosshairsX:r,crosshairsY:i,series:a,name:o,item:s=()=>({}),facet:c=!1}=t,l=Le(t,["shared","crosshairs","crosshairsX","crosshairsY","series","name","item","facet"]);return(t,o,u)=>{const{container:f,view:h}=t,{scale:d,markState:p,coordinate:g,theme:v}=h,m=hI(p,"seriesTooltip"),y=hI(p,"crosshairs"),b=vR(f),x=dI(a,m),w=dI(n,y);if(x&&function(t){return Array.from(t.values()).some((t=>{var e;return(null===(e=t.interaction)||void 0===e?void 0:e.seriesTooltip)&&t.tooltip}))}(p)&&!c)return mI(b,Object.assign(Object.assign({},l),{theme:v,elements:dR,scale:d,coordinate:g,crosshairs:w,crosshairsX:dI(dI(r,n),!1),crosshairsY:dI(i,w),item:s,emitter:u}));if(x&&c){const e=o.filter((e=>e!==t&&e.options.parentKey===t.options.key)),a=pR(t,o),c=e[0].view.scale,f=b.getBounds(),h=f.min[0],d=f.min[1];return Object.assign(c,{facet:!0}),mI(b.parentNode.parentNode,Object.assign(Object.assign({},l),{theme:v,elements:()=>a,scale:c,coordinate:g,crosshairs:dI(n,y),crosshairsX:dI(dI(r,n),!1),crosshairsY:dI(i,w),item:s,startX:h,startY:d,emitter:u}))}return yI(b,Object.assign(Object.assign({},l),{datum:kR(h),elements:dR,scale:d,coordinate:g,groupKey:e?t=>t.__data__.x:void 0,item:s,emitter:u,view:h,theme:v,shared:e}))}}$R.props={reapplyWhenUpdate:!0},HR.props={reapplyWhenUpdate:!0},YR.props={reapplyWhenUpdate:!0},UR.props={reapplyWhenUpdate:!0},qR.props={reapplyWhenUpdate:!0},XR.props={reapplyWhenUpdate:!0},KR.props={reapplyWhenUpdate:!0},bI.props={reapplyWhenUpdate:!0};const xI="legend-category";function wI(t){return t.getElementsByClassName("legend-category-item-marker")[0]}function kI(t){return t.getElementsByClassName("legend-category-item-label")[0]}function EI(t){return t.getElementsByClassName("items-item")}function MI(t){return t.getElementsByClassName(xI)}function OI(t){return t.getElementsByClassName("legend-continuous")}function SI(t){let e=t.parentNode;for(;e&&!e.__data__;)e=e.parentNode;return e.__data__}function AI(t,{legend:e,channel:n,value:r,ordinal:i,channels:a,allChannels:o,facet:s=!1}){return Re(this,void 0,void 0,(function*(){const{view:c,update:l,setState:u}=t;u(e,(t=>{const{marks:e}=t,l=e.map((t=>{if("legends"===t.type)return t;const{transform:e=[],data:l=[]}=t,u=e.findIndex((({type:t})=>t.startsWith("group")||t.startsWith("bin"))),f=[...e];l.length&&f.splice(u+1,0,{type:"filter",[n]:{value:r,ordinal:i}});const h=Object.fromEntries(a.map((t=>[t,{domain:c.scale[t].getOptions().domain}])));return Q({},t,Object.assign(Object.assign({transform:f,scale:h},!i&&{animate:!1}),{legend:!s&&Object.fromEntries(o.map((t=>[t,{preserve:!0}])))}))}));return Object.assign(Object.assign({},t),{marks:l})})),yield l()}))}function _I(t,e){for(const n of t)AI(n,Object.assign(Object.assign({},e),{facet:!0}))}function TI(){return(t,e,n)=>{const{container:r}=t,i=e.filter((e=>e!==t)),a=i.length>0,o=t=>SI(t).scales.map((t=>t.name)),s=[...MI(r),...OI(r)],c=s.flatMap(o),l=ot(a?_I:AI,50,{trailing:!0}),u=s.map((e=>{const{name:s,domain:u}=SI(e).scales[0],f={legend:e,channel:s,channels:o(e),allChannels:c};return e.className===xI?function(t,{legends:e,marker:n,label:r,datum:i,filter:a,emitter:o,channel:s,state:c={}}){const l=new Map,u=new Map,f=new Map,{unselected:h={markerStroke:"#aaa",markerFill:"#aaa",labelFill:"#aaa"}}=c,d={unselected:Va(h,"marker")},p={unselected:Va(h,"label")},{setState:g,removeState:v}=AR(d,void 0),{setState:m,removeState:y}=AR(p,void 0),b=Array.from(e(t));let x=b.map(i);const w=()=>{for(const t of b){const e=i(t),a=n(t),o=r(t);x.includes(e)?(v(a,"unselected"),y(o,"unselected")):(g(a,"unselected"),m(o,"unselected"))}};for(const e of b){const n=()=>{jR(t,"pointer")},r=()=>{RR(t)},c=t=>Re(this,void 0,void 0,(function*(){const n=i(e),r=x.indexOf(n);-1===r?x.push(n):x.splice(r,1),yield a(x),w();const{nativeEvent:c=!0}=t;c&&(x.length===b.length?o.emit("legend:reset",{nativeEvent:c}):o.emit("legend:filter",Object.assign(Object.assign({},t),{nativeEvent:c,data:{channel:s,values:x}})))}));e.addEventListener("click",c),e.addEventListener("pointerenter",n),e.addEventListener("pointerout",r),l.set(e,c),u.set(e,n),f.set(e,r)}const k=t=>Re(this,void 0,void 0,(function*(){const{nativeEvent:e}=t;if(e)return;const{data:n}=t,{channel:r,values:i}=n;r===s&&(x=i,yield a(x),w())})),E=t=>Re(this,void 0,void 0,(function*(){const{nativeEvent:e}=t;e||(x=b.map(i),yield a(x),w())}));return o.on("legend:filter",k),o.on("legend:reset",E),()=>{for(const t of b)t.removeEventListener("click",l.get(t)),t.removeEventListener("pointerenter",u.get(t)),t.removeEventListener("pointerout",f.get(t)),o.off("legend:filter",k),o.off("legend:reset",E)}}(r,{legends:EI,marker:wI,label:kI,datum:t=>{const{__data__:e}=t,{index:n}=e;return u[n]},filter:e=>{const n=Object.assign(Object.assign({},f),{value:e,ordinal:!0});l(a?i:t,n)},state:e.attributes.state,channel:s,emitter:n}):function(t,{legend:e,filter:n,emitter:r,channel:i}){const a=({detail:{value:t}})=>{n(t),r.emit({nativeEvent:!0,data:{channel:i,values:t}})};return e.addEventListener("valuechange",a),()=>{e.removeEventListener("valuechange",a)}}(0,{legend:e,filter:e=>{const n=Object.assign(Object.assign({},f),{value:e,ordinal:!1});l(a?i:t,n)},emitter:n,channel:s})}));return()=>{u.forEach((t=>t()))}}}function PI(){return(t,e,n)=>{const{container:r,view:i,options:a}=t,o=MI(r),s=dR(r),c=t=>SI(t).scales[0].name,l=t=>{const{scale:{[t]:e}}=i;return e},u=TR(a,["active","inactive"]),f=PR(s,kR(i)),h=[];for(const t of o){const e=e=>{const{data:n}=t.attributes,{__data__:r}=e,{index:i}=r;return n[i].label},r=c(t),i=EI(t),a=l(r),o=Qn(s,(t=>a.invert(t.__data__[r]))),{state:d={}}=t.attributes,{inactive:p={}}=d,{setState:g,removeState:v}=AR(u,f),m={inactive:Va(p,"marker")},y={inactive:Va(p,"label")},{setState:b,removeState:x}=AR(m),{setState:w,removeState:k}=AR(y),E=t=>{for(const e of i){const n=wI(e),r=kI(e);e===t||null===t?(x(n,"inactive"),k(r,"inactive")):(b(n,"inactive"),w(r,"inactive"))}},M=(t,i)=>{const a=e(i),c=new Set(o.get(a));for(const t of s)c.has(t)?g(t,"active"):g(t,"inactive");E(i);const{nativeEvent:l=!0}=t;l&&n.emit("legend:highlight",Object.assign(Object.assign({},t),{nativeEvent:l,data:{channel:r,value:a}}))},O=new Map;for(const t of i){const e=e=>{M(e,t)};t.addEventListener("pointerover",e),O.set(t,e)}const S=t=>{for(const t of s)v(t,"inactive","active");E(null);const{nativeEvent:e=!0}=t;e&&n.emit("legend:unhighlight",{nativeEvent:e})},A=t=>{const{nativeEvent:n,data:a}=t;if(n)return;const{channel:o,value:s}=a;if(o!==r)return;const c=i.find((t=>e(t)===s));c&&M({nativeEvent:!1},c)},_=t=>{const{nativeEvent:e}=t;e||S({nativeEvent:!1})};t.addEventListener("pointerleave",S),n.on("legend:highlight",A),n.on("legend:unhighlight",_);const T=()=>{t.removeEventListener(S),n.off("legend:highlight",A),n.off("legend:unhighlight",_);for(const[t,e]of O)t.removeEventListener(e)};h.push(T)}return()=>h.forEach((t=>t()))}}function CI(t,e){const[n,r,i,a]=t,[o,s,c,l]=e;return!(o>i||c<n||s>a||l<r)}function NI(t){const{width:e,height:n}=t.getBBox();return[0,0,e,n]}function LI(t,e){for(const[n,r]of Object.entries(e))t.style(n,r)}const jI=Om((t=>{const e=t.attributes,{x:n,y:r,width:i,height:a,class:o,renders:s={},handleSize:c=10,document:l}=e,u=Le(e,["x","y","width","height","class","renders","handleSize","document"]);if(!l||void 0===i||void 0===a||void 0===n||void 0===r)return;const f=c/2,h=(t,e,n)=>{t.handle||(t.handle=n.createElement("rect"),t.append(t.handle));const{handle:r}=t;return r.attr(e),r},d=Va(qa(u,"handleNW","handleNE"),"handleN"),{render:p=h}=d,g=Le(d,["render"]),v=Va(u,"handleE"),{render:m=h}=v,y=Le(v,["render"]),b=Va(qa(u,"handleSE","handleSW"),"handleS"),{render:x=h}=b,w=Le(b,["render"]),k=Va(u,"handleW"),{render:E=h}=k,M=Le(k,["render"]),O=Va(u,"handleNW"),{render:S=h}=O,A=Le(O,["render"]),_=Va(u,"handleNE"),{render:T=h}=_,P=Le(_,["render"]),C=Va(u,"handleSE"),{render:N=h}=C,L=Le(C,["render"]),j=Va(u,"handleSW"),{render:R=h}=j,I=Le(j,["render"]),D=t=>()=>{const e=Om((e=>((t,e)=>{const{id:n}=t,r=e(t,t.attributes,l);r.id=n,r.style.draggable=!0})(e,t)));return new e({})},B=am(t).attr("className",o).style("transform",`translate(${n}, ${r})`).style("draggable",!0);B.maybeAppend("selection","rect").style("draggable",!0).style("fill","transparent").call(LI,Object.assign(Object.assign({width:i,height:a},qa(u,"handle")),{transform:void 0})),B.maybeAppend("handle-n",D(p)).style("x",f).style("y",-f).style("width",i-c).style("height",c).style("fill","transparent").call(LI,g),B.maybeAppend("handle-e",D(m)).style("x",i-f).style("y",f).style("width",c).style("height",a-c).style("fill","transparent").call(LI,y),B.maybeAppend("handle-s",D(x)).style("x",f).style("y",a-f).style("width",i-c).style("height",c).style("fill","transparent").call(LI,w),B.maybeAppend("handle-w",D(E)).style("x",-f).style("y",f).style("width",c).style("height",a-c).style("fill","transparent").call(LI,M),B.maybeAppend("handle-nw",D(S)).style("x",-f).style("y",-f).style("width",c).style("height",c).style("fill","transparent").call(LI,A),B.maybeAppend("handle-ne",D(T)).style("x",i-f).style("y",-f).style("width",c).style("height",c).style("fill","transparent").call(LI,P),B.maybeAppend("handle-se",D(N)).style("x",i-f).style("y",a-f).style("width",c).style("height",c).style("fill","transparent").call(LI,L),B.maybeAppend("handle-sw",D(R)).style("x",-f).style("y",a-f).style("width",c).style("height",c).style("fill","transparent").call(LI,I)}));function RI(t,e){var{brushed:n=()=>{},brushended:r=()=>{},brushcreated:i=()=>{},brushstarted:a=()=>{},brushupdated:o=()=>{},extent:s=NI(t),brushRegion:c=(t,e,n,r,i)=>[t,e,n,r],reverse:l=!1,fill:u="#777",fillOpacity:f="0.3",stroke:h="#fff",selectedHandles:d=["handle-n","handle-e","handle-s","handle-w","handle-nw","handle-ne","handle-se","handle-sw"]}=e,p=Le(e,["brushed","brushended","brushcreated","brushstarted","brushupdated","extent","brushRegion","reverse","fill","fillOpacity","stroke","selectedHandles"]);let g=null,v=null,m=null,y=null,b=null,x=!1;const[w,k,E,M]=s;jR(t,"crosshair"),t.style.draggable=!0;const O=(t,e,n)=>{if(a(n),y&&y.remove(),b&&b.remove(),g=[t,e],l)return S();A()},S=()=>{b=new Bg({style:Object.assign(Object.assign({},p),{fill:u,fillOpacity:f,stroke:h,pointerEvents:"none"})}),y=new jI({style:{x:0,y:0,width:0,height:0,draggable:!0,document:t.ownerDocument},className:"mask"}),t.appendChild(b),t.appendChild(y)},A=()=>{y=new jI({style:Object.assign(Object.assign({document:t.ownerDocument,x:0,y:0},p),{fill:u,fillOpacity:f,stroke:h,draggable:!0}),className:"mask"}),t.appendChild(y)},_=(t=!0)=>{y&&y.remove(),b&&b.remove(),g=null,v=null,m=null,x=!1,y=null,b=null,r(t)},T=(t,e,r=!0)=>{const[i,a,o,u]=function(t,e,n,r,i){const[a,o,s,c]=i;return[Math.max(a,Math.min(t,n)),Math.max(o,Math.min(e,r)),Math.min(s,Math.max(t,n)),Math.min(c,Math.max(e,r))]}(t[0],t[1],e[0],e[1],s),[f,h,d,p]=c(i,a,o,u,s);return l?C(f,h,d,p):P(f,h,d,p),n(f,h,d,p,r),[f,h,d,p]},P=(t,e,n,r)=>{y.style.x=t,y.style.y=e,y.style.width=n-t,y.style.height=r-e},C=(t,e,n,r)=>{b.style.d=`\n M${w},${k}L${E},${k}L${E},${M}L${w},${M}Z\n M${t},${e}L${t},${r}L${n},${r}L${n},${e}Z\n `,y.style.x=t,y.style.y=e,y.style.width=n-t,y.style.height=r-e},N={"handle-n":{vector:[0,1,0,0],cursor:"ns-resize"},"handle-e":{vector:[0,0,1,0],cursor:"ew-resize"},"handle-s":{vector:[0,0,0,1],cursor:"ns-resize"},"handle-w":{vector:[1,0,0,0],cursor:"ew-resize"},"handle-nw":{vector:[1,1,0,0],cursor:"nwse-resize"},"handle-ne":{vector:[0,1,1,0],cursor:"nesw-resize"},"handle-se":{vector:[0,0,1,1],cursor:"nwse-resize"},"handle-sw":{vector:[1,0,0,1],cursor:"nesw-resize"}},L=t=>R(t)||j(t),j=t=>{const{id:e}=t;return-1!==d.indexOf(e)&&new Set(Object.keys(N)).has(e)},R=t=>t===y.getElementById("selection"),I=e=>{const{target:n}=e,[r,i]=bR(t,e);if(!y||!L(n))return O(r,i,e),void(x=!0);L(n)&&(m=[r,i])},D=e=>{const{target:n}=e,r=bR(t,e);if(!g)return;if(!m)return T(g,r);if(R(n))return(t=>{const e=(t,e,n,r,i)=>t+e<r?r-e:t+n>i?i-n:t,n=t[0]-m[0],r=t[1]-m[1],i=e(n,g[0],v[0],w,E),a=e(r,g[1],v[1],k,M),o=[g[0]+i,g[1]+a],s=[v[0]+i,v[1]+a];T(o,s)})(r);const[i,a]=[r[0]-m[0],r[1]-m[1]],{id:o}=n;if(N[o]){const[t,e,n,r]=N[o].vector;return T([g[0]+i*t,g[1]+a*e],[v[0]+i*n,v[1]+a*r])}},B=e=>{if(m){m=null;const{x:t,y:n,width:r,height:i}=y.style;return g=[t,n],v=[t+r,n+i],void o(t,n,t+r,n+i,e)}v=bR(t,e);const[n,r,a,s]=T(g,v);x=!1,i(n,r,a,s,e)},F=t=>{const{target:e}=t;y&&!L(e)&&_()},z=e=>{const{target:n}=e;y&&L(n)&&!x?R(n)?jR(t,"move"):j(n)&&jR(t,N[n.id].cursor):jR(t,"crosshair")},G=()=>{jR(t,"default")};return t.addEventListener("dragstart",I),t.addEventListener("drag",D),t.addEventListener("dragend",B),t.addEventListener("click",F),t.addEventListener("pointermove",z),t.addEventListener("pointerleave",G),{mask:y,move(t,e,n,r,i=!0){y||O(t,e,{}),g=[t,e],v=[n,r],T([t,e],[n,r],i)},remove(t=!0){y&&_(t)},destroy(){y&&_(!1),jR(t,"default"),t.removeEventListener("dragstart",I),t.removeEventListener("drag",D),t.removeEventListener("dragend",B),t.removeEventListener("click",F),t.removeEventListener("pointermove",z),t.removeEventListener("pointerleave",G)}}}function II(t,e,n){return e.filter((e=>{if(e===t)return!1;const{interaction:r={}}=e.options;return Object.values(r).find((t=>t.brushKey===n))}))}function DI(t,e,n){return II(t,e,n).map((t=>t.options))}function BI(t,e){var{elements:n,selectedHandles:r,siblings:i=t=>[],datum:a,brushRegion:o,extent:s,reverse:c,scale:l,coordinate:u,series:f=!1,key:h=t=>t,bboxOf:d=t=>{const{x:e,y:n,width:r,height:i}=t.style;return{x:e,y:n,width:r,height:i}},state:p={},emitter:g}=e,v=Le(e,["elements","selectedHandles","siblings","datum","brushRegion","extent","reverse","scale","coordinate","series","key","bboxOf","state","emitter"]);const m=n(t),y=i(t),b=y.flatMap(n),x=PR(m,a),w=Va(v,"mask"),{setState:k,removeState:E}=AR(p,x),M=new Map,{width:O,height:S,x:A=0,y:_=0}=d(t),T=s||[0,0,O,S],P=()=>{for(const t of[...m,...b])E(t,"active","inactive")},C=(t,e,n,r)=>{var i;for(const t of y)null===(i=t.brush)||void 0===i||i.remove();const a=new Set;for(const i of m){const{min:o,max:s}=i.getLocalBounds(),[c,l]=o,[u,f]=s;CI([c,l,u,f],[t,e,n,r])?(k(i,"active"),a.add(h(i))):k(i,"inactive")}for(const t of b)a.has(h(t))?k(t,"active"):k(t,"inactive")},N=()=>{for(const t of m)E(t,"inactive");for(const t of M.values())t.remove();M.clear()},L=(e,n,r,i)=>{const a=t=>{const e=t.cloneNode();return e.__data__=t.__data__,t.parentNode.appendChild(e),M.set(t,e),e},o=new $g({style:{x:e+A,y:n+_,width:r-e,height:i-n}});t.appendChild(o);for(const t of m){const e=M.get(t)||a(t);e.style.clipPath=o,k(t,"inactive"),k(e,"active")}},j=RI(t,Object.assign(Object.assign({},w),{extent:T,brushRegion:o,reverse:c,selectedHandles:r,brushended:t=>{const e=f?N:P;t&&g.emit("brush:remove",{nativeEvent:!0}),e()},brushed:(t,e,n,r,i)=>{const a=uS(t,e,n,r,l,u);i&&g.emit("brush:highlight",{nativeEvent:!0,data:{selection:a}});(f?L:C)(t,e,n,r)},brushcreated:(t,e,n,r,i)=>{const a=uS(t,e,n,r,l,u);g.emit("brush:end",Object.assign(Object.assign({},i),{nativeEvent:!0,data:{selection:a}}))},brushupdated:(t,e,n,r,i)=>{const a=uS(t,e,n,r,l,u);g.emit("brush:end",Object.assign(Object.assign({},i),{nativeEvent:!0,data:{selection:a}}))},brushstarted:t=>{g.emit("brush:start",t)}})),R=({nativeEvent:t,data:e})=>{if(t)return;const{selection:n}=e,[r,i,a,o]=function(t,e,n){const{x:r,y:i}=e,[a,o]=t,s=fS(a,r),c=fS(o,i),l=[s[0],c[0]],u=[s[1],c[1]],[f,h]=n.map(l),[d,p]=n.map(u);return[f,h,d,p]}(n,l,u);j.move(r,i,a,o,!1)};g.on("brush:highlight",R);const I=({nativeEvent:t}={})=>{t||j.remove(!1)};g.on("brush:remove",I);const D=j.destroy.bind(j);return j.destroy=()=>{g.off("brush:highlight",R),g.off("brush:remove",I),D()},j}function FI(t){var{facet:e,brushKey:n}=t,r=Le(t,["facet","brushKey"]);return(t,i,a)=>{const{container:o,view:s,options:c}=t,l=vR(o),u={maskFill:"#777",maskFillOpacity:"0.3",maskStroke:"#fff",reverse:!1},f=["active",["inactive",{opacity:.5}]],{scale:h,coordinate:d}=s;if(e){const e=l.getBounds(),n=e.min[0],o=e.min[1],s=e.max[0],c=e.max[1];return BI(l.parentNode.parentNode,Object.assign(Object.assign({elements:()=>pR(t,i),datum:kR(gR(t,i).map((t=>t.view))),brushRegion:(t,e,n,r)=>[t,e,n,r],extent:[n,o,s,c],state:TR(gR(t,i).map((t=>t.options)),f),emitter:a,scale:h,coordinate:d,selectedHandles:void 0},u),r))}const p=BI(l,Object.assign(Object.assign({elements:dR,key:t=>t.__data__.key,siblings:()=>function(t,e,n){return II(t,e,n).map((t=>vR(t.container)))}(t,i,n),datum:kR([s,...II(t,i,n).map((t=>t.view))]),brushRegion:(t,e,n,r)=>[t,e,n,r],extent:void 0,state:TR([c,...DI(t,i,n)],f),emitter:a,scale:h,coordinate:d,selectedHandles:void 0},u),r));return l.brush=p,()=>p.destroy()}}function zI(t,e,n,r,i){const[,a,,o]=i;return[t,a,n,o]}function GI(t){return FI(Object.assign(Object.assign({},t),{brushRegion:zI,selectedHandles:["handle-e","handle-w"]}))}function WI(t,e,n,r,i){const[a,,o]=i;return[a,e,o,r]}function $I(t){return FI(Object.assign(Object.assign({},t),{brushRegion:WI,selectedHandles:["handle-n","handle-s"]}))}const HI="axis-hot-area";function YI(t){return t.getElementsByClassName("axis")}function VI(t){return t.getElementsByClassName("axis-line")[0]}function UI(t){return function(t){return t.getElementsByClassName("axis-main-group")[0]}(t).getLocalBounds()}function qI(t,e){var{cross:n,offsetX:r,offsetY:i}=e,a=Le(e,["cross","offsetX","offsetY"]);const o=UI(t),s=VI(t),[c]=s.getLocalBounds().min,[l,u]=o.min,[f,h]=o.max,d=2*(f-l);return{brushRegion:WI,hotZone:new $g({className:HI,style:Object.assign({width:n?d/2:d,transform:`translate(${(n?l:c-d/2).toFixed(2)}, ${u})`,height:h-u},a)}),extent:n?(t,e,n,r)=>[-1/0,e,1/0,r]:(t,e,n,i)=>[Math.floor(l-r),e,Math.ceil(f-r),i]}}function XI(t,e){var{offsetY:n,offsetX:r,cross:i=!1}=e,a=Le(e,["offsetY","offsetX","cross"]);const o=UI(t),s=VI(t),[,c]=s.getLocalBounds().min,[l,u]=o.min,[f,h]=o.max,d=h-u;return{brushRegion:zI,hotZone:new $g({className:HI,style:Object.assign({width:f-l,height:i?d:2*d,transform:`translate(${l}, ${i?u:c-d})`},a)}),extent:i?(t,e,n,r)=>[t,-1/0,n,1/0]:(t,e,r,i)=>[t,Math.floor(u-n),r,Math.ceil(h-n)]}}function KI(t){return(e,n,r)=>{const{container:i,view:a,options:o}=e,s=vR(i),{x:c,y:l}=s.getBBox(),{coordinate:u}=a;return function(t,e){var{axes:n,elements:r,points:i,horizontal:a,datum:o,offsetY:s,offsetX:c,reverse:l=!1,state:u={},emitter:f,coordinate:h}=e,d=Le(e,["axes","elements","points","horizontal","datum","offsetY","offsetX","reverse","state","emitter","coordinate"]);const p=r(t),g=n(t),v=PR(p,o),{setState:m,removeState:y}=AR(u,v),b=new Map,x=Va(d,"mask"),w=t=>Array.from(b.values()).every((([e,n,r,i])=>t.some((([t,a])=>t>=e&&t<=r&&a>=n&&a<=i)))),k=g.map((t=>t.attributes.scale)),E=t=>t.length>2?[t[0],t[t.length-1]]:t,M=new Map,O=()=>{M.clear();for(let t=0;t<g.length;t++){const e=k[t],{domain:n}=e.getOptions();M.set(t,E(n))}};O();const S=(t,e)=>{const n=[];for(const t of p){const e=i(t);w(e)?(m(t,"active"),n.push(t)):m(t,"inactive")}M.set(t,_(n,t)),e&&f.emit("brushAxis:highlight",{nativeEvent:!0,data:{selection:(()=>{if(!T)return Array.from(M.values());const t=[];for(const[e,n]of M){const r=k[e],{name:i}=r.getOptions();"x"===i?t[0]=n:t[1]=n}return t})()}})},A=t=>{for(const t of p)y(t,"active","inactive");O(),t&&f.emit("brushAxis:remove",{nativeEvent:!0})},_=(t,e)=>{const n=k[e],{name:r}=n.getOptions(),i=t.map((t=>{const e=t.__data__;return n.invert(e[r])}));return E(lS(n,i))},T=g.some(a)&&g.some((t=>!a(t))),P=[];for(let t=0;t<g.length;t++){const e=g[t],n=a(e)?XI:qI,{hotZone:r,brushRegion:i,extent:o}=n(e,{offsetY:s,offsetX:c,cross:T,zIndex:999,fill:"transparent"});e.parentNode.appendChild(r);const u=RI(r,Object.assign(Object.assign({},x),{reverse:l,brushRegion:i,brushended(n){b.delete(e),0===Array.from(b.entries()).length?A(n):S(t,n)},brushed(n,r,i,a,s){b.set(e,o(n,r,i,a)),S(t,s)}}));P.push(u)}const C=(t={})=>{const{nativeEvent:e}=t;e||P.forEach((t=>t.remove(!1)))},N=(t,e,n)=>{const[r,i]=t,o=L(r,e,n),s=L(i,e,n)+(t=>t.getStep?t.getStep():0)(e);return a(n)?[o,-1/0,s,1/0]:[-1/0,o,1/0,s]},L=(t,e,n)=>{const{height:r,width:i}=h.getOptions(),o=e.clone();return a(n)?o.update({range:[0,i]}):o.update({range:[r,0]}),o.map(t)},j=t=>{const{nativeEvent:e}=t;if(e)return;const{selection:n}=t.data;for(let t=0;t<P.length;t++){const e=n[t],r=P[t],i=g[t];if(e){const n=k[t];r.move(...N(e,n,i),!1)}else r.remove(!1)}};return f.on("brushAxis:remove",C),f.on("brushAxis:highlight",j),()=>{P.forEach((t=>t.destroy())),f.off("brushAxis:remove",C),f.off("brushAxis:highlight",j)}}(i,Object.assign({elements:dR,axes:YI,offsetY:l,offsetX:c,points:t=>t.__data__.points,horizontal:t=>{const{startPos:[e,n],endPos:[r,i]}=t.attributes;return e!==r&&n===i},datum:kR(a),state:TR(o,["active",["inactive",{opacity:.5}]]),coordinate:u,emitter:r},t))}}function ZI(t){var{hideX:e=!0,hideY:n=!0}=t,r=Le(t,["hideX","hideY"]);return(t,i,a)=>{const{container:o,view:s,options:c,update:l,setState:u}=t,f=vR(o);let h=!1,d=!1,p=s;const{scale:g,coordinate:v}=s;return function(t,e){var{filter:n,reset:r,brushRegion:i,extent:a,reverse:o,emitter:s,scale:c,coordinate:l,selection:u,series:f=!1}=e;const h=Va(Le(e,["filter","reset","brushRegion","extent","reverse","emitter","scale","coordinate","selection","series"]),"mask"),{width:d,height:p}=t.getBBox(),g=a||[0,0,d,p],v=function(t=300){let e=null;return n=>{const{timeStamp:r}=n;return null!==e&&r-e<t?(e=r,!0):(e=r,!1)}}(),m=RI(t,Object.assign(Object.assign({},h),{extent:g,brushRegion:i,reverse:o,brushcreated:function(t,e,r,i,a){t===r&&e===i||(a.nativeEvent=!0,n(u(t,e,r,i),a),m.remove())}}));function y(t){v(t)&&(t.nativeEvent=!0,r(t))}t.addEventListener("click",y);const b=({nativeEvent:t,data:e})=>{if(t)return;const{selection:r}=e;n(r,{nativeEvent:!1})};return s.on("brush:filter",b),()=>{m.destroy(),s.off("brush:filter",b),t.removeEventListener("click",y)}}(f,Object.assign(Object.assign({brushRegion:(t,e,n,r)=>[t,e,n,r],selection:(t,e,n,r)=>{const{scale:i,coordinate:a}=p;return uS(t,e,n,r,i,a)},filter:(t,r)=>Re(this,void 0,void 0,(function*(){if(d)return;d=!0;const[i,o]=t;u("brushFilter",(t=>{const{marks:r}=t,a=r.map((t=>Q({axis:Object.assign(Object.assign({},e&&{x:{transform:[{type:"hide"}]}}),n&&{y:{transform:[{type:"hide"}]}})},t,{scale:{x:{domain:i,nice:!1},y:{domain:o,nice:!1}}})));return Object.assign(Object.assign({},c),{marks:a,clip:!0})})),a.emit("brush:filter",Object.assign(Object.assign({},r),{data:{selection:[i,o]}}));const s=yield l();p=s.view,d=!1,h=!0})),reset:t=>{if(d||!h)return;const{scale:e}=s,{x:n,y:r}=e,i=n.getOptions().domain,o=r.getOptions().domain;a.emit("brush:filter",Object.assign(Object.assign({},t),{data:{selection:[i,o]}})),h=!1,p=s,u("brushFilter"),l()},extent:void 0,emitter:a,scale:g,coordinate:v},{maskFill:"#777",maskFillOpacity:"0.3",maskStroke:"#fff",unhighlightedOpacity:.5,reverse:!1}),r))}}function QI(t){return ZI(Object.assign(Object.assign({hideX:!0},t),{brushRegion:zI}))}function JI(t){return ZI(Object.assign(Object.assign({hideY:!0},t),{brushRegion:WI}))}function tD(t,e,n,r=!1,i="x",a="y"){const{marks:o}=t,s=o.map((t=>{var o,s;return Q({axis:{x:{transform:[{type:"hide"}]},y:{transform:[{type:"hide"}]}}},t,{scale:e,[n]:Object.assign(Object.assign({},(null===(o=t[n])||void 0===o?void 0:o[i])&&{[i]:Object.assign({preserve:!0},r&&{ratio:null})}),(null===(s=t[n])||void 0===s?void 0:s[a])&&{[a]:{preserve:!0}}),animate:!1})}));return Object.assign(Object.assign({},t),{marks:s,clip:!0,animate:!1})}function eD(t,e,n){const[r,i]=t,a=n?t=>1-t:t=>t;return lS(e,[cS(e,a(r),!0),cS(e,a(i),!1)])}function nD(t){return[t[0],t[t.length-1]]}function rD({initDomain:t={},className:e="slider",prefix:n="slider",setValue:r=(t,e)=>t.setValues(e),hasState:i=!1,wait:a=50,leading:o=!0,trailing:s=!1,getInitValues:c=t=>{var e;const n=null===(e=null==t?void 0:t.attributes)||void 0===e?void 0:e.values;if(0!==n[0]||1!==n[1])return n}}){return(l,u,f)=>{const{container:h,view:d,update:p,setState:g}=l,v=h.getElementsByClassName(e);if(!v.length)return()=>{};let m=!1;const{scale:y,coordinate:b,layout:x}=d,{paddingLeft:w,paddingTop:k,paddingBottom:E,paddingRight:M}=x,{x:O,y:S}=y,A=Vc(b),_=t=>{const e="vertical"===t?"y":"x",n="vertical"===t?"x":"y";return A?[n,e]:[e,n]},T=new Map,P=new Set,C={x:t.x||O.getOptions().domain,y:t.y||S.getOptions().domain};for(const t of v){const{orientation:e}=t.attributes,[l,u]=_(e),h=`${n}${$(l)}:filter`,d="x"===l,{ratio:v}=O.getOptions(),{ratio:b}=S.getOptions(),x=t=>{if(t.data){const{selection:e}=t.data,[n=nD(C.x),r=nD(C.y)]=e;return d?[lS(O,n,v),lS(S,r,b)]:[lS(S,r,b),lS(O,n,v)]}const{value:n}=t.detail;return[eD(n,y[l],A&&"horizontal"===e),C[u]]},N=ot((e=>Re(this,void 0,void 0,(function*(){const{initValue:r=!1}=e;if(m&&!r)return;m=!0;const{nativeEvent:a=!0}=e,[o,s]=x(e);if(C[l]=o,C[u]=s,a){const t=d?o:s,n=d?s:o;f.emit(h,Object.assign(Object.assign({},e),{nativeEvent:a,data:{selection:[nD(t),nD(n)]}}))}g(t,(t=>Object.assign(Object.assign({},tD(t,{[l]:{domain:o,nice:!1}},n,i,l,u)),{paddingLeft:w,paddingTop:k,paddingBottom:E,paddingRight:M}))),yield p(),m=!1}))),a,{leading:o,trailing:s}),L=e=>{const{nativeEvent:n}=e;if(n)return;const{data:i}=e,{selection:a}=i,[o,s]=a;t.dispatchEvent(new Sp("valuechange",{data:i,nativeEvent:!1}));const c=d?fS(o,O):fS(s,S);r(t,c)};f.on(h,L),t.addEventListener("valuechange",N),T.set(t,N),P.add([h,L]);const j=c(t);j&&t.dispatchEvent(new Sp("valuechange",{detail:{value:j},nativeEvent:!1,initValue:!0}))}return()=>{for(const[t,e]of T)t.removeEventListener("valuechange",e);for(const[t,e]of P)f.off(t,e)}}}const iD="g2-scrollbar";function aD(t={}){return(e,n,r)=>{const{view:i,container:a}=e;if(!a.getElementsByClassName(iD).length)return()=>{};const{scale:o}=i,{x:s,y:c}=o,l={x:[...s.getOptions().domain],y:[...c.getOptions().domain]};s.update({domain:s.getOptions().expectedDomain}),c.update({domain:c.getOptions().expectedDomain});return rD(Object.assign(Object.assign({},t),{initDomain:l,className:iD,prefix:"scrollbar",hasState:!0,setValue:(t,e)=>t.setValue(e[0]),getInitValues:t=>{const e=t.slider.attributes.values;if(0!==e[0])return e}}))(e,n,r)}}function oD(t,e,n){return`<${t} style="${Object.entries(n).map((([t,e])=>`${function(t){return t.replace(/([A-Z])/g,"-$1").toLowerCase()}(t)}:${e}`)).join(";")}">${e}</${t}>`}const sD={backgroundColor:"rgba(0,0,0,0.75)",color:"#fff",width:"max-content",padding:"1px 4px",fontSize:"12px",borderRadius:"2.5px",boxShadow:"0 3px 6px -4px rgba(0,0,0,0.12), 0 6px 16px 0 rgba(0,0,0,0.08), 0 9px 28px 8px rgba(0,0,0,0.05)"};function cD(t){return"text"===t.nodeName&&!!t.isOverflowing()}function lD(t){var{offsetX:e=8,offsetY:n=8}=t,r=Le(t,["offsetX","offsetY"]);return t=>{const{container:i}=t,[a,o]=i.getBounds().min,s=Va(r,"tip"),c=new Set,l=t=>{const{target:r}=t;if(!cD(r))return void t.stopPropagation();const{offsetX:l,offsetY:u}=t,f=l+e-a,h=u+n-o;if(r.tip)return r.tip.style.x=f,void(r.tip.style.y=h);const{text:d}=r.style,p=new Lg({className:"poptip",style:{innerHTML:oD("div",d,Object.assign(Object.assign({},sD),s)),x:f,y:h}});i.appendChild(p),r.tip=p,c.add(p)},u=t=>{const{target:e}=t;cD(e)?e.tip&&(e.tip.remove(),e.tip=null,c.delete(e.tip)):t.stopPropagation()};return i.addEventListener("pointerover",l),i.addEventListener("pointerout",u),()=>{i.removeEventListener("pointerover",l),i.removeEventListener("pointerout",u),c.forEach((t=>t.remove()))}}}lD.props={reapplyWhenUpdate:!0};const uD={breadCrumbFill:"rgba(0, 0, 0, 0.85)",breadCrumbFontSize:12,breadCrumbY:12,activeFill:"rgba(0, 0, 0, 0.5)"};function fD(t={}){const{originData:e=[],layout:n}=t,r=Le(t,["originData","layout"]),i=Q({},uD,r),a=Va(i,"breadCrumb"),o=Va(i,"active");return t=>{const{update:r,setState:i,container:s,options:c}=t,l=function(t){return am(t).select(`.${XS}`).node()}(s),u=c.marks[0],{state:f}=u,h=new Cg;l.appendChild(h);const d=(t,c)=>Re(this,void 0,void 0,(function*(){if(h.removeChildren(),c){let e="",n=a.y,r=0;const i=[],s=l.getBBox().width,c=t.map(((o,c)=>{e=`${e}${o}/`,i.push(o);const l=new Yg({name:e.replace(/\/$/,""),style:Object.assign(Object.assign({text:o,x:r,path:[...i],depth:c},a),{y:n})});h.appendChild(l),r+=l.getBBox().width;const u=new Yg({style:Object.assign(Object.assign({x:r,text:" / "},a),{y:n})});return h.appendChild(u),r+=u.getBBox().width,r>s&&(n=h.getBBox().height+a.y,r=0,l.attr({x:r,y:n}),r+=l.getBBox().width,u.attr({x:r,y:n}),r+=u.getBBox().width),c===lt(t)-1&&u.remove(),l}));c.forEach(((t,e)=>{if(e===lt(c)-1)return;const n=Object.assign({},t.attributes);t.attr("cursor","pointer"),t.addEventListener("mouseenter",(()=>{t.attr(o)})),t.addEventListener("mouseleave",(()=>{t.attr(n)})),t.addEventListener("click",(()=>{d(rt(t,["style","path"]),rt(t,["style","depth"]))}))}))}!function(t,e){[...MI(t),...OI(t)].forEach((t=>{e(t,(t=>t))}))}(s,i),i("treemapDrillDown",(r=>{const{marks:i}=r,a=t.join("/"),o=i.map((t=>{if("rect"!==t.type)return t;let r=e;if(c){const t=e.filter((t=>{const e=rt(t,["id"]);return e&&(e.match(`${a}/`)||a.match(e))})).map((t=>({value:0===t.height?rt(t,["value"]):void 0,name:rt(t,["id"])}))),{paddingLeft:i,paddingBottom:o,paddingRight:s}=n,l=Object.assign(Object.assign({},n),{paddingTop:(n.paddingTop||h.getBBox().height+10)/(c+1),paddingLeft:i/(c+1),paddingBottom:o/(c+1),paddingRight:s/(c+1),path:t=>t.name,layer:t=>t.depth===c+1});r=NM(t,l,{value:"value"})[0]}else r=e.filter((t=>1===t.depth));const i=[];return r.forEach((({path:t})=>{i.push(j(t))})),Q({},t,{data:r,scale:{color:{domain:i}}})}));return Object.assign(Object.assign({},r),{marks:o})})),yield r(void 0,["legendFilter"])})),p=t=>{const n=t.target,{markType:r,nodeName:i,attributes:a}=n||{};if("rect"!==r&&i!==Xl.TEXT)return;const o=i===Xl.TEXT&&!0===rt(a,"isTreemapLabel")?(t=>t.attributes.key.split("-")[0])(n):(t=>rt(t,["__data__","key"]))(n),s=_(e,(t=>t.id===o));rt(s,"height")&&d(rt(s,"path"),rt(s,"depth"))};l.addEventListener("click",p);const g=E(Object.assign(Object.assign({},f.active),f.inactive)),v=()=>{FR(l).forEach((t=>{const n=rt(t,["style","cursor"]),r=_(e,(e=>e.id===rt(t,["__data__","key"])));if("pointer"!==n&&(null==r?void 0:r.height)){t.style.cursor="pointer";const e=function(t,e){if(null===t||!A(t))return{};var n={};return k(e,(function(e){it.call(t,e)&&(n[e]=t[e])})),n}(t.attributes,g);t.addEventListener("mouseenter",(()=>{t.attr(f.active)})),t.addEventListener("mouseleave",(()=>{t.attr(Q(e,f.inactive))}))}}))};return v(),l.addEventListener("mousemove",v),()=>{h.remove(),l.removeEventListener("click",p),l.removeEventListener("mousemove",v)}}}const hD={pointR:6,pointStrokeWidth:1,pointStroke:"#888",pointActiveStroke:"#f5f5f5",pathStroke:"#888",pathLineDash:[3,4],labelFontSize:12,labelFill:"#888",labelStroke:"#fff",labelLineWidth:1,labelY:-6,labelX:2},dD="movePoint",pD=t=>{const e=t.target,{markType:n}=e;"line"===n&&(e.attr("_lineWidth",e.attr("lineWidth")||1),e.attr("lineWidth",e.attr("_lineWidth")+3)),"interval"===n&&(e.attr("_opacity",e.attr("opacity")||1),e.attr("opacity",.7*e.attr("_opacity")))},gD=t=>{const e=t.target,{markType:n}=e;"line"===n&&e.attr("lineWidth",e.attr("_lineWidth")),"interval"===n&&e.attr("opacity",e.attr("_opacity"))},vD=(t,e,n)=>{t.forEach(((t,r)=>{t.attr("stroke",e[1]===r?n.activeStroke:n.stroke)}))},mD=(t,e,n,r)=>{const i=new Bg({style:n}),a=new Yg({style:r});return e.appendChild(a),t.appendChild(i),[i,a]},yD=(t,e)=>{if(!rt(t,["options","range","indexOf"]))return;const n=t.options.range.indexOf(e);return t.sortedDomain[n]},bD=(t,e,n)=>{const r=DR(t,e),i=DR(t,n)/r;return[t[0]+(e[0]-t[0])*i,t[1]+(e[1]-t[1])*i]};function xD(t={}){const{selection:e=[],precision:n=2}=t,r=Le(t,["selection","precision"]),i=Object.assign(Object.assign({},hD),r||{}),a=Va(i,"path"),o=Va(i,"label"),s=Va(i,"point");return(t,r,i)=>{const{update:c,setState:l,container:u,view:f,options:{marks:h,coordinate:d}}=t,p=vR(u);let g,v=FR(p),m=e;const{transform:y=[],type:b}=d,x=!!_(y,(({type:t})=>"transpose"===t)),w="polar"===b,k="theta"===b,E=!!_(v,(({markType:t})=>"area"===t));E&&(v=v.filter((({markType:t})=>"area"===t)));const M=new Cg({style:{zIndex:2}});p.appendChild(M);const O=()=>{i.emit("element-point:select",{nativeEvent:!0,data:{selection:m}})},S=t=>{const e=t.target;m=[e.parentNode.childNodes.indexOf(e)],O(),T(e)},A=t=>{const{data:{selection:e},nativeEvent:n}=t;if(n)return;m=e;const r=rt(v,[null==m?void 0:m[0]]);r&&T(r)},T=t=>{const{attributes:e,markType:r,__data__:d}=t,{stroke:p}=e,{points:v,seriesTitle:y,color:b,title:S,seriesX:A,y1:P}=d;if(x&&"interval"!==r)return;const{scale:C,coordinate:N}=(null==g?void 0:g.view)||f,{color:L,y:j,x:R}=C,I=N.getCenter();let D;M.removeChildren();const B=(t,e,n,r)=>Re(this,void 0,void 0,(function*(){return l("elementPointMove",(a=>{var o;const s=((null===(o=null==g?void 0:g.options)||void 0===o?void 0:o.marks)||h).map((a=>{if(!r.includes(a.type))return a;const{data:o,encode:s}=a,c=Object.keys(s).reduce(((r,i)=>{const a=s[i];return"x"===i&&(r[a]=t),"y"===i&&(r[a]=e),"color"===i&&(r[a]=n),r}),{}),l=((t,e,n)=>e.map((e=>{const r=["x","color"].reduce(((r,i)=>{const a=n[i];return a?e[a]===t[a]&&r:r}),!0);return r?Object.assign(Object.assign({},e),t):e})))(c,o,s);return((t,e)=>{i.emit("element-point:moved",{nativeEvent:!0,data:{changeData:t,data:e}})})(c,l),Q({},a,{data:l,animate:!1})}));return Object.assign(Object.assign({},a),{marks:s})})),yield c("elementPointMove")}));if(["line","area"].includes(r))v.forEach(((e,r)=>{const i=R.invert(A[r]);if(!i)return;const c=new Ag({name:dD,style:Object.assign({cx:e[0],cy:e[1],fill:p},s)}),l=((t,e)=>{const n=rt(t,["__data__","seriesItems",e,"0","value"]),r=rt(t,["__data__","seriesIndex",e]),{__data__:{data:i,encode:a,transform:o}}=t.parentNode,s=_(o,(({type:t})=>"normalizeY"===t)),c=rt(a,["y","field"]),l=i[r][c];return t=>s?1===n?t:t/(1-t)/(n/(1-n))*l:t})(t,r);c.addEventListener("mousedown",(f=>{const h=N.output([A[r],0]),d=null==y?void 0:y.length;u.attr("cursor","move"),m[1]!==r&&(m[1]=r,O()),vD(M.childNodes,m,s);const[p,x]=mD(M,c,a,o),k=t=>{const i=e[1]+t.clientY-D[1];if(E)if(w){const a=e[0]+t.clientX-D[0],[o,s]=bD(I,h,[a,i]),[,u]=N.output([1,j.output(0)]),[,f]=N.invert([o,u-(v[r+d][1]-s)]),g=(r+1)%d,m=BR([v[(r-1+d)%d],[o,s],y[g]&&v[g]]);x.attr("text",l(j.invert(f)).toFixed(n)),p.attr("d",m),c.attr("cx",o),c.attr("cy",s)}else{const[,t]=N.output([1,j.output(0)]),[,a]=N.invert([e[0],t-(v[r+d][1]-i)]),o=BR([v[r-1],[e[0],i],y[r+1]&&v[r+1]]);x.attr("text",l(j.invert(a)).toFixed(n)),p.attr("d",o),c.attr("cy",i)}else{const[,t]=N.invert([e[0],i]),a=BR([v[r-1],[e[0],i],v[r+1]]);x.attr("text",j.invert(t).toFixed(n)),p.attr("d",a),c.attr("cy",i)}};D=[f.clientX,f.clientY],window.addEventListener("mousemove",k);const S=()=>Re(this,void 0,void 0,(function*(){if(u.attr("cursor","default"),window.removeEventListener("mousemove",k),u.removeEventListener("mouseup",S),Y(x.attr("text")))return;const e=Number(x.attr("text")),n=yD(L,b);g=yield B(i,e,n,["line","area"]),x.remove(),p.remove(),T(t)}));u.addEventListener("mouseup",S)})),M.appendChild(c)})),vD(M.childNodes,m,s);else if("interval"===r){let e=[(v[0][0]+v[1][0])/2,v[0][1]];x?e=[v[0][0],(v[0][1]+v[1][1])/2]:k&&(e=v[0]);const i=(t=>{const e=rt(t,["__data__","y"]),n=rt(t,["__data__","y1"])-e,{__data__:{data:r,encode:i,transform:a},childNodes:o}=t.parentNode,s=_(a,(({type:t})=>"normalizeY"===t)),c=rt(i,["y","field"]),l=r[o.indexOf(t)][c];return(t,e=!1)=>s||e?t/(1-t)/(n/(1-n))*l:t})(t),c=new Ag({name:dD,style:Object.assign(Object.assign({cx:e[0],cy:e[1],fill:p},s),{stroke:s.activeStroke})});c.addEventListener("mousedown",(s=>{u.attr("cursor","move");const l=yD(L,b),[f,h]=mD(M,c,a,o),d=t=>{if(x){const r=e[0]+t.clientX-D[0],[a]=N.output([j.output(0),j.output(0)]),[,o]=N.invert([a+(r-v[2][0]),e[1]]),s=BR([[r,v[0][1]],[r,v[1][1]],v[2],v[3]],!0);h.attr("text",i(j.invert(o)).toFixed(n)),f.attr("d",s),c.attr("cx",r)}else if(k){const r=e[1]+t.clientY-D[1],a=e[0]+t.clientX-D[0],[o,s]=bD(I,[a,r],e),[l,u]=bD(I,[a,r],v[1]),d=N.invert([o,s])[1],p=P-d;if(p<0)return;const g=function(t,e,n=0){const r=[["M",...e[1]]],i=DR(t,e[1]),a=DR(t,e[0]);return 0===i?r.push(["L",...e[3]],["A",a,a,0,n,1,...e[0]],["Z"]):r.push(["A",i,i,0,n,0,...e[2]],["L",...e[3]],["A",a,a,0,n,1,...e[0]],["Z"]),r}(I,[[o,s],[l,u],v[2],v[3]],p>.5?1:0);h.attr("text",i(p,!0).toFixed(n)),f.attr("d",g),c.attr("cx",o),c.attr("cy",s)}else{const r=e[1]+t.clientY-D[1],[,a]=N.output([1,j.output(0)]),[,o]=N.invert([e[0],a-(v[2][1]-r)]),s=BR([[v[0][0],r],[v[1][0],r],v[2],v[3]],!0);h.attr("text",i(j.invert(o)).toFixed(n)),f.attr("d",s),c.attr("cy",r)}};D=[s.clientX,s.clientY],window.addEventListener("mousemove",d);const p=()=>Re(this,void 0,void 0,(function*(){if(u.attr("cursor","default"),u.removeEventListener("mouseup",p),window.removeEventListener("mousemove",d),Y(h.attr("text")))return;const e=Number(h.attr("text"));g=yield B(S,e,l,[r]),h.remove(),f.remove(),T(t)}));u.addEventListener("mouseup",p)})),M.appendChild(c)}};v.forEach(((t,e)=>{m[0]===e&&T(t),t.addEventListener("click",S),t.addEventListener("mouseenter",pD),t.addEventListener("mouseleave",gD)}));const P=t=>{const e=null==t?void 0:t.target;e&&(e.name===dD||v.includes(e))||(m=[],O(),M.removeChildren())};return i.on("element-point:select",A),i.on("element-point:unselect",P),u.addEventListener("mousedown",P),()=>{M.remove(),i.off("element-point:select",A),i.off("element-point:unselect",P),u.removeEventListener("mousedown",P),v.forEach((t=>{t.removeEventListener("click",S),t.removeEventListener("mouseenter",pD),t.removeEventListener("mouseleave",gD)}))}}}var wD={},kD={};function ED(t){return new Function("d","return {"+t.map((function(t,e){return JSON.stringify(t)+": d["+e+'] || ""'})).join(",")+"}")}function MD(t){var e=Object.create(null),n=[];return t.forEach((function(t){for(var r in t)r in e||n.push(e[r]=r)})),n}function OD(t,e){var n=t+"",r=n.length;return r<e?new Array(e-r+1).join(0)+n:n}function SD(t){var e=t.getUTCHours(),n=t.getUTCMinutes(),r=t.getUTCSeconds(),i=t.getUTCMilliseconds();return isNaN(t)?"Invalid Date":function(t){return t<0?"-"+OD(-t,6):t>9999?"+"+OD(t,6):OD(t,4)}(t.getUTCFullYear())+"-"+OD(t.getUTCMonth()+1,2)+"-"+OD(t.getUTCDate(),2)+(i?"T"+OD(e,2)+":"+OD(n,2)+":"+OD(r,2)+"."+OD(i,3)+"Z":r?"T"+OD(e,2)+":"+OD(n,2)+":"+OD(r,2)+"Z":n||e?"T"+OD(e,2)+":"+OD(n,2)+"Z":"")}function AD(t){var e=new RegExp('["'+t+"\n\r]"),n=t.charCodeAt(0);function r(t,e){var r,i=[],a=t.length,o=0,s=0,c=a<=0,l=!1;function u(){if(c)return kD;if(l)return l=!1,wD;var e,r,i=o;if(34===t.charCodeAt(i)){for(;o++<a&&34!==t.charCodeAt(o)||34===t.charCodeAt(++o););return(e=o)>=a?c=!0:10===(r=t.charCodeAt(o++))?l=!0:13===r&&(l=!0,10===t.charCodeAt(o)&&++o),t.slice(i+1,e-1).replace(/""/g,'"')}for(;o<a;){if(10===(r=t.charCodeAt(e=o++)))l=!0;else if(13===r)l=!0,10===t.charCodeAt(o)&&++o;else if(r!==n)continue;return t.slice(i,e)}return c=!0,t.slice(i,a)}for(10===t.charCodeAt(a-1)&&--a,13===t.charCodeAt(a-1)&&--a;(r=u())!==kD;){for(var f=[];r!==wD&&r!==kD;)f.push(r),r=u();e&&null==(f=e(f,s++))||i.push(f)}return i}function i(e,n){return e.map((function(e){return n.map((function(t){return o(e[t])})).join(t)}))}function a(e){return e.map(o).join(t)}function o(t){return null==t?"":t instanceof Date?SD(t):e.test(t+="")?'"'+t.replace(/"/g,'""')+'"':t}return{parse:function(t,e){var n,i,a=r(t,(function(t,r){if(n)return n(t,r-1);i=t,n=e?function(t,e){var n=ED(t);return function(r,i){return e(n(r),i,t)}}(t,e):ED(t)}));return a.columns=i||[],a},parseRows:r,format:function(e,n){return null==n&&(n=MD(e)),[n.map(o).join(t)].concat(i(e,n)).join("\n")},formatBody:function(t,e){return null==e&&(e=MD(t)),i(t,e).join("\n")},formatRows:function(t){return t.map(a).join("\n")},formatRow:a,formatValue:o}}function _D(t){for(var e in t){var n,r,i=t[e].trim();if(i)if("true"===i)i=!0;else if("false"===i)i=!1;else if("NaN"===i)i=NaN;else if(isNaN(n=+i)){if(!(r=i.match(/^([-+]\d{2})?\d{4}(-\d{2}(-\d{2})?)?(T\d{2}:\d{2}(:\d{2}(\.\d{3})?)?(Z|[-+]\d{2}:\d{2})?)?$/)))continue;TD&&r[4]&&!r[7]&&(i=i.replace(/-/g,"/").replace(/T/," ")),i=new Date(i)}else i=n;else i=null;t[e]=i}return t}const TD=new Date("2019-01-01T00:00").getHours()||new Date("2019-07-01T00:00").getHours(),PD=t=>{const{value:e,format:n=e.split(".").pop(),delimiter:r=",",autoType:i=!0}=t;return()=>Re(void 0,void 0,void 0,(function*(){const t=yield fetch(e);if("csv"===n){const e=yield t.text();return AD(r).parse(e,i?_D:Fa)}if("json"===n)return yield t.json();throw new Error(`Unknown format: ${n}.`)}))};PD.props={};const CD=t=>{const{fields:e,key:n="key",value:r="value"}=t;return t=>{return(i=e)&&0!==Object.keys(i).length?t.flatMap((t=>e.map((e=>Object.assign(Object.assign({},t),{[n]:e,[r]:t[e]}))))):t;var i}};function ND(t){return null!=t&&!Number.isNaN(t)}CD.props={};const LD=t=>{const{callback:e=ND}=t;return t=>t.filter(e)};LD.props={};const jD=t=>{const{callback:e}=t;return t=>Array.isArray(t)?[...t].sort(e):t};jD.props={};const RD=t=>{const{fields:e}=t;return t=>t.map((t=>function(t,e=[]){return e.reduce(((e,n)=>(n in t&&(e[n]=t[n]),e)),{})}(t,e)))};RD.props={};const ID=t=>e=>{if(!t||(n=t,0===Object.keys(n).length))return e;var n;return e.map((e=>Object.entries(e).reduce(((e,[n,r])=>(e[t[n]||n]=r,e)),{})))};ID.props={};const DD=t=>{const{fields:e=[]}=t,n=(r=!0,e.map((t=>{if(Array.isArray(t)){const[e,n=r]=t;return[e,n]}return[t,r]})));var r;return t=>[...t].sort(((t,e)=>n.reduce(((n,[r,i=!0])=>0!==n?n:i?t[r]<e[r]?-1:+(t[r]!==e[r]):t[r]>e[r]?-1:+(t[r]!==e[r])),0)))};DD.props={};const BD=t=>{const{value:e}=t;return()=>e};BD.props={};const FD=t=>{const{callback:e=Fa}=t;return t=>e(t)};FD.props={};const zD=t=>{const{callback:e=Fa}=t;return t=>Array.isArray(t)?t.map(e):t};zD.props={};const GD=Math.PI/180,WD=2048;function $D(t){return t.text}function HD(){return"serif"}function YD(){return"normal"}function VD(t){return t.value}function UD(){return 90*~~(2*Math.random())}function qD(){return 1}function XD(){}function KD(t,e,n,r){if(e.sprite)return;const i=t.context,a=t.ratio;i.clearRect(0,0,2048/a,WD/a);let o=0,s=0,c=0;const l=n.length;for(--r;++r<l;){e=n[r],i.save(),i.font=e.style+" "+e.weight+" "+~~((e.size+1)/a)+"px "+e.font;let t=i.measureText(e.text+"m").width*a,l=e.size<<1;if(e.rotate){const n=Math.sin(e.rotate*GD),r=Math.cos(e.rotate*GD),i=t*r,a=t*n,o=l*r,s=l*n;t=Math.max(Math.abs(i+s),Math.abs(i-s))+31>>5<<5,l=~~Math.max(Math.abs(a+o),Math.abs(a-o))}else t=t+31>>5<<5;if(l>c&&(c=l),o+t>=2048&&(o=0,s+=c,c=0),s+l>=WD)break;i.translate((o+(t>>1))/a,(s+(l>>1))/a),e.rotate&&i.rotate(e.rotate*GD),i.fillText(e.text,0,0),e.padding&&(i.lineWidth=2*e.padding,i.strokeText(e.text,0,0)),i.restore(),e.width=t,e.height=l,e.xoff=o,e.yoff=s,e.x1=t>>1,e.y1=l>>1,e.x0=-e.x1,e.y0=-e.y1,e.hasText=!0,o+=t}const u=i.getImageData(0,0,2048/a,WD/a).data,f=[];for(;--r>=0;){if(!(e=n[r]).hasText)continue;const t=e.width,i=t>>5;let a=e.y1-e.y0;for(let t=0;t<a*i;t++)f[t]=0;if(o=e.xoff,null==o)return;s=e.yoff;let c=0,l=-1;for(let n=0;n<a;n++){for(let e=0;e<t;e++){const t=i*n+(e>>5),r=u[2048*(s+n)+(o+e)<<2]?1<<31-e%32:0;f[t]|=r,c|=r}c?l=n:(e.y0++,a--,n--,s++)}e.y1=e.y0+l,e.sprite=f.slice(0,(e.y1-e.y0)*i)}}function ZD(t,e,n){n>>=5;const r=t.sprite,i=t.width>>5,a=t.x-(i<<4),o=127&a,s=32-o,c=t.y1-t.y0;let l,u=(t.y+t.y0)*n+(a>>5);for(let t=0;t<c;t++){l=0;for(let n=0;n<=i;n++)if((l<<s|(n<i?(l=r[t*i+n])>>>o:0))&e[u+n])return!0;u+=n}return!1}function QD(t,e){const n=t[0],r=t[1];e.x+e.x0<n.x&&(n.x=e.x+e.x0),e.y+e.y0<n.y&&(n.y=e.y+e.y0),e.x+e.x1>r.x&&(r.x=e.x+e.x1),e.y+e.y1>r.y&&(r.y=e.y+e.y1)}function JD(t,e){return t.x+t.x1>e[0].x&&t.x+t.x0<e[1].x&&t.y+t.y1>e[0].y&&t.y+t.y0<e[1].y}function tB(t){const e=t[0]/t[1];return function(t){return[e*(t*=.1)*Math.cos(t),t*Math.sin(t)]}}function eB(t){const e=[];let n=-1;for(;++n<t;)e[n]=0;return e}function nB(){return document.createElement("canvas")}function rB(t){return"function"==typeof t?t:function(){return t}}const iB={archimedean:tB,rectangular:function(t){const e=4*t[0]/t[1];let n=0,r=0;return function(t){const i=t<0?-1:1;switch(Math.sqrt(1+4*i*t)-i&3){case 0:n+=e;break;case 1:r+=4;break;case 2:n-=e;break;default:r-=4}return[n,r]}}};function aB(){let t=[256,256],e=$D,n=HD,r=VD,i=YD,a=UD,o=qD,s=tB,c=Math.random,l=XD,u=[],f=null,h=1/0,d=nB;const p=YD,g={};function v(e,n,r){const i=n.x,a=n.y,o=Math.sqrt(t[0]*t[0]+t[1]*t[1]),l=s(t),u=c()<.5?1:-1;let f,h,d,p=-u;for(;(f=l(p+=u))&&(h=~~f[0],d=~~f[1],!(Math.min(Math.abs(h),Math.abs(d))>=o));)if(n.x=i+h,n.y=a+d,!(n.x+n.x0<0||n.y+n.y0<0||n.x+n.x1>t[0]||n.y+n.y1>t[1])&&(!r||!ZD(n,e,t[0]))&&(!r||JD(n,r))){const r=n.sprite,i=n.width>>5,a=t[0]>>5,o=n.x-(i<<4),s=127&o,c=32-s,l=n.y1-n.y0;let u,f=(n.y+n.y0)*a+(o>>5);for(let t=0;t<l;t++){u=0;for(let n=0;n<=i;n++)e[f+n]|=u<<c|(n<i?(u=r[t*i+n])>>>s:0);f+=a}return delete n.sprite,!0}return!1}return g.start=function(){const[s,m]=t,y=function(t){t.width=t.height=1;const e=Math.sqrt(t.getContext("2d").getImageData(0,0,1,1).data.length>>2);t.width=2048/e,t.height=WD/e;const n=t.getContext("2d");return n.fillStyle=n.strokeStyle="red",n.textAlign="center",n.textBaseline="middle",{context:n,ratio:e}}(d()),b=g.board?g.board:eB((t[0]>>5)*t[1]),x=u.length,w=[],k=u.map((function(t,s,c){return t.text=e.call(this,t,s,c),t.font=n.call(this,t,s,c),t.style=p.call(this,t,s,c),t.weight=i.call(this,t,s,c),t.rotate=a.call(this,t,s,c),t.size=~~r.call(this,t,s,c),t.padding=o.call(this,t,s,c),t})).sort((function(t,e){return e.size-t.size}));let E=-1,M=g.board?[{x:0,y:0},{x:s,y:m}]:void 0;function O(){const e=Date.now();for(;Date.now()-e<h&&++E<x;){const e=k[E];e.x=s*(c()+.5)>>1,e.y=m*(c()+.5)>>1,KD(y,e,k,E),e.hasText&&v(b,e,M)&&(l.call(null,"word",{cloud:g,word:e}),w.push(e),M?g.hasImage||QD(M,e):M=[{x:e.x+e.x0,y:e.y+e.y0},{x:e.x+e.x1,y:e.y+e.y1}],e.x-=t[0]>>1,e.y-=t[1]>>1)}g._tags=w,g._bounds=M,E>=x&&(g.stop(),l.call(null,"end",{cloud:g,words:w,bounds:M}))}return f&&clearInterval(f),f=setInterval(O,0),O(),g},g.stop=function(){return f&&(clearInterval(f),f=null),g},g.createMask=e=>{const n=document.createElement("canvas"),[r,i]=t;if(!r||!i)return;const a=r>>5,o=eB((r>>5)*i);n.width=r,n.height=i;const s=n.getContext("2d");s.drawImage(e,0,0,e.width,e.height,0,0,r,i);const c=s.getImageData(0,0,r,i).data;for(let t=0;t<i;t++)for(let e=0;e<r;e++){const n=a*t+(e>>5),i=t*r+e<<2,s=c[i]>=250&&c[i+1]>=250&&c[i+2]>=250?1<<31-e%32:0;o[n]|=s}g.board=o,g.hasImage=!0},g.timeInterval=function(t){h=null==t?1/0:t},g.words=function(t){u=t},g.size=function(e=[]){t=[+e[0],+e[1]]},g.text=function(t){e=rB(t)},g.font=function(t){n=rB(t)},g.fontWeight=function(t){i=rB(t)},g.rotate=function(t){a=rB(t)},g.canvas=function(t){d=rB(t)},g.spiral=function(t){s=iB[t]||t},g.fontSize=function(t){r=rB(t)},g.padding=function(t){o=rB(t)},g.random=function(t){c=rB(t)},g.on=function(t){l=rB(t)},g}const oB={fontSize:[20,60],font:"Impact",padding:2,rotate:function(){return 30*(~~(6*Math.random())-3)}};function sB(t){return new Promise(((e,n)=>{if(t instanceof HTMLImageElement)e(t);else{if("string"==typeof t){const r=new Image;return r.crossOrigin="anonymous",r.src=t,r.onload=()=>e(r),void(r.onerror=()=>{console.error(`'image ${t} load failed !!!'`),n()})}n()}}))}const cB=(t,e)=>n=>Re(void 0,void 0,void 0,(function*(){const r=Object.assign({},oB,t,{canvas:e.createCanvas}),i=aB();var a,o;yield(a=i,o=r,{set(t,e,n){if(void 0===o[t])return this;const r=e?e.call(null,o[t]):o[t];return n?n.call(null,r):"function"==typeof a[t]?a[t](r):a[t]=r,this},setAsync(t,e,n){return Re(this,void 0,void 0,(function*(){if(void 0===o[t])return this;const r=e?yield e.call(null,o[t]):o[t];return n?n.call(null,r):"function"==typeof a[t]?a[t](r):a[t]=r,this}))}}).set("fontSize",(t=>{const e=n.map((t=>t.value));return function(t,e){if("function"==typeof t)return t;if(Array.isArray(t)){const[n,r]=t;if(!e)return()=>(r+n)/2;const[i,a]=e;return a===i?()=>(r+n)/2:({value:t})=>(r-n)/(a-i)*(t-i)+n}return()=>t}(t,[mr(e),gr(e)])})).set("font").set("fontStyle").set("fontWeight").set("padding").set("rotate").set("size").set("spiral").set("timeInterval").set("random").set("text").set("on").set("canvas").setAsync("imageMask",sB,i.createMask),i.words([...n]);const s=i.start(),[c,l]=r.size,u=[{x:0,y:0},{x:c,y:l}],{_bounds:f=u,_tags:h,hasImage:d}=s,p=h.map((t=>{var{x:e,y:n,font:r}=t,i=Le(t,["x","y","font"]);return Object.assign(Object.assign({},i),{x:e+c/2,y:n+l/2,fontFamily:r})})),[{x:g,y:v},{x:m,y:y}]=f,b={text:"",value:0,opacity:0,fontSize:0};return p.push(Object.assign(Object.assign({},b),{x:d?0:g,y:d?0:v}),Object.assign(Object.assign({},b),{x:d?c:m,y:d?l:y})),p}));function lB(t){return"string"==typeof t?e=>e[t]:t}cB.props={};const uB=t=>{const{join:e,on:n,select:r=[],as:i=r,unknown:a=NaN}=t,[o,s]=n,c=lB(s),l=lB(o),u=tr(e,(([t])=>t),(t=>c(t)));return t=>t.map((t=>{const e=u.get(l(t));return Object.assign(Object.assign({},t),r.reduce(((t,n,r)=>(t[i[r]]=e?e[n]:a,t)),{}))}))};uB.props={};const fB=t=>{const{start:e,end:n}=t;return t=>t.slice(e,n)};fB.props={};var hB={exports:{}},dB={exports:{}};!function(t){var e=t.exports;t.exports.isNumber=function(t){return"number"==typeof t},t.exports.findMin=function(t){if(0===t.length)return 1/0;for(var e=t[0],n=1;n<t.length;n++)e=Math.min(e,t[n]);return e},t.exports.findMax=function(t){if(0===t.length)return-1/0;for(var e=t[0],n=1;n<t.length;n++)e=Math.max(e,t[n]);return e},t.exports.findMinMulti=function(t){for(var n=e.findMin(t[0]),r=1;r<t.length;r++)n=Math.min(n,e.findMin(t[r]));return n},t.exports.findMaxMulti=function(t){for(var n=e.findMax(t[0]),r=1;r<t.length;r++)n=Math.max(n,e.findMax(t[r]));return n},t.exports.inside=function(t,e,n){return t<=n&&n<=e}}(dB),function(t){var e=Math.log(2),n=t.exports,r=dB.exports;function i(t){return 1-Math.abs(t)}t.exports.getUnifiedMinMax=function(t,e){return n.getUnifiedMinMaxMulti([t],e)},t.exports.getUnifiedMinMaxMulti=function(t,e){e=e||{};var n=!1,i=!1,a=r.isNumber(e.width)?e.width:2,o=r.isNumber(e.size)?e.size:50,s=r.isNumber(e.min)?e.min:(n=!0,r.findMinMulti(t)),c=r.isNumber(e.max)?e.max:(i=!0,r.findMaxMulti(t)),l=(c-s)/(o-1);return n&&(s-=2*a*l),i&&(c+=2*a*l),{min:s,max:c}},t.exports.create=function(t,e){if(e=e||{},!t||0===t.length)return[];var a=r.isNumber(e.size)?e.size:50,o=r.isNumber(e.width)?e.width:2,s=n.getUnifiedMinMax(t,{size:a,width:o,min:e.min,max:e.max}),c=s.min,l=s.max-c,u=l/(a-1);if(0===l)return[{x:c,y:1}];for(var f=[],h=0;h<a;h++)f.push({x:c+h*u,y:0});var d=function(t,e){for(var n={},r=0,i=-e;i<=e;i++)r+=t(i/e),n[i]=r;return n}(i,o),p=d[o],g=d[o-1]-d[o-2],v=0;t.forEach((function(t){var e=function(t){return Math.floor((t-c)/u)}(t);if(!(e+o<0||e-o>=f.length)){var n=Math.max(e-o,0),i=e,a=Math.min(e+o,f.length-1),s=n-(e-o),l=e+o-a,h=d[-o-1+s]||0,m=d[-o-1+l]||0,y=p/(p-h-m);s>0&&(v+=y*(s-1)*g);var b=Math.max(0,e-o+1);r.inside(0,f.length-1,b)&&(f[b].y+=1*y*g),r.inside(0,f.length-1,i+1)&&(f[i+1].y-=2*y*g),r.inside(0,f.length-1,a+1)&&(f[a+1].y+=1*y*g)}}));var m=v,y=0,b=0;return f.forEach((function(t){y+=t.y,m+=y,t.y=m,b+=m})),b>0&&f.forEach((function(t){t.y/=b})),f},t.exports.getExpectedValueFromPdf=function(t){if(t&&0!==t.length){var e=0;return t.forEach((function(t){e+=t.x*t.y})),e}},t.exports.getXWithLeftTailArea=function(t,e){if(t&&0!==t.length){for(var n=0,r=0,i=0;i<t.length&&(r=i,!((n+=t[i].y)>=e));i++);return t[r].x}},t.exports.getPerplexity=function(t){if(t&&0!==t.length){var n=0;return t.forEach((function(t){var e=Math.log(t.y);isFinite(e)&&(n+=t.y*e)})),n=-n/e,Math.pow(2,n)}}}(hB);var pB=hB.exports;const gB=t=>{const{field:e,groupBy:n,as:r=["y","size"],min:i,max:a,size:o=10,width:s}=t,[c,l]=r;return t=>{const r=Array.from(Qn(t,(t=>n.map((e=>t[e])).join("-"))).values());return r.map((t=>{const n=pB.create(t.map((t=>t[e])),{min:i,max:a,size:o,width:s}),r=n.map((t=>t.x)),u=n.map((t=>t.y));return Object.assign(Object.assign({},t[0]),{[c]:r,[l]:u})}))}};gB.props={};const vB=()=>t=>(console.log("G2 data section:",t),t);vB.props={};const mB=t=>{const{field:e="y",alpha:n=.6,as:r=e}=t;return t=>{const i=t.map((t=>t[e])),a=function(t,e){if(e<0||e>1)throw new Error("alpha must be between 0 and 1.");if(0===t.length)return[];let n=t[0];const r=[];for(const i of t){if(null==i){r.push(i),console.warn("EMA:The value is null or undefined",t);continue}null==n&&(n=i);const a=n*e+(1-e)*i;r.push(a),n=a}return r}(i,n);return t.map(((t,e)=>Object.assign(Object.assign({},t),{[r]:a[e]})))}};mB.props={};function yB(t){const{min:e,max:n}=t;return[[e[0],e[1]],[n[0],n[1]]]}function bB(t,e,n=.01){const[r,i]=t,[a,o]=e;return r>=a[0]-n&&r<=o[0]+n&&i>=a[1]-n&&i<=o[1]+n}const xB=t=>{const{priority:e}=t;return t=>{const n=[];return e&&t.sort(e),t.forEach((t=>{hR(t);const e=t.getLocalBounds(),r=n.some((t=>function(t,e){const[n,r]=t,[i,a]=e;return n[0]<a[0]&&r[0]>i[0]&&n[1]<a[1]&&r[1]>i[1]}(yB(e),yB(t.getLocalBounds()))));r?fR(t):n.push(t)})),t}};function wB([t,e],[n,r]){return r>t&&e>n}function kB(){const t=new Map;return[e=>t.get(e),(e,n)=>t.set(e,n)]}function EB(t){const e=t.cloneNode(!0),n=e.getElementById("connector");n&&e.removeChild(n);const{min:r,max:i}=e.getRenderBounds();return e.destroy(),{min:r,max:i}}const MB=t=>{const{maxIterations:e=10,maxError:n=.1,padding:r=1}=t;return t=>{const i=t.length;if(i<=1)return t;const[a,o]=kB(),[s,c]=kB(),[l,u]=kB(),[f,h]=kB();for(const e of t){const{min:t,max:n}=EB(e),[r,i]=t,[a,s]=n;o(e,i),c(e,i),u(e,s-i),h(e,[r,a])}for(let a=0;a<e;a++){t.sort(((t,e)=>Rn(s(t),s(e))));let e=0;for(let n=0;n<i-1;n++){const i=t[n];let a,o=n+1;for(;(a=t[o])&&!wB(f(i),f(a));)o+=1;if(a){const t=s(i),n=l(i),o=s(a),u=o-(t+n);if(u<r){const n=(r-u)/2;e=Math.max(e,n),c(i,t-n),c(a,o+n)}}}if(e<n)break}for(const e of t)e.style.y+=s(e)-a(e);return t}};function OB(t){let e=t/255;return e=e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4),e}function SB(t,e,n){return.2126*OB(t)+.7152*OB(e)+.0722*OB(n)}function AB(t,e){if(!t||!e||t===e)return 1;const{r:n,g:r,b:i}=t,{r:a,g:o,b:s}=e,c=SB(n,r,i),l=SB(a,o,s);return(Math.max(c,l)+.05)/(Math.min(c,l)+.05)}function _B(t,e){const n=vr(e,(e=>AB(t,function(t){return"object"==typeof t?t:ih(t)}(e))));return e[n]}const TB=t=>{const{threshold:e=4.5,palette:n=["#000","#fff"]}=t;return t=>(t.forEach((t=>{const r=t.attr("dependentElement").parsedStyle.fill;AB(t.parsedStyle.fill,r)<e&&t.attr("fill",_B(r,n))})),t)},PB=()=>t=>(t.forEach((t=>{hR(t);const e=t.attr("bounds"),n=function(t,e,n=.01){const[r,i]=t;return!(bB(r,e,n)&&bB(i,e,n))}(yB(t.getLocalBounds()),e);n&&fR(t)})),t),CB=()=>(t,{canvas:e,layout:n})=>(t.forEach((t=>{hR(t);const{max:e,min:r}=t.getRenderBounds(),[i,a]=e,[o,s]=r,c=((t,e)=>{const[[n,r],[i,a]]=e,[[o,s],[c,l]]=t;let u=0,f=0;return o<n?u=n-o:c>i&&(u=i-c),s<r?f=r-s:l>a&&(f=a-l),[u,f]})([[o,s],[i,a]],[[n.x,n.y],[n.x+n.width,n.y+n.height]]);t.style.connector&&t.style.connectorPoints&&(t.style.connectorPoints[0][0]-=c[0],t.style.connectorPoints[0][1]-=c[1]),t.style.x+=c[0],t.style.y+=c[1]})),t);function NB(){return{"data.fetch":PD,"data.inline":BD,"data.sortBy":DD,"data.sort":jD,"data.filter":LD,"data.pick":RD,"data.rename":ID,"data.fold":CD,"data.slice":fB,"data.custom":FD,"data.map":zD,"data.join":uB,"data.kde":gB,"data.log":vB,"data.wordCloud":cB,"data.ema":mB,"transform.stackY":go,"transform.binX":js,"transform.bin":Ls,"transform.dodgeX":Fo,"transform.jitter":Ho,"transform.jitterX":Yo,"transform.jitterY":Vo,"transform.symmetryY":Uo,"transform.diffY":qo,"transform.stackEnter":zo,"transform.normalizeY":Go,"transform.select":Jo,"transform.selectX":ts,"transform.selectY":es,"transform.groupX":ds,"transform.groupY":ps,"transform.groupColor":gs,"transform.group":hs,"transform.sortX":ms,"transform.sortY":bs,"transform.sortColor":ys,"transform.flexX":xs,"transform.pack":Ps,"transform.sample":Is,"transform.filter":Ds,"coordinate.cartesian":e,"coordinate.polar":r,"coordinate.transpose":a,"coordinate.theta":o,"coordinate.parallel":l,"coordinate.fisheye":u,"coordinate.radial":c,"coordinate.radar":f,"coordinate.helix":i,"encode.constant":h,"encode.field":p,"encode.transform":d,"encode.column":g,"mark.interval":gE,"mark.rect":mE,"mark.line":wE,"mark.point":EE,"mark.text":OE,"mark.cell":AE,"mark.area":TE,"mark.link":CE,"mark.image":LE,"mark.polygon":RE,"mark.box":DE,"mark.vector":FE,"mark.lineX":$E,"mark.lineY":GE,"mark.connector":YE,"mark.range":XE,"mark.rangeX":ZE,"mark.rangeY":JE,"mark.path":eM,"mark.shape":LM,"mark.density":IM,"mark.heatmap":BM,"mark.wordCloud":jM,"palette.category10":FM,"palette.category20":zM,"scale.linear":WM,"scale.ordinal":$M,"scale.band":GM,"scale.identity":HM,"scale.point":YM,"scale.time":VM,"scale.log":UM,"scale.pow":qM,"scale.sqrt":QM,"scale.threshold":XM,"scale.quantile":KM,"scale.quantize":ZM,"scale.sequential":JM,"scale.constant":tO,"theme.classic":iO,"theme.classicDark":sO,"theme.academy":lO,"theme.light":rO,"theme.dark":oO,"component.axisX":GO,"component.axisY":WO,"component.legendCategory":qO,"component.legendContinuous":JO,"component.legends":bS,"component.title":oS,"component.sliderX":pS,"component.sliderY":gS,"component.scrollbarX":mS,"component.scrollbarY":yS,"animation.scaleInX":xS,"animation.scaleOutX":wS,"animation.scaleInY":kS,"animation.scaleOutY":ES,"animation.waveIn":FS,"animation.fadeIn":MS,"animation.fadeOut":OS,"animation.zoomIn":zS,"animation.zoomOut":GS,"animation.pathIn":WS,"animation.morphing":BS,"animation.growInX":$S,"animation.growInY":HS,"interaction.elementHighlight":$R,"interaction.elementHighlightByX":HR,"interaction.elementHighlightByColor":YR,"interaction.elementSelect":UR,"interaction.elementSelectByX":qR,"interaction.elementSelectByColor":XR,"interaction.fisheye":ZR,"interaction.chartIndex":KR,"interaction.tooltip":bI,"interaction.legendFilter":TI,"interaction.legendHighlight":PI,"interaction.brushHighlight":FI,"interaction.brushXHighlight":GI,"interaction.brushYHighlight":$I,"interaction.brushAxisHighlight":KI,"interaction.brushFilter":ZI,"interaction.brushXFilter":QI,"interaction.brushYFilter":JI,"interaction.sliderFilter":rD,"interaction.scrollbarFilter":aD,"interaction.poptip":lD,"interaction.treemapDrillDown":fD,"interaction.elementPointMove":xD,"composition.spaceLayer":rP,"composition.spaceFlex":iP,"composition.facetRect":xP,"composition.repeatMatrix":SP,"composition.facetCircle":NP,"composition.timingKeyframe":jP,"labelTransform.overlapHide":xB,"labelTransform.overlapDodgeY":MB,"labelTransform.overflowHide":PB,"labelTransform.contrastReverse":TB,"labelTransform.exceedAdjust":CB}}function LB(t,e){return class extends t{constructor(t){super(Object.assign(Object.assign({},t),{lib:e}))}}}const jB={};const RB=t=>t?parseInt(t):0;function IB(t,e){const n=[t];for(;n.length;){const t=n.shift();e&&e(t);const r=t.children||[];for(const t of r)n.push(t)}}class DB{constructor(t={},e){this.parentNode=null,this.children=[],this.index=0,this.type=e,this.value=t}map(t=t=>t){const e=t(this.value);return this.value=e,this}attr(t,e){return 1===arguments.length?this.value[t]:this.map((n=>(n[t]=e,n)))}append(t){const e=new t({});return e.children=[],this.push(e),e}push(t){return t.parentNode=this,t.index=this.children.length,this.children.push(t),this}remove(){const t=this.parentNode;if(t){const{children:e}=t,n=e.findIndex((t=>t===this));e.splice(n,1)}return this}getNodeByKey(t){let e=null;return IB(this,(n=>{t===n.attr("key")&&(e=n)})),e}getNodesByType(t){const e=[];return IB(this,(n=>{t===n.type&&e.push(n)})),e}getNodeByType(t){let e=null;return IB(this,(n=>{e||t===n.type&&(e=n)})),e}call(t,...e){return t(this.map(),...e),this}getRoot(){let t=this;for(;t&&t.parentNode;)t=t.parentNode;return t}}const BB=["width","height","depth","padding","paddingLeft","paddingRight","paddingBottom","paddingTop","inset","insetLeft","insetRight","insetTop","insetBottom","margin","marginLeft","marginRight","marginTop","marginBottom","autoFit","theme","title","interaction"],FB="__remove__",zB="__callback__";function GB(t){return Object.assign(Object.assign({},t.value),{type:t.type})}function WB(t,e){const{width:n,height:r,autoFit:i,depth:a=0}=t;let o=640,s=480;if(i){const{width:t,height:n}=function(t){const e=getComputedStyle(t),n=t.clientWidth||RB(e.width),r=t.clientHeight||RB(e.height);return{width:n-(RB(e.paddingLeft)+RB(e.paddingRight)),height:r-(RB(e.paddingTop)+RB(e.paddingBottom))}}(e);o=t||o,s=n||s}return o=n||o,s=r||s,{width:Math.max(I(o)?o:1,1),height:Math.max(I(s)?s:1,1),depth:a}}function $B(t){const e=function(t){if(null!==t.type)return t;const e=t.children[t.children.length-1];for(const n of BB)e.attr(n,t.attr(n));return e}(t),n=[e],r=new Map;for(r.set(e,GB(e));n.length;){const t=n.pop(),e=r.get(t),{children:i=[]}=t;for(const t of i)if(t.type===zB)e.children=t.value;else{const i=GB(t),{children:a=[]}=e;a.push(i),n.push(t),r.set(t,i),e.children=a}}return r.get(e)}function HB(t,e,n,r,i){const{type:a}=t,{type:o=n||a}=e;if(function(t,e){return"function"!=typeof t&&new Set(Object.keys(e)).has(t)}(o,i)){for(const n of BB)void 0!==t.attr(n)&&void 0===e[n]&&(e[n]=t.attr(n));return e}if(function(t,e){return"function"==typeof t||new Set(Object.keys(e)).has(t)}(o,r)){const t={type:"view"},n=Object.assign({},e);for(const e of BB)void 0!==n[e]&&(t[e]=n[e],delete n[e]);return Object.assign(Object.assign({},t),{children:[n]})}return e}function YB(t,e,n){if("function"==typeof t){const e=new DB;return e.value=t,e.type=zB,e}const{type:r,children:i}=t,a=Le(t,["type","children"]),o=function(t,e,n){if("function"==typeof t)return e.mark;const r=Object.assign(Object.assign({},e),n)[t];if(!r)throw new Error(`Unknown mark: ${t}.`);return r}(r,e,n),s=new o;return s.value=a,s.type=r,s}function VB(t,e){const{type:n,children:r}=e,i=Le(e,["type","children"]);t.type===n||void 0===n?Qa(t.value,i):"string"==typeof n&&(t.type=n,t.value=i)}function UB(t,e,n,r){if(!t)return;const i=[[t,e]];for(;i.length;){const[t,e]=i.shift(),a=YB(e,n,r);Array.isArray(t.children)&&t.push(a);const{children:o}=e;if(Array.isArray(o))for(const t of o)i.push([a,t]);else"function"==typeof o&&i.push([a,o])}}function qB(t,e,{key:n=e}){t.prototype[e]=function(t){return 0===arguments.length?this.attr(n):this.attr(n,t)}}function XB(t,e,{key:n=e}){t.prototype[e]=function(t){if(0===arguments.length)return this.attr(n);if(Array.isArray(t))return this.attr(n,t);const e=[...this.attr(n)||[],t];return this.attr(n,e)}}function KB(t,e,{key:n=e}){t.prototype[e]=function(t,e){if(0===arguments.length)return this.attr(n);if(1===arguments.length&&"string"!=typeof t)return this.attr(n,t);const r=this.attr(n)||{};return r[t]=1===arguments.length||e,this.attr(n,r)}}function ZB(t,e,n){t.prototype[e]=function(t){if(0===arguments.length)return this.attr(e);if(Array.isArray(t))return this.attr(e,{items:t});if(Ka(t)&&(void 0!==t.title||void 0!==t.items))return this.attr(e,t);if(null===t||!1===t)return this.attr(e,t);const n=this.attr(e)||{},{items:r=[]}=n;return r.push(t),n.items=r,this.attr(e,n)}}function QB(t,e,{ctor:n}){t.prototype[e]=function(t){const r=this.append(n);return"mark"===e&&(r.type=t),r}}function JB(t,e,{ctor:n}){t.prototype[e]=function(){return this.type=null,this.append(n)}}function tF(t){return e=>{for(const[n,r]of Object.entries(t)){const{type:t}=r;"value"===t?qB(e,n,r):"array"===t?XB(e,n,r):"object"===t?KB(e,n,r):"node"===t?QB(e,n,r):"container"===t?JB(e,n,r):"mix"===t&&ZB(e,n)}return e}}function eF(t){return Object.fromEntries(Object.entries(t).map((([t,e])=>[t,{type:"node",ctor:e}])))}const nF={encode:{type:"object"},scale:{type:"object"},data:{type:"value"},transform:{type:"array"},style:{type:"object"},animate:{type:"object"},coordinate:{type:"object"},interaction:{type:"object"},label:{type:"array",key:"labels"},axis:{type:"object"},legend:{type:"object"},slider:{type:"object"},scrollbar:{type:"object"},state:{type:"object"},layout:{type:"object"},theme:{type:"object"},title:{type:"value"}},rF=Object.assign(Object.assign({},nF),{tooltip:{type:"mix"},viewStyle:{type:"object"}}),iF=Object.assign(Object.assign({},nF),{labelTransform:{type:"array"}});let aF=class extends DB{changeData(t){var e;const n=this.getRoot();if(n)return this.attr("data",t),(null===(e=this.children)||void 0===e?void 0:e.length)&&this.children.forEach((e=>{e.attr("data",t)})),null==n?void 0:n.render()}getView(){const t=this.getRoot(),{views:e}=t.getContext();if(null==e?void 0:e.length)return e.find((t=>t.key===this._key))}getScale(){var t;return null===(t=this.getView())||void 0===t?void 0:t.scale}getScaleByChannel(t){const e=this.getScale();if(e)return e[t]}getCoordinate(){var t;return null===(t=this.getView())||void 0===t?void 0:t.coordinate}getTheme(){var t;return null===(t=this.getView())||void 0===t?void 0:t.theme}getGroup(){const t=this._key;if(!t)return;return this.getRoot().getContext().canvas.getRoot().getElementById(t)}show(){const t=this.getGroup();t&&!t.isVisible()&&hR(t)}hide(){const t=this.getGroup();t&&t.isVisible()&&fR(t)}};aF=je([tF(iF)],aF);let oF=class extends DB{changeData(t){const e=this.getRoot();if(e)return this.attr("data",t),null==e?void 0:e.render()}getMark(){var t;const e=null===(t=this.getRoot())||void 0===t?void 0:t.getView();if(!e)return;const{markState:n}=e,r=Array.from(n.keys()).find((t=>t.key===this.attr("key")));return n.get(r)}getScale(){var t;const e=null===(t=this.getRoot())||void 0===t?void 0:t.getView();if(e)return null==e?void 0:e.scale}getScaleByChannel(t){var e,n;const r=null===(e=this.getRoot())||void 0===e?void 0:e.getView();if(r)return null===(n=null==r?void 0:r.scale)||void 0===n?void 0:n[t]}getGroup(){const t=this.attr("key");if(!t)return;return this.getRoot().getContext().canvas.getRoot().getElementById(t)}};oF=je([tF(rF)],oF);const sF="G2_CHART_KEY";class cF extends aF{constructor(t){const{container:e,canvas:n,renderer:r,plugins:i,lib:a,createCanvas:o}=t;super(Le(t,["container","canvas","renderer","plugins","lib","createCanvas"]),"view"),this._hasBindAutoFit=!1,this._rendering=!1,this._trailingClear=null,this._trailing=!1,this._trailingResolve=null,this._trailingReject=null,this._previousDefinedType=null,this._onResize=q((()=>{this.forceFit()}),300),this._renderer=r||new h_,this._plugins=i||[],this._container=function(t){if(void 0===t){const t=document.createElement("div");return t[FB]=!0,t}if("string"==typeof t)return document.getElementById(t);return t}(e),this._emitter=new v_,this._context={library:Object.assign(Object.assign({},a),jB),emitter:this._emitter,canvas:n,createCanvas:o},this._create()}render(){if(this._rendering)return this._addToTrailing();this._context.canvas||this._createCanvas(),this._bindAutoFit(),this._rendering=!0;const t=new Promise(((t,e)=>aR(this._computedOptions(),this._context,this._createResolve(t),this._createReject(e)))),[e,n,r]=function(){let t,e;return[new Promise(((n,r)=>{e=n,t=r})),e,t]}();return t.then(n).then((()=>{if(this._trailingClear){const t=this.options();this._trailingClear(),this._trailing&&this.options(t)}})).catch(r).then((()=>{this._trailingClear=null,this._renderTrailing()})),e}options(t){if(0===arguments.length)return $B(this);const{type:e}=t;return e&&(this._previousDefinedType=e),function(t,e,n,r,i){const a=[[null,t,HB(t,e,n,r,i)]];for(;a.length;){const[t,e,n]=a.shift();if(e)if(n){VB(e,n);const{children:t}=n,{children:r}=e;if(Array.isArray(t)&&Array.isArray(r)){const n=Math.max(t.length,r.length);for(let i=0;i<n;i++){const n=t[i],o=r[i];a.push([e,o,n])}}else"function"==typeof t&&a.push([e,null,t])}else e.remove();else UB(t,n,r,i)}}(this,t,this._previousDefinedType,this._marks,this._compositions),this}getContainer(){return this._container}getContext(){return this._context}on(t,e,n){return this._emitter.on(t,e,n),this}once(t,e){return this._emitter.once(t,e),this}emit(t,...e){return this._emitter.emit(t,...e),this}off(t,e){return this._emitter.off(t,e),this}clear(t=!0){this.options();this.emit(m_.BEFORE_CLEAR),this._reset(),oR(0,this._context,!1,t),this.emit(m_.AFTER_CLEAR)}destroy(){this.options();this.emit(m_.BEFORE_DESTROY),this._unbindAutoFit(),this._reset(),oR(0,this._context,!0),this._container[FB]&&function(t){const e=t.parentNode;e&&e.removeChild(t)}(this._container),this.emit(m_.AFTER_DESTROY)}forceFit(){this.options.autoFit=!0;const{width:t,height:e}=WB(this.options(),this._container);if(t===this._width&&e===this._height)return Promise.resolve(this);this.emit(m_.BEFORE_CHANGE_SIZE);const n=this.render();return n.then((()=>{this.emit(m_.AFTER_CHANGE_SIZE)})),n}changeSize(t,e){if(t===this._width&&e===this._height)return Promise.resolve(this);this.emit(m_.BEFORE_CHANGE_SIZE),this.attr("width",t),this.attr("height",e);const n=this.render();return n.then((()=>{this.emit(m_.AFTER_CHANGE_SIZE)})),n}getDataByXY(t,e={}){const{shared:n=!1,series:r,facet:i=!1,startX:a=0,startY:o=0}=e,{canvas:s,views:c}=this._context,{document:l}=s,{x:u,y:f}=t,{coordinate:h,scale:d,markState:p,data:g,key:v}=c[0],m=l.getElementsByClassName(US),y=n?t=>t.__data__.x:t=>t,b=Qn(m,y),x=vR(l.getElementsByClassName(qS)[0]),w=t=>Array.from(t.values()).some((t=>{var e,n;return(null===(e=t.interaction)||void 0===e?void 0:e.seriesTooltip)||(null===(n=t.channels)||void 0===n?void 0:n.some((t=>"series"===t.name&&void 0!==t.values)))})),k=dI(r,w(p)),E=t=>rt(t,"__data__.data",null);try{if(k&&w(p)&&!i){const{selectedData:t}=vI({root:x,event:{offsetX:u,offsetY:f},elements:m,coordinate:h,scale:d,startX:a,startY:o}),e=g.get(`${v}-0`);return t.map((({index:t})=>e[t]))}const t=y(gI({root:x,event:{offsetX:u,offsetY:f},elements:m,coordinate:h,scale:d,shared:n})),e=b.get(t);return e?e.map(E):[]}catch(t){const e=s.document.elementFromPointSync(u,f);return e?E(e):[]}}_create(){const{library:t}=this._context,e=["mark.mark",...Object.keys(t).filter((t=>t.startsWith("mark.")||"component.axisX"===t||"component.axisY"===t||"component.legends"===t))];this._marks={};for(const t of e){const e=t.split(".").pop();class n extends oF{constructor(){super({},e)}}this._marks[e]=n,this[e]=function(t){const r=this.append(n);return"mark"===e&&(r.type=t),r}}const n=["composition.view",...Object.keys(t).filter((t=>t.startsWith("composition.")&&"composition.mark"!==t))];this._compositions=Object.fromEntries(n.map((t=>{const e=t.split(".").pop();let n=class extends aF{constructor(){super({},e)}};return n=je([tF(eF(this._marks))],n),[e,n]})));for(const t of Object.values(this._compositions))tF(eF(this._compositions))(t);for(const t of n){const e=t.split(".").pop();this[e]=function(){const t=this._compositions[e];return this.type=null,this.append(t)}}}_reset(){const t=["theme","type","width","height","autoFit"];this.type="view",this.value=Object.fromEntries(Object.entries(this.value).filter((([e])=>e.startsWith("margin")||e.startsWith("padding")||e.startsWith("inset")||t.includes(e)))),this.children=[]}_renderTrailing(){this._trailing&&(this._trailing=!1,this.render().then((()=>{const t=this._trailingResolve.bind(this);this._trailingResolve=null,t(this)})).catch((t=>{const e=this._trailingReject.bind(this);this._trailingReject=null,e(t)})))}_createResolve(t){return()=>{this._rendering=!1,t(this)}}_createReject(t){return e=>{this._rendering=!1,t(e)}}_computedOptions(){const t=this.options(),{key:e=sF}=t,{width:n,height:r,depth:i}=WB(t,this._container);return this._width=n,this._height=r,this._key=e,Object.assign(Object.assign({key:this._key},t),{width:n,height:r,depth:i})}_createCanvas(){const{width:t,height:e}=WB(this.options(),this._container);this._plugins.push(new p_),this._plugins.forEach((t=>this._renderer.registerPlugin(t))),this._context.canvas=new ov({container:this._container,width:t,height:e,renderer:this._renderer})}_addToTrailing(){var t;null===(t=this._trailingResolve)||void 0===t||t.call(this,this),this._trailing=!0;return new Promise(((t,e)=>{this._trailingResolve=t,this._trailingReject=e}))}_bindAutoFit(){const t=this.options(),{autoFit:e}=t;this._hasBindAutoFit?e||this._unbindAutoFit():e&&(this._hasBindAutoFit=!0,window.addEventListener("resize",this._onResize))}_unbindAutoFit(){this._hasBindAutoFit&&(this._hasBindAutoFit=!1,window.removeEventListener("resize",this._onResize))}}const lF=LB(cF,Object.assign({},NB()));t.AREA_CLASS_NAME=QS,t.Academy=lO,t.Bin=Ls,t.BinX=js,t.COMPONENT_CLASS_NAME=KS,t.Chart=lF,t.ChartEvent=m_,t.Classic=iO,t.ClassicDark=sO,t.Dark=oO,t.DiffY=qo,t.DodgeX=Fo,t.ELEMENT_CLASS_NAME=US,t.Filter=Ds,t.FlexX=xs,t.Group=hs,t.GroupColor=gs,t.GroupX=ds,t.GroupY=ps,t.Jitter=Ho,t.JitterX=Yo,t.JitterY=Vo,t.LABEL_CLASS_NAME=ZS,t.LABEL_LAYER_CLASS_NAME=VS,t.Light=rO,t.LinearAxis=FO,t.MAIN_LAYER_CLASS_NAME=YS,t.MASK_CLASS_NAME="mask",t.MaybeDefaultX=Co,t.MaybeDefaultY=No,t.MaybeFunctionAttribute=Io,t.MaybeGradient=Bo,t.MaybeIdentityX=Po,t.MaybeIdentityY=To,t.MaybeKey=Oo,t.MaybeSeries=So,t.MaybeSize=Mo,t.MaybeStackY=mo,t.MaybeTitle=xo,t.MaybeTooltip=Lo,t.MaybeTuple=Do,t.MaybeTupleX=_o,t.MaybeTupleY=Ao,t.MaybeVisualPosition=Ro,t.MaybeZeroPadding=jo,t.MaybeZeroX=wo,t.MaybeZeroY=ko,t.MaybeZeroY1=jn,t.MaybeZeroZ=Eo,t.NormalizeY=Go,t.PLOT_CLASS_NAME=XS,t.Pack=Ps,t.Runtime=cF,t.Sample=Is,t.Select=Jo,t.SelectX=ts,t.SelectY=es,t.Selection=om,t.SortColor=ys,t.SortX=ms,t.SortY=bs,t.StackEnter=zo,t.StackY=go,t.SymmetryY=Uo,t.VIEW_CLASS_NAME=qS,t.corelib=NB,t.dataOf=Da,t.extend=LB,t.register=function(t,e){var n,r;t.startsWith("symbol.")?(n=t.split(".").pop(),r=e,cy.set(n,r)):Object.assign(jB,{[t]:e})},t.render=aR,t.renderToMountedElement=function(t,e={},n=()=>{},r=t=>{throw t}){var i;const{width:a=640,height:o=480}=t,s=rR(t),{group:c=new Cg,emitter:l=new v_,library:u}=e;(null==c?void 0:c.parentElement)||Wa("renderToMountedElement can't render chart to unmounted group.");const f=am(c);return e.group=c,e.emitter=l,e.canvas=e.canvas||(null===(i=null==c?void 0:c.ownerDocument)||void 0===i?void 0:i.defaultView),l.emit(m_.BEFORE_RENDER),_j(Object.assign(Object.assign({},s),{width:a,height:o}),f,e).then((()=>{var t;null===(t=e.canvas)||void 0===t||t.requestAnimationFrame((()=>{l.emit(m_.AFTER_RENDER),null==n||n()}))})).catch((t=>{null==r||r(t)})),c},t.select=am,t.selectG2Elements=dR,t.selectPlotArea=vR,t.seriesOf=function(t){const e=Ia(t).__data__,{scale:n}=e;return Ba(n,t.__data__)},Object.defineProperty(t,"__esModule",{value:!0})}));